|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /home/nandedex/www/s.nandedexpress.com/ |
priority-queue.min.js 0000644 00000006466 15121363530 0010702 0 ustar 00 /*! This file is auto-generated */
(()=>{var e={5033:(e,t,n)=>{var o,r,i;r=[],void 0===(i="function"==typeof(o=function(){"use strict";var e,t,o,r,i="undefined"!=typeof window?window:null!=typeof n.g?n.g:this||{},u=i.cancelRequestAnimationFrame&&i.requestAnimationFrame||setTimeout,a=i.cancelRequestAnimationFrame||clearTimeout,c=[],l=0,s=!1,d=7,f=35,m=125,b=0,p=0,v=0,w={get didTimeout(){return!1},timeRemaining:function(){var e=d-(Date.now()-p);return e<0?0:e}},y=g((function(){d=22,m=66,f=0}));function g(e){var t,n,o=99,r=function(){var i=Date.now()-n;i<o?t=setTimeout(r,o-i):(t=null,e())};return function(){n=Date.now(),t||(t=setTimeout(r,o))}}function h(){s&&(r&&a(r),o&&clearTimeout(o),s=!1)}function k(){125!=m&&(d=7,m=125,f=35,s&&(h(),C())),y()}function T(){r=null,o=setTimeout(D,0)}function q(){o=null,u(T)}function C(){s||(t=m-(Date.now()-p),e=Date.now(),s=!0,f&&t<f&&(t=f),t>9?o=setTimeout(q,t):(t=0,q()))}function D(){var n,r,i,u=d>9?9:1;if(p=Date.now(),s=!1,o=null,l>2||p-t-50<e)for(r=0,i=c.length;r<i&&w.timeRemaining()>u;r++)n=c.shift(),v++,n&&n(w);c.length?C():l=0}function I(e){return b++,c.push(e),C(),b}function O(e){var t=e-1-v;c[t]&&(c[t]=null)}if(i.requestIdleCallback&&i.cancelIdleCallback)try{i.requestIdleCallback((function(){}),{timeout:0})}catch(e){!function(e){var t,n;if(i.requestIdleCallback=function(t,n){return n&&"number"==typeof n.timeout?e(t,n.timeout):e(t)},i.IdleCallbackDeadline&&(t=IdleCallbackDeadline.prototype)){if(!(n=Object.getOwnPropertyDescriptor(t,"timeRemaining"))||!n.configurable||!n.get)return;Object.defineProperty(t,"timeRemaining",{value:function(){return n.get.call(this)},enumerable:!0,configurable:!0})}}(i.requestIdleCallback)}else i.requestIdleCallback=I,i.cancelIdleCallback=O,i.document&&document.addEventListener&&(i.addEventListener("scroll",k,!0),i.addEventListener("resize",k),document.addEventListener("focus",k,!0),document.addEventListener("mouseover",k,!0),["click","keypress","touchstart","mousedown"].forEach((function(e){document.addEventListener(e,k,{capture:!0,passive:!0})})),i.MutationObserver&&new MutationObserver(k).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}));return{request:I,cancel:O}})?o.apply(t,r):o)||(e.exports=i)}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{createQueue:()=>t});n(5033);var e="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback;const t=()=>{const t=new Map;let n=!1;const o=r=>{for(const[e,n]of t)if(t.delete(e),n(),"number"==typeof r||r.timeRemaining()<=0)break;0!==t.size?e(o):n=!1};return{add:(r,i)=>{t.set(r,i),n||(n=!0,e(o))},flush:e=>{const n=t.get(e);return void 0!==n&&(t.delete(e),n(),!0)},cancel:e=>t.delete(e),reset:()=>{t.clear(),n=!1}}}})(),(window.wp=window.wp||{}).priorityQueue=o})(); block-editor.js 0000644 00010716575 15121363530 0007505 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 197:
/***/ (() => {
/* (ignored) */
/***/ }),
/***/ 271:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let Container = __webpack_require__(683)
let LazyResult, Processor
class Document extends Container {
constructor(defaults) {
// type needs to be passed to super, otherwise child roots won't be normalized correctly
super({ type: 'document', ...defaults })
if (!this.nodes) {
this.nodes = []
}
}
toResult(opts = {}) {
let lazy = new LazyResult(new Processor(), this, opts)
return lazy.stringify()
}
}
Document.registerLazyResult = dependant => {
LazyResult = dependant
}
Document.registerProcessor = dependant => {
Processor = dependant
}
module.exports = Document
Document.default = Document
/***/ }),
/***/ 346:
/***/ ((module) => {
"use strict";
const DEFAULT_RAW = {
after: '\n',
beforeClose: '\n',
beforeComment: '\n',
beforeDecl: '\n',
beforeOpen: ' ',
beforeRule: '\n',
colon: ': ',
commentLeft: ' ',
commentRight: ' ',
emptyBody: '',
indent: ' ',
semicolon: false
}
function capitalize(str) {
return str[0].toUpperCase() + str.slice(1)
}
class Stringifier {
constructor(builder) {
this.builder = builder
}
atrule(node, semicolon) {
let name = '@' + node.name
let params = node.params ? this.rawValue(node, 'params') : ''
if (typeof node.raws.afterName !== 'undefined') {
name += node.raws.afterName
} else if (params) {
name += ' '
}
if (node.nodes) {
this.block(node, name + params)
} else {
let end = (node.raws.between || '') + (semicolon ? ';' : '')
this.builder(name + params + end, node)
}
}
beforeAfter(node, detect) {
let value
if (node.type === 'decl') {
value = this.raw(node, null, 'beforeDecl')
} else if (node.type === 'comment') {
value = this.raw(node, null, 'beforeComment')
} else if (detect === 'before') {
value = this.raw(node, null, 'beforeRule')
} else {
value = this.raw(node, null, 'beforeClose')
}
let buf = node.parent
let depth = 0
while (buf && buf.type !== 'root') {
depth += 1
buf = buf.parent
}
if (value.includes('\n')) {
let indent = this.raw(node, null, 'indent')
if (indent.length) {
for (let step = 0; step < depth; step++) value += indent
}
}
return value
}
block(node, start) {
let between = this.raw(node, 'between', 'beforeOpen')
this.builder(start + between + '{', node, 'start')
let after
if (node.nodes && node.nodes.length) {
this.body(node)
after = this.raw(node, 'after')
} else {
after = this.raw(node, 'after', 'emptyBody')
}
if (after) this.builder(after)
this.builder('}', node, 'end')
}
body(node) {
let last = node.nodes.length - 1
while (last > 0) {
if (node.nodes[last].type !== 'comment') break
last -= 1
}
let semicolon = this.raw(node, 'semicolon')
for (let i = 0; i < node.nodes.length; i++) {
let child = node.nodes[i]
let before = this.raw(child, 'before')
if (before) this.builder(before)
this.stringify(child, last !== i || semicolon)
}
}
comment(node) {
let left = this.raw(node, 'left', 'commentLeft')
let right = this.raw(node, 'right', 'commentRight')
this.builder('/*' + left + node.text + right + '*/', node)
}
decl(node, semicolon) {
let between = this.raw(node, 'between', 'colon')
let string = node.prop + between + this.rawValue(node, 'value')
if (node.important) {
string += node.raws.important || ' !important'
}
if (semicolon) string += ';'
this.builder(string, node)
}
document(node) {
this.body(node)
}
raw(node, own, detect) {
let value
if (!detect) detect = own
// Already had
if (own) {
value = node.raws[own]
if (typeof value !== 'undefined') return value
}
let parent = node.parent
if (detect === 'before') {
// Hack for first rule in CSS
if (!parent || (parent.type === 'root' && parent.first === node)) {
return ''
}
// `root` nodes in `document` should use only their own raws
if (parent && parent.type === 'document') {
return ''
}
}
// Floating child without parent
if (!parent) return DEFAULT_RAW[detect]
// Detect style by other nodes
let root = node.root()
if (!root.rawCache) root.rawCache = {}
if (typeof root.rawCache[detect] !== 'undefined') {
return root.rawCache[detect]
}
if (detect === 'before' || detect === 'after') {
return this.beforeAfter(node, detect)
} else {
let method = 'raw' + capitalize(detect)
if (this[method]) {
value = this[method](root, node)
} else {
root.walk(i => {
value = i.raws[own]
if (typeof value !== 'undefined') return false
})
}
}
if (typeof value === 'undefined') value = DEFAULT_RAW[detect]
root.rawCache[detect] = value
return value
}
rawBeforeClose(root) {
let value
root.walk(i => {
if (i.nodes && i.nodes.length > 0) {
if (typeof i.raws.after !== 'undefined') {
value = i.raws.after
if (value.includes('\n')) {
value = value.replace(/[^\n]+$/, '')
}
return false
}
}
})
if (value) value = value.replace(/\S/g, '')
return value
}
rawBeforeComment(root, node) {
let value
root.walkComments(i => {
if (typeof i.raws.before !== 'undefined') {
value = i.raws.before
if (value.includes('\n')) {
value = value.replace(/[^\n]+$/, '')
}
return false
}
})
if (typeof value === 'undefined') {
value = this.raw(node, null, 'beforeDecl')
} else if (value) {
value = value.replace(/\S/g, '')
}
return value
}
rawBeforeDecl(root, node) {
let value
root.walkDecls(i => {
if (typeof i.raws.before !== 'undefined') {
value = i.raws.before
if (value.includes('\n')) {
value = value.replace(/[^\n]+$/, '')
}
return false
}
})
if (typeof value === 'undefined') {
value = this.raw(node, null, 'beforeRule')
} else if (value) {
value = value.replace(/\S/g, '')
}
return value
}
rawBeforeOpen(root) {
let value
root.walk(i => {
if (i.type !== 'decl') {
value = i.raws.between
if (typeof value !== 'undefined') return false
}
})
return value
}
rawBeforeRule(root) {
let value
root.walk(i => {
if (i.nodes && (i.parent !== root || root.first !== i)) {
if (typeof i.raws.before !== 'undefined') {
value = i.raws.before
if (value.includes('\n')) {
value = value.replace(/[^\n]+$/, '')
}
return false
}
}
})
if (value) value = value.replace(/\S/g, '')
return value
}
rawColon(root) {
let value
root.walkDecls(i => {
if (typeof i.raws.between !== 'undefined') {
value = i.raws.between.replace(/[^\s:]/g, '')
return false
}
})
return value
}
rawEmptyBody(root) {
let value
root.walk(i => {
if (i.nodes && i.nodes.length === 0) {
value = i.raws.after
if (typeof value !== 'undefined') return false
}
})
return value
}
rawIndent(root) {
if (root.raws.indent) return root.raws.indent
let value
root.walk(i => {
let p = i.parent
if (p && p !== root && p.parent && p.parent === root) {
if (typeof i.raws.before !== 'undefined') {
let parts = i.raws.before.split('\n')
value = parts[parts.length - 1]
value = value.replace(/\S/g, '')
return false
}
}
})
return value
}
rawSemicolon(root) {
let value
root.walk(i => {
if (i.nodes && i.nodes.length && i.last.type === 'decl') {
value = i.raws.semicolon
if (typeof value !== 'undefined') return false
}
})
return value
}
rawValue(node, prop) {
let value = node[prop]
let raw = node.raws[prop]
if (raw && raw.value === value) {
return raw.raw
}
return value
}
root(node) {
this.body(node)
if (node.raws.after) this.builder(node.raws.after)
}
rule(node) {
this.block(node, this.rawValue(node, 'selector'))
if (node.raws.ownSemicolon) {
this.builder(node.raws.ownSemicolon, node, 'end')
}
}
stringify(node, semicolon) {
/* c8 ignore start */
if (!this[node.type]) {
throw new Error(
'Unknown AST node type ' +
node.type +
'. ' +
'Maybe you need to change PostCSS stringifier.'
)
}
/* c8 ignore stop */
this[node.type](node, semicolon)
}
}
module.exports = Stringifier
Stringifier.default = Stringifier
/***/ }),
/***/ 356:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let pico = __webpack_require__(2775)
let terminalHighlight = __webpack_require__(9746)
class CssSyntaxError extends Error {
constructor(message, line, column, source, file, plugin) {
super(message)
this.name = 'CssSyntaxError'
this.reason = message
if (file) {
this.file = file
}
if (source) {
this.source = source
}
if (plugin) {
this.plugin = plugin
}
if (typeof line !== 'undefined' && typeof column !== 'undefined') {
if (typeof line === 'number') {
this.line = line
this.column = column
} else {
this.line = line.line
this.column = line.column
this.endLine = column.line
this.endColumn = column.column
}
}
this.setMessage()
if (Error.captureStackTrace) {
Error.captureStackTrace(this, CssSyntaxError)
}
}
setMessage() {
this.message = this.plugin ? this.plugin + ': ' : ''
this.message += this.file ? this.file : '<css input>'
if (typeof this.line !== 'undefined') {
this.message += ':' + this.line + ':' + this.column
}
this.message += ': ' + this.reason
}
showSourceCode(color) {
if (!this.source) return ''
let css = this.source
if (color == null) color = pico.isColorSupported
let aside = text => text
let mark = text => text
let highlight = text => text
if (color) {
let { bold, gray, red } = pico.createColors(true)
mark = text => bold(red(text))
aside = text => gray(text)
if (terminalHighlight) {
highlight = text => terminalHighlight(text)
}
}
let lines = css.split(/\r?\n/)
let start = Math.max(this.line - 3, 0)
let end = Math.min(this.line + 2, lines.length)
let maxWidth = String(end).length
return lines
.slice(start, end)
.map((line, index) => {
let number = start + 1 + index
let gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | '
if (number === this.line) {
if (line.length > 160) {
let padding = 20
let subLineStart = Math.max(0, this.column - padding)
let subLineEnd = Math.max(
this.column + padding,
this.endColumn + padding
)
let subLine = line.slice(subLineStart, subLineEnd)
let spacing =
aside(gutter.replace(/\d/g, ' ')) +
line
.slice(0, Math.min(this.column - 1, padding - 1))
.replace(/[^\t]/g, ' ')
return (
mark('>') +
aside(gutter) +
highlight(subLine) +
'\n ' +
spacing +
mark('^')
)
}
let spacing =
aside(gutter.replace(/\d/g, ' ')) +
line.slice(0, this.column - 1).replace(/[^\t]/g, ' ')
return (
mark('>') +
aside(gutter) +
highlight(line) +
'\n ' +
spacing +
mark('^')
)
}
return ' ' + aside(gutter) + highlight(line)
})
.join('\n')
}
toString() {
let code = this.showSourceCode()
if (code) {
code = '\n\n' + code + '\n'
}
return this.name + ': ' + this.message + code
}
}
module.exports = CssSyntaxError
CssSyntaxError.default = CssSyntaxError
/***/ }),
/***/ 448:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let Container = __webpack_require__(683)
let Document = __webpack_require__(271)
let MapGenerator = __webpack_require__(1670)
let parse = __webpack_require__(4295)
let Result = __webpack_require__(9055)
let Root = __webpack_require__(9434)
let stringify = __webpack_require__(633)
let { isClean, my } = __webpack_require__(1381)
let warnOnce = __webpack_require__(3122)
const TYPE_TO_CLASS_NAME = {
atrule: 'AtRule',
comment: 'Comment',
decl: 'Declaration',
document: 'Document',
root: 'Root',
rule: 'Rule'
}
const PLUGIN_PROPS = {
AtRule: true,
AtRuleExit: true,
Comment: true,
CommentExit: true,
Declaration: true,
DeclarationExit: true,
Document: true,
DocumentExit: true,
Once: true,
OnceExit: true,
postcssPlugin: true,
prepare: true,
Root: true,
RootExit: true,
Rule: true,
RuleExit: true
}
const NOT_VISITORS = {
Once: true,
postcssPlugin: true,
prepare: true
}
const CHILDREN = 0
function isPromise(obj) {
return typeof obj === 'object' && typeof obj.then === 'function'
}
function getEvents(node) {
let key = false
let type = TYPE_TO_CLASS_NAME[node.type]
if (node.type === 'decl') {
key = node.prop.toLowerCase()
} else if (node.type === 'atrule') {
key = node.name.toLowerCase()
}
if (key && node.append) {
return [
type,
type + '-' + key,
CHILDREN,
type + 'Exit',
type + 'Exit-' + key
]
} else if (key) {
return [type, type + '-' + key, type + 'Exit', type + 'Exit-' + key]
} else if (node.append) {
return [type, CHILDREN, type + 'Exit']
} else {
return [type, type + 'Exit']
}
}
function toStack(node) {
let events
if (node.type === 'document') {
events = ['Document', CHILDREN, 'DocumentExit']
} else if (node.type === 'root') {
events = ['Root', CHILDREN, 'RootExit']
} else {
events = getEvents(node)
}
return {
eventIndex: 0,
events,
iterator: 0,
node,
visitorIndex: 0,
visitors: []
}
}
function cleanMarks(node) {
node[isClean] = false
if (node.nodes) node.nodes.forEach(i => cleanMarks(i))
return node
}
let postcss = {}
class LazyResult {
get content() {
return this.stringify().content
}
get css() {
return this.stringify().css
}
get map() {
return this.stringify().map
}
get messages() {
return this.sync().messages
}
get opts() {
return this.result.opts
}
get processor() {
return this.result.processor
}
get root() {
return this.sync().root
}
get [Symbol.toStringTag]() {
return 'LazyResult'
}
constructor(processor, css, opts) {
this.stringified = false
this.processed = false
let root
if (
typeof css === 'object' &&
css !== null &&
(css.type === 'root' || css.type === 'document')
) {
root = cleanMarks(css)
} else if (css instanceof LazyResult || css instanceof Result) {
root = cleanMarks(css.root)
if (css.map) {
if (typeof opts.map === 'undefined') opts.map = {}
if (!opts.map.inline) opts.map.inline = false
opts.map.prev = css.map
}
} else {
let parser = parse
if (opts.syntax) parser = opts.syntax.parse
if (opts.parser) parser = opts.parser
if (parser.parse) parser = parser.parse
try {
root = parser(css, opts)
} catch (error) {
this.processed = true
this.error = error
}
if (root && !root[my]) {
/* c8 ignore next 2 */
Container.rebuild(root)
}
}
this.result = new Result(processor, root, opts)
this.helpers = { ...postcss, postcss, result: this.result }
this.plugins = this.processor.plugins.map(plugin => {
if (typeof plugin === 'object' && plugin.prepare) {
return { ...plugin, ...plugin.prepare(this.result) }
} else {
return plugin
}
})
}
async() {
if (this.error) return Promise.reject(this.error)
if (this.processed) return Promise.resolve(this.result)
if (!this.processing) {
this.processing = this.runAsync()
}
return this.processing
}
catch(onRejected) {
return this.async().catch(onRejected)
}
finally(onFinally) {
return this.async().then(onFinally, onFinally)
}
getAsyncError() {
throw new Error('Use process(css).then(cb) to work with async plugins')
}
handleError(error, node) {
let plugin = this.result.lastPlugin
try {
if (node) node.addToError(error)
this.error = error
if (error.name === 'CssSyntaxError' && !error.plugin) {
error.plugin = plugin.postcssPlugin
error.setMessage()
} else if (plugin.postcssVersion) {
if (false) {}
}
} catch (err) {
/* c8 ignore next 3 */
// eslint-disable-next-line no-console
if (console && console.error) console.error(err)
}
return error
}
prepareVisitors() {
this.listeners = {}
let add = (plugin, type, cb) => {
if (!this.listeners[type]) this.listeners[type] = []
this.listeners[type].push([plugin, cb])
}
for (let plugin of this.plugins) {
if (typeof plugin === 'object') {
for (let event in plugin) {
if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) {
throw new Error(
`Unknown event ${event} in ${plugin.postcssPlugin}. ` +
`Try to update PostCSS (${this.processor.version} now).`
)
}
if (!NOT_VISITORS[event]) {
if (typeof plugin[event] === 'object') {
for (let filter in plugin[event]) {
if (filter === '*') {
add(plugin, event, plugin[event][filter])
} else {
add(
plugin,
event + '-' + filter.toLowerCase(),
plugin[event][filter]
)
}
}
} else if (typeof plugin[event] === 'function') {
add(plugin, event, plugin[event])
}
}
}
}
}
this.hasListener = Object.keys(this.listeners).length > 0
}
async runAsync() {
this.plugin = 0
for (let i = 0; i < this.plugins.length; i++) {
let plugin = this.plugins[i]
let promise = this.runOnRoot(plugin)
if (isPromise(promise)) {
try {
await promise
} catch (error) {
throw this.handleError(error)
}
}
}
this.prepareVisitors()
if (this.hasListener) {
let root = this.result.root
while (!root[isClean]) {
root[isClean] = true
let stack = [toStack(root)]
while (stack.length > 0) {
let promise = this.visitTick(stack)
if (isPromise(promise)) {
try {
await promise
} catch (e) {
let node = stack[stack.length - 1].node
throw this.handleError(e, node)
}
}
}
}
if (this.listeners.OnceExit) {
for (let [plugin, visitor] of this.listeners.OnceExit) {
this.result.lastPlugin = plugin
try {
if (root.type === 'document') {
let roots = root.nodes.map(subRoot =>
visitor(subRoot, this.helpers)
)
await Promise.all(roots)
} else {
await visitor(root, this.helpers)
}
} catch (e) {
throw this.handleError(e)
}
}
}
}
this.processed = true
return this.stringify()
}
runOnRoot(plugin) {
this.result.lastPlugin = plugin
try {
if (typeof plugin === 'object' && plugin.Once) {
if (this.result.root.type === 'document') {
let roots = this.result.root.nodes.map(root =>
plugin.Once(root, this.helpers)
)
if (isPromise(roots[0])) {
return Promise.all(roots)
}
return roots
}
return plugin.Once(this.result.root, this.helpers)
} else if (typeof plugin === 'function') {
return plugin(this.result.root, this.result)
}
} catch (error) {
throw this.handleError(error)
}
}
stringify() {
if (this.error) throw this.error
if (this.stringified) return this.result
this.stringified = true
this.sync()
let opts = this.result.opts
let str = stringify
if (opts.syntax) str = opts.syntax.stringify
if (opts.stringifier) str = opts.stringifier
if (str.stringify) str = str.stringify
let map = new MapGenerator(str, this.result.root, this.result.opts)
let data = map.generate()
this.result.css = data[0]
this.result.map = data[1]
return this.result
}
sync() {
if (this.error) throw this.error
if (this.processed) return this.result
this.processed = true
if (this.processing) {
throw this.getAsyncError()
}
for (let plugin of this.plugins) {
let promise = this.runOnRoot(plugin)
if (isPromise(promise)) {
throw this.getAsyncError()
}
}
this.prepareVisitors()
if (this.hasListener) {
let root = this.result.root
while (!root[isClean]) {
root[isClean] = true
this.walkSync(root)
}
if (this.listeners.OnceExit) {
if (root.type === 'document') {
for (let subRoot of root.nodes) {
this.visitSync(this.listeners.OnceExit, subRoot)
}
} else {
this.visitSync(this.listeners.OnceExit, root)
}
}
}
return this.result
}
then(onFulfilled, onRejected) {
if (false) {}
return this.async().then(onFulfilled, onRejected)
}
toString() {
return this.css
}
visitSync(visitors, node) {
for (let [plugin, visitor] of visitors) {
this.result.lastPlugin = plugin
let promise
try {
promise = visitor(node, this.helpers)
} catch (e) {
throw this.handleError(e, node.proxyOf)
}
if (node.type !== 'root' && node.type !== 'document' && !node.parent) {
return true
}
if (isPromise(promise)) {
throw this.getAsyncError()
}
}
}
visitTick(stack) {
let visit = stack[stack.length - 1]
let { node, visitors } = visit
if (node.type !== 'root' && node.type !== 'document' && !node.parent) {
stack.pop()
return
}
if (visitors.length > 0 && visit.visitorIndex < visitors.length) {
let [plugin, visitor] = visitors[visit.visitorIndex]
visit.visitorIndex += 1
if (visit.visitorIndex === visitors.length) {
visit.visitors = []
visit.visitorIndex = 0
}
this.result.lastPlugin = plugin
try {
return visitor(node.toProxy(), this.helpers)
} catch (e) {
throw this.handleError(e, node)
}
}
if (visit.iterator !== 0) {
let iterator = visit.iterator
let child
while ((child = node.nodes[node.indexes[iterator]])) {
node.indexes[iterator] += 1
if (!child[isClean]) {
child[isClean] = true
stack.push(toStack(child))
return
}
}
visit.iterator = 0
delete node.indexes[iterator]
}
let events = visit.events
while (visit.eventIndex < events.length) {
let event = events[visit.eventIndex]
visit.eventIndex += 1
if (event === CHILDREN) {
if (node.nodes && node.nodes.length) {
node[isClean] = true
visit.iterator = node.getIterator()
}
return
} else if (this.listeners[event]) {
visit.visitors = this.listeners[event]
return
}
}
stack.pop()
}
walkSync(node) {
node[isClean] = true
let events = getEvents(node)
for (let event of events) {
if (event === CHILDREN) {
if (node.nodes) {
node.each(child => {
if (!child[isClean]) this.walkSync(child)
})
}
} else {
let visitors = this.listeners[event]
if (visitors) {
if (this.visitSync(visitors, node.toProxy())) return
}
}
}
}
warnings() {
return this.sync().warnings()
}
}
LazyResult.registerPostcss = dependant => {
postcss = dependant
}
module.exports = LazyResult
LazyResult.default = LazyResult
Root.registerLazyResult(LazyResult)
Document.registerLazyResult(LazyResult)
/***/ }),
/***/ 461:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
// Load in dependencies
var computedStyle = __webpack_require__(6109);
/**
* Calculate the `line-height` of a given node
* @param {HTMLElement} node Element to calculate line height of. Must be in the DOM.
* @returns {Number} `line-height` of the element in pixels
*/
function lineHeight(node) {
// Grab the line-height via style
var lnHeightStr = computedStyle(node, 'line-height');
var lnHeight = parseFloat(lnHeightStr, 10);
// If the lineHeight did not contain a unit (i.e. it was numeric), convert it to ems (e.g. '2.3' === '2.3em')
if (lnHeightStr === lnHeight + '') {
// Save the old lineHeight style and update the em unit to the element
var _lnHeightStyle = node.style.lineHeight;
node.style.lineHeight = lnHeightStr + 'em';
// Calculate the em based height
lnHeightStr = computedStyle(node, 'line-height');
lnHeight = parseFloat(lnHeightStr, 10);
// Revert the lineHeight style
if (_lnHeightStyle) {
node.style.lineHeight = _lnHeightStyle;
} else {
delete node.style.lineHeight;
}
}
// If the lineHeight is in `pt`, convert it to pixels (4px for 3pt)
// DEV: `em` units are converted to `pt` in IE6
// Conversion ratio from https://developer.mozilla.org/en-US/docs/Web/CSS/length
if (lnHeightStr.indexOf('pt') !== -1) {
lnHeight *= 4;
lnHeight /= 3;
// Otherwise, if the lineHeight is in `mm`, convert it to pixels (96px for 25.4mm)
} else if (lnHeightStr.indexOf('mm') !== -1) {
lnHeight *= 96;
lnHeight /= 25.4;
// Otherwise, if the lineHeight is in `cm`, convert it to pixels (96px for 2.54cm)
} else if (lnHeightStr.indexOf('cm') !== -1) {
lnHeight *= 96;
lnHeight /= 2.54;
// Otherwise, if the lineHeight is in `in`, convert it to pixels (96px for 1in)
} else if (lnHeightStr.indexOf('in') !== -1) {
lnHeight *= 96;
// Otherwise, if the lineHeight is in `pc`, convert it to pixels (12pt for 1pc)
} else if (lnHeightStr.indexOf('pc') !== -1) {
lnHeight *= 16;
}
// Continue our computation
lnHeight = Math.round(lnHeight);
// If the line-height is "normal", calculate by font-size
if (lnHeightStr === 'normal') {
// Create a temporary node
var nodeName = node.nodeName;
var _node = document.createElement(nodeName);
_node.innerHTML = ' ';
// If we have a text area, reset it to only 1 row
// https://github.com/twolfson/line-height/issues/4
if (nodeName.toUpperCase() === 'TEXTAREA') {
_node.setAttribute('rows', '1');
}
// Set the font-size of the element
var fontSizeStr = computedStyle(node, 'font-size');
_node.style.fontSize = fontSizeStr;
// Remove default padding/border which can affect offset height
// https://github.com/twolfson/line-height/issues/4
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight
_node.style.padding = '0px';
_node.style.border = '0px';
// Append it to the body
var body = document.body;
body.appendChild(_node);
// Assume the line height of the element is the height
var height = _node.offsetHeight;
lnHeight = height;
// Remove our child from the DOM
body.removeChild(_node);
}
// Return the calculated height
return lnHeight;
}
// Export lineHeight
module.exports = lineHeight;
/***/ }),
/***/ 628:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var ReactPropTypesSecret = __webpack_require__(4067);
function emptyFunction() {}
function emptyFunctionWithReset() {}
emptyFunctionWithReset.resetWarningCache = emptyFunction;
module.exports = function() {
function shim(props, propName, componentName, location, propFullName, secret) {
if (secret === ReactPropTypesSecret) {
// It is still safe when called from React.
return;
}
var err = new Error(
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use PropTypes.checkPropTypes() to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
err.name = 'Invariant Violation';
throw err;
};
shim.isRequired = shim;
function getShim() {
return shim;
};
// Important!
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
var ReactPropTypes = {
array: shim,
bigint: shim,
bool: shim,
func: shim,
number: shim,
object: shim,
string: shim,
symbol: shim,
any: shim,
arrayOf: getShim,
element: shim,
elementType: shim,
instanceOf: getShim,
node: shim,
objectOf: getShim,
oneOf: getShim,
oneOfType: getShim,
shape: getShim,
exact: getShim,
checkPropTypes: emptyFunctionWithReset,
resetWarningCache: emptyFunction
};
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
/***/ }),
/***/ 633:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let Stringifier = __webpack_require__(346)
function stringify(node, builder) {
let str = new Stringifier(builder)
str.stringify(node)
}
module.exports = stringify
stringify.default = stringify
/***/ }),
/***/ 683:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let Comment = __webpack_require__(6589)
let Declaration = __webpack_require__(1516)
let Node = __webpack_require__(7490)
let { isClean, my } = __webpack_require__(1381)
let AtRule, parse, Root, Rule
function cleanSource(nodes) {
return nodes.map(i => {
if (i.nodes) i.nodes = cleanSource(i.nodes)
delete i.source
return i
})
}
function markTreeDirty(node) {
node[isClean] = false
if (node.proxyOf.nodes) {
for (let i of node.proxyOf.nodes) {
markTreeDirty(i)
}
}
}
class Container extends Node {
get first() {
if (!this.proxyOf.nodes) return undefined
return this.proxyOf.nodes[0]
}
get last() {
if (!this.proxyOf.nodes) return undefined
return this.proxyOf.nodes[this.proxyOf.nodes.length - 1]
}
append(...children) {
for (let child of children) {
let nodes = this.normalize(child, this.last)
for (let node of nodes) this.proxyOf.nodes.push(node)
}
this.markDirty()
return this
}
cleanRaws(keepBetween) {
super.cleanRaws(keepBetween)
if (this.nodes) {
for (let node of this.nodes) node.cleanRaws(keepBetween)
}
}
each(callback) {
if (!this.proxyOf.nodes) return undefined
let iterator = this.getIterator()
let index, result
while (this.indexes[iterator] < this.proxyOf.nodes.length) {
index = this.indexes[iterator]
result = callback(this.proxyOf.nodes[index], index)
if (result === false) break
this.indexes[iterator] += 1
}
delete this.indexes[iterator]
return result
}
every(condition) {
return this.nodes.every(condition)
}
getIterator() {
if (!this.lastEach) this.lastEach = 0
if (!this.indexes) this.indexes = {}
this.lastEach += 1
let iterator = this.lastEach
this.indexes[iterator] = 0
return iterator
}
getProxyProcessor() {
return {
get(node, prop) {
if (prop === 'proxyOf') {
return node
} else if (!node[prop]) {
return node[prop]
} else if (
prop === 'each' ||
(typeof prop === 'string' && prop.startsWith('walk'))
) {
return (...args) => {
return node[prop](
...args.map(i => {
if (typeof i === 'function') {
return (child, index) => i(child.toProxy(), index)
} else {
return i
}
})
)
}
} else if (prop === 'every' || prop === 'some') {
return cb => {
return node[prop]((child, ...other) =>
cb(child.toProxy(), ...other)
)
}
} else if (prop === 'root') {
return () => node.root().toProxy()
} else if (prop === 'nodes') {
return node.nodes.map(i => i.toProxy())
} else if (prop === 'first' || prop === 'last') {
return node[prop].toProxy()
} else {
return node[prop]
}
},
set(node, prop, value) {
if (node[prop] === value) return true
node[prop] = value
if (prop === 'name' || prop === 'params' || prop === 'selector') {
node.markDirty()
}
return true
}
}
}
index(child) {
if (typeof child === 'number') return child
if (child.proxyOf) child = child.proxyOf
return this.proxyOf.nodes.indexOf(child)
}
insertAfter(exist, add) {
let existIndex = this.index(exist)
let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse()
existIndex = this.index(exist)
for (let node of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node)
let index
for (let id in this.indexes) {
index = this.indexes[id]
if (existIndex < index) {
this.indexes[id] = index + nodes.length
}
}
this.markDirty()
return this
}
insertBefore(exist, add) {
let existIndex = this.index(exist)
let type = existIndex === 0 ? 'prepend' : false
let nodes = this.normalize(
add,
this.proxyOf.nodes[existIndex],
type
).reverse()
existIndex = this.index(exist)
for (let node of nodes) this.proxyOf.nodes.splice(existIndex, 0, node)
let index
for (let id in this.indexes) {
index = this.indexes[id]
if (existIndex <= index) {
this.indexes[id] = index + nodes.length
}
}
this.markDirty()
return this
}
normalize(nodes, sample) {
if (typeof nodes === 'string') {
nodes = cleanSource(parse(nodes).nodes)
} else if (typeof nodes === 'undefined') {
nodes = []
} else if (Array.isArray(nodes)) {
nodes = nodes.slice(0)
for (let i of nodes) {
if (i.parent) i.parent.removeChild(i, 'ignore')
}
} else if (nodes.type === 'root' && this.type !== 'document') {
nodes = nodes.nodes.slice(0)
for (let i of nodes) {
if (i.parent) i.parent.removeChild(i, 'ignore')
}
} else if (nodes.type) {
nodes = [nodes]
} else if (nodes.prop) {
if (typeof nodes.value === 'undefined') {
throw new Error('Value field is missed in node creation')
} else if (typeof nodes.value !== 'string') {
nodes.value = String(nodes.value)
}
nodes = [new Declaration(nodes)]
} else if (nodes.selector || nodes.selectors) {
nodes = [new Rule(nodes)]
} else if (nodes.name) {
nodes = [new AtRule(nodes)]
} else if (nodes.text) {
nodes = [new Comment(nodes)]
} else {
throw new Error('Unknown node type in node creation')
}
let processed = nodes.map(i => {
/* c8 ignore next */
if (!i[my]) Container.rebuild(i)
i = i.proxyOf
if (i.parent) i.parent.removeChild(i)
if (i[isClean]) markTreeDirty(i)
if (!i.raws) i.raws = {}
if (typeof i.raws.before === 'undefined') {
if (sample && typeof sample.raws.before !== 'undefined') {
i.raws.before = sample.raws.before.replace(/\S/g, '')
}
}
i.parent = this.proxyOf
return i
})
return processed
}
prepend(...children) {
children = children.reverse()
for (let child of children) {
let nodes = this.normalize(child, this.first, 'prepend').reverse()
for (let node of nodes) this.proxyOf.nodes.unshift(node)
for (let id in this.indexes) {
this.indexes[id] = this.indexes[id] + nodes.length
}
}
this.markDirty()
return this
}
push(child) {
child.parent = this
this.proxyOf.nodes.push(child)
return this
}
removeAll() {
for (let node of this.proxyOf.nodes) node.parent = undefined
this.proxyOf.nodes = []
this.markDirty()
return this
}
removeChild(child) {
child = this.index(child)
this.proxyOf.nodes[child].parent = undefined
this.proxyOf.nodes.splice(child, 1)
let index
for (let id in this.indexes) {
index = this.indexes[id]
if (index >= child) {
this.indexes[id] = index - 1
}
}
this.markDirty()
return this
}
replaceValues(pattern, opts, callback) {
if (!callback) {
callback = opts
opts = {}
}
this.walkDecls(decl => {
if (opts.props && !opts.props.includes(decl.prop)) return
if (opts.fast && !decl.value.includes(opts.fast)) return
decl.value = decl.value.replace(pattern, callback)
})
this.markDirty()
return this
}
some(condition) {
return this.nodes.some(condition)
}
walk(callback) {
return this.each((child, i) => {
let result
try {
result = callback(child, i)
} catch (e) {
throw child.addToError(e)
}
if (result !== false && child.walk) {
result = child.walk(callback)
}
return result
})
}
walkAtRules(name, callback) {
if (!callback) {
callback = name
return this.walk((child, i) => {
if (child.type === 'atrule') {
return callback(child, i)
}
})
}
if (name instanceof RegExp) {
return this.walk((child, i) => {
if (child.type === 'atrule' && name.test(child.name)) {
return callback(child, i)
}
})
}
return this.walk((child, i) => {
if (child.type === 'atrule' && child.name === name) {
return callback(child, i)
}
})
}
walkComments(callback) {
return this.walk((child, i) => {
if (child.type === 'comment') {
return callback(child, i)
}
})
}
walkDecls(prop, callback) {
if (!callback) {
callback = prop
return this.walk((child, i) => {
if (child.type === 'decl') {
return callback(child, i)
}
})
}
if (prop instanceof RegExp) {
return this.walk((child, i) => {
if (child.type === 'decl' && prop.test(child.prop)) {
return callback(child, i)
}
})
}
return this.walk((child, i) => {
if (child.type === 'decl' && child.prop === prop) {
return callback(child, i)
}
})
}
walkRules(selector, callback) {
if (!callback) {
callback = selector
return this.walk((child, i) => {
if (child.type === 'rule') {
return callback(child, i)
}
})
}
if (selector instanceof RegExp) {
return this.walk((child, i) => {
if (child.type === 'rule' && selector.test(child.selector)) {
return callback(child, i)
}
})
}
return this.walk((child, i) => {
if (child.type === 'rule' && child.selector === selector) {
return callback(child, i)
}
})
}
}
Container.registerParse = dependant => {
parse = dependant
}
Container.registerRule = dependant => {
Rule = dependant
}
Container.registerAtRule = dependant => {
AtRule = dependant
}
Container.registerRoot = dependant => {
Root = dependant
}
module.exports = Container
Container.default = Container
/* c8 ignore start */
Container.rebuild = node => {
if (node.type === 'atrule') {
Object.setPrototypeOf(node, AtRule.prototype)
} else if (node.type === 'rule') {
Object.setPrototypeOf(node, Rule.prototype)
} else if (node.type === 'decl') {
Object.setPrototypeOf(node, Declaration.prototype)
} else if (node.type === 'comment') {
Object.setPrototypeOf(node, Comment.prototype)
} else if (node.type === 'root') {
Object.setPrototypeOf(node, Root.prototype)
}
node[my] = true
if (node.nodes) {
node.nodes.forEach(child => {
Container.rebuild(child)
})
}
}
/* c8 ignore stop */
/***/ }),
/***/ 1087:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule isEventSupported
*/
var ExecutionEnvironment = __webpack_require__(8202);
var useHasFeature;
if (ExecutionEnvironment.canUseDOM) {
useHasFeature =
document.implementation &&
document.implementation.hasFeature &&
// always returns true in newer browsers as per the standard.
// @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
document.implementation.hasFeature('', '') !== true;
}
/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/
function isEventSupported(eventNameSuffix, capture) {
if (!ExecutionEnvironment.canUseDOM ||
capture && !('addEventListener' in document)) {
return false;
}
var eventName = 'on' + eventNameSuffix;
var isSupported = eventName in document;
if (!isSupported) {
var element = document.createElement('div');
element.setAttribute(eventName, 'return;');
isSupported = typeof element[eventName] === 'function';
}
if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
// This is the only way to test support for the `wheel` event in IE9+.
isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
}
return isSupported;
}
module.exports = isEventSupported;
/***/ }),
/***/ 1326:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let Container = __webpack_require__(683)
class AtRule extends Container {
constructor(defaults) {
super(defaults)
this.type = 'atrule'
}
append(...children) {
if (!this.proxyOf.nodes) this.nodes = []
return super.append(...children)
}
prepend(...children) {
if (!this.proxyOf.nodes) this.nodes = []
return super.prepend(...children)
}
}
module.exports = AtRule
AtRule.default = AtRule
Container.registerAtRule(AtRule)
/***/ }),
/***/ 1381:
/***/ ((module) => {
"use strict";
module.exports.isClean = Symbol('isClean')
module.exports.my = Symbol('my')
/***/ }),
/***/ 1443:
/***/ ((module) => {
module.exports = function postcssPrefixSelector(options) {
const prefix = options.prefix;
const prefixWithSpace = /\s+$/.test(prefix) ? prefix : `${prefix} `;
const ignoreFiles = options.ignoreFiles ? [].concat(options.ignoreFiles) : [];
const includeFiles = options.includeFiles
? [].concat(options.includeFiles)
: [];
return function (root) {
if (
ignoreFiles.length &&
root.source.input.file &&
isFileInArray(root.source.input.file, ignoreFiles)
) {
return;
}
if (
includeFiles.length &&
root.source.input.file &&
!isFileInArray(root.source.input.file, includeFiles)
) {
return;
}
root.walkRules((rule) => {
const keyframeRules = [
'keyframes',
'-webkit-keyframes',
'-moz-keyframes',
'-o-keyframes',
'-ms-keyframes',
];
if (rule.parent && keyframeRules.includes(rule.parent.name)) {
return;
}
rule.selectors = rule.selectors.map((selector) => {
if (options.exclude && excludeSelector(selector, options.exclude)) {
return selector;
}
if (options.transform) {
return options.transform(
prefix,
selector,
prefixWithSpace + selector,
root.source.input.file,
rule
);
}
return prefixWithSpace + selector;
});
});
};
};
function isFileInArray(file, arr) {
return arr.some((ruleOrString) => {
if (ruleOrString instanceof RegExp) {
return ruleOrString.test(file);
}
return file.includes(ruleOrString);
});
}
function excludeSelector(selector, excludeArr) {
return excludeArr.some((excludeRule) => {
if (excludeRule instanceof RegExp) {
return excludeRule.test(selector);
}
return selector === excludeRule;
});
}
/***/ }),
/***/ 1516:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let Node = __webpack_require__(7490)
class Declaration extends Node {
get variable() {
return this.prop.startsWith('--') || this.prop[0] === '$'
}
constructor(defaults) {
if (
defaults &&
typeof defaults.value !== 'undefined' &&
typeof defaults.value !== 'string'
) {
defaults = { ...defaults, value: String(defaults.value) }
}
super(defaults)
this.type = 'decl'
}
}
module.exports = Declaration
Declaration.default = Declaration
/***/ }),
/***/ 1524:
/***/ ((module) => {
var minus = "-".charCodeAt(0);
var plus = "+".charCodeAt(0);
var dot = ".".charCodeAt(0);
var exp = "e".charCodeAt(0);
var EXP = "E".charCodeAt(0);
// Check if three code points would start a number
// https://www.w3.org/TR/css-syntax-3/#starts-with-a-number
function likeNumber(value) {
var code = value.charCodeAt(0);
var nextCode;
if (code === plus || code === minus) {
nextCode = value.charCodeAt(1);
if (nextCode >= 48 && nextCode <= 57) {
return true;
}
var nextNextCode = value.charCodeAt(2);
if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) {
return true;
}
return false;
}
if (code === dot) {
nextCode = value.charCodeAt(1);
if (nextCode >= 48 && nextCode <= 57) {
return true;
}
return false;
}
if (code >= 48 && code <= 57) {
return true;
}
return false;
}
// Consume a number
// https://www.w3.org/TR/css-syntax-3/#consume-number
module.exports = function(value) {
var pos = 0;
var length = value.length;
var code;
var nextCode;
var nextNextCode;
if (length === 0 || !likeNumber(value)) {
return false;
}
code = value.charCodeAt(pos);
if (code === plus || code === minus) {
pos++;
}
while (pos < length) {
code = value.charCodeAt(pos);
if (code < 48 || code > 57) {
break;
}
pos += 1;
}
code = value.charCodeAt(pos);
nextCode = value.charCodeAt(pos + 1);
if (code === dot && nextCode >= 48 && nextCode <= 57) {
pos += 2;
while (pos < length) {
code = value.charCodeAt(pos);
if (code < 48 || code > 57) {
break;
}
pos += 1;
}
}
code = value.charCodeAt(pos);
nextCode = value.charCodeAt(pos + 1);
nextNextCode = value.charCodeAt(pos + 2);
if (
(code === exp || code === EXP) &&
((nextCode >= 48 && nextCode <= 57) ||
((nextCode === plus || nextCode === minus) &&
nextNextCode >= 48 &&
nextNextCode <= 57))
) {
pos += nextCode === plus || nextCode === minus ? 3 : 2;
while (pos < length) {
code = value.charCodeAt(pos);
if (code < 48 || code > 57) {
break;
}
pos += 1;
}
}
return {
number: value.slice(0, pos),
unit: value.slice(pos)
};
};
/***/ }),
/***/ 1544:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var parse = __webpack_require__(8491);
var walk = __webpack_require__(3815);
var stringify = __webpack_require__(4725);
function ValueParser(value) {
if (this instanceof ValueParser) {
this.nodes = parse(value);
return this;
}
return new ValueParser(value);
}
ValueParser.prototype.toString = function() {
return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
};
ValueParser.prototype.walk = function(cb, bubble) {
walk(this.nodes, cb, bubble);
return this;
};
ValueParser.unit = __webpack_require__(1524);
ValueParser.walk = walk;
ValueParser.stringify = stringify;
module.exports = ValueParser;
/***/ }),
/***/ 1609:
/***/ ((module) => {
"use strict";
module.exports = window["React"];
/***/ }),
/***/ 1670:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let { dirname, relative, resolve, sep } = __webpack_require__(197)
let { SourceMapConsumer, SourceMapGenerator } = __webpack_require__(1866)
let { pathToFileURL } = __webpack_require__(2739)
let Input = __webpack_require__(5380)
let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator)
let pathAvailable = Boolean(dirname && resolve && relative && sep)
class MapGenerator {
constructor(stringify, root, opts, cssString) {
this.stringify = stringify
this.mapOpts = opts.map || {}
this.root = root
this.opts = opts
this.css = cssString
this.originalCSS = cssString
this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute
this.memoizedFileURLs = new Map()
this.memoizedPaths = new Map()
this.memoizedURLs = new Map()
}
addAnnotation() {
let content
if (this.isInline()) {
content =
'data:application/json;base64,' + this.toBase64(this.map.toString())
} else if (typeof this.mapOpts.annotation === 'string') {
content = this.mapOpts.annotation
} else if (typeof this.mapOpts.annotation === 'function') {
content = this.mapOpts.annotation(this.opts.to, this.root)
} else {
content = this.outputFile() + '.map'
}
let eol = '\n'
if (this.css.includes('\r\n')) eol = '\r\n'
this.css += eol + '/*# sourceMappingURL=' + content + ' */'
}
applyPrevMaps() {
for (let prev of this.previous()) {
let from = this.toUrl(this.path(prev.file))
let root = prev.root || dirname(prev.file)
let map
if (this.mapOpts.sourcesContent === false) {
map = new SourceMapConsumer(prev.text)
if (map.sourcesContent) {
map.sourcesContent = null
}
} else {
map = prev.consumer()
}
this.map.applySourceMap(map, from, this.toUrl(this.path(root)))
}
}
clearAnnotation() {
if (this.mapOpts.annotation === false) return
if (this.root) {
let node
for (let i = this.root.nodes.length - 1; i >= 0; i--) {
node = this.root.nodes[i]
if (node.type !== 'comment') continue
if (node.text.startsWith('# sourceMappingURL=')) {
this.root.removeChild(i)
}
}
} else if (this.css) {
this.css = this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm, '')
}
}
generate() {
this.clearAnnotation()
if (pathAvailable && sourceMapAvailable && this.isMap()) {
return this.generateMap()
} else {
let result = ''
this.stringify(this.root, i => {
result += i
})
return [result]
}
}
generateMap() {
if (this.root) {
this.generateString()
} else if (this.previous().length === 1) {
let prev = this.previous()[0].consumer()
prev.file = this.outputFile()
this.map = SourceMapGenerator.fromSourceMap(prev, {
ignoreInvalidMapping: true
})
} else {
this.map = new SourceMapGenerator({
file: this.outputFile(),
ignoreInvalidMapping: true
})
this.map.addMapping({
generated: { column: 0, line: 1 },
original: { column: 0, line: 1 },
source: this.opts.from
? this.toUrl(this.path(this.opts.from))
: '<no source>'
})
}
if (this.isSourcesContent()) this.setSourcesContent()
if (this.root && this.previous().length > 0) this.applyPrevMaps()
if (this.isAnnotation()) this.addAnnotation()
if (this.isInline()) {
return [this.css]
} else {
return [this.css, this.map]
}
}
generateString() {
this.css = ''
this.map = new SourceMapGenerator({
file: this.outputFile(),
ignoreInvalidMapping: true
})
let line = 1
let column = 1
let noSource = '<no source>'
let mapping = {
generated: { column: 0, line: 0 },
original: { column: 0, line: 0 },
source: ''
}
let last, lines
this.stringify(this.root, (str, node, type) => {
this.css += str
if (node && type !== 'end') {
mapping.generated.line = line
mapping.generated.column = column - 1
if (node.source && node.source.start) {
mapping.source = this.sourcePath(node)
mapping.original.line = node.source.start.line
mapping.original.column = node.source.start.column - 1
this.map.addMapping(mapping)
} else {
mapping.source = noSource
mapping.original.line = 1
mapping.original.column = 0
this.map.addMapping(mapping)
}
}
lines = str.match(/\n/g)
if (lines) {
line += lines.length
last = str.lastIndexOf('\n')
column = str.length - last
} else {
column += str.length
}
if (node && type !== 'start') {
let p = node.parent || { raws: {} }
let childless =
node.type === 'decl' || (node.type === 'atrule' && !node.nodes)
if (!childless || node !== p.last || p.raws.semicolon) {
if (node.source && node.source.end) {
mapping.source = this.sourcePath(node)
mapping.original.line = node.source.end.line
mapping.original.column = node.source.end.column - 1
mapping.generated.line = line
mapping.generated.column = column - 2
this.map.addMapping(mapping)
} else {
mapping.source = noSource
mapping.original.line = 1
mapping.original.column = 0
mapping.generated.line = line
mapping.generated.column = column - 1
this.map.addMapping(mapping)
}
}
}
})
}
isAnnotation() {
if (this.isInline()) {
return true
}
if (typeof this.mapOpts.annotation !== 'undefined') {
return this.mapOpts.annotation
}
if (this.previous().length) {
return this.previous().some(i => i.annotation)
}
return true
}
isInline() {
if (typeof this.mapOpts.inline !== 'undefined') {
return this.mapOpts.inline
}
let annotation = this.mapOpts.annotation
if (typeof annotation !== 'undefined' && annotation !== true) {
return false
}
if (this.previous().length) {
return this.previous().some(i => i.inline)
}
return true
}
isMap() {
if (typeof this.opts.map !== 'undefined') {
return !!this.opts.map
}
return this.previous().length > 0
}
isSourcesContent() {
if (typeof this.mapOpts.sourcesContent !== 'undefined') {
return this.mapOpts.sourcesContent
}
if (this.previous().length) {
return this.previous().some(i => i.withContent())
}
return true
}
outputFile() {
if (this.opts.to) {
return this.path(this.opts.to)
} else if (this.opts.from) {
return this.path(this.opts.from)
} else {
return 'to.css'
}
}
path(file) {
if (this.mapOpts.absolute) return file
if (file.charCodeAt(0) === 60 /* `<` */) return file
if (/^\w+:\/\//.test(file)) return file
let cached = this.memoizedPaths.get(file)
if (cached) return cached
let from = this.opts.to ? dirname(this.opts.to) : '.'
if (typeof this.mapOpts.annotation === 'string') {
from = dirname(resolve(from, this.mapOpts.annotation))
}
let path = relative(from, file)
this.memoizedPaths.set(file, path)
return path
}
previous() {
if (!this.previousMaps) {
this.previousMaps = []
if (this.root) {
this.root.walk(node => {
if (node.source && node.source.input.map) {
let map = node.source.input.map
if (!this.previousMaps.includes(map)) {
this.previousMaps.push(map)
}
}
})
} else {
let input = new Input(this.originalCSS, this.opts)
if (input.map) this.previousMaps.push(input.map)
}
}
return this.previousMaps
}
setSourcesContent() {
let already = {}
if (this.root) {
this.root.walk(node => {
if (node.source) {
let from = node.source.input.from
if (from && !already[from]) {
already[from] = true
let fromUrl = this.usesFileUrls
? this.toFileUrl(from)
: this.toUrl(this.path(from))
this.map.setSourceContent(fromUrl, node.source.input.css)
}
}
})
} else if (this.css) {
let from = this.opts.from
? this.toUrl(this.path(this.opts.from))
: '<no source>'
this.map.setSourceContent(from, this.css)
}
}
sourcePath(node) {
if (this.mapOpts.from) {
return this.toUrl(this.mapOpts.from)
} else if (this.usesFileUrls) {
return this.toFileUrl(node.source.input.from)
} else {
return this.toUrl(this.path(node.source.input.from))
}
}
toBase64(str) {
if (Buffer) {
return Buffer.from(str).toString('base64')
} else {
return window.btoa(unescape(encodeURIComponent(str)))
}
}
toFileUrl(path) {
let cached = this.memoizedFileURLs.get(path)
if (cached) return cached
if (pathToFileURL) {
let fileURL = pathToFileURL(path).toString()
this.memoizedFileURLs.set(path, fileURL)
return fileURL
} else {
throw new Error(
'`map.absolute` option is not available in this PostCSS build'
)
}
}
toUrl(path) {
let cached = this.memoizedURLs.get(path)
if (cached) return cached
if (sep === '\\') {
path = path.replace(/\\/g, '/')
}
let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent)
this.memoizedURLs.set(path, url)
return url
}
}
module.exports = MapGenerator
/***/ }),
/***/ 1866:
/***/ (() => {
/* (ignored) */
/***/ }),
/***/ 2213:
/***/ ((module) => {
/**
* Copyright 2004-present Facebook. All Rights Reserved.
*
* @providesModule UserAgent_DEPRECATED
*/
/**
* Provides entirely client-side User Agent and OS detection. You should prefer
* the non-deprecated UserAgent module when possible, which exposes our
* authoritative server-side PHP-based detection to the client.
*
* Usage is straightforward:
*
* if (UserAgent_DEPRECATED.ie()) {
* // IE
* }
*
* You can also do version checks:
*
* if (UserAgent_DEPRECATED.ie() >= 7) {
* // IE7 or better
* }
*
* The browser functions will return NaN if the browser does not match, so
* you can also do version compares the other way:
*
* if (UserAgent_DEPRECATED.ie() < 7) {
* // IE6 or worse
* }
*
* Note that the version is a float and may include a minor version number,
* so you should always use range operators to perform comparisons, not
* strict equality.
*
* **Note:** You should **strongly** prefer capability detection to browser
* version detection where it's reasonable:
*
* http://www.quirksmode.org/js/support.html
*
* Further, we have a large number of mature wrapper functions and classes
* which abstract away many browser irregularities. Check the documentation,
* grep for things, or ask on javascript@lists.facebook.com before writing yet
* another copy of "event || window.event".
*
*/
var _populated = false;
// Browsers
var _ie, _firefox, _opera, _webkit, _chrome;
// Actual IE browser for compatibility mode
var _ie_real_version;
// Platforms
var _osx, _windows, _linux, _android;
// Architectures
var _win64;
// Devices
var _iphone, _ipad, _native;
var _mobile;
function _populate() {
if (_populated) {
return;
}
_populated = true;
// To work around buggy JS libraries that can't handle multi-digit
// version numbers, Opera 10's user agent string claims it's Opera
// 9, then later includes a Version/X.Y field:
//
// Opera/9.80 (foo) Presto/2.2.15 Version/10.10
var uas = navigator.userAgent;
var agent = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(uas);
var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas);
_iphone = /\b(iPhone|iP[ao]d)/.exec(uas);
_ipad = /\b(iP[ao]d)/.exec(uas);
_android = /Android/i.exec(uas);
_native = /FBAN\/\w+;/i.exec(uas);
_mobile = /Mobile/i.exec(uas);
// Note that the IE team blog would have you believe you should be checking
// for 'Win64; x64'. But MSDN then reveals that you can actually be coming
// from either x64 or ia64; so ultimately, you should just check for Win64
// as in indicator of whether you're in 64-bit IE. 32-bit IE on 64-bit
// Windows will send 'WOW64' instead.
_win64 = !!(/Win64/.exec(uas));
if (agent) {
_ie = agent[1] ? parseFloat(agent[1]) : (
agent[5] ? parseFloat(agent[5]) : NaN);
// IE compatibility mode
if (_ie && document && document.documentMode) {
_ie = document.documentMode;
}
// grab the "true" ie version from the trident token if available
var trident = /(?:Trident\/(\d+.\d+))/.exec(uas);
_ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie;
_firefox = agent[2] ? parseFloat(agent[2]) : NaN;
_opera = agent[3] ? parseFloat(agent[3]) : NaN;
_webkit = agent[4] ? parseFloat(agent[4]) : NaN;
if (_webkit) {
// We do not add the regexp to the above test, because it will always
// match 'safari' only since 'AppleWebKit' appears before 'Chrome' in
// the userAgent string.
agent = /(?:Chrome\/(\d+\.\d+))/.exec(uas);
_chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN;
} else {
_chrome = NaN;
}
} else {
_ie = _firefox = _opera = _chrome = _webkit = NaN;
}
if (os) {
if (os[1]) {
// Detect OS X version. If no version number matches, set _osx to true.
// Version examples: 10, 10_6_1, 10.7
// Parses version number as a float, taking only first two sets of
// digits. If only one set of digits is found, returns just the major
// version number.
var ver = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(uas);
_osx = ver ? parseFloat(ver[1].replace('_', '.')) : true;
} else {
_osx = false;
}
_windows = !!os[2];
_linux = !!os[3];
} else {
_osx = _windows = _linux = false;
}
}
var UserAgent_DEPRECATED = {
/**
* Check if the UA is Internet Explorer.
*
*
* @return float|NaN Version number (if match) or NaN.
*/
ie: function() {
return _populate() || _ie;
},
/**
* Check if we're in Internet Explorer compatibility mode.
*
* @return bool true if in compatibility mode, false if
* not compatibility mode or not ie
*/
ieCompatibilityMode: function() {
return _populate() || (_ie_real_version > _ie);
},
/**
* Whether the browser is 64-bit IE. Really, this is kind of weak sauce; we
* only need this because Skype can't handle 64-bit IE yet. We need to remove
* this when we don't need it -- tracked by #601957.
*/
ie64: function() {
return UserAgent_DEPRECATED.ie() && _win64;
},
/**
* Check if the UA is Firefox.
*
*
* @return float|NaN Version number (if match) or NaN.
*/
firefox: function() {
return _populate() || _firefox;
},
/**
* Check if the UA is Opera.
*
*
* @return float|NaN Version number (if match) or NaN.
*/
opera: function() {
return _populate() || _opera;
},
/**
* Check if the UA is WebKit.
*
*
* @return float|NaN Version number (if match) or NaN.
*/
webkit: function() {
return _populate() || _webkit;
},
/**
* For Push
* WILL BE REMOVED VERY SOON. Use UserAgent_DEPRECATED.webkit
*/
safari: function() {
return UserAgent_DEPRECATED.webkit();
},
/**
* Check if the UA is a Chrome browser.
*
*
* @return float|NaN Version number (if match) or NaN.
*/
chrome : function() {
return _populate() || _chrome;
},
/**
* Check if the user is running Windows.
*
* @return bool `true' if the user's OS is Windows.
*/
windows: function() {
return _populate() || _windows;
},
/**
* Check if the user is running Mac OS X.
*
* @return float|bool Returns a float if a version number is detected,
* otherwise true/false.
*/
osx: function() {
return _populate() || _osx;
},
/**
* Check if the user is running Linux.
*
* @return bool `true' if the user's OS is some flavor of Linux.
*/
linux: function() {
return _populate() || _linux;
},
/**
* Check if the user is running on an iPhone or iPod platform.
*
* @return bool `true' if the user is running some flavor of the
* iPhone OS.
*/
iphone: function() {
return _populate() || _iphone;
},
mobile: function() {
return _populate() || (_iphone || _ipad || _android || _mobile);
},
nativeApp: function() {
// webviews inside of the native apps
return _populate() || _native;
},
android: function() {
return _populate() || _android;
},
ipad: function() {
return _populate() || _ipad;
}
};
module.exports = UserAgent_DEPRECATED;
/***/ }),
/***/ 2327:
/***/ ((module) => {
"use strict";
const SINGLE_QUOTE = "'".charCodeAt(0)
const DOUBLE_QUOTE = '"'.charCodeAt(0)
const BACKSLASH = '\\'.charCodeAt(0)
const SLASH = '/'.charCodeAt(0)
const NEWLINE = '\n'.charCodeAt(0)
const SPACE = ' '.charCodeAt(0)
const FEED = '\f'.charCodeAt(0)
const TAB = '\t'.charCodeAt(0)
const CR = '\r'.charCodeAt(0)
const OPEN_SQUARE = '['.charCodeAt(0)
const CLOSE_SQUARE = ']'.charCodeAt(0)
const OPEN_PARENTHESES = '('.charCodeAt(0)
const CLOSE_PARENTHESES = ')'.charCodeAt(0)
const OPEN_CURLY = '{'.charCodeAt(0)
const CLOSE_CURLY = '}'.charCodeAt(0)
const SEMICOLON = ';'.charCodeAt(0)
const ASTERISK = '*'.charCodeAt(0)
const COLON = ':'.charCodeAt(0)
const AT = '@'.charCodeAt(0)
const RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g
const RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g
const RE_BAD_BRACKET = /.[\r\n"'(/\\]/
const RE_HEX_ESCAPE = /[\da-f]/i
module.exports = function tokenizer(input, options = {}) {
let css = input.css.valueOf()
let ignore = options.ignoreErrors
let code, content, escape, next, quote
let currentToken, escaped, escapePos, n, prev
let length = css.length
let pos = 0
let buffer = []
let returned = []
function position() {
return pos
}
function unclosed(what) {
throw input.error('Unclosed ' + what, pos)
}
function endOfFile() {
return returned.length === 0 && pos >= length
}
function nextToken(opts) {
if (returned.length) return returned.pop()
if (pos >= length) return
let ignoreUnclosed = opts ? opts.ignoreUnclosed : false
code = css.charCodeAt(pos)
switch (code) {
case NEWLINE:
case SPACE:
case TAB:
case CR:
case FEED: {
next = pos
do {
next += 1
code = css.charCodeAt(next)
} while (
code === SPACE ||
code === NEWLINE ||
code === TAB ||
code === CR ||
code === FEED
)
currentToken = ['space', css.slice(pos, next)]
pos = next - 1
break
}
case OPEN_SQUARE:
case CLOSE_SQUARE:
case OPEN_CURLY:
case CLOSE_CURLY:
case COLON:
case SEMICOLON:
case CLOSE_PARENTHESES: {
let controlChar = String.fromCharCode(code)
currentToken = [controlChar, controlChar, pos]
break
}
case OPEN_PARENTHESES: {
prev = buffer.length ? buffer.pop()[1] : ''
n = css.charCodeAt(pos + 1)
if (
prev === 'url' &&
n !== SINGLE_QUOTE &&
n !== DOUBLE_QUOTE &&
n !== SPACE &&
n !== NEWLINE &&
n !== TAB &&
n !== FEED &&
n !== CR
) {
next = pos
do {
escaped = false
next = css.indexOf(')', next + 1)
if (next === -1) {
if (ignore || ignoreUnclosed) {
next = pos
break
} else {
unclosed('bracket')
}
}
escapePos = next
while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
escapePos -= 1
escaped = !escaped
}
} while (escaped)
currentToken = ['brackets', css.slice(pos, next + 1), pos, next]
pos = next
} else {
next = css.indexOf(')', pos + 1)
content = css.slice(pos, next + 1)
if (next === -1 || RE_BAD_BRACKET.test(content)) {
currentToken = ['(', '(', pos]
} else {
currentToken = ['brackets', content, pos, next]
pos = next
}
}
break
}
case SINGLE_QUOTE:
case DOUBLE_QUOTE: {
quote = code === SINGLE_QUOTE ? "'" : '"'
next = pos
do {
escaped = false
next = css.indexOf(quote, next + 1)
if (next === -1) {
if (ignore || ignoreUnclosed) {
next = pos + 1
break
} else {
unclosed('string')
}
}
escapePos = next
while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
escapePos -= 1
escaped = !escaped
}
} while (escaped)
currentToken = ['string', css.slice(pos, next + 1), pos, next]
pos = next
break
}
case AT: {
RE_AT_END.lastIndex = pos + 1
RE_AT_END.test(css)
if (RE_AT_END.lastIndex === 0) {
next = css.length - 1
} else {
next = RE_AT_END.lastIndex - 2
}
currentToken = ['at-word', css.slice(pos, next + 1), pos, next]
pos = next
break
}
case BACKSLASH: {
next = pos
escape = true
while (css.charCodeAt(next + 1) === BACKSLASH) {
next += 1
escape = !escape
}
code = css.charCodeAt(next + 1)
if (
escape &&
code !== SLASH &&
code !== SPACE &&
code !== NEWLINE &&
code !== TAB &&
code !== CR &&
code !== FEED
) {
next += 1
if (RE_HEX_ESCAPE.test(css.charAt(next))) {
while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) {
next += 1
}
if (css.charCodeAt(next + 1) === SPACE) {
next += 1
}
}
}
currentToken = ['word', css.slice(pos, next + 1), pos, next]
pos = next
break
}
default: {
if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) {
next = css.indexOf('*/', pos + 2) + 1
if (next === 0) {
if (ignore || ignoreUnclosed) {
next = css.length
} else {
unclosed('comment')
}
}
currentToken = ['comment', css.slice(pos, next + 1), pos, next]
pos = next
} else {
RE_WORD_END.lastIndex = pos + 1
RE_WORD_END.test(css)
if (RE_WORD_END.lastIndex === 0) {
next = css.length - 1
} else {
next = RE_WORD_END.lastIndex - 2
}
currentToken = ['word', css.slice(pos, next + 1), pos, next]
buffer.push(currentToken)
pos = next
}
break
}
}
pos++
return currentToken
}
function back(token) {
returned.push(token)
}
return {
back,
endOfFile,
nextToken,
position
}
}
/***/ }),
/***/ 2739:
/***/ (() => {
/* (ignored) */
/***/ }),
/***/ 2775:
/***/ ((module) => {
var x=String;
var create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x,blackBright:x,redBright:x,greenBright:x,yellowBright:x,blueBright:x,magentaBright:x,cyanBright:x,whiteBright:x,bgBlackBright:x,bgRedBright:x,bgGreenBright:x,bgYellowBright:x,bgBlueBright:x,bgMagentaBright:x,bgCyanBright:x,bgWhiteBright:x}};
module.exports=create();
module.exports.createColors = create;
/***/ }),
/***/ 3122:
/***/ ((module) => {
"use strict";
/* eslint-disable no-console */
let printed = {}
module.exports = function warnOnce(message) {
if (printed[message]) return
printed[message] = true
if (typeof console !== 'undefined' && console.warn) {
console.warn(message)
}
}
/***/ }),
/***/ 3815:
/***/ ((module) => {
module.exports = function walk(nodes, cb, bubble) {
var i, max, node, result;
for (i = 0, max = nodes.length; i < max; i += 1) {
node = nodes[i];
if (!bubble) {
result = cb(node, i, nodes);
}
if (
result !== false &&
node.type === "function" &&
Array.isArray(node.nodes)
) {
walk(node.nodes, cb, bubble);
}
if (bubble) {
cb(node, i, nodes);
}
}
};
/***/ }),
/***/ 3937:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let AtRule = __webpack_require__(1326)
let Comment = __webpack_require__(6589)
let Declaration = __webpack_require__(1516)
let Root = __webpack_require__(9434)
let Rule = __webpack_require__(4092)
let tokenizer = __webpack_require__(2327)
const SAFE_COMMENT_NEIGHBOR = {
empty: true,
space: true
}
function findLastWithPosition(tokens) {
for (let i = tokens.length - 1; i >= 0; i--) {
let token = tokens[i]
let pos = token[3] || token[2]
if (pos) return pos
}
}
class Parser {
constructor(input) {
this.input = input
this.root = new Root()
this.current = this.root
this.spaces = ''
this.semicolon = false
this.createTokenizer()
this.root.source = { input, start: { column: 1, line: 1, offset: 0 } }
}
atrule(token) {
let node = new AtRule()
node.name = token[1].slice(1)
if (node.name === '') {
this.unnamedAtrule(node, token)
}
this.init(node, token[2])
let type
let prev
let shift
let last = false
let open = false
let params = []
let brackets = []
while (!this.tokenizer.endOfFile()) {
token = this.tokenizer.nextToken()
type = token[0]
if (type === '(' || type === '[') {
brackets.push(type === '(' ? ')' : ']')
} else if (type === '{' && brackets.length > 0) {
brackets.push('}')
} else if (type === brackets[brackets.length - 1]) {
brackets.pop()
}
if (brackets.length === 0) {
if (type === ';') {
node.source.end = this.getPosition(token[2])
node.source.end.offset++
this.semicolon = true
break
} else if (type === '{') {
open = true
break
} else if (type === '}') {
if (params.length > 0) {
shift = params.length - 1
prev = params[shift]
while (prev && prev[0] === 'space') {
prev = params[--shift]
}
if (prev) {
node.source.end = this.getPosition(prev[3] || prev[2])
node.source.end.offset++
}
}
this.end(token)
break
} else {
params.push(token)
}
} else {
params.push(token)
}
if (this.tokenizer.endOfFile()) {
last = true
break
}
}
node.raws.between = this.spacesAndCommentsFromEnd(params)
if (params.length) {
node.raws.afterName = this.spacesAndCommentsFromStart(params)
this.raw(node, 'params', params)
if (last) {
token = params[params.length - 1]
node.source.end = this.getPosition(token[3] || token[2])
node.source.end.offset++
this.spaces = node.raws.between
node.raws.between = ''
}
} else {
node.raws.afterName = ''
node.params = ''
}
if (open) {
node.nodes = []
this.current = node
}
}
checkMissedSemicolon(tokens) {
let colon = this.colon(tokens)
if (colon === false) return
let founded = 0
let token
for (let j = colon - 1; j >= 0; j--) {
token = tokens[j]
if (token[0] !== 'space') {
founded += 1
if (founded === 2) break
}
}
// If the token is a word, e.g. `!important`, `red` or any other valid property's value.
// Then we need to return the colon after that word token. [3] is the "end" colon of that word.
// And because we need it after that one we do +1 to get the next one.
throw this.input.error(
'Missed semicolon',
token[0] === 'word' ? token[3] + 1 : token[2]
)
}
colon(tokens) {
let brackets = 0
let prev, token, type
for (let [i, element] of tokens.entries()) {
token = element
type = token[0]
if (type === '(') {
brackets += 1
}
if (type === ')') {
brackets -= 1
}
if (brackets === 0 && type === ':') {
if (!prev) {
this.doubleColon(token)
} else if (prev[0] === 'word' && prev[1] === 'progid') {
continue
} else {
return i
}
}
prev = token
}
return false
}
comment(token) {
let node = new Comment()
this.init(node, token[2])
node.source.end = this.getPosition(token[3] || token[2])
node.source.end.offset++
let text = token[1].slice(2, -2)
if (/^\s*$/.test(text)) {
node.text = ''
node.raws.left = text
node.raws.right = ''
} else {
let match = text.match(/^(\s*)([^]*\S)(\s*)$/)
node.text = match[2]
node.raws.left = match[1]
node.raws.right = match[3]
}
}
createTokenizer() {
this.tokenizer = tokenizer(this.input)
}
decl(tokens, customProperty) {
let node = new Declaration()
this.init(node, tokens[0][2])
let last = tokens[tokens.length - 1]
if (last[0] === ';') {
this.semicolon = true
tokens.pop()
}
node.source.end = this.getPosition(
last[3] || last[2] || findLastWithPosition(tokens)
)
node.source.end.offset++
while (tokens[0][0] !== 'word') {
if (tokens.length === 1) this.unknownWord(tokens)
node.raws.before += tokens.shift()[1]
}
node.source.start = this.getPosition(tokens[0][2])
node.prop = ''
while (tokens.length) {
let type = tokens[0][0]
if (type === ':' || type === 'space' || type === 'comment') {
break
}
node.prop += tokens.shift()[1]
}
node.raws.between = ''
let token
while (tokens.length) {
token = tokens.shift()
if (token[0] === ':') {
node.raws.between += token[1]
break
} else {
if (token[0] === 'word' && /\w/.test(token[1])) {
this.unknownWord([token])
}
node.raws.between += token[1]
}
}
if (node.prop[0] === '_' || node.prop[0] === '*') {
node.raws.before += node.prop[0]
node.prop = node.prop.slice(1)
}
let firstSpaces = []
let next
while (tokens.length) {
next = tokens[0][0]
if (next !== 'space' && next !== 'comment') break
firstSpaces.push(tokens.shift())
}
this.precheckMissedSemicolon(tokens)
for (let i = tokens.length - 1; i >= 0; i--) {
token = tokens[i]
if (token[1].toLowerCase() === '!important') {
node.important = true
let string = this.stringFrom(tokens, i)
string = this.spacesFromEnd(tokens) + string
if (string !== ' !important') node.raws.important = string
break
} else if (token[1].toLowerCase() === 'important') {
let cache = tokens.slice(0)
let str = ''
for (let j = i; j > 0; j--) {
let type = cache[j][0]
if (str.trim().startsWith('!') && type !== 'space') {
break
}
str = cache.pop()[1] + str
}
if (str.trim().startsWith('!')) {
node.important = true
node.raws.important = str
tokens = cache
}
}
if (token[0] !== 'space' && token[0] !== 'comment') {
break
}
}
let hasWord = tokens.some(i => i[0] !== 'space' && i[0] !== 'comment')
if (hasWord) {
node.raws.between += firstSpaces.map(i => i[1]).join('')
firstSpaces = []
}
this.raw(node, 'value', firstSpaces.concat(tokens), customProperty)
if (node.value.includes(':') && !customProperty) {
this.checkMissedSemicolon(tokens)
}
}
doubleColon(token) {
throw this.input.error(
'Double colon',
{ offset: token[2] },
{ offset: token[2] + token[1].length }
)
}
emptyRule(token) {
let node = new Rule()
this.init(node, token[2])
node.selector = ''
node.raws.between = ''
this.current = node
}
end(token) {
if (this.current.nodes && this.current.nodes.length) {
this.current.raws.semicolon = this.semicolon
}
this.semicolon = false
this.current.raws.after = (this.current.raws.after || '') + this.spaces
this.spaces = ''
if (this.current.parent) {
this.current.source.end = this.getPosition(token[2])
this.current.source.end.offset++
this.current = this.current.parent
} else {
this.unexpectedClose(token)
}
}
endFile() {
if (this.current.parent) this.unclosedBlock()
if (this.current.nodes && this.current.nodes.length) {
this.current.raws.semicolon = this.semicolon
}
this.current.raws.after = (this.current.raws.after || '') + this.spaces
this.root.source.end = this.getPosition(this.tokenizer.position())
}
freeSemicolon(token) {
this.spaces += token[1]
if (this.current.nodes) {
let prev = this.current.nodes[this.current.nodes.length - 1]
if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) {
prev.raws.ownSemicolon = this.spaces
this.spaces = ''
prev.source.end = this.getPosition(token[2])
prev.source.end.offset += prev.raws.ownSemicolon.length
}
}
}
// Helpers
getPosition(offset) {
let pos = this.input.fromOffset(offset)
return {
column: pos.col,
line: pos.line,
offset
}
}
init(node, offset) {
this.current.push(node)
node.source = {
input: this.input,
start: this.getPosition(offset)
}
node.raws.before = this.spaces
this.spaces = ''
if (node.type !== 'comment') this.semicolon = false
}
other(start) {
let end = false
let type = null
let colon = false
let bracket = null
let brackets = []
let customProperty = start[1].startsWith('--')
let tokens = []
let token = start
while (token) {
type = token[0]
tokens.push(token)
if (type === '(' || type === '[') {
if (!bracket) bracket = token
brackets.push(type === '(' ? ')' : ']')
} else if (customProperty && colon && type === '{') {
if (!bracket) bracket = token
brackets.push('}')
} else if (brackets.length === 0) {
if (type === ';') {
if (colon) {
this.decl(tokens, customProperty)
return
} else {
break
}
} else if (type === '{') {
this.rule(tokens)
return
} else if (type === '}') {
this.tokenizer.back(tokens.pop())
end = true
break
} else if (type === ':') {
colon = true
}
} else if (type === brackets[brackets.length - 1]) {
brackets.pop()
if (brackets.length === 0) bracket = null
}
token = this.tokenizer.nextToken()
}
if (this.tokenizer.endOfFile()) end = true
if (brackets.length > 0) this.unclosedBracket(bracket)
if (end && colon) {
if (!customProperty) {
while (tokens.length) {
token = tokens[tokens.length - 1][0]
if (token !== 'space' && token !== 'comment') break
this.tokenizer.back(tokens.pop())
}
}
this.decl(tokens, customProperty)
} else {
this.unknownWord(tokens)
}
}
parse() {
let token
while (!this.tokenizer.endOfFile()) {
token = this.tokenizer.nextToken()
switch (token[0]) {
case 'space':
this.spaces += token[1]
break
case ';':
this.freeSemicolon(token)
break
case '}':
this.end(token)
break
case 'comment':
this.comment(token)
break
case 'at-word':
this.atrule(token)
break
case '{':
this.emptyRule(token)
break
default:
this.other(token)
break
}
}
this.endFile()
}
precheckMissedSemicolon(/* tokens */) {
// Hook for Safe Parser
}
raw(node, prop, tokens, customProperty) {
let token, type
let length = tokens.length
let value = ''
let clean = true
let next, prev
for (let i = 0; i < length; i += 1) {
token = tokens[i]
type = token[0]
if (type === 'space' && i === length - 1 && !customProperty) {
clean = false
} else if (type === 'comment') {
prev = tokens[i - 1] ? tokens[i - 1][0] : 'empty'
next = tokens[i + 1] ? tokens[i + 1][0] : 'empty'
if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) {
if (value.slice(-1) === ',') {
clean = false
} else {
value += token[1]
}
} else {
clean = false
}
} else {
value += token[1]
}
}
if (!clean) {
let raw = tokens.reduce((all, i) => all + i[1], '')
node.raws[prop] = { raw, value }
}
node[prop] = value
}
rule(tokens) {
tokens.pop()
let node = new Rule()
this.init(node, tokens[0][2])
node.raws.between = this.spacesAndCommentsFromEnd(tokens)
this.raw(node, 'selector', tokens)
this.current = node
}
spacesAndCommentsFromEnd(tokens) {
let lastTokenType
let spaces = ''
while (tokens.length) {
lastTokenType = tokens[tokens.length - 1][0]
if (lastTokenType !== 'space' && lastTokenType !== 'comment') break
spaces = tokens.pop()[1] + spaces
}
return spaces
}
// Errors
spacesAndCommentsFromStart(tokens) {
let next
let spaces = ''
while (tokens.length) {
next = tokens[0][0]
if (next !== 'space' && next !== 'comment') break
spaces += tokens.shift()[1]
}
return spaces
}
spacesFromEnd(tokens) {
let lastTokenType
let spaces = ''
while (tokens.length) {
lastTokenType = tokens[tokens.length - 1][0]
if (lastTokenType !== 'space') break
spaces = tokens.pop()[1] + spaces
}
return spaces
}
stringFrom(tokens, from) {
let result = ''
for (let i = from; i < tokens.length; i++) {
result += tokens[i][1]
}
tokens.splice(from, tokens.length - from)
return result
}
unclosedBlock() {
let pos = this.current.source.start
throw this.input.error('Unclosed block', pos.line, pos.column)
}
unclosedBracket(bracket) {
throw this.input.error(
'Unclosed bracket',
{ offset: bracket[2] },
{ offset: bracket[2] + 1 }
)
}
unexpectedClose(token) {
throw this.input.error(
'Unexpected }',
{ offset: token[2] },
{ offset: token[2] + 1 }
)
}
unknownWord(tokens) {
throw this.input.error(
'Unknown word ' + tokens[0][1],
{ offset: tokens[0][2] },
{ offset: tokens[0][2] + tokens[0][1].length }
)
}
unnamedAtrule(node, token) {
throw this.input.error(
'At-rule without name',
{ offset: token[2] },
{ offset: token[2] + token[1].length }
)
}
}
module.exports = Parser
/***/ }),
/***/ 4067:
/***/ ((module) => {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
/***/ }),
/***/ 4092:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let Container = __webpack_require__(683)
let list = __webpack_require__(7374)
class Rule extends Container {
get selectors() {
return list.comma(this.selector)
}
set selectors(values) {
let match = this.selector ? this.selector.match(/,\s*/) : null
let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen')
this.selector = values.join(sep)
}
constructor(defaults) {
super(defaults)
this.type = 'rule'
if (!this.nodes) this.nodes = []
}
}
module.exports = Rule
Rule.default = Rule
Container.registerRule(Rule)
/***/ }),
/***/ 4132:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
var __webpack_unused_export__;
__webpack_unused_export__ = true;
var TextareaAutosize_1 = __webpack_require__(4462);
exports.A = TextareaAutosize_1.TextareaAutosize;
/***/ }),
/***/ 4295:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let Container = __webpack_require__(683)
let Input = __webpack_require__(5380)
let Parser = __webpack_require__(3937)
function parse(css, opts) {
let input = new Input(css, opts)
let parser = new Parser(input)
try {
parser.parse()
} catch (e) {
if (false) {}
throw e
}
return parser.root
}
module.exports = parse
parse.default = parse
Container.registerParse(parse)
/***/ }),
/***/ 4306:
/***/ (function(module, exports) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
autosize 4.0.4
license: MIT
http://www.jacklmoore.com/autosize
*/
(function (global, factory) {
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else { var mod; }
})(this, function (module, exports) {
'use strict';
var map = typeof Map === "function" ? new Map() : function () {
var keys = [];
var values = [];
return {
has: function has(key) {
return keys.indexOf(key) > -1;
},
get: function get(key) {
return values[keys.indexOf(key)];
},
set: function set(key, value) {
if (keys.indexOf(key) === -1) {
keys.push(key);
values.push(value);
}
},
delete: function _delete(key) {
var index = keys.indexOf(key);
if (index > -1) {
keys.splice(index, 1);
values.splice(index, 1);
}
}
};
}();
var createEvent = function createEvent(name) {
return new Event(name, { bubbles: true });
};
try {
new Event('test');
} catch (e) {
// IE does not support `new Event()`
createEvent = function createEvent(name) {
var evt = document.createEvent('Event');
evt.initEvent(name, true, false);
return evt;
};
}
function assign(ta) {
if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;
var heightOffset = null;
var clientWidth = null;
var cachedHeight = null;
function init() {
var style = window.getComputedStyle(ta, null);
if (style.resize === 'vertical') {
ta.style.resize = 'none';
} else if (style.resize === 'both') {
ta.style.resize = 'horizontal';
}
if (style.boxSizing === 'content-box') {
heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));
} else {
heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
}
// Fix when a textarea is not on document body and heightOffset is Not a Number
if (isNaN(heightOffset)) {
heightOffset = 0;
}
update();
}
function changeOverflow(value) {
{
// Chrome/Safari-specific fix:
// When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space
// made available by removing the scrollbar. The following forces the necessary text reflow.
var width = ta.style.width;
ta.style.width = '0px';
// Force reflow:
/* jshint ignore:start */
ta.offsetWidth;
/* jshint ignore:end */
ta.style.width = width;
}
ta.style.overflowY = value;
}
function getParentOverflows(el) {
var arr = [];
while (el && el.parentNode && el.parentNode instanceof Element) {
if (el.parentNode.scrollTop) {
arr.push({
node: el.parentNode,
scrollTop: el.parentNode.scrollTop
});
}
el = el.parentNode;
}
return arr;
}
function resize() {
if (ta.scrollHeight === 0) {
// If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.
return;
}
var overflows = getParentOverflows(ta);
var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)
ta.style.height = '';
ta.style.height = ta.scrollHeight + heightOffset + 'px';
// used to check if an update is actually necessary on window.resize
clientWidth = ta.clientWidth;
// prevents scroll-position jumping
overflows.forEach(function (el) {
el.node.scrollTop = el.scrollTop;
});
if (docTop) {
document.documentElement.scrollTop = docTop;
}
}
function update() {
resize();
var styleHeight = Math.round(parseFloat(ta.style.height));
var computed = window.getComputedStyle(ta, null);
// Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box
var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;
// The actual height not matching the style height (set via the resize method) indicates that
// the max-height has been exceeded, in which case the overflow should be allowed.
if (actualHeight < styleHeight) {
if (computed.overflowY === 'hidden') {
changeOverflow('scroll');
resize();
actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
}
} else {
// Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands.
if (computed.overflowY !== 'hidden') {
changeOverflow('hidden');
resize();
actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
}
}
if (cachedHeight !== actualHeight) {
cachedHeight = actualHeight;
var evt = createEvent('autosize:resized');
try {
ta.dispatchEvent(evt);
} catch (err) {
// Firefox will throw an error on dispatchEvent for a detached element
// https://bugzilla.mozilla.org/show_bug.cgi?id=889376
}
}
}
var pageResize = function pageResize() {
if (ta.clientWidth !== clientWidth) {
update();
}
};
var destroy = function (style) {
window.removeEventListener('resize', pageResize, false);
ta.removeEventListener('input', update, false);
ta.removeEventListener('keyup', update, false);
ta.removeEventListener('autosize:destroy', destroy, false);
ta.removeEventListener('autosize:update', update, false);
Object.keys(style).forEach(function (key) {
ta.style[key] = style[key];
});
map.delete(ta);
}.bind(ta, {
height: ta.style.height,
resize: ta.style.resize,
overflowY: ta.style.overflowY,
overflowX: ta.style.overflowX,
wordWrap: ta.style.wordWrap
});
ta.addEventListener('autosize:destroy', destroy, false);
// IE9 does not fire onpropertychange or oninput for deletions,
// so binding to onkeyup to catch most of those events.
// There is no way that I know of to detect something like 'cut' in IE9.
if ('onpropertychange' in ta && 'oninput' in ta) {
ta.addEventListener('keyup', update, false);
}
window.addEventListener('resize', pageResize, false);
ta.addEventListener('input', update, false);
ta.addEventListener('autosize:update', update, false);
ta.style.overflowX = 'hidden';
ta.style.wordWrap = 'break-word';
map.set(ta, {
destroy: destroy,
update: update
});
init();
}
function destroy(ta) {
var methods = map.get(ta);
if (methods) {
methods.destroy();
}
}
function update(ta) {
var methods = map.get(ta);
if (methods) {
methods.update();
}
}
var autosize = null;
// Do nothing in Node.js environment and IE8 (or lower)
if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
autosize = function autosize(el) {
return el;
};
autosize.destroy = function (el) {
return el;
};
autosize.update = function (el) {
return el;
};
} else {
autosize = function autosize(el, options) {
if (el) {
Array.prototype.forEach.call(el.length ? el : [el], function (x) {
return assign(x, options);
});
}
return el;
};
autosize.destroy = function (el) {
if (el) {
Array.prototype.forEach.call(el.length ? el : [el], destroy);
}
return el;
};
autosize.update = function (el) {
if (el) {
Array.prototype.forEach.call(el.length ? el : [el], update);
}
return el;
};
}
exports.default = autosize;
module.exports = exports['default'];
});
/***/ }),
/***/ 4462:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
return t;
};
exports.__esModule = true;
var React = __webpack_require__(1609);
var PropTypes = __webpack_require__(5826);
var autosize = __webpack_require__(4306);
var _getLineHeight = __webpack_require__(461);
var getLineHeight = _getLineHeight;
var RESIZED = "autosize:resized";
/**
* A light replacement for built-in textarea component
* which automaticaly adjusts its height to match the content
*/
var TextareaAutosizeClass = /** @class */ (function (_super) {
__extends(TextareaAutosizeClass, _super);
function TextareaAutosizeClass() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.state = {
lineHeight: null
};
_this.textarea = null;
_this.onResize = function (e) {
if (_this.props.onResize) {
_this.props.onResize(e);
}
};
_this.updateLineHeight = function () {
if (_this.textarea) {
_this.setState({
lineHeight: getLineHeight(_this.textarea)
});
}
};
_this.onChange = function (e) {
var onChange = _this.props.onChange;
_this.currentValue = e.currentTarget.value;
onChange && onChange(e);
};
return _this;
}
TextareaAutosizeClass.prototype.componentDidMount = function () {
var _this = this;
var _a = this.props, maxRows = _a.maxRows, async = _a.async;
if (typeof maxRows === "number") {
this.updateLineHeight();
}
if (typeof maxRows === "number" || async) {
/*
the defer is needed to:
- force "autosize" to activate the scrollbar when this.props.maxRows is passed
- support StyledComponents (see #71)
*/
setTimeout(function () { return _this.textarea && autosize(_this.textarea); });
}
else {
this.textarea && autosize(this.textarea);
}
if (this.textarea) {
this.textarea.addEventListener(RESIZED, this.onResize);
}
};
TextareaAutosizeClass.prototype.componentWillUnmount = function () {
if (this.textarea) {
this.textarea.removeEventListener(RESIZED, this.onResize);
autosize.destroy(this.textarea);
}
};
TextareaAutosizeClass.prototype.render = function () {
var _this = this;
var _a = this, _b = _a.props, onResize = _b.onResize, maxRows = _b.maxRows, onChange = _b.onChange, style = _b.style, innerRef = _b.innerRef, children = _b.children, props = __rest(_b, ["onResize", "maxRows", "onChange", "style", "innerRef", "children"]), lineHeight = _a.state.lineHeight;
var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null;
return (React.createElement("textarea", __assign({}, props, { onChange: this.onChange, style: maxHeight ? __assign({}, style, { maxHeight: maxHeight }) : style, ref: function (element) {
_this.textarea = element;
if (typeof _this.props.innerRef === 'function') {
_this.props.innerRef(element);
}
else if (_this.props.innerRef) {
_this.props.innerRef.current = element;
}
} }), children));
};
TextareaAutosizeClass.prototype.componentDidUpdate = function () {
this.textarea && autosize.update(this.textarea);
};
TextareaAutosizeClass.defaultProps = {
rows: 1,
async: false
};
TextareaAutosizeClass.propTypes = {
rows: PropTypes.number,
maxRows: PropTypes.number,
onResize: PropTypes.func,
innerRef: PropTypes.any,
async: PropTypes.bool
};
return TextareaAutosizeClass;
}(React.Component));
exports.TextareaAutosize = React.forwardRef(function (props, ref) {
return React.createElement(TextareaAutosizeClass, __assign({}, props, { innerRef: ref }));
});
/***/ }),
/***/ 4725:
/***/ ((module) => {
function stringifyNode(node, custom) {
var type = node.type;
var value = node.value;
var buf;
var customResult;
if (custom && (customResult = custom(node)) !== undefined) {
return customResult;
} else if (type === "word" || type === "space") {
return value;
} else if (type === "string") {
buf = node.quote || "";
return buf + value + (node.unclosed ? "" : buf);
} else if (type === "comment") {
return "/*" + value + (node.unclosed ? "" : "*/");
} else if (type === "div") {
return (node.before || "") + value + (node.after || "");
} else if (Array.isArray(node.nodes)) {
buf = stringify(node.nodes, custom);
if (type !== "function") {
return buf;
}
return (
value +
"(" +
(node.before || "") +
buf +
(node.after || "") +
(node.unclosed ? "" : ")")
);
}
return value;
}
function stringify(nodes, custom) {
var result, i;
if (Array.isArray(nodes)) {
result = "";
for (i = nodes.length - 1; ~i; i -= 1) {
result = stringifyNode(nodes[i], custom) + result;
}
return result;
}
return stringifyNode(nodes, custom);
}
module.exports = stringify;
/***/ }),
/***/ 5042:
/***/ ((module) => {
// This alphabet uses `A-Za-z0-9_-` symbols.
// The order of characters is optimized for better gzip and brotli compression.
// References to the same file (works both for gzip and brotli):
// `'use`, `andom`, and `rict'`
// References to the brotli default dictionary:
// `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf`
let urlAlphabet =
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
let customAlphabet = (alphabet, defaultSize = 21) => {
return (size = defaultSize) => {
let id = ''
// A compact alternative for `for (var i = 0; i < step; i++)`.
let i = size | 0
while (i--) {
// `| 0` is more compact and faster than `Math.floor()`.
id += alphabet[(Math.random() * alphabet.length) | 0]
}
return id
}
}
let nanoid = (size = 21) => {
let id = ''
// A compact alternative for `for (var i = 0; i < step; i++)`.
let i = size | 0
while (i--) {
// `| 0` is more compact and faster than `Math.floor()`.
id += urlAlphabet[(Math.random() * 64) | 0]
}
return id
}
module.exports = { nanoid, customAlphabet }
/***/ }),
/***/ 5215:
/***/ ((module) => {
"use strict";
// do not edit .js files directly - edit src/index.jst
module.exports = function equal(a, b) {
if (a === b) return true;
if (a && b && typeof a == 'object' && typeof b == 'object') {
if (a.constructor !== b.constructor) return false;
var length, i, keys;
if (Array.isArray(a)) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0;)
if (!equal(a[i], b[i])) return false;
return true;
}
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
keys = Object.keys(a);
length = keys.length;
if (length !== Object.keys(b).length) return false;
for (i = length; i-- !== 0;)
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
for (i = length; i-- !== 0;) {
var key = keys[i];
if (!equal(a[key], b[key])) return false;
}
return true;
}
// true if both NaN, false otherwise
return a!==a && b!==b;
};
/***/ }),
/***/ 5380:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let { nanoid } = __webpack_require__(5042)
let { isAbsolute, resolve } = __webpack_require__(197)
let { SourceMapConsumer, SourceMapGenerator } = __webpack_require__(1866)
let { fileURLToPath, pathToFileURL } = __webpack_require__(2739)
let CssSyntaxError = __webpack_require__(356)
let PreviousMap = __webpack_require__(5696)
let terminalHighlight = __webpack_require__(9746)
let lineToIndexCache = Symbol('lineToIndexCache')
let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator)
let pathAvailable = Boolean(resolve && isAbsolute)
function getLineToIndex(input) {
if (input[lineToIndexCache]) return input[lineToIndexCache]
let lines = input.css.split('\n')
let lineToIndex = new Array(lines.length)
let prevIndex = 0
for (let i = 0, l = lines.length; i < l; i++) {
lineToIndex[i] = prevIndex
prevIndex += lines[i].length + 1
}
input[lineToIndexCache] = lineToIndex
return lineToIndex
}
class Input {
get from() {
return this.file || this.id
}
constructor(css, opts = {}) {
if (
css === null ||
typeof css === 'undefined' ||
(typeof css === 'object' && !css.toString)
) {
throw new Error(`PostCSS received ${css} instead of CSS string`)
}
this.css = css.toString()
if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') {
this.hasBOM = true
this.css = this.css.slice(1)
} else {
this.hasBOM = false
}
this.document = this.css
if (opts.document) this.document = opts.document.toString()
if (opts.from) {
if (
!pathAvailable ||
/^\w+:\/\//.test(opts.from) ||
isAbsolute(opts.from)
) {
this.file = opts.from
} else {
this.file = resolve(opts.from)
}
}
if (pathAvailable && sourceMapAvailable) {
let map = new PreviousMap(this.css, opts)
if (map.text) {
this.map = map
let file = map.consumer().file
if (!this.file && file) this.file = this.mapResolve(file)
}
}
if (!this.file) {
this.id = '<input css ' + nanoid(6) + '>'
}
if (this.map) this.map.file = this.from
}
error(message, line, column, opts = {}) {
let endColumn, endLine, endOffset, offset, result
if (line && typeof line === 'object') {
let start = line
let end = column
if (typeof start.offset === 'number') {
offset = start.offset
let pos = this.fromOffset(offset)
line = pos.line
column = pos.col
} else {
line = start.line
column = start.column
offset = this.fromLineAndColumn(line, column)
}
if (typeof end.offset === 'number') {
endOffset = end.offset
let pos = this.fromOffset(endOffset)
endLine = pos.line
endColumn = pos.col
} else {
endLine = end.line
endColumn = end.column
endOffset = this.fromLineAndColumn(end.line, end.column)
}
} else if (!column) {
offset = line
let pos = this.fromOffset(offset)
line = pos.line
column = pos.col
} else {
offset = this.fromLineAndColumn(line, column)
}
let origin = this.origin(line, column, endLine, endColumn)
if (origin) {
result = new CssSyntaxError(
message,
origin.endLine === undefined
? origin.line
: { column: origin.column, line: origin.line },
origin.endLine === undefined
? origin.column
: { column: origin.endColumn, line: origin.endLine },
origin.source,
origin.file,
opts.plugin
)
} else {
result = new CssSyntaxError(
message,
endLine === undefined ? line : { column, line },
endLine === undefined ? column : { column: endColumn, line: endLine },
this.css,
this.file,
opts.plugin
)
}
result.input = { column, endColumn, endLine, endOffset, line, offset, source: this.css }
if (this.file) {
if (pathToFileURL) {
result.input.url = pathToFileURL(this.file).toString()
}
result.input.file = this.file
}
return result
}
fromLineAndColumn(line, column) {
let lineToIndex = getLineToIndex(this)
let index = lineToIndex[line - 1]
return index + column - 1
}
fromOffset(offset) {
let lineToIndex = getLineToIndex(this)
let lastLine = lineToIndex[lineToIndex.length - 1]
let min = 0
if (offset >= lastLine) {
min = lineToIndex.length - 1
} else {
let max = lineToIndex.length - 2
let mid
while (min < max) {
mid = min + ((max - min) >> 1)
if (offset < lineToIndex[mid]) {
max = mid - 1
} else if (offset >= lineToIndex[mid + 1]) {
min = mid + 1
} else {
min = mid
break
}
}
}
return {
col: offset - lineToIndex[min] + 1,
line: min + 1
}
}
mapResolve(file) {
if (/^\w+:\/\//.test(file)) {
return file
}
return resolve(this.map.consumer().sourceRoot || this.map.root || '.', file)
}
origin(line, column, endLine, endColumn) {
if (!this.map) return false
let consumer = this.map.consumer()
let from = consumer.originalPositionFor({ column, line })
if (!from.source) return false
let to
if (typeof endLine === 'number') {
to = consumer.originalPositionFor({ column: endColumn, line: endLine })
}
let fromUrl
if (isAbsolute(from.source)) {
fromUrl = pathToFileURL(from.source)
} else {
fromUrl = new URL(
from.source,
this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile)
)
}
let result = {
column: from.column,
endColumn: to && to.column,
endLine: to && to.line,
line: from.line,
url: fromUrl.toString()
}
if (fromUrl.protocol === 'file:') {
if (fileURLToPath) {
result.file = fileURLToPath(fromUrl)
} else {
/* c8 ignore next 2 */
throw new Error(`file: protocol is not available in this PostCSS build`)
}
}
let source = consumer.sourceContentFor(from.source)
if (source) result.source = source
return result
}
toJSON() {
let json = {}
for (let name of ['hasBOM', 'css', 'file', 'id']) {
if (this[name] != null) {
json[name] = this[name]
}
}
if (this.map) {
json.map = { ...this.map }
if (json.map.consumerCache) {
json.map.consumerCache = undefined
}
}
return json
}
}
module.exports = Input
Input.default = Input
if (terminalHighlight && terminalHighlight.registerInput) {
terminalHighlight.registerInput(Input)
}
/***/ }),
/***/ 5404:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
const CSSValueParser = __webpack_require__(1544)
/**
* @type {import('postcss').PluginCreator}
*/
module.exports = (opts) => {
const DEFAULTS = {
skipHostRelativeUrls: true,
}
const config = Object.assign(DEFAULTS, opts)
return {
postcssPlugin: 'rebaseUrl',
Declaration(decl) {
// The faster way to find Declaration node
const parsedValue = CSSValueParser(decl.value)
let valueChanged = false
parsedValue.walk(node => {
if (node.type !== 'function' || node.value !== 'url') {
return
}
const urlVal = node.nodes[0].value
// bases relative URLs with rootUrl
const basedUrl = new URL(urlVal, opts.rootUrl)
// skip host-relative, already normalized URLs (e.g. `/images/image.jpg`, without `..`s)
if ((basedUrl.pathname === urlVal) && config.skipHostRelativeUrls) {
return false // skip this value
}
node.nodes[0].value = basedUrl.toString()
valueChanged = true
return false // do not walk deeper
})
if (valueChanged) {
decl.value = CSSValueParser.stringify(parsedValue)
}
}
}
}
module.exports.postcss = true
/***/ }),
/***/ 5417:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
/*istanbul ignore start*/
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = Diff;
/*istanbul ignore end*/
function Diff() {}
Diff.prototype = {
/*istanbul ignore start*/
/*istanbul ignore end*/
diff: function diff(oldString, newString) {
/*istanbul ignore start*/
var
/*istanbul ignore end*/
options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var callback = options.callback;
if (typeof options === 'function') {
callback = options;
options = {};
}
this.options = options;
var self = this;
function done(value) {
if (callback) {
setTimeout(function () {
callback(undefined, value);
}, 0);
return true;
} else {
return value;
}
} // Allow subclasses to massage the input prior to running
oldString = this.castInput(oldString);
newString = this.castInput(newString);
oldString = this.removeEmpty(this.tokenize(oldString));
newString = this.removeEmpty(this.tokenize(newString));
var newLen = newString.length,
oldLen = oldString.length;
var editLength = 1;
var maxEditLength = newLen + oldLen;
var bestPath = [{
newPos: -1,
components: []
}]; // Seed editLength = 0, i.e. the content starts with the same values
var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
// Identity per the equality and tokenizer
return done([{
value: this.join(newString),
count: newString.length
}]);
} // Main worker method. checks all permutations of a given edit length for acceptance.
function execEditLength() {
for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
var basePath =
/*istanbul ignore start*/
void 0
/*istanbul ignore end*/
;
var addPath = bestPath[diagonalPath - 1],
removePath = bestPath[diagonalPath + 1],
_oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
if (addPath) {
// No one else is going to attempt to use this value, clear it
bestPath[diagonalPath - 1] = undefined;
}
var canAdd = addPath && addPath.newPos + 1 < newLen,
canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
if (!canAdd && !canRemove) {
// If this path is a terminal then prune
bestPath[diagonalPath] = undefined;
continue;
} // Select the diagonal that we want to branch from. We select the prior
// path whose position in the new string is the farthest from the origin
// and does not pass the bounds of the diff graph
if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
basePath = clonePath(removePath);
self.pushComponent(basePath.components, undefined, true);
} else {
basePath = addPath; // No need to clone, we've pulled it from the list
basePath.newPos++;
self.pushComponent(basePath.components, true, undefined);
}
_oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done
if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));
} else {
// Otherwise track this path as a potential candidate and continue.
bestPath[diagonalPath] = basePath;
}
}
editLength++;
} // Performs the length of edit iteration. Is a bit fugly as this has to support the
// sync and async mode which is never fun. Loops over execEditLength until a value
// is produced.
if (callback) {
(function exec() {
setTimeout(function () {
// This should not happen, but we want to be safe.
/* istanbul ignore next */
if (editLength > maxEditLength) {
return callback();
}
if (!execEditLength()) {
exec();
}
}, 0);
})();
} else {
while (editLength <= maxEditLength) {
var ret = execEditLength();
if (ret) {
return ret;
}
}
}
},
/*istanbul ignore start*/
/*istanbul ignore end*/
pushComponent: function pushComponent(components, added, removed) {
var last = components[components.length - 1];
if (last && last.added === added && last.removed === removed) {
// We need to clone here as the component clone operation is just
// as shallow array clone
components[components.length - 1] = {
count: last.count + 1,
added: added,
removed: removed
};
} else {
components.push({
count: 1,
added: added,
removed: removed
});
}
},
/*istanbul ignore start*/
/*istanbul ignore end*/
extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
var newLen = newString.length,
oldLen = oldString.length,
newPos = basePath.newPos,
oldPos = newPos - diagonalPath,
commonCount = 0;
while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
newPos++;
oldPos++;
commonCount++;
}
if (commonCount) {
basePath.components.push({
count: commonCount
});
}
basePath.newPos = newPos;
return oldPos;
},
/*istanbul ignore start*/
/*istanbul ignore end*/
equals: function equals(left, right) {
if (this.options.comparator) {
return this.options.comparator(left, right);
} else {
return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
}
},
/*istanbul ignore start*/
/*istanbul ignore end*/
removeEmpty: function removeEmpty(array) {
var ret = [];
for (var i = 0; i < array.length; i++) {
if (array[i]) {
ret.push(array[i]);
}
}
return ret;
},
/*istanbul ignore start*/
/*istanbul ignore end*/
castInput: function castInput(value) {
return value;
},
/*istanbul ignore start*/
/*istanbul ignore end*/
tokenize: function tokenize(value) {
return value.split('');
},
/*istanbul ignore start*/
/*istanbul ignore end*/
join: function join(chars) {
return chars.join('');
}
};
function buildValues(diff, components, newString, oldString, useLongestToken) {
var componentPos = 0,
componentLen = components.length,
newPos = 0,
oldPos = 0;
for (; componentPos < componentLen; componentPos++) {
var component = components[componentPos];
if (!component.removed) {
if (!component.added && useLongestToken) {
var value = newString.slice(newPos, newPos + component.count);
value = value.map(function (value, i) {
var oldValue = oldString[oldPos + i];
return oldValue.length > value.length ? oldValue : value;
});
component.value = diff.join(value);
} else {
component.value = diff.join(newString.slice(newPos, newPos + component.count));
}
newPos += component.count; // Common case
if (!component.added) {
oldPos += component.count;
}
} else {
component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
oldPos += component.count; // Reverse add and remove so removes are output first to match common convention
// The diffing algorithm is tied to add then remove output and this is the simplest
// route to get the desired output with minimal overhead.
if (componentPos && components[componentPos - 1].added) {
var tmp = components[componentPos - 1];
components[componentPos - 1] = components[componentPos];
components[componentPos] = tmp;
}
}
} // Special case handle for when one terminal is ignored (i.e. whitespace).
// For this case we merge the terminal into the prior string and drop the change.
// This is only available for string mode.
var lastComponent = components[componentLen - 1];
if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) {
components[componentLen - 2].value += lastComponent.value;
components.pop();
}
return components;
}
function clonePath(path) {
return {
newPos: path.newPos,
components: path.components.slice(0)
};
}
/***/ }),
/***/ 5696:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let { existsSync, readFileSync } = __webpack_require__(9977)
let { dirname, join } = __webpack_require__(197)
let { SourceMapConsumer, SourceMapGenerator } = __webpack_require__(1866)
function fromBase64(str) {
if (Buffer) {
return Buffer.from(str, 'base64').toString()
} else {
/* c8 ignore next 2 */
return window.atob(str)
}
}
class PreviousMap {
constructor(css, opts) {
if (opts.map === false) return
this.loadAnnotation(css)
this.inline = this.startWith(this.annotation, 'data:')
let prev = opts.map ? opts.map.prev : undefined
let text = this.loadMap(opts.from, prev)
if (!this.mapFile && opts.from) {
this.mapFile = opts.from
}
if (this.mapFile) this.root = dirname(this.mapFile)
if (text) this.text = text
}
consumer() {
if (!this.consumerCache) {
this.consumerCache = new SourceMapConsumer(this.text)
}
return this.consumerCache
}
decodeInline(text) {
let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/
let baseUri = /^data:application\/json;base64,/
let charsetUri = /^data:application\/json;charset=utf-?8,/
let uri = /^data:application\/json,/
let uriMatch = text.match(charsetUri) || text.match(uri)
if (uriMatch) {
return decodeURIComponent(text.substr(uriMatch[0].length))
}
let baseUriMatch = text.match(baseCharsetUri) || text.match(baseUri)
if (baseUriMatch) {
return fromBase64(text.substr(baseUriMatch[0].length))
}
let encoding = text.match(/data:application\/json;([^,]+),/)[1]
throw new Error('Unsupported source map encoding ' + encoding)
}
getAnnotationURL(sourceMapString) {
return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, '').trim()
}
isMap(map) {
if (typeof map !== 'object') return false
return (
typeof map.mappings === 'string' ||
typeof map._mappings === 'string' ||
Array.isArray(map.sections)
)
}
loadAnnotation(css) {
let comments = css.match(/\/\*\s*# sourceMappingURL=/g)
if (!comments) return
// sourceMappingURLs from comments, strings, etc.
let start = css.lastIndexOf(comments.pop())
let end = css.indexOf('*/', start)
if (start > -1 && end > -1) {
// Locate the last sourceMappingURL to avoid pickin
this.annotation = this.getAnnotationURL(css.substring(start, end))
}
}
loadFile(path) {
this.root = dirname(path)
if (existsSync(path)) {
this.mapFile = path
return readFileSync(path, 'utf-8').toString().trim()
}
}
loadMap(file, prev) {
if (prev === false) return false
if (prev) {
if (typeof prev === 'string') {
return prev
} else if (typeof prev === 'function') {
let prevPath = prev(file)
if (prevPath) {
let map = this.loadFile(prevPath)
if (!map) {
throw new Error(
'Unable to load previous source map: ' + prevPath.toString()
)
}
return map
}
} else if (prev instanceof SourceMapConsumer) {
return SourceMapGenerator.fromSourceMap(prev).toString()
} else if (prev instanceof SourceMapGenerator) {
return prev.toString()
} else if (this.isMap(prev)) {
return JSON.stringify(prev)
} else {
throw new Error(
'Unsupported previous source map format: ' + prev.toString()
)
}
} else if (this.inline) {
return this.decodeInline(this.annotation)
} else if (this.annotation) {
let map = this.annotation
if (file) map = join(dirname(file), map)
return this.loadFile(map)
}
}
startWith(string, start) {
if (!string) return false
return string.substr(0, start.length) === start
}
withContent() {
return !!(
this.consumer().sourcesContent &&
this.consumer().sourcesContent.length > 0
)
}
}
module.exports = PreviousMap
PreviousMap.default = PreviousMap
/***/ }),
/***/ 5776:
/***/ ((module) => {
"use strict";
class Warning {
constructor(text, opts = {}) {
this.type = 'warning'
this.text = text
if (opts.node && opts.node.source) {
let range = opts.node.rangeBy(opts)
this.line = range.start.line
this.column = range.start.column
this.endLine = range.end.line
this.endColumn = range.end.column
}
for (let opt in opts) this[opt] = opts[opt]
}
toString() {
if (this.node) {
return this.node.error(this.text, {
index: this.index,
plugin: this.plugin,
word: this.word
}).message
}
if (this.plugin) {
return this.plugin + ': ' + this.text
}
return this.text
}
}
module.exports = Warning
Warning.default = Warning
/***/ }),
/***/ 5826:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
if (false) { var throwOnDirectAccess, ReactIs; } else {
// By explicitly using `prop-types` you are opting into new production behavior.
// http://fb.me/prop-types-in-prod
module.exports = __webpack_require__(628)();
}
/***/ }),
/***/ 6109:
/***/ ((module) => {
// This code has been refactored for 140 bytes
// You can see the original here: https://github.com/twolfson/computedStyle/blob/04cd1da2e30fa45844f95f5cb1ac898e9b9ef050/lib/computedStyle.js
var computedStyle = function (el, prop, getComputedStyle) {
getComputedStyle = window.getComputedStyle;
// In one fell swoop
return (
// If we have getComputedStyle
getComputedStyle ?
// Query it
// TODO: From CSS-Query notes, we might need (node, null) for FF
getComputedStyle(el) :
// Otherwise, we are in IE and use currentStyle
el.currentStyle
)[
// Switch to camelCase for CSSOM
// DEV: Grabbed from jQuery
// https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194
// https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597
prop.replace(/-(\w)/gi, function (word, letter) {
return letter.toUpperCase();
})
];
};
module.exports = computedStyle;
/***/ }),
/***/ 6589:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let Node = __webpack_require__(7490)
class Comment extends Node {
constructor(defaults) {
super(defaults)
this.type = 'comment'
}
}
module.exports = Comment
Comment.default = Comment
/***/ }),
/***/ 7191:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
/**
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule normalizeWheel
* @typechecks
*/
var UserAgent_DEPRECATED = __webpack_require__(2213);
var isEventSupported = __webpack_require__(1087);
// Reasonable defaults
var PIXEL_STEP = 10;
var LINE_HEIGHT = 40;
var PAGE_HEIGHT = 800;
/**
* Mouse wheel (and 2-finger trackpad) support on the web sucks. It is
* complicated, thus this doc is long and (hopefully) detailed enough to answer
* your questions.
*
* If you need to react to the mouse wheel in a predictable way, this code is
* like your bestest friend. * hugs *
*
* As of today, there are 4 DOM event types you can listen to:
*
* 'wheel' -- Chrome(31+), FF(17+), IE(9+)
* 'mousewheel' -- Chrome, IE(6+), Opera, Safari
* 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother!
* 'DOMMouseScroll' -- FF(0.9.7+) since 2003
*
* So what to do? The is the best:
*
* normalizeWheel.getEventType();
*
* In your event callback, use this code to get sane interpretation of the
* deltas. This code will return an object with properties:
*
* spinX -- normalized spin speed (use for zoom) - x plane
* spinY -- " - y plane
* pixelX -- normalized distance (to pixels) - x plane
* pixelY -- " - y plane
*
* Wheel values are provided by the browser assuming you are using the wheel to
* scroll a web page by a number of lines or pixels (or pages). Values can vary
* significantly on different platforms and browsers, forgetting that you can
* scroll at different speeds. Some devices (like trackpads) emit more events
* at smaller increments with fine granularity, and some emit massive jumps with
* linear speed or acceleration.
*
* This code does its best to normalize the deltas for you:
*
* - spin is trying to normalize how far the wheel was spun (or trackpad
* dragged). This is super useful for zoom support where you want to
* throw away the chunky scroll steps on the PC and make those equal to
* the slow and smooth tiny steps on the Mac. Key data: This code tries to
* resolve a single slow step on a wheel to 1.
*
* - pixel is normalizing the desired scroll delta in pixel units. You'll
* get the crazy differences between browsers, but at least it'll be in
* pixels!
*
* - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This
* should translate to positive value zooming IN, negative zooming OUT.
* This matches the newer 'wheel' event.
*
* Why are there spinX, spinY (or pixels)?
*
* - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn
* with a mouse. It results in side-scrolling in the browser by default.
*
* - spinY is what you expect -- it's the classic axis of a mouse wheel.
*
* - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and
* probably is by browsers in conjunction with fancy 3D controllers .. but
* you know.
*
* Implementation info:
*
* Examples of 'wheel' event if you scroll slowly (down) by one step with an
* average mouse:
*
* OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120)
* OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12)
* OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A)
* Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120)
* Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120)
*
* On the trackpad:
*
* OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6)
* OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A)
*
* On other/older browsers.. it's more complicated as there can be multiple and
* also missing delta values.
*
* The 'wheel' event is more standard:
*
* http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents
*
* The basics is that it includes a unit, deltaMode (pixels, lines, pages), and
* deltaX, deltaY and deltaZ. Some browsers provide other values to maintain
* backward compatibility with older events. Those other values help us
* better normalize spin speed. Example of what the browsers provide:
*
* | event.wheelDelta | event.detail
* ------------------+------------------+--------------
* Safari v5/OS X | -120 | 0
* Safari v5/Win7 | -120 | 0
* Chrome v17/OS X | -120 | 0
* Chrome v17/Win7 | -120 | 0
* IE9/Win7 | -120 | undefined
* Firefox v4/OS X | undefined | 1
* Firefox v4/Win7 | undefined | 3
*
*/
function normalizeWheel(/*object*/ event) /*object*/ {
var sX = 0, sY = 0, // spinX, spinY
pX = 0, pY = 0; // pixelX, pixelY
// Legacy
if ('detail' in event) { sY = event.detail; }
if ('wheelDelta' in event) { sY = -event.wheelDelta / 120; }
if ('wheelDeltaY' in event) { sY = -event.wheelDeltaY / 120; }
if ('wheelDeltaX' in event) { sX = -event.wheelDeltaX / 120; }
// side scrolling on FF with DOMMouseScroll
if ( 'axis' in event && event.axis === event.HORIZONTAL_AXIS ) {
sX = sY;
sY = 0;
}
pX = sX * PIXEL_STEP;
pY = sY * PIXEL_STEP;
if ('deltaY' in event) { pY = event.deltaY; }
if ('deltaX' in event) { pX = event.deltaX; }
if ((pX || pY) && event.deltaMode) {
if (event.deltaMode == 1) { // delta in LINE units
pX *= LINE_HEIGHT;
pY *= LINE_HEIGHT;
} else { // delta in PAGE units
pX *= PAGE_HEIGHT;
pY *= PAGE_HEIGHT;
}
}
// Fall-back if spin cannot be determined
if (pX && !sX) { sX = (pX < 1) ? -1 : 1; }
if (pY && !sY) { sY = (pY < 1) ? -1 : 1; }
return { spinX : sX,
spinY : sY,
pixelX : pX,
pixelY : pY };
}
/**
* The best combination if you prefer spinX + spinY normalization. It favors
* the older DOMMouseScroll for Firefox, as FF does not include wheelDelta with
* 'wheel' event, making spin speed determination impossible.
*/
normalizeWheel.getEventType = function() /*string*/ {
return (UserAgent_DEPRECATED.firefox())
? 'DOMMouseScroll'
: (isEventSupported('wheel'))
? 'wheel'
: 'mousewheel';
};
module.exports = normalizeWheel;
/***/ }),
/***/ 7374:
/***/ ((module) => {
"use strict";
let list = {
comma(string) {
return list.split(string, [','], true)
},
space(string) {
let spaces = [' ', '\n', '\t']
return list.split(string, spaces)
},
split(string, separators, last) {
let array = []
let current = ''
let split = false
let func = 0
let inQuote = false
let prevQuote = ''
let escape = false
for (let letter of string) {
if (escape) {
escape = false
} else if (letter === '\\') {
escape = true
} else if (inQuote) {
if (letter === prevQuote) {
inQuote = false
}
} else if (letter === '"' || letter === "'") {
inQuote = true
prevQuote = letter
} else if (letter === '(') {
func += 1
} else if (letter === ')') {
if (func > 0) func -= 1
} else if (func === 0) {
if (separators.includes(letter)) split = true
}
if (split) {
if (current !== '') array.push(current.trim())
current = ''
split = false
} else {
current += letter
}
}
if (last || current !== '') array.push(current.trim())
return array
}
}
module.exports = list
list.default = list
/***/ }),
/***/ 7490:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let CssSyntaxError = __webpack_require__(356)
let Stringifier = __webpack_require__(346)
let stringify = __webpack_require__(633)
let { isClean, my } = __webpack_require__(1381)
function cloneNode(obj, parent) {
let cloned = new obj.constructor()
for (let i in obj) {
if (!Object.prototype.hasOwnProperty.call(obj, i)) {
/* c8 ignore next 2 */
continue
}
if (i === 'proxyCache') continue
let value = obj[i]
let type = typeof value
if (i === 'parent' && type === 'object') {
if (parent) cloned[i] = parent
} else if (i === 'source') {
cloned[i] = value
} else if (Array.isArray(value)) {
cloned[i] = value.map(j => cloneNode(j, cloned))
} else {
if (type === 'object' && value !== null) value = cloneNode(value)
cloned[i] = value
}
}
return cloned
}
function sourceOffset(inputCSS, position) {
// Not all custom syntaxes support `offset` in `source.start` and `source.end`
if (position && typeof position.offset !== 'undefined') {
return position.offset
}
let column = 1
let line = 1
let offset = 0
for (let i = 0; i < inputCSS.length; i++) {
if (line === position.line && column === position.column) {
offset = i
break
}
if (inputCSS[i] === '\n') {
column = 1
line += 1
} else {
column += 1
}
}
return offset
}
class Node {
get proxyOf() {
return this
}
constructor(defaults = {}) {
this.raws = {}
this[isClean] = false
this[my] = true
for (let name in defaults) {
if (name === 'nodes') {
this.nodes = []
for (let node of defaults[name]) {
if (typeof node.clone === 'function') {
this.append(node.clone())
} else {
this.append(node)
}
}
} else {
this[name] = defaults[name]
}
}
}
addToError(error) {
error.postcssNode = this
if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) {
let s = this.source
error.stack = error.stack.replace(
/\n\s{4}at /,
`$&${s.input.from}:${s.start.line}:${s.start.column}$&`
)
}
return error
}
after(add) {
this.parent.insertAfter(this, add)
return this
}
assign(overrides = {}) {
for (let name in overrides) {
this[name] = overrides[name]
}
return this
}
before(add) {
this.parent.insertBefore(this, add)
return this
}
cleanRaws(keepBetween) {
delete this.raws.before
delete this.raws.after
if (!keepBetween) delete this.raws.between
}
clone(overrides = {}) {
let cloned = cloneNode(this)
for (let name in overrides) {
cloned[name] = overrides[name]
}
return cloned
}
cloneAfter(overrides = {}) {
let cloned = this.clone(overrides)
this.parent.insertAfter(this, cloned)
return cloned
}
cloneBefore(overrides = {}) {
let cloned = this.clone(overrides)
this.parent.insertBefore(this, cloned)
return cloned
}
error(message, opts = {}) {
if (this.source) {
let { end, start } = this.rangeBy(opts)
return this.source.input.error(
message,
{ column: start.column, line: start.line },
{ column: end.column, line: end.line },
opts
)
}
return new CssSyntaxError(message)
}
getProxyProcessor() {
return {
get(node, prop) {
if (prop === 'proxyOf') {
return node
} else if (prop === 'root') {
return () => node.root().toProxy()
} else {
return node[prop]
}
},
set(node, prop, value) {
if (node[prop] === value) return true
node[prop] = value
if (
prop === 'prop' ||
prop === 'value' ||
prop === 'name' ||
prop === 'params' ||
prop === 'important' ||
/* c8 ignore next */
prop === 'text'
) {
node.markDirty()
}
return true
}
}
}
/* c8 ignore next 3 */
markClean() {
this[isClean] = true
}
markDirty() {
if (this[isClean]) {
this[isClean] = false
let next = this
while ((next = next.parent)) {
next[isClean] = false
}
}
}
next() {
if (!this.parent) return undefined
let index = this.parent.index(this)
return this.parent.nodes[index + 1]
}
positionBy(opts = {}) {
let pos = this.source.start
if (opts.index) {
pos = this.positionInside(opts.index)
} else if (opts.word) {
let inputString =
'document' in this.source.input
? this.source.input.document
: this.source.input.css
let stringRepresentation = inputString.slice(
sourceOffset(inputString, this.source.start),
sourceOffset(inputString, this.source.end)
)
let index = stringRepresentation.indexOf(opts.word)
if (index !== -1) pos = this.positionInside(index)
}
return pos
}
positionInside(index) {
let column = this.source.start.column
let line = this.source.start.line
let inputString =
'document' in this.source.input
? this.source.input.document
: this.source.input.css
let offset = sourceOffset(inputString, this.source.start)
let end = offset + index
for (let i = offset; i < end; i++) {
if (inputString[i] === '\n') {
column = 1
line += 1
} else {
column += 1
}
}
return { column, line, offset: end }
}
prev() {
if (!this.parent) return undefined
let index = this.parent.index(this)
return this.parent.nodes[index - 1]
}
rangeBy(opts = {}) {
let inputString =
'document' in this.source.input
? this.source.input.document
: this.source.input.css
let start = {
column: this.source.start.column,
line: this.source.start.line,
offset: sourceOffset(inputString, this.source.start)
}
let end = this.source.end
? {
column: this.source.end.column + 1,
line: this.source.end.line,
offset:
typeof this.source.end.offset === 'number'
? // `source.end.offset` is exclusive, so we don't need to add 1
this.source.end.offset
: // Since line/column in this.source.end is inclusive,
// the `sourceOffset(... , this.source.end)` returns an inclusive offset.
// So, we add 1 to convert it to exclusive.
sourceOffset(inputString, this.source.end) + 1
}
: {
column: start.column + 1,
line: start.line,
offset: start.offset + 1
}
if (opts.word) {
let stringRepresentation = inputString.slice(
sourceOffset(inputString, this.source.start),
sourceOffset(inputString, this.source.end)
)
let index = stringRepresentation.indexOf(opts.word)
if (index !== -1) {
start = this.positionInside(index)
end = this.positionInside(index + opts.word.length)
}
} else {
if (opts.start) {
start = {
column: opts.start.column,
line: opts.start.line,
offset: sourceOffset(inputString, opts.start)
}
} else if (opts.index) {
start = this.positionInside(opts.index)
}
if (opts.end) {
end = {
column: opts.end.column,
line: opts.end.line,
offset: sourceOffset(inputString, opts.end)
}
} else if (typeof opts.endIndex === 'number') {
end = this.positionInside(opts.endIndex)
} else if (opts.index) {
end = this.positionInside(opts.index + 1)
}
}
if (
end.line < start.line ||
(end.line === start.line && end.column <= start.column)
) {
end = {
column: start.column + 1,
line: start.line,
offset: start.offset + 1
}
}
return { end, start }
}
raw(prop, defaultType) {
let str = new Stringifier()
return str.raw(this, prop, defaultType)
}
remove() {
if (this.parent) {
this.parent.removeChild(this)
}
this.parent = undefined
return this
}
replaceWith(...nodes) {
if (this.parent) {
let bookmark = this
let foundSelf = false
for (let node of nodes) {
if (node === this) {
foundSelf = true
} else if (foundSelf) {
this.parent.insertAfter(bookmark, node)
bookmark = node
} else {
this.parent.insertBefore(bookmark, node)
}
}
if (!foundSelf) {
this.remove()
}
}
return this
}
root() {
let result = this
while (result.parent && result.parent.type !== 'document') {
result = result.parent
}
return result
}
toJSON(_, inputs) {
let fixed = {}
let emitInputs = inputs == null
inputs = inputs || new Map()
let inputsNextIndex = 0
for (let name in this) {
if (!Object.prototype.hasOwnProperty.call(this, name)) {
/* c8 ignore next 2 */
continue
}
if (name === 'parent' || name === 'proxyCache') continue
let value = this[name]
if (Array.isArray(value)) {
fixed[name] = value.map(i => {
if (typeof i === 'object' && i.toJSON) {
return i.toJSON(null, inputs)
} else {
return i
}
})
} else if (typeof value === 'object' && value.toJSON) {
fixed[name] = value.toJSON(null, inputs)
} else if (name === 'source') {
if (value == null) continue
let inputId = inputs.get(value.input)
if (inputId == null) {
inputId = inputsNextIndex
inputs.set(value.input, inputsNextIndex)
inputsNextIndex++
}
fixed[name] = {
end: value.end,
inputId,
start: value.start
}
} else {
fixed[name] = value
}
}
if (emitInputs) {
fixed.inputs = [...inputs.keys()].map(input => input.toJSON())
}
return fixed
}
toProxy() {
if (!this.proxyCache) {
this.proxyCache = new Proxy(this, this.getProxyProcessor())
}
return this.proxyCache
}
toString(stringifier = stringify) {
if (stringifier.stringify) stringifier = stringifier.stringify
let result = ''
stringifier(this, i => {
result += i
})
return result
}
warn(result, text, opts = {}) {
let data = { node: this }
for (let i in opts) data[i] = opts[i]
return result.warn(text, data)
}
}
module.exports = Node
Node.default = Node
/***/ }),
/***/ 7520:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
module.exports = __webpack_require__(7191);
/***/ }),
/***/ 7661:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let MapGenerator = __webpack_require__(1670)
let parse = __webpack_require__(4295)
const Result = __webpack_require__(9055)
let stringify = __webpack_require__(633)
let warnOnce = __webpack_require__(3122)
class NoWorkResult {
get content() {
return this.result.css
}
get css() {
return this.result.css
}
get map() {
return this.result.map
}
get messages() {
return []
}
get opts() {
return this.result.opts
}
get processor() {
return this.result.processor
}
get root() {
if (this._root) {
return this._root
}
let root
let parser = parse
try {
root = parser(this._css, this._opts)
} catch (error) {
this.error = error
}
if (this.error) {
throw this.error
} else {
this._root = root
return root
}
}
get [Symbol.toStringTag]() {
return 'NoWorkResult'
}
constructor(processor, css, opts) {
css = css.toString()
this.stringified = false
this._processor = processor
this._css = css
this._opts = opts
this._map = undefined
let root
let str = stringify
this.result = new Result(this._processor, root, this._opts)
this.result.css = css
let self = this
Object.defineProperty(this.result, 'root', {
get() {
return self.root
}
})
let map = new MapGenerator(str, root, this._opts, css)
if (map.isMap()) {
let [generatedCSS, generatedMap] = map.generate()
if (generatedCSS) {
this.result.css = generatedCSS
}
if (generatedMap) {
this.result.map = generatedMap
}
} else {
map.clearAnnotation()
this.result.css = map.css
}
}
async() {
if (this.error) return Promise.reject(this.error)
return Promise.resolve(this.result)
}
catch(onRejected) {
return this.async().catch(onRejected)
}
finally(onFinally) {
return this.async().then(onFinally, onFinally)
}
sync() {
if (this.error) throw this.error
return this.result
}
then(onFulfilled, onRejected) {
if (false) {}
return this.async().then(onFulfilled, onRejected)
}
toString() {
return this._css
}
warnings() {
return []
}
}
module.exports = NoWorkResult
NoWorkResult.default = NoWorkResult
/***/ }),
/***/ 7734:
/***/ ((module) => {
"use strict";
// do not edit .js files directly - edit src/index.jst
var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';
module.exports = function equal(a, b) {
if (a === b) return true;
if (a && b && typeof a == 'object' && typeof b == 'object') {
if (a.constructor !== b.constructor) return false;
var length, i, keys;
if (Array.isArray(a)) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0;)
if (!equal(a[i], b[i])) return false;
return true;
}
if ((a instanceof Map) && (b instanceof Map)) {
if (a.size !== b.size) return false;
for (i of a.entries())
if (!b.has(i[0])) return false;
for (i of a.entries())
if (!equal(i[1], b.get(i[0]))) return false;
return true;
}
if ((a instanceof Set) && (b instanceof Set)) {
if (a.size !== b.size) return false;
for (i of a.entries())
if (!b.has(i[0])) return false;
return true;
}
if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0;)
if (a[i] !== b[i]) return false;
return true;
}
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
keys = Object.keys(a);
length = keys.length;
if (length !== Object.keys(b).length) return false;
for (i = length; i-- !== 0;)
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
for (i = length; i-- !== 0;) {
var key = keys[i];
if (!equal(a[key], b[key])) return false;
}
return true;
}
// true if both NaN, false otherwise
return a!==a && b!==b;
};
/***/ }),
/***/ 8021:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
var __webpack_unused_export__;
/*istanbul ignore start*/
__webpack_unused_export__ = ({
value: true
});
exports.JJ = diffChars;
__webpack_unused_export__ = void 0;
/*istanbul ignore end*/
var
/*istanbul ignore start*/
_base = _interopRequireDefault(__webpack_require__(5417))
/*istanbul ignore end*/
;
/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/*istanbul ignore end*/
var characterDiff = new
/*istanbul ignore start*/
_base
/*istanbul ignore end*/
.
/*istanbul ignore start*/
default
/*istanbul ignore end*/
();
/*istanbul ignore start*/
__webpack_unused_export__ = characterDiff;
/*istanbul ignore end*/
function diffChars(oldStr, newStr, options) {
return characterDiff.diff(oldStr, newStr, options);
}
/***/ }),
/***/ 8202:
/***/ ((module) => {
"use strict";
/**
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule ExecutionEnvironment
*/
/*jslint evil: true */
var canUseDOM = !!(
typeof window !== 'undefined' &&
window.document &&
window.document.createElement
);
/**
* Simple, lightweight module assisting with the detection and context of
* Worker. Helps avoid circular dependencies and allows code to reason about
* whether or not they are in a Worker, even if they never include the main
* `ReactWorker` dependency.
*/
var ExecutionEnvironment = {
canUseDOM: canUseDOM,
canUseWorkers: typeof Worker !== 'undefined',
canUseEventListeners:
canUseDOM && !!(window.addEventListener || window.attachEvent),
canUseViewport: canUseDOM && !!window.screen,
isInWorker: !canUseDOM // For now, this is true - might change in the future.
};
module.exports = ExecutionEnvironment;
/***/ }),
/***/ 8491:
/***/ ((module) => {
var openParentheses = "(".charCodeAt(0);
var closeParentheses = ")".charCodeAt(0);
var singleQuote = "'".charCodeAt(0);
var doubleQuote = '"'.charCodeAt(0);
var backslash = "\\".charCodeAt(0);
var slash = "/".charCodeAt(0);
var comma = ",".charCodeAt(0);
var colon = ":".charCodeAt(0);
var star = "*".charCodeAt(0);
var uLower = "u".charCodeAt(0);
var uUpper = "U".charCodeAt(0);
var plus = "+".charCodeAt(0);
var isUnicodeRange = /^[a-f0-9?-]+$/i;
module.exports = function(input) {
var tokens = [];
var value = input;
var next,
quote,
prev,
token,
escape,
escapePos,
whitespacePos,
parenthesesOpenPos;
var pos = 0;
var code = value.charCodeAt(pos);
var max = value.length;
var stack = [{ nodes: tokens }];
var balanced = 0;
var parent;
var name = "";
var before = "";
var after = "";
while (pos < max) {
// Whitespaces
if (code <= 32) {
next = pos;
do {
next += 1;
code = value.charCodeAt(next);
} while (code <= 32);
token = value.slice(pos, next);
prev = tokens[tokens.length - 1];
if (code === closeParentheses && balanced) {
after = token;
} else if (prev && prev.type === "div") {
prev.after = token;
prev.sourceEndIndex += token.length;
} else if (
code === comma ||
code === colon ||
(code === slash &&
value.charCodeAt(next + 1) !== star &&
(!parent ||
(parent && parent.type === "function" && parent.value !== "calc")))
) {
before = token;
} else {
tokens.push({
type: "space",
sourceIndex: pos,
sourceEndIndex: next,
value: token
});
}
pos = next;
// Quotes
} else if (code === singleQuote || code === doubleQuote) {
next = pos;
quote = code === singleQuote ? "'" : '"';
token = {
type: "string",
sourceIndex: pos,
quote: quote
};
do {
escape = false;
next = value.indexOf(quote, next + 1);
if (~next) {
escapePos = next;
while (value.charCodeAt(escapePos - 1) === backslash) {
escapePos -= 1;
escape = !escape;
}
} else {
value += quote;
next = value.length - 1;
token.unclosed = true;
}
} while (escape);
token.value = value.slice(pos + 1, next);
token.sourceEndIndex = token.unclosed ? next : next + 1;
tokens.push(token);
pos = next + 1;
code = value.charCodeAt(pos);
// Comments
} else if (code === slash && value.charCodeAt(pos + 1) === star) {
next = value.indexOf("*/", pos);
token = {
type: "comment",
sourceIndex: pos,
sourceEndIndex: next + 2
};
if (next === -1) {
token.unclosed = true;
next = value.length;
token.sourceEndIndex = next;
}
token.value = value.slice(pos + 2, next);
tokens.push(token);
pos = next + 2;
code = value.charCodeAt(pos);
// Operation within calc
} else if (
(code === slash || code === star) &&
parent &&
parent.type === "function" &&
parent.value === "calc"
) {
token = value[pos];
tokens.push({
type: "word",
sourceIndex: pos - before.length,
sourceEndIndex: pos + token.length,
value: token
});
pos += 1;
code = value.charCodeAt(pos);
// Dividers
} else if (code === slash || code === comma || code === colon) {
token = value[pos];
tokens.push({
type: "div",
sourceIndex: pos - before.length,
sourceEndIndex: pos + token.length,
value: token,
before: before,
after: ""
});
before = "";
pos += 1;
code = value.charCodeAt(pos);
// Open parentheses
} else if (openParentheses === code) {
// Whitespaces after open parentheses
next = pos;
do {
next += 1;
code = value.charCodeAt(next);
} while (code <= 32);
parenthesesOpenPos = pos;
token = {
type: "function",
sourceIndex: pos - name.length,
value: name,
before: value.slice(parenthesesOpenPos + 1, next)
};
pos = next;
if (name === "url" && code !== singleQuote && code !== doubleQuote) {
next -= 1;
do {
escape = false;
next = value.indexOf(")", next + 1);
if (~next) {
escapePos = next;
while (value.charCodeAt(escapePos - 1) === backslash) {
escapePos -= 1;
escape = !escape;
}
} else {
value += ")";
next = value.length - 1;
token.unclosed = true;
}
} while (escape);
// Whitespaces before closed
whitespacePos = next;
do {
whitespacePos -= 1;
code = value.charCodeAt(whitespacePos);
} while (code <= 32);
if (parenthesesOpenPos < whitespacePos) {
if (pos !== whitespacePos + 1) {
token.nodes = [
{
type: "word",
sourceIndex: pos,
sourceEndIndex: whitespacePos + 1,
value: value.slice(pos, whitespacePos + 1)
}
];
} else {
token.nodes = [];
}
if (token.unclosed && whitespacePos + 1 !== next) {
token.after = "";
token.nodes.push({
type: "space",
sourceIndex: whitespacePos + 1,
sourceEndIndex: next,
value: value.slice(whitespacePos + 1, next)
});
} else {
token.after = value.slice(whitespacePos + 1, next);
token.sourceEndIndex = next;
}
} else {
token.after = "";
token.nodes = [];
}
pos = next + 1;
token.sourceEndIndex = token.unclosed ? next : pos;
code = value.charCodeAt(pos);
tokens.push(token);
} else {
balanced += 1;
token.after = "";
token.sourceEndIndex = pos + 1;
tokens.push(token);
stack.push(token);
tokens = token.nodes = [];
parent = token;
}
name = "";
// Close parentheses
} else if (closeParentheses === code && balanced) {
pos += 1;
code = value.charCodeAt(pos);
parent.after = after;
parent.sourceEndIndex += after.length;
after = "";
balanced -= 1;
stack[stack.length - 1].sourceEndIndex = pos;
stack.pop();
parent = stack[balanced];
tokens = parent.nodes;
// Words
} else {
next = pos;
do {
if (code === backslash) {
next += 1;
}
next += 1;
code = value.charCodeAt(next);
} while (
next < max &&
!(
code <= 32 ||
code === singleQuote ||
code === doubleQuote ||
code === comma ||
code === colon ||
code === slash ||
code === openParentheses ||
(code === star &&
parent &&
parent.type === "function" &&
parent.value === "calc") ||
(code === slash &&
parent.type === "function" &&
parent.value === "calc") ||
(code === closeParentheses && balanced)
)
);
token = value.slice(pos, next);
if (openParentheses === code) {
name = token;
} else if (
(uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) &&
plus === token.charCodeAt(1) &&
isUnicodeRange.test(token.slice(2))
) {
tokens.push({
type: "unicode-range",
sourceIndex: pos,
sourceEndIndex: next,
value: token
});
} else {
tokens.push({
type: "word",
sourceIndex: pos,
sourceEndIndex: next,
value: token
});
}
pos = next;
}
}
for (pos = stack.length - 1; pos; pos -= 1) {
stack[pos].unclosed = true;
stack[pos].sourceEndIndex = value.length;
}
return stack[0].nodes;
};
/***/ }),
/***/ 9055:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let Warning = __webpack_require__(5776)
class Result {
get content() {
return this.css
}
constructor(processor, root, opts) {
this.processor = processor
this.messages = []
this.root = root
this.opts = opts
this.css = ''
this.map = undefined
}
toString() {
return this.css
}
warn(text, opts = {}) {
if (!opts.plugin) {
if (this.lastPlugin && this.lastPlugin.postcssPlugin) {
opts.plugin = this.lastPlugin.postcssPlugin
}
}
let warning = new Warning(text, opts)
this.messages.push(warning)
return warning
}
warnings() {
return this.messages.filter(i => i.type === 'warning')
}
}
module.exports = Result
Result.default = Result
/***/ }),
/***/ 9434:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let Container = __webpack_require__(683)
let LazyResult, Processor
class Root extends Container {
constructor(defaults) {
super(defaults)
this.type = 'root'
if (!this.nodes) this.nodes = []
}
normalize(child, sample, type) {
let nodes = super.normalize(child)
if (sample) {
if (type === 'prepend') {
if (this.nodes.length > 1) {
sample.raws.before = this.nodes[1].raws.before
} else {
delete sample.raws.before
}
} else if (this.first !== sample) {
for (let node of nodes) {
node.raws.before = sample.raws.before
}
}
}
return nodes
}
removeChild(child, ignore) {
let index = this.index(child)
if (!ignore && index === 0 && this.nodes.length > 1) {
this.nodes[1].raws.before = this.nodes[index].raws.before
}
return super.removeChild(child)
}
toResult(opts = {}) {
let lazy = new LazyResult(new Processor(), this, opts)
return lazy.stringify()
}
}
Root.registerLazyResult = dependant => {
LazyResult = dependant
}
Root.registerProcessor = dependant => {
Processor = dependant
}
module.exports = Root
Root.default = Root
Container.registerRoot(Root)
/***/ }),
/***/ 9656:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
let Document = __webpack_require__(271)
let LazyResult = __webpack_require__(448)
let NoWorkResult = __webpack_require__(7661)
let Root = __webpack_require__(9434)
class Processor {
constructor(plugins = []) {
this.version = '8.5.6'
this.plugins = this.normalize(plugins)
}
normalize(plugins) {
let normalized = []
for (let i of plugins) {
if (i.postcss === true) {
i = i()
} else if (i.postcss) {
i = i.postcss
}
if (typeof i === 'object' && Array.isArray(i.plugins)) {
normalized = normalized.concat(i.plugins)
} else if (typeof i === 'object' && i.postcssPlugin) {
normalized.push(i)
} else if (typeof i === 'function') {
normalized.push(i)
} else if (typeof i === 'object' && (i.parse || i.stringify)) {
if (false) {}
} else {
throw new Error(i + ' is not a PostCSS plugin')
}
}
return normalized
}
process(css, opts = {}) {
if (
!this.plugins.length &&
!opts.parser &&
!opts.stringifier &&
!opts.syntax
) {
return new NoWorkResult(this, css, opts)
} else {
return new LazyResult(this, css, opts)
}
}
use(plugin) {
this.plugins = this.plugins.concat(this.normalize([plugin]))
return this
}
}
module.exports = Processor
Processor.default = Processor
Root.registerProcessor(Processor)
Document.registerProcessor(Processor)
/***/ }),
/***/ 9681:
/***/ ((module) => {
var characterMap = {
"À": "A",
"Á": "A",
"Â": "A",
"Ã": "A",
"Ä": "A",
"Å": "A",
"Ấ": "A",
"Ắ": "A",
"Ẳ": "A",
"Ẵ": "A",
"Ặ": "A",
"Æ": "AE",
"Ầ": "A",
"Ằ": "A",
"Ȃ": "A",
"Ả": "A",
"Ạ": "A",
"Ẩ": "A",
"Ẫ": "A",
"Ậ": "A",
"Ç": "C",
"Ḉ": "C",
"È": "E",
"É": "E",
"Ê": "E",
"Ë": "E",
"Ế": "E",
"Ḗ": "E",
"Ề": "E",
"Ḕ": "E",
"Ḝ": "E",
"Ȇ": "E",
"Ẻ": "E",
"Ẽ": "E",
"Ẹ": "E",
"Ể": "E",
"Ễ": "E",
"Ệ": "E",
"Ì": "I",
"Í": "I",
"Î": "I",
"Ï": "I",
"Ḯ": "I",
"Ȋ": "I",
"Ỉ": "I",
"Ị": "I",
"Ð": "D",
"Ñ": "N",
"Ò": "O",
"Ó": "O",
"Ô": "O",
"Õ": "O",
"Ö": "O",
"Ø": "O",
"Ố": "O",
"Ṍ": "O",
"Ṓ": "O",
"Ȏ": "O",
"Ỏ": "O",
"Ọ": "O",
"Ổ": "O",
"Ỗ": "O",
"Ộ": "O",
"Ờ": "O",
"Ở": "O",
"Ỡ": "O",
"Ớ": "O",
"Ợ": "O",
"Ù": "U",
"Ú": "U",
"Û": "U",
"Ü": "U",
"Ủ": "U",
"Ụ": "U",
"Ử": "U",
"Ữ": "U",
"Ự": "U",
"Ý": "Y",
"à": "a",
"á": "a",
"â": "a",
"ã": "a",
"ä": "a",
"å": "a",
"ấ": "a",
"ắ": "a",
"ẳ": "a",
"ẵ": "a",
"ặ": "a",
"æ": "ae",
"ầ": "a",
"ằ": "a",
"ȃ": "a",
"ả": "a",
"ạ": "a",
"ẩ": "a",
"ẫ": "a",
"ậ": "a",
"ç": "c",
"ḉ": "c",
"è": "e",
"é": "e",
"ê": "e",
"ë": "e",
"ế": "e",
"ḗ": "e",
"ề": "e",
"ḕ": "e",
"ḝ": "e",
"ȇ": "e",
"ẻ": "e",
"ẽ": "e",
"ẹ": "e",
"ể": "e",
"ễ": "e",
"ệ": "e",
"ì": "i",
"í": "i",
"î": "i",
"ï": "i",
"ḯ": "i",
"ȋ": "i",
"ỉ": "i",
"ị": "i",
"ð": "d",
"ñ": "n",
"ò": "o",
"ó": "o",
"ô": "o",
"õ": "o",
"ö": "o",
"ø": "o",
"ố": "o",
"ṍ": "o",
"ṓ": "o",
"ȏ": "o",
"ỏ": "o",
"ọ": "o",
"ổ": "o",
"ỗ": "o",
"ộ": "o",
"ờ": "o",
"ở": "o",
"ỡ": "o",
"ớ": "o",
"ợ": "o",
"ù": "u",
"ú": "u",
"û": "u",
"ü": "u",
"ủ": "u",
"ụ": "u",
"ử": "u",
"ữ": "u",
"ự": "u",
"ý": "y",
"ÿ": "y",
"Ā": "A",
"ā": "a",
"Ă": "A",
"ă": "a",
"Ą": "A",
"ą": "a",
"Ć": "C",
"ć": "c",
"Ĉ": "C",
"ĉ": "c",
"Ċ": "C",
"ċ": "c",
"Č": "C",
"č": "c",
"C̆": "C",
"c̆": "c",
"Ď": "D",
"ď": "d",
"Đ": "D",
"đ": "d",
"Ē": "E",
"ē": "e",
"Ĕ": "E",
"ĕ": "e",
"Ė": "E",
"ė": "e",
"Ę": "E",
"ę": "e",
"Ě": "E",
"ě": "e",
"Ĝ": "G",
"Ǵ": "G",
"ĝ": "g",
"ǵ": "g",
"Ğ": "G",
"ğ": "g",
"Ġ": "G",
"ġ": "g",
"Ģ": "G",
"ģ": "g",
"Ĥ": "H",
"ĥ": "h",
"Ħ": "H",
"ħ": "h",
"Ḫ": "H",
"ḫ": "h",
"Ĩ": "I",
"ĩ": "i",
"Ī": "I",
"ī": "i",
"Ĭ": "I",
"ĭ": "i",
"Į": "I",
"į": "i",
"İ": "I",
"ı": "i",
"IJ": "IJ",
"ij": "ij",
"Ĵ": "J",
"ĵ": "j",
"Ķ": "K",
"ķ": "k",
"Ḱ": "K",
"ḱ": "k",
"K̆": "K",
"k̆": "k",
"Ĺ": "L",
"ĺ": "l",
"Ļ": "L",
"ļ": "l",
"Ľ": "L",
"ľ": "l",
"Ŀ": "L",
"ŀ": "l",
"Ł": "l",
"ł": "l",
"Ḿ": "M",
"ḿ": "m",
"M̆": "M",
"m̆": "m",
"Ń": "N",
"ń": "n",
"Ņ": "N",
"ņ": "n",
"Ň": "N",
"ň": "n",
"ʼn": "n",
"N̆": "N",
"n̆": "n",
"Ō": "O",
"ō": "o",
"Ŏ": "O",
"ŏ": "o",
"Ő": "O",
"ő": "o",
"Œ": "OE",
"œ": "oe",
"P̆": "P",
"p̆": "p",
"Ŕ": "R",
"ŕ": "r",
"Ŗ": "R",
"ŗ": "r",
"Ř": "R",
"ř": "r",
"R̆": "R",
"r̆": "r",
"Ȓ": "R",
"ȓ": "r",
"Ś": "S",
"ś": "s",
"Ŝ": "S",
"ŝ": "s",
"Ş": "S",
"Ș": "S",
"ș": "s",
"ş": "s",
"Š": "S",
"š": "s",
"Ţ": "T",
"ţ": "t",
"ț": "t",
"Ț": "T",
"Ť": "T",
"ť": "t",
"Ŧ": "T",
"ŧ": "t",
"T̆": "T",
"t̆": "t",
"Ũ": "U",
"ũ": "u",
"Ū": "U",
"ū": "u",
"Ŭ": "U",
"ŭ": "u",
"Ů": "U",
"ů": "u",
"Ű": "U",
"ű": "u",
"Ų": "U",
"ų": "u",
"Ȗ": "U",
"ȗ": "u",
"V̆": "V",
"v̆": "v",
"Ŵ": "W",
"ŵ": "w",
"Ẃ": "W",
"ẃ": "w",
"X̆": "X",
"x̆": "x",
"Ŷ": "Y",
"ŷ": "y",
"Ÿ": "Y",
"Y̆": "Y",
"y̆": "y",
"Ź": "Z",
"ź": "z",
"Ż": "Z",
"ż": "z",
"Ž": "Z",
"ž": "z",
"ſ": "s",
"ƒ": "f",
"Ơ": "O",
"ơ": "o",
"Ư": "U",
"ư": "u",
"Ǎ": "A",
"ǎ": "a",
"Ǐ": "I",
"ǐ": "i",
"Ǒ": "O",
"ǒ": "o",
"Ǔ": "U",
"ǔ": "u",
"Ǖ": "U",
"ǖ": "u",
"Ǘ": "U",
"ǘ": "u",
"Ǚ": "U",
"ǚ": "u",
"Ǜ": "U",
"ǜ": "u",
"Ứ": "U",
"ứ": "u",
"Ṹ": "U",
"ṹ": "u",
"Ǻ": "A",
"ǻ": "a",
"Ǽ": "AE",
"ǽ": "ae",
"Ǿ": "O",
"ǿ": "o",
"Þ": "TH",
"þ": "th",
"Ṕ": "P",
"ṕ": "p",
"Ṥ": "S",
"ṥ": "s",
"X́": "X",
"x́": "x",
"Ѓ": "Г",
"ѓ": "г",
"Ќ": "К",
"ќ": "к",
"A̋": "A",
"a̋": "a",
"E̋": "E",
"e̋": "e",
"I̋": "I",
"i̋": "i",
"Ǹ": "N",
"ǹ": "n",
"Ồ": "O",
"ồ": "o",
"Ṑ": "O",
"ṑ": "o",
"Ừ": "U",
"ừ": "u",
"Ẁ": "W",
"ẁ": "w",
"Ỳ": "Y",
"ỳ": "y",
"Ȁ": "A",
"ȁ": "a",
"Ȅ": "E",
"ȅ": "e",
"Ȉ": "I",
"ȉ": "i",
"Ȍ": "O",
"ȍ": "o",
"Ȑ": "R",
"ȑ": "r",
"Ȕ": "U",
"ȕ": "u",
"B̌": "B",
"b̌": "b",
"Č̣": "C",
"č̣": "c",
"Ê̌": "E",
"ê̌": "e",
"F̌": "F",
"f̌": "f",
"Ǧ": "G",
"ǧ": "g",
"Ȟ": "H",
"ȟ": "h",
"J̌": "J",
"ǰ": "j",
"Ǩ": "K",
"ǩ": "k",
"M̌": "M",
"m̌": "m",
"P̌": "P",
"p̌": "p",
"Q̌": "Q",
"q̌": "q",
"Ř̩": "R",
"ř̩": "r",
"Ṧ": "S",
"ṧ": "s",
"V̌": "V",
"v̌": "v",
"W̌": "W",
"w̌": "w",
"X̌": "X",
"x̌": "x",
"Y̌": "Y",
"y̌": "y",
"A̧": "A",
"a̧": "a",
"B̧": "B",
"b̧": "b",
"Ḑ": "D",
"ḑ": "d",
"Ȩ": "E",
"ȩ": "e",
"Ɛ̧": "E",
"ɛ̧": "e",
"Ḩ": "H",
"ḩ": "h",
"I̧": "I",
"i̧": "i",
"Ɨ̧": "I",
"ɨ̧": "i",
"M̧": "M",
"m̧": "m",
"O̧": "O",
"o̧": "o",
"Q̧": "Q",
"q̧": "q",
"U̧": "U",
"u̧": "u",
"X̧": "X",
"x̧": "x",
"Z̧": "Z",
"z̧": "z",
"й":"и",
"Й":"И",
"ё":"е",
"Ё":"Е",
};
var chars = Object.keys(characterMap).join('|');
var allAccents = new RegExp(chars, 'g');
var firstAccent = new RegExp(chars, '');
function matcher(match) {
return characterMap[match];
}
var removeAccents = function(string) {
return string.replace(allAccents, matcher);
};
var hasAccents = function(string) {
return !!string.match(firstAccent);
};
module.exports = removeAccents;
module.exports.has = hasAccents;
module.exports.remove = removeAccents;
/***/ }),
/***/ 9746:
/***/ (() => {
/* (ignored) */
/***/ }),
/***/ 9977:
/***/ (() => {
/* (ignored) */
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
(() => {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
AlignmentControl: () => (/* reexport */ AlignmentControl),
AlignmentToolbar: () => (/* reexport */ AlignmentToolbar),
Autocomplete: () => (/* reexport */ autocomplete_default),
BlockAlignmentControl: () => (/* reexport */ BlockAlignmentControl),
BlockAlignmentToolbar: () => (/* reexport */ BlockAlignmentToolbar),
BlockBreadcrumb: () => (/* reexport */ block_breadcrumb_default),
BlockCanvas: () => (/* reexport */ block_canvas_default),
BlockColorsStyleSelector: () => (/* reexport */ color_style_selector_default),
BlockContextProvider: () => (/* reexport */ BlockContextProvider),
BlockControls: () => (/* reexport */ block_controls_default),
BlockEdit: () => (/* reexport */ BlockEdit),
BlockEditorKeyboardShortcuts: () => (/* reexport */ keyboard_shortcuts_default),
BlockEditorProvider: () => (/* reexport */ provider_provider_default),
BlockFormatControls: () => (/* reexport */ BlockFormatControls),
BlockIcon: () => (/* reexport */ block_icon_default),
BlockInspector: () => (/* reexport */ block_inspector_default),
BlockList: () => (/* reexport */ BlockList),
BlockMover: () => (/* reexport */ block_mover_default),
BlockNavigationDropdown: () => (/* reexport */ dropdown_default),
BlockPopover: () => (/* reexport */ block_popover_default),
BlockPreview: () => (/* reexport */ block_preview_default),
BlockSelectionClearer: () => (/* reexport */ BlockSelectionClearer),
BlockSettingsMenu: () => (/* reexport */ block_settings_menu_default),
BlockSettingsMenuControls: () => (/* reexport */ block_settings_menu_controls_default),
BlockStyles: () => (/* reexport */ block_styles_default),
BlockTitle: () => (/* reexport */ BlockTitle),
BlockToolbar: () => (/* reexport */ BlockToolbar),
BlockTools: () => (/* reexport */ BlockTools),
BlockVerticalAlignmentControl: () => (/* reexport */ BlockVerticalAlignmentControl),
BlockVerticalAlignmentToolbar: () => (/* reexport */ BlockVerticalAlignmentToolbar),
ButtonBlockAppender: () => (/* reexport */ button_block_appender_default),
ButtonBlockerAppender: () => (/* reexport */ ButtonBlockerAppender),
ColorPalette: () => (/* reexport */ color_palette_default),
ColorPaletteControl: () => (/* reexport */ ColorPaletteControl),
ContrastChecker: () => (/* reexport */ contrast_checker_default),
CopyHandler: () => (/* reexport */ CopyHandler),
DefaultBlockAppender: () => (/* reexport */ DefaultBlockAppender),
FontSizePicker: () => (/* reexport */ font_size_picker_default),
HeadingLevelDropdown: () => (/* reexport */ HeadingLevelDropdown),
HeightControl: () => (/* reexport */ HeightControl),
InnerBlocks: () => (/* reexport */ inner_blocks_default),
Inserter: () => (/* reexport */ inserter_default),
InspectorAdvancedControls: () => (/* reexport */ InspectorAdvancedControls),
InspectorControls: () => (/* reexport */ inspector_controls_default),
JustifyContentControl: () => (/* reexport */ JustifyContentControl),
JustifyToolbar: () => (/* reexport */ JustifyToolbar),
LineHeightControl: () => (/* reexport */ line_height_control_default),
LinkControl: () => (/* reexport */ link_control_default),
MediaPlaceholder: () => (/* reexport */ media_placeholder_default),
MediaReplaceFlow: () => (/* reexport */ media_replace_flow_default),
MediaUpload: () => (/* reexport */ media_upload_default),
MediaUploadCheck: () => (/* reexport */ check_default),
MultiSelectScrollIntoView: () => (/* reexport */ MultiSelectScrollIntoView),
NavigableToolbar: () => (/* reexport */ NavigableToolbar),
ObserveTyping: () => (/* reexport */ observe_typing_default),
PanelColorSettings: () => (/* reexport */ panel_color_settings_default),
PlainText: () => (/* reexport */ plain_text_default),
RecursionProvider: () => (/* reexport */ RecursionProvider),
RichText: () => (/* reexport */ rich_text_default),
RichTextShortcut: () => (/* reexport */ RichTextShortcut),
RichTextToolbarButton: () => (/* reexport */ RichTextToolbarButton),
SETTINGS_DEFAULTS: () => (/* reexport */ SETTINGS_DEFAULTS),
SkipToSelectedBlock: () => (/* reexport */ SkipToSelectedBlock),
Typewriter: () => (/* reexport */ typewriter_default),
URLInput: () => (/* reexport */ url_input_default),
URLInputButton: () => (/* reexport */ button_default),
URLPopover: () => (/* reexport */ url_popover_default),
Warning: () => (/* reexport */ warning_default),
WritingFlow: () => (/* reexport */ writing_flow_default),
__experimentalBlockAlignmentMatrixControl: () => (/* reexport */ block_alignment_matrix_control_default),
__experimentalBlockFullHeightAligmentControl: () => (/* reexport */ block_full_height_alignment_control_default),
__experimentalBlockPatternSetup: () => (/* reexport */ block_pattern_setup_default),
__experimentalBlockPatternsList: () => (/* reexport */ block_patterns_list_default),
__experimentalBlockVariationPicker: () => (/* reexport */ block_variation_picker_default),
__experimentalBlockVariationTransforms: () => (/* reexport */ block_variation_transforms_default),
__experimentalBorderRadiusControl: () => (/* reexport */ BorderRadiusControl),
__experimentalColorGradientControl: () => (/* reexport */ control_default),
__experimentalColorGradientSettingsDropdown: () => (/* reexport */ ColorGradientSettingsDropdown),
__experimentalDateFormatPicker: () => (/* reexport */ DateFormatPicker),
__experimentalDuotoneControl: () => (/* reexport */ duotone_control_default),
__experimentalFontAppearanceControl: () => (/* reexport */ FontAppearanceControl),
__experimentalFontFamilyControl: () => (/* reexport */ FontFamilyControl),
__experimentalGetBorderClassesAndStyles: () => (/* reexport */ getBorderClassesAndStyles),
__experimentalGetColorClassesAndStyles: () => (/* reexport */ getColorClassesAndStyles),
__experimentalGetElementClassName: () => (/* reexport */ __experimentalGetElementClassName),
__experimentalGetGapCSSValue: () => (/* reexport */ getGapCSSValue),
__experimentalGetGradientClass: () => (/* reexport */ __experimentalGetGradientClass),
__experimentalGetGradientObjectByGradientValue: () => (/* reexport */ __experimentalGetGradientObjectByGradientValue),
__experimentalGetShadowClassesAndStyles: () => (/* reexport */ getShadowClassesAndStyles),
__experimentalGetSpacingClassesAndStyles: () => (/* reexport */ getSpacingClassesAndStyles),
__experimentalImageEditor: () => (/* reexport */ ImageEditor),
__experimentalImageSizeControl: () => (/* reexport */ ImageSizeControl),
__experimentalImageURLInputUI: () => (/* reexport */ ImageURLInputUI),
__experimentalInspectorPopoverHeader: () => (/* reexport */ InspectorPopoverHeader),
__experimentalLetterSpacingControl: () => (/* reexport */ LetterSpacingControl),
__experimentalLibrary: () => (/* reexport */ library_default),
__experimentalLinkControl: () => (/* reexport */ DeprecatedExperimentalLinkControl),
__experimentalLinkControlSearchInput: () => (/* reexport */ __experimentalLinkControlSearchInput),
__experimentalLinkControlSearchItem: () => (/* reexport */ __experimentalLinkControlSearchItem),
__experimentalLinkControlSearchResults: () => (/* reexport */ __experimentalLinkControlSearchResults),
__experimentalListView: () => (/* reexport */ list_view_list_view_default),
__experimentalPanelColorGradientSettings: () => (/* reexport */ panel_color_gradient_settings_default),
__experimentalPreviewOptions: () => (/* reexport */ PreviewOptions),
__experimentalPublishDateTimePicker: () => (/* reexport */ publish_date_time_picker_default),
__experimentalRecursionProvider: () => (/* reexport */ DeprecatedExperimentalRecursionProvider),
__experimentalResponsiveBlockControl: () => (/* reexport */ responsive_block_control_default),
__experimentalSpacingSizesControl: () => (/* reexport */ SpacingSizesControl),
__experimentalTextDecorationControl: () => (/* reexport */ TextDecorationControl),
__experimentalTextTransformControl: () => (/* reexport */ TextTransformControl),
__experimentalUnitControl: () => (/* reexport */ UnitControl),
__experimentalUseBlockOverlayActive: () => (/* reexport */ useBlockOverlayActive),
__experimentalUseBlockPreview: () => (/* reexport */ useBlockPreview),
__experimentalUseBorderProps: () => (/* reexport */ useBorderProps),
__experimentalUseColorProps: () => (/* reexport */ useColorProps),
__experimentalUseCustomSides: () => (/* reexport */ useCustomSides),
__experimentalUseGradient: () => (/* reexport */ __experimentalUseGradient),
__experimentalUseHasRecursion: () => (/* reexport */ DeprecatedExperimentalUseHasRecursion),
__experimentalUseMultipleOriginColorsAndGradients: () => (/* reexport */ useMultipleOriginColorsAndGradients),
__experimentalUseResizeCanvas: () => (/* reexport */ useResizeCanvas),
__experimentalWritingModeControl: () => (/* reexport */ WritingModeControl),
__unstableBlockNameContext: () => (/* reexport */ block_name_context_default),
__unstableBlockSettingsMenuFirstItem: () => (/* reexport */ block_settings_menu_first_item_default),
__unstableBlockToolbarLastItem: () => (/* reexport */ block_toolbar_last_item_default),
__unstableEditorStyles: () => (/* reexport */ editor_styles_default),
__unstableIframe: () => (/* reexport */ iframe_default),
__unstableInserterMenuExtension: () => (/* reexport */ inserter_menu_extension_default),
__unstableRichTextInputEvent: () => (/* reexport */ __unstableRichTextInputEvent),
__unstableUseBlockSelectionClearer: () => (/* reexport */ useBlockSelectionClearer),
__unstableUseClipboardHandler: () => (/* reexport */ __unstableUseClipboardHandler),
__unstableUseMouseMoveTypingReset: () => (/* reexport */ useMouseMoveTypingReset),
__unstableUseTypewriter: () => (/* reexport */ useTypewriter),
__unstableUseTypingObserver: () => (/* reexport */ useTypingObserver),
createCustomColorsHOC: () => (/* reexport */ createCustomColorsHOC),
getColorClassName: () => (/* reexport */ getColorClassName),
getColorObjectByAttributeValues: () => (/* reexport */ getColorObjectByAttributeValues),
getColorObjectByColorValue: () => (/* reexport */ getColorObjectByColorValue),
getComputedFluidTypographyValue: () => (/* reexport */ getComputedFluidTypographyValue),
getCustomValueFromPreset: () => (/* reexport */ getCustomValueFromPreset),
getFontSize: () => (/* reexport */ utils_getFontSize),
getFontSizeClass: () => (/* reexport */ getFontSizeClass),
getFontSizeObjectByValue: () => (/* reexport */ utils_getFontSizeObjectByValue),
getGradientSlugByValue: () => (/* reexport */ getGradientSlugByValue),
getGradientValueBySlug: () => (/* reexport */ getGradientValueBySlug),
getPxFromCssUnit: () => (/* reexport */ get_px_from_css_unit_default),
getSpacingPresetCssVar: () => (/* reexport */ getSpacingPresetCssVar),
getTypographyClassesAndStyles: () => (/* reexport */ getTypographyClassesAndStyles),
isValueSpacingPreset: () => (/* reexport */ isValueSpacingPreset),
privateApis: () => (/* reexport */ privateApis),
store: () => (/* reexport */ store),
storeConfig: () => (/* reexport */ storeConfig),
transformStyles: () => (/* reexport */ transform_styles_default),
useBlockBindingsUtils: () => (/* reexport */ useBlockBindingsUtils),
useBlockCommands: () => (/* reexport */ useBlockCommands),
useBlockDisplayInformation: () => (/* reexport */ useBlockDisplayInformation),
useBlockEditContext: () => (/* reexport */ useBlockEditContext),
useBlockEditingMode: () => (/* reexport */ useBlockEditingMode),
useBlockProps: () => (/* reexport */ use_block_props_useBlockProps),
useCachedTruthy: () => (/* reexport */ useCachedTruthy),
useHasRecursion: () => (/* reexport */ useHasRecursion),
useInnerBlocksProps: () => (/* reexport */ useInnerBlocksProps),
useSetting: () => (/* reexport */ useSetting),
useSettings: () => (/* reexport */ use_settings_useSettings),
useStyleOverride: () => (/* reexport */ useStyleOverride),
withColorContext: () => (/* reexport */ with_color_context_default),
withColors: () => (/* reexport */ withColors),
withFontSizes: () => (/* reexport */ with_font_sizes_default)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/store/private-selectors.js
var private_selectors_namespaceObject = {};
__webpack_require__.r(private_selectors_namespaceObject);
__webpack_require__.d(private_selectors_namespaceObject, {
getAllPatterns: () => (getAllPatterns),
getBlockRemovalRules: () => (getBlockRemovalRules),
getBlockSettings: () => (getBlockSettings),
getBlockStyles: () => (getBlockStyles),
getBlockWithoutAttributes: () => (getBlockWithoutAttributes),
getClosestAllowedInsertionPoint: () => (getClosestAllowedInsertionPoint),
getClosestAllowedInsertionPointForPattern: () => (getClosestAllowedInsertionPointForPattern),
getContentLockingParent: () => (getContentLockingParent),
getEnabledBlockParents: () => (getEnabledBlockParents),
getEnabledClientIdsTree: () => (getEnabledClientIdsTree),
getExpandedBlock: () => (getExpandedBlock),
getInserterMediaCategories: () => (getInserterMediaCategories),
getInsertionPoint: () => (getInsertionPoint),
getLastFocus: () => (getLastFocus),
getLastInsertedBlocksClientIds: () => (getLastInsertedBlocksClientIds),
getOpenedBlockSettingsMenu: () => (getOpenedBlockSettingsMenu),
getParentSectionBlock: () => (getParentSectionBlock),
getPatternBySlug: () => (getPatternBySlug),
getRegisteredInserterMediaCategories: () => (getRegisteredInserterMediaCategories),
getRemovalPromptData: () => (getRemovalPromptData),
getReusableBlocks: () => (getReusableBlocks),
getSectionRootClientId: () => (getSectionRootClientId),
getStyleOverrides: () => (getStyleOverrides),
getTemporarilyEditingAsBlocks: () => (getTemporarilyEditingAsBlocks),
getTemporarilyEditingFocusModeToRevert: () => (getTemporarilyEditingFocusModeToRevert),
getZoomLevel: () => (getZoomLevel),
hasAllowedPatterns: () => (hasAllowedPatterns),
hasBlockSpotlight: () => (private_selectors_hasBlockSpotlight),
isBlockHidden: () => (isBlockHidden),
isBlockInterfaceHidden: () => (private_selectors_isBlockInterfaceHidden),
isBlockSubtreeDisabled: () => (isBlockSubtreeDisabled),
isContainerInsertableToInContentOnlyMode: () => (isContainerInsertableToInContentOnlyMode),
isDragging: () => (private_selectors_isDragging),
isSectionBlock: () => (isSectionBlock),
isZoomOut: () => (isZoomOut)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/store/selectors.js
var selectors_namespaceObject = {};
__webpack_require__.r(selectors_namespaceObject);
__webpack_require__.d(selectors_namespaceObject, {
__experimentalGetActiveBlockIdByBlockNames: () => (__experimentalGetActiveBlockIdByBlockNames),
__experimentalGetAllowedBlocks: () => (__experimentalGetAllowedBlocks),
__experimentalGetAllowedPatterns: () => (__experimentalGetAllowedPatterns),
__experimentalGetBlockListSettingsForBlocks: () => (__experimentalGetBlockListSettingsForBlocks),
__experimentalGetDirectInsertBlock: () => (__experimentalGetDirectInsertBlock),
__experimentalGetGlobalBlocksByName: () => (__experimentalGetGlobalBlocksByName),
__experimentalGetLastBlockAttributeChanges: () => (__experimentalGetLastBlockAttributeChanges),
__experimentalGetParsedPattern: () => (__experimentalGetParsedPattern),
__experimentalGetPatternTransformItems: () => (__experimentalGetPatternTransformItems),
__experimentalGetPatternsByBlockTypes: () => (__experimentalGetPatternsByBlockTypes),
__experimentalGetReusableBlockTitle: () => (__experimentalGetReusableBlockTitle),
__unstableGetBlockWithoutInnerBlocks: () => (__unstableGetBlockWithoutInnerBlocks),
__unstableGetClientIdWithClientIdsTree: () => (__unstableGetClientIdWithClientIdsTree),
__unstableGetClientIdsTree: () => (__unstableGetClientIdsTree),
__unstableGetContentLockingParent: () => (__unstableGetContentLockingParent),
__unstableGetSelectedBlocksWithPartialSelection: () => (__unstableGetSelectedBlocksWithPartialSelection),
__unstableGetTemporarilyEditingAsBlocks: () => (__unstableGetTemporarilyEditingAsBlocks),
__unstableGetTemporarilyEditingFocusModeToRevert: () => (__unstableGetTemporarilyEditingFocusModeToRevert),
__unstableGetVisibleBlocks: () => (__unstableGetVisibleBlocks),
__unstableHasActiveBlockOverlayActive: () => (__unstableHasActiveBlockOverlayActive),
__unstableIsFullySelected: () => (__unstableIsFullySelected),
__unstableIsLastBlockChangeIgnored: () => (__unstableIsLastBlockChangeIgnored),
__unstableIsSelectionCollapsed: () => (__unstableIsSelectionCollapsed),
__unstableIsSelectionMergeable: () => (__unstableIsSelectionMergeable),
__unstableIsWithinBlockOverlay: () => (__unstableIsWithinBlockOverlay),
__unstableSelectionHasUnmergeableBlock: () => (__unstableSelectionHasUnmergeableBlock),
areInnerBlocksControlled: () => (areInnerBlocksControlled),
canEditBlock: () => (canEditBlock),
canInsertBlockType: () => (canInsertBlockType),
canInsertBlocks: () => (canInsertBlocks),
canLockBlockType: () => (canLockBlockType),
canMoveBlock: () => (canMoveBlock),
canMoveBlocks: () => (canMoveBlocks),
canRemoveBlock: () => (canRemoveBlock),
canRemoveBlocks: () => (canRemoveBlocks),
didAutomaticChange: () => (didAutomaticChange),
getAdjacentBlockClientId: () => (getAdjacentBlockClientId),
getAllowedBlocks: () => (getAllowedBlocks),
getBlock: () => (getBlock),
getBlockAttributes: () => (getBlockAttributes),
getBlockCount: () => (getBlockCount),
getBlockEditingMode: () => (getBlockEditingMode),
getBlockHierarchyRootClientId: () => (getBlockHierarchyRootClientId),
getBlockIndex: () => (getBlockIndex),
getBlockInsertionPoint: () => (getBlockInsertionPoint),
getBlockListSettings: () => (getBlockListSettings),
getBlockMode: () => (getBlockMode),
getBlockName: () => (getBlockName),
getBlockNamesByClientId: () => (getBlockNamesByClientId),
getBlockOrder: () => (getBlockOrder),
getBlockParents: () => (getBlockParents),
getBlockParentsByBlockName: () => (getBlockParentsByBlockName),
getBlockRootClientId: () => (getBlockRootClientId),
getBlockSelectionEnd: () => (getBlockSelectionEnd),
getBlockSelectionStart: () => (getBlockSelectionStart),
getBlockTransformItems: () => (getBlockTransformItems),
getBlocks: () => (getBlocks),
getBlocksByClientId: () => (getBlocksByClientId),
getBlocksByName: () => (getBlocksByName),
getClientIdsOfDescendants: () => (getClientIdsOfDescendants),
getClientIdsWithDescendants: () => (getClientIdsWithDescendants),
getDirectInsertBlock: () => (getDirectInsertBlock),
getDraggedBlockClientIds: () => (getDraggedBlockClientIds),
getFirstMultiSelectedBlockClientId: () => (getFirstMultiSelectedBlockClientId),
getGlobalBlockCount: () => (getGlobalBlockCount),
getHoveredBlockClientId: () => (getHoveredBlockClientId),
getInserterItems: () => (getInserterItems),
getLastMultiSelectedBlockClientId: () => (getLastMultiSelectedBlockClientId),
getLowestCommonAncestorWithSelectedBlock: () => (getLowestCommonAncestorWithSelectedBlock),
getMultiSelectedBlockClientIds: () => (getMultiSelectedBlockClientIds),
getMultiSelectedBlocks: () => (getMultiSelectedBlocks),
getMultiSelectedBlocksEndClientId: () => (getMultiSelectedBlocksEndClientId),
getMultiSelectedBlocksStartClientId: () => (getMultiSelectedBlocksStartClientId),
getNextBlockClientId: () => (getNextBlockClientId),
getPatternsByBlockTypes: () => (getPatternsByBlockTypes),
getPreviousBlockClientId: () => (getPreviousBlockClientId),
getSelectedBlock: () => (getSelectedBlock),
getSelectedBlockClientId: () => (getSelectedBlockClientId),
getSelectedBlockClientIds: () => (getSelectedBlockClientIds),
getSelectedBlockCount: () => (getSelectedBlockCount),
getSelectedBlocksInitialCaretPosition: () => (getSelectedBlocksInitialCaretPosition),
getSelectionEnd: () => (getSelectionEnd),
getSelectionStart: () => (getSelectionStart),
getSettings: () => (getSettings),
getTemplate: () => (getTemplate),
getTemplateLock: () => (getTemplateLock),
hasBlockMovingClientId: () => (hasBlockMovingClientId),
hasDraggedInnerBlock: () => (hasDraggedInnerBlock),
hasInserterItems: () => (hasInserterItems),
hasMultiSelection: () => (hasMultiSelection),
hasSelectedBlock: () => (hasSelectedBlock),
hasSelectedInnerBlock: () => (hasSelectedInnerBlock),
isAncestorBeingDragged: () => (isAncestorBeingDragged),
isAncestorMultiSelected: () => (isAncestorMultiSelected),
isBlockBeingDragged: () => (isBlockBeingDragged),
isBlockHighlighted: () => (isBlockHighlighted),
isBlockInsertionPointVisible: () => (isBlockInsertionPointVisible),
isBlockMultiSelected: () => (isBlockMultiSelected),
isBlockSelected: () => (isBlockSelected),
isBlockValid: () => (isBlockValid),
isBlockVisible: () => (isBlockVisible),
isBlockWithinSelection: () => (isBlockWithinSelection),
isCaretWithinFormattedText: () => (isCaretWithinFormattedText),
isDraggingBlocks: () => (isDraggingBlocks),
isFirstMultiSelectedBlock: () => (isFirstMultiSelectedBlock),
isGroupable: () => (isGroupable),
isLastBlockChangePersistent: () => (isLastBlockChangePersistent),
isMultiSelecting: () => (selectors_isMultiSelecting),
isSelectionEnabled: () => (selectors_isSelectionEnabled),
isTyping: () => (selectors_isTyping),
isUngroupable: () => (isUngroupable),
isValidTemplate: () => (isValidTemplate),
wasBlockJustInserted: () => (wasBlockJustInserted)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/store/private-actions.js
var private_actions_namespaceObject = {};
__webpack_require__.r(private_actions_namespaceObject);
__webpack_require__.d(private_actions_namespaceObject, {
__experimentalUpdateSettings: () => (__experimentalUpdateSettings),
clearBlockRemovalPrompt: () => (clearBlockRemovalPrompt),
deleteStyleOverride: () => (deleteStyleOverride),
ensureDefaultBlock: () => (ensureDefaultBlock),
expandBlock: () => (expandBlock),
hideBlockInterface: () => (hideBlockInterface),
modifyContentLockBlock: () => (modifyContentLockBlock),
privateRemoveBlocks: () => (privateRemoveBlocks),
resetZoomLevel: () => (resetZoomLevel),
setBlockRemovalRules: () => (setBlockRemovalRules),
setInsertionPoint: () => (setInsertionPoint),
setLastFocus: () => (setLastFocus),
setOpenedBlockSettingsMenu: () => (setOpenedBlockSettingsMenu),
setStyleOverride: () => (setStyleOverride),
setZoomLevel: () => (setZoomLevel),
showBlockInterface: () => (showBlockInterface),
startDragging: () => (startDragging),
stopDragging: () => (stopDragging),
stopEditingAsBlocks: () => (stopEditingAsBlocks),
toggleBlockSpotlight: () => (toggleBlockSpotlight)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/store/actions.js
var actions_namespaceObject = {};
__webpack_require__.r(actions_namespaceObject);
__webpack_require__.d(actions_namespaceObject, {
__unstableDeleteSelection: () => (__unstableDeleteSelection),
__unstableExpandSelection: () => (__unstableExpandSelection),
__unstableMarkAutomaticChange: () => (__unstableMarkAutomaticChange),
__unstableMarkLastChangeAsPersistent: () => (__unstableMarkLastChangeAsPersistent),
__unstableMarkNextChangeAsNotPersistent: () => (__unstableMarkNextChangeAsNotPersistent),
__unstableSaveReusableBlock: () => (__unstableSaveReusableBlock),
__unstableSetEditorMode: () => (__unstableSetEditorMode),
__unstableSetTemporarilyEditingAsBlocks: () => (__unstableSetTemporarilyEditingAsBlocks),
__unstableSplitSelection: () => (__unstableSplitSelection),
clearSelectedBlock: () => (clearSelectedBlock),
duplicateBlocks: () => (duplicateBlocks),
enterFormattedText: () => (enterFormattedText),
exitFormattedText: () => (exitFormattedText),
flashBlock: () => (flashBlock),
hideInsertionPoint: () => (hideInsertionPoint),
hoverBlock: () => (hoverBlock),
insertAfterBlock: () => (insertAfterBlock),
insertBeforeBlock: () => (insertBeforeBlock),
insertBlock: () => (insertBlock),
insertBlocks: () => (insertBlocks),
insertDefaultBlock: () => (insertDefaultBlock),
mergeBlocks: () => (mergeBlocks),
moveBlockToPosition: () => (moveBlockToPosition),
moveBlocksDown: () => (moveBlocksDown),
moveBlocksToPosition: () => (moveBlocksToPosition),
moveBlocksUp: () => (moveBlocksUp),
multiSelect: () => (multiSelect),
receiveBlocks: () => (receiveBlocks),
registerInserterMediaCategory: () => (registerInserterMediaCategory),
removeBlock: () => (removeBlock),
removeBlocks: () => (removeBlocks),
replaceBlock: () => (replaceBlock),
replaceBlocks: () => (replaceBlocks),
replaceInnerBlocks: () => (replaceInnerBlocks),
resetBlocks: () => (resetBlocks),
resetSelection: () => (resetSelection),
selectBlock: () => (selectBlock),
selectNextBlock: () => (selectNextBlock),
selectPreviousBlock: () => (selectPreviousBlock),
selectionChange: () => (selectionChange),
setBlockEditingMode: () => (setBlockEditingMode),
setBlockMovingClientId: () => (setBlockMovingClientId),
setBlockVisibility: () => (setBlockVisibility),
setHasControlledInnerBlocks: () => (setHasControlledInnerBlocks),
setTemplateValidity: () => (setTemplateValidity),
showInsertionPoint: () => (showInsertionPoint),
startDraggingBlocks: () => (startDraggingBlocks),
startMultiSelect: () => (startMultiSelect),
startTyping: () => (startTyping),
stopDraggingBlocks: () => (stopDraggingBlocks),
stopMultiSelect: () => (stopMultiSelect),
stopTyping: () => (stopTyping),
synchronizeTemplate: () => (synchronizeTemplate),
toggleBlockHighlight: () => (toggleBlockHighlight),
toggleBlockMode: () => (toggleBlockMode),
toggleSelection: () => (toggleSelection),
unsetBlockEditingMode: () => (unsetBlockEditingMode),
updateBlock: () => (updateBlock),
updateBlockAttributes: () => (updateBlockAttributes),
updateBlockListSettings: () => (updateBlockListSettings),
updateSettings: () => (updateSettings),
validateBlocksToTemplate: () => (validateBlocksToTemplate)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/upload-media/build-module/store/selectors.js
var store_selectors_namespaceObject = {};
__webpack_require__.r(store_selectors_namespaceObject);
__webpack_require__.d(store_selectors_namespaceObject, {
getItems: () => (getItems),
getSettings: () => (selectors_getSettings),
isUploading: () => (isUploading),
isUploadingById: () => (isUploadingById),
isUploadingByUrl: () => (isUploadingByUrl)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/upload-media/build-module/store/private-selectors.js
var store_private_selectors_namespaceObject = {};
__webpack_require__.r(store_private_selectors_namespaceObject);
__webpack_require__.d(store_private_selectors_namespaceObject, {
getAllItems: () => (getAllItems),
getBlobUrls: () => (getBlobUrls),
getItem: () => (getItem),
getPausedUploadForPost: () => (getPausedUploadForPost),
isBatchUploaded: () => (isBatchUploaded),
isPaused: () => (isPaused),
isUploadingToPost: () => (isUploadingToPost)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/upload-media/build-module/store/actions.js
var store_actions_namespaceObject = {};
__webpack_require__.r(store_actions_namespaceObject);
__webpack_require__.d(store_actions_namespaceObject, {
addItems: () => (addItems),
cancelItem: () => (cancelItem)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/upload-media/build-module/store/private-actions.js
var store_private_actions_namespaceObject = {};
__webpack_require__.r(store_private_actions_namespaceObject);
__webpack_require__.d(store_private_actions_namespaceObject, {
addItem: () => (addItem),
finishOperation: () => (finishOperation),
pauseQueue: () => (pauseQueue),
prepareItem: () => (prepareItem),
processItem: () => (processItem),
removeItem: () => (removeItem),
resumeQueue: () => (resumeQueue),
revokeBlobUrls: () => (revokeBlobUrls),
updateSettings: () => (private_actions_updateSettings),
uploadItem: () => (uploadItem)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/components/global-styles/index.js
var global_styles_namespaceObject = {};
__webpack_require__.r(global_styles_namespaceObject);
__webpack_require__.d(global_styles_namespaceObject, {
AdvancedPanel: () => (AdvancedPanel),
BackgroundPanel: () => (background_panel_BackgroundImagePanel),
BorderPanel: () => (BorderPanel),
ColorPanel: () => (ColorPanel),
DimensionsPanel: () => (DimensionsPanel),
FiltersPanel: () => (FiltersPanel),
GlobalStylesContext: () => (GlobalStylesContext),
ImageSettingsPanel: () => (ImageSettingsPanel),
TypographyPanel: () => (TypographyPanel),
areGlobalStyleConfigsEqual: () => (areGlobalStyleConfigsEqual),
getBlockCSSSelector: () => (getBlockCSSSelector),
getBlockSelectors: () => (getBlockSelectors),
getGlobalStylesChanges: () => (getGlobalStylesChanges),
getLayoutStyles: () => (getLayoutStyles),
toStyles: () => (toStyles),
useGlobalSetting: () => (useGlobalSetting),
useGlobalStyle: () => (useGlobalStyle),
useGlobalStylesOutput: () => (useGlobalStylesOutput),
useGlobalStylesOutputWithConfig: () => (useGlobalStylesOutputWithConfig),
useGlobalStylesReset: () => (useGlobalStylesReset),
useHasBackgroundPanel: () => (useHasBackgroundPanel),
useHasBorderPanel: () => (useHasBorderPanel),
useHasBorderPanelControls: () => (useHasBorderPanelControls),
useHasColorPanel: () => (useHasColorPanel),
useHasDimensionsPanel: () => (useHasDimensionsPanel),
useHasFiltersPanel: () => (useHasFiltersPanel),
useHasImageSettingsPanel: () => (useHasImageSettingsPanel),
useHasTypographyPanel: () => (useHasTypographyPanel),
useSettingsForBlockElement: () => (useSettingsForBlockElement)
});
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// external ["wp","blocks"]
const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
;// external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// external ["wp","data"]
const external_wp_data_namespaceObject = window["wp"]["data"];
;// external ["wp","compose"]
const external_wp_compose_namespaceObject = window["wp"]["compose"];
;// external ["wp","hooks"]
const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
;// ./node_modules/@wordpress/block-editor/build-module/components/block-edit/context.js
const mayDisplayControlsKey = Symbol("mayDisplayControls");
const mayDisplayParentControlsKey = Symbol("mayDisplayParentControls");
const blockEditingModeKey = Symbol("blockEditingMode");
const blockBindingsKey = Symbol("blockBindings");
const isPreviewModeKey = Symbol("isPreviewMode");
const DEFAULT_BLOCK_EDIT_CONTEXT = {
name: "",
isSelected: false
};
const Context = (0,external_wp_element_namespaceObject.createContext)(DEFAULT_BLOCK_EDIT_CONTEXT);
Context.displayName = "BlockEditContext";
const { Provider } = Context;
function useBlockEditContext() {
return (0,external_wp_element_namespaceObject.useContext)(Context);
}
;// external ["wp","deprecated"]
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
// EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js
var es6 = __webpack_require__(7734);
var es6_default = /*#__PURE__*/__webpack_require__.n(es6);
;// external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// ./node_modules/@wordpress/block-editor/build-module/store/defaults.js
const PREFERENCES_DEFAULTS = {
insertUsage: {}
};
const SETTINGS_DEFAULTS = {
alignWide: false,
supportsLayout: true,
// colors setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.
// The setting is only kept for backward compatibility purposes.
colors: [
{
name: (0,external_wp_i18n_namespaceObject.__)("Black"),
slug: "black",
color: "#000000"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Cyan bluish gray"),
slug: "cyan-bluish-gray",
color: "#abb8c3"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("White"),
slug: "white",
color: "#ffffff"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Pale pink"),
slug: "pale-pink",
color: "#f78da7"
},
{ name: (0,external_wp_i18n_namespaceObject.__)("Vivid red"), slug: "vivid-red", color: "#cf2e2e" },
{
name: (0,external_wp_i18n_namespaceObject.__)("Luminous vivid orange"),
slug: "luminous-vivid-orange",
color: "#ff6900"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Luminous vivid amber"),
slug: "luminous-vivid-amber",
color: "#fcb900"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Light green cyan"),
slug: "light-green-cyan",
color: "#7bdcb5"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Vivid green cyan"),
slug: "vivid-green-cyan",
color: "#00d084"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Pale cyan blue"),
slug: "pale-cyan-blue",
color: "#8ed1fc"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Vivid cyan blue"),
slug: "vivid-cyan-blue",
color: "#0693e3"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Vivid purple"),
slug: "vivid-purple",
color: "#9b51e0"
}
],
// fontSizes setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.
// The setting is only kept for backward compatibility purposes.
fontSizes: [
{
name: (0,external_wp_i18n_namespaceObject._x)("Small", "font size name"),
size: 13,
slug: "small"
},
{
name: (0,external_wp_i18n_namespaceObject._x)("Normal", "font size name"),
size: 16,
slug: "normal"
},
{
name: (0,external_wp_i18n_namespaceObject._x)("Medium", "font size name"),
size: 20,
slug: "medium"
},
{
name: (0,external_wp_i18n_namespaceObject._x)("Large", "font size name"),
size: 36,
slug: "large"
},
{
name: (0,external_wp_i18n_namespaceObject._x)("Huge", "font size name"),
size: 42,
slug: "huge"
}
],
// Image default size slug.
imageDefaultSize: "large",
imageSizes: [
{ slug: "thumbnail", name: (0,external_wp_i18n_namespaceObject.__)("Thumbnail") },
{ slug: "medium", name: (0,external_wp_i18n_namespaceObject.__)("Medium") },
{ slug: "large", name: (0,external_wp_i18n_namespaceObject.__)("Large") },
{ slug: "full", name: (0,external_wp_i18n_namespaceObject.__)("Full Size") }
],
// Allow plugin to disable Image Editor if need be.
imageEditing: true,
// This is current max width of the block inner area
// It's used to constraint image resizing and this value could be overridden later by themes
maxWidth: 580,
// Allowed block types for the editor, defaulting to true (all supported).
allowedBlockTypes: true,
// Maximum upload size in bytes allowed for the site.
maxUploadFileSize: 0,
// List of allowed mime types and file extensions.
allowedMimeTypes: null,
// Allows to disable block locking interface.
canLockBlocks: true,
// Allows to disable Openverse media category in the inserter.
enableOpenverseMediaCategory: true,
clearBlockSelection: true,
__experimentalCanUserUseUnfilteredHTML: false,
__experimentalBlockDirectory: false,
__mobileEnablePageTemplates: false,
__experimentalBlockPatterns: [],
__experimentalBlockPatternCategories: [],
isPreviewMode: false,
// These settings will be completely revamped in the future.
// The goal is to evolve this into an API which will instruct
// the block inspector to animate transitions between what it
// displays based on the relationship between the selected block
// and its parent, and only enable it if the parent is controlling
// its children blocks.
blockInspectorAnimation: {
animationParent: "core/navigation",
"core/navigation": { enterDirection: "leftToRight" },
"core/navigation-submenu": { enterDirection: "rightToLeft" },
"core/navigation-link": { enterDirection: "rightToLeft" },
"core/search": { enterDirection: "rightToLeft" },
"core/social-links": { enterDirection: "rightToLeft" },
"core/page-list": { enterDirection: "rightToLeft" },
"core/spacer": { enterDirection: "rightToLeft" },
"core/home-link": { enterDirection: "rightToLeft" },
"core/site-title": { enterDirection: "rightToLeft" },
"core/site-logo": { enterDirection: "rightToLeft" }
},
generateAnchors: false,
// gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.
// The setting is only kept for backward compatibility purposes.
gradients: [
{
name: (0,external_wp_i18n_namespaceObject.__)("Vivid cyan blue to vivid purple"),
gradient: "linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",
slug: "vivid-cyan-blue-to-vivid-purple"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Light green cyan to vivid green cyan"),
gradient: "linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",
slug: "light-green-cyan-to-vivid-green-cyan"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Luminous vivid amber to luminous vivid orange"),
gradient: "linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",
slug: "luminous-vivid-amber-to-luminous-vivid-orange"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Luminous vivid orange to vivid red"),
gradient: "linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",
slug: "luminous-vivid-orange-to-vivid-red"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Very light gray to cyan bluish gray"),
gradient: "linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",
slug: "very-light-gray-to-cyan-bluish-gray"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Cool to warm spectrum"),
gradient: "linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",
slug: "cool-to-warm-spectrum"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Blush light purple"),
gradient: "linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",
slug: "blush-light-purple"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Blush bordeaux"),
gradient: "linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",
slug: "blush-bordeaux"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Luminous dusk"),
gradient: "linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",
slug: "luminous-dusk"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Pale ocean"),
gradient: "linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",
slug: "pale-ocean"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Electric grass"),
gradient: "linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",
slug: "electric-grass"
},
{
name: (0,external_wp_i18n_namespaceObject.__)("Midnight"),
gradient: "linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",
slug: "midnight"
}
],
__unstableResolvedAssets: { styles: [], scripts: [] }
};
;// ./node_modules/@wordpress/block-editor/build-module/store/array.js
function insertAt(array, elements, index) {
return [
...array.slice(0, index),
...Array.isArray(elements) ? elements : [elements],
...array.slice(index)
];
}
function moveTo(array, from, to, count = 1) {
const withoutMovedElements = [...array];
withoutMovedElements.splice(from, count);
return insertAt(
withoutMovedElements,
array.slice(from, from + count),
to
);
}
;// ./node_modules/@wordpress/block-editor/build-module/store/private-keys.js
const globalStylesDataKey = Symbol("globalStylesDataKey");
const globalStylesLinksDataKey = Symbol("globalStylesLinks");
const selectBlockPatternsKey = Symbol("selectBlockPatternsKey");
const reusableBlocksSelectKey = Symbol("reusableBlocksSelect");
const sectionRootClientIdKey = Symbol("sectionRootClientIdKey");
const mediaEditKey = Symbol("mediaEditKey");
const essentialFormatKey = Symbol("essentialFormat");
;// external ["wp","privateApis"]
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// ./node_modules/@wordpress/block-editor/build-module/lock-unlock.js
const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
"@wordpress/block-editor"
);
;// ./node_modules/@wordpress/block-editor/build-module/store/reducer.js
const { isContentBlock } = unlock(external_wp_blocks_namespaceObject.privateApis);
const identity = (x) => x;
function mapBlockOrder(blocks2, rootClientId = "") {
const result = /* @__PURE__ */ new Map();
const current = [];
result.set(rootClientId, current);
blocks2.forEach((block) => {
const { clientId, innerBlocks } = block;
current.push(clientId);
mapBlockOrder(innerBlocks, clientId).forEach(
(order, subClientId) => {
result.set(subClientId, order);
}
);
});
return result;
}
function mapBlockParents(blocks2, rootClientId = "") {
const result = [];
const stack = [[rootClientId, blocks2]];
while (stack.length) {
const [parent, currentBlocks] = stack.shift();
currentBlocks.forEach(({ innerBlocks, ...block }) => {
result.push([block.clientId, parent]);
if (innerBlocks?.length) {
stack.push([block.clientId, innerBlocks]);
}
});
}
return result;
}
function flattenBlocks(blocks2, transform = identity) {
const result = [];
const stack = [...blocks2];
while (stack.length) {
const { innerBlocks, ...block } = stack.shift();
stack.push(...innerBlocks);
result.push([block.clientId, transform(block)]);
}
return result;
}
function getFlattenedClientIds(blocks2) {
const result = {};
const stack = [...blocks2];
while (stack.length) {
const { innerBlocks, ...block } = stack.shift();
stack.push(...innerBlocks);
result[block.clientId] = true;
}
return result;
}
function getFlattenedBlocksWithoutAttributes(blocks2) {
return flattenBlocks(blocks2, (block) => {
const { attributes, ...restBlock } = block;
return restBlock;
});
}
function getFlattenedBlockAttributes(blocks2) {
return flattenBlocks(blocks2, (block) => block.attributes);
}
function hasSameKeys(a, b) {
return es6_default()(Object.keys(a), Object.keys(b));
}
function isUpdatingSameBlockAttribute(action, lastAction) {
return action.type === "UPDATE_BLOCK_ATTRIBUTES" && lastAction !== void 0 && lastAction.type === "UPDATE_BLOCK_ATTRIBUTES" && es6_default()(action.clientIds, lastAction.clientIds) && hasSameKeys(action.attributes, lastAction.attributes);
}
function updateBlockTreeForBlocks(state, blocks2) {
const treeToUpdate = state.tree;
const stack = [...blocks2];
const flattenedBlocks = [...blocks2];
while (stack.length) {
const block = stack.shift();
stack.push(...block.innerBlocks);
flattenedBlocks.push(...block.innerBlocks);
}
for (const block of flattenedBlocks) {
treeToUpdate.set(block.clientId, {});
}
for (const block of flattenedBlocks) {
treeToUpdate.set(
block.clientId,
Object.assign(treeToUpdate.get(block.clientId), {
...state.byClientId.get(block.clientId),
attributes: state.attributes.get(block.clientId),
innerBlocks: block.innerBlocks.map(
(subBlock) => treeToUpdate.get(subBlock.clientId)
)
})
);
}
}
function updateParentInnerBlocksInTree(state, updatedClientIds, updateChildrenOfUpdatedClientIds = false) {
const treeToUpdate = state.tree;
const uncontrolledParents = /* @__PURE__ */ new Set([]);
const controlledParents = /* @__PURE__ */ new Set();
for (const clientId of updatedClientIds) {
let current = updateChildrenOfUpdatedClientIds ? clientId : state.parents.get(clientId);
do {
if (state.controlledInnerBlocks[current]) {
controlledParents.add(current);
break;
} else {
uncontrolledParents.add(current);
current = state.parents.get(current);
}
} while (current !== void 0);
}
for (const clientId of uncontrolledParents) {
treeToUpdate.set(clientId, { ...treeToUpdate.get(clientId) });
}
for (const clientId of uncontrolledParents) {
treeToUpdate.get(clientId).innerBlocks = (state.order.get(clientId) || []).map((subClientId) => treeToUpdate.get(subClientId));
}
for (const clientId of controlledParents) {
treeToUpdate.set("controlled||" + clientId, {
innerBlocks: (state.order.get(clientId) || []).map(
(subClientId) => treeToUpdate.get(subClientId)
)
});
}
}
const withBlockTree = (reducer) => (state = {}, action) => {
const newState = reducer(state, action);
if (newState === state) {
return state;
}
newState.tree = state.tree ? state.tree : /* @__PURE__ */ new Map();
switch (action.type) {
case "RECEIVE_BLOCKS":
case "INSERT_BLOCKS": {
newState.tree = new Map(newState.tree);
updateBlockTreeForBlocks(newState, action.blocks);
updateParentInnerBlocksInTree(
newState,
action.rootClientId ? [action.rootClientId] : [""],
true
);
break;
}
case "UPDATE_BLOCK":
newState.tree = new Map(newState.tree);
newState.tree.set(action.clientId, {
...newState.tree.get(action.clientId),
...newState.byClientId.get(action.clientId),
attributes: newState.attributes.get(action.clientId)
});
updateParentInnerBlocksInTree(
newState,
[action.clientId],
false
);
break;
case "SYNC_DERIVED_BLOCK_ATTRIBUTES":
case "UPDATE_BLOCK_ATTRIBUTES": {
newState.tree = new Map(newState.tree);
action.clientIds.forEach((clientId) => {
newState.tree.set(clientId, {
...newState.tree.get(clientId),
attributes: newState.attributes.get(clientId)
});
});
updateParentInnerBlocksInTree(
newState,
action.clientIds,
false
);
break;
}
case "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN": {
const inserterClientIds = getFlattenedClientIds(
action.blocks
);
newState.tree = new Map(newState.tree);
action.replacedClientIds.forEach((clientId) => {
newState.tree.delete(clientId);
if (!inserterClientIds[clientId]) {
newState.tree.delete("controlled||" + clientId);
}
});
updateBlockTreeForBlocks(newState, action.blocks);
updateParentInnerBlocksInTree(
newState,
action.blocks.map((b) => b.clientId),
false
);
const parentsOfRemovedBlocks2 = [];
for (const clientId of action.clientIds) {
const parentId = state.parents.get(clientId);
if (parentId !== void 0 && (parentId === "" || newState.byClientId.get(parentId))) {
parentsOfRemovedBlocks2.push(parentId);
}
}
updateParentInnerBlocksInTree(
newState,
parentsOfRemovedBlocks2,
true
);
break;
}
case "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":
const parentsOfRemovedBlocks = [];
for (const clientId of action.clientIds) {
const parentId = state.parents.get(clientId);
if (parentId !== void 0 && (parentId === "" || newState.byClientId.get(parentId))) {
parentsOfRemovedBlocks.push(parentId);
}
}
newState.tree = new Map(newState.tree);
action.removedClientIds.forEach((clientId) => {
newState.tree.delete(clientId);
newState.tree.delete("controlled||" + clientId);
});
updateParentInnerBlocksInTree(
newState,
parentsOfRemovedBlocks,
true
);
break;
case "MOVE_BLOCKS_TO_POSITION": {
const updatedBlockUids = [];
if (action.fromRootClientId) {
updatedBlockUids.push(action.fromRootClientId);
} else {
updatedBlockUids.push("");
}
if (action.toRootClientId) {
updatedBlockUids.push(action.toRootClientId);
}
newState.tree = new Map(newState.tree);
updateParentInnerBlocksInTree(
newState,
updatedBlockUids,
true
);
break;
}
case "MOVE_BLOCKS_UP":
case "MOVE_BLOCKS_DOWN": {
const updatedBlockUids = [
action.rootClientId ? action.rootClientId : ""
];
newState.tree = new Map(newState.tree);
updateParentInnerBlocksInTree(
newState,
updatedBlockUids,
true
);
break;
}
case "SAVE_REUSABLE_BLOCK_SUCCESS": {
const updatedBlockUids = [];
newState.attributes.forEach((attributes, clientId) => {
if (newState.byClientId.get(clientId).name === "core/block" && attributes.ref === action.updatedId) {
updatedBlockUids.push(clientId);
}
});
newState.tree = new Map(newState.tree);
updatedBlockUids.forEach((clientId) => {
newState.tree.set(clientId, {
...newState.byClientId.get(clientId),
attributes: newState.attributes.get(clientId),
innerBlocks: newState.tree.get(clientId).innerBlocks
});
});
updateParentInnerBlocksInTree(
newState,
updatedBlockUids,
false
);
}
}
return newState;
};
function withPersistentBlockChange(reducer) {
let lastAction;
let markNextChangeAsNotPersistent = false;
let explicitPersistent;
return (state, action) => {
let nextState = reducer(state, action);
let nextIsPersistentChange;
if (action.type === "SET_EXPLICIT_PERSISTENT") {
explicitPersistent = action.isPersistentChange;
nextIsPersistentChange = state.isPersistentChange ?? true;
}
if (explicitPersistent !== void 0) {
nextIsPersistentChange = explicitPersistent;
return nextIsPersistentChange === nextState.isPersistentChange ? nextState : {
...nextState,
isPersistentChange: nextIsPersistentChange
};
}
const isExplicitPersistentChange = action.type === "MARK_LAST_CHANGE_AS_PERSISTENT" || markNextChangeAsNotPersistent;
if (state === nextState && !isExplicitPersistentChange) {
markNextChangeAsNotPersistent = action.type === "MARK_NEXT_CHANGE_AS_NOT_PERSISTENT";
nextIsPersistentChange = state?.isPersistentChange ?? true;
if (state.isPersistentChange === nextIsPersistentChange) {
return state;
}
return {
...nextState,
isPersistentChange: nextIsPersistentChange
};
}
nextState = {
...nextState,
isPersistentChange: isExplicitPersistentChange ? !markNextChangeAsNotPersistent : !isUpdatingSameBlockAttribute(action, lastAction)
};
lastAction = action;
markNextChangeAsNotPersistent = action.type === "MARK_NEXT_CHANGE_AS_NOT_PERSISTENT";
return nextState;
};
}
function withIgnoredBlockChange(reducer) {
const IGNORED_ACTION_TYPES = /* @__PURE__ */ new Set(["RECEIVE_BLOCKS"]);
return (state, action) => {
const nextState = reducer(state, action);
if (nextState !== state) {
nextState.isIgnoredChange = IGNORED_ACTION_TYPES.has(action.type);
}
return nextState;
};
}
const withInnerBlocksRemoveCascade = (reducer) => (state, action) => {
const getAllChildren = (clientIds) => {
let result = clientIds;
for (let i = 0; i < result.length; i++) {
if (!state.order.get(result[i]) || action.keepControlledInnerBlocks && action.keepControlledInnerBlocks[result[i]]) {
continue;
}
if (result === clientIds) {
result = [...result];
}
result.push(...state.order.get(result[i]));
}
return result;
};
if (state) {
switch (action.type) {
case "REMOVE_BLOCKS":
action = {
...action,
type: "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",
removedClientIds: getAllChildren(action.clientIds)
};
break;
case "REPLACE_BLOCKS":
action = {
...action,
type: "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",
replacedClientIds: getAllChildren(action.clientIds)
};
break;
}
}
return reducer(state, action);
};
const withBlockReset = (reducer) => (state, action) => {
if (action.type === "RESET_BLOCKS") {
const newState = {
...state,
byClientId: new Map(
getFlattenedBlocksWithoutAttributes(action.blocks)
),
attributes: new Map(getFlattenedBlockAttributes(action.blocks)),
order: mapBlockOrder(action.blocks),
parents: new Map(mapBlockParents(action.blocks)),
controlledInnerBlocks: {}
};
newState.tree = new Map(state?.tree);
updateBlockTreeForBlocks(newState, action.blocks);
newState.tree.set("", {
innerBlocks: action.blocks.map(
(subBlock) => newState.tree.get(subBlock.clientId)
)
});
return newState;
}
return reducer(state, action);
};
const withReplaceInnerBlocks = (reducer) => (state, action) => {
if (action.type !== "REPLACE_INNER_BLOCKS") {
return reducer(state, action);
}
const nestedControllers = {};
if (Object.keys(state.controlledInnerBlocks).length) {
const stack = [...action.blocks];
while (stack.length) {
const { innerBlocks, ...block } = stack.shift();
stack.push(...innerBlocks);
if (!!state.controlledInnerBlocks[block.clientId]) {
nestedControllers[block.clientId] = true;
}
}
}
let stateAfterBlocksRemoval = state;
if (state.order.get(action.rootClientId)) {
stateAfterBlocksRemoval = reducer(stateAfterBlocksRemoval, {
type: "REMOVE_BLOCKS",
keepControlledInnerBlocks: nestedControllers,
clientIds: state.order.get(action.rootClientId)
});
}
let stateAfterInsert = stateAfterBlocksRemoval;
if (action.blocks.length) {
stateAfterInsert = reducer(stateAfterInsert, {
...action,
type: "INSERT_BLOCKS",
index: 0
});
const stateAfterInsertOrder = new Map(stateAfterInsert.order);
Object.keys(nestedControllers).forEach((key) => {
if (state.order.get(key)) {
stateAfterInsertOrder.set(key, state.order.get(key));
}
});
stateAfterInsert.order = stateAfterInsertOrder;
stateAfterInsert.tree = new Map(stateAfterInsert.tree);
Object.keys(nestedControllers).forEach((_key) => {
const key = `controlled||${_key}`;
if (state.tree.has(key)) {
stateAfterInsert.tree.set(key, state.tree.get(key));
}
});
}
return stateAfterInsert;
};
const withSaveReusableBlock = (reducer) => (state, action) => {
if (state && action.type === "SAVE_REUSABLE_BLOCK_SUCCESS") {
const { id, updatedId } = action;
if (id === updatedId) {
return state;
}
state = { ...state };
state.attributes = new Map(state.attributes);
state.attributes.forEach((attributes, clientId) => {
const { name } = state.byClientId.get(clientId);
if (name === "core/block" && attributes.ref === id) {
state.attributes.set(clientId, {
...attributes,
ref: updatedId
});
}
});
}
return reducer(state, action);
};
const withResetControlledBlocks = (reducer) => (state, action) => {
if (action.type === "SET_HAS_CONTROLLED_INNER_BLOCKS") {
const tempState = reducer(state, {
type: "REPLACE_INNER_BLOCKS",
rootClientId: action.clientId,
blocks: []
});
return reducer(tempState, action);
}
return reducer(state, action);
};
const blocks = (0,external_wp_compose_namespaceObject.pipe)(
external_wp_data_namespaceObject.combineReducers,
withSaveReusableBlock,
// Needs to be before withBlockCache.
withBlockTree,
// Needs to be before withInnerBlocksRemoveCascade.
withInnerBlocksRemoveCascade,
withReplaceInnerBlocks,
// Needs to be after withInnerBlocksRemoveCascade.
withBlockReset,
withPersistentBlockChange,
withIgnoredBlockChange,
withResetControlledBlocks
)({
// The state is using a Map instead of a plain object for performance reasons.
// You can run the "./test/performance.js" unit test to check the impact
// code changes can have on this reducer.
byClientId(state = /* @__PURE__ */ new Map(), action) {
switch (action.type) {
case "RECEIVE_BLOCKS":
case "INSERT_BLOCKS": {
const newState = new Map(state);
getFlattenedBlocksWithoutAttributes(action.blocks).forEach(
([key, value]) => {
newState.set(key, value);
}
);
return newState;
}
case "UPDATE_BLOCK": {
if (!state.has(action.clientId)) {
return state;
}
const { attributes, ...changes } = action.updates;
if (Object.values(changes).length === 0) {
return state;
}
const newState = new Map(state);
newState.set(action.clientId, {
...state.get(action.clientId),
...changes
});
return newState;
}
case "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN": {
if (!action.blocks) {
return state;
}
const newState = new Map(state);
action.replacedClientIds.forEach((clientId) => {
newState.delete(clientId);
});
getFlattenedBlocksWithoutAttributes(action.blocks).forEach(
([key, value]) => {
newState.set(key, value);
}
);
return newState;
}
case "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN": {
const newState = new Map(state);
action.removedClientIds.forEach((clientId) => {
newState.delete(clientId);
});
return newState;
}
}
return state;
},
// The state is using a Map instead of a plain object for performance reasons.
// You can run the "./test/performance.js" unit test to check the impact
// code changes can have on this reducer.
attributes(state = /* @__PURE__ */ new Map(), action) {
switch (action.type) {
case "RECEIVE_BLOCKS":
case "INSERT_BLOCKS": {
const newState = new Map(state);
getFlattenedBlockAttributes(action.blocks).forEach(
([key, value]) => {
newState.set(key, value);
}
);
return newState;
}
case "UPDATE_BLOCK": {
if (!state.get(action.clientId) || !action.updates.attributes) {
return state;
}
const newState = new Map(state);
newState.set(action.clientId, {
...state.get(action.clientId),
...action.updates.attributes
});
return newState;
}
case "SYNC_DERIVED_BLOCK_ATTRIBUTES":
case "UPDATE_BLOCK_ATTRIBUTES": {
if (action.clientIds.every((id) => !state.get(id))) {
return state;
}
let hasChange = false;
const newState = new Map(state);
for (const clientId of action.clientIds) {
const updatedAttributeEntries = Object.entries(
!!action.options?.uniqueByBlock ? action.attributes[clientId] : action.attributes ?? {}
);
if (updatedAttributeEntries.length === 0) {
continue;
}
let hasUpdatedAttributes = false;
const existingAttributes = state.get(clientId);
const newAttributes = {};
updatedAttributeEntries.forEach(([key, value]) => {
if (existingAttributes[key] !== value) {
hasUpdatedAttributes = true;
newAttributes[key] = value;
}
});
hasChange = hasChange || hasUpdatedAttributes;
if (hasUpdatedAttributes) {
newState.set(clientId, {
...existingAttributes,
...newAttributes
});
}
}
return hasChange ? newState : state;
}
case "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN": {
if (!action.blocks) {
return state;
}
const newState = new Map(state);
action.replacedClientIds.forEach((clientId) => {
newState.delete(clientId);
});
getFlattenedBlockAttributes(action.blocks).forEach(
([key, value]) => {
newState.set(key, value);
}
);
return newState;
}
case "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN": {
const newState = new Map(state);
action.removedClientIds.forEach((clientId) => {
newState.delete(clientId);
});
return newState;
}
}
return state;
},
// The state is using a Map instead of a plain object for performance reasons.
// You can run the "./test/performance.js" unit test to check the impact
// code changes can have on this reducer.
order(state = /* @__PURE__ */ new Map(), action) {
switch (action.type) {
case "RECEIVE_BLOCKS": {
const blockOrder = mapBlockOrder(action.blocks);
const newState = new Map(state);
blockOrder.forEach((order, clientId) => {
if (clientId !== "") {
newState.set(clientId, order);
}
});
newState.set(
"",
(state.get("") ?? []).concat(blockOrder[""])
);
return newState;
}
case "INSERT_BLOCKS": {
const { rootClientId = "" } = action;
const subState = state.get(rootClientId) || [];
const mappedBlocks = mapBlockOrder(
action.blocks,
rootClientId
);
const { index = subState.length } = action;
const newState = new Map(state);
mappedBlocks.forEach((order, clientId) => {
newState.set(clientId, order);
});
newState.set(
rootClientId,
insertAt(
subState,
mappedBlocks.get(rootClientId),
index
)
);
return newState;
}
case "MOVE_BLOCKS_TO_POSITION": {
const {
fromRootClientId = "",
toRootClientId = "",
clientIds
} = action;
const { index = state.get(toRootClientId).length } = action;
if (fromRootClientId === toRootClientId) {
const subState = state.get(toRootClientId);
const fromIndex = subState.indexOf(clientIds[0]);
const newState2 = new Map(state);
newState2.set(
toRootClientId,
moveTo(
state.get(toRootClientId),
fromIndex,
index,
clientIds.length
)
);
return newState2;
}
const newState = new Map(state);
newState.set(
fromRootClientId,
state.get(fromRootClientId)?.filter((id) => !clientIds.includes(id)) ?? []
);
newState.set(
toRootClientId,
insertAt(state.get(toRootClientId), clientIds, index)
);
return newState;
}
case "MOVE_BLOCKS_UP": {
const { clientIds, rootClientId = "" } = action;
const firstClientId = clientIds[0];
const subState = state.get(rootClientId);
if (!subState.length || firstClientId === subState[0]) {
return state;
}
const firstIndex = subState.indexOf(firstClientId);
const newState = new Map(state);
newState.set(
rootClientId,
moveTo(
subState,
firstIndex,
firstIndex - 1,
clientIds.length
)
);
return newState;
}
case "MOVE_BLOCKS_DOWN": {
const { clientIds, rootClientId = "" } = action;
const firstClientId = clientIds[0];
const lastClientId = clientIds[clientIds.length - 1];
const subState = state.get(rootClientId);
if (!subState.length || lastClientId === subState[subState.length - 1]) {
return state;
}
const firstIndex = subState.indexOf(firstClientId);
const newState = new Map(state);
newState.set(
rootClientId,
moveTo(
subState,
firstIndex,
firstIndex + 1,
clientIds.length
)
);
return newState;
}
case "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN": {
const { clientIds } = action;
if (!action.blocks) {
return state;
}
const mappedBlocks = mapBlockOrder(action.blocks);
const newState = new Map(state);
action.replacedClientIds.forEach((clientId) => {
newState.delete(clientId);
});
mappedBlocks.forEach((order, clientId) => {
if (clientId !== "") {
newState.set(clientId, order);
}
});
newState.forEach((order, clientId) => {
const newSubOrder = Object.values(order).reduce(
(result, subClientId) => {
if (subClientId === clientIds[0]) {
return [...result, ...mappedBlocks.get("")];
}
if (clientIds.indexOf(subClientId) === -1) {
result.push(subClientId);
}
return result;
},
[]
);
newState.set(clientId, newSubOrder);
});
return newState;
}
case "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN": {
const newState = new Map(state);
action.removedClientIds.forEach((clientId) => {
newState.delete(clientId);
});
newState.forEach((order, clientId) => {
const newSubOrder = order?.filter(
(id) => !action.removedClientIds.includes(id)
) ?? [];
if (newSubOrder.length !== order.length) {
newState.set(clientId, newSubOrder);
}
});
return newState;
}
}
return state;
},
// While technically redundant data as the inverse of `order`, it serves as
// an optimization for the selectors which derive the ancestry of a block.
parents(state = /* @__PURE__ */ new Map(), action) {
switch (action.type) {
case "RECEIVE_BLOCKS": {
const newState = new Map(state);
mapBlockParents(action.blocks).forEach(
([key, value]) => {
newState.set(key, value);
}
);
return newState;
}
case "INSERT_BLOCKS": {
const newState = new Map(state);
mapBlockParents(
action.blocks,
action.rootClientId || ""
).forEach(([key, value]) => {
newState.set(key, value);
});
return newState;
}
case "MOVE_BLOCKS_TO_POSITION": {
const newState = new Map(state);
action.clientIds.forEach((id) => {
newState.set(id, action.toRootClientId || "");
});
return newState;
}
case "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN": {
const newState = new Map(state);
action.replacedClientIds.forEach((clientId) => {
newState.delete(clientId);
});
mapBlockParents(
action.blocks,
state.get(action.clientIds[0])
).forEach(([key, value]) => {
newState.set(key, value);
});
return newState;
}
case "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN": {
const newState = new Map(state);
action.removedClientIds.forEach((clientId) => {
newState.delete(clientId);
});
return newState;
}
}
return state;
},
controlledInnerBlocks(state = {}, { type, clientId, hasControlledInnerBlocks }) {
if (type === "SET_HAS_CONTROLLED_INNER_BLOCKS") {
return {
...state,
[clientId]: hasControlledInnerBlocks
};
}
return state;
}
});
function isBlockInterfaceHidden(state = false, action) {
switch (action.type) {
case "HIDE_BLOCK_INTERFACE":
return true;
case "SHOW_BLOCK_INTERFACE":
return false;
}
return state;
}
function isTyping(state = false, action) {
switch (action.type) {
case "START_TYPING":
return true;
case "STOP_TYPING":
return false;
}
return state;
}
function isDragging(state = false, action) {
switch (action.type) {
case "START_DRAGGING":
return true;
case "STOP_DRAGGING":
return false;
}
return state;
}
function draggedBlocks(state = [], action) {
switch (action.type) {
case "START_DRAGGING_BLOCKS":
return action.clientIds;
case "STOP_DRAGGING_BLOCKS":
return [];
}
return state;
}
function blockVisibility(state = {}, action) {
if (action.type === "SET_BLOCK_VISIBILITY") {
return {
...state,
...action.updates
};
}
return state;
}
function selectionHelper(state = {}, action) {
switch (action.type) {
case "CLEAR_SELECTED_BLOCK": {
if (state.clientId) {
return {};
}
return state;
}
case "SELECT_BLOCK":
if (action.clientId === state.clientId) {
return state;
}
return { clientId: action.clientId };
case "REPLACE_INNER_BLOCKS":
case "INSERT_BLOCKS": {
if (!action.updateSelection || !action.blocks.length) {
return state;
}
return { clientId: action.blocks[0].clientId };
}
case "REMOVE_BLOCKS":
if (!action.clientIds || !action.clientIds.length || action.clientIds.indexOf(state.clientId) === -1) {
return state;
}
return {};
case "REPLACE_BLOCKS": {
if (action.clientIds.indexOf(state.clientId) === -1) {
return state;
}
const blockToSelect = action.blocks[action.indexToSelect] || action.blocks[action.blocks.length - 1];
if (!blockToSelect) {
return {};
}
if (blockToSelect.clientId === state.clientId) {
return state;
}
return { clientId: blockToSelect.clientId };
}
}
return state;
}
function selection(state = {}, action) {
switch (action.type) {
case "SELECTION_CHANGE":
if (action.clientId) {
return {
selectionStart: {
clientId: action.clientId,
attributeKey: action.attributeKey,
offset: action.startOffset
},
selectionEnd: {
clientId: action.clientId,
attributeKey: action.attributeKey,
offset: action.endOffset
}
};
}
return {
selectionStart: action.start || state.selectionStart,
selectionEnd: action.end || state.selectionEnd
};
case "RESET_SELECTION":
const { selectionStart: selectionStart2, selectionEnd: selectionEnd2 } = action;
return {
selectionStart: selectionStart2,
selectionEnd: selectionEnd2
};
case "MULTI_SELECT":
const { start, end } = action;
if (start === state.selectionStart?.clientId && end === state.selectionEnd?.clientId) {
return state;
}
return {
selectionStart: { clientId: start },
selectionEnd: { clientId: end }
};
case "RESET_BLOCKS":
const startClientId = state?.selectionStart?.clientId;
const endClientId = state?.selectionEnd?.clientId;
if (!startClientId && !endClientId) {
return state;
}
if (!action.blocks.some(
(block) => block.clientId === startClientId
)) {
return {
selectionStart: {},
selectionEnd: {}
};
}
if (!action.blocks.some(
(block) => block.clientId === endClientId
)) {
return {
...state,
selectionEnd: state.selectionStart
};
}
}
const selectionStart = selectionHelper(state.selectionStart, action);
const selectionEnd = selectionHelper(state.selectionEnd, action);
if (selectionStart === state.selectionStart && selectionEnd === state.selectionEnd) {
return state;
}
return {
selectionStart,
selectionEnd
};
}
function isMultiSelecting(state = false, action) {
switch (action.type) {
case "START_MULTI_SELECT":
return true;
case "STOP_MULTI_SELECT":
return false;
}
return state;
}
function isSelectionEnabled(state = true, action) {
switch (action.type) {
case "TOGGLE_SELECTION":
return action.isSelectionEnabled;
}
return state;
}
function removalPromptData(state = false, action) {
switch (action.type) {
case "DISPLAY_BLOCK_REMOVAL_PROMPT":
const { clientIds, selectPrevious, message } = action;
return {
clientIds,
selectPrevious,
message
};
case "CLEAR_BLOCK_REMOVAL_PROMPT":
return false;
}
return state;
}
function blockRemovalRules(state = false, action) {
switch (action.type) {
case "SET_BLOCK_REMOVAL_RULES":
return action.rules;
}
return state;
}
function initialPosition(state = null, action) {
if (action.type === "REPLACE_BLOCKS" && action.initialPosition !== void 0) {
return action.initialPosition;
} else if ([
"MULTI_SELECT",
"SELECT_BLOCK",
"RESET_SELECTION",
"INSERT_BLOCKS",
"REPLACE_INNER_BLOCKS"
].includes(action.type)) {
return action.initialPosition;
}
return state;
}
function blocksMode(state = {}, action) {
if (action.type === "TOGGLE_BLOCK_MODE") {
const { clientId } = action;
return {
...state,
[clientId]: state[clientId] && state[clientId] === "html" ? "visual" : "html"
};
}
return state;
}
function insertionCue(state = null, action) {
switch (action.type) {
case "SHOW_INSERTION_POINT": {
const {
rootClientId,
index,
__unstableWithInserter,
operation,
nearestSide
} = action;
const nextState = {
rootClientId,
index,
__unstableWithInserter,
operation,
nearestSide
};
return es6_default()(state, nextState) ? state : nextState;
}
case "HIDE_INSERTION_POINT":
return null;
}
return state;
}
function template(state = { isValid: true }, action) {
switch (action.type) {
case "SET_TEMPLATE_VALIDITY":
return {
...state,
isValid: action.isValid
};
}
return state;
}
function settings(state = SETTINGS_DEFAULTS, action) {
switch (action.type) {
case "UPDATE_SETTINGS": {
const updatedSettings = action.reset ? {
...SETTINGS_DEFAULTS,
...action.settings
} : {
...state,
...action.settings
};
Object.defineProperty(updatedSettings, "__unstableIsPreviewMode", {
get() {
external_wp_deprecated_default()("__unstableIsPreviewMode", {
since: "6.8",
alternative: "isPreviewMode"
});
return this.isPreviewMode;
}
});
return updatedSettings;
}
}
return state;
}
function preferences(state = PREFERENCES_DEFAULTS, action) {
switch (action.type) {
case "INSERT_BLOCKS":
case "REPLACE_BLOCKS": {
const nextInsertUsage = action.blocks.reduce(
(prevUsage, block) => {
const { attributes, name: blockName } = block;
let id = blockName;
const match = (0,external_wp_data_namespaceObject.select)(external_wp_blocks_namespaceObject.store).getActiveBlockVariation(
blockName,
attributes
);
if (match?.name) {
id += "/" + match.name;
}
if (blockName === "core/block") {
id += "/" + attributes.ref;
}
return {
...prevUsage,
[id]: {
time: action.time,
count: prevUsage[id] ? prevUsage[id].count + 1 : 1
}
};
},
state.insertUsage
);
return {
...state,
insertUsage: nextInsertUsage
};
}
}
return state;
}
const blockListSettings = (state = {}, action) => {
switch (action.type) {
// Even if the replaced blocks have the same client ID, our logic
// should correct the state.
case "REPLACE_BLOCKS":
case "REMOVE_BLOCKS": {
return Object.fromEntries(
Object.entries(state).filter(
([id]) => !action.clientIds.includes(id)
)
);
}
case "UPDATE_BLOCK_LIST_SETTINGS": {
const updates = typeof action.clientId === "string" ? { [action.clientId]: action.settings } : action.clientId;
for (const clientId in updates) {
if (!updates[clientId]) {
if (!state[clientId]) {
delete updates[clientId];
}
} else if (es6_default()(state[clientId], updates[clientId])) {
delete updates[clientId];
}
}
if (Object.keys(updates).length === 0) {
return state;
}
const merged = { ...state, ...updates };
for (const clientId in updates) {
if (!updates[clientId]) {
delete merged[clientId];
}
}
return merged;
}
}
return state;
};
function lastBlockAttributesChange(state = null, action) {
switch (action.type) {
case "UPDATE_BLOCK":
if (!action.updates.attributes) {
break;
}
return { [action.clientId]: action.updates.attributes };
case "UPDATE_BLOCK_ATTRIBUTES":
return action.clientIds.reduce(
(accumulator, id) => ({
...accumulator,
[id]: !!action.options?.uniqueByBlock ? action.attributes[id] : action.attributes
}),
{}
);
}
return state;
}
function highlightedBlock(state, action) {
switch (action.type) {
case "TOGGLE_BLOCK_HIGHLIGHT":
const { clientId, isHighlighted } = action;
if (isHighlighted) {
return clientId;
} else if (state === clientId) {
return null;
}
return state;
case "SELECT_BLOCK":
if (action.clientId !== state) {
return null;
}
}
return state;
}
function hasBlockSpotlight(state, action) {
switch (action.type) {
case "TOGGLE_BLOCK_SPOTLIGHT":
const { clientId, hasBlockSpotlight: _hasBlockSpotlight } = action;
if (_hasBlockSpotlight) {
return clientId;
} else if (state === clientId) {
return null;
}
return state;
case "SELECT_BLOCK":
if (action.clientId !== state) {
return null;
}
return state;
case "SELECTION_CHANGE":
if (action.start?.clientId !== state || action.end?.clientId !== state) {
return null;
}
return state;
case "CLEAR_SELECTED_BLOCK":
return null;
}
return state;
}
function expandedBlock(state = null, action) {
switch (action.type) {
case "SET_BLOCK_EXPANDED_IN_LIST_VIEW":
return action.clientId;
case "SELECT_BLOCK":
if (action.clientId !== state) {
return null;
}
}
return state;
}
function lastBlockInserted(state = {}, action) {
switch (action.type) {
case "INSERT_BLOCKS":
case "REPLACE_BLOCKS":
if (!action.blocks.length) {
return state;
}
const clientIds = action.blocks.map((block) => {
return block.clientId;
});
const source = action.meta?.source;
return { clientIds, source };
case "RESET_BLOCKS":
return {};
}
return state;
}
function temporarilyEditingAsBlocks(state = "", action) {
if (action.type === "SET_TEMPORARILY_EDITING_AS_BLOCKS") {
return action.temporarilyEditingAsBlocks;
}
return state;
}
function temporarilyEditingFocusModeRevert(state = "", action) {
if (action.type === "SET_TEMPORARILY_EDITING_AS_BLOCKS") {
return action.focusModeToRevert;
}
return state;
}
function blockEditingModes(state = /* @__PURE__ */ new Map(), action) {
switch (action.type) {
case "SET_BLOCK_EDITING_MODE":
if (state.get(action.clientId) === action.mode) {
return state;
}
return new Map(state).set(action.clientId, action.mode);
case "UNSET_BLOCK_EDITING_MODE": {
if (!state.has(action.clientId)) {
return state;
}
const newState = new Map(state);
newState.delete(action.clientId);
return newState;
}
case "RESET_BLOCKS": {
return state.has("") ? (/* @__PURE__ */ new Map()).set("", state.get("")) : state;
}
}
return state;
}
function openedBlockSettingsMenu(state = null, action) {
if ("SET_OPENED_BLOCK_SETTINGS_MENU" === action.type) {
return action?.clientId ?? null;
}
return state;
}
function styleOverrides(state = /* @__PURE__ */ new Map(), action) {
switch (action.type) {
case "SET_STYLE_OVERRIDE":
return new Map(state).set(action.id, action.style);
case "DELETE_STYLE_OVERRIDE": {
const newState = new Map(state);
newState.delete(action.id);
return newState;
}
}
return state;
}
function registeredInserterMediaCategories(state = [], action) {
switch (action.type) {
case "REGISTER_INSERTER_MEDIA_CATEGORY":
return [...state, action.category];
}
return state;
}
function lastFocus(state = false, action) {
switch (action.type) {
case "LAST_FOCUS":
return action.lastFocus;
}
return state;
}
function zoomLevel(state = 100, action) {
switch (action.type) {
case "SET_ZOOM_LEVEL":
return action.zoom;
case "RESET_ZOOM_LEVEL":
return 100;
}
return state;
}
function insertionPoint(state = null, action) {
switch (action.type) {
case "SET_INSERTION_POINT":
return action.value;
case "SELECT_BLOCK":
return null;
}
return state;
}
const combinedReducers = (0,external_wp_data_namespaceObject.combineReducers)({
blocks,
isDragging,
isTyping,
isBlockInterfaceHidden,
draggedBlocks,
selection,
isMultiSelecting,
isSelectionEnabled,
initialPosition,
blocksMode,
blockListSettings,
insertionPoint,
insertionCue,
template,
settings,
preferences,
lastBlockAttributesChange,
lastFocus,
expandedBlock,
highlightedBlock,
lastBlockInserted,
temporarilyEditingAsBlocks,
temporarilyEditingFocusModeRevert,
blockVisibility,
blockEditingModes,
styleOverrides,
removalPromptData,
blockRemovalRules,
openedBlockSettingsMenu,
registeredInserterMediaCategories,
zoomLevel,
hasBlockSpotlight
});
function getBlockTreeBlock(state, clientId) {
if (clientId === "") {
const rootBlock = state.blocks.tree.get(clientId);
if (!rootBlock) {
return;
}
return {
clientId: "",
...rootBlock
};
}
if (!state.blocks.controlledInnerBlocks[clientId]) {
return state.blocks.tree.get(clientId);
}
const controlledTree = state.blocks.tree.get(`controlled||${clientId}`);
const regularTree = state.blocks.tree.get(clientId);
return {
...regularTree,
innerBlocks: controlledTree?.innerBlocks
};
}
function traverseBlockTree(state, clientId, callback) {
const tree = getBlockTreeBlock(state, clientId);
if (!tree) {
return;
}
callback(tree);
if (!tree?.innerBlocks?.length) {
return;
}
for (const innerBlock of tree?.innerBlocks) {
traverseBlockTree(state, innerBlock.clientId, callback);
}
}
function findParentInClientIdsList(state, clientId, clientIds) {
if (!clientIds.length) {
return;
}
let parent = state.blocks.parents.get(clientId);
while (parent !== void 0) {
if (clientIds.includes(parent)) {
return parent;
}
parent = state.blocks.parents.get(parent);
}
}
function hasBindings(block) {
return block?.attributes?.metadata?.bindings && Object.keys(block?.attributes?.metadata?.bindings).length;
}
function getDerivedBlockEditingModesForTree(state, treeClientId = "") {
const isZoomedOut = state?.zoomLevel < 100 || state?.zoomLevel === "auto-scaled";
const derivedBlockEditingModes = /* @__PURE__ */ new Map();
const sectionRootClientId = state.settings?.[sectionRootClientIdKey];
const sectionClientIds = state.blocks.order.get(sectionRootClientId);
const hasDisabledBlocks = Array.from(state.blockEditingModes).some(
([, mode]) => mode === "disabled"
);
const templatePartClientIds = [];
const syncedPatternClientIds = [];
Object.keys(state.blocks.controlledInnerBlocks).forEach((clientId) => {
const block = state.blocks.byClientId?.get(clientId);
if (block?.name === "core/template-part") {
templatePartClientIds.push(clientId);
}
if (block?.name === "core/block") {
syncedPatternClientIds.push(clientId);
}
});
const contentOnlyTemplateLockedClientIds = Object.keys(
state.blockListSettings
).filter(
(clientId) => state.blockListSettings[clientId]?.templateLock === "contentOnly"
);
const unsyncedPatternClientIds = !!window?.__experimentalContentOnlyPatternInsertion ? Array.from(state.blocks.attributes.keys()).filter(
(clientId) => state.blocks.attributes.get(clientId)?.metadata?.patternName
) : [];
const contentOnlyParents = [
...contentOnlyTemplateLockedClientIds,
...unsyncedPatternClientIds,
...window?.__experimentalContentOnlyPatternInsertion ? templatePartClientIds : []
];
traverseBlockTree(state, treeClientId, (block) => {
const { clientId, name: blockName } = block;
if (state.blockEditingModes.has(clientId)) {
return;
}
if (hasDisabledBlocks) {
let ancestorBlockEditingMode;
let parent = state.blocks.parents.get(clientId);
while (parent !== void 0) {
if (state.blockEditingModes.has(parent)) {
ancestorBlockEditingMode = state.blockEditingModes.get(parent);
}
if (ancestorBlockEditingMode) {
break;
}
parent = state.blocks.parents.get(parent);
}
if (ancestorBlockEditingMode === "disabled") {
derivedBlockEditingModes.set(clientId, "disabled");
return;
}
}
if (isZoomedOut) {
if (clientId === sectionRootClientId) {
derivedBlockEditingModes.set(clientId, "contentOnly");
return;
}
if (!sectionClientIds?.length) {
derivedBlockEditingModes.set(clientId, "disabled");
return;
}
if (sectionClientIds.includes(clientId)) {
derivedBlockEditingModes.set(clientId, "contentOnly");
return;
}
derivedBlockEditingModes.set(clientId, "disabled");
return;
}
if (syncedPatternClientIds.length) {
if (syncedPatternClientIds.includes(clientId)) {
if (findParentInClientIdsList(
state,
clientId,
syncedPatternClientIds
)) {
derivedBlockEditingModes.set(clientId, "disabled");
return;
}
return;
}
const parentPatternClientId = findParentInClientIdsList(
state,
clientId,
syncedPatternClientIds
);
if (parentPatternClientId) {
if (findParentInClientIdsList(
state,
parentPatternClientId,
syncedPatternClientIds
)) {
derivedBlockEditingModes.set(clientId, "disabled");
return;
}
if (hasBindings(block)) {
derivedBlockEditingModes.set(clientId, "contentOnly");
return;
}
derivedBlockEditingModes.set(clientId, "disabled");
}
}
if (contentOnlyParents.length) {
const hasContentOnlyParent = !!findParentInClientIdsList(
state,
clientId,
contentOnlyParents
);
if (hasContentOnlyParent) {
if (isContentBlock(blockName)) {
derivedBlockEditingModes.set(clientId, "contentOnly");
} else {
derivedBlockEditingModes.set(clientId, "disabled");
}
}
}
});
return derivedBlockEditingModes;
}
function getDerivedBlockEditingModesUpdates({
prevState,
nextState,
addedBlocks,
removedClientIds
}) {
const prevDerivedBlockEditingModes = prevState.derivedBlockEditingModes;
let nextDerivedBlockEditingModes;
removedClientIds?.forEach((clientId) => {
traverseBlockTree(prevState, clientId, (block) => {
if (prevDerivedBlockEditingModes.has(block.clientId)) {
if (!nextDerivedBlockEditingModes) {
nextDerivedBlockEditingModes = new Map(
prevDerivedBlockEditingModes
);
}
nextDerivedBlockEditingModes.delete(block.clientId);
}
});
});
addedBlocks?.forEach((addedBlock) => {
const updates = getDerivedBlockEditingModesForTree(
nextState,
addedBlock.clientId
);
if (updates.size) {
if (!nextDerivedBlockEditingModes) {
nextDerivedBlockEditingModes = new Map([
...prevDerivedBlockEditingModes?.size ? prevDerivedBlockEditingModes : [],
...updates
]);
} else {
nextDerivedBlockEditingModes = new Map([
...nextDerivedBlockEditingModes?.size ? nextDerivedBlockEditingModes : [],
...updates
]);
}
}
});
return nextDerivedBlockEditingModes;
}
function withDerivedBlockEditingModes(reducer) {
return (state, action) => {
const nextState = reducer(state, action);
if (action.type !== "SET_EDITOR_MODE" && nextState === state) {
return state;
}
switch (action.type) {
case "REMOVE_BLOCKS": {
const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({
prevState: state,
nextState,
removedClientIds: action.clientIds
});
if (nextDerivedBlockEditingModes) {
return {
...nextState,
derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes
};
}
break;
}
case "RECEIVE_BLOCKS":
case "INSERT_BLOCKS": {
const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({
prevState: state,
nextState,
addedBlocks: action.blocks
});
if (nextDerivedBlockEditingModes) {
return {
...nextState,
derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes
};
}
break;
}
case "UPDATE_BLOCK_ATTRIBUTES": {
const addedBlocks = [];
const removedClientIds = [];
for (const clientId of action?.clientIds) {
const attributes = action.options?.uniqueByBlock ? action.attributes[clientId] : action.attributes;
if (!attributes) {
break;
}
if (
// patternName is switching from falsy to truthy, indicating
// this block is becoming an unsynced pattern.
attributes.metadata?.patternName && !state.blocks.attributes.get(clientId)?.metadata?.patternName
) {
addedBlocks.push(
nextState.blocks.tree.get(clientId)
);
} else if (
// patternName is switching from truthy to falsy, this block is becoming
// a regular block but was an unsynced pattern.
// Check that `metadata` is part of the included attributes, as
// `updateBlockAttributes` merges attributes, if it isn't present
// the previous `metadata` would be retained.
attributes.metadata && !attributes.metadata?.patternName && state.blocks.attributes.get(clientId)?.metadata?.patternName
) {
removedClientIds.push(clientId);
}
}
if (!addedBlocks?.length && !removedClientIds?.length) {
break;
}
const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({
prevState: state,
nextState,
addedBlocks,
removedClientIds
});
if (nextDerivedBlockEditingModes) {
return {
...nextState,
derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes
};
}
break;
}
case "UPDATE_BLOCK_LIST_SETTINGS": {
const addedBlocks = [];
const removedClientIds = [];
const updates = typeof action.clientId === "string" ? { [action.clientId]: action.settings } : action.clientId;
for (const clientId in updates) {
const isNewContentOnlyBlock = state.blockListSettings[clientId]?.templateLock !== "contentOnly" && nextState.blockListSettings[clientId]?.templateLock === "contentOnly";
const wasContentOnlyBlock = state.blockListSettings[clientId]?.templateLock === "contentOnly" && nextState.blockListSettings[clientId]?.templateLock !== "contentOnly";
if (isNewContentOnlyBlock) {
addedBlocks.push(
nextState.blocks.tree.get(clientId)
);
} else if (wasContentOnlyBlock) {
removedClientIds.push(clientId);
}
}
if (!addedBlocks.length && !removedClientIds.length) {
break;
}
const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({
prevState: state,
nextState,
addedBlocks,
removedClientIds
});
if (nextDerivedBlockEditingModes) {
return {
...nextState,
derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes
};
}
break;
}
case "SET_BLOCK_EDITING_MODE":
case "UNSET_BLOCK_EDITING_MODE":
case "SET_HAS_CONTROLLED_INNER_BLOCKS": {
const updatedBlock = getBlockTreeBlock(
nextState,
action.clientId
);
if (!updatedBlock) {
break;
}
const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({
prevState: state,
nextState,
removedClientIds: [action.clientId],
addedBlocks: [updatedBlock]
});
if (nextDerivedBlockEditingModes) {
return {
...nextState,
derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes
};
}
break;
}
case "REPLACE_BLOCKS": {
const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({
prevState: state,
nextState,
addedBlocks: action.blocks,
removedClientIds: action.clientIds
});
if (nextDerivedBlockEditingModes) {
return {
...nextState,
derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes
};
}
break;
}
case "REPLACE_INNER_BLOCKS": {
const removedClientIds = state.blocks.order.get(
action.rootClientId
);
const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({
prevState: state,
nextState,
addedBlocks: action.blocks,
removedClientIds
});
if (nextDerivedBlockEditingModes) {
return {
...nextState,
derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes
};
}
break;
}
case "MOVE_BLOCKS_TO_POSITION": {
const addedBlocks = action.clientIds.map((clientId) => {
return nextState.blocks.byClientId.get(clientId);
});
const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({
prevState: state,
nextState,
addedBlocks,
removedClientIds: action.clientIds
});
if (nextDerivedBlockEditingModes) {
return {
...nextState,
derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes
};
}
break;
}
case "UPDATE_SETTINGS": {
if (state?.settings?.[sectionRootClientIdKey] !== nextState?.settings?.[sectionRootClientIdKey]) {
return {
...nextState,
derivedBlockEditingModes: getDerivedBlockEditingModesForTree(nextState)
};
}
break;
}
case "RESET_BLOCKS":
case "SET_EDITOR_MODE":
case "RESET_ZOOM_LEVEL":
case "SET_ZOOM_LEVEL": {
return {
...nextState,
derivedBlockEditingModes: getDerivedBlockEditingModesForTree(nextState)
};
}
}
nextState.derivedBlockEditingModes = state?.derivedBlockEditingModes ?? /* @__PURE__ */ new Map();
return nextState;
};
}
function withAutomaticChangeReset(reducer) {
return (state, action) => {
const nextState = reducer(state, action);
if (!state) {
return nextState;
}
nextState.automaticChangeStatus = state.automaticChangeStatus;
if (action.type === "MARK_AUTOMATIC_CHANGE") {
return {
...nextState,
automaticChangeStatus: "pending"
};
}
if (action.type === "MARK_AUTOMATIC_CHANGE_FINAL" && state.automaticChangeStatus === "pending") {
return {
...nextState,
automaticChangeStatus: "final"
};
}
if (nextState.blocks === state.blocks && nextState.selection === state.selection) {
return nextState;
}
if (nextState.automaticChangeStatus !== "final" && nextState.selection !== state.selection) {
return nextState;
}
return {
...nextState,
automaticChangeStatus: void 0
};
};
}
var reducer_default = (0,external_wp_compose_namespaceObject.pipe)(
withDerivedBlockEditingModes,
withAutomaticChangeReset
)(combinedReducers);
;// external ["wp","primitives"]
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
;// ./node_modules/@wordpress/icons/build-module/library/symbol.js
var symbol_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) });
;// external ["wp","richText"]
const external_wp_richText_namespaceObject = window["wp"]["richText"];
;// external ["wp","blockSerializationDefaultParser"]
const external_wp_blockSerializationDefaultParser_namespaceObject = window["wp"]["blockSerializationDefaultParser"];
;// ./node_modules/@wordpress/block-editor/build-module/store/constants.js
const STORE_NAME = "core/block-editor";
;// ./node_modules/@wordpress/block-editor/build-module/utils/object.js
function setImmutably(object, path, value) {
path = Array.isArray(path) ? [...path] : [path];
object = Array.isArray(object) ? [...object] : { ...object };
const leaf = path.pop();
let prev = object;
for (const key of path) {
const lvl = prev[key];
prev = prev[key] = Array.isArray(lvl) ? [...lvl] : { ...lvl };
}
prev[leaf] = value;
return object;
}
const getValueFromObjectPath = (object, path, defaultValue) => {
const arrayPath = Array.isArray(path) ? path : path.split(".");
let value = object;
arrayPath.forEach((fieldName) => {
value = value?.[fieldName];
});
return value ?? defaultValue;
};
function uniqByProperty(array, property) {
const seen = /* @__PURE__ */ new Set();
return array.filter((item) => {
const value = item[property];
return seen.has(value) ? false : seen.add(value);
});
}
;// ./node_modules/@wordpress/block-editor/build-module/store/get-block-settings.js
const blockedPaths = [
"color",
"border",
"dimensions",
"typography",
"spacing"
];
const deprecatedFlags = {
"color.palette": (settings) => settings.colors,
"color.gradients": (settings) => settings.gradients,
"color.custom": (settings) => settings.disableCustomColors === void 0 ? void 0 : !settings.disableCustomColors,
"color.customGradient": (settings) => settings.disableCustomGradients === void 0 ? void 0 : !settings.disableCustomGradients,
"typography.fontSizes": (settings) => settings.fontSizes,
"typography.customFontSize": (settings) => settings.disableCustomFontSizes === void 0 ? void 0 : !settings.disableCustomFontSizes,
"typography.lineHeight": (settings) => settings.enableCustomLineHeight,
"spacing.units": (settings) => {
if (settings.enableCustomUnits === void 0) {
return;
}
if (settings.enableCustomUnits === true) {
return ["px", "em", "rem", "vh", "vw", "%"];
}
return settings.enableCustomUnits;
},
"spacing.padding": (settings) => settings.enableCustomSpacing
};
const prefixedFlags = {
/*
* These were only available in the plugin
* and can be removed when the minimum WordPress version
* for the plugin is 5.9.
*/
"border.customColor": "border.color",
"border.customStyle": "border.style",
"border.customWidth": "border.width",
"typography.customFontStyle": "typography.fontStyle",
"typography.customFontWeight": "typography.fontWeight",
"typography.customLetterSpacing": "typography.letterSpacing",
"typography.customTextDecorations": "typography.textDecoration",
"typography.customTextTransforms": "typography.textTransform",
/*
* These were part of WordPress 5.8 and we need to keep them.
*/
"border.customRadius": "border.radius",
"spacing.customMargin": "spacing.margin",
"spacing.customPadding": "spacing.padding",
"typography.customLineHeight": "typography.lineHeight"
};
const removeCustomPrefixes = (path) => {
return prefixedFlags[path] || path;
};
function getBlockSettings(state, clientId, ...paths) {
const blockName = getBlockName(state, clientId);
const candidates = [];
if (clientId) {
let id = clientId;
do {
const name = getBlockName(state, id);
if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, "__experimentalSettings", false)) {
candidates.push(id);
}
} while (id = state.blocks.parents.get(id));
}
return paths.map((path) => {
if (blockedPaths.includes(path)) {
console.warn(
"Top level useSetting paths are disabled. Please use a subpath to query the information needed."
);
return void 0;
}
let result = (0,external_wp_hooks_namespaceObject.applyFilters)(
"blockEditor.useSetting.before",
void 0,
path,
clientId,
blockName
);
if (void 0 !== result) {
return result;
}
const normalizedPath = removeCustomPrefixes(path);
for (const candidateClientId of candidates) {
const candidateAtts = getBlockAttributes(
state,
candidateClientId
);
result = getValueFromObjectPath(
candidateAtts.settings?.blocks?.[blockName],
normalizedPath
) ?? getValueFromObjectPath(
candidateAtts.settings,
normalizedPath
);
if (result !== void 0) {
break;
}
}
const settings = getSettings(state);
if (result === void 0 && blockName) {
result = getValueFromObjectPath(
settings.__experimentalFeatures?.blocks?.[blockName],
normalizedPath
);
}
if (result === void 0) {
result = getValueFromObjectPath(
settings.__experimentalFeatures,
normalizedPath
);
}
if (result !== void 0) {
if (external_wp_blocks_namespaceObject.__EXPERIMENTAL_PATHS_WITH_OVERRIDE[normalizedPath]) {
return result.custom ?? result.theme ?? result.default;
}
return result;
}
const deprecatedSettingsValue = deprecatedFlags[normalizedPath]?.(settings);
if (deprecatedSettingsValue !== void 0) {
return deprecatedSettingsValue;
}
return normalizedPath === "typography.dropCap" ? true : void 0;
});
}
;// ./node_modules/@wordpress/block-editor/build-module/store/private-selectors.js
const { isContentBlock: private_selectors_isContentBlock } = unlock(external_wp_blocks_namespaceObject.privateApis);
function private_selectors_isBlockInterfaceHidden(state) {
return state.isBlockInterfaceHidden;
}
function getLastInsertedBlocksClientIds(state) {
return state?.lastBlockInserted?.clientIds;
}
function getBlockWithoutAttributes(state, clientId) {
return state.blocks.byClientId.get(clientId);
}
const isBlockSubtreeDisabled = (state, clientId) => {
const isChildSubtreeDisabled = (childClientId) => {
return getBlockEditingMode(state, childClientId) === "disabled" && getBlockOrder(state, childClientId).every(
isChildSubtreeDisabled
);
};
return getBlockOrder(state, clientId).every(isChildSubtreeDisabled);
};
function isContainerInsertableToInContentOnlyMode(state, blockName, rootClientId) {
const isBlockContentBlock = private_selectors_isContentBlock(blockName);
const rootBlockName = getBlockName(state, rootClientId);
const isContainerContentBlock = private_selectors_isContentBlock(rootBlockName);
const isRootBlockMain = getSectionRootClientId(state) === rootClientId;
return isRootBlockMain || isContainerContentBlock && isBlockContentBlock;
}
function getEnabledClientIdsTreeUnmemoized(state, rootClientId) {
const blockOrder = getBlockOrder(state, rootClientId);
const result = [];
for (const clientId of blockOrder) {
const innerBlocks = getEnabledClientIdsTreeUnmemoized(
state,
clientId
);
if (getBlockEditingMode(state, clientId) !== "disabled") {
result.push({ clientId, innerBlocks });
} else {
result.push(...innerBlocks);
}
}
return result;
}
const getEnabledClientIdsTree = (0,external_wp_data_namespaceObject.createRegistrySelector)(
() => (0,external_wp_data_namespaceObject.createSelector)(getEnabledClientIdsTreeUnmemoized, (state) => [
state.blocks.order,
state.derivedBlockEditingModes,
state.blockEditingModes
])
);
const getEnabledBlockParents = (0,external_wp_data_namespaceObject.createSelector)(
(state, clientId, ascending = false) => {
return getBlockParents(state, clientId, ascending).filter(
(parent) => getBlockEditingMode(state, parent) !== "disabled"
);
},
(state) => [
state.blocks.parents,
state.blockEditingModes,
state.settings.templateLock,
state.blockListSettings
]
);
function getRemovalPromptData(state) {
return state.removalPromptData;
}
function getBlockRemovalRules(state) {
return state.blockRemovalRules;
}
function getOpenedBlockSettingsMenu(state) {
return state.openedBlockSettingsMenu;
}
const getStyleOverrides = (0,external_wp_data_namespaceObject.createSelector)(
(state) => {
const clientIds = getClientIdsWithDescendants(state);
const clientIdMap = clientIds.reduce((acc, clientId, index) => {
acc[clientId] = index;
return acc;
}, {});
return [...state.styleOverrides].sort((overrideA, overrideB) => {
const [, { clientId: clientIdA }] = overrideA;
const [, { clientId: clientIdB }] = overrideB;
const aIndex = clientIdMap[clientIdA] ?? -1;
const bIndex = clientIdMap[clientIdB] ?? -1;
return aIndex - bIndex;
});
},
(state) => [state.blocks.order, state.styleOverrides]
);
function getRegisteredInserterMediaCategories(state) {
return state.registeredInserterMediaCategories;
}
const getInserterMediaCategories = (0,external_wp_data_namespaceObject.createSelector)(
(state) => {
const {
settings: {
inserterMediaCategories,
allowedMimeTypes,
enableOpenverseMediaCategory
},
registeredInserterMediaCategories
} = state;
if (!inserterMediaCategories && !registeredInserterMediaCategories.length || !allowedMimeTypes) {
return;
}
const coreInserterMediaCategoriesNames = inserterMediaCategories?.map(({ name }) => name) || [];
const mergedCategories = [
...inserterMediaCategories || [],
...(registeredInserterMediaCategories || []).filter(
({ name }) => !coreInserterMediaCategoriesNames.includes(name)
)
];
return mergedCategories.filter((category) => {
if (!enableOpenverseMediaCategory && category.name === "openverse") {
return false;
}
return Object.values(allowedMimeTypes).some(
(mimeType) => mimeType.startsWith(`${category.mediaType}/`)
);
});
},
(state) => [
state.settings.inserterMediaCategories,
state.settings.allowedMimeTypes,
state.settings.enableOpenverseMediaCategory,
state.registeredInserterMediaCategories
]
);
const hasAllowedPatterns = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (0,external_wp_data_namespaceObject.createSelector)(
(state, rootClientId = null) => {
const { getAllPatterns: getAllPatterns2 } = unlock(select(STORE_NAME));
const patterns = getAllPatterns2();
const { allowedBlockTypes } = getSettings(state);
return patterns.some((pattern) => {
const { inserter = true } = pattern;
if (!inserter) {
return false;
}
const grammar = getGrammar(pattern);
return checkAllowListRecursive(grammar, allowedBlockTypes) && grammar.every(
({ name: blockName }) => canInsertBlockType(state, blockName, rootClientId)
);
});
},
(state, rootClientId) => [
...getAllPatternsDependants(select)(state),
...getInsertBlockTypeDependants(select)(state, rootClientId)
]
)
);
const getPatternBySlug = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (0,external_wp_data_namespaceObject.createSelector)(
(state, patternName) => {
if (patternName?.startsWith("core/block/")) {
const _id = parseInt(
patternName.slice("core/block/".length),
10
);
const block = unlock(select(STORE_NAME)).getReusableBlocks().find(({ id }) => id === _id);
if (!block) {
return null;
}
return mapUserPattern(
block,
state.settings.__experimentalUserPatternCategories
);
}
return [
// This setting is left for back compat.
...state.settings.__experimentalBlockPatterns ?? [],
...state.settings[selectBlockPatternsKey]?.(select) ?? []
].find(({ name }) => name === patternName);
},
(state, patternName) => patternName?.startsWith("core/block/") ? [
unlock(select(STORE_NAME)).getReusableBlocks(),
state.settings.__experimentalReusableBlocks
] : [
state.settings.__experimentalBlockPatterns,
state.settings[selectBlockPatternsKey]?.(select)
]
)
);
const getAllPatterns = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (0,external_wp_data_namespaceObject.createSelector)((state) => {
return [
...unlock(select(STORE_NAME)).getReusableBlocks().map(
(userPattern) => mapUserPattern(
userPattern,
state.settings.__experimentalUserPatternCategories
)
),
// This setting is left for back compat.
...state.settings.__experimentalBlockPatterns ?? [],
...state.settings[selectBlockPatternsKey]?.(select) ?? []
].filter(
(x, index, arr) => index === arr.findIndex((y) => x.name === y.name)
);
}, getAllPatternsDependants(select))
);
const EMPTY_ARRAY = [];
const getReusableBlocks = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (state) => {
const reusableBlocksSelect = state.settings[reusableBlocksSelectKey];
return (reusableBlocksSelect ? reusableBlocksSelect(select) : state.settings.__experimentalReusableBlocks) ?? EMPTY_ARRAY;
}
);
function getLastFocus(state) {
return state.lastFocus;
}
function private_selectors_isDragging(state) {
return state.isDragging;
}
function getExpandedBlock(state) {
return state.expandedBlock;
}
const getContentLockingParent = (state, clientId) => {
let current = clientId;
let result;
while (!result && (current = state.blocks.parents.get(current))) {
if (getTemplateLock(state, current) === "contentOnly") {
result = current;
}
}
return result;
};
const getParentSectionBlock = (state, clientId) => {
let current = clientId;
let result;
while (!result && (current = state.blocks.parents.get(current))) {
if (isSectionBlock(state, current)) {
result = current;
}
}
return result;
};
function isSectionBlock(state, clientId) {
const blockName = getBlockName(state, clientId);
if (blockName === "core/block" || getTemplateLock(state, clientId) === "contentOnly") {
return true;
}
const attributes = getBlockAttributes(state, clientId);
const isTemplatePart = blockName === "core/template-part";
if ((attributes?.metadata?.patternName || isTemplatePart) && !!window?.__experimentalContentOnlyPatternInsertion) {
return true;
}
return false;
}
function getTemporarilyEditingAsBlocks(state) {
return state.temporarilyEditingAsBlocks;
}
function getTemporarilyEditingFocusModeToRevert(state) {
return state.temporarilyEditingFocusModeRevert;
}
const getBlockStyles = (0,external_wp_data_namespaceObject.createSelector)(
(state, clientIds) => clientIds.reduce((styles, clientId) => {
styles[clientId] = state.blocks.attributes.get(clientId)?.style;
return styles;
}, {}),
(state, clientIds) => [
...clientIds.map(
(clientId) => state.blocks.attributes.get(clientId)?.style
)
]
);
function getSectionRootClientId(state) {
return state.settings?.[sectionRootClientIdKey];
}
function isZoomOut(state) {
return state.zoomLevel === "auto-scaled" || state.zoomLevel < 100;
}
function getZoomLevel(state) {
return state.zoomLevel;
}
function getClosestAllowedInsertionPoint(state, name, clientId = "") {
const blockNames = Array.isArray(name) ? name : [name];
const areBlockNamesAllowedInClientId = (id) => blockNames.every(
(currentName) => canInsertBlockType(state, currentName, id)
);
if (!clientId) {
if (areBlockNamesAllowedInClientId(clientId)) {
return clientId;
}
const sectionRootClientId = getSectionRootClientId(state);
if (sectionRootClientId && areBlockNamesAllowedInClientId(sectionRootClientId)) {
return sectionRootClientId;
}
return null;
}
let current = clientId;
while (current !== null && !areBlockNamesAllowedInClientId(current)) {
const parentClientId = getBlockRootClientId(state, current);
current = parentClientId;
}
return current;
}
function getClosestAllowedInsertionPointForPattern(state, pattern, clientId) {
const { allowedBlockTypes } = getSettings(state);
const isAllowed = checkAllowListRecursive(
getGrammar(pattern),
allowedBlockTypes
);
if (!isAllowed) {
return null;
}
const names = getGrammar(pattern).map(({ blockName: name }) => name);
return getClosestAllowedInsertionPoint(state, names, clientId);
}
function getInsertionPoint(state) {
return state.insertionPoint;
}
const isBlockHidden = (state, clientId) => {
const blockName = getBlockName(state, clientId);
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(state, blockName, "visibility", true)) {
return false;
}
const attributes = state.blocks.attributes.get(clientId);
return attributes?.metadata?.blockVisibility === false;
};
function private_selectors_hasBlockSpotlight(state) {
return !!state.hasBlockSpotlight;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-tab/utils.js
const INSERTER_PATTERN_TYPES = {
user: "user",
theme: "theme",
directory: "directory"
};
const INSERTER_SYNC_TYPES = {
full: "fully",
unsynced: "unsynced"
};
const allPatternsCategory = {
name: "allPatterns",
label: (0,external_wp_i18n_namespaceObject._x)("All", "patterns")
};
const myPatternsCategory = {
name: "myPatterns",
label: (0,external_wp_i18n_namespaceObject.__)("My patterns")
};
const starterPatternsCategory = {
name: "core/starter-content",
label: (0,external_wp_i18n_namespaceObject.__)("Starter content")
};
function isPatternFiltered(pattern, sourceFilter, syncFilter) {
const isUserPattern = pattern.name.startsWith("core/block");
const isDirectoryPattern = pattern.source === "core" || pattern.source?.startsWith("pattern-directory");
if (sourceFilter === INSERTER_PATTERN_TYPES.theme && (isUserPattern || isDirectoryPattern)) {
return true;
}
if (sourceFilter === INSERTER_PATTERN_TYPES.directory && (isUserPattern || !isDirectoryPattern)) {
return true;
}
if (sourceFilter === INSERTER_PATTERN_TYPES.user && pattern.type !== INSERTER_PATTERN_TYPES.user) {
return true;
}
if (syncFilter === INSERTER_SYNC_TYPES.full && pattern.syncStatus !== "") {
return true;
}
if (syncFilter === INSERTER_SYNC_TYPES.unsynced && pattern.syncStatus !== "unsynced" && isUserPattern) {
return true;
}
return false;
}
;// ./node_modules/@wordpress/block-editor/build-module/store/utils.js
const isFiltered = Symbol("isFiltered");
const parsedPatternCache = /* @__PURE__ */ new WeakMap();
const grammarMapCache = /* @__PURE__ */ new WeakMap();
function mapUserPattern(userPattern, __experimentalUserPatternCategories = []) {
return {
name: `core/block/${userPattern.id}`,
id: userPattern.id,
type: INSERTER_PATTERN_TYPES.user,
title: userPattern.title?.raw,
categories: userPattern.wp_pattern_category?.map((catId) => {
const category = __experimentalUserPatternCategories.find(
({ id }) => id === catId
);
return category ? category.slug : catId;
}),
content: userPattern.content?.raw,
syncStatus: userPattern.wp_pattern_sync_status
};
}
function parsePattern(pattern) {
const blocks = (0,external_wp_blocks_namespaceObject.parse)(pattern.content, {
__unstableSkipMigrationLogs: true
});
if (blocks.length === 1) {
blocks[0].attributes = {
...blocks[0].attributes,
metadata: {
...blocks[0].attributes.metadata || {},
categories: pattern.categories,
patternName: pattern.name,
name: blocks[0].attributes.metadata?.name || pattern.title
}
};
}
return {
...pattern,
blocks
};
}
function getParsedPattern(pattern) {
let parsedPattern = parsedPatternCache.get(pattern);
if (!parsedPattern) {
parsedPattern = parsePattern(pattern);
parsedPatternCache.set(pattern, parsedPattern);
}
return parsedPattern;
}
function getGrammar(pattern) {
let grammarMap = grammarMapCache.get(pattern);
if (!grammarMap) {
grammarMap = (0,external_wp_blockSerializationDefaultParser_namespaceObject.parse)(pattern.content);
grammarMap = grammarMap.filter((block) => block.blockName !== null);
grammarMapCache.set(pattern, grammarMap);
}
return grammarMap;
}
const checkAllowList = (list, item, defaultResult = null) => {
if (typeof list === "boolean") {
return list;
}
if (Array.isArray(list)) {
if (list.includes("core/post-content") && item === null) {
return true;
}
return list.includes(item);
}
return defaultResult;
};
const checkAllowListRecursive = (blocks, allowedBlockTypes) => {
if (typeof allowedBlockTypes === "boolean") {
return allowedBlockTypes;
}
const blocksQueue = [...blocks];
while (blocksQueue.length > 0) {
const block = blocksQueue.shift();
const isAllowed = checkAllowList(
allowedBlockTypes,
block.name || block.blockName,
true
);
if (!isAllowed) {
return false;
}
block.innerBlocks?.forEach((innerBlock) => {
blocksQueue.push(innerBlock);
});
}
return true;
};
const getAllPatternsDependants = (select) => (state) => {
return [
state.settings.__experimentalBlockPatterns,
state.settings.__experimentalUserPatternCategories,
state.settings.__experimentalReusableBlocks,
state.settings[selectBlockPatternsKey]?.(select),
state.blockPatterns,
unlock(select(STORE_NAME)).getReusableBlocks()
];
};
const getInsertBlockTypeDependants = () => (state, rootClientId) => {
return [
state.blockListSettings[rootClientId],
state.blocks.byClientId.get(rootClientId),
state.settings.allowedBlockTypes,
state.settings.templateLock,
getBlockEditingMode(state, rootClientId),
getSectionRootClientId(state),
isSectionBlock(state, rootClientId)
];
};
;// ./node_modules/@wordpress/block-editor/build-module/utils/sorting.js
const comparator = (field, items, order) => {
return (a, b) => {
let cmpA, cmpB;
if (typeof field === "function") {
cmpA = field(a);
cmpB = field(b);
} else {
cmpA = a[field];
cmpB = b[field];
}
if (cmpA > cmpB) {
return order === "asc" ? 1 : -1;
} else if (cmpB > cmpA) {
return order === "asc" ? -1 : 1;
}
const orderA = items.findIndex((item) => item === a);
const orderB = items.findIndex((item) => item === b);
if (orderA > orderB) {
return 1;
} else if (orderB > orderA) {
return -1;
}
return 0;
};
};
function orderBy(items, field, order = "asc") {
return items.concat().sort(comparator(field, items, order));
}
;// ./node_modules/@wordpress/block-editor/build-module/store/selectors.js
const { isContentBlock: selectors_isContentBlock } = unlock(external_wp_blocks_namespaceObject.privateApis);
const MILLISECONDS_PER_HOUR = 3600 * 1e3;
const MILLISECONDS_PER_DAY = 24 * 3600 * 1e3;
const MILLISECONDS_PER_WEEK = 7 * 24 * 3600 * 1e3;
const selectors_EMPTY_ARRAY = [];
const EMPTY_SET = /* @__PURE__ */ new Set();
const DEFAULT_INSERTER_OPTIONS = {
[isFiltered]: true
};
function getBlockName(state, clientId) {
const block = state.blocks.byClientId.get(clientId);
const socialLinkName = "core/social-link";
if (external_wp_element_namespaceObject.Platform.OS !== "web" && block?.name === socialLinkName) {
const attributes = state.blocks.attributes.get(clientId);
const { service } = attributes ?? {};
return service ? `${socialLinkName}-${service}` : socialLinkName;
}
return block ? block.name : null;
}
function isBlockValid(state, clientId) {
const block = state.blocks.byClientId.get(clientId);
return !!block && block.isValid;
}
function getBlockAttributes(state, clientId) {
const block = state.blocks.byClientId.get(clientId);
if (!block) {
return null;
}
return state.blocks.attributes.get(clientId);
}
function getBlock(state, clientId) {
if (!state.blocks.byClientId.has(clientId)) {
return null;
}
return state.blocks.tree.get(clientId);
}
const __unstableGetBlockWithoutInnerBlocks = (0,external_wp_data_namespaceObject.createSelector)(
(state, clientId) => {
const block = state.blocks.byClientId.get(clientId);
if (!block) {
return null;
}
return {
...block,
attributes: getBlockAttributes(state, clientId)
};
},
(state, clientId) => [
state.blocks.byClientId.get(clientId),
state.blocks.attributes.get(clientId)
]
);
function getBlocks(state, rootClientId) {
const treeKey = !rootClientId || !areInnerBlocksControlled(state, rootClientId) ? rootClientId || "" : "controlled||" + rootClientId;
return state.blocks.tree.get(treeKey)?.innerBlocks || selectors_EMPTY_ARRAY;
}
const __unstableGetClientIdWithClientIdsTree = (0,external_wp_data_namespaceObject.createSelector)(
(state, clientId) => {
external_wp_deprecated_default()(
"wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",
{
since: "6.3",
version: "6.5"
}
);
return {
clientId,
innerBlocks: __unstableGetClientIdsTree(state, clientId)
};
},
(state) => [state.blocks.order]
);
const __unstableGetClientIdsTree = (0,external_wp_data_namespaceObject.createSelector)(
(state, rootClientId = "") => {
external_wp_deprecated_default()(
"wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",
{
since: "6.3",
version: "6.5"
}
);
return getBlockOrder(state, rootClientId).map(
(clientId) => __unstableGetClientIdWithClientIdsTree(state, clientId)
);
},
(state) => [state.blocks.order]
);
const getClientIdsOfDescendants = (0,external_wp_data_namespaceObject.createSelector)(
(state, rootIds) => {
rootIds = Array.isArray(rootIds) ? [...rootIds] : [rootIds];
const ids = [];
for (const rootId of rootIds) {
const order = state.blocks.order.get(rootId);
if (order) {
ids.push(...order);
}
}
let index = 0;
while (index < ids.length) {
const id = ids[index];
const order = state.blocks.order.get(id);
if (order) {
ids.splice(index + 1, 0, ...order);
}
index++;
}
return ids;
},
(state) => [state.blocks.order]
);
const getClientIdsWithDescendants = (state) => getClientIdsOfDescendants(state, "");
const getGlobalBlockCount = (0,external_wp_data_namespaceObject.createSelector)(
(state, blockName) => {
const clientIds = getClientIdsWithDescendants(state);
if (!blockName) {
return clientIds.length;
}
let count = 0;
for (const clientId of clientIds) {
const block = state.blocks.byClientId.get(clientId);
if (block.name === blockName) {
count++;
}
}
return count;
},
(state) => [state.blocks.order, state.blocks.byClientId]
);
const getBlocksByName = (0,external_wp_data_namespaceObject.createSelector)(
(state, blockName) => {
if (!blockName) {
return selectors_EMPTY_ARRAY;
}
const blockNames = Array.isArray(blockName) ? blockName : [blockName];
const clientIds = getClientIdsWithDescendants(state);
const foundBlocks = clientIds.filter((clientId) => {
const block = state.blocks.byClientId.get(clientId);
return blockNames.includes(block.name);
});
return foundBlocks.length > 0 ? foundBlocks : selectors_EMPTY_ARRAY;
},
(state) => [state.blocks.order, state.blocks.byClientId]
);
function __experimentalGetGlobalBlocksByName(state, blockName) {
external_wp_deprecated_default()(
"wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName",
{
since: "6.5",
alternative: `wp.data.select( 'core/block-editor' ).getBlocksByName`
}
);
return getBlocksByName(state, blockName);
}
const getBlocksByClientId = (0,external_wp_data_namespaceObject.createSelector)(
(state, clientIds) => (Array.isArray(clientIds) ? clientIds : [clientIds]).map(
(clientId) => getBlock(state, clientId)
),
(state, clientIds) => (Array.isArray(clientIds) ? clientIds : [clientIds]).map(
(clientId) => state.blocks.tree.get(clientId)
)
);
const getBlockNamesByClientId = (0,external_wp_data_namespaceObject.createSelector)(
(state, clientIds) => getBlocksByClientId(state, clientIds).filter(Boolean).map((block) => block.name),
(state, clientIds) => getBlocksByClientId(state, clientIds)
);
function getBlockCount(state, rootClientId) {
return getBlockOrder(state, rootClientId).length;
}
function getSelectionStart(state) {
return state.selection.selectionStart;
}
function getSelectionEnd(state) {
return state.selection.selectionEnd;
}
function getBlockSelectionStart(state) {
return state.selection.selectionStart.clientId;
}
function getBlockSelectionEnd(state) {
return state.selection.selectionEnd.clientId;
}
function getSelectedBlockCount(state) {
const multiSelectedBlockCount = getMultiSelectedBlockClientIds(state).length;
if (multiSelectedBlockCount) {
return multiSelectedBlockCount;
}
return state.selection.selectionStart.clientId ? 1 : 0;
}
function hasSelectedBlock(state) {
const { selectionStart, selectionEnd } = state.selection;
return !!selectionStart.clientId && selectionStart.clientId === selectionEnd.clientId;
}
function getSelectedBlockClientId(state) {
const { selectionStart, selectionEnd } = state.selection;
const { clientId } = selectionStart;
if (!clientId || clientId !== selectionEnd.clientId) {
return null;
}
return clientId;
}
function getSelectedBlock(state) {
const clientId = getSelectedBlockClientId(state);
return clientId ? getBlock(state, clientId) : null;
}
function getBlockRootClientId(state, clientId) {
return state.blocks.parents.get(clientId) ?? null;
}
const getBlockParents = (0,external_wp_data_namespaceObject.createSelector)(
(state, clientId, ascending = false) => {
const parents = [];
let current = clientId;
while (current = state.blocks.parents.get(current)) {
parents.push(current);
}
if (!parents.length) {
return selectors_EMPTY_ARRAY;
}
return ascending ? parents : parents.reverse();
},
(state) => [state.blocks.parents]
);
const getBlockParentsByBlockName = (0,external_wp_data_namespaceObject.createSelector)(
(state, clientId, blockName, ascending = false) => {
const parents = getBlockParents(state, clientId, ascending);
const hasName = Array.isArray(blockName) ? (name) => blockName.includes(name) : (name) => blockName === name;
return parents.filter((id) => hasName(getBlockName(state, id)));
},
(state) => [state.blocks.parents]
);
function getBlockHierarchyRootClientId(state, clientId) {
let current = clientId;
let parent;
do {
parent = current;
current = state.blocks.parents.get(current);
} while (current);
return parent;
}
function getLowestCommonAncestorWithSelectedBlock(state, clientId) {
const selectedId = getSelectedBlockClientId(state);
const clientParents = [...getBlockParents(state, clientId), clientId];
const selectedParents = [
...getBlockParents(state, selectedId),
selectedId
];
let lowestCommonAncestor;
const maxDepth = Math.min(clientParents.length, selectedParents.length);
for (let index = 0; index < maxDepth; index++) {
if (clientParents[index] === selectedParents[index]) {
lowestCommonAncestor = clientParents[index];
} else {
break;
}
}
return lowestCommonAncestor;
}
function getAdjacentBlockClientId(state, startClientId, modifier = 1) {
if (startClientId === void 0) {
startClientId = getSelectedBlockClientId(state);
}
if (startClientId === void 0) {
if (modifier < 0) {
startClientId = getFirstMultiSelectedBlockClientId(state);
} else {
startClientId = getLastMultiSelectedBlockClientId(state);
}
}
if (!startClientId) {
return null;
}
const rootClientId = getBlockRootClientId(state, startClientId);
if (rootClientId === null) {
return null;
}
const { order } = state.blocks;
const orderSet = order.get(rootClientId);
const index = orderSet.indexOf(startClientId);
const nextIndex = index + 1 * modifier;
if (nextIndex < 0) {
return null;
}
if (nextIndex === orderSet.length) {
return null;
}
return orderSet[nextIndex];
}
function getPreviousBlockClientId(state, startClientId) {
return getAdjacentBlockClientId(state, startClientId, -1);
}
function getNextBlockClientId(state, startClientId) {
return getAdjacentBlockClientId(state, startClientId, 1);
}
function getSelectedBlocksInitialCaretPosition(state) {
return state.initialPosition;
}
const getSelectedBlockClientIds = (0,external_wp_data_namespaceObject.createSelector)(
(state) => {
const { selectionStart, selectionEnd } = state.selection;
if (!selectionStart.clientId || !selectionEnd.clientId) {
return selectors_EMPTY_ARRAY;
}
if (selectionStart.clientId === selectionEnd.clientId) {
return [selectionStart.clientId];
}
const rootClientId = getBlockRootClientId(
state,
selectionStart.clientId
);
if (rootClientId === null) {
return selectors_EMPTY_ARRAY;
}
const blockOrder = getBlockOrder(state, rootClientId);
const startIndex = blockOrder.indexOf(selectionStart.clientId);
const endIndex = blockOrder.indexOf(selectionEnd.clientId);
if (startIndex > endIndex) {
return blockOrder.slice(endIndex, startIndex + 1);
}
return blockOrder.slice(startIndex, endIndex + 1);
},
(state) => [
state.blocks.order,
state.selection.selectionStart.clientId,
state.selection.selectionEnd.clientId
]
);
function getMultiSelectedBlockClientIds(state) {
const { selectionStart, selectionEnd } = state.selection;
if (selectionStart.clientId === selectionEnd.clientId) {
return selectors_EMPTY_ARRAY;
}
return getSelectedBlockClientIds(state);
}
const getMultiSelectedBlocks = (0,external_wp_data_namespaceObject.createSelector)(
(state) => {
const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state);
if (!multiSelectedBlockClientIds.length) {
return selectors_EMPTY_ARRAY;
}
return multiSelectedBlockClientIds.map(
(clientId) => getBlock(state, clientId)
);
},
(state) => [
...getSelectedBlockClientIds.getDependants(state),
state.blocks.byClientId,
state.blocks.order,
state.blocks.attributes
]
);
function getFirstMultiSelectedBlockClientId(state) {
return getMultiSelectedBlockClientIds(state)[0] || null;
}
function getLastMultiSelectedBlockClientId(state) {
const selectedClientIds = getMultiSelectedBlockClientIds(state);
return selectedClientIds[selectedClientIds.length - 1] || null;
}
function isFirstMultiSelectedBlock(state, clientId) {
return getFirstMultiSelectedBlockClientId(state) === clientId;
}
function isBlockMultiSelected(state, clientId) {
return getMultiSelectedBlockClientIds(state).indexOf(clientId) !== -1;
}
const isAncestorMultiSelected = (0,external_wp_data_namespaceObject.createSelector)(
(state, clientId) => {
let ancestorClientId = clientId;
let isMultiSelected = false;
while (ancestorClientId && !isMultiSelected) {
ancestorClientId = getBlockRootClientId(state, ancestorClientId);
isMultiSelected = isBlockMultiSelected(state, ancestorClientId);
}
return isMultiSelected;
},
(state) => [
state.blocks.order,
state.selection.selectionStart.clientId,
state.selection.selectionEnd.clientId
]
);
function getMultiSelectedBlocksStartClientId(state) {
const { selectionStart, selectionEnd } = state.selection;
if (selectionStart.clientId === selectionEnd.clientId) {
return null;
}
return selectionStart.clientId || null;
}
function getMultiSelectedBlocksEndClientId(state) {
const { selectionStart, selectionEnd } = state.selection;
if (selectionStart.clientId === selectionEnd.clientId) {
return null;
}
return selectionEnd.clientId || null;
}
function __unstableIsFullySelected(state) {
const selectionAnchor = getSelectionStart(state);
const selectionFocus = getSelectionEnd(state);
return !selectionAnchor.attributeKey && !selectionFocus.attributeKey && typeof selectionAnchor.offset === "undefined" && typeof selectionFocus.offset === "undefined";
}
function __unstableIsSelectionCollapsed(state) {
const selectionAnchor = getSelectionStart(state);
const selectionFocus = getSelectionEnd(state);
return !!selectionAnchor && !!selectionFocus && selectionAnchor.clientId === selectionFocus.clientId && selectionAnchor.attributeKey === selectionFocus.attributeKey && selectionAnchor.offset === selectionFocus.offset;
}
function __unstableSelectionHasUnmergeableBlock(state) {
return getSelectedBlockClientIds(state).some((clientId) => {
const blockName = getBlockName(state, clientId);
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName);
return !blockType.merge;
});
}
function __unstableIsSelectionMergeable(state, isForward) {
const selectionAnchor = getSelectionStart(state);
const selectionFocus = getSelectionEnd(state);
if (selectionAnchor.clientId === selectionFocus.clientId) {
return false;
}
if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === "undefined" || typeof selectionFocus.offset === "undefined") {
return false;
}
const anchorRootClientId = getBlockRootClientId(
state,
selectionAnchor.clientId
);
const focusRootClientId = getBlockRootClientId(
state,
selectionFocus.clientId
);
if (anchorRootClientId !== focusRootClientId) {
return false;
}
const blockOrder = getBlockOrder(state, anchorRootClientId);
const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId);
const focusIndex = blockOrder.indexOf(selectionFocus.clientId);
let selectionStart, selectionEnd;
if (anchorIndex > focusIndex) {
selectionStart = selectionFocus;
selectionEnd = selectionAnchor;
} else {
selectionStart = selectionAnchor;
selectionEnd = selectionFocus;
}
const targetBlockClientId = isForward ? selectionEnd.clientId : selectionStart.clientId;
const blockToMergeClientId = isForward ? selectionStart.clientId : selectionEnd.clientId;
const targetBlockName = getBlockName(state, targetBlockClientId);
const targetBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(targetBlockName);
if (!targetBlockType.merge) {
return false;
}
const blockToMerge = getBlock(state, blockToMergeClientId);
if (blockToMerge.name === targetBlockName) {
return true;
}
const blocksToMerge = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blockToMerge, targetBlockName);
return blocksToMerge && blocksToMerge.length;
}
const __unstableGetSelectedBlocksWithPartialSelection = (state) => {
const selectionAnchor = getSelectionStart(state);
const selectionFocus = getSelectionEnd(state);
if (selectionAnchor.clientId === selectionFocus.clientId) {
return selectors_EMPTY_ARRAY;
}
if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === "undefined" || typeof selectionFocus.offset === "undefined") {
return selectors_EMPTY_ARRAY;
}
const anchorRootClientId = getBlockRootClientId(
state,
selectionAnchor.clientId
);
const focusRootClientId = getBlockRootClientId(
state,
selectionFocus.clientId
);
if (anchorRootClientId !== focusRootClientId) {
return selectors_EMPTY_ARRAY;
}
const blockOrder = getBlockOrder(state, anchorRootClientId);
const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId);
const focusIndex = blockOrder.indexOf(selectionFocus.clientId);
const [selectionStart, selectionEnd] = anchorIndex > focusIndex ? [selectionFocus, selectionAnchor] : [selectionAnchor, selectionFocus];
const blockA = getBlock(state, selectionStart.clientId);
const blockB = getBlock(state, selectionEnd.clientId);
const htmlA = blockA.attributes[selectionStart.attributeKey];
const htmlB = blockB.attributes[selectionEnd.attributeKey];
let valueA = (0,external_wp_richText_namespaceObject.create)({ html: htmlA });
let valueB = (0,external_wp_richText_namespaceObject.create)({ html: htmlB });
valueA = (0,external_wp_richText_namespaceObject.remove)(valueA, 0, selectionStart.offset);
valueB = (0,external_wp_richText_namespaceObject.remove)(valueB, selectionEnd.offset, valueB.text.length);
return [
{
...blockA,
attributes: {
...blockA.attributes,
[selectionStart.attributeKey]: (0,external_wp_richText_namespaceObject.toHTMLString)({
value: valueA
})
}
},
{
...blockB,
attributes: {
...blockB.attributes,
[selectionEnd.attributeKey]: (0,external_wp_richText_namespaceObject.toHTMLString)({
value: valueB
})
}
}
];
};
function getBlockOrder(state, rootClientId) {
return state.blocks.order.get(rootClientId || "") || selectors_EMPTY_ARRAY;
}
function getBlockIndex(state, clientId) {
const rootClientId = getBlockRootClientId(state, clientId);
return getBlockOrder(state, rootClientId).indexOf(clientId);
}
function isBlockSelected(state, clientId) {
const { selectionStart, selectionEnd } = state.selection;
if (selectionStart.clientId !== selectionEnd.clientId) {
return false;
}
return selectionStart.clientId === clientId;
}
function hasSelectedInnerBlock(state, clientId, deep = false) {
const selectedBlockClientIds = getSelectedBlockClientIds(state);
if (!selectedBlockClientIds.length) {
return false;
}
if (deep) {
return selectedBlockClientIds.some(
(id) => (
// Pass true because we don't care about order and it's more
// performant.
getBlockParents(state, id, true).includes(clientId)
)
);
}
return selectedBlockClientIds.some(
(id) => getBlockRootClientId(state, id) === clientId
);
}
function hasDraggedInnerBlock(state, clientId, deep = false) {
return getBlockOrder(state, clientId).some(
(innerClientId) => isBlockBeingDragged(state, innerClientId) || deep && hasDraggedInnerBlock(state, innerClientId, deep)
);
}
function isBlockWithinSelection(state, clientId) {
if (!clientId) {
return false;
}
const clientIds = getMultiSelectedBlockClientIds(state);
const index = clientIds.indexOf(clientId);
return index > -1 && index < clientIds.length - 1;
}
function hasMultiSelection(state) {
const { selectionStart, selectionEnd } = state.selection;
return selectionStart.clientId !== selectionEnd.clientId;
}
function selectors_isMultiSelecting(state) {
return state.isMultiSelecting;
}
function selectors_isSelectionEnabled(state) {
return state.isSelectionEnabled;
}
function getBlockMode(state, clientId) {
return state.blocksMode[clientId] || "visual";
}
function selectors_isTyping(state) {
return state.isTyping;
}
function isDraggingBlocks(state) {
return !!state.draggedBlocks.length;
}
function getDraggedBlockClientIds(state) {
return state.draggedBlocks;
}
function isBlockBeingDragged(state, clientId) {
return state.draggedBlocks.includes(clientId);
}
function isAncestorBeingDragged(state, clientId) {
if (!isDraggingBlocks(state)) {
return false;
}
const parents = getBlockParents(state, clientId);
return parents.some(
(parentClientId) => isBlockBeingDragged(state, parentClientId)
);
}
function isCaretWithinFormattedText() {
external_wp_deprecated_default()(
'wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',
{
since: "6.1",
version: "6.3"
}
);
return false;
}
const getBlockInsertionPoint = (0,external_wp_data_namespaceObject.createSelector)(
(state) => {
let rootClientId, index;
const {
insertionCue,
selection: { selectionEnd }
} = state;
if (insertionCue !== null) {
return insertionCue;
}
const { clientId } = selectionEnd;
if (clientId) {
rootClientId = getBlockRootClientId(state, clientId) || void 0;
index = getBlockIndex(state, selectionEnd.clientId) + 1;
} else {
index = getBlockOrder(state).length;
}
return { rootClientId, index };
},
(state) => [
state.insertionCue,
state.selection.selectionEnd.clientId,
state.blocks.parents,
state.blocks.order
]
);
function isBlockInsertionPointVisible(state) {
return state.insertionCue !== null;
}
function isValidTemplate(state) {
return state.template.isValid;
}
function getTemplate(state) {
return state.settings.template;
}
function getTemplateLock(state, rootClientId) {
if (!rootClientId) {
return state.settings.templateLock ?? false;
}
return getBlockListSettings(state, rootClientId)?.templateLock ?? false;
}
const isBlockVisibleInTheInserter = (state, blockNameOrType, rootClientId = null) => {
let blockType;
let blockName;
if (blockNameOrType && "object" === typeof blockNameOrType) {
blockType = blockNameOrType;
blockName = blockNameOrType.name;
} else {
blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockNameOrType);
blockName = blockNameOrType;
}
if (!blockType) {
return false;
}
const { allowedBlockTypes } = getSettings(state);
const isBlockAllowedInEditor = checkAllowList(
allowedBlockTypes,
blockName,
true
);
if (!isBlockAllowedInEditor) {
return false;
}
const parents = (Array.isArray(blockType.parent) ? blockType.parent : []).concat(Array.isArray(blockType.ancestor) ? blockType.ancestor : []);
if (parents.length > 0) {
if (parents.includes("core/post-content")) {
return true;
}
let current = rootClientId;
let hasParent = false;
do {
if (parents.includes(getBlockName(state, current))) {
hasParent = true;
break;
}
current = state.blocks.parents.get(current);
} while (current);
return hasParent;
}
return true;
};
const canInsertBlockTypeUnmemoized = (state, blockName, rootClientId = null) => {
if (!isBlockVisibleInTheInserter(state, blockName, rootClientId)) {
return false;
}
let blockType;
if (blockName && "object" === typeof blockName) {
blockType = blockName;
blockName = blockType.name;
} else {
blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName);
}
if (getTemplateLock(state, rootClientId)) {
return false;
}
const blockEditingMode = getBlockEditingMode(state, rootClientId ?? "");
if (blockEditingMode === "disabled") {
return false;
}
const parentBlockListSettings = getBlockListSettings(state, rootClientId);
if (rootClientId && parentBlockListSettings === void 0) {
return false;
}
const isContentRoleBlock = selectors_isContentBlock(blockName);
const isParentSectionBlock = !!isSectionBlock(state, rootClientId);
const isBlockWithinSection = !!getParentSectionBlock(
state,
rootClientId
);
if ((isParentSectionBlock || isBlockWithinSection) && !isContentRoleBlock) {
return false;
}
if ((isParentSectionBlock || blockEditingMode === "contentOnly") && !isContainerInsertableToInContentOnlyMode(
state,
blockName,
rootClientId
)) {
return false;
}
const parentName = getBlockName(state, rootClientId);
const parentBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(parentName);
const parentAllowedChildBlocks = parentBlockType?.allowedBlocks;
let hasParentAllowedBlock = checkAllowList(
parentAllowedChildBlocks,
blockName
);
if (hasParentAllowedBlock !== false) {
const parentAllowedBlocks = parentBlockListSettings?.allowedBlocks;
const hasParentListAllowedBlock = checkAllowList(
parentAllowedBlocks,
blockName
);
if (hasParentListAllowedBlock !== null) {
hasParentAllowedBlock = hasParentListAllowedBlock;
}
}
const blockAllowedParentBlocks = blockType.parent;
const hasBlockAllowedParent = checkAllowList(
blockAllowedParentBlocks,
parentName
);
let hasBlockAllowedAncestor = true;
const blockAllowedAncestorBlocks = blockType.ancestor;
if (blockAllowedAncestorBlocks) {
const ancestors = [
rootClientId,
...getBlockParents(state, rootClientId)
];
hasBlockAllowedAncestor = ancestors.some(
(ancestorClientId) => checkAllowList(
blockAllowedAncestorBlocks,
getBlockName(state, ancestorClientId)
)
);
}
const canInsert = hasBlockAllowedAncestor && (hasParentAllowedBlock === null && hasBlockAllowedParent === null || hasParentAllowedBlock === true || hasBlockAllowedParent === true);
if (!canInsert) {
return canInsert;
}
return (0,external_wp_hooks_namespaceObject.applyFilters)(
"blockEditor.__unstableCanInsertBlockType",
canInsert,
blockType,
rootClientId,
{
// Pass bound selectors of the current registry. If we're in a nested
// context, the data will differ from the one selected from the root
// registry.
getBlock: getBlock.bind(null, state),
getBlockParentsByBlockName: getBlockParentsByBlockName.bind(
null,
state
)
}
);
};
const canInsertBlockType = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (0,external_wp_data_namespaceObject.createSelector)(
canInsertBlockTypeUnmemoized,
(state, blockName, rootClientId) => getInsertBlockTypeDependants(select)(state, rootClientId)
)
);
function canInsertBlocks(state, clientIds, rootClientId = null) {
return clientIds.every(
(id) => canInsertBlockType(state, getBlockName(state, id), rootClientId)
);
}
function canRemoveBlock(state, clientId) {
const attributes = getBlockAttributes(state, clientId);
if (attributes === null) {
return true;
}
if (attributes.lock?.remove !== void 0) {
return !attributes.lock.remove;
}
const rootClientId = getBlockRootClientId(state, clientId);
if (getTemplateLock(state, rootClientId)) {
return false;
}
const isBlockWithinSection = !!getParentSectionBlock(state, clientId);
const isContentRoleBlock = selectors_isContentBlock(
getBlockName(state, clientId)
);
if (isBlockWithinSection && !isContentRoleBlock) {
return false;
}
const isParentSectionBlock = !!isSectionBlock(state, rootClientId);
const rootBlockEditingMode = getBlockEditingMode(state, rootClientId);
if ((isParentSectionBlock || rootBlockEditingMode === "contentOnly") && !isContainerInsertableToInContentOnlyMode(
state,
getBlockName(state, clientId),
rootClientId
)) {
return false;
}
return rootBlockEditingMode !== "disabled";
}
function canRemoveBlocks(state, clientIds) {
return clientIds.every((clientId) => canRemoveBlock(state, clientId));
}
function canMoveBlock(state, clientId) {
const attributes = getBlockAttributes(state, clientId);
if (attributes === null) {
return true;
}
if (attributes.lock?.move !== void 0) {
return !attributes.lock.move;
}
const rootClientId = getBlockRootClientId(state, clientId);
const templateLock = getTemplateLock(state, rootClientId);
if (templateLock === "all" || templateLock === "contentOnly") {
return false;
}
const isBlockWithinSection = !!getParentSectionBlock(state, clientId);
const isContentRoleBlock = selectors_isContentBlock(
getBlockName(state, clientId)
);
if (isBlockWithinSection && !isContentRoleBlock) {
return false;
}
const isParentSectionBlock = !!isSectionBlock(state, rootClientId);
const rootBlockEditingMode = getBlockEditingMode(state, rootClientId);
if ((isParentSectionBlock || rootBlockEditingMode === "contentOnly") && !isContainerInsertableToInContentOnlyMode(
state,
getBlockName(state, clientId),
rootClientId
)) {
return false;
}
return getBlockEditingMode(state, rootClientId) !== "disabled";
}
function canMoveBlocks(state, clientIds) {
return clientIds.every((clientId) => canMoveBlock(state, clientId));
}
function canEditBlock(state, clientId) {
const attributes = getBlockAttributes(state, clientId);
if (attributes === null) {
return true;
}
const { lock } = attributes;
return !lock?.edit;
}
function canLockBlockType(state, nameOrType) {
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, "lock", true)) {
return false;
}
return !!state.settings?.canLockBlocks;
}
function getInsertUsage(state, id) {
return state.preferences.insertUsage?.[id] ?? null;
}
const canIncludeBlockTypeInInserter = (state, blockType, rootClientId) => {
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, "inserter", true)) {
return false;
}
return canInsertBlockTypeUnmemoized(state, blockType.name, rootClientId);
};
const getItemFromVariation = (state, item) => (variation) => {
const variationId = `${item.id}/${variation.name}`;
const { time, count = 0 } = getInsertUsage(state, variationId) || {};
return {
...item,
id: variationId,
icon: variation.icon || item.icon,
title: variation.title || item.title,
description: variation.description || item.description,
category: variation.category || item.category,
// If `example` is explicitly undefined for the variation, the preview will not be shown.
example: variation.hasOwnProperty("example") ? variation.example : item.example,
initialAttributes: {
...item.initialAttributes,
...variation.attributes
},
innerBlocks: variation.innerBlocks,
keywords: variation.keywords || item.keywords,
frecency: calculateFrecency(time, count)
};
};
const calculateFrecency = (time, count) => {
if (!time) {
return count;
}
const duration = Date.now() - time;
switch (true) {
case duration < MILLISECONDS_PER_HOUR:
return count * 4;
case duration < MILLISECONDS_PER_DAY:
return count * 2;
case duration < MILLISECONDS_PER_WEEK:
return count / 2;
default:
return count / 4;
}
};
const buildBlockTypeItem = (state, { buildScope = "inserter" }) => (blockType) => {
const id = blockType.name;
let isDisabled = false;
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType.name, "multiple", true)) {
isDisabled = getBlocksByClientId(
state,
getClientIdsWithDescendants(state)
).some(({ name }) => name === blockType.name);
}
const { time, count = 0 } = getInsertUsage(state, id) || {};
const blockItemBase = {
id,
name: blockType.name,
title: blockType.title,
icon: blockType.icon,
isDisabled,
frecency: calculateFrecency(time, count)
};
if (buildScope === "transform") {
return blockItemBase;
}
const inserterVariations = (0,external_wp_blocks_namespaceObject.getBlockVariations)(
blockType.name,
"inserter"
);
return {
...blockItemBase,
initialAttributes: {},
description: blockType.description,
category: blockType.category,
keywords: blockType.keywords,
parent: blockType.parent,
ancestor: blockType.ancestor,
variations: inserterVariations,
example: blockType.example,
utility: 1
// Deprecated.
};
};
const getInserterItems = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (0,external_wp_data_namespaceObject.createSelector)(
(state, rootClientId = null, options = DEFAULT_INSERTER_OPTIONS) => {
const buildReusableBlockInserterItem = (reusableBlock) => {
const icon = !reusableBlock.wp_pattern_sync_status ? {
src: symbol_default,
foreground: "var(--wp-block-synced-color)"
} : symbol_default;
const userPattern = mapUserPattern(reusableBlock);
const { time, count = 0 } = getInsertUsage(state, userPattern.name) || {};
const frecency = calculateFrecency(time, count);
return {
id: userPattern.name,
name: "core/block",
initialAttributes: { ref: reusableBlock.id },
title: userPattern.title,
icon,
category: "reusable",
keywords: ["reusable"],
isDisabled: false,
utility: 1,
// Deprecated.
frecency,
content: userPattern.content,
get blocks() {
return getParsedPattern(userPattern).blocks;
},
syncStatus: userPattern.syncStatus
};
};
const patternInserterItems = canInsertBlockTypeUnmemoized(
state,
"core/block",
rootClientId
) ? unlock(select(STORE_NAME)).getReusableBlocks().map(buildReusableBlockInserterItem) : [];
const buildBlockTypeInserterItem = buildBlockTypeItem(state, {
buildScope: "inserter"
});
let blockTypeInserterItems = (0,external_wp_blocks_namespaceObject.getBlockTypes)().filter(
(blockType) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, "inserter", true)
).map(buildBlockTypeInserterItem);
if (options[isFiltered] !== false) {
blockTypeInserterItems = blockTypeInserterItems.filter(
(blockType) => canIncludeBlockTypeInInserter(
state,
blockType,
rootClientId
)
);
} else {
blockTypeInserterItems = blockTypeInserterItems.filter(
(blockType) => isBlockVisibleInTheInserter(
state,
blockType,
rootClientId
)
).map((blockType) => ({
...blockType,
isAllowedInCurrentRoot: canIncludeBlockTypeInInserter(
state,
blockType,
rootClientId
)
}));
}
const stretchVariations = [];
const items = blockTypeInserterItems.reduce(
(accumulator, item) => {
const { variations = [] } = item;
if (!variations.some(({ isDefault }) => isDefault)) {
accumulator.push(item);
}
if (variations.length) {
const variationMapper = getItemFromVariation(
state,
item
);
variations.map(variationMapper).forEach((variation) => {
if (variation.id === "core/paragraph/stretchy-paragraph" || variation.id === "core/heading/stretchy-heading") {
stretchVariations.push(variation);
} else {
accumulator.push(variation);
}
});
}
return accumulator;
},
[]
);
items.push(...stretchVariations);
const groupByType = (blocks, block) => {
const { core, noncore } = blocks;
const type = block.name.startsWith("core/") ? core : noncore;
type.push(block);
return blocks;
};
const { core: coreItems, noncore: nonCoreItems } = items.reduce(
groupByType,
{ core: [], noncore: [] }
);
const sortedBlockTypes = [...coreItems, ...nonCoreItems];
return [...sortedBlockTypes, ...patternInserterItems];
},
(state, rootClientId) => [
(0,external_wp_blocks_namespaceObject.getBlockTypes)(),
unlock(select(STORE_NAME)).getReusableBlocks(),
state.blocks.order,
state.preferences.insertUsage,
...getInsertBlockTypeDependants(select)(state, rootClientId)
]
)
);
const getBlockTransformItems = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (0,external_wp_data_namespaceObject.createSelector)(
(state, blocks, rootClientId = null) => {
const normalizedBlocks = Array.isArray(blocks) ? blocks : [blocks];
const buildBlockTypeTransformItem = buildBlockTypeItem(state, {
buildScope: "transform"
});
const blockTypeTransformItems = (0,external_wp_blocks_namespaceObject.getBlockTypes)().filter(
(blockType) => canIncludeBlockTypeInInserter(
state,
blockType,
rootClientId
)
).map(buildBlockTypeTransformItem);
const itemsByName = Object.fromEntries(
Object.entries(blockTypeTransformItems).map(
([, value]) => [value.name, value]
)
);
const possibleTransforms = (0,external_wp_blocks_namespaceObject.getPossibleBlockTransformations)(
normalizedBlocks
).reduce((accumulator, block) => {
if (itemsByName[block?.name]) {
accumulator.push(itemsByName[block.name]);
}
return accumulator;
}, []);
return orderBy(
possibleTransforms,
(block) => itemsByName[block.name].frecency,
"desc"
);
},
(state, blocks, rootClientId) => [
(0,external_wp_blocks_namespaceObject.getBlockTypes)(),
state.preferences.insertUsage,
...getInsertBlockTypeDependants(select)(state, rootClientId)
]
)
);
const hasInserterItems = (state, rootClientId = null) => {
const hasBlockType = (0,external_wp_blocks_namespaceObject.getBlockTypes)().some(
(blockType) => canIncludeBlockTypeInInserter(state, blockType, rootClientId)
);
if (hasBlockType) {
return true;
}
const hasReusableBlock = canInsertBlockTypeUnmemoized(
state,
"core/block",
rootClientId
);
return hasReusableBlock;
};
const getAllowedBlocks = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (0,external_wp_data_namespaceObject.createSelector)(
(state, rootClientId = null) => {
if (!rootClientId) {
return;
}
const blockTypes = (0,external_wp_blocks_namespaceObject.getBlockTypes)().filter(
(blockType) => canIncludeBlockTypeInInserter(state, blockType, rootClientId)
);
const hasReusableBlock = canInsertBlockTypeUnmemoized(
state,
"core/block",
rootClientId
);
if (hasReusableBlock) {
blockTypes.push("core/block");
}
return blockTypes;
},
(state, rootClientId) => [
(0,external_wp_blocks_namespaceObject.getBlockTypes)(),
...getInsertBlockTypeDependants(select)(state, rootClientId)
]
)
);
const __experimentalGetAllowedBlocks = (0,external_wp_data_namespaceObject.createSelector)(
(state, rootClientId = null) => {
external_wp_deprecated_default()(
'wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',
{
alternative: 'wp.data.select( "core/block-editor" ).getAllowedBlocks',
since: "6.2",
version: "6.4"
}
);
return getAllowedBlocks(state, rootClientId);
},
(state, rootClientId) => getAllowedBlocks.getDependants(state, rootClientId)
);
function getDirectInsertBlock(state, rootClientId = null) {
if (!rootClientId) {
return;
}
const { defaultBlock, directInsert } = state.blockListSettings[rootClientId] ?? {};
if (!defaultBlock || !directInsert) {
return;
}
return defaultBlock;
}
function __experimentalGetDirectInsertBlock(state, rootClientId = null) {
external_wp_deprecated_default()(
'wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock',
{
alternative: 'wp.data.select( "core/block-editor" ).getDirectInsertBlock',
since: "6.3",
version: "6.4"
}
);
return getDirectInsertBlock(state, rootClientId);
}
const __experimentalGetParsedPattern = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (state, patternName) => {
const pattern = unlock(select(STORE_NAME)).getPatternBySlug(
patternName
);
return pattern ? getParsedPattern(pattern) : null;
}
);
const getAllowedPatternsDependants = (select) => (state, rootClientId) => [
...getAllPatternsDependants(select)(state),
...getInsertBlockTypeDependants(select)(state, rootClientId)
];
const patternsWithParsedBlocks = /* @__PURE__ */ new WeakMap();
function enhancePatternWithParsedBlocks(pattern) {
let enhancedPattern = patternsWithParsedBlocks.get(pattern);
if (!enhancedPattern) {
enhancedPattern = {
...pattern,
get blocks() {
return getParsedPattern(pattern).blocks;
}
};
patternsWithParsedBlocks.set(pattern, enhancedPattern);
}
return enhancedPattern;
}
const __experimentalGetAllowedPatterns = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => {
return (0,external_wp_data_namespaceObject.createSelector)(
(state, rootClientId = null, options = DEFAULT_INSERTER_OPTIONS) => {
const { getAllPatterns } = unlock(select(STORE_NAME));
const patterns = getAllPatterns();
const { allowedBlockTypes } = getSettings(state);
const parsedPatterns = patterns.filter(({ inserter = true }) => !!inserter).map(enhancePatternWithParsedBlocks);
const availableParsedPatterns = parsedPatterns.filter(
(pattern) => checkAllowListRecursive(
getGrammar(pattern),
allowedBlockTypes
)
);
const patternsAllowed = availableParsedPatterns.filter(
(pattern) => getGrammar(pattern).every(
({ blockName: name }) => options[isFiltered] !== false ? canInsertBlockType(
state,
name,
rootClientId
) : isBlockVisibleInTheInserter(
state,
name,
rootClientId
)
)
);
return patternsAllowed;
},
getAllowedPatternsDependants(select)
);
}
);
const getPatternsByBlockTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (0,external_wp_data_namespaceObject.createSelector)(
(state, blockNames, rootClientId = null) => {
if (!blockNames) {
return selectors_EMPTY_ARRAY;
}
const patterns = select(STORE_NAME).__experimentalGetAllowedPatterns(
rootClientId
);
const normalizedBlockNames = Array.isArray(blockNames) ? blockNames : [blockNames];
const filteredPatterns = patterns.filter(
(pattern) => pattern?.blockTypes?.some?.(
(blockName) => normalizedBlockNames.includes(blockName)
)
);
if (filteredPatterns.length === 0) {
return selectors_EMPTY_ARRAY;
}
return filteredPatterns;
},
(state, blockNames, rootClientId) => getAllowedPatternsDependants(select)(state, rootClientId)
)
);
const __experimentalGetPatternsByBlockTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => {
external_wp_deprecated_default()(
'wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',
{
alternative: 'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',
since: "6.2",
version: "6.4"
}
);
return select(STORE_NAME).getPatternsByBlockTypes;
}
);
const __experimentalGetPatternTransformItems = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (0,external_wp_data_namespaceObject.createSelector)(
(state, blocks, rootClientId = null) => {
if (!blocks) {
return selectors_EMPTY_ARRAY;
}
if (blocks.some(
({ clientId, innerBlocks }) => innerBlocks.length || areInnerBlocksControlled(state, clientId)
)) {
return selectors_EMPTY_ARRAY;
}
const selectedBlockNames = Array.from(
new Set(blocks.map(({ name }) => name))
);
return select(STORE_NAME).getPatternsByBlockTypes(
selectedBlockNames,
rootClientId
);
},
(state, blocks, rootClientId) => getAllowedPatternsDependants(select)(state, rootClientId)
)
);
function getBlockListSettings(state, clientId) {
return state.blockListSettings[clientId];
}
function getSettings(state) {
return state.settings;
}
function isLastBlockChangePersistent(state) {
return state.blocks.isPersistentChange;
}
const __experimentalGetBlockListSettingsForBlocks = (0,external_wp_data_namespaceObject.createSelector)(
(state, clientIds = []) => {
return clientIds.reduce((blockListSettingsForBlocks, clientId) => {
if (!state.blockListSettings[clientId]) {
return blockListSettingsForBlocks;
}
return {
...blockListSettingsForBlocks,
[clientId]: state.blockListSettings[clientId]
};
}, {});
},
(state) => [state.blockListSettings]
);
const __experimentalGetReusableBlockTitle = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (0,external_wp_data_namespaceObject.createSelector)(
(state, ref) => {
external_wp_deprecated_default()(
"wp.data.select( 'core/block-editor' ).__experimentalGetReusableBlockTitle",
{
since: "6.6",
version: "6.8"
}
);
const reusableBlock = unlock(select(STORE_NAME)).getReusableBlocks().find((block) => block.id === ref);
if (!reusableBlock) {
return null;
}
return reusableBlock.title?.raw;
},
() => [unlock(select(STORE_NAME)).getReusableBlocks()]
)
);
function __unstableIsLastBlockChangeIgnored(state) {
return state.blocks.isIgnoredChange;
}
function __experimentalGetLastBlockAttributeChanges(state) {
return state.lastBlockAttributesChange;
}
function hasBlockMovingClientId() {
external_wp_deprecated_default()(
'wp.data.select( "core/block-editor" ).hasBlockMovingClientId',
{
since: "6.7",
hint: "Block moving mode feature has been removed"
}
);
return false;
}
function didAutomaticChange(state) {
return !!state.automaticChangeStatus;
}
function isBlockHighlighted(state, clientId) {
return state.highlightedBlock === clientId;
}
function areInnerBlocksControlled(state, clientId) {
return !!state.blocks.controlledInnerBlocks[clientId];
}
const __experimentalGetActiveBlockIdByBlockNames = (0,external_wp_data_namespaceObject.createSelector)(
(state, validBlockNames) => {
if (!validBlockNames.length) {
return null;
}
const selectedBlockClientId = getSelectedBlockClientId(state);
if (validBlockNames.includes(
getBlockName(state, selectedBlockClientId)
)) {
return selectedBlockClientId;
}
const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state);
const entityAreaParents = getBlockParentsByBlockName(
state,
selectedBlockClientId || multiSelectedBlockClientIds[0],
validBlockNames
);
if (entityAreaParents) {
return entityAreaParents[entityAreaParents.length - 1];
}
return null;
},
(state, validBlockNames) => [
state.selection.selectionStart.clientId,
state.selection.selectionEnd.clientId,
validBlockNames
]
);
function wasBlockJustInserted(state, clientId, source) {
const { lastBlockInserted } = state;
return lastBlockInserted.clientIds?.includes(clientId) && lastBlockInserted.source === source;
}
function isBlockVisible(state, clientId) {
return state.blockVisibility?.[clientId] ?? true;
}
function getHoveredBlockClientId() {
external_wp_deprecated_default()(
"wp.data.select( 'core/block-editor' ).getHoveredBlockClientId",
{
since: "6.9",
version: "7.1"
}
);
return void 0;
}
const __unstableGetVisibleBlocks = (0,external_wp_data_namespaceObject.createSelector)(
(state) => {
const visibleBlocks = new Set(
Object.keys(state.blockVisibility).filter(
(key) => state.blockVisibility[key]
)
);
if (visibleBlocks.size === 0) {
return EMPTY_SET;
}
return visibleBlocks;
},
(state) => [state.blockVisibility]
);
function __unstableHasActiveBlockOverlayActive(state, clientId) {
if (getBlockEditingMode(state, clientId) !== "default") {
return false;
}
if (!canEditBlock(state, clientId)) {
return true;
}
if (isZoomOut(state)) {
const sectionRootClientId = getSectionRootClientId(state);
if (sectionRootClientId) {
const sectionClientIds = getBlockOrder(
state,
sectionRootClientId
);
if (sectionClientIds?.includes(clientId)) {
return true;
}
} else if (clientId && !getBlockRootClientId(state, clientId)) {
return true;
}
}
const blockSupportDisable = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(
getBlockName(state, clientId),
"__experimentalDisableBlockOverlay",
false
);
const shouldEnableIfUnselected = blockSupportDisable ? false : areInnerBlocksControlled(state, clientId);
return shouldEnableIfUnselected && !isBlockSelected(state, clientId) && !hasSelectedInnerBlock(state, clientId, true);
}
function __unstableIsWithinBlockOverlay(state, clientId) {
let parent = state.blocks.parents.get(clientId);
while (!!parent) {
if (__unstableHasActiveBlockOverlayActive(state, parent)) {
return true;
}
parent = state.blocks.parents.get(parent);
}
return false;
}
function getBlockEditingMode(state, clientId = "") {
if (clientId === null) {
clientId = "";
}
if (state.derivedBlockEditingModes?.has(clientId)) {
return state.derivedBlockEditingModes.get(clientId);
}
if (state.blockEditingModes.has(clientId)) {
return state.blockEditingModes.get(clientId);
}
return "default";
}
const isUngroupable = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (state, clientId = "") => {
const _clientId = clientId || getSelectedBlockClientId(state);
if (!_clientId) {
return false;
}
const { getGroupingBlockName } = select(external_wp_blocks_namespaceObject.store);
const block = getBlock(state, _clientId);
const groupingBlockName = getGroupingBlockName();
const _isUngroupable = block && (block.name === groupingBlockName || (0,external_wp_blocks_namespaceObject.getBlockType)(block.name)?.transforms?.ungroup) && !!block.innerBlocks.length;
return _isUngroupable && canRemoveBlock(state, _clientId);
}
);
const isGroupable = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (state, clientIds = selectors_EMPTY_ARRAY) => {
const { getGroupingBlockName } = select(external_wp_blocks_namespaceObject.store);
const groupingBlockName = getGroupingBlockName();
const _clientIds = clientIds?.length ? clientIds : getSelectedBlockClientIds(state);
const rootClientId = _clientIds?.length ? getBlockRootClientId(state, _clientIds[0]) : void 0;
const groupingBlockAvailable = canInsertBlockType(
state,
groupingBlockName,
rootClientId
);
const _isGroupable = groupingBlockAvailable && _clientIds.length;
return _isGroupable && canRemoveBlocks(state, _clientIds);
}
);
const __unstableGetContentLockingParent = (state, clientId) => {
external_wp_deprecated_default()(
"wp.data.select( 'core/block-editor' ).__unstableGetContentLockingParent",
{
since: "6.1",
version: "6.7"
}
);
return getContentLockingParent(state, clientId);
};
function __unstableGetTemporarilyEditingAsBlocks(state) {
external_wp_deprecated_default()(
"wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingAsBlocks",
{
since: "6.1",
version: "6.7"
}
);
return getTemporarilyEditingAsBlocks(state);
}
function __unstableGetTemporarilyEditingFocusModeToRevert(state) {
external_wp_deprecated_default()(
"wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingFocusModeToRevert",
{
since: "6.5",
version: "6.7"
}
);
return getTemporarilyEditingFocusModeToRevert(state);
}
;// external ["wp","a11y"]
const external_wp_a11y_namespaceObject = window["wp"]["a11y"];
;// ./node_modules/@wordpress/block-editor/build-module/store/private-actions.js
const castArray = (maybeArray) => Array.isArray(maybeArray) ? maybeArray : [maybeArray];
const privateSettings = [
"inserterMediaCategories",
"blockInspectorAnimation",
"mediaSideload"
];
function __experimentalUpdateSettings(settings, { stripExperimentalSettings = false, reset = false } = {}) {
let incomingSettings = settings;
if (Object.hasOwn(incomingSettings, "__unstableIsPreviewMode")) {
external_wp_deprecated_default()(
"__unstableIsPreviewMode argument in wp.data.dispatch('core/block-editor').updateSettings",
{
since: "6.8",
alternative: "isPreviewMode"
}
);
incomingSettings = { ...incomingSettings };
incomingSettings.isPreviewMode = incomingSettings.__unstableIsPreviewMode;
delete incomingSettings.__unstableIsPreviewMode;
}
let cleanSettings = incomingSettings;
if (stripExperimentalSettings && external_wp_element_namespaceObject.Platform.OS === "web") {
cleanSettings = {};
for (const key in incomingSettings) {
if (!privateSettings.includes(key)) {
cleanSettings[key] = incomingSettings[key];
}
}
}
return {
type: "UPDATE_SETTINGS",
settings: cleanSettings,
reset
};
}
function hideBlockInterface() {
return {
type: "HIDE_BLOCK_INTERFACE"
};
}
function showBlockInterface() {
return {
type: "SHOW_BLOCK_INTERFACE"
};
}
const privateRemoveBlocks = (clientIds, selectPrevious = true, forceRemove = false) => ({ select, dispatch, registry }) => {
if (!clientIds || !clientIds.length) {
return;
}
clientIds = castArray(clientIds);
const canRemoveBlocks = select.canRemoveBlocks(clientIds);
if (!canRemoveBlocks) {
return;
}
const rules = !forceRemove && select.getBlockRemovalRules();
if (rules) {
let flattenBlocks2 = function(blocks) {
const result = [];
const stack = [...blocks];
while (stack.length) {
const { innerBlocks, ...block } = stack.shift();
stack.push(...innerBlocks);
result.push(block);
}
return result;
};
var flattenBlocks = flattenBlocks2;
const blockList = clientIds.map(select.getBlock);
const flattenedBlocks = flattenBlocks2(blockList);
let message;
for (const rule of rules) {
message = rule.callback(flattenedBlocks);
if (message) {
dispatch(
displayBlockRemovalPrompt(
clientIds,
selectPrevious,
message
)
);
return;
}
}
}
if (selectPrevious) {
dispatch.selectPreviousBlock(clientIds[0], selectPrevious);
}
registry.batch(() => {
dispatch({ type: "REMOVE_BLOCKS", clientIds });
dispatch(ensureDefaultBlock());
});
};
const ensureDefaultBlock = () => ({ select, dispatch }) => {
const count = select.getBlockCount();
if (count > 0) {
return;
}
const { __unstableHasCustomAppender } = select.getSettings();
if (__unstableHasCustomAppender) {
return;
}
dispatch.insertDefaultBlock();
};
function displayBlockRemovalPrompt(clientIds, selectPrevious, message) {
return {
type: "DISPLAY_BLOCK_REMOVAL_PROMPT",
clientIds,
selectPrevious,
message
};
}
function clearBlockRemovalPrompt() {
return {
type: "CLEAR_BLOCK_REMOVAL_PROMPT"
};
}
function setBlockRemovalRules(rules = false) {
return {
type: "SET_BLOCK_REMOVAL_RULES",
rules
};
}
function setOpenedBlockSettingsMenu(clientId) {
return {
type: "SET_OPENED_BLOCK_SETTINGS_MENU",
clientId
};
}
function setStyleOverride(id, style) {
return {
type: "SET_STYLE_OVERRIDE",
id,
style
};
}
function deleteStyleOverride(id) {
return {
type: "DELETE_STYLE_OVERRIDE",
id
};
}
function setLastFocus(lastFocus = null) {
return {
type: "LAST_FOCUS",
lastFocus
};
}
function stopEditingAsBlocks(clientId) {
return ({ select, dispatch, registry }) => {
const focusModeToRevert = unlock(
registry.select(store)
).getTemporarilyEditingFocusModeToRevert();
dispatch.__unstableMarkNextChangeAsNotPersistent();
dispatch.updateBlockAttributes(clientId, {
templateLock: "contentOnly"
});
dispatch.updateBlockListSettings(clientId, {
...select.getBlockListSettings(clientId),
templateLock: "contentOnly"
});
dispatch.updateSettings({ focusMode: focusModeToRevert });
dispatch.__unstableSetTemporarilyEditingAsBlocks();
};
}
function startDragging() {
return {
type: "START_DRAGGING"
};
}
function stopDragging() {
return {
type: "STOP_DRAGGING"
};
}
function expandBlock(clientId) {
return {
type: "SET_BLOCK_EXPANDED_IN_LIST_VIEW",
clientId
};
}
function setInsertionPoint(value) {
return {
type: "SET_INSERTION_POINT",
value
};
}
const modifyContentLockBlock = (clientId) => ({ select, dispatch }) => {
dispatch.selectBlock(clientId);
dispatch.__unstableMarkNextChangeAsNotPersistent();
dispatch.updateBlockAttributes(clientId, {
templateLock: void 0
});
dispatch.updateBlockListSettings(clientId, {
...select.getBlockListSettings(clientId),
templateLock: false
});
const focusModeToRevert = select.getSettings().focusMode;
dispatch.updateSettings({ focusMode: true });
dispatch.__unstableSetTemporarilyEditingAsBlocks(
clientId,
focusModeToRevert
);
};
const setZoomLevel = (zoom = 100) => ({ select, dispatch }) => {
if (zoom !== 100) {
const firstSelectedClientId = select.getBlockSelectionStart();
const sectionRootClientId = select.getSectionRootClientId();
if (firstSelectedClientId) {
let sectionClientId;
if (sectionRootClientId) {
const sectionClientIds = select.getBlockOrder(sectionRootClientId);
if (sectionClientIds?.includes(firstSelectedClientId)) {
sectionClientId = firstSelectedClientId;
} else {
sectionClientId = select.getBlockParents(firstSelectedClientId).find(
(parent) => sectionClientIds.includes(parent)
);
}
} else {
sectionClientId = select.getBlockHierarchyRootClientId(
firstSelectedClientId
);
}
if (sectionClientId) {
dispatch.selectBlock(sectionClientId);
} else {
dispatch.clearSelectedBlock();
}
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)("You are currently in zoom-out mode."));
}
}
dispatch({
type: "SET_ZOOM_LEVEL",
zoom
});
};
function resetZoomLevel() {
return {
type: "RESET_ZOOM_LEVEL"
};
}
function toggleBlockSpotlight(clientId, hasBlockSpotlight) {
return {
type: "TOGGLE_BLOCK_SPOTLIGHT",
clientId,
hasBlockSpotlight
};
}
;// external ["wp","notices"]
const external_wp_notices_namespaceObject = window["wp"]["notices"];
;// external ["wp","preferences"]
const external_wp_preferences_namespaceObject = window["wp"]["preferences"];
;// ./node_modules/@wordpress/block-editor/build-module/utils/selection.js
const START_OF_SELECTED_AREA = "\x86";
function retrieveSelectedAttribute(blockAttributes) {
if (!blockAttributes) {
return;
}
return Object.keys(blockAttributes).find((name) => {
const value = blockAttributes[name];
return (typeof value === "string" || value instanceof external_wp_richText_namespaceObject.RichTextData) && // To do: refactor this to use rich text's selection instead, so we
// no longer have to use on this hack inserting a special character.
value.toString().indexOf(START_OF_SELECTED_AREA) !== -1;
});
}
function findRichTextAttributeKey(blockType) {
for (const [key, value] of Object.entries(blockType.attributes)) {
if (value.source === "rich-text" || value.source === "html") {
return key;
}
}
}
;// ./node_modules/@wordpress/block-editor/build-module/store/actions.js
const actions_castArray = (maybeArray) => Array.isArray(maybeArray) ? maybeArray : [maybeArray];
const resetBlocks = (blocks) => ({ dispatch }) => {
dispatch({ type: "RESET_BLOCKS", blocks });
dispatch(validateBlocksToTemplate(blocks));
};
const validateBlocksToTemplate = (blocks) => ({ select, dispatch }) => {
const template = select.getTemplate();
const templateLock = select.getTemplateLock();
const isBlocksValidToTemplate = !template || templateLock !== "all" || (0,external_wp_blocks_namespaceObject.doBlocksMatchTemplate)(blocks, template);
const isValidTemplate = select.isValidTemplate();
if (isBlocksValidToTemplate !== isValidTemplate) {
dispatch.setTemplateValidity(isBlocksValidToTemplate);
return isBlocksValidToTemplate;
}
};
function resetSelection(selectionStart, selectionEnd, initialPosition) {
return {
type: "RESET_SELECTION",
selectionStart,
selectionEnd,
initialPosition
};
}
function receiveBlocks(blocks) {
external_wp_deprecated_default()('wp.data.dispatch( "core/block-editor" ).receiveBlocks', {
since: "5.9",
alternative: "resetBlocks or insertBlocks"
});
return {
type: "RECEIVE_BLOCKS",
blocks
};
}
function updateBlockAttributes(clientIds, attributes, options = { uniqueByBlock: false }) {
if (typeof options === "boolean") {
options = { uniqueByBlock: options };
}
return {
type: "UPDATE_BLOCK_ATTRIBUTES",
clientIds: actions_castArray(clientIds),
attributes,
options
};
}
function updateBlock(clientId, updates) {
return {
type: "UPDATE_BLOCK",
clientId,
updates
};
}
function selectBlock(clientId, initialPosition = 0) {
return {
type: "SELECT_BLOCK",
initialPosition,
clientId
};
}
function hoverBlock() {
external_wp_deprecated_default()('wp.data.dispatch( "core/block-editor" ).hoverBlock', {
since: "6.9",
version: "7.1"
});
return {
type: "DO_NOTHING"
};
}
const selectPreviousBlock = (clientId, fallbackToParent = false) => ({ select, dispatch }) => {
const previousBlockClientId = select.getPreviousBlockClientId(clientId);
if (previousBlockClientId) {
dispatch.selectBlock(previousBlockClientId, -1);
} else if (fallbackToParent) {
const firstParentClientId = select.getBlockRootClientId(clientId);
if (firstParentClientId) {
dispatch.selectBlock(firstParentClientId, -1);
}
}
};
const selectNextBlock = (clientId) => ({ select, dispatch }) => {
const nextBlockClientId = select.getNextBlockClientId(clientId);
if (nextBlockClientId) {
dispatch.selectBlock(nextBlockClientId);
}
};
function startMultiSelect() {
return {
type: "START_MULTI_SELECT"
};
}
function stopMultiSelect() {
return {
type: "STOP_MULTI_SELECT"
};
}
const multiSelect = (start, end, __experimentalInitialPosition = 0) => ({ select, dispatch }) => {
const startBlockRootClientId = select.getBlockRootClientId(start);
const endBlockRootClientId = select.getBlockRootClientId(end);
if (startBlockRootClientId !== endBlockRootClientId) {
return;
}
dispatch({
type: "MULTI_SELECT",
start,
end,
initialPosition: __experimentalInitialPosition
});
const blockCount = select.getSelectedBlockCount();
(0,external_wp_a11y_namespaceObject.speak)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: number of selected blocks */
(0,external_wp_i18n_namespaceObject._n)("%s block selected.", "%s blocks selected.", blockCount),
blockCount
),
"assertive"
);
};
function clearSelectedBlock() {
return {
type: "CLEAR_SELECTED_BLOCK"
};
}
function toggleSelection(isSelectionEnabled = true) {
return {
type: "TOGGLE_SELECTION",
isSelectionEnabled
};
}
const replaceBlocks = (clientIds, blocks, indexToSelect, initialPosition = 0, meta) => ({ select, dispatch, registry }) => {
clientIds = actions_castArray(clientIds);
blocks = actions_castArray(blocks);
const rootClientId = select.getBlockRootClientId(clientIds[0]);
for (let index = 0; index < blocks.length; index++) {
const block = blocks[index];
const canInsertBlock = select.canInsertBlockType(
block.name,
rootClientId
);
if (!canInsertBlock) {
return;
}
}
registry.batch(() => {
dispatch({
type: "REPLACE_BLOCKS",
clientIds,
blocks,
time: Date.now(),
indexToSelect,
initialPosition,
meta
});
dispatch.ensureDefaultBlock();
});
};
function replaceBlock(clientId, block) {
return replaceBlocks(clientId, block);
}
const createOnMove = (type) => (clientIds, rootClientId) => ({ select, dispatch }) => {
const canMoveBlocks = select.canMoveBlocks(clientIds);
if (!canMoveBlocks) {
return;
}
dispatch({ type, clientIds: actions_castArray(clientIds), rootClientId });
};
const moveBlocksDown = createOnMove("MOVE_BLOCKS_DOWN");
const moveBlocksUp = createOnMove("MOVE_BLOCKS_UP");
const moveBlocksToPosition = (clientIds, fromRootClientId = "", toRootClientId = "", index) => ({ select, dispatch }) => {
const canMoveBlocks = select.canMoveBlocks(clientIds);
if (!canMoveBlocks) {
return;
}
if (fromRootClientId !== toRootClientId) {
const canRemoveBlocks = select.canRemoveBlocks(clientIds);
if (!canRemoveBlocks) {
return;
}
const canInsertBlocks = select.canInsertBlocks(
clientIds,
toRootClientId
);
if (!canInsertBlocks) {
return;
}
}
dispatch({
type: "MOVE_BLOCKS_TO_POSITION",
fromRootClientId,
toRootClientId,
clientIds,
index
});
};
function moveBlockToPosition(clientId, fromRootClientId = "", toRootClientId = "", index) {
return moveBlocksToPosition(
[clientId],
fromRootClientId,
toRootClientId,
index
);
}
function insertBlock(block, index, rootClientId, updateSelection, meta) {
return insertBlocks(
[block],
index,
rootClientId,
updateSelection,
0,
meta
);
}
const insertBlocks = (blocks, index, rootClientId, updateSelection = true, initialPosition = 0, meta) => ({ select, dispatch }) => {
if (initialPosition !== null && typeof initialPosition === "object") {
meta = initialPosition;
initialPosition = 0;
external_wp_deprecated_default()(
"meta argument in wp.data.dispatch('core/block-editor')",
{
since: "5.8",
hint: "The meta argument is now the 6th argument of the function"
}
);
}
blocks = actions_castArray(blocks);
const allowedBlocks = [];
for (const block of blocks) {
const isValid = select.canInsertBlockType(
block.name,
rootClientId
);
if (isValid) {
allowedBlocks.push(block);
}
}
if (allowedBlocks.length) {
dispatch({
type: "INSERT_BLOCKS",
blocks: allowedBlocks,
index,
rootClientId,
time: Date.now(),
updateSelection,
initialPosition: updateSelection ? initialPosition : null,
meta
});
}
};
function showInsertionPoint(rootClientId, index, __unstableOptions = {}) {
const { __unstableWithInserter, operation, nearestSide } = __unstableOptions;
return {
type: "SHOW_INSERTION_POINT",
rootClientId,
index,
__unstableWithInserter,
operation,
nearestSide
};
}
const hideInsertionPoint = () => ({ select, dispatch }) => {
if (!select.isBlockInsertionPointVisible()) {
return;
}
dispatch({
type: "HIDE_INSERTION_POINT"
});
};
function setTemplateValidity(isValid) {
return {
type: "SET_TEMPLATE_VALIDITY",
isValid
};
}
const synchronizeTemplate = () => ({ select, dispatch }) => {
dispatch({ type: "SYNCHRONIZE_TEMPLATE" });
const blocks = select.getBlocks();
const template = select.getTemplate();
const updatedBlockList = (0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)(
blocks,
template
);
dispatch.resetBlocks(updatedBlockList);
};
const __unstableDeleteSelection = (isForward) => ({ registry, select, dispatch }) => {
const selectionAnchor = select.getSelectionStart();
const selectionFocus = select.getSelectionEnd();
if (selectionAnchor.clientId === selectionFocus.clientId) {
return;
}
if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === "undefined" || typeof selectionFocus.offset === "undefined") {
return false;
}
const anchorRootClientId = select.getBlockRootClientId(
selectionAnchor.clientId
);
const focusRootClientId = select.getBlockRootClientId(
selectionFocus.clientId
);
if (anchorRootClientId !== focusRootClientId) {
return;
}
const blockOrder = select.getBlockOrder(anchorRootClientId);
const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId);
const focusIndex = blockOrder.indexOf(selectionFocus.clientId);
let selectionStart, selectionEnd;
if (anchorIndex > focusIndex) {
selectionStart = selectionFocus;
selectionEnd = selectionAnchor;
} else {
selectionStart = selectionAnchor;
selectionEnd = selectionFocus;
}
const targetSelection = isForward ? selectionEnd : selectionStart;
const targetBlock = select.getBlock(targetSelection.clientId);
const targetBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(targetBlock.name);
if (!targetBlockType.merge) {
return;
}
const selectionA = selectionStart;
const selectionB = selectionEnd;
const blockA = select.getBlock(selectionA.clientId);
const blockB = select.getBlock(selectionB.clientId);
const htmlA = blockA.attributes[selectionA.attributeKey];
const htmlB = blockB.attributes[selectionB.attributeKey];
let valueA = (0,external_wp_richText_namespaceObject.create)({ html: htmlA });
let valueB = (0,external_wp_richText_namespaceObject.create)({ html: htmlB });
valueA = (0,external_wp_richText_namespaceObject.remove)(valueA, selectionA.offset, valueA.text.length);
valueB = (0,external_wp_richText_namespaceObject.insert)(valueB, START_OF_SELECTED_AREA, 0, selectionB.offset);
const cloneA = (0,external_wp_blocks_namespaceObject.cloneBlock)(blockA, {
[selectionA.attributeKey]: (0,external_wp_richText_namespaceObject.toHTMLString)({ value: valueA })
});
const cloneB = (0,external_wp_blocks_namespaceObject.cloneBlock)(blockB, {
[selectionB.attributeKey]: (0,external_wp_richText_namespaceObject.toHTMLString)({ value: valueB })
});
const followingBlock = isForward ? cloneA : cloneB;
const blocksWithTheSameType = blockA.name === blockB.name ? [followingBlock] : (0,external_wp_blocks_namespaceObject.switchToBlockType)(followingBlock, targetBlockType.name);
if (!blocksWithTheSameType || !blocksWithTheSameType.length) {
return;
}
let updatedAttributes;
if (isForward) {
const blockToMerge = blocksWithTheSameType.pop();
updatedAttributes = targetBlockType.merge(
blockToMerge.attributes,
cloneB.attributes
);
} else {
const blockToMerge = blocksWithTheSameType.shift();
updatedAttributes = targetBlockType.merge(
cloneA.attributes,
blockToMerge.attributes
);
}
const newAttributeKey = retrieveSelectedAttribute(updatedAttributes);
const convertedHtml = updatedAttributes[newAttributeKey];
const convertedValue = (0,external_wp_richText_namespaceObject.create)({ html: convertedHtml });
const newOffset = convertedValue.text.indexOf(START_OF_SELECTED_AREA);
const newValue = (0,external_wp_richText_namespaceObject.remove)(convertedValue, newOffset, newOffset + 1);
const newHtml = (0,external_wp_richText_namespaceObject.toHTMLString)({ value: newValue });
updatedAttributes[newAttributeKey] = newHtml;
const selectedBlockClientIds = select.getSelectedBlockClientIds();
const replacement = [
...isForward ? blocksWithTheSameType : [],
{
// Preserve the original client ID.
...targetBlock,
attributes: {
...targetBlock.attributes,
...updatedAttributes
}
},
...isForward ? [] : blocksWithTheSameType
];
registry.batch(() => {
dispatch.selectionChange(
targetBlock.clientId,
newAttributeKey,
newOffset,
newOffset
);
dispatch.replaceBlocks(
selectedBlockClientIds,
replacement,
0,
// If we don't pass the `indexToSelect` it will default to the last block.
select.getSelectedBlocksInitialCaretPosition()
);
});
};
const __unstableSplitSelection = (blocks = []) => ({ registry, select, dispatch }) => {
const selectionAnchor = select.getSelectionStart();
const selectionFocus = select.getSelectionEnd();
const anchorRootClientId = select.getBlockRootClientId(
selectionAnchor.clientId
);
const focusRootClientId = select.getBlockRootClientId(
selectionFocus.clientId
);
if (anchorRootClientId !== focusRootClientId) {
return;
}
const blockOrder = select.getBlockOrder(anchorRootClientId);
const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId);
const focusIndex = blockOrder.indexOf(selectionFocus.clientId);
let selectionStart, selectionEnd;
if (anchorIndex > focusIndex) {
selectionStart = selectionFocus;
selectionEnd = selectionAnchor;
} else {
selectionStart = selectionAnchor;
selectionEnd = selectionFocus;
}
const selectionA = selectionStart;
const selectionB = selectionEnd;
const blockA = select.getBlock(selectionA.clientId);
const blockB = select.getBlock(selectionB.clientId);
const blockAType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockA.name);
const blockBType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockB.name);
const attributeKeyA = typeof selectionA.attributeKey === "string" ? selectionA.attributeKey : findRichTextAttributeKey(blockAType);
const attributeKeyB = typeof selectionB.attributeKey === "string" ? selectionB.attributeKey : findRichTextAttributeKey(blockBType);
const blockAttributes = select.getBlockAttributes(
selectionA.clientId
);
const bindings = blockAttributes?.metadata?.bindings;
if (bindings?.[attributeKeyA]) {
if (blocks.length) {
const { createWarningNotice } = registry.dispatch(external_wp_notices_namespaceObject.store);
createWarningNotice(
(0,external_wp_i18n_namespaceObject.__)(
"Blocks can't be inserted into other blocks with bindings"
),
{
type: "snackbar"
}
);
return;
}
dispatch.insertAfterBlock(selectionA.clientId);
return;
}
if (!attributeKeyA || !attributeKeyB || typeof selectionAnchor.offset === "undefined" || typeof selectionFocus.offset === "undefined") {
return;
}
if (selectionA.clientId === selectionB.clientId && attributeKeyA === attributeKeyB && selectionA.offset === selectionB.offset) {
if (blocks.length) {
if ((0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(blockA)) {
dispatch.replaceBlocks(
[selectionA.clientId],
blocks,
blocks.length - 1,
-1
);
return;
}
} else if (!select.getBlockOrder(selectionA.clientId).length) {
let createEmpty2 = function() {
const defaultBlockName2 = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)();
return select.canInsertBlockType(
defaultBlockName2,
anchorRootClientId
) ? (0,external_wp_blocks_namespaceObject.createBlock)(defaultBlockName2) : (0,external_wp_blocks_namespaceObject.createBlock)(
select.getBlockName(selectionA.clientId)
);
};
var createEmpty = createEmpty2;
const length = blockAttributes[attributeKeyA].length;
if (selectionA.offset === 0 && length) {
dispatch.insertBlocks(
[createEmpty2()],
select.getBlockIndex(selectionA.clientId),
anchorRootClientId,
false
);
return;
}
if (selectionA.offset === length) {
dispatch.insertBlocks(
[createEmpty2()],
select.getBlockIndex(selectionA.clientId) + 1,
anchorRootClientId
);
return;
}
}
}
const htmlA = blockA.attributes[attributeKeyA];
const htmlB = blockB.attributes[attributeKeyB];
let valueA = (0,external_wp_richText_namespaceObject.create)({ html: htmlA });
let valueB = (0,external_wp_richText_namespaceObject.create)({ html: htmlB });
valueA = (0,external_wp_richText_namespaceObject.remove)(valueA, selectionA.offset, valueA.text.length);
valueB = (0,external_wp_richText_namespaceObject.remove)(valueB, 0, selectionB.offset);
let head = {
// Preserve the original client ID.
...blockA,
// If both start and end are the same, should only copy innerBlocks
// once.
innerBlocks: blockA.clientId === blockB.clientId ? [] : blockA.innerBlocks,
attributes: {
...blockA.attributes,
[attributeKeyA]: (0,external_wp_richText_namespaceObject.toHTMLString)({ value: valueA })
}
};
let tail = {
...blockB,
// Only preserve the original client ID if the end is different.
clientId: blockA.clientId === blockB.clientId ? (0,external_wp_blocks_namespaceObject.createBlock)(blockB.name).clientId : blockB.clientId,
attributes: {
...blockB.attributes,
[attributeKeyB]: (0,external_wp_richText_namespaceObject.toHTMLString)({ value: valueB })
}
};
const defaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)();
if (
// A block is only split when the selection is within the same
// block.
blockA.clientId === blockB.clientId && defaultBlockName && tail.name !== defaultBlockName && select.canInsertBlockType(defaultBlockName, anchorRootClientId)
) {
const switched = (0,external_wp_blocks_namespaceObject.switchToBlockType)(tail, defaultBlockName);
if (switched?.length === 1) {
tail = switched[0];
}
}
if (!blocks.length) {
dispatch.replaceBlocks(select.getSelectedBlockClientIds(), [
head,
tail
]);
return;
}
let selection;
const output = [];
const clonedBlocks = [...blocks];
const firstBlock = clonedBlocks.shift();
const headType = (0,external_wp_blocks_namespaceObject.getBlockType)(head.name);
const firstBlocks = headType.merge && firstBlock.name === headType.name ? [firstBlock] : (0,external_wp_blocks_namespaceObject.switchToBlockType)(firstBlock, headType.name);
if (firstBlocks?.length) {
const first = firstBlocks.shift();
head = {
...head,
attributes: {
...head.attributes,
...headType.merge(head.attributes, first.attributes)
}
};
output.push(head);
selection = {
clientId: head.clientId,
attributeKey: attributeKeyA,
offset: (0,external_wp_richText_namespaceObject.create)({ html: head.attributes[attributeKeyA] }).text.length
};
clonedBlocks.unshift(...firstBlocks);
} else {
if (!(0,external_wp_blocks_namespaceObject.isUnmodifiedBlock)(head)) {
output.push(head);
}
output.push(firstBlock);
}
const lastBlock = clonedBlocks.pop();
const tailType = (0,external_wp_blocks_namespaceObject.getBlockType)(tail.name);
if (clonedBlocks.length) {
output.push(...clonedBlocks);
}
if (lastBlock) {
const lastBlocks = tailType.merge && tailType.name === lastBlock.name ? [lastBlock] : (0,external_wp_blocks_namespaceObject.switchToBlockType)(lastBlock, tailType.name);
if (lastBlocks?.length) {
const last = lastBlocks.pop();
output.push({
...tail,
attributes: {
...tail.attributes,
...tailType.merge(last.attributes, tail.attributes)
}
});
output.push(...lastBlocks);
selection = {
clientId: tail.clientId,
attributeKey: attributeKeyB,
offset: (0,external_wp_richText_namespaceObject.create)({
html: last.attributes[attributeKeyB]
}).text.length
};
} else {
output.push(lastBlock);
if (!(0,external_wp_blocks_namespaceObject.isUnmodifiedBlock)(tail)) {
output.push(tail);
}
}
} else if (!(0,external_wp_blocks_namespaceObject.isUnmodifiedBlock)(tail)) {
output.push(tail);
}
registry.batch(() => {
dispatch.replaceBlocks(
select.getSelectedBlockClientIds(),
output,
output.length - 1,
0
);
if (selection) {
dispatch.selectionChange(
selection.clientId,
selection.attributeKey,
selection.offset,
selection.offset
);
}
});
};
const __unstableExpandSelection = () => ({ select, dispatch }) => {
const selectionAnchor = select.getSelectionStart();
const selectionFocus = select.getSelectionEnd();
dispatch.selectionChange({
start: { clientId: selectionAnchor.clientId },
end: { clientId: selectionFocus.clientId }
});
};
const mergeBlocks = (firstBlockClientId, secondBlockClientId) => ({ registry, select, dispatch }) => {
const clientIdA = firstBlockClientId;
const clientIdB = secondBlockClientId;
const blockA = select.getBlock(clientIdA);
const blockAType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockA.name);
if (!blockAType || select.getBlockEditingMode(clientIdA) === "disabled" || select.getBlockEditingMode(clientIdB) === "disabled") {
return;
}
const blockB = select.getBlock(clientIdB);
if (!blockAType.merge && (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockA.name, "__experimentalOnMerge")) {
const blocksWithTheSameType2 = (0,external_wp_blocks_namespaceObject.switchToBlockType)(
blockB,
blockAType.name
);
if (blocksWithTheSameType2?.length !== 1) {
dispatch.selectBlock(blockA.clientId);
return;
}
const [blockWithSameType] = blocksWithTheSameType2;
if (blockWithSameType.innerBlocks.length < 1) {
dispatch.selectBlock(blockA.clientId);
return;
}
registry.batch(() => {
dispatch.insertBlocks(
blockWithSameType.innerBlocks,
void 0,
clientIdA
);
dispatch.removeBlock(clientIdB);
dispatch.selectBlock(
blockWithSameType.innerBlocks[0].clientId
);
const nextBlockClientId = select.getNextBlockClientId(clientIdA);
if (nextBlockClientId && select.getBlockName(clientIdA) === select.getBlockName(nextBlockClientId)) {
const rootAttributes = select.getBlockAttributes(clientIdA);
const previousRootAttributes = select.getBlockAttributes(nextBlockClientId);
if (Object.keys(rootAttributes).every(
(key) => rootAttributes[key] === previousRootAttributes[key]
)) {
dispatch.moveBlocksToPosition(
select.getBlockOrder(nextBlockClientId),
nextBlockClientId,
clientIdA
);
dispatch.removeBlock(nextBlockClientId, false);
}
}
});
return;
}
if ((0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(blockA)) {
dispatch.removeBlock(
clientIdA,
select.isBlockSelected(clientIdA)
);
return;
}
if ((0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(blockB)) {
dispatch.removeBlock(
clientIdB,
select.isBlockSelected(clientIdB)
);
return;
}
if (!blockAType.merge) {
if ((0,external_wp_blocks_namespaceObject.isUnmodifiedBlock)(blockB, "content")) {
dispatch.removeBlock(
clientIdB,
select.isBlockSelected(clientIdB)
);
} else {
dispatch.selectBlock(blockA.clientId);
}
return;
}
const blockBType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockB.name);
const { clientId, attributeKey, offset } = select.getSelectionStart();
const selectedBlockType = clientId === clientIdA ? blockAType : blockBType;
const attributeDefinition = selectedBlockType.attributes[attributeKey];
const canRestoreTextSelection = (clientId === clientIdA || clientId === clientIdB) && attributeKey !== void 0 && offset !== void 0 && // We cannot restore text selection if the RichText identifier
// is not a defined block attribute key. This can be the case if the
// fallback instance ID is used to store selection (and no RichText
// identifier is set), or when the identifier is wrong.
!!attributeDefinition;
if (!attributeDefinition) {
if (typeof attributeKey === "number") {
window.console.error(
`RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was ${typeof attributeKey}`
);
} else {
window.console.error(
"The RichText identifier prop does not match any attributes defined by the block."
);
}
}
const cloneA = (0,external_wp_blocks_namespaceObject.cloneBlock)(blockA);
const cloneB = (0,external_wp_blocks_namespaceObject.cloneBlock)(blockB);
if (canRestoreTextSelection) {
const selectedBlock = clientId === clientIdA ? cloneA : cloneB;
const html = selectedBlock.attributes[attributeKey];
const value = (0,external_wp_richText_namespaceObject.insert)(
(0,external_wp_richText_namespaceObject.create)({ html }),
START_OF_SELECTED_AREA,
offset,
offset
);
selectedBlock.attributes[attributeKey] = (0,external_wp_richText_namespaceObject.toHTMLString)({
value
});
}
const blocksWithTheSameType = blockA.name === blockB.name ? [cloneB] : (0,external_wp_blocks_namespaceObject.switchToBlockType)(cloneB, blockA.name);
if (!blocksWithTheSameType || !blocksWithTheSameType.length) {
return;
}
const updatedAttributes = blockAType.merge(
cloneA.attributes,
blocksWithTheSameType[0].attributes
);
if (canRestoreTextSelection) {
const newAttributeKey = retrieveSelectedAttribute(updatedAttributes);
const convertedHtml = updatedAttributes[newAttributeKey];
const convertedValue = (0,external_wp_richText_namespaceObject.create)({ html: convertedHtml });
const newOffset = convertedValue.text.indexOf(
START_OF_SELECTED_AREA
);
const newValue = (0,external_wp_richText_namespaceObject.remove)(convertedValue, newOffset, newOffset + 1);
const newHtml = (0,external_wp_richText_namespaceObject.toHTMLString)({ value: newValue });
updatedAttributes[newAttributeKey] = newHtml;
dispatch.selectionChange(
blockA.clientId,
newAttributeKey,
newOffset,
newOffset
);
}
dispatch.replaceBlocks(
[blockA.clientId, blockB.clientId],
[
{
...blockA,
attributes: {
...blockA.attributes,
...updatedAttributes
}
},
...blocksWithTheSameType.slice(1)
],
0
// If we don't pass the `indexToSelect` it will default to the last block.
);
};
const removeBlocks = (clientIds, selectPrevious = true) => privateRemoveBlocks(clientIds, selectPrevious);
function removeBlock(clientId, selectPrevious) {
return removeBlocks([clientId], selectPrevious);
}
function replaceInnerBlocks(rootClientId, blocks, updateSelection = false, initialPosition = 0) {
return {
type: "REPLACE_INNER_BLOCKS",
rootClientId,
blocks,
updateSelection,
initialPosition: updateSelection ? initialPosition : null,
time: Date.now()
};
}
function toggleBlockMode(clientId) {
return {
type: "TOGGLE_BLOCK_MODE",
clientId
};
}
function startTyping() {
return {
type: "START_TYPING"
};
}
function stopTyping() {
return {
type: "STOP_TYPING"
};
}
function startDraggingBlocks(clientIds = []) {
return {
type: "START_DRAGGING_BLOCKS",
clientIds
};
}
function stopDraggingBlocks() {
return {
type: "STOP_DRAGGING_BLOCKS"
};
}
function enterFormattedText() {
external_wp_deprecated_default()('wp.data.dispatch( "core/block-editor" ).enterFormattedText', {
since: "6.1",
version: "6.3"
});
return {
type: "DO_NOTHING"
};
}
function exitFormattedText() {
external_wp_deprecated_default()('wp.data.dispatch( "core/block-editor" ).exitFormattedText', {
since: "6.1",
version: "6.3"
});
return {
type: "DO_NOTHING"
};
}
function selectionChange(clientId, attributeKey, startOffset, endOffset) {
if (typeof clientId === "string") {
return {
type: "SELECTION_CHANGE",
clientId,
attributeKey,
startOffset,
endOffset
};
}
return { type: "SELECTION_CHANGE", ...clientId };
}
const insertDefaultBlock = (attributes, rootClientId, index) => ({ dispatch }) => {
const defaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)();
if (!defaultBlockName) {
return;
}
const block = (0,external_wp_blocks_namespaceObject.createBlock)(defaultBlockName, attributes);
return dispatch.insertBlock(block, index, rootClientId);
};
function updateBlockListSettings(clientId, settings) {
return {
type: "UPDATE_BLOCK_LIST_SETTINGS",
clientId,
settings
};
}
function updateSettings(settings) {
return __experimentalUpdateSettings(settings, {
stripExperimentalSettings: true
});
}
function __unstableSaveReusableBlock(id, updatedId) {
return {
type: "SAVE_REUSABLE_BLOCK_SUCCESS",
id,
updatedId
};
}
function __unstableMarkLastChangeAsPersistent() {
return { type: "MARK_LAST_CHANGE_AS_PERSISTENT" };
}
function __unstableMarkNextChangeAsNotPersistent() {
return { type: "MARK_NEXT_CHANGE_AS_NOT_PERSISTENT" };
}
const __unstableMarkAutomaticChange = () => ({ dispatch }) => {
dispatch({ type: "MARK_AUTOMATIC_CHANGE" });
const { requestIdleCallback = (cb) => setTimeout(cb, 100) } = window;
requestIdleCallback(() => {
dispatch({ type: "MARK_AUTOMATIC_CHANGE_FINAL" });
});
};
const __unstableSetEditorMode = (mode) => ({ registry }) => {
registry.dispatch(external_wp_preferences_namespaceObject.store).set("core", "editorTool", mode);
if (mode === "navigation") {
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)("You are currently in Write mode."));
} else if (mode === "edit") {
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)("You are currently in Design mode."));
}
};
function setBlockMovingClientId() {
external_wp_deprecated_default()(
'wp.data.dispatch( "core/block-editor" ).setBlockMovingClientId',
{
since: "6.7",
hint: "Block moving mode feature has been removed"
}
);
return {
type: "DO_NOTHING"
};
}
const duplicateBlocks = (clientIds, updateSelection = true) => ({ select, dispatch }) => {
if (!clientIds || !clientIds.length) {
return;
}
const blocks = select.getBlocksByClientId(clientIds);
if (blocks.some((block) => !block)) {
return;
}
const blockNames = blocks.map((block) => block.name);
if (blockNames.some(
(blockName) => !(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, "multiple", true)
)) {
return;
}
const rootClientId = select.getBlockRootClientId(clientIds[0]);
const clientIdsArray = actions_castArray(clientIds);
const lastSelectedIndex = select.getBlockIndex(
clientIdsArray[clientIdsArray.length - 1]
);
const clonedBlocks = blocks.map(
(block) => (0,external_wp_blocks_namespaceObject.__experimentalCloneSanitizedBlock)(block)
);
dispatch.insertBlocks(
clonedBlocks,
lastSelectedIndex + 1,
rootClientId,
updateSelection
);
if (clonedBlocks.length > 1 && updateSelection) {
dispatch.multiSelect(
clonedBlocks[0].clientId,
clonedBlocks[clonedBlocks.length - 1].clientId
);
}
return clonedBlocks.map((block) => block.clientId);
};
const insertBeforeBlock = (clientId) => ({ select, dispatch }) => {
if (!clientId) {
return;
}
const rootClientId = select.getBlockRootClientId(clientId);
const isLocked = select.getTemplateLock(rootClientId);
if (isLocked) {
return;
}
const blockIndex = select.getBlockIndex(clientId);
const directInsertBlock = rootClientId ? select.getDirectInsertBlock(rootClientId) : null;
if (!directInsertBlock) {
return dispatch.insertDefaultBlock({}, rootClientId, blockIndex);
}
const copiedAttributes = {};
if (directInsertBlock.attributesToCopy) {
const attributes = select.getBlockAttributes(clientId);
directInsertBlock.attributesToCopy.forEach((key) => {
if (attributes[key]) {
copiedAttributes[key] = attributes[key];
}
});
}
const block = (0,external_wp_blocks_namespaceObject.createBlock)(directInsertBlock.name, {
...directInsertBlock.attributes,
...copiedAttributes
});
return dispatch.insertBlock(block, blockIndex, rootClientId);
};
const insertAfterBlock = (clientId) => ({ select, dispatch }) => {
if (!clientId) {
return;
}
const rootClientId = select.getBlockRootClientId(clientId);
const isLocked = select.getTemplateLock(rootClientId);
if (isLocked) {
return;
}
const blockIndex = select.getBlockIndex(clientId);
const directInsertBlock = rootClientId ? select.getDirectInsertBlock(rootClientId) : null;
if (!directInsertBlock) {
return dispatch.insertDefaultBlock(
{},
rootClientId,
blockIndex + 1
);
}
const copiedAttributes = {};
if (directInsertBlock.attributesToCopy) {
const attributes = select.getBlockAttributes(clientId);
directInsertBlock.attributesToCopy.forEach((key) => {
if (attributes[key]) {
copiedAttributes[key] = attributes[key];
}
});
}
const block = (0,external_wp_blocks_namespaceObject.createBlock)(directInsertBlock.name, {
...directInsertBlock.attributes,
...copiedAttributes
});
return dispatch.insertBlock(block, blockIndex + 1, rootClientId);
};
function toggleBlockHighlight(clientId, isHighlighted) {
return {
type: "TOGGLE_BLOCK_HIGHLIGHT",
clientId,
isHighlighted
};
}
const flashBlock = (clientId, timeout = 150) => async ({ dispatch }) => {
dispatch(toggleBlockHighlight(clientId, true));
await new Promise((resolve) => setTimeout(resolve, timeout));
dispatch(toggleBlockHighlight(clientId, false));
};
function setHasControlledInnerBlocks(clientId, hasControlledInnerBlocks) {
return {
type: "SET_HAS_CONTROLLED_INNER_BLOCKS",
hasControlledInnerBlocks,
clientId
};
}
function setBlockVisibility(updates) {
return {
type: "SET_BLOCK_VISIBILITY",
updates
};
}
function __unstableSetTemporarilyEditingAsBlocks(temporarilyEditingAsBlocks, focusModeToRevert) {
return {
type: "SET_TEMPORARILY_EDITING_AS_BLOCKS",
temporarilyEditingAsBlocks,
focusModeToRevert
};
}
const registerInserterMediaCategory = (category) => ({ select, dispatch }) => {
if (!category || typeof category !== "object") {
console.error(
"Category should be an `InserterMediaCategory` object."
);
return;
}
if (!category.name) {
console.error(
"Category should have a `name` that should be unique among all media categories."
);
return;
}
if (!category.labels?.name) {
console.error("Category should have a `labels.name`.");
return;
}
if (!["image", "audio", "video"].includes(category.mediaType)) {
console.error(
"Category should have `mediaType` property that is one of `image|audio|video`."
);
return;
}
if (!category.fetch || typeof category.fetch !== "function") {
console.error(
"Category should have a `fetch` function defined with the following signature `(InserterMediaRequest) => Promise<InserterMediaItem[]>`."
);
return;
}
const registeredInserterMediaCategories = select.getRegisteredInserterMediaCategories();
if (registeredInserterMediaCategories.some(
({ name }) => name === category.name
)) {
console.error(
`A category is already registered with the same name: "${category.name}".`
);
return;
}
if (registeredInserterMediaCategories.some(
({ labels: { name } = {} }) => name === category.labels?.name
)) {
console.error(
`A category is already registered with the same labels.name: "${category.labels.name}".`
);
return;
}
dispatch({
type: "REGISTER_INSERTER_MEDIA_CATEGORY",
category: { ...category, isExternalResource: true }
});
};
function setBlockEditingMode(clientId = "", mode) {
return {
type: "SET_BLOCK_EDITING_MODE",
clientId,
mode
};
}
function unsetBlockEditingMode(clientId = "") {
return {
type: "UNSET_BLOCK_EDITING_MODE",
clientId
};
}
;// ./node_modules/@wordpress/block-editor/build-module/store/index.js
const storeConfig = {
reducer: reducer_default,
selectors: selectors_namespaceObject,
actions: actions_namespaceObject
};
const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
...storeConfig,
persist: ["preferences"]
});
const registeredStore = (0,external_wp_data_namespaceObject.registerStore)(STORE_NAME, {
...storeConfig,
persist: ["preferences"]
});
unlock(registeredStore).registerPrivateActions(private_actions_namespaceObject);
unlock(registeredStore).registerPrivateSelectors(private_selectors_namespaceObject);
unlock(store).registerPrivateActions(private_actions_namespaceObject);
unlock(store).registerPrivateSelectors(private_selectors_namespaceObject);
;// ./node_modules/@wordpress/block-editor/build-module/components/use-settings/index.js
function use_settings_useSettings(...paths) {
const { clientId = null } = useBlockEditContext();
return (0,external_wp_data_namespaceObject.useSelect)(
(select) => unlock(select(store)).getBlockSettings(
clientId,
...paths
),
[clientId, ...paths]
);
}
function useSetting(path) {
external_wp_deprecated_default()("wp.blockEditor.useSetting", {
since: "6.5",
alternative: "wp.blockEditor.useSettings",
note: "The new useSettings function can retrieve multiple settings at once, with better performance."
});
const [value] = use_settings_useSettings(path);
return value;
}
;// external ["wp","styleEngine"]
const external_wp_styleEngine_namespaceObject = window["wp"]["styleEngine"];
;// ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/fluid-utils.js
const DEFAULT_MAXIMUM_VIEWPORT_WIDTH = "1600px";
const DEFAULT_MINIMUM_VIEWPORT_WIDTH = "320px";
const DEFAULT_SCALE_FACTOR = 1;
const DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MIN = 0.25;
const DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MAX = 0.75;
const DEFAULT_MINIMUM_FONT_SIZE_LIMIT = "14px";
function getComputedFluidTypographyValue({
minimumFontSize,
maximumFontSize,
fontSize,
minimumViewportWidth = DEFAULT_MINIMUM_VIEWPORT_WIDTH,
maximumViewportWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH,
scaleFactor = DEFAULT_SCALE_FACTOR,
minimumFontSizeLimit
}) {
minimumFontSizeLimit = !!getTypographyValueAndUnit(minimumFontSizeLimit) ? minimumFontSizeLimit : DEFAULT_MINIMUM_FONT_SIZE_LIMIT;
if (fontSize) {
const fontSizeParsed = getTypographyValueAndUnit(fontSize);
if (!fontSizeParsed?.unit) {
return null;
}
const minimumFontSizeLimitParsed = getTypographyValueAndUnit(
minimumFontSizeLimit,
{
coerceTo: fontSizeParsed.unit
}
);
if (!!minimumFontSizeLimitParsed?.value && !minimumFontSize && !maximumFontSize) {
if (fontSizeParsed?.value <= minimumFontSizeLimitParsed?.value) {
return null;
}
}
if (!maximumFontSize) {
maximumFontSize = `${fontSizeParsed.value}${fontSizeParsed.unit}`;
}
if (!minimumFontSize) {
const fontSizeValueInPx = fontSizeParsed.unit === "px" ? fontSizeParsed.value : fontSizeParsed.value * 16;
const minimumFontSizeFactor = Math.min(
Math.max(
1 - 0.075 * Math.log2(fontSizeValueInPx),
DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MIN
),
DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MAX
);
const calculatedMinimumFontSize = roundToPrecision(
fontSizeParsed.value * minimumFontSizeFactor,
3
);
if (!!minimumFontSizeLimitParsed?.value && calculatedMinimumFontSize < minimumFontSizeLimitParsed?.value) {
minimumFontSize = `${minimumFontSizeLimitParsed.value}${minimumFontSizeLimitParsed.unit}`;
} else {
minimumFontSize = `${calculatedMinimumFontSize}${fontSizeParsed.unit}`;
}
}
}
const minimumFontSizeParsed = getTypographyValueAndUnit(minimumFontSize);
const fontSizeUnit = minimumFontSizeParsed?.unit || "rem";
const maximumFontSizeParsed = getTypographyValueAndUnit(maximumFontSize, {
coerceTo: fontSizeUnit
});
if (!minimumFontSizeParsed || !maximumFontSizeParsed) {
return null;
}
const minimumFontSizeRem = getTypographyValueAndUnit(minimumFontSize, {
coerceTo: "rem"
});
const maximumViewportWidthParsed = getTypographyValueAndUnit(
maximumViewportWidth,
{ coerceTo: fontSizeUnit }
);
const minimumViewportWidthParsed = getTypographyValueAndUnit(
minimumViewportWidth,
{ coerceTo: fontSizeUnit }
);
if (!maximumViewportWidthParsed || !minimumViewportWidthParsed || !minimumFontSizeRem) {
return null;
}
const linearDenominator = maximumViewportWidthParsed.value - minimumViewportWidthParsed.value;
if (!linearDenominator) {
return null;
}
const minViewportWidthOffsetValue = roundToPrecision(
minimumViewportWidthParsed.value / 100,
3
);
const viewportWidthOffset = roundToPrecision(minViewportWidthOffsetValue, 3) + fontSizeUnit;
const linearFactor = 100 * ((maximumFontSizeParsed.value - minimumFontSizeParsed.value) / linearDenominator);
const linearFactorScaled = roundToPrecision(
(linearFactor || 1) * scaleFactor,
3
);
const fluidTargetFontSize = `${minimumFontSizeRem.value}${minimumFontSizeRem.unit} + ((1vw - ${viewportWidthOffset}) * ${linearFactorScaled})`;
return `clamp(${minimumFontSize}, ${fluidTargetFontSize}, ${maximumFontSize})`;
}
function getTypographyValueAndUnit(rawValue, options = {}) {
if (typeof rawValue !== "string" && typeof rawValue !== "number") {
return null;
}
if (isFinite(rawValue)) {
rawValue = `${rawValue}px`;
}
const { coerceTo, rootSizeValue, acceptableUnits } = {
coerceTo: "",
// Default browser font size. Later we could inject some JS to compute this `getComputedStyle( document.querySelector( "html" ) ).fontSize`.
rootSizeValue: 16,
acceptableUnits: ["rem", "px", "em"],
...options
};
const acceptableUnitsGroup = acceptableUnits?.join("|");
const regexUnits = new RegExp(
`^(\\d*\\.?\\d+)(${acceptableUnitsGroup}){1,1}$`
);
const matches = rawValue.match(regexUnits);
if (!matches || matches.length < 3) {
return null;
}
let [, value, unit] = matches;
let returnValue = parseFloat(value);
if ("px" === coerceTo && ("em" === unit || "rem" === unit)) {
returnValue = returnValue * rootSizeValue;
unit = coerceTo;
}
if ("px" === unit && ("em" === coerceTo || "rem" === coerceTo)) {
returnValue = returnValue / rootSizeValue;
unit = coerceTo;
}
if (("em" === coerceTo || "rem" === coerceTo) && ("em" === unit || "rem" === unit)) {
unit = coerceTo;
}
return {
value: roundToPrecision(returnValue, 3),
unit
};
}
function roundToPrecision(value, digits = 3) {
const base = Math.pow(10, digits);
return Number.isFinite(value) ? parseFloat(Math.round(value * base) / base) : void 0;
}
;// ./node_modules/@wordpress/block-editor/build-module/utils/format-font-style.js
function formatFontStyle(fontStyle) {
if (!fontStyle) {
return {};
}
if (typeof fontStyle === "object") {
return fontStyle;
}
let name;
switch (fontStyle) {
case "normal":
name = (0,external_wp_i18n_namespaceObject._x)("Regular", "font style");
break;
case "italic":
name = (0,external_wp_i18n_namespaceObject._x)("Italic", "font style");
break;
case "oblique":
name = (0,external_wp_i18n_namespaceObject._x)("Oblique", "font style");
break;
default:
name = fontStyle;
break;
}
return { name, value: fontStyle };
}
;// ./node_modules/@wordpress/block-editor/build-module/utils/format-font-weight.js
function formatFontWeight(fontWeight) {
if (!fontWeight) {
return {};
}
if (typeof fontWeight === "object") {
return fontWeight;
}
let name;
switch (fontWeight) {
case "normal":
case "400":
name = (0,external_wp_i18n_namespaceObject._x)("Regular", "font weight");
break;
case "bold":
case "700":
name = (0,external_wp_i18n_namespaceObject._x)("Bold", "font weight");
break;
case "100":
name = (0,external_wp_i18n_namespaceObject._x)("Thin", "font weight");
break;
case "200":
name = (0,external_wp_i18n_namespaceObject._x)("Extra Light", "font weight");
break;
case "300":
name = (0,external_wp_i18n_namespaceObject._x)("Light", "font weight");
break;
case "500":
name = (0,external_wp_i18n_namespaceObject._x)("Medium", "font weight");
break;
case "600":
name = (0,external_wp_i18n_namespaceObject._x)("Semi Bold", "font weight");
break;
case "800":
name = (0,external_wp_i18n_namespaceObject._x)("Extra Bold", "font weight");
break;
case "900":
name = (0,external_wp_i18n_namespaceObject._x)("Black", "font weight");
break;
case "1000":
name = (0,external_wp_i18n_namespaceObject._x)("Extra Black", "font weight");
break;
default:
name = fontWeight;
break;
}
return { name, value: fontWeight };
}
;// ./node_modules/@wordpress/block-editor/build-module/utils/get-font-styles-and-weights.js
const FONT_STYLES = [
{
name: (0,external_wp_i18n_namespaceObject._x)("Regular", "font style"),
value: "normal"
},
{
name: (0,external_wp_i18n_namespaceObject._x)("Italic", "font style"),
value: "italic"
}
];
const FONT_WEIGHTS = [
{
name: (0,external_wp_i18n_namespaceObject._x)("Thin", "font weight"),
value: "100"
},
{
name: (0,external_wp_i18n_namespaceObject._x)("Extra Light", "font weight"),
value: "200"
},
{
name: (0,external_wp_i18n_namespaceObject._x)("Light", "font weight"),
value: "300"
},
{
name: (0,external_wp_i18n_namespaceObject._x)("Regular", "font weight"),
value: "400"
},
{
name: (0,external_wp_i18n_namespaceObject._x)("Medium", "font weight"),
value: "500"
},
{
name: (0,external_wp_i18n_namespaceObject._x)("Semi Bold", "font weight"),
value: "600"
},
{
name: (0,external_wp_i18n_namespaceObject._x)("Bold", "font weight"),
value: "700"
},
{
name: (0,external_wp_i18n_namespaceObject._x)("Extra Bold", "font weight"),
value: "800"
},
{
name: (0,external_wp_i18n_namespaceObject._x)("Black", "font weight"),
value: "900"
},
{
name: (0,external_wp_i18n_namespaceObject._x)("Extra Black", "font weight"),
value: "1000"
}
];
function getFontStylesAndWeights(fontFamilyFaces) {
let fontStyles = [];
let fontWeights = [];
const combinedStyleAndWeightOptions = [];
const isSystemFont = !fontFamilyFaces || fontFamilyFaces?.length === 0;
let isVariableFont = false;
fontFamilyFaces?.forEach((face) => {
if ("string" === typeof face.fontWeight && /\s/.test(face.fontWeight.trim())) {
isVariableFont = true;
let [startValue, endValue] = face.fontWeight.split(" ");
startValue = parseInt(startValue.slice(0, 1));
if (endValue === "1000") {
endValue = 10;
} else {
endValue = parseInt(endValue.slice(0, 1));
}
for (let i = startValue; i <= endValue; i++) {
const fontWeightValue = `${i.toString()}00`;
if (!fontWeights.some(
(weight) => weight.value === fontWeightValue
)) {
fontWeights.push(formatFontWeight(fontWeightValue));
}
}
}
const fontWeight = formatFontWeight(
"number" === typeof face.fontWeight ? face.fontWeight.toString() : face.fontWeight
);
const fontStyle = formatFontStyle(face.fontStyle);
if (fontStyle && Object.keys(fontStyle).length) {
if (!fontStyles.some(
(style) => style.value === fontStyle.value
)) {
fontStyles.push(fontStyle);
}
}
if (fontWeight && Object.keys(fontWeight).length) {
if (!fontWeights.some(
(weight) => weight.value === fontWeight.value
)) {
if (!isVariableFont) {
fontWeights.push(fontWeight);
}
}
}
});
if (!fontWeights.some((weight) => weight.value >= "600")) {
fontWeights.push({
name: (0,external_wp_i18n_namespaceObject._x)("Bold", "font weight"),
value: "700"
});
}
if (!fontStyles.some((style) => style.value === "italic")) {
fontStyles.push({
name: (0,external_wp_i18n_namespaceObject._x)("Italic", "font style"),
value: "italic"
});
}
if (isSystemFont) {
fontStyles = FONT_STYLES;
fontWeights = FONT_WEIGHTS;
}
fontStyles = fontStyles.length === 0 ? FONT_STYLES : fontStyles;
fontWeights = fontWeights.length === 0 ? FONT_WEIGHTS : fontWeights;
fontStyles.forEach(({ name: styleName, value: styleValue }) => {
fontWeights.forEach(({ name: weightName, value: weightValue }) => {
const optionName = styleValue === "normal" ? weightName : (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Font weight name. 2: Font style name. */
(0,external_wp_i18n_namespaceObject._x)("%1$s %2$s", "font"),
weightName,
styleName
);
combinedStyleAndWeightOptions.push({
key: `${styleValue}-${weightValue}`,
name: optionName,
style: {
fontStyle: styleValue,
fontWeight: weightValue
}
});
});
});
return {
fontStyles,
fontWeights,
combinedStyleAndWeightOptions,
isSystemFont,
isVariableFont
};
}
;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/typography-utils.js
function getTypographyFontSizeValue(preset, settings) {
const { size: defaultSize } = preset;
if (!defaultSize || "0" === defaultSize || false === preset?.fluid) {
return defaultSize;
}
if (!isFluidTypographyEnabled(settings?.typography) && !isFluidTypographyEnabled(preset)) {
return defaultSize;
}
let fluidTypographySettings = getFluidTypographyOptionsFromSettings(settings);
fluidTypographySettings = typeof fluidTypographySettings?.fluid === "object" ? fluidTypographySettings?.fluid : {};
const fluidFontSizeValue = getComputedFluidTypographyValue({
minimumFontSize: preset?.fluid?.min,
maximumFontSize: preset?.fluid?.max,
fontSize: defaultSize,
minimumFontSizeLimit: fluidTypographySettings?.minFontSize,
maximumViewportWidth: fluidTypographySettings?.maxViewportWidth,
minimumViewportWidth: fluidTypographySettings?.minViewportWidth
});
if (!!fluidFontSizeValue) {
return fluidFontSizeValue;
}
return defaultSize;
}
function isFluidTypographyEnabled(typographySettings) {
const fluidSettings = typographySettings?.fluid;
return true === fluidSettings || fluidSettings && typeof fluidSettings === "object" && Object.keys(fluidSettings).length > 0;
}
function getFluidTypographyOptionsFromSettings(settings) {
const typographySettings = settings?.typography;
const layoutSettings = settings?.layout;
const defaultMaxViewportWidth = getTypographyValueAndUnit(
layoutSettings?.wideSize
) ? layoutSettings?.wideSize : null;
return isFluidTypographyEnabled(typographySettings) && defaultMaxViewportWidth ? {
fluid: {
maxViewportWidth: defaultMaxViewportWidth,
...typographySettings.fluid
}
} : {
fluid: typographySettings?.fluid
};
}
function getMergedFontFamiliesAndFontFamilyFaces(settings, selectedFontFamily) {
const fontFamiliesFromSettings = settings?.typography?.fontFamilies;
const fontFamilies = ["default", "theme", "custom"].flatMap(
(key) => fontFamiliesFromSettings?.[key] ?? []
);
const fontFamilyFaces = fontFamilies.find(
(family) => family.fontFamily === selectedFontFamily
)?.fontFace ?? [];
return { fontFamilies, fontFamilyFaces };
}
function findNearestFontWeight(availableFontWeights, newFontWeightValue) {
newFontWeightValue = "number" === typeof newFontWeightValue ? newFontWeightValue.toString() : newFontWeightValue;
if (!newFontWeightValue || typeof newFontWeightValue !== "string") {
return "";
}
if (!availableFontWeights || availableFontWeights.length === 0) {
return newFontWeightValue;
}
const nearestFontWeight = availableFontWeights?.reduce(
(nearest, { value: fw }) => {
const currentDiff = Math.abs(
parseInt(fw) - parseInt(newFontWeightValue)
);
const nearestDiff = Math.abs(
parseInt(nearest) - parseInt(newFontWeightValue)
);
return currentDiff < nearestDiff ? fw : nearest;
},
availableFontWeights[0]?.value
);
return nearestFontWeight;
}
function findNearestFontStyle(availableFontStyles, newFontStyleValue) {
if (typeof newFontStyleValue !== "string" || !newFontStyleValue) {
return "";
}
const validStyles = ["normal", "italic", "oblique"];
if (!validStyles.includes(newFontStyleValue)) {
return "";
}
if (!availableFontStyles || availableFontStyles.length === 0 || availableFontStyles.find(
(style) => style.value === newFontStyleValue
)) {
return newFontStyleValue;
}
if (newFontStyleValue === "oblique" && !availableFontStyles.find((style) => style.value === "oblique")) {
return "italic";
}
return "";
}
function findNearestStyleAndWeight(fontFamilyFaces, fontStyle, fontWeight) {
let nearestFontStyle = fontStyle;
let nearestFontWeight = fontWeight;
const { fontStyles, fontWeights, combinedStyleAndWeightOptions } = getFontStylesAndWeights(fontFamilyFaces);
const hasFontStyle = fontStyles?.some(
({ value: fs }) => fs === fontStyle
);
const hasFontWeight = fontWeights?.some(
({ value: fw }) => fw?.toString() === fontWeight?.toString()
);
if (!hasFontStyle) {
nearestFontStyle = fontStyle ? findNearestFontStyle(fontStyles, fontStyle) : combinedStyleAndWeightOptions?.find(
(option) => option.style.fontWeight === findNearestFontWeight(fontWeights, fontWeight)
)?.style?.fontStyle;
}
if (!hasFontWeight) {
nearestFontWeight = fontWeight ? findNearestFontWeight(fontWeights, fontWeight) : combinedStyleAndWeightOptions?.find(
(option) => option.style.fontStyle === (nearestFontStyle || fontStyle)
)?.style?.fontWeight;
}
return { nearestFontStyle, nearestFontWeight };
}
;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/utils.js
const ROOT_BLOCK_SELECTOR = "body";
const ROOT_CSS_PROPERTIES_SELECTOR = ":root";
const PRESET_METADATA = [
{
path: ["color", "palette"],
valueKey: "color",
cssVarInfix: "color",
classes: [
{ classSuffix: "color", propertyName: "color" },
{
classSuffix: "background-color",
propertyName: "background-color"
},
{
classSuffix: "border-color",
propertyName: "border-color"
}
]
},
{
path: ["color", "gradients"],
valueKey: "gradient",
cssVarInfix: "gradient",
classes: [
{
classSuffix: "gradient-background",
propertyName: "background"
}
]
},
{
path: ["color", "duotone"],
valueKey: "colors",
cssVarInfix: "duotone",
valueFunc: ({ slug }) => `url( '#wp-duotone-${slug}' )`,
classes: []
},
{
path: ["shadow", "presets"],
valueKey: "shadow",
cssVarInfix: "shadow",
classes: []
},
{
path: ["typography", "fontSizes"],
valueFunc: (preset, settings) => getTypographyFontSizeValue(preset, settings),
valueKey: "size",
cssVarInfix: "font-size",
classes: [{ classSuffix: "font-size", propertyName: "font-size" }]
},
{
path: ["typography", "fontFamilies"],
valueKey: "fontFamily",
cssVarInfix: "font-family",
classes: [
{ classSuffix: "font-family", propertyName: "font-family" }
]
},
{
path: ["spacing", "spacingSizes"],
valueKey: "size",
cssVarInfix: "spacing",
classes: []
},
{
path: ["border", "radiusSizes"],
valueKey: "size",
cssVarInfix: "border-radius",
classes: []
}
];
const STYLE_PATH_TO_CSS_VAR_INFIX = {
"color.background": "color",
"color.text": "color",
"filter.duotone": "duotone",
"elements.link.color.text": "color",
"elements.link.:hover.color.text": "color",
"elements.link.typography.fontFamily": "font-family",
"elements.link.typography.fontSize": "font-size",
"elements.button.color.text": "color",
"elements.button.color.background": "color",
"elements.caption.color.text": "color",
"elements.button.typography.fontFamily": "font-family",
"elements.button.typography.fontSize": "font-size",
"elements.heading.color": "color",
"elements.heading.color.background": "color",
"elements.heading.typography.fontFamily": "font-family",
"elements.heading.gradient": "gradient",
"elements.heading.color.gradient": "gradient",
"elements.h1.color": "color",
"elements.h1.color.background": "color",
"elements.h1.typography.fontFamily": "font-family",
"elements.h1.color.gradient": "gradient",
"elements.h2.color": "color",
"elements.h2.color.background": "color",
"elements.h2.typography.fontFamily": "font-family",
"elements.h2.color.gradient": "gradient",
"elements.h3.color": "color",
"elements.h3.color.background": "color",
"elements.h3.typography.fontFamily": "font-family",
"elements.h3.color.gradient": "gradient",
"elements.h4.color": "color",
"elements.h4.color.background": "color",
"elements.h4.typography.fontFamily": "font-family",
"elements.h4.color.gradient": "gradient",
"elements.h5.color": "color",
"elements.h5.color.background": "color",
"elements.h5.typography.fontFamily": "font-family",
"elements.h5.color.gradient": "gradient",
"elements.h6.color": "color",
"elements.h6.color.background": "color",
"elements.h6.typography.fontFamily": "font-family",
"elements.h6.color.gradient": "gradient",
"color.gradient": "gradient",
shadow: "shadow",
"typography.fontSize": "font-size",
"typography.fontFamily": "font-family"
};
const STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {
"color.background": "backgroundColor",
"color.text": "textColor",
"color.gradient": "gradient",
"typography.fontSize": "fontSize",
"typography.fontFamily": "fontFamily"
};
function useToolsPanelDropdownMenuProps() {
const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
return !isMobile ? {
popoverProps: {
placement: "left-start",
// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)
offset: 259
}
} : {};
}
function findInPresetsBy(features, blockName, presetPath, presetProperty, presetValueValue) {
const orderedPresetsByOrigin = [
getValueFromObjectPath(features, [
"blocks",
blockName,
...presetPath
]),
getValueFromObjectPath(features, presetPath)
];
for (const presetByOrigin of orderedPresetsByOrigin) {
if (presetByOrigin) {
const origins = ["custom", "theme", "default"];
for (const origin of origins) {
const presets = presetByOrigin[origin];
if (presets) {
const presetObject = presets.find(
(preset) => preset[presetProperty] === presetValueValue
);
if (presetObject) {
if (presetProperty === "slug") {
return presetObject;
}
const highestPresetObjectWithSameSlug = findInPresetsBy(
features,
blockName,
presetPath,
"slug",
presetObject.slug
);
if (highestPresetObjectWithSameSlug[presetProperty] === presetObject[presetProperty]) {
return presetObject;
}
return void 0;
}
}
}
}
}
}
function getPresetVariableFromValue(features, blockName, variableStylePath, presetPropertyValue) {
if (!presetPropertyValue) {
return presetPropertyValue;
}
const cssVarInfix = STYLE_PATH_TO_CSS_VAR_INFIX[variableStylePath];
const metadata = PRESET_METADATA.find(
(data) => data.cssVarInfix === cssVarInfix
);
if (!metadata) {
return presetPropertyValue;
}
const { valueKey, path } = metadata;
const presetObject = findInPresetsBy(
features,
blockName,
path,
valueKey,
presetPropertyValue
);
if (!presetObject) {
return presetPropertyValue;
}
return `var:preset|${cssVarInfix}|${presetObject.slug}`;
}
function getValueFromPresetVariable(features, blockName, variable, [presetType, slug]) {
const metadata = PRESET_METADATA.find(
(data) => data.cssVarInfix === presetType
);
if (!metadata) {
return variable;
}
const presetObject = findInPresetsBy(
features.settings,
blockName,
metadata.path,
"slug",
slug
);
if (presetObject) {
const { valueKey } = metadata;
const result = presetObject[valueKey];
return getValueFromVariable(features, blockName, result);
}
return variable;
}
function getValueFromCustomVariable(features, blockName, variable, path) {
const result = getValueFromObjectPath(features.settings, [
"blocks",
blockName,
"custom",
...path
]) ?? getValueFromObjectPath(features.settings, ["custom", ...path]);
if (!result) {
return variable;
}
return getValueFromVariable(features, blockName, result);
}
function getValueFromVariable(features, blockName, variable) {
if (!variable || typeof variable !== "string") {
if (typeof variable?.ref === "string") {
variable = getValueFromObjectPath(features, variable.ref);
if (!variable || !!variable?.ref) {
return variable;
}
} else {
return variable;
}
}
const USER_VALUE_PREFIX = "var:";
const THEME_VALUE_PREFIX = "var(--wp--";
const THEME_VALUE_SUFFIX = ")";
let parsedVar;
if (variable.startsWith(USER_VALUE_PREFIX)) {
parsedVar = variable.slice(USER_VALUE_PREFIX.length).split("|");
} else if (variable.startsWith(THEME_VALUE_PREFIX) && variable.endsWith(THEME_VALUE_SUFFIX)) {
parsedVar = variable.slice(THEME_VALUE_PREFIX.length, -THEME_VALUE_SUFFIX.length).split("--");
} else {
return variable;
}
const [type, ...path] = parsedVar;
if (type === "preset") {
return getValueFromPresetVariable(
features,
blockName,
variable,
path
);
}
if (type === "custom") {
return getValueFromCustomVariable(
features,
blockName,
variable,
path
);
}
return variable;
}
function scopeSelector(scope, selector) {
if (!scope || !selector) {
return selector;
}
const scopes = scope.split(",");
const selectors = selector.split(",");
const selectorsScoped = [];
scopes.forEach((outer) => {
selectors.forEach((inner) => {
selectorsScoped.push(`${outer.trim()} ${inner.trim()}`);
});
});
return selectorsScoped.join(", ");
}
function scopeFeatureSelectors(scope, selectors) {
if (!scope || !selectors) {
return;
}
const featureSelectors = {};
Object.entries(selectors).forEach(([feature, selector]) => {
if (typeof selector === "string") {
featureSelectors[feature] = scopeSelector(scope, selector);
}
if (typeof selector === "object") {
featureSelectors[feature] = {};
Object.entries(selector).forEach(
([subfeature, subfeatureSelector]) => {
featureSelectors[feature][subfeature] = scopeSelector(
scope,
subfeatureSelector
);
}
);
}
});
return featureSelectors;
}
function appendToSelector(selector, toAppend) {
if (!selector.includes(",")) {
return selector + toAppend;
}
const selectors = selector.split(",");
const newSelectors = selectors.map((sel) => sel + toAppend);
return newSelectors.join(",");
}
function areGlobalStyleConfigsEqual(original, variation) {
if (typeof original !== "object" || typeof variation !== "object") {
return original === variation;
}
return es6_default()(original?.styles, variation?.styles) && es6_default()(original?.settings, variation?.settings);
}
function getBlockStyleVariationSelector(variation, blockSelector) {
const variationClass = `.is-style-${variation}`;
if (!blockSelector) {
return variationClass;
}
const ancestorRegex = /((?::\([^)]+\))?\s*)([^\s:]+)/;
const addVariationClass = (_match, group1, group2) => {
return group1 + group2 + variationClass;
};
const result = blockSelector.split(",").map((part) => part.replace(ancestorRegex, addVariationClass));
return result.join(",");
}
function getResolvedThemeFilePath(file, themeFileURIs) {
if (!file || !themeFileURIs || !Array.isArray(themeFileURIs)) {
return file;
}
const uri = themeFileURIs.find(
(themeFileUri) => themeFileUri?.name === file
);
if (!uri?.href) {
return file;
}
return uri?.href;
}
function getResolvedRefValue(ruleValue, tree) {
if (!ruleValue || !tree) {
return ruleValue;
}
if (typeof ruleValue !== "string" && ruleValue?.ref) {
const resolvedRuleValue = (0,external_wp_styleEngine_namespaceObject.getCSSValueFromRawStyle)(
getValueFromObjectPath(tree, ruleValue.ref)
);
if (resolvedRuleValue?.ref) {
return void 0;
}
if (resolvedRuleValue === void 0) {
return ruleValue;
}
return resolvedRuleValue;
}
return ruleValue;
}
function getResolvedValue(ruleValue, tree) {
if (!ruleValue || !tree) {
return ruleValue;
}
const resolvedValue = getResolvedRefValue(ruleValue, tree);
if (resolvedValue?.url) {
resolvedValue.url = getResolvedThemeFilePath(
resolvedValue.url,
tree?._links?.["wp:theme-file"]
);
}
return resolvedValue;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/context.js
const DEFAULT_GLOBAL_STYLES_CONTEXT = {
user: {},
base: {},
merged: {},
setUserConfig: () => {
}
};
const GlobalStylesContext = (0,external_wp_element_namespaceObject.createContext)(
DEFAULT_GLOBAL_STYLES_CONTEXT
);
GlobalStylesContext.displayName = "GlobalStylesContext";
;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/hooks.js
const EMPTY_CONFIG = { settings: {}, styles: {} };
const VALID_SETTINGS = [
"appearanceTools",
"useRootPaddingAwareAlignments",
"background.backgroundImage",
"background.backgroundRepeat",
"background.backgroundSize",
"background.backgroundPosition",
"border.color",
"border.radius",
"border.style",
"border.width",
"border.radiusSizes",
"shadow.presets",
"shadow.defaultPresets",
"color.background",
"color.button",
"color.caption",
"color.custom",
"color.customDuotone",
"color.customGradient",
"color.defaultDuotone",
"color.defaultGradients",
"color.defaultPalette",
"color.duotone",
"color.gradients",
"color.heading",
"color.link",
"color.palette",
"color.text",
"custom",
"dimensions.aspectRatio",
"dimensions.minHeight",
"layout.contentSize",
"layout.definitions",
"layout.wideSize",
"lightbox.enabled",
"lightbox.allowEditing",
"position.fixed",
"position.sticky",
"spacing.customSpacingSize",
"spacing.defaultSpacingSizes",
"spacing.spacingSizes",
"spacing.spacingScale",
"spacing.blockGap",
"spacing.margin",
"spacing.padding",
"spacing.units",
"typography.fluid",
"typography.customFontSize",
"typography.defaultFontSizes",
"typography.dropCap",
"typography.fontFamilies",
"typography.fontSizes",
"typography.fontStyle",
"typography.fontWeight",
"typography.letterSpacing",
"typography.lineHeight",
"typography.textAlign",
"typography.textColumns",
"typography.textDecoration",
"typography.textTransform",
"typography.writingMode"
];
const useGlobalStylesReset = () => {
const { user, setUserConfig } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext);
const config = {
settings: user.settings,
styles: user.styles
};
const canReset = !!config && !es6_default()(config, EMPTY_CONFIG);
return [
canReset,
(0,external_wp_element_namespaceObject.useCallback)(() => setUserConfig(EMPTY_CONFIG), [setUserConfig])
];
};
function useGlobalSetting(propertyPath, blockName, source = "all") {
const { setUserConfig, ...configs } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext);
const appendedBlockPath = blockName ? ".blocks." + blockName : "";
const appendedPropertyPath = propertyPath ? "." + propertyPath : "";
const contextualPath = `settings${appendedBlockPath}${appendedPropertyPath}`;
const globalPath = `settings${appendedPropertyPath}`;
const sourceKey = source === "all" ? "merged" : source;
const settingValue = (0,external_wp_element_namespaceObject.useMemo)(() => {
const configToUse = configs[sourceKey];
if (!configToUse) {
throw "Unsupported source";
}
if (propertyPath) {
return getValueFromObjectPath(configToUse, contextualPath) ?? getValueFromObjectPath(configToUse, globalPath);
}
let result = {};
VALID_SETTINGS.forEach((setting) => {
const value = getValueFromObjectPath(
configToUse,
`settings${appendedBlockPath}.${setting}`
) ?? getValueFromObjectPath(configToUse, `settings.${setting}`);
if (value !== void 0) {
result = setImmutably(result, setting.split("."), value);
}
});
return result;
}, [
configs,
sourceKey,
propertyPath,
contextualPath,
globalPath,
appendedBlockPath
]);
const setSetting = (newValue) => {
setUserConfig(
(currentConfig) => setImmutably(currentConfig, contextualPath.split("."), newValue)
);
};
return [settingValue, setSetting];
}
function useGlobalStyle(path, blockName, source = "all", { shouldDecodeEncode = true } = {}) {
const {
merged: mergedConfig,
base: baseConfig,
user: userConfig,
setUserConfig
} = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext);
const appendedPath = path ? "." + path : "";
const finalPath = !blockName ? `styles${appendedPath}` : `styles.blocks.${blockName}${appendedPath}`;
const setStyle = (newValue) => {
setUserConfig(
(currentConfig) => setImmutably(
currentConfig,
finalPath.split("."),
shouldDecodeEncode ? getPresetVariableFromValue(
mergedConfig.settings,
blockName,
path,
newValue
) : newValue
)
);
};
let rawResult, result;
switch (source) {
case "all":
rawResult = getValueFromObjectPath(mergedConfig, finalPath);
result = shouldDecodeEncode ? getValueFromVariable(mergedConfig, blockName, rawResult) : rawResult;
break;
case "user":
rawResult = getValueFromObjectPath(userConfig, finalPath);
result = shouldDecodeEncode ? getValueFromVariable(mergedConfig, blockName, rawResult) : rawResult;
break;
case "base":
rawResult = getValueFromObjectPath(baseConfig, finalPath);
result = shouldDecodeEncode ? getValueFromVariable(baseConfig, blockName, rawResult) : rawResult;
break;
default:
throw "Unsupported source";
}
return [result, setStyle];
}
function useSettingsForBlockElement(parentSettings, blockName, element) {
const { supportedStyles, supports } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
return {
supportedStyles: unlock(
select(external_wp_blocks_namespaceObject.store)
).getSupportedStyles(blockName, element),
supports: select(external_wp_blocks_namespaceObject.store).getBlockType(blockName)?.supports
};
},
[blockName, element]
);
return (0,external_wp_element_namespaceObject.useMemo)(() => {
const updatedSettings = { ...parentSettings };
if (!supportedStyles.includes("fontSize")) {
updatedSettings.typography = {
...updatedSettings.typography,
fontSizes: {},
customFontSize: false,
defaultFontSizes: false
};
}
if (!supportedStyles.includes("fontFamily")) {
updatedSettings.typography = {
...updatedSettings.typography,
fontFamilies: {}
};
}
updatedSettings.color = {
...updatedSettings.color,
text: updatedSettings.color?.text && supportedStyles.includes("color"),
background: updatedSettings.color?.background && (supportedStyles.includes("background") || supportedStyles.includes("backgroundColor")),
button: updatedSettings.color?.button && supportedStyles.includes("buttonColor"),
heading: updatedSettings.color?.heading && supportedStyles.includes("headingColor"),
link: updatedSettings.color?.link && supportedStyles.includes("linkColor"),
caption: updatedSettings.color?.caption && supportedStyles.includes("captionColor")
};
if (!supportedStyles.includes("background")) {
updatedSettings.color.gradients = [];
updatedSettings.color.customGradient = false;
}
if (!supportedStyles.includes("filter")) {
updatedSettings.color.defaultDuotone = false;
updatedSettings.color.customDuotone = false;
}
[
"lineHeight",
"fontStyle",
"fontWeight",
"letterSpacing",
"textAlign",
"textTransform",
"textDecoration",
"writingMode"
].forEach((key) => {
if (!supportedStyles.includes(key)) {
updatedSettings.typography = {
...updatedSettings.typography,
[key]: false
};
}
});
if (!supportedStyles.includes("columnCount")) {
updatedSettings.typography = {
...updatedSettings.typography,
textColumns: false
};
}
["contentSize", "wideSize"].forEach((key) => {
if (!supportedStyles.includes(key)) {
updatedSettings.layout = {
...updatedSettings.layout,
[key]: false
};
}
});
["padding", "margin", "blockGap"].forEach((key) => {
if (!supportedStyles.includes(key)) {
updatedSettings.spacing = {
...updatedSettings.spacing,
[key]: false
};
}
const sides = Array.isArray(supports?.spacing?.[key]) ? supports?.spacing?.[key] : supports?.spacing?.[key]?.sides;
if (sides?.length && updatedSettings.spacing?.[key]) {
updatedSettings.spacing = {
...updatedSettings.spacing,
[key]: {
...updatedSettings.spacing?.[key],
sides
}
};
}
});
["aspectRatio", "minHeight"].forEach((key) => {
if (!supportedStyles.includes(key)) {
updatedSettings.dimensions = {
...updatedSettings.dimensions,
[key]: false
};
}
});
["radius", "color", "style", "width"].forEach((key) => {
if (!supportedStyles.includes(
"border" + key.charAt(0).toUpperCase() + key.slice(1)
)) {
updatedSettings.border = {
...updatedSettings.border,
[key]: false
};
}
});
["backgroundImage", "backgroundSize"].forEach((key) => {
if (!supportedStyles.includes(key)) {
updatedSettings.background = {
...updatedSettings.background,
[key]: false
};
}
});
updatedSettings.shadow = supportedStyles.includes("shadow") ? updatedSettings.shadow : false;
if (element) {
updatedSettings.typography.textAlign = false;
}
return updatedSettings;
}, [parentSettings, supportedStyles, supports, element]);
}
function useColorsPerOrigin(settings) {
const customColors = settings?.color?.palette?.custom;
const themeColors = settings?.color?.palette?.theme;
const defaultColors = settings?.color?.palette?.default;
const shouldDisplayDefaultColors = settings?.color?.defaultPalette;
return (0,external_wp_element_namespaceObject.useMemo)(() => {
const result = [];
if (themeColors && themeColors.length) {
result.push({
name: (0,external_wp_i18n_namespaceObject._x)(
"Theme",
"Indicates this palette comes from the theme."
),
colors: themeColors
});
}
if (shouldDisplayDefaultColors && defaultColors && defaultColors.length) {
result.push({
name: (0,external_wp_i18n_namespaceObject._x)(
"Default",
"Indicates this palette comes from WordPress."
),
colors: defaultColors
});
}
if (customColors && customColors.length) {
result.push({
name: (0,external_wp_i18n_namespaceObject._x)(
"Custom",
"Indicates this palette is created by the user."
),
colors: customColors
});
}
return result;
}, [
customColors,
themeColors,
defaultColors,
shouldDisplayDefaultColors
]);
}
function useGradientsPerOrigin(settings) {
const customGradients = settings?.color?.gradients?.custom;
const themeGradients = settings?.color?.gradients?.theme;
const defaultGradients = settings?.color?.gradients?.default;
const shouldDisplayDefaultGradients = settings?.color?.defaultGradients;
return (0,external_wp_element_namespaceObject.useMemo)(() => {
const result = [];
if (themeGradients && themeGradients.length) {
result.push({
name: (0,external_wp_i18n_namespaceObject._x)(
"Theme",
"Indicates this palette comes from the theme."
),
gradients: themeGradients
});
}
if (shouldDisplayDefaultGradients && defaultGradients && defaultGradients.length) {
result.push({
name: (0,external_wp_i18n_namespaceObject._x)(
"Default",
"Indicates this palette comes from WordPress."
),
gradients: defaultGradients
});
}
if (customGradients && customGradients.length) {
result.push({
name: (0,external_wp_i18n_namespaceObject._x)(
"Custom",
"Indicates this palette is created by the user."
),
gradients: customGradients
});
}
return result;
}, [
customGradients,
themeGradients,
defaultGradients,
shouldDisplayDefaultGradients
]);
}
;// ./node_modules/clsx/dist/clsx.mjs
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx);
;// ./node_modules/@wordpress/block-editor/build-module/hooks/utils.js
const utils_cleanEmptyObject = (object) => {
if (object === null || typeof object !== "object" || Array.isArray(object)) {
return object;
}
const cleanedNestedObjects = Object.entries(object).map(([key, value]) => [key, utils_cleanEmptyObject(value)]).filter(([, value]) => value !== void 0);
return !cleanedNestedObjects.length ? void 0 : Object.fromEntries(cleanedNestedObjects);
};
function transformStyles(activeSupports, migrationPaths, result, source, index, results) {
if (Object.values(activeSupports ?? {}).every(
(isActive) => !isActive
)) {
return result;
}
if (results.length === 1 && result.innerBlocks.length === source.length) {
return result;
}
let referenceBlockAttributes = source[0]?.attributes;
if (results.length > 1 && source.length > 1) {
if (source[index]) {
referenceBlockAttributes = source[index]?.attributes;
} else {
return result;
}
}
let returnBlock = result;
Object.entries(activeSupports).forEach(([support, isActive]) => {
if (isActive) {
migrationPaths[support].forEach((path) => {
const styleValue = getValueFromObjectPath(
referenceBlockAttributes,
path
);
if (styleValue) {
returnBlock = {
...returnBlock,
attributes: setImmutably(
returnBlock.attributes,
path,
styleValue
)
};
}
});
}
});
return returnBlock;
}
function shouldSkipSerialization(blockNameOrType, featureSet, feature) {
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockNameOrType, featureSet);
const skipSerialization = support?.__experimentalSkipSerialization;
if (Array.isArray(skipSerialization)) {
return skipSerialization.includes(feature);
}
return skipSerialization;
}
const pendingStyleOverrides = /* @__PURE__ */ new WeakMap();
function useStyleOverride({ id, css }) {
return usePrivateStyleOverride({ id, css });
}
function usePrivateStyleOverride({
id,
css,
assets,
__unstableType,
variation,
clientId
} = {}) {
const { setStyleOverride, deleteStyleOverride } = unlock(
(0,external_wp_data_namespaceObject.useDispatch)(store)
);
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const fallbackId = (0,external_wp_element_namespaceObject.useId)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!css && !assets) {
return;
}
const _id = id || fallbackId;
const override = {
id,
css,
assets,
__unstableType,
variation,
clientId
};
if (!pendingStyleOverrides.get(registry)) {
pendingStyleOverrides.set(registry, []);
}
pendingStyleOverrides.get(registry).push([_id, override]);
window.queueMicrotask(() => {
if (pendingStyleOverrides.get(registry)?.length) {
registry.batch(() => {
pendingStyleOverrides.get(registry).forEach((args) => {
setStyleOverride(...args);
});
pendingStyleOverrides.set(registry, []);
});
}
});
return () => {
const isPending = pendingStyleOverrides.get(registry)?.find(([currentId]) => currentId === _id);
if (isPending) {
pendingStyleOverrides.set(
registry,
pendingStyleOverrides.get(registry).filter(([currentId]) => currentId !== _id)
);
} else {
deleteStyleOverride(_id);
}
};
}, [
id,
css,
clientId,
assets,
__unstableType,
fallbackId,
setStyleOverride,
deleteStyleOverride,
registry
]);
}
function useBlockSettings(name, parentLayout) {
const [
backgroundImage,
backgroundSize,
customFontFamilies,
defaultFontFamilies,
themeFontFamilies,
defaultFontSizesEnabled,
customFontSizes,
defaultFontSizes,
themeFontSizes,
customFontSize,
fontStyle,
fontWeight,
lineHeight,
textAlign,
textColumns,
textDecoration,
writingMode,
textTransform,
letterSpacing,
padding,
margin,
blockGap,
defaultSpacingSizesEnabled,
customSpacingSize,
userSpacingSizes,
defaultSpacingSizes,
themeSpacingSizes,
units,
aspectRatio,
minHeight,
layout,
borderColor,
borderRadius,
borderStyle,
borderWidth,
borderRadiusSizes,
customColorsEnabled,
customColors,
customDuotone,
themeColors,
defaultColors,
defaultPalette,
defaultDuotone,
userDuotonePalette,
themeDuotonePalette,
defaultDuotonePalette,
userGradientPalette,
themeGradientPalette,
defaultGradientPalette,
defaultGradients,
areCustomGradientsEnabled,
isBackgroundEnabled,
isLinkEnabled,
isTextEnabled,
isHeadingEnabled,
isButtonEnabled,
shadow
] = use_settings_useSettings(
"background.backgroundImage",
"background.backgroundSize",
"typography.fontFamilies.custom",
"typography.fontFamilies.default",
"typography.fontFamilies.theme",
"typography.defaultFontSizes",
"typography.fontSizes.custom",
"typography.fontSizes.default",
"typography.fontSizes.theme",
"typography.customFontSize",
"typography.fontStyle",
"typography.fontWeight",
"typography.lineHeight",
"typography.textAlign",
"typography.textColumns",
"typography.textDecoration",
"typography.writingMode",
"typography.textTransform",
"typography.letterSpacing",
"spacing.padding",
"spacing.margin",
"spacing.blockGap",
"spacing.defaultSpacingSizes",
"spacing.customSpacingSize",
"spacing.spacingSizes.custom",
"spacing.spacingSizes.default",
"spacing.spacingSizes.theme",
"spacing.units",
"dimensions.aspectRatio",
"dimensions.minHeight",
"layout",
"border.color",
"border.radius",
"border.style",
"border.width",
"border.radiusSizes",
"color.custom",
"color.palette.custom",
"color.customDuotone",
"color.palette.theme",
"color.palette.default",
"color.defaultPalette",
"color.defaultDuotone",
"color.duotone.custom",
"color.duotone.theme",
"color.duotone.default",
"color.gradients.custom",
"color.gradients.theme",
"color.gradients.default",
"color.defaultGradients",
"color.customGradient",
"color.background",
"color.link",
"color.text",
"color.heading",
"color.button",
"shadow"
);
const rawSettings = (0,external_wp_element_namespaceObject.useMemo)(() => {
return {
background: {
backgroundImage,
backgroundSize
},
color: {
palette: {
custom: customColors,
theme: themeColors,
default: defaultColors
},
gradients: {
custom: userGradientPalette,
theme: themeGradientPalette,
default: defaultGradientPalette
},
duotone: {
custom: userDuotonePalette,
theme: themeDuotonePalette,
default: defaultDuotonePalette
},
defaultGradients,
defaultPalette,
defaultDuotone,
custom: customColorsEnabled,
customGradient: areCustomGradientsEnabled,
customDuotone,
background: isBackgroundEnabled,
link: isLinkEnabled,
heading: isHeadingEnabled,
button: isButtonEnabled,
text: isTextEnabled
},
typography: {
fontFamilies: {
custom: customFontFamilies,
default: defaultFontFamilies,
theme: themeFontFamilies
},
fontSizes: {
custom: customFontSizes,
default: defaultFontSizes,
theme: themeFontSizes
},
customFontSize,
defaultFontSizes: defaultFontSizesEnabled,
fontStyle,
fontWeight,
lineHeight,
textAlign,
textColumns,
textDecoration,
textTransform,
letterSpacing,
writingMode
},
spacing: {
spacingSizes: {
custom: userSpacingSizes,
default: defaultSpacingSizes,
theme: themeSpacingSizes
},
customSpacingSize,
defaultSpacingSizes: defaultSpacingSizesEnabled,
padding,
margin,
blockGap,
units
},
border: {
color: borderColor,
radius: borderRadius,
style: borderStyle,
width: borderWidth,
radiusSizes: borderRadiusSizes
},
dimensions: {
aspectRatio,
minHeight
},
layout,
parentLayout,
shadow
};
}, [
backgroundImage,
backgroundSize,
customFontFamilies,
defaultFontFamilies,
themeFontFamilies,
defaultFontSizesEnabled,
customFontSizes,
defaultFontSizes,
themeFontSizes,
customFontSize,
fontStyle,
fontWeight,
lineHeight,
textAlign,
textColumns,
textDecoration,
textTransform,
letterSpacing,
writingMode,
padding,
margin,
blockGap,
defaultSpacingSizesEnabled,
customSpacingSize,
userSpacingSizes,
defaultSpacingSizes,
themeSpacingSizes,
units,
aspectRatio,
minHeight,
layout,
parentLayout,
borderColor,
borderRadius,
borderStyle,
borderWidth,
borderRadiusSizes,
customColorsEnabled,
customColors,
customDuotone,
themeColors,
defaultColors,
defaultPalette,
defaultDuotone,
userDuotonePalette,
themeDuotonePalette,
defaultDuotonePalette,
userGradientPalette,
themeGradientPalette,
defaultGradientPalette,
defaultGradients,
areCustomGradientsEnabled,
isBackgroundEnabled,
isLinkEnabled,
isTextEnabled,
isHeadingEnabled,
isButtonEnabled,
shadow
]);
return useSettingsForBlockElement(rawSettings, name);
}
function createBlockEditFilter(features) {
features = features.map((settings) => {
return { ...settings, Edit: (0,external_wp_element_namespaceObject.memo)(settings.edit) };
});
const withBlockEditHooks = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
(OriginalBlockEdit) => (props) => {
const context = useBlockEditContext();
return [
...features.map((feature, i) => {
const {
Edit,
hasSupport,
attributeKeys = [],
shareWithChildBlocks
} = feature;
const shouldDisplayControls = context[mayDisplayControlsKey] || context[mayDisplayParentControlsKey] && shareWithChildBlocks;
if (!shouldDisplayControls || !hasSupport(props.name)) {
return null;
}
const neededProps = {};
for (const key of attributeKeys) {
if (props.attributes[key]) {
neededProps[key] = props.attributes[key];
}
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Edit,
{
name: props.name,
isSelected: props.isSelected,
clientId: props.clientId,
setAttributes: props.setAttributes,
__unstableParentLayout: props.__unstableParentLayout,
...neededProps
},
i
);
}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalBlockEdit, { ...props }, "edit")
];
},
"withBlockEditHooks"
);
(0,external_wp_hooks_namespaceObject.addFilter)("editor.BlockEdit", "core/editor/hooks", withBlockEditHooks);
}
function BlockProps({
index,
useBlockProps: hook,
setAllWrapperProps,
...props
}) {
const wrapperProps = hook(props);
const setWrapperProps = (next) => setAllWrapperProps((prev) => {
const nextAll = [...prev];
nextAll[index] = next;
return nextAll;
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
setWrapperProps(wrapperProps);
return () => {
setWrapperProps(void 0);
};
});
return null;
}
const BlockPropsPure = (0,external_wp_element_namespaceObject.memo)(BlockProps);
function createBlockListBlockFilter(features) {
const withBlockListBlockHooks = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
(BlockListBlock) => (props) => {
const [allWrapperProps, setAllWrapperProps] = (0,external_wp_element_namespaceObject.useState)(
Array(features.length).fill(void 0)
);
return [
...features.map((feature, i) => {
const {
hasSupport,
attributeKeys = [],
useBlockProps,
isMatch
} = feature;
const neededProps = {};
for (const key of attributeKeys) {
if (props.attributes[key]) {
neededProps[key] = props.attributes[key];
}
}
if (
// Skip rendering if none of the needed attributes are
// set.
!Object.keys(neededProps).length || !hasSupport(props.name) || isMatch && !isMatch(neededProps)
) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockPropsPure,
{
index: i,
useBlockProps,
setAllWrapperProps,
name: props.name,
clientId: props.clientId,
...neededProps
},
i
);
}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockListBlock,
{
...props,
wrapperProps: allWrapperProps.filter(Boolean).reduce((acc, wrapperProps) => {
return {
...acc,
...wrapperProps,
className: dist_clsx(
acc.className,
wrapperProps.className
),
style: {
...acc.style,
...wrapperProps.style
}
};
}, props.wrapperProps || {})
},
"edit"
)
];
},
"withBlockListBlockHooks"
);
(0,external_wp_hooks_namespaceObject.addFilter)(
"editor.BlockListBlock",
"core/editor/hooks",
withBlockListBlockHooks
);
}
function createBlockSaveFilter(features) {
function extraPropsFromHooks(props, name, attributes) {
return features.reduce((accu, feature) => {
const { hasSupport, attributeKeys = [], addSaveProps } = feature;
const neededAttributes = {};
for (const key of attributeKeys) {
if (attributes[key]) {
neededAttributes[key] = attributes[key];
}
}
if (
// Skip rendering if none of the needed attributes are
// set.
!Object.keys(neededAttributes).length || !hasSupport(name)
) {
return accu;
}
return addSaveProps(accu, name, neededAttributes);
}, props);
}
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.getSaveContent.extraProps",
"core/editor/hooks",
extraPropsFromHooks,
0
);
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.getSaveContent.extraProps",
"core/editor/hooks",
(props) => {
if (props.hasOwnProperty("className") && !props.className) {
delete props.className;
}
return props;
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/compat.js
function migrateLightBlockWrapper(settings) {
const { apiVersion = 1 } = settings;
if (apiVersion < 2 && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, "lightBlockWrapper", false)) {
settings.apiVersion = 2;
}
return settings;
}
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.registerBlockType",
"core/compat/migrateLightBlockWrapper",
migrateLightBlockWrapper
);
;// external ["wp","components"]
const external_wp_components_namespaceObject = window["wp"]["components"];
;// ./node_modules/@wordpress/block-editor/build-module/components/block-controls/groups.js
const BlockControlsDefault = (0,external_wp_components_namespaceObject.createSlotFill)("BlockControls");
const BlockControlsBlock = (0,external_wp_components_namespaceObject.createSlotFill)("BlockControlsBlock");
const BlockControlsInline = (0,external_wp_components_namespaceObject.createSlotFill)("BlockFormatControls");
const BlockControlsOther = (0,external_wp_components_namespaceObject.createSlotFill)("BlockControlsOther");
const BlockControlsParent = (0,external_wp_components_namespaceObject.createSlotFill)("BlockControlsParent");
const groups = {
default: BlockControlsDefault,
block: BlockControlsBlock,
inline: BlockControlsInline,
other: BlockControlsOther,
parent: BlockControlsParent
};
var groups_default = groups;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-controls/hook.js
function useBlockControlsFill(group, shareWithChildBlocks) {
const context = useBlockEditContext();
if (context[mayDisplayControlsKey]) {
return groups_default[group]?.Fill;
}
if (context[mayDisplayParentControlsKey] && shareWithChildBlocks) {
return groups_default.parent.Fill;
}
return null;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-controls/fill.js
function BlockControlsFill({
group = "default",
controls,
children,
__experimentalShareWithChildBlocks = false
}) {
const Fill = useBlockControlsFill(
group,
__experimentalShareWithChildBlocks
);
if (!Fill) {
return null;
}
const innerMarkup = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
group === "default" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { controls }),
children
] });
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalStyleProvider, { document, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Fill, { children: (fillProps) => {
const { forwardedContext = [] } = fillProps;
return forwardedContext.reduce(
(inner, [Provider, props]) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, { ...props, children: inner }),
innerMarkup
);
} }) });
}
;// external ["wp","warning"]
const external_wp_warning_namespaceObject = window["wp"]["warning"];
var external_wp_warning_default = /*#__PURE__*/__webpack_require__.n(external_wp_warning_namespaceObject);
;// ./node_modules/@wordpress/block-editor/build-module/components/block-controls/slot.js
const { ComponentsContext } = unlock(external_wp_components_namespaceObject.privateApis);
function BlockControlsSlot({ group = "default", ...props }) {
const toolbarState = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.__experimentalToolbarContext);
const contextState = (0,external_wp_element_namespaceObject.useContext)(ComponentsContext);
const fillProps = (0,external_wp_element_namespaceObject.useMemo)(
() => ({
forwardedContext: [
[external_wp_components_namespaceObject.__experimentalToolbarContext.Provider, { value: toolbarState }],
[ComponentsContext.Provider, { value: contextState }]
]
}),
[toolbarState, contextState]
);
const slotFill = groups_default[group];
const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(slotFill.name);
if (!slotFill) {
external_wp_warning_default()(`Unknown BlockControls group "${group}" provided.`);
return null;
}
if (!fills?.length) {
return null;
}
const { Slot } = slotFill;
const slot = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Slot, { ...props, bubblesVirtually: true, fillProps });
if (group === "default") {
return slot;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: slot });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-controls/index.js
const BlockControls = BlockControlsFill;
BlockControls.Slot = BlockControlsSlot;
const BlockFormatControls = (props) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockControlsFill, { group: "inline", ...props });
};
BlockFormatControls.Slot = (props) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockControlsSlot, { group: "inline", ...props });
};
var block_controls_default = BlockControls;
;// ./node_modules/@wordpress/icons/build-module/library/justify-left.js
var justify_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M9 9v6h11V9H9zM4 20h1.5V4H4v16z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/justify-center.js
var justify_center_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/justify-right.js
var justify_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/justify-space-between.js
var justify_space_between_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/justify-stretch.js
var justify_stretch_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/arrow-right.js
var arrow_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/arrow-down.js
var arrow_down_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/layouts/definitions.js
const LAYOUT_DEFINITIONS = {
default: {
name: "default",
slug: "flow",
className: "is-layout-flow",
baseStyles: [
{
selector: " > .alignleft",
rules: {
float: "left",
"margin-inline-start": "0",
"margin-inline-end": "2em"
}
},
{
selector: " > .alignright",
rules: {
float: "right",
"margin-inline-start": "2em",
"margin-inline-end": "0"
}
},
{
selector: " > .aligncenter",
rules: {
"margin-left": "auto !important",
"margin-right": "auto !important"
}
}
],
spacingStyles: [
{
selector: " > :first-child",
rules: {
"margin-block-start": "0"
}
},
{
selector: " > :last-child",
rules: {
"margin-block-end": "0"
}
},
{
selector: " > *",
rules: {
"margin-block-start": null,
"margin-block-end": "0"
}
}
]
},
constrained: {
name: "constrained",
slug: "constrained",
className: "is-layout-constrained",
baseStyles: [
{
selector: " > .alignleft",
rules: {
float: "left",
"margin-inline-start": "0",
"margin-inline-end": "2em"
}
},
{
selector: " > .alignright",
rules: {
float: "right",
"margin-inline-start": "2em",
"margin-inline-end": "0"
}
},
{
selector: " > .aligncenter",
rules: {
"margin-left": "auto !important",
"margin-right": "auto !important"
}
},
{
selector: " > :where(:not(.alignleft):not(.alignright):not(.alignfull))",
rules: {
"max-width": "var(--wp--style--global--content-size)",
"margin-left": "auto !important",
"margin-right": "auto !important"
}
},
{
selector: " > .alignwide",
rules: {
"max-width": "var(--wp--style--global--wide-size)"
}
}
],
spacingStyles: [
{
selector: " > :first-child",
rules: {
"margin-block-start": "0"
}
},
{
selector: " > :last-child",
rules: {
"margin-block-end": "0"
}
},
{
selector: " > *",
rules: {
"margin-block-start": null,
"margin-block-end": "0"
}
}
]
},
flex: {
name: "flex",
slug: "flex",
className: "is-layout-flex",
displayMode: "flex",
baseStyles: [
{
selector: "",
rules: {
"flex-wrap": "wrap",
"align-items": "center"
}
},
{
selector: " > :is(*, div)",
// :is(*, div) instead of just * increases the specificity by 001.
rules: {
margin: "0"
}
}
],
spacingStyles: [
{
selector: "",
rules: {
gap: null
}
}
]
},
grid: {
name: "grid",
slug: "grid",
className: "is-layout-grid",
displayMode: "grid",
baseStyles: [
{
selector: " > :is(*, div)",
// :is(*, div) instead of just * increases the specificity by 001.
rules: {
margin: "0"
}
}
],
spacingStyles: [
{
selector: "",
rules: {
gap: null
}
}
]
}
};
;// ./node_modules/@wordpress/block-editor/build-module/layouts/utils.js
function appendSelectors(selectors, append = "") {
return selectors.split(",").map(
(subselector) => `${subselector}${append ? ` ${append}` : ""}`
).join(",");
}
function getBlockGapCSS(selector, layoutDefinitions = LAYOUT_DEFINITIONS, layoutType, blockGapValue) {
let output = "";
if (layoutDefinitions?.[layoutType]?.spacingStyles?.length && blockGapValue) {
layoutDefinitions[layoutType].spacingStyles.forEach((gapStyle) => {
output += `${appendSelectors(
selector,
gapStyle.selector.trim()
)} { `;
output += Object.entries(gapStyle.rules).map(
([cssProperty, value]) => `${cssProperty}: ${value ? value : blockGapValue}`
).join("; ");
output += "; }";
});
}
return output;
}
function getAlignmentsInfo(layout) {
const { contentSize, wideSize, type = "default" } = layout;
const alignmentInfo = {};
const sizeRegex = /^(?!0)\d+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i;
if (sizeRegex.test(contentSize) && type === "constrained") {
alignmentInfo.none = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Max %s wide"), contentSize);
}
if (sizeRegex.test(wideSize)) {
alignmentInfo.wide = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Max %s wide"), wideSize);
}
return alignmentInfo;
}
;// ./node_modules/@wordpress/icons/build-module/library/sides-all.js
var sides_all_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/sides-horizontal.js
var sides_horizontal_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",
style: { opacity: 0.25 }
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m4.5 7.5v9h1.5v-9z" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m18 7.5v9h1.5v-9z" })
] });
;// ./node_modules/@wordpress/icons/build-module/library/sides-vertical.js
var sides_vertical_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",
style: { opacity: 0.25 }
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7.5 6h9v-1.5h-9z" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7.5 19.5h9v-1.5h-9z" })
] });
;// ./node_modules/@wordpress/icons/build-module/library/sides-top.js
var sides_top_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",
style: { opacity: 0.25 }
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m16.5 6h-9v-1.5h9z" })
] });
;// ./node_modules/@wordpress/icons/build-module/library/sides-right.js
var sides_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",
style: { opacity: 0.25 }
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m18 16.5v-9h1.5v9z" })
] });
;// ./node_modules/@wordpress/icons/build-module/library/sides-bottom.js
var sides_bottom_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",
style: { opacity: 0.25 }
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m16.5 19.5h-9v-1.5h9z" })
] });
;// ./node_modules/@wordpress/icons/build-module/library/sides-left.js
var sides_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",
style: { opacity: 0.25 }
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m4.5 16.5v-9h1.5v9z" })
] });
;// ./node_modules/@wordpress/block-editor/build-module/components/spacing-sizes-control/utils.js
const RANGE_CONTROL_MAX_SIZE = 8;
const ALL_SIDES = ["top", "right", "bottom", "left"];
const DEFAULT_VALUES = {
top: void 0,
right: void 0,
bottom: void 0,
left: void 0
};
const ICONS = {
custom: sides_all_default,
axial: sides_all_default,
horizontal: sides_horizontal_default,
vertical: sides_vertical_default,
top: sides_top_default,
right: sides_right_default,
bottom: sides_bottom_default,
left: sides_left_default
};
const LABELS = {
default: (0,external_wp_i18n_namespaceObject.__)("Spacing control"),
top: (0,external_wp_i18n_namespaceObject.__)("Top"),
bottom: (0,external_wp_i18n_namespaceObject.__)("Bottom"),
left: (0,external_wp_i18n_namespaceObject.__)("Left"),
right: (0,external_wp_i18n_namespaceObject.__)("Right"),
mixed: (0,external_wp_i18n_namespaceObject.__)("Mixed"),
vertical: (0,external_wp_i18n_namespaceObject.__)("Vertical"),
horizontal: (0,external_wp_i18n_namespaceObject.__)("Horizontal"),
axial: (0,external_wp_i18n_namespaceObject.__)("Horizontal & vertical"),
custom: (0,external_wp_i18n_namespaceObject.__)("Custom")
};
const VIEWS = {
axial: "axial",
top: "top",
right: "right",
bottom: "bottom",
left: "left",
custom: "custom"
};
function isValueSpacingPreset(value) {
if (!value?.includes) {
return false;
}
return value === "0" || value.includes("var:preset|spacing|");
}
function getCustomValueFromPreset(value, spacingSizes) {
if (!isValueSpacingPreset(value)) {
return value;
}
const slug = getSpacingPresetSlug(value);
const spacingSize = spacingSizes.find(
(size) => String(size.slug) === slug
);
return spacingSize?.size;
}
function getPresetValueFromCustomValue(value, spacingSizes) {
if (!value || isValueSpacingPreset(value) || value === "0") {
return value;
}
const spacingMatch = spacingSizes.find(
(size) => String(size.size) === String(value)
);
if (spacingMatch?.slug) {
return `var:preset|spacing|${spacingMatch.slug}`;
}
return value;
}
function getSpacingPresetCssVar(value) {
if (!value) {
return;
}
const slug = value.match(/var:preset\|spacing\|(.+)/);
if (!slug) {
return value;
}
return `var(--wp--preset--spacing--${slug[1]})`;
}
function getSpacingPresetSlug(value) {
if (!value) {
return;
}
if (value === "0" || value === "default") {
return value;
}
const slug = value.match(/var:preset\|spacing\|(.+)/);
return slug ? slug[1] : void 0;
}
function getSliderValueFromPreset(presetValue, spacingSizes) {
if (presetValue === void 0) {
return 0;
}
const slug = parseFloat(presetValue, 10) === 0 ? "0" : getSpacingPresetSlug(presetValue);
const sliderValue = spacingSizes.findIndex((spacingSize) => {
return String(spacingSize.slug) === slug;
});
return sliderValue !== -1 ? sliderValue : NaN;
}
function hasAxisSupport(sides, axis) {
if (!sides || !sides.length) {
return false;
}
const hasHorizontalSupport = sides.includes("horizontal") || sides.includes("left") && sides.includes("right");
const hasVerticalSupport = sides.includes("vertical") || sides.includes("top") && sides.includes("bottom");
if (axis === "horizontal") {
return hasHorizontalSupport;
}
if (axis === "vertical") {
return hasVerticalSupport;
}
return hasHorizontalSupport || hasVerticalSupport;
}
function hasBalancedSidesSupport(sides = []) {
const counts = { top: 0, right: 0, bottom: 0, left: 0 };
sides.forEach((side) => counts[side] += 1);
return (counts.top + counts.bottom) % 2 === 0 && (counts.left + counts.right) % 2 === 0;
}
function getInitialView(values = {}, sides) {
const { top, right, bottom, left } = values;
const sideValues = [top, right, bottom, left].filter(Boolean);
const hasMatchingAxialValues = top === bottom && left === right && (!!top || !!left);
const hasNoValuesAndBalancedSides = !sideValues.length && hasBalancedSidesSupport(sides);
const hasOnlyAxialSides = sides?.includes("horizontal") && sides?.includes("vertical") && sides?.length === 2;
if (hasAxisSupport(sides) && (hasMatchingAxialValues || hasNoValuesAndBalancedSides)) {
return VIEWS.axial;
}
if (hasOnlyAxialSides && sideValues.length === 1) {
let side;
Object.entries(values).some(([key, value]) => {
side = key;
return value !== void 0;
});
return side;
}
if (sides?.length === 1 && !sideValues.length) {
return sides[0];
}
return VIEWS.custom;
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/gap.js
function getGapBoxControlValueFromStyle(blockGapValue) {
if (!blockGapValue) {
return null;
}
const isValueString = typeof blockGapValue === "string";
return {
top: isValueString ? blockGapValue : blockGapValue?.top,
left: isValueString ? blockGapValue : blockGapValue?.left
};
}
function getGapCSSValue(blockGapValue, defaultValue = "0") {
const blockGapBoxControlValue = getGapBoxControlValueFromStyle(blockGapValue);
if (!blockGapBoxControlValue) {
return null;
}
const row = getSpacingPresetCssVar(blockGapBoxControlValue?.top) || defaultValue;
const column = getSpacingPresetCssVar(blockGapBoxControlValue?.left) || defaultValue;
return row === column ? row : `${row} ${column}`;
}
;// ./node_modules/@wordpress/icons/build-module/library/justify-top.js
var justify_top_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M9 20h6V9H9v11zM4 4v1.5h16V4H4z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/justify-center-vertical.js
var justify_center_vertical_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/justify-bottom.js
var justify_bottom_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/justify-stretch-vertical.js
var justify_stretch_vertical_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/justify-space-between-vertical.js
var justify_space_between_vertical_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/block-vertical-alignment-control/ui.js
const BLOCK_ALIGNMENTS_CONTROLS = {
top: {
icon: justify_top_default,
title: (0,external_wp_i18n_namespaceObject._x)("Align top", "Block vertical alignment setting")
},
center: {
icon: justify_center_vertical_default,
title: (0,external_wp_i18n_namespaceObject._x)("Align middle", "Block vertical alignment setting")
},
bottom: {
icon: justify_bottom_default,
title: (0,external_wp_i18n_namespaceObject._x)("Align bottom", "Block vertical alignment setting")
},
stretch: {
icon: justify_stretch_vertical_default,
title: (0,external_wp_i18n_namespaceObject._x)("Stretch to fill", "Block vertical alignment setting")
},
"space-between": {
icon: justify_space_between_vertical_default,
title: (0,external_wp_i18n_namespaceObject._x)("Space between", "Block vertical alignment setting")
}
};
const DEFAULT_CONTROLS = ["top", "center", "bottom"];
const DEFAULT_CONTROL = "top";
function BlockVerticalAlignmentUI({
value,
onChange,
controls = DEFAULT_CONTROLS,
isCollapsed = true,
isToolbar
}) {
function applyOrUnset(align) {
return () => onChange(value === align ? void 0 : align);
}
const activeAlignment = BLOCK_ALIGNMENTS_CONTROLS[value];
const defaultAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[DEFAULT_CONTROL];
const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu;
const extraProps = isToolbar ? { isCollapsed } : {};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
UIComponent,
{
icon: activeAlignment ? activeAlignment.icon : defaultAlignmentControl.icon,
label: (0,external_wp_i18n_namespaceObject._x)(
"Change vertical alignment",
"Block vertical alignment setting label"
),
controls: controls.map((control) => {
return {
...BLOCK_ALIGNMENTS_CONTROLS[control],
isActive: value === control,
role: isCollapsed ? "menuitemradio" : void 0,
onClick: applyOrUnset(control)
};
}),
...extraProps
}
);
}
var ui_default = BlockVerticalAlignmentUI;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-vertical-alignment-control/index.js
const BlockVerticalAlignmentControl = (props) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ui_default, { ...props, isToolbar: false });
};
const BlockVerticalAlignmentToolbar = (props) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ui_default, { ...props, isToolbar: true });
};
;// ./node_modules/@wordpress/block-editor/build-module/components/justify-content-control/ui.js
const icons = {
left: justify_left_default,
center: justify_center_default,
right: justify_right_default,
"space-between": justify_space_between_default,
stretch: justify_stretch_default
};
function JustifyContentUI({
allowedControls = ["left", "center", "right", "space-between"],
isCollapsed = true,
onChange,
value,
popoverProps,
isToolbar
}) {
const handleClick = (next) => {
if (next === value) {
onChange(void 0);
} else {
onChange(next);
}
};
const icon = value ? icons[value] : icons.left;
const allControls = [
{
name: "left",
icon: justify_left_default,
title: (0,external_wp_i18n_namespaceObject.__)("Justify items left"),
isActive: "left" === value,
onClick: () => handleClick("left")
},
{
name: "center",
icon: justify_center_default,
title: (0,external_wp_i18n_namespaceObject.__)("Justify items center"),
isActive: "center" === value,
onClick: () => handleClick("center")
},
{
name: "right",
icon: justify_right_default,
title: (0,external_wp_i18n_namespaceObject.__)("Justify items right"),
isActive: "right" === value,
onClick: () => handleClick("right")
},
{
name: "space-between",
icon: justify_space_between_default,
title: (0,external_wp_i18n_namespaceObject.__)("Space between items"),
isActive: "space-between" === value,
onClick: () => handleClick("space-between")
},
{
name: "stretch",
icon: justify_stretch_default,
title: (0,external_wp_i18n_namespaceObject.__)("Stretch items"),
isActive: "stretch" === value,
onClick: () => handleClick("stretch")
}
];
const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu;
const extraProps = isToolbar ? { isCollapsed } : {};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
UIComponent,
{
icon,
popoverProps,
label: (0,external_wp_i18n_namespaceObject.__)("Change items justification"),
controls: allControls.filter(
(elem) => allowedControls.includes(elem.name)
),
...extraProps
}
);
}
var ui_ui_default = JustifyContentUI;
;// ./node_modules/@wordpress/block-editor/build-module/components/justify-content-control/index.js
const JustifyContentControl = (props) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ui_ui_default, { ...props, isToolbar: false });
};
const JustifyToolbar = (props) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ui_ui_default, { ...props, isToolbar: true });
};
;// ./node_modules/@wordpress/block-editor/build-module/layouts/flex.js
const justifyContentMap = {
left: "flex-start",
right: "flex-end",
center: "center",
"space-between": "space-between"
};
const alignItemsMap = {
left: "flex-start",
right: "flex-end",
center: "center",
stretch: "stretch"
};
const verticalAlignmentMap = {
top: "flex-start",
center: "center",
bottom: "flex-end",
stretch: "stretch",
"space-between": "space-between"
};
const defaultAlignments = {
horizontal: "center",
vertical: "top"
};
const flexWrapOptions = ["wrap", "nowrap"];
var flex_default = {
name: "flex",
label: (0,external_wp_i18n_namespaceObject.__)("Flex"),
inspectorControls: function FlexLayoutInspectorControls({
layout = {},
onChange,
layoutBlockSupport = {}
}) {
const { allowOrientation = true, allowJustification = true } = layoutBlockSupport;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { children: [
allowJustification && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FlexLayoutJustifyContentControl,
{
layout,
onChange
}
) }),
allowOrientation && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
OrientationControl,
{
layout,
onChange
}
) })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexWrapControl, { layout, onChange })
] });
},
toolBarControls: function FlexLayoutToolbarControls({
layout = {},
onChange,
layoutBlockSupport
}) {
const { allowVerticalAlignment = true, allowJustification = true } = layoutBlockSupport;
if (!allowJustification && !allowVerticalAlignment) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(block_controls_default, { group: "block", __experimentalShareWithChildBlocks: true, children: [
allowJustification && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FlexLayoutJustifyContentControl,
{
layout,
onChange,
isToolbar: true
}
),
allowVerticalAlignment && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FlexLayoutVerticalAlignmentControl,
{
layout,
onChange
}
)
] });
},
getLayoutStyle: function getLayoutStyle({
selector,
layout,
style,
blockName,
hasBlockGapSupport,
layoutDefinitions = LAYOUT_DEFINITIONS
}) {
const { orientation = "horizontal" } = layout;
const blockGapValue = style?.spacing?.blockGap && !shouldSkipSerialization(blockName, "spacing", "blockGap") ? getGapCSSValue(style?.spacing?.blockGap, "0.5em") : void 0;
const justifyContent = justifyContentMap[layout.justifyContent];
const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : "wrap";
const verticalAlignment = verticalAlignmentMap[layout.verticalAlignment];
const alignItems = alignItemsMap[layout.justifyContent] || alignItemsMap.left;
let output = "";
const rules = [];
if (flexWrap && flexWrap !== "wrap") {
rules.push(`flex-wrap: ${flexWrap}`);
}
if (orientation === "horizontal") {
if (verticalAlignment) {
rules.push(`align-items: ${verticalAlignment}`);
}
if (justifyContent) {
rules.push(`justify-content: ${justifyContent}`);
}
} else {
if (verticalAlignment) {
rules.push(`justify-content: ${verticalAlignment}`);
}
rules.push("flex-direction: column");
rules.push(`align-items: ${alignItems}`);
}
if (rules.length) {
output = `${appendSelectors(selector)} {
${rules.join("; ")};
}`;
}
if (hasBlockGapSupport && blockGapValue) {
output += getBlockGapCSS(
selector,
layoutDefinitions,
"flex",
blockGapValue
);
}
return output;
},
getOrientation(layout) {
const { orientation = "horizontal" } = layout;
return orientation;
},
getAlignments() {
return [];
}
};
function FlexLayoutVerticalAlignmentControl({ layout, onChange }) {
const { orientation = "horizontal" } = layout;
const defaultVerticalAlignment = orientation === "horizontal" ? defaultAlignments.horizontal : defaultAlignments.vertical;
const { verticalAlignment = defaultVerticalAlignment } = layout;
const onVerticalAlignmentChange = (value) => {
onChange({
...layout,
verticalAlignment: value
});
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockVerticalAlignmentControl,
{
onChange: onVerticalAlignmentChange,
value: verticalAlignment,
controls: orientation === "horizontal" ? ["top", "center", "bottom", "stretch"] : ["top", "center", "bottom", "space-between"]
}
);
}
const POPOVER_PROPS = {
placement: "bottom-start"
};
function FlexLayoutJustifyContentControl({
layout,
onChange,
isToolbar = false
}) {
const { justifyContent = "left", orientation = "horizontal" } = layout;
const onJustificationChange = (value) => {
onChange({
...layout,
justifyContent: value
});
};
const allowedControls = ["left", "center", "right"];
if (orientation === "horizontal") {
allowedControls.push("space-between");
} else {
allowedControls.push("stretch");
}
if (isToolbar) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
JustifyContentControl,
{
allowedControls,
value: justifyContent,
onChange: onJustificationChange,
popoverProps: POPOVER_PROPS
}
);
}
const justificationOptions = [
{
value: "left",
icon: justify_left_default,
label: (0,external_wp_i18n_namespaceObject.__)("Justify items left")
},
{
value: "center",
icon: justify_center_default,
label: (0,external_wp_i18n_namespaceObject.__)("Justify items center")
},
{
value: "right",
icon: justify_right_default,
label: (0,external_wp_i18n_namespaceObject.__)("Justify items right")
}
];
if (orientation === "horizontal") {
justificationOptions.push({
value: "space-between",
icon: justify_space_between_default,
label: (0,external_wp_i18n_namespaceObject.__)("Space between items")
});
} else {
justificationOptions.push({
value: "stretch",
icon: justify_stretch_default,
label: (0,external_wp_i18n_namespaceObject.__)("Stretch items")
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Justification"),
value: justifyContent,
onChange: onJustificationChange,
className: "block-editor-hooks__flex-layout-justification-controls",
children: justificationOptions.map(({ value, icon, label }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon,
{
value,
icon,
label
},
value
);
})
}
);
}
function FlexWrapControl({ layout, onChange }) {
const { flexWrap = "wrap" } = layout;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Allow to wrap to multiple lines"),
onChange: (value) => {
onChange({
...layout,
flexWrap: value ? "wrap" : "nowrap"
});
},
checked: flexWrap === "wrap"
}
);
}
function OrientationControl({ layout, onChange }) {
const {
orientation = "horizontal",
verticalAlignment,
justifyContent
} = layout;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
className: "block-editor-hooks__flex-layout-orientation-controls",
label: (0,external_wp_i18n_namespaceObject.__)("Orientation"),
value: orientation,
onChange: (value) => {
let newVerticalAlignment = verticalAlignment;
let newJustification = justifyContent;
if (value === "horizontal") {
if (verticalAlignment === "space-between") {
newVerticalAlignment = "center";
}
if (justifyContent === "stretch") {
newJustification = "left";
}
} else {
if (verticalAlignment === "stretch") {
newVerticalAlignment = "top";
}
if (justifyContent === "space-between") {
newJustification = "left";
}
}
return onChange({
...layout,
orientation: value,
verticalAlignment: newVerticalAlignment,
justifyContent: newJustification
});
},
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon,
{
icon: arrow_right_default,
value: "horizontal",
label: (0,external_wp_i18n_namespaceObject.__)("Horizontal")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon,
{
icon: arrow_down_default,
value: "vertical",
label: (0,external_wp_i18n_namespaceObject.__)("Vertical")
}
)
]
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/layouts/flow.js
var flow_default = {
name: "default",
label: (0,external_wp_i18n_namespaceObject.__)("Flow"),
inspectorControls: function DefaultLayoutInspectorControls() {
return null;
},
toolBarControls: function DefaultLayoutToolbarControls() {
return null;
},
getLayoutStyle: function getLayoutStyle({
selector,
style,
blockName,
hasBlockGapSupport,
layoutDefinitions = LAYOUT_DEFINITIONS
}) {
const blockGapStyleValue = getGapCSSValue(style?.spacing?.blockGap);
let blockGapValue = "";
if (!shouldSkipSerialization(blockName, "spacing", "blockGap")) {
if (blockGapStyleValue?.top) {
blockGapValue = getGapCSSValue(blockGapStyleValue?.top);
} else if (typeof blockGapStyleValue === "string") {
blockGapValue = getGapCSSValue(blockGapStyleValue);
}
}
let output = "";
if (hasBlockGapSupport && blockGapValue) {
output += getBlockGapCSS(
selector,
layoutDefinitions,
"default",
blockGapValue
);
}
return output;
},
getOrientation() {
return "vertical";
},
getAlignments(layout, isBlockBasedTheme) {
const alignmentInfo = getAlignmentsInfo(layout);
if (layout.alignments !== void 0) {
if (!layout.alignments.includes("none")) {
layout.alignments.unshift("none");
}
return layout.alignments.map((alignment) => ({
name: alignment,
info: alignmentInfo[alignment]
}));
}
const alignments = [
{ name: "left" },
{ name: "center" },
{ name: "right" }
];
if (!isBlockBasedTheme) {
const { contentSize, wideSize } = layout;
if (contentSize) {
alignments.unshift({ name: "full" });
}
if (wideSize) {
alignments.unshift({
name: "wide",
info: alignmentInfo.wide
});
}
}
alignments.unshift({ name: "none", info: alignmentInfo.none });
return alignments;
}
};
;// ./node_modules/@wordpress/icons/build-module/icon/index.js
var icon_default = (0,external_wp_element_namespaceObject.forwardRef)(
({ icon, size = 24, ...props }, ref) => {
return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
width: size,
height: size,
...props,
ref
});
}
);
;// ./node_modules/@wordpress/icons/build-module/library/align-none.js
var align_none_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/stretch-wide.js
var stretch_wide_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16 5.5H8V4h8v1.5ZM16 20H8v-1.5h8V20ZM5 9h14v6H5V9Z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/layouts/constrained.js
var constrained_default = {
name: "constrained",
label: (0,external_wp_i18n_namespaceObject.__)("Constrained"),
inspectorControls: function DefaultLayoutInspectorControls({
layout,
onChange,
layoutBlockSupport = {}
}) {
const { wideSize, contentSize, justifyContent = "center" } = layout;
const {
allowJustification = true,
allowCustomContentAndWideSize = true
} = layoutBlockSupport;
const onJustificationChange = (value) => {
onChange({
...layout,
justifyContent: value
});
};
const justificationOptions = [
{
value: "left",
icon: justify_left_default,
label: (0,external_wp_i18n_namespaceObject.__)("Justify items left")
},
{
value: "center",
icon: justify_center_default,
label: (0,external_wp_i18n_namespaceObject.__)("Justify items center")
},
{
value: "right",
icon: justify_right_default,
label: (0,external_wp_i18n_namespaceObject.__)("Justify items right")
}
];
const [availableUnits] = use_settings_useSettings("spacing.units");
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits: availableUnits || ["%", "px", "em", "rem", "vw"]
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
spacing: 4,
className: "block-editor-hooks__layout-constrained",
children: [
allowCustomContentAndWideSize && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Content width"),
labelPosition: "top",
value: contentSize || wideSize || "",
onChange: (nextWidth) => {
nextWidth = 0 > parseFloat(nextWidth) ? "0" : nextWidth;
onChange({
...layout,
contentSize: nextWidth
});
},
units,
prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: align_none_default }) })
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Wide width"),
labelPosition: "top",
value: wideSize || contentSize || "",
onChange: (nextWidth) => {
nextWidth = 0 > parseFloat(nextWidth) ? "0" : nextWidth;
onChange({
...layout,
wideSize: nextWidth
});
},
units,
prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: stretch_wide_default }) })
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "block-editor-hooks__layout-constrained-helptext", children: (0,external_wp_i18n_namespaceObject.__)(
"Customize the width for all elements that are assigned to the center or wide columns."
) })
] }),
allowJustification && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Justification"),
value: justifyContent,
onChange: onJustificationChange,
children: justificationOptions.map(
({ value, icon, label }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon,
{
value,
icon,
label
},
value
);
}
)
}
)
]
}
);
},
toolBarControls: function DefaultLayoutToolbarControls({
layout = {},
onChange,
layoutBlockSupport
}) {
const { allowJustification = true } = layoutBlockSupport;
if (!allowJustification) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls_default, { group: "block", __experimentalShareWithChildBlocks: true, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DefaultLayoutJustifyContentControl,
{
layout,
onChange
}
) });
},
getLayoutStyle: function getLayoutStyle({
selector,
layout = {},
style,
blockName,
hasBlockGapSupport,
layoutDefinitions = LAYOUT_DEFINITIONS
}) {
const { contentSize, wideSize, justifyContent } = layout;
const blockGapStyleValue = getGapCSSValue(style?.spacing?.blockGap);
let blockGapValue = "";
if (!shouldSkipSerialization(blockName, "spacing", "blockGap")) {
if (blockGapStyleValue?.top) {
blockGapValue = getGapCSSValue(blockGapStyleValue?.top);
} else if (typeof blockGapStyleValue === "string") {
blockGapValue = getGapCSSValue(blockGapStyleValue);
}
}
const marginLeft = justifyContent === "left" ? "0 !important" : "auto !important";
const marginRight = justifyContent === "right" ? "0 !important" : "auto !important";
let output = !!contentSize || !!wideSize ? `
${appendSelectors(
selector,
"> :where(:not(.alignleft):not(.alignright):not(.alignfull))"
)} {
max-width: ${contentSize ?? wideSize};
margin-left: ${marginLeft};
margin-right: ${marginRight};
}
${appendSelectors(selector, "> .alignwide")} {
max-width: ${wideSize ?? contentSize};
}
${appendSelectors(selector, "> .alignfull")} {
max-width: none;
}
` : "";
if (justifyContent === "left") {
output += `${appendSelectors(
selector,
"> :where(:not(.alignleft):not(.alignright):not(.alignfull))"
)}
{ margin-left: ${marginLeft}; }`;
} else if (justifyContent === "right") {
output += `${appendSelectors(
selector,
"> :where(:not(.alignleft):not(.alignright):not(.alignfull))"
)}
{ margin-right: ${marginRight}; }`;
}
if (style?.spacing?.padding) {
const paddingValues = (0,external_wp_styleEngine_namespaceObject.getCSSRules)(style);
paddingValues.forEach((rule) => {
if (rule.key === "paddingRight") {
const paddingRightValue = rule.value === "0" ? "0px" : rule.value;
output += `
${appendSelectors(selector, "> .alignfull")} {
margin-right: calc(${paddingRightValue} * -1);
}
`;
} else if (rule.key === "paddingLeft") {
const paddingLeftValue = rule.value === "0" ? "0px" : rule.value;
output += `
${appendSelectors(selector, "> .alignfull")} {
margin-left: calc(${paddingLeftValue} * -1);
}
`;
}
});
}
if (hasBlockGapSupport && blockGapValue) {
output += getBlockGapCSS(
selector,
layoutDefinitions,
"constrained",
blockGapValue
);
}
return output;
},
getOrientation() {
return "vertical";
},
getAlignments(layout) {
const alignmentInfo = getAlignmentsInfo(layout);
if (layout.alignments !== void 0) {
if (!layout.alignments.includes("none")) {
layout.alignments.unshift("none");
}
return layout.alignments.map((alignment) => ({
name: alignment,
info: alignmentInfo[alignment]
}));
}
const { contentSize, wideSize } = layout;
const alignments = [
{ name: "left" },
{ name: "center" },
{ name: "right" }
];
if (contentSize) {
alignments.unshift({ name: "full" });
}
if (wideSize) {
alignments.unshift({ name: "wide", info: alignmentInfo.wide });
}
alignments.unshift({ name: "none", info: alignmentInfo.none });
return alignments;
}
};
const constrained_POPOVER_PROPS = {
placement: "bottom-start"
};
function DefaultLayoutJustifyContentControl({ layout, onChange }) {
const { justifyContent = "center" } = layout;
const onJustificationChange = (value) => {
onChange({
...layout,
justifyContent: value
});
};
const allowedControls = ["left", "center", "right"];
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
JustifyContentControl,
{
allowedControls,
value: justifyContent,
onChange: onJustificationChange,
popoverProps: constrained_POPOVER_PROPS
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/layouts/grid.js
const RANGE_CONTROL_MAX_VALUES = {
px: 600,
"%": 100,
vw: 100,
vh: 100,
em: 38,
rem: 38,
svw: 100,
lvw: 100,
dvw: 100,
svh: 100,
lvh: 100,
dvh: 100,
vi: 100,
svi: 100,
lvi: 100,
dvi: 100,
vb: 100,
svb: 100,
lvb: 100,
dvb: 100,
vmin: 100,
svmin: 100,
lvmin: 100,
dvmin: 100,
vmax: 100,
svmax: 100,
lvmax: 100,
dvmax: 100
};
const units = [
{ value: "px", label: "px", default: 0 },
{ value: "rem", label: "rem", default: 0 },
{ value: "em", label: "em", default: 0 }
];
var grid_default = {
name: "grid",
label: (0,external_wp_i18n_namespaceObject.__)("Grid"),
inspectorControls: function GridLayoutInspectorControls({
layout = {},
onChange,
layoutBlockSupport = {}
}) {
const { allowSizingOnChildren = false } = layoutBlockSupport;
const showColumnsControl = window.__experimentalEnableGridInteractivity || !!layout?.columnCount;
const showMinWidthControl = window.__experimentalEnableGridInteractivity || !layout?.columnCount;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridLayoutTypeControl,
{
layout,
onChange
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
showColumnsControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridLayoutColumnsAndRowsControl,
{
layout,
onChange,
allowSizingOnChildren
}
),
showMinWidthControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridLayoutMinimumWidthControl,
{
layout,
onChange
}
)
] })
] });
},
toolBarControls: function GridLayoutToolbarControls() {
return null;
},
getLayoutStyle: function getLayoutStyle({
selector,
layout,
style,
blockName,
hasBlockGapSupport,
layoutDefinitions = LAYOUT_DEFINITIONS
}) {
const {
minimumColumnWidth = null,
columnCount = null,
rowCount = null
} = layout;
if (false) {}
const blockGapValue = style?.spacing?.blockGap && !shouldSkipSerialization(blockName, "spacing", "blockGap") ? getGapCSSValue(style?.spacing?.blockGap, "0.5em") : void 0;
let output = "";
const rules = [];
if (minimumColumnWidth && columnCount > 0) {
const maxValue = `max(${minimumColumnWidth}, ( 100% - (${blockGapValue || "1.2rem"}*${columnCount - 1}) ) / ${columnCount})`;
rules.push(
`grid-template-columns: repeat(auto-fill, minmax(${maxValue}, 1fr))`,
`container-type: inline-size`
);
if (rowCount) {
rules.push(
`grid-template-rows: repeat(${rowCount}, minmax(1rem, auto))`
);
}
} else if (columnCount) {
rules.push(
`grid-template-columns: repeat(${columnCount}, minmax(0, 1fr))`
);
if (rowCount) {
rules.push(
`grid-template-rows: repeat(${rowCount}, minmax(1rem, auto))`
);
}
} else {
rules.push(
`grid-template-columns: repeat(auto-fill, minmax(min(${minimumColumnWidth || "12rem"}, 100%), 1fr))`,
"container-type: inline-size"
);
}
if (rules.length) {
output = `${appendSelectors(selector)} { ${rules.join(
"; "
)}; }`;
}
if (hasBlockGapSupport && blockGapValue) {
output += getBlockGapCSS(
selector,
layoutDefinitions,
"grid",
blockGapValue
);
}
return output;
},
getOrientation() {
return "horizontal";
},
getAlignments() {
return [];
}
};
function GridLayoutMinimumWidthControl({ layout, onChange }) {
const { minimumColumnWidth, columnCount, isManualPlacement } = layout;
const defaultValue = isManualPlacement || columnCount ? null : "12rem";
const value = minimumColumnWidth || defaultValue;
const [quantity, unit = "rem"] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
const handleSliderChange = (next) => {
onChange({
...layout,
minimumColumnWidth: [next, unit].join("")
});
};
const handleUnitChange = (newUnit) => {
let newValue;
if (["em", "rem"].includes(newUnit) && unit === "px") {
newValue = (quantity / 16).toFixed(2) + newUnit;
} else if (["em", "rem"].includes(unit) && newUnit === "px") {
newValue = Math.round(quantity * 16) + newUnit;
}
onChange({
...layout,
minimumColumnWidth: newValue
});
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "block-editor-hooks__grid-layout-minimum-width-control", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { as: "legend", children: (0,external_wp_i18n_namespaceObject.__)("Minimum column width") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { gap: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
size: "__unstable-large",
onChange: (newValue) => {
onChange({
...layout,
minimumColumnWidth: newValue === "" ? void 0 : newValue
});
},
onUnitChange: handleUnitChange,
value,
units,
min: 0,
label: (0,external_wp_i18n_namespaceObject.__)("Minimum column width"),
hideLabelFromVision: true
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.RangeControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
onChange: handleSliderChange,
value: quantity || 0,
min: 0,
max: RANGE_CONTROL_MAX_VALUES[unit] || 600,
withInputField: false,
label: (0,external_wp_i18n_namespaceObject.__)("Minimum column width"),
hideLabelFromVision: true
}
) })
] })
] });
}
function GridLayoutColumnsAndRowsControl({
layout,
onChange,
allowSizingOnChildren
}) {
const defaultColumnCount = window.__experimentalEnableGridInteractivity ? void 0 : 3;
const {
columnCount = defaultColumnCount,
rowCount,
isManualPlacement
} = layout;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "block-editor-hooks__grid-layout-columns-and-rows-controls", children: [
(!window.__experimentalEnableGridInteractivity || !isManualPlacement) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { as: "legend", children: (0,external_wp_i18n_namespaceObject.__)("Columns") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { gap: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalNumberControl,
{
size: "__unstable-large",
onChange: (value) => {
if (window.__experimentalEnableGridInteractivity) {
const defaultNewColumnCount = isManualPlacement ? 1 : void 0;
const newColumnCount = value === "" || value === "0" ? defaultNewColumnCount : parseInt(value, 10);
onChange({
...layout,
columnCount: newColumnCount
});
} else {
const newColumnCount = value === "" || value === "0" ? 1 : parseInt(value, 10);
onChange({
...layout,
columnCount: newColumnCount
});
}
},
value: columnCount,
min: 1,
label: (0,external_wp_i18n_namespaceObject.__)("Columns"),
hideLabelFromVision: !window.__experimentalEnableGridInteractivity || !isManualPlacement
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, children: window.__experimentalEnableGridInteractivity && allowSizingOnChildren && isManualPlacement ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalNumberControl,
{
size: "__unstable-large",
onChange: (value) => {
const newRowCount = value === "" || value === "0" ? 1 : parseInt(value, 10);
onChange({
...layout,
rowCount: newRowCount
});
},
value: rowCount,
min: 1,
label: (0,external_wp_i18n_namespaceObject.__)("Rows")
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.RangeControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
value: columnCount ?? 1,
onChange: (value) => onChange({
...layout,
columnCount: value === "" || value === "0" ? 1 : value
}),
min: 1,
max: 16,
withInputField: false,
label: (0,external_wp_i18n_namespaceObject.__)("Columns"),
hideLabelFromVision: true
}
) })
] })
] }) });
}
function GridLayoutTypeControl({ layout, onChange }) {
const { columnCount, rowCount, minimumColumnWidth, isManualPlacement } = layout;
const [tempColumnCount, setTempColumnCount] = (0,external_wp_element_namespaceObject.useState)(
columnCount || 3
);
const [tempRowCount, setTempRowCount] = (0,external_wp_element_namespaceObject.useState)(rowCount);
const [tempMinimumColumnWidth, setTempMinimumColumnWidth] = (0,external_wp_element_namespaceObject.useState)(
minimumColumnWidth || "12rem"
);
const gridPlacement = isManualPlacement || !!columnCount && !window.__experimentalEnableGridInteractivity ? "manual" : "auto";
const onChangeType = (value) => {
if (value === "manual") {
setTempMinimumColumnWidth(minimumColumnWidth || "12rem");
} else {
setTempColumnCount(columnCount || 3);
setTempRowCount(rowCount);
}
onChange({
...layout,
columnCount: value === "manual" ? tempColumnCount : null,
rowCount: value === "manual" && window.__experimentalEnableGridInteractivity ? tempRowCount : void 0,
isManualPlacement: value === "manual" && window.__experimentalEnableGridInteractivity ? true : void 0,
minimumColumnWidth: value === "auto" ? tempMinimumColumnWidth : null
});
};
const helpText = gridPlacement === "manual" ? (0,external_wp_i18n_namespaceObject.__)(
"Grid items can be manually placed in any position on the grid."
) : (0,external_wp_i18n_namespaceObject.__)(
"Grid items are placed automatically depending on their order."
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Grid item position"),
value: gridPlacement,
onChange: onChangeType,
isBlock: true,
help: window.__experimentalEnableGridInteractivity ? helpText : void 0,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "auto",
label: (0,external_wp_i18n_namespaceObject.__)("Auto")
},
"auto"
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "manual",
label: (0,external_wp_i18n_namespaceObject.__)("Manual")
},
"manual"
)
]
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/layouts/index.js
const layoutTypes = [flow_default, flex_default, constrained_default, grid_default];
function getLayoutType(name = "default") {
return layoutTypes.find((layoutType) => layoutType.name === name);
}
function getLayoutTypes() {
return layoutTypes;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/layout.js
const defaultLayout = { type: "default" };
const Layout = (0,external_wp_element_namespaceObject.createContext)(defaultLayout);
Layout.displayName = "BlockLayoutContext";
const LayoutProvider = Layout.Provider;
function useLayout() {
return (0,external_wp_element_namespaceObject.useContext)(Layout);
}
function LayoutStyle({ layout = {}, css, ...props }) {
const layoutType = getLayoutType(layout.type);
const [blockGapSupport] = use_settings_useSettings("spacing.blockGap");
const hasBlockGapSupport = blockGapSupport !== null;
if (layoutType) {
if (css) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("style", { children: css });
}
const layoutStyle = layoutType.getLayoutStyle?.({
hasBlockGapSupport,
layout,
...props
});
if (layoutStyle) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("style", { children: layoutStyle });
}
}
return null;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/use-available-alignments.js
const use_available_alignments_EMPTY_ARRAY = [];
const use_available_alignments_DEFAULT_CONTROLS = ["none", "left", "center", "right", "wide", "full"];
const WIDE_CONTROLS = ["wide", "full"];
function useAvailableAlignments(controls = use_available_alignments_DEFAULT_CONTROLS) {
if (!controls.includes("none")) {
controls = ["none", ...controls];
}
const isNoneOnly = controls.length === 1 && controls[0] === "none";
const [wideControlsEnabled, themeSupportsLayout, isBlockBasedTheme] = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
if (isNoneOnly) {
return [false, false, false];
}
const settings = select(store).getSettings();
return [
settings.alignWide ?? false,
settings.supportsLayout,
settings.__unstableIsBlockBasedTheme
];
},
[isNoneOnly]
);
const layout = useLayout();
if (isNoneOnly) {
return use_available_alignments_EMPTY_ARRAY;
}
const layoutType = getLayoutType(layout?.type);
if (themeSupportsLayout) {
const layoutAlignments = layoutType.getAlignments(
layout,
isBlockBasedTheme
);
const alignments2 = layoutAlignments.filter(
(alignment) => controls.includes(alignment.name)
);
if (alignments2.length === 1 && alignments2[0].name === "none") {
return use_available_alignments_EMPTY_ARRAY;
}
return alignments2;
}
if (layoutType.name !== "default" && layoutType.name !== "constrained") {
return use_available_alignments_EMPTY_ARRAY;
}
const alignments = controls.filter((control) => {
if (layout.alignments) {
return layout.alignments.includes(control);
}
if (!wideControlsEnabled && WIDE_CONTROLS.includes(control)) {
return false;
}
return use_available_alignments_DEFAULT_CONTROLS.includes(control);
}).map((name) => ({ name }));
if (alignments.length === 1 && alignments[0].name === "none") {
return use_available_alignments_EMPTY_ARRAY;
}
return alignments;
}
;// ./node_modules/@wordpress/icons/build-module/library/position-left.js
var position_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/position-center.js
var position_center_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/position-right.js
var position_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/stretch-full-width.js
var stretch_full_width_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5 4h14v11H5V4Zm11 16H8v-1.5h8V20Z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/constants.js
const constants_BLOCK_ALIGNMENTS_CONTROLS = {
none: {
icon: align_none_default,
title: (0,external_wp_i18n_namespaceObject._x)("None", "Alignment option")
},
left: {
icon: position_left_default,
title: (0,external_wp_i18n_namespaceObject.__)("Align left")
},
center: {
icon: position_center_default,
title: (0,external_wp_i18n_namespaceObject.__)("Align center")
},
right: {
icon: position_right_default,
title: (0,external_wp_i18n_namespaceObject.__)("Align right")
},
wide: {
icon: stretch_wide_default,
title: (0,external_wp_i18n_namespaceObject.__)("Wide width")
},
full: {
icon: stretch_full_width_default,
title: (0,external_wp_i18n_namespaceObject.__)("Full width")
}
};
const constants_DEFAULT_CONTROL = "none";
;// ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/ui.js
function BlockAlignmentUI({
value,
onChange,
controls,
isToolbar,
isCollapsed = true
}) {
const enabledControls = useAvailableAlignments(controls);
const hasEnabledControls = !!enabledControls.length;
if (!hasEnabledControls) {
return null;
}
function onChangeAlignment(align) {
onChange([value, "none"].includes(align) ? void 0 : align);
}
const activeAlignmentControl = constants_BLOCK_ALIGNMENTS_CONTROLS[value];
const defaultAlignmentControl = constants_BLOCK_ALIGNMENTS_CONTROLS[constants_DEFAULT_CONTROL];
const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu;
const commonProps = {
icon: activeAlignmentControl ? activeAlignmentControl.icon : defaultAlignmentControl.icon,
label: (0,external_wp_i18n_namespaceObject.__)("Align")
};
const extraProps = isToolbar ? {
isCollapsed,
controls: enabledControls.map(({ name: controlName }) => {
return {
...constants_BLOCK_ALIGNMENTS_CONTROLS[controlName],
isActive: value === controlName || !value && controlName === "none",
role: isCollapsed ? "menuitemradio" : void 0,
onClick: () => onChangeAlignment(controlName)
};
})
} : {
toggleProps: { description: (0,external_wp_i18n_namespaceObject.__)("Change alignment") },
children: ({ onClose }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { className: "block-editor-block-alignment-control__menu-group", children: enabledControls.map(
({ name: controlName, info }) => {
const { icon, title } = constants_BLOCK_ALIGNMENTS_CONTROLS[controlName];
const isSelected = controlName === value || !value && controlName === "none";
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
icon,
iconPosition: "left",
className: dist_clsx(
"components-dropdown-menu__menu-item",
{
"is-active": isSelected
}
),
isSelected,
onClick: () => {
onChangeAlignment(
controlName
);
onClose();
},
role: "menuitemradio",
info,
children: title
},
controlName
);
}
) }) });
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(UIComponent, { ...commonProps, ...extraProps });
}
var block_alignment_control_ui_ui_default = BlockAlignmentUI;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/index.js
const BlockAlignmentControl = (props) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_alignment_control_ui_ui_default, { ...props, isToolbar: false });
};
const BlockAlignmentToolbar = (props) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_alignment_control_ui_ui_default, { ...props, isToolbar: true });
};
;// ./node_modules/@wordpress/block-editor/build-module/components/block-editing-mode/index.js
function useBlockEditingMode(mode) {
const context = useBlockEditContext();
const { clientId = "" } = context;
const { setBlockEditingMode, unsetBlockEditingMode } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const globalBlockEditingMode = (0,external_wp_data_namespaceObject.useSelect)(
(select) => (
// Avoid adding the subscription if not needed!
clientId ? null : select(store).getBlockEditingMode()
),
[clientId]
);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (mode) {
setBlockEditingMode(clientId, mode);
}
return () => {
if (mode) {
unsetBlockEditingMode(clientId);
}
};
}, [clientId, mode, setBlockEditingMode, unsetBlockEditingMode]);
return clientId ? context[blockEditingModeKey] : globalBlockEditingMode;
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/align.js
const ALL_ALIGNMENTS = ["left", "center", "right", "wide", "full"];
const WIDE_ALIGNMENTS = ["wide", "full"];
function getValidAlignments(blockAlign, hasWideBlockSupport = true, hasWideEnabled = true) {
let validAlignments;
if (Array.isArray(blockAlign)) {
validAlignments = ALL_ALIGNMENTS.filter(
(value) => blockAlign.includes(value)
);
} else if (blockAlign === true) {
validAlignments = [...ALL_ALIGNMENTS];
} else {
validAlignments = [];
}
if (!hasWideEnabled || blockAlign === true && !hasWideBlockSupport) {
return validAlignments.filter(
(alignment) => !WIDE_ALIGNMENTS.includes(alignment)
);
}
return validAlignments;
}
function addAttribute(settings) {
if ("type" in (settings.attributes?.align ?? {})) {
return settings;
}
if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, "align")) {
settings.attributes = {
...settings.attributes,
align: {
type: "string",
// Allow for '' since it is used by the `updateAlignment` function
// in toolbar controls for special cases with defined default values.
enum: [...ALL_ALIGNMENTS, ""]
}
};
}
return settings;
}
function BlockEditAlignmentToolbarControlsPure({
name: blockName,
align,
setAttributes
}) {
const blockAllowedAlignments = getValidAlignments(
(0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, "align"),
(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, "alignWide", true)
);
const validAlignments = useAvailableAlignments(
blockAllowedAlignments
).map(({ name }) => name);
const blockEditingMode = useBlockEditingMode();
if (!validAlignments.length || blockEditingMode !== "default") {
return null;
}
const updateAlignment = (nextAlign) => {
if (!nextAlign) {
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName);
const blockDefaultAlign = blockType?.attributes?.align?.default;
if (blockDefaultAlign) {
nextAlign = "";
}
}
setAttributes({ align: nextAlign });
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls_default, { group: "block", __experimentalShareWithChildBlocks: true, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockAlignmentControl,
{
value: align,
onChange: updateAlignment,
controls: validAlignments
}
) });
}
var align_default = {
shareWithChildBlocks: true,
edit: BlockEditAlignmentToolbarControlsPure,
useBlockProps,
addSaveProps: addAssignedAlign,
attributeKeys: ["align"],
hasSupport(name) {
return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, "align", false);
}
};
function useBlockProps({ name, align }) {
const blockAllowedAlignments = getValidAlignments(
(0,external_wp_blocks_namespaceObject.getBlockSupport)(name, "align"),
(0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, "alignWide", true)
);
const validAlignments = useAvailableAlignments(blockAllowedAlignments);
if (validAlignments.some((alignment) => alignment.name === align)) {
return { "data-align": align };
}
return {};
}
function addAssignedAlign(props, blockType, attributes) {
const { align } = attributes;
const blockAlign = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, "align");
const hasWideBlockSupport = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, "alignWide", true);
const isAlignValid = getValidAlignments(
blockAlign,
hasWideBlockSupport
).includes(align);
if (isAlignValid) {
props.className = dist_clsx(`align${align}`, props.className);
}
return props;
}
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.registerBlockType",
"core/editor/align/addAttribute",
addAttribute
);
;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/groups.js
const InspectorControlsDefault = (0,external_wp_components_namespaceObject.createSlotFill)("InspectorControls");
const InspectorControlsAdvanced = (0,external_wp_components_namespaceObject.createSlotFill)("InspectorAdvancedControls");
const InspectorControlsBindings = (0,external_wp_components_namespaceObject.createSlotFill)("InspectorControlsBindings");
const InspectorControlsBackground = (0,external_wp_components_namespaceObject.createSlotFill)(
"InspectorControlsBackground"
);
const InspectorControlsBorder = (0,external_wp_components_namespaceObject.createSlotFill)("InspectorControlsBorder");
const InspectorControlsColor = (0,external_wp_components_namespaceObject.createSlotFill)("InspectorControlsColor");
const InspectorControlsFilter = (0,external_wp_components_namespaceObject.createSlotFill)("InspectorControlsFilter");
const InspectorControlsDimensions = (0,external_wp_components_namespaceObject.createSlotFill)(
"InspectorControlsDimensions"
);
const InspectorControlsPosition = (0,external_wp_components_namespaceObject.createSlotFill)("InspectorControlsPosition");
const InspectorControlsTypography = (0,external_wp_components_namespaceObject.createSlotFill)(
"InspectorControlsTypography"
);
const InspectorControlsListView = (0,external_wp_components_namespaceObject.createSlotFill)("InspectorControlsListView");
const InspectorControlsStyles = (0,external_wp_components_namespaceObject.createSlotFill)("InspectorControlsStyles");
const InspectorControlsEffects = (0,external_wp_components_namespaceObject.createSlotFill)("InspectorControlsEffects");
const groups_groups = {
default: InspectorControlsDefault,
advanced: InspectorControlsAdvanced,
background: InspectorControlsBackground,
bindings: InspectorControlsBindings,
border: InspectorControlsBorder,
color: InspectorControlsColor,
dimensions: InspectorControlsDimensions,
effects: InspectorControlsEffects,
filter: InspectorControlsFilter,
list: InspectorControlsListView,
position: InspectorControlsPosition,
settings: InspectorControlsDefault,
// Alias for default.
styles: InspectorControlsStyles,
typography: InspectorControlsTypography
};
var groups_groups_default = groups_groups;
const PrivateInspectorControlsAllowedBlocks = (0,external_wp_components_namespaceObject.createSlotFill)(
Symbol("PrivateInspectorControlsAllowedBlocks")
);
;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/fill.js
function InspectorControlsFill({
children,
group = "default",
__experimentalGroup,
resetAllFilter
}) {
if (__experimentalGroup) {
external_wp_deprecated_default()(
"`__experimentalGroup` property in `InspectorControlsFill`",
{
since: "6.2",
version: "6.4",
alternative: "`group`"
}
);
group = __experimentalGroup;
}
const context = useBlockEditContext();
const Fill = groups_groups_default[group]?.Fill;
if (!Fill) {
external_wp_warning_default()(`Unknown InspectorControls group "${group}" provided.`);
return null;
}
if (!context[mayDisplayControlsKey]) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalStyleProvider, { document, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Fill, { children: (fillProps) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ToolsPanelInspectorControl,
{
fillProps,
children,
resetAllFilter
}
);
} }) });
}
function RegisterResetAll({ resetAllFilter, children }) {
const { registerResetAllFilter, deregisterResetAllFilter } = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.__experimentalToolsPanelContext);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (resetAllFilter && registerResetAllFilter && deregisterResetAllFilter) {
registerResetAllFilter(resetAllFilter);
return () => {
deregisterResetAllFilter(resetAllFilter);
};
}
}, [resetAllFilter, registerResetAllFilter, deregisterResetAllFilter]);
return children;
}
function ToolsPanelInspectorControl({ children, resetAllFilter, fillProps }) {
const { forwardedContext = [] } = fillProps;
const innerMarkup = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RegisterResetAll, { resetAllFilter, children });
return forwardedContext.reduce(
(inner, [Provider, props]) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, { ...props, children: inner }),
innerMarkup
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/block-support-tools-panel.js
function BlockSupportToolsPanel({ children, group, label }) {
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const {
getBlockAttributes,
getMultiSelectedBlockClientIds,
getSelectedBlockClientId,
hasMultiSelection
} = (0,external_wp_data_namespaceObject.useSelect)(store);
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const panelId = getSelectedBlockClientId();
const resetAll = (0,external_wp_element_namespaceObject.useCallback)(
(resetFilters = []) => {
const newAttributes = {};
const clientIds = hasMultiSelection() ? getMultiSelectedBlockClientIds() : [panelId];
clientIds.forEach((clientId) => {
const { style } = getBlockAttributes(clientId);
let newBlockAttributes = { style };
resetFilters.forEach((resetFilter) => {
newBlockAttributes = {
...newBlockAttributes,
...resetFilter(newBlockAttributes)
};
});
newBlockAttributes = {
...newBlockAttributes,
style: utils_cleanEmptyObject(newBlockAttributes.style)
};
newAttributes[clientId] = newBlockAttributes;
});
updateBlockAttributes(clientIds, newAttributes, true);
},
[
getBlockAttributes,
getMultiSelectedBlockClientIds,
hasMultiSelection,
panelId,
updateBlockAttributes
]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
className: `${group}-block-support-panel`,
label,
resetAll,
panelId,
hasInnerWrapper: true,
shouldRenderPlaceholderItems: true,
__experimentalFirstVisibleItemClass: "first",
__experimentalLastVisibleItemClass: "last",
dropdownMenuProps,
children
},
panelId
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/block-support-slot-container.js
function BlockSupportSlotContainer({
Slot,
fillProps,
...props
}) {
const toolsPanelContext = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.__experimentalToolsPanelContext);
const computedFillProps = (0,external_wp_element_namespaceObject.useMemo)(
() => ({
...fillProps ?? {},
forwardedContext: [
...fillProps?.forwardedContext ?? [],
[external_wp_components_namespaceObject.__experimentalToolsPanelContext.Provider, { value: toolsPanelContext }]
]
}),
[toolsPanelContext, fillProps]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Slot, { ...props, fillProps: computedFillProps, bubblesVirtually: true });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/slot.js
function InspectorControlsSlot({
__experimentalGroup,
group = "default",
label,
fillProps,
...props
}) {
if (__experimentalGroup) {
external_wp_deprecated_default()(
"`__experimentalGroup` property in `InspectorControlsSlot`",
{
since: "6.2",
version: "6.4",
alternative: "`group`"
}
);
group = __experimentalGroup;
}
const slotFill = groups_groups_default[group];
const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(slotFill?.name);
if (!slotFill) {
external_wp_warning_default()(`Unknown InspectorControls group "${group}" provided.`);
return null;
}
if (!fills?.length) {
return null;
}
const { Slot } = slotFill;
if (label) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockSupportToolsPanel, { group, label, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockSupportSlotContainer,
{
...props,
fillProps,
Slot
}
) });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Slot, { ...props, fillProps, bubblesVirtually: true });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/index.js
const InspectorControls = InspectorControlsFill;
InspectorControls.Slot = InspectorControlsSlot;
const InspectorAdvancedControls = (props) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorControlsFill, { ...props, group: "advanced" });
};
InspectorAdvancedControls.Slot = (props) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorControlsSlot, { ...props, group: "advanced" });
};
InspectorAdvancedControls.slotName = "InspectorAdvancedControls";
var inspector_controls_default = InspectorControls;
;// ./node_modules/@wordpress/icons/build-module/library/reset.js
var reset_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7 11.5h10V13H7z" }) });
;// external ["wp","url"]
const external_wp_url_namespaceObject = window["wp"]["url"];
;// external ["wp","dom"]
const external_wp_dom_namespaceObject = window["wp"]["dom"];
;// external ["wp","blob"]
const external_wp_blob_namespaceObject = window["wp"]["blob"];
;// external ["wp","keycodes"]
const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
;// ./node_modules/@wordpress/icons/build-module/library/media.js
var media_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7 6.5 4 2.5-4 2.5z" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z"
}
)
] });
;// ./node_modules/@wordpress/icons/build-module/library/upload.js
var upload_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/post-featured-image.js
var post_featured_image_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/media-upload/index.js
const MediaUpload = () => null;
var media_upload_default = (0,external_wp_components_namespaceObject.withFilters)("editor.MediaUpload")(MediaUpload);
;// ./node_modules/@wordpress/block-editor/build-module/components/media-upload/check.js
function MediaUploadCheck({ fallback = null, children }) {
const hasUploadPermissions = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getSettings } = select(store);
return !!getSettings().mediaUpload;
}, []);
return hasUploadPermissions ? children : fallback;
}
var check_default = MediaUploadCheck;
;// external ["wp","isShallowEqual"]
const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"];
var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject);
;// ./node_modules/@wordpress/icons/build-module/library/link-off.js
var link_off_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js
var keyboard_return_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/chevron-left-small.js
var chevron_left_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js
var chevron_right_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/settings-drawer.js
function LinkSettingsDrawer({ children, settingsOpen, setSettingsOpen }) {
const prefersReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
const MaybeAnimatePresence = prefersReducedMotion ? external_wp_element_namespaceObject.Fragment : external_wp_components_namespaceObject.__unstableAnimatePresence;
const MaybeMotionDiv = prefersReducedMotion ? "div" : external_wp_components_namespaceObject.__unstableMotion.div;
const id = (0,external_wp_compose_namespaceObject.useInstanceId)(LinkSettingsDrawer);
const settingsDrawerId = `link-control-settings-drawer-${id}`;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
className: "block-editor-link-control__drawer-toggle",
"aria-expanded": settingsOpen,
onClick: () => setSettingsOpen(!settingsOpen),
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_small_default : chevron_right_small_default,
"aria-controls": settingsDrawerId,
children: (0,external_wp_i18n_namespaceObject._x)("Advanced", "Additional link settings")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MaybeAnimatePresence, { children: settingsOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
MaybeMotionDiv,
{
className: "block-editor-link-control__drawer",
hidden: !settingsOpen,
id: settingsDrawerId,
initial: "collapsed",
animate: "open",
exit: "collapsed",
variants: {
open: { opacity: 1, height: "auto" },
collapsed: { opacity: 0, height: 0 }
},
transition: {
duration: 0.1
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-link-control__drawer-inner", children })
}
) })
] });
}
var settings_drawer_default = LinkSettingsDrawer;
// EXTERNAL MODULE: external "React"
var external_React_ = __webpack_require__(1609);
;// ./node_modules/@wordpress/block-editor/build-module/components/url-input/index.js
function isFunction(maybeFunc) {
return typeof maybeFunc === "function";
}
class URLInput extends external_wp_element_namespaceObject.Component {
constructor(props) {
super(props);
this.onChange = this.onChange.bind(this);
this.onFocus = this.onFocus.bind(this);
this.onKeyDown = this.onKeyDown.bind(this);
this.selectLink = this.selectLink.bind(this);
this.handleOnClick = this.handleOnClick.bind(this);
this.bindSuggestionNode = this.bindSuggestionNode.bind(this);
this.autocompleteRef = props.autocompleteRef || (0,external_wp_element_namespaceObject.createRef)();
this.inputRef = props.inputRef || (0,external_wp_element_namespaceObject.createRef)();
this.updateSuggestions = (0,external_wp_compose_namespaceObject.debounce)(
this.updateSuggestions.bind(this),
200
);
this.suggestionNodes = [];
this.suggestionsRequest = null;
this.state = {
suggestions: [],
showSuggestions: false,
suggestionsValue: null,
selectedSuggestion: null,
suggestionsListboxId: "",
suggestionOptionIdPrefix: ""
};
}
componentDidUpdate(prevProps) {
const { showSuggestions, selectedSuggestion } = this.state;
const { value, __experimentalShowInitialSuggestions = false } = this.props;
if (showSuggestions && selectedSuggestion !== null && this.suggestionNodes[selectedSuggestion]) {
this.suggestionNodes[selectedSuggestion].scrollIntoView({
behavior: "instant",
block: "nearest",
inline: "nearest"
});
}
if (prevProps.value !== value && !this.props.disableSuggestions) {
if (value?.length) {
this.updateSuggestions(value);
} else if (__experimentalShowInitialSuggestions) {
this.updateSuggestions();
}
}
}
componentDidMount() {
if (this.shouldShowInitialSuggestions()) {
this.updateSuggestions();
}
}
componentWillUnmount() {
this.suggestionsRequest?.cancel?.();
this.suggestionsRequest = null;
}
bindSuggestionNode(index) {
return (ref) => {
this.suggestionNodes[index] = ref;
};
}
shouldShowInitialSuggestions() {
const { __experimentalShowInitialSuggestions = false, value } = this.props;
return __experimentalShowInitialSuggestions && !(value && value.length);
}
updateSuggestions(value = "") {
const {
__experimentalFetchLinkSuggestions: fetchLinkSuggestions,
__experimentalHandleURLSuggestions: handleURLSuggestions
} = this.props;
if (!fetchLinkSuggestions) {
return;
}
const isInitialSuggestions = !value?.length;
value = value.trim();
if (!isInitialSuggestions && (value.length < 2 || !handleURLSuggestions && (0,external_wp_url_namespaceObject.isURL)(value))) {
this.suggestionsRequest?.cancel?.();
this.suggestionsRequest = null;
this.setState({
suggestions: [],
showSuggestions: false,
suggestionsValue: value,
selectedSuggestion: null,
loading: false
});
return;
}
this.setState({
selectedSuggestion: null,
loading: true
});
const request = fetchLinkSuggestions(value, {
isInitialSuggestions
});
request.then((suggestions) => {
if (this.suggestionsRequest !== request) {
return;
}
this.setState({
suggestions,
suggestionsValue: value,
loading: false,
showSuggestions: !!suggestions.length
});
if (!!suggestions.length) {
this.props.debouncedSpeak(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: number of results. */
(0,external_wp_i18n_namespaceObject._n)(
"%d result found, use up and down arrow keys to navigate.",
"%d results found, use up and down arrow keys to navigate.",
suggestions.length
),
suggestions.length
),
"assertive"
);
} else {
this.props.debouncedSpeak(
(0,external_wp_i18n_namespaceObject.__)("No results."),
"assertive"
);
}
}).catch(() => {
if (this.suggestionsRequest !== request) {
return;
}
this.setState({
loading: false
});
}).finally(() => {
if (this.suggestionsRequest === request) {
this.suggestionsRequest = null;
}
});
this.suggestionsRequest = request;
}
onChange(newValue) {
this.props.onChange(newValue);
}
onFocus() {
const { suggestions } = this.state;
const { disableSuggestions, value } = this.props;
if (value && !disableSuggestions && !(suggestions && suggestions.length) && this.suggestionsRequest === null) {
this.updateSuggestions(value);
}
}
onKeyDown(event) {
this.props.onKeyDown?.(event);
const { showSuggestions, selectedSuggestion, suggestions, loading } = this.state;
if (!showSuggestions || !suggestions.length || loading) {
switch (event.keyCode) {
// When UP is pressed, if the caret is at the start of the text, move it to the 0
// position.
case external_wp_keycodes_namespaceObject.UP: {
if (0 !== event.target.selectionStart) {
event.preventDefault();
event.target.setSelectionRange(0, 0);
}
break;
}
// When DOWN is pressed, if the caret is not at the end of the text, move it to the
// last position.
case external_wp_keycodes_namespaceObject.DOWN: {
if (this.props.value.length !== event.target.selectionStart) {
event.preventDefault();
event.target.setSelectionRange(
this.props.value.length,
this.props.value.length
);
}
break;
}
// Submitting while loading should trigger onSubmit.
case external_wp_keycodes_namespaceObject.ENTER: {
if (this.props.onSubmit) {
event.preventDefault();
this.props.onSubmit(null, event);
}
break;
}
}
return;
}
const suggestion = this.state.suggestions[this.state.selectedSuggestion];
switch (event.keyCode) {
case external_wp_keycodes_namespaceObject.UP: {
event.preventDefault();
const previousIndex = !selectedSuggestion ? suggestions.length - 1 : selectedSuggestion - 1;
this.setState({
selectedSuggestion: previousIndex
});
break;
}
case external_wp_keycodes_namespaceObject.DOWN: {
event.preventDefault();
const nextIndex = selectedSuggestion === null || selectedSuggestion === suggestions.length - 1 ? 0 : selectedSuggestion + 1;
this.setState({
selectedSuggestion: nextIndex
});
break;
}
case external_wp_keycodes_namespaceObject.TAB: {
if (this.state.selectedSuggestion !== null) {
this.selectLink(suggestion);
this.props.speak((0,external_wp_i18n_namespaceObject.__)("Link selected."));
}
break;
}
case external_wp_keycodes_namespaceObject.ENTER: {
event.preventDefault();
if (this.state.selectedSuggestion !== null) {
this.selectLink(suggestion);
if (this.props.onSubmit) {
this.props.onSubmit(suggestion, event);
}
} else if (this.props.onSubmit) {
this.props.onSubmit(null, event);
}
break;
}
}
}
selectLink(suggestion) {
this.props.onChange(suggestion.url, suggestion);
this.setState({
selectedSuggestion: null,
showSuggestions: false
});
}
handleOnClick(suggestion) {
this.selectLink(suggestion);
this.inputRef.current.focus();
}
static getDerivedStateFromProps({
value,
instanceId,
disableSuggestions,
__experimentalShowInitialSuggestions = false
}, { showSuggestions }) {
let shouldShowSuggestions = showSuggestions;
const hasValue = value && value.length;
if (!__experimentalShowInitialSuggestions && !hasValue) {
shouldShowSuggestions = false;
}
if (disableSuggestions === true) {
shouldShowSuggestions = false;
}
return {
showSuggestions: shouldShowSuggestions,
suggestionsListboxId: `block-editor-url-input-suggestions-${instanceId}`,
suggestionOptionIdPrefix: `block-editor-url-input-suggestion-${instanceId}`
};
}
render() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
this.renderControl(),
this.renderSuggestions()
] });
}
renderControl() {
const {
label = null,
className,
isFullWidth,
instanceId,
placeholder = (0,external_wp_i18n_namespaceObject.__)("Paste URL or type to search"),
__experimentalRenderControl: renderControl,
value = "",
hideLabelFromVision = false,
help = null,
disabled = false
} = this.props;
const {
loading,
showSuggestions,
selectedSuggestion,
suggestionsListboxId,
suggestionOptionIdPrefix
} = this.state;
const inputId = `url-input-control-${instanceId}`;
const controlProps = {
id: inputId,
// Passes attribute to label for the for attribute
label,
className: dist_clsx("block-editor-url-input", className, {
"is-full-width": isFullWidth
}),
hideLabelFromVision
};
const inputProps = {
id: inputId,
value,
required: true,
type: "text",
onChange: disabled ? () => {
} : this.onChange,
// Disable onChange when disabled
onFocus: disabled ? () => {
} : this.onFocus,
// Disable onFocus when disabled
placeholder,
onKeyDown: disabled ? () => {
} : this.onKeyDown,
// Disable onKeyDown when disabled
role: "combobox",
"aria-label": label ? void 0 : (0,external_wp_i18n_namespaceObject.__)("URL"),
// Ensure input always has an accessible label
"aria-expanded": showSuggestions,
"aria-autocomplete": "list",
"aria-owns": suggestionsListboxId,
"aria-activedescendant": selectedSuggestion !== null ? `${suggestionOptionIdPrefix}-${selectedSuggestion}` : void 0,
ref: this.inputRef,
disabled,
suffix: this.props.suffix,
help
};
if (renderControl) {
return renderControl(controlProps, inputProps, loading);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.BaseControl, { __nextHasNoMarginBottom: true, ...controlProps, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, { ...inputProps, __next40pxDefaultSize: true }),
loading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})
] });
}
renderSuggestions() {
const {
className,
__experimentalRenderSuggestions: renderSuggestions
} = this.props;
const {
showSuggestions,
suggestions,
suggestionsValue,
selectedSuggestion,
suggestionsListboxId,
suggestionOptionIdPrefix,
loading
} = this.state;
if (!showSuggestions || suggestions.length === 0) {
return null;
}
const suggestionsListProps = {
id: suggestionsListboxId,
ref: this.autocompleteRef,
role: "listbox"
};
const buildSuggestionItemProps = (suggestion, index) => {
return {
role: "option",
tabIndex: "-1",
id: `${suggestionOptionIdPrefix}-${index}`,
ref: this.bindSuggestionNode(index),
"aria-selected": index === selectedSuggestion ? true : void 0
};
};
if (isFunction(renderSuggestions)) {
return renderSuggestions({
suggestions,
selectedSuggestion,
suggestionsListProps,
buildSuggestionItemProps,
isLoading: loading,
handleSuggestionClick: this.handleOnClick,
isInitialSuggestions: !suggestionsValue?.length,
currentInputValue: suggestionsValue
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { placement: "bottom", focusOnMount: false, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
...suggestionsListProps,
className: dist_clsx("block-editor-url-input__suggestions", {
[`${className}__suggestions`]: className
}),
children: suggestions.map((suggestion, index) => /* @__PURE__ */ (0,external_React_.createElement)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
...buildSuggestionItemProps(suggestion, index),
key: suggestion.id,
className: dist_clsx(
"block-editor-url-input__suggestion",
{
"is-selected": index === selectedSuggestion
}
),
onClick: () => this.handleOnClick(suggestion)
},
suggestion.title
))
}
) });
}
}
var url_input_default = (0,external_wp_compose_namespaceObject.compose)(
external_wp_compose_namespaceObject.withSafeTimeout,
external_wp_components_namespaceObject.withSpokenMessages,
external_wp_compose_namespaceObject.withInstanceId,
(0,external_wp_data_namespaceObject.withSelect)((select, props) => {
if (isFunction(props.__experimentalFetchLinkSuggestions)) {
return;
}
const { getSettings } = select(store);
return {
__experimentalFetchLinkSuggestions: getSettings().__experimentalFetchLinkSuggestions
};
})
)(URLInput);
;// ./node_modules/@wordpress/icons/build-module/library/plus.js
var plus_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-create-button.js
const LinkControlSearchCreate = ({
searchTerm,
onClick,
itemProps,
buttonText
}) => {
if (!searchTerm) {
return null;
}
let text;
if (buttonText) {
text = typeof buttonText === "function" ? buttonText(searchTerm) : buttonText;
} else {
text = (0,external_wp_element_namespaceObject.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: search term. */
(0,external_wp_i18n_namespaceObject.__)("Create: <mark>%s</mark>"),
searchTerm
),
{ mark: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("mark", {}) }
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
...itemProps,
iconPosition: "left",
icon: plus_default,
className: "block-editor-link-control__search-item",
onClick,
children: text
}
);
};
var search_create_button_default = LinkControlSearchCreate;
;// ./node_modules/@wordpress/icons/build-module/library/post-list.js
var post_list_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 5.5H6a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h12a.5.5 0 0 0 .5-.5V6a.5.5 0 0 0-.5-.5ZM6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm1 5h1.5v1.5H7V9Zm1.5 4.5H7V15h1.5v-1.5ZM10 9h7v1.5h-7V9Zm7 4.5h-7V15h7v-1.5Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/page.js
var page_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z" })
] });
;// ./node_modules/@wordpress/icons/build-module/library/tag.js
var tag_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/category.js
var category_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",
fillRule: "evenodd",
clipRule: "evenodd"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/file.js
var file_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/globe.js
var globe_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8Zm6.5 8c0 .6 0 1.2-.2 1.8h-2.7c0-.6.2-1.1.2-1.8s0-1.2-.2-1.8h2.7c.2.6.2 1.1.2 1.8Zm-.9-3.2h-2.4c-.3-.9-.7-1.8-1.1-2.4-.1-.2-.2-.4-.3-.5 1.6.5 3 1.6 3.8 3ZM12.8 17c-.3.5-.6 1-.8 1.3-.2-.3-.5-.8-.8-1.3-.3-.5-.6-1.1-.8-1.7h3.3c-.2.6-.5 1.2-.8 1.7Zm-2.9-3.2c-.1-.6-.2-1.1-.2-1.8s0-1.2.2-1.8H14c.1.6.2 1.1.2 1.8s0 1.2-.2 1.8H9.9ZM11.2 7c.3-.5.6-1 .8-1.3.2.3.5.8.8 1.3.3.5.6 1.1.8 1.7h-3.3c.2-.6.5-1.2.8-1.7Zm-1-1.2c-.1.2-.2.3-.3.5-.4.7-.8 1.5-1.1 2.4H6.4c.8-1.4 2.2-2.5 3.8-3Zm-1.8 8H5.7c-.2-.6-.2-1.1-.2-1.8s0-1.2.2-1.8h2.7c0 .6-.2 1.1-.2 1.8s0 1.2.2 1.8Zm-2 1.4h2.4c.3.9.7 1.8 1.1 2.4.1.2.2.4.3.5-1.6-.5-3-1.6-3.8-3Zm7.4 3c.1-.2.2-.3.3-.5.4-.7.8-1.5 1.1-2.4h2.4c-.8 1.4-2.2 2.5-3.8 3Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/home.js
var home_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/verse.js
var verse_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-item.js
const TYPES = {
post: {
icon: post_list_default,
label: (0,external_wp_i18n_namespaceObject.__)("Post")
},
page: {
icon: page_default,
label: (0,external_wp_i18n_namespaceObject.__)("Page")
},
post_tag: {
icon: tag_default,
label: (0,external_wp_i18n_namespaceObject.__)("Tag")
},
category: {
icon: category_default,
label: (0,external_wp_i18n_namespaceObject.__)("Category")
},
attachment: {
icon: file_default,
label: (0,external_wp_i18n_namespaceObject.__)("Attachment")
}
};
function SearchItemIcon({ isURL, suggestion }) {
let icon = null;
if (isURL) {
icon = globe_default;
} else if (suggestion.type in TYPES) {
icon = TYPES[suggestion.type].icon;
if (suggestion.type === "page") {
if (suggestion.isFrontPage) {
icon = home_default;
}
if (suggestion.isBlogHome) {
icon = verse_default;
}
}
}
if (icon) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
icon_default,
{
className: "block-editor-link-control__search-item-icon",
icon
}
);
}
return null;
}
function addLeadingSlash(url) {
const trimmedURL = url?.trim();
if (!trimmedURL?.length) {
return url;
}
return url?.replace(/^\/?/, "/");
}
function removeTrailingSlash(url) {
const trimmedURL = url?.trim();
if (!trimmedURL?.length) {
return url;
}
return url?.replace(/\/$/, "");
}
const partialRight = (fn, ...partialArgs) => (...args) => fn(...args, ...partialArgs);
const defaultTo = (d) => (v) => {
return v === null || v === void 0 || v !== v ? d : v;
};
function getURLForDisplay(url) {
if (!url) {
return url;
}
return (0,external_wp_compose_namespaceObject.pipe)(
external_wp_url_namespaceObject.safeDecodeURI,
external_wp_url_namespaceObject.getPath,
defaultTo(""),
partialRight(external_wp_url_namespaceObject.filterURLForDisplay, 24),
removeTrailingSlash,
addLeadingSlash
)(url);
}
const LinkControlSearchItem = ({
itemProps,
suggestion,
searchTerm,
onClick,
isURL = false,
shouldShowType = false
}) => {
const info = isURL ? (0,external_wp_i18n_namespaceObject.__)("Press ENTER to add this link") : getURLForDisplay(suggestion.url);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
...itemProps,
info,
iconPosition: "left",
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SearchItemIcon, { suggestion, isURL }),
onClick,
shortcut: shouldShowType && getVisualTypeName(suggestion),
className: "block-editor-link-control__search-item",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextHighlight,
{
text: (0,external_wp_dom_namespaceObject.__unstableStripHTML)(suggestion.title),
highlight: searchTerm
}
)
}
);
};
function getVisualTypeName(suggestion) {
if (suggestion.isFrontPage) {
return (0,external_wp_i18n_namespaceObject.__)("Front page");
}
if (suggestion.isBlogHome) {
return (0,external_wp_i18n_namespaceObject.__)("Blog home");
}
if (suggestion.type in TYPES) {
return TYPES[suggestion.type].label;
}
return suggestion.type;
}
var search_item_default = LinkControlSearchItem;
const __experimentalLinkControlSearchItem = (props) => {
external_wp_deprecated_default()("wp.blockEditor.__experimentalLinkControlSearchItem", {
since: "6.8"
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkControlSearchItem, { ...props });
};
;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/constants.js
const CREATE_TYPE = "__CREATE__";
const TEL_TYPE = "tel";
const URL_TYPE = "link";
const MAILTO_TYPE = "mailto";
const INTERNAL_TYPE = "internal";
const LINK_ENTRY_TYPES = [
URL_TYPE,
MAILTO_TYPE,
TEL_TYPE,
INTERNAL_TYPE
];
const DEFAULT_LINK_SETTINGS = [
{
id: "opensInNewTab",
title: (0,external_wp_i18n_namespaceObject.__)("Open in new tab")
}
];
;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-results.js
function LinkControlSearchResults({
withCreateSuggestion,
currentInputValue,
handleSuggestionClick,
suggestionsListProps,
buildSuggestionItemProps,
suggestions,
selectedSuggestion,
isLoading,
isInitialSuggestions,
createSuggestionButtonText,
suggestionsQuery
}) {
const resultsListClasses = dist_clsx(
"block-editor-link-control__search-results",
{
"is-loading": isLoading
}
);
const isSingleDirectEntryResult = suggestions.length === 1 && LINK_ENTRY_TYPES.includes(suggestions[0].type);
const shouldShowCreateSuggestion = withCreateSuggestion && !isSingleDirectEntryResult && !isInitialSuggestions;
const shouldShowSuggestionsTypes = !suggestionsQuery?.type;
const labelText = isInitialSuggestions ? (0,external_wp_i18n_namespaceObject.__)("Suggestions") : (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: search term. */
(0,external_wp_i18n_namespaceObject.__)('Search results for "%s"'),
currentInputValue
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-link-control__search-results-wrapper", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
...suggestionsListProps,
className: resultsListClasses,
"aria-label": labelText,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: suggestions.map((suggestion, index) => {
if (shouldShowCreateSuggestion && CREATE_TYPE === suggestion.type) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
search_create_button_default,
{
searchTerm: currentInputValue,
buttonText: createSuggestionButtonText,
onClick: () => handleSuggestionClick(suggestion),
itemProps: buildSuggestionItemProps(
suggestion,
index
),
isSelected: index === selectedSuggestion
},
suggestion.type
);
}
if (CREATE_TYPE === suggestion.type) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
search_item_default,
{
itemProps: buildSuggestionItemProps(
suggestion,
index
),
suggestion,
index,
onClick: () => {
handleSuggestionClick(suggestion);
},
isSelected: index === selectedSuggestion,
isURL: LINK_ENTRY_TYPES.includes(
suggestion.type
),
searchTerm: currentInputValue,
shouldShowType: shouldShowSuggestionsTypes,
isFrontPage: suggestion?.isFrontPage,
isBlogHome: suggestion?.isBlogHome
},
`${suggestion.id}-${suggestion.type}`
);
}) })
}
) });
}
var search_results_default = LinkControlSearchResults;
const __experimentalLinkControlSearchResults = (props) => {
external_wp_deprecated_default()("wp.blockEditor.__experimentalLinkControlSearchResults", {
since: "6.8"
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkControlSearchResults, { ...props });
};
;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/is-url-like.js
function isURLLike(val) {
const hasSpaces = val.includes(" ");
if (hasSpaces) {
return false;
}
const protocol = (0,external_wp_url_namespaceObject.getProtocol)(val);
const protocolIsValid = (0,external_wp_url_namespaceObject.isValidProtocol)(protocol);
const mayBeTLD = hasPossibleTLD(val);
const isWWW = val?.startsWith("www.");
const isInternal = val?.startsWith("#") && (0,external_wp_url_namespaceObject.isValidFragment)(val);
return protocolIsValid || isWWW || isInternal || mayBeTLD;
}
function hasPossibleTLD(url, maxLength = 6) {
const cleanedURL = url.split(/[?#]/)[0];
const regex = new RegExp(
`(?<=\\S)\\.(?:[a-zA-Z_]{2,${maxLength}})(?:\\/|$)`
);
return regex.test(cleanedURL);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-search-handler.js
const handleNoop = () => Promise.resolve([]);
const handleDirectEntry = (val) => {
let type = URL_TYPE;
const protocol = (0,external_wp_url_namespaceObject.getProtocol)(val) || "";
if (protocol.includes("mailto")) {
type = MAILTO_TYPE;
}
if (protocol.includes("tel")) {
type = TEL_TYPE;
}
if (val?.startsWith("#")) {
type = INTERNAL_TYPE;
}
return Promise.resolve([
{
id: val,
title: val,
url: type === "URL" ? (0,external_wp_url_namespaceObject.prependHTTP)(val) : val,
type
}
]);
};
const handleEntitySearch = async (val, suggestionsQuery, fetchSearchSuggestions, withCreateSuggestion, pageOnFront, pageForPosts) => {
const { isInitialSuggestions } = suggestionsQuery;
const results = await fetchSearchSuggestions(val, suggestionsQuery);
results.map((result) => {
if (Number(result.id) === pageOnFront) {
result.isFrontPage = true;
return result;
} else if (Number(result.id) === pageForPosts) {
result.isBlogHome = true;
return result;
}
return result;
});
if (isInitialSuggestions) {
return results;
}
return isURLLike(val) || !withCreateSuggestion ? results : results.concat({
// the `id` prop is intentionally omitted here because it
// is never exposed as part of the component's public API.
// see: https://github.com/WordPress/gutenberg/pull/19775#discussion_r378931316.
title: val,
// Must match the existing `<input>`s text value.
url: val,
// Must match the existing `<input>`s text value.
type: CREATE_TYPE
});
};
function useSearchHandler(suggestionsQuery, allowDirectEntry, withCreateSuggestion) {
const { fetchSearchSuggestions, pageOnFront, pageForPosts } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getSettings } = select(store);
return {
pageOnFront: getSettings().pageOnFront,
pageForPosts: getSettings().pageForPosts,
fetchSearchSuggestions: getSettings().__experimentalFetchLinkSuggestions
};
},
[]
);
const directEntryHandler = allowDirectEntry ? handleDirectEntry : handleNoop;
return (0,external_wp_element_namespaceObject.useCallback)(
(val, { isInitialSuggestions }) => {
return isURLLike(val) ? directEntryHandler(val, { isInitialSuggestions }) : handleEntitySearch(
val,
{ ...suggestionsQuery, isInitialSuggestions },
fetchSearchSuggestions,
withCreateSuggestion,
pageOnFront,
pageForPosts
);
},
[
directEntryHandler,
fetchSearchSuggestions,
pageOnFront,
pageForPosts,
suggestionsQuery,
withCreateSuggestion
]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-input.js
const noopSearchHandler = () => Promise.resolve([]);
const noop = () => {
};
const LinkControlSearchInput = (0,external_wp_element_namespaceObject.forwardRef)(
({
value,
children,
currentLink = {},
className = null,
placeholder = null,
withCreateSuggestion = false,
onCreateSuggestion = noop,
onChange = noop,
onSelect = noop,
showSuggestions = true,
renderSuggestions = (props) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(search_results_default, { ...props }),
fetchSuggestions = null,
allowDirectEntry = true,
showInitialSuggestions = false,
suggestionsQuery = {},
withURLSuggestion = true,
createSuggestionButtonText,
hideLabelFromVision = false,
suffix,
isEntity = false
}, ref) => {
const genericSearchHandler = useSearchHandler(
suggestionsQuery,
allowDirectEntry,
withCreateSuggestion,
withURLSuggestion
);
const searchHandler = showSuggestions ? fetchSuggestions || genericSearchHandler : noopSearchHandler;
const [focusedSuggestion, setFocusedSuggestion] = (0,external_wp_element_namespaceObject.useState)();
const onInputChange = (selection, suggestion) => {
onChange(selection);
setFocusedSuggestion(suggestion);
};
const handleRenderSuggestions = (props) => renderSuggestions({
...props,
withCreateSuggestion,
createSuggestionButtonText,
suggestionsQuery,
handleSuggestionClick: (suggestion) => {
if (props.handleSuggestionClick) {
props.handleSuggestionClick(suggestion);
}
onSuggestionSelected(suggestion);
}
});
const onSuggestionSelected = async (selectedSuggestion) => {
let suggestion = selectedSuggestion;
if (CREATE_TYPE === selectedSuggestion.type) {
try {
suggestion = await onCreateSuggestion(
selectedSuggestion.title
);
if (suggestion?.url) {
onSelect(suggestion);
}
} catch (e) {
}
return;
}
if (allowDirectEntry || suggestion && Object.keys(suggestion).length >= 1) {
const { id, url, ...restLinkProps } = currentLink ?? {};
onSelect(
// Some direct entries don't have types or IDs, and we still need to clear the previous ones.
{ ...restLinkProps, ...suggestion },
suggestion
);
}
};
const _placeholder = placeholder ?? (0,external_wp_i18n_namespaceObject.__)("Search or type URL");
const label = hideLabelFromVision && placeholder !== "" ? _placeholder : (0,external_wp_i18n_namespaceObject.__)("Link");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-link-control__search-input-container", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
url_input_default,
{
disableSuggestions: currentLink?.url === value,
label,
hideLabelFromVision,
className,
value,
onChange: onInputChange,
placeholder: _placeholder,
__experimentalRenderSuggestions: showSuggestions ? handleRenderSuggestions : null,
__experimentalFetchLinkSuggestions: searchHandler,
__experimentalHandleURLSuggestions: true,
__experimentalShowInitialSuggestions: showInitialSuggestions,
onSubmit: (suggestion, event) => {
const hasSuggestion = suggestion || focusedSuggestion;
if (!hasSuggestion && !value?.trim()?.length) {
event.preventDefault();
} else {
onSuggestionSelected(
hasSuggestion || { url: value }
);
}
},
inputRef: ref,
suffix,
disabled: isEntity
}
),
children
] });
}
);
var search_input_default = LinkControlSearchInput;
const __experimentalLinkControlSearchInput = (props) => {
external_wp_deprecated_default()("wp.blockEditor.__experimentalLinkControlSearchInput", {
since: "6.8"
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkControlSearchInput, { ...props });
};
;// ./node_modules/@wordpress/icons/build-module/library/info.js
var info_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/pencil.js
var pencil_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/copy-small.js
var copy_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"
}
) });
;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/viewer-slot.js
const { Slot: ViewerSlot, Fill: ViewerFill } = (0,external_wp_components_namespaceObject.createSlotFill)(
"BlockEditorLinkControlViewer"
);
var viewer_slot_default = (/* unused pure expression or super */ null && (ViewerSlot));
;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-rich-url-data.js
function reducer(state, action) {
switch (action.type) {
case "RESOLVED":
return {
...state,
isFetching: false,
richData: action.richData
};
case "ERROR":
return {
...state,
isFetching: false,
richData: null
};
case "LOADING":
return {
...state,
isFetching: true
};
default:
throw new Error(`Unexpected action type ${action.type}`);
}
}
function useRemoteUrlData(url) {
const [state, dispatch] = (0,external_wp_element_namespaceObject.useReducer)(reducer, {
richData: null,
isFetching: false
});
const { fetchRichUrlData } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getSettings } = select(store);
return {
fetchRichUrlData: getSettings().__experimentalFetchRichUrlData
};
}, []);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (url?.length && fetchRichUrlData && typeof AbortController !== "undefined") {
dispatch({
type: "LOADING"
});
const controller = new window.AbortController();
const signal = controller.signal;
fetchRichUrlData(url, {
signal
}).then((urlData) => {
dispatch({
type: "RESOLVED",
richData: urlData
});
}).catch(() => {
if (!signal.aborted) {
dispatch({
type: "ERROR"
});
}
});
return () => {
controller.abort();
};
}
}, [url]);
return state;
}
var use_rich_url_data_default = useRemoteUrlData;
;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/link-preview.js
function filterTitleForDisplay(title) {
return title.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i, "").replace(/^www\./i, "");
}
function LinkPreview({
value,
onEditClick,
hasRichPreviews = false,
hasUnlinkControl = false,
onRemove
}) {
const showIconLabels = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(external_wp_preferences_namespaceObject.store).get("core", "showIconLabels"),
[]
);
const showRichPreviews = hasRichPreviews ? value?.url : null;
const { richData, isFetching } = use_rich_url_data_default(showRichPreviews);
const hasRichData = richData && Object.keys(richData).length;
const displayURL = value && (0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURI)(value.url), 24) || "";
const isEmptyURL = !value?.url?.length;
const displayTitle = !isEmptyURL && (0,external_wp_dom_namespaceObject.__unstableStripHTML)(richData?.title || value?.title || displayURL);
const isUrlRedundant = !value?.url || filterTitleForDisplay(displayTitle) === displayURL;
let icon;
if (richData?.icon) {
icon = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: richData?.icon, alt: "" });
} else if (isEmptyURL) {
icon = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: info_default, size: 32 });
} else {
icon = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: globe_default });
}
const { createNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(value.url, () => {
createNotice("info", (0,external_wp_i18n_namespaceObject.__)("Link copied to clipboard."), {
isDismissible: true,
type: "snackbar"
});
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
role: "group",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Manage link"),
className: dist_clsx("block-editor-link-control__search-item", {
"is-current": true,
"is-rich": hasRichData,
"is-fetching": !!isFetching,
"is-preview": true,
"is-error": isEmptyURL,
"is-url-title": displayTitle === displayURL
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-link-control__search-item-top", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"span",
{
className: "block-editor-link-control__search-item-header",
role: "figure",
"aria-label": (
/* translators: Accessibility text for the link preview when editing a link. */
(0,external_wp_i18n_namespaceObject.__)("Link information")
),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: dist_clsx(
"block-editor-link-control__search-item-icon",
{
"is-image": richData?.icon
}
),
children: icon
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-link-control__search-item-details", children: !isEmptyURL ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ExternalLink,
{
className: "block-editor-link-control__search-item-title",
href: value.url,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { numberOfLines: 1, children: displayTitle })
}
),
!isUrlRedundant && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-link-control__search-item-info", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { numberOfLines: 1, children: displayURL }) })
] }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-link-control__search-item-error-notice", children: (0,external_wp_i18n_namespaceObject.__)("Link is empty") }) })
]
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
icon: pencil_default,
label: (0,external_wp_i18n_namespaceObject.__)("Edit link"),
onClick: onEditClick,
size: "compact",
showTooltip: !showIconLabels
}
),
hasUnlinkControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
icon: link_off_default,
label: (0,external_wp_i18n_namespaceObject.__)("Remove link"),
onClick: onRemove,
size: "compact",
showTooltip: !showIconLabels
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
icon: copy_small_default,
label: (0,external_wp_i18n_namespaceObject.__)("Copy link"),
ref,
accessibleWhenDisabled: true,
disabled: isEmptyURL,
size: "compact",
showTooltip: !showIconLabels
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ViewerSlot, { fillProps: value })
] })
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/settings.js
const settings_noop = () => {
};
const LinkControlSettings = ({ value, onChange = settings_noop, settings }) => {
if (!settings || !settings.length) {
return null;
}
const handleSettingChange = (setting) => (newValue) => {
onChange({
...value,
[setting.id]: newValue
});
};
const theSettings = settings.map((setting) => {
if ("render" in setting) {
if (typeof setting.render === "function") {
const renderedContent = setting.render(
setting,
value,
onChange
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "block-editor-link-control__setting",
children: renderedContent
},
setting.id
);
}
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CheckboxControl,
{
__nextHasNoMarginBottom: true,
className: "block-editor-link-control__setting",
label: setting.title,
onChange: handleSettingChange(setting),
checked: value ? !!value[setting.id] : false,
help: setting?.help
},
setting.id
);
}).filter(Boolean);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "block-editor-link-control__settings", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "legend", children: (0,external_wp_i18n_namespaceObject.__)("Currently selected link settings") }),
theSettings
] });
};
var settings_default = LinkControlSettings;
;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-create-page.js
function useCreatePage(handleCreatePage) {
const cancelableCreateSuggestion = (0,external_wp_element_namespaceObject.useRef)();
const [isCreatingPage, setIsCreatingPage] = (0,external_wp_element_namespaceObject.useState)(false);
const [errorMessage, setErrorMessage] = (0,external_wp_element_namespaceObject.useState)(null);
const createPage = async function(suggestionTitle) {
setIsCreatingPage(true);
setErrorMessage(null);
try {
cancelableCreateSuggestion.current = makeCancelable(
// Using Promise.resolve to allow createSuggestion to return a
// non-Promise based value.
Promise.resolve(handleCreatePage(suggestionTitle))
);
return await cancelableCreateSuggestion.current.promise;
} catch (error) {
if (error && error.isCanceled) {
return;
}
setErrorMessage(
error.message || (0,external_wp_i18n_namespaceObject.__)(
"An unknown error occurred during creation. Please try again."
)
);
throw error;
} finally {
setIsCreatingPage(false);
}
};
(0,external_wp_element_namespaceObject.useEffect)(() => {
return () => {
if (cancelableCreateSuggestion.current) {
cancelableCreateSuggestion.current.cancel();
}
};
}, []);
return {
createPage,
isCreatingPage,
errorMessage
};
}
const makeCancelable = (promise) => {
let hasCanceled_ = false;
const wrappedPromise = new Promise((resolve, reject) => {
promise.then(
(val) => hasCanceled_ ? reject({ isCanceled: true }) : resolve(val),
(error) => hasCanceled_ ? reject({ isCanceled: true }) : reject(error)
);
});
return {
promise: wrappedPromise,
cancel() {
hasCanceled_ = true;
}
};
};
// EXTERNAL MODULE: ./node_modules/fast-deep-equal/index.js
var fast_deep_equal = __webpack_require__(5215);
var fast_deep_equal_default = /*#__PURE__*/__webpack_require__.n(fast_deep_equal);
;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-internal-value.js
function useInternalValue(value) {
const [internalValue, setInternalValue] = (0,external_wp_element_namespaceObject.useState)(value || {});
const [previousValue, setPreviousValue] = (0,external_wp_element_namespaceObject.useState)(value);
if (!fast_deep_equal_default()(value, previousValue)) {
setPreviousValue(value);
setInternalValue(value);
}
const setInternalURLInputValue = (nextValue) => {
setInternalValue({
...internalValue,
url: nextValue
});
};
const setInternalTextInputValue = (nextValue) => {
setInternalValue({
...internalValue,
title: nextValue
});
};
const createSetInternalSettingValueHandler = (settingsKeys) => (nextValue) => {
const settingsUpdates = Object.keys(nextValue).reduce(
(acc, key) => {
if (settingsKeys.includes(key)) {
acc[key] = nextValue[key];
}
return acc;
},
{}
);
setInternalValue({
...internalValue,
...settingsUpdates
});
};
return [
internalValue,
setInternalValue,
setInternalURLInputValue,
setInternalTextInputValue,
createSetInternalSettingValueHandler
];
}
;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/index.js
const link_control_noop = () => {
};
const PREFERENCE_SCOPE = "core/block-editor";
const PREFERENCE_KEY = "linkControlSettingsDrawer";
function LinkControl({
searchInputPlaceholder,
value,
settings = DEFAULT_LINK_SETTINGS,
onChange = link_control_noop,
onRemove,
onCancel,
noDirectEntry = false,
showSuggestions = true,
showInitialSuggestions,
forceIsEditingLink,
createSuggestion,
withCreateSuggestion,
inputValue: propInputValue = "",
suggestionsQuery = {},
noURLSuggestion = false,
createSuggestionButtonText,
hasRichPreviews = false,
hasTextControl = false,
renderControlBottom = null,
handleEntities = false
}) {
if (withCreateSuggestion === void 0 && createSuggestion) {
withCreateSuggestion = true;
}
const [settingsOpen, setSettingsOpen] = (0,external_wp_element_namespaceObject.useState)(false);
const { advancedSettingsPreference } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const prefsStore = select(external_wp_preferences_namespaceObject.store);
return {
advancedSettingsPreference: prefsStore.get(PREFERENCE_SCOPE, PREFERENCE_KEY) ?? false
};
}, []);
const { set: setPreference } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
const setSettingsOpenWithPreference = (prefVal) => {
if (setPreference) {
setPreference(PREFERENCE_SCOPE, PREFERENCE_KEY, prefVal);
}
setSettingsOpen(prefVal);
};
const isSettingsOpen = advancedSettingsPreference || settingsOpen;
const isMountingRef = (0,external_wp_element_namespaceObject.useRef)(true);
const wrapperNode = (0,external_wp_element_namespaceObject.useRef)();
const textInputRef = (0,external_wp_element_namespaceObject.useRef)();
const searchInputRef = (0,external_wp_element_namespaceObject.useRef)();
const isEndingEditWithFocusRef = (0,external_wp_element_namespaceObject.useRef)(false);
const settingsKeys = settings.map(({ id }) => id);
const [
internalControlValue,
setInternalControlValue,
setInternalURLInputValue,
setInternalTextInputValue,
createSetInternalSettingValueHandler
] = useInternalValue(value);
const isEntity = handleEntities && !!internalControlValue?.id;
const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(LinkControl, "link-control");
const helpTextId = isEntity ? `${baseId}__help` : null;
const valueHasChanges = value && !(0,external_wp_isShallowEqual_namespaceObject.isShallowEqualObjects)(internalControlValue, value);
const [isEditingLink, setIsEditingLink] = (0,external_wp_element_namespaceObject.useState)(
forceIsEditingLink !== void 0 ? forceIsEditingLink : !value || !value.url
);
const { createPage, isCreatingPage, errorMessage } = useCreatePage(createSuggestion);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (forceIsEditingLink === void 0) {
return;
}
setIsEditingLink(forceIsEditingLink);
}, [forceIsEditingLink]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (isMountingRef.current) {
return;
}
const nextFocusTarget = external_wp_dom_namespaceObject.focus.focusable.find(wrapperNode.current)[0] || wrapperNode.current;
nextFocusTarget.focus();
isEndingEditWithFocusRef.current = false;
}, [isEditingLink, isCreatingPage]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
isMountingRef.current = false;
return () => {
isMountingRef.current = true;
};
}, []);
const hasLinkValue = value?.url?.trim()?.length > 0;
const stopEditing = () => {
isEndingEditWithFocusRef.current = !!wrapperNode.current?.contains(
wrapperNode.current.ownerDocument.activeElement
);
setIsEditingLink(false);
};
const handleSelectSuggestion = (updatedValue) => {
const nonSettingsChanges = Object.keys(updatedValue).reduce(
(acc, key) => {
if (!settingsKeys.includes(key)) {
acc[key] = updatedValue[key];
}
return acc;
},
{}
);
onChange({
...internalControlValue,
...nonSettingsChanges,
// As title is not a setting, it must be manually applied
// in such a way as to preserve the users changes over
// any "title" value provided by the "suggestion".
title: internalControlValue?.title || updatedValue?.title
});
stopEditing();
};
const handleSubmit = () => {
if (valueHasChanges) {
onChange({
...value,
...internalControlValue,
url: currentUrlInputValue
});
}
stopEditing();
};
const handleSubmitWithEnter = (event) => {
const { keyCode } = event;
if (keyCode === external_wp_keycodes_namespaceObject.ENTER && !currentInputIsEmpty) {
event.preventDefault();
handleSubmit();
}
};
const resetInternalValues = () => {
setInternalControlValue(value);
};
const handleCancel = (event) => {
event.preventDefault();
event.stopPropagation();
resetInternalValues();
if (hasLinkValue) {
stopEditing();
} else {
onRemove?.();
}
onCancel?.();
};
const [shouldFocusSearchInput, setShouldFocusSearchInput] = (0,external_wp_element_namespaceObject.useState)(false);
const handleUnlink = () => {
const { id, kind, type, ...restValue } = internalControlValue;
setInternalControlValue({
...restValue,
id: void 0,
kind: void 0,
type: void 0,
url: void 0
});
setShouldFocusSearchInput(true);
};
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (shouldFocusSearchInput) {
searchInputRef.current?.focus();
setShouldFocusSearchInput(false);
}
}, [shouldFocusSearchInput]);
const currentUrlInputValue = propInputValue || internalControlValue?.url || "";
const currentInputIsEmpty = !currentUrlInputValue?.trim()?.length;
const shownUnlinkControl = onRemove && value && !isEditingLink && !isCreatingPage;
const showActions = isEditingLink && hasLinkValue;
const showTextControl = hasLinkValue && hasTextControl;
const isEditing = (isEditingLink || !value) && !isCreatingPage;
const isDisabled = !valueHasChanges || currentInputIsEmpty;
const showSettings = !!settings?.length && isEditingLink && hasLinkValue;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
tabIndex: -1,
ref: wrapperNode,
className: "block-editor-link-control",
children: [
isCreatingPage && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-link-control__loading", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}),
" ",
(0,external_wp_i18n_namespaceObject.__)("Creating"),
"\u2026"
] }),
isEditing && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
className: dist_clsx({
"block-editor-link-control__search-input-wrapper": true,
"has-text-control": showTextControl,
"has-actions": showActions
}),
children: [
showTextControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
__nextHasNoMarginBottom: true,
ref: textInputRef,
className: "block-editor-link-control__field block-editor-link-control__text-content",
label: (0,external_wp_i18n_namespaceObject.__)("Text"),
value: internalControlValue?.title,
onChange: setInternalTextInputValue,
onKeyDown: handleSubmitWithEnter,
__next40pxDefaultSize: true
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
search_input_default,
{
ref: searchInputRef,
currentLink: value,
className: "block-editor-link-control__field block-editor-link-control__search-input",
placeholder: searchInputPlaceholder,
value: currentUrlInputValue,
withCreateSuggestion,
onCreateSuggestion: createPage,
onChange: setInternalURLInputValue,
onSelect: handleSelectSuggestion,
showInitialSuggestions,
allowDirectEntry: !noDirectEntry,
showSuggestions,
suggestionsQuery,
withURLSuggestion: !noURLSuggestion,
createSuggestionButtonText,
hideLabelFromVision: !showTextControl,
isEntity,
suffix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SearchSuffixControl,
{
isEntity,
showActions,
isDisabled,
onUnlink: handleUnlink,
onSubmit: handleSubmit,
helpTextId
}
)
}
),
isEntity && helpTextId && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"p",
{
id: helpTextId,
className: "block-editor-link-control__help",
children: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: entity type (e.g., page, post) */
(0,external_wp_i18n_namespaceObject.__)("Synced with the selected %s."),
internalControlValue?.type || "item"
)
}
)
]
}
),
errorMessage && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Notice,
{
className: "block-editor-link-control__search-error",
status: "error",
isDismissible: false,
children: errorMessage
}
)
] }),
value && !isEditingLink && !isCreatingPage && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
LinkPreview,
{
value,
onEditClick: () => setIsEditingLink(true),
hasRichPreviews,
hasUnlinkControl: shownUnlinkControl,
onRemove: () => {
onRemove();
setIsEditingLink(true);
}
},
value?.url
),
showSettings && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-link-control__tools", children: !currentInputIsEmpty && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
settings_drawer_default,
{
settingsOpen: isSettingsOpen,
setSettingsOpen: setSettingsOpenWithPreference,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
settings_default,
{
value: internalControlValue,
settings,
onChange: createSetInternalSettingValueHandler(
settingsKeys
)
}
)
}
) }),
showActions && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
justify: "right",
className: "block-editor-link-control__search-actions",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: handleCancel,
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "primary",
onClick: isDisabled ? link_control_noop : handleSubmit,
className: "block-editor-link-control__search-submit",
"aria-disabled": isDisabled,
children: (0,external_wp_i18n_namespaceObject.__)("Apply")
}
)
]
}
),
!isCreatingPage && renderControlBottom && renderControlBottom()
]
}
);
}
function SearchSuffixControl({
isEntity,
showActions,
isDisabled,
onUnlink,
onSubmit,
helpTextId
}) {
if (isEntity) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
icon: link_off_default,
onClick: onUnlink,
"aria-describedby": helpTextId,
showTooltip: true,
label: (0,external_wp_i18n_namespaceObject.__)("Unsync and edit"),
__next40pxDefaultSize: true
}
);
}
if (showActions) {
return void 0;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlSuffixWrapper, { variant: "control", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
onClick: isDisabled ? link_control_noop : onSubmit,
label: (0,external_wp_i18n_namespaceObject.__)("Submit"),
icon: keyboard_return_default,
className: "block-editor-link-control__search-submit",
"aria-disabled": isDisabled,
size: "small"
}
) });
}
LinkControl.ViewerFill = ViewerFill;
LinkControl.DEFAULT_LINK_SETTINGS = DEFAULT_LINK_SETTINGS;
const DeprecatedExperimentalLinkControl = (props) => {
external_wp_deprecated_default()("wp.blockEditor.__experimentalLinkControl", {
since: "6.8",
alternative: "wp.blockEditor.LinkControl"
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkControl, { ...props });
};
DeprecatedExperimentalLinkControl.ViewerFill = LinkControl.ViewerFill;
DeprecatedExperimentalLinkControl.DEFAULT_LINK_SETTINGS = LinkControl.DEFAULT_LINK_SETTINGS;
var link_control_default = LinkControl;
;// ./node_modules/@wordpress/block-editor/build-module/components/media-replace-flow/index.js
const media_replace_flow_noop = () => {
};
let uniqueId = 0;
const MediaReplaceFlow = ({
mediaURL,
mediaId,
mediaIds,
allowedTypes,
accept,
onError,
onSelect,
onSelectURL,
onReset,
onToggleFeaturedImage,
useFeaturedImage,
onFilesUpload = media_replace_flow_noop,
name = (0,external_wp_i18n_namespaceObject.__)("Replace"),
createNotice,
removeNotice,
children,
multiple = false,
addToGallery,
handleUpload = true,
popoverProps,
renderToggle
}) => {
const { getSettings } = (0,external_wp_data_namespaceObject.useSelect)(store);
const errorNoticeID = `block-editor/media-replace-flow/error-notice/${++uniqueId}`;
const onUploadError = (message) => {
const safeMessage = (0,external_wp_dom_namespaceObject.__unstableStripHTML)(message);
if (onError) {
onError(safeMessage);
return;
}
setTimeout(() => {
createNotice("error", safeMessage, {
speak: true,
id: errorNoticeID,
isDismissible: true
});
}, 1e3);
};
const selectMedia = (media, closeMenu) => {
if (useFeaturedImage && onToggleFeaturedImage) {
onToggleFeaturedImage();
}
closeMenu();
onSelect(media);
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)("The media file has been replaced"));
removeNotice(errorNoticeID);
};
const uploadFiles = (event, closeMenu) => {
const files = event.target.files;
if (!handleUpload) {
closeMenu();
return onSelect(files);
}
onFilesUpload(files);
getSettings().mediaUpload({
allowedTypes,
filesList: files,
onFileChange: ([media]) => {
selectMedia(media, closeMenu);
},
onError: onUploadError
});
};
const openOnArrowDown = (event) => {
if (event.keyCode === external_wp_keycodes_namespaceObject.DOWN) {
event.preventDefault();
event.target.click();
}
};
const onlyAllowsImages = () => {
if (!allowedTypes || allowedTypes.length === 0) {
return false;
}
return allowedTypes.every(
(allowedType) => allowedType === "image" || allowedType.startsWith("image/")
);
};
const gallery = multiple && onlyAllowsImages();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
popoverProps,
contentClassName: "block-editor-media-replace-flow__options",
renderToggle: ({ isOpen, onToggle }) => {
if (renderToggle) {
return renderToggle({
"aria-expanded": isOpen,
"aria-haspopup": "true",
onClick: onToggle,
onKeyDown: openOnArrowDown,
children: name
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
"aria-expanded": isOpen,
"aria-haspopup": "true",
onClick: onToggle,
onKeyDown: openOnArrowDown,
children: name
}
);
},
renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.NavigableMenu, { className: "block-editor-media-replace-flow__media-upload-menu", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(check_default, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
media_upload_default,
{
gallery,
addToGallery,
multiple,
value: multiple ? mediaIds : mediaId,
onSelect: (media) => selectMedia(media, onClose),
allowedTypes,
render: ({ open }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
icon: media_default,
onClick: open,
children: (0,external_wp_i18n_namespaceObject.__)("Open Media Library")
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.FormFileUpload,
{
onChange: (event) => {
uploadFiles(event, onClose);
},
accept,
multiple: !!multiple,
render: ({ openFileDialog }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
icon: upload_default,
onClick: () => {
openFileDialog();
},
children: (0,external_wp_i18n_namespaceObject._x)("Upload", "verb")
}
);
}
}
)
] }),
onToggleFeaturedImage && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
icon: post_featured_image_default,
onClick: onToggleFeaturedImage,
isPressed: useFeaturedImage,
children: (0,external_wp_i18n_namespaceObject.__)("Use featured image")
}
),
mediaURL && onReset && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: () => {
onReset();
onClose();
},
children: (0,external_wp_i18n_namespaceObject.__)("Reset")
}
),
typeof children === "function" ? children({ onClose }) : children
] }),
onSelectURL && // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", { className: "block-editor-media-flow__url-input", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-media-replace-flow__image-url-label", children: (0,external_wp_i18n_namespaceObject.__)("Current media URL:") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
link_control_default,
{
value: { url: mediaURL },
settings: [],
showSuggestions: false,
onChange: ({ url }) => {
onSelectURL(url);
},
searchInputPlaceholder: (0,external_wp_i18n_namespaceObject.__)(
"Paste or type URL"
)
}
)
] })
] })
}
);
};
var media_replace_flow_default = (0,external_wp_compose_namespaceObject.compose)([
(0,external_wp_data_namespaceObject.withDispatch)((dispatch) => {
const { createNotice, removeNotice } = dispatch(external_wp_notices_namespaceObject.store);
return {
createNotice,
removeNotice
};
}),
(0,external_wp_components_namespaceObject.withFilters)("editor.MediaReplaceFlow")
])(MediaReplaceFlow);
;// ./node_modules/@wordpress/block-editor/build-module/components/background-image-control/index.js
const IMAGE_BACKGROUND_TYPE = "image";
const BACKGROUND_POPOVER_PROPS = {
placement: "left-start",
offset: 36,
shift: true,
className: "block-editor-global-styles-background-panel__popover"
};
const background_image_control_noop = () => {
};
const focusToggleButton = (containerRef) => {
window.requestAnimationFrame(() => {
const [toggleButton] = external_wp_dom_namespaceObject.focus.tabbable.find(containerRef?.current);
if (!toggleButton) {
return;
}
toggleButton.focus();
});
};
function backgroundSizeHelpText(value) {
if (value === "cover" || value === void 0) {
return (0,external_wp_i18n_namespaceObject.__)("Image covers the space evenly.");
}
if (value === "contain") {
return (0,external_wp_i18n_namespaceObject.__)("Image is contained without distortion.");
}
return (0,external_wp_i18n_namespaceObject.__)("Image has a fixed width.");
}
const coordsToBackgroundPosition = (value) => {
if (!value || isNaN(value.x) && isNaN(value.y)) {
return void 0;
}
const x = isNaN(value.x) ? 0.5 : value.x;
const y = isNaN(value.y) ? 0.5 : value.y;
return `${x * 100}% ${y * 100}%`;
};
const backgroundPositionToCoords = (value) => {
if (!value) {
return { x: void 0, y: void 0 };
}
let [x, y] = value.split(" ").map((v) => parseFloat(v) / 100);
x = isNaN(x) ? void 0 : x;
y = isNaN(y) ? x : y;
return { x, y };
};
function InspectorImagePreviewItem({
as = "span",
imgUrl,
toggleProps = {},
filename,
label,
onToggleCallback = background_image_control_noop
}) {
const { isOpen, ...restToggleProps } = toggleProps;
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (typeof isOpen !== "undefined") {
onToggleCallback(isOpen);
}
}, [isOpen, onToggleCallback]);
const renderPreviewContent = () => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
justify: "flex-start",
as: "span",
className: "block-editor-global-styles-background-panel__inspector-preview-inner",
children: [
imgUrl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: "block-editor-global-styles-background-panel__inspector-image-indicator-wrapper",
"aria-hidden": true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: "block-editor-global-styles-background-panel__inspector-image-indicator",
style: {
backgroundImage: `url(${imgUrl})`
}
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.FlexItem, { as: "span", style: imgUrl ? {} : { flexGrow: 1 }, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalTruncate,
{
numberOfLines: 1,
className: "block-editor-global-styles-background-panel__inspector-media-replace-title",
children: label
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "span", children: imgUrl ? (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: file name */
(0,external_wp_i18n_namespaceObject.__)("Background image: %s"),
filename || label
) : (0,external_wp_i18n_namespaceObject.__)("No background image selected") })
] })
]
}
);
};
return as === "button" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, ...restToggleProps, children: renderPreviewContent() }) : renderPreviewContent();
}
function BackgroundControlsPanel({
label,
filename,
url: imgUrl,
children,
onToggle: onToggleCallback = background_image_control_noop,
hasImageValue,
onReset,
containerRef
}) {
if (!hasImageValue) {
return;
}
const imgLabel = label || (0,external_wp_url_namespaceObject.getFilename)(imgUrl) || (0,external_wp_i18n_namespaceObject.__)("Add background image");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
popoverProps: BACKGROUND_POPOVER_PROPS,
renderToggle: ({ onToggle, isOpen }) => {
const toggleProps = {
onClick: onToggle,
className: "block-editor-global-styles-background-panel__dropdown-toggle",
"aria-expanded": isOpen,
"aria-label": (0,external_wp_i18n_namespaceObject.__)(
"Background size, position and repeat options."
),
isOpen
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
InspectorImagePreviewItem,
{
imgUrl,
filename,
label: imgLabel,
toggleProps,
as: "button",
onToggleCallback
}
),
onReset && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Reset"),
className: "block-editor-global-styles-background-panel__reset",
size: "small",
icon: reset_default,
onClick: () => {
onReset();
if (isOpen) {
onToggle();
}
focusToggleButton(containerRef);
}
}
)
] });
},
renderContent: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalDropdownContentWrapper,
{
className: "block-editor-global-styles-background-panel__dropdown-content-wrapper",
paddingSize: "medium",
children
}
)
}
);
}
function LoadingSpinner() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { className: "block-editor-global-styles-background-panel__loading", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) });
}
function BackgroundImageControls({
onChange,
style,
inheritedValue,
onRemoveImage = background_image_control_noop,
onResetImage = background_image_control_noop,
displayInPanel,
defaultValues,
containerRef
}) {
const [isUploading, setIsUploading] = (0,external_wp_element_namespaceObject.useState)(false);
const { getSettings } = (0,external_wp_data_namespaceObject.useSelect)(store);
const { id, title, url } = style?.background?.backgroundImage || {
...inheritedValue?.background?.backgroundImage
};
const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const onUploadError = (message) => {
createErrorNotice(message, { type: "snackbar" });
setIsUploading(false);
};
const resetBackgroundImage = () => onChange(
setImmutably(
style,
["background", "backgroundImage"],
void 0
)
);
const onSelectMedia = (media) => {
if (!media || !media.url) {
resetBackgroundImage();
setIsUploading(false);
return;
}
if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
setIsUploading(true);
return;
}
if (media.media_type && media.media_type !== IMAGE_BACKGROUND_TYPE || !media.media_type && media.type && media.type !== IMAGE_BACKGROUND_TYPE) {
onUploadError(
(0,external_wp_i18n_namespaceObject.__)("Only images can be used as a background image.")
);
return;
}
const sizeValue = style?.background?.backgroundSize || defaultValues?.backgroundSize;
const positionValue = style?.background?.backgroundPosition;
onChange(
setImmutably(style, ["background"], {
...style?.background,
backgroundImage: {
url: media.url,
id: media.id,
source: "file",
title: media.title || void 0
},
backgroundPosition: (
/*
* A background image uploaded and set in the editor receives a default background position of '50% 0',
* when the background image size is the equivalent of "Tile".
* This is to increase the chance that the image's focus point is visible.
* This is in-editor only to assist with the user experience.
*/
!positionValue && ("auto" === sizeValue || !sizeValue) ? "50% 0" : positionValue
),
backgroundSize: sizeValue
})
);
setIsUploading(false);
focusToggleButton(containerRef);
};
const onFilesDrop = (filesList) => {
getSettings().mediaUpload({
allowedTypes: [IMAGE_BACKGROUND_TYPE],
filesList,
onFileChange([image]) {
onSelectMedia(image);
},
onError: onUploadError,
multiple: false
});
};
const hasValue = hasBackgroundImageValue(style);
const onRemove = () => onChange(
setImmutably(style, ["background"], {
backgroundImage: "none"
})
);
const canRemove = !hasValue && hasBackgroundImageValue(inheritedValue);
const imgLabel = title || (0,external_wp_url_namespaceObject.getFilename)(url) || (0,external_wp_i18n_namespaceObject.__)("Add background image");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-global-styles-background-panel__image-tools-panel-item", children: [
isUploading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LoadingSpinner, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
media_replace_flow_default,
{
mediaId: id,
mediaURL: url,
allowedTypes: [IMAGE_BACKGROUND_TYPE],
accept: "image/*",
onSelect: onSelectMedia,
popoverProps: {
className: dist_clsx({
"block-editor-global-styles-background-panel__media-replace-popover": displayInPanel
})
},
name: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
InspectorImagePreviewItem,
{
imgUrl: url,
filename: title,
label: imgLabel
}
),
renderToggle: (props) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { ...props, __next40pxDefaultSize: true }),
onError: onUploadError,
onReset: () => {
focusToggleButton(containerRef);
onResetImage();
},
children: canRemove && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: () => {
focusToggleButton(containerRef);
onRemove();
onRemoveImage();
},
children: (0,external_wp_i18n_namespaceObject.__)("Remove")
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropZone,
{
onFilesDrop,
label: (0,external_wp_i18n_namespaceObject.__)("Drop to upload")
}
)
] });
}
function BackgroundSizeControls({
onChange,
style,
inheritedValue,
defaultValues
}) {
const sizeValue = style?.background?.backgroundSize || inheritedValue?.background?.backgroundSize;
const repeatValue = style?.background?.backgroundRepeat || inheritedValue?.background?.backgroundRepeat;
const imageValue = style?.background?.backgroundImage?.url || inheritedValue?.background?.backgroundImage?.url;
const isUploadedImage = style?.background?.backgroundImage?.id;
const positionValue = style?.background?.backgroundPosition || inheritedValue?.background?.backgroundPosition;
const attachmentValue = style?.background?.backgroundAttachment || inheritedValue?.background?.backgroundAttachment;
let currentValueForToggle = !sizeValue && isUploadedImage ? defaultValues?.backgroundSize : sizeValue || "auto";
currentValueForToggle = !["cover", "contain", "auto"].includes(
currentValueForToggle
) ? "auto" : currentValueForToggle;
const repeatCheckedValue = !(repeatValue === "no-repeat" || currentValueForToggle === "cover" && repeatValue === void 0);
const updateBackgroundSize = (next) => {
let nextRepeat = repeatValue;
let nextPosition = positionValue;
if (next === "contain") {
nextRepeat = "no-repeat";
nextPosition = void 0;
}
if (next === "cover") {
nextRepeat = void 0;
nextPosition = void 0;
}
if ((currentValueForToggle === "cover" || currentValueForToggle === "contain") && next === "auto") {
nextRepeat = void 0;
if (!!style?.background?.backgroundImage?.id) {
nextPosition = "50% 0";
}
}
if (!next && currentValueForToggle === "auto") {
next = "auto";
}
onChange(
setImmutably(style, ["background"], {
...style?.background,
backgroundPosition: nextPosition,
backgroundRepeat: nextRepeat,
backgroundSize: next
})
);
};
const updateBackgroundPosition = (next) => {
onChange(
setImmutably(
style,
["background", "backgroundPosition"],
coordsToBackgroundPosition(next)
)
);
};
const toggleIsRepeated = () => onChange(
setImmutably(
style,
["background", "backgroundRepeat"],
repeatCheckedValue === true ? "no-repeat" : "repeat"
)
);
const toggleScrollWithPage = () => onChange(
setImmutably(
style,
["background", "backgroundAttachment"],
attachmentValue === "fixed" ? "scroll" : "fixed"
)
);
const backgroundPositionValue = !positionValue && isUploadedImage && "contain" === sizeValue ? defaultValues?.backgroundPosition : positionValue;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, className: "single-column", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.FocalPointPicker,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Focal point"),
url: imageValue,
value: backgroundPositionToCoords(backgroundPositionValue),
onChange: updateBackgroundPosition
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Fixed background"),
checked: attachmentValue === "fixed",
onChange: toggleScrollWithPage
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
__nextHasNoMarginBottom: true,
size: "__unstable-large",
label: (0,external_wp_i18n_namespaceObject.__)("Size"),
value: currentValueForToggle,
onChange: updateBackgroundSize,
isBlock: true,
help: backgroundSizeHelpText(
sizeValue || defaultValues?.backgroundSize
),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "cover",
label: (0,external_wp_i18n_namespaceObject._x)(
"Cover",
"Size option for background image control"
)
},
"cover"
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "contain",
label: (0,external_wp_i18n_namespaceObject._x)(
"Contain",
"Size option for background image control"
)
},
"contain"
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "auto",
label: (0,external_wp_i18n_namespaceObject._x)(
"Tile",
"Size option for background image control"
)
},
"tile"
)
]
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", spacing: 2, as: "span", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Background image width"),
onChange: updateBackgroundSize,
value: sizeValue,
size: "__unstable-large",
__unstableInputWidth: "100px",
min: 0,
placeholder: (0,external_wp_i18n_namespaceObject.__)("Auto"),
disabled: currentValueForToggle !== "auto" || currentValueForToggle === void 0
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Repeat"),
checked: repeatCheckedValue,
onChange: toggleIsRepeated,
disabled: currentValueForToggle === "cover"
}
)
] })
] });
}
function BackgroundImagePanel({
value,
onChange,
inheritedValue = value,
settings,
defaultValues = {}
}) {
const { globalStyles, _links } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getSettings } = select(store);
const _settings = getSettings();
return {
globalStyles: _settings[globalStylesDataKey],
_links: _settings[globalStylesLinksDataKey]
};
}, []);
const resolvedInheritedValue = (0,external_wp_element_namespaceObject.useMemo)(() => {
const resolvedValues = {
background: {}
};
if (!inheritedValue?.background) {
return inheritedValue;
}
Object.entries(inheritedValue?.background).forEach(
([key, backgroundValue]) => {
resolvedValues.background[key] = getResolvedValue(
backgroundValue,
{
styles: globalStyles,
_links
}
);
}
);
return resolvedValues;
}, [globalStyles, _links, inheritedValue]);
const resetBackground = () => onChange(setImmutably(value, ["background"], {}));
const { title, url } = value?.background?.backgroundImage || {
...resolvedInheritedValue?.background?.backgroundImage
};
const hasImageValue = hasBackgroundImageValue(value) || hasBackgroundImageValue(resolvedInheritedValue);
const imageValue = value?.background?.backgroundImage || inheritedValue?.background?.backgroundImage;
const shouldShowBackgroundImageControls = hasImageValue && "none" !== imageValue && (settings?.background?.backgroundSize || settings?.background?.backgroundPosition || settings?.background?.backgroundRepeat);
const [isDropDownOpen, setIsDropDownOpen] = (0,external_wp_element_namespaceObject.useState)(false);
const containerRef = (0,external_wp_element_namespaceObject.useRef)();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
ref: containerRef,
className: dist_clsx(
"block-editor-global-styles-background-panel__inspector-media-replace-container",
{
"is-open": isDropDownOpen
}
),
children: shouldShowBackgroundImageControls ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BackgroundControlsPanel,
{
label: title,
filename: title,
url,
onToggle: setIsDropDownOpen,
hasImageValue,
onReset: resetBackground,
containerRef,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, className: "single-column", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BackgroundImageControls,
{
onChange,
style: value,
inheritedValue: resolvedInheritedValue,
displayInPanel: true,
onResetImage: () => {
setIsDropDownOpen(false);
resetBackground();
},
onRemoveImage: () => setIsDropDownOpen(false),
defaultValues,
containerRef
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BackgroundSizeControls,
{
onChange,
style: value,
defaultValues,
inheritedValue: resolvedInheritedValue
}
)
] })
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BackgroundImageControls,
{
onChange,
style: value,
inheritedValue: resolvedInheritedValue,
defaultValues,
onResetImage: () => {
setIsDropDownOpen(false);
resetBackground();
},
onRemoveImage: () => setIsDropDownOpen(false),
containerRef
}
)
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/background-panel.js
const background_panel_DEFAULT_CONTROLS = {
backgroundImage: true
};
function useHasBackgroundPanel(settings) {
return external_wp_element_namespaceObject.Platform.OS === "web" && settings?.background?.backgroundImage;
}
function hasBackgroundSizeValue(style) {
return style?.background?.backgroundPosition !== void 0 || style?.background?.backgroundSize !== void 0;
}
function hasBackgroundImageValue(style) {
return !!style?.background?.backgroundImage?.id || // Supports url() string values in theme.json.
"string" === typeof style?.background?.backgroundImage || !!style?.background?.backgroundImage?.url;
}
function BackgroundToolsPanel({
resetAllFilter,
onChange,
value,
panelId,
children,
headerLabel
}) {
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const resetAll = () => {
const updatedValue = resetAllFilter(value);
onChange(updatedValue);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: headerLabel,
resetAll,
panelId,
dropdownMenuProps,
children
}
);
}
function background_panel_BackgroundImagePanel({
as: Wrapper = BackgroundToolsPanel,
value,
onChange,
inheritedValue,
settings,
panelId,
defaultControls = background_panel_DEFAULT_CONTROLS,
defaultValues = {},
headerLabel = (0,external_wp_i18n_namespaceObject.__)("Background image")
}) {
const showBackgroundImageControl = useHasBackgroundPanel(settings);
const resetBackground = () => onChange(setImmutably(value, ["background"], {}));
const resetAllFilter = (0,external_wp_element_namespaceObject.useCallback)((previousValue) => {
return {
...previousValue,
background: {}
};
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Wrapper,
{
resetAllFilter,
value,
onChange,
panelId,
headerLabel,
children: showBackgroundImageControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: () => !!value?.background,
label: (0,external_wp_i18n_namespaceObject.__)("Image"),
onDeselect: resetBackground,
isShownByDefault: defaultControls.backgroundImage,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BackgroundImagePanel,
{
value,
onChange,
settings,
inheritedValue,
defaultControls,
defaultValues
}
)
}
)
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/background.js
const BACKGROUND_SUPPORT_KEY = "background";
const BACKGROUND_BLOCK_DEFAULT_VALUES = {
backgroundSize: "cover",
backgroundPosition: "50% 50%"
// used only when backgroundSize is 'contain'.
};
function hasBackgroundSupport(blockName, feature = "any") {
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, BACKGROUND_SUPPORT_KEY);
if (support === true) {
return true;
}
if (feature === "any") {
return !!support?.backgroundImage || !!support?.backgroundSize || !!support?.backgroundRepeat;
}
return !!support?.[feature];
}
function setBackgroundStyleDefaults(backgroundStyle) {
if (!backgroundStyle || !backgroundStyle?.backgroundImage?.url) {
return;
}
let backgroundStylesWithDefaults;
if (!backgroundStyle?.backgroundSize) {
backgroundStylesWithDefaults = {
backgroundSize: BACKGROUND_BLOCK_DEFAULT_VALUES.backgroundSize
};
}
if ("contain" === backgroundStyle?.backgroundSize && !backgroundStyle?.backgroundPosition) {
backgroundStylesWithDefaults = {
backgroundPosition: BACKGROUND_BLOCK_DEFAULT_VALUES.backgroundPosition
};
}
return backgroundStylesWithDefaults;
}
function background_useBlockProps({ name, style }) {
if (!hasBackgroundSupport(name) || !style?.background?.backgroundImage) {
return;
}
const backgroundStyles = setBackgroundStyleDefaults(style?.background);
if (!backgroundStyles) {
return;
}
return {
style: {
...backgroundStyles
}
};
}
function getBackgroundImageClasses(style) {
return hasBackgroundImageValue(style) ? "has-background" : "";
}
function BackgroundInspectorControl({ children }) {
const resetAllFilter = (0,external_wp_element_namespaceObject.useCallback)((attributes) => {
return {
...attributes,
style: {
...attributes.style,
background: void 0
}
};
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default, { group: "background", resetAllFilter, children });
}
function background_BackgroundImagePanel({
clientId,
name,
setAttributes,
settings
}) {
const { style, inheritedValue } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockAttributes, getSettings } = select(store);
const _settings = getSettings();
return {
style: getBlockAttributes(clientId)?.style,
/*
* To ensure we pass down the right inherited values:
* @TODO 1. Pass inherited value down to all block style controls,
* See: packages/block-editor/src/hooks/style.js
* @TODO 2. Add support for block style variations,
* See implementation: packages/block-editor/src/hooks/block-style-variation.js
*/
inheritedValue: _settings[globalStylesDataKey]?.blocks?.[name]
};
},
[clientId, name]
);
if (!useHasBackgroundPanel(settings) || !hasBackgroundSupport(name, "backgroundImage")) {
return null;
}
const onChange = (newStyle) => {
setAttributes({
style: utils_cleanEmptyObject(newStyle)
});
};
const updatedSettings = {
...settings,
background: {
...settings.background,
backgroundSize: settings?.background?.backgroundSize && hasBackgroundSupport(name, "backgroundSize")
}
};
const defaultControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [
BACKGROUND_SUPPORT_KEY,
"defaultControls"
]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
background_panel_BackgroundImagePanel,
{
inheritedValue,
as: BackgroundInspectorControl,
panelId: clientId,
defaultValues: BACKGROUND_BLOCK_DEFAULT_VALUES,
settings: updatedSettings,
onChange,
defaultControls,
value: style
}
);
}
var background_default = {
useBlockProps: background_useBlockProps,
attributeKeys: ["style"],
hasSupport: hasBackgroundSupport
};
;// ./node_modules/@wordpress/block-editor/build-module/hooks/lock.js
function lock_addAttribute(settings) {
if ("type" in (settings.attributes?.lock ?? {})) {
return settings;
}
settings.attributes = {
...settings.attributes,
lock: {
type: "object"
}
};
return settings;
}
(0,external_wp_hooks_namespaceObject.addFilter)("blocks.registerBlockType", "core/lock/addAttribute", lock_addAttribute);
;// ./node_modules/@wordpress/icons/build-module/library/block-default.js
var block_default_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/block-icon/index.js
function BlockIcon({ icon, showColors = false, className, context }) {
if (icon?.src === "block-default") {
icon = {
src: block_default_default
};
}
const renderedIcon = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: icon && icon.src ? icon.src : icon, context });
const style = showColors ? {
backgroundColor: icon && icon.background,
color: icon && icon.foreground
} : {};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
style,
className: dist_clsx("block-editor-block-icon", className, {
"has-colors": showColors
}),
children: renderedIcon
}
);
}
var block_icon_default = (0,external_wp_element_namespaceObject.memo)(BlockIcon);
;// ./node_modules/@wordpress/block-editor/build-module/components/block-manager/checklist.js
function BlockTypesChecklist({ blockTypes, value, onItemChange }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { className: "block-editor-block-manager__checklist", children: blockTypes.map((blockType) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"li",
{
className: "block-editor-block-manager__checklist-item",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CheckboxControl,
{
__nextHasNoMarginBottom: true,
label: blockType.title,
checked: value.includes(blockType.name),
onChange: (...args) => onItemChange(blockType, ...args)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon_default, { icon: blockType.icon })
]
},
blockType.name
)) });
}
var checklist_default = BlockTypesChecklist;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-manager/category.js
function BlockManagerCategory({
title,
blockTypes,
selectedBlockTypes,
onChange
}) {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockManagerCategory);
const toggleVisible = (0,external_wp_element_namespaceObject.useCallback)(
(blockType, nextIsChecked) => {
if (nextIsChecked) {
onChange([...selectedBlockTypes, blockType]);
} else {
onChange(
selectedBlockTypes.filter(
({ name }) => name !== blockType.name
)
);
}
},
[selectedBlockTypes, onChange]
);
const toggleAllVisible = (0,external_wp_element_namespaceObject.useCallback)(
(nextIsChecked) => {
if (nextIsChecked) {
onChange([
...selectedBlockTypes,
...blockTypes.filter(
(blockType) => !selectedBlockTypes.find(
({ name }) => name === blockType.name
)
)
]);
} else {
onChange(
selectedBlockTypes.filter(
(selectedBlockType) => !blockTypes.find(
({ name }) => name === selectedBlockType.name
)
)
);
}
},
[blockTypes, selectedBlockTypes, onChange]
);
if (!blockTypes.length) {
return null;
}
const checkedBlockNames = blockTypes.map(({ name }) => name).filter(
(type) => (selectedBlockTypes ?? []).some(
(selectedBlockType) => selectedBlockType.name === type
)
);
const titleId = "block-editor-block-manager__category-title-" + instanceId;
const isAllChecked = checkedBlockNames.length === blockTypes.length;
const isIndeterminate = !isAllChecked && checkedBlockNames.length > 0;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
role: "group",
"aria-labelledby": titleId,
className: "block-editor-block-manager__category",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CheckboxControl,
{
__nextHasNoMarginBottom: true,
checked: isAllChecked,
onChange: toggleAllVisible,
className: "block-editor-block-manager__category-title",
indeterminate: isIndeterminate,
label: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { id: titleId, children: title })
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
checklist_default,
{
blockTypes,
value: checkedBlockNames,
onItemChange: toggleVisible
}
)
]
}
);
}
var category_category_default = BlockManagerCategory;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-manager/index.js
function BlockManager({
blockTypes,
selectedBlockTypes,
onChange,
showSelectAll = true
}) {
const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500);
const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)("");
const { categories, isMatchingSearchTerm } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
return {
categories: select(external_wp_blocks_namespaceObject.store).getCategories(),
isMatchingSearchTerm: select(external_wp_blocks_namespaceObject.store).isMatchingSearchTerm
};
}, []);
const filteredBlockTypes = blockTypes.filter((blockType) => {
return !search || isMatchingSearchTerm(blockType, search);
});
const isIndeterminate = selectedBlockTypes.length > 0 && selectedBlockTypes.length !== blockTypes.length;
const isAllChecked = blockTypes.length > 0 && selectedBlockTypes.length === blockTypes.length;
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!search) {
return;
}
const count = filteredBlockTypes.length;
const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: number of results. */
(0,external_wp_i18n_namespaceObject._n)("%d result found.", "%d results found.", count),
count
);
debouncedSpeak(resultsFoundMessage);
}, [filteredBlockTypes?.length, search, debouncedSpeak]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { className: "block-editor-block-manager__content", spacing: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SearchControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Search for a block"),
placeholder: (0,external_wp_i18n_namespaceObject.__)("Search for a block"),
value: search,
onChange: (nextSearch) => setSearch(nextSearch),
className: "block-editor-block-manager__search"
}
),
showSelectAll && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CheckboxControl,
{
className: "block-editor-block-manager__select-all",
label: (0,external_wp_i18n_namespaceObject.__)("Select all"),
checked: isAllChecked,
onChange: () => {
if (isAllChecked) {
onChange([]);
} else {
onChange(blockTypes);
}
},
indeterminate: isIndeterminate,
__nextHasNoMarginBottom: true
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
tabIndex: "0",
role: "region",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Available block types"),
className: "block-editor-block-manager__results",
children: [
filteredBlockTypes.length === 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "block-editor-block-manager__no-results", children: (0,external_wp_i18n_namespaceObject.__)("No blocks found.") }),
categories.map((category) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
category_category_default,
{
title: category.title,
blockTypes: filteredBlockTypes.filter(
(blockType) => blockType.category === category.slug
),
selectedBlockTypes,
onChange
},
category.slug
)),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
category_category_default,
{
title: (0,external_wp_i18n_namespaceObject.__)("Uncategorized"),
blockTypes: filteredBlockTypes.filter(
({ category }) => !category
),
selectedBlockTypes,
onChange
}
)
]
}
)
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-allowed-blocks/modal.js
function BlockAllowedBlocksModal({
clientId,
blockTypes,
selectedBlockTypes,
onClose
}) {
const [currentSelectedBlockTypes, setCurrentSelectedBlockTypes] = (0,external_wp_element_namespaceObject.useState)(selectedBlockTypes);
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const handleSubmit = () => {
const isFullySelected = currentSelectedBlockTypes.length === blockTypes.length;
const newBlockNames = currentSelectedBlockTypes.map(
({ name }) => name
);
updateBlockAttributes(clientId, {
allowedBlocks: isFullySelected ? void 0 : newBlockNames
});
onClose();
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
title: (0,external_wp_i18n_namespaceObject.__)("Manage allowed blocks"),
onRequestClose: onClose,
overlayClassName: "block-editor-block-allowed-blocks-modal",
focusOnMount: "firstContentElement",
size: "medium",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
as: "form",
onSubmit: (e) => {
e.preventDefault();
handleSubmit();
},
spacing: "4",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)(
"Select which blocks can be added inside this container."
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockManager,
{
blockTypes,
selectedBlockTypes: currentSelectedBlockTypes,
onChange: (newSelectedBlockTypes) => {
setCurrentSelectedBlockTypes(newSelectedBlockTypes);
}
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Flex,
{
className: "block-editor-block-allowed-blocks-modal__actions",
justify: "flex-end",
expanded: false,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: "tertiary",
onClick: onClose,
__next40pxDefaultSize: true,
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: "primary",
type: "submit",
__next40pxDefaultSize: true,
children: (0,external_wp_i18n_namespaceObject.__)("Apply")
}
) })
]
}
)
]
}
)
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-allowed-blocks/allowed-blocks-control.js
function BlockAllowedBlocksControl({ clientId }) {
const [isBlockControlOpened, setIsBlockControlOpened] = (0,external_wp_element_namespaceObject.useState)(false);
const { blockTypes, selectedBlockNames } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockAttributes } = select(store);
return {
blockTypes: select(external_wp_blocks_namespaceObject.store).getBlockTypes(),
selectedBlockNames: getBlockAttributes(clientId)?.allowedBlocks
};
},
[clientId]
);
const filteredBlockTypes = blockTypes.filter(
(blockType) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, "inserter", true) && (!blockType.parent || blockType.parent.includes("core/post-content"))
);
if (!filteredBlockTypes) {
return null;
}
const selectedBlockTypes = selectedBlockNames === void 0 ? filteredBlockTypes : filteredBlockTypes.filter(
(blockType) => selectedBlockNames.includes(blockType.name)
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-allowed-blocks-control", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.BaseControl,
{
help: (0,external_wp_i18n_namespaceObject.__)(
"Specify which blocks are allowed inside this container."
),
__nextHasNoMarginBottom: true,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { children: (0,external_wp_i18n_namespaceObject.__)("Allowed Blocks") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "secondary",
onClick: () => {
setIsBlockControlOpened(true);
},
className: "block-editor-block-allowed-blocks-control__button",
children: (0,external_wp_i18n_namespaceObject.__)("Manage allowed blocks")
}
)
]
}
),
isBlockControlOpened && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockAllowedBlocksModal,
{
clientId,
blockTypes: filteredBlockTypes,
selectedBlockTypes,
onClose: () => setIsBlockControlOpened(false)
}
)
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/allowed-blocks.js
function BlockEditAllowedBlocksControlPure({ clientId }) {
const isContentOnly = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
return select(store).getBlockEditingMode(clientId) === "contentOnly";
},
[clientId]
);
if (isContentOnly) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateInspectorControlsAllowedBlocks.Fill, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockAllowedBlocksControl, { clientId }) });
}
var allowed_blocks_default = {
edit: BlockEditAllowedBlocksControlPure,
attributeKeys: ["allowedBlocks"],
hasSupport(name) {
return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, "allowedBlocks");
}
};
function allowed_blocks_addAttribute(settings) {
if (settings?.attributes?.allowedBlocks?.type) {
return settings;
}
if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, "allowedBlocks")) {
settings.attributes = {
...settings.attributes,
allowedBlocks: {
type: "array"
}
};
}
return settings;
}
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.registerBlockType",
"core/allowedBlocks/attribute",
allowed_blocks_addAttribute
);
function addTransforms(result, source, index, results) {
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(result.name, "allowedBlocks")) {
return result;
}
if (source.length !== 1 && results.length === 1 && result.innerBlocks.length === source.length) {
return result;
}
if (results.length === 1 && source.length > 1 || results.length > 1 && source.length === 1) {
return result;
}
if (results.length > 1 && source.length > 1 && results.length !== source.length) {
return result;
}
if (result.attributes.allowedBlocks) {
return result;
}
const sourceAllowedBlocks = source[index]?.attributes?.allowedBlocks;
if (!sourceAllowedBlocks) {
return result;
}
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(result.name);
const destinationAllowedBlocks = blockType?.allowedBlocks || [];
if (!destinationAllowedBlocks.length) {
return {
...result,
attributes: {
...result.attributes,
allowedBlocks: sourceAllowedBlocks
}
};
}
const filteredSourceAllowedBlocks = sourceAllowedBlocks.filter(
(block) => destinationAllowedBlocks.includes(block)
);
return {
...result,
attributes: {
...result.attributes,
allowedBlocks: filteredSourceAllowedBlocks
}
};
}
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.switchToBlockType.transformedBlock",
"core/allowedBlocks/addTransforms",
addTransforms
);
;// ./node_modules/@wordpress/block-editor/build-module/hooks/anchor.js
const ANCHOR_REGEX = /[\s#]/g;
const ANCHOR_SCHEMA = {
type: "string",
source: "attribute",
attribute: "id",
selector: "*"
};
function anchor_addAttribute(settings) {
if ("type" in (settings.attributes?.anchor ?? {})) {
return settings;
}
if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, "anchor")) {
settings.attributes = {
...settings.attributes,
anchor: ANCHOR_SCHEMA
};
}
return settings;
}
function BlockEditAnchorControlPure({ anchor, setAttributes }) {
const blockEditingMode = useBlockEditingMode();
if (blockEditingMode !== "default") {
return null;
}
const isWeb = external_wp_element_namespaceObject.Platform.OS === "web";
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default, { group: "advanced", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
className: "html-anchor-control",
label: (0,external_wp_i18n_namespaceObject.__)("HTML anchor"),
help: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
(0,external_wp_i18n_namespaceObject.__)(
"Enter a word or two \u2014 without spaces \u2014 to make a unique web address just for this block, called an \u201Canchor\u201D. Then, you\u2019ll be able to link directly to this section of your page."
),
isWeb && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
" ",
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ExternalLink,
{
href: (0,external_wp_i18n_namespaceObject.__)(
"https://wordpress.org/documentation/article/page-jumps/"
),
children: (0,external_wp_i18n_namespaceObject.__)("Learn more about anchors")
}
)
] })
] }),
value: anchor || "",
placeholder: !isWeb ? (0,external_wp_i18n_namespaceObject.__)("Add an anchor") : null,
onChange: (nextValue) => {
nextValue = nextValue.replace(ANCHOR_REGEX, "-");
setAttributes({
anchor: nextValue
});
},
autoCapitalize: "none",
autoComplete: "off"
}
) });
}
var anchor_default = {
addSaveProps,
edit: BlockEditAnchorControlPure,
attributeKeys: ["anchor"],
hasSupport(name) {
return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, "anchor");
}
};
function addSaveProps(extraProps, blockType, attributes) {
if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, "anchor")) {
extraProps.id = attributes.anchor === "" ? null : attributes.anchor;
}
return extraProps;
}
(0,external_wp_hooks_namespaceObject.addFilter)("blocks.registerBlockType", "core/anchor/attribute", anchor_addAttribute);
;// ./node_modules/@wordpress/block-editor/build-module/hooks/aria-label.js
function aria_label_addAttribute(settings) {
if (settings?.attributes?.ariaLabel?.type) {
return settings;
}
if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, "ariaLabel")) {
settings.attributes = {
...settings.attributes,
ariaLabel: {
type: "string"
}
};
}
return settings;
}
function aria_label_addSaveProps(extraProps, blockType, attributes) {
if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, "ariaLabel")) {
extraProps["aria-label"] = attributes.ariaLabel === "" ? null : attributes.ariaLabel;
}
return extraProps;
}
var aria_label_default = {
addSaveProps: aria_label_addSaveProps,
attributeKeys: ["ariaLabel"],
hasSupport(name) {
return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, "ariaLabel");
}
};
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.registerBlockType",
"core/ariaLabel/attribute",
aria_label_addAttribute
);
;// ./node_modules/@wordpress/block-editor/build-module/hooks/custom-class-name.js
function custom_class_name_addAttribute(settings) {
if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, "customClassName", true)) {
settings.attributes = {
...settings.attributes,
className: {
type: "string"
}
};
}
return settings;
}
function CustomClassNameControlsPure({ className, setAttributes }) {
const blockEditingMode = useBlockEditingMode();
if (blockEditingMode !== "default") {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default, { group: "advanced", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
autoComplete: "off",
label: (0,external_wp_i18n_namespaceObject.__)("Additional CSS class(es)"),
value: className || "",
onChange: (nextValue) => {
setAttributes({
className: nextValue !== "" ? nextValue : void 0
});
},
help: (0,external_wp_i18n_namespaceObject.__)("Separate multiple classes with spaces.")
}
) });
}
var custom_class_name_default = {
edit: CustomClassNameControlsPure,
addSaveProps: custom_class_name_addSaveProps,
attributeKeys: ["className"],
hasSupport(name) {
return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, "customClassName", true);
}
};
function custom_class_name_addSaveProps(extraProps, blockType, attributes) {
if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, "customClassName", true) && attributes.className) {
extraProps.className = dist_clsx(
extraProps.className,
attributes.className
);
}
return extraProps;
}
function custom_class_name_addTransforms(result, source, index, results) {
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(result.name, "customClassName", true)) {
return result;
}
if (results.length === 1 && result.innerBlocks.length === source.length) {
return result;
}
if (results.length === 1 && source.length > 1 || results.length > 1 && source.length === 1) {
return result;
}
if (source[index]) {
const originClassName = source[index]?.attributes.className;
if (originClassName && result.attributes.className === void 0) {
return {
...result,
attributes: {
...result.attributes,
className: originClassName
}
};
}
}
return result;
}
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.registerBlockType",
"core/editor/custom-class-name/attribute",
custom_class_name_addAttribute
);
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.switchToBlockType.transformedBlock",
"core/customClassName/addTransforms",
custom_class_name_addTransforms
);
;// ./node_modules/@wordpress/block-editor/build-module/hooks/generated-class-name.js
function addGeneratedClassName(extraProps, blockType) {
if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, "className", true)) {
if (typeof extraProps.className === "string") {
extraProps.className = [
.../* @__PURE__ */ new Set([
(0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(blockType.name),
...extraProps.className.split(" ")
])
].join(" ").trim();
} else {
extraProps.className = (0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(blockType.name);
}
}
return extraProps;
}
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.getSaveContent.extraProps",
"core/generated-class-name/save-props",
addGeneratedClassName
);
;// ./node_modules/colord/index.mjs
var colord_r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(colord_r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},colord_j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof colord_j?r:new colord_j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(colord_j,y),S.push(r))})},E=function(){return new colord_j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};
;// ./node_modules/colord/plugins/names.mjs
/* harmony default export */ function names(e,f){var a={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])}
;// ./node_modules/colord/plugins/a11y.mjs
var a11y_o=function(o){var t=o/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},a11y_t=function(t){return.2126*a11y_o(t.r)+.7152*a11y_o(t.g)+.0722*a11y_o(t.b)};/* harmony default export */ function a11y(o){o.prototype.luminance=function(){return o=a11y_t(this.rgba),void 0===(r=2)&&(r=0),void 0===n&&(n=Math.pow(10,r)),Math.round(n*o)/n+0;var o,r,n},o.prototype.contrast=function(r){void 0===r&&(r="#FFF");var n,a,i,e,v,u,d,c=r instanceof o?r:new o(r);return e=this.rgba,v=c.toRgb(),u=a11y_t(e),d=a11y_t(v),n=u>d?(u+.05)/(d+.05):(d+.05)/(u+.05),void 0===(a=2)&&(a=0),void 0===i&&(i=Math.pow(10,a)),Math.floor(i*n)/i+0},o.prototype.isReadable=function(o,t){return void 0===o&&(o="#FFF"),void 0===t&&(t={}),this.contrast(o)>=(e=void 0===(i=(r=t).size)?"normal":i,"AAA"===(a=void 0===(n=r.level)?"AA":n)&&"normal"===e?7:"AA"===a&&"large"===e?3:4.5);var r,n,a,i,e}}
;// ./node_modules/@wordpress/block-editor/build-module/components/colors/utils.js
k([names, a11y]);
const { kebabCase } = unlock(external_wp_components_namespaceObject.privateApis);
const getColorObjectByAttributeValues = (colors, definedColor, customColor) => {
if (definedColor) {
const colorObj = colors?.find(
(color) => color.slug === definedColor
);
if (colorObj) {
return colorObj;
}
}
return {
color: customColor
};
};
const getColorObjectByColorValue = (colors, colorValue) => {
return colors?.find((color) => color.color === colorValue);
};
function getColorClassName(colorContextName, colorSlug) {
if (!colorContextName || !colorSlug) {
return void 0;
}
return `has-${kebabCase(colorSlug)}-${colorContextName}`;
}
function getMostReadableColor(colors, colorValue) {
const colordColor = w(colorValue);
const getColorContrast = ({ color }) => colordColor.contrast(color);
const maxContrast = Math.max(...colors.map(getColorContrast));
return colors.find((color) => getColorContrast(color) === maxContrast).color;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js
function useMultipleOriginColorsAndGradients() {
const [
enableCustomColors,
customColors,
themeColors,
defaultColors,
shouldDisplayDefaultColors,
enableCustomGradients,
customGradients,
themeGradients,
defaultGradients,
shouldDisplayDefaultGradients
] = use_settings_useSettings(
"color.custom",
"color.palette.custom",
"color.palette.theme",
"color.palette.default",
"color.defaultPalette",
"color.customGradient",
"color.gradients.custom",
"color.gradients.theme",
"color.gradients.default",
"color.defaultGradients"
);
const colorGradientSettings = {
disableCustomColors: !enableCustomColors,
disableCustomGradients: !enableCustomGradients
};
colorGradientSettings.colors = (0,external_wp_element_namespaceObject.useMemo)(() => {
const result = [];
if (themeColors && themeColors.length) {
result.push({
name: (0,external_wp_i18n_namespaceObject._x)(
"Theme",
"Indicates this palette comes from the theme."
),
slug: "theme",
colors: themeColors
});
}
if (shouldDisplayDefaultColors && defaultColors && defaultColors.length) {
result.push({
name: (0,external_wp_i18n_namespaceObject._x)(
"Default",
"Indicates this palette comes from WordPress."
),
slug: "default",
colors: defaultColors
});
}
if (customColors && customColors.length) {
result.push({
name: (0,external_wp_i18n_namespaceObject._x)(
"Custom",
"Indicates this palette is created by the user."
),
slug: "custom",
colors: customColors
});
}
return result;
}, [
customColors,
themeColors,
defaultColors,
shouldDisplayDefaultColors
]);
colorGradientSettings.gradients = (0,external_wp_element_namespaceObject.useMemo)(() => {
const result = [];
if (themeGradients && themeGradients.length) {
result.push({
name: (0,external_wp_i18n_namespaceObject._x)(
"Theme",
"Indicates this palette comes from the theme."
),
slug: "theme",
gradients: themeGradients
});
}
if (shouldDisplayDefaultGradients && defaultGradients && defaultGradients.length) {
result.push({
name: (0,external_wp_i18n_namespaceObject._x)(
"Default",
"Indicates this palette comes from WordPress."
),
slug: "default",
gradients: defaultGradients
});
}
if (customGradients && customGradients.length) {
result.push({
name: (0,external_wp_i18n_namespaceObject._x)(
"Custom",
"Indicates this palette is created by the user."
),
slug: "custom",
gradients: customGradients
});
}
return result;
}, [
customGradients,
themeGradients,
defaultGradients,
shouldDisplayDefaultGradients
]);
colorGradientSettings.hasColorsOrGradients = !!colorGradientSettings.colors.length || !!colorGradientSettings.gradients.length;
return colorGradientSettings;
}
;// ./node_modules/@wordpress/icons/build-module/library/link.js
var link_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/linked-button.js
function LinkedButton({ isLinked, ...props }) {
const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)("Unlink radii") : (0,external_wp_i18n_namespaceObject.__)("Link radii");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
...props,
className: "components-border-radius-control__linked-button",
size: "small",
icon: isLinked ? link_default : link_off_default,
iconSize: 24,
label
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/utils.js
function mode(inputArray) {
const arr = [...inputArray];
return arr.sort(
(a, b) => inputArray.filter((v) => v === b).length - inputArray.filter((v) => v === a).length
).shift();
}
function getAllUnit(selectedUnits = {}) {
const { flat, ...cornerUnits } = selectedUnits;
return flat || mode(Object.values(cornerUnits).filter(Boolean)) || "px";
}
function getAllValue(values = {}) {
if (typeof values === "string") {
return values;
}
const parsedQuantitiesAndUnits = Object.values(values).map((value2) => {
const newValue = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value2);
if (typeof value2 === "string" && newValue[0] === void 0) {
return [value2, ""];
}
return newValue;
});
const allValues = parsedQuantitiesAndUnits.map(
(value2) => value2[0] ?? ""
);
const allUnits = parsedQuantitiesAndUnits.map((value2) => value2[1]);
const value = allValues.every((v) => v === allValues[0]) ? allValues[0] : "";
const unit = mode(allUnits);
const allValue = value === 0 || value ? `${value}${unit || ""}` : void 0;
return allValue;
}
function hasMixedValues(values = {}) {
if (typeof values === "string") {
return false;
}
if (!values || typeof values !== "object") {
return false;
}
const cornerValues = Object.values(values);
if (cornerValues.length === 0) {
return false;
}
const firstValue = cornerValues[0];
const allSame = cornerValues.every((value) => value === firstValue);
return !allSame;
}
function hasDefinedValues(values) {
if (!values) {
return false;
}
if (typeof values === "string") {
return true;
}
const filteredValues = Object.values(values).filter((value) => {
return !!value || value === 0;
});
return !!filteredValues.length;
}
function isValuePreset(value) {
if (!value?.includes) {
return false;
}
return value === "0" || value.includes("var:preset|border-radius|");
}
function getPresetSlug(value) {
if (!value) {
return;
}
if (value === "0" || value === "default") {
return value;
}
const slug = value.match(/var:preset\|border-radius\|(.+)/);
return slug ? slug[1] : void 0;
}
function utils_getSliderValueFromPreset(presetValue, presets) {
if (presetValue === void 0) {
return 0;
}
const slug = parseFloat(presetValue, 10) === 0 ? "0" : getPresetSlug(presetValue);
const sliderValue = presets.findIndex((size) => {
return String(size.slug) === slug;
});
return sliderValue !== -1 ? sliderValue : NaN;
}
function utils_getCustomValueFromPreset(value, presets) {
if (!isValuePreset(value)) {
return value;
}
const slug = parseFloat(value, 10) === 0 ? "0" : getPresetSlug(value);
const radiusSize = presets.find((size) => String(size.slug) === slug);
return radiusSize?.size;
}
function getPresetValueFromControlValue(controlValue, controlType, presets) {
const size = parseInt(controlValue, 10);
if (controlType === "selectList") {
if (size === 0) {
return void 0;
}
} else if (size === 0) {
return "0";
}
return `var:preset|border-radius|${presets[controlValue]?.slug}`;
}
function utils_getPresetValueFromCustomValue(value, presets) {
if (!value || isValuePreset(value) || value === "0") {
return value;
}
const spacingMatch = presets.find(
(size) => String(size.size) === String(value)
);
if (spacingMatch?.slug) {
return `var:preset|border-radius|${spacingMatch.slug}`;
}
return value;
}
function convertPresetsToCustomValues(values, presets) {
if (!values || typeof values !== "object") {
return values;
}
const converted = {};
Object.keys(values).forEach((key) => {
const value = values[key];
if (isValuePreset(value)) {
const customValue = utils_getCustomValueFromPreset(value, presets);
converted[key] = customValue !== void 0 ? customValue : value;
} else {
converted[key] = value;
}
});
return converted;
}
;// ./node_modules/@wordpress/icons/build-module/library/settings.js
var settings_settings_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z" })
] });
;// ./node_modules/@wordpress/icons/build-module/library/corner-all.js
var corner_all_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5Zm-12.5 9v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/corner-top-left.js
var corner_top_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.G, { opacity: ".25", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z" }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M6 5.75a.25.25 0 0 0-.25.25v3h-1.5V6c0-.966.784-1.75 1.75-1.75h3v1.5H6Z"
}
)
] });
;// ./node_modules/@wordpress/icons/build-module/library/corner-top-right.js
var corner_top_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.G, { opacity: ".25", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z" }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5Z"
}
)
] });
;// ./node_modules/@wordpress/icons/build-module/library/corner-bottom-left.js
var corner_bottom_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.G, { opacity: ".25", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z" }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M5.75 15v3c0 .138.112.25.25.25h3v1.5H6A1.75 1.75 0 0 1 4.25 18v-3h1.5Z"
}
)
] });
;// ./node_modules/@wordpress/icons/build-module/library/corner-bottom-right.js
var corner_bottom_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.G, { opacity: ".25", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z" }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M15 18.25h3a.25.25 0 0 0 .25-.25v-3h1.5v3A1.75 1.75 0 0 1 18 19.75h-3v-1.5Z"
}
)
] });
;// ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/constants.js
const constants_DEFAULT_VALUES = {
topLeft: void 0,
topRight: void 0,
bottomLeft: void 0,
bottomRight: void 0
};
const constants_RANGE_CONTROL_MAX_SIZE = 8;
const constants_EMPTY_ARRAY = [];
const CORNERS = {
all: (0,external_wp_i18n_namespaceObject.__)("Border radius"),
topLeft: (0,external_wp_i18n_namespaceObject.__)("Top left"),
topRight: (0,external_wp_i18n_namespaceObject.__)("Top right"),
bottomLeft: (0,external_wp_i18n_namespaceObject.__)("Bottom left"),
bottomRight: (0,external_wp_i18n_namespaceObject.__)("Bottom right")
};
const constants_ICONS = {
all: corner_all_default,
topLeft: corner_top_left_default,
topRight: corner_top_right_default,
bottomLeft: corner_bottom_left_default,
bottomRight: corner_bottom_right_default
};
const MIN_BORDER_RADIUS_VALUE = 0;
const MAX_BORDER_RADIUS_VALUES = {
px: 100,
em: 20,
rem: 20
};
;// ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/single-input-control.js
function SingleInputControl({
corner,
onChange,
selectedUnits,
setSelectedUnits,
values: valuesProp,
units,
presets
}) {
const changeCornerValue = (validatedValue) => {
if (corner === "all") {
onChange({
topLeft: validatedValue,
topRight: validatedValue,
bottomLeft: validatedValue,
bottomRight: validatedValue
});
} else {
onChange({
...values,
[corner]: validatedValue
});
}
};
const onChangeValue = (next) => {
if (!onChange) {
return;
}
const isNumeric = !isNaN(parseFloat(next));
const nextValue = isNumeric ? next : void 0;
changeCornerValue(nextValue);
};
const onChangeUnit = (next) => {
const newUnits = { ...selectedUnits };
if (corner === "all") {
newUnits.flat = next;
newUnits.topLeft = next;
newUnits.topRight = next;
newUnits.bottomLeft = next;
newUnits.bottomRight = next;
} else {
newUnits[corner] = next;
}
setSelectedUnits(newUnits);
};
const values = typeof valuesProp !== "string" ? valuesProp : {
topLeft: valuesProp,
topRight: valuesProp,
bottomLeft: valuesProp,
bottomRight: valuesProp
};
let value;
if (corner === "all") {
const convertedValues = convertPresetsToCustomValues(values, presets);
const customValue = getAllValue(convertedValues);
value = utils_getPresetValueFromCustomValue(customValue, presets);
} else {
value = utils_getPresetValueFromCustomValue(values[corner], presets);
}
const resolvedPresetValue = isValuePreset(value) ? utils_getCustomValueFromPreset(value, presets) : value;
const [parsedQuantity, parsedUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(resolvedPresetValue);
const computedUnit = value ? parsedUnit : selectedUnits[corner] || selectedUnits.flat || "px";
const unitConfig = units && units.find((item) => item.value === computedUnit);
const step = unitConfig?.step || 1;
const [showCustomValueControl, setShowCustomValueControl] = (0,external_wp_element_namespaceObject.useState)(
value !== void 0 && !isValuePreset(value)
);
const showRangeControl = presets.length <= constants_RANGE_CONTROL_MAX_SIZE;
const presetIndex = utils_getSliderValueFromPreset(value, presets);
const rangeTooltip = (newValue) => value === void 0 ? void 0 : presets[newValue]?.name;
const marks = presets.slice(1, presets.length - 1).map((_newValue, index) => ({
value: index + 1,
label: void 0
}));
const hasPresets = marks.length > 0;
let options = [];
if (!showRangeControl) {
options = [
...presets,
{
name: (0,external_wp_i18n_namespaceObject.__)("Custom"),
slug: "custom",
size: resolvedPresetValue
}
].map((size, index) => ({
key: index,
name: size.name
}));
}
const icon = constants_ICONS[corner];
const handleSliderChange = (next) => {
const val = next !== void 0 ? `${next}${computedUnit}` : void 0;
changeCornerValue(val);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { children: [
icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Icon,
{
className: "components-border-radius-control__icon",
icon,
size: 24
}
),
(!hasPresets || showCustomValueControl) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "components-border-radius-control__input-controls-wrapper", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: CORNERS[corner], placement: "top", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "components-border-radius-control__tooltip-wrapper", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
className: "components-border-radius-control__unit-control",
"aria-label": CORNERS[corner],
value: [parsedQuantity, computedUnit].join(
""
),
onChange: onChangeValue,
onUnitChange: onChangeUnit,
size: "__unstable-large",
min: MIN_BORDER_RADIUS_VALUE,
units
}
) }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.RangeControl,
{
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Border radius"),
hideLabelFromVision: true,
className: "components-border-radius-control__range-control",
value: parsedQuantity ?? "",
min: MIN_BORDER_RADIUS_VALUE,
max: MAX_BORDER_RADIUS_VALUES[computedUnit],
initialPosition: 0,
withInputField: false,
onChange: handleSliderChange,
step,
__nextHasNoMarginBottom: true
}
)
] }),
hasPresets && showRangeControl && !showCustomValueControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.RangeControl,
{
__next40pxDefaultSize: true,
className: "components-border-radius-control__range-control",
value: presetIndex,
onChange: (newSize) => {
changeCornerValue(
getPresetValueFromControlValue(
newSize,
"range",
presets
)
);
},
withInputField: false,
"aria-valuenow": presetIndex,
"aria-valuetext": presets[presetIndex]?.name,
renderTooltipContent: rangeTooltip,
min: 0,
max: presets.length - 1,
marks,
label: CORNERS[corner],
hideLabelFromVision: true,
__nextHasNoMarginBottom: true
}
),
!showRangeControl && !showCustomValueControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CustomSelectControl,
{
className: "components-border-radius-control__custom-select-control",
value: options.find(
(option) => option.key === presetIndex
) || options[options.length - 1],
onChange: (selection) => {
if (selection.selectedItem.key === options.length - 1) {
setShowCustomValueControl(true);
} else {
changeCornerValue(
getPresetValueFromControlValue(
selection.selectedItem.key,
"selectList",
presets
)
);
}
},
options,
label: CORNERS[corner],
hideLabelFromVision: true,
size: "__unstable-large"
}
),
hasPresets && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
label: showCustomValueControl ? (0,external_wp_i18n_namespaceObject.__)("Use border radius preset") : (0,external_wp_i18n_namespaceObject.__)("Set custom border radius"),
icon: settings_settings_default,
onClick: () => {
setShowCustomValueControl(!showCustomValueControl);
},
isPressed: showCustomValueControl,
size: "small",
className: "components-border-radius-control__custom-toggle",
iconSize: 24
}
)
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/index.js
function useBorderRadiusSizes(presets) {
const defaultSizes = presets?.default ?? constants_EMPTY_ARRAY;
const customSizes = presets?.custom ?? constants_EMPTY_ARRAY;
const themeSizes = presets?.theme ?? constants_EMPTY_ARRAY;
return (0,external_wp_element_namespaceObject.useMemo)(() => {
const sizes = [
{ name: (0,external_wp_i18n_namespaceObject.__)("None"), slug: "0", size: 0 },
...customSizes,
...themeSizes,
...defaultSizes
];
return sizes.length > constants_RANGE_CONTROL_MAX_SIZE ? [
{
name: (0,external_wp_i18n_namespaceObject.__)("Default"),
slug: "default",
size: void 0
},
...sizes
] : sizes;
}, [customSizes, themeSizes, defaultSizes]);
}
function BorderRadiusControl({ onChange, values, presets }) {
const [isLinked, setIsLinked] = (0,external_wp_element_namespaceObject.useState)(
!hasDefinedValues(values) || !hasMixedValues(values)
);
const options = useBorderRadiusSizes(presets);
const [selectedUnits, setSelectedUnits] = (0,external_wp_element_namespaceObject.useState)({
flat: typeof values === "string" ? (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values)[1] : void 0,
topLeft: (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values?.topLeft)[1],
topRight: (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values?.topRight)[1],
bottomLeft: (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values?.bottomLeft)[1],
bottomRight: (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(
values?.bottomRight
)[1]
});
const [availableUnits] = use_settings_useSettings("spacing.units");
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits: availableUnits || ["px", "em", "rem"]
});
const toggleLinked = () => setIsLinked(!isLinked);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "components-border-radius-control", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { className: "components-border-radius-control__header", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { as: "legend", children: (0,external_wp_i18n_namespaceObject.__)("Radius") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkedButton, { onClick: toggleLinked, isLinked })
] }),
isLinked ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SingleInputControl,
{
onChange,
selectedUnits,
setSelectedUnits,
values,
units,
corner: "all",
presets: options
}
) }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { children: [
"topLeft",
"topRight",
"bottomLeft",
"bottomRight"
].map((corner) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SingleInputControl,
{
onChange,
selectedUnits,
setSelectedUnits,
values: values || constants_DEFAULT_VALUES,
units,
corner,
presets: options
},
corner
)) })
] });
}
;// ./node_modules/@wordpress/icons/build-module/library/check.js
var check_check_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/shadow.js
var shadow_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/shadow-panel-components.js
const shadow_panel_components_EMPTY_ARRAY = [];
function ShadowPopoverContainer({ shadow, onShadowChange, settings }) {
const shadows = useShadowPresets(settings);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-global-styles__shadow-popover-container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { level: 5, children: (0,external_wp_i18n_namespaceObject.__)("Drop shadow") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ShadowPresets,
{
presets: shadows,
activeShadow: shadow,
onSelect: onShadowChange
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-global-styles__clear-shadow", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: () => onShadowChange(void 0),
disabled: !shadow,
accessibleWhenDisabled: true,
children: (0,external_wp_i18n_namespaceObject.__)("Clear")
}
) })
] }) });
}
function ShadowPresets({ presets, activeShadow, onSelect }) {
return !presets ? null : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite,
{
role: "listbox",
className: "block-editor-global-styles__shadow__list",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Drop shadows"),
children: presets.map(({ name, slug, shadow }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ShadowIndicator,
{
label: name,
isActive: shadow === activeShadow,
type: slug === "unset" ? "unset" : "preset",
onSelect: () => onSelect(shadow === activeShadow ? void 0 : shadow),
shadow
},
slug
))
}
);
}
function ShadowIndicator({ type, label, isActive, onSelect, shadow }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: label, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite.Item,
{
role: "option",
"aria-label": label,
"aria-selected": isActive,
className: dist_clsx("block-editor-global-styles__shadow__item", {
"is-active": isActive
}),
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"button",
{
className: dist_clsx(
"block-editor-global-styles__shadow-indicator",
{
unset: type === "unset"
}
),
onClick: onSelect,
style: { boxShadow: shadow },
"aria-label": label,
children: isActive && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: check_check_default })
}
)
}
) });
}
function ShadowPopover({ shadow, onShadowChange, settings }) {
const popoverProps = {
placement: "left-start",
offset: 36,
shift: true
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
popoverProps,
className: "block-editor-global-styles__shadow-dropdown",
renderToggle: renderShadowToggle(shadow, onShadowChange),
renderContent: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, { paddingSize: "medium", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ShadowPopoverContainer,
{
shadow,
onShadowChange,
settings
}
) })
}
);
}
function renderShadowToggle(shadow, onShadowChange) {
return ({ onToggle, isOpen }) => {
const shadowButtonRef = (0,external_wp_element_namespaceObject.useRef)(void 0);
const toggleProps = {
onClick: onToggle,
className: dist_clsx(
"block-editor-global-styles__shadow-dropdown-toggle",
{ "is-open": isOpen }
),
"aria-expanded": isOpen,
ref: shadowButtonRef
};
const removeButtonProps = {
onClick: () => {
if (isOpen) {
onToggle();
}
onShadowChange(void 0);
shadowButtonRef.current?.focus();
},
className: dist_clsx(
"block-editor-global-styles__shadow-editor__remove-button",
{ "is-open": isOpen }
),
label: (0,external_wp_i18n_namespaceObject.__)("Remove")
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, ...toggleProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
icon_default,
{
className: "block-editor-global-styles__toggle-icon",
icon: shadow_default,
size: 24
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: (0,external_wp_i18n_namespaceObject.__)("Drop shadow") })
] }) }),
!!shadow && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
size: "small",
icon: reset_default,
...removeButtonProps
}
)
] });
};
}
function useShadowPresets(settings) {
return (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!settings?.shadow) {
return shadow_panel_components_EMPTY_ARRAY;
}
const defaultPresetsEnabled = settings?.shadow?.defaultPresets;
const {
default: defaultShadows,
theme: themeShadows,
custom: customShadows
} = settings?.shadow?.presets ?? {};
const unsetShadow = {
name: (0,external_wp_i18n_namespaceObject.__)("Unset"),
slug: "unset",
shadow: "none"
};
const shadowPresets = [
...defaultPresetsEnabled && defaultShadows || shadow_panel_components_EMPTY_ARRAY,
...themeShadows || shadow_panel_components_EMPTY_ARRAY,
...customShadows || shadow_panel_components_EMPTY_ARRAY
];
if (shadowPresets.length) {
shadowPresets.unshift(unsetShadow);
}
return shadowPresets;
}, [settings]);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/border-panel.js
function useHasBorderPanel(settings) {
const controls = Object.values(useHasBorderPanelControls(settings));
return controls.some(Boolean);
}
function useHasBorderPanelControls(settings) {
const controls = {
hasBorderColor: useHasBorderColorControl(settings),
hasBorderRadius: useHasBorderRadiusControl(settings),
hasBorderStyle: useHasBorderStyleControl(settings),
hasBorderWidth: useHasBorderWidthControl(settings),
hasShadow: useHasShadowControl(settings)
};
return controls;
}
function useHasBorderColorControl(settings) {
return settings?.border?.color;
}
function useHasBorderRadiusControl(settings) {
return settings?.border?.radius;
}
function useHasBorderStyleControl(settings) {
return settings?.border?.style;
}
function useHasBorderWidthControl(settings) {
return settings?.border?.width;
}
function useHasShadowControl(settings) {
const shadows = useShadowPresets(settings);
return !!settings?.shadow && shadows.length > 0;
}
function BorderToolsPanel({
resetAllFilter,
onChange,
value,
panelId,
children,
label
}) {
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const resetAll = () => {
const updatedValue = resetAllFilter(value);
onChange(updatedValue);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label,
resetAll,
panelId,
dropdownMenuProps,
children
}
);
}
const border_panel_DEFAULT_CONTROLS = {
radius: true,
color: true,
width: true,
shadow: true
};
function BorderPanel({
as: Wrapper = BorderToolsPanel,
value,
onChange,
inheritedValue = value,
settings,
panelId,
name,
defaultControls = border_panel_DEFAULT_CONTROLS
}) {
const colors = useColorsPerOrigin(settings);
const decodeValue = (0,external_wp_element_namespaceObject.useCallback)(
(rawValue) => getValueFromVariable({ settings }, "", rawValue),
[settings]
);
const encodeColorValue = (colorValue) => {
const allColors = colors.flatMap(
({ colors: originColors }) => originColors
);
const colorObject = allColors.find(
({ color }) => color === colorValue
);
return colorObject ? "var:preset|color|" + colorObject.slug : colorValue;
};
const border = (0,external_wp_element_namespaceObject.useMemo)(() => {
if ((0,external_wp_components_namespaceObject.__experimentalHasSplitBorders)(inheritedValue?.border)) {
const borderValue = { ...inheritedValue?.border };
["top", "right", "bottom", "left"].forEach((side) => {
borderValue[side] = {
...borderValue[side],
color: decodeValue(borderValue[side]?.color)
};
});
return borderValue;
}
return {
...inheritedValue?.border,
color: inheritedValue?.border?.color ? decodeValue(inheritedValue?.border?.color) : void 0
};
}, [inheritedValue?.border, decodeValue]);
const setBorder = (newBorder) => onChange({ ...value, border: newBorder });
const showBorderColor = useHasBorderColorControl(settings);
const showBorderStyle = useHasBorderStyleControl(settings);
const showBorderWidth = useHasBorderWidthControl(settings);
const showBorderRadius = useHasBorderRadiusControl(settings);
const borderRadiusValues = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (typeof inheritedValue?.border?.radius !== "object") {
return decodeValue(inheritedValue?.border?.radius);
}
return {
topLeft: decodeValue(inheritedValue?.border?.radius?.topLeft),
topRight: decodeValue(inheritedValue?.border?.radius?.topRight),
bottomLeft: decodeValue(
inheritedValue?.border?.radius?.bottomLeft
),
bottomRight: decodeValue(
inheritedValue?.border?.radius?.bottomRight
)
};
}, [inheritedValue?.border?.radius, decodeValue]);
const setBorderRadius = (newBorderRadius) => setBorder({ ...border, radius: newBorderRadius });
const hasBorderRadius = () => {
const borderValues = value?.border?.radius;
if (typeof borderValues === "object") {
return Object.entries(borderValues).some(Boolean);
}
return !!borderValues;
};
const hasShadowControl = useHasShadowControl(settings);
const shadow = decodeValue(inheritedValue?.shadow);
const shadowPresets = settings?.shadow?.presets ?? {};
const mergedShadowPresets = shadowPresets.custom ?? shadowPresets.theme ?? shadowPresets.default ?? [];
const setShadow = (newValue) => {
const slug = mergedShadowPresets?.find(
({ shadow: shadowName }) => shadowName === newValue
)?.slug;
onChange(
setImmutably(
value,
["shadow"],
slug ? `var:preset|shadow|${slug}` : newValue || void 0
)
);
};
const hasShadow = () => !!value?.shadow;
const resetShadow = () => setShadow(void 0);
const resetBorder = () => {
if (hasBorderRadius()) {
return setBorder({ radius: value?.border?.radius });
}
setBorder(void 0);
};
const onBorderChange = (newBorder) => {
const updatedBorder = { ...newBorder };
if ((0,external_wp_components_namespaceObject.__experimentalHasSplitBorders)(updatedBorder)) {
["top", "right", "bottom", "left"].forEach((side) => {
if (updatedBorder[side]) {
updatedBorder[side] = {
...updatedBorder[side],
color: encodeColorValue(updatedBorder[side]?.color)
};
}
});
} else if (updatedBorder) {
updatedBorder.color = encodeColorValue(updatedBorder.color);
}
setBorder({ radius: border?.radius, ...updatedBorder });
};
const resetAllFilter = (0,external_wp_element_namespaceObject.useCallback)((previousValue) => {
return {
...previousValue,
border: void 0,
shadow: void 0
};
}, []);
const showBorderByDefault = defaultControls?.color || defaultControls?.width;
const hasBorderControl = showBorderColor || showBorderStyle || showBorderWidth || showBorderRadius;
const label = useBorderPanelLabel({
blockName: name,
hasShadowControl,
hasBorderControl
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
Wrapper,
{
resetAllFilter,
value,
onChange,
panelId,
label,
children: [
(showBorderWidth || showBorderColor) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: () => (0,external_wp_components_namespaceObject.__experimentalIsDefinedBorder)(value?.border),
label: (0,external_wp_i18n_namespaceObject.__)("Border"),
onDeselect: () => resetBorder(),
isShownByDefault: showBorderByDefault,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.BorderBoxControl,
{
colors,
enableAlpha: true,
enableStyle: showBorderStyle,
onChange: onBorderChange,
popoverOffset: 40,
popoverPlacement: "left-start",
value: border,
__experimentalIsRenderedInSidebar: true,
size: "__unstable-large",
hideLabelFromVision: !hasShadowControl,
label: (0,external_wp_i18n_namespaceObject.__)("Border")
}
)
}
),
showBorderRadius && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: hasBorderRadius,
label: (0,external_wp_i18n_namespaceObject.__)("Radius"),
onDeselect: () => setBorderRadius(void 0),
isShownByDefault: defaultControls.radius,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BorderRadiusControl,
{
presets: settings?.border?.radiusSizes,
values: borderRadiusValues,
onChange: (newValue) => {
setBorderRadius(newValue || void 0);
}
}
)
}
),
hasShadowControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Shadow"),
hasValue: hasShadow,
onDeselect: resetShadow,
isShownByDefault: defaultControls.shadow,
panelId,
children: [
hasBorderControl ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { as: "legend", children: (0,external_wp_i18n_namespaceObject.__)("Shadow") }) : null,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ShadowPopover,
{
shadow,
onShadowChange: setShadow,
settings
}
)
]
}
)
]
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/border.js
const BORDER_SUPPORT_KEY = "__experimentalBorder";
const SHADOW_SUPPORT_KEY = "shadow";
const getColorByProperty = (colors, property, value) => {
let matchedColor;
colors.some(
(origin) => origin.colors.some((color) => {
if (color[property] === value) {
matchedColor = color;
return true;
}
return false;
})
);
return matchedColor;
};
const getMultiOriginColor = ({ colors, namedColor, customColor }) => {
if (namedColor) {
const colorObject2 = getColorByProperty(colors, "slug", namedColor);
if (colorObject2) {
return colorObject2;
}
}
if (!customColor) {
return { color: void 0 };
}
const colorObject = getColorByProperty(colors, "color", customColor);
return colorObject ? colorObject : { color: customColor };
};
function getColorSlugFromVariable(value) {
const namedColor = /var:preset\|color\|(.+)/.exec(value);
if (namedColor && namedColor[1]) {
return namedColor[1];
}
return null;
}
function styleToAttributes(style) {
if ((0,external_wp_components_namespaceObject.__experimentalHasSplitBorders)(style?.border)) {
return {
style,
borderColor: void 0
};
}
const borderColorValue = style?.border?.color;
const borderColorSlug = borderColorValue?.startsWith("var:preset|color|") ? borderColorValue.substring("var:preset|color|".length) : void 0;
const updatedStyle = { ...style };
updatedStyle.border = {
...updatedStyle.border,
color: borderColorSlug ? void 0 : borderColorValue
};
return {
style: utils_cleanEmptyObject(updatedStyle),
borderColor: borderColorSlug
};
}
function attributesToStyle(attributes) {
if ((0,external_wp_components_namespaceObject.__experimentalHasSplitBorders)(attributes.style?.border)) {
return attributes.style;
}
return {
...attributes.style,
border: {
...attributes.style?.border,
color: attributes.borderColor ? "var:preset|color|" + attributes.borderColor : attributes.style?.border?.color
}
};
}
function BordersInspectorControl({ label, children, resetAllFilter }) {
const attributesResetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(
(attributes) => {
const existingStyle = attributesToStyle(attributes);
const updatedStyle = resetAllFilter(existingStyle);
return {
...attributes,
...styleToAttributes(updatedStyle)
};
},
[resetAllFilter]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inspector_controls_default,
{
group: "border",
resetAllFilter: attributesResetAllFilter,
label,
children
}
);
}
function border_BorderPanel({ clientId, name, setAttributes, settings }) {
const isEnabled = useHasBorderPanel(settings);
function selector(select) {
const { style: style2, borderColor: borderColor2 } = select(store).getBlockAttributes(clientId) || {};
return { style: style2, borderColor: borderColor2 };
}
const { style, borderColor } = (0,external_wp_data_namespaceObject.useSelect)(selector, [clientId]);
const value = (0,external_wp_element_namespaceObject.useMemo)(() => {
return attributesToStyle({ style, borderColor });
}, [style, borderColor]);
const onChange = (newStyle) => {
setAttributes(styleToAttributes(newStyle));
};
if (!isEnabled) {
return null;
}
const defaultControls = {
...(0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [
BORDER_SUPPORT_KEY,
"__experimentalDefaultControls"
]),
...(0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [
SHADOW_SUPPORT_KEY,
"__experimentalDefaultControls"
])
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BorderPanel,
{
as: BordersInspectorControl,
panelId: clientId,
settings,
value,
onChange,
defaultControls
}
);
}
function hasBorderSupport(blockName, feature = "any") {
if (external_wp_element_namespaceObject.Platform.OS !== "web") {
return false;
}
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, BORDER_SUPPORT_KEY);
if (support === true) {
return true;
}
if (feature === "any") {
return !!(support?.color || support?.radius || support?.width || support?.style);
}
return !!support?.[feature];
}
function hasShadowSupport(blockName) {
return hasBlockSupport(blockName, SHADOW_SUPPORT_KEY);
}
function useBorderPanelLabel({
blockName,
hasBorderControl,
hasShadowControl
} = {}) {
const settings = useBlockSettings(blockName);
const controls = useHasBorderPanelControls(settings);
if (!hasBorderControl && !hasShadowControl && blockName) {
hasBorderControl = controls?.hasBorderColor || controls?.hasBorderStyle || controls?.hasBorderWidth || controls?.hasBorderRadius;
hasShadowControl = controls?.hasShadow;
}
if (hasBorderControl && hasShadowControl) {
return (0,external_wp_i18n_namespaceObject.__)("Border & Shadow");
}
if (hasShadowControl) {
return (0,external_wp_i18n_namespaceObject.__)("Shadow");
}
return (0,external_wp_i18n_namespaceObject.__)("Border");
}
function removeBorderAttribute(style, attribute) {
return cleanEmptyObject({
...style,
border: {
...style?.border,
[attribute]: void 0
}
});
}
function addAttributes(settings) {
if (!hasBorderSupport(settings, "color")) {
return settings;
}
if (settings.attributes.borderColor) {
return settings;
}
return {
...settings,
attributes: {
...settings.attributes,
borderColor: {
type: "string"
}
}
};
}
function border_addSaveProps(props, blockNameOrType, attributes) {
if (!hasBorderSupport(blockNameOrType, "color") || shouldSkipSerialization(blockNameOrType, BORDER_SUPPORT_KEY, "color")) {
return props;
}
const borderClasses = getBorderClasses(attributes);
const newClassName = dist_clsx(props.className, borderClasses);
props.className = newClassName ? newClassName : void 0;
return props;
}
function getBorderClasses(attributes) {
const { borderColor, style } = attributes;
const borderColorClass = getColorClassName("border-color", borderColor);
return dist_clsx({
"has-border-color": borderColor || style?.border?.color,
[borderColorClass]: !!borderColorClass
});
}
function border_useBlockProps({ name, borderColor, style }) {
const { colors } = useMultipleOriginColorsAndGradients();
if (!hasBorderSupport(name, "color") || shouldSkipSerialization(name, BORDER_SUPPORT_KEY, "color")) {
return {};
}
const { color: borderColorValue } = getMultiOriginColor({
colors,
namedColor: borderColor
});
const { color: borderTopColor } = getMultiOriginColor({
colors,
namedColor: getColorSlugFromVariable(style?.border?.top?.color)
});
const { color: borderRightColor } = getMultiOriginColor({
colors,
namedColor: getColorSlugFromVariable(style?.border?.right?.color)
});
const { color: borderBottomColor } = getMultiOriginColor({
colors,
namedColor: getColorSlugFromVariable(style?.border?.bottom?.color)
});
const { color: borderLeftColor } = getMultiOriginColor({
colors,
namedColor: getColorSlugFromVariable(style?.border?.left?.color)
});
const extraStyles = {
borderTopColor: borderTopColor || borderColorValue,
borderRightColor: borderRightColor || borderColorValue,
borderBottomColor: borderBottomColor || borderColorValue,
borderLeftColor: borderLeftColor || borderColorValue
};
return border_addSaveProps(
{ style: utils_cleanEmptyObject(extraStyles) || {} },
name,
{ borderColor, style }
);
}
var border_default = {
useBlockProps: border_useBlockProps,
addSaveProps: border_addSaveProps,
attributeKeys: ["borderColor", "style"],
hasSupport(name) {
return hasBorderSupport(name, "color");
}
};
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.registerBlockType",
"core/border/addAttributes",
addAttributes
);
;// ./node_modules/@wordpress/block-editor/build-module/components/gradients/use-gradient.js
function __experimentalGetGradientClass(gradientSlug) {
if (!gradientSlug) {
return void 0;
}
return `has-${gradientSlug}-gradient-background`;
}
function getGradientValueBySlug(gradients, slug) {
const gradient = gradients?.find((g) => g.slug === slug);
return gradient && gradient.gradient;
}
function __experimentalGetGradientObjectByGradientValue(gradients, value) {
const gradient = gradients?.find((g) => g.gradient === value);
return gradient;
}
function getGradientSlugByValue(gradients, value) {
const gradient = __experimentalGetGradientObjectByGradientValue(
gradients,
value
);
return gradient && gradient.slug;
}
function __experimentalUseGradient({
gradientAttribute = "gradient",
customGradientAttribute = "customGradient"
} = {}) {
const { clientId } = useBlockEditContext();
const [
userGradientPalette,
themeGradientPalette,
defaultGradientPalette
] = use_settings_useSettings(
"color.gradients.custom",
"color.gradients.theme",
"color.gradients.default"
);
const allGradients = (0,external_wp_element_namespaceObject.useMemo)(
() => [
...userGradientPalette || [],
...themeGradientPalette || [],
...defaultGradientPalette || []
],
[userGradientPalette, themeGradientPalette, defaultGradientPalette]
);
const { gradient, customGradient } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockAttributes } = select(store);
const attributes = getBlockAttributes(clientId) || {};
return {
customGradient: attributes[customGradientAttribute],
gradient: attributes[gradientAttribute]
};
},
[clientId, gradientAttribute, customGradientAttribute]
);
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const setGradient = (0,external_wp_element_namespaceObject.useCallback)(
(newGradientValue) => {
const slug = getGradientSlugByValue(
allGradients,
newGradientValue
);
if (slug) {
updateBlockAttributes(clientId, {
[gradientAttribute]: slug,
[customGradientAttribute]: void 0
});
return;
}
updateBlockAttributes(clientId, {
[gradientAttribute]: void 0,
[customGradientAttribute]: newGradientValue
});
},
[allGradients, clientId, updateBlockAttributes]
);
const gradientClass = __experimentalGetGradientClass(gradient);
let gradientValue;
if (gradient) {
gradientValue = getGradientValueBySlug(allGradients, gradient);
} else {
gradientValue = customGradient;
}
return { gradientClass, gradientValue, setGradient };
}
;// ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/control.js
const { Tabs } = unlock(external_wp_components_namespaceObject.privateApis);
const colorsAndGradientKeys = [
"colors",
"disableCustomColors",
"gradients",
"disableCustomGradients"
];
const TAB_IDS = { color: "color", gradient: "gradient" };
function ColorGradientControlInner({
colors,
gradients,
disableCustomColors,
disableCustomGradients,
__experimentalIsRenderedInSidebar,
className,
label,
onColorChange,
onGradientChange,
colorValue,
gradientValue,
clearable,
showTitle = true,
enableAlpha,
headingLevel
}) {
const canChooseAColor = onColorChange && (colors && colors.length > 0 || !disableCustomColors);
const canChooseAGradient = onGradientChange && (gradients && gradients.length > 0 || !disableCustomGradients);
if (!canChooseAColor && !canChooseAGradient) {
return null;
}
const tabPanels = {
[TAB_IDS.color]: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ColorPalette,
{
value: colorValue,
onChange: canChooseAGradient ? (newColor) => {
onColorChange(newColor);
onGradientChange();
} : onColorChange,
...{ colors, disableCustomColors },
__experimentalIsRenderedInSidebar,
clearable,
enableAlpha,
headingLevel
}
),
[TAB_IDS.gradient]: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.GradientPicker,
{
value: gradientValue,
onChange: canChooseAColor ? (newGradient) => {
onGradientChange(newGradient);
onColorChange();
} : onGradientChange,
...{ gradients, disableCustomGradients },
__experimentalIsRenderedInSidebar,
clearable,
headingLevel
}
)
};
const renderPanelType = (type) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-color-gradient-control__panel", children: tabPanels[type] });
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.BaseControl,
{
__nextHasNoMarginBottom: true,
className: dist_clsx(
"block-editor-color-gradient-control",
className
),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("fieldset", { className: "block-editor-color-gradient-control__fieldset", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 1, children: [
showTitle && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("legend", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-color-gradient-control__color-indicator", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { children: label }) }) }),
canChooseAColor && canChooseAGradient && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
Tabs,
{
defaultTabId: gradientValue ? TAB_IDS.gradient : !!canChooseAColor && TAB_IDS.color,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs.TabList, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, { tabId: TAB_IDS.color, children: (0,external_wp_i18n_namespaceObject.__)("Color") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, { tabId: TAB_IDS.gradient, children: (0,external_wp_i18n_namespaceObject.__)("Gradient") })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Tabs.TabPanel,
{
tabId: TAB_IDS.color,
className: "block-editor-color-gradient-control__panel",
focusable: false,
children: tabPanels.color
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Tabs.TabPanel,
{
tabId: TAB_IDS.gradient,
className: "block-editor-color-gradient-control__panel",
focusable: false,
children: tabPanels.gradient
}
)
]
}
) }),
!canChooseAGradient && renderPanelType(TAB_IDS.color),
!canChooseAColor && renderPanelType(TAB_IDS.gradient)
] }) })
}
);
}
function ColorGradientControlSelect(props) {
const [colors, gradients, customColors, customGradients] = use_settings_useSettings(
"color.palette",
"color.gradients",
"color.custom",
"color.customGradient"
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ColorGradientControlInner,
{
colors,
gradients,
disableCustomColors: !customColors,
disableCustomGradients: !customGradients,
...props
}
);
}
function ColorGradientControl(props) {
if (colorsAndGradientKeys.every((key) => props.hasOwnProperty(key))) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorGradientControlInner, { ...props });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorGradientControlSelect, { ...props });
}
var control_default = ColorGradientControl;
;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/color-panel.js
function useHasColorPanel(settings) {
const hasTextPanel = useHasTextPanel(settings);
const hasBackgroundPanel = useHasBackgroundColorPanel(settings);
const hasLinkPanel = useHasLinkPanel(settings);
const hasHeadingPanel = useHasHeadingPanel(settings);
const hasButtonPanel = useHasButtonPanel(settings);
const hasCaptionPanel = useHasCaptionPanel(settings);
return hasTextPanel || hasBackgroundPanel || hasLinkPanel || hasHeadingPanel || hasButtonPanel || hasCaptionPanel;
}
function useHasTextPanel(settings) {
const colors = useColorsPerOrigin(settings);
return settings?.color?.text && (colors?.length > 0 || settings?.color?.custom);
}
function useHasLinkPanel(settings) {
const colors = useColorsPerOrigin(settings);
return settings?.color?.link && (colors?.length > 0 || settings?.color?.custom);
}
function useHasCaptionPanel(settings) {
const colors = useColorsPerOrigin(settings);
return settings?.color?.caption && (colors?.length > 0 || settings?.color?.custom);
}
function useHasHeadingPanel(settings) {
const colors = useColorsPerOrigin(settings);
const gradients = useGradientsPerOrigin(settings);
return settings?.color?.heading && (colors?.length > 0 || settings?.color?.custom || gradients?.length > 0 || settings?.color?.customGradient);
}
function useHasButtonPanel(settings) {
const colors = useColorsPerOrigin(settings);
const gradients = useGradientsPerOrigin(settings);
return settings?.color?.button && (colors?.length > 0 || settings?.color?.custom || gradients?.length > 0 || settings?.color?.customGradient);
}
function useHasBackgroundColorPanel(settings) {
const colors = useColorsPerOrigin(settings);
const gradients = useGradientsPerOrigin(settings);
return settings?.color?.background && (colors?.length > 0 || settings?.color?.custom || gradients?.length > 0 || settings?.color?.customGradient);
}
function ColorToolsPanel({
resetAllFilter,
onChange,
value,
panelId,
children
}) {
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const resetAll = () => {
const updatedValue = resetAllFilter(value);
onChange(updatedValue);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Elements"),
resetAll,
panelId,
hasInnerWrapper: true,
headingLevel: 3,
className: "color-block-support-panel",
__experimentalFirstVisibleItemClass: "first",
__experimentalLastVisibleItemClass: "last",
dropdownMenuProps,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "color-block-support-panel__inner-wrapper", children })
}
);
}
const color_panel_DEFAULT_CONTROLS = {
text: true,
background: true,
link: true,
heading: true,
button: true,
caption: true
};
const popoverProps = {
placement: "left-start",
offset: 36,
shift: true,
flip: true,
resize: false
};
const { Tabs: color_panel_Tabs } = unlock(external_wp_components_namespaceObject.privateApis);
const LabeledColorIndicators = ({ indicators, label }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalZStack, { isLayered: false, offset: -8, children: indicators.map((indicator, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { expanded: false, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ColorIndicator, { colorValue: indicator }) }, index)) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { className: "block-editor-panel-color-gradient-settings__color-name", children: label })
] });
function ColorPanelTab({
isGradient,
inheritedValue,
userValue,
setValue,
colorGradientControlSettings
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
control_default,
{
...colorGradientControlSettings,
showTitle: false,
enableAlpha: true,
__experimentalIsRenderedInSidebar: true,
colorValue: isGradient ? void 0 : inheritedValue,
gradientValue: isGradient ? inheritedValue : void 0,
onColorChange: isGradient ? void 0 : setValue,
onGradientChange: isGradient ? setValue : void 0,
clearable: inheritedValue === userValue,
headingLevel: 3
}
);
}
function ColorPanelDropdown({
label,
hasValue,
resetValue,
isShownByDefault,
indicators,
tabs,
colorGradientControlSettings,
panelId
}) {
const currentTab = tabs.find((tab) => tab.userValue !== void 0);
const { key: firstTabKey, ...firstTab } = tabs[0] ?? {};
const colorGradientDropdownButtonRef = (0,external_wp_element_namespaceObject.useRef)(void 0);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
className: "block-editor-tools-panel-color-gradient-settings__item",
hasValue,
label,
onDeselect: resetValue,
isShownByDefault,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
popoverProps,
className: "block-editor-tools-panel-color-gradient-settings__dropdown",
renderToggle: ({ onToggle, isOpen }) => {
const toggleProps = {
onClick: onToggle,
className: dist_clsx(
"block-editor-panel-color-gradient-settings__dropdown",
{ "is-open": isOpen }
),
"aria-expanded": isOpen,
ref: colorGradientDropdownButtonRef
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { ...toggleProps, __next40pxDefaultSize: true, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
LabeledColorIndicators,
{
indicators,
label
}
) }),
hasValue() && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Reset"),
className: "block-editor-panel-color-gradient-settings__reset",
size: "small",
icon: reset_default,
onClick: () => {
resetValue();
if (isOpen) {
onToggle();
}
colorGradientDropdownButtonRef.current?.focus();
}
}
)
] });
},
renderContent: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, { paddingSize: "none", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-panel-color-gradient-settings__dropdown-content", children: [
tabs.length === 1 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ColorPanelTab,
{
...firstTab,
colorGradientControlSettings
},
firstTabKey
),
tabs.length > 1 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(color_panel_Tabs, { defaultTabId: currentTab?.key, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(color_panel_Tabs.TabList, { children: tabs.map((tab) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
color_panel_Tabs.Tab,
{
tabId: tab.key,
children: tab.label
},
tab.key
)) }),
tabs.map((tab) => {
const { key: tabKey, ...restTabProps } = tab;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
color_panel_Tabs.TabPanel,
{
tabId: tabKey,
focusable: false,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ColorPanelTab,
{
...restTabProps,
colorGradientControlSettings
},
tabKey
)
},
tabKey
);
})
] })
] }) })
}
)
}
);
}
function ColorPanel({
as: Wrapper = ColorToolsPanel,
value,
onChange,
inheritedValue = value,
settings,
panelId,
defaultControls = color_panel_DEFAULT_CONTROLS,
children
}) {
const colors = useColorsPerOrigin(settings);
const gradients = useGradientsPerOrigin(settings);
const areCustomSolidsEnabled = settings?.color?.custom;
const areCustomGradientsEnabled = settings?.color?.customGradient;
const hasSolidColors = colors.length > 0 || areCustomSolidsEnabled;
const hasGradientColors = gradients.length > 0 || areCustomGradientsEnabled;
const decodeValue = (rawValue) => getValueFromVariable({ settings }, "", rawValue);
const encodeColorValue = (colorValue) => {
const allColors = colors.flatMap(
({ colors: originColors }) => originColors
);
const colorObject = allColors.find(
({ color }) => color === colorValue
);
return colorObject ? "var:preset|color|" + colorObject.slug : colorValue;
};
const encodeGradientValue = (gradientValue) => {
const allGradients = gradients.flatMap(
({ gradients: originGradients }) => originGradients
);
const gradientObject = allGradients.find(
({ gradient: gradient2 }) => gradient2 === gradientValue
);
return gradientObject ? "var:preset|gradient|" + gradientObject.slug : gradientValue;
};
const showBackgroundPanel = useHasBackgroundColorPanel(settings);
const backgroundColor = decodeValue(inheritedValue?.color?.background);
const userBackgroundColor = decodeValue(value?.color?.background);
const gradient = decodeValue(inheritedValue?.color?.gradient);
const userGradient = decodeValue(value?.color?.gradient);
const hasBackground = () => !!userBackgroundColor || !!userGradient;
const setBackgroundColor = (newColor) => {
const newValue = setImmutably(
value,
["color", "background"],
encodeColorValue(newColor)
);
newValue.color.gradient = void 0;
onChange(newValue);
};
const setGradient = (newGradient) => {
const newValue = setImmutably(
value,
["color", "gradient"],
encodeGradientValue(newGradient)
);
newValue.color.background = void 0;
onChange(newValue);
};
const resetBackground = () => {
const newValue = setImmutably(
value,
["color", "background"],
void 0
);
newValue.color.gradient = void 0;
onChange(newValue);
};
const showLinkPanel = useHasLinkPanel(settings);
const linkColor = decodeValue(
inheritedValue?.elements?.link?.color?.text
);
const userLinkColor = decodeValue(value?.elements?.link?.color?.text);
const setLinkColor = (newColor) => {
onChange(
setImmutably(
value,
["elements", "link", "color", "text"],
encodeColorValue(newColor)
)
);
};
const hoverLinkColor = decodeValue(
inheritedValue?.elements?.link?.[":hover"]?.color?.text
);
const userHoverLinkColor = decodeValue(
value?.elements?.link?.[":hover"]?.color?.text
);
const setHoverLinkColor = (newColor) => {
onChange(
setImmutably(
value,
["elements", "link", ":hover", "color", "text"],
encodeColorValue(newColor)
)
);
};
const hasLink = () => !!userLinkColor || !!userHoverLinkColor;
const resetLink = () => {
let newValue = setImmutably(
value,
["elements", "link", ":hover", "color", "text"],
void 0
);
newValue = setImmutably(
newValue,
["elements", "link", "color", "text"],
void 0
);
onChange(newValue);
};
const showTextPanel = useHasTextPanel(settings);
const textColor = decodeValue(inheritedValue?.color?.text);
const userTextColor = decodeValue(value?.color?.text);
const hasTextColor = () => !!userTextColor;
const setTextColor = (newColor) => {
let changedObject = setImmutably(
value,
["color", "text"],
encodeColorValue(newColor)
);
if (textColor === linkColor) {
changedObject = setImmutably(
changedObject,
["elements", "link", "color", "text"],
encodeColorValue(newColor)
);
}
onChange(changedObject);
};
const resetTextColor = () => setTextColor(void 0);
const elements = [
{
name: "caption",
label: (0,external_wp_i18n_namespaceObject.__)("Captions"),
showPanel: useHasCaptionPanel(settings)
},
{
name: "button",
label: (0,external_wp_i18n_namespaceObject.__)("Button"),
showPanel: useHasButtonPanel(settings)
},
{
name: "heading",
label: (0,external_wp_i18n_namespaceObject.__)("Heading"),
showPanel: useHasHeadingPanel(settings)
},
{
name: "h1",
label: (0,external_wp_i18n_namespaceObject.__)("H1"),
showPanel: useHasHeadingPanel(settings)
},
{
name: "h2",
label: (0,external_wp_i18n_namespaceObject.__)("H2"),
showPanel: useHasHeadingPanel(settings)
},
{
name: "h3",
label: (0,external_wp_i18n_namespaceObject.__)("H3"),
showPanel: useHasHeadingPanel(settings)
},
{
name: "h4",
label: (0,external_wp_i18n_namespaceObject.__)("H4"),
showPanel: useHasHeadingPanel(settings)
},
{
name: "h5",
label: (0,external_wp_i18n_namespaceObject.__)("H5"),
showPanel: useHasHeadingPanel(settings)
},
{
name: "h6",
label: (0,external_wp_i18n_namespaceObject.__)("H6"),
showPanel: useHasHeadingPanel(settings)
}
];
const resetAllFilter = (0,external_wp_element_namespaceObject.useCallback)((previousValue) => {
return {
...previousValue,
color: void 0,
elements: {
...previousValue?.elements,
link: {
...previousValue?.elements?.link,
color: void 0,
":hover": {
color: void 0
}
},
...elements.reduce((acc, element) => {
return {
...acc,
[element.name]: {
...previousValue?.elements?.[element.name],
color: void 0
}
};
}, {})
}
};
}, []);
const items = [
showTextPanel && {
key: "text",
label: (0,external_wp_i18n_namespaceObject.__)("Text"),
hasValue: hasTextColor,
resetValue: resetTextColor,
isShownByDefault: defaultControls.text,
indicators: [textColor],
tabs: [
{
key: "text",
label: (0,external_wp_i18n_namespaceObject.__)("Text"),
inheritedValue: textColor,
setValue: setTextColor,
userValue: userTextColor
}
]
},
showBackgroundPanel && {
key: "background",
label: (0,external_wp_i18n_namespaceObject.__)("Background"),
hasValue: hasBackground,
resetValue: resetBackground,
isShownByDefault: defaultControls.background,
indicators: [gradient ?? backgroundColor],
tabs: [
hasSolidColors && {
key: "background",
label: (0,external_wp_i18n_namespaceObject.__)("Color"),
inheritedValue: backgroundColor,
setValue: setBackgroundColor,
userValue: userBackgroundColor
},
hasGradientColors && {
key: "gradient",
label: (0,external_wp_i18n_namespaceObject.__)("Gradient"),
inheritedValue: gradient,
setValue: setGradient,
userValue: userGradient,
isGradient: true
}
].filter(Boolean)
},
showLinkPanel && {
key: "link",
label: (0,external_wp_i18n_namespaceObject.__)("Link"),
hasValue: hasLink,
resetValue: resetLink,
isShownByDefault: defaultControls.link,
indicators: [linkColor, hoverLinkColor],
tabs: [
{
key: "link",
label: (0,external_wp_i18n_namespaceObject.__)("Default"),
inheritedValue: linkColor,
setValue: setLinkColor,
userValue: userLinkColor
},
{
key: "hover",
label: (0,external_wp_i18n_namespaceObject.__)("Hover"),
inheritedValue: hoverLinkColor,
setValue: setHoverLinkColor,
userValue: userHoverLinkColor
}
]
}
].filter(Boolean);
elements.forEach(({ name, label, showPanel }) => {
if (!showPanel) {
return;
}
const elementBackgroundColor = decodeValue(
inheritedValue?.elements?.[name]?.color?.background
);
const elementGradient = decodeValue(
inheritedValue?.elements?.[name]?.color?.gradient
);
const elementTextColor = decodeValue(
inheritedValue?.elements?.[name]?.color?.text
);
const elementBackgroundUserColor = decodeValue(
value?.elements?.[name]?.color?.background
);
const elementGradientUserColor = decodeValue(
value?.elements?.[name]?.color?.gradient
);
const elementTextUserColor = decodeValue(
value?.elements?.[name]?.color?.text
);
const hasElement = () => !!(elementTextUserColor || elementBackgroundUserColor || elementGradientUserColor);
const resetElement = () => {
const newValue = setImmutably(
value,
["elements", name, "color", "background"],
void 0
);
newValue.elements[name].color.gradient = void 0;
newValue.elements[name].color.text = void 0;
onChange(newValue);
};
const setElementTextColor = (newTextColor) => {
onChange(
setImmutably(
value,
["elements", name, "color", "text"],
encodeColorValue(newTextColor)
)
);
};
const setElementBackgroundColor = (newBackgroundColor) => {
const newValue = setImmutably(
value,
["elements", name, "color", "background"],
encodeColorValue(newBackgroundColor)
);
newValue.elements[name].color.gradient = void 0;
onChange(newValue);
};
const setElementGradient = (newGradient) => {
const newValue = setImmutably(
value,
["elements", name, "color", "gradient"],
encodeGradientValue(newGradient)
);
newValue.elements[name].color.background = void 0;
onChange(newValue);
};
const supportsTextColor = true;
const supportsBackground = name !== "caption";
items.push({
key: name,
label,
hasValue: hasElement,
resetValue: resetElement,
isShownByDefault: defaultControls[name],
indicators: supportsTextColor && supportsBackground ? [
elementTextColor,
elementGradient ?? elementBackgroundColor
] : [
supportsTextColor ? elementTextColor : elementGradient ?? elementBackgroundColor
],
tabs: [
hasSolidColors && supportsTextColor && {
key: "text",
label: (0,external_wp_i18n_namespaceObject.__)("Text"),
inheritedValue: elementTextColor,
setValue: setElementTextColor,
userValue: elementTextUserColor
},
hasSolidColors && supportsBackground && {
key: "background",
label: (0,external_wp_i18n_namespaceObject.__)("Background"),
inheritedValue: elementBackgroundColor,
setValue: setElementBackgroundColor,
userValue: elementBackgroundUserColor
},
hasGradientColors && supportsBackground && {
key: "gradient",
label: (0,external_wp_i18n_namespaceObject.__)("Gradient"),
inheritedValue: elementGradient,
setValue: setElementGradient,
userValue: elementGradientUserColor,
isGradient: true
}
].filter(Boolean)
});
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
Wrapper,
{
resetAllFilter,
value,
onChange,
panelId,
children: [
items.map((item) => {
const { key, ...restItem } = item;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ColorPanelDropdown,
{
...restItem,
colorGradientControlSettings: {
colors,
disableCustomColors: !areCustomSolidsEnabled,
gradients,
disableCustomGradients: !areCustomGradientsEnabled
},
panelId
},
key
);
}),
children
]
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/contrast-checker/index.js
k([names, a11y]);
function ContrastChecker({
backgroundColor,
fallbackBackgroundColor,
fallbackTextColor,
fallbackLinkColor,
fontSize,
// Font size value in pixels.
isLargeText,
textColor,
linkColor,
enableAlphaChecker = false
}) {
const currentBackgroundColor = backgroundColor || fallbackBackgroundColor;
if (!currentBackgroundColor) {
return null;
}
const currentTextColor = textColor || fallbackTextColor;
const currentLinkColor = linkColor || fallbackLinkColor;
if (!currentTextColor && !currentLinkColor) {
return null;
}
const textColors = [
{
color: currentTextColor,
description: (0,external_wp_i18n_namespaceObject.__)("text color")
},
{
color: currentLinkColor,
description: (0,external_wp_i18n_namespaceObject.__)("link color")
}
];
const colordBackgroundColor = w(currentBackgroundColor);
const backgroundColorHasTransparency = colordBackgroundColor.alpha() < 1;
const backgroundColorBrightness = colordBackgroundColor.brightness();
const isReadableOptions = {
level: "AA",
size: isLargeText || isLargeText !== false && fontSize >= 24 ? "large" : "small"
};
let message = "";
let speakMessage = "";
for (const item of textColors) {
if (!item.color) {
continue;
}
const colordTextColor = w(item.color);
const isColordTextReadable = colordTextColor.isReadable(
colordBackgroundColor,
isReadableOptions
);
const textHasTransparency = colordTextColor.alpha() < 1;
if (!isColordTextReadable) {
if (backgroundColorHasTransparency || textHasTransparency) {
continue;
}
message = backgroundColorBrightness < colordTextColor.brightness() ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s is a type of text color, e.g., "text color" or "link color".
(0,external_wp_i18n_namespaceObject.__)(
"This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."
),
item.description
) : (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s is a type of text color, e.g., "text color" or "link color".
(0,external_wp_i18n_namespaceObject.__)(
"This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."
),
item.description
);
speakMessage = (0,external_wp_i18n_namespaceObject.__)(
"This color combination may be hard for people to read."
);
break;
}
if (textHasTransparency && enableAlphaChecker) {
message = (0,external_wp_i18n_namespaceObject.__)("Transparent text may be hard for people to read.");
speakMessage = (0,external_wp_i18n_namespaceObject.__)(
"Transparent text may be hard for people to read."
);
}
}
if (!message) {
return null;
}
(0,external_wp_a11y_namespaceObject.speak)(speakMessage);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-contrast-checker", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Notice,
{
spokenMessage: null,
status: "warning",
isDismissible: false,
children: message
}
) });
}
var contrast_checker_default = ContrastChecker;
;// ./node_modules/@wordpress/block-editor/build-module/components/provider/block-refs-provider.js
const BlockRefs = (0,external_wp_element_namespaceObject.createContext)({ refsMap: (0,external_wp_compose_namespaceObject.observableMap)() });
BlockRefs.displayName = "BlockRefsContext";
function BlockRefsProvider({ children }) {
const value = (0,external_wp_element_namespaceObject.useMemo)(() => ({ refsMap: (0,external_wp_compose_namespaceObject.observableMap)() }), []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRefs.Provider, { value, children });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-block-refs.js
function useBlockRefProvider(clientId) {
const { refsMap } = (0,external_wp_element_namespaceObject.useContext)(BlockRefs);
return (0,external_wp_compose_namespaceObject.useRefEffect)(
(element) => {
refsMap.set(clientId, element);
return () => refsMap.delete(clientId);
},
[clientId]
);
}
function assignRef(ref, value) {
if (typeof ref === "function") {
ref(value);
} else if (ref) {
ref.current = value;
}
}
function useBlockElementRef(clientId, ref) {
const { refsMap } = (0,external_wp_element_namespaceObject.useContext)(BlockRefs);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
assignRef(ref, refsMap.get(clientId));
const unsubscribe = refsMap.subscribe(
clientId,
() => assignRef(ref, refsMap.get(clientId))
);
return () => {
unsubscribe();
assignRef(ref, null);
};
}, [refsMap, clientId, ref]);
}
function useBlockElement(clientId) {
const [blockElement, setBlockElement] = (0,external_wp_element_namespaceObject.useState)(null);
useBlockElementRef(clientId, setBlockElement);
return blockElement;
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/contrast-checker.js
function getComputedValue(node, property) {
return node.ownerDocument.defaultView.getComputedStyle(node).getPropertyValue(property);
}
function getBlockElementColors(blockEl) {
if (!blockEl) {
return {};
}
const firstLinkElement = blockEl.querySelector("a");
const linkColor = !!firstLinkElement?.innerText ? getComputedValue(firstLinkElement, "color") : void 0;
const textColor = getComputedValue(blockEl, "color");
let backgroundColorNode = blockEl;
let backgroundColor = getComputedValue(
backgroundColorNode,
"background-color"
);
while (backgroundColor === "rgba(0, 0, 0, 0)" && backgroundColorNode.parentNode && backgroundColorNode.parentNode.nodeType === backgroundColorNode.parentNode.ELEMENT_NODE) {
backgroundColorNode = backgroundColorNode.parentNode;
backgroundColor = getComputedValue(
backgroundColorNode,
"background-color"
);
}
return {
textColor,
backgroundColor,
linkColor
};
}
function contrast_checker_reducer(prevColors, newColors) {
const hasChanged = Object.keys(newColors).some(
(key) => prevColors[key] !== newColors[key]
);
return hasChanged ? newColors : prevColors;
}
function BlockColorContrastChecker({ clientId }) {
const blockEl = useBlockElement(clientId);
const [colors, setColors] = (0,external_wp_element_namespaceObject.useReducer)(contrast_checker_reducer, {});
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (!blockEl) {
return;
}
function updateColors() {
setColors(getBlockElementColors(blockEl));
}
window.requestAnimationFrame(
() => window.requestAnimationFrame(updateColors)
);
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
contrast_checker_default,
{
backgroundColor: colors.backgroundColor,
textColor: colors.textColor,
linkColor: colors.linkColor,
enableAlphaChecker: true
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/color.js
const COLOR_SUPPORT_KEY = "color";
const hasColorSupport = (blockNameOrType) => {
const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockNameOrType, COLOR_SUPPORT_KEY);
return colorSupport && (colorSupport.link === true || colorSupport.gradient === true || colorSupport.background !== false || colorSupport.text !== false);
};
const hasLinkColorSupport = (blockType) => {
if (external_wp_element_namespaceObject.Platform.OS !== "web") {
return false;
}
const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY);
return colorSupport !== null && typeof colorSupport === "object" && !!colorSupport.link;
};
const hasGradientSupport = (blockNameOrType) => {
const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockNameOrType, COLOR_SUPPORT_KEY);
return colorSupport !== null && typeof colorSupport === "object" && !!colorSupport.gradients;
};
const hasBackgroundColorSupport = (blockType) => {
const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY);
return colorSupport && colorSupport.background !== false;
};
const hasTextColorSupport = (blockType) => {
const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY);
return colorSupport && colorSupport.text !== false;
};
function color_addAttributes(settings) {
if (!hasColorSupport(settings)) {
return settings;
}
if (!settings.attributes.backgroundColor) {
Object.assign(settings.attributes, {
backgroundColor: {
type: "string"
}
});
}
if (!settings.attributes.textColor) {
Object.assign(settings.attributes, {
textColor: {
type: "string"
}
});
}
if (hasGradientSupport(settings) && !settings.attributes.gradient) {
Object.assign(settings.attributes, {
gradient: {
type: "string"
}
});
}
return settings;
}
function color_addSaveProps(props, blockNameOrType, attributes) {
if (!hasColorSupport(blockNameOrType) || shouldSkipSerialization(blockNameOrType, COLOR_SUPPORT_KEY)) {
return props;
}
const hasGradient = hasGradientSupport(blockNameOrType);
const { backgroundColor, textColor, gradient, style } = attributes;
const shouldSerialize = (feature) => !shouldSkipSerialization(
blockNameOrType,
COLOR_SUPPORT_KEY,
feature
);
const textClass = shouldSerialize("text") ? getColorClassName("color", textColor) : void 0;
const gradientClass = shouldSerialize("gradients") ? __experimentalGetGradientClass(gradient) : void 0;
const backgroundClass = shouldSerialize("background") ? getColorClassName("background-color", backgroundColor) : void 0;
const serializeHasBackground = shouldSerialize("background") || shouldSerialize("gradients");
const hasBackground = backgroundColor || style?.color?.background || hasGradient && (gradient || style?.color?.gradient);
const newClassName = dist_clsx(props.className, textClass, gradientClass, {
// Don't apply the background class if there's a custom gradient.
[backgroundClass]: (!hasGradient || !style?.color?.gradient) && !!backgroundClass,
"has-text-color": shouldSerialize("text") && (textColor || style?.color?.text),
"has-background": serializeHasBackground && hasBackground,
"has-link-color": shouldSerialize("link") && style?.elements?.link?.color
});
props.className = newClassName ? newClassName : void 0;
return props;
}
function color_styleToAttributes(style) {
const textColorValue = style?.color?.text;
const textColorSlug = textColorValue?.startsWith("var:preset|color|") ? textColorValue.substring("var:preset|color|".length) : void 0;
const backgroundColorValue = style?.color?.background;
const backgroundColorSlug = backgroundColorValue?.startsWith(
"var:preset|color|"
) ? backgroundColorValue.substring("var:preset|color|".length) : void 0;
const gradientValue = style?.color?.gradient;
const gradientSlug = gradientValue?.startsWith("var:preset|gradient|") ? gradientValue.substring("var:preset|gradient|".length) : void 0;
const updatedStyle = { ...style };
updatedStyle.color = {
...updatedStyle.color,
text: textColorSlug ? void 0 : textColorValue,
background: backgroundColorSlug ? void 0 : backgroundColorValue,
gradient: gradientSlug ? void 0 : gradientValue
};
return {
style: utils_cleanEmptyObject(updatedStyle),
textColor: textColorSlug,
backgroundColor: backgroundColorSlug,
gradient: gradientSlug
};
}
function color_attributesToStyle(attributes) {
return {
...attributes.style,
color: {
...attributes.style?.color,
text: attributes.textColor ? "var:preset|color|" + attributes.textColor : attributes.style?.color?.text,
background: attributes.backgroundColor ? "var:preset|color|" + attributes.backgroundColor : attributes.style?.color?.background,
gradient: attributes.gradient ? "var:preset|gradient|" + attributes.gradient : attributes.style?.color?.gradient
}
};
}
function ColorInspectorControl({ children, resetAllFilter }) {
const attributesResetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(
(attributes) => {
const existingStyle = color_attributesToStyle(attributes);
const updatedStyle = resetAllFilter(existingStyle);
return {
...attributes,
...color_styleToAttributes(updatedStyle)
};
},
[resetAllFilter]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inspector_controls_default,
{
group: "color",
resetAllFilter: attributesResetAllFilter,
children
}
);
}
function ColorEdit({ clientId, name, setAttributes, settings }) {
const isEnabled = useHasColorPanel(settings);
function selector(select) {
const { style: style2, textColor: textColor2, backgroundColor: backgroundColor2, gradient: gradient2 } = select(store).getBlockAttributes(clientId) || {};
return { style: style2, textColor: textColor2, backgroundColor: backgroundColor2, gradient: gradient2 };
}
const { style, textColor, backgroundColor, gradient } = (0,external_wp_data_namespaceObject.useSelect)(
selector,
[clientId]
);
const value = (0,external_wp_element_namespaceObject.useMemo)(() => {
return color_attributesToStyle({
style,
textColor,
backgroundColor,
gradient
});
}, [style, textColor, backgroundColor, gradient]);
const onChange = (newStyle) => {
setAttributes(color_styleToAttributes(newStyle));
};
if (!isEnabled) {
return null;
}
const defaultControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [
COLOR_SUPPORT_KEY,
"__experimentalDefaultControls"
]);
const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === "web" && !value?.color?.gradient && (settings?.color?.text || settings?.color?.link) && // Contrast checking is enabled by default.
// Deactivating it requires `enableContrastChecker` to have
// an explicit value of `false`.
false !== (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [
COLOR_SUPPORT_KEY,
"enableContrastChecker"
]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ColorPanel,
{
as: ColorInspectorControl,
panelId: clientId,
settings,
value,
onChange,
defaultControls,
enableContrastChecker: false !== (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [
COLOR_SUPPORT_KEY,
"enableContrastChecker"
]),
children: enableContrastChecking && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockColorContrastChecker, { clientId })
}
);
}
function color_useBlockProps({
name,
backgroundColor,
textColor,
gradient,
style
}) {
const [userPalette, themePalette, defaultPalette] = use_settings_useSettings(
"color.palette.custom",
"color.palette.theme",
"color.palette.default"
);
const colors = (0,external_wp_element_namespaceObject.useMemo)(
() => [
...userPalette || [],
...themePalette || [],
...defaultPalette || []
],
[userPalette, themePalette, defaultPalette]
);
if (!hasColorSupport(name) || shouldSkipSerialization(name, COLOR_SUPPORT_KEY)) {
return {};
}
const extraStyles = {};
if (textColor && !shouldSkipSerialization(name, COLOR_SUPPORT_KEY, "text")) {
extraStyles.color = getColorObjectByAttributeValues(
colors,
textColor
)?.color;
}
if (backgroundColor && !shouldSkipSerialization(name, COLOR_SUPPORT_KEY, "background")) {
extraStyles.backgroundColor = getColorObjectByAttributeValues(
colors,
backgroundColor
)?.color;
}
const saveProps = color_addSaveProps({ style: extraStyles }, name, {
textColor,
backgroundColor,
gradient,
style
});
const hasBackgroundValue = backgroundColor || style?.color?.background || gradient || style?.color?.gradient;
return {
...saveProps,
className: dist_clsx(
saveProps.className,
// Add background image classes in the editor, if not already handled by background color values.
!hasBackgroundValue && getBackgroundImageClasses(style)
)
};
}
var color_default = {
useBlockProps: color_useBlockProps,
addSaveProps: color_addSaveProps,
attributeKeys: ["backgroundColor", "textColor", "gradient", "style"],
hasSupport: hasColorSupport
};
const MIGRATION_PATHS = {
linkColor: [["style", "elements", "link", "color", "text"]],
textColor: [["textColor"], ["style", "color", "text"]],
backgroundColor: [
["backgroundColor"],
["style", "color", "background"]
],
gradient: [["gradient"], ["style", "color", "gradient"]]
};
function color_addTransforms(result, source, index, results) {
const destinationBlockType = result.name;
const activeSupports = {
linkColor: hasLinkColorSupport(destinationBlockType),
textColor: hasTextColorSupport(destinationBlockType),
backgroundColor: hasBackgroundColorSupport(destinationBlockType),
gradient: hasGradientSupport(destinationBlockType)
};
return transformStyles(
activeSupports,
MIGRATION_PATHS,
result,
source,
index,
results
);
}
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.registerBlockType",
"core/color/addAttribute",
color_addAttributes
);
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.switchToBlockType.transformedBlock",
"core/color/addTransforms",
color_addTransforms
);
;// ./node_modules/@wordpress/block-editor/build-module/components/font-family/index.js
function FontFamilyControl({
/** Start opting into the larger default height that will become the default size in a future version. */
__next40pxDefaultSize = false,
/** Start opting into the new margin-free styles that will become the default in a future version. */
__nextHasNoMarginBottom = false,
value = "",
onChange,
fontFamilies,
className,
...props
}) {
const [blockLevelFontFamilies] = use_settings_useSettings("typography.fontFamilies");
if (!fontFamilies) {
fontFamilies = blockLevelFontFamilies;
}
if (!fontFamilies || fontFamilies.length === 0) {
return null;
}
const options = [
{
key: "",
name: (0,external_wp_i18n_namespaceObject.__)("Default")
},
...fontFamilies.map(({ fontFamily, name }) => ({
key: fontFamily,
name: name || fontFamily,
style: { fontFamily }
}))
];
if (!__nextHasNoMarginBottom) {
external_wp_deprecated_default()(
"Bottom margin styles for wp.blockEditor.FontFamilyControl",
{
since: "6.7",
version: "7.0",
hint: "Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"
}
);
}
if (!__next40pxDefaultSize && (props.size === void 0 || props.size === "default")) {
external_wp_deprecated_default()(
`36px default size for wp.blockEditor.__experimentalFontFamilyControl`,
{
since: "6.8",
version: "7.1",
hint: "Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."
}
);
}
const selectedValue = options.find((option) => option.key === value) ?? "";
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CustomSelectControl,
{
__next40pxDefaultSize,
__shouldNotWarnDeprecated36pxSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Font"),
value: selectedValue,
onChange: ({ selectedItem }) => onChange(selectedItem.key),
options,
className: dist_clsx("block-editor-font-family-control", className, {
"is-next-has-no-margin-bottom": __nextHasNoMarginBottom
}),
...props
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/font-appearance-control/index.js
const getFontAppearanceLabel = (hasFontStyles, hasFontWeights) => {
if (!hasFontStyles) {
return (0,external_wp_i18n_namespaceObject.__)("Font weight");
}
if (!hasFontWeights) {
return (0,external_wp_i18n_namespaceObject.__)("Font style");
}
return (0,external_wp_i18n_namespaceObject.__)("Appearance");
};
function FontAppearanceControl(props) {
const {
/** Start opting into the larger default height that will become the default size in a future version. */
__next40pxDefaultSize = false,
onChange,
hasFontStyles = true,
hasFontWeights = true,
fontFamilyFaces,
value: { fontStyle, fontWeight },
...otherProps
} = props;
const hasStylesOrWeights = hasFontStyles || hasFontWeights;
const label = getFontAppearanceLabel(hasFontStyles, hasFontWeights);
const defaultOption = {
key: "default",
name: (0,external_wp_i18n_namespaceObject.__)("Default"),
style: { fontStyle: void 0, fontWeight: void 0 }
};
const { fontStyles, fontWeights, combinedStyleAndWeightOptions } = getFontStylesAndWeights(fontFamilyFaces);
const combineOptions = () => {
const combinedOptions = [defaultOption];
if (combinedStyleAndWeightOptions) {
combinedOptions.push(...combinedStyleAndWeightOptions);
}
return combinedOptions;
};
const styleOptions = () => {
const combinedOptions = [defaultOption];
fontStyles.forEach(({ name, value }) => {
combinedOptions.push({
key: value,
name,
style: { fontStyle: value, fontWeight: void 0 }
});
});
return combinedOptions;
};
const weightOptions = () => {
const combinedOptions = [defaultOption];
fontWeights.forEach(({ name, value }) => {
combinedOptions.push({
key: value,
name,
style: { fontStyle: void 0, fontWeight: value }
});
});
return combinedOptions;
};
const selectOptions = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (hasFontStyles && hasFontWeights) {
return combineOptions();
}
return hasFontStyles ? styleOptions() : weightOptions();
}, [
props.options,
fontStyles,
fontWeights,
combinedStyleAndWeightOptions
]);
const currentSelection = selectOptions.find(
(option) => option.style.fontStyle === fontStyle && option.style.fontWeight === fontWeight
) || selectOptions[0];
const getDescribedBy = () => {
if (!currentSelection) {
return (0,external_wp_i18n_namespaceObject.__)("No selected font appearance");
}
if (!hasFontStyles) {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Currently selected font weight.
(0,external_wp_i18n_namespaceObject.__)("Currently selected font weight: %s"),
currentSelection.name
);
}
if (!hasFontWeights) {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Currently selected font style.
(0,external_wp_i18n_namespaceObject.__)("Currently selected font style: %s"),
currentSelection.name
);
}
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Currently selected font appearance.
(0,external_wp_i18n_namespaceObject.__)("Currently selected font appearance: %s"),
currentSelection.name
);
};
if (!__next40pxDefaultSize && (otherProps.size === void 0 || otherProps.size === "default")) {
external_wp_deprecated_default()(
`36px default size for wp.blockEditor.__experimentalFontAppearanceControl`,
{
since: "6.8",
version: "7.1",
hint: "Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."
}
);
}
return hasStylesOrWeights && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CustomSelectControl,
{
...otherProps,
className: "components-font-appearance-control",
__next40pxDefaultSize,
__shouldNotWarnDeprecated36pxSize: true,
label,
describedBy: getDescribedBy(),
options: selectOptions,
value: currentSelection,
onChange: ({ selectedItem }) => onChange(selectedItem.style)
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/line-height-control/utils.js
const BASE_DEFAULT_VALUE = 1.5;
const STEP = 0.01;
const SPIN_FACTOR = 10;
const RESET_VALUE = "";
function isLineHeightDefined(lineHeight) {
return lineHeight !== void 0 && lineHeight !== RESET_VALUE;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/line-height-control/index.js
const line_height_control_LineHeightControl = ({
/** Start opting into the larger default height that will become the default size in a future version. */
__next40pxDefaultSize = false,
value: lineHeight,
onChange,
__unstableInputWidth = "60px",
...otherProps
}) => {
const isDefined = isLineHeightDefined(lineHeight);
const adjustNextValue = (nextValue, wasTypedOrPasted) => {
if (isDefined) {
return nextValue;
}
const spin = STEP * SPIN_FACTOR;
switch (`${nextValue}`) {
case `${spin}`:
return BASE_DEFAULT_VALUE + spin;
case "0": {
if (wasTypedOrPasted) {
return nextValue;
}
return BASE_DEFAULT_VALUE - spin;
}
case "":
return BASE_DEFAULT_VALUE;
default:
return nextValue;
}
};
const stateReducer = (state, action) => {
const wasTypedOrPasted = ["insertText", "insertFromPaste"].includes(
action.payload.event.nativeEvent?.inputType
);
const value2 = adjustNextValue(state.value, wasTypedOrPasted);
return { ...state, value: value2 };
};
const value = isDefined ? lineHeight : RESET_VALUE;
const handleOnChange = (nextValue, { event }) => {
if (nextValue === "") {
onChange();
return;
}
if (event.type === "click") {
onChange(adjustNextValue(`${nextValue}`, false));
return;
}
onChange(`${nextValue}`);
};
if (!__next40pxDefaultSize && (otherProps.size === void 0 || otherProps.size === "default")) {
external_wp_deprecated_default()(`36px default size for wp.blockEditor.LineHeightControl`, {
since: "6.8",
version: "7.1",
hint: "Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-line-height-control", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalNumberControl,
{
...otherProps,
__shouldNotWarnDeprecated36pxSize: true,
__next40pxDefaultSize,
__unstableInputWidth,
__unstableStateReducer: stateReducer,
onChange: handleOnChange,
label: (0,external_wp_i18n_namespaceObject.__)("Line height"),
placeholder: BASE_DEFAULT_VALUE,
step: STEP,
spinFactor: SPIN_FACTOR,
value,
min: 0,
spinControls: "custom"
}
) });
};
var line_height_control_default = line_height_control_LineHeightControl;
;// ./node_modules/@wordpress/block-editor/build-module/components/letter-spacing-control/index.js
function LetterSpacingControl({
__next40pxDefaultSize = false,
value,
onChange,
__unstableInputWidth = "60px",
...otherProps
}) {
const [availableUnits] = use_settings_useSettings("spacing.units");
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits: availableUnits || ["px", "em", "rem"],
defaultValues: { px: 2, em: 0.2, rem: 0.2 }
});
if (!__next40pxDefaultSize && (otherProps.size === void 0 || otherProps.size === "default")) {
external_wp_deprecated_default()(
`36px default size for wp.blockEditor.__experimentalLetterSpacingControl`,
{
since: "6.8",
version: "7.1",
hint: "Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
__next40pxDefaultSize,
__shouldNotWarnDeprecated36pxSize: true,
...otherProps,
label: (0,external_wp_i18n_namespaceObject.__)("Letter spacing"),
value,
__unstableInputWidth,
units,
onChange
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/align-left.js
var align_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/align-center.js
var align_center_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/align-right.js
var align_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/align-justify.js
var align_justify_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 12.8h16v-1.5H4v1.5zm0 7h12.4v-1.5H4v1.5zM4 4.3v1.5h16V4.3H4z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/text-alignment-control/index.js
const TEXT_ALIGNMENT_OPTIONS = [
{
label: (0,external_wp_i18n_namespaceObject.__)("Align text left"),
value: "left",
icon: align_left_default
},
{
label: (0,external_wp_i18n_namespaceObject.__)("Align text center"),
value: "center",
icon: align_center_default
},
{
label: (0,external_wp_i18n_namespaceObject.__)("Align text right"),
value: "right",
icon: align_right_default
},
{
label: (0,external_wp_i18n_namespaceObject.__)("Justify text"),
value: "justify",
icon: align_justify_default
}
];
const DEFAULT_OPTIONS = ["left", "center", "right"];
function TextAlignmentControl({
className,
value,
onChange,
options = DEFAULT_OPTIONS
}) {
const validOptions = (0,external_wp_element_namespaceObject.useMemo)(
() => TEXT_ALIGNMENT_OPTIONS.filter(
(option) => options.includes(option.value)
),
[options]
);
if (!validOptions.length) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
isDeselectable: true,
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Text alignment"),
className: dist_clsx(
"block-editor-text-alignment-control",
className
),
value,
onChange: (newValue) => {
onChange(newValue === value ? void 0 : newValue);
},
children: validOptions.map((option) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon,
{
value: option.value,
icon: option.icon,
label: option.label
},
option.value
);
})
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/format-uppercase.js
var format_uppercase_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/format-lowercase.js
var format_lowercase_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/format-capitalize.js
var format_capitalize_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/text-transform-control/index.js
const TEXT_TRANSFORMS = [
{
label: (0,external_wp_i18n_namespaceObject.__)("None"),
value: "none",
icon: reset_default
},
{
label: (0,external_wp_i18n_namespaceObject.__)("Uppercase"),
value: "uppercase",
icon: format_uppercase_default
},
{
label: (0,external_wp_i18n_namespaceObject.__)("Lowercase"),
value: "lowercase",
icon: format_lowercase_default
},
{
label: (0,external_wp_i18n_namespaceObject.__)("Capitalize"),
value: "capitalize",
icon: format_capitalize_default
}
];
function TextTransformControl({ className, value, onChange }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
isDeselectable: true,
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Letter case"),
className: dist_clsx(
"block-editor-text-transform-control",
className
),
value,
onChange: (newValue) => {
onChange(newValue === value ? void 0 : newValue);
},
children: TEXT_TRANSFORMS.map((option) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon,
{
value: option.value,
icon: option.icon,
label: option.label
},
option.value
);
})
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/format-underline.js
var format_underline_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/format-strikethrough.js
var format_strikethrough_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/text-decoration-control/index.js
const TEXT_DECORATIONS = [
{
label: (0,external_wp_i18n_namespaceObject.__)("None"),
value: "none",
icon: reset_default
},
{
label: (0,external_wp_i18n_namespaceObject.__)("Underline"),
value: "underline",
icon: format_underline_default
},
{
label: (0,external_wp_i18n_namespaceObject.__)("Strikethrough"),
value: "line-through",
icon: format_strikethrough_default
}
];
function TextDecorationControl({
value,
onChange,
className
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
isDeselectable: true,
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Decoration"),
className: dist_clsx(
"block-editor-text-decoration-control",
className
),
value,
onChange: (newValue) => {
onChange(newValue === value ? void 0 : newValue);
},
children: TEXT_DECORATIONS.map((option) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon,
{
value: option.value,
icon: option.icon,
label: option.label
},
option.value
);
})
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/text-horizontal.js
var text_horizontal_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M8.2 14.4h3.9L13 17h1.7L11 6.5H9.3L5.6 17h1.7l.9-2.6zm2-5.5 1.4 4H8.8l1.4-4zm7.4 7.5-1.3.8.8 1.4H5.5V20h14.3l-2.2-3.6z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/text-vertical.js
var text_vertical_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7 5.6v1.7l2.6.9v3.9L7 13v1.7L17.5 11V9.3L7 5.6zm4.2 6V8.8l4 1.4-4 1.4zm-5.7 5.6V5.5H4v14.3l3.6-2.2-.8-1.3-1.3.9z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/writing-mode-control/index.js
const WRITING_MODES = [
{
label: (0,external_wp_i18n_namespaceObject.__)("Horizontal"),
value: "horizontal-tb",
icon: text_horizontal_default
},
{
label: (0,external_wp_i18n_namespaceObject.__)("Vertical"),
value: (0,external_wp_i18n_namespaceObject.isRTL)() ? "vertical-lr" : "vertical-rl",
icon: text_vertical_default
}
];
function WritingModeControl({ className, value, onChange }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
isDeselectable: true,
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Orientation"),
className: dist_clsx("block-editor-writing-mode-control", className),
value,
onChange: (newValue) => {
onChange(newValue === value ? void 0 : newValue);
},
children: WRITING_MODES.map((option) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon,
{
value: option.value,
icon: option.icon,
label: option.label
},
option.value
);
})
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/typography-panel.js
const MIN_TEXT_COLUMNS = 1;
const MAX_TEXT_COLUMNS = 6;
function useHasTypographyPanel(settings) {
const hasFontFamily = useHasFontFamilyControl(settings);
const hasLineHeight = useHasLineHeightControl(settings);
const hasFontAppearance = useHasAppearanceControl(settings);
const hasLetterSpacing = useHasLetterSpacingControl(settings);
const hasTextAlign = useHasTextAlignmentControl(settings);
const hasTextTransform = useHasTextTransformControl(settings);
const hasTextDecoration = useHasTextDecorationControl(settings);
const hasWritingMode = useHasWritingModeControl(settings);
const hasTextColumns = useHasTextColumnsControl(settings);
const hasFontSize = useHasFontSizeControl(settings);
return hasFontFamily || hasLineHeight || hasFontAppearance || hasLetterSpacing || hasTextAlign || hasTextTransform || hasFontSize || hasTextDecoration || hasWritingMode || hasTextColumns;
}
function useHasFontSizeControl(settings) {
return settings?.typography?.defaultFontSizes !== false && settings?.typography?.fontSizes?.default?.length || settings?.typography?.fontSizes?.theme?.length || settings?.typography?.fontSizes?.custom?.length || settings?.typography?.customFontSize;
}
function useHasFontFamilyControl(settings) {
return ["default", "theme", "custom"].some(
(key) => settings?.typography?.fontFamilies?.[key]?.length
);
}
function useHasLineHeightControl(settings) {
return settings?.typography?.lineHeight;
}
function useHasAppearanceControl(settings) {
return settings?.typography?.fontStyle || settings?.typography?.fontWeight;
}
function useAppearanceControlLabel(settings) {
if (!settings?.typography?.fontStyle) {
return (0,external_wp_i18n_namespaceObject.__)("Font weight");
}
if (!settings?.typography?.fontWeight) {
return (0,external_wp_i18n_namespaceObject.__)("Font style");
}
return (0,external_wp_i18n_namespaceObject.__)("Appearance");
}
function useHasLetterSpacingControl(settings) {
return settings?.typography?.letterSpacing;
}
function useHasTextTransformControl(settings) {
return settings?.typography?.textTransform;
}
function useHasTextAlignmentControl(settings) {
return settings?.typography?.textAlign;
}
function useHasTextDecorationControl(settings) {
return settings?.typography?.textDecoration;
}
function useHasWritingModeControl(settings) {
return settings?.typography?.writingMode;
}
function useHasTextColumnsControl(settings) {
return settings?.typography?.textColumns;
}
function getMergedFontSizes(settings) {
const fontSizes = settings?.typography?.fontSizes;
const defaultFontSizesEnabled = !!settings?.typography?.defaultFontSizes;
return [
...fontSizes?.custom ?? [],
...fontSizes?.theme ?? [],
...defaultFontSizesEnabled ? fontSizes?.default ?? [] : []
];
}
function TypographyToolsPanel({
resetAllFilter,
onChange,
value,
panelId,
children
}) {
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const resetAll = () => {
const updatedValue = resetAllFilter(value);
onChange(updatedValue);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Typography"),
resetAll,
panelId,
dropdownMenuProps,
children
}
);
}
const typography_panel_DEFAULT_CONTROLS = {
fontFamily: true,
fontSize: true,
fontAppearance: true,
lineHeight: true,
letterSpacing: true,
textAlign: true,
textTransform: true,
textDecoration: true,
writingMode: true,
textColumns: true
};
function TypographyPanel({
as: Wrapper = TypographyToolsPanel,
value,
onChange,
inheritedValue = value,
settings,
panelId,
defaultControls = typography_panel_DEFAULT_CONTROLS,
fitText = false
}) {
const decodeValue = (rawValue) => getValueFromVariable({ settings }, "", rawValue);
const hasFontFamilyEnabled = useHasFontFamilyControl(settings);
const fontFamily = decodeValue(inheritedValue?.typography?.fontFamily);
const { fontFamilies, fontFamilyFaces } = (0,external_wp_element_namespaceObject.useMemo)(() => {
return getMergedFontFamiliesAndFontFamilyFaces(settings, fontFamily);
}, [settings, fontFamily]);
const setFontFamily = (newValue) => {
const slug = fontFamilies?.find(
({ fontFamily: f }) => f === newValue
)?.slug;
onChange(
setImmutably(
value,
["typography", "fontFamily"],
slug ? `var:preset|font-family|${slug}` : newValue || void 0
)
);
};
const hasFontFamily = () => !!value?.typography?.fontFamily;
const resetFontFamily = () => setFontFamily(void 0);
const hasFontSizeEnabled = useHasFontSizeControl(settings);
const disableCustomFontSizes = !settings?.typography?.customFontSize;
const mergedFontSizes = getMergedFontSizes(settings);
const fontSize = decodeValue(inheritedValue?.typography?.fontSize);
const currentFontSizeSlug = (() => {
const rawValue = inheritedValue?.typography?.fontSize;
if (!rawValue || typeof rawValue !== "string") {
return void 0;
}
if (rawValue.startsWith("var:preset|font-size|")) {
return rawValue.replace("var:preset|font-size|", "");
}
const cssVarMatch = rawValue.match(
/^var\(--wp--preset--font-size--([^)]+)\)$/
);
if (cssVarMatch) {
return cssVarMatch[1];
}
return void 0;
})();
const setFontSize = (newValue, metadata) => {
const actualValue = !!metadata?.slug ? `var:preset|font-size|${metadata?.slug}` : newValue;
onChange(
setImmutably(
value,
["typography", "fontSize"],
actualValue || void 0
)
);
};
const hasFontSize = () => !!value?.typography?.fontSize;
const resetFontSize = () => setFontSize(void 0);
const hasAppearanceControl = useHasAppearanceControl(settings);
const appearanceControlLabel = useAppearanceControlLabel(settings);
const hasFontStyles = settings?.typography?.fontStyle;
const hasFontWeights = settings?.typography?.fontWeight;
const fontStyle = decodeValue(inheritedValue?.typography?.fontStyle);
const fontWeight = decodeValue(inheritedValue?.typography?.fontWeight);
const { nearestFontStyle, nearestFontWeight } = findNearestStyleAndWeight(
fontFamilyFaces,
fontStyle,
fontWeight
);
const setFontAppearance = (0,external_wp_element_namespaceObject.useCallback)(
({ fontStyle: newFontStyle, fontWeight: newFontWeight }) => {
if (newFontStyle !== fontStyle || newFontWeight !== fontWeight) {
onChange({
...value,
typography: {
...value?.typography,
fontStyle: newFontStyle || void 0,
fontWeight: newFontWeight || void 0
}
});
}
},
[fontStyle, fontWeight, onChange, value]
);
const hasFontAppearance = () => !!value?.typography?.fontStyle || !!value?.typography?.fontWeight;
const resetFontAppearance = (0,external_wp_element_namespaceObject.useCallback)(() => {
setFontAppearance({});
}, [setFontAppearance]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (nearestFontStyle && nearestFontWeight) {
setFontAppearance({
fontStyle: nearestFontStyle,
fontWeight: nearestFontWeight
});
} else {
resetFontAppearance();
}
}, [
nearestFontStyle,
nearestFontWeight,
resetFontAppearance,
setFontAppearance
]);
const hasLineHeightEnabled = useHasLineHeightControl(settings);
const lineHeight = decodeValue(inheritedValue?.typography?.lineHeight);
const setLineHeight = (newValue) => {
onChange(
setImmutably(
value,
["typography", "lineHeight"],
newValue || void 0
)
);
};
const hasLineHeight = () => value?.typography?.lineHeight !== void 0;
const resetLineHeight = () => setLineHeight(void 0);
const hasLetterSpacingControl = useHasLetterSpacingControl(settings);
const letterSpacing = decodeValue(
inheritedValue?.typography?.letterSpacing
);
const setLetterSpacing = (newValue) => {
onChange(
setImmutably(
value,
["typography", "letterSpacing"],
newValue || void 0
)
);
};
const hasLetterSpacing = () => !!value?.typography?.letterSpacing;
const resetLetterSpacing = () => setLetterSpacing(void 0);
const hasTextColumnsControl = useHasTextColumnsControl(settings);
const textColumns = decodeValue(inheritedValue?.typography?.textColumns);
const setTextColumns = (newValue) => {
onChange(
setImmutably(
value,
["typography", "textColumns"],
newValue || void 0
)
);
};
const hasTextColumns = () => !!value?.typography?.textColumns;
const resetTextColumns = () => setTextColumns(void 0);
const hasTextTransformControl = useHasTextTransformControl(settings);
const textTransform = decodeValue(
inheritedValue?.typography?.textTransform
);
const setTextTransform = (newValue) => {
onChange(
setImmutably(
value,
["typography", "textTransform"],
newValue || void 0
)
);
};
const hasTextTransform = () => !!value?.typography?.textTransform;
const resetTextTransform = () => setTextTransform(void 0);
const hasTextDecorationControl = useHasTextDecorationControl(settings);
const textDecoration = decodeValue(
inheritedValue?.typography?.textDecoration
);
const setTextDecoration = (newValue) => {
onChange(
setImmutably(
value,
["typography", "textDecoration"],
newValue || void 0
)
);
};
const hasTextDecoration = () => !!value?.typography?.textDecoration;
const resetTextDecoration = () => setTextDecoration(void 0);
const hasWritingModeControl = useHasWritingModeControl(settings);
const writingMode = decodeValue(inheritedValue?.typography?.writingMode);
const setWritingMode = (newValue) => {
onChange(
setImmutably(
value,
["typography", "writingMode"],
newValue || void 0
)
);
};
const hasWritingMode = () => !!value?.typography?.writingMode;
const resetWritingMode = () => setWritingMode(void 0);
const hasTextAlignmentControl = useHasTextAlignmentControl(settings);
const textAlign = decodeValue(inheritedValue?.typography?.textAlign);
const setTextAlign = (newValue) => {
onChange(
setImmutably(
value,
["typography", "textAlign"],
newValue || void 0
)
);
};
const hasTextAlign = () => !!value?.typography?.textAlign;
const resetTextAlign = () => setTextAlign(void 0);
const resetAllFilter = (0,external_wp_element_namespaceObject.useCallback)((previousValue) => {
return {
...previousValue,
typography: {}
};
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
Wrapper,
{
resetAllFilter,
value,
onChange,
panelId,
children: [
hasFontFamilyEnabled && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Font"),
hasValue: hasFontFamily,
onDeselect: resetFontFamily,
isShownByDefault: defaultControls.fontFamily,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FontFamilyControl,
{
fontFamilies,
value: fontFamily,
onChange: setFontFamily,
size: "__unstable-large",
__nextHasNoMarginBottom: true
}
)
}
),
hasFontSizeEnabled && !fitText && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Size"),
hasValue: hasFontSize,
onDeselect: resetFontSize,
isShownByDefault: defaultControls.fontSize,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.FontSizePicker,
{
value: currentFontSizeSlug || fontSize,
valueMode: currentFontSizeSlug ? "slug" : "literal",
onChange: setFontSize,
fontSizes: mergedFontSizes,
disableCustomFontSizes,
withReset: false,
withSlider: true,
size: "__unstable-large"
}
)
}
),
hasAppearanceControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
className: "single-column",
label: appearanceControlLabel,
hasValue: hasFontAppearance,
onDeselect: resetFontAppearance,
isShownByDefault: defaultControls.fontAppearance,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FontAppearanceControl,
{
value: {
fontStyle,
fontWeight
},
onChange: setFontAppearance,
hasFontStyles,
hasFontWeights,
fontFamilyFaces,
size: "__unstable-large"
}
)
}
),
hasLineHeightEnabled && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
className: "single-column",
label: (0,external_wp_i18n_namespaceObject.__)("Line height"),
hasValue: hasLineHeight,
onDeselect: resetLineHeight,
isShownByDefault: defaultControls.lineHeight,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
line_height_control_default,
{
__unstableInputWidth: "auto",
value: lineHeight,
onChange: setLineHeight,
size: "__unstable-large"
}
)
}
),
hasLetterSpacingControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
className: "single-column",
label: (0,external_wp_i18n_namespaceObject.__)("Letter spacing"),
hasValue: hasLetterSpacing,
onDeselect: resetLetterSpacing,
isShownByDefault: defaultControls.letterSpacing,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
LetterSpacingControl,
{
value: letterSpacing,
onChange: setLetterSpacing,
size: "__unstable-large",
__unstableInputWidth: "auto"
}
)
}
),
hasTextColumnsControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
className: "single-column",
label: (0,external_wp_i18n_namespaceObject.__)("Columns"),
hasValue: hasTextColumns,
onDeselect: resetTextColumns,
isShownByDefault: defaultControls.textColumns,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalNumberControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Columns"),
max: MAX_TEXT_COLUMNS,
min: MIN_TEXT_COLUMNS,
onChange: setTextColumns,
size: "__unstable-large",
spinControls: "custom",
value: textColumns,
initialPosition: 1
}
)
}
),
hasTextDecorationControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
className: "single-column",
label: (0,external_wp_i18n_namespaceObject.__)("Decoration"),
hasValue: hasTextDecoration,
onDeselect: resetTextDecoration,
isShownByDefault: defaultControls.textDecoration,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
TextDecorationControl,
{
value: textDecoration,
onChange: setTextDecoration,
size: "__unstable-large",
__unstableInputWidth: "auto"
}
)
}
),
hasWritingModeControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
className: "single-column",
label: (0,external_wp_i18n_namespaceObject.__)("Orientation"),
hasValue: hasWritingMode,
onDeselect: resetWritingMode,
isShownByDefault: defaultControls.writingMode,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
WritingModeControl,
{
value: writingMode,
onChange: setWritingMode,
size: "__unstable-large",
__nextHasNoMarginBottom: true
}
)
}
),
hasTextTransformControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Letter case"),
hasValue: hasTextTransform,
onDeselect: resetTextTransform,
isShownByDefault: defaultControls.textTransform,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
TextTransformControl,
{
value: textTransform,
onChange: setTextTransform,
showNone: true,
isBlock: true,
size: "__unstable-large",
__nextHasNoMarginBottom: true
}
)
}
),
hasTextAlignmentControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Text alignment"),
hasValue: hasTextAlign,
onDeselect: resetTextAlign,
isShownByDefault: defaultControls.textAlign,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
TextAlignmentControl,
{
value: textAlign,
onChange: setTextAlign,
size: "__unstable-large",
__nextHasNoMarginBottom: true
}
)
}
)
]
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/line-height.js
const LINE_HEIGHT_SUPPORT_KEY = "typography.lineHeight";
function LineHeightEdit(props) {
const {
attributes: { style },
setAttributes
} = props;
const onChange = (newLineHeightValue) => {
const newStyle = {
...style,
typography: {
...style?.typography,
lineHeight: newLineHeightValue
}
};
setAttributes({ style: cleanEmptyObject(newStyle) });
};
return /* @__PURE__ */ jsx(
LineHeightControl,
{
__unstableInputWidth: "100%",
value: style?.typography?.lineHeight,
onChange,
size: "__unstable-large"
}
);
}
function useIsLineHeightDisabled({ name: blockName } = {}) {
const [isEnabled] = useSettings("typography.lineHeight");
return !isEnabled || !hasBlockSupport(blockName, LINE_HEIGHT_SUPPORT_KEY);
}
;// external ["wp","tokenList"]
const external_wp_tokenList_namespaceObject = window["wp"]["tokenList"];
var external_wp_tokenList_default = /*#__PURE__*/__webpack_require__.n(external_wp_tokenList_namespaceObject);
;// ./node_modules/@wordpress/block-editor/build-module/hooks/font-family.js
const FONT_FAMILY_SUPPORT_KEY = "typography.__experimentalFontFamily";
const { kebabCase: font_family_kebabCase } = unlock(external_wp_components_namespaceObject.privateApis);
function font_family_addAttributes(settings) {
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, FONT_FAMILY_SUPPORT_KEY)) {
return settings;
}
if (!settings.attributes.fontFamily) {
Object.assign(settings.attributes, {
fontFamily: {
type: "string"
}
});
}
return settings;
}
function font_family_addSaveProps(props, blockType, attributes) {
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, FONT_FAMILY_SUPPORT_KEY)) {
return props;
}
if (shouldSkipSerialization(
blockType,
TYPOGRAPHY_SUPPORT_KEY,
"fontFamily"
)) {
return props;
}
if (!attributes?.fontFamily) {
return props;
}
const classes = new (external_wp_tokenList_default())(props.className);
classes.add(`has-${font_family_kebabCase(attributes?.fontFamily)}-font-family`);
const newClassName = classes.value;
props.className = newClassName ? newClassName : void 0;
return props;
}
function font_family_useBlockProps({ name, fontFamily }) {
return font_family_addSaveProps({}, name, { fontFamily });
}
var font_family_default = {
useBlockProps: font_family_useBlockProps,
addSaveProps: font_family_addSaveProps,
attributeKeys: ["fontFamily"],
hasSupport(name) {
return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, FONT_FAMILY_SUPPORT_KEY);
}
};
function resetFontFamily({ setAttributes }) {
setAttributes({ fontFamily: void 0 });
}
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.registerBlockType",
"core/fontFamily/addAttribute",
font_family_addAttributes
);
;// ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/utils.js
const { kebabCase: utils_kebabCase } = unlock(external_wp_components_namespaceObject.privateApis);
const utils_getFontSize = (fontSizes, fontSizeAttribute, customFontSizeAttribute) => {
if (fontSizeAttribute) {
const fontSizeObject = fontSizes?.find(
({ slug }) => slug === fontSizeAttribute
);
if (fontSizeObject) {
return fontSizeObject;
}
}
return {
size: customFontSizeAttribute
};
};
function utils_getFontSizeObjectByValue(fontSizes, value) {
const fontSizeObject = fontSizes?.find(({ size }) => size === value);
if (fontSizeObject) {
return fontSizeObject;
}
return {
size: value
};
}
function getFontSizeClass(fontSizeSlug) {
if (!fontSizeSlug) {
return;
}
return `has-${utils_kebabCase(fontSizeSlug)}-font-size`;
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/font-size.js
const FONT_SIZE_SUPPORT_KEY = "typography.fontSize";
function font_size_addAttributes(settings) {
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, FONT_SIZE_SUPPORT_KEY)) {
return settings;
}
if (!settings.attributes.fontSize) {
Object.assign(settings.attributes, {
fontSize: {
type: "string"
}
});
}
return settings;
}
function font_size_addSaveProps(props, blockNameOrType, attributes) {
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockNameOrType, FONT_SIZE_SUPPORT_KEY)) {
return props;
}
if (shouldSkipSerialization(
blockNameOrType,
TYPOGRAPHY_SUPPORT_KEY,
"fontSize"
)) {
return props;
}
const classes = new (external_wp_tokenList_default())(props.className);
classes.add(getFontSizeClass(attributes.fontSize));
const newClassName = classes.value;
props.className = newClassName ? newClassName : void 0;
return props;
}
function FontSizeEdit(props) {
const {
attributes: { fontSize, style, fitText },
setAttributes
} = props;
const [fontSizes] = useSettings("typography.fontSizes");
if (fitText) {
return null;
}
const onChange = (value, selectedItem) => {
const fontSizeSlug = selectedItem?.slug || getFontSizeObjectByValue(fontSizes, value).slug;
setAttributes({
style: cleanEmptyObject({
...style,
typography: {
...style?.typography,
fontSize: fontSizeSlug ? void 0 : value
}
}),
fontSize: fontSizeSlug
});
};
const fontSizeObject = getFontSize(
fontSizes,
fontSize,
style?.typography?.fontSize
);
const fontSizeValue = fontSizeObject?.size || style?.typography?.fontSize || fontSize;
return /* @__PURE__ */ jsx(
FontSizePicker,
{
onChange,
value: fontSize || fontSizeValue,
valueMode: fontSize ? "slug" : "literal",
withReset: false,
withSlider: true,
size: "__unstable-large"
}
);
}
function useIsFontSizeDisabled({ name: blockName } = {}) {
const [fontSizes] = useSettings("typography.fontSizes");
const hasFontSizes = !!fontSizes?.length;
return !hasBlockSupport(blockName, FONT_SIZE_SUPPORT_KEY) || !hasFontSizes;
}
function font_size_useBlockProps({ name, fontSize, style }) {
const [fontSizes, fluidTypographySettings, layoutSettings] = use_settings_useSettings(
"typography.fontSizes",
"typography.fluid",
"layout"
);
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, FONT_SIZE_SUPPORT_KEY) || shouldSkipSerialization(name, TYPOGRAPHY_SUPPORT_KEY, "fontSize") || !fontSize && !style?.typography?.fontSize) {
return;
}
let props;
if (style?.typography?.fontSize) {
props = {
style: {
fontSize: getTypographyFontSizeValue(
{ size: style.typography.fontSize },
{
typography: {
fluid: fluidTypographySettings
},
layout: layoutSettings
}
)
}
};
}
if (fontSize) {
props = {
style: {
fontSize: utils_getFontSize(
fontSizes,
fontSize,
style?.typography?.fontSize
).size
}
};
}
if (!props) {
return;
}
return font_size_addSaveProps(props, name, { fontSize });
}
var font_size_default = {
useBlockProps: font_size_useBlockProps,
addSaveProps: font_size_addSaveProps,
attributeKeys: ["fontSize", "style", "fitText"],
hasSupport(name) {
return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, FONT_SIZE_SUPPORT_KEY);
}
};
const font_size_MIGRATION_PATHS = {
fontSize: [["fontSize"], ["style", "typography", "fontSize"]]
};
function font_size_addTransforms(result, source, index, results) {
const destinationBlockType = result.name;
const activeSupports = {
fontSize: (0,external_wp_blocks_namespaceObject.hasBlockSupport)(
destinationBlockType,
FONT_SIZE_SUPPORT_KEY
)
};
return transformStyles(
activeSupports,
font_size_MIGRATION_PATHS,
result,
source,
index,
results
);
}
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.registerBlockType",
"core/font/addAttribute",
font_size_addAttributes
);
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.switchToBlockType.transformedBlock",
"core/font-size/addTransforms",
font_size_addTransforms
);
;// ./node_modules/@wordpress/block-editor/build-module/components/alignment-control/ui.js
const DEFAULT_ALIGNMENT_CONTROLS = [
{
icon: align_left_default,
title: (0,external_wp_i18n_namespaceObject.__)("Align text left"),
align: "left"
},
{
icon: align_center_default,
title: (0,external_wp_i18n_namespaceObject.__)("Align text center"),
align: "center"
},
{
icon: align_right_default,
title: (0,external_wp_i18n_namespaceObject.__)("Align text right"),
align: "right"
}
];
const ui_POPOVER_PROPS = {
placement: "bottom-start"
};
function AlignmentUI({
value,
onChange,
alignmentControls = DEFAULT_ALIGNMENT_CONTROLS,
label = (0,external_wp_i18n_namespaceObject.__)("Align text"),
description = (0,external_wp_i18n_namespaceObject.__)("Change text alignment"),
isCollapsed = true,
isToolbar
}) {
function applyOrUnset(align) {
return () => onChange(value === align ? void 0 : align);
}
const activeAlignment = alignmentControls.find(
(control) => control.align === value
);
function setIcon() {
if (activeAlignment) {
return activeAlignment.icon;
}
return (0,external_wp_i18n_namespaceObject.isRTL)() ? align_right_default : align_left_default;
}
const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu;
const extraProps = isToolbar ? { isCollapsed } : {
toggleProps: {
description
},
popoverProps: ui_POPOVER_PROPS
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
UIComponent,
{
icon: setIcon(),
label,
controls: alignmentControls.map((control) => {
const { align } = control;
const isActive = value === align;
return {
...control,
isActive,
role: isCollapsed ? "menuitemradio" : void 0,
onClick: applyOrUnset(align)
};
}),
...extraProps
}
);
}
var alignment_control_ui_ui_default = AlignmentUI;
;// ./node_modules/@wordpress/block-editor/build-module/components/alignment-control/index.js
const AlignmentControl = (props) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(alignment_control_ui_ui_default, { ...props, isToolbar: false });
};
const AlignmentToolbar = (props) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(alignment_control_ui_ui_default, { ...props, isToolbar: true });
};
;// ./node_modules/@wordpress/block-editor/build-module/hooks/text-align.js
const TEXT_ALIGN_SUPPORT_KEY = "typography.textAlign";
const text_align_TEXT_ALIGNMENT_OPTIONS = [
{
icon: align_left_default,
title: (0,external_wp_i18n_namespaceObject.__)("Align text left"),
align: "left"
},
{
icon: align_center_default,
title: (0,external_wp_i18n_namespaceObject.__)("Align text center"),
align: "center"
},
{
icon: align_right_default,
title: (0,external_wp_i18n_namespaceObject.__)("Align text right"),
align: "right"
}
];
const VALID_TEXT_ALIGNMENTS = ["left", "center", "right"];
const NO_TEXT_ALIGNMENTS = [];
function getValidTextAlignments(blockTextAlign) {
if (Array.isArray(blockTextAlign)) {
return VALID_TEXT_ALIGNMENTS.filter(
(textAlign) => blockTextAlign.includes(textAlign)
);
}
return blockTextAlign === true ? VALID_TEXT_ALIGNMENTS : NO_TEXT_ALIGNMENTS;
}
function BlockEditTextAlignmentToolbarControlsPure({
style,
name: blockName,
setAttributes
}) {
const settings = useBlockSettings(blockName);
const hasTextAlignControl = settings?.typography?.textAlign;
const blockEditingMode = useBlockEditingMode();
if (!hasTextAlignControl || blockEditingMode !== "default") {
return null;
}
const validTextAlignments = getValidTextAlignments(
(0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, TEXT_ALIGN_SUPPORT_KEY)
);
if (!validTextAlignments.length) {
return null;
}
const textAlignmentControls = text_align_TEXT_ALIGNMENT_OPTIONS.filter(
(control) => validTextAlignments.includes(control.align)
);
const onChange = (newTextAlignValue) => {
const newStyle = {
...style,
typography: {
...style?.typography,
textAlign: newTextAlignValue
}
};
setAttributes({ style: utils_cleanEmptyObject(newStyle) });
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls_default, { group: "block", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
AlignmentControl,
{
value: style?.typography?.textAlign,
onChange,
alignmentControls: textAlignmentControls
}
) });
}
var text_align_default = {
edit: BlockEditTextAlignmentToolbarControlsPure,
useBlockProps: text_align_useBlockProps,
addSaveProps: addAssignedTextAlign,
attributeKeys: ["style"],
hasSupport(name) {
return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, TEXT_ALIGN_SUPPORT_KEY, false);
}
};
function text_align_useBlockProps({ name, style }) {
if (!style?.typography?.textAlign) {
return null;
}
const validTextAlignments = getValidTextAlignments(
(0,external_wp_blocks_namespaceObject.getBlockSupport)(name, TEXT_ALIGN_SUPPORT_KEY)
);
if (!validTextAlignments.length) {
return null;
}
if (shouldSkipSerialization(name, TYPOGRAPHY_SUPPORT_KEY, "textAlign")) {
return null;
}
const textAlign = style.typography.textAlign;
const className = dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
});
return { className };
}
function addAssignedTextAlign(props, blockType, attributes) {
if (!attributes?.style?.typography?.textAlign) {
return props;
}
const { textAlign } = attributes.style.typography;
const blockTextAlign = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, TEXT_ALIGN_SUPPORT_KEY);
const isTextAlignValid = getValidTextAlignments(blockTextAlign).includes(textAlign);
if (isTextAlignValid && !shouldSkipSerialization(
blockType,
TYPOGRAPHY_SUPPORT_KEY,
"textAlign"
)) {
props.className = dist_clsx(
`has-text-align-${textAlign}`,
props.className
);
}
return props;
}
;// ./node_modules/@wordpress/block-editor/build-module/utils/fit-text-utils.js
function findOptimalFontSize(textElement, applyFontSize) {
const alreadyHasScrollableHeight = textElement.scrollHeight > textElement.clientHeight;
let minSize = 5;
let maxSize = 2400;
let bestSize = minSize;
const computedStyle = window.getComputedStyle(textElement);
const paddingLeft = parseFloat(computedStyle.paddingLeft) || 0;
const paddingRight = parseFloat(computedStyle.paddingRight) || 0;
const range = document.createRange();
range.selectNodeContents(textElement);
while (minSize <= maxSize) {
const midSize = Math.floor((minSize + maxSize) / 2);
applyFontSize(midSize);
const rect = range.getBoundingClientRect();
const textWidth = rect.width;
const fitsWidth = textElement.scrollWidth <= textElement.clientWidth && textWidth <= textElement.clientWidth - paddingLeft - paddingRight;
const fitsHeight = alreadyHasScrollableHeight || textElement.scrollHeight <= textElement.clientHeight;
if (fitsWidth && fitsHeight) {
bestSize = midSize;
minSize = midSize + 1;
} else {
maxSize = midSize - 1;
}
}
range.detach();
return bestSize;
}
function optimizeFitText(textElement, applyFontSize) {
if (!textElement) {
return;
}
applyFontSize(0);
const optimalSize = findOptimalFontSize(textElement, applyFontSize);
applyFontSize(optimalSize);
return optimalSize;
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/fit-text.js
const EMPTY_OBJECT = {};
const FIT_TEXT_SUPPORT_KEY = "typography.fitText";
function fit_text_addAttributes(settings) {
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, FIT_TEXT_SUPPORT_KEY)) {
return settings;
}
if (settings.attributes?.fitText) {
return settings;
}
return {
...settings,
attributes: {
...settings.attributes,
fitText: {
type: "boolean"
}
}
};
}
function useFitText({ fitText, name, clientId }) {
const hasFitTextSupport2 = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, FIT_TEXT_SUPPORT_KEY);
const blockElement = useBlockElement(clientId);
const { blockAttributes, parentId } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
if (!clientId || !hasFitTextSupport2 || !fitText) {
return EMPTY_OBJECT;
}
return {
blockAttributes: select(store).getBlockAttributes(clientId),
parentId: select(store).getBlockRootClientId(clientId)
};
},
[clientId, hasFitTextSupport2, fitText]
);
const applyFitText = (0,external_wp_element_namespaceObject.useCallback)(() => {
if (!blockElement || !hasFitTextSupport2 || !fitText) {
return;
}
const styleId = `fit-text-${clientId}`;
let styleElement = blockElement.ownerDocument.getElementById(styleId);
if (!styleElement) {
styleElement = blockElement.ownerDocument.createElement("style");
styleElement.id = styleId;
blockElement.ownerDocument.head.appendChild(styleElement);
}
const blockSelector = `#block-${clientId}`;
const applyFontSize = (fontSize) => {
if (fontSize === 0) {
styleElement.textContent = "";
} else {
styleElement.textContent = `${blockSelector} { font-size: ${fontSize}px !important; }`;
}
};
optimizeFitText(blockElement, applyFontSize);
}, [blockElement, clientId, hasFitTextSupport2, fitText]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!fitText || !blockElement || !clientId || !hasFitTextSupport2) {
return;
}
const currentElement = blockElement;
const previousVisibility = currentElement.style.visibility;
let hideFrameId = null;
let calculateFrameId = null;
let showTimeoutId = null;
hideFrameId = window.requestAnimationFrame(() => {
currentElement.style.visibility = "hidden";
calculateFrameId = window.requestAnimationFrame(() => {
applyFitText();
showTimeoutId = setTimeout(() => {
currentElement.style.visibility = previousVisibility;
}, 10);
});
});
let resizeObserver;
if (window.ResizeObserver && currentElement.parentElement) {
resizeObserver = new window.ResizeObserver(applyFitText);
resizeObserver.observe(currentElement.parentElement);
resizeObserver.observe(currentElement);
}
return () => {
if (hideFrameId !== null) {
window.cancelAnimationFrame(hideFrameId);
}
if (calculateFrameId !== null) {
window.cancelAnimationFrame(calculateFrameId);
}
if (showTimeoutId !== null) {
clearTimeout(showTimeoutId);
}
if (resizeObserver) {
resizeObserver.disconnect();
}
const styleId = `fit-text-${clientId}`;
const styleElement = currentElement.ownerDocument.getElementById(styleId);
if (styleElement) {
styleElement.remove();
}
};
}, [
fitText,
clientId,
parentId,
applyFitText,
blockElement,
hasFitTextSupport2
]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (fitText && blockElement && hasFitTextSupport2) {
const frameId = window.requestAnimationFrame(() => {
if (blockElement) {
applyFitText();
}
});
return () => window.cancelAnimationFrame(frameId);
}
}, [
blockAttributes,
fitText,
applyFitText,
blockElement,
hasFitTextSupport2
]);
}
function fit_text_addSaveProps(props, blockType, attributes) {
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, FIT_TEXT_SUPPORT_KEY)) {
return props;
}
const { fitText } = attributes;
if (!fitText) {
return props;
}
const className = props.className ? `${props.className} has-fit-text` : "has-fit-text";
return {
...props,
className
};
}
function fit_text_useBlockProps({ name, fitText, clientId }) {
useFitText({ fitText, name, clientId });
if (!fitText || !(0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, FIT_TEXT_SUPPORT_KEY)) {
return {};
}
return {
className: "has-fit-text"
};
}
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.registerBlockType",
"core/fit-text/addAttribute",
fit_text_addAttributes
);
const hasFitTextSupport = (blockNameOrType) => {
return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockNameOrType, FIT_TEXT_SUPPORT_KEY);
};
var fit_text_default = {
useBlockProps: fit_text_useBlockProps,
addSaveProps: fit_text_addSaveProps,
attributeKeys: ["fitText"],
hasSupport: hasFitTextSupport,
edit: () => null
};
;// ./node_modules/@wordpress/block-editor/build-module/hooks/typography.js
function omit(object, keys) {
return Object.fromEntries(
Object.entries(object).filter(([key]) => !keys.includes(key))
);
}
const LETTER_SPACING_SUPPORT_KEY = "typography.__experimentalLetterSpacing";
const TEXT_TRANSFORM_SUPPORT_KEY = "typography.__experimentalTextTransform";
const TEXT_DECORATION_SUPPORT_KEY = "typography.__experimentalTextDecoration";
const TEXT_COLUMNS_SUPPORT_KEY = "typography.textColumns";
const FONT_STYLE_SUPPORT_KEY = "typography.__experimentalFontStyle";
const FONT_WEIGHT_SUPPORT_KEY = "typography.__experimentalFontWeight";
const WRITING_MODE_SUPPORT_KEY = "typography.__experimentalWritingMode";
const TYPOGRAPHY_SUPPORT_KEY = "typography";
const TYPOGRAPHY_SUPPORT_KEYS = [
LINE_HEIGHT_SUPPORT_KEY,
FONT_SIZE_SUPPORT_KEY,
FONT_STYLE_SUPPORT_KEY,
FONT_WEIGHT_SUPPORT_KEY,
FONT_FAMILY_SUPPORT_KEY,
TEXT_ALIGN_SUPPORT_KEY,
TEXT_COLUMNS_SUPPORT_KEY,
TEXT_DECORATION_SUPPORT_KEY,
WRITING_MODE_SUPPORT_KEY,
TEXT_TRANSFORM_SUPPORT_KEY,
LETTER_SPACING_SUPPORT_KEY,
FIT_TEXT_SUPPORT_KEY
];
function typography_styleToAttributes(style) {
const updatedStyle = { ...omit(style, ["fontFamily"]) };
const fontSizeValue = style?.typography?.fontSize;
const fontFamilyValue = style?.typography?.fontFamily;
const fontSizeSlug = typeof fontSizeValue === "string" && fontSizeValue?.startsWith("var:preset|font-size|") ? fontSizeValue.substring("var:preset|font-size|".length) : void 0;
const fontFamilySlug = fontFamilyValue?.startsWith(
"var:preset|font-family|"
) ? fontFamilyValue.substring("var:preset|font-family|".length) : void 0;
updatedStyle.typography = {
...omit(updatedStyle.typography, ["fontFamily"]),
fontSize: fontSizeSlug ? void 0 : fontSizeValue
};
return {
style: utils_cleanEmptyObject(updatedStyle),
fontFamily: fontFamilySlug,
fontSize: fontSizeSlug
};
}
function typography_attributesToStyle(attributes) {
return {
...attributes.style,
typography: {
...attributes.style?.typography,
fontFamily: attributes.fontFamily ? "var:preset|font-family|" + attributes.fontFamily : void 0,
fontSize: attributes.fontSize ? "var:preset|font-size|" + attributes.fontSize : attributes.style?.typography?.fontSize
}
};
}
function TypographyInspectorControl({ children, resetAllFilter }) {
const attributesResetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(
(attributes) => {
const existingStyle = typography_attributesToStyle(attributes);
const updatedStyle = resetAllFilter(existingStyle);
return {
...attributes,
...typography_styleToAttributes(updatedStyle)
};
},
[resetAllFilter]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inspector_controls_default,
{
group: "typography",
resetAllFilter: attributesResetAllFilter,
children
}
);
}
function typography_TypographyPanel({ clientId, name, setAttributes, settings }) {
function selector(select) {
const { style: style2, fontFamily: fontFamily2, fontSize: fontSize2, fitText: fitText2 } = select(store).getBlockAttributes(clientId) || {};
return { style: style2, fontFamily: fontFamily2, fontSize: fontSize2, fitText: fitText2 };
}
const { style, fontFamily, fontSize, fitText } = (0,external_wp_data_namespaceObject.useSelect)(selector, [
clientId
]);
const isEnabled = useHasTypographyPanel(settings);
const value = (0,external_wp_element_namespaceObject.useMemo)(
() => typography_attributesToStyle({ style, fontFamily, fontSize }),
[style, fontSize, fontFamily]
);
const onChange = (newStyle) => {
setAttributes(typography_styleToAttributes(newStyle));
};
if (!isEnabled) {
return null;
}
const defaultControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [
TYPOGRAPHY_SUPPORT_KEY,
"__experimentalDefaultControls"
]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
TypographyPanel,
{
as: TypographyInspectorControl,
panelId: clientId,
settings,
value,
onChange,
defaultControls,
fitText
}
);
}
const hasTypographySupport = (blockName) => {
return TYPOGRAPHY_SUPPORT_KEYS.some(
(key) => hasBlockSupport(blockName, key)
);
};
;// ./node_modules/@wordpress/block-editor/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js
const use_spacing_sizes_EMPTY_ARRAY = [];
const compare = new Intl.Collator("und", { numeric: true }).compare;
function useSpacingSizes() {
const [
customSpacingSizes,
themeSpacingSizes,
defaultSpacingSizes,
defaultSpacingSizesEnabled
] = use_settings_useSettings(
"spacing.spacingSizes.custom",
"spacing.spacingSizes.theme",
"spacing.spacingSizes.default",
"spacing.defaultSpacingSizes"
);
const customSizes = customSpacingSizes ?? use_spacing_sizes_EMPTY_ARRAY;
const themeSizes = themeSpacingSizes ?? use_spacing_sizes_EMPTY_ARRAY;
const defaultSizes = defaultSpacingSizes && defaultSpacingSizesEnabled !== false ? defaultSpacingSizes : use_spacing_sizes_EMPTY_ARRAY;
return (0,external_wp_element_namespaceObject.useMemo)(() => {
const sizes = [
{ name: (0,external_wp_i18n_namespaceObject.__)("None"), slug: "0", size: 0 },
...customSizes,
...themeSizes,
...defaultSizes
];
if (sizes.every(({ slug }) => /^[0-9]/.test(slug))) {
sizes.sort((a, b) => compare(a.slug, b.slug));
}
return sizes.length > RANGE_CONTROL_MAX_SIZE ? [
{
name: (0,external_wp_i18n_namespaceObject.__)("Default"),
slug: "default",
size: void 0
},
...sizes
] : sizes;
}, [customSizes, themeSizes, defaultSizes]);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js
const CUSTOM_VALUE_SETTINGS = {
px: { max: 300, steps: 1 },
"%": { max: 100, steps: 1 },
vw: { max: 100, steps: 1 },
vh: { max: 100, steps: 1 },
em: { max: 10, steps: 0.1 },
rm: { max: 10, steps: 0.1 },
svw: { max: 100, steps: 1 },
lvw: { max: 100, steps: 1 },
dvw: { max: 100, steps: 1 },
svh: { max: 100, steps: 1 },
lvh: { max: 100, steps: 1 },
dvh: { max: 100, steps: 1 },
vi: { max: 100, steps: 1 },
svi: { max: 100, steps: 1 },
lvi: { max: 100, steps: 1 },
dvi: { max: 100, steps: 1 },
vb: { max: 100, steps: 1 },
svb: { max: 100, steps: 1 },
lvb: { max: 100, steps: 1 },
dvb: { max: 100, steps: 1 },
vmin: { max: 100, steps: 1 },
svmin: { max: 100, steps: 1 },
lvmin: { max: 100, steps: 1 },
dvmin: { max: 100, steps: 1 },
vmax: { max: 100, steps: 1 },
svmax: { max: 100, steps: 1 },
lvmax: { max: 100, steps: 1 },
dvmax: { max: 100, steps: 1 }
};
function SpacingInputControl({
icon,
isMixed = false,
minimumCustomValue,
onChange,
onMouseOut,
onMouseOver,
showSideInLabel = true,
side,
spacingSizes,
type,
value
}) {
value = getPresetValueFromCustomValue(value, spacingSizes);
let selectListSizes = spacingSizes;
const showRangeControl = spacingSizes.length <= RANGE_CONTROL_MAX_SIZE;
const disableCustomSpacingSizes = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const editorSettings = select(store).getSettings();
return editorSettings?.disableCustomSpacingSizes;
});
const [showCustomValueControl, setShowCustomValueControl] = (0,external_wp_element_namespaceObject.useState)(
!disableCustomSpacingSizes && value !== void 0 && !isValueSpacingPreset(value)
);
const [minValue, setMinValue] = (0,external_wp_element_namespaceObject.useState)(minimumCustomValue);
const previousValue = (0,external_wp_compose_namespaceObject.usePrevious)(value);
if (!!value && previousValue !== value && !isValueSpacingPreset(value) && showCustomValueControl !== true) {
setShowCustomValueControl(true);
}
const [availableUnits] = use_settings_useSettings("spacing.units");
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits: availableUnits || ["px", "em", "rem"]
});
let currentValue = null;
const showCustomValueInSelectList = !showRangeControl && !showCustomValueControl && value !== void 0 && (!isValueSpacingPreset(value) || isValueSpacingPreset(value) && isMixed);
if (showCustomValueInSelectList) {
selectListSizes = [
...spacingSizes,
{
name: !isMixed ? (
// translators: %s: A custom measurement, e.g. a number followed by a unit like 12px.
(0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Custom (%s)"), value)
) : (0,external_wp_i18n_namespaceObject.__)("Mixed"),
slug: "custom",
size: value
}
];
currentValue = selectListSizes.length - 1;
} else if (!isMixed) {
currentValue = !showCustomValueControl ? getSliderValueFromPreset(value, spacingSizes) : getCustomValueFromPreset(value, spacingSizes);
}
const selectedUnit = (0,external_wp_element_namespaceObject.useMemo)(
() => (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(currentValue),
[currentValue]
)[1] || units[0]?.value;
const setInitialValue = () => {
if (value === void 0) {
onChange("0");
}
};
const customTooltipContent = (newValue) => value === void 0 ? void 0 : spacingSizes[newValue]?.name;
const customRangeValue = parseFloat(currentValue, 10);
const getNewCustomValue = (newSize) => {
const isNumeric = !isNaN(parseFloat(newSize));
const nextValue = isNumeric ? newSize : void 0;
return nextValue;
};
const getNewPresetValue = (newSize, controlType) => {
const size = parseInt(newSize, 10);
if (controlType === "selectList") {
if (size === 0) {
return void 0;
}
if (size === 1) {
return "0";
}
} else if (size === 0) {
return "0";
}
return `var:preset|spacing|${spacingSizes[newSize]?.slug}`;
};
const handleCustomValueSliderChange = (next) => {
onChange([next, selectedUnit].join(""));
};
const allPlaceholder = isMixed ? (0,external_wp_i18n_namespaceObject.__)("Mixed") : null;
const options = selectListSizes.map((size, index) => ({
key: index,
name: size.name
}));
const marks = spacingSizes.slice(1, spacingSizes.length - 1).map((_newValue, index) => ({
value: index + 1,
label: void 0
}));
const sideLabel = ALL_SIDES.includes(side) && showSideInLabel ? LABELS[side] : "";
const typeLabel = showSideInLabel ? type?.toLowerCase() : type;
const ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: The side of the block being modified (top, bottom, left etc.). 2. Type of spacing being modified (padding, margin, etc).
(0,external_wp_i18n_namespaceObject._x)("%1$s %2$s", "spacing"),
sideLabel,
typeLabel
).trim();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { className: "spacing-sizes-control__wrapper", children: [
icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Icon,
{
className: "spacing-sizes-control__icon",
icon,
size: 24
}
),
showCustomValueControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
onMouseOver,
onMouseOut,
onFocus: onMouseOver,
onBlur: onMouseOut,
onChange: (newSize) => onChange(getNewCustomValue(newSize)),
value: currentValue,
units,
min: minValue,
placeholder: allPlaceholder,
disableUnits: isMixed,
label: ariaLabel,
hideLabelFromVision: true,
className: "spacing-sizes-control__custom-value-input",
size: "__unstable-large",
onDragStart: () => {
if (value?.charAt(0) === "-") {
setMinValue(0);
}
},
onDrag: () => {
if (value?.charAt(0) === "-") {
setMinValue(0);
}
},
onDragEnd: () => {
setMinValue(minimumCustomValue);
}
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.RangeControl,
{
__next40pxDefaultSize: true,
onMouseOver,
onMouseOut,
onFocus: onMouseOver,
onBlur: onMouseOut,
value: customRangeValue,
min: 0,
max: CUSTOM_VALUE_SETTINGS[selectedUnit]?.max ?? 10,
step: CUSTOM_VALUE_SETTINGS[selectedUnit]?.steps ?? 0.1,
withInputField: false,
onChange: handleCustomValueSliderChange,
className: "spacing-sizes-control__custom-value-range",
__nextHasNoMarginBottom: true,
label: ariaLabel,
hideLabelFromVision: true
}
)
] }),
showRangeControl && !showCustomValueControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.RangeControl,
{
__next40pxDefaultSize: true,
onMouseOver,
onMouseOut,
className: "spacing-sizes-control__range-control",
value: currentValue,
onChange: (newSize) => onChange(getNewPresetValue(newSize)),
onMouseDown: (event) => {
if (event?.nativeEvent?.offsetX < 35) {
setInitialValue();
}
},
withInputField: false,
"aria-valuenow": currentValue,
"aria-valuetext": spacingSizes[currentValue]?.name,
renderTooltipContent: customTooltipContent,
min: 0,
max: spacingSizes.length - 1,
marks,
label: ariaLabel,
hideLabelFromVision: true,
__nextHasNoMarginBottom: true,
onFocus: onMouseOver,
onBlur: onMouseOut
}
),
!showRangeControl && !showCustomValueControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CustomSelectControl,
{
className: "spacing-sizes-control__custom-select-control",
value: (
// passing empty string as a fallback to continue using the
// component in controlled mode
options.find(
(option) => option.key === currentValue
) || ""
),
onChange: (selection) => {
onChange(
getNewPresetValue(
selection.selectedItem.key,
"selectList"
)
);
},
options,
label: ariaLabel,
hideLabelFromVision: true,
size: "__unstable-large",
onMouseOver,
onMouseOut,
onFocus: onMouseOver,
onBlur: onMouseOut
}
),
!disableCustomSpacingSizes && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
label: showCustomValueControl ? (0,external_wp_i18n_namespaceObject.__)("Use size preset") : (0,external_wp_i18n_namespaceObject.__)("Set custom size"),
icon: settings_settings_default,
onClick: () => {
setShowCustomValueControl(!showCustomValueControl);
},
isPressed: showCustomValueControl,
size: "small",
className: "spacing-sizes-control__custom-toggle",
iconSize: 24
}
)
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/spacing-sizes-control/input-controls/axial.js
const groupedSides = ["vertical", "horizontal"];
function AxialInputControls({
minimumCustomValue,
onChange,
onMouseOut,
onMouseOver,
sides,
spacingSizes,
type,
values
}) {
const createHandleOnChange = (side) => (next) => {
if (!onChange) {
return;
}
const nextValues = {
...Object.keys(values).reduce((acc, key) => {
acc[key] = getPresetValueFromCustomValue(
values[key],
spacingSizes
);
return acc;
}, {})
};
if (side === "vertical") {
nextValues.top = next;
nextValues.bottom = next;
}
if (side === "horizontal") {
nextValues.left = next;
nextValues.right = next;
}
onChange(nextValues);
};
const filteredSides = sides?.length ? groupedSides.filter((side) => hasAxisSupport(sides, side)) : groupedSides;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: filteredSides.map((side) => {
const axisValue = side === "vertical" ? values.top : values.left;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SpacingInputControl,
{
icon: ICONS[side],
label: LABELS[side],
minimumCustomValue,
onChange: createHandleOnChange(side),
onMouseOut,
onMouseOver,
side,
spacingSizes,
type,
value: axisValue,
withInputField: false
},
`spacing-sizes-control-${side}`
);
}) });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/spacing-sizes-control/input-controls/separated.js
function SeparatedInputControls({
minimumCustomValue,
onChange,
onMouseOut,
onMouseOver,
sides,
spacingSizes,
type,
values
}) {
const filteredSides = sides?.length ? ALL_SIDES.filter((side) => sides.includes(side)) : ALL_SIDES;
const createHandleOnChange = (side) => (next) => {
const nextValues = {
...Object.keys(values).reduce((acc, key) => {
acc[key] = getPresetValueFromCustomValue(
values[key],
spacingSizes
);
return acc;
}, {})
};
nextValues[side] = next;
onChange(nextValues);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: filteredSides.map((side) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SpacingInputControl,
{
icon: ICONS[side],
label: LABELS[side],
minimumCustomValue,
onChange: createHandleOnChange(side),
onMouseOut,
onMouseOver,
side,
spacingSizes,
type,
value: values[side],
withInputField: false
},
`spacing-sizes-control-${side}`
);
}) });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/spacing-sizes-control/input-controls/single.js
function single_SingleInputControl({
minimumCustomValue,
onChange,
onMouseOut,
onMouseOver,
showSideInLabel,
side,
spacingSizes,
type,
values
}) {
const createHandleOnChange = (currentSide) => (next) => {
const nextValues = {
...Object.keys(values).reduce((acc, key) => {
acc[key] = getPresetValueFromCustomValue(
values[key],
spacingSizes
);
return acc;
}, {})
};
nextValues[currentSide] = next;
onChange(nextValues);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SpacingInputControl,
{
label: LABELS[side],
minimumCustomValue,
onChange: createHandleOnChange(side),
onMouseOut,
onMouseOver,
showSideInLabel,
side,
spacingSizes,
type,
value: values[side],
withInputField: false
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/spacing-sizes-control/linked-button.js
function linked_button_LinkedButton({ isLinked, ...props }) {
const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)("Unlink sides") : (0,external_wp_i18n_namespaceObject.__)("Link sides");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
...props,
size: "small",
icon: isLinked ? link_default : link_off_default,
iconSize: 24,
label
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/spacing-sizes-control/index.js
function SpacingSizesControl({
inputProps,
label: labelProp,
minimumCustomValue = 0,
onChange,
onMouseOut,
onMouseOver,
showSideInLabel = true,
sides = ALL_SIDES,
useSelect,
values
}) {
const spacingSizes = useSpacingSizes();
const inputValues = values || DEFAULT_VALUES;
const hasOneSide = sides?.length === 1;
const hasOnlyAxialSides = sides?.includes("horizontal") && sides?.includes("vertical") && sides?.length === 2;
const [view, setView] = (0,external_wp_element_namespaceObject.useState)(getInitialView(inputValues, sides));
const toggleLinked = () => {
setView(view === VIEWS.axial ? VIEWS.custom : VIEWS.axial);
};
const handleOnChange = (nextValue) => {
const newValues = { ...values, ...nextValue };
onChange(newValues);
};
const inputControlProps = {
...inputProps,
minimumCustomValue,
onChange: handleOnChange,
onMouseOut,
onMouseOver,
sides,
spacingSizes,
type: labelProp,
useSelect,
values: inputValues
};
const renderControls = () => {
if (view === VIEWS.axial) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(AxialInputControls, { ...inputControlProps });
}
if (view === VIEWS.custom) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SeparatedInputControls, { ...inputControlProps });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
single_SingleInputControl,
{
side: view,
...inputControlProps,
showSideInLabel
}
);
};
const sideLabel = ALL_SIDES.includes(view) && showSideInLabel ? LABELS[view] : "";
const label = (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: The side of the block being modified (top, bottom, left etc.). 2. Type of spacing being modified (padding, margin, etc).
(0,external_wp_i18n_namespaceObject._x)("%1$s %2$s", "spacing"),
labelProp,
sideLabel
).trim();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "spacing-sizes-control", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { className: "spacing-sizes-control__header", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.BaseControl.VisualLabel,
{
as: "legend",
className: "spacing-sizes-control__label",
children: label
}
),
!hasOneSide && !hasOnlyAxialSides && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
linked_button_LinkedButton,
{
label: labelProp,
onClick: toggleLinked,
isLinked: view === VIEWS.axial
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 0.5, children: renderControls() })
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/height-control/index.js
const RANGE_CONTROL_CUSTOM_SETTINGS = {
px: { max: 1e3, step: 1 },
"%": { max: 100, step: 1 },
vw: { max: 100, step: 1 },
vh: { max: 100, step: 1 },
em: { max: 50, step: 0.1 },
rem: { max: 50, step: 0.1 },
svw: { max: 100, step: 1 },
lvw: { max: 100, step: 1 },
dvw: { max: 100, step: 1 },
svh: { max: 100, step: 1 },
lvh: { max: 100, step: 1 },
dvh: { max: 100, step: 1 },
vi: { max: 100, step: 1 },
svi: { max: 100, step: 1 },
lvi: { max: 100, step: 1 },
dvi: { max: 100, step: 1 },
vb: { max: 100, step: 1 },
svb: { max: 100, step: 1 },
lvb: { max: 100, step: 1 },
dvb: { max: 100, step: 1 },
vmin: { max: 100, step: 1 },
svmin: { max: 100, step: 1 },
lvmin: { max: 100, step: 1 },
dvmin: { max: 100, step: 1 },
vmax: { max: 100, step: 1 },
svmax: { max: 100, step: 1 },
lvmax: { max: 100, step: 1 },
dvmax: { max: 100, step: 1 }
};
function HeightControl({
label = (0,external_wp_i18n_namespaceObject.__)("Height"),
onChange,
value
}) {
const customRangeValue = parseFloat(value);
const [availableUnits] = use_settings_useSettings("spacing.units");
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits: availableUnits || [
"%",
"px",
"em",
"rem",
"vh",
"vw"
]
});
const selectedUnit = (0,external_wp_element_namespaceObject.useMemo)(
() => (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value),
[value]
)[1] || units[0]?.value || "px";
const handleSliderChange = (next) => {
onChange([next, selectedUnit].join(""));
};
const handleUnitChange = (newUnit) => {
const [currentValue, currentUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
if (["em", "rem"].includes(newUnit) && currentUnit === "px") {
onChange((currentValue / 16).toFixed(2) + newUnit);
} else if (["em", "rem"].includes(currentUnit) && newUnit === "px") {
onChange(Math.round(currentValue * 16) + newUnit);
} else if ([
"%",
"vw",
"svw",
"lvw",
"dvw",
"vh",
"svh",
"lvh",
"dvh",
"vi",
"svi",
"lvi",
"dvi",
"vb",
"svb",
"lvb",
"dvb",
"vmin",
"svmin",
"lvmin",
"dvmin",
"vmax",
"svmax",
"lvmax",
"dvmax"
].includes(newUnit) && currentValue > 100) {
onChange(100 + newUnit);
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "block-editor-height-control", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { as: "legend", children: label }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
value,
units,
onChange,
onUnitChange: handleUnitChange,
min: 0,
size: "__unstable-large",
label,
hideLabelFromVision: true
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginX: 2, marginBottom: 0, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.RangeControl,
{
__next40pxDefaultSize: true,
value: customRangeValue,
min: 0,
max: RANGE_CONTROL_CUSTOM_SETTINGS[selectedUnit]?.max ?? 100,
step: RANGE_CONTROL_CUSTOM_SETTINGS[selectedUnit]?.step ?? 0.1,
withInputField: false,
onChange: handleSliderChange,
__nextHasNoMarginBottom: true,
label,
hideLabelFromVision: true
}
) }) })
] })
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/grid/use-get-number-of-blocks-before-cell.js
function useGetNumberOfBlocksBeforeCell(gridClientId, numColumns) {
const { getBlockOrder, getBlockAttributes } = (0,external_wp_data_namespaceObject.useSelect)(store);
const getNumberOfBlocksBeforeCell = (column, row) => {
const targetIndex = (row - 1) * numColumns + column - 1;
let count = 0;
for (const clientId of getBlockOrder(gridClientId)) {
const { columnStart, rowStart } = getBlockAttributes(clientId).style?.layout ?? {};
const cellIndex = (rowStart - 1) * numColumns + columnStart - 1;
if (cellIndex < targetIndex) {
count++;
}
}
return count;
};
return getNumberOfBlocksBeforeCell;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/child-layout-control/index.js
function helpText(selfStretch, parentLayout) {
const { orientation = "horizontal" } = parentLayout;
if (selfStretch === "fill") {
return (0,external_wp_i18n_namespaceObject.__)("Stretch to fill available space.");
}
if (selfStretch === "fixed" && orientation === "horizontal") {
return (0,external_wp_i18n_namespaceObject.__)("Specify a fixed width.");
} else if (selfStretch === "fixed") {
return (0,external_wp_i18n_namespaceObject.__)("Specify a fixed height.");
}
return (0,external_wp_i18n_namespaceObject.__)("Fit contents.");
}
function ChildLayoutControl({
value: childLayout = {},
onChange,
parentLayout,
isShownByDefault,
panelId
}) {
const {
type: parentType,
default: { type: defaultParentType = "default" } = {}
} = parentLayout ?? {};
const parentLayoutType = parentType || defaultParentType;
if (parentLayoutType === "flex") {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FlexControls,
{
childLayout,
onChange,
parentLayout,
isShownByDefault,
panelId
}
);
} else if (parentLayoutType === "grid") {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridControls,
{
childLayout,
onChange,
parentLayout,
isShownByDefault,
panelId
}
);
}
return null;
}
function FlexControls({
childLayout,
onChange,
parentLayout,
isShownByDefault,
panelId
}) {
const { selfStretch, flexSize } = childLayout;
const { orientation = "horizontal" } = parentLayout ?? {};
const hasFlexValue = () => !!selfStretch;
const flexResetLabel = orientation === "horizontal" ? (0,external_wp_i18n_namespaceObject.__)("Width") : (0,external_wp_i18n_namespaceObject.__)("Height");
const [availableUnits] = use_settings_useSettings("spacing.units");
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits: availableUnits || [
"%",
"px",
"em",
"rem",
"vh",
"vw"
]
});
const resetFlex = () => {
onChange({
selfStretch: void 0,
flexSize: void 0
});
};
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (selfStretch === "fixed" && !flexSize) {
onChange({
...childLayout,
selfStretch: "fit"
});
}
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
as: external_wp_components_namespaceObject.__experimentalToolsPanelItem,
spacing: 2,
hasValue: hasFlexValue,
label: flexResetLabel,
onDeselect: resetFlex,
isShownByDefault,
panelId,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
__nextHasNoMarginBottom: true,
size: "__unstable-large",
label: childLayoutOrientation(parentLayout),
value: selfStretch || "fit",
help: helpText(selfStretch, parentLayout),
onChange: (value) => {
const newFlexSize = value !== "fixed" ? null : flexSize;
onChange({
selfStretch: value,
flexSize: newFlexSize
});
},
isBlock: true,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "fit",
label: (0,external_wp_i18n_namespaceObject._x)(
"Fit",
"Intrinsic block width in flex layout"
)
},
"fit"
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "fill",
label: (0,external_wp_i18n_namespaceObject._x)(
"Grow",
"Block with expanding width in flex layout"
)
},
"fill"
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "fixed",
label: (0,external_wp_i18n_namespaceObject._x)(
"Fixed",
"Block with fixed width in flex layout"
)
},
"fixed"
)
]
}
),
selfStretch === "fixed" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
size: "__unstable-large",
units,
onChange: (value) => {
onChange({
selfStretch,
flexSize: value
});
},
value: flexSize,
min: 0,
label: flexResetLabel,
hideLabelFromVision: true
}
)
]
}
);
}
function childLayoutOrientation(parentLayout) {
const { orientation = "horizontal" } = parentLayout;
return orientation === "horizontal" ? (0,external_wp_i18n_namespaceObject.__)("Width") : (0,external_wp_i18n_namespaceObject.__)("Height");
}
function GridControls({
childLayout,
onChange,
parentLayout,
isShownByDefault,
panelId
}) {
const { columnStart, rowStart, columnSpan, rowSpan } = childLayout;
const { columnCount, rowCount } = parentLayout ?? {};
const rootClientId = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).getBlockRootClientId(panelId)
);
const { moveBlocksToPosition, __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(
rootClientId,
columnCount || 3
);
const hasStartValue = () => !!columnStart || !!rowStart;
const hasSpanValue = () => !!columnSpan || !!rowSpan;
const resetGridStarts = () => {
onChange({
columnStart: void 0,
rowStart: void 0
});
};
const resetGridSpans = () => {
onChange({
columnSpan: void 0,
rowSpan: void 0
});
};
const maxColumnSpan = columnCount ? columnCount - (columnStart ?? 1) + 1 : void 0;
const maxRowSpan = window.__experimentalEnableGridInteractivity && rowCount ? rowCount - (rowStart ?? 1) + 1 : void 0;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Flex,
{
as: external_wp_components_namespaceObject.__experimentalToolsPanelItem,
hasValue: hasSpanValue,
label: (0,external_wp_i18n_namespaceObject.__)("Grid span"),
onDeselect: resetGridSpans,
isShownByDefault,
panelId,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { style: { width: "50%" }, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalInputControl,
{
size: "__unstable-large",
label: (0,external_wp_i18n_namespaceObject.__)("Column span"),
type: "number",
onChange: (value) => {
const newColumnSpan = value === "" ? 1 : parseInt(value, 10);
const constrainedValue = maxColumnSpan ? Math.min(newColumnSpan, maxColumnSpan) : newColumnSpan;
onChange({
columnStart,
rowStart,
rowSpan,
columnSpan: constrainedValue
});
},
value: columnSpan ?? 1,
min: 1,
max: maxColumnSpan
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { style: { width: "50%" }, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalInputControl,
{
size: "__unstable-large",
label: (0,external_wp_i18n_namespaceObject.__)("Row span"),
type: "number",
onChange: (value) => {
const newRowSpan = value === "" ? 1 : parseInt(value, 10);
const constrainedValue = maxRowSpan ? Math.min(newRowSpan, maxRowSpan) : newRowSpan;
onChange({
columnStart,
rowStart,
columnSpan,
rowSpan: constrainedValue
});
},
value: rowSpan ?? 1,
min: 1,
max: maxRowSpan
}
) })
]
}
),
window.__experimentalEnableGridInteractivity && // Use Flex with an explicit width on the FlexItem instead of HStack to
// work around an issue in webkit where inputs with a max attribute are
// sized incorrectly.
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Flex,
{
as: external_wp_components_namespaceObject.__experimentalToolsPanelItem,
hasValue: hasStartValue,
label: (0,external_wp_i18n_namespaceObject.__)("Grid placement"),
onDeselect: resetGridStarts,
isShownByDefault: false,
panelId,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { style: { width: "50%" }, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalInputControl,
{
size: "__unstable-large",
label: (0,external_wp_i18n_namespaceObject.__)("Column"),
type: "number",
onChange: (value) => {
const newColumnStart = value === "" ? 1 : parseInt(value, 10);
onChange({
columnStart: newColumnStart,
rowStart,
columnSpan,
rowSpan
});
__unstableMarkNextChangeAsNotPersistent();
moveBlocksToPosition(
[panelId],
rootClientId,
rootClientId,
getNumberOfBlocksBeforeCell(
newColumnStart,
rowStart
)
);
},
value: columnStart ?? 1,
min: 1,
max: columnCount ? columnCount - (columnSpan ?? 1) + 1 : void 0
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { style: { width: "50%" }, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalInputControl,
{
size: "__unstable-large",
label: (0,external_wp_i18n_namespaceObject.__)("Row"),
type: "number",
onChange: (value) => {
const newRowStart = value === "" ? 1 : parseInt(value, 10);
onChange({
columnStart,
rowStart: newRowStart,
columnSpan,
rowSpan
});
__unstableMarkNextChangeAsNotPersistent();
moveBlocksToPosition(
[panelId],
rootClientId,
rootClientId,
getNumberOfBlocksBeforeCell(
columnStart,
newRowStart
)
);
},
value: rowStart ?? 1,
min: 1,
max: rowCount ? rowCount - (rowSpan ?? 1) + 1 : void 0
}
) })
]
}
)
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/dimensions-tool/aspect-ratio-tool.js
function AspectRatioTool({
panelId,
value,
onChange = () => {
},
options,
defaultValue = "auto",
hasValue,
isShownByDefault = true
}) {
const displayValue = value ?? "auto";
const [defaultRatios, themeRatios, showDefaultRatios] = use_settings_useSettings(
"dimensions.aspectRatios.default",
"dimensions.aspectRatios.theme",
"dimensions.defaultAspectRatios"
);
const themeOptions = themeRatios?.map(({ name, ratio }) => ({
label: name,
value: ratio
}));
const defaultOptions = defaultRatios?.map(({ name, ratio }) => ({
label: name,
value: ratio
}));
const aspectRatioOptions = [
{
label: (0,external_wp_i18n_namespaceObject._x)(
"Original",
"Aspect ratio option for dimensions control"
),
value: "auto"
},
...showDefaultRatios ? defaultOptions : [],
...themeOptions ? themeOptions : [],
{
label: (0,external_wp_i18n_namespaceObject._x)("Custom", "Aspect ratio option for dimensions control"),
value: "custom",
disabled: true,
hidden: true
}
];
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: hasValue ? hasValue : () => displayValue !== defaultValue,
label: (0,external_wp_i18n_namespaceObject.__)("Aspect ratio"),
onDeselect: () => onChange(void 0),
isShownByDefault,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SelectControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Aspect ratio"),
value: displayValue,
options: options ?? aspectRatioOptions,
onChange,
size: "__unstable-large",
__nextHasNoMarginBottom: true
}
)
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/dimensions-panel.js
const AXIAL_SIDES = ["horizontal", "vertical"];
function useHasDimensionsPanel(settings) {
const hasContentSize = useHasContentSize(settings);
const hasWideSize = useHasWideSize(settings);
const hasPadding = useHasPadding(settings);
const hasMargin = useHasMargin(settings);
const hasGap = useHasGap(settings);
const hasMinHeight = useHasMinHeight(settings);
const hasAspectRatio = useHasAspectRatio(settings);
const hasChildLayout = useHasChildLayout(settings);
return external_wp_element_namespaceObject.Platform.OS === "web" && (hasContentSize || hasWideSize || hasPadding || hasMargin || hasGap || hasMinHeight || hasAspectRatio || hasChildLayout);
}
function useHasContentSize(settings) {
return settings?.layout?.contentSize;
}
function useHasWideSize(settings) {
return settings?.layout?.wideSize;
}
function useHasPadding(settings) {
return settings?.spacing?.padding;
}
function useHasMargin(settings) {
return settings?.spacing?.margin;
}
function useHasGap(settings) {
return settings?.spacing?.blockGap;
}
function useHasMinHeight(settings) {
return settings?.dimensions?.minHeight;
}
function useHasAspectRatio(settings) {
return settings?.dimensions?.aspectRatio;
}
function useHasChildLayout(settings) {
const {
type: parentLayoutType = "default",
default: { type: defaultParentLayoutType = "default" } = {},
allowSizingOnChildren = false
} = settings?.parentLayout ?? {};
const support = (defaultParentLayoutType === "flex" || parentLayoutType === "flex" || defaultParentLayoutType === "grid" || parentLayoutType === "grid") && allowSizingOnChildren;
return !!settings?.layout && support;
}
function useHasSpacingPresets(settings) {
const { defaultSpacingSizes, spacingSizes } = settings?.spacing || {};
return defaultSpacingSizes !== false && spacingSizes?.default?.length > 0 || spacingSizes?.theme?.length > 0 || spacingSizes?.custom?.length > 0;
}
function filterValuesBySides(values, sides) {
if (!sides || !values) {
return values;
}
const filteredValues = {};
sides.forEach((side) => {
if (side === "vertical") {
filteredValues.top = values.top;
filteredValues.bottom = values.bottom;
}
if (side === "horizontal") {
filteredValues.left = values.left;
filteredValues.right = values.right;
}
filteredValues[side] = values?.[side];
});
return filteredValues;
}
function splitStyleValue(value) {
if (value && typeof value === "string") {
return {
top: value,
right: value,
bottom: value,
left: value
};
}
return value;
}
function splitGapValue(value, isAxialGap) {
if (!value) {
return value;
}
if (typeof value === "string") {
return isAxialGap ? { top: value, right: value, bottom: value, left: value } : { top: value };
}
return {
...value,
right: value?.left,
bottom: value?.top
};
}
function DimensionsToolsPanel({
resetAllFilter,
onChange,
value,
panelId,
children
}) {
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const resetAll = () => {
const updatedValue = resetAllFilter(value);
onChange(updatedValue);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Dimensions"),
resetAll,
panelId,
dropdownMenuProps,
children
}
);
}
const dimensions_panel_DEFAULT_CONTROLS = {
contentSize: true,
wideSize: true,
padding: true,
margin: true,
blockGap: true,
minHeight: true,
aspectRatio: true,
childLayout: true
};
function DimensionsPanel({
as: Wrapper = DimensionsToolsPanel,
value,
onChange,
inheritedValue = value,
settings,
panelId,
defaultControls = dimensions_panel_DEFAULT_CONTROLS,
onVisualize = () => {
},
// Special case because the layout controls are not part of the dimensions panel
// in global styles but not in block inspector.
includeLayoutControls = false
}) {
const { dimensions, spacing } = settings;
const decodeValue = (rawValue) => {
if (rawValue && typeof rawValue === "object") {
return Object.keys(rawValue).reduce((acc, key) => {
acc[key] = getValueFromVariable(
{ settings: { dimensions, spacing } },
"",
rawValue[key]
);
return acc;
}, {});
}
return getValueFromVariable(
{ settings: { dimensions, spacing } },
"",
rawValue
);
};
const showSpacingPresetsControl = useHasSpacingPresets(settings);
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits: settings?.spacing?.units || [
"%",
"px",
"em",
"rem",
"vw"
]
});
const minimumMargin = -Infinity;
const [minMarginValue, setMinMarginValue] = (0,external_wp_element_namespaceObject.useState)(minimumMargin);
const showContentSizeControl = useHasContentSize(settings) && includeLayoutControls;
const contentSizeValue = decodeValue(inheritedValue?.layout?.contentSize);
const setContentSizeValue = (newValue) => {
onChange(
setImmutably(
value,
["layout", "contentSize"],
newValue || void 0
)
);
};
const hasUserSetContentSizeValue = () => !!value?.layout?.contentSize;
const resetContentSizeValue = () => setContentSizeValue(void 0);
const showWideSizeControl = useHasWideSize(settings) && includeLayoutControls;
const wideSizeValue = decodeValue(inheritedValue?.layout?.wideSize);
const setWideSizeValue = (newValue) => {
onChange(
setImmutably(
value,
["layout", "wideSize"],
newValue || void 0
)
);
};
const hasUserSetWideSizeValue = () => !!value?.layout?.wideSize;
const resetWideSizeValue = () => setWideSizeValue(void 0);
const showPaddingControl = useHasPadding(settings);
const rawPadding = decodeValue(inheritedValue?.spacing?.padding);
const paddingValues = splitStyleValue(rawPadding);
const paddingSides = Array.isArray(settings?.spacing?.padding) ? settings?.spacing?.padding : settings?.spacing?.padding?.sides;
const isAxialPadding = paddingSides && paddingSides.some((side) => AXIAL_SIDES.includes(side));
const setPaddingValues = (newPaddingValues) => {
const padding = filterValuesBySides(newPaddingValues, paddingSides);
onChange(setImmutably(value, ["spacing", "padding"], padding));
};
const hasPaddingValue = () => !!value?.spacing?.padding && Object.keys(value?.spacing?.padding).length;
const resetPaddingValue = () => setPaddingValues(void 0);
const onMouseOverPadding = () => onVisualize("padding");
const showMarginControl = useHasMargin(settings);
const rawMargin = decodeValue(inheritedValue?.spacing?.margin);
const marginValues = splitStyleValue(rawMargin);
const marginSides = Array.isArray(settings?.spacing?.margin) ? settings?.spacing?.margin : settings?.spacing?.margin?.sides;
const isAxialMargin = marginSides && marginSides.some((side) => AXIAL_SIDES.includes(side));
const setMarginValues = (newMarginValues) => {
const margin = filterValuesBySides(newMarginValues, marginSides);
onChange(setImmutably(value, ["spacing", "margin"], margin));
};
const hasMarginValue = () => !!value?.spacing?.margin && Object.keys(value?.spacing?.margin).length;
const resetMarginValue = () => setMarginValues(void 0);
const onMouseOverMargin = () => onVisualize("margin");
const showGapControl = useHasGap(settings);
const gapSides = Array.isArray(settings?.spacing?.blockGap) ? settings?.spacing?.blockGap : settings?.spacing?.blockGap?.sides;
const isAxialGap = gapSides && gapSides.some((side) => AXIAL_SIDES.includes(side));
const gapValue = decodeValue(inheritedValue?.spacing?.blockGap);
const gapValues = splitGapValue(gapValue, isAxialGap);
const setGapValue = (newGapValue) => {
onChange(
setImmutably(value, ["spacing", "blockGap"], newGapValue)
);
};
const setGapValues = (nextBoxGapValue) => {
if (!nextBoxGapValue) {
setGapValue(null);
}
if (!isAxialGap && nextBoxGapValue?.hasOwnProperty("top")) {
setGapValue(nextBoxGapValue.top);
} else {
setGapValue({
top: nextBoxGapValue?.top,
left: nextBoxGapValue?.left
});
}
};
const resetGapValue = () => setGapValue(void 0);
const hasGapValue = () => !!value?.spacing?.blockGap;
const showMinHeightControl = useHasMinHeight(settings);
const minHeightValue = decodeValue(inheritedValue?.dimensions?.minHeight);
const setMinHeightValue = (newValue) => {
const tempValue = setImmutably(
value,
["dimensions", "minHeight"],
newValue
);
onChange(
setImmutably(
tempValue,
["dimensions", "aspectRatio"],
void 0
)
);
};
const resetMinHeightValue = () => {
setMinHeightValue(void 0);
};
const hasMinHeightValue = () => !!value?.dimensions?.minHeight;
const showAspectRatioControl = useHasAspectRatio(settings);
const aspectRatioValue = decodeValue(
inheritedValue?.dimensions?.aspectRatio
);
const setAspectRatioValue = (newValue) => {
const tempValue = setImmutably(
value,
["dimensions", "aspectRatio"],
newValue
);
onChange(
setImmutably(tempValue, ["dimensions", "minHeight"], void 0)
);
};
const hasAspectRatioValue = () => !!value?.dimensions?.aspectRatio;
const showChildLayoutControl = useHasChildLayout(settings);
const childLayout = inheritedValue?.layout;
const setChildLayout = (newChildLayout) => {
onChange({
...value,
layout: {
...newChildLayout
}
});
};
const resetAllFilter = (0,external_wp_element_namespaceObject.useCallback)((previousValue) => {
return {
...previousValue,
layout: utils_cleanEmptyObject({
...previousValue?.layout,
contentSize: void 0,
wideSize: void 0,
selfStretch: void 0,
flexSize: void 0,
columnStart: void 0,
rowStart: void 0,
columnSpan: void 0,
rowSpan: void 0
}),
spacing: {
...previousValue?.spacing,
padding: void 0,
margin: void 0,
blockGap: void 0
},
dimensions: {
...previousValue?.dimensions,
minHeight: void 0,
aspectRatio: void 0
}
};
}, []);
const onMouseLeaveControls = () => onVisualize(false);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
Wrapper,
{
resetAllFilter,
value,
onChange,
panelId,
children: [
(showContentSizeControl || showWideSizeControl) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "span-columns", children: (0,external_wp_i18n_namespaceObject.__)("Set the width of the main content area.") }),
showContentSizeControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Content width"),
hasValue: hasUserSetContentSizeValue,
onDeselect: resetContentSizeValue,
isShownByDefault: defaultControls.contentSize ?? dimensions_panel_DEFAULT_CONTROLS.contentSize,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Content width"),
labelPosition: "top",
value: contentSizeValue || "",
onChange: (nextContentSize) => {
setContentSizeValue(nextContentSize);
},
units,
prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: align_none_default }) })
}
)
}
),
showWideSizeControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Wide width"),
hasValue: hasUserSetWideSizeValue,
onDeselect: resetWideSizeValue,
isShownByDefault: defaultControls.wideSize ?? dimensions_panel_DEFAULT_CONTROLS.wideSize,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Wide width"),
labelPosition: "top",
value: wideSizeValue || "",
onChange: (nextWideSize) => {
setWideSizeValue(nextWideSize);
},
units,
prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: stretch_wide_default }) })
}
)
}
),
showPaddingControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: hasPaddingValue,
label: (0,external_wp_i18n_namespaceObject.__)("Padding"),
onDeselect: resetPaddingValue,
isShownByDefault: defaultControls.padding ?? dimensions_panel_DEFAULT_CONTROLS.padding,
className: dist_clsx({
"tools-panel-item-spacing": showSpacingPresetsControl
}),
panelId,
children: [
!showSpacingPresetsControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.BoxControl,
{
__next40pxDefaultSize: true,
values: paddingValues,
onChange: setPaddingValues,
label: (0,external_wp_i18n_namespaceObject.__)("Padding"),
sides: paddingSides,
units,
allowReset: false,
splitOnAxis: isAxialPadding,
inputProps: {
onMouseOver: onMouseOverPadding,
onMouseOut: onMouseLeaveControls
}
}
),
showSpacingPresetsControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SpacingSizesControl,
{
values: paddingValues,
onChange: setPaddingValues,
label: (0,external_wp_i18n_namespaceObject.__)("Padding"),
sides: paddingSides,
units,
allowReset: false,
onMouseOver: onMouseOverPadding,
onMouseOut: onMouseLeaveControls
}
)
]
}
),
showMarginControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: hasMarginValue,
label: (0,external_wp_i18n_namespaceObject.__)("Margin"),
onDeselect: resetMarginValue,
isShownByDefault: defaultControls.margin ?? dimensions_panel_DEFAULT_CONTROLS.margin,
className: dist_clsx({
"tools-panel-item-spacing": showSpacingPresetsControl
}),
panelId,
children: [
!showSpacingPresetsControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.BoxControl,
{
__next40pxDefaultSize: true,
values: marginValues,
onChange: setMarginValues,
inputProps: {
min: minMarginValue,
onDragStart: () => {
setMinMarginValue(0);
},
onDragEnd: () => {
setMinMarginValue(minimumMargin);
},
onMouseOver: onMouseOverMargin,
onMouseOut: onMouseLeaveControls
},
label: (0,external_wp_i18n_namespaceObject.__)("Margin"),
sides: marginSides,
units,
allowReset: false,
splitOnAxis: isAxialMargin
}
),
showSpacingPresetsControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SpacingSizesControl,
{
values: marginValues,
onChange: setMarginValues,
minimumCustomValue: -Infinity,
label: (0,external_wp_i18n_namespaceObject.__)("Margin"),
sides: marginSides,
units,
allowReset: false,
onMouseOver: onMouseOverMargin,
onMouseOut: onMouseLeaveControls
}
)
]
}
),
showGapControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: hasGapValue,
label: (0,external_wp_i18n_namespaceObject.__)("Block spacing"),
onDeselect: resetGapValue,
isShownByDefault: defaultControls.blockGap ?? dimensions_panel_DEFAULT_CONTROLS.blockGap,
className: dist_clsx({
"tools-panel-item-spacing": showSpacingPresetsControl,
"single-column": (
// If UnitControl is used, should be single-column.
!showSpacingPresetsControl && !isAxialGap
)
}),
panelId,
children: [
!showSpacingPresetsControl && (isAxialGap ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.BoxControl,
{
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Block spacing"),
min: 0,
onChange: setGapValues,
units,
sides: gapSides,
values: gapValues,
allowReset: false,
splitOnAxis: isAxialGap
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Block spacing"),
min: 0,
onChange: setGapValue,
units,
value: gapValue
}
)),
showSpacingPresetsControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SpacingSizesControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Block spacing"),
min: 0,
onChange: setGapValues,
showSideInLabel: false,
sides: isAxialGap ? gapSides : ["top"],
values: gapValues,
allowReset: false
}
)
]
}
),
showChildLayoutControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ChildLayoutControl,
{
value: childLayout,
onChange: setChildLayout,
parentLayout: settings?.parentLayout,
panelId,
isShownByDefault: defaultControls.childLayout ?? dimensions_panel_DEFAULT_CONTROLS.childLayout
}
),
showMinHeightControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: hasMinHeightValue,
label: (0,external_wp_i18n_namespaceObject.__)("Minimum height"),
onDeselect: resetMinHeightValue,
isShownByDefault: defaultControls.minHeight ?? dimensions_panel_DEFAULT_CONTROLS.minHeight,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
HeightControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Minimum height"),
value: minHeightValue,
onChange: setMinHeightValue
}
)
}
),
showAspectRatioControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
AspectRatioTool,
{
hasValue: hasAspectRatioValue,
value: aspectRatioValue,
onChange: setAspectRatioValue,
panelId,
isShownByDefault: defaultControls.aspectRatio ?? dimensions_panel_DEFAULT_CONTROLS.aspectRatio
}
)
]
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-popover/use-popover-scroll.js
const scrollContainerCache = /* @__PURE__ */ new WeakMap();
function usePopoverScroll(contentRef) {
const effect = (0,external_wp_compose_namespaceObject.useRefEffect)(
(node) => {
function onWheel(event) {
const { deltaX, deltaY, target } = event;
const contentEl = contentRef.current;
let scrollContainer = scrollContainerCache.get(contentEl);
if (!scrollContainer) {
scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(contentEl);
scrollContainerCache.set(contentEl, scrollContainer);
}
const eventScrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(target);
if (!node.contains(eventScrollContainer)) {
scrollContainer.scrollBy(deltaX, deltaY);
}
}
const options = { passive: true };
node.addEventListener("wheel", onWheel, options);
return () => {
node.removeEventListener("wheel", onWheel, options);
};
},
[contentRef]
);
return contentRef ? effect : null;
}
var use_popover_scroll_default = usePopoverScroll;
;// ./node_modules/@wordpress/block-editor/build-module/utils/dom.js
const BLOCK_SELECTOR = ".block-editor-block-list__block";
const APPENDER_SELECTOR = ".block-list-appender";
const BLOCK_APPENDER_CLASS = ".block-editor-button-block-appender";
function isInSameBlock(a, b) {
return a.closest(BLOCK_SELECTOR) === b.closest(BLOCK_SELECTOR);
}
function isInsideRootBlock(blockElement, element) {
const parentBlock = element.closest(
[BLOCK_SELECTOR, APPENDER_SELECTOR, BLOCK_APPENDER_CLASS].join(",")
);
return parentBlock === blockElement;
}
function getBlockClientId(node) {
while (node && node.nodeType !== node.ELEMENT_NODE) {
node = node.parentNode;
}
if (!node) {
return;
}
const elementNode = (
/** @type {Element} */
node
);
const blockNode = elementNode.closest(BLOCK_SELECTOR);
if (!blockNode) {
return;
}
return blockNode.id.slice("block-".length);
}
function rectUnion(rect1, rect2) {
const left = Math.min(rect1.left, rect2.left);
const right = Math.max(rect1.right, rect2.right);
const bottom = Math.max(rect1.bottom, rect2.bottom);
const top = Math.min(rect1.top, rect2.top);
return new window.DOMRectReadOnly(left, top, right - left, bottom - top);
}
function isElementVisible(element) {
const viewport = element.ownerDocument.defaultView;
if (!viewport) {
return false;
}
if (element.classList.contains("components-visually-hidden")) {
return false;
}
const bounds = element.getBoundingClientRect();
if (bounds.width === 0 || bounds.height === 0) {
return false;
}
if (element.checkVisibility) {
return element.checkVisibility?.({
opacityProperty: true,
contentVisibilityAuto: true,
visibilityProperty: true
});
}
const style = viewport.getComputedStyle(element);
if (style.display === "none" || style.visibility === "hidden" || style.opacity === "0") {
return false;
}
return true;
}
function isScrollable(element) {
const style = window.getComputedStyle(element);
return style.overflowX === "auto" || style.overflowX === "scroll" || style.overflowY === "auto" || style.overflowY === "scroll";
}
const WITH_OVERFLOW_ELEMENT_BLOCKS = ["core/navigation"];
function getElementBounds(element) {
const viewport = element.ownerDocument.defaultView;
if (!viewport) {
return new window.DOMRectReadOnly();
}
let bounds = element.getBoundingClientRect();
const dataType = element.getAttribute("data-type");
if (dataType && WITH_OVERFLOW_ELEMENT_BLOCKS.includes(dataType)) {
const stack = [element];
let currentElement;
while (currentElement = stack.pop()) {
if (!isScrollable(currentElement)) {
for (const child of currentElement.children) {
if (isElementVisible(child)) {
const childBounds = child.getBoundingClientRect();
bounds = rectUnion(bounds, childBounds);
stack.push(child);
}
}
}
}
}
const left = Math.max(bounds.left, 0);
const right = Math.min(bounds.right, viewport.innerWidth);
bounds = new window.DOMRectReadOnly(
left,
bounds.top,
right - left,
bounds.height
);
return bounds;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-popover/index.js
const MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;
function BlockPopover({
clientId,
bottomClientId,
children,
__unstablePopoverSlot,
__unstableContentRef,
shift = true,
...props
}, ref) {
const selectedElement = useBlockElement(clientId);
const lastSelectedElement = useBlockElement(bottomClientId ?? clientId);
const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([
ref,
use_popover_scroll_default(__unstableContentRef)
]);
const [
popoverDimensionsRecomputeCounter,
forceRecomputePopoverDimensions
] = (0,external_wp_element_namespaceObject.useReducer)(
// Module is there to make sure that the counter doesn't overflow.
(s) => (s + 1) % MAX_POPOVER_RECOMPUTE_COUNTER,
0
);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (!selectedElement) {
return;
}
const observer = new window.MutationObserver(
forceRecomputePopoverDimensions
);
observer.observe(selectedElement, { attributes: true });
return () => {
observer.disconnect();
};
}, [selectedElement]);
const popoverAnchor = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (
// popoverDimensionsRecomputeCounter is by definition always equal or greater
// than 0. This check is only there to satisfy the correctness of the
// exhaustive-deps rule for the `useMemo` hook.
popoverDimensionsRecomputeCounter < 0 || !selectedElement || bottomClientId && !lastSelectedElement
) {
return void 0;
}
return {
getBoundingClientRect() {
return lastSelectedElement ? rectUnion(
getElementBounds(selectedElement),
getElementBounds(lastSelectedElement)
) : getElementBounds(selectedElement);
},
contextElement: selectedElement
};
}, [
popoverDimensionsRecomputeCounter,
selectedElement,
bottomClientId,
lastSelectedElement
]);
if (!selectedElement || bottomClientId && !lastSelectedElement) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Popover,
{
ref: mergedRefs,
animate: false,
focusOnMount: false,
anchor: popoverAnchor,
__unstableSlotName: __unstablePopoverSlot,
inline: !__unstablePopoverSlot,
placement: "top-start",
resize: false,
flip: false,
shift,
...props,
className: dist_clsx("block-editor-block-popover", props.className),
variant: "unstyled",
children
}
);
}
const PrivateBlockPopover = (0,external_wp_element_namespaceObject.forwardRef)(BlockPopover);
const PublicBlockPopover = ({ clientId, bottomClientId, children, ...props }, ref) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PrivateBlockPopover,
{
...props,
bottomClientId,
clientId,
__unstableContentRef: void 0,
__unstablePopoverSlot: void 0,
ref,
children
}
);
var block_popover_default = (0,external_wp_element_namespaceObject.forwardRef)(PublicBlockPopover);
;// ./node_modules/@wordpress/block-editor/build-module/components/block-popover/cover.js
function BlockPopoverCover({
clientId,
bottomClientId,
children,
shift = false,
additionalStyles,
...props
}, ref) {
bottomClientId ??= clientId;
const selectedElement = useBlockElement(clientId);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PrivateBlockPopover,
{
ref,
clientId,
bottomClientId,
shift,
...props,
children: selectedElement && clientId === bottomClientId ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CoverContainer,
{
selectedElement,
additionalStyles,
children
}
) : children
}
);
}
function CoverContainer({
selectedElement,
additionalStyles = {},
children
}) {
const [width, setWidth] = (0,external_wp_element_namespaceObject.useState)(selectedElement.offsetWidth);
const [height, setHeight] = (0,external_wp_element_namespaceObject.useState)(selectedElement.offsetHeight);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const observer = new window.ResizeObserver(() => {
setWidth(selectedElement.offsetWidth);
setHeight(selectedElement.offsetHeight);
});
observer.observe(selectedElement, { box: "border-box" });
return () => observer.disconnect();
}, [selectedElement]);
const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
return {
position: "absolute",
width,
height,
...additionalStyles
};
}, [width, height, additionalStyles]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { style, children });
}
var cover_default = (0,external_wp_element_namespaceObject.forwardRef)(BlockPopoverCover);
;// ./node_modules/@wordpress/block-editor/build-module/hooks/spacing-visualizer.js
function SpacingVisualizer({ clientId, value, computeStyle, forceShow }) {
const blockElement = useBlockElement(clientId);
const [style, updateStyle] = (0,external_wp_element_namespaceObject.useReducer)(
() => computeStyle(blockElement)
);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!blockElement) {
return;
}
const observer = new window.MutationObserver(updateStyle);
observer.observe(blockElement, {
attributes: true,
attributeFilter: ["style", "class"]
});
return () => {
observer.disconnect();
};
}, [blockElement]);
const previousValueRef = (0,external_wp_element_namespaceObject.useRef)(value);
const [isActive, setIsActive] = (0,external_wp_element_namespaceObject.useState)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (external_wp_isShallowEqual_default()(value, previousValueRef.current) || forceShow) {
return;
}
setIsActive(true);
previousValueRef.current = value;
const timeout = setTimeout(() => {
setIsActive(false);
}, 400);
return () => {
setIsActive(false);
clearTimeout(timeout);
};
}, [value, forceShow]);
if (!isActive && !forceShow) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
cover_default,
{
clientId,
__unstablePopoverSlot: "block-toolbar",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor__spacing-visualizer", style })
}
);
}
function getComputedCSS(element, property) {
return element.ownerDocument.defaultView.getComputedStyle(element).getPropertyValue(property);
}
function MarginVisualizer({ clientId, value, forceShow }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SpacingVisualizer,
{
clientId,
value: value?.spacing?.margin,
computeStyle: (blockElement) => {
const top = getComputedCSS(blockElement, "margin-top");
const right = getComputedCSS(blockElement, "margin-right");
const bottom = getComputedCSS(blockElement, "margin-bottom");
const left = getComputedCSS(blockElement, "margin-left");
return {
borderTopWidth: top,
borderRightWidth: right,
borderBottomWidth: bottom,
borderLeftWidth: left,
top: top ? `-${top}` : 0,
right: right ? `-${right}` : 0,
bottom: bottom ? `-${bottom}` : 0,
left: left ? `-${left}` : 0
};
},
forceShow
}
);
}
function PaddingVisualizer({ clientId, value, forceShow }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SpacingVisualizer,
{
clientId,
value: value?.spacing?.padding,
computeStyle: (blockElement) => ({
borderTopWidth: getComputedCSS(blockElement, "padding-top"),
borderRightWidth: getComputedCSS(
blockElement,
"padding-right"
),
borderBottomWidth: getComputedCSS(
blockElement,
"padding-bottom"
),
borderLeftWidth: getComputedCSS(blockElement, "padding-left")
}),
forceShow
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/dimensions.js
const DIMENSIONS_SUPPORT_KEY = "dimensions";
const SPACING_SUPPORT_KEY = "spacing";
const dimensions_ALL_SIDES = (/* unused pure expression or super */ null && (["top", "right", "bottom", "left"]));
const dimensions_AXIAL_SIDES = (/* unused pure expression or super */ null && (["vertical", "horizontal"]));
function useVisualizer() {
const [property, setProperty] = (0,external_wp_element_namespaceObject.useState)(false);
const { hideBlockInterface, showBlockInterface } = unlock(
(0,external_wp_data_namespaceObject.useDispatch)(store)
);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!property) {
showBlockInterface();
} else {
hideBlockInterface();
}
}, [property, showBlockInterface, hideBlockInterface]);
return [property, setProperty];
}
function DimensionsInspectorControl({ children, resetAllFilter }) {
const attributesResetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(
(attributes) => {
const existingStyle = attributes.style;
const updatedStyle = resetAllFilter(existingStyle);
return {
...attributes,
style: updatedStyle
};
},
[resetAllFilter]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inspector_controls_default,
{
group: "dimensions",
resetAllFilter: attributesResetAllFilter,
children
}
);
}
function dimensions_DimensionsPanel({ clientId, name, setAttributes, settings }) {
const isEnabled = useHasDimensionsPanel(settings);
const value = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).getBlockAttributes(clientId)?.style,
[clientId]
);
const [visualizedProperty, setVisualizedProperty] = useVisualizer();
const onChange = (newStyle) => {
setAttributes({
style: utils_cleanEmptyObject(newStyle)
});
};
if (!isEnabled) {
return null;
}
const defaultDimensionsControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [
DIMENSIONS_SUPPORT_KEY,
"__experimentalDefaultControls"
]);
const defaultSpacingControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [
SPACING_SUPPORT_KEY,
"__experimentalDefaultControls"
]);
const defaultControls = {
...defaultDimensionsControls,
...defaultSpacingControls
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DimensionsPanel,
{
as: DimensionsInspectorControl,
panelId: clientId,
settings,
value,
onChange,
defaultControls,
onVisualize: setVisualizedProperty
}
),
!!settings?.spacing?.padding && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PaddingVisualizer,
{
forceShow: visualizedProperty === "padding",
clientId,
value
}
),
!!settings?.spacing?.margin && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
MarginVisualizer,
{
forceShow: visualizedProperty === "margin",
clientId,
value
}
)
] });
}
function hasDimensionsSupport(blockName, feature = "any") {
if (external_wp_element_namespaceObject.Platform.OS !== "web") {
return false;
}
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, DIMENSIONS_SUPPORT_KEY);
if (support === true) {
return true;
}
if (feature === "any") {
return !!(support?.aspectRatio || !!support?.minHeight);
}
return !!support?.[feature];
}
var dimensions_default = {
useBlockProps: dimensions_useBlockProps,
attributeKeys: ["minHeight", "style"],
hasSupport(name) {
return hasDimensionsSupport(name, "aspectRatio");
}
};
function dimensions_useBlockProps({ name, minHeight, style }) {
if (!hasDimensionsSupport(name, "aspectRatio") || shouldSkipSerialization(name, DIMENSIONS_SUPPORT_KEY, "aspectRatio")) {
return {};
}
const className = dist_clsx({
"has-aspect-ratio": !!style?.dimensions?.aspectRatio
});
const inlineStyleOverrides = {};
if (style?.dimensions?.aspectRatio) {
inlineStyleOverrides.minHeight = "unset";
} else if (minHeight || style?.dimensions?.minHeight) {
inlineStyleOverrides.aspectRatio = "unset";
}
return { className, style: inlineStyleOverrides };
}
function useCustomSides() {
external_wp_deprecated_default()("wp.blockEditor.__experimentalUseCustomSides", {
since: "6.3",
version: "6.4"
});
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/style.js
const styleSupportKeys = [
...TYPOGRAPHY_SUPPORT_KEYS,
BORDER_SUPPORT_KEY,
COLOR_SUPPORT_KEY,
DIMENSIONS_SUPPORT_KEY,
BACKGROUND_SUPPORT_KEY,
SPACING_SUPPORT_KEY,
SHADOW_SUPPORT_KEY
];
const hasStyleSupport = (nameOrType) => styleSupportKeys.some((key) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, key));
function getInlineStyles(styles = {}) {
const output = {};
(0,external_wp_styleEngine_namespaceObject.getCSSRules)(styles).forEach((rule) => {
output[rule.key] = rule.value;
});
return output;
}
function style_addAttribute(settings) {
if (!hasStyleSupport(settings)) {
return settings;
}
if (!settings.attributes.style) {
Object.assign(settings.attributes, {
style: {
type: "object"
}
});
}
return settings;
}
const skipSerializationPathsEdit = {
[`${BORDER_SUPPORT_KEY}.__experimentalSkipSerialization`]: ["border"],
[`${COLOR_SUPPORT_KEY}.__experimentalSkipSerialization`]: [
COLOR_SUPPORT_KEY
],
[`${TYPOGRAPHY_SUPPORT_KEY}.__experimentalSkipSerialization`]: [
TYPOGRAPHY_SUPPORT_KEY
],
[`${DIMENSIONS_SUPPORT_KEY}.__experimentalSkipSerialization`]: [
DIMENSIONS_SUPPORT_KEY
],
[`${SPACING_SUPPORT_KEY}.__experimentalSkipSerialization`]: [
SPACING_SUPPORT_KEY
],
[`${SHADOW_SUPPORT_KEY}.__experimentalSkipSerialization`]: [
SHADOW_SUPPORT_KEY
]
};
const skipSerializationPathsSave = {
...skipSerializationPathsEdit,
[`${DIMENSIONS_SUPPORT_KEY}.aspectRatio`]: [
`${DIMENSIONS_SUPPORT_KEY}.aspectRatio`
],
// Skip serialization of aspect ratio in save mode.
[`${BACKGROUND_SUPPORT_KEY}`]: [BACKGROUND_SUPPORT_KEY]
// Skip serialization of background support in save mode.
};
const skipSerializationPathsSaveChecks = {
[`${DIMENSIONS_SUPPORT_KEY}.aspectRatio`]: true,
[`${BACKGROUND_SUPPORT_KEY}`]: true
};
const renamedFeatures = { gradients: "gradient" };
function omitStyle(style, paths, preserveReference = false) {
if (!style) {
return style;
}
let newStyle = style;
if (!preserveReference) {
newStyle = JSON.parse(JSON.stringify(style));
}
if (!Array.isArray(paths)) {
paths = [paths];
}
paths.forEach((path) => {
if (!Array.isArray(path)) {
path = path.split(".");
}
if (path.length > 1) {
const [firstSubpath, ...restPath] = path;
omitStyle(newStyle[firstSubpath], [restPath], true);
} else if (path.length === 1) {
delete newStyle[path[0]];
}
});
return newStyle;
}
function style_addSaveProps(props, blockNameOrType, attributes, skipPaths = skipSerializationPathsSave) {
if (!hasStyleSupport(blockNameOrType)) {
return props;
}
let { style } = attributes;
Object.entries(skipPaths).forEach(([indicator, path]) => {
const skipSerialization = skipSerializationPathsSaveChecks[indicator] || (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockNameOrType, indicator);
if (skipSerialization === true) {
style = omitStyle(style, path);
}
if (Array.isArray(skipSerialization)) {
skipSerialization.forEach((featureName) => {
const feature = renamedFeatures[featureName] || featureName;
style = omitStyle(style, [[...path, feature]]);
});
}
});
props.style = {
...getInlineStyles(style),
...props.style
};
return props;
}
function BlockStyleControls({
clientId,
name,
setAttributes,
__unstableParentLayout
}) {
const settings = useBlockSettings(name, __unstableParentLayout);
const blockEditingMode = useBlockEditingMode();
const passedProps = {
clientId,
name,
setAttributes,
settings: {
...settings,
typography: {
...settings.typography,
// The text alignment UI for individual blocks is rendered in
// the block toolbar, so disable it here.
textAlign: false
}
}
};
if (blockEditingMode !== "default") {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorEdit, { ...passedProps }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(background_BackgroundImagePanel, { ...passedProps }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(typography_TypographyPanel, { ...passedProps }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_BorderPanel, { ...passedProps }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dimensions_DimensionsPanel, { ...passedProps })
] });
}
var style_default = {
edit: BlockStyleControls,
hasSupport: hasStyleSupport,
addSaveProps: style_addSaveProps,
attributeKeys: ["style"],
useBlockProps: style_useBlockProps
};
const elementTypes = [
{ elementType: "button" },
{ elementType: "link", pseudo: [":hover"] },
{
elementType: "heading",
elements: ["h1", "h2", "h3", "h4", "h5", "h6"]
}
];
const STYLE_BLOCK_PROPS_REFERENCE = {};
function style_useBlockProps({ name, style }) {
const blockElementsContainerIdentifier = (0,external_wp_compose_namespaceObject.useInstanceId)(
STYLE_BLOCK_PROPS_REFERENCE,
"wp-elements"
);
const baseElementSelector = `.${blockElementsContainerIdentifier}`;
const blockElementStyles = style?.elements;
const styles = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!blockElementStyles) {
return;
}
const elementCSSRules = [];
elementTypes.forEach(({ elementType, pseudo, elements }) => {
const skipSerialization = shouldSkipSerialization(
name,
COLOR_SUPPORT_KEY,
elementType
);
if (skipSerialization) {
return;
}
const elementStyles = blockElementStyles?.[elementType];
if (elementStyles) {
const selector = scopeSelector(
baseElementSelector,
external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[elementType]
);
elementCSSRules.push(
(0,external_wp_styleEngine_namespaceObject.compileCSS)(elementStyles, { selector })
);
if (pseudo) {
pseudo.forEach((pseudoSelector) => {
if (elementStyles[pseudoSelector]) {
elementCSSRules.push(
(0,external_wp_styleEngine_namespaceObject.compileCSS)(elementStyles[pseudoSelector], {
selector: scopeSelector(
baseElementSelector,
`${external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[elementType]}${pseudoSelector}`
)
})
);
}
});
}
}
if (elements) {
elements.forEach((element) => {
if (blockElementStyles[element]) {
elementCSSRules.push(
(0,external_wp_styleEngine_namespaceObject.compileCSS)(blockElementStyles[element], {
selector: scopeSelector(
baseElementSelector,
external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[element]
)
})
);
}
});
}
});
return elementCSSRules.length > 0 ? elementCSSRules.join("") : void 0;
}, [baseElementSelector, blockElementStyles, name]);
useStyleOverride({ css: styles });
return style_addSaveProps(
{ className: blockElementsContainerIdentifier },
name,
{ style },
skipSerializationPathsEdit
);
}
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.registerBlockType",
"core/style/addAttribute",
style_addAttribute
);
;// ./node_modules/@wordpress/block-editor/build-module/hooks/settings.js
const hasSettingsSupport = (blockType) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, "__experimentalSettings", false);
function settings_addAttribute(settings) {
if (!hasSettingsSupport(settings)) {
return settings;
}
if (!settings?.attributes?.settings) {
settings.attributes = {
...settings.attributes,
settings: {
type: "object"
}
};
}
return settings;
}
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.registerBlockType",
"core/settings/addAttribute",
settings_addAttribute
);
;// ./node_modules/@wordpress/icons/build-module/library/filter.js
var filter_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/duotone-control/index.js
function DuotoneControl({
id: idProp,
colorPalette,
duotonePalette,
disableCustomColors,
disableCustomDuotone,
value,
onChange
}) {
let toolbarIcon;
if (value === "unset") {
toolbarIcon = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ColorIndicator, { className: "block-editor-duotone-control__unset-indicator" });
} else if (value) {
toolbarIcon = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DuotoneSwatch, { values: value });
} else {
toolbarIcon = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: filter_default });
}
const actionLabel = (0,external_wp_i18n_namespaceObject.__)("Apply duotone filter");
const id = (0,external_wp_compose_namespaceObject.useInstanceId)(DuotoneControl, "duotone-control", idProp);
const descriptionId = `${id}__description`;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
popoverProps: {
className: "block-editor-duotone-control__popover",
headerTitle: (0,external_wp_i18n_namespaceObject.__)("Duotone")
},
renderToggle: ({ isOpen, onToggle }) => {
const openOnArrowDown = (event) => {
if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) {
event.preventDefault();
onToggle();
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
showTooltip: true,
onClick: onToggle,
"aria-haspopup": "true",
"aria-expanded": isOpen,
onKeyDown: openOnArrowDown,
label: actionLabel,
icon: toolbarIcon
}
);
},
renderContent: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)("Duotone"), children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)(
"Create a two-tone color effect without losing your original image."
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DuotonePicker,
{
"aria-label": actionLabel,
"aria-describedby": descriptionId,
colorPalette,
duotonePalette,
disableCustomColors,
disableCustomDuotone,
value,
onChange
}
)
] })
}
);
}
var duotone_control_default = DuotoneControl;
;// ./node_modules/@wordpress/block-editor/build-module/components/duotone/utils.js
function getValuesFromColors(colors = []) {
const values = { r: [], g: [], b: [], a: [] };
colors.forEach((color) => {
const rgbColor = w(color).toRgb();
values.r.push(rgbColor.r / 255);
values.g.push(rgbColor.g / 255);
values.b.push(rgbColor.b / 255);
values.a.push(rgbColor.a);
});
return values;
}
function getDuotoneUnsetStylesheet(selector) {
return `${selector}{filter:none}`;
}
function getDuotoneStylesheet(selector, id) {
return `${selector}{filter:url(#${id})}`;
}
function getDuotoneFilter(id, colors) {
const values = getValuesFromColors(colors);
return `
<svg
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 0 0"
width="0"
height="0"
focusable="false"
role="none"
aria-hidden="true"
style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"
>
<defs>
<filter id="${id}">
<!--
Use sRGB instead of linearRGB so transparency looks correct.
Use perceptual brightness to convert to grayscale.
-->
<feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "></feColorMatrix>
<!-- Use sRGB instead of linearRGB to be consistent with how CSS gradients work. -->
<feComponentTransfer color-interpolation-filters="sRGB">
<feFuncR type="table" tableValues="${values.r.join(" ")}"></feFuncR>
<feFuncG type="table" tableValues="${values.g.join(" ")}"></feFuncG>
<feFuncB type="table" tableValues="${values.b.join(" ")}"></feFuncB>
<feFuncA type="table" tableValues="${values.a.join(" ")}"></feFuncA>
</feComponentTransfer>
<!-- Re-mask the image with the original transparency since the feColorMatrix above loses that information. -->
<feComposite in2="SourceGraphic" operator="in"></feComposite>
</filter>
</defs>
</svg>`;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/get-block-css-selector.js
function getBlockCSSSelector(blockType, target = "root", options = {}) {
if (!target) {
return null;
}
const { fallback = false } = options;
const { name, selectors, supports } = blockType;
const hasSelectors = selectors && Object.keys(selectors).length > 0;
const path = Array.isArray(target) ? target.join(".") : target;
let rootSelector = null;
if (hasSelectors && selectors.root) {
rootSelector = selectors?.root;
} else if (supports?.__experimentalSelector) {
rootSelector = supports.__experimentalSelector;
} else {
rootSelector = ".wp-block-" + name.replace("core/", "").replace("/", "-");
}
if (path === "root") {
return rootSelector;
}
const pathArray = Array.isArray(target) ? target : target.split(".");
if (pathArray.length === 1) {
const fallbackSelector = fallback ? rootSelector : null;
if (hasSelectors) {
const featureSelector2 = getValueFromObjectPath(selectors, `${path}.root`, null) || getValueFromObjectPath(selectors, path, null);
return featureSelector2 || fallbackSelector;
}
const featureSelector = getValueFromObjectPath(
supports,
`${path}.__experimentalSelector`,
null
);
if (!featureSelector) {
return fallbackSelector;
}
return scopeSelector(rootSelector, featureSelector);
}
let subfeatureSelector;
if (hasSelectors) {
subfeatureSelector = getValueFromObjectPath(selectors, path, null);
}
if (subfeatureSelector) {
return subfeatureSelector;
}
if (fallback) {
return getBlockCSSSelector(blockType, pathArray[0], options);
}
return null;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/filters-panel.js
const filters_panel_EMPTY_ARRAY = [];
function useMultiOriginColorPresets(settings, { presetSetting, defaultSetting }) {
const disableDefault = !settings?.color?.[defaultSetting];
const userPresets = settings?.color?.[presetSetting]?.custom || filters_panel_EMPTY_ARRAY;
const themePresets = settings?.color?.[presetSetting]?.theme || filters_panel_EMPTY_ARRAY;
const defaultPresets = settings?.color?.[presetSetting]?.default || filters_panel_EMPTY_ARRAY;
return (0,external_wp_element_namespaceObject.useMemo)(
() => [
...userPresets,
...themePresets,
...disableDefault ? filters_panel_EMPTY_ARRAY : defaultPresets
],
[disableDefault, userPresets, themePresets, defaultPresets]
);
}
function useHasFiltersPanel(settings) {
return useHasDuotoneControl(settings);
}
function useHasDuotoneControl(settings) {
return settings.color.customDuotone || settings.color.defaultDuotone || settings.color.duotone.length > 0;
}
function FiltersToolsPanel({
resetAllFilter,
onChange,
value,
panelId,
children
}) {
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const resetAll = () => {
const updatedValue = resetAllFilter(value);
onChange(updatedValue);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject._x)("Filters", "Name for applying graphical effects"),
resetAll,
panelId,
dropdownMenuProps,
children
}
);
}
const filters_panel_DEFAULT_CONTROLS = {
duotone: true
};
const filters_panel_popoverProps = {
placement: "left-start",
offset: 36,
shift: true,
className: "block-editor-duotone-control__popover",
headerTitle: (0,external_wp_i18n_namespaceObject.__)("Duotone")
};
const LabeledColorIndicator = ({ indicator, label }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalZStack, { isLayered: false, offset: -8, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { expanded: false, children: indicator === "unset" || !indicator ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ColorIndicator, { className: "block-editor-duotone-control__unset-indicator" }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DuotoneSwatch, { values: indicator }) }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { title: label, children: label })
] });
const renderToggle = (duotone, resetDuotone) => ({ onToggle, isOpen }) => {
const duotoneButtonRef = (0,external_wp_element_namespaceObject.useRef)(void 0);
const toggleProps = {
onClick: onToggle,
className: dist_clsx(
"block-editor-global-styles-filters-panel__dropdown-toggle",
{ "is-open": isOpen }
),
"aria-expanded": isOpen,
ref: duotoneButtonRef
};
const removeButtonProps = {
onClick: () => {
if (isOpen) {
onToggle();
}
resetDuotone();
duotoneButtonRef.current?.focus();
},
className: "block-editor-panel-duotone-settings__reset",
label: (0,external_wp_i18n_namespaceObject.__)("Reset")
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, ...toggleProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
LabeledColorIndicator,
{
indicator: duotone,
label: (0,external_wp_i18n_namespaceObject.__)("Duotone")
}
) }),
duotone && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "small",
icon: reset_default,
...removeButtonProps
}
)
] });
};
function FiltersPanel({
as: Wrapper = FiltersToolsPanel,
value,
onChange,
inheritedValue = value,
settings,
panelId,
defaultControls = filters_panel_DEFAULT_CONTROLS
}) {
const decodeValue = (rawValue) => getValueFromVariable({ settings }, "", rawValue);
const hasDuotoneEnabled = useHasDuotoneControl(settings);
const duotonePalette = useMultiOriginColorPresets(settings, {
presetSetting: "duotone",
defaultSetting: "defaultDuotone"
});
const colorPalette = useMultiOriginColorPresets(settings, {
presetSetting: "palette",
defaultSetting: "defaultPalette"
});
const duotone = decodeValue(inheritedValue?.filter?.duotone);
const setDuotone = (newValue) => {
const duotonePreset = duotonePalette.find(({ colors }) => {
return colors === newValue;
});
const duotoneValue = duotonePreset ? `var:preset|duotone|${duotonePreset.slug}` : newValue;
onChange(
setImmutably(value, ["filter", "duotone"], duotoneValue)
);
};
const hasDuotone = () => !!value?.filter?.duotone;
const resetDuotone = () => setDuotone(void 0);
const resetAllFilter = (0,external_wp_element_namespaceObject.useCallback)((previousValue) => {
return {
...previousValue,
filter: {
...previousValue.filter,
duotone: void 0
}
};
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Wrapper,
{
resetAllFilter,
value,
onChange,
panelId,
children: hasDuotoneEnabled && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Duotone"),
hasValue: hasDuotone,
onDeselect: resetDuotone,
isShownByDefault: defaultControls.duotone,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
popoverProps: filters_panel_popoverProps,
className: "block-editor-global-styles-filters-panel__dropdown",
renderToggle: renderToggle(duotone, resetDuotone),
renderContent: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, { paddingSize: "small", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)("Duotone"), children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)(
"Create a two-tone color effect without losing your original image."
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DuotonePicker,
{
colorPalette,
duotonePalette,
disableCustomColors: true,
disableCustomDuotone: true,
value: duotone,
onChange: setDuotone
}
)
] }) })
}
)
}
)
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/duotone.js
const duotone_EMPTY_ARRAY = [];
const isSafari = window?.navigator.userAgent && window.navigator.userAgent.includes("Safari") && !window.navigator.userAgent.includes("Chrome") && !window.navigator.userAgent.includes("Chromium");
k([names]);
function useMultiOriginPresets({ presetSetting, defaultSetting }) {
const [enableDefault, userPresets, themePresets, defaultPresets] = use_settings_useSettings(
defaultSetting,
`${presetSetting}.custom`,
`${presetSetting}.theme`,
`${presetSetting}.default`
);
return (0,external_wp_element_namespaceObject.useMemo)(
() => [
...userPresets || duotone_EMPTY_ARRAY,
...themePresets || duotone_EMPTY_ARRAY,
...enableDefault && defaultPresets || duotone_EMPTY_ARRAY
],
[enableDefault, userPresets, themePresets, defaultPresets]
);
}
function getColorsFromDuotonePreset(duotone, duotonePalette) {
if (!duotone) {
return;
}
const preset = duotonePalette?.find(({ slug }) => {
return duotone === `var:preset|duotone|${slug}`;
});
return preset ? preset.colors : void 0;
}
function getDuotonePresetFromColors(colors, duotonePalette) {
if (!colors || !Array.isArray(colors)) {
return;
}
const preset = duotonePalette?.find((duotonePreset) => {
return duotonePreset?.colors?.every(
(val, index) => val === colors[index]
);
});
return preset ? `var:preset|duotone|${preset.slug}` : void 0;
}
function DuotonePanelPure({ style, setAttributes, name }) {
const duotoneStyle = style?.color?.duotone;
const settings = useBlockSettings(name);
const blockEditingMode = useBlockEditingMode();
const duotonePalette = useMultiOriginPresets({
presetSetting: "color.duotone",
defaultSetting: "color.defaultDuotone"
});
const colorPalette = useMultiOriginPresets({
presetSetting: "color.palette",
defaultSetting: "color.defaultPalette"
});
const [enableCustomColors, enableCustomDuotone] = use_settings_useSettings(
"color.custom",
"color.customDuotone"
);
const disableCustomColors = !enableCustomColors;
const disableCustomDuotone = !enableCustomDuotone || colorPalette?.length === 0 && disableCustomColors;
if (duotonePalette?.length === 0 && disableCustomDuotone) {
return null;
}
if (blockEditingMode !== "default") {
return null;
}
const duotonePresetOrColors = duotoneStyle === "unset" || Array.isArray(duotoneStyle) ? duotoneStyle : getColorsFromDuotonePreset(duotoneStyle, duotonePalette);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default, { group: "filter", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FiltersPanel,
{
value: { filter: { duotone: duotonePresetOrColors } },
onChange: (newDuotone) => {
const newStyle = {
...style,
color: {
...newDuotone?.filter
}
};
setAttributes({
style: utils_cleanEmptyObject(newStyle)
});
},
settings
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls_default, { group: "block", __experimentalShareWithChildBlocks: true, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
duotone_control_default,
{
duotonePalette,
colorPalette,
disableCustomDuotone,
disableCustomColors,
value: duotonePresetOrColors,
onChange: (newDuotone) => {
const maybePreset = getDuotonePresetFromColors(
newDuotone,
duotonePalette
);
const newStyle = {
...style,
color: {
...style?.color,
duotone: maybePreset ?? newDuotone
// use preset or fallback to custom colors.
}
};
setAttributes({
style: utils_cleanEmptyObject(newStyle)
});
},
settings
}
) })
] });
}
var duotone_default = {
shareWithChildBlocks: true,
edit: DuotonePanelPure,
useBlockProps: duotone_useBlockProps,
attributeKeys: ["style"],
hasSupport(name) {
return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, "filter.duotone");
}
};
function addDuotoneAttributes(settings) {
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, "filter.duotone")) {
return settings;
}
if (!settings.attributes.style) {
Object.assign(settings.attributes, {
style: {
type: "object"
}
});
}
return settings;
}
function useDuotoneStyles({
clientId,
id: filterId,
selector: duotoneSelector,
attribute: duotoneAttr
}) {
const duotonePalette = useMultiOriginPresets({
presetSetting: "color.duotone",
defaultSetting: "color.defaultDuotone"
});
const isCustom = Array.isArray(duotoneAttr);
const duotonePreset = isCustom ? void 0 : getColorsFromDuotonePreset(duotoneAttr, duotonePalette);
const isPreset = typeof duotoneAttr === "string" && duotonePreset;
const isCSS = typeof duotoneAttr === "string" && !isPreset;
let colors = null;
if (isPreset) {
colors = duotonePreset;
} else if (isCSS) {
colors = duotoneAttr;
} else if (isCustom) {
colors = duotoneAttr;
}
const selectors = duotoneSelector.split(",");
const selectorsScoped = selectors.map((selectorPart) => {
return `.${filterId}${selectorPart.trim()}`;
});
const selector = selectorsScoped.join(", ");
const isValidFilter = Array.isArray(colors) || colors === "unset";
usePrivateStyleOverride(
isValidFilter ? {
css: colors !== "unset" ? getDuotoneStylesheet(selector, filterId) : getDuotoneUnsetStylesheet(selector),
__unstableType: "presets"
} : void 0
);
usePrivateStyleOverride(
isValidFilter ? {
assets: colors !== "unset" ? getDuotoneFilter(filterId, colors) : "",
__unstableType: "svgs"
} : void 0
);
const blockElement = useBlockElement(clientId);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isValidFilter) {
return;
}
if (blockElement && isSafari) {
const display = blockElement.style.display;
blockElement.style.setProperty("display", "inline-block");
blockElement.offsetHeight;
blockElement.style.setProperty("display", display);
}
}, [isValidFilter, blockElement, colors]);
}
const DUOTONE_BLOCK_PROPS_REFERENCE = {};
function duotone_useBlockProps({ clientId, name, style }) {
const id = (0,external_wp_compose_namespaceObject.useInstanceId)(DUOTONE_BLOCK_PROPS_REFERENCE);
const selector = (0,external_wp_element_namespaceObject.useMemo)(() => {
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name);
if (blockType) {
const duotoneSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(
blockType,
"filter.duotone",
false
);
if (!duotoneSupport) {
return null;
}
const experimentalDuotone = (0,external_wp_blocks_namespaceObject.getBlockSupport)(
blockType,
"color.__experimentalDuotone",
false
);
if (experimentalDuotone) {
const rootSelector = getBlockCSSSelector(blockType);
return typeof experimentalDuotone === "string" ? scopeSelector(rootSelector, experimentalDuotone) : rootSelector;
}
return getBlockCSSSelector(blockType, "filter.duotone", {
fallback: true
});
}
}, [name]);
const attribute = style?.color?.duotone;
const filterClass = `wp-duotone-${id}`;
const shouldRender = selector && attribute;
useDuotoneStyles({
clientId,
id: filterClass,
selector,
attribute
});
return {
className: shouldRender ? filterClass : ""
};
}
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.registerBlockType",
"core/editor/duotone/add-attributes",
addDuotoneAttributes
);
;// ./node_modules/@wordpress/block-editor/build-module/components/use-block-display-information/index.js
function getPositionTypeLabel(attributes) {
const positionType = attributes?.style?.position?.type;
if (positionType === "sticky") {
return (0,external_wp_i18n_namespaceObject.__)("Sticky");
}
if (positionType === "fixed") {
return (0,external_wp_i18n_namespaceObject.__)("Fixed");
}
return null;
}
function useBlockDisplayInformation(clientId) {
return (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
if (!clientId) {
return null;
}
const { getBlockName, getBlockAttributes } = select(store);
const { getBlockType, getActiveBlockVariation } = select(external_wp_blocks_namespaceObject.store);
const blockName = getBlockName(clientId);
const blockType = getBlockType(blockName);
if (!blockType) {
return null;
}
const attributes = getBlockAttributes(clientId);
const match = getActiveBlockVariation(blockName, attributes);
const isSynced = (0,external_wp_blocks_namespaceObject.isReusableBlock)(blockType) || (0,external_wp_blocks_namespaceObject.isTemplatePart)(blockType);
const syncedTitle = isSynced ? (0,external_wp_blocks_namespaceObject.__experimentalGetBlockLabel)(blockType, attributes) : void 0;
const title = syncedTitle || blockType.title;
const positionLabel = getPositionTypeLabel(attributes);
const blockTypeInfo = {
isSynced,
title,
icon: blockType.icon,
description: blockType.description,
anchor: attributes?.anchor,
positionLabel,
positionType: attributes?.style?.position?.type,
name: attributes?.metadata?.name
};
if (!match) {
return blockTypeInfo;
}
return {
isSynced,
title: match.title || blockType.title,
icon: match.icon || blockType.icon,
description: match.description || blockType.description,
anchor: attributes?.anchor,
positionLabel,
positionType: attributes?.style?.position?.type,
name: attributes?.metadata?.name
};
},
[clientId]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/position.js
const POSITION_SUPPORT_KEY = "position";
const DEFAULT_OPTION = {
key: "default",
value: "",
name: (0,external_wp_i18n_namespaceObject.__)("Default")
};
const STICKY_OPTION = {
key: "sticky",
value: "sticky",
name: (0,external_wp_i18n_namespaceObject._x)("Sticky", "Name for the value of the CSS position property"),
hint: (0,external_wp_i18n_namespaceObject.__)(
"The block will stick to the top of the window instead of scrolling."
)
};
const FIXED_OPTION = {
key: "fixed",
value: "fixed",
name: (0,external_wp_i18n_namespaceObject._x)("Fixed", "Name for the value of the CSS position property"),
hint: (0,external_wp_i18n_namespaceObject.__)("The block will not move when the page is scrolled.")
};
const POSITION_SIDES = ["top", "right", "bottom", "left"];
const VALID_POSITION_TYPES = ["sticky", "fixed"];
function getPositionCSS({ selector, style }) {
let output = "";
const { type: positionType } = style?.position || {};
if (!VALID_POSITION_TYPES.includes(positionType)) {
return output;
}
output += `${selector} {`;
output += `position: ${positionType};`;
POSITION_SIDES.forEach((side) => {
if (style?.position?.[side] !== void 0) {
output += `${side}: ${style.position[side]};`;
}
});
if (positionType === "sticky" || positionType === "fixed") {
output += `z-index: 10`;
}
output += `}`;
return output;
}
function hasStickyPositionSupport(blockType) {
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, POSITION_SUPPORT_KEY);
return !!(true === support || support?.sticky);
}
function hasFixedPositionSupport(blockType) {
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, POSITION_SUPPORT_KEY);
return !!(true === support || support?.fixed);
}
function hasPositionSupport(blockType) {
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, POSITION_SUPPORT_KEY);
return !!support;
}
function hasPositionValue(props) {
return props.attributes.style?.position?.type !== void 0;
}
function hasStickyOrFixedPositionValue(attributes) {
const positionType = attributes?.style?.position?.type;
return positionType === "sticky" || positionType === "fixed";
}
function resetPosition({ attributes = {}, setAttributes }) {
const { style = {} } = attributes;
setAttributes({
style: cleanEmptyObject({
...style,
position: {
...style?.position,
type: void 0,
top: void 0,
right: void 0,
bottom: void 0,
left: void 0
}
})
});
}
function useIsPositionDisabled({ name: blockName } = {}) {
const [allowFixed, allowSticky] = use_settings_useSettings(
"position.fixed",
"position.sticky"
);
const isDisabled = !allowFixed && !allowSticky;
return !hasPositionSupport(blockName) || isDisabled;
}
function PositionPanelPure({
style = {},
clientId,
name: blockName,
setAttributes
}) {
const allowFixed = hasFixedPositionSupport(blockName);
const allowSticky = hasStickyPositionSupport(blockName);
const value = style?.position?.type;
const { firstParentClientId } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockParents } = select(store);
const parents = getBlockParents(clientId);
return { firstParentClientId: parents[parents.length - 1] };
},
[clientId]
);
const blockInformation = useBlockDisplayInformation(firstParentClientId);
const stickyHelpText = allowSticky && value === STICKY_OPTION.value && blockInformation ? (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: the name of the parent block. */
(0,external_wp_i18n_namespaceObject.__)(
"The block will stick to the scrollable area of the parent %s block."
),
blockInformation.title
) : null;
const options = (0,external_wp_element_namespaceObject.useMemo)(() => {
const availableOptions = [DEFAULT_OPTION];
if (allowSticky || value === STICKY_OPTION.value) {
availableOptions.push(STICKY_OPTION);
}
if (allowFixed || value === FIXED_OPTION.value) {
availableOptions.push(FIXED_OPTION);
}
return availableOptions;
}, [allowFixed, allowSticky, value]);
const onChangeType = (next) => {
const placementValue = "0px";
const newStyle = {
...style,
position: {
...style?.position,
type: next,
top: next === "sticky" || next === "fixed" ? placementValue : void 0
}
};
setAttributes({
style: utils_cleanEmptyObject(newStyle)
});
};
const selectedOption = value ? options.find((option) => option.value === value) || DEFAULT_OPTION : DEFAULT_OPTION;
return external_wp_element_namespaceObject.Platform.select({
web: options.length > 1 ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default, { group: "position", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.BaseControl,
{
__nextHasNoMarginBottom: true,
help: stickyHelpText,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CustomSelectControl,
{
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Position"),
hideLabelFromVision: true,
describedBy: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Currently selected position.
(0,external_wp_i18n_namespaceObject.__)("Currently selected position: %s"),
selectedOption.name
),
options,
value: selectedOption,
onChange: ({ selectedItem }) => {
onChangeType(selectedItem.value);
},
size: "__unstable-large"
}
)
}
) }) : null,
native: null
});
}
var position_default = {
edit: function Edit(props) {
const isPositionDisabled = useIsPositionDisabled(props);
if (isPositionDisabled) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PositionPanelPure, { ...props });
},
useBlockProps: position_useBlockProps,
attributeKeys: ["style"],
hasSupport(name) {
return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, POSITION_SUPPORT_KEY);
}
};
const POSITION_BLOCK_PROPS_REFERENCE = {};
function position_useBlockProps({ name, style }) {
const hasPositionBlockSupport = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(
name,
POSITION_SUPPORT_KEY
);
const isPositionDisabled = useIsPositionDisabled({ name });
const allowPositionStyles = hasPositionBlockSupport && !isPositionDisabled;
const id = (0,external_wp_compose_namespaceObject.useInstanceId)(POSITION_BLOCK_PROPS_REFERENCE);
const positionSelector = `.wp-container-${id}.wp-container-${id}`;
let css;
if (allowPositionStyles) {
css = getPositionCSS({
selector: positionSelector,
style
}) || "";
}
const className = dist_clsx({
[`wp-container-${id}`]: allowPositionStyles && !!css,
// Only attach a container class if there is generated CSS to be attached.
[`is-position-${style?.position?.type}`]: allowPositionStyles && !!css && !!style?.position?.type
});
useStyleOverride({ css });
return { className };
}
;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/use-global-styles-output.js
const ELEMENT_CLASS_NAMES = {
button: "wp-element-button",
caption: "wp-element-caption"
};
const BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS = {
__experimentalBorder: "border",
color: "color",
spacing: "spacing",
typography: "typography"
};
const { kebabCase: use_global_styles_output_kebabCase } = unlock(external_wp_components_namespaceObject.privateApis);
function getPresetsDeclarations(blockPresets = {}, mergedSettings) {
return PRESET_METADATA.reduce(
(declarations, { path, valueKey, valueFunc, cssVarInfix }) => {
const presetByOrigin = getValueFromObjectPath(
blockPresets,
path,
[]
);
["default", "theme", "custom"].forEach((origin) => {
if (presetByOrigin[origin]) {
presetByOrigin[origin].forEach((value) => {
if (valueKey && !valueFunc) {
declarations.push(
`--wp--preset--${cssVarInfix}--${use_global_styles_output_kebabCase(
value.slug
)}: ${value[valueKey]}`
);
} else if (valueFunc && typeof valueFunc === "function") {
declarations.push(
`--wp--preset--${cssVarInfix}--${use_global_styles_output_kebabCase(
value.slug
)}: ${valueFunc(value, mergedSettings)}`
);
}
});
}
});
return declarations;
},
[]
);
}
function getPresetsClasses(blockSelector = "*", blockPresets = {}) {
return PRESET_METADATA.reduce(
(declarations, { path, cssVarInfix, classes }) => {
if (!classes) {
return declarations;
}
const presetByOrigin = getValueFromObjectPath(
blockPresets,
path,
[]
);
["default", "theme", "custom"].forEach((origin) => {
if (presetByOrigin[origin]) {
presetByOrigin[origin].forEach(({ slug }) => {
classes.forEach(({ classSuffix, propertyName }) => {
const classSelectorToUse = `.has-${use_global_styles_output_kebabCase(
slug
)}-${classSuffix}`;
const selectorToUse = blockSelector.split(",").map(
(selector) => `${selector}${classSelectorToUse}`
).join(",");
const value = `var(--wp--preset--${cssVarInfix}--${use_global_styles_output_kebabCase(
slug
)})`;
declarations += `${selectorToUse}{${propertyName}: ${value} !important;}`;
});
});
}
});
return declarations;
},
""
);
}
function getPresetsSvgFilters(blockPresets = {}) {
return PRESET_METADATA.filter(
// Duotone are the only type of filters for now.
(metadata) => metadata.path.at(-1) === "duotone"
).flatMap((metadata) => {
const presetByOrigin = getValueFromObjectPath(
blockPresets,
metadata.path,
{}
);
return ["default", "theme"].filter((origin) => presetByOrigin[origin]).flatMap(
(origin) => presetByOrigin[origin].map(
(preset) => getDuotoneFilter(
`wp-duotone-${preset.slug}`,
preset.colors
)
)
).join("");
});
}
function flattenTree(input = {}, prefix, token) {
let result = [];
Object.keys(input).forEach((key) => {
const newKey = prefix + use_global_styles_output_kebabCase(key.replace("/", "-"));
const newLeaf = input[key];
if (newLeaf instanceof Object) {
const newPrefix = newKey + token;
result = [...result, ...flattenTree(newLeaf, newPrefix, token)];
} else {
result.push(`${newKey}: ${newLeaf}`);
}
});
return result;
}
function concatFeatureVariationSelectorString(featureSelector, styleVariationSelector) {
const featureSelectors = featureSelector.split(",");
const combinedSelectors = [];
featureSelectors.forEach((selector) => {
combinedSelectors.push(
`${styleVariationSelector.trim()}${selector.trim()}`
);
});
return combinedSelectors.join(", ");
}
const getFeatureDeclarations = (selectors, styles) => {
const declarations = {};
Object.entries(selectors).forEach(([feature, selector]) => {
if (feature === "root" || !styles?.[feature]) {
return;
}
const isShorthand = typeof selector === "string";
if (!isShorthand) {
Object.entries(selector).forEach(
([subfeature, subfeatureSelector]) => {
if (subfeature === "root" || !styles?.[feature][subfeature]) {
return;
}
const subfeatureStyles = {
[feature]: {
[subfeature]: styles[feature][subfeature]
}
};
const newDeclarations = getStylesDeclarations(subfeatureStyles);
declarations[subfeatureSelector] = [
...declarations[subfeatureSelector] || [],
...newDeclarations
];
delete styles[feature][subfeature];
}
);
}
if (isShorthand || selector.root) {
const featureSelector = isShorthand ? selector : selector.root;
const featureStyles = { [feature]: styles[feature] };
const newDeclarations = getStylesDeclarations(featureStyles);
declarations[featureSelector] = [
...declarations[featureSelector] || [],
...newDeclarations
];
delete styles[feature];
}
});
return declarations;
};
function getStylesDeclarations(blockStyles = {}, selector = "", useRootPaddingAlign, tree = {}, disableRootPadding = false) {
const isRoot = ROOT_BLOCK_SELECTOR === selector;
const output = Object.entries(external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY).reduce(
(declarations, [key, { value, properties, useEngine, rootOnly }]) => {
if (rootOnly && !isRoot) {
return declarations;
}
const pathToValue = value;
if (pathToValue[0] === "elements" || useEngine) {
return declarations;
}
const styleValue = getValueFromObjectPath(
blockStyles,
pathToValue
);
if (key === "--wp--style--root--padding" && (typeof styleValue === "string" || !useRootPaddingAlign)) {
return declarations;
}
if (properties && typeof styleValue !== "string") {
Object.entries(properties).forEach((entry) => {
const [name, prop] = entry;
if (!getValueFromObjectPath(styleValue, [prop], false)) {
return;
}
const cssProperty = name.startsWith("--") ? name : use_global_styles_output_kebabCase(name);
declarations.push(
`${cssProperty}: ${(0,external_wp_styleEngine_namespaceObject.getCSSValueFromRawStyle)(
getValueFromObjectPath(styleValue, [prop])
)}`
);
});
} else if (getValueFromObjectPath(blockStyles, pathToValue, false)) {
const cssProperty = key.startsWith("--") ? key : use_global_styles_output_kebabCase(key);
declarations.push(
`${cssProperty}: ${(0,external_wp_styleEngine_namespaceObject.getCSSValueFromRawStyle)(
getValueFromObjectPath(blockStyles, pathToValue)
)}`
);
}
return declarations;
},
[]
);
if (!!blockStyles.background) {
if (blockStyles.background?.backgroundImage) {
blockStyles.background.backgroundImage = getResolvedValue(
blockStyles.background.backgroundImage,
tree
);
}
if (!isRoot && !!blockStyles.background?.backgroundImage?.id) {
blockStyles = {
...blockStyles,
background: {
...blockStyles.background,
...setBackgroundStyleDefaults(blockStyles.background)
}
};
}
}
const extraRules = (0,external_wp_styleEngine_namespaceObject.getCSSRules)(blockStyles);
extraRules.forEach((rule) => {
if (isRoot && (useRootPaddingAlign || disableRootPadding) && rule.key.startsWith("padding")) {
return;
}
const cssProperty = rule.key.startsWith("--") ? rule.key : use_global_styles_output_kebabCase(rule.key);
let ruleValue = getResolvedValue(rule.value, tree, null);
if (cssProperty === "font-size") {
ruleValue = getTypographyFontSizeValue(
{ size: ruleValue },
tree?.settings
);
}
if (cssProperty === "aspect-ratio") {
output.push("min-height: unset");
}
output.push(`${cssProperty}: ${ruleValue}`);
});
return output;
}
function getLayoutStyles({
layoutDefinitions = LAYOUT_DEFINITIONS,
style,
selector,
hasBlockGapSupport,
hasFallbackGapSupport,
fallbackGapValue
}) {
let ruleset = "";
let gapValue = hasBlockGapSupport ? getGapCSSValue(style?.spacing?.blockGap) : "";
if (hasFallbackGapSupport) {
if (selector === ROOT_BLOCK_SELECTOR) {
gapValue = !gapValue ? "0.5em" : gapValue;
} else if (!hasBlockGapSupport && fallbackGapValue) {
gapValue = fallbackGapValue;
}
}
if (gapValue && layoutDefinitions) {
Object.values(layoutDefinitions).forEach(
({ className, name, spacingStyles }) => {
if (!hasBlockGapSupport && "flex" !== name && "grid" !== name) {
return;
}
if (spacingStyles?.length) {
spacingStyles.forEach((spacingStyle) => {
const declarations = [];
if (spacingStyle.rules) {
Object.entries(spacingStyle.rules).forEach(
([cssProperty, cssValue]) => {
declarations.push(
`${cssProperty}: ${cssValue ? cssValue : gapValue}`
);
}
);
}
if (declarations.length) {
let combinedSelector = "";
if (!hasBlockGapSupport) {
combinedSelector = selector === ROOT_BLOCK_SELECTOR ? `:where(.${className}${spacingStyle?.selector || ""})` : `:where(${selector}.${className}${spacingStyle?.selector || ""})`;
} else {
combinedSelector = selector === ROOT_BLOCK_SELECTOR ? `:root :where(.${className})${spacingStyle?.selector || ""}` : `:root :where(${selector}-${className})${spacingStyle?.selector || ""}`;
}
ruleset += `${combinedSelector} { ${declarations.join(
"; "
)}; }`;
}
});
}
}
);
if (selector === ROOT_BLOCK_SELECTOR && hasBlockGapSupport) {
ruleset += `${ROOT_CSS_PROPERTIES_SELECTOR} { --wp--style--block-gap: ${gapValue}; }`;
}
}
if (selector === ROOT_BLOCK_SELECTOR && layoutDefinitions) {
const validDisplayModes = ["block", "flex", "grid"];
Object.values(layoutDefinitions).forEach(
({ className, displayMode, baseStyles }) => {
if (displayMode && validDisplayModes.includes(displayMode)) {
ruleset += `${selector} .${className} { display:${displayMode}; }`;
}
if (baseStyles?.length) {
baseStyles.forEach((baseStyle) => {
const declarations = [];
if (baseStyle.rules) {
Object.entries(baseStyle.rules).forEach(
([cssProperty, cssValue]) => {
declarations.push(
`${cssProperty}: ${cssValue}`
);
}
);
}
if (declarations.length) {
const combinedSelector = `.${className}${baseStyle?.selector || ""}`;
ruleset += `${combinedSelector} { ${declarations.join(
"; "
)}; }`;
}
});
}
}
);
}
return ruleset;
}
const STYLE_KEYS = [
"border",
"color",
"dimensions",
"spacing",
"typography",
"filter",
"outline",
"shadow",
"background"
];
function pickStyleKeys(treeToPickFrom) {
if (!treeToPickFrom) {
return {};
}
const entries = Object.entries(treeToPickFrom);
const pickedEntries = entries.filter(
([key]) => STYLE_KEYS.includes(key)
);
const clonedEntries = pickedEntries.map(([key, style]) => [
key,
JSON.parse(JSON.stringify(style))
]);
return Object.fromEntries(clonedEntries);
}
const getNodesWithStyles = (tree, blockSelectors) => {
const nodes = [];
if (!tree?.styles) {
return nodes;
}
const styles = pickStyleKeys(tree.styles);
if (styles) {
nodes.push({
styles,
selector: ROOT_BLOCK_SELECTOR,
// Root selector (body) styles should not be wrapped in `:root where()` to keep
// specificity at (0,0,1) and maintain backwards compatibility.
skipSelectorWrapper: true
});
}
Object.entries(external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS).forEach(([name, selector]) => {
if (tree.styles?.elements?.[name]) {
nodes.push({
styles: tree.styles?.elements?.[name],
selector,
// Top level elements that don't use a class name should not receive the
// `:root :where()` wrapper to maintain backwards compatibility.
skipSelectorWrapper: !ELEMENT_CLASS_NAMES[name]
});
}
});
Object.entries(tree.styles?.blocks ?? {}).forEach(
([blockName, node]) => {
const blockStyles = pickStyleKeys(node);
if (node?.variations) {
const variations = {};
Object.entries(node.variations).forEach(
([variationName, variation]) => {
variations[variationName] = pickStyleKeys(variation);
if (variation?.css) {
variations[variationName].css = variation.css;
}
const variationSelector = blockSelectors[blockName]?.styleVariationSelectors?.[variationName];
Object.entries(variation?.elements ?? {}).forEach(
([element, elementStyles]) => {
if (elementStyles && external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[element]) {
nodes.push({
styles: elementStyles,
selector: scopeSelector(
variationSelector,
external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[element]
)
});
}
}
);
Object.entries(variation?.blocks ?? {}).forEach(
([
variationBlockName,
variationBlockStyles
]) => {
const variationBlockSelector = scopeSelector(
variationSelector,
blockSelectors[variationBlockName]?.selector
);
const variationDuotoneSelector = scopeSelector(
variationSelector,
blockSelectors[variationBlockName]?.duotoneSelector
);
const variationFeatureSelectors = scopeFeatureSelectors(
variationSelector,
blockSelectors[variationBlockName]?.featureSelectors
);
const variationBlockStyleNodes = pickStyleKeys(variationBlockStyles);
if (variationBlockStyles?.css) {
variationBlockStyleNodes.css = variationBlockStyles.css;
}
nodes.push({
selector: variationBlockSelector,
duotoneSelector: variationDuotoneSelector,
featureSelectors: variationFeatureSelectors,
fallbackGapValue: blockSelectors[variationBlockName]?.fallbackGapValue,
hasLayoutSupport: blockSelectors[variationBlockName]?.hasLayoutSupport,
styles: variationBlockStyleNodes
});
Object.entries(
variationBlockStyles.elements ?? {}
).forEach(
([
variationBlockElement,
variationBlockElementStyles
]) => {
if (variationBlockElementStyles && external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[variationBlockElement]) {
nodes.push({
styles: variationBlockElementStyles,
selector: scopeSelector(
variationBlockSelector,
external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[variationBlockElement]
)
});
}
}
);
}
);
}
);
blockStyles.variations = variations;
}
if (blockSelectors?.[blockName]?.selector) {
nodes.push({
duotoneSelector: blockSelectors[blockName].duotoneSelector,
fallbackGapValue: blockSelectors[blockName].fallbackGapValue,
hasLayoutSupport: blockSelectors[blockName].hasLayoutSupport,
selector: blockSelectors[blockName].selector,
styles: blockStyles,
featureSelectors: blockSelectors[blockName].featureSelectors,
styleVariationSelectors: blockSelectors[blockName].styleVariationSelectors
});
}
Object.entries(node?.elements ?? {}).forEach(
([elementName, value]) => {
if (value && blockSelectors?.[blockName] && external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[elementName]) {
nodes.push({
styles: value,
selector: blockSelectors[blockName]?.selector.split(",").map((sel) => {
const elementSelectors = external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[elementName].split(",");
return elementSelectors.map(
(elementSelector) => sel + " " + elementSelector
);
}).join(",")
});
}
}
);
}
);
return nodes;
};
const getNodesWithSettings = (tree, blockSelectors) => {
const nodes = [];
if (!tree?.settings) {
return nodes;
}
const pickPresets = (treeToPickFrom) => {
let presets2 = {};
PRESET_METADATA.forEach(({ path }) => {
const value = getValueFromObjectPath(treeToPickFrom, path, false);
if (value !== false) {
presets2 = setImmutably(presets2, path, value);
}
});
return presets2;
};
const presets = pickPresets(tree.settings);
const custom = tree.settings?.custom;
if (Object.keys(presets).length > 0 || custom) {
nodes.push({
presets,
custom,
selector: ROOT_CSS_PROPERTIES_SELECTOR
});
}
Object.entries(tree.settings?.blocks ?? {}).forEach(
([blockName, node]) => {
const blockPresets = pickPresets(node);
const blockCustom = node.custom;
if (Object.keys(blockPresets).length > 0 || blockCustom) {
nodes.push({
presets: blockPresets,
custom: blockCustom,
selector: blockSelectors[blockName]?.selector
});
}
}
);
return nodes;
};
const toCustomProperties = (tree, blockSelectors) => {
const settings = getNodesWithSettings(tree, blockSelectors);
let ruleset = "";
settings.forEach(({ presets, custom, selector }) => {
const declarations = getPresetsDeclarations(presets, tree?.settings);
const customProps = flattenTree(custom, "--wp--custom--", "--");
if (customProps.length > 0) {
declarations.push(...customProps);
}
if (declarations.length > 0) {
ruleset += `${selector}{${declarations.join(";")};}`;
}
});
return ruleset;
};
const toStyles = (tree, blockSelectors, hasBlockGapSupport, hasFallbackGapSupport, disableLayoutStyles = false, disableRootPadding = false, styleOptions = void 0) => {
const options = {
blockGap: true,
blockStyles: true,
layoutStyles: true,
marginReset: true,
presets: true,
rootPadding: true,
variationStyles: false,
...styleOptions
};
const nodesWithStyles = getNodesWithStyles(tree, blockSelectors);
const nodesWithSettings = getNodesWithSettings(tree, blockSelectors);
const useRootPaddingAlign = tree?.settings?.useRootPaddingAwareAlignments;
const { contentSize, wideSize } = tree?.settings?.layout || {};
const hasBodyStyles = options.marginReset || options.rootPadding || options.layoutStyles;
let ruleset = "";
if (options.presets && (contentSize || wideSize)) {
ruleset += `${ROOT_CSS_PROPERTIES_SELECTOR} {`;
ruleset = contentSize ? ruleset + ` --wp--style--global--content-size: ${contentSize};` : ruleset;
ruleset = wideSize ? ruleset + ` --wp--style--global--wide-size: ${wideSize};` : ruleset;
ruleset += "}";
}
if (hasBodyStyles) {
ruleset += ":where(body) {margin: 0;";
if (options.rootPadding && useRootPaddingAlign) {
ruleset += `padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }
.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }
.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }
.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; }
.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0;
`;
}
ruleset += "}";
}
if (options.blockStyles) {
nodesWithStyles.forEach(
({
selector,
duotoneSelector,
styles,
fallbackGapValue,
hasLayoutSupport,
featureSelectors,
styleVariationSelectors,
skipSelectorWrapper
}) => {
if (featureSelectors) {
const featureDeclarations = getFeatureDeclarations(
featureSelectors,
styles
);
Object.entries(featureDeclarations).forEach(
([cssSelector, declarations]) => {
if (declarations.length) {
const rules = declarations.join(";");
ruleset += `:root :where(${cssSelector}){${rules};}`;
}
}
);
}
if (duotoneSelector) {
const duotoneStyles = {};
if (styles?.filter) {
duotoneStyles.filter = styles.filter;
delete styles.filter;
}
const duotoneDeclarations = getStylesDeclarations(duotoneStyles);
if (duotoneDeclarations.length) {
ruleset += `${duotoneSelector}{${duotoneDeclarations.join(
";"
)};}`;
}
}
if (!disableLayoutStyles && (ROOT_BLOCK_SELECTOR === selector || hasLayoutSupport)) {
ruleset += getLayoutStyles({
style: styles,
selector,
hasBlockGapSupport,
hasFallbackGapSupport,
fallbackGapValue
});
}
const styleDeclarations = getStylesDeclarations(
styles,
selector,
useRootPaddingAlign,
tree,
disableRootPadding
);
if (styleDeclarations?.length) {
const generalSelector = skipSelectorWrapper ? selector : `:root :where(${selector})`;
ruleset += `${generalSelector}{${styleDeclarations.join(
";"
)};}`;
}
if (styles?.css) {
ruleset += processCSSNesting(
styles.css,
`:root :where(${selector})`
);
}
if (options.variationStyles && styleVariationSelectors) {
Object.entries(styleVariationSelectors).forEach(
([styleVariationName, styleVariationSelector]) => {
const styleVariations = styles?.variations?.[styleVariationName];
if (styleVariations) {
if (featureSelectors) {
const featureDeclarations = getFeatureDeclarations(
featureSelectors,
styleVariations
);
Object.entries(
featureDeclarations
).forEach(
([baseSelector, declarations]) => {
if (declarations.length) {
const cssSelector = concatFeatureVariationSelectorString(
baseSelector,
styleVariationSelector
);
const rules = declarations.join(";");
ruleset += `:root :where(${cssSelector}){${rules};}`;
}
}
);
}
const styleVariationDeclarations = getStylesDeclarations(
styleVariations,
styleVariationSelector,
useRootPaddingAlign,
tree
);
if (styleVariationDeclarations.length) {
ruleset += `:root :where(${styleVariationSelector}){${styleVariationDeclarations.join(
";"
)};}`;
}
if (styleVariations?.css) {
ruleset += processCSSNesting(
styleVariations.css,
`:root :where(${styleVariationSelector})`
);
}
}
}
);
}
const pseudoSelectorStyles = Object.entries(styles).filter(
([key]) => key.startsWith(":")
);
if (pseudoSelectorStyles?.length) {
pseudoSelectorStyles.forEach(
([pseudoKey, pseudoStyle]) => {
const pseudoDeclarations = getStylesDeclarations(pseudoStyle);
if (!pseudoDeclarations?.length) {
return;
}
const _selector = selector.split(",").map((sel) => sel + pseudoKey).join(",");
const pseudoRule = `:root :where(${_selector}){${pseudoDeclarations.join(
";"
)};}`;
ruleset += pseudoRule;
}
);
}
}
);
}
if (options.layoutStyles) {
ruleset = ruleset + ".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }";
ruleset = ruleset + ".wp-site-blocks > .alignright { float: right; margin-left: 2em; }";
ruleset = ruleset + ".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }";
}
if (options.blockGap && hasBlockGapSupport) {
const gapValue = getGapCSSValue(tree?.styles?.spacing?.blockGap) || "0.5em";
ruleset = ruleset + `:root :where(.wp-site-blocks) > * { margin-block-start: ${gapValue}; margin-block-end: 0; }`;
ruleset = ruleset + ":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }";
ruleset = ruleset + ":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }";
}
if (options.presets) {
nodesWithSettings.forEach(({ selector, presets }) => {
if (ROOT_BLOCK_SELECTOR === selector || ROOT_CSS_PROPERTIES_SELECTOR === selector) {
selector = "";
}
const classes = getPresetsClasses(selector, presets);
if (classes.length > 0) {
ruleset += classes;
}
});
}
return ruleset;
};
function toSvgFilters(tree, blockSelectors) {
const nodesWithSettings = getNodesWithSettings(tree, blockSelectors);
return nodesWithSettings.flatMap(({ presets }) => {
return getPresetsSvgFilters(presets);
});
}
const getSelectorsConfig = (blockType, rootSelector) => {
if (blockType?.selectors && Object.keys(blockType.selectors).length > 0) {
return blockType.selectors;
}
const config = { root: rootSelector };
Object.entries(BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS).forEach(
([featureKey, featureName]) => {
const featureSelector = getBlockCSSSelector(
blockType,
featureKey
);
if (featureSelector) {
config[featureName] = featureSelector;
}
}
);
return config;
};
const getBlockSelectors = (blockTypes, getBlockStyles, variationInstanceId) => {
const result = {};
blockTypes.forEach((blockType) => {
const name = blockType.name;
const selector = getBlockCSSSelector(blockType);
let duotoneSelector = getBlockCSSSelector(
blockType,
"filter.duotone"
);
if (!duotoneSelector) {
const rootSelector = getBlockCSSSelector(blockType);
const duotoneSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(
blockType,
"color.__experimentalDuotone",
false
);
duotoneSelector = duotoneSupport && scopeSelector(rootSelector, duotoneSupport);
}
const hasLayoutSupport = !!blockType?.supports?.layout || !!blockType?.supports?.__experimentalLayout;
const fallbackGapValue = blockType?.supports?.spacing?.blockGap?.__experimentalDefault;
const blockStyleVariations = getBlockStyles(name);
const styleVariationSelectors = {};
blockStyleVariations?.forEach((variation) => {
const variationSuffix = variationInstanceId ? `-${variationInstanceId}` : "";
const variationName = `${variation.name}${variationSuffix}`;
const styleVariationSelector = getBlockStyleVariationSelector(
variationName,
selector
);
styleVariationSelectors[variationName] = styleVariationSelector;
});
const featureSelectors = getSelectorsConfig(blockType, selector);
result[name] = {
duotoneSelector,
fallbackGapValue,
featureSelectors: Object.keys(featureSelectors).length ? featureSelectors : void 0,
hasLayoutSupport,
name,
selector,
styleVariationSelectors: blockStyleVariations?.length ? styleVariationSelectors : void 0
};
});
return result;
};
function updateConfigWithSeparator(config) {
const needsSeparatorStyleUpdate = config.styles?.blocks?.["core/separator"] && config.styles?.blocks?.["core/separator"].color?.background && !config.styles?.blocks?.["core/separator"].color?.text && !config.styles?.blocks?.["core/separator"].border?.color;
if (needsSeparatorStyleUpdate) {
return {
...config,
styles: {
...config.styles,
blocks: {
...config.styles.blocks,
"core/separator": {
...config.styles.blocks["core/separator"],
color: {
...config.styles.blocks["core/separator"].color,
text: config.styles?.blocks["core/separator"].color.background
}
}
}
}
};
}
return config;
}
function processCSSNesting(css, blockSelector) {
let processedCSS = "";
if (!css || css.trim() === "") {
return processedCSS;
}
const parts = css.split("&");
parts.forEach((part) => {
if (!part || part.trim() === "") {
return;
}
const isRootCss = !part.includes("{");
if (isRootCss) {
processedCSS += `:root :where(${blockSelector}){${part.trim()}}`;
} else {
const splitPart = part.replace("}", "").split("{");
if (splitPart.length !== 2) {
return;
}
const [nestedSelector, cssValue] = splitPart;
const matches = nestedSelector.match(/([>+~\s]*::[a-zA-Z-]+)/);
const pseudoPart = matches ? matches[1] : "";
const withoutPseudoElement = matches ? nestedSelector.replace(pseudoPart, "").trim() : nestedSelector.trim();
let combinedSelector;
if (withoutPseudoElement === "") {
combinedSelector = blockSelector;
} else {
combinedSelector = nestedSelector.startsWith(" ") ? scopeSelector(blockSelector, withoutPseudoElement) : appendToSelector(blockSelector, withoutPseudoElement);
}
processedCSS += `:root :where(${combinedSelector})${pseudoPart}{${cssValue.trim()}}`;
}
});
return processedCSS;
}
function useGlobalStylesOutputWithConfig(mergedConfig = {}, disableRootPadding) {
const [blockGap] = useGlobalSetting("spacing.blockGap");
const hasBlockGapSupport = blockGap !== null;
const hasFallbackGapSupport = !hasBlockGapSupport;
const disableLayoutStyles = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getSettings } = select(store);
return !!getSettings().disableLayoutStyles;
});
const { getBlockStyles } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store);
return (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!mergedConfig?.styles || !mergedConfig?.settings) {
return [];
}
const updatedConfig = updateConfigWithSeparator(mergedConfig);
const blockSelectors = getBlockSelectors(
(0,external_wp_blocks_namespaceObject.getBlockTypes)(),
getBlockStyles
);
const customProperties = toCustomProperties(
updatedConfig,
blockSelectors
);
const globalStyles = toStyles(
updatedConfig,
blockSelectors,
hasBlockGapSupport,
hasFallbackGapSupport,
disableLayoutStyles,
disableRootPadding
);
const svgs = toSvgFilters(updatedConfig, blockSelectors);
const styles = [
{
css: customProperties,
isGlobalStyles: true
},
{
css: globalStyles,
isGlobalStyles: true
},
// Load custom CSS in own stylesheet so that any invalid CSS entered in the input won't break all the global styles in the editor.
{
css: updatedConfig.styles.css ?? "",
isGlobalStyles: true
},
{
assets: svgs,
__unstableType: "svg",
isGlobalStyles: true
}
];
(0,external_wp_blocks_namespaceObject.getBlockTypes)().forEach((blockType) => {
if (updatedConfig.styles.blocks[blockType.name]?.css) {
const selector = blockSelectors[blockType.name].selector;
styles.push({
css: processCSSNesting(
updatedConfig.styles.blocks[blockType.name]?.css,
selector
),
isGlobalStyles: true
});
}
});
return [styles, updatedConfig.settings];
}, [
hasBlockGapSupport,
hasFallbackGapSupport,
mergedConfig,
disableLayoutStyles,
disableRootPadding,
getBlockStyles
]);
}
function useGlobalStylesOutput(disableRootPadding = false) {
const { merged: mergedConfig } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext);
return useGlobalStylesOutputWithConfig(mergedConfig, disableRootPadding);
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/block-style-variation.js
const VARIATION_PREFIX = "is-style-";
function getVariationMatches(className) {
if (!className) {
return [];
}
return className.split(/\s+/).reduce((matches, name) => {
if (name.startsWith(VARIATION_PREFIX)) {
const match = name.slice(VARIATION_PREFIX.length);
if (match !== "default") {
matches.push(match);
}
}
return matches;
}, []);
}
function getVariationNameFromClass(className, registeredStyles = []) {
const matches = getVariationMatches(className);
if (!matches) {
return null;
}
for (const variation of matches) {
if (registeredStyles.some((style) => style.name === variation)) {
return variation;
}
}
return null;
}
function OverrideStyles({ override }) {
usePrivateStyleOverride(override);
}
function __unstableBlockStyleVariationOverridesWithConfig({ config }) {
const { getBlockStyles, overrides } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => ({
getBlockStyles: select(external_wp_blocks_namespaceObject.store).getBlockStyles,
overrides: unlock(select(store)).getStyleOverrides()
}),
[]
);
const { getBlockName } = (0,external_wp_data_namespaceObject.useSelect)(store);
const overridesWithConfig = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!overrides?.length) {
return;
}
const newOverrides = [];
const overriddenClientIds = [];
for (const [, override] of overrides) {
if (override?.variation && override?.clientId && /*
* Because this component overwrites existing style overrides,
* filter out any overrides that are already present in the store.
*/
!overriddenClientIds.includes(override.clientId)) {
const blockName = getBlockName(override.clientId);
const configStyles = config?.styles?.blocks?.[blockName]?.variations?.[override.variation];
if (configStyles) {
const variationConfig = {
settings: config?.settings,
// The variation style data is all that is needed to generate
// the styles for the current application to a block. The variation
// name is updated to match the instance specific class name.
styles: {
blocks: {
[blockName]: {
variations: {
[`${override.variation}-${override.clientId}`]: configStyles
}
}
}
}
};
const blockSelectors = getBlockSelectors(
(0,external_wp_blocks_namespaceObject.getBlockTypes)(),
getBlockStyles,
override.clientId
);
const hasBlockGapSupport = false;
const hasFallbackGapSupport = true;
const disableLayoutStyles = true;
const disableRootPadding = true;
const variationStyles = toStyles(
variationConfig,
blockSelectors,
hasBlockGapSupport,
hasFallbackGapSupport,
disableLayoutStyles,
disableRootPadding,
{
blockGap: false,
blockStyles: true,
layoutStyles: false,
marginReset: false,
presets: false,
rootPadding: false,
variationStyles: true
}
);
newOverrides.push({
id: `${override.variation}-${override.clientId}`,
css: variationStyles,
__unstableType: "variation",
variation: override.variation,
// The clientId will be stored with the override and used to ensure
// the order of overrides matches the order of blocks so that the
// correct CSS cascade is maintained.
clientId: override.clientId
});
overriddenClientIds.push(override.clientId);
}
}
}
return newOverrides;
}, [config, overrides, getBlockStyles, getBlockName]);
if (!overridesWithConfig || !overridesWithConfig.length) {
return;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: overridesWithConfig.map((override) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(OverrideStyles, { override }, override.id)) });
}
function getVariationStylesWithRefValues(globalStyles, name, variation) {
if (!globalStyles?.styles?.blocks?.[name]?.variations?.[variation]) {
return;
}
const replaceRefs = (variationStyles) => {
Object.keys(variationStyles).forEach((key) => {
const value = variationStyles[key];
if (typeof value === "object" && value !== null) {
if (value.ref !== void 0) {
if (typeof value.ref !== "string" || value.ref.trim() === "") {
delete variationStyles[key];
} else {
const refValue = getValueFromObjectPath(
globalStyles,
value.ref
);
if (refValue) {
variationStyles[key] = refValue;
} else {
delete variationStyles[key];
}
}
} else {
replaceRefs(value);
if (Object.keys(value).length === 0) {
delete variationStyles[key];
}
}
}
});
};
const styles = JSON.parse(
JSON.stringify(
globalStyles.styles.blocks[name].variations[variation]
)
);
replaceRefs(styles);
return styles;
}
function useBlockStyleVariation(name, variation, clientId) {
const { merged: mergedConfig } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext);
const { globalSettings, globalStyles } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const settings = select(store).getSettings();
return {
globalSettings: settings.__experimentalFeatures,
globalStyles: settings[globalStylesDataKey]
};
}, []);
return (0,external_wp_element_namespaceObject.useMemo)(() => {
const variationStyles = getVariationStylesWithRefValues(
{
settings: mergedConfig?.settings ?? globalSettings,
styles: mergedConfig?.styles ?? globalStyles
},
name,
variation
);
return {
settings: mergedConfig?.settings ?? globalSettings,
// The variation style data is all that is needed to generate
// the styles for the current application to a block. The variation
// name is updated to match the instance specific class name.
styles: {
blocks: {
[name]: {
variations: {
[`${variation}-${clientId}`]: variationStyles
}
}
}
}
};
}, [
mergedConfig,
globalSettings,
globalStyles,
variation,
clientId,
name
]);
}
function block_style_variation_useBlockProps({ name, className, clientId }) {
const { getBlockStyles } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store);
const registeredStyles = getBlockStyles(name);
const variation = getVariationNameFromClass(className, registeredStyles);
const variationClass = `${VARIATION_PREFIX}${variation}-${clientId}`;
const { settings, styles } = useBlockStyleVariation(
name,
variation,
clientId
);
const variationStyles = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!variation) {
return;
}
const variationConfig = { settings, styles };
const blockSelectors = getBlockSelectors(
(0,external_wp_blocks_namespaceObject.getBlockTypes)(),
getBlockStyles,
clientId
);
const hasBlockGapSupport = false;
const hasFallbackGapSupport = true;
const disableLayoutStyles = true;
const disableRootPadding = true;
return toStyles(
variationConfig,
blockSelectors,
hasBlockGapSupport,
hasFallbackGapSupport,
disableLayoutStyles,
disableRootPadding,
{
blockGap: false,
blockStyles: true,
layoutStyles: false,
marginReset: false,
presets: false,
rootPadding: false,
variationStyles: true
}
);
}, [variation, settings, styles, getBlockStyles, clientId]);
usePrivateStyleOverride({
id: `variation-${clientId}`,
css: variationStyles,
__unstableType: "variation",
variation,
// The clientId will be stored with the override and used to ensure
// the order of overrides matches the order of blocks so that the
// correct CSS cascade is maintained.
clientId
});
return variation ? { className: variationClass } : {};
}
var block_style_variation_default = {
hasSupport: () => true,
attributeKeys: ["className"],
isMatch: ({ className }) => getVariationMatches(className).length > 0,
useBlockProps: block_style_variation_useBlockProps
};
;// ./node_modules/@wordpress/block-editor/build-module/hooks/layout.js
const layoutBlockSupportKey = "layout";
const { kebabCase: layout_kebabCase } = unlock(external_wp_components_namespaceObject.privateApis);
function hasLayoutBlockSupport(blockName) {
return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, "layout") || (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, "__experimentalLayout");
}
function useLayoutClasses(blockAttributes = {}, blockName = "") {
const { layout } = blockAttributes;
const { default: defaultBlockLayout } = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, layoutBlockSupportKey) || {};
const usedLayout = layout?.inherit || layout?.contentSize || layout?.wideSize ? { ...layout, type: "constrained" } : layout || defaultBlockLayout || {};
const layoutClassnames = [];
if (LAYOUT_DEFINITIONS[usedLayout?.type || "default"]?.className) {
const baseClassName = LAYOUT_DEFINITIONS[usedLayout?.type || "default"]?.className;
const splitBlockName = blockName.split("/");
const fullBlockName = splitBlockName[0] === "core" ? splitBlockName.pop() : splitBlockName.join("-");
const compoundClassName = `wp-block-${fullBlockName}-${baseClassName}`;
layoutClassnames.push(baseClassName, compoundClassName);
}
const hasGlobalPadding = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
return (usedLayout?.inherit || usedLayout?.contentSize || usedLayout?.type === "constrained") && select(store).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments;
},
[usedLayout?.contentSize, usedLayout?.inherit, usedLayout?.type]
);
if (hasGlobalPadding) {
layoutClassnames.push("has-global-padding");
}
if (usedLayout?.orientation) {
layoutClassnames.push(`is-${layout_kebabCase(usedLayout.orientation)}`);
}
if (usedLayout?.justifyContent) {
layoutClassnames.push(
`is-content-justification-${layout_kebabCase(
usedLayout.justifyContent
)}`
);
}
if (usedLayout?.flexWrap && usedLayout.flexWrap === "nowrap") {
layoutClassnames.push("is-nowrap");
}
return layoutClassnames;
}
function useLayoutStyles(blockAttributes = {}, blockName, selector) {
const { layout = {}, style = {} } = blockAttributes;
const usedLayout = layout?.inherit || layout?.contentSize || layout?.wideSize ? { ...layout, type: "constrained" } : layout || {};
const fullLayoutType = getLayoutType(usedLayout?.type || "default");
const [blockGapSupport] = use_settings_useSettings("spacing.blockGap");
const hasBlockGapSupport = blockGapSupport !== null;
return fullLayoutType?.getLayoutStyle?.({
blockName,
selector,
layout,
style,
hasBlockGapSupport
});
}
function LayoutPanelPure({
layout,
setAttributes,
name: blockName,
clientId
}) {
const settings = useBlockSettings(blockName);
const { layout: layoutSettings } = settings;
const { themeSupportsLayout } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getSettings } = select(store);
return {
themeSupportsLayout: getSettings().supportsLayout
};
}, []);
const blockEditingMode = useBlockEditingMode();
if (blockEditingMode !== "default") {
return null;
}
const layoutBlockSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(
blockName,
layoutBlockSupportKey,
{}
);
const blockSupportAndThemeSettings = {
...layoutSettings,
...layoutBlockSupport
};
const {
allowSwitching,
allowEditing = true,
allowInheriting = true,
default: defaultBlockLayout
} = blockSupportAndThemeSettings;
if (!allowEditing) {
return null;
}
const blockSupportAndLayout = {
...layoutBlockSupport,
...layout
};
const { type, default: { type: defaultType = "default" } = {} } = blockSupportAndLayout;
const blockLayoutType = type || defaultType;
const showInheritToggle = !!(allowInheriting && (!blockLayoutType || blockLayoutType === "default" || blockLayoutType === "constrained" || blockSupportAndLayout.inherit));
const usedLayout = layout || defaultBlockLayout || {};
const { inherit = false, contentSize = null } = usedLayout;
if ((blockLayoutType === "default" || blockLayoutType === "constrained") && !themeSupportsLayout) {
return null;
}
const layoutType = getLayoutType(blockLayoutType);
const constrainedType = getLayoutType("constrained");
const displayControlsForLegacyLayouts = !usedLayout.type && (contentSize || inherit);
const hasContentSizeOrLegacySettings = !!inherit || !!contentSize;
const onChangeType = (newType) => setAttributes({ layout: { type: newType } });
const onChangeLayout = (newLayout) => setAttributes({ layout: newLayout });
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)("Layout"), children: [
showInheritToggle && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Inner blocks use content width"),
checked: layoutType?.name === "constrained" || hasContentSizeOrLegacySettings,
onChange: () => setAttributes({
layout: {
type: layoutType?.name === "constrained" || hasContentSizeOrLegacySettings ? "default" : "constrained"
}
}),
help: layoutType?.name === "constrained" || hasContentSizeOrLegacySettings ? (0,external_wp_i18n_namespaceObject.__)(
"Nested blocks use content width with options for full and wide widths."
) : (0,external_wp_i18n_namespaceObject.__)(
"Nested blocks will fill the width of this container."
)
}
) }),
!inherit && allowSwitching && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
LayoutTypeSwitcher,
{
type: blockLayoutType,
onChange: onChangeType
}
),
layoutType && layoutType.name !== "default" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
layoutType.inspectorControls,
{
layout: usedLayout,
onChange: onChangeLayout,
layoutBlockSupport: blockSupportAndThemeSettings,
name: blockName,
clientId
}
),
constrainedType && displayControlsForLegacyLayouts && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
constrainedType.inspectorControls,
{
layout: usedLayout,
onChange: onChangeLayout,
layoutBlockSupport: blockSupportAndThemeSettings,
name: blockName,
clientId
}
)
] }) }),
!inherit && layoutType && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
layoutType.toolBarControls,
{
layout: usedLayout,
onChange: onChangeLayout,
layoutBlockSupport,
name: blockName,
clientId
}
)
] });
}
var layout_default = {
shareWithChildBlocks: true,
edit: LayoutPanelPure,
attributeKeys: ["layout"],
hasSupport(name) {
return hasLayoutBlockSupport(name);
}
};
function LayoutTypeSwitcher({ type, onChange }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
__next40pxDefaultSize: true,
isBlock: true,
label: (0,external_wp_i18n_namespaceObject.__)("Layout type"),
__nextHasNoMarginBottom: true,
hideLabelFromVision: true,
isAdaptiveWidth: true,
value: type,
onChange,
children: getLayoutTypes().map(({ name, label }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: name,
label
},
name
);
})
}
);
}
function layout_addAttribute(settings) {
if ("type" in (settings.attributes?.layout ?? {})) {
return settings;
}
if (hasLayoutBlockSupport(settings)) {
settings.attributes = {
...settings.attributes,
layout: {
type: "object"
}
};
}
return settings;
}
function BlockWithLayoutStyles({
block: BlockListBlock,
props,
blockGapSupport,
layoutClasses
}) {
const { name, attributes } = props;
const id = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockListBlock);
const { layout } = attributes;
const { default: defaultBlockLayout } = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, layoutBlockSupportKey) || {};
const usedLayout = layout?.inherit || layout?.contentSize || layout?.wideSize ? { ...layout, type: "constrained" } : layout || defaultBlockLayout || {};
const selectorPrefix = `wp-container-${layout_kebabCase(name)}-is-layout-`;
const selector = `.${selectorPrefix}${id}`;
const hasBlockGapSupport = blockGapSupport !== null;
const fullLayoutType = getLayoutType(usedLayout?.type || "default");
const css = fullLayoutType?.getLayoutStyle?.({
blockName: name,
selector,
layout: usedLayout,
style: attributes?.style,
hasBlockGapSupport
});
const layoutClassNames = dist_clsx(
{
[`${selectorPrefix}${id}`]: !!css
// Only attach a container class if there is generated CSS to be attached.
},
layoutClasses
);
useStyleOverride({ css });
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockListBlock,
{
...props,
__unstableLayoutClassNames: layoutClassNames
}
);
}
const withLayoutStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
(BlockListBlock) => (props) => {
const { clientId, name, attributes } = props;
const blockSupportsLayout = hasLayoutBlockSupport(name);
const layoutClasses = useLayoutClasses(attributes, name);
const extraProps = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
if (!blockSupportsLayout) {
return;
}
const { getSettings, getBlockSettings } = unlock(
select(store)
);
const { disableLayoutStyles } = getSettings();
if (disableLayoutStyles) {
return;
}
const [blockGapSupport] = getBlockSettings(
clientId,
"spacing.blockGap"
);
return { blockGapSupport };
},
[blockSupportsLayout, clientId]
);
if (!extraProps) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockListBlock,
{
...props,
__unstableLayoutClassNames: blockSupportsLayout ? layoutClasses : void 0
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockWithLayoutStyles,
{
block: BlockListBlock,
props,
layoutClasses,
...extraProps
}
);
},
"withLayoutStyles"
);
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.registerBlockType",
"core/layout/addAttribute",
layout_addAttribute
);
(0,external_wp_hooks_namespaceObject.addFilter)(
"editor.BlockListBlock",
"core/editor/layout/with-layout-styles",
withLayoutStyles
);
;// ./node_modules/@wordpress/block-editor/build-module/components/grid/utils.js
function range(start, length) {
return Array.from({ length }, (_, i) => start + i);
}
class GridRect {
constructor({
columnStart,
rowStart,
columnEnd,
rowEnd,
columnSpan,
rowSpan
} = {}) {
this.columnStart = columnStart ?? 1;
this.rowStart = rowStart ?? 1;
if (columnSpan !== void 0) {
this.columnEnd = this.columnStart + columnSpan - 1;
} else {
this.columnEnd = columnEnd ?? this.columnStart;
}
if (rowSpan !== void 0) {
this.rowEnd = this.rowStart + rowSpan - 1;
} else {
this.rowEnd = rowEnd ?? this.rowStart;
}
}
get columnSpan() {
return this.columnEnd - this.columnStart + 1;
}
get rowSpan() {
return this.rowEnd - this.rowStart + 1;
}
contains(column, row) {
return column >= this.columnStart && column <= this.columnEnd && row >= this.rowStart && row <= this.rowEnd;
}
containsRect(rect) {
return this.contains(rect.columnStart, rect.rowStart) && this.contains(rect.columnEnd, rect.rowEnd);
}
intersectsRect(rect) {
return this.columnStart <= rect.columnEnd && this.columnEnd >= rect.columnStart && this.rowStart <= rect.rowEnd && this.rowEnd >= rect.rowStart;
}
}
function utils_getComputedCSS(element, property) {
return element.ownerDocument.defaultView.getComputedStyle(element).getPropertyValue(property);
}
function getGridTracks(template, gap) {
const tracks = [];
for (const size of template.split(" ")) {
const previousTrack = tracks[tracks.length - 1];
const start = previousTrack ? previousTrack.end + gap : 0;
const end = start + parseFloat(size);
tracks.push({ start, end });
}
return tracks;
}
function getClosestTrack(tracks, position, edge = "start") {
return tracks.reduce(
(closest, track, index) => Math.abs(track[edge] - position) < Math.abs(tracks[closest][edge] - position) ? index : closest,
0
);
}
function getGridRect(gridElement, rect) {
const columnGap = parseFloat(utils_getComputedCSS(gridElement, "column-gap"));
const rowGap = parseFloat(utils_getComputedCSS(gridElement, "row-gap"));
const gridColumnTracks = getGridTracks(
utils_getComputedCSS(gridElement, "grid-template-columns"),
columnGap
);
const gridRowTracks = getGridTracks(
utils_getComputedCSS(gridElement, "grid-template-rows"),
rowGap
);
const columnStart = getClosestTrack(gridColumnTracks, rect.left) + 1;
const rowStart = getClosestTrack(gridRowTracks, rect.top) + 1;
const columnEnd = getClosestTrack(gridColumnTracks, rect.right, "end") + 1;
const rowEnd = getClosestTrack(gridRowTracks, rect.bottom, "end") + 1;
return new GridRect({
columnStart,
columnEnd,
rowStart,
rowEnd
});
}
function getGridItemRect(gridItemElement) {
return getGridRect(
gridItemElement.parentElement,
new window.DOMRect(
gridItemElement.offsetLeft,
gridItemElement.offsetTop,
gridItemElement.offsetWidth,
gridItemElement.offsetHeight
)
);
}
function getGridInfo(gridElement) {
const gridTemplateColumns = utils_getComputedCSS(
gridElement,
"grid-template-columns"
);
const gridTemplateRows = utils_getComputedCSS(
gridElement,
"grid-template-rows"
);
const borderTopWidth = utils_getComputedCSS(gridElement, "border-top-width");
const borderRightWidth = utils_getComputedCSS(
gridElement,
"border-right-width"
);
const borderBottomWidth = utils_getComputedCSS(
gridElement,
"border-bottom-width"
);
const borderLeftWidth = utils_getComputedCSS(gridElement, "border-left-width");
const paddingTop = utils_getComputedCSS(gridElement, "padding-top");
const paddingRight = utils_getComputedCSS(gridElement, "padding-right");
const paddingBottom = utils_getComputedCSS(gridElement, "padding-bottom");
const paddingLeft = utils_getComputedCSS(gridElement, "padding-left");
const numColumns = gridTemplateColumns.split(" ").length;
const numRows = gridTemplateRows.split(" ").length;
const numItems = numColumns * numRows;
return {
numColumns,
numRows,
numItems,
currentColor: utils_getComputedCSS(gridElement, "color"),
style: {
gridTemplateColumns,
gridTemplateRows,
gap: utils_getComputedCSS(gridElement, "gap"),
inset: `
calc(${paddingTop} + ${borderTopWidth})
calc(${paddingRight} + ${borderRightWidth})
calc(${paddingBottom} + ${borderBottomWidth})
calc(${paddingLeft} + ${borderLeftWidth})
`
}
};
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/tips.js
const globalTips = [
(0,external_wp_element_namespaceObject.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.__)(
"While writing, you can press <kbd>/</kbd> to quickly insert new blocks."
),
{ kbd: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", {}) }
),
(0,external_wp_element_namespaceObject.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.__)(
"Indent a list by pressing <kbd>space</kbd> at the beginning of a line."
),
{ kbd: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", {}) }
),
(0,external_wp_element_namespaceObject.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.__)(
"Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."
),
{ kbd: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", {}) }
),
(0,external_wp_i18n_namespaceObject.__)("Drag files into the editor to automatically insert media blocks."),
(0,external_wp_i18n_namespaceObject.__)("Change a block's type by pressing the block icon on the toolbar.")
];
function Tips() {
const [randomIndex] = (0,external_wp_element_namespaceObject.useState)(
// Disable Reason: I'm not generating an HTML id.
// eslint-disable-next-line no-restricted-syntax
Math.floor(Math.random() * globalTips.length)
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tip, { children: globalTips[randomIndex] });
}
var tips_default = Tips;
;// ./node_modules/@wordpress/icons/build-module/library/chevron-right.js
var chevron_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/chevron-left.js
var chevron_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/block-card/index.js
const { Badge } = unlock(external_wp_components_namespaceObject.privateApis);
function BlockCard({
title,
icon,
description,
blockType,
className,
name,
allowParentNavigation,
children
}) {
if (blockType) {
external_wp_deprecated_default()("`blockType` property in `BlockCard component`", {
since: "5.7",
alternative: "`title, icon and description` properties"
});
({ title, icon, description } = blockType);
}
const parentNavBlockClientId = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
if (!allowParentNavigation) {
return;
}
const { getSelectedBlockClientId, getBlockParentsByBlockName } = select(store);
const _selectedBlockClientId = getSelectedBlockClientId();
return getBlockParentsByBlockName(
_selectedBlockClientId,
"core/navigation",
true
)[0];
},
[allowParentNavigation]
);
const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: dist_clsx("block-editor-block-card", className), children: [
allowParentNavigation && parentNavBlockClientId && // This is only used by the Navigation block for now. It's not ideal having Navigation block specific code here.
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
onClick: () => selectBlock(parentNavBlockClientId),
label: (0,external_wp_i18n_namespaceObject.__)("Go to parent Navigation block"),
style: (
// TODO: This style override is also used in ToolsPanelHeader.
// It should be supported out-of-the-box by Button.
{ minWidth: 24, padding: 0 }
),
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right_default : chevron_left_default,
size: "small"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon_default, { icon, showColors: true }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 1, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("h2", { className: "block-editor-block-card__title", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-block-card__name", children: !!name?.length ? name : title }),
!!name?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Badge, { children: title })
] }),
description && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { className: "block-editor-block-card__description", children: description }),
children
] })
] });
}
var block_card_default = BlockCard;
;// ./node_modules/@wordpress/upload-media/build-module/store/types.js
var Type = /* @__PURE__ */ ((Type2) => {
Type2["Unknown"] = "REDUX_UNKNOWN";
Type2["Add"] = "ADD_ITEM";
Type2["Prepare"] = "PREPARE_ITEM";
Type2["Cancel"] = "CANCEL_ITEM";
Type2["Remove"] = "REMOVE_ITEM";
Type2["PauseItem"] = "PAUSE_ITEM";
Type2["ResumeItem"] = "RESUME_ITEM";
Type2["PauseQueue"] = "PAUSE_QUEUE";
Type2["ResumeQueue"] = "RESUME_QUEUE";
Type2["OperationStart"] = "OPERATION_START";
Type2["OperationFinish"] = "OPERATION_FINISH";
Type2["AddOperations"] = "ADD_OPERATIONS";
Type2["CacheBlobUrl"] = "CACHE_BLOB_URL";
Type2["RevokeBlobUrls"] = "REVOKE_BLOB_URLS";
Type2["UpdateSettings"] = "UPDATE_SETTINGS";
return Type2;
})(Type || {});
var ItemStatus = /* @__PURE__ */ ((ItemStatus2) => {
ItemStatus2["Processing"] = "PROCESSING";
ItemStatus2["Paused"] = "PAUSED";
return ItemStatus2;
})(ItemStatus || {});
var OperationType = /* @__PURE__ */ ((OperationType2) => {
OperationType2["Prepare"] = "PREPARE";
OperationType2["Upload"] = "UPLOAD";
return OperationType2;
})(OperationType || {});
;// ./node_modules/@wordpress/upload-media/build-module/store/reducer.js
const reducer_noop = () => {
};
const DEFAULT_STATE = {
queue: [],
queueStatus: "active",
blobUrls: {},
settings: {
mediaUpload: reducer_noop
}
};
function reducer_reducer(state = DEFAULT_STATE, action = { type: Type.Unknown }) {
switch (action.type) {
case Type.PauseQueue: {
return {
...state,
queueStatus: "paused"
};
}
case Type.ResumeQueue: {
return {
...state,
queueStatus: "active"
};
}
case Type.Add:
return {
...state,
queue: [...state.queue, action.item]
};
case Type.Cancel:
return {
...state,
queue: state.queue.map(
(item) => item.id === action.id ? {
...item,
error: action.error
} : item
)
};
case Type.Remove:
return {
...state,
queue: state.queue.filter((item) => item.id !== action.id)
};
case Type.OperationStart: {
return {
...state,
queue: state.queue.map(
(item) => item.id === action.id ? {
...item,
currentOperation: action.operation
} : item
)
};
}
case Type.AddOperations:
return {
...state,
queue: state.queue.map((item) => {
if (item.id !== action.id) {
return item;
}
return {
...item,
operations: [
...item.operations || [],
...action.operations
]
};
})
};
case Type.OperationFinish:
return {
...state,
queue: state.queue.map((item) => {
if (item.id !== action.id) {
return item;
}
const operations = item.operations ? item.operations.slice(1) : [];
const attachment = item.attachment || action.item.attachment ? {
...item.attachment,
...action.item.attachment
} : void 0;
return {
...item,
currentOperation: void 0,
operations,
...action.item,
attachment,
additionalData: {
...item.additionalData,
...action.item.additionalData
}
};
})
};
case Type.CacheBlobUrl: {
const blobUrls = state.blobUrls[action.id] || [];
return {
...state,
blobUrls: {
...state.blobUrls,
[action.id]: [...blobUrls, action.blobUrl]
}
};
}
case Type.RevokeBlobUrls: {
const newBlobUrls = { ...state.blobUrls };
delete newBlobUrls[action.id];
return {
...state,
blobUrls: newBlobUrls
};
}
case Type.UpdateSettings: {
return {
...state,
settings: {
...state.settings,
...action.settings
}
};
}
}
return state;
}
var reducer_reducer_default = reducer_reducer;
;// ./node_modules/@wordpress/upload-media/build-module/store/selectors.js
function getItems(state) {
return state.queue;
}
function isUploading(state) {
return state.queue.length >= 1;
}
function isUploadingByUrl(state, url) {
return state.queue.some(
(item) => item.attachment?.url === url || item.sourceUrl === url
);
}
function isUploadingById(state, attachmentId) {
return state.queue.some(
(item) => item.attachment?.id === attachmentId || item.sourceAttachmentId === attachmentId
);
}
function selectors_getSettings(state) {
return state.settings;
}
;// ./node_modules/@wordpress/upload-media/build-module/store/private-selectors.js
function getAllItems(state) {
return state.queue;
}
function getItem(state, id) {
return state.queue.find((item) => item.id === id);
}
function isBatchUploaded(state, batchId) {
const batchItems = state.queue.filter(
(item) => batchId === item.batchId
);
return batchItems.length === 0;
}
function isUploadingToPost(state, postOrAttachmentId) {
return state.queue.some(
(item) => item.currentOperation === OperationType.Upload && item.additionalData.post === postOrAttachmentId
);
}
function getPausedUploadForPost(state, postOrAttachmentId) {
return state.queue.find(
(item) => item.status === ItemStatus.Paused && item.additionalData.post === postOrAttachmentId
);
}
function isPaused(state) {
return state.queueStatus === "paused";
}
function getBlobUrls(state, id) {
return state.blobUrls[id] || [];
}
;// ./node_modules/@wordpress/upload-media/node_modules/uuid/dist/esm-browser/native.js
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
/* harmony default export */ const esm_browser_native = ({
randomUUID
});
;// ./node_modules/@wordpress/upload-media/node_modules/uuid/dist/esm-browser/rng.js
// Unique ID creation requires a high quality random # generator. In the browser we therefore
// require the crypto API and do not support built-in fallback to lower quality random number
// generators (like Math.random()).
let getRandomValues;
const rnds8 = new Uint8Array(16);
function rng() {
// lazy load so that environments that need to polyfill have a chance to do so
if (!getRandomValues) {
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
if (!getRandomValues) {
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
}
}
return getRandomValues(rnds8);
}
;// ./node_modules/@wordpress/upload-media/node_modules/uuid/dist/esm-browser/stringify.js
/**
* Convert array of 16 byte values to UUID string format of the form:
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
*/
const byteToHex = [];
for (let i = 0; i < 256; ++i) {
byteToHex.push((i + 0x100).toString(16).slice(1));
}
function unsafeStringify(arr, offset = 0) {
// Note: Be careful editing this code! It's been tuned for performance
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
}
function stringify(arr, offset = 0) {
const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
// of the following:
// - One or more input array values don't map to a hex octet (leading to
// "undefined" in the uuid)
// - Invalid input values for the RFC `version` or `variant` fields
if (!validate(uuid)) {
throw TypeError('Stringified UUID is invalid');
}
return uuid;
}
/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
;// ./node_modules/@wordpress/upload-media/node_modules/uuid/dist/esm-browser/v4.js
function v4(options, buf, offset) {
if (esm_browser_native.randomUUID && !buf && !options) {
return esm_browser_native.randomUUID();
}
options = options || {};
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
rnds[6] = rnds[6] & 0x0f | 0x40;
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
if (buf) {
offset = offset || 0;
for (let i = 0; i < 16; ++i) {
buf[offset + i] = rnds[i];
}
return buf;
}
return unsafeStringify(rnds);
}
/* harmony default export */ const esm_browser_v4 = (v4);
;// ./node_modules/@wordpress/upload-media/build-module/upload-error.js
class UploadError extends Error {
code;
file;
constructor({ code, message, file, cause }) {
super(message, { cause });
Object.setPrototypeOf(this, new.target.prototype);
this.code = code;
this.file = file;
}
}
;// ./node_modules/@wordpress/upload-media/build-module/validate-mime-type.js
function validateMimeType(file, allowedTypes) {
if (!allowedTypes) {
return;
}
const isAllowedType = allowedTypes.some((allowedType) => {
if (allowedType.includes("/")) {
return allowedType === file.type;
}
return file.type.startsWith(`${allowedType}/`);
});
if (file.type && !isAllowedType) {
throw new UploadError({
code: "MIME_TYPE_NOT_SUPPORTED",
message: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: file name.
(0,external_wp_i18n_namespaceObject.__)("%s: Sorry, this file type is not supported here."),
file.name
),
file
});
}
}
;// ./node_modules/@wordpress/upload-media/build-module/get-mime-types-array.js
function getMimeTypesArray(wpMimeTypesObject) {
if (!wpMimeTypesObject) {
return null;
}
return Object.entries(wpMimeTypesObject).flatMap(
([extensionsString, mime]) => {
const [type] = mime.split("/");
const extensions = extensionsString.split("|");
return [
mime,
...extensions.map(
(extension) => `${type}/${extension}`
)
];
}
);
}
;// ./node_modules/@wordpress/upload-media/build-module/validate-mime-type-for-user.js
function validateMimeTypeForUser(file, wpAllowedMimeTypes) {
const allowedMimeTypesForUser = getMimeTypesArray(wpAllowedMimeTypes);
if (!allowedMimeTypesForUser) {
return;
}
const isAllowedMimeTypeForUser = allowedMimeTypesForUser.includes(
file.type
);
if (file.type && !isAllowedMimeTypeForUser) {
throw new UploadError({
code: "MIME_TYPE_NOT_ALLOWED_FOR_USER",
message: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: file name.
(0,external_wp_i18n_namespaceObject.__)(
"%s: Sorry, you are not allowed to upload this file type."
),
file.name
),
file
});
}
}
;// ./node_modules/@wordpress/upload-media/build-module/validate-file-size.js
function validateFileSize(file, maxUploadFileSize) {
if (file.size <= 0) {
throw new UploadError({
code: "EMPTY_FILE",
message: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: file name.
(0,external_wp_i18n_namespaceObject.__)("%s: This file is empty."),
file.name
),
file
});
}
if (maxUploadFileSize && file.size > maxUploadFileSize) {
throw new UploadError({
code: "SIZE_ABOVE_LIMIT",
message: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: file name.
(0,external_wp_i18n_namespaceObject.__)(
"%s: This file exceeds the maximum upload size for this site."
),
file.name
),
file
});
}
}
;// ./node_modules/@wordpress/upload-media/build-module/store/actions.js
function addItems({
files,
onChange,
onSuccess,
onError,
onBatchSuccess,
additionalData,
allowedTypes
}) {
return async ({ select, dispatch }) => {
const batchId = esm_browser_v4();
for (const file of files) {
try {
validateMimeType(file, allowedTypes);
validateMimeTypeForUser(
file,
select.getSettings().allowedMimeTypes
);
} catch (error) {
onError?.(error);
continue;
}
try {
validateFileSize(
file,
select.getSettings().maxUploadFileSize
);
} catch (error) {
onError?.(error);
continue;
}
dispatch.addItem({
file,
batchId,
onChange,
onSuccess,
onBatchSuccess,
onError,
additionalData
});
}
};
}
function cancelItem(id, error, silent = false) {
return async ({ select, dispatch }) => {
const item = select.getItem(id);
if (!item) {
return;
}
item.abortController?.abort();
if (!silent) {
const { onError } = item;
onError?.(error ?? new Error("Upload cancelled"));
if (!onError && error) {
console.error("Upload cancelled", error);
}
}
dispatch({
type: Type.Cancel,
id,
error
});
dispatch.removeItem(id);
dispatch.revokeBlobUrls(id);
if (item.batchId && select.isBatchUploaded(item.batchId)) {
item.onBatchSuccess?.();
}
};
}
;// ./node_modules/@wordpress/upload-media/build-module/utils.js
function convertBlobToFile(fileOrBlob) {
if (fileOrBlob instanceof File) {
return fileOrBlob;
}
const ext = fileOrBlob.type.split("/")[1];
const mediaType = "application/pdf" === fileOrBlob.type ? "document" : fileOrBlob.type.split("/")[0];
return new File([fileOrBlob], `${mediaType}.${ext}`, {
type: fileOrBlob.type
});
}
function renameFile(file, name) {
return new File([file], name, {
type: file.type,
lastModified: file.lastModified
});
}
function cloneFile(file) {
return renameFile(file, file.name);
}
function getFileExtension(file) {
return file.includes(".") ? file.split(".").pop() || null : null;
}
function getFileBasename(name) {
return name.includes(".") ? name.split(".").slice(0, -1).join(".") : name;
}
function getFileNameFromUrl(url) {
return getFilename(url) || _x("unnamed", "file name");
}
;// ./node_modules/@wordpress/upload-media/build-module/stub-file.js
class StubFile extends File {
constructor(fileName = "stub-file") {
super([], fileName);
}
}
;// ./node_modules/@wordpress/upload-media/build-module/store/private-actions.js
function addItem({
file: fileOrBlob,
batchId,
onChange,
onSuccess,
onBatchSuccess,
onError,
additionalData = {},
sourceUrl,
sourceAttachmentId,
abortController,
operations
}) {
return async ({ dispatch }) => {
const itemId = esm_browser_v4();
const file = convertBlobToFile(fileOrBlob);
let blobUrl;
if (!(file instanceof StubFile)) {
blobUrl = (0,external_wp_blob_namespaceObject.createBlobURL)(file);
dispatch({
type: Type.CacheBlobUrl,
id: itemId,
blobUrl
});
}
dispatch({
type: Type.Add,
item: {
id: itemId,
batchId,
status: ItemStatus.Processing,
sourceFile: cloneFile(file),
file,
attachment: {
url: blobUrl
},
additionalData: {
convert_format: false,
...additionalData
},
onChange,
onSuccess,
onBatchSuccess,
onError,
sourceUrl,
sourceAttachmentId,
abortController: abortController || new AbortController(),
operations: Array.isArray(operations) ? operations : [OperationType.Prepare]
}
});
dispatch.processItem(itemId);
};
}
function processItem(id) {
return async ({ select, dispatch }) => {
if (select.isPaused()) {
return;
}
const item = select.getItem(id);
const { attachment, onChange, onSuccess, onBatchSuccess, batchId } = item;
const operation = Array.isArray(item.operations?.[0]) ? item.operations[0][0] : item.operations?.[0];
if (attachment) {
onChange?.([attachment]);
}
if (!operation) {
if (attachment) {
onSuccess?.([attachment]);
}
dispatch.revokeBlobUrls(id);
if (batchId && select.isBatchUploaded(batchId)) {
onBatchSuccess?.();
}
return;
}
if (!operation) {
return;
}
dispatch({
type: Type.OperationStart,
id,
operation
});
switch (operation) {
case OperationType.Prepare:
dispatch.prepareItem(item.id);
break;
case OperationType.Upload:
dispatch.uploadItem(id);
break;
}
};
}
function pauseQueue() {
return {
type: Type.PauseQueue
};
}
function resumeQueue() {
return async ({ select, dispatch }) => {
dispatch({
type: Type.ResumeQueue
});
for (const item of select.getAllItems()) {
dispatch.processItem(item.id);
}
};
}
function removeItem(id) {
return async ({ select, dispatch }) => {
const item = select.getItem(id);
if (!item) {
return;
}
dispatch({
type: Type.Remove,
id
});
};
}
function finishOperation(id, updates) {
return async ({ dispatch }) => {
dispatch({
type: Type.OperationFinish,
id,
item: updates
});
dispatch.processItem(id);
};
}
function prepareItem(id) {
return async ({ dispatch }) => {
const operations = [OperationType.Upload];
dispatch({
type: Type.AddOperations,
id,
operations
});
dispatch.finishOperation(id, {});
};
}
function uploadItem(id) {
return async ({ select, dispatch }) => {
const item = select.getItem(id);
select.getSettings().mediaUpload({
filesList: [item.file],
additionalData: item.additionalData,
signal: item.abortController?.signal,
onFileChange: ([attachment]) => {
if (!(0,external_wp_blob_namespaceObject.isBlobURL)(attachment.url)) {
dispatch.finishOperation(id, {
attachment
});
}
},
onSuccess: ([attachment]) => {
dispatch.finishOperation(id, {
attachment
});
},
onError: (error) => {
dispatch.cancelItem(id, error);
}
});
};
}
function revokeBlobUrls(id) {
return async ({ select, dispatch }) => {
const blobUrls = select.getBlobUrls(id);
for (const blobUrl of blobUrls) {
(0,external_wp_blob_namespaceObject.revokeBlobURL)(blobUrl);
}
dispatch({
type: Type.RevokeBlobUrls,
id
});
};
}
function private_actions_updateSettings(settings) {
return {
type: Type.UpdateSettings,
settings
};
}
;// ./node_modules/@wordpress/upload-media/build-module/lock-unlock.js
const { lock: lock_unlock_lock, unlock: lock_unlock_unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
"@wordpress/upload-media"
);
;// ./node_modules/@wordpress/upload-media/build-module/store/constants.js
const constants_STORE_NAME = "core/upload-media";
;// ./node_modules/@wordpress/upload-media/build-module/store/index.js
const store_storeConfig = {
reducer: reducer_reducer_default,
selectors: store_selectors_namespaceObject,
actions: store_actions_namespaceObject
};
const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, {
reducer: reducer_reducer_default,
selectors: store_selectors_namespaceObject,
actions: store_actions_namespaceObject
});
(0,external_wp_data_namespaceObject.register)(store_store);
lock_unlock_unlock(store_store).registerPrivateActions(store_private_actions_namespaceObject);
lock_unlock_unlock(store_store).registerPrivateSelectors(store_private_selectors_namespaceObject);
;// ./node_modules/@wordpress/upload-media/build-module/components/provider/with-registry-provider.js
function getSubRegistry(subRegistries, registry, useSubRegistry) {
if (!useSubRegistry) {
return registry;
}
let subRegistry = subRegistries.get(registry);
if (!subRegistry) {
subRegistry = (0,external_wp_data_namespaceObject.createRegistry)({}, registry);
subRegistry.registerStore(constants_STORE_NAME, store_storeConfig);
subRegistries.set(registry, subRegistry);
}
return subRegistry;
}
const withRegistryProvider = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
(WrappedComponent) => ({ useSubRegistry = true, ...props }) => {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const [subRegistries] = (0,external_wp_element_namespaceObject.useState)(() => /* @__PURE__ */ new WeakMap());
const subRegistry = getSubRegistry(
subRegistries,
registry,
useSubRegistry
);
if (subRegistry === registry) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { registry, ...props });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_data_namespaceObject.RegistryProvider, { value: subRegistry, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { registry: subRegistry, ...props }) });
},
"withRegistryProvider"
);
var with_registry_provider_default = withRegistryProvider;
;// ./node_modules/@wordpress/upload-media/build-module/components/provider/index.js
const MediaUploadProvider = with_registry_provider_default((props) => {
const { children, settings } = props;
const { updateSettings } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
(0,external_wp_element_namespaceObject.useEffect)(() => {
updateSettings(settings);
}, [settings, updateSettings]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children });
});
var provider_default = MediaUploadProvider;
;// ./node_modules/@wordpress/block-editor/build-module/components/provider/with-registry-provider.js
function with_registry_provider_getSubRegistry(subRegistries, registry, useSubRegistry) {
if (!useSubRegistry) {
return registry;
}
let subRegistry = subRegistries.get(registry);
if (!subRegistry) {
subRegistry = (0,external_wp_data_namespaceObject.createRegistry)({}, registry);
subRegistry.registerStore(STORE_NAME, storeConfig);
subRegistries.set(registry, subRegistry);
}
return subRegistry;
}
const with_registry_provider_withRegistryProvider = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
(WrappedComponent) => ({ useSubRegistry = true, ...props }) => {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const [subRegistries] = (0,external_wp_element_namespaceObject.useState)(() => /* @__PURE__ */ new WeakMap());
const subRegistry = with_registry_provider_getSubRegistry(
subRegistries,
registry,
useSubRegistry
);
if (subRegistry === registry) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { registry, ...props });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_data_namespaceObject.RegistryProvider, { value: subRegistry, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { registry: subRegistry, ...props }) });
},
"withRegistryProvider"
);
var with_registry_provider_with_registry_provider_default = with_registry_provider_withRegistryProvider;
;// ./node_modules/@wordpress/block-editor/build-module/components/provider/use-block-sync.js
const use_block_sync_noop = () => {
};
function useBlockSync({
clientId = null,
value: controlledBlocks,
selection: controlledSelection,
onChange = use_block_sync_noop,
onInput = use_block_sync_noop
}) {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const {
resetBlocks,
resetSelection,
replaceInnerBlocks,
setHasControlledInnerBlocks,
__unstableMarkNextChangeAsNotPersistent
} = registry.dispatch(store);
const { getBlockName, getBlocks, getSelectionStart, getSelectionEnd } = registry.select(store);
const isControlled = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
return !clientId || select(store).areInnerBlocksControlled(clientId);
},
[clientId]
);
const pendingChangesRef = (0,external_wp_element_namespaceObject.useRef)({ incoming: null, outgoing: [] });
const subscribedRef = (0,external_wp_element_namespaceObject.useRef)(false);
const setControlledBlocks = () => {
if (!controlledBlocks) {
return;
}
__unstableMarkNextChangeAsNotPersistent();
if (clientId) {
registry.batch(() => {
setHasControlledInnerBlocks(clientId, true);
const storeBlocks = controlledBlocks.map(
(block) => (0,external_wp_blocks_namespaceObject.cloneBlock)(block)
);
if (subscribedRef.current) {
pendingChangesRef.current.incoming = storeBlocks;
}
__unstableMarkNextChangeAsNotPersistent();
replaceInnerBlocks(clientId, storeBlocks);
});
} else {
if (subscribedRef.current) {
pendingChangesRef.current.incoming = controlledBlocks;
}
resetBlocks(controlledBlocks);
}
};
const unsetControlledBlocks = () => {
__unstableMarkNextChangeAsNotPersistent();
if (clientId) {
setHasControlledInnerBlocks(clientId, false);
__unstableMarkNextChangeAsNotPersistent();
replaceInnerBlocks(clientId, []);
} else {
resetBlocks([]);
}
};
const onInputRef = (0,external_wp_element_namespaceObject.useRef)(onInput);
const onChangeRef = (0,external_wp_element_namespaceObject.useRef)(onChange);
(0,external_wp_element_namespaceObject.useEffect)(() => {
onInputRef.current = onInput;
onChangeRef.current = onChange;
}, [onInput, onChange]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (pendingChangesRef.current.outgoing.includes(controlledBlocks)) {
if (pendingChangesRef.current.outgoing[pendingChangesRef.current.outgoing.length - 1] === controlledBlocks) {
pendingChangesRef.current.outgoing = [];
}
} else if (getBlocks(clientId) !== controlledBlocks) {
pendingChangesRef.current.outgoing = [];
setControlledBlocks();
if (controlledSelection) {
resetSelection(
controlledSelection.selectionStart,
controlledSelection.selectionEnd,
controlledSelection.initialPosition
);
}
}
}, [controlledBlocks, clientId]);
const isMountedRef = (0,external_wp_element_namespaceObject.useRef)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isMountedRef.current) {
isMountedRef.current = true;
return;
}
if (!isControlled) {
pendingChangesRef.current.outgoing = [];
setControlledBlocks();
}
}, [isControlled]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const {
getSelectedBlocksInitialCaretPosition,
isLastBlockChangePersistent,
__unstableIsLastBlockChangeIgnored,
areInnerBlocksControlled
} = registry.select(store);
let blocks = getBlocks(clientId);
let isPersistent = isLastBlockChangePersistent();
let previousAreBlocksDifferent = false;
subscribedRef.current = true;
const unsubscribe = registry.subscribe(() => {
if (clientId !== null && getBlockName(clientId) === null) {
return;
}
const isStillControlled = !clientId || areInnerBlocksControlled(clientId);
if (!isStillControlled) {
return;
}
const newIsPersistent = isLastBlockChangePersistent();
const newBlocks = getBlocks(clientId);
const areBlocksDifferent = newBlocks !== blocks;
blocks = newBlocks;
if (areBlocksDifferent && (pendingChangesRef.current.incoming || __unstableIsLastBlockChangeIgnored())) {
pendingChangesRef.current.incoming = null;
isPersistent = newIsPersistent;
return;
}
const didPersistenceChange = previousAreBlocksDifferent && !areBlocksDifferent && newIsPersistent && !isPersistent;
if (areBlocksDifferent || didPersistenceChange) {
isPersistent = newIsPersistent;
pendingChangesRef.current.outgoing.push(blocks);
const updateParent = isPersistent ? onChangeRef.current : onInputRef.current;
updateParent(blocks, {
selection: {
selectionStart: getSelectionStart(),
selectionEnd: getSelectionEnd(),
initialPosition: getSelectedBlocksInitialCaretPosition()
}
});
}
previousAreBlocksDifferent = areBlocksDifferent;
}, store);
return () => {
subscribedRef.current = false;
unsubscribe();
};
}, [registry, clientId]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
return () => {
unsetControlledBlocks();
};
}, []);
}
;// external ["wp","keyboardShortcuts"]
const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
;// ./node_modules/@wordpress/block-editor/build-module/components/keyboard-shortcuts/index.js
function KeyboardShortcuts() {
return null;
}
function KeyboardShortcutsRegister() {
const { registerShortcut } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store);
(0,external_wp_element_namespaceObject.useEffect)(() => {
registerShortcut({
name: "core/block-editor/copy",
category: "block",
description: (0,external_wp_i18n_namespaceObject.__)("Copy the selected block(s)."),
keyCombination: {
modifier: "primary",
character: "c"
}
});
registerShortcut({
name: "core/block-editor/cut",
category: "block",
description: (0,external_wp_i18n_namespaceObject.__)("Cut the selected block(s)."),
keyCombination: {
modifier: "primary",
character: "x"
}
});
registerShortcut({
name: "core/block-editor/paste",
category: "block",
description: (0,external_wp_i18n_namespaceObject.__)("Paste the selected block(s)."),
keyCombination: {
modifier: "primary",
character: "v"
}
});
registerShortcut({
name: "core/block-editor/duplicate",
category: "block",
description: (0,external_wp_i18n_namespaceObject.__)("Duplicate the selected block(s)."),
keyCombination: {
modifier: "primaryShift",
character: "d"
}
});
registerShortcut({
name: "core/block-editor/remove",
category: "block",
description: (0,external_wp_i18n_namespaceObject.__)("Remove the selected block(s)."),
keyCombination: {
modifier: "access",
character: "z"
}
});
registerShortcut({
name: "core/block-editor/paste-styles",
category: "block",
description: (0,external_wp_i18n_namespaceObject.__)(
"Paste the copied style to the selected block(s)."
),
keyCombination: {
modifier: "primaryAlt",
character: "v"
}
});
registerShortcut({
name: "core/block-editor/insert-before",
category: "block",
description: (0,external_wp_i18n_namespaceObject.__)(
"Insert a new block before the selected block(s)."
),
keyCombination: {
modifier: "primaryAlt",
character: "t"
}
});
registerShortcut({
name: "core/block-editor/insert-after",
category: "block",
description: (0,external_wp_i18n_namespaceObject.__)(
"Insert a new block after the selected block(s)."
),
keyCombination: {
modifier: "primaryAlt",
character: "y"
}
});
registerShortcut({
name: "core/block-editor/delete-multi-selection",
category: "block",
description: (0,external_wp_i18n_namespaceObject.__)("Delete selection."),
keyCombination: {
character: "del"
},
aliases: [
{
character: "backspace"
}
]
});
registerShortcut({
name: "core/block-editor/select-all",
category: "selection",
description: (0,external_wp_i18n_namespaceObject.__)(
"Select all text when typing. Press again to select all blocks."
),
keyCombination: {
modifier: "primary",
character: "a"
}
});
registerShortcut({
name: "core/block-editor/unselect",
category: "selection",
description: (0,external_wp_i18n_namespaceObject.__)("Clear selection."),
keyCombination: {
character: "escape"
}
});
registerShortcut({
name: "core/block-editor/multi-text-selection",
category: "selection",
description: (0,external_wp_i18n_namespaceObject.__)("Select text across multiple blocks."),
keyCombination: {
modifier: "shift",
character: "arrow"
}
});
registerShortcut({
name: "core/block-editor/focus-toolbar",
category: "global",
description: (0,external_wp_i18n_namespaceObject.__)("Navigate to the nearest toolbar."),
keyCombination: {
modifier: "alt",
character: "F10"
}
});
registerShortcut({
name: "core/block-editor/move-up",
category: "block",
description: (0,external_wp_i18n_namespaceObject.__)("Move the selected block(s) up."),
keyCombination: {
modifier: "secondary",
character: "t"
}
});
registerShortcut({
name: "core/block-editor/move-down",
category: "block",
description: (0,external_wp_i18n_namespaceObject.__)("Move the selected block(s) down."),
keyCombination: {
modifier: "secondary",
character: "y"
}
});
registerShortcut({
name: "core/block-editor/collapse-list-view",
category: "list-view",
description: (0,external_wp_i18n_namespaceObject.__)("Collapse all other items."),
keyCombination: {
modifier: "alt",
character: "l"
}
});
registerShortcut({
name: "core/block-editor/group",
category: "block",
description: (0,external_wp_i18n_namespaceObject.__)(
"Create a group block from the selected multiple blocks."
),
keyCombination: {
modifier: "primary",
character: "g"
}
});
registerShortcut({
name: "core/block-editor/toggle-block-visibility",
category: "block",
description: (0,external_wp_i18n_namespaceObject.__)("Show or hide the selected block(s)."),
keyCombination: {
modifier: "primaryShift",
character: "h"
}
});
}, [registerShortcut]);
return null;
}
KeyboardShortcuts.Register = KeyboardShortcutsRegister;
var keyboard_shortcuts_default = KeyboardShortcuts;
;// ./node_modules/@wordpress/block-editor/build-module/components/provider/use-media-upload-settings.js
function useMediaUploadSettings(settings = {}) {
return (0,external_wp_element_namespaceObject.useMemo)(
() => ({
mediaUpload: settings.mediaUpload,
mediaSideload: settings.mediaSideload,
maxUploadFileSize: settings.maxUploadFileSize,
allowedMimeTypes: settings.allowedMimeTypes
}),
[settings]
);
}
var use_media_upload_settings_default = useMediaUploadSettings;
;// ./node_modules/@wordpress/block-editor/build-module/components/provider/index.js
const provider_noop = () => {
};
function mediaUpload(registry, {
allowedTypes,
additionalData = {},
filesList,
onError = provider_noop,
onFileChange,
onSuccess,
onBatchSuccess
}) {
void registry.dispatch(store_store).addItems({
files: filesList,
onChange: onFileChange,
onSuccess,
onBatchSuccess,
onError: ({ message }) => onError(message),
additionalData,
allowedTypes
});
}
const ExperimentalBlockEditorProvider = with_registry_provider_with_registry_provider_default(
(props) => {
const {
settings: _settings,
registry,
stripExperimentalSettings = false
} = props;
const mediaUploadSettings = use_media_upload_settings_default(_settings);
let settings = _settings;
if (window.__experimentalMediaProcessing && _settings.mediaUpload) {
settings = (0,external_wp_element_namespaceObject.useMemo)(
() => ({
..._settings,
mediaUpload: mediaUpload.bind(null, registry)
}),
[_settings, registry]
);
}
const { __experimentalUpdateSettings } = unlock(
(0,external_wp_data_namespaceObject.useDispatch)(store)
);
(0,external_wp_element_namespaceObject.useEffect)(() => {
__experimentalUpdateSettings(
{
...settings,
__internalIsInitialized: true
},
{
stripExperimentalSettings,
reset: true
}
);
}, [
settings,
stripExperimentalSettings,
__experimentalUpdateSettings
]);
useBlockSync(props);
const children = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SlotFillProvider, { passthrough: true, children: [
!settings?.isPreviewMode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts_default.Register, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRefsProvider, { children: props.children })
] });
if (window.__experimentalMediaProcessing) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
provider_default,
{
settings: mediaUploadSettings,
useSubRegistry: false,
children
}
);
}
return children;
}
);
const BlockEditorProvider = (props) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalBlockEditorProvider, { ...props, stripExperimentalSettings: true, children: props.children });
};
var provider_provider_default = BlockEditorProvider;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-context/index.js
const block_context_Context = (0,external_wp_element_namespaceObject.createContext)({});
block_context_Context.displayName = "BlockContext";
function BlockContextProvider({ value, children }) {
const context = (0,external_wp_element_namespaceObject.useContext)(block_context_Context);
const nextValue = (0,external_wp_element_namespaceObject.useMemo)(
() => ({ ...context, ...value }),
[context, value]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_context_Context.Provider, { value: nextValue, children });
}
var block_context_default = block_context_Context;
;// ./node_modules/@wordpress/block-editor/build-module/utils/block-bindings.js
const DEFAULT_ATTRIBUTE = "__default";
const PATTERN_OVERRIDES_SOURCE = "core/pattern-overrides";
function isObjectEmpty(object) {
return !object || Object.keys(object).length === 0;
}
function hasPatternOverridesDefaultBinding(bindings) {
return bindings?.[DEFAULT_ATTRIBUTE]?.source === PATTERN_OVERRIDES_SOURCE;
}
function replacePatternOverridesDefaultBinding(bindings, supportedAttributes) {
if (hasPatternOverridesDefaultBinding(bindings)) {
const bindingsWithDefaults = {};
for (const attributeName of supportedAttributes) {
const bindingSource = bindings[attributeName] ? bindings[attributeName] : { source: PATTERN_OVERRIDES_SOURCE };
bindingsWithDefaults[attributeName] = bindingSource;
}
return bindingsWithDefaults;
}
return bindings;
}
function useBlockBindingsUtils(clientId) {
const { clientId: contextClientId } = useBlockEditContext();
const blockClientId = clientId || contextClientId;
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const { getBlockAttributes } = (0,external_wp_data_namespaceObject.useRegistry)().select(store);
const updateBlockBindings = (bindings) => {
const { metadata: { bindings: currentBindings, ...metadata } = {} } = getBlockAttributes(blockClientId);
const newBindings = { ...currentBindings };
Object.entries(bindings).forEach(([attribute, binding]) => {
if (!binding && newBindings[attribute]) {
delete newBindings[attribute];
return;
}
newBindings[attribute] = binding;
});
const newMetadata = {
...metadata,
bindings: newBindings
};
if (isObjectEmpty(newMetadata.bindings)) {
delete newMetadata.bindings;
}
updateBlockAttributes(blockClientId, {
metadata: isObjectEmpty(newMetadata) ? void 0 : newMetadata
});
};
const removeAllBlockBindings = () => {
const { metadata: { bindings, ...metadata } = {} } = getBlockAttributes(blockClientId);
updateBlockAttributes(blockClientId, {
metadata: isObjectEmpty(metadata) ? void 0 : metadata
});
};
return { updateBlockBindings, removeAllBlockBindings };
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/private-block-context.js
const PrivateBlockContext = (0,external_wp_element_namespaceObject.createContext)({});
PrivateBlockContext.displayName = "PrivateBlockContext";
;// ./node_modules/@wordpress/block-editor/build-module/components/block-edit/edit.js
const DEFAULT_BLOCK_CONTEXT = {};
const Edit = (props) => {
const { name } = props;
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name);
if (!blockType) {
return null;
}
const Component = blockType.edit || blockType.save;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { ...props });
};
const EditWithFilters = (0,external_wp_components_namespaceObject.withFilters)("editor.BlockEdit")(Edit);
const EditWithGeneratedProps = (props) => {
const { name, clientId, attributes, setAttributes } = props;
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name);
const blockContext = (0,external_wp_element_namespaceObject.useContext)(block_context_default);
const registeredSources = (0,external_wp_data_namespaceObject.useSelect)(
(select) => unlock(select(external_wp_blocks_namespaceObject.store)).getAllBlockBindingsSources(),
[]
);
const { bindableAttributes } = (0,external_wp_element_namespaceObject.useContext)(PrivateBlockContext);
const { blockBindings, context, hasPatternOverrides } = (0,external_wp_element_namespaceObject.useMemo)(() => {
const computedContext = blockType?.usesContext ? Object.fromEntries(
Object.entries(blockContext).filter(
([key]) => blockType.usesContext.includes(key)
)
) : DEFAULT_BLOCK_CONTEXT;
if (attributes?.metadata?.bindings) {
Object.values(attributes?.metadata?.bindings || {}).forEach(
(binding) => {
registeredSources[binding?.source]?.usesContext?.forEach(
(key) => {
computedContext[key] = blockContext[key];
}
);
}
);
}
return {
blockBindings: replacePatternOverridesDefaultBinding(
attributes?.metadata?.bindings,
bindableAttributes
),
context: computedContext,
hasPatternOverrides: hasPatternOverridesDefaultBinding(
attributes?.metadata?.bindings
)
};
}, [
name,
blockType?.usesContext,
blockContext,
attributes?.metadata?.bindings,
registeredSources
]);
const computedAttributes = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
if (!blockBindings) {
return attributes;
}
const attributesFromSources = {};
const blockBindingsBySource = /* @__PURE__ */ new Map();
for (const [attributeName, binding] of Object.entries(
blockBindings
)) {
const { source: sourceName, args: sourceArgs } = binding;
const source = registeredSources[sourceName];
if (!source || !bindableAttributes?.includes(attributeName)) {
continue;
}
blockBindingsBySource.set(source, {
...blockBindingsBySource.get(source),
[attributeName]: {
args: sourceArgs
}
});
}
if (blockBindingsBySource.size) {
for (const [source, bindings] of blockBindingsBySource) {
let values = {};
if (!source.getValues) {
Object.keys(bindings).forEach((attr) => {
values[attr] = source.label;
});
} else {
values = source.getValues({
select,
context,
clientId,
bindings
});
}
for (const [attributeName, value] of Object.entries(
values
)) {
if (attributeName === "url" && (!value || !isURLLike(value))) {
attributesFromSources[attributeName] = null;
} else {
attributesFromSources[attributeName] = value;
}
}
}
}
return {
...attributes,
...attributesFromSources
};
},
[
attributes,
bindableAttributes,
blockBindings,
clientId,
context,
name,
registeredSources
]
);
const setBoundAttributes = (0,external_wp_element_namespaceObject.useCallback)(
(nextAttributes) => {
if (!blockBindings) {
setAttributes(nextAttributes);
return;
}
registry.batch(() => {
const keptAttributes = { ...nextAttributes };
const blockBindingsBySource = /* @__PURE__ */ new Map();
for (const [attributeName, newValue] of Object.entries(
keptAttributes
)) {
if (!blockBindings[attributeName] || !bindableAttributes?.includes(attributeName)) {
continue;
}
const binding = blockBindings[attributeName];
const source = registeredSources[binding?.source];
if (!source?.setValues) {
continue;
}
blockBindingsBySource.set(source, {
...blockBindingsBySource.get(source),
[attributeName]: {
args: binding.args,
newValue
}
});
delete keptAttributes[attributeName];
}
if (blockBindingsBySource.size) {
for (const [
source,
bindings
] of blockBindingsBySource) {
source.setValues({
select: registry.select,
dispatch: registry.dispatch,
context,
clientId,
bindings
});
}
}
const hasParentPattern = !!context["pattern/overrides"];
if (
// Don't update non-connected attributes if the block is using pattern overrides
// and the editing is happening while overriding the pattern (not editing the original).
!(hasPatternOverrides && hasParentPattern) && Object.keys(keptAttributes).length
) {
if (hasPatternOverrides) {
delete keptAttributes.caption;
delete keptAttributes.href;
}
setAttributes(keptAttributes);
}
});
},
[
bindableAttributes,
blockBindings,
clientId,
context,
hasPatternOverrides,
setAttributes,
registeredSources,
name,
registry
]
);
if (!blockType) {
return null;
}
if (blockType.apiVersion > 1) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
EditWithFilters,
{
...props,
attributes: computedAttributes,
context,
setAttributes: setBoundAttributes
}
);
}
const generatedClassName = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, "className", true) ? (0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(name) : null;
const className = dist_clsx(
generatedClassName,
attributes?.className,
props.className
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
EditWithFilters,
{
...props,
attributes: computedAttributes,
className,
context,
setAttributes: setBoundAttributes
}
);
};
var edit_default = EditWithGeneratedProps;
;// ./node_modules/@wordpress/icons/build-module/library/more-vertical.js
var more_vertical_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/warning/index.js
function Warning({ className, actions, children, secondaryActions }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { style: { display: "contents", all: "initial" }, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx(className, "block-editor-warning"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-warning__contents", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "block-editor-warning__message", children }),
(actions?.length > 0 || secondaryActions) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-warning__actions", children: [
actions?.length > 0 && actions.map((action, i) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: "block-editor-warning__action",
children: action
},
i
)),
secondaryActions && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropdownMenu,
{
className: "block-editor-warning__secondary",
icon: more_vertical_default,
label: (0,external_wp_i18n_namespaceObject.__)("More options"),
popoverProps: {
placement: "bottom-end",
className: "block-editor-warning__dropdown"
},
noIcons: true,
children: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: secondaryActions.map(
(item, pos) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: item.onClick,
children: item.title
},
pos
)
) })
}
)
] })
] }) }) });
}
var warning_default = Warning;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-edit/multiple-usage-warning.js
function MultipleUsageWarning({
originalBlockClientId,
name,
onReplace
}) {
const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
warning_default,
{
actions: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "secondary",
onClick: () => selectBlock(originalBlockClientId),
children: (0,external_wp_i18n_namespaceObject.__)("Find original")
},
"find-original"
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "secondary",
onClick: () => onReplace([]),
children: (0,external_wp_i18n_namespaceObject.__)("Remove")
},
"remove"
)
],
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("strong", { children: [
blockType?.title,
": "
] }),
(0,external_wp_i18n_namespaceObject.__)("This block can only be used once.")
]
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-edit/index.js
function BlockEdit({
mayDisplayControls,
mayDisplayParentControls,
blockEditingMode,
isPreviewMode,
// The remaining props are passed through the BlockEdit filters and are thus
// public API!
...props
}) {
const {
name,
isSelected,
clientId,
attributes = {},
__unstableLayoutClassNames
} = props;
const { layout = null, metadata = {} } = attributes;
const { bindings } = metadata;
const layoutSupport = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, "layout", false) || (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, "__experimentalLayout", false);
const { originalBlockClientId } = (0,external_wp_element_namespaceObject.useContext)(PrivateBlockContext);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
Provider,
{
value: (0,external_wp_element_namespaceObject.useMemo)(
() => ({
name,
isSelected,
clientId,
layout: layoutSupport ? layout : null,
__unstableLayoutClassNames,
// We use symbols in favour of an __unstable prefix to avoid
// usage outside of the package (this context is exposed).
[mayDisplayControlsKey]: mayDisplayControls,
[mayDisplayParentControlsKey]: mayDisplayParentControls,
[blockEditingModeKey]: blockEditingMode,
[blockBindingsKey]: bindings,
[isPreviewModeKey]: isPreviewMode
}),
[
name,
isSelected,
clientId,
layoutSupport,
layout,
__unstableLayoutClassNames,
mayDisplayControls,
mayDisplayParentControls,
blockEditingMode,
bindings,
isPreviewMode
]
),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_default, { ...props }),
originalBlockClientId && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
MultipleUsageWarning,
{
originalBlockClientId,
name,
onReplace: props.onReplace
}
)
]
}
);
}
// EXTERNAL MODULE: ./node_modules/diff/lib/diff/character.js
var character = __webpack_require__(8021);
;// ./node_modules/@wordpress/block-editor/build-module/components/block-compare/block-view.js
function BlockView({
title,
rawContent,
renderedContent,
action,
actionText,
className
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-compare__content", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "block-editor-block-compare__heading", children: title }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-compare__html", children: rawContent }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-compare__preview edit-post-visual-editor", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: (0,external_wp_dom_namespaceObject.safeHTML)(renderedContent) }) })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-compare__action", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "secondary",
tabIndex: "0",
onClick: action,
children: actionText
}
) })
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-compare/index.js
function BlockCompare({
block,
onKeep,
onConvert,
convertor,
convertButtonText
}) {
function getDifference(originalContent, newContent) {
const difference2 = (0,character/* diffChars */.JJ)(originalContent, newContent);
return difference2.map((item, pos) => {
const classes = dist_clsx({
"block-editor-block-compare__added": item.added,
"block-editor-block-compare__removed": item.removed
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: classes, children: item.value }, pos);
});
}
function getConvertedContent(convertedBlock) {
const newBlocks = Array.isArray(convertedBlock) ? convertedBlock : [convertedBlock];
const newContent = newBlocks.map(
(item) => (0,external_wp_blocks_namespaceObject.getSaveContent)(item.name, item.attributes, item.innerBlocks)
);
return newContent.join("");
}
const converted = getConvertedContent(convertor(block));
const difference = getDifference(block.originalContent, converted);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-compare__wrapper", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockView,
{
title: (0,external_wp_i18n_namespaceObject.__)("Current"),
className: "block-editor-block-compare__current",
action: onKeep,
actionText: (0,external_wp_i18n_namespaceObject.__)("Convert to HTML"),
rawContent: block.originalContent,
renderedContent: block.originalContent
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockView,
{
title: (0,external_wp_i18n_namespaceObject.__)("After Conversion"),
className: "block-editor-block-compare__converted",
action: onConvert,
actionText: convertButtonText,
rawContent: difference,
renderedContent: converted
}
)
] });
}
var block_compare_default = BlockCompare;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-invalid-warning.js
const blockToBlocks = (block) => (0,external_wp_blocks_namespaceObject.rawHandler)({
HTML: block.originalContent
});
function BlockInvalidWarning({ clientId }) {
const { block, canInsertHTMLBlock, canInsertClassicBlock } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { canInsertBlockType, getBlock, getBlockRootClientId } = select(store);
const rootClientId = getBlockRootClientId(clientId);
return {
block: getBlock(clientId),
canInsertHTMLBlock: canInsertBlockType(
"core/html",
rootClientId
),
canInsertClassicBlock: canInsertBlockType(
"core/freeform",
rootClientId
)
};
},
[clientId]
);
const { replaceBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const [compare, setCompare] = (0,external_wp_element_namespaceObject.useState)(false);
const onCompareClose = (0,external_wp_element_namespaceObject.useCallback)(() => setCompare(false), []);
const convert = (0,external_wp_element_namespaceObject.useMemo)(
() => ({
toClassic() {
const classicBlock = (0,external_wp_blocks_namespaceObject.createBlock)("core/freeform", {
content: block.originalContent
});
return replaceBlock(block.clientId, classicBlock);
},
toHTML() {
const htmlBlock = (0,external_wp_blocks_namespaceObject.createBlock)("core/html", {
content: block.originalContent
});
return replaceBlock(block.clientId, htmlBlock);
},
toBlocks() {
const newBlocks = blockToBlocks(block);
return replaceBlock(block.clientId, newBlocks);
},
toRecoveredBlock() {
const recoveredBlock = (0,external_wp_blocks_namespaceObject.createBlock)(
block.name,
block.attributes,
block.innerBlocks
);
return replaceBlock(block.clientId, recoveredBlock);
}
}),
[block, replaceBlock]
);
const secondaryActions = (0,external_wp_element_namespaceObject.useMemo)(
() => [
{
// translators: Button to fix block content
title: (0,external_wp_i18n_namespaceObject._x)("Resolve", "imperative verb"),
onClick: () => setCompare(true)
},
canInsertHTMLBlock && {
title: (0,external_wp_i18n_namespaceObject.__)("Convert to HTML"),
onClick: convert.toHTML
},
canInsertClassicBlock && {
title: (0,external_wp_i18n_namespaceObject.__)("Convert to Classic Block"),
onClick: convert.toClassic
}
].filter(Boolean),
[canInsertHTMLBlock, canInsertClassicBlock, convert]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
warning_default,
{
actions: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
onClick: convert.toRecoveredBlock,
variant: "primary",
children: (0,external_wp_i18n_namespaceObject.__)("Attempt recovery")
},
"recover"
)
],
secondaryActions,
children: (0,external_wp_i18n_namespaceObject.__)("Block contains unexpected or invalid content.")
}
),
compare && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
title: (
// translators: Dialog title to fix block content
(0,external_wp_i18n_namespaceObject.__)("Resolve Block")
),
onRequestClose: onCompareClose,
className: "block-editor-block-compare",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_compare_default,
{
block,
onKeep: convert.toHTML,
onConvert: convert.toBlocks,
convertor: blockToBlocks,
convertButtonText: (0,external_wp_i18n_namespaceObject.__)("Convert to Blocks")
}
)
}
)
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-crash-warning.js
const warning = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(warning_default, { className: "block-editor-block-list__block-crash-warning", children: (0,external_wp_i18n_namespaceObject.__)("This block has encountered an error and cannot be previewed.") });
var block_crash_warning_default = () => warning;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-crash-boundary.js
class BlockCrashBoundary extends external_wp_element_namespaceObject.Component {
constructor() {
super(...arguments);
this.state = {
hasError: false
};
}
componentDidCatch() {
this.setState({
hasError: true
});
}
render() {
if (this.state.hasError) {
return this.props.fallback;
}
return this.props.children;
}
}
var block_crash_boundary_default = BlockCrashBoundary;
// EXTERNAL MODULE: ./node_modules/react-autosize-textarea/lib/index.js
var lib = __webpack_require__(4132);
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-html.js
function BlockHTML({ clientId }) {
const [html, setHtml] = (0,external_wp_element_namespaceObject.useState)("");
const block = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).getBlock(clientId),
[clientId]
);
const { updateBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const onChange = () => {
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(block.name);
if (!blockType) {
return;
}
const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(
blockType,
html,
block.attributes
);
const content = html ? html : (0,external_wp_blocks_namespaceObject.getSaveContent)(blockType, attributes);
const [isValid] = html ? (0,external_wp_blocks_namespaceObject.validateBlock)({
...block,
attributes,
originalContent: content
}) : [true];
updateBlock(clientId, {
attributes,
originalContent: content,
isValid
});
if (!html) {
setHtml(content);
}
};
(0,external_wp_element_namespaceObject.useEffect)(() => {
setHtml((0,external_wp_blocks_namespaceObject.getBlockContent)(block));
}, [block]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
lib/* default */.A,
{
className: "block-editor-block-list__block-html-textarea",
value: html,
onBlur: onChange,
onChange: (event) => setHtml(event.target.value)
}
);
}
var block_html_default = BlockHTML;
;// ./node_modules/@react-spring/rafz/dist/esm/index.js
var esm_f=esm_l(),esm_n=e=>esm_c(e,esm_f),esm_m=esm_l();esm_n.write=e=>esm_c(e,esm_m);var esm_d=esm_l();esm_n.onStart=e=>esm_c(e,esm_d);var esm_h=esm_l();esm_n.onFrame=e=>esm_c(e,esm_h);var esm_p=esm_l();esm_n.onFinish=e=>esm_c(e,esm_p);var esm_i=[];esm_n.setTimeout=(e,t)=>{let a=esm_n.now()+t,o=()=>{let F=esm_i.findIndex(z=>z.cancel==o);~F&&esm_i.splice(F,1),esm_u-=~F?1:0},s={time:a,handler:e,cancel:o};return esm_i.splice(esm_w(a),0,s),esm_u+=1,esm_v(),s};var esm_w=e=>~(~esm_i.findIndex(t=>t.time>e)||~esm_i.length);esm_n.cancel=e=>{esm_d.delete(e),esm_h.delete(e),esm_p.delete(e),esm_f.delete(e),esm_m.delete(e)};esm_n.sync=e=>{T=!0,esm_n.batchedUpdates(e),T=!1};esm_n.throttle=e=>{let t;function a(){try{e(...t)}finally{t=null}}function o(...s){t=s,esm_n.onStart(a)}return o.handler=e,o.cancel=()=>{esm_d.delete(a),t=null},o};var esm_y=typeof window<"u"?window.requestAnimationFrame:()=>{};esm_n.use=e=>esm_y=e;esm_n.now=typeof performance<"u"?()=>performance.now():Date.now;esm_n.batchedUpdates=e=>e();esm_n.catch=console.error;esm_n.frameLoop="always";esm_n.advance=()=>{esm_n.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):esm_x()};var esm_r=-1,esm_u=0,T=!1;function esm_c(e,t){T?(t.delete(e),e(0)):(t.add(e),esm_v())}function esm_v(){esm_r<0&&(esm_r=0,esm_n.frameLoop!=="demand"&&esm_y(esm_b))}function esm_R(){esm_r=-1}function esm_b(){~esm_r&&(esm_y(esm_b),esm_n.batchedUpdates(esm_x))}function esm_x(){let e=esm_r;esm_r=esm_n.now();let t=esm_w(esm_r);if(t&&(Q(esm_i.splice(0,t),a=>a.handler()),esm_u-=t),!esm_u){esm_R();return}esm_d.flush(),esm_f.flush(e?Math.min(64,esm_r-e):16.667),esm_h.flush(),esm_m.flush(),esm_p.flush()}function esm_l(){let e=new Set,t=e;return{add(a){esm_u+=t==e&&!e.has(a)?1:0,e.add(a)},delete(a){return esm_u-=t==e&&e.has(a)?1:0,e.delete(a)},flush(a){t.size&&(e=new Set,esm_u-=t.size,Q(t,o=>o(a)&&e.add(o)),esm_u+=e.size,t=e)}}}function Q(e,t){e.forEach(a=>{try{t(a)}catch(o){esm_n.catch(o)}})}var esm_S={count(){return esm_u},isRunning(){return esm_r>=0},clear(){esm_r=-1,esm_i=[],esm_d=esm_l(),esm_f=esm_l(),esm_h=esm_l(),esm_m=esm_l(),esm_p=esm_l(),esm_u=0}};
;// ./node_modules/@react-spring/shared/dist/esm/index.js
var ze=Object.defineProperty;var Le=(e,t)=>{for(var r in t)ze(e,r,{get:t[r],enumerable:!0})};var dist_esm_p={};Le(dist_esm_p,{assign:()=>U,colors:()=>dist_esm_c,createStringInterpolator:()=>esm_k,skipAnimation:()=>ee,to:()=>J,willAdvance:()=>dist_esm_S});function Y(){}var mt=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),dist_esm_l={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function bt(e,t){if(dist_esm_l.arr(e)){if(!dist_esm_l.arr(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return e===t}var esm_Ve=(e,t)=>e.forEach(t);function xt(e,t,r){if(dist_esm_l.arr(e)){for(let n=0;n<e.length;n++)t.call(r,e[n],`${n}`);return}for(let n in e)e.hasOwnProperty(n)&&t.call(r,e[n],n)}var ht=e=>dist_esm_l.und(e)?[]:dist_esm_l.arr(e)?e:[e];function Pe(e,t){if(e.size){let r=Array.from(e);e.clear(),esm_Ve(r,t)}}var yt=(e,...t)=>Pe(e,r=>r(...t)),dist_esm_h=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);var esm_k,J,dist_esm_c=null,ee=!1,dist_esm_S=Y,U=e=>{e.to&&(J=e.to),e.now&&(esm_n.now=e.now),e.colors!==void 0&&(dist_esm_c=e.colors),e.skipAnimation!=null&&(ee=e.skipAnimation),e.createStringInterpolator&&(esm_k=e.createStringInterpolator),e.requestAnimationFrame&&esm_n.use(e.requestAnimationFrame),e.batchedUpdates&&(esm_n.batchedUpdates=e.batchedUpdates),e.willAdvance&&(dist_esm_S=e.willAdvance),e.frameLoop&&(esm_n.frameLoop=e.frameLoop)};var esm_E=new Set,dist_esm_u=[],esm_H=[],A=0,qe={get idle(){return!esm_E.size&&!dist_esm_u.length},start(e){A>e.priority?(esm_E.add(e),esm_n.onStart($e)):(te(e),esm_n(B))},advance:B,sort(e){if(A)esm_n.onFrame(()=>qe.sort(e));else{let t=dist_esm_u.indexOf(e);~t&&(dist_esm_u.splice(t,1),re(e))}},clear(){dist_esm_u=[],esm_E.clear()}};function $e(){esm_E.forEach(te),esm_E.clear(),esm_n(B)}function te(e){dist_esm_u.includes(e)||re(e)}function re(e){dist_esm_u.splice(Ge(dist_esm_u,t=>t.priority>e.priority),0,e)}function B(e){let t=esm_H;for(let r=0;r<dist_esm_u.length;r++){let n=dist_esm_u[r];A=n.priority,n.idle||(dist_esm_S(n),n.advance(e),n.idle||t.push(n))}return A=0,esm_H=dist_esm_u,esm_H.length=0,dist_esm_u=t,dist_esm_u.length>0}function Ge(e,t){let r=e.findIndex(t);return r<0?e.length:r}var ne=(e,t,r)=>Math.min(Math.max(r,e),t);var It={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199};var dist_esm_d="[-+]?\\d*\\.?\\d+",esm_M=dist_esm_d+"%";function C(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var oe=new RegExp("rgb"+C(dist_esm_d,dist_esm_d,dist_esm_d)),fe=new RegExp("rgba"+C(dist_esm_d,dist_esm_d,dist_esm_d,dist_esm_d)),ae=new RegExp("hsl"+C(dist_esm_d,esm_M,esm_M)),ie=new RegExp("hsla"+C(dist_esm_d,esm_M,esm_M,dist_esm_d)),se=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ue=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,le=/^#([0-9a-fA-F]{6})$/,esm_ce=/^#([0-9a-fA-F]{8})$/;function be(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=le.exec(e))?parseInt(t[1]+"ff",16)>>>0:dist_esm_c&&dist_esm_c[e]!==void 0?dist_esm_c[e]:(t=oe.exec(e))?(dist_esm_y(t[1])<<24|dist_esm_y(t[2])<<16|dist_esm_y(t[3])<<8|255)>>>0:(t=fe.exec(e))?(dist_esm_y(t[1])<<24|dist_esm_y(t[2])<<16|dist_esm_y(t[3])<<8|me(t[4]))>>>0:(t=se.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=esm_ce.exec(e))?parseInt(t[1],16)>>>0:(t=ue.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=ae.exec(e))?(de(esm_pe(t[1]),esm_z(t[2]),esm_z(t[3]))|255)>>>0:(t=ie.exec(e))?(de(esm_pe(t[1]),esm_z(t[2]),esm_z(t[3]))|me(t[4]))>>>0:null}function esm_j(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function de(e,t,r){let n=r<.5?r*(1+t):r+t-r*t,f=2*r-n,o=esm_j(f,n,e+1/3),i=esm_j(f,n,e),s=esm_j(f,n,e-1/3);return Math.round(o*255)<<24|Math.round(i*255)<<16|Math.round(s*255)<<8}function dist_esm_y(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function esm_pe(e){return(parseFloat(e)%360+360)%360/360}function me(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function esm_z(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function D(e){let t=be(e);if(t===null)return e;t=t||0;let r=(t&4278190080)>>>24,n=(t&16711680)>>>16,f=(t&65280)>>>8,o=(t&255)/255;return`rgba(${r}, ${n}, ${f}, ${o})`}var W=(e,t,r)=>{if(dist_esm_l.fun(e))return e;if(dist_esm_l.arr(e))return W({range:e,output:t,extrapolate:r});if(dist_esm_l.str(e.output[0]))return esm_k(e);let n=e,f=n.output,o=n.range||[0,1],i=n.extrapolateLeft||n.extrapolate||"extend",s=n.extrapolateRight||n.extrapolate||"extend",x=n.easing||(a=>a);return a=>{let F=He(a,o);return Ue(a,o[F],o[F+1],f[F],f[F+1],x,i,s,n.map)}};function Ue(e,t,r,n,f,o,i,s,x){let a=x?x(e):e;if(a<t){if(i==="identity")return a;i==="clamp"&&(a=t)}if(a>r){if(s==="identity")return a;s==="clamp"&&(a=r)}return n===f?n:t===r?e<=t?n:f:(t===-1/0?a=-a:r===1/0?a=a-t:a=(a-t)/(r-t),a=o(a),n===-1/0?a=-a:f===1/0?a=a+n:a=a*(f-n)+n,a)}function He(e,t){for(var r=1;r<t.length-1&&!(t[r]>=e);++r);return r-1}var Be=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);let n=r*e,f=t==="end"?Math.floor(n):Math.ceil(n);return ne(0,1,f/e)},P=1.70158,L=P*1.525,xe=P+1,he=2*Math.PI/3,ye=2*Math.PI/4.5,V=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,Lt={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>xe*e*e*e-P*e*e,easeOutBack:e=>1+xe*Math.pow(e-1,3)+P*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((L+1)*2*e-L)/2:(Math.pow(2*e-2,2)*((L+1)*(e*2-2)+L)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*he),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*he)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*ye))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*ye)/2+1,easeInBounce:e=>1-V(1-e),easeOutBounce:V,easeInOutBounce:e=>e<.5?(1-V(1-2*e))/2:(1+V(2*e-1))/2,steps:Be};var esm_g=Symbol.for("FluidValue.get"),dist_esm_m=Symbol.for("FluidValue.observers");var Pt=e=>Boolean(e&&e[esm_g]),ve=e=>e&&e[esm_g]?e[esm_g]():e,esm_qt=e=>e[dist_esm_m]||null;function je(e,t){e.eventObserved?e.eventObserved(t):e(t)}function $t(e,t){let r=e[dist_esm_m];r&&r.forEach(n=>{je(n,t)})}var esm_ge=class{[esm_g];[dist_esm_m];constructor(t){if(!t&&!(t=this.get))throw Error("Unknown getter");De(this,t)}},De=(e,t)=>Ee(e,esm_g,t);function Gt(e,t){if(e[esm_g]){let r=e[dist_esm_m];r||Ee(e,dist_esm_m,r=new Set),r.has(t)||(r.add(t),e.observerAdded&&e.observerAdded(r.size,t))}return t}function Qt(e,t){let r=e[dist_esm_m];if(r&&r.has(t)){let n=r.size-1;n?r.delete(t):e[dist_esm_m]=null,e.observerRemoved&&e.observerRemoved(n,t)}}var Ee=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0});var O=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,esm_Oe=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,K=new RegExp(`(${O.source})(%|[a-z]+)`,"i"),we=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,dist_esm_b=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;var esm_N=e=>{let[t,r]=We(e);if(!t||dist_esm_h())return e;let n=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(n)return n.trim();if(r&&r.startsWith("--")){let f=window.getComputedStyle(document.documentElement).getPropertyValue(r);return f||e}else{if(r&&dist_esm_b.test(r))return esm_N(r);if(r)return r}return e},We=e=>{let t=dist_esm_b.exec(e);if(!t)return[,];let[,r,n]=t;return[r,n]};var _,esm_Ke=(e,t,r,n,f)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(n)}, ${f})`,Xt=e=>{_||(_=dist_esm_c?new RegExp(`(${Object.keys(dist_esm_c).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map(o=>ve(o).replace(dist_esm_b,esm_N).replace(esm_Oe,D).replace(_,D)),r=t.map(o=>o.match(O).map(Number)),f=r[0].map((o,i)=>r.map(s=>{if(!(i in s))throw Error('The arity of each "output" value must be equal');return s[i]})).map(o=>W({...e,output:o}));return o=>{let i=!K.test(t[0])&&t.find(x=>K.test(x))?.replace(O,""),s=0;return t[0].replace(O,()=>`${f[s++](o)}${i||""}`).replace(we,esm_Ke)}};var Z="react-spring: ",Te=e=>{let t=e,r=!1;if(typeof t!="function")throw new TypeError(`${Z}once requires a function parameter`);return(...n)=>{r||(t(...n),r=!0)}},Ne=Te(console.warn);function Jt(){Ne(`${Z}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var _e=Te(console.warn);function er(){_e(`${Z}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function esm_or(e){return dist_esm_l.str(e)&&(e[0]=="#"||/\d/.test(e)||!dist_esm_h()&&dist_esm_b.test(e)||e in(dist_esm_c||{}))}var dist_esm_v,q=new WeakMap,Ze=e=>e.forEach(({target:t,contentRect:r})=>q.get(t)?.forEach(n=>n(r)));function Fe(e,t){dist_esm_v||typeof ResizeObserver<"u"&&(dist_esm_v=new ResizeObserver(Ze));let r=q.get(t);return r||(r=new Set,q.set(t,r)),r.add(e),dist_esm_v&&dist_esm_v.observe(t),()=>{let n=q.get(t);!n||(n.delete(e),!n.size&&dist_esm_v&&dist_esm_v.unobserve(t))}}var esm_$=new Set,dist_esm_w,esm_Xe=()=>{let e=()=>{esm_$.forEach(t=>t({width:window.innerWidth,height:window.innerHeight}))};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},Ie=e=>(esm_$.add(e),dist_esm_w||(dist_esm_w=esm_Xe()),()=>{esm_$.delete(e),!esm_$.size&&dist_esm_w&&(dist_esm_w(),dist_esm_w=void 0)});var ke=(e,{container:t=document.documentElement}={})=>t===document.documentElement?Ie(e):Fe(e,t);var Se=(e,t,r)=>t-e===0?1:(r-e)/(t-e);var esm_Ye={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}},esm_G=class{callback;container;info;constructor(t,r){this.callback=t,this.container=r,this.info={time:0,x:this.createAxis(),y:this.createAxis()}}createAxis=()=>({current:0,progress:0,scrollLength:0});updateAxis=t=>{let r=this.info[t],{length:n,position:f}=esm_Ye[t];r.current=this.container[`scroll${f}`],r.scrollLength=this.container["scroll"+n]-this.container["client"+n],r.progress=Se(0,r.scrollLength,r.current)};update=()=>{this.updateAxis("x"),this.updateAxis("y")};sendEvent=()=>{this.callback(this.info)};advance=()=>{this.update(),this.sendEvent()}};var esm_T=new WeakMap,Ae=new WeakMap,X=new WeakMap,Me=e=>e===document.documentElement?window:e,yr=(e,{container:t=document.documentElement}={})=>{let r=X.get(t);r||(r=new Set,X.set(t,r));let n=new esm_G(e,t);if(r.add(n),!esm_T.has(t)){let o=()=>(r?.forEach(s=>s.advance()),!0);esm_T.set(t,o);let i=Me(t);window.addEventListener("resize",o,{passive:!0}),t!==document.documentElement&&Ae.set(t,ke(o,{container:t})),i.addEventListener("scroll",o,{passive:!0})}let f=esm_T.get(t);return Re(f),()=>{Re.cancel(f);let o=X.get(t);if(!o||(o.delete(n),o.size))return;let i=esm_T.get(t);esm_T.delete(t),i&&(Me(t).removeEventListener("scroll",i),window.removeEventListener("resize",i),Ae.get(t)?.())}};function Er(e){let t=Je(null);return t.current===null&&(t.current=e()),t.current}var esm_Q=dist_esm_h()?external_React_.useEffect:external_React_.useLayoutEffect;var Ce=()=>{let e=(0,external_React_.useRef)(!1);return esm_Q(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function Mr(){let e=(0,external_React_.useState)()[1],t=Ce();return()=>{t.current&&e(Math.random())}}function Lr(e,t){let[r]=(0,external_React_.useState)(()=>({inputs:t,result:e()})),n=(0,external_React_.useRef)(),f=n.current,o=f;return o?Boolean(t&&o.inputs&&it(t,o.inputs))||(o={inputs:t,result:e()}):o=r,(0,external_React_.useEffect)(()=>{n.current=o,f==r&&(r.inputs=r.result=void 0)},[o]),o.result}function it(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}var $r=e=>(0,external_React_.useEffect)(e,ut),ut=[];function Ur(e){let t=ct();return lt(()=>{t.current=e}),t.current}var Wr=()=>{let[e,t]=dt(null);return esm_Q(()=>{let r=window.matchMedia("(prefers-reduced-motion)"),n=f=>{t(f.matches),U({skipAnimation:f.matches})};return n(r),r.addEventListener("change",n),()=>{r.removeEventListener("change",n)}},[]),e};
;// ./node_modules/@react-spring/animated/dist/esm/index.js
var animated_dist_esm_h=Symbol.for("Animated:node"),animated_dist_esm_v=e=>!!e&&e[animated_dist_esm_h]===e,dist_esm_k=e=>e&&e[animated_dist_esm_h],esm_D=(e,t)=>mt(e,animated_dist_esm_h,t),F=e=>e&&e[animated_dist_esm_h]&&e[animated_dist_esm_h].getPayload(),animated_dist_esm_c=class{payload;constructor(){esm_D(this,this)}getPayload(){return this.payload||[]}};var animated_dist_esm_l=class extends animated_dist_esm_c{constructor(r){super();this._value=r;dist_esm_l.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(r){return new animated_dist_esm_l(r)}getPayload(){return[this]}getValue(){return this._value}setValue(r,n){return dist_esm_l.num(r)&&(this.lastPosition=r,n&&(r=Math.round(r/n)*n,this.done&&(this.lastPosition=r))),this._value===r?!1:(this._value=r,!0)}reset(){let{done:r}=this;this.done=!1,dist_esm_l.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,r&&(this.lastVelocity=null),this.v0=null)}};var animated_dist_esm_d=class extends animated_dist_esm_l{_string=null;_toString;constructor(t){super(0),this._toString=W({output:[t,t]})}static create(t){return new animated_dist_esm_d(t)}getValue(){let t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if(dist_esm_l.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=W({output:[this.getValue(),t]})),this._value=0,super.reset()}};var dist_esm_f={dependencies:null};var animated_dist_esm_u=class extends animated_dist_esm_c{constructor(r){super();this.source=r;this.setValue(r)}getValue(r){let n={};return xt(this.source,(a,i)=>{animated_dist_esm_v(a)?n[i]=a.getValue(r):Pt(a)?n[i]=ve(a):r||(n[i]=a)}),n}setValue(r){this.source=r,this.payload=this._makePayload(r)}reset(){this.payload&&esm_Ve(this.payload,r=>r.reset())}_makePayload(r){if(r){let n=new Set;return xt(r,this._addToPayload,n),Array.from(n)}}_addToPayload(r){dist_esm_f.dependencies&&Pt(r)&&dist_esm_f.dependencies.add(r);let n=F(r);n&&esm_Ve(n,a=>this.add(a))}};var animated_dist_esm_y=class extends animated_dist_esm_u{constructor(t){super(t)}static create(t){return new animated_dist_esm_y(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){let r=this.getPayload();return t.length==r.length?r.map((n,a)=>n.setValue(t[a])).some(Boolean):(super.setValue(t.map(dist_esm_z)),!0)}};function dist_esm_z(e){return(esm_or(e)?animated_dist_esm_d:animated_dist_esm_l).create(e)}function esm_Le(e){let t=dist_esm_k(e);return t?t.constructor:dist_esm_l.arr(e)?animated_dist_esm_y:esm_or(e)?animated_dist_esm_d:animated_dist_esm_l}var dist_esm_x=(e,t)=>{let r=!dist_esm_l.fun(e)||e.prototype&&e.prototype.isReactComponent;return (0,external_React_.forwardRef)((n,a)=>{let i=(0,external_React_.useRef)(null),o=r&&(0,external_React_.useCallback)(s=>{i.current=esm_ae(a,s)},[a]),[m,T]=esm_ne(n,t),W=Mr(),P=()=>{let s=i.current;if(r&&!s)return;(s?t.applyAnimatedValues(s,m.getValue(!0)):!1)===!1&&W()},_=new animated_dist_esm_b(P,T),p=(0,external_React_.useRef)();esm_Q(()=>(p.current=_,esm_Ve(T,s=>Gt(s,_)),()=>{p.current&&(esm_Ve(p.current.deps,s=>Qt(s,p.current)),esm_n.cancel(p.current.update))})),(0,external_React_.useEffect)(P,[]),$r(()=>()=>{let s=p.current;esm_Ve(s.deps,S=>Qt(S,s))});let $=t.getComponentProps(m.getValue());return external_React_.createElement(e,{...$,ref:o})})},animated_dist_esm_b=class{constructor(t,r){this.update=t;this.deps=r}eventObserved(t){t.type=="change"&&esm_n.write(this.update)}};function esm_ne(e,t){let r=new Set;return dist_esm_f.dependencies=r,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new animated_dist_esm_u(e),dist_esm_f.dependencies=null,[e,r]}function esm_ae(e,t){return e&&(dist_esm_l.fun(e)?e(t):e.current=t),t}var dist_esm_j=Symbol.for("AnimatedComponent"),dist_esm_Ke=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:r=a=>new animated_dist_esm_u(a),getComponentProps:n=a=>a}={})=>{let a={applyAnimatedValues:t,createAnimatedStyle:r,getComponentProps:n},i=o=>{let m=esm_I(o)||"Anonymous";return dist_esm_l.str(o)?o=i[o]||(i[o]=dist_esm_x(o,a)):o=o[dist_esm_j]||(o[dist_esm_j]=dist_esm_x(o,a)),o.displayName=`Animated(${m})`,o};return xt(e,(o,m)=>{dist_esm_l.arr(e)&&(m=esm_I(o)),i[m]=i(o)}),{animated:i}},esm_I=e=>dist_esm_l.str(e)?e:e&&dist_esm_l.str(e.displayName)?e.displayName:dist_esm_l.fun(e)&&e.name||null;
;// ./node_modules/@react-spring/core/dist/esm/index.js
function dist_esm_I(t,...e){return dist_esm_l.fun(t)?t(...e):t}var esm_te=(t,e)=>t===!0||!!(e&&t&&(dist_esm_l.fun(t)?t(e):ht(t).includes(e))),et=(t,e)=>dist_esm_l.obj(t)?e&&t[e]:t;var esm_ke=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,nn=t=>t,dist_esm_ne=(t,e=nn)=>{let n=rn;t.default&&t.default!==!0&&(t=t.default,n=Object.keys(t));let r={};for(let o of n){let s=e(t[o],o);dist_esm_l.und(s)||(r[o]=s)}return r},rn=["config","onProps","onStart","onChange","onPause","onResume","onRest"],on={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function sn(t){let e={},n=0;if(xt(t,(r,o)=>{on[o]||(e[o]=r,n++)}),n)return e}function esm_de(t){let e=sn(t);if(e){let n={to:e};return xt(t,(r,o)=>o in e||(n[o]=r)),n}return{...t}}function esm_me(t){return t=ve(t),dist_esm_l.arr(t)?t.map(esm_me):esm_or(t)?dist_esm_p.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function esm_Ue(t){for(let e in t)return!0;return!1}function esm_Ee(t){return dist_esm_l.fun(t)||dist_esm_l.arr(t)&&dist_esm_l.obj(t[0])}function esm_xe(t,e){t.ref?.delete(t),e?.delete(t)}function esm_he(t,e){e&&t.ref!==e&&(t.ref?.delete(t),e.add(t),t.ref=e)}function wr(t,e,n=1e3){an(()=>{if(e){let r=0;ge(t,(o,s)=>{let a=o.current;if(a.length){let i=n*e[s];isNaN(i)?i=r:r=i,ge(a,u=>{ge(u.queue,p=>{let f=p.delay;p.delay=d=>i+dist_esm_I(f||0,d)})}),o.start()}})}else{let r=Promise.resolve();ge(t,o=>{let s=o.current;if(s.length){let a=s.map(i=>{let u=i.queue;return i.queue=[],u});r=r.then(()=>(ge(s,(i,u)=>ge(a[u]||[],p=>i.queue.push(p))),Promise.all(o.start())))}})}})}var esm_mt={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};var tt={...esm_mt.default,mass:1,damping:1,easing:Lt.linear,clamp:!1},esm_we=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,tt)}};function gt(t,e,n){n&&(n={...n},esm_ht(n,e),e={...n,...e}),esm_ht(t,e),Object.assign(t,e);for(let a in tt)t[a]==null&&(t[a]=tt[a]);let{mass:r,frequency:o,damping:s}=t;return dist_esm_l.und(o)||(o<.01&&(o=.01),s<0&&(s=0),t.tension=Math.pow(2*Math.PI/o,2)*r,t.friction=4*Math.PI*s*r/o),t}function esm_ht(t,e){if(!dist_esm_l.und(e.decay))t.duration=void 0;else{let n=!dist_esm_l.und(e.tension)||!dist_esm_l.und(e.friction);(n||!dist_esm_l.und(e.frequency)||!dist_esm_l.und(e.damping)||!dist_esm_l.und(e.mass))&&(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}}var esm_yt=[],dist_esm_Le=class{changed=!1;values=esm_yt;toValues=null;fromValues=esm_yt;to;from;config=new esm_we;immediate=!1};function esm_Me(t,{key:e,props:n,defaultProps:r,state:o,actions:s}){return new Promise((a,i)=>{let u,p,f=esm_te(n.cancel??r?.cancel,e);if(f)b();else{dist_esm_l.und(n.pause)||(o.paused=esm_te(n.pause,e));let c=r?.pause;c!==!0&&(c=o.paused||esm_te(c,e)),u=dist_esm_I(n.delay||0,e),c?(o.resumeQueue.add(m),s.pause()):(s.resume(),m())}function d(){o.resumeQueue.add(m),o.timeouts.delete(p),p.cancel(),u=p.time-esm_n.now()}function m(){u>0&&!dist_esm_p.skipAnimation?(o.delayed=!0,p=esm_n.setTimeout(b,u),o.pauseQueue.add(d),o.timeouts.add(p)):b()}function b(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(d),o.timeouts.delete(p),t<=(o.cancelId||0)&&(f=!0);try{s.start({...n,callId:t,cancel:f},a)}catch(c){i(c)}}})}var esm_be=(t,e)=>e.length==1?e[0]:e.some(n=>n.cancelled)?esm_q(t.get()):e.every(n=>n.noop)?nt(t.get()):dist_esm_E(t.get(),e.every(n=>n.finished)),nt=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),dist_esm_E=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),esm_q=t=>({value:t,cancelled:!0,finished:!1});function esm_De(t,e,n,r){let{callId:o,parentId:s,onRest:a}=e,{asyncTo:i,promise:u}=n;return!s&&t===i&&!e.reset?u:n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;let p=dist_esm_ne(e,(l,h)=>h==="onRest"?void 0:l),f,d,m=new Promise((l,h)=>(f=l,d=h)),b=l=>{let h=o<=(n.cancelId||0)&&esm_q(r)||o!==n.asyncId&&dist_esm_E(r,!1);if(h)throw l.result=h,d(l),l},c=(l,h)=>{let g=new esm_Ae,x=new esm_Ne;return(async()=>{if(dist_esm_p.skipAnimation)throw esm_oe(n),x.result=dist_esm_E(r,!1),d(x),x;b(g);let S=dist_esm_l.obj(l)?{...l}:{...h,to:l};S.parentId=o,xt(p,(V,_)=>{dist_esm_l.und(S[_])&&(S[_]=V)});let A=await r.start(S);return b(g),n.paused&&await new Promise(V=>{n.resumeQueue.add(V)}),A})()},P;if(dist_esm_p.skipAnimation)return esm_oe(n),dist_esm_E(r,!1);try{let l;dist_esm_l.arr(t)?l=(async h=>{for(let g of h)await c(g)})(t):l=Promise.resolve(t(c,r.stop.bind(r))),await Promise.all([l.then(f),m]),P=dist_esm_E(r.get(),!0,!1)}catch(l){if(l instanceof esm_Ae)P=l.result;else if(l instanceof esm_Ne)P=l.result;else throw l}finally{o==n.asyncId&&(n.asyncId=s,n.asyncTo=s?i:void 0,n.promise=s?u:void 0)}return dist_esm_l.fun(a)&&esm_n.batchedUpdates(()=>{a(P,r,r.item)}),P})()}function esm_oe(t,e){Pe(t.timeouts,n=>n.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var esm_Ae=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},esm_Ne=class extends Error{result;constructor(){super("SkipAnimationSignal")}};var esm_Re=t=>t instanceof esm_X,Sn=1,esm_X=class extends esm_ge{id=Sn++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=dist_esm_k(this);return e&&e.getValue()}to(...e){return dist_esm_p.to(this,e)}interpolate(...e){return Jt(),dist_esm_p.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,n=!1){$t(this,{type:"change",parent:this,value:e,idle:n})}_onPriorityChange(e){this.idle||qe.sort(this),$t(this,{type:"priority",parent:this,priority:e})}};var esm_se=Symbol.for("SpringPhase"),esm_bt=1,rt=2,ot=4,esm_qe=t=>(t[esm_se]&esm_bt)>0,dist_esm_Q=t=>(t[esm_se]&rt)>0,esm_ye=t=>(t[esm_se]&ot)>0,st=(t,e)=>e?t[esm_se]|=rt|esm_bt:t[esm_se]&=~rt,esm_it=(t,e)=>e?t[esm_se]|=ot:t[esm_se]&=~ot;var esm_ue=class extends esm_X{key;animation=new dist_esm_Le;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,n){if(super(),!dist_esm_l.und(e)||!dist_esm_l.und(n)){let r=dist_esm_l.obj(e)?{...e}:{...n,from:e};dist_esm_l.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(dist_esm_Q(this)||this._state.asyncTo)||esm_ye(this)}get goal(){return ve(this.animation.to)}get velocity(){let e=dist_esm_k(this);return e instanceof animated_dist_esm_l?e.lastVelocity||0:e.getPayload().map(n=>n.lastVelocity||0)}get hasAnimated(){return esm_qe(this)}get isAnimating(){return dist_esm_Q(this)}get isPaused(){return esm_ye(this)}get isDelayed(){return this._state.delayed}advance(e){let n=!0,r=!1,o=this.animation,{config:s,toValues:a}=o,i=F(o.to);!i&&Pt(o.to)&&(a=ht(ve(o.to))),o.values.forEach((f,d)=>{if(f.done)return;let m=f.constructor==animated_dist_esm_d?1:i?i[d].lastPosition:a[d],b=o.immediate,c=m;if(!b){if(c=f.lastPosition,s.tension<=0){f.done=!0;return}let P=f.elapsedTime+=e,l=o.fromValues[d],h=f.v0!=null?f.v0:f.v0=dist_esm_l.arr(s.velocity)?s.velocity[d]:s.velocity,g,x=s.precision||(l==m?.005:Math.min(1,Math.abs(m-l)*.001));if(dist_esm_l.und(s.duration))if(s.decay){let S=s.decay===!0?.998:s.decay,A=Math.exp(-(1-S)*P);c=l+h/(1-S)*(1-A),b=Math.abs(f.lastPosition-c)<=x,g=h*A}else{g=f.lastVelocity==null?h:f.lastVelocity;let S=s.restVelocity||x/10,A=s.clamp?0:s.bounce,V=!dist_esm_l.und(A),_=l==m?f.v0>0:l<m,v,w=!1,C=1,$=Math.ceil(e/C);for(let L=0;L<$&&(v=Math.abs(g)>S,!(!v&&(b=Math.abs(m-c)<=x,b)));++L){V&&(w=c==m||c>m==_,w&&(g=-g*A,c=m));let N=-s.tension*1e-6*(c-m),y=-s.friction*.001*g,T=(N+y)/s.mass;g=g+T*C,c=c+g*C}}else{let S=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,f.durationProgress>0&&(f.elapsedTime=s.duration*f.durationProgress,P=f.elapsedTime+=e)),S=(s.progress||0)+P/this._memoizedDuration,S=S>1?1:S<0?0:S,f.durationProgress=S),c=l+s.easing(S)*(m-l),g=(c-f.lastPosition)/e,b=S==1}f.lastVelocity=g,Number.isNaN(c)&&(console.warn("Got NaN while animating:",this),b=!0)}i&&!i[d].done&&(b=!1),b?f.done=!0:n=!1,f.setValue(c,s.round)&&(r=!0)});let u=dist_esm_k(this),p=u.getValue();if(n){let f=ve(o.to);(p!==f||r)&&!s.decay?(u.setValue(f),this._onChange(f)):r&&s.decay&&this._onChange(p),this._stop()}else r&&this._onChange(p)}set(e){return esm_n.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(dist_esm_Q(this)){let{to:e,config:n}=this.animation;esm_n.batchedUpdates(()=>{this._onStart(),n.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,n){let r;return dist_esm_l.und(e)?(r=this.queue||[],this.queue=[]):r=[dist_esm_l.obj(e)?e:{...n,to:e}],Promise.all(r.map(o=>this._update(o))).then(o=>esm_be(this,o))}stop(e){let{to:n}=this.animation;return this._focus(this.get()),esm_oe(this._state,e&&this._lastCallId),esm_n.batchedUpdates(()=>this._stop(n,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){let n=this.key||"",{to:r,from:o}=e;r=dist_esm_l.obj(r)?r[n]:r,(r==null||esm_Ee(r))&&(r=void 0),o=dist_esm_l.obj(o)?o[n]:o,o==null&&(o=void 0);let s={to:r,from:o};return esm_qe(this)||(e.reverse&&([r,o]=[o,r]),o=ve(o),dist_esm_l.und(o)?dist_esm_k(this)||this._set(r):this._set(o)),s}_update({...e},n){let{key:r,defaultProps:o}=this;e.default&&Object.assign(o,dist_esm_ne(e,(i,u)=>/^on/.test(u)?et(i,r):i)),_t(this,e,"onProps"),esm_Ie(this,"onProps",e,this);let s=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let a=this._state;return esm_Me(++this._lastCallId,{key:r,props:e,defaultProps:o,state:a,actions:{pause:()=>{esm_ye(this)||(esm_it(this,!0),yt(a.pauseQueue),esm_Ie(this,"onPause",dist_esm_E(this,esm_Ce(this,this.animation.to)),this))},resume:()=>{esm_ye(this)&&(esm_it(this,!1),dist_esm_Q(this)&&this._resume(),yt(a.resumeQueue),esm_Ie(this,"onResume",dist_esm_E(this,esm_Ce(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(i=>{if(e.loop&&i.finished&&!(n&&i.noop)){let u=at(e);if(u)return this._update(u,!0)}return i})}_merge(e,n,r){if(n.cancel)return this.stop(!0),r(esm_q(this));let o=!dist_esm_l.und(e.to),s=!dist_esm_l.und(e.from);if(o||s)if(n.callId>this._lastToId)this._lastToId=n.callId;else return r(esm_q(this));let{key:a,defaultProps:i,animation:u}=this,{to:p,from:f}=u,{to:d=p,from:m=f}=e;s&&!o&&(!n.default||dist_esm_l.und(d))&&(d=m),n.reverse&&([d,m]=[m,d]);let b=!bt(m,f);b&&(u.from=m),m=ve(m);let c=!bt(d,p);c&&this._focus(d);let P=esm_Ee(n.to),{config:l}=u,{decay:h,velocity:g}=l;(o||s)&&(l.velocity=0),n.config&&!P&>(l,dist_esm_I(n.config,a),n.config!==i.config?dist_esm_I(i.config,a):void 0);let x=dist_esm_k(this);if(!x||dist_esm_l.und(d))return r(dist_esm_E(this,!0));let S=dist_esm_l.und(n.reset)?s&&!n.default:!dist_esm_l.und(m)&&esm_te(n.reset,a),A=S?m:this.get(),V=esm_me(d),_=dist_esm_l.num(V)||dist_esm_l.arr(V)||esm_or(V),v=!P&&(!_||esm_te(i.immediate||n.immediate,a));if(c){let L=esm_Le(d);if(L!==x.constructor)if(v)x=this._set(V);else throw Error(`Cannot animate between ${x.constructor.name} and ${L.name}, as the "to" prop suggests`)}let w=x.constructor,C=Pt(d),$=!1;if(!C){let L=S||!esm_qe(this)&&b;(c||L)&&($=bt(esm_me(A),V),C=!$),(!bt(u.immediate,v)&&!v||!bt(l.decay,h)||!bt(l.velocity,g))&&(C=!0)}if($&&dist_esm_Q(this)&&(u.changed&&!S?C=!0:C||this._stop(p)),!P&&((C||Pt(p))&&(u.values=x.getPayload(),u.toValues=Pt(d)?null:w==animated_dist_esm_d?[1]:ht(V)),u.immediate!=v&&(u.immediate=v,!v&&!S&&this._set(p)),C)){let{onRest:L}=u;esm_Ve(_n,y=>_t(this,n,y));let N=dist_esm_E(this,esm_Ce(this,p));yt(this._pendingCalls,N),this._pendingCalls.add(r),u.changed&&esm_n.batchedUpdates(()=>{u.changed=!S,L?.(N,this),S?dist_esm_I(i.onRest,N):u.onStart?.(N,this)})}S&&this._set(A),P?r(esm_De(n.to,n,this._state,this)):C?this._start():dist_esm_Q(this)&&!c?this._pendingCalls.add(r):r(nt(A))}_focus(e){let n=this.animation;e!==n.to&&(esm_qt(this)&&this._detach(),n.to=e,esm_qt(this)&&this._attach())}_attach(){let e=0,{to:n}=this.animation;Pt(n)&&(Gt(n,this),esm_Re(n)&&(e=n.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Pt(e)&&Qt(e,this)}_set(e,n=!0){let r=ve(e);if(!dist_esm_l.und(r)){let o=dist_esm_k(this);if(!o||!bt(r,o.getValue())){let s=esm_Le(r);!o||o.constructor!=s?esm_D(this,s.create(r)):o.setValue(r),o&&esm_n.batchedUpdates(()=>{this._onChange(r,n)})}}return dist_esm_k(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,esm_Ie(this,"onStart",dist_esm_E(this,esm_Ce(this,e.to)),this))}_onChange(e,n){n||(this._onStart(),dist_esm_I(this.animation.onChange,e,this)),dist_esm_I(this.defaultProps.onChange,e,this),super._onChange(e,n)}_start(){let e=this.animation;dist_esm_k(this).reset(ve(e.to)),e.immediate||(e.fromValues=e.values.map(n=>n.lastPosition)),dist_esm_Q(this)||(st(this,!0),esm_ye(this)||this._resume())}_resume(){dist_esm_p.skipAnimation?this.finish():qe.start(this)}_stop(e,n){if(dist_esm_Q(this)){st(this,!1);let r=this.animation;esm_Ve(r.values,s=>{s.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),$t(this,{type:"idle",parent:this});let o=n?esm_q(this.get()):dist_esm_E(this.get(),esm_Ce(this,e??r.to));yt(this._pendingCalls,o),r.changed&&(r.changed=!1,esm_Ie(this,"onRest",o,this))}}};function esm_Ce(t,e){let n=esm_me(e),r=esm_me(t.get());return bt(r,n)}function at(t,e=t.loop,n=t.to){let r=dist_esm_I(e);if(r){let o=r!==!0&&esm_de(r),s=(o||t).reverse,a=!o||o.reset;return esm_Pe({...t,loop:e,default:!1,pause:void 0,to:!s||esm_Ee(n)?n:void 0,from:a?t.from:void 0,reset:a,...o})}}function esm_Pe(t){let{to:e,from:n}=t=esm_de(t),r=new Set;return dist_esm_l.obj(e)&&Vt(e,r),dist_esm_l.obj(n)&&Vt(n,r),t.keys=r.size?Array.from(r):null,t}function Ot(t){let e=esm_Pe(t);return R.und(e.default)&&(e.default=dist_esm_ne(e)),e}function Vt(t,e){xt(t,(n,r)=>n!=null&&e.add(r))}var _n=["onStart","onRest","onChange","onPause","onResume"];function _t(t,e,n){t.animation[n]=e[n]!==esm_ke(e,n)?et(e[n],t.key):void 0}function esm_Ie(t,e,...n){t.animation[e]?.(...n),t.defaultProps[e]?.(...n)}var Fn=["onStart","onChange","onRest"],kn=1,esm_le=class{id=kn++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,n){this._onFrame=this._onFrame.bind(this),n&&(this._flush=n),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((n,r)=>e[r]=n.get()),e}set(e){for(let n in e){let r=e[n];dist_esm_l.und(r)||this.springs[n].set(r)}}update(e){return e&&this.queue.push(esm_Pe(e)),this}start(e){let{queue:n}=this;return e?n=ht(e).map(esm_Pe):this.queue=[],this._flush?this._flush(this,n):(jt(this,n),esm_ze(this,n))}stop(e,n){if(e!==!!e&&(n=e),n){let r=this.springs;esm_Ve(ht(n),o=>r[o].stop(!!e))}else esm_oe(this._state,this._lastAsyncId),this.each(r=>r.stop(!!e));return this}pause(e){if(dist_esm_l.und(e))this.start({pause:!0});else{let n=this.springs;esm_Ve(ht(e),r=>n[r].pause())}return this}resume(e){if(dist_esm_l.und(e))this.start({pause:!1});else{let n=this.springs;esm_Ve(ht(e),r=>n[r].resume())}return this}each(e){xt(this.springs,e)}_onFrame(){let{onStart:e,onChange:n,onRest:r}=this._events,o=this._active.size>0,s=this._changed.size>0;(o&&!this._started||s&&!this._started)&&(this._started=!0,Pe(e,([u,p])=>{p.value=this.get(),u(p,this,this._item)}));let a=!o&&this._started,i=s||a&&r.size?this.get():null;s&&n.size&&Pe(n,([u,p])=>{p.value=i,u(p,this,this._item)}),a&&(this._started=!1,Pe(r,([u,p])=>{p.value=i,u(p,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;esm_n.onFrame(this._onFrame)}};function esm_ze(t,e){return Promise.all(e.map(n=>wt(t,n))).then(n=>esm_be(t,n))}async function wt(t,e,n){let{keys:r,to:o,from:s,loop:a,onRest:i,onResolve:u}=e,p=dist_esm_l.obj(e.default)&&e.default;a&&(e.loop=!1),o===!1&&(e.to=null),s===!1&&(e.from=null);let f=dist_esm_l.arr(o)||dist_esm_l.fun(o)?o:void 0;f?(e.to=void 0,e.onRest=void 0,p&&(p.onRest=void 0)):esm_Ve(Fn,P=>{let l=e[P];if(dist_esm_l.fun(l)){let h=t._events[P];e[P]=({finished:g,cancelled:x})=>{let S=h.get(l);S?(g||(S.finished=!1),x&&(S.cancelled=!0)):h.set(l,{value:null,finished:g||!1,cancelled:x||!1})},p&&(p[P]=e[P])}});let d=t._state;e.pause===!d.paused?(d.paused=e.pause,yt(e.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(e.pause=!0);let m=(r||Object.keys(t.springs)).map(P=>t.springs[P].start(e)),b=e.cancel===!0||esm_ke(e,"cancel")===!0;(f||b&&d.asyncId)&&m.push(esm_Me(++t._lastAsyncId,{props:e,state:d,actions:{pause:Y,resume:Y,start(P,l){b?(esm_oe(d,t._lastAsyncId),l(esm_q(t))):(P.onRest=i,l(esm_De(f,P,d,t)))}}})),d.paused&&await new Promise(P=>{d.resumeQueue.add(P)});let c=esm_be(t,await Promise.all(m));if(a&&c.finished&&!(n&&c.noop)){let P=at(e,a,o);if(P)return jt(t,[P]),wt(t,P,!0)}return u&&esm_n.batchedUpdates(()=>u(c,t,t.item)),c}function esm_e(t,e){let n={...t.springs};return e&&pe(Ve(e),r=>{z.und(r.keys)&&(r=esm_Pe(r)),z.obj(r.to)||(r={...r,to:void 0}),Mt(n,r,o=>esm_Lt(o))}),pt(t,n),n}function pt(t,e){Ut(e,(n,r)=>{t.springs[r]||(t.springs[r]=n,Et(n,t))})}function esm_Lt(t,e){let n=new esm_ue;return n.key=t,e&&Gt(n,e),n}function Mt(t,e,n){e.keys&&esm_Ve(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function jt(t,e){esm_Ve(e,n=>{Mt(t.springs,n,r=>esm_Lt(r,t))})}var dist_esm_H=({children:t,...e})=>{let n=(0,external_React_.useContext)(esm_Ge),r=e.pause||!!n.pause,o=e.immediate||!!n.immediate;e=Lr(()=>({pause:r,immediate:o}),[r,o]);let{Provider:s}=esm_Ge;return external_React_.createElement(s,{value:e},t)},esm_Ge=wn(dist_esm_H,{});dist_esm_H.Provider=esm_Ge.Provider;dist_esm_H.Consumer=esm_Ge.Consumer;function wn(t,e){return Object.assign(t,external_React_.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}var esm_fe=()=>{let t=[],e=function(r){Ln();let o=[];return ce(t,(s,a)=>{if(Ke.und(r))o.push(s.start());else{let i=n(r,s,a);i&&o.push(s.start(i))}}),o};e.current=t,e.add=function(r){t.includes(r)||t.push(r)},e.delete=function(r){let o=t.indexOf(r);~o&&t.splice(o,1)},e.pause=function(){return ce(t,r=>r.pause(...arguments)),this},e.resume=function(){return ce(t,r=>r.resume(...arguments)),this},e.set=function(r){ce(t,(o,s)=>{let a=Ke.fun(r)?r(s,o):r;a&&o.set(a)})},e.start=function(r){let o=[];return ce(t,(s,a)=>{if(Ke.und(r))o.push(s.start());else{let i=this._getProps(r,s,a);i&&o.push(s.start(i))}}),o},e.stop=function(){return ce(t,r=>r.stop(...arguments)),this},e.update=function(r){return ce(t,(o,s)=>o.update(this._getProps(r,o,s))),this};let n=function(r,o,s){return Ke.fun(r)?r(s,o):r};return e._getProps=n,e};function esm_He(t,e,n){let r=jn.fun(e)&&e;r&&!n&&(n=[]);let o=Xe(()=>r||arguments.length==3?esm_fe():void 0,[]),s=Nt(0),a=Dn(),i=Xe(()=>({ctrls:[],queue:[],flush(h,g){let x=esm_e(h,g);return s.current>0&&!i.queue.length&&!Object.keys(x).some(A=>!h.springs[A])?esm_ze(h,g):new Promise(A=>{pt(h,x),i.queue.push(()=>{A(esm_ze(h,g))}),a()})}}),[]),u=Nt([...i.ctrls]),p=[],f=Dt(t)||0;Xe(()=>{Ye(u.current.slice(t,f),h=>{esm_xe(h,o),h.stop(!0)}),u.current.length=t,d(f,t)},[t]),Xe(()=>{d(0,Math.min(f,t))},n);function d(h,g){for(let x=h;x<g;x++){let S=u.current[x]||(u.current[x]=new esm_le(null,i.flush)),A=r?r(x,S):e[x];A&&(p[x]=Ot(A))}}let m=u.current.map((h,g)=>esm_e(h,p[g])),b=Mn(dist_esm_H),c=Dt(b),P=b!==c&&esm_Ue(b);qn(()=>{s.current++,i.ctrls=u.current;let{queue:h}=i;h.length&&(i.queue=[],Ye(h,g=>g())),Ye(u.current,(g,x)=>{o?.add(g),P&&g.start({default:b});let S=p[x];S&&(esm_he(g,S.ref),g.ref?g.queue.push(S):g.start(S))})}),Nn(()=>()=>{Ye(i.ctrls,h=>h.stop(!0))});let l=m.map(h=>({...h}));return o?[l,o]:l}function esm_J(t,e){let n=Qn.fun(t),[[r],o]=esm_He(1,n?t:[t],n?e||[]:e);return n||arguments.length==2?[r,o]:r}var Gn=()=>esm_fe(),Xo=()=>zn(Gn)[0];var Wo=(t,e)=>{let n=Bn(()=>new esm_ue(t,e));return Kn(()=>()=>{n.stop()}),n};function esm_Qt(t,e,n){let r=qt.fun(e)&&e;r&&!n&&(n=[]);let o=!0,s,a=esm_He(t,(i,u)=>{let p=r?r(i,u):e;return s=p.ref,o=o&&p.reverse,p},n||[{}]);if(Yn(()=>{Xn(a[1].current,(i,u)=>{let p=a[1].current[u+(o?1:-1)];if(esm_he(i,s),i.ref){p&&i.update({to:p.springs});return}p?i.start({to:p.springs}):i.start()})},n),r||arguments.length==3){let i=s??a[1];return i._getProps=(u,p,f)=>{let d=qt.fun(u)?u(f,p):u;if(d){let m=i.current[f+(d.reverse?1:-1)];return m&&(d.to=m.springs),d}},a}return a[0]}function esm_Gt(t,e,n){let r=G.fun(e)&&e,{reset:o,sort:s,trail:a=0,expires:i=!0,exitBeforeEnter:u=!1,onDestroyed:p,ref:f,config:d}=r?r():e,m=Jn(()=>r||arguments.length==3?esm_fe():void 0,[]),b=zt(t),c=[],P=lt(null),l=o?null:P.current;Je(()=>{P.current=c}),$n(()=>(j(c,y=>{m?.add(y.ctrl),y.ctrl.ref=m}),()=>{j(P.current,y=>{y.expired&&clearTimeout(y.expirationId),esm_xe(y.ctrl,m),y.ctrl.stop(!0)})}));let h=tr(b,r?r():e,l),g=o&&P.current||[];Je(()=>j(g,({ctrl:y,item:T,key:F})=>{esm_xe(y,m),dist_esm_I(p,T,F)}));let x=[];if(l&&j(l,(y,T)=>{y.expired?(clearTimeout(y.expirationId),g.push(y)):(T=x[T]=h.indexOf(y.key),~T&&(c[T]=y))}),j(b,(y,T)=>{c[T]||(c[T]={key:h[T],item:y,phase:"mount",ctrl:new esm_le},c[T].ctrl.item=y)}),x.length){let y=-1,{leave:T}=r?r():e;j(x,(F,k)=>{let O=l[k];~F?(y=c.indexOf(O),c[y]={...O,item:b[F]}):T&&c.splice(++y,0,O)})}G.fun(s)&&c.sort((y,T)=>s(y.item,T.item));let S=-a,A=Wn(),V=dist_esm_ne(e),_=new Map,v=lt(new Map),w=lt(!1);j(c,(y,T)=>{let F=y.key,k=y.phase,O=r?r():e,U,D,Jt=dist_esm_I(O.delay||0,F);if(k=="mount")U=O.enter,D="enter";else{let M=h.indexOf(F)<0;if(k!="leave")if(M)U=O.leave,D="leave";else if(U=O.update)D="update";else return;else if(!M)U=O.enter,D="enter";else return}if(U=dist_esm_I(U,y.item,T),U=G.obj(U)?esm_de(U):{to:U},!U.config){let M=d||V.config;U.config=dist_esm_I(M,y.item,T,D)}S+=a;let Z={...V,delay:Jt+S,ref:f,immediate:O.immediate,reset:!1,...U};if(D=="enter"&&G.und(Z.from)){let M=r?r():e,Te=G.und(M.initial)||l?M.from:M.initial;Z.from=dist_esm_I(Te,y.item,T)}let{onResolve:Wt}=Z;Z.onResolve=M=>{dist_esm_I(Wt,M);let Te=P.current,B=Te.find(Fe=>Fe.key===F);if(!!B&&!(M.cancelled&&B.phase!="update")&&B.ctrl.idle){let Fe=Te.every(ee=>ee.ctrl.idle);if(B.phase=="leave"){let ee=dist_esm_I(i,B.item);if(ee!==!1){let Ze=ee===!0?0:ee;if(B.expired=!0,!Fe&&Ze>0){Ze<=2147483647&&(B.expirationId=setTimeout(A,Ze));return}}}Fe&&Te.some(ee=>ee.expired)&&(v.current.delete(B),u&&(w.current=!0),A())}};let ft=esm_e(y.ctrl,Z);D==="leave"&&u?v.current.set(y,{phase:D,springs:ft,payload:Z}):_.set(y,{phase:D,springs:ft,payload:Z})});let C=Hn(dist_esm_H),$=Zn(C),L=C!==$&&esm_Ue(C);Je(()=>{L&&j(c,y=>{y.ctrl.start({default:C})})},[C]),j(_,(y,T)=>{if(v.current.size){let F=c.findIndex(k=>k.key===T.key);c.splice(F,1)}}),Je(()=>{j(v.current.size?v.current:_,({phase:y,payload:T},F)=>{let{ctrl:k}=F;F.phase=y,m?.add(k),L&&y=="enter"&&k.start({default:C}),T&&(esm_he(k,T.ref),(k.ref||m)&&!w.current?k.update(T):(k.start(T),w.current&&(w.current=!1)))})},o?void 0:n);let N=y=>Oe.createElement(Oe.Fragment,null,c.map((T,F)=>{let{springs:k}=_.get(T)||T.ctrl,O=y({...k},T.item,T,F);return O&&O.type?Oe.createElement(O.type,{...O.props,key:G.str(T.key)||G.num(T.key)?T.key:T.ctrl.id,ref:O.ref}):O}));return m?[N,m]:N}var esm_er=1;function tr(t,{key:e,keys:n=e},r){if(n===null){let o=new Set;return t.map(s=>{let a=r&&r.find(i=>i.item===s&&i.phase!=="leave"&&!o.has(i));return a?(o.add(a),a.key):esm_er++})}return G.und(n)?t:G.fun(n)?t.map(n):zt(n)}var hs=({container:t,...e}={})=>{let[n,r]=esm_J(()=>({scrollX:0,scrollY:0,scrollXProgress:0,scrollYProgress:0,...e}),[]);return or(()=>{let o=rr(({x:s,y:a})=>{r.start({scrollX:s.current,scrollXProgress:s.progress,scrollY:a.current,scrollYProgress:a.progress})},{container:t?.current||void 0});return()=>{nr(Object.values(n),s=>s.stop()),o()}},[]),n};var Ps=({container:t,...e})=>{let[n,r]=esm_J(()=>({width:0,height:0,...e}),[]);return ar(()=>{let o=sr(({width:s,height:a})=>{r.start({width:s,height:a,immediate:n.width.get()===0||n.height.get()===0})},{container:t?.current||void 0});return()=>{ir(Object.values(n),s=>s.stop()),o()}},[]),n};var cr={any:0,all:1};function Cs(t,e){let[n,r]=pr(!1),o=ur(),s=Bt.fun(t)&&t,a=s?s():{},{to:i={},from:u={},...p}=a,f=s?e:t,[d,m]=esm_J(()=>({from:u,...p}),[]);return lr(()=>{let b=o.current,{root:c,once:P,amount:l="any",...h}=f??{};if(!b||P&&n||typeof IntersectionObserver>"u")return;let g=new WeakMap,x=()=>(i&&m.start(i),r(!0),P?void 0:()=>{u&&m.start(u),r(!1)}),S=V=>{V.forEach(_=>{let v=g.get(_.target);if(_.isIntersecting!==Boolean(v))if(_.isIntersecting){let w=x();Bt.fun(w)?g.set(_.target,w):A.unobserve(_.target)}else v&&(v(),g.delete(_.target))})},A=new IntersectionObserver(S,{root:c&&c.current||void 0,threshold:typeof l=="number"||Array.isArray(l)?l:cr[l],...h});return A.observe(b),()=>A.unobserve(b)},[f]),s?[o,d]:[o,n]}function qs({children:t,...e}){return t(esm_J(e))}function Bs({items:t,children:e,...n}){let r=esm_Qt(t.length,n);return t.map((o,s)=>{let a=e(o,s);return fr.fun(a)?a(r[s]):a})}function Ys({items:t,children:e,...n}){return esm_Gt(t,n)(e)}var esm_W=class extends esm_X{constructor(n,r){super();this.source=n;this.calc=W(...r);let o=this._get(),s=esm_Le(o);esm_D(this,s.create(o))}key;idle=!0;calc;_active=new Set;advance(n){let r=this._get(),o=this.get();bt(r,o)||(dist_esm_k(this).setValue(r),this._onChange(r,this.idle)),!this.idle&&Yt(this._active)&&esm_ct(this)}_get(){let n=dist_esm_l.arr(this.source)?this.source.map(ve):ht(ve(this.source));return this.calc(...n)}_start(){this.idle&&!Yt(this._active)&&(this.idle=!1,esm_Ve(F(this),n=>{n.done=!1}),dist_esm_p.skipAnimation?(esm_n.batchedUpdates(()=>this.advance()),esm_ct(this)):qe.start(this))}_attach(){let n=1;esm_Ve(ht(this.source),r=>{Pt(r)&&Gt(r,this),esm_Re(r)&&(r.idle||this._active.add(r),n=Math.max(n,r.priority+1))}),this.priority=n,this._start()}_detach(){esm_Ve(ht(this.source),n=>{Pt(n)&&Qt(n,this)}),this._active.clear(),esm_ct(this)}eventObserved(n){n.type=="change"?n.idle?this.advance():(this._active.add(n.parent),this._start()):n.type=="idle"?this._active.delete(n.parent):n.type=="priority"&&(this.priority=ht(this.source).reduce((r,o)=>Math.max(r,(esm_Re(o)?o.priority:0)+1),0))}};function vr(t){return t.idle!==!1}function Yt(t){return!t.size||Array.from(t).every(vr)}function esm_ct(t){t.idle||(t.idle=!0,esm_Ve(F(t),e=>{e.done=!0}),$t(t,{type:"idle",parent:t}))}var ui=(t,...e)=>new esm_W(t,e),pi=(t,...e)=>(Cr(),new esm_W(t,e));dist_esm_p.assign({createStringInterpolator:Xt,to:(t,e)=>new esm_W(t,e)});var di=qe.advance;
;// external "ReactDOM"
const external_ReactDOM_namespaceObject = window["ReactDOM"];
;// ./node_modules/@react-spring/web/dist/esm/index.js
var web_dist_esm_k=/^--/;function web_dist_esm_I(t,e){return e==null||typeof e=="boolean"||e===""?"":typeof e=="number"&&e!==0&&!web_dist_esm_k.test(t)&&!(web_dist_esm_c.hasOwnProperty(t)&&web_dist_esm_c[t])?e+"px":(""+e).trim()}var web_dist_esm_v={};function esm_V(t,e){if(!t.nodeType||!t.setAttribute)return!1;let r=t.nodeName==="filter"||t.parentNode&&t.parentNode.nodeName==="filter",{style:i,children:s,scrollTop:u,scrollLeft:l,viewBox:a,...n}=e,d=Object.values(n),m=Object.keys(n).map(o=>r||t.hasAttribute(o)?o:web_dist_esm_v[o]||(web_dist_esm_v[o]=o.replace(/([A-Z])/g,p=>"-"+p.toLowerCase())));s!==void 0&&(t.textContent=s);for(let o in i)if(i.hasOwnProperty(o)){let p=web_dist_esm_I(o,i[o]);web_dist_esm_k.test(o)?t.style.setProperty(o,p):t.style[o]=p}m.forEach((o,p)=>{t.setAttribute(o,d[p])}),u!==void 0&&(t.scrollTop=u),l!==void 0&&(t.scrollLeft=l),a!==void 0&&t.setAttribute("viewBox",a)}var web_dist_esm_c={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},esm_F=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1),esm_L=["Webkit","Ms","Moz","O"];web_dist_esm_c=Object.keys(web_dist_esm_c).reduce((t,e)=>(esm_L.forEach(r=>t[esm_F(r,e)]=t[e]),t),web_dist_esm_c);var esm_=/^(matrix|translate|scale|rotate|skew)/,dist_esm_$=/^(translate)/,dist_esm_G=/^(rotate|skew)/,web_dist_esm_y=(t,e)=>dist_esm_l.num(t)&&t!==0?t+e:t,web_dist_esm_h=(t,e)=>dist_esm_l.arr(t)?t.every(r=>web_dist_esm_h(r,e)):dist_esm_l.num(t)?t===e:parseFloat(t)===e,dist_esm_g=class extends animated_dist_esm_u{constructor({x:e,y:r,z:i,...s}){let u=[],l=[];(e||r||i)&&(u.push([e||0,r||0,i||0]),l.push(a=>[`translate3d(${a.map(n=>web_dist_esm_y(n,"px")).join(",")})`,web_dist_esm_h(a,0)])),xt(s,(a,n)=>{if(n==="transform")u.push([a||""]),l.push(d=>[d,d===""]);else if(esm_.test(n)){if(delete s[n],dist_esm_l.und(a))return;let d=dist_esm_$.test(n)?"px":dist_esm_G.test(n)?"deg":"";u.push(ht(a)),l.push(n==="rotate3d"?([m,o,p,O])=>[`rotate3d(${m},${o},${p},${web_dist_esm_y(O,d)})`,web_dist_esm_h(O,0)]:m=>[`${n}(${m.map(o=>web_dist_esm_y(o,d)).join(",")})`,web_dist_esm_h(m,n.startsWith("scale")?1:0)])}}),u.length&&(s.transform=new web_dist_esm_x(u,l)),super(s)}},web_dist_esm_x=class extends esm_ge{constructor(r,i){super();this.inputs=r;this.transforms=i}_value=null;get(){return this._value||(this._value=this._get())}_get(){let r="",i=!0;return esm_Ve(this.inputs,(s,u)=>{let l=ve(s[0]),[a,n]=this.transforms[u](dist_esm_l.arr(l)?l:s.map(ve));r+=" "+a,i=i&&n}),i?"none":r}observerAdded(r){r==1&&esm_Ve(this.inputs,i=>esm_Ve(i,s=>Pt(s)&&Gt(s,this)))}observerRemoved(r){r==0&&esm_Ve(this.inputs,i=>esm_Ve(i,s=>Pt(s)&&Qt(s,this)))}eventObserved(r){r.type=="change"&&(this._value=null),$t(this,r)}};var esm_C=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];dist_esm_p.assign({batchedUpdates:external_ReactDOM_namespaceObject.unstable_batchedUpdates,createStringInterpolator:Xt,colors:It});var dist_esm_q=dist_esm_Ke(esm_C,{applyAnimatedValues:esm_V,createAnimatedStyle:t=>new dist_esm_g(t),getComponentProps:({scrollTop:t,scrollLeft:e,...r})=>r}),dist_esm_it=dist_esm_q.animated;
;// ./node_modules/@wordpress/block-editor/build-module/components/use-moving-animation/index.js
const BLOCK_ANIMATION_THRESHOLD = 200;
function getAbsolutePosition(element) {
return {
top: element.offsetTop,
left: element.offsetLeft
};
}
function useMovingAnimation({ triggerAnimationOnChange, clientId }) {
const ref = (0,external_wp_element_namespaceObject.useRef)();
const {
isTyping,
getGlobalBlockCount,
isBlockSelected,
isFirstMultiSelectedBlock,
isBlockMultiSelected,
isAncestorMultiSelected,
isDraggingBlocks
} = (0,external_wp_data_namespaceObject.useSelect)(store);
const { previous, prevRect } = (0,external_wp_element_namespaceObject.useMemo)(
() => ({
previous: ref.current && getAbsolutePosition(ref.current),
prevRect: ref.current && ref.current.getBoundingClientRect()
}),
[triggerAnimationOnChange]
);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (!previous || !ref.current) {
return;
}
const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(ref.current);
const isSelected = isBlockSelected(clientId);
const adjustScrolling = isSelected || isFirstMultiSelectedBlock(clientId);
const isDragging = isDraggingBlocks();
function preserveScrollPosition() {
if (isDragging) {
return;
}
if (adjustScrolling && prevRect) {
const blockRect = ref.current.getBoundingClientRect();
const diff = blockRect.top - prevRect.top;
if (diff) {
scrollContainer.scrollTop += diff;
}
}
}
const disableAnimation = window.matchMedia("(prefers-reduced-motion: reduce)").matches || isTyping() || getGlobalBlockCount() > BLOCK_ANIMATION_THRESHOLD;
if (disableAnimation) {
preserveScrollPosition();
return;
}
const isPartOfSelection = isSelected || isBlockMultiSelected(clientId) || isAncestorMultiSelected(clientId);
if (isPartOfSelection && isDragging) {
return;
}
const zIndex = isPartOfSelection ? "1" : "";
const controller = new esm_le({
x: 0,
y: 0,
config: { mass: 5, tension: 2e3, friction: 200 },
onChange({ value }) {
if (!ref.current) {
return;
}
let { x: x2, y: y2 } = value;
x2 = Math.round(x2);
y2 = Math.round(y2);
const finishedMoving = x2 === 0 && y2 === 0;
ref.current.style.transformOrigin = "center center";
ref.current.style.transform = finishedMoving ? null : `translate3d(${x2}px,${y2}px,0)`;
ref.current.style.zIndex = zIndex;
preserveScrollPosition();
}
});
ref.current.style.transform = void 0;
const destination = getAbsolutePosition(ref.current);
const x = Math.round(previous.left - destination.left);
const y = Math.round(previous.top - destination.top);
controller.start({ x: 0, y: 0, from: { x, y } });
return () => {
controller.stop();
controller.set({ x: 0, y: 0 });
};
}, [
previous,
prevRect,
clientId,
isTyping,
getGlobalBlockCount,
isBlockSelected,
isFirstMultiSelectedBlock,
isBlockMultiSelected,
isAncestorMultiSelected,
isDraggingBlocks
]);
return ref;
}
var use_moving_animation_default = useMovingAnimation;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-focus-first-element.js
function useFocusFirstElement({ clientId, initialPosition }) {
const ref = (0,external_wp_element_namespaceObject.useRef)();
const { isBlockSelected, isMultiSelecting, isZoomOut } = unlock(
(0,external_wp_data_namespaceObject.useSelect)(store)
);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isBlockSelected(clientId) || isMultiSelecting() || isZoomOut()) {
return;
}
if (initialPosition === void 0 || initialPosition === null) {
return;
}
if (!ref.current) {
return;
}
const { ownerDocument } = ref.current;
if (isInsideRootBlock(ref.current, ownerDocument.activeElement)) {
return;
}
const textInputs = external_wp_dom_namespaceObject.focus.tabbable.find(ref.current).filter((node) => (0,external_wp_dom_namespaceObject.isTextField)(node));
const isReverse = -1 === initialPosition;
const target = textInputs[isReverse ? textInputs.length - 1 : 0] || ref.current;
if (!isInsideRootBlock(ref.current, target)) {
ref.current.focus();
return;
}
if (!ref.current.getAttribute("contenteditable")) {
const focusElement = external_wp_dom_namespaceObject.focus.tabbable.findNext(ref.current);
if (focusElement && isInsideRootBlock(ref.current, focusElement) && (0,external_wp_dom_namespaceObject.isFormElement)(focusElement)) {
focusElement.focus();
return;
}
}
(0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(target, isReverse);
}, [initialPosition, clientId]);
return ref;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-is-hovered.js
function listener(event) {
if (event.defaultPrevented) {
return;
}
event.preventDefault();
event.currentTarget.classList.toggle(
"is-hovered",
event.type === "mouseover"
);
}
function useIsHovered() {
return (0,external_wp_compose_namespaceObject.useRefEffect)((node) => {
node.addEventListener("mouseout", listener);
node.addEventListener("mouseover", listener);
return () => {
node.removeEventListener("mouseout", listener);
node.removeEventListener("mouseover", listener);
node.classList.remove("is-hovered");
};
}, []);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-focus-handler.js
function useFocusHandler(clientId) {
const { isBlockSelected } = (0,external_wp_data_namespaceObject.useSelect)(store);
const { selectBlock, selectionChange } = (0,external_wp_data_namespaceObject.useDispatch)(store);
return (0,external_wp_compose_namespaceObject.useRefEffect)(
(node) => {
function onFocus(event) {
if (node.parentElement.closest('[contenteditable="true"]')) {
return;
}
if (isBlockSelected(clientId)) {
if (!event.target.isContentEditable) {
selectionChange(clientId);
}
return;
}
if (!isInsideRootBlock(node, event.target)) {
return;
}
selectBlock(clientId);
}
node.addEventListener("focusin", onFocus);
return () => {
node.removeEventListener("focusin", onFocus);
};
},
[isBlockSelected, selectBlock]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js
function isColorTransparent(color) {
return !color || color === "transparent" || color === "rgba(0, 0, 0, 0)";
}
function useEventHandlers({ clientId, isSelected }) {
const { getBlockRootClientId, isZoomOut, hasMultiSelection } = unlock(
(0,external_wp_data_namespaceObject.useSelect)(store)
);
const {
insertAfterBlock,
removeBlock,
resetZoomLevel,
startDraggingBlocks,
stopDraggingBlocks
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
return (0,external_wp_compose_namespaceObject.useRefEffect)(
(node) => {
if (!isSelected) {
return;
}
function onKeyDown(event) {
const { keyCode, target } = event;
if (keyCode !== external_wp_keycodes_namespaceObject.ENTER && keyCode !== external_wp_keycodes_namespaceObject.BACKSPACE && keyCode !== external_wp_keycodes_namespaceObject.DELETE) {
return;
}
if (target !== node || (0,external_wp_dom_namespaceObject.isTextField)(target)) {
return;
}
event.preventDefault();
if (keyCode === external_wp_keycodes_namespaceObject.ENTER && isZoomOut()) {
resetZoomLevel();
} else if (keyCode === external_wp_keycodes_namespaceObject.ENTER) {
insertAfterBlock(clientId);
} else {
removeBlock(clientId);
}
}
function onDragStart(event) {
if (node !== event.target || node.isContentEditable || node.ownerDocument.activeElement !== node || hasMultiSelection()) {
event.preventDefault();
return;
}
const data = JSON.stringify({
type: "block",
srcClientIds: [clientId],
srcRootClientId: getBlockRootClientId(clientId)
});
event.dataTransfer.effectAllowed = "move";
event.dataTransfer.clearData();
event.dataTransfer.setData("wp-blocks", data);
const { ownerDocument } = node;
const { defaultView } = ownerDocument;
const selection = defaultView.getSelection();
selection.removeAllRanges();
const dragElement = ownerDocument.createElement("div");
dragElement.style.width = "1px";
dragElement.style.height = "1px";
dragElement.style.position = "fixed";
dragElement.style.visibility = "hidden";
ownerDocument.body.appendChild(dragElement);
event.dataTransfer.setDragImage(dragElement, 0, 0);
const rect = node.getBoundingClientRect();
const clone = node.cloneNode(true);
clone.style.visibility = "hidden";
clone.style.display = "none";
const id = node.id;
node.id = null;
let _scale = 1;
{
let parentElement = node;
while (parentElement = parentElement.parentElement) {
const { scale } = defaultView.getComputedStyle(parentElement);
if (scale && scale !== "none") {
_scale = parseFloat(scale);
break;
}
}
}
const inverted = 1 / _scale;
node.after(clone);
const originalNodeProperties = {};
for (const property of [
"transform",
"transformOrigin",
"transition",
"zIndex",
"position",
"top",
"left",
"pointerEvents",
"opacity",
"backgroundColor"
]) {
originalNodeProperties[property] = node.style[property];
}
const originScrollTop = defaultView.scrollY;
const originScrollLeft = defaultView.scrollX;
const originClientX = event.clientX;
const originClientY = event.clientY;
node.style.position = "relative";
node.style.top = `${0}px`;
node.style.left = `${0}px`;
const originX = event.clientX - rect.left;
const originY = event.clientY - rect.top;
const dragScale = rect.height > 200 ? 200 / rect.height : 1;
node.style.zIndex = "1000";
node.style.transformOrigin = `${originX * inverted}px ${originY * inverted}px`;
node.style.transition = "transform 0.2s ease-out";
node.style.transform = `scale(${dragScale})`;
node.style.opacity = "0.9";
if (isColorTransparent(
defaultView.getComputedStyle(node).backgroundColor
)) {
let bgColor = "transparent";
let parentElement = node;
while (parentElement = parentElement.parentElement) {
const { backgroundColor } = defaultView.getComputedStyle(parentElement);
if (!isColorTransparent(backgroundColor)) {
bgColor = backgroundColor;
break;
}
}
node.style.backgroundColor = bgColor;
}
let hasStarted = false;
function over(e) {
if (!hasStarted) {
hasStarted = true;
node.style.pointerEvents = "none";
}
const scrollTop = defaultView.scrollY;
const scrollLeft = defaultView.scrollX;
node.style.top = `${(e.clientY - originClientY + scrollTop - originScrollTop) * inverted}px`;
node.style.left = `${(e.clientX - originClientX + scrollLeft - originScrollLeft) * inverted}px`;
}
function end() {
ownerDocument.removeEventListener("dragover", over);
ownerDocument.removeEventListener("dragend", end);
ownerDocument.removeEventListener("drop", end);
ownerDocument.removeEventListener("scroll", over);
for (const [property, value] of Object.entries(
originalNodeProperties
)) {
node.style[property] = value;
}
clone.remove();
node.id = id;
dragElement.remove();
stopDraggingBlocks();
document.body.classList.remove(
"is-dragging-components-draggable"
);
ownerDocument.documentElement.classList.remove(
"is-dragging"
);
}
ownerDocument.addEventListener("dragover", over);
ownerDocument.addEventListener("dragend", end);
ownerDocument.addEventListener("drop", end);
ownerDocument.addEventListener("scroll", over);
startDraggingBlocks([clientId]);
document.body.classList.add(
"is-dragging-components-draggable"
);
ownerDocument.documentElement.classList.add("is-dragging");
}
node.addEventListener("keydown", onKeyDown);
node.addEventListener("dragstart", onDragStart);
return () => {
node.removeEventListener("keydown", onKeyDown);
node.removeEventListener("dragstart", onDragStart);
};
},
[
clientId,
isSelected,
getBlockRootClientId,
insertAfterBlock,
removeBlock,
isZoomOut,
resetZoomLevel,
hasMultiSelection,
startDraggingBlocks,
stopDraggingBlocks
]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-intersection-observer.js
function useIntersectionObserver() {
const observer = (0,external_wp_element_namespaceObject.useContext)(block_list_IntersectionObserver);
return (0,external_wp_compose_namespaceObject.useRefEffect)(
(node) => {
if (observer) {
observer.observe(node);
return () => {
observer.unobserve(node);
};
}
},
[observer]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-scroll-into-view.js
function useScrollIntoView({ isSelected }) {
const prefersReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
return (0,external_wp_compose_namespaceObject.useRefEffect)(
(node) => {
if (isSelected) {
const { ownerDocument } = node;
const { defaultView } = ownerDocument;
if (!defaultView.IntersectionObserver) {
return;
}
const observer = new defaultView.IntersectionObserver(
(entries) => {
if (!entries[0].isIntersecting) {
node.scrollIntoView({
behavior: prefersReducedMotion ? "instant" : "smooth"
});
}
observer.disconnect();
}
);
observer.observe(node);
return () => {
observer.disconnect();
};
}
},
[isSelected]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/use-flash-editable-blocks/index.js
function useFlashEditableBlocks({
clientId = "",
isEnabled = true
} = {}) {
const { getEnabledClientIdsTree } = unlock((0,external_wp_data_namespaceObject.useSelect)(store));
return (0,external_wp_compose_namespaceObject.useRefEffect)(
(element) => {
if (!isEnabled) {
return;
}
const flashEditableBlocks = () => {
getEnabledClientIdsTree(clientId).forEach(
({ clientId: id }) => {
const block = element.querySelector(
`[data-block="${id}"]`
);
if (!block) {
return;
}
block.classList.remove("has-editable-outline");
block.offsetWidth;
block.classList.add("has-editable-outline");
}
);
};
const handleClick = (event) => {
const shouldFlash = event.target === element || event.target.classList.contains("is-root-container");
if (!shouldFlash) {
return;
}
if (event.defaultPrevented) {
return;
}
event.preventDefault();
flashEditableBlocks();
};
element.addEventListener("click", handleClick);
return () => element.removeEventListener("click", handleClick);
},
[isEnabled]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js
const nodesByDocument = /* @__PURE__ */ new Map();
function add(doc, node) {
let set = nodesByDocument.get(doc);
if (!set) {
set = /* @__PURE__ */ new Set();
nodesByDocument.set(doc, set);
doc.addEventListener("pointerdown", down);
}
set.add(node);
}
function remove(doc, node) {
const set = nodesByDocument.get(doc);
if (set) {
set.delete(node);
restore(node);
if (set.size === 0) {
nodesByDocument.delete(doc);
doc.removeEventListener("pointerdown", down);
}
}
}
function restore(node) {
const prevDraggable = node.getAttribute("data-draggable");
if (prevDraggable) {
node.removeAttribute("data-draggable");
if (prevDraggable === "true" && !node.getAttribute("draggable")) {
node.setAttribute("draggable", "true");
}
}
}
function down(event) {
const { target } = event;
const { ownerDocument, isContentEditable, tagName } = target;
const isInputOrTextArea = ["INPUT", "TEXTAREA"].includes(tagName);
const nodes = nodesByDocument.get(ownerDocument);
if (isContentEditable || isInputOrTextArea) {
for (const node of nodes) {
if (node.getAttribute("draggable") === "true" && node.contains(target)) {
node.removeAttribute("draggable");
node.setAttribute("data-draggable", "true");
}
}
} else {
for (const node of nodes) {
restore(node);
}
}
}
function useFirefoxDraggableCompatibility() {
return (0,external_wp_compose_namespaceObject.useRefEffect)((node) => {
add(node.ownerDocument, node);
return () => {
remove(node.ownerDocument, node);
};
}, []);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/index.js
function use_block_props_useBlockProps(props = {}, { __unstableIsHtml } = {}) {
const {
clientId,
className,
wrapperProps = {},
isAligned,
index,
mode,
name,
blockApiVersion,
blockTitle,
isSelected,
isSubtreeDisabled,
hasOverlay,
initialPosition,
blockEditingMode,
isHighlighted,
isMultiSelected,
isPartiallySelected,
isReusable,
isDragging,
hasChildSelected,
isEditingDisabled,
hasEditableOutline,
isTemporarilyEditingAsBlocks,
defaultClassName,
isSectionBlock,
canMove,
isBlockHidden
} = (0,external_wp_element_namespaceObject.useContext)(PrivateBlockContext);
const blockLabel = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Block: %s"), blockTitle);
const htmlSuffix = mode === "html" && !__unstableIsHtml ? "-visual" : "";
const ffDragRef = useFirefoxDraggableCompatibility();
const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([
props.ref,
useFocusFirstElement({ clientId, initialPosition }),
useBlockRefProvider(clientId),
useFocusHandler(clientId),
useEventHandlers({ clientId, isSelected }),
useIsHovered(),
useIntersectionObserver(),
use_moving_animation_default({ triggerAnimationOnChange: index, clientId }),
(0,external_wp_compose_namespaceObject.useDisabled)({ isDisabled: !hasOverlay }),
useFlashEditableBlocks({
clientId,
isEnabled: isSectionBlock
}),
useScrollIntoView({ isSelected }),
canMove ? ffDragRef : void 0
]);
const blockEditContext = useBlockEditContext();
const hasBlockBindings = !!blockEditContext[blockBindingsKey];
const bindingsStyle = hasBlockBindings ? {
"--wp-admin-theme-color": "var(--wp-block-synced-color)",
"--wp-admin-theme-color--rgb": "var(--wp-block-synced-color--rgb)"
} : {};
if (blockApiVersion < 2 && clientId === blockEditContext.clientId) {
external_wp_warning_default()(
`Block type "${name}" must support API version 2 or higher to work correctly with "useBlockProps" method.`
);
}
let hasNegativeMargin = false;
if (wrapperProps?.style?.marginTop?.charAt(0) === "-" || wrapperProps?.style?.marginBottom?.charAt(0) === "-" || wrapperProps?.style?.marginLeft?.charAt(0) === "-" || wrapperProps?.style?.marginRight?.charAt(0) === "-") {
hasNegativeMargin = true;
}
return {
tabIndex: blockEditingMode === "disabled" ? -1 : 0,
draggable: canMove && !hasChildSelected ? true : void 0,
...wrapperProps,
...props,
ref: mergedRefs,
id: `block-${clientId}${htmlSuffix}`,
role: "document",
"aria-label": blockLabel,
"data-block": clientId,
"data-type": name,
"data-title": blockTitle,
inert: isSubtreeDisabled ? "true" : void 0,
className: dist_clsx(
"block-editor-block-list__block",
{
// The wp-block className is important for editor styles.
"wp-block": !isAligned,
"has-block-overlay": hasOverlay,
"is-selected": isSelected,
"is-highlighted": isHighlighted,
"is-multi-selected": isMultiSelected,
"is-partially-selected": isPartiallySelected,
"is-reusable": isReusable,
"is-dragging": isDragging,
"has-child-selected": hasChildSelected,
"is-editing-disabled": isEditingDisabled,
"has-editable-outline": hasEditableOutline,
"has-negative-margin": hasNegativeMargin,
"is-content-locked-temporarily-editing-as-blocks": isTemporarilyEditingAsBlocks,
"is-block-hidden": isBlockHidden
},
className,
props.className,
wrapperProps.className,
defaultClassName
),
style: { ...wrapperProps.style, ...props.style, ...bindingsStyle }
};
}
use_block_props_useBlockProps.save = external_wp_blocks_namespaceObject.__unstableGetBlockProps;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/block.js
function mergeWrapperProps(propsA, propsB) {
const newProps = {
...propsA,
...propsB
};
if (propsA?.hasOwnProperty("className") && propsB?.hasOwnProperty("className")) {
newProps.className = dist_clsx(propsA.className, propsB.className);
}
if (propsA?.hasOwnProperty("style") && propsB?.hasOwnProperty("style")) {
newProps.style = { ...propsA.style, ...propsB.style };
}
return newProps;
}
function Block({ children, isHtml, ...props }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...use_block_props_useBlockProps(props, { __unstableIsHtml: isHtml }), children });
}
function BlockListBlock({
block: { __unstableBlockSource },
mode,
isLocked,
canRemove,
clientId,
isSelected,
isSelectionEnabled,
className,
__unstableLayoutClassNames: layoutClassNames,
name,
isValid,
attributes,
wrapperProps,
setAttributes,
onReplace,
onRemove,
onInsertBlocksAfter,
onMerge,
toggleSelection
}) {
const {
mayDisplayControls,
mayDisplayParentControls,
themeSupportsLayout,
...context
} = (0,external_wp_element_namespaceObject.useContext)(PrivateBlockContext);
const parentLayout = useLayout() || {};
let blockEdit = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockEdit,
{
name,
isSelected,
attributes,
setAttributes,
insertBlocksAfter: isLocked ? void 0 : onInsertBlocksAfter,
onReplace: canRemove ? onReplace : void 0,
onRemove: canRemove ? onRemove : void 0,
mergeBlocks: canRemove ? onMerge : void 0,
clientId,
isSelectionEnabled,
toggleSelection,
__unstableLayoutClassNames: layoutClassNames,
__unstableParentLayout: Object.keys(parentLayout).length ? parentLayout : void 0,
mayDisplayControls,
mayDisplayParentControls,
blockEditingMode: context.blockEditingMode,
isPreviewMode: context.isPreviewMode
}
);
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name);
if (blockType?.getEditWrapperProps) {
wrapperProps = mergeWrapperProps(
wrapperProps,
blockType.getEditWrapperProps(attributes)
);
}
const isAligned = wrapperProps && !!wrapperProps["data-align"] && !themeSupportsLayout;
const isSticky = className?.includes("is-position-sticky");
if (isAligned) {
blockEdit = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx("wp-block", isSticky && className),
"data-align": wrapperProps["data-align"],
children: blockEdit
}
);
}
let block;
if (!isValid) {
const saveContent = __unstableBlockSource ? (0,external_wp_blocks_namespaceObject.serializeRawBlock)(__unstableBlockSource) : (0,external_wp_blocks_namespaceObject.getSaveContent)(blockType, attributes);
block = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Block, { className: "has-warning", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockInvalidWarning, { clientId }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: (0,external_wp_dom_namespaceObject.safeHTML)(saveContent) })
] });
} else if (mode === "html") {
block = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { style: { display: "none" }, children: blockEdit }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Block, { isHtml: true, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_html_default, { clientId }) })
] });
} else if (blockType?.apiVersion > 1) {
block = blockEdit;
} else {
block = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Block, { children: blockEdit });
}
const { "data-align": dataAlign, ...restWrapperProps } = wrapperProps ?? {};
const updatedWrapperProps = {
...restWrapperProps,
className: dist_clsx(
restWrapperProps.className,
dataAlign && themeSupportsLayout && `align${dataAlign}`,
!(dataAlign && isSticky) && className
)
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PrivateBlockContext.Provider,
{
value: {
wrapperProps: updatedWrapperProps,
isAligned,
...context
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_crash_boundary_default,
{
fallback: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Block, { className: "has-warning", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_crash_warning_default, {}) }),
children: block
}
)
}
);
}
const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, registry) => {
const {
updateBlockAttributes,
insertBlocks,
mergeBlocks,
replaceBlocks,
toggleSelection,
__unstableMarkLastChangeAsPersistent,
moveBlocksToPosition,
removeBlock,
selectBlock
} = dispatch(store);
return {
setAttributes(nextAttributes) {
const { getMultiSelectedBlockClientIds } = registry.select(store);
const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds();
const { clientId, attributes } = ownProps;
const clientIds = multiSelectedBlockClientIds.length ? multiSelectedBlockClientIds : [clientId];
const newAttributes = typeof nextAttributes === "function" ? nextAttributes(attributes) : nextAttributes;
updateBlockAttributes(clientIds, newAttributes);
},
onInsertBlocks(blocks, index) {
const { rootClientId } = ownProps;
insertBlocks(blocks, index, rootClientId);
},
onInsertBlocksAfter(blocks) {
const { clientId, rootClientId } = ownProps;
const { getBlockIndex } = registry.select(store);
const index = getBlockIndex(clientId);
insertBlocks(blocks, index + 1, rootClientId);
},
onMerge(forward) {
const { clientId, rootClientId } = ownProps;
const {
getPreviousBlockClientId,
getNextBlockClientId,
getBlock,
getBlockAttributes,
getBlockName,
getBlockOrder,
getBlockIndex,
getBlockRootClientId,
canInsertBlockType
} = registry.select(store);
function switchToDefaultOrRemove() {
const block = getBlock(clientId);
const defaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)();
const defaultBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(defaultBlockName);
if (getBlockName(clientId) !== defaultBlockName) {
const replacement = (0,external_wp_blocks_namespaceObject.switchToBlockType)(
block,
defaultBlockName
);
if (replacement && replacement.length) {
replaceBlocks(clientId, replacement);
}
} else if ((0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(block)) {
const nextBlockClientId = getNextBlockClientId(clientId);
if (nextBlockClientId) {
registry.batch(() => {
removeBlock(clientId);
selectBlock(nextBlockClientId);
});
}
} else if (defaultBlockType.merge) {
const attributes = defaultBlockType.merge(
{},
block.attributes
);
replaceBlocks(
[clientId],
[(0,external_wp_blocks_namespaceObject.createBlock)(defaultBlockName, attributes)]
);
}
}
function moveFirstItemUp(_clientId, changeSelection = true) {
const wrapperBlockName = getBlockName(_clientId);
const wrapperBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(wrapperBlockName);
const isTextualWrapper = wrapperBlockType.category === "text";
const targetRootClientId = getBlockRootClientId(_clientId);
const blockOrder = getBlockOrder(_clientId);
const [firstClientId] = blockOrder;
if (blockOrder.length === 1 && (0,external_wp_blocks_namespaceObject.isUnmodifiedBlock)(getBlock(firstClientId))) {
removeBlock(_clientId);
} else if (isTextualWrapper) {
registry.batch(() => {
if (canInsertBlockType(
getBlockName(firstClientId),
targetRootClientId
)) {
moveBlocksToPosition(
[firstClientId],
_clientId,
targetRootClientId,
getBlockIndex(_clientId)
);
} else {
const replacement = (0,external_wp_blocks_namespaceObject.switchToBlockType)(
getBlock(firstClientId),
(0,external_wp_blocks_namespaceObject.getDefaultBlockName)()
);
if (replacement && replacement.length && replacement.every(
(block) => canInsertBlockType(
block.name,
targetRootClientId
)
)) {
insertBlocks(
replacement,
getBlockIndex(_clientId),
targetRootClientId,
changeSelection
);
removeBlock(firstClientId, false);
} else {
switchToDefaultOrRemove();
}
}
if (!getBlockOrder(_clientId).length && (0,external_wp_blocks_namespaceObject.isUnmodifiedBlock)(getBlock(_clientId))) {
removeBlock(_clientId, false);
}
});
} else {
switchToDefaultOrRemove();
}
}
if (forward) {
if (rootClientId) {
const nextRootClientId = getNextBlockClientId(rootClientId);
if (nextRootClientId) {
if (getBlockName(rootClientId) === getBlockName(nextRootClientId)) {
const rootAttributes = getBlockAttributes(rootClientId);
const previousRootAttributes = getBlockAttributes(nextRootClientId);
if (Object.keys(rootAttributes).every(
(key) => rootAttributes[key] === previousRootAttributes[key]
)) {
registry.batch(() => {
moveBlocksToPosition(
getBlockOrder(nextRootClientId),
nextRootClientId,
rootClientId
);
removeBlock(nextRootClientId, false);
});
return;
}
} else {
mergeBlocks(rootClientId, nextRootClientId);
return;
}
}
}
const nextBlockClientId = getNextBlockClientId(clientId);
if (!nextBlockClientId) {
return;
}
if (getBlockOrder(nextBlockClientId).length) {
moveFirstItemUp(nextBlockClientId, false);
} else {
mergeBlocks(clientId, nextBlockClientId);
}
} else {
const previousBlockClientId = getPreviousBlockClientId(clientId);
if (previousBlockClientId) {
mergeBlocks(previousBlockClientId, clientId);
} else if (rootClientId) {
const previousRootClientId = getPreviousBlockClientId(rootClientId);
if (previousRootClientId && getBlockName(rootClientId) === getBlockName(previousRootClientId)) {
const rootAttributes = getBlockAttributes(rootClientId);
const previousRootAttributes = getBlockAttributes(previousRootClientId);
if (Object.keys(rootAttributes).every(
(key) => rootAttributes[key] === previousRootAttributes[key]
)) {
registry.batch(() => {
moveBlocksToPosition(
getBlockOrder(rootClientId),
rootClientId,
previousRootClientId
);
removeBlock(rootClientId, false);
});
return;
}
}
moveFirstItemUp(rootClientId);
} else {
switchToDefaultOrRemove();
}
}
},
onReplace(blocks, indexToSelect, initialPosition) {
if (blocks.length && !(0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(blocks[blocks.length - 1])) {
__unstableMarkLastChangeAsPersistent();
}
const replacementBlocks = blocks?.length === 1 && Array.isArray(blocks[0]) ? blocks[0] : blocks;
replaceBlocks(
[ownProps.clientId],
replacementBlocks,
indexToSelect,
initialPosition
);
},
onRemove() {
removeBlock(ownProps.clientId);
},
toggleSelection(selectionEnabled) {
toggleSelection(selectionEnabled);
}
};
});
BlockListBlock = (0,external_wp_compose_namespaceObject.compose)(
applyWithDispatch,
(0,external_wp_components_namespaceObject.withFilters)("editor.BlockListBlock")
)(BlockListBlock);
function BlockListBlockProvider(props) {
const { clientId, rootClientId } = props;
const selectedProps = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
isBlockSelected,
getBlockMode,
isSelectionEnabled: isSelectionEnabled2,
getTemplateLock,
isSectionBlock: _isSectionBlock,
getBlockWithoutAttributes,
getBlockAttributes,
canRemoveBlock,
canMoveBlock,
getSettings,
getTemporarilyEditingAsBlocks,
getBlockEditingMode,
getBlockName,
isFirstMultiSelectedBlock,
getMultiSelectedBlockClientIds,
hasSelectedInnerBlock,
getBlocksByName,
getBlockIndex,
isBlockMultiSelected,
isBlockSubtreeDisabled,
isBlockHighlighted,
__unstableIsFullySelected,
__unstableSelectionHasUnmergeableBlock,
isBlockBeingDragged,
isDragging: isDragging2,
__unstableHasActiveBlockOverlayActive,
getSelectedBlocksInitialCaretPosition
} = unlock(select(store));
const blockWithoutAttributes2 = getBlockWithoutAttributes(clientId);
if (!blockWithoutAttributes2) {
return;
}
const {
hasBlockSupport: _hasBlockSupport,
getActiveBlockVariation
} = select(external_wp_blocks_namespaceObject.store);
const attributes2 = getBlockAttributes(clientId);
const { name: blockName, isValid: isValid2 } = blockWithoutAttributes2;
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName);
const {
supportsLayout,
isPreviewMode: isPreviewMode2,
__experimentalBlockBindingsSupportedAttributes
} = getSettings();
const bindableAttributes2 = __experimentalBlockBindingsSupportedAttributes?.[blockName];
const hasLightBlockWrapper = blockType?.apiVersion > 1;
const previewContext = {
isPreviewMode: isPreviewMode2,
blockWithoutAttributes: blockWithoutAttributes2,
name: blockName,
attributes: attributes2,
isValid: isValid2,
themeSupportsLayout: supportsLayout,
index: getBlockIndex(clientId),
isReusable: (0,external_wp_blocks_namespaceObject.isReusableBlock)(blockType),
className: hasLightBlockWrapper ? attributes2.className : void 0,
defaultClassName: hasLightBlockWrapper ? (0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(blockName) : void 0,
blockTitle: blockType?.title,
isBlockHidden: attributes2?.metadata?.blockVisibility === false,
bindableAttributes: bindableAttributes2
};
if (isPreviewMode2) {
return previewContext;
}
const { isBlockHidden: _isBlockHidden } = unlock(
select(store)
);
const _isSelected = isBlockSelected(clientId);
const canRemove2 = canRemoveBlock(clientId);
const canMove2 = canMoveBlock(clientId);
const match = getActiveBlockVariation(blockName, attributes2);
const isMultiSelected2 = isBlockMultiSelected(clientId);
const checkDeep = true;
const isAncestorOfSelectedBlock = hasSelectedInnerBlock(
clientId,
checkDeep
);
const blockEditingMode2 = getBlockEditingMode(clientId);
const multiple = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, "multiple", true);
const blocksWithSameName = multiple ? [] : getBlocksByName(blockName);
const isInvalid = blocksWithSameName.length && blocksWithSameName[0] !== clientId;
return {
...previewContext,
mode: getBlockMode(clientId),
isSelectionEnabled: isSelectionEnabled2(),
isLocked: !!getTemplateLock(rootClientId),
isSectionBlock: _isSectionBlock(clientId),
canRemove: canRemove2,
canMove: canMove2,
isSelected: _isSelected,
isTemporarilyEditingAsBlocks: getTemporarilyEditingAsBlocks() === clientId,
blockEditingMode: blockEditingMode2,
mayDisplayControls: _isSelected || isFirstMultiSelectedBlock(clientId) && getMultiSelectedBlockClientIds().every(
(id) => getBlockName(id) === blockName
),
mayDisplayParentControls: _hasBlockSupport(
getBlockName(clientId),
"__experimentalExposeControlsToChildren",
false
) && hasSelectedInnerBlock(clientId),
blockApiVersion: blockType?.apiVersion || 1,
blockTitle: match?.title || blockType?.title,
isSubtreeDisabled: blockEditingMode2 === "disabled" && isBlockSubtreeDisabled(clientId),
hasOverlay: __unstableHasActiveBlockOverlayActive(clientId) && !isDragging2(),
initialPosition: _isSelected ? getSelectedBlocksInitialCaretPosition() : void 0,
isHighlighted: isBlockHighlighted(clientId),
isMultiSelected: isMultiSelected2,
isPartiallySelected: isMultiSelected2 && !__unstableIsFullySelected() && !__unstableSelectionHasUnmergeableBlock(),
isDragging: isBlockBeingDragged(clientId),
hasChildSelected: isAncestorOfSelectedBlock,
isEditingDisabled: blockEditingMode2 === "disabled",
hasEditableOutline: blockEditingMode2 !== "disabled" && getBlockEditingMode(rootClientId) === "disabled",
originalBlockClientId: isInvalid ? blocksWithSameName[0] : false,
isBlockHidden: _isBlockHidden(clientId)
};
},
[clientId, rootClientId]
);
const {
isPreviewMode,
// Fill values that end up as a public API and may not be defined in
// preview mode.
mode = "visual",
isSelectionEnabled = false,
isLocked = false,
canRemove = false,
canMove = false,
blockWithoutAttributes,
name,
attributes,
isValid,
isSelected = false,
themeSupportsLayout,
isTemporarilyEditingAsBlocks,
blockEditingMode,
mayDisplayControls,
mayDisplayParentControls,
index,
blockApiVersion,
blockTitle,
isSubtreeDisabled,
hasOverlay,
initialPosition,
isHighlighted,
isMultiSelected,
isPartiallySelected,
isReusable,
isDragging,
hasChildSelected,
isSectionBlock,
isEditingDisabled,
hasEditableOutline,
className,
defaultClassName,
originalBlockClientId,
isBlockHidden,
bindableAttributes
} = selectedProps;
const block = (0,external_wp_element_namespaceObject.useMemo)(
() => ({ ...blockWithoutAttributes, attributes }),
[blockWithoutAttributes, attributes]
);
if (!selectedProps) {
return null;
}
const privateContext = {
isPreviewMode,
clientId,
className,
index,
mode,
name,
blockApiVersion,
blockTitle,
isSelected,
isSubtreeDisabled,
hasOverlay,
initialPosition,
blockEditingMode,
isHighlighted,
isMultiSelected,
isPartiallySelected,
isReusable,
isDragging,
hasChildSelected,
isSectionBlock,
isEditingDisabled,
hasEditableOutline,
isTemporarilyEditingAsBlocks,
defaultClassName,
mayDisplayControls,
mayDisplayParentControls,
originalBlockClientId,
themeSupportsLayout,
canMove,
isBlockHidden,
bindableAttributes
};
if (isBlockHidden && !isSelected && !isMultiSelected && !hasChildSelected) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateBlockContext.Provider, { value: privateContext, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockListBlock,
{
...props,
...{
mode,
isSelectionEnabled,
isLocked,
canRemove,
canMove,
// Users of the editor.BlockListBlock filter used to be able
// to access the block prop. Ideally these blocks would rely
// on the clientId prop only. This is kept for backward
// compatibility reasons.
block,
name,
attributes,
isValid,
isSelected
}
}
) });
}
var block_default = (0,external_wp_element_namespaceObject.memo)(BlockListBlockProvider);
;// external ["wp","htmlEntities"]
const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
;// ./node_modules/@wordpress/block-editor/build-module/components/default-block-appender/index.js
const ZWNBSP = "\uFEFF";
function DefaultBlockAppender({ rootClientId }) {
const { showPrompt, isLocked, placeholder, isManualGrid } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getBlockCount,
getSettings,
getTemplateLock,
getBlockAttributes
} = select(store);
const isEmpty = !getBlockCount(rootClientId);
const { bodyPlaceholder } = getSettings();
return {
showPrompt: isEmpty,
isLocked: !!getTemplateLock(rootClientId),
placeholder: bodyPlaceholder,
isManualGrid: getBlockAttributes(rootClientId)?.layout?.isManualPlacement
};
},
[rootClientId]
);
const { insertDefaultBlock, startTyping } = (0,external_wp_data_namespaceObject.useDispatch)(store);
if (isLocked || isManualGrid) {
return null;
}
const value = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(placeholder) || (0,external_wp_i18n_namespaceObject.__)("Type / to choose a block");
const onAppend = () => {
insertDefaultBlock(void 0, rootClientId);
startTyping();
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
"data-root-client-id": rootClientId || "",
className: dist_clsx("block-editor-default-block-appender", {
"has-visible-prompt": showPrompt
}),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"p",
{
tabIndex: "0",
role: "button",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Add default block"),
className: "block-editor-default-block-appender__content",
onKeyDown: (event) => {
if (external_wp_keycodes_namespaceObject.ENTER === event.keyCode || external_wp_keycodes_namespaceObject.SPACE === event.keyCode) {
onAppend();
}
},
onClick: () => onAppend(),
onFocus: () => {
if (showPrompt) {
onAppend();
}
},
children: showPrompt ? value : ZWNBSP
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inserter_default,
{
rootClientId,
position: "bottom right",
isAppender: true,
__experimentalIsQuick: true
}
)
]
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list-appender/index.js
function DefaultAppender({ rootClientId }) {
const canInsertDefaultBlock = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).canInsertBlockType(
(0,external_wp_blocks_namespaceObject.getDefaultBlockName)(),
rootClientId
)
);
if (canInsertDefaultBlock) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DefaultBlockAppender, { rootClientId });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
button_block_appender_default,
{
rootClientId,
className: "block-list-appender__toggle"
}
);
}
function BlockListAppender({
rootClientId,
CustomAppender,
className,
tagName: TagName = "div"
}) {
const isDragOver = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getBlockInsertionPoint,
isBlockInsertionPointVisible,
getBlockCount
} = select(store);
const insertionPoint = getBlockInsertionPoint();
return isBlockInsertionPointVisible() && rootClientId === insertionPoint?.rootClientId && getBlockCount(rootClientId) === 0;
},
[rootClientId]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
TagName,
{
tabIndex: -1,
className: dist_clsx("block-list-appender wp-block", className, {
"is-drag-over": isDragOver
}),
contentEditable: false,
"data-block": true,
children: CustomAppender ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomAppender, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DefaultAppender, { rootClientId })
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-popover/inbetween.js
const inbetween_MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;
function BlockPopoverInbetween({
previousClientId,
nextClientId,
children,
__unstablePopoverSlot,
__unstableContentRef,
operation = "insert",
nearestSide = "right",
...props
}) {
const [popoverRecomputeCounter, forcePopoverRecompute] = (0,external_wp_element_namespaceObject.useReducer)(
// Module is there to make sure that the counter doesn't overflow.
(s) => (s + 1) % inbetween_MAX_POPOVER_RECOMPUTE_COUNTER,
0
);
const { orientation, rootClientId, isVisible } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getBlockListSettings,
getBlockRootClientId,
isBlockVisible
} = select(store);
const _rootClientId = getBlockRootClientId(
previousClientId ?? nextClientId
);
return {
orientation: getBlockListSettings(_rootClientId)?.orientation || "vertical",
rootClientId: _rootClientId,
isVisible: isBlockVisible(previousClientId) && isBlockVisible(nextClientId)
};
},
[previousClientId, nextClientId]
);
const previousElement = useBlockElement(previousClientId);
const nextElement = useBlockElement(nextClientId);
const isVertical = orientation === "vertical";
const popoverAnchor = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (
// popoverRecomputeCounter is by definition always equal or greater than 0.
// This check is only there to satisfy the correctness of the
// exhaustive-deps rule for the `useMemo` hook.
popoverRecomputeCounter < 0 || !previousElement && !nextElement || !isVisible
) {
return void 0;
}
const contextElement = operation === "group" ? nextElement || previousElement : previousElement || nextElement;
return {
contextElement,
getBoundingClientRect() {
const previousRect = previousElement ? previousElement.getBoundingClientRect() : null;
const nextRect = nextElement ? nextElement.getBoundingClientRect() : null;
let left = 0;
let top = 0;
let width = 0;
let height = 0;
if (operation === "group") {
const targetRect = nextRect || previousRect;
top = targetRect.top;
width = 0;
height = targetRect.bottom - targetRect.top;
left = nearestSide === "left" ? targetRect.left - 2 : targetRect.right - 2;
} else if (isVertical) {
top = previousRect ? previousRect.bottom : nextRect.top;
width = previousRect ? previousRect.width : nextRect.width;
height = nextRect && previousRect ? nextRect.top - previousRect.bottom : 0;
left = previousRect ? previousRect.left : nextRect.left;
} else {
top = previousRect ? previousRect.top : nextRect.top;
height = previousRect ? previousRect.height : nextRect.height;
if ((0,external_wp_i18n_namespaceObject.isRTL)()) {
left = nextRect ? nextRect.right : previousRect.left;
width = previousRect && nextRect ? previousRect.left - nextRect.right : 0;
} else {
left = previousRect ? previousRect.right : nextRect.left;
width = previousRect && nextRect ? nextRect.left - previousRect.right : 0;
}
width = Math.max(width, 0);
}
return new window.DOMRect(left, top, width, height);
}
};
}, [
previousElement,
nextElement,
popoverRecomputeCounter,
isVertical,
isVisible,
operation,
nearestSide
]);
const popoverScrollRef = use_popover_scroll_default(__unstableContentRef);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (!previousElement) {
return;
}
const observer = new window.MutationObserver(forcePopoverRecompute);
observer.observe(previousElement, { attributes: true });
return () => {
observer.disconnect();
};
}, [previousElement]);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (!nextElement) {
return;
}
const observer = new window.MutationObserver(forcePopoverRecompute);
observer.observe(nextElement, { attributes: true });
return () => {
observer.disconnect();
};
}, [nextElement]);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (!previousElement) {
return;
}
previousElement.ownerDocument.defaultView.addEventListener(
"resize",
forcePopoverRecompute
);
return () => {
previousElement.ownerDocument.defaultView?.removeEventListener(
"resize",
forcePopoverRecompute
);
};
}, [previousElement]);
if (!previousElement && !nextElement || !isVisible) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Popover,
{
ref: popoverScrollRef,
animate: false,
anchor: popoverAnchor,
focusOnMount: false,
__unstableSlotName: __unstablePopoverSlot,
inline: !__unstablePopoverSlot,
...props,
className: dist_clsx(
"block-editor-block-popover",
"block-editor-block-popover__inbetween",
props.className
),
resize: false,
flip: false,
placement: "overlay",
variant: "unstyled",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-popover__inbetween-container", children })
},
nextClientId + "--" + rootClientId
);
}
var inbetween_default = BlockPopoverInbetween;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-popover/drop-zone.js
const animateVariants = {
hide: { opacity: 0, scaleY: 0.75 },
show: { opacity: 1, scaleY: 1 },
exit: { opacity: 0, scaleY: 0.9 }
};
function BlockDropZonePopover({
__unstablePopoverSlot,
__unstableContentRef
}) {
const { clientId } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getBlockOrder, getBlockInsertionPoint } = select(store);
const insertionPoint = getBlockInsertionPoint();
const order = getBlockOrder(insertionPoint.rootClientId);
if (!order.length) {
return {};
}
return {
clientId: order[insertionPoint.index]
};
}, []);
const reducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
cover_default,
{
clientId,
__unstablePopoverSlot,
__unstableContentRef,
className: "block-editor-block-popover__drop-zone",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
"data-testid": "block-popover-drop-zone",
initial: reducedMotion ? animateVariants.show : animateVariants.hide,
animate: animateVariants.show,
exit: reducedMotion ? animateVariants.show : animateVariants.exit,
className: "block-editor-block-popover__drop-zone-foreground"
}
)
}
);
}
var drop_zone_default = BlockDropZonePopover;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/insertion-point.js
const InsertionPointOpenRef = (0,external_wp_element_namespaceObject.createContext)();
InsertionPointOpenRef.displayName = "InsertionPointOpenRefContext";
function InbetweenInsertionPointPopover({
__unstablePopoverSlot,
__unstableContentRef,
operation = "insert",
nearestSide = "right"
}) {
const { selectBlock, hideInsertionPoint } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const openRef = (0,external_wp_element_namespaceObject.useContext)(InsertionPointOpenRef);
const ref = (0,external_wp_element_namespaceObject.useRef)();
const {
orientation,
previousClientId,
nextClientId,
rootClientId,
isInserterShown,
isDistractionFree,
isZoomOutMode
} = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const {
getBlockOrder,
getBlockListSettings,
getBlockInsertionPoint,
isBlockBeingDragged,
getPreviousBlockClientId,
getNextBlockClientId,
getSettings,
isZoomOut
} = unlock(select(store));
const insertionPoint = getBlockInsertionPoint();
const order = getBlockOrder(insertionPoint.rootClientId);
if (!order.length) {
return {};
}
let _previousClientId = order[insertionPoint.index - 1];
let _nextClientId = order[insertionPoint.index];
while (isBlockBeingDragged(_previousClientId)) {
_previousClientId = getPreviousBlockClientId(_previousClientId);
}
while (isBlockBeingDragged(_nextClientId)) {
_nextClientId = getNextBlockClientId(_nextClientId);
}
const settings = getSettings();
return {
previousClientId: _previousClientId,
nextClientId: _nextClientId,
orientation: getBlockListSettings(insertionPoint.rootClientId)?.orientation || "vertical",
rootClientId: insertionPoint.rootClientId,
isDistractionFree: settings.isDistractionFree,
isInserterShown: insertionPoint?.__unstableWithInserter,
isZoomOutMode: isZoomOut()
};
}, []);
const { getBlockEditingMode } = (0,external_wp_data_namespaceObject.useSelect)(store);
const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
function onClick(event) {
if (event.target === ref.current && nextClientId && getBlockEditingMode(nextClientId) !== "disabled") {
selectBlock(nextClientId, -1);
}
}
function maybeHideInserterPoint(event) {
if (event.target === ref.current && !openRef.current) {
hideInsertionPoint();
}
}
function onFocus(event) {
if (event.target !== ref.current) {
openRef.current = true;
}
}
const maybeResetOpenRef = (0,external_wp_element_namespaceObject.useCallback)(
(node) => {
if (!node && openRef.current) {
openRef.current = false;
}
},
[openRef]
);
const lineVariants = {
// Initial position starts from the center and invisible.
start: {
opacity: 0,
scale: 0
},
// The line expands to fill the container. If the inserter is visible it
// is delayed so it appears orchestrated.
rest: {
opacity: 1,
scale: 1,
transition: { delay: isInserterShown ? 0.5 : 0, type: "tween" }
},
hover: {
opacity: 1,
scale: 1,
transition: { delay: 0.5, type: "tween" }
}
};
const inserterVariants = {
start: {
scale: disableMotion ? 1 : 0
},
rest: {
scale: 1,
transition: { delay: 0.4, type: "tween" }
}
};
if (isDistractionFree) {
return null;
}
if (isZoomOutMode && operation !== "insert") {
return null;
}
const orientationClassname = orientation === "horizontal" || operation === "group" ? "is-horizontal" : "is-vertical";
const className = dist_clsx(
"block-editor-block-list__insertion-point",
orientationClassname
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inbetween_default,
{
previousClientId,
nextClientId,
__unstablePopoverSlot,
__unstableContentRef,
operation,
nearestSide,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
layout: !disableMotion,
initial: disableMotion ? "rest" : "start",
animate: "rest",
whileHover: "hover",
whileTap: "pressed",
exit: "start",
ref,
tabIndex: -1,
onClick,
onFocus,
className: dist_clsx(className, {
"is-with-inserter": isInserterShown
}),
onHoverEnd: maybeHideInserterPoint,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
variants: lineVariants,
className: "block-editor-block-list__insertion-point-indicator",
"data-testid": "block-list-insertion-point-indicator"
}
),
isInserterShown && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
variants: inserterVariants,
className: dist_clsx(
"block-editor-block-list__insertion-point-inserter"
),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inserter_default,
{
ref: maybeResetOpenRef,
position: "bottom center",
clientId: nextClientId,
rootClientId,
__experimentalIsQuick: true,
onToggle: (isOpen) => {
openRef.current = isOpen;
},
onSelectOrClose: () => {
openRef.current = false;
}
}
)
}
)
]
}
)
}
);
}
function InsertionPoint(props) {
const { insertionPoint, isVisible, isBlockListEmpty } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getBlockInsertionPoint,
isBlockInsertionPointVisible,
getBlockCount
} = select(store);
const blockInsertionPoint = getBlockInsertionPoint();
return {
insertionPoint: blockInsertionPoint,
isVisible: isBlockInsertionPointVisible(),
isBlockListEmpty: getBlockCount(blockInsertionPoint?.rootClientId) === 0
};
},
[]
);
if (!isVisible || // Don't render the insertion point if the block list is empty.
// The insertion point will be represented by the appender instead.
isBlockListEmpty) {
return null;
}
return insertionPoint.operation === "replace" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
drop_zone_default,
{
...props
},
`${insertionPoint.rootClientId}-${insertionPoint.index}`
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
InbetweenInsertionPointPopover,
{
operation: insertionPoint.operation,
nearestSide: insertionPoint.nearestSide,
...props
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-in-between-inserter.js
function useInBetweenInserter() {
const openRef = (0,external_wp_element_namespaceObject.useContext)(InsertionPointOpenRef);
const isInBetweenInserterDisabled = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).getSettings().isDistractionFree || unlock(select(store)).isZoomOut(),
[]
);
const {
getBlockListSettings,
getBlockIndex,
isMultiSelecting,
getSelectedBlockClientIds,
getSettings,
getTemplateLock,
__unstableIsWithinBlockOverlay,
getBlockEditingMode,
getBlockName,
getBlockAttributes,
getParentSectionBlock
} = unlock((0,external_wp_data_namespaceObject.useSelect)(store));
const { showInsertionPoint, hideInsertionPoint } = (0,external_wp_data_namespaceObject.useDispatch)(store);
return (0,external_wp_compose_namespaceObject.useRefEffect)(
(node) => {
if (isInBetweenInserterDisabled) {
return;
}
function onMouseMove(event) {
if (openRef === void 0 || openRef.current) {
return;
}
if (event.target.nodeType === event.target.TEXT_NODE) {
return;
}
if (isMultiSelecting()) {
return;
}
if (!event.target.classList.contains(
"block-editor-block-list__layout"
)) {
hideInsertionPoint();
return;
}
let rootClientId;
if (!event.target.classList.contains("is-root-container")) {
const blockElement = !!event.target.getAttribute(
"data-block"
) ? event.target : event.target.closest("[data-block]");
rootClientId = blockElement.getAttribute("data-block");
}
if (getTemplateLock(rootClientId) || getBlockEditingMode(rootClientId) === "disabled" || getBlockName(rootClientId) === "core/block" || rootClientId && getBlockAttributes(rootClientId).layout?.isManualPlacement) {
return;
}
const blockListSettings = getBlockListSettings(rootClientId);
const orientation = blockListSettings?.orientation || "vertical";
const captureToolbars = !!blockListSettings?.__experimentalCaptureToolbars;
const offsetTop = event.clientY;
const offsetLeft = event.clientX;
const children = Array.from(event.target.children);
let element = children.find((blockEl) => {
const blockElRect = blockEl.getBoundingClientRect();
return blockEl.classList.contains("wp-block") && orientation === "vertical" && blockElRect.top > offsetTop || blockEl.classList.contains("wp-block") && orientation === "horizontal" && ((0,external_wp_i18n_namespaceObject.isRTL)() ? blockElRect.right < offsetLeft : blockElRect.left > offsetLeft);
});
if (!element) {
hideInsertionPoint();
return;
}
if (!element.id) {
element = element.firstElementChild;
if (!element) {
hideInsertionPoint();
return;
}
}
const clientId = element.id.slice("block-".length);
if (!clientId || __unstableIsWithinBlockOverlay(clientId) || !!getParentSectionBlock(clientId)) {
return;
}
if (getSelectedBlockClientIds().includes(clientId) && orientation === "vertical" && !captureToolbars && !getSettings().hasFixedToolbar) {
return;
}
const elementRect = element.getBoundingClientRect();
if (orientation === "horizontal" && (event.clientY > elementRect.bottom || event.clientY < elementRect.top) || orientation === "vertical" && (event.clientX > elementRect.right || event.clientX < elementRect.left)) {
hideInsertionPoint();
return;
}
const index = getBlockIndex(clientId);
if (index === 0) {
hideInsertionPoint();
return;
}
showInsertionPoint(rootClientId, index, {
__unstableWithInserter: true
});
}
node.addEventListener("mousemove", onMouseMove);
return () => {
node.removeEventListener("mousemove", onMouseMove);
};
},
[
openRef,
getBlockListSettings,
getBlockIndex,
isMultiSelecting,
showInsertionPoint,
hideInsertionPoint,
getSelectedBlockClientIds,
isInBetweenInserterDisabled
]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-selection-clearer/index.js
function useBlockSelectionClearer() {
const { getSettings, hasSelectedBlock, hasMultiSelection } = (0,external_wp_data_namespaceObject.useSelect)(store);
const { clearSelectedBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const { clearBlockSelection: isEnabled } = getSettings();
return (0,external_wp_compose_namespaceObject.useRefEffect)(
(node) => {
if (!isEnabled) {
return;
}
function onMouseDown(event) {
if (!hasSelectedBlock() && !hasMultiSelection()) {
return;
}
if (event.target !== node) {
return;
}
clearSelectedBlock();
}
node.addEventListener("mousedown", onMouseDown);
return () => {
node.removeEventListener("mousedown", onMouseDown);
};
},
[hasSelectedBlock, hasMultiSelection, clearSelectedBlock, isEnabled]
);
}
function BlockSelectionClearer(props) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: useBlockSelectionClearer(), ...props });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/button-block-appender.js
function ButtonBlockAppender({
showSeparator,
isFloating,
onAddBlock,
isToggle
}) {
const { clientId } = useBlockEditContext();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
button_block_appender_default,
{
className: dist_clsx({
"block-list-appender__toggle": isToggle
}),
rootClientId: clientId,
showSeparator,
isFloating,
onAddBlock
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/default-block-appender.js
function default_block_appender_DefaultBlockAppender() {
const { clientId } = useBlockEditContext();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DefaultBlockAppender, { rootClientId: clientId });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/use-nested-settings-update.js
const pendingSettingsUpdates = /* @__PURE__ */ new WeakMap();
function createShallowMemo() {
let value;
return (newValue) => {
if (value === void 0 || !external_wp_isShallowEqual_default()(value, newValue)) {
value = newValue;
}
return value;
};
}
function useShallowMemo(value) {
const [memo] = (0,external_wp_element_namespaceObject.useState)(createShallowMemo);
return memo(value);
}
function useNestedSettingsUpdate(clientId, parentLock, allowedBlocks, prioritizedInserterBlocks, defaultBlock, directInsert, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, captureToolbars, orientation, layout) {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const _allowedBlocks = useShallowMemo(allowedBlocks);
const _prioritizedInserterBlocks = useShallowMemo(
prioritizedInserterBlocks
);
const _templateLock = templateLock === void 0 || parentLock === "contentOnly" ? parentLock : templateLock;
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
const newSettings = {
allowedBlocks: _allowedBlocks,
prioritizedInserterBlocks: _prioritizedInserterBlocks,
templateLock: _templateLock
};
if (captureToolbars !== void 0) {
newSettings.__experimentalCaptureToolbars = captureToolbars;
}
if (orientation !== void 0) {
newSettings.orientation = orientation;
} else {
const layoutType = getLayoutType(layout?.type);
newSettings.orientation = layoutType.getOrientation(layout);
}
if (__experimentalDefaultBlock !== void 0) {
external_wp_deprecated_default()("__experimentalDefaultBlock", {
alternative: "defaultBlock",
since: "6.3",
version: "6.4"
});
newSettings.defaultBlock = __experimentalDefaultBlock;
}
if (defaultBlock !== void 0) {
newSettings.defaultBlock = defaultBlock;
}
if (__experimentalDirectInsert !== void 0) {
external_wp_deprecated_default()("__experimentalDirectInsert", {
alternative: "directInsert",
since: "6.3",
version: "6.4"
});
newSettings.directInsert = __experimentalDirectInsert;
}
if (directInsert !== void 0) {
newSettings.directInsert = directInsert;
}
if (newSettings.directInsert !== void 0 && typeof newSettings.directInsert !== "boolean") {
external_wp_deprecated_default()("Using `Function` as a `directInsert` argument", {
alternative: "`boolean` values",
since: "6.5"
});
}
if (!pendingSettingsUpdates.get(registry)) {
pendingSettingsUpdates.set(registry, {});
}
pendingSettingsUpdates.get(registry)[clientId] = newSettings;
window.queueMicrotask(() => {
const settings = pendingSettingsUpdates.get(registry);
if (Object.keys(settings).length) {
const { updateBlockListSettings } = registry.dispatch(store);
updateBlockListSettings(settings);
pendingSettingsUpdates.set(registry, {});
}
});
}, [
clientId,
_allowedBlocks,
_prioritizedInserterBlocks,
_templateLock,
defaultBlock,
directInsert,
__experimentalDefaultBlock,
__experimentalDirectInsert,
captureToolbars,
orientation,
layout,
registry
]);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/use-inner-block-template-sync.js
function useInnerBlockTemplateSync(clientId, template, templateLock, templateInsertUpdatesSelection) {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const existingTemplateRef = (0,external_wp_element_namespaceObject.useRef)(null);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
let isCancelled = false;
const {
getBlocks,
getSelectedBlocksInitialCaretPosition,
isBlockSelected
} = registry.select(store);
const { replaceInnerBlocks, __unstableMarkNextChangeAsNotPersistent } = registry.dispatch(store);
window.queueMicrotask(() => {
if (isCancelled) {
return;
}
const currentInnerBlocks = getBlocks(clientId);
const shouldApplyTemplate = currentInnerBlocks.length === 0 || templateLock === "all" || templateLock === "contentOnly";
const hasTemplateChanged = !es6_default()(
template,
existingTemplateRef.current
);
if (!shouldApplyTemplate || !hasTemplateChanged) {
return;
}
existingTemplateRef.current = template;
const nextBlocks = (0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)(
currentInnerBlocks,
template
);
if (!es6_default()(nextBlocks, currentInnerBlocks)) {
__unstableMarkNextChangeAsNotPersistent();
replaceInnerBlocks(
clientId,
nextBlocks,
currentInnerBlocks.length === 0 && templateInsertUpdatesSelection && nextBlocks.length !== 0 && isBlockSelected(clientId),
// This ensures the "initialPosition" doesn't change when applying the template
// If we're supposed to focus the block, we'll focus the first inner block
// otherwise, we won't apply any auto-focus.
// This ensures for instance that the focus stays in the inserter when inserting the "buttons" block.
getSelectedBlocksInitialCaretPosition()
);
}
});
return () => {
isCancelled = true;
};
}, [
template,
templateLock,
clientId,
registry,
templateInsertUpdatesSelection
]);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/use-block-context.js
function useBlockContext(clientId) {
return (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const block = select(store).getBlock(clientId);
if (!block) {
return void 0;
}
const blockType = select(external_wp_blocks_namespaceObject.store).getBlockType(block.name);
if (!blockType) {
return void 0;
}
if (Object.keys(blockType.providesContext).length === 0) {
return void 0;
}
return Object.fromEntries(
Object.entries(blockType.providesContext).map(
([contextName, attributeName]) => [
contextName,
block.attributes[attributeName]
]
)
);
},
[clientId]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/use-on-block-drop/index.js
function parseDropEvent(event) {
let result = {
srcRootClientId: null,
srcClientIds: null,
srcIndex: null,
type: null,
blocks: null
};
if (!event.dataTransfer) {
return result;
}
try {
result = Object.assign(
result,
JSON.parse(event.dataTransfer.getData("wp-blocks"))
);
} catch (err) {
return result;
}
return result;
}
function onBlockDrop(targetRootClientId, targetBlockIndex, getBlockIndex, getClientIdsOfDescendants, moveBlocks, insertOrReplaceBlocks, clearSelectedBlock, operation, getBlock) {
return (event) => {
const {
srcRootClientId: sourceRootClientId,
srcClientIds: sourceClientIds,
type: dropType,
blocks
} = parseDropEvent(event);
if (dropType === "inserter") {
clearSelectedBlock();
const blocksToInsert = blocks.map(
(block) => (0,external_wp_blocks_namespaceObject.cloneBlock)(block)
);
insertOrReplaceBlocks(blocksToInsert, true, null);
}
if (dropType === "block") {
const sourceBlockIndex = getBlockIndex(sourceClientIds[0]);
if (sourceRootClientId === targetRootClientId && sourceBlockIndex === targetBlockIndex) {
return;
}
if (sourceClientIds.includes(targetRootClientId) || getClientIdsOfDescendants(sourceClientIds).some(
(id) => id === targetRootClientId
)) {
return;
}
if (operation === "group") {
const blocksToInsert = sourceClientIds.map(
(clientId) => getBlock(clientId)
);
insertOrReplaceBlocks(
blocksToInsert,
true,
null,
sourceClientIds
);
return;
}
const isAtSameLevel = sourceRootClientId === targetRootClientId;
const draggedBlockCount = sourceClientIds.length;
const insertIndex = isAtSameLevel && sourceBlockIndex < targetBlockIndex ? targetBlockIndex - draggedBlockCount : targetBlockIndex;
moveBlocks(sourceClientIds, sourceRootClientId, insertIndex);
}
};
}
function onFilesDrop(targetRootClientId, getSettings, updateBlockAttributes, canInsertBlockType, insertOrReplaceBlocks) {
return (files) => {
if (!getSettings().mediaUpload) {
return;
}
const transformation = (0,external_wp_blocks_namespaceObject.findTransform)(
(0,external_wp_blocks_namespaceObject.getBlockTransforms)("from"),
(transform) => transform.type === "files" && canInsertBlockType(transform.blockName, targetRootClientId) && transform.isMatch(files)
);
if (transformation) {
const blocks = transformation.transform(
files,
updateBlockAttributes
);
insertOrReplaceBlocks(blocks);
}
};
}
function onHTMLDrop(insertOrReplaceBlocks) {
return (HTML) => {
const blocks = (0,external_wp_blocks_namespaceObject.pasteHandler)({ HTML, mode: "BLOCKS" });
if (blocks.length) {
insertOrReplaceBlocks(blocks);
}
};
}
function useOnBlockDrop(targetRootClientId, targetBlockIndex, options = {}) {
const { operation = "insert", nearestSide = "right" } = options;
const {
canInsertBlockType,
getBlockIndex,
getClientIdsOfDescendants,
getBlockOrder,
getBlocksByClientId,
getSettings,
getBlock
} = (0,external_wp_data_namespaceObject.useSelect)(store);
const { getGroupingBlockName } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store);
const {
insertBlocks,
moveBlocksToPosition,
updateBlockAttributes,
clearSelectedBlock,
replaceBlocks,
removeBlocks
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const insertOrReplaceBlocks = (0,external_wp_element_namespaceObject.useCallback)(
(blocks, updateSelection = true, initialPosition = 0, clientIdsToReplace = []) => {
if (!Array.isArray(blocks)) {
blocks = [blocks];
}
const clientIds = getBlockOrder(targetRootClientId);
const clientId = clientIds[targetBlockIndex];
if (operation === "replace") {
replaceBlocks(clientId, blocks, void 0, initialPosition);
} else if (operation === "group") {
const targetBlock = getBlock(clientId);
if (nearestSide === "left") {
blocks.push(targetBlock);
} else {
blocks.unshift(targetBlock);
}
const groupInnerBlocks = blocks.map((block) => {
return (0,external_wp_blocks_namespaceObject.createBlock)(
block.name,
block.attributes,
block.innerBlocks
);
});
const areAllImages = blocks.every((block) => {
return block.name === "core/image";
});
const galleryBlock = canInsertBlockType(
"core/gallery",
targetRootClientId
);
const wrappedBlocks = (0,external_wp_blocks_namespaceObject.createBlock)(
areAllImages && galleryBlock ? "core/gallery" : getGroupingBlockName(),
{
layout: {
type: "flex",
flexWrap: areAllImages && galleryBlock ? null : "nowrap"
}
},
groupInnerBlocks
);
replaceBlocks(
[clientId, ...clientIdsToReplace],
wrappedBlocks,
void 0,
initialPosition
);
} else {
insertBlocks(
blocks,
targetBlockIndex,
targetRootClientId,
updateSelection,
initialPosition
);
}
},
[
getBlockOrder,
targetRootClientId,
targetBlockIndex,
operation,
replaceBlocks,
getBlock,
nearestSide,
canInsertBlockType,
getGroupingBlockName,
insertBlocks
]
);
const moveBlocks = (0,external_wp_element_namespaceObject.useCallback)(
(sourceClientIds, sourceRootClientId, insertIndex) => {
if (operation === "replace") {
const sourceBlocks = getBlocksByClientId(sourceClientIds);
const targetBlockClientIds = getBlockOrder(targetRootClientId);
const targetBlockClientId = targetBlockClientIds[targetBlockIndex];
registry.batch(() => {
removeBlocks(sourceClientIds, false);
replaceBlocks(
targetBlockClientId,
sourceBlocks,
void 0,
0
);
});
} else {
moveBlocksToPosition(
sourceClientIds,
sourceRootClientId,
targetRootClientId,
insertIndex
);
}
},
[
operation,
getBlockOrder,
getBlocksByClientId,
moveBlocksToPosition,
registry,
removeBlocks,
replaceBlocks,
targetBlockIndex,
targetRootClientId
]
);
const _onDrop = onBlockDrop(
targetRootClientId,
targetBlockIndex,
getBlockIndex,
getClientIdsOfDescendants,
moveBlocks,
insertOrReplaceBlocks,
clearSelectedBlock,
operation,
getBlock
);
const _onFilesDrop = onFilesDrop(
targetRootClientId,
getSettings,
updateBlockAttributes,
canInsertBlockType,
insertOrReplaceBlocks
);
const _onHTMLDrop = onHTMLDrop(insertOrReplaceBlocks);
return (event) => {
const files = (0,external_wp_dom_namespaceObject.getFilesFromDataTransfer)(event.dataTransfer);
const html = event.dataTransfer.getData("text/html");
if (html) {
_onHTMLDrop(html);
} else if (files.length) {
_onFilesDrop(files);
} else {
_onDrop(event);
}
};
}
;// ./node_modules/@wordpress/block-editor/build-module/utils/math.js
function getDistanceFromPointToEdge(point, rect, edge) {
const isHorizontal = edge === "top" || edge === "bottom";
const { x, y } = point;
const pointLateralPosition = isHorizontal ? x : y;
const pointForwardPosition = isHorizontal ? y : x;
const edgeStart = isHorizontal ? rect.left : rect.top;
const edgeEnd = isHorizontal ? rect.right : rect.bottom;
const edgeForwardPosition = rect[edge];
let edgeLateralPosition;
if (pointLateralPosition >= edgeStart && pointLateralPosition <= edgeEnd) {
edgeLateralPosition = pointLateralPosition;
} else if (pointLateralPosition < edgeEnd) {
edgeLateralPosition = edgeStart;
} else {
edgeLateralPosition = edgeEnd;
}
return Math.sqrt(
(pointLateralPosition - edgeLateralPosition) ** 2 + (pointForwardPosition - edgeForwardPosition) ** 2
);
}
function getDistanceToNearestEdge(point, rect, allowedEdges = ["top", "bottom", "left", "right"]) {
let candidateDistance;
let candidateEdge;
allowedEdges.forEach((edge) => {
const distance = getDistanceFromPointToEdge(point, rect, edge);
if (candidateDistance === void 0 || distance < candidateDistance) {
candidateDistance = distance;
candidateEdge = edge;
}
});
return [candidateDistance, candidateEdge];
}
function isPointContainedByRect(point, rect) {
return rect.left <= point.x && rect.right >= point.x && rect.top <= point.y && rect.bottom >= point.y;
}
function isPointWithinTopAndBottomBoundariesOfRect(point, rect) {
return rect.top <= point.y && rect.bottom >= point.y;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/use-block-drop-zone/index.js
const THRESHOLD_DISTANCE = 30;
const MINIMUM_HEIGHT_FOR_THRESHOLD = 120;
const MINIMUM_WIDTH_FOR_THRESHOLD = 120;
function getDropTargetPosition(blocksData, position, orientation = "vertical", options = {}) {
const allowedEdges = orientation === "horizontal" ? ["left", "right"] : ["top", "bottom"];
let nearestIndex = 0;
let insertPosition = "before";
let minDistance = Infinity;
let targetBlockIndex = null;
let nearestSide = "right";
const {
dropZoneElement,
parentBlockOrientation,
rootBlockIndex = 0
} = options;
if (dropZoneElement && parentBlockOrientation !== "horizontal") {
const rect = dropZoneElement.getBoundingClientRect();
const [distance, edge] = getDistanceToNearestEdge(position, rect, [
"top",
"bottom"
]);
if (rect.height > MINIMUM_HEIGHT_FOR_THRESHOLD && distance < THRESHOLD_DISTANCE) {
if (edge === "top") {
return [rootBlockIndex, "before"];
}
if (edge === "bottom") {
return [rootBlockIndex + 1, "after"];
}
}
}
const isRightToLeft = (0,external_wp_i18n_namespaceObject.isRTL)();
if (dropZoneElement && parentBlockOrientation === "horizontal") {
const rect = dropZoneElement.getBoundingClientRect();
const [distance, edge] = getDistanceToNearestEdge(position, rect, [
"left",
"right"
]);
if (rect.width > MINIMUM_WIDTH_FOR_THRESHOLD && distance < THRESHOLD_DISTANCE) {
if (isRightToLeft && edge === "right" || !isRightToLeft && edge === "left") {
return [rootBlockIndex, "before"];
}
if (isRightToLeft && edge === "left" || !isRightToLeft && edge === "right") {
return [rootBlockIndex + 1, "after"];
}
}
}
blocksData.forEach(
({
isUnmodifiedDefaultBlock,
getBoundingClientRect,
blockIndex,
blockOrientation
}) => {
const rect = getBoundingClientRect();
if (!rect) {
return;
}
let [distance, edge] = getDistanceToNearestEdge(
position,
rect,
allowedEdges
);
const [sideDistance, sideEdge] = getDistanceToNearestEdge(
position,
rect,
["left", "right"]
);
const isPointInsideRect = isPointContainedByRect(position, rect);
if (isUnmodifiedDefaultBlock && isPointInsideRect) {
distance = 0;
} else if (orientation === "vertical" && blockOrientation !== "horizontal" && (isPointInsideRect && sideDistance < THRESHOLD_DISTANCE || !isPointInsideRect && isPointWithinTopAndBottomBoundariesOfRect(
position,
rect
))) {
targetBlockIndex = blockIndex;
nearestSide = sideEdge;
}
if (distance < minDistance) {
insertPosition = edge === "bottom" || !isRightToLeft && edge === "right" || isRightToLeft && edge === "left" ? "after" : "before";
minDistance = distance;
nearestIndex = blockIndex;
}
}
);
const adjacentIndex = nearestIndex + (insertPosition === "after" ? 1 : -1);
const isNearestBlockUnmodifiedDefaultBlock = !!blocksData[nearestIndex]?.isUnmodifiedDefaultBlock;
const isAdjacentBlockUnmodifiedDefaultBlock = !!blocksData[adjacentIndex]?.isUnmodifiedDefaultBlock;
if (targetBlockIndex !== null) {
return [targetBlockIndex, "group", nearestSide];
}
if (!isNearestBlockUnmodifiedDefaultBlock && !isAdjacentBlockUnmodifiedDefaultBlock) {
const insertionIndex = insertPosition === "after" ? nearestIndex + 1 : nearestIndex;
return [insertionIndex, "insert"];
}
return [
isNearestBlockUnmodifiedDefaultBlock ? nearestIndex : adjacentIndex,
"replace"
];
}
function isDropTargetValid(getBlockType, allowedBlocks, draggedBlockNames, targetBlockName) {
let areBlocksAllowed = true;
if (allowedBlocks) {
const allowedBlockNames = allowedBlocks?.map(({ name }) => name);
areBlocksAllowed = draggedBlockNames.every(
(name) => allowedBlockNames?.includes(name)
);
}
const draggedBlockTypes = draggedBlockNames.map(
(name) => getBlockType(name)
);
const targetMatchesDraggedBlockParents = draggedBlockTypes.every(
(block) => {
const [allowedParentName] = block?.parent || [];
if (!allowedParentName) {
return true;
}
return allowedParentName === targetBlockName;
}
);
return areBlocksAllowed && targetMatchesDraggedBlockParents;
}
function isInsertionPoint(targetToCheck, ownerDocument) {
const { defaultView } = ownerDocument;
return !!(defaultView && targetToCheck instanceof defaultView.HTMLElement && targetToCheck.closest("[data-is-insertion-point]"));
}
function useBlockDropZone({
dropZoneElement,
// An undefined value represents a top-level block. Default to an empty
// string for this so that `targetRootClientId` can be easily compared to
// values returned by the `getRootBlockClientId` selector, which also uses
// an empty string to represent top-level blocks.
rootClientId: targetRootClientId = "",
parentClientId: parentBlockClientId = "",
isDisabled = false
} = {}) {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const [dropTarget, setDropTarget] = (0,external_wp_element_namespaceObject.useState)({
index: null,
operation: "insert"
});
const { getBlockType, getBlockVariations, getGroupingBlockName } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store);
const {
canInsertBlockType,
getBlockListSettings,
getBlocks,
getBlockIndex,
getDraggedBlockClientIds,
getBlockNamesByClientId,
getAllowedBlocks,
isDragging,
isGroupable,
isZoomOut,
getSectionRootClientId,
getBlockParents
} = unlock((0,external_wp_data_namespaceObject.useSelect)(store));
const {
showInsertionPoint,
hideInsertionPoint,
startDragging,
stopDragging
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
const onBlockDrop = useOnBlockDrop(
dropTarget.operation === "before" || dropTarget.operation === "after" ? parentBlockClientId : targetRootClientId,
dropTarget.index,
{
operation: dropTarget.operation,
nearestSide: dropTarget.nearestSide
}
);
const throttled = (0,external_wp_compose_namespaceObject.useThrottle)(
(0,external_wp_element_namespaceObject.useCallback)(
(event, ownerDocument) => {
if (!isDragging()) {
startDragging();
}
const draggedBlockClientIds = getDraggedBlockClientIds();
const targetParents = [
targetRootClientId,
...getBlockParents(targetRootClientId, true)
];
const isTargetWithinDraggedBlocks = draggedBlockClientIds.some(
(clientId) => targetParents.includes(clientId)
);
if (isTargetWithinDraggedBlocks) {
return;
}
const allowedBlocks = getAllowedBlocks(targetRootClientId);
const targetBlockName = getBlockNamesByClientId([
targetRootClientId
])[0];
const draggedBlockNames = getBlockNamesByClientId(
draggedBlockClientIds
);
const isBlockDroppingAllowed = isDropTargetValid(
getBlockType,
allowedBlocks,
draggedBlockNames,
targetBlockName
);
if (!isBlockDroppingAllowed) {
return;
}
const sectionRootClientId = getSectionRootClientId();
if (isZoomOut() && sectionRootClientId !== targetRootClientId) {
return;
}
const blocks = getBlocks(targetRootClientId).filter((block) => {
return !((0,external_wp_blocks_namespaceObject.hasBlockSupport)(block.name, "visibility", true) && block.attributes?.metadata?.blockVisibility === false);
});
if (blocks.length === 0) {
registry.batch(() => {
setDropTarget({
index: 0,
operation: "insert"
});
showInsertionPoint(targetRootClientId, 0, {
operation: "insert"
});
});
return;
}
const blocksData = blocks.map((block) => {
const clientId = block.clientId;
return {
isUnmodifiedDefaultBlock: (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(block),
getBoundingClientRect: () => {
const blockElement = ownerDocument.getElementById(
`block-${clientId}`
);
return blockElement ? blockElement.getBoundingClientRect() : null;
},
blockIndex: getBlockIndex(clientId),
blockOrientation: getBlockListSettings(clientId)?.orientation
};
});
const dropTargetPosition = getDropTargetPosition(
blocksData,
{ x: event.clientX, y: event.clientY },
getBlockListSettings(targetRootClientId)?.orientation,
{
dropZoneElement,
parentBlockClientId,
parentBlockOrientation: parentBlockClientId ? getBlockListSettings(parentBlockClientId)?.orientation : void 0,
rootBlockIndex: getBlockIndex(targetRootClientId)
}
);
const [targetIndex, operation, nearestSide] = dropTargetPosition;
const isTargetIndexEmptyDefaultBlock = blocksData[targetIndex]?.isUnmodifiedDefaultBlock;
if (isZoomOut() && !isTargetIndexEmptyDefaultBlock && operation !== "insert") {
return;
}
if (operation === "group") {
const targetBlock = blocks[targetIndex];
const areAllImages = [
targetBlock.name,
...draggedBlockNames
].every((name) => name === "core/image");
const canInsertGalleryBlock = canInsertBlockType(
"core/gallery",
targetRootClientId
);
const areGroupableBlocks = isGroupable([
targetBlock.clientId,
getDraggedBlockClientIds()
]);
const groupBlockVariations = getBlockVariations(
getGroupingBlockName(),
"block"
);
const canInsertRow = groupBlockVariations && groupBlockVariations.find(
({ name }) => name === "group-row"
);
if (areAllImages && !canInsertGalleryBlock && (!areGroupableBlocks || !canInsertRow)) {
return;
}
if (!areAllImages && (!areGroupableBlocks || !canInsertRow)) {
return;
}
}
registry.batch(() => {
setDropTarget({
index: targetIndex,
operation,
nearestSide
});
const insertionPointClientId = [
"before",
"after"
].includes(operation) ? parentBlockClientId : targetRootClientId;
showInsertionPoint(insertionPointClientId, targetIndex, {
operation,
nearestSide
});
});
},
[
isDragging,
getAllowedBlocks,
targetRootClientId,
getBlockNamesByClientId,
getDraggedBlockClientIds,
getBlockType,
getSectionRootClientId,
isZoomOut,
getBlocks,
getBlockListSettings,
dropZoneElement,
parentBlockClientId,
getBlockIndex,
registry,
startDragging,
showInsertionPoint,
canInsertBlockType,
isGroupable,
getBlockVariations,
getGroupingBlockName
]
),
200
);
return (0,external_wp_compose_namespaceObject.__experimentalUseDropZone)({
dropZoneElement,
isDisabled,
onDrop: onBlockDrop,
onDragOver(event) {
throttled(event, event.currentTarget.ownerDocument);
},
onDragLeave(event) {
const { ownerDocument } = event.currentTarget;
if (isInsertionPoint(event.relatedTarget, ownerDocument) || isInsertionPoint(event.target, ownerDocument)) {
return;
}
throttled.cancel();
hideInsertionPoint();
},
onDragEnd() {
throttled.cancel();
stopDragging();
hideInsertionPoint();
}
});
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/index.js
const inner_blocks_EMPTY_OBJECT = {};
function BlockContext({ children, clientId }) {
const context = useBlockContext(clientId);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockContextProvider, { value: context, children });
}
const BlockListItemsMemo = (0,external_wp_element_namespaceObject.memo)(BlockListItems);
function UncontrolledInnerBlocks(props) {
const {
clientId,
allowedBlocks,
prioritizedInserterBlocks,
defaultBlock,
directInsert,
__experimentalDefaultBlock,
__experimentalDirectInsert,
template,
templateLock,
wrapperRef,
templateInsertUpdatesSelection,
__experimentalCaptureToolbars: captureToolbars,
__experimentalAppenderTagName,
renderAppender,
orientation,
placeholder,
layout,
name,
blockType,
parentLock,
defaultLayout
} = props;
useNestedSettingsUpdate(
clientId,
parentLock,
allowedBlocks,
prioritizedInserterBlocks,
defaultBlock,
directInsert,
__experimentalDefaultBlock,
__experimentalDirectInsert,
templateLock,
captureToolbars,
orientation,
layout
);
useInnerBlockTemplateSync(
clientId,
template,
templateLock,
templateInsertUpdatesSelection
);
const defaultLayoutBlockSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, "layout") || (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, "__experimentalLayout") || inner_blocks_EMPTY_OBJECT;
const { allowSizingOnChildren = false } = defaultLayoutBlockSupport;
const usedLayout = layout || defaultLayoutBlockSupport;
const memoedLayout = (0,external_wp_element_namespaceObject.useMemo)(
() => ({
// Default layout will know about any content/wide size defined by the theme.
...defaultLayout,
...usedLayout,
...allowSizingOnChildren && {
allowSizingOnChildren: true
}
}),
[defaultLayout, usedLayout, allowSizingOnChildren]
);
const items = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockListItemsMemo,
{
rootClientId: clientId,
renderAppender,
__experimentalAppenderTagName,
layout: memoedLayout,
wrapperRef,
placeholder
}
);
if (!blockType?.providesContext || Object.keys(blockType.providesContext).length === 0) {
return items;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockContext, { clientId, children: items });
}
function ControlledInnerBlocks(props) {
useBlockSync(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(UncontrolledInnerBlocks, { ...props });
}
const ForwardedInnerBlocks = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
const innerBlocksProps = useInnerBlocksProps({ ref }, props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inner-blocks", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps }) });
});
function useInnerBlocksProps(props = {}, options = {}) {
const {
__unstableDisableLayoutClassNames,
__unstableDisableDropZone,
dropZoneElement
} = options;
const {
clientId,
layout = null,
__unstableLayoutClassNames: layoutClassNames = ""
} = useBlockEditContext();
const selected = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getBlockName,
isZoomOut,
getTemplateLock,
getBlockRootClientId,
getBlockEditingMode,
getBlockSettings,
getSectionRootClientId
} = unlock(select(store));
if (!clientId) {
const sectionRootClientId = getSectionRootClientId();
return {
isDropZoneDisabled: isZoomOut() && sectionRootClientId !== ""
};
}
const { hasBlockSupport, getBlockType } = select(external_wp_blocks_namespaceObject.store);
const blockName = getBlockName(clientId);
const blockEditingMode = getBlockEditingMode(clientId);
const parentClientId2 = getBlockRootClientId(clientId);
const [defaultLayout2] = getBlockSettings(clientId, "layout");
let _isDropZoneDisabled = blockEditingMode === "disabled";
if (isZoomOut()) {
const sectionRootClientId = getSectionRootClientId();
_isDropZoneDisabled = clientId !== sectionRootClientId;
}
return {
__experimentalCaptureToolbars: hasBlockSupport(
blockName,
"__experimentalExposeControlsToChildren",
false
),
name: blockName,
blockType: getBlockType(blockName),
parentLock: getTemplateLock(parentClientId2),
parentClientId: parentClientId2,
isDropZoneDisabled: _isDropZoneDisabled,
defaultLayout: defaultLayout2
};
},
[clientId]
);
const {
__experimentalCaptureToolbars,
name,
blockType,
parentLock,
parentClientId,
isDropZoneDisabled,
defaultLayout
} = selected;
const blockDropZoneRef = useBlockDropZone({
dropZoneElement,
rootClientId: clientId,
parentClientId
});
const ref = (0,external_wp_compose_namespaceObject.useMergeRefs)([
props.ref,
__unstableDisableDropZone || isDropZoneDisabled || layout?.isManualPlacement && window.__experimentalEnableGridInteractivity ? null : blockDropZoneRef
]);
const innerBlocksProps = {
__experimentalCaptureToolbars,
layout,
name,
blockType,
parentLock,
defaultLayout,
...options
};
const InnerBlocks = innerBlocksProps.value && innerBlocksProps.onChange ? ControlledInnerBlocks : UncontrolledInnerBlocks;
return {
...props,
ref,
className: dist_clsx(
props.className,
"block-editor-block-list__layout",
__unstableDisableLayoutClassNames ? "" : layoutClassNames
),
children: clientId ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InnerBlocks, { ...innerBlocksProps, clientId }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockListItems, { ...options })
};
}
useInnerBlocksProps.save = external_wp_blocks_namespaceObject.__unstableGetInnerBlocksProps;
ForwardedInnerBlocks.DefaultBlockAppender = default_block_appender_DefaultBlockAppender;
ForwardedInnerBlocks.ButtonBlockAppender = ButtonBlockAppender;
ForwardedInnerBlocks.Content = () => useInnerBlocksProps.save().children;
var inner_blocks_default = ForwardedInnerBlocks;
;// ./node_modules/@wordpress/block-editor/build-module/components/observe-typing/index.js
const KEY_DOWN_ELIGIBLE_KEY_CODES = /* @__PURE__ */ new Set([
external_wp_keycodes_namespaceObject.UP,
external_wp_keycodes_namespaceObject.RIGHT,
external_wp_keycodes_namespaceObject.DOWN,
external_wp_keycodes_namespaceObject.LEFT,
external_wp_keycodes_namespaceObject.ENTER,
external_wp_keycodes_namespaceObject.BACKSPACE
]);
function isKeyDownEligibleForStartTyping(event) {
const { keyCode, shiftKey } = event;
return !shiftKey && KEY_DOWN_ELIGIBLE_KEY_CODES.has(keyCode);
}
function useMouseMoveTypingReset() {
const isTyping = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).isTyping(),
[]
);
const { stopTyping } = (0,external_wp_data_namespaceObject.useDispatch)(store);
return (0,external_wp_compose_namespaceObject.useRefEffect)(
(node) => {
if (!isTyping) {
return;
}
const { ownerDocument } = node;
let lastClientX;
let lastClientY;
function stopTypingOnMouseMove(event) {
const { clientX, clientY } = event;
if (lastClientX && lastClientY && (lastClientX !== clientX || lastClientY !== clientY)) {
stopTyping();
}
lastClientX = clientX;
lastClientY = clientY;
}
ownerDocument.addEventListener(
"mousemove",
stopTypingOnMouseMove
);
return () => {
ownerDocument.removeEventListener(
"mousemove",
stopTypingOnMouseMove
);
};
},
[isTyping, stopTyping]
);
}
function useTypingObserver() {
const { isTyping } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { isTyping: _isTyping } = select(store);
return {
isTyping: _isTyping()
};
}, []);
const { startTyping, stopTyping } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const ref1 = useMouseMoveTypingReset();
const ref2 = (0,external_wp_compose_namespaceObject.useRefEffect)(
(node) => {
const { ownerDocument } = node;
const { defaultView } = ownerDocument;
const selection = defaultView.getSelection();
if (isTyping) {
let stopTypingOnNonTextField2 = function(event) {
const { target } = event;
timerId = defaultView.setTimeout(() => {
if (!(0,external_wp_dom_namespaceObject.isTextField)(target)) {
stopTyping();
}
});
}, stopTypingOnEscapeKey2 = function(event) {
const { keyCode } = event;
if (keyCode === external_wp_keycodes_namespaceObject.ESCAPE || keyCode === external_wp_keycodes_namespaceObject.TAB) {
stopTyping();
}
}, stopTypingOnSelectionUncollapse2 = function() {
if (!selection.isCollapsed) {
stopTyping();
}
};
var stopTypingOnNonTextField = stopTypingOnNonTextField2, stopTypingOnEscapeKey = stopTypingOnEscapeKey2, stopTypingOnSelectionUncollapse = stopTypingOnSelectionUncollapse2;
let timerId;
node.addEventListener("focus", stopTypingOnNonTextField2);
node.addEventListener("keydown", stopTypingOnEscapeKey2);
ownerDocument.addEventListener(
"selectionchange",
stopTypingOnSelectionUncollapse2
);
return () => {
defaultView.clearTimeout(timerId);
node.removeEventListener(
"focus",
stopTypingOnNonTextField2
);
node.removeEventListener(
"keydown",
stopTypingOnEscapeKey2
);
ownerDocument.removeEventListener(
"selectionchange",
stopTypingOnSelectionUncollapse2
);
};
}
function startTypingInTextField(event) {
const { type, target } = event;
if (!(0,external_wp_dom_namespaceObject.isTextField)(target) || !node.contains(target)) {
return;
}
if (type === "keydown" && !isKeyDownEligibleForStartTyping(event)) {
return;
}
startTyping();
}
node.addEventListener("keypress", startTypingInTextField);
node.addEventListener("keydown", startTypingInTextField);
return () => {
node.removeEventListener("keypress", startTypingInTextField);
node.removeEventListener("keydown", startTypingInTextField);
};
},
[isTyping, startTyping, stopTyping]
);
return (0,external_wp_compose_namespaceObject.useMergeRefs)([ref1, ref2]);
}
function ObserveTyping({ children }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: useTypingObserver(), children });
}
var observe_typing_default = ObserveTyping;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/zoom-out-separator.js
function ZoomOutSeparator({
clientId,
rootClientId = "",
position = "top"
}) {
const [isDraggedOver, setIsDraggedOver] = (0,external_wp_element_namespaceObject.useState)(false);
const {
sectionRootClientId,
sectionClientIds,
insertionPoint,
blockInsertionPointVisible,
blockInsertionPoint,
blocksBeingDragged
} = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const {
getInsertionPoint,
getBlockOrder,
getSectionRootClientId,
isBlockInsertionPointVisible,
getBlockInsertionPoint,
getDraggedBlockClientIds
} = unlock(select(store));
const root = getSectionRootClientId();
const sectionRootClientIds = getBlockOrder(root);
return {
sectionRootClientId: root,
sectionClientIds: sectionRootClientIds,
insertionPoint: getInsertionPoint(),
blockInsertionPoint: getBlockInsertionPoint(),
blockInsertionPointVisible: isBlockInsertionPointVisible(),
blocksBeingDragged: getDraggedBlockClientIds()
};
}, []);
const isReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
if (!clientId) {
return;
}
let isVisible = false;
const isSectionBlock = rootClientId === sectionRootClientId && sectionClientIds && sectionClientIds.includes(clientId);
if (!isSectionBlock) {
return null;
}
const hasTopInsertionPoint = insertionPoint?.index === 0 && clientId === sectionClientIds[insertionPoint.index];
const hasBottomInsertionPoint = insertionPoint && insertionPoint.hasOwnProperty("index") && clientId === sectionClientIds[insertionPoint.index - 1];
if (position === "top") {
isVisible = hasTopInsertionPoint || blockInsertionPointVisible && blockInsertionPoint.index === 0 && clientId === sectionClientIds[blockInsertionPoint.index];
}
if (position === "bottom") {
isVisible = hasBottomInsertionPoint || blockInsertionPointVisible && clientId === sectionClientIds[blockInsertionPoint.index - 1];
}
const blockBeingDraggedClientId = blocksBeingDragged[0];
const isCurrentBlockBeingDragged = blocksBeingDragged.includes(clientId);
const blockBeingDraggedIndex = sectionClientIds.indexOf(
blockBeingDraggedClientId
);
const blockBeingDraggedPreviousSiblingClientId = blockBeingDraggedIndex > 0 ? sectionClientIds[blockBeingDraggedIndex - 1] : null;
const isCurrentBlockPreviousSiblingOfBlockBeingDragged = blockBeingDraggedPreviousSiblingClientId === clientId;
if (isCurrentBlockBeingDragged || isCurrentBlockPreviousSiblingOfBlockBeingDragged) {
isVisible = false;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { children: isVisible && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
initial: { height: 0 },
animate: {
// Use a height equal to that of the zoom out frame size.
height: "calc(1 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)"
},
exit: { height: 0 },
transition: {
type: "tween",
duration: isReducedMotion ? 0 : 0.2,
ease: [0.6, 0, 0.4, 1]
},
className: dist_clsx(
"block-editor-block-list__zoom-out-separator",
{
"is-dragged-over": isDraggedOver
}
),
"data-is-insertion-point": "true",
onDragOver: () => setIsDraggedOver(true),
onDragLeave: () => setIsDraggedOver(false),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
initial: { opacity: 0 },
animate: { opacity: 1 },
exit: { opacity: 0, transition: { delay: -0.125 } },
transition: {
ease: "linear",
duration: 0.1,
delay: 0.125
},
children: (0,external_wp_i18n_namespaceObject.__)("Drop pattern.")
}
)
}
) });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/index.js
const block_list_IntersectionObserver = (0,external_wp_element_namespaceObject.createContext)();
block_list_IntersectionObserver.displayName = "IntersectionObserverContext";
const pendingBlockVisibilityUpdatesPerRegistry = /* @__PURE__ */ new WeakMap();
const delayedBlockVisibilityDebounceOptions = {
trailing: true
};
function Root({ className, ...settings }) {
const { isOutlineMode, isFocusMode, temporarilyEditingAsBlocks } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const {
getSettings,
getTemporarilyEditingAsBlocks,
isTyping,
hasBlockSpotlight
} = unlock(select(store));
const { outlineMode, focusMode } = getSettings();
return {
isOutlineMode: outlineMode && !isTyping(),
isFocusMode: focusMode || hasBlockSpotlight(),
temporarilyEditingAsBlocks: getTemporarilyEditingAsBlocks()
};
}, []);
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const { setBlockVisibility } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const delayedBlockVisibilityUpdates = (0,external_wp_compose_namespaceObject.useDebounce)(
(0,external_wp_element_namespaceObject.useCallback)(() => {
const updates = {};
pendingBlockVisibilityUpdatesPerRegistry.get(registry).forEach(([id, isIntersecting]) => {
updates[id] = isIntersecting;
});
setBlockVisibility(updates);
}, [registry]),
300,
delayedBlockVisibilityDebounceOptions
);
const intersectionObserver = (0,external_wp_element_namespaceObject.useMemo)(() => {
const { IntersectionObserver: Observer } = window;
if (!Observer) {
return;
}
return new Observer((entries) => {
if (!pendingBlockVisibilityUpdatesPerRegistry.get(registry)) {
pendingBlockVisibilityUpdatesPerRegistry.set(registry, []);
}
for (const entry of entries) {
const clientId = entry.target.getAttribute("data-block");
pendingBlockVisibilityUpdatesPerRegistry.get(registry).push([clientId, entry.isIntersecting]);
}
delayedBlockVisibilityUpdates();
});
}, []);
const innerBlocksProps = useInnerBlocksProps(
{
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([
useBlockSelectionClearer(),
useInBetweenInserter(),
useTypingObserver()
]),
className: dist_clsx("is-root-container", className, {
"is-outline-mode": isOutlineMode,
"is-focus-mode": isFocusMode
})
},
settings
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(block_list_IntersectionObserver.Provider, { value: intersectionObserver, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps }),
!!temporarilyEditingAsBlocks && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
StopEditingAsBlocksOnOutsideSelect,
{
clientId: temporarilyEditingAsBlocks
}
)
] });
}
function StopEditingAsBlocksOnOutsideSelect({ clientId }) {
const { stopEditingAsBlocks } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
const isBlockOrDescendantSelected = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { isBlockSelected, hasSelectedInnerBlock } = select(store);
return isBlockSelected(clientId) || hasSelectedInnerBlock(clientId, true);
},
[clientId]
);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isBlockOrDescendantSelected) {
stopEditingAsBlocks(clientId);
}
}, [isBlockOrDescendantSelected, clientId, stopEditingAsBlocks]);
return null;
}
function BlockList(settings) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, { value: DEFAULT_BLOCK_EDIT_CONTEXT, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Root, { ...settings }) });
}
const block_list_EMPTY_ARRAY = [];
const block_list_EMPTY_SET = /* @__PURE__ */ new Set();
function Items({
placeholder,
rootClientId,
renderAppender: CustomAppender,
__experimentalAppenderTagName,
layout = defaultLayout
}) {
const hasAppender = CustomAppender !== false;
const hasCustomAppender = !!CustomAppender;
const {
order,
isZoomOut,
selectedBlocks,
visibleBlocks,
shouldRenderAppender
} = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getSettings,
getBlockOrder,
getSelectedBlockClientIds,
__unstableGetVisibleBlocks,
getTemplateLock,
getBlockEditingMode,
isSectionBlock,
isContainerInsertableToInContentOnlyMode,
getBlockName,
isZoomOut: _isZoomOut,
canInsertBlockType
} = unlock(select(store));
const _order = getBlockOrder(rootClientId);
if (getSettings().isPreviewMode) {
return {
order: _order,
selectedBlocks: block_list_EMPTY_ARRAY,
visibleBlocks: block_list_EMPTY_SET
};
}
const selectedBlockClientIds = getSelectedBlockClientIds();
const selectedBlockClientId = selectedBlockClientIds[0];
const showRootAppender = !rootClientId && !selectedBlockClientId && (!_order.length || !canInsertBlockType(
(0,external_wp_blocks_namespaceObject.getDefaultBlockName)(),
rootClientId
));
const hasSelectedRoot = !!(rootClientId && selectedBlockClientId && rootClientId === selectedBlockClientId);
return {
order: _order,
selectedBlocks: selectedBlockClientIds,
visibleBlocks: __unstableGetVisibleBlocks(),
isZoomOut: _isZoomOut(),
shouldRenderAppender: (!isSectionBlock(rootClientId) || isContainerInsertableToInContentOnlyMode(
getBlockName(selectedBlockClientId),
rootClientId
)) && getBlockEditingMode(rootClientId) !== "disabled" && !getTemplateLock(rootClientId) && hasAppender && !_isZoomOut() && (hasCustomAppender || hasSelectedRoot || showRootAppender)
};
},
[rootClientId, hasAppender, hasCustomAppender]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(LayoutProvider, { value: layout, children: [
order.map((clientId) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_data_namespaceObject.AsyncModeProvider,
{
value: (
// Only provide data asynchronously if the block is
// not visible and not selected.
!visibleBlocks.has(clientId) && !selectedBlocks.includes(clientId)
),
children: [
isZoomOut && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ZoomOutSeparator,
{
clientId,
rootClientId,
position: "top"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_default,
{
rootClientId,
clientId
}
),
isZoomOut && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ZoomOutSeparator,
{
clientId,
rootClientId,
position: "bottom"
}
)
]
},
clientId
)),
order.length < 1 && placeholder,
shouldRenderAppender && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockListAppender,
{
tagName: __experimentalAppenderTagName,
rootClientId,
CustomAppender
}
)
] });
}
function BlockListItems(props) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_data_namespaceObject.AsyncModeProvider, { value: false, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Items, { ...props }) });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-multi-selection.js
function selector(select) {
const {
isMultiSelecting,
getMultiSelectedBlockClientIds,
hasMultiSelection,
getSelectedBlockClientId,
getSelectedBlocksInitialCaretPosition,
__unstableIsFullySelected
} = select(store);
return {
isMultiSelecting: isMultiSelecting(),
multiSelectedBlockClientIds: getMultiSelectedBlockClientIds(),
hasMultiSelection: hasMultiSelection(),
selectedBlockClientId: getSelectedBlockClientId(),
initialPosition: getSelectedBlocksInitialCaretPosition(),
isFullSelection: __unstableIsFullySelected()
};
}
function useMultiSelection() {
const {
initialPosition,
isMultiSelecting,
multiSelectedBlockClientIds,
hasMultiSelection,
selectedBlockClientId,
isFullSelection
} = (0,external_wp_data_namespaceObject.useSelect)(selector, []);
return (0,external_wp_compose_namespaceObject.useRefEffect)(
(node) => {
const { ownerDocument } = node;
const { defaultView } = ownerDocument;
if (initialPosition === void 0 || initialPosition === null) {
return;
}
if (!hasMultiSelection || isMultiSelecting) {
return;
}
const { length } = multiSelectedBlockClientIds;
if (length < 2) {
return;
}
if (!isFullSelection) {
return;
}
node.contentEditable = true;
node.focus();
defaultView.getSelection().removeAllRanges();
},
[
hasMultiSelection,
isMultiSelecting,
multiSelectedBlockClientIds,
selectedBlockClientId,
initialPosition,
isFullSelection
]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-tab-nav.js
function useTabNav() {
const containerRef = (
/** @type {typeof useRef<HTMLElement>} */
(0,external_wp_element_namespaceObject.useRef)()
);
const focusCaptureBeforeRef = (0,external_wp_element_namespaceObject.useRef)();
const focusCaptureAfterRef = (0,external_wp_element_namespaceObject.useRef)();
const {
hasMultiSelection,
getSelectedBlockClientId,
getBlockCount,
getBlockOrder,
getLastFocus,
getSectionRootClientId,
isZoomOut
} = unlock((0,external_wp_data_namespaceObject.useSelect)(store));
const { setLastFocus } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
const noCaptureRef = (0,external_wp_element_namespaceObject.useRef)();
function onFocusCapture(event) {
const canvasElement = containerRef.current.ownerDocument === event.target.ownerDocument ? containerRef.current : containerRef.current.ownerDocument.defaultView.frameElement;
if (noCaptureRef.current) {
noCaptureRef.current = null;
} else if (hasMultiSelection()) {
containerRef.current.focus();
} else if (getSelectedBlockClientId()) {
if (getLastFocus()?.current) {
getLastFocus().current.focus();
} else {
containerRef.current.querySelector(
`[data-block="${getSelectedBlockClientId()}"]`
).focus();
}
} else if (isZoomOut()) {
const sectionRootClientId = getSectionRootClientId();
const sectionBlocks = getBlockOrder(sectionRootClientId);
if (sectionBlocks.length) {
containerRef.current.querySelector(`[data-block="${sectionBlocks[0]}"]`).focus();
} else if (sectionRootClientId) {
containerRef.current.querySelector(`[data-block="${sectionRootClientId}"]`).focus();
} else {
canvasElement.focus();
}
} else {
const isBefore = (
// eslint-disable-next-line no-bitwise
event.target.compareDocumentPosition(canvasElement) & event.target.DOCUMENT_POSITION_FOLLOWING
);
const tabbables = external_wp_dom_namespaceObject.focus.tabbable.find(containerRef.current);
if (tabbables.length) {
const next = isBefore ? tabbables[0] : tabbables[tabbables.length - 1];
next.focus();
}
}
}
const before = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
ref: focusCaptureBeforeRef,
tabIndex: "0",
onFocus: onFocusCapture
}
);
const after = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
ref: focusCaptureAfterRef,
tabIndex: "0",
onFocus: onFocusCapture
}
);
const ref = (0,external_wp_compose_namespaceObject.useRefEffect)((node) => {
function onKeyDown(event) {
if (event.defaultPrevented) {
return;
}
if (event.keyCode !== external_wp_keycodes_namespaceObject.TAB) {
return;
}
if (
// Bails in case the focus capture elements aren’t present. They
// may be omitted to avoid silent tab stops in preview mode.
// See: https://github.com/WordPress/gutenberg/pull/59317
!focusCaptureAfterRef.current || !focusCaptureBeforeRef.current
) {
return;
}
const { target, shiftKey: isShift } = event;
const direction = isShift ? "findPrevious" : "findNext";
const nextTabbable = external_wp_dom_namespaceObject.focus.tabbable[direction](target);
const currentBlock = target.closest("[data-block]");
const isElementPartOfSelectedBlock = currentBlock && nextTabbable && (isInSameBlock(currentBlock, nextTabbable) || isInsideRootBlock(currentBlock, nextTabbable));
if ((0,external_wp_dom_namespaceObject.isFormElement)(nextTabbable) && isElementPartOfSelectedBlock) {
return;
}
const next = isShift ? focusCaptureBeforeRef : focusCaptureAfterRef;
noCaptureRef.current = true;
next.current.focus({ preventScroll: true });
}
function onFocusOut(event) {
setLastFocus({ ...getLastFocus(), current: event.target });
const { ownerDocument: ownerDocument2 } = node;
if (!event.relatedTarget && event.target.hasAttribute("data-block") && ownerDocument2.activeElement === ownerDocument2.body && getBlockCount() === 0) {
node.focus();
}
}
function preventScrollOnTab(event) {
if (event.keyCode !== external_wp_keycodes_namespaceObject.TAB) {
return;
}
if (event.target?.getAttribute("role") === "region") {
return;
}
if (containerRef.current === event.target) {
return;
}
const isShift = event.shiftKey;
const direction = isShift ? "findPrevious" : "findNext";
const target = external_wp_dom_namespaceObject.focus.tabbable[direction](event.target);
if (target === focusCaptureBeforeRef.current || target === focusCaptureAfterRef.current) {
event.preventDefault();
target.focus({ preventScroll: true });
}
}
const { ownerDocument } = node;
const { defaultView } = ownerDocument;
defaultView.addEventListener("keydown", preventScrollOnTab);
node.addEventListener("keydown", onKeyDown);
node.addEventListener("focusout", onFocusOut);
return () => {
defaultView.removeEventListener("keydown", preventScrollOnTab);
node.removeEventListener("keydown", onKeyDown);
node.removeEventListener("focusout", onFocusOut);
};
}, []);
const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([containerRef, ref]);
return [before, mergedRefs, after];
}
;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-arrow-nav.js
function isNavigationCandidate(element, keyCode, hasModifier) {
const isVertical = keyCode === external_wp_keycodes_namespaceObject.UP || keyCode === external_wp_keycodes_namespaceObject.DOWN;
const { tagName } = element;
const elementType = element.getAttribute("type");
if (isVertical && !hasModifier) {
if (tagName === "INPUT") {
const verticalInputTypes = [
"date",
"datetime-local",
"month",
"number",
"range",
"time",
"week"
];
return !verticalInputTypes.includes(elementType);
}
return true;
}
if (tagName === "INPUT") {
const simpleInputTypes = [
"button",
"checkbox",
"number",
"color",
"file",
"image",
"radio",
"reset",
"submit"
];
return simpleInputTypes.includes(elementType);
}
return tagName !== "TEXTAREA";
}
function getClosestTabbable(target, isReverse, containerElement, onlyVertical) {
let focusableNodes = external_wp_dom_namespaceObject.focus.focusable.find(containerElement);
if (isReverse) {
focusableNodes.reverse();
}
focusableNodes = focusableNodes.slice(
focusableNodes.indexOf(target) + 1
);
let targetRect;
if (onlyVertical) {
targetRect = target.getBoundingClientRect();
}
function isTabCandidate(node) {
if (node.closest("[inert]")) {
return;
}
if (node.children.length === 1 && isInSameBlock(node, node.firstElementChild) && node.firstElementChild.getAttribute("contenteditable") === "true") {
return;
}
if (!external_wp_dom_namespaceObject.focus.tabbable.isTabbableIndex(node)) {
return false;
}
if (node.isContentEditable && node.contentEditable !== "true") {
return false;
}
if (onlyVertical) {
const nodeRect = node.getBoundingClientRect();
if (nodeRect.left >= targetRect.right || nodeRect.right <= targetRect.left) {
return false;
}
}
return true;
}
return focusableNodes.find(isTabCandidate);
}
function useArrowNav() {
const {
getMultiSelectedBlocksStartClientId,
getMultiSelectedBlocksEndClientId,
getSettings,
hasMultiSelection,
__unstableIsFullySelected
} = (0,external_wp_data_namespaceObject.useSelect)(store);
const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store);
return (0,external_wp_compose_namespaceObject.useRefEffect)((node) => {
let verticalRect;
function onMouseDown() {
verticalRect = null;
}
function isClosestTabbableABlock(target, isReverse) {
const closestTabbable = getClosestTabbable(
target,
isReverse,
node
);
return closestTabbable && getBlockClientId(closestTabbable);
}
function onKeyDown(event) {
if (event.defaultPrevented) {
return;
}
const { keyCode, target, shiftKey, ctrlKey, altKey, metaKey } = event;
const isUp = keyCode === external_wp_keycodes_namespaceObject.UP;
const isDown = keyCode === external_wp_keycodes_namespaceObject.DOWN;
const isLeft = keyCode === external_wp_keycodes_namespaceObject.LEFT;
const isRight = keyCode === external_wp_keycodes_namespaceObject.RIGHT;
const isReverse = isUp || isLeft;
const isHorizontal = isLeft || isRight;
const isVertical = isUp || isDown;
const isNav = isHorizontal || isVertical;
const hasModifier = shiftKey || ctrlKey || altKey || metaKey;
const isNavEdge = isVertical ? external_wp_dom_namespaceObject.isVerticalEdge : external_wp_dom_namespaceObject.isHorizontalEdge;
const { ownerDocument } = node;
const { defaultView } = ownerDocument;
if (!isNav) {
return;
}
if (hasMultiSelection()) {
if (shiftKey) {
return;
}
if (!__unstableIsFullySelected()) {
return;
}
event.preventDefault();
if (isReverse) {
selectBlock(getMultiSelectedBlocksStartClientId());
} else {
selectBlock(getMultiSelectedBlocksEndClientId(), -1);
}
return;
}
if (!isNavigationCandidate(target, keyCode, hasModifier)) {
return;
}
if (!isVertical) {
verticalRect = null;
} else if (!verticalRect) {
verticalRect = (0,external_wp_dom_namespaceObject.computeCaretRect)(defaultView);
}
const isReverseDir = (0,external_wp_dom_namespaceObject.isRTL)(target) ? !isReverse : isReverse;
const { keepCaretInsideBlock } = getSettings();
if (shiftKey) {
if (isClosestTabbableABlock(target, isReverse) && isNavEdge(target, isReverse)) {
node.contentEditable = true;
node.focus();
}
} else if (isVertical && (0,external_wp_dom_namespaceObject.isVerticalEdge)(target, isReverse) && // When Alt is pressed, only intercept if the caret is also at
// the horizontal edge.
(altKey ? (0,external_wp_dom_namespaceObject.isHorizontalEdge)(target, isReverseDir) : true) && !keepCaretInsideBlock) {
const closestTabbable = getClosestTabbable(
target,
isReverse,
node,
true
);
if (closestTabbable) {
(0,external_wp_dom_namespaceObject.placeCaretAtVerticalEdge)(
closestTabbable,
// When Alt is pressed, place the caret at the furthest
// horizontal edge and the furthest vertical edge.
altKey ? !isReverse : isReverse,
altKey ? void 0 : verticalRect
);
event.preventDefault();
}
} else if (isHorizontal && defaultView.getSelection().isCollapsed && (0,external_wp_dom_namespaceObject.isHorizontalEdge)(target, isReverseDir) && !keepCaretInsideBlock) {
const closestTabbable = getClosestTabbable(
target,
isReverseDir,
node
);
(0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(closestTabbable, isReverse);
event.preventDefault();
}
}
node.addEventListener("mousedown", onMouseDown);
node.addEventListener("keydown", onKeyDown);
return () => {
node.removeEventListener("mousedown", onMouseDown);
node.removeEventListener("keydown", onKeyDown);
};
}, []);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-select-all.js
function useSelectAll() {
const { getBlockOrder, getSelectedBlockClientIds, getBlockRootClientId } = (0,external_wp_data_namespaceObject.useSelect)(store);
const { multiSelect, selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const isMatch = (0,external_wp_keyboardShortcuts_namespaceObject.__unstableUseShortcutEventMatch)();
return (0,external_wp_compose_namespaceObject.useRefEffect)((node) => {
function onKeyDown(event) {
if (!isMatch("core/block-editor/select-all", event)) {
return;
}
const selectedClientIds = getSelectedBlockClientIds();
if (selectedClientIds.length < 2 && !(0,external_wp_dom_namespaceObject.isEntirelySelected)(event.target)) {
return;
}
event.preventDefault();
const [firstSelectedClientId] = selectedClientIds;
const rootClientId = getBlockRootClientId(firstSelectedClientId);
const blockClientIds = getBlockOrder(rootClientId);
if (selectedClientIds.length === blockClientIds.length) {
if (rootClientId) {
node.ownerDocument.defaultView.getSelection().removeAllRanges();
selectBlock(rootClientId);
}
return;
}
multiSelect(
blockClientIds[0],
blockClientIds[blockClientIds.length - 1]
);
}
node.addEventListener("keydown", onKeyDown);
return () => {
node.removeEventListener("keydown", onKeyDown);
};
}, []);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-drag-selection.js
function setContentEditableWrapper(node, value) {
node.contentEditable = value;
if (value) {
node.focus();
}
}
function useDragSelection() {
const { startMultiSelect, stopMultiSelect } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const {
isSelectionEnabled,
hasSelectedBlock,
isDraggingBlocks,
isMultiSelecting
} = (0,external_wp_data_namespaceObject.useSelect)(store);
return (0,external_wp_compose_namespaceObject.useRefEffect)(
(node) => {
const { ownerDocument } = node;
const { defaultView } = ownerDocument;
let anchorElement;
let rafId;
function onMouseUp() {
stopMultiSelect();
defaultView.removeEventListener("mouseup", onMouseUp);
rafId = defaultView.requestAnimationFrame(() => {
if (!hasSelectedBlock()) {
return;
}
setContentEditableWrapper(node, false);
const selection = defaultView.getSelection();
if (selection.rangeCount) {
const range = selection.getRangeAt(0);
const { commonAncestorContainer } = range;
const clonedRange = range.cloneRange();
if (anchorElement.contains(commonAncestorContainer)) {
anchorElement.focus();
selection.removeAllRanges();
selection.addRange(clonedRange);
}
}
});
}
let lastMouseDownTarget;
function onMouseDown({ target }) {
lastMouseDownTarget = target;
}
function onMouseLeave({ buttons, target, relatedTarget }) {
if (!target.contains(lastMouseDownTarget)) {
return;
}
if (target.contains(relatedTarget)) {
return;
}
if (isDraggingBlocks()) {
return;
}
if (buttons !== 1) {
return;
}
if (isMultiSelecting()) {
return;
}
if (node === target) {
return;
}
if (target.getAttribute("contenteditable") !== "true") {
return;
}
if (!isSelectionEnabled()) {
return;
}
anchorElement = target;
startMultiSelect();
defaultView.addEventListener("mouseup", onMouseUp);
setContentEditableWrapper(node, true);
}
node.addEventListener("mouseout", onMouseLeave);
node.addEventListener("mousedown", onMouseDown);
return () => {
node.removeEventListener("mouseout", onMouseLeave);
defaultView.removeEventListener("mouseup", onMouseUp);
defaultView.cancelAnimationFrame(rafId);
};
},
[
startMultiSelect,
stopMultiSelect,
isSelectionEnabled,
hasSelectedBlock
]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-selection-observer.js
function extractSelectionStartNode(selection) {
const { anchorNode, anchorOffset } = selection;
if (anchorNode.nodeType === anchorNode.TEXT_NODE) {
return anchorNode;
}
if (anchorOffset === 0) {
return anchorNode;
}
return anchorNode.childNodes[anchorOffset - 1];
}
function extractSelectionEndNode(selection) {
const { focusNode, focusOffset } = selection;
if (focusNode.nodeType === focusNode.TEXT_NODE) {
return focusNode;
}
if (focusOffset === focusNode.childNodes.length) {
return focusNode;
}
if (focusOffset === 0 && (0,external_wp_dom_namespaceObject.isSelectionForward)(selection)) {
return focusNode.previousSibling ?? focusNode.parentElement;
}
return focusNode.childNodes[focusOffset];
}
function findDepth(a, b) {
let depth = 0;
while (a[depth] === b[depth]) {
depth++;
}
return depth;
}
function use_selection_observer_setContentEditableWrapper(node, value) {
if (node.contentEditable !== String(value)) {
node.contentEditable = value;
if (value) {
node.focus();
}
}
}
function getRichTextElement(node) {
const element = node.nodeType === node.ELEMENT_NODE ? node : node.parentElement;
return element?.closest("[data-wp-block-attribute-key]");
}
function useSelectionObserver() {
const { multiSelect, selectBlock, selectionChange } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const { getBlockParents, getBlockSelectionStart, isMultiSelecting } = (0,external_wp_data_namespaceObject.useSelect)(store);
return (0,external_wp_compose_namespaceObject.useRefEffect)(
(node) => {
const { ownerDocument } = node;
const { defaultView } = ownerDocument;
function onSelectionChange(event) {
const selection = defaultView.getSelection();
if (!selection.rangeCount) {
return;
}
const startNode = extractSelectionStartNode(selection);
const endNode = extractSelectionEndNode(selection);
if (!node.contains(startNode) || !node.contains(endNode)) {
return;
}
const isClickShift = event.shiftKey && event.type === "mouseup";
if (selection.isCollapsed && !isClickShift) {
if (node.contentEditable === "true" && !isMultiSelecting()) {
use_selection_observer_setContentEditableWrapper(node, false);
let element = startNode.nodeType === startNode.ELEMENT_NODE ? startNode : startNode.parentElement;
element = element?.closest("[contenteditable]");
element?.focus();
}
return;
}
let startClientId = getBlockClientId(startNode);
let endClientId = getBlockClientId(endNode);
if (isClickShift) {
const selectedClientId = getBlockSelectionStart();
const clickedClientId = getBlockClientId(event.target);
const focusNodeIsNonSelectable = clickedClientId !== endClientId;
if (startClientId === endClientId && selection.isCollapsed || !endClientId || focusNodeIsNonSelectable) {
endClientId = clickedClientId;
}
if (startClientId !== selectedClientId) {
startClientId = selectedClientId;
}
}
if (startClientId === void 0 && endClientId === void 0) {
use_selection_observer_setContentEditableWrapper(node, false);
return;
}
const isSingularSelection = startClientId === endClientId;
if (isSingularSelection) {
if (!isMultiSelecting()) {
selectBlock(startClientId);
} else {
multiSelect(startClientId, startClientId);
}
} else {
const startPath = [
...getBlockParents(startClientId),
startClientId
];
const endPath = [
...getBlockParents(endClientId),
endClientId
];
const depth = findDepth(startPath, endPath);
if (startPath[depth] !== startClientId || endPath[depth] !== endClientId) {
multiSelect(startPath[depth], endPath[depth]);
return;
}
const richTextElementStart = getRichTextElement(startNode);
const richTextElementEnd = getRichTextElement(endNode);
if (richTextElementStart && richTextElementEnd) {
const range = selection.getRangeAt(0);
const richTextDataStart = (0,external_wp_richText_namespaceObject.create)({
element: richTextElementStart,
range,
__unstableIsEditableTree: true
});
const richTextDataEnd = (0,external_wp_richText_namespaceObject.create)({
element: richTextElementEnd,
range,
__unstableIsEditableTree: true
});
const startOffset = richTextDataStart.start ?? richTextDataStart.end;
const endOffset = richTextDataEnd.start ?? richTextDataEnd.end;
selectionChange({
start: {
clientId: startClientId,
attributeKey: richTextElementStart.dataset.wpBlockAttributeKey,
offset: startOffset
},
end: {
clientId: endClientId,
attributeKey: richTextElementEnd.dataset.wpBlockAttributeKey,
offset: endOffset
}
});
} else {
multiSelect(startClientId, endClientId);
}
}
}
ownerDocument.addEventListener(
"selectionchange",
onSelectionChange
);
defaultView.addEventListener("mouseup", onSelectionChange);
return () => {
ownerDocument.removeEventListener(
"selectionchange",
onSelectionChange
);
defaultView.removeEventListener("mouseup", onSelectionChange);
};
},
[multiSelect, selectBlock, selectionChange, getBlockParents]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-click-selection.js
function useClickSelection() {
const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const { isSelectionEnabled, getBlockSelectionStart, hasMultiSelection } = (0,external_wp_data_namespaceObject.useSelect)(store);
return (0,external_wp_compose_namespaceObject.useRefEffect)(
(node) => {
function onMouseDown(event) {
if (!isSelectionEnabled() || event.button !== 0) {
return;
}
const startClientId = getBlockSelectionStart();
const clickedClientId = getBlockClientId(event.target);
if (event.shiftKey) {
if (startClientId && startClientId !== clickedClientId) {
node.contentEditable = true;
node.focus();
}
} else if (hasMultiSelection()) {
selectBlock(clickedClientId);
}
}
node.addEventListener("mousedown", onMouseDown);
return () => {
node.removeEventListener("mousedown", onMouseDown);
};
},
[
selectBlock,
isSelectionEnabled,
getBlockSelectionStart,
hasMultiSelection
]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-input.js
function useInput() {
const {
__unstableIsFullySelected,
getSelectedBlockClientIds,
getSelectedBlockClientId,
__unstableIsSelectionMergeable,
hasMultiSelection,
getBlockName,
canInsertBlockType,
getBlockRootClientId,
getSelectionStart,
getSelectionEnd,
getBlockAttributes
} = (0,external_wp_data_namespaceObject.useSelect)(store);
const {
replaceBlocks,
__unstableSplitSelection,
removeBlocks,
__unstableDeleteSelection,
__unstableExpandSelection,
__unstableMarkAutomaticChange
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
return (0,external_wp_compose_namespaceObject.useRefEffect)((node) => {
function onBeforeInput(event) {
if (node.contentEditable === "true") {
event.preventDefault();
}
}
function onKeyDown(event) {
if (event.defaultPrevented) {
return;
}
if (!hasMultiSelection()) {
if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER) {
if (event.shiftKey || __unstableIsFullySelected()) {
return;
}
const clientId = getSelectedBlockClientId();
const blockName = getBlockName(clientId);
const selectionStart = getSelectionStart();
const selectionEnd = getSelectionEnd();
if (selectionStart.attributeKey === selectionEnd.attributeKey) {
const selectedAttributeValue = getBlockAttributes(clientId)[selectionStart.attributeKey];
const transforms = (0,external_wp_blocks_namespaceObject.getBlockTransforms)("from").filter(
({ type }) => type === "enter"
);
const transformation = (0,external_wp_blocks_namespaceObject.findTransform)(
transforms,
(item) => {
return item.regExp.test(
selectedAttributeValue
);
}
);
if (transformation) {
replaceBlocks(
clientId,
transformation.transform({
content: selectedAttributeValue
})
);
__unstableMarkAutomaticChange();
return;
}
}
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, "splitting", false) && !event.__deprecatedOnSplit) {
return;
}
if (canInsertBlockType(
blockName,
getBlockRootClientId(clientId)
)) {
__unstableSplitSelection();
event.preventDefault();
}
}
return;
}
if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER) {
node.contentEditable = false;
event.preventDefault();
if (__unstableIsFullySelected()) {
replaceBlocks(
getSelectedBlockClientIds(),
(0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())
);
} else {
__unstableSplitSelection();
}
} else if (event.keyCode === external_wp_keycodes_namespaceObject.BACKSPACE || event.keyCode === external_wp_keycodes_namespaceObject.DELETE) {
node.contentEditable = false;
event.preventDefault();
if (__unstableIsFullySelected()) {
removeBlocks(getSelectedBlockClientIds());
} else if (__unstableIsSelectionMergeable()) {
__unstableDeleteSelection(event.keyCode === external_wp_keycodes_namespaceObject.DELETE);
} else {
__unstableExpandSelection();
}
} else if (
// If key.length is longer than 1, it's a control key that doesn't
// input anything.
event.key.length === 1 && !(event.metaKey || event.ctrlKey)
) {
node.contentEditable = false;
if (__unstableIsSelectionMergeable()) {
__unstableDeleteSelection(event.keyCode === external_wp_keycodes_namespaceObject.DELETE);
} else {
event.preventDefault();
node.ownerDocument.defaultView.getSelection().removeAllRanges();
}
}
}
function onCompositionStart(event) {
if (!hasMultiSelection()) {
return;
}
node.contentEditable = false;
if (__unstableIsSelectionMergeable()) {
__unstableDeleteSelection();
} else {
event.preventDefault();
node.ownerDocument.defaultView.getSelection().removeAllRanges();
}
}
node.addEventListener("beforeinput", onBeforeInput);
node.addEventListener("keydown", onKeyDown);
node.addEventListener("compositionstart", onCompositionStart);
return () => {
node.removeEventListener("beforeinput", onBeforeInput);
node.removeEventListener("keydown", onKeyDown);
node.removeEventListener("compositionstart", onCompositionStart);
};
}, []);
}
;// ./node_modules/@wordpress/block-editor/build-module/utils/use-notify-copy.js
function useNotifyCopy() {
const { getBlockName } = (0,external_wp_data_namespaceObject.useSelect)(store);
const { getBlockType } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store);
const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
return (0,external_wp_element_namespaceObject.useCallback)(
(eventType, selectedBlockClientIds) => {
let notice = "";
if (eventType === "copyStyles") {
notice = (0,external_wp_i18n_namespaceObject.__)("Styles copied to clipboard.");
} else if (selectedBlockClientIds.length === 1) {
const clientId = selectedBlockClientIds[0];
const title = getBlockType(getBlockName(clientId))?.title;
if (eventType === "copy") {
notice = (0,external_wp_i18n_namespaceObject.sprintf)(
// Translators: %s: Name of the block being copied, e.g. "Paragraph".
(0,external_wp_i18n_namespaceObject.__)('Copied "%s" to clipboard.'),
title
);
} else {
notice = (0,external_wp_i18n_namespaceObject.sprintf)(
// Translators: %s: Name of the block being cut, e.g. "Paragraph".
(0,external_wp_i18n_namespaceObject.__)('Moved "%s" to clipboard.'),
title
);
}
} else if (eventType === "copy") {
notice = (0,external_wp_i18n_namespaceObject.sprintf)(
// Translators: %d: Number of blocks being copied.
(0,external_wp_i18n_namespaceObject._n)(
"Copied %d block to clipboard.",
"Copied %d blocks to clipboard.",
selectedBlockClientIds.length
),
selectedBlockClientIds.length
);
} else {
notice = (0,external_wp_i18n_namespaceObject.sprintf)(
// Translators: %d: Number of blocks being moved.
(0,external_wp_i18n_namespaceObject._n)(
"Moved %d block to clipboard.",
"Moved %d blocks to clipboard.",
selectedBlockClientIds.length
),
selectedBlockClientIds.length
);
}
createSuccessNotice(notice, {
type: "snackbar"
});
},
[createSuccessNotice, getBlockName, getBlockType]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/utils/pasting.js
function removeWindowsFragments(html) {
const startStr = "<!--StartFragment-->";
const startIdx = html.indexOf(startStr);
if (startIdx > -1) {
html = html.substring(startIdx + startStr.length);
} else {
return html;
}
const endStr = "<!--EndFragment-->";
const endIdx = html.indexOf(endStr);
if (endIdx > -1) {
html = html.substring(0, endIdx);
}
return html;
}
function removeCharsetMetaTag(html) {
const metaTag = `<meta charset='utf-8'>`;
if (html.startsWith(metaTag)) {
return html.slice(metaTag.length);
}
return html;
}
function getPasteEventData({ clipboardData }) {
let plainText = "";
let html = "";
try {
plainText = clipboardData.getData("text/plain");
html = clipboardData.getData("text/html");
} catch (error) {
return;
}
html = removeWindowsFragments(html);
html = removeCharsetMetaTag(html);
const files = (0,external_wp_dom_namespaceObject.getFilesFromDataTransfer)(clipboardData);
if (files.length && !shouldDismissPastedFiles(files, html)) {
return { files };
}
return { html, plainText, files: [] };
}
function shouldDismissPastedFiles(files, html) {
if (html && files?.length === 1 && files[0].type.indexOf("image/") === 0) {
const IMAGE_TAG = /<\s*img\b/gi;
if (html.match(IMAGE_TAG)?.length !== 1) {
return true;
}
const IMG_WITH_LOCAL_SRC = /<\s*img\b[^>]*\bsrc="file:\/\//i;
if (html.match(IMG_WITH_LOCAL_SRC)) {
return true;
}
}
return false;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/utils.js
const requiresWrapperOnCopy = Symbol("requiresWrapperOnCopy");
function setClipboardBlocks(event, blocks, registry) {
let _blocks = blocks;
const [firstBlock] = blocks;
if (firstBlock) {
const firstBlockType = registry.select(external_wp_blocks_namespaceObject.store).getBlockType(firstBlock.name);
if (firstBlockType[requiresWrapperOnCopy]) {
const { getBlockRootClientId, getBlockName, getBlockAttributes } = registry.select(store);
const wrapperBlockClientId = getBlockRootClientId(
firstBlock.clientId
);
const wrapperBlockName = getBlockName(wrapperBlockClientId);
if (wrapperBlockName) {
_blocks = (0,external_wp_blocks_namespaceObject.createBlock)(
wrapperBlockName,
getBlockAttributes(wrapperBlockClientId),
_blocks
);
}
}
}
const serialized = (0,external_wp_blocks_namespaceObject.serialize)(_blocks);
event.clipboardData.setData("text/plain", toPlainText(serialized));
event.clipboardData.setData("text/html", serialized);
}
function getPasteBlocks(event, canUserUseUnfilteredHTML) {
const { plainText, html, files } = getPasteEventData(event);
let blocks = [];
if (files.length) {
const fromTransforms = (0,external_wp_blocks_namespaceObject.getBlockTransforms)("from");
blocks = files.reduce((accumulator, file) => {
const transformation = (0,external_wp_blocks_namespaceObject.findTransform)(
fromTransforms,
(transform) => transform.type === "files" && transform.isMatch([file])
);
if (transformation) {
accumulator.push(transformation.transform([file]));
}
return accumulator;
}, []).flat();
} else {
blocks = (0,external_wp_blocks_namespaceObject.pasteHandler)({
HTML: html,
plainText,
mode: "BLOCKS",
canUserUseUnfilteredHTML
});
}
return blocks;
}
function toPlainText(html) {
html = html.replace(/<br>/g, "\n");
const plainText = (0,external_wp_dom_namespaceObject.__unstableStripHTML)(html).trim();
return plainText.replace(/\n\n+/g, "\n\n");
}
;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-clipboard-handler.js
function useClipboardHandler() {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const {
getBlocksByClientId,
getSelectedBlockClientIds,
hasMultiSelection,
getSettings,
getBlockName,
__unstableIsFullySelected,
__unstableIsSelectionCollapsed,
__unstableIsSelectionMergeable,
__unstableGetSelectedBlocksWithPartialSelection,
canInsertBlockType,
getBlockRootClientId
} = (0,external_wp_data_namespaceObject.useSelect)(store);
const {
flashBlock,
removeBlocks,
replaceBlocks,
__unstableDeleteSelection,
__unstableExpandSelection,
__unstableSplitSelection
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
const notifyCopy = useNotifyCopy();
return (0,external_wp_compose_namespaceObject.useRefEffect)((node) => {
function handler(event) {
if (event.defaultPrevented) {
return;
}
const selectedBlockClientIds = getSelectedBlockClientIds();
if (selectedBlockClientIds.length === 0) {
return;
}
if (!hasMultiSelection()) {
const { target } = event;
const { ownerDocument } = target;
const hasSelection = event.type === "copy" || event.type === "cut" ? (0,external_wp_dom_namespaceObject.documentHasUncollapsedSelection)(ownerDocument) : (0,external_wp_dom_namespaceObject.documentHasSelection)(ownerDocument) && !ownerDocument.activeElement.isContentEditable;
if (hasSelection) {
return;
}
}
const { activeElement } = event.target.ownerDocument;
if (!node.contains(activeElement)) {
return;
}
const isSelectionMergeable = __unstableIsSelectionMergeable();
const shouldHandleWholeBlocks = __unstableIsSelectionCollapsed() || __unstableIsFullySelected();
const expandSelectionIsNeeded = !shouldHandleWholeBlocks && !isSelectionMergeable;
if (event.type === "copy" || event.type === "cut") {
event.preventDefault();
if (selectedBlockClientIds.length === 1) {
flashBlock(selectedBlockClientIds[0]);
}
if (expandSelectionIsNeeded) {
__unstableExpandSelection();
} else {
notifyCopy(event.type, selectedBlockClientIds);
let blocks;
if (shouldHandleWholeBlocks) {
blocks = getBlocksByClientId(selectedBlockClientIds);
} else {
const [head, tail] = __unstableGetSelectedBlocksWithPartialSelection();
const inBetweenBlocks = getBlocksByClientId(
selectedBlockClientIds.slice(
1,
selectedBlockClientIds.length - 1
)
);
blocks = [head, ...inBetweenBlocks, tail];
}
setClipboardBlocks(event, blocks, registry);
}
}
if (event.type === "cut") {
if (shouldHandleWholeBlocks && !expandSelectionIsNeeded) {
removeBlocks(selectedBlockClientIds);
} else {
event.target.ownerDocument.activeElement.contentEditable = false;
__unstableDeleteSelection();
}
} else if (event.type === "paste") {
const {
__experimentalCanUserUseUnfilteredHTML: canUserUseUnfilteredHTML,
mediaUpload
} = getSettings();
const isInternal = event.clipboardData.getData("rich-text") === "true";
if (isInternal) {
return;
}
const { plainText, html, files } = getPasteEventData(event);
const isFullySelected = __unstableIsFullySelected();
let blocks = [];
if (files.length) {
if (!mediaUpload) {
event.preventDefault();
return;
}
const fromTransforms = (0,external_wp_blocks_namespaceObject.getBlockTransforms)("from");
blocks = files.reduce((accumulator, file) => {
const transformation = (0,external_wp_blocks_namespaceObject.findTransform)(
fromTransforms,
(transform) => transform.type === "files" && transform.isMatch([file])
);
if (transformation) {
accumulator.push(
transformation.transform([file])
);
}
return accumulator;
}, []).flat();
} else {
blocks = (0,external_wp_blocks_namespaceObject.pasteHandler)({
HTML: html,
plainText,
mode: isFullySelected ? "BLOCKS" : "AUTO",
canUserUseUnfilteredHTML
});
}
if (typeof blocks === "string") {
return;
}
if (isFullySelected) {
replaceBlocks(
selectedBlockClientIds,
blocks,
blocks.length - 1,
-1
);
event.preventDefault();
return;
}
if (!hasMultiSelection() && !(0,external_wp_blocks_namespaceObject.hasBlockSupport)(
getBlockName(selectedBlockClientIds[0]),
"splitting",
false
) && !event.__deprecatedOnSplit) {
return;
}
const [firstSelectedClientId] = selectedBlockClientIds;
const rootClientId = getBlockRootClientId(
firstSelectedClientId
);
const newBlocks = [];
for (const block of blocks) {
if (canInsertBlockType(block.name, rootClientId)) {
newBlocks.push(block);
} else {
const rootBlockName = getBlockName(rootClientId);
const switchedBlocks = block.name !== rootBlockName ? (0,external_wp_blocks_namespaceObject.switchToBlockType)(block, rootBlockName) : [block];
if (!switchedBlocks) {
return;
}
for (const switchedBlock of switchedBlocks) {
for (const innerBlock of switchedBlock.innerBlocks) {
newBlocks.push(innerBlock);
}
}
}
}
__unstableSplitSelection(newBlocks);
event.preventDefault();
}
}
node.ownerDocument.addEventListener("copy", handler);
node.ownerDocument.addEventListener("cut", handler);
node.ownerDocument.addEventListener("paste", handler);
return () => {
node.ownerDocument.removeEventListener("copy", handler);
node.ownerDocument.removeEventListener("cut", handler);
node.ownerDocument.removeEventListener("paste", handler);
};
}, []);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/index.js
function useWritingFlow() {
const [before, ref, after] = useTabNav();
const hasMultiSelection = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).hasMultiSelection(),
[]
);
return [
before,
(0,external_wp_compose_namespaceObject.useMergeRefs)([
ref,
useClipboardHandler(),
useInput(),
useDragSelection(),
useSelectionObserver(),
useClickSelection(),
useMultiSelection(),
useSelectAll(),
useArrowNav(),
(0,external_wp_compose_namespaceObject.useRefEffect)(
(node) => {
node.tabIndex = 0;
node.dataset.hasMultiSelection = hasMultiSelection;
if (!hasMultiSelection) {
return () => {
delete node.dataset.hasMultiSelection;
};
}
node.setAttribute(
"aria-label",
(0,external_wp_i18n_namespaceObject.__)("Multiple selected blocks")
);
return () => {
delete node.dataset.hasMultiSelection;
node.removeAttribute("aria-label");
};
},
[hasMultiSelection]
)
]),
after
];
}
function WritingFlow({ children, ...props }, forwardedRef) {
const [before, ref, after] = useWritingFlow();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
before,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
...props,
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, forwardedRef]),
className: dist_clsx(
props.className,
"block-editor-writing-flow"
),
children
}
),
after
] });
}
var writing_flow_default = (0,external_wp_element_namespaceObject.forwardRef)(WritingFlow);
;// ./node_modules/@wordpress/block-editor/build-module/components/iframe/get-compatibility-styles.js
let compatibilityStyles = null;
function getCompatibilityStyles() {
if (compatibilityStyles) {
return compatibilityStyles;
}
compatibilityStyles = Array.from(document.styleSheets).reduce(
(accumulator, styleSheet) => {
try {
styleSheet.cssRules;
} catch (e) {
return accumulator;
}
const { ownerNode, cssRules } = styleSheet;
if (ownerNode === null) {
return accumulator;
}
if (!cssRules) {
return accumulator;
}
if (ownerNode.id.startsWith("wp-")) {
return accumulator;
}
if (!ownerNode.id) {
return accumulator;
}
function matchFromRules(_cssRules) {
return Array.from(_cssRules).find(
({
selectorText,
conditionText,
cssRules: __cssRules
}) => {
if (conditionText) {
return matchFromRules(__cssRules);
}
return selectorText && (selectorText.includes(
".editor-styles-wrapper"
) || selectorText.includes(".wp-block"));
}
);
}
if (matchFromRules(cssRules)) {
const isInline = ownerNode.tagName === "STYLE";
if (isInline) {
const mainStylesCssId = ownerNode.id.replace(
"-inline-css",
"-css"
);
const mainStylesElement = document.getElementById(mainStylesCssId);
if (mainStylesElement) {
accumulator.push(mainStylesElement.cloneNode(true));
}
}
accumulator.push(ownerNode.cloneNode(true));
if (!isInline) {
const inlineStylesCssId = ownerNode.id.replace(
"-css",
"-inline-css"
);
const inlineStylesElement = document.getElementById(inlineStylesCssId);
if (inlineStylesElement) {
accumulator.push(
inlineStylesElement.cloneNode(true)
);
}
}
}
return accumulator;
},
[]
);
return compatibilityStyles;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/iframe/use-scale-canvas.js
function calculateScale({
frameSize,
containerWidth,
maxContainerWidth,
scaleContainerWidth
}) {
return (Math.min(containerWidth, maxContainerWidth) - frameSize * 2) / scaleContainerWidth;
}
function computeScrollHeightNext(transitionFrom, transitionTo) {
const { scaleValue: prevScale, scrollHeight: prevScrollHeight } = transitionFrom;
const { frameSize, scaleValue } = transitionTo;
return prevScrollHeight * (scaleValue / prevScale) + frameSize * 2;
}
function computeScrollTopNext(transitionFrom, transitionTo) {
const {
containerHeight: prevContainerHeight,
frameSize: prevFrameSize,
scaleValue: prevScale,
scrollTop: prevScrollTop
} = transitionFrom;
const { containerHeight, frameSize, scaleValue, scrollHeight } = transitionTo;
let scrollTopNext = prevScrollTop;
scrollTopNext = (scrollTopNext + prevContainerHeight / 2 - prevFrameSize) / prevScale - prevContainerHeight / 2;
scrollTopNext = (scrollTopNext + containerHeight / 2) * scaleValue + frameSize - containerHeight / 2;
scrollTopNext = prevScrollTop <= prevFrameSize ? 0 : scrollTopNext;
const maxScrollTop = scrollHeight - containerHeight;
return Math.round(
Math.min(Math.max(0, scrollTopNext), Math.max(0, maxScrollTop))
);
}
function getAnimationKeyframes(transitionFrom, transitionTo) {
const {
scaleValue: prevScale,
frameSize: prevFrameSize,
scrollTop
} = transitionFrom;
const { scaleValue, frameSize, scrollTop: scrollTopNext } = transitionTo;
return [
{
translate: `0 0`,
scale: prevScale,
paddingTop: `${prevFrameSize / prevScale}px`,
paddingBottom: `${prevFrameSize / prevScale}px`
},
{
translate: `0 ${scrollTop - scrollTopNext}px`,
scale: scaleValue,
paddingTop: `${frameSize / scaleValue}px`,
paddingBottom: `${frameSize / scaleValue}px`
}
];
}
function useScaleCanvas({
frameSize,
iframeDocument,
maxContainerWidth = 750,
scale
}) {
const [contentResizeListener, { height: contentHeight }] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
const [
containerResizeListener,
{ width: containerWidth, height: containerHeight }
] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
const initialContainerWidthRef = (0,external_wp_element_namespaceObject.useRef)(0);
const isZoomedOut = scale !== 1;
const prefersReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
const isAutoScaled = scale === "auto-scaled";
const startAnimationRef = (0,external_wp_element_namespaceObject.useRef)(false);
const animationRef = (0,external_wp_element_namespaceObject.useRef)(null);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isZoomedOut) {
initialContainerWidthRef.current = containerWidth;
}
}, [containerWidth, isZoomedOut]);
const scaleContainerWidth = Math.max(
initialContainerWidthRef.current,
containerWidth
);
const scaleValue = isAutoScaled ? calculateScale({
frameSize,
containerWidth,
maxContainerWidth,
scaleContainerWidth
}) : scale;
const transitionFromRef = (0,external_wp_element_namespaceObject.useRef)({
scaleValue,
frameSize,
containerHeight: 0,
scrollTop: 0,
scrollHeight: 0
});
const transitionToRef = (0,external_wp_element_namespaceObject.useRef)({
scaleValue,
frameSize,
containerHeight: 0,
scrollTop: 0,
scrollHeight: 0
});
const startZoomOutAnimation = (0,external_wp_element_namespaceObject.useCallback)(() => {
const { scrollTop } = transitionFromRef.current;
const { scrollTop: scrollTopNext } = transitionToRef.current;
iframeDocument.documentElement.style.setProperty(
"--wp-block-editor-iframe-zoom-out-scroll-top",
`${scrollTop}px`
);
iframeDocument.documentElement.style.setProperty(
"--wp-block-editor-iframe-zoom-out-scroll-top-next",
`${scrollTopNext}px`
);
iframeDocument.documentElement.style.setProperty(
"--wp-block-editor-iframe-zoom-out-overflow-behavior",
transitionFromRef.current.scrollHeight === transitionFromRef.current.containerHeight ? "auto" : "scroll"
);
iframeDocument.documentElement.classList.add("zoom-out-animation");
return iframeDocument.documentElement.animate(
getAnimationKeyframes(
transitionFromRef.current,
transitionToRef.current
),
{
easing: "cubic-bezier(0.46, 0.03, 0.52, 0.96)",
duration: 400
}
);
}, [iframeDocument]);
const finishZoomOutAnimation = (0,external_wp_element_namespaceObject.useCallback)(() => {
startAnimationRef.current = false;
animationRef.current = null;
iframeDocument.documentElement.style.setProperty(
"--wp-block-editor-iframe-zoom-out-scale",
transitionToRef.current.scaleValue
);
iframeDocument.documentElement.style.setProperty(
"--wp-block-editor-iframe-zoom-out-frame-size",
`${transitionToRef.current.frameSize}px`
);
iframeDocument.documentElement.classList.remove("zoom-out-animation");
iframeDocument.documentElement.scrollTop = transitionToRef.current.scrollTop;
iframeDocument.documentElement.style.removeProperty(
"--wp-block-editor-iframe-zoom-out-scroll-top"
);
iframeDocument.documentElement.style.removeProperty(
"--wp-block-editor-iframe-zoom-out-scroll-top-next"
);
iframeDocument.documentElement.style.removeProperty(
"--wp-block-editor-iframe-zoom-out-overflow-behavior"
);
transitionFromRef.current = transitionToRef.current;
}, [iframeDocument]);
const previousIsZoomedOut = (0,external_wp_element_namespaceObject.useRef)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const trigger = iframeDocument && previousIsZoomedOut.current !== isZoomedOut;
previousIsZoomedOut.current = isZoomedOut;
if (!trigger) {
return;
}
startAnimationRef.current = true;
if (!isZoomedOut) {
return;
}
iframeDocument.documentElement.classList.add("is-zoomed-out");
return () => {
iframeDocument.documentElement.classList.remove("is-zoomed-out");
};
}, [iframeDocument, isZoomedOut]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!iframeDocument) {
return;
}
if (isAutoScaled && transitionFromRef.current.scaleValue !== 1) {
transitionFromRef.current.scaleValue = calculateScale({
frameSize: transitionFromRef.current.frameSize,
containerWidth,
maxContainerWidth,
scaleContainerWidth: containerWidth
});
}
if (scaleValue < 1) {
if (!startAnimationRef.current) {
iframeDocument.documentElement.style.setProperty(
"--wp-block-editor-iframe-zoom-out-scale",
scaleValue
);
iframeDocument.documentElement.style.setProperty(
"--wp-block-editor-iframe-zoom-out-frame-size",
`${frameSize}px`
);
}
iframeDocument.documentElement.style.setProperty(
"--wp-block-editor-iframe-zoom-out-content-height",
`${contentHeight}px`
);
iframeDocument.documentElement.style.setProperty(
"--wp-block-editor-iframe-zoom-out-inner-height",
`${containerHeight}px`
);
iframeDocument.documentElement.style.setProperty(
"--wp-block-editor-iframe-zoom-out-container-width",
`${containerWidth}px`
);
iframeDocument.documentElement.style.setProperty(
"--wp-block-editor-iframe-zoom-out-scale-container-width",
`${scaleContainerWidth}px`
);
}
if (startAnimationRef.current) {
startAnimationRef.current = false;
if (animationRef.current) {
animationRef.current.reverse();
const tempTransitionFrom = transitionFromRef.current;
const tempTransitionTo = transitionToRef.current;
transitionFromRef.current = tempTransitionTo;
transitionToRef.current = tempTransitionFrom;
} else {
transitionFromRef.current.scrollTop = iframeDocument.documentElement.scrollTop;
transitionFromRef.current.scrollHeight = iframeDocument.documentElement.scrollHeight;
transitionFromRef.current.containerHeight = containerHeight;
transitionToRef.current = {
scaleValue,
frameSize,
containerHeight: iframeDocument.documentElement.clientHeight
// use clientHeight to get the actual height of the new container after zoom state changes have rendered, as it will be the most up-to-date.
};
transitionToRef.current.scrollHeight = computeScrollHeightNext(
transitionFromRef.current,
transitionToRef.current
);
transitionToRef.current.scrollTop = computeScrollTopNext(
transitionFromRef.current,
transitionToRef.current
);
animationRef.current = startZoomOutAnimation();
if (prefersReducedMotion) {
finishZoomOutAnimation();
} else {
animationRef.current.onfinish = finishZoomOutAnimation;
}
}
}
}, [
startZoomOutAnimation,
finishZoomOutAnimation,
prefersReducedMotion,
isAutoScaled,
scaleValue,
frameSize,
iframeDocument,
contentHeight,
containerWidth,
containerHeight,
maxContainerWidth,
scaleContainerWidth
]);
return {
isZoomedOut,
scaleContainerWidth,
contentResizeListener,
containerResizeListener
};
}
;// ./node_modules/@wordpress/block-editor/build-module/components/iframe/index.js
function bubbleEvent(event, Constructor, frame) {
const init = {};
for (const key in event) {
init[key] = event[key];
}
if (event instanceof frame.contentDocument.defaultView.MouseEvent) {
const rect = frame.getBoundingClientRect();
init.clientX += rect.left;
init.clientY += rect.top;
}
const newEvent = new Constructor(event.type, init);
if (init.defaultPrevented) {
newEvent.preventDefault();
}
const cancelled = !frame.dispatchEvent(newEvent);
if (cancelled) {
event.preventDefault();
}
}
function useBubbleEvents(iframeDocument) {
return (0,external_wp_compose_namespaceObject.useRefEffect)(() => {
const { defaultView } = iframeDocument;
if (!defaultView) {
return;
}
const { frameElement } = defaultView;
const html = iframeDocument.documentElement;
const eventTypes = ["dragover", "mousemove"];
const handlers = {};
for (const name of eventTypes) {
handlers[name] = (event) => {
const prototype = Object.getPrototypeOf(event);
const constructorName = prototype.constructor.name;
const Constructor = window[constructorName];
bubbleEvent(event, Constructor, frameElement);
};
html.addEventListener(name, handlers[name]);
}
return () => {
for (const name of eventTypes) {
html.removeEventListener(name, handlers[name]);
}
};
});
}
function Iframe({
contentRef,
children,
tabIndex = 0,
scale = 1,
frameSize = 0,
readonly,
forwardedRef: ref,
title = (0,external_wp_i18n_namespaceObject.__)("Editor canvas"),
...props
}) {
const { resolvedAssets, isPreviewMode } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getSettings } = select(store);
const settings = getSettings();
return {
resolvedAssets: settings.__unstableResolvedAssets,
isPreviewMode: settings.isPreviewMode
};
}, []);
const { styles = "", scripts = "" } = resolvedAssets;
const [iframeDocument, setIframeDocument] = (0,external_wp_element_namespaceObject.useState)();
const [bodyClasses, setBodyClasses] = (0,external_wp_element_namespaceObject.useState)([]);
const clearerRef = useBlockSelectionClearer();
const [before, writingFlowRef, after] = useWritingFlow();
const setRef = (0,external_wp_compose_namespaceObject.useRefEffect)((node) => {
node._load = () => {
setIframeDocument(node.contentDocument);
};
let iFrameDocument;
function preventFileDropDefault(event) {
event.preventDefault();
}
function interceptLinkClicks(event) {
if (event.target.tagName === "A" && event.target.getAttribute("href")?.startsWith("#")) {
event.preventDefault();
iFrameDocument.defaultView.location.hash = event.target.getAttribute("href").slice(1);
}
}
const { ownerDocument } = node;
setBodyClasses(
Array.from(ownerDocument.body.classList).filter(
(name) => name.startsWith("admin-color-") || name.startsWith("post-type-") || name === "wp-embed-responsive"
)
);
function onLoad() {
const { contentDocument } = node;
const { documentElement } = contentDocument;
iFrameDocument = contentDocument;
documentElement.classList.add("block-editor-iframe__html");
clearerRef(documentElement);
contentDocument.dir = ownerDocument.dir;
for (const compatStyle of getCompatibilityStyles()) {
if (contentDocument.getElementById(compatStyle.id)) {
continue;
}
contentDocument.head.appendChild(
compatStyle.cloneNode(true)
);
if (!isPreviewMode) {
console.warn(
`${compatStyle.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,
compatStyle
);
}
}
iFrameDocument.addEventListener(
"dragover",
preventFileDropDefault,
false
);
iFrameDocument.addEventListener(
"drop",
preventFileDropDefault,
false
);
iFrameDocument.addEventListener("click", interceptLinkClicks);
}
node.addEventListener("load", onLoad);
return () => {
delete node._load;
node.removeEventListener("load", onLoad);
iFrameDocument?.removeEventListener(
"dragover",
preventFileDropDefault
);
iFrameDocument?.removeEventListener(
"drop",
preventFileDropDefault
);
iFrameDocument?.removeEventListener("click", interceptLinkClicks);
};
}, []);
const {
contentResizeListener,
containerResizeListener,
isZoomedOut,
scaleContainerWidth
} = useScaleCanvas({
scale,
frameSize: parseInt(frameSize),
iframeDocument
});
const disabledRef = (0,external_wp_compose_namespaceObject.useDisabled)({ isDisabled: !readonly });
const bodyRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([
useBubbleEvents(iframeDocument),
contentRef,
clearerRef,
writingFlowRef,
disabledRef
]);
const html = `<!doctype html>
<html>
<head>
<meta charset="utf-8">
<base href="${window.location.origin}">
<script>window.frameElement._load()</script>
<style>
html{
height: auto !important;
min-height: 100%;
}
/* Lowest specificity to not override global styles */
:where(body) {
margin: 0;
/* Default background color in case zoom out mode background
colors the html element */
background-color: white;
}
</style>
${styles}
${scripts}
</head>
<body>
<script>document.currentScript.parentElement.remove()</script>
</body>
</html>`;
const [src, cleanup] = (0,external_wp_element_namespaceObject.useMemo)(() => {
const _src = URL.createObjectURL(
new window.Blob([html], { type: "text/html" })
);
return [_src, () => URL.revokeObjectURL(_src)];
}, [html]);
(0,external_wp_element_namespaceObject.useEffect)(() => cleanup, [cleanup]);
const shouldRenderFocusCaptureElements = tabIndex >= 0 && !isPreviewMode;
const iframe = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
shouldRenderFocusCaptureElements && before,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"iframe",
{
...props,
style: {
...props.style,
height: props.style?.height,
border: 0
},
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, setRef]),
tabIndex,
src,
title,
onKeyDown: (event) => {
if (props.onKeyDown) {
props.onKeyDown(event);
}
if (event.currentTarget.ownerDocument !== event.target.ownerDocument) {
const { stopPropagation } = event.nativeEvent;
event.nativeEvent.stopPropagation = () => {
};
event.stopPropagation();
event.nativeEvent.stopPropagation = stopPropagation;
bubbleEvent(
event,
window.KeyboardEvent,
event.currentTarget
);
}
},
children: iframeDocument && (0,external_wp_element_namespaceObject.createPortal)(
// We want to prevent React events from bubbling through the iframe
// we bubble these manually.
/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"body",
{
ref: bodyRef,
className: dist_clsx(
"block-editor-iframe__body",
"editor-styles-wrapper",
...bodyClasses
),
children: [
contentResizeListener,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalStyleProvider, { document: iframeDocument, children })
]
}
),
iframeDocument.documentElement
)
}
),
shouldRenderFocusCaptureElements && after
] });
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-iframe__container", children: [
containerResizeListener,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx(
"block-editor-iframe__scale-container",
isZoomedOut && "is-zoomed-out"
),
style: {
"--wp-block-editor-iframe-zoom-out-scale-container-width": isZoomedOut && `${scaleContainerWidth}px`
},
children: iframe
}
)
] });
}
function IframeIfReady(props, ref) {
const isInitialised = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).getSettings().__internalIsInitialized,
[]
);
if (!isInitialised) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Iframe, { ...props, forwardedRef: ref });
}
var iframe_default = (0,external_wp_element_namespaceObject.forwardRef)(IframeIfReady);
;// ./node_modules/parsel-js/dist/parsel.js
const TOKENS = {
attribute: /\[\s*(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?(?<name>[-\w\P{ASCII}]+)\s*(?:(?<operator>\W?=)\s*(?<value>.+?)\s*(\s(?<caseSensitive>[iIsS]))?\s*)?\]/gu,
id: /#(?<name>[-\w\P{ASCII}]+)/gu,
class: /\.(?<name>[-\w\P{ASCII}]+)/gu,
comma: /\s*,\s*/g,
combinator: /\s*[\s>+~]\s*/g,
'pseudo-element': /::(?<name>[-\w\P{ASCII}]+)(?:\((?<argument>¶*)\))?/gu,
'pseudo-class': /:(?<name>[-\w\P{ASCII}]+)(?:\((?<argument>¶*)\))?/gu,
universal: /(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?\*/gu,
type: /(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?(?<name>[-\w\P{ASCII}]+)/gu, // this must be last
};
const TRIM_TOKENS = new Set(['combinator', 'comma']);
const RECURSIVE_PSEUDO_CLASSES = new Set([
'not',
'is',
'where',
'has',
'matches',
'-moz-any',
'-webkit-any',
'nth-child',
'nth-last-child',
]);
const nthChildRegExp = /(?<index>[\dn+-]+)\s+of\s+(?<subtree>.+)/;
const RECURSIVE_PSEUDO_CLASSES_ARGS = {
'nth-child': nthChildRegExp,
'nth-last-child': nthChildRegExp,
};
const getArgumentPatternByType = (type) => {
switch (type) {
case 'pseudo-element':
case 'pseudo-class':
return new RegExp(TOKENS[type].source.replace('(?<argument>¶*)', '(?<argument>.*)'), 'gu');
default:
return TOKENS[type];
}
};
function gobbleParens(text, offset) {
let nesting = 0;
let result = '';
for (; offset < text.length; offset++) {
const char = text[offset];
switch (char) {
case '(':
++nesting;
break;
case ')':
--nesting;
break;
}
result += char;
if (nesting === 0) {
return result;
}
}
return result;
}
function tokenizeBy(text, grammar = TOKENS) {
if (!text) {
return [];
}
const tokens = [text];
for (const [type, pattern] of Object.entries(grammar)) {
for (let i = 0; i < tokens.length; i++) {
const token = tokens[i];
if (typeof token !== 'string') {
continue;
}
pattern.lastIndex = 0;
const match = pattern.exec(token);
if (!match) {
continue;
}
const from = match.index - 1;
const args = [];
const content = match[0];
const before = token.slice(0, from + 1);
if (before) {
args.push(before);
}
args.push({
...match.groups,
type,
content,
});
const after = token.slice(from + content.length + 1);
if (after) {
args.push(after);
}
tokens.splice(i, 1, ...args);
}
}
let offset = 0;
for (const token of tokens) {
switch (typeof token) {
case 'string':
throw new Error(`Unexpected sequence ${token} found at index ${offset}`);
case 'object':
offset += token.content.length;
token.pos = [offset - token.content.length, offset];
if (TRIM_TOKENS.has(token.type)) {
token.content = token.content.trim() || ' ';
}
break;
}
}
return tokens;
}
const STRING_PATTERN = /(['"])([^\\\n]+?)\1/g;
const ESCAPE_PATTERN = /\\./g;
function parsel_tokenize(selector, grammar = TOKENS) {
// Prevent leading/trailing whitespaces from being interpreted as combinators
selector = selector.trim();
if (selector === '') {
return [];
}
const replacements = [];
// Replace escapes with placeholders.
selector = selector.replace(ESCAPE_PATTERN, (value, offset) => {
replacements.push({ value, offset });
return '\uE000'.repeat(value.length);
});
// Replace strings with placeholders.
selector = selector.replace(STRING_PATTERN, (value, quote, content, offset) => {
replacements.push({ value, offset });
return `${quote}${'\uE001'.repeat(content.length)}${quote}`;
});
// Replace parentheses with placeholders.
{
let pos = 0;
let offset;
while ((offset = selector.indexOf('(', pos)) > -1) {
const value = gobbleParens(selector, offset);
replacements.push({ value, offset });
selector = `${selector.substring(0, offset)}(${'¶'.repeat(value.length - 2)})${selector.substring(offset + value.length)}`;
pos = offset + value.length;
}
}
// Now we have no nested structures and we can parse with regexes
const tokens = tokenizeBy(selector, grammar);
// Replace placeholders in reverse order.
const changedTokens = new Set();
for (const replacement of replacements.reverse()) {
for (const token of tokens) {
const { offset, value } = replacement;
if (!(token.pos[0] <= offset &&
offset + value.length <= token.pos[1])) {
continue;
}
const { content } = token;
const tokenOffset = offset - token.pos[0];
token.content =
content.slice(0, tokenOffset) +
value +
content.slice(tokenOffset + value.length);
if (token.content !== content) {
changedTokens.add(token);
}
}
}
// Update changed tokens.
for (const token of changedTokens) {
const pattern = getArgumentPatternByType(token.type);
if (!pattern) {
throw new Error(`Unknown token type: ${token.type}`);
}
pattern.lastIndex = 0;
const match = pattern.exec(token.content);
if (!match) {
throw new Error(`Unable to parse content for ${token.type}: ${token.content}`);
}
Object.assign(token, match.groups);
}
return tokens;
}
/**
* Convert a flat list of tokens into a tree of complex & compound selectors
*/
function nestTokens(tokens, { list = true } = {}) {
if (list && tokens.find((t) => t.type === 'comma')) {
const selectors = [];
const temp = [];
for (let i = 0; i < tokens.length; i++) {
if (tokens[i].type === 'comma') {
if (temp.length === 0) {
throw new Error('Incorrect comma at ' + i);
}
selectors.push(nestTokens(temp, { list: false }));
temp.length = 0;
}
else {
temp.push(tokens[i]);
}
}
if (temp.length === 0) {
throw new Error('Trailing comma');
}
else {
selectors.push(nestTokens(temp, { list: false }));
}
return { type: 'list', list: selectors };
}
for (let i = tokens.length - 1; i >= 0; i--) {
let token = tokens[i];
if (token.type === 'combinator') {
let left = tokens.slice(0, i);
let right = tokens.slice(i + 1);
return {
type: 'complex',
combinator: token.content,
left: nestTokens(left),
right: nestTokens(right),
};
}
}
switch (tokens.length) {
case 0:
throw new Error('Could not build AST.');
case 1:
// If we're here, there are no combinators, so it's just a list.
return tokens[0];
default:
return {
type: 'compound',
list: [...tokens], // clone to avoid pointers messing up the AST
};
}
}
/**
* Traverse an AST in depth-first order
*/
function* flatten(node,
/**
* @internal
*/
parent) {
switch (node.type) {
case 'list':
for (let child of node.list) {
yield* flatten(child, node);
}
break;
case 'complex':
yield* flatten(node.left, node);
yield* flatten(node.right, node);
break;
case 'compound':
yield* node.list.map((token) => [token, node]);
break;
default:
yield [node, parent];
}
}
/**
* Traverse an AST (or part thereof), in depth-first order
*/
function walk(node, visit,
/**
* @internal
*/
parent) {
if (!node) {
return;
}
for (const [token, ast] of flatten(node, parent)) {
visit(token, ast);
}
}
/**
* Parse a CSS selector
*
* @param selector - The selector to parse
* @param options.recursive - Whether to parse the arguments of pseudo-classes like :is(), :has() etc. Defaults to true.
* @param options.list - Whether this can be a selector list (A, B, C etc). Defaults to true.
*/
function parse(selector, { recursive = true, list = true } = {}) {
const tokens = parsel_tokenize(selector);
if (!tokens) {
return;
}
const ast = nestTokens(tokens, { list });
if (!recursive) {
return ast;
}
for (const [token] of flatten(ast)) {
if (token.type !== 'pseudo-class' || !token.argument) {
continue;
}
if (!RECURSIVE_PSEUDO_CLASSES.has(token.name)) {
continue;
}
let argument = token.argument;
const childArg = RECURSIVE_PSEUDO_CLASSES_ARGS[token.name];
if (childArg) {
const match = childArg.exec(argument);
if (!match) {
continue;
}
Object.assign(token, match.groups);
argument = match.groups['subtree'];
}
if (!argument) {
continue;
}
Object.assign(token, {
subtree: parse(argument, {
recursive: true,
list: true,
}),
});
}
return ast;
}
/**
* Converts the given list or (sub)tree to a string.
*/
function parsel_stringify(listOrNode) {
let tokens;
if (Array.isArray(listOrNode)) {
tokens = listOrNode;
}
else {
tokens = [...flatten(listOrNode)].map(([token]) => token);
}
return tokens.map(token => token.content).join('');
}
/**
* To convert the specificity array to a number
*/
function specificityToNumber(specificity, base) {
base = base || Math.max(...specificity) + 1;
return (specificity[0] * (base << 1) + specificity[1] * base + specificity[2]);
}
/**
* Calculate specificity of a selector.
*
* If the selector is a list, the max specificity is returned.
*/
function specificity(selector) {
let ast = selector;
if (typeof ast === 'string') {
ast = parse(ast, { recursive: true });
}
if (!ast) {
return [];
}
if (ast.type === 'list' && 'list' in ast) {
let base = 10;
const specificities = ast.list.map((ast) => {
const sp = specificity(ast);
base = Math.max(base, ...specificity(ast));
return sp;
});
const numbers = specificities.map((ast) => specificityToNumber(ast, base));
return specificities[numbers.indexOf(Math.max(...numbers))];
}
const ret = [0, 0, 0];
for (const [token] of flatten(ast)) {
switch (token.type) {
case 'id':
ret[0]++;
break;
case 'class':
case 'attribute':
ret[1]++;
break;
case 'pseudo-element':
case 'type':
ret[2]++;
break;
case 'pseudo-class':
if (token.name === 'where') {
break;
}
if (!RECURSIVE_PSEUDO_CLASSES.has(token.name) ||
!token.subtree) {
ret[1]++;
break;
}
const sub = specificity(token.subtree);
sub.forEach((s, i) => (ret[i] += s));
// :nth-child() & :nth-last-child() add (0, 1, 0) to the specificity of their most complex selector
if (token.name === 'nth-child' ||
token.name === 'nth-last-child') {
ret[1]++;
}
}
}
return ret;
}
// EXTERNAL MODULE: ./node_modules/postcss/lib/processor.js
var processor = __webpack_require__(9656);
var processor_default = /*#__PURE__*/__webpack_require__.n(processor);
// EXTERNAL MODULE: ./node_modules/postcss/lib/css-syntax-error.js
var css_syntax_error = __webpack_require__(356);
var css_syntax_error_default = /*#__PURE__*/__webpack_require__.n(css_syntax_error);
// EXTERNAL MODULE: ./node_modules/postcss-prefix-selector/index.js
var postcss_prefix_selector = __webpack_require__(1443);
var postcss_prefix_selector_default = /*#__PURE__*/__webpack_require__.n(postcss_prefix_selector);
// EXTERNAL MODULE: ./node_modules/postcss-urlrebase/index.js
var postcss_urlrebase = __webpack_require__(5404);
var postcss_urlrebase_default = /*#__PURE__*/__webpack_require__.n(postcss_urlrebase);
;// ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/index.js
const cacheByWrapperSelector = /* @__PURE__ */ new Map();
const ROOT_SELECTOR_TOKENS = [
{ type: "type", content: "body" },
{ type: "type", content: "html" },
{ type: "pseudo-class", content: ":root" },
{ type: "pseudo-class", content: ":where(body)" },
{ type: "pseudo-class", content: ":where(:root)" },
{ type: "pseudo-class", content: ":where(html)" }
];
function prefixRootSelector(prefix, selector) {
const tokenized = parsel_tokenize(selector);
const lastRootIndex = tokenized.findLastIndex(({ content, type }) => {
return ROOT_SELECTOR_TOKENS.some(
(rootSelector) => content === rootSelector.content && type === rootSelector.type
);
});
let insertionPoint = -1;
for (let i = lastRootIndex + 1; i < tokenized.length; i++) {
if (tokenized[i].type === "combinator") {
insertionPoint = i;
break;
}
}
const tokenizedPrefix = parsel_tokenize(prefix);
tokenized.splice(
// Insert at the insertion point, or the end.
insertionPoint === -1 ? tokenized.length : insertionPoint,
0,
{
type: "combinator",
content: " "
},
...tokenizedPrefix
);
return parsel_stringify(tokenized);
}
function transformStyle({ css, ignoredSelectors = [], baseURL }, wrapperSelector = "", transformOptions) {
if (!wrapperSelector && !baseURL) {
return css;
}
try {
const excludedSelectors = [
...ignoredSelectors,
...transformOptions?.ignoredSelectors ?? [],
wrapperSelector
];
return new (processor_default())(
[
wrapperSelector && postcss_prefix_selector_default()({
prefix: wrapperSelector,
transform(prefix, selector, prefixedSelector) {
if (excludedSelectors.some(
(excludedSelector) => excludedSelector instanceof RegExp ? selector.match(excludedSelector) : selector.includes(excludedSelector)
)) {
return selector;
}
const hasRootSelector = ROOT_SELECTOR_TOKENS.some(
(rootSelector) => selector.startsWith(rootSelector.content)
);
if (hasRootSelector) {
return prefixRootSelector(prefix, selector);
}
return prefixedSelector;
}
}),
baseURL && postcss_urlrebase_default()({ rootUrl: baseURL })
].filter(Boolean)
).process(css, {}).css;
} catch (error) {
if (error instanceof (css_syntax_error_default())) {
console.warn(
"wp.blockEditor.transformStyles Failed to transform CSS.",
error.message + "\n" + error.showSourceCode(false)
);
} else {
console.warn(
"wp.blockEditor.transformStyles Failed to transform CSS.",
error
);
}
return null;
}
}
const transform_styles_transformStyles = (styles, wrapperSelector = "", transformOptions) => {
let cache = cacheByWrapperSelector.get(wrapperSelector);
if (!cache) {
cache = /* @__PURE__ */ new WeakMap();
cacheByWrapperSelector.set(wrapperSelector, cache);
}
return styles.map((style) => {
let css = cache.get(style);
if (!css) {
css = transformStyle(style, wrapperSelector, transformOptions);
cache.set(style, css);
}
return css;
});
};
var transform_styles_default = transform_styles_transformStyles;
;// ./node_modules/@wordpress/block-editor/build-module/components/editor-styles/index.js
k([names, a11y]);
function useDarkThemeBodyClassName(styles, scope) {
return (0,external_wp_element_namespaceObject.useCallback)(
(node) => {
if (!node) {
return;
}
const { ownerDocument } = node;
const { defaultView, body } = ownerDocument;
const canvas = scope ? ownerDocument.querySelector(scope) : body;
let backgroundColor;
if (!canvas) {
const tempCanvas = ownerDocument.createElement("div");
tempCanvas.classList.add("editor-styles-wrapper");
body.appendChild(tempCanvas);
backgroundColor = defaultView?.getComputedStyle(tempCanvas, null).getPropertyValue("background-color");
body.removeChild(tempCanvas);
} else {
backgroundColor = defaultView?.getComputedStyle(canvas, null).getPropertyValue("background-color");
}
const colordBackgroundColor = w(backgroundColor);
if (colordBackgroundColor.luminance() > 0.5 || colordBackgroundColor.alpha() === 0) {
body.classList.remove("is-dark-theme");
} else {
body.classList.add("is-dark-theme");
}
},
[styles, scope]
);
}
function EditorStyles({ styles, scope, transformOptions }) {
const overrides = (0,external_wp_data_namespaceObject.useSelect)(
(select) => unlock(select(store)).getStyleOverrides(),
[]
);
const [transformedStyles, transformedSvgs] = (0,external_wp_element_namespaceObject.useMemo)(() => {
const _styles = Object.values(styles ?? []);
for (const [id, override] of overrides) {
const index = _styles.findIndex(({ id: _id }) => id === _id);
const overrideWithId = { ...override, id };
if (index === -1) {
_styles.push(overrideWithId);
} else {
_styles[index] = overrideWithId;
}
}
return [
transform_styles_default(
_styles.filter((style) => style?.css),
scope,
transformOptions
),
_styles.filter((style) => style.__unstableType === "svgs").map((style) => style.assets).join("")
];
}, [styles, overrides, scope, transformOptions]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"style",
{
ref: useDarkThemeBodyClassName(transformedStyles, scope)
}
),
transformedStyles.map((css, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("style", { children: css }, index)),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SVG,
{
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 0 0",
width: "0",
height: "0",
role: "none",
style: {
visibility: "hidden",
position: "absolute",
left: "-9999px",
overflow: "hidden"
},
dangerouslySetInnerHTML: { __html: transformedSvgs }
}
)
] });
}
var editor_styles_default = (0,external_wp_element_namespaceObject.memo)(EditorStyles);
;// ./node_modules/@wordpress/block-editor/build-module/components/block-preview/auto.js
const MemoizedBlockList = (0,external_wp_element_namespaceObject.memo)(BlockList);
const MAX_HEIGHT = 2e3;
const EMPTY_ADDITIONAL_STYLES = [];
function ScaledBlockPreview({
viewportWidth,
containerWidth,
minHeight,
additionalStyles = EMPTY_ADDITIONAL_STYLES
}) {
if (!viewportWidth) {
viewportWidth = containerWidth;
}
const [contentResizeListener, { height: contentHeight }] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
const { styles } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const settings = select(store).getSettings();
return {
styles: settings.styles
};
}, []);
const editorStyles = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (styles) {
return [
...styles,
{
css: "body{height:auto;overflow:hidden;border:none;padding:0;}",
__unstableType: "presets"
},
...additionalStyles
];
}
return styles;
}, [styles, additionalStyles]);
const scale = containerWidth / viewportWidth;
const aspectRatio = contentHeight ? containerWidth / (contentHeight * scale) : 0;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Disabled,
{
className: "block-editor-block-preview__content",
style: {
transform: `scale(${scale})`,
// Using width + aspect-ratio instead of height here triggers browsers' native
// handling of scrollbar's visibility. It prevents the flickering issue seen
// in https://github.com/WordPress/gutenberg/issues/52027.
// See https://github.com/WordPress/gutenberg/pull/52921 for more info.
aspectRatio,
maxHeight: contentHeight > MAX_HEIGHT ? MAX_HEIGHT * scale : void 0,
minHeight
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
iframe_default,
{
contentRef: (0,external_wp_compose_namespaceObject.useRefEffect)((bodyElement) => {
const {
ownerDocument: { documentElement }
} = bodyElement;
documentElement.classList.add(
"block-editor-block-preview__content-iframe"
);
documentElement.style.position = "absolute";
documentElement.style.width = "100%";
bodyElement.style.boxSizing = "border-box";
bodyElement.style.position = "absolute";
bodyElement.style.width = "100%";
}, []),
"aria-hidden": true,
tabIndex: -1,
style: {
position: "absolute",
width: viewportWidth,
height: contentHeight,
pointerEvents: "none",
// This is a catch-all max-height for patterns.
// See: https://github.com/WordPress/gutenberg/pull/38175.
maxHeight: MAX_HEIGHT,
minHeight: scale !== 0 && scale < 1 && minHeight ? minHeight / scale : minHeight
},
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_styles_default, { styles: editorStyles }),
contentResizeListener,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MemoizedBlockList, { renderAppender: false })
]
}
)
}
);
}
function AutoBlockPreview(props) {
const [containerResizeListener, { width: containerWidth }] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { style: { position: "relative", width: "100%", height: 0 }, children: containerResizeListener }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-preview__container", children: !!containerWidth && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ScaledBlockPreview,
{
...props,
containerWidth
}
) })
] });
}
;// external ["wp","priorityQueue"]
const external_wp_priorityQueue_namespaceObject = window["wp"]["priorityQueue"];
;// ./node_modules/@wordpress/block-editor/build-module/components/block-preview/async.js
const blockPreviewQueue = (0,external_wp_priorityQueue_namespaceObject.createQueue)();
function Async({ children, placeholder }) {
const [shouldRender, setShouldRender] = (0,external_wp_element_namespaceObject.useState)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const context = {};
blockPreviewQueue.add(context, () => {
(0,external_wp_element_namespaceObject.flushSync)(() => {
setShouldRender(true);
});
});
return () => {
blockPreviewQueue.cancel(context);
};
}, []);
if (!shouldRender) {
return placeholder;
}
return children;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-preview/index.js
const block_preview_EMPTY_ADDITIONAL_STYLES = [];
function BlockPreview({
blocks,
viewportWidth = 1200,
minHeight,
additionalStyles = block_preview_EMPTY_ADDITIONAL_STYLES,
// Deprecated props:
__experimentalMinHeight,
__experimentalPadding
}) {
if (__experimentalMinHeight) {
minHeight = __experimentalMinHeight;
external_wp_deprecated_default()("The __experimentalMinHeight prop", {
since: "6.2",
version: "6.4",
alternative: "minHeight"
});
}
if (__experimentalPadding) {
additionalStyles = [
...additionalStyles,
{ css: `body { padding: ${__experimentalPadding}px; }` }
];
external_wp_deprecated_default()("The __experimentalPadding prop of BlockPreview", {
since: "6.2",
version: "6.4",
alternative: "additionalStyles"
});
}
const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).getSettings(),
[]
);
const settings = (0,external_wp_element_namespaceObject.useMemo)(
() => ({
...originalSettings,
focusMode: false,
// Disable "Spotlight mode".
isPreviewMode: true
}),
[originalSettings]
);
const renderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(
() => Array.isArray(blocks) ? blocks : [blocks],
[blocks]
);
if (!blocks || blocks.length === 0) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ExperimentalBlockEditorProvider,
{
value: renderedBlocks,
settings,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
AutoBlockPreview,
{
viewportWidth,
minHeight,
additionalStyles
}
)
}
);
}
const MemoizedBlockPreview = (0,external_wp_element_namespaceObject.memo)(BlockPreview);
MemoizedBlockPreview.Async = Async;
var block_preview_default = MemoizedBlockPreview;
function useBlockPreview({ blocks, props = {}, layout }) {
const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).getSettings(),
[]
);
const settings = (0,external_wp_element_namespaceObject.useMemo)(
() => ({
...originalSettings,
styles: void 0,
// Clear styles included by the parent settings, as they are already output by the parent's EditorStyles.
focusMode: false,
// Disable "Spotlight mode".
isPreviewMode: true
}),
[originalSettings]
);
const disabledRef = (0,external_wp_compose_namespaceObject.useDisabled)();
const ref = (0,external_wp_compose_namespaceObject.useMergeRefs)([props.ref, disabledRef]);
const renderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(
() => Array.isArray(blocks) ? blocks : [blocks],
[blocks]
);
const children = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
ExperimentalBlockEditorProvider,
{
value: renderedBlocks,
settings,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_styles_default, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockListItems, { renderAppender: false, layout })
]
}
);
return {
...props,
ref,
className: dist_clsx(
props.className,
"block-editor-block-preview__live-content",
"components-disabled"
),
children: blocks?.length ? children : null
};
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/preview-panel.js
function InserterPreviewPanel({ item }) {
const { name, title, icon, description, initialAttributes, example } = item;
const isReusable = (0,external_wp_blocks_namespaceObject.isReusableBlock)(item);
const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!example) {
return (0,external_wp_blocks_namespaceObject.createBlock)(name, initialAttributes);
}
return (0,external_wp_blocks_namespaceObject.getBlockFromExample)(name, {
attributes: {
...example.attributes,
...initialAttributes
},
innerBlocks: example.innerBlocks
});
}, [name, example, initialAttributes]);
const previewHeight = 144;
const sidebarWidth = 280;
const viewportWidth = example?.viewportWidth ?? 500;
const scale = sidebarWidth / viewportWidth;
const minHeight = scale !== 0 && scale < 1 && previewHeight ? previewHeight / scale : previewHeight;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-inserter__preview-container", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__preview", children: isReusable || example ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__preview-content", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_preview_default,
{
blocks,
viewportWidth,
minHeight: previewHeight,
additionalStyles: (
//We want this CSS to be in sync with the one in BlockPreviewPanel.
[
{
css: `
body {
padding: 24px;
min-height:${Math.round(minHeight)}px;
display:flex;
align-items:center;
}
.is-root-container { width: 100%; }
`
}
]
)
}
) }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__preview-content-missing", children: (0,external_wp_i18n_namespaceObject.__)("No preview available.") }) }),
!isReusable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_card_default,
{
title,
icon,
description
}
)
] });
}
var preview_panel_default = InserterPreviewPanel;
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/item.js
function InserterListboxItem({ isFirst, as: Component, children, ...props }, ref) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite.Item,
{
ref,
role: "option",
accessibleWhenDisabled: true,
...props,
render: (htmlProps) => {
const propsWithTabIndex = {
...htmlProps,
tabIndex: isFirst ? 0 : htmlProps.tabIndex
};
if (Component) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { ...propsWithTabIndex, children });
}
if (typeof children === "function") {
return children(propsWithTabIndex);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, ...propsWithTabIndex, children });
}
}
);
}
var item_default = (0,external_wp_element_namespaceObject.forwardRef)(InserterListboxItem);
;// ./node_modules/@wordpress/icons/build-module/library/drag-handle.js
var drag_handle_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/draggable-chip.js
function BlockDraggableChip({
count,
icon,
isPattern,
fadeWhenDisabled
}) {
const patternLabel = isPattern && (0,external_wp_i18n_namespaceObject.__)("Pattern");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-draggable-chip-wrapper", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "block-editor-block-draggable-chip",
"data-testid": "block-draggable-chip",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Flex,
{
justify: "center",
className: "block-editor-block-draggable-chip__content",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: icon ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon_default, { icon }) : patternLabel || (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: Number of blocks. */
(0,external_wp_i18n_namespaceObject._n)("%d block", "%d blocks", count),
count
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon_default, { icon: drag_handle_default }) }),
fadeWhenDisabled && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { className: "block-editor-block-draggable-chip__disabled", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-block-draggable-chip__disabled-icon" }) })
]
}
)
}
) });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter-draggable-blocks/index.js
const InserterDraggableBlocks = ({
isEnabled,
blocks,
icon,
children,
pattern
}) => {
const blockTypeIcon = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockType } = select(external_wp_blocks_namespaceObject.store);
return blocks.length === 1 && getBlockType(blocks[0].name)?.icon;
},
[blocks]
);
const { startDragging, stopDragging } = unlock(
(0,external_wp_data_namespaceObject.useDispatch)(store)
);
const patternBlock = (0,external_wp_element_namespaceObject.useMemo)(() => {
return pattern?.type === INSERTER_PATTERN_TYPES.user && pattern?.syncStatus !== "unsynced" ? [(0,external_wp_blocks_namespaceObject.createBlock)("core/block", { ref: pattern.id })] : void 0;
}, [pattern?.type, pattern?.syncStatus, pattern?.id]);
if (!isEnabled) {
return children({
draggable: false,
onDragStart: void 0,
onDragEnd: void 0
});
}
const draggableBlocks = patternBlock ?? blocks;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Draggable,
{
__experimentalTransferDataType: "wp-blocks",
transferData: { type: "inserter", blocks: draggableBlocks },
onDragStart: (event) => {
startDragging();
for (const block of draggableBlocks) {
const type = `wp-block:${block.name}`;
event.dataTransfer.items.add("", type);
}
},
onDragEnd: () => {
stopDragging();
},
__experimentalDragComponent: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockDraggableChip,
{
count: blocks.length,
icon: icon || !pattern && blockTypeIcon,
isPattern: !!pattern
}
),
children: ({ onDraggableStart, onDraggableEnd }) => {
return children({
draggable: true,
onDragStart: onDraggableStart,
onDragEnd: onDraggableEnd
});
}
}
);
};
var inserter_draggable_blocks_default = InserterDraggableBlocks;
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter-list-item/index.js
function InserterListItem({
className,
isFirst,
item,
onSelect,
onHover,
isDraggable,
...props
}) {
const isDraggingRef = (0,external_wp_element_namespaceObject.useRef)(false);
const itemIconStyle = item.icon ? {
backgroundColor: item.icon.background,
color: item.icon.foreground
} : {};
const blocks = (0,external_wp_element_namespaceObject.useMemo)(
() => [
(0,external_wp_blocks_namespaceObject.createBlock)(
item.name,
item.initialAttributes,
(0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(item.innerBlocks)
)
],
[item.name, item.initialAttributes, item.innerBlocks]
);
const isSynced = (0,external_wp_blocks_namespaceObject.isReusableBlock)(item) && item.syncStatus !== "unsynced" || (0,external_wp_blocks_namespaceObject.isTemplatePart)(item);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inserter_draggable_blocks_default,
{
isEnabled: isDraggable && !item.isDisabled,
blocks,
icon: item.icon,
children: ({ draggable, onDragStart, onDragEnd }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx(
"block-editor-block-types-list__list-item",
{
"is-synced": isSynced
}
),
draggable,
onDragStart: (event) => {
isDraggingRef.current = true;
if (onDragStart) {
onHover(null);
onDragStart(event);
}
},
onDragEnd: (event) => {
isDraggingRef.current = false;
if (onDragEnd) {
onDragEnd(event);
}
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
item_default,
{
isFirst,
className: dist_clsx(
"block-editor-block-types-list__item",
className
),
disabled: item.isDisabled,
onClick: (event) => {
event.preventDefault();
onSelect(
item,
(0,external_wp_keycodes_namespaceObject.isAppleOS)() ? event.metaKey : event.ctrlKey
);
onHover(null);
},
onKeyDown: (event) => {
const { keyCode } = event;
if (keyCode === external_wp_keycodes_namespaceObject.ENTER) {
event.preventDefault();
onSelect(
item,
(0,external_wp_keycodes_namespaceObject.isAppleOS)() ? event.metaKey : event.ctrlKey
);
onHover(null);
}
},
onMouseEnter: () => {
if (isDraggingRef.current) {
return;
}
onHover(item);
},
onMouseLeave: () => onHover(null),
...props,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: "block-editor-block-types-list__item-icon",
style: itemIconStyle,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon_default, { icon: item.icon, showColors: true })
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-block-types-list__item-title", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { numberOfLines: 3, children: item.title }) })
]
}
)
}
)
}
);
}
var inserter_list_item_default = (0,external_wp_element_namespaceObject.memo)(InserterListItem);
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/group.js
function InserterListboxGroup(props, ref) {
const [shouldSpeak, setShouldSpeak] = (0,external_wp_element_namespaceObject.useState)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (shouldSpeak) {
(0,external_wp_a11y_namespaceObject.speak)(
(0,external_wp_i18n_namespaceObject.__)("Use left and right arrow keys to move through blocks")
);
}
}, [shouldSpeak]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
ref,
role: "listbox",
"aria-orientation": "horizontal",
onFocus: () => {
setShouldSpeak(true);
},
onBlur: (event) => {
const focusingOutsideGroup = !event.currentTarget.contains(
event.relatedTarget
);
if (focusingOutsideGroup) {
setShouldSpeak(false);
}
},
...props
}
);
}
var group_default = (0,external_wp_element_namespaceObject.forwardRef)(InserterListboxGroup);
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/row.js
function InserterListboxRow(props, ref) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.Group, { role: "presentation", ref, ...props });
}
var row_default = (0,external_wp_element_namespaceObject.forwardRef)(InserterListboxRow);
;// ./node_modules/@wordpress/block-editor/build-module/components/block-types-list/index.js
function chunk(array, size) {
const chunks = [];
for (let i = 0, j = array.length; i < j; i += size) {
chunks.push(array.slice(i, i + size));
}
return chunks;
}
function BlockTypesList({
items = [],
onSelect,
onHover = () => {
},
children,
label,
isDraggable = true
}) {
const className = "block-editor-block-types-list";
const listId = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockTypesList, className);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(group_default, { className, "aria-label": label, children: [
chunk(items, 3).map((row, i) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(row_default, { children: row.map((item, j) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inserter_list_item_default,
{
item,
className: (0,external_wp_blocks_namespaceObject.getBlockMenuDefaultClassName)(
item.id
),
onSelect,
onHover,
isDraggable: isDraggable && !item.isDisabled,
isFirst: i === 0 && j === 0,
rowId: `${listId}-${i}`
},
item.id
)) }, i)),
children
] });
}
var block_types_list_default = BlockTypesList;
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/panel.js
function InserterPanel({ title, icon, children }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-inserter__panel-header", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "block-editor-inserter__panel-title", children: title }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__panel-content", children })
] });
}
var panel_default = InserterPanel;
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-block-types-state.js
const useBlockTypesState = (rootClientId, onInsert, isQuick) => {
const options = (0,external_wp_element_namespaceObject.useMemo)(
() => ({ [isFiltered]: !!isQuick }),
[isQuick]
);
const [items] = (0,external_wp_data_namespaceObject.useSelect)(
(select) => [
select(store).getInserterItems(
rootClientId,
options
)
],
[rootClientId, options]
);
const { getClosestAllowedInsertionPoint } = unlock(
(0,external_wp_data_namespaceObject.useSelect)(store)
);
const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const [categories, collections] = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getCategories, getCollections } = select(external_wp_blocks_namespaceObject.store);
return [getCategories(), getCollections()];
}, []);
const onSelectItem = (0,external_wp_element_namespaceObject.useCallback)(
({ name, initialAttributes, innerBlocks, syncStatus, content }, shouldFocusBlock) => {
const destinationClientId = getClosestAllowedInsertionPoint(
name,
rootClientId
);
if (destinationClientId === null) {
const title = (0,external_wp_blocks_namespaceObject.getBlockType)(name)?.title ?? name;
createErrorNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: block pattern title. */
(0,external_wp_i18n_namespaceObject.__)(`Block "%s" can't be inserted.`),
title
),
{
type: "snackbar",
id: "inserter-notice"
}
);
return;
}
const insertedBlock = syncStatus === "unsynced" ? (0,external_wp_blocks_namespaceObject.parse)(content, {
__unstableSkipMigrationLogs: true
}) : (0,external_wp_blocks_namespaceObject.createBlock)(
name,
initialAttributes,
(0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocks)
);
onInsert(
insertedBlock,
void 0,
shouldFocusBlock,
destinationClientId
);
},
[
getClosestAllowedInsertionPoint,
rootClientId,
onInsert,
createErrorNotice
]
);
return [items, categories, collections, onSelectItem];
};
var use_block_types_state_default = useBlockTypesState;
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/index.js
function InserterListBoxWrapper({ key, children }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.Fragment, { children }, key);
}
function InserterListbox({ children }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite,
{
focusShift: true,
focusWrap: "horizontal",
render: InserterListBoxWrapper,
children
}
);
}
var inserter_listbox_default = InserterListbox;
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/no-results.js
function InserterNoResults() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__no-results", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)("No results found.") }) });
}
var no_results_default = InserterNoResults;
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-types-tab.js
const getBlockNamespace = (item) => item.name.split("/")[0];
const MAX_SUGGESTED_ITEMS = 6;
const block_types_tab_EMPTY_ARRAY = [];
function BlockTypesTabPanel({
items,
collections,
categories,
onSelectItem,
onHover,
showMostUsedBlocks,
className
}) {
const suggestedItems = (0,external_wp_element_namespaceObject.useMemo)(() => {
return orderBy(items, "frecency", "desc").slice(
0,
MAX_SUGGESTED_ITEMS
);
}, [items]);
const uncategorizedItems = (0,external_wp_element_namespaceObject.useMemo)(() => {
return items.filter((item) => !item.category);
}, [items]);
const itemsPerCollection = (0,external_wp_element_namespaceObject.useMemo)(() => {
const result = { ...collections };
Object.keys(collections).forEach((namespace) => {
result[namespace] = items.filter(
(item) => getBlockNamespace(item) === namespace
);
if (result[namespace].length === 0) {
delete result[namespace];
}
});
return result;
}, [items, collections]);
(0,external_wp_element_namespaceObject.useEffect)(() => () => onHover(null), []);
const currentlyRenderedCategories = (0,external_wp_compose_namespaceObject.useAsyncList)(categories);
const didRenderAllCategories = categories.length === currentlyRenderedCategories.length;
const collectionEntries = (0,external_wp_element_namespaceObject.useMemo)(() => {
return Object.entries(collections);
}, [collections]);
const currentlyRenderedCollections = (0,external_wp_compose_namespaceObject.useAsyncList)(
didRenderAllCategories ? collectionEntries : block_types_tab_EMPTY_ARRAY
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className, children: [
showMostUsedBlocks && // Only show the most used blocks if the total amount of block
// is larger than 1 row, otherwise it is not so useful.
items.length > 3 && !!suggestedItems.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(panel_default, { title: (0,external_wp_i18n_namespaceObject._x)("Most used", "blocks"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_types_list_default,
{
items: suggestedItems,
onSelect: onSelectItem,
onHover,
label: (0,external_wp_i18n_namespaceObject._x)("Most used", "blocks")
}
) }),
currentlyRenderedCategories.map((category) => {
const categoryItems = items.filter(
(item) => item.category === category.slug
);
if (!categoryItems || !categoryItems.length) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
panel_default,
{
title: category.title,
icon: category.icon,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_types_list_default,
{
items: categoryItems,
onSelect: onSelectItem,
onHover,
label: category.title
}
)
},
category.slug
);
}),
didRenderAllCategories && uncategorizedItems.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
panel_default,
{
className: "block-editor-inserter__uncategorized-blocks-panel",
title: (0,external_wp_i18n_namespaceObject.__)("Uncategorized"),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_types_list_default,
{
items: uncategorizedItems,
onSelect: onSelectItem,
onHover,
label: (0,external_wp_i18n_namespaceObject.__)("Uncategorized")
}
)
}
),
currentlyRenderedCollections.map(
([namespace, collection]) => {
const collectionItems = itemsPerCollection[namespace];
if (!collectionItems || !collectionItems.length) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
panel_default,
{
title: collection.title,
icon: collection.icon,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_types_list_default,
{
items: collectionItems,
onSelect: onSelectItem,
onHover,
label: collection.title
}
)
},
namespace
);
}
)
] });
}
function BlockTypesTab({ rootClientId, onInsert, onHover, showMostUsedBlocks }, ref) {
const [items, categories, collections, onSelectItem] = use_block_types_state_default(
rootClientId,
onInsert
);
if (!items.length) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(no_results_default, {});
}
const itemsForCurrentRoot = [];
const itemsRemaining = [];
for (const item of items) {
if (item.category === "reusable") {
continue;
}
if (item.isAllowedInCurrentRoot) {
itemsForCurrentRoot.push(item);
} else {
itemsRemaining.push(item);
}
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_listbox_default, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ref, children: [
!!itemsForCurrentRoot.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockTypesTabPanel,
{
items: itemsForCurrentRoot,
categories,
collections,
onSelectItem,
onHover,
showMostUsedBlocks,
className: "block-editor-inserter__insertable-blocks-at-selection"
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockTypesTabPanel,
{
items: itemsRemaining,
categories,
collections,
onSelectItem,
onHover,
showMostUsedBlocks,
className: "block-editor-inserter__all-blocks"
}
)
] }) });
}
var block_types_tab_default = (0,external_wp_element_namespaceObject.forwardRef)(BlockTypesTab);
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js
function PatternCategoriesList({
selectedCategory,
patternCategories,
onClickCategory
}) {
const baseClassName = "block-editor-block-patterns-explorer__sidebar";
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `${baseClassName}__categories-list`, children: patternCategories.map(({ name, label }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
label,
className: `${baseClassName}__categories-list__item`,
isPressed: selectedCategory === name,
onClick: () => {
onClickCategory(name);
},
children: label
},
name
);
}) });
}
function PatternsExplorerSearch({ searchValue, setSearchValue }) {
const baseClassName = "block-editor-block-patterns-explorer__search";
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: baseClassName, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SearchControl,
{
__nextHasNoMarginBottom: true,
onChange: setSearchValue,
value: searchValue,
label: (0,external_wp_i18n_namespaceObject.__)("Search"),
placeholder: (0,external_wp_i18n_namespaceObject.__)("Search")
}
) });
}
function PatternExplorerSidebar({
selectedCategory,
patternCategories,
onClickCategory,
searchValue,
setSearchValue
}) {
const baseClassName = "block-editor-block-patterns-explorer__sidebar";
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: baseClassName, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PatternsExplorerSearch,
{
searchValue,
setSearchValue
}
),
!searchValue && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PatternCategoriesList,
{
selectedCategory,
patternCategories,
onClickCategory
}
)
] });
}
var pattern_explorer_sidebar_default = PatternExplorerSidebar;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-patterns-paging/index.js
function Pagination({
currentPage,
numPages,
changePage,
totalItems
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { className: "block-editor-patterns__grid-pagination-wrapper", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { variant: "muted", children: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Total number of patterns.
(0,external_wp_i18n_namespaceObject._n)("%s item", "%s items", totalItems),
totalItems
) }),
numPages > 1 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
expanded: false,
spacing: 3,
justify: "flex-start",
className: "block-editor-patterns__grid-pagination",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
expanded: false,
spacing: 1,
className: "block-editor-patterns__grid-pagination-previous",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: "tertiary",
onClick: () => changePage(1),
disabled: currentPage === 1,
"aria-label": (0,external_wp_i18n_namespaceObject.__)("First page"),
size: "compact",
accessibleWhenDisabled: true,
className: "block-editor-patterns__grid-pagination-button",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: "\xAB" })
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: "tertiary",
onClick: () => changePage(currentPage - 1),
disabled: currentPage === 1,
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Previous page"),
size: "compact",
accessibleWhenDisabled: true,
className: "block-editor-patterns__grid-pagination-button",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: "\u2039" })
}
)
]
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { variant: "muted", children: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Current page number. 2: Total number of pages.
(0,external_wp_i18n_namespaceObject._x)("%1$s of %2$s", "paging"),
currentPage,
numPages
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
expanded: false,
spacing: 1,
className: "block-editor-patterns__grid-pagination-next",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: "tertiary",
onClick: () => changePage(currentPage + 1),
disabled: currentPage === numPages,
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Next page"),
size: "compact",
accessibleWhenDisabled: true,
className: "block-editor-patterns__grid-pagination-button",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: "\u203A" })
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: "tertiary",
onClick: () => changePage(numPages),
disabled: currentPage === numPages,
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Last page"),
size: "compact",
accessibleWhenDisabled: true,
className: "block-editor-patterns__grid-pagination-button",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: "\xBB" })
}
)
]
}
)
]
}
)
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-patterns-list/index.js
const WithToolTip = ({ showTooltip, title, children }) => {
if (showTooltip) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: title, children });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children });
};
function BlockPattern({
id,
isDraggable,
pattern,
onClick,
onHover,
showTitlesAsTooltip,
category,
isSelected
}) {
const [isDragging, setIsDragging] = (0,external_wp_element_namespaceObject.useState)(false);
const { blocks, viewportWidth } = pattern;
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockPattern);
const descriptionId = `block-editor-block-patterns-list__item-description-${instanceId}`;
const isUserPattern = pattern.type === INSERTER_PATTERN_TYPES.user;
const patternBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!category || !isDraggable) {
return blocks;
}
return (blocks ?? []).map((block) => {
const clonedBlock = (0,external_wp_blocks_namespaceObject.cloneBlock)(block);
if (clonedBlock.attributes.metadata?.categories?.includes(
category
)) {
clonedBlock.attributes.metadata.categories = [category];
}
return clonedBlock;
});
}, [blocks, isDraggable, category]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inserter_draggable_blocks_default,
{
isEnabled: isDraggable,
blocks: patternBlocks,
pattern,
children: ({ draggable, onDragStart, onDragEnd }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "block-editor-block-patterns-list__list-item",
draggable,
onDragStart: (event) => {
setIsDragging(true);
if (onDragStart) {
onHover?.(null);
onDragStart(event);
}
},
onDragEnd: (event) => {
setIsDragging(false);
if (onDragEnd) {
onDragEnd(event);
}
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
WithToolTip,
{
showTooltip: showTitlesAsTooltip && !isUserPattern,
title: pattern.title,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Composite.Item,
{
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
role: "option",
"aria-label": pattern.title,
"aria-describedby": pattern.description ? descriptionId : void 0,
className: dist_clsx(
"block-editor-block-patterns-list__item",
{
"block-editor-block-patterns-list__list-item-synced": pattern.type === INSERTER_PATTERN_TYPES.user && !pattern.syncStatus,
"is-selected": isSelected
}
)
}
),
id,
onClick: () => {
onClick(pattern, blocks);
onHover?.(null);
},
onMouseEnter: () => {
if (isDragging) {
return;
}
onHover?.(pattern);
},
onMouseLeave: () => onHover?.(null),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_preview_default.Async,
{
placeholder: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockPatternPlaceholder, {}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_preview_default,
{
blocks,
viewportWidth
}
)
}
),
(!showTitlesAsTooltip || isUserPattern) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
className: "block-editor-patterns__pattern-details",
spacing: 2,
children: [
isUserPattern && !pattern.syncStatus && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-patterns__pattern-icon-wrapper", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
icon_default,
{
className: "block-editor-patterns__pattern-icon",
icon: symbol_default
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-patterns-list__item-title", children: pattern.title })
]
}
),
!!pattern.description && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: descriptionId, children: pattern.description })
]
}
)
}
)
}
)
}
);
}
function BlockPatternPlaceholder() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-patterns-list__item is-placeholder" });
}
function BlockPatternsList({
isDraggable,
blockPatterns,
onHover,
onClickPattern,
orientation,
label = (0,external_wp_i18n_namespaceObject.__)("Block patterns"),
category,
showTitlesAsTooltip,
pagingProps
}, ref) {
const [activeCompositeId, setActiveCompositeId] = (0,external_wp_element_namespaceObject.useState)(void 0);
const [activePattern, setActivePattern] = (0,external_wp_element_namespaceObject.useState)(null);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const firstCompositeItemId = blockPatterns[0]?.name;
setActiveCompositeId(firstCompositeItemId);
}, [blockPatterns]);
const handleClickPattern = (pattern, blocks) => {
setActivePattern(pattern.name);
onClickPattern(pattern, blocks);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Composite,
{
orientation,
activeId: activeCompositeId,
setActiveId: setActiveCompositeId,
role: "listbox",
className: "block-editor-block-patterns-list",
"aria-label": label,
ref,
children: [
blockPatterns.map((pattern) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockPattern,
{
id: pattern.name,
pattern,
onClick: handleClickPattern,
onHover,
isDraggable,
showTitlesAsTooltip,
category,
isSelected: !!activePattern && activePattern === pattern.name
},
pattern.name
)),
pagingProps && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Pagination, { ...pagingProps })
]
}
);
}
var block_patterns_list_default = (0,external_wp_element_namespaceObject.forwardRef)(BlockPatternsList);
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-insertion-point.js
function getIndex({
destinationRootClientId,
destinationIndex,
rootClientId,
registry
}) {
if (rootClientId === destinationRootClientId) {
return destinationIndex;
}
const parents = [
"",
...registry.select(store).getBlockParents(destinationRootClientId),
destinationRootClientId
];
const parentIndex = parents.indexOf(rootClientId);
if (parentIndex !== -1) {
return registry.select(store).getBlockIndex(parents[parentIndex + 1]) + 1;
}
return registry.select(store).getBlockOrder(rootClientId).length;
}
function useInsertionPoint({
rootClientId = "",
insertionIndex,
clientId,
isAppender,
onSelect,
shouldFocusBlock = true,
selectBlockOnInsert = true
}) {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const {
getSelectedBlock,
getClosestAllowedInsertionPoint,
isBlockInsertionPointVisible
} = unlock((0,external_wp_data_namespaceObject.useSelect)(store));
const { destinationRootClientId, destinationIndex } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getSelectedBlockClientId,
getBlockRootClientId,
getBlockIndex,
getBlockOrder,
getInsertionPoint
} = unlock(select(store));
const selectedBlockClientId = getSelectedBlockClientId();
let _destinationRootClientId = rootClientId;
let _destinationIndex;
const insertionPoint = getInsertionPoint();
if (insertionIndex !== void 0) {
_destinationIndex = insertionIndex;
} else if (insertionPoint && insertionPoint.hasOwnProperty("index")) {
_destinationRootClientId = insertionPoint?.rootClientId ? insertionPoint.rootClientId : rootClientId;
_destinationIndex = insertionPoint.index;
} else if (clientId) {
_destinationIndex = getBlockIndex(clientId);
} else if (!isAppender && selectedBlockClientId) {
_destinationRootClientId = getBlockRootClientId(
selectedBlockClientId
);
_destinationIndex = getBlockIndex(selectedBlockClientId) + 1;
} else {
_destinationIndex = getBlockOrder(
_destinationRootClientId
).length;
}
return {
destinationRootClientId: _destinationRootClientId,
destinationIndex: _destinationIndex
};
},
[rootClientId, insertionIndex, clientId, isAppender]
);
const {
replaceBlocks,
insertBlocks,
showInsertionPoint,
hideInsertionPoint,
setLastFocus
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
const onInsertBlocks = (0,external_wp_element_namespaceObject.useCallback)(
(blocks, meta, shouldForceFocusBlock = false, _rootClientId) => {
if (shouldForceFocusBlock || shouldFocusBlock || selectBlockOnInsert) {
setLastFocus(null);
}
const selectedBlock = getSelectedBlock();
if (!isAppender && selectedBlock && (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(selectedBlock, "content")) {
replaceBlocks(
selectedBlock.clientId,
blocks,
null,
shouldFocusBlock || shouldForceFocusBlock ? 0 : null,
meta
);
} else {
insertBlocks(
blocks,
isAppender || _rootClientId === void 0 ? destinationIndex : getIndex({
destinationRootClientId,
destinationIndex,
rootClientId: _rootClientId,
registry
}),
isAppender || _rootClientId === void 0 ? destinationRootClientId : _rootClientId,
selectBlockOnInsert,
shouldFocusBlock || shouldForceFocusBlock ? 0 : null,
meta
);
}
const blockLength = Array.isArray(blocks) ? blocks.length : 1;
const message = (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %d: the name of the block that has been added
(0,external_wp_i18n_namespaceObject._n)("%d block added.", "%d blocks added.", blockLength),
blockLength
);
(0,external_wp_a11y_namespaceObject.speak)(message);
if (onSelect) {
onSelect(blocks);
}
},
[
isAppender,
getSelectedBlock,
replaceBlocks,
insertBlocks,
destinationRootClientId,
destinationIndex,
onSelect,
shouldFocusBlock,
selectBlockOnInsert
]
);
const onToggleInsertionPoint = (0,external_wp_element_namespaceObject.useCallback)(
(item) => {
if (item && !isBlockInsertionPointVisible()) {
const allowedDestinationRootClientId = getClosestAllowedInsertionPoint(
item.name,
destinationRootClientId
);
if (allowedDestinationRootClientId !== null) {
showInsertionPoint(
allowedDestinationRootClientId,
getIndex({
destinationRootClientId,
destinationIndex,
rootClientId: allowedDestinationRootClientId,
registry
})
);
}
} else {
hideInsertionPoint();
}
},
[
getClosestAllowedInsertionPoint,
isBlockInsertionPointVisible,
showInsertionPoint,
hideInsertionPoint,
destinationRootClientId,
destinationIndex
]
);
return [destinationRootClientId, onInsertBlocks, onToggleInsertionPoint];
}
var use_insertion_point_default = useInsertionPoint;
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-patterns-state.js
const usePatternsState = (onInsert, rootClientId, selectedCategory, isQuick) => {
const options = (0,external_wp_element_namespaceObject.useMemo)(
() => ({ [isFiltered]: !!isQuick }),
[isQuick]
);
const { patternCategories, patterns, userPatternCategories } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getSettings, __experimentalGetAllowedPatterns } = unlock(
select(store)
);
const {
__experimentalUserPatternCategories,
__experimentalBlockPatternCategories
} = getSettings();
return {
patterns: __experimentalGetAllowedPatterns(
rootClientId,
options
),
userPatternCategories: __experimentalUserPatternCategories,
patternCategories: __experimentalBlockPatternCategories
};
},
[rootClientId, options]
);
const { getClosestAllowedInsertionPointForPattern } = unlock(
(0,external_wp_data_namespaceObject.useSelect)(store)
);
const allCategories = (0,external_wp_element_namespaceObject.useMemo)(() => {
const categories = [...patternCategories];
userPatternCategories?.forEach((userCategory) => {
if (!categories.find(
(existingCategory) => existingCategory.name === userCategory.name
)) {
categories.push(userCategory);
}
});
return categories;
}, [patternCategories, userPatternCategories]);
const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const onClickPattern = (0,external_wp_element_namespaceObject.useCallback)(
(pattern, blocks) => {
const destinationRootClientId = isQuick ? rootClientId : getClosestAllowedInsertionPointForPattern(
pattern,
rootClientId
);
if (destinationRootClientId === null) {
return;
}
const patternBlocks = pattern.type === INSERTER_PATTERN_TYPES.user && pattern.syncStatus !== "unsynced" ? [(0,external_wp_blocks_namespaceObject.createBlock)("core/block", { ref: pattern.id })] : blocks;
onInsert(
(patternBlocks ?? []).map((block) => {
const clonedBlock = (0,external_wp_blocks_namespaceObject.cloneBlock)(block);
if (clonedBlock.attributes.metadata?.categories?.includes(
selectedCategory
)) {
clonedBlock.attributes.metadata.categories = [
selectedCategory
];
}
return clonedBlock;
}),
pattern.name,
false,
destinationRootClientId
);
createSuccessNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: block pattern title. */
(0,external_wp_i18n_namespaceObject.__)('Block pattern "%s" inserted.'),
pattern.title
),
{
type: "snackbar",
id: "inserter-notice"
}
);
},
[
createSuccessNotice,
onInsert,
selectedCategory,
rootClientId,
getClosestAllowedInsertionPointForPattern,
isQuick
]
);
return [patterns, allCategories, onClickPattern];
};
var use_patterns_state_default = usePatternsState;
// EXTERNAL MODULE: ./node_modules/remove-accents/index.js
var remove_accents = __webpack_require__(9681);
var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
;// ./node_modules/lower-case/dist.es2015/index.js
/**
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
*/
var SUPPORTED_LOCALE = {
tr: {
regexp: /\u0130|\u0049|\u0049\u0307/g,
map: {
İ: "\u0069",
I: "\u0131",
İ: "\u0069",
},
},
az: {
regexp: /\u0130/g,
map: {
İ: "\u0069",
I: "\u0131",
İ: "\u0069",
},
},
lt: {
regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
map: {
I: "\u0069\u0307",
J: "\u006A\u0307",
Į: "\u012F\u0307",
Ì: "\u0069\u0307\u0300",
Í: "\u0069\u0307\u0301",
Ĩ: "\u0069\u0307\u0303",
},
},
};
/**
* Localized lower case.
*/
function localeLowerCase(str, locale) {
var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
if (lang)
return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
return lowerCase(str);
}
/**
* Lower case as a function.
*/
function lowerCase(str) {
return str.toLowerCase();
}
;// ./node_modules/no-case/dist.es2015/index.js
// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
// Remove all non-word characters.
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
/**
* Normalize the string into something other libraries can manipulate easier.
*/
function noCase(input, options) {
if (options === void 0) { options = {}; }
var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
var result = dist_es2015_replace(dist_es2015_replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
var start = 0;
var end = result.length;
// Trim the delimiter from around the output string.
while (result.charAt(start) === "\0")
start++;
while (result.charAt(end - 1) === "\0")
end--;
// Transform each token independently.
return result.slice(start, end).split("\0").map(transform).join(delimiter);
}
/**
* Replace `re` in the input string with the replacement value.
*/
function dist_es2015_replace(input, re, value) {
if (re instanceof RegExp)
return input.replace(re, value);
return re.reduce(function (input, re) { return input.replace(re, value); }, input);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/search-items.js
const defaultGetName = (item) => item.name || "";
const defaultGetTitle = (item) => item.title;
const defaultGetDescription = (item) => item.description || "";
const defaultGetKeywords = (item) => item.keywords || [];
const defaultGetCategory = (item) => item.category;
const defaultGetCollection = () => null;
const splitRegexp = [
/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,
// One lowercase or digit, followed by one uppercase.
/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu
// One uppercase followed by one uppercase and one lowercase.
];
const stripRegexp = new RegExp("(\\p{C}|\\p{P}|\\p{S})+", "giu");
const extractedWords = /* @__PURE__ */ new Map();
const normalizedStrings = /* @__PURE__ */ new Map();
function extractWords(input = "") {
if (extractedWords.has(input)) {
return extractedWords.get(input);
}
const result = noCase(input, {
splitRegexp,
stripRegexp
}).split(" ").filter(Boolean);
extractedWords.set(input, result);
return result;
}
function normalizeString(input = "") {
if (normalizedStrings.has(input)) {
return normalizedStrings.get(input);
}
let result = remove_accents_default()(input);
result = result.replace(/^\//, "");
result = result.toLowerCase();
normalizedStrings.set(input, result);
return result;
}
const getNormalizedSearchTerms = (input = "") => {
return extractWords(normalizeString(input));
};
const removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => {
return unmatchedTerms.filter(
(term) => !getNormalizedSearchTerms(unprocessedTerms).some(
(unprocessedTerm) => unprocessedTerm.includes(term)
)
);
};
const searchBlockItems = (items, categories, collections, searchInput) => {
const normalizedSearchTerms = getNormalizedSearchTerms(searchInput);
if (normalizedSearchTerms.length === 0) {
return items;
}
const config = {
getCategory: (item) => categories.find(({ slug }) => slug === item.category)?.title,
getCollection: (item) => collections[item.name.split("/")[0]]?.title
};
return searchItems(items, searchInput, config);
};
const searchItems = (items = [], searchInput = "", config = {}) => {
const normalizedSearchTerms = getNormalizedSearchTerms(searchInput);
if (normalizedSearchTerms.length === 0) {
return items;
}
const rankedItems = items.map((item) => {
return [item, getItemSearchRank(item, searchInput, config)];
}).filter(([, rank]) => rank > 0);
rankedItems.sort(([, rank1], [, rank2]) => rank2 - rank1);
return rankedItems.map(([item]) => item);
};
function getItemSearchRank(item, searchTerm, config = {}) {
const {
getName = defaultGetName,
getTitle = defaultGetTitle,
getDescription = defaultGetDescription,
getKeywords = defaultGetKeywords,
getCategory = defaultGetCategory,
getCollection = defaultGetCollection
} = config;
const name = getName(item);
const title = getTitle(item);
const description = getDescription(item);
const keywords = getKeywords(item);
const category = getCategory(item);
const collection = getCollection(item);
const normalizedSearchInput = normalizeString(searchTerm);
const normalizedTitle = normalizeString(title);
let rank = 0;
if (normalizedSearchInput === normalizedTitle) {
rank += 30;
} else if (normalizedTitle.startsWith(normalizedSearchInput)) {
rank += 20;
} else {
const terms = [
name,
title,
description,
...keywords,
category,
collection
].join(" ");
const normalizedSearchTerms = extractWords(normalizedSearchInput);
const unmatchedTerms = removeMatchingTerms(
normalizedSearchTerms,
terms
);
if (unmatchedTerms.length === 0) {
rank += 10;
}
}
if (rank !== 0 && name.startsWith("core/")) {
const isCoreBlockVariation = name !== item.id;
rank += isCoreBlockVariation ? 1 : 2;
}
return rank;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-patterns-paging.js
const PAGE_SIZE = 20;
function usePatternsPaging(currentCategoryPatterns, currentCategory, scrollContainerRef, currentFilter = "") {
const [currentPage, setCurrentPage] = (0,external_wp_element_namespaceObject.useState)(1);
const previousCategory = (0,external_wp_compose_namespaceObject.usePrevious)(currentCategory);
const previousFilter = (0,external_wp_compose_namespaceObject.usePrevious)(currentFilter);
if ((previousCategory !== currentCategory || previousFilter !== currentFilter) && currentPage !== 1) {
setCurrentPage(1);
}
const totalItems = currentCategoryPatterns.length;
const pageIndex = currentPage - 1;
const categoryPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => {
return currentCategoryPatterns.slice(
pageIndex * PAGE_SIZE,
pageIndex * PAGE_SIZE + PAGE_SIZE
);
}, [pageIndex, currentCategoryPatterns]);
const numPages = Math.ceil(currentCategoryPatterns.length / PAGE_SIZE);
const changePage = (page) => {
const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(
scrollContainerRef?.current
);
scrollContainer?.scrollTo(0, 0);
setCurrentPage(page);
};
(0,external_wp_element_namespaceObject.useEffect)(
function scrollToTopOnCategoryChange() {
const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(
scrollContainerRef?.current
);
scrollContainer?.scrollTo(0, 0);
},
[currentCategory, scrollContainerRef]
);
return {
totalItems,
categoryPatterns,
numPages,
changePage,
currentPage
};
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-explorer/pattern-list.js
function PatternsListHeader({ filterValue, filteredBlockPatternsLength }) {
if (!filterValue) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHeading,
{
level: 2,
lineHeight: "48px",
className: "block-editor-block-patterns-explorer__search-results-count",
children: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: number of patterns. */
(0,external_wp_i18n_namespaceObject._n)(
"%d pattern found",
"%d patterns found",
filteredBlockPatternsLength
),
filteredBlockPatternsLength
)
}
);
}
function PatternList({
searchValue,
selectedCategory,
patternCategories,
rootClientId,
onModalClose
}) {
const container = (0,external_wp_element_namespaceObject.useRef)();
const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500);
const [destinationRootClientId, onInsertBlocks] = use_insertion_point_default({
rootClientId,
shouldFocusBlock: true
});
const [patterns, , onClickPattern] = use_patterns_state_default(
onInsertBlocks,
destinationRootClientId,
selectedCategory
);
const registeredPatternCategories = (0,external_wp_element_namespaceObject.useMemo)(
() => patternCategories.map(
(patternCategory) => patternCategory.name
),
[patternCategories]
);
const filteredBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => {
const filteredPatterns = patterns.filter((pattern) => {
if (selectedCategory === allPatternsCategory.name) {
return true;
}
if (selectedCategory === myPatternsCategory.name && pattern.type === INSERTER_PATTERN_TYPES.user) {
return true;
}
if (selectedCategory === starterPatternsCategory.name && pattern.blockTypes?.includes("core/post-content")) {
return true;
}
if (selectedCategory === "uncategorized") {
const hasKnownCategory = pattern.categories?.some(
(category) => registeredPatternCategories.includes(category)
) ?? false;
return !pattern.categories?.length || !hasKnownCategory;
}
return pattern.categories?.includes(selectedCategory);
});
if (!searchValue) {
return filteredPatterns;
}
return searchItems(filteredPatterns, searchValue);
}, [
searchValue,
patterns,
selectedCategory,
registeredPatternCategories
]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!searchValue) {
return;
}
const count = filteredBlockPatterns.length;
const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: number of results. */
(0,external_wp_i18n_namespaceObject._n)("%d result found.", "%d results found.", count),
count
);
debouncedSpeak(resultsFoundMessage);
}, [searchValue, debouncedSpeak, filteredBlockPatterns.length]);
const pagingProps = usePatternsPaging(
filteredBlockPatterns,
selectedCategory,
container
);
const [previousSearchValue, setPreviousSearchValue] = (0,external_wp_element_namespaceObject.useState)(searchValue);
if (searchValue !== previousSearchValue) {
setPreviousSearchValue(searchValue);
pagingProps.changePage(1);
}
const hasItems = !!filteredBlockPatterns?.length;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
className: "block-editor-block-patterns-explorer__list",
ref: container,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PatternsListHeader,
{
filterValue: searchValue,
filteredBlockPatternsLength: filteredBlockPatterns.length
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_listbox_default, { children: hasItems && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_patterns_list_default,
{
blockPatterns: pagingProps.categoryPatterns,
onClickPattern: (pattern, blocks) => {
onClickPattern(pattern, blocks);
onModalClose();
},
isDraggable: false
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Pagination, { ...pagingProps })
] }) })
]
}
);
}
var pattern_list_default = PatternList;
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js
function hasRegisteredCategory(pattern, allCategories) {
if (!pattern.categories || !pattern.categories.length) {
return false;
}
return pattern.categories.some(
(cat) => allCategories.some((category) => category.name === cat)
);
}
function usePatternCategories(rootClientId, sourceFilter = "all") {
const [patterns, allCategories] = use_patterns_state_default(
void 0,
rootClientId
);
const filteredPatterns = (0,external_wp_element_namespaceObject.useMemo)(
() => sourceFilter === "all" ? patterns : patterns.filter(
(pattern) => !isPatternFiltered(pattern, sourceFilter)
),
[sourceFilter, patterns]
);
const populatedCategories = (0,external_wp_element_namespaceObject.useMemo)(() => {
const categories = allCategories.filter(
(category) => filteredPatterns.some(
(pattern) => pattern.categories?.includes(category.name)
)
).sort((a, b) => a.label.localeCompare(b.label));
if (filteredPatterns.some(
(pattern) => !hasRegisteredCategory(pattern, allCategories)
) && !categories.find(
(category) => category.name === "uncategorized"
)) {
categories.push({
name: "uncategorized",
label: (0,external_wp_i18n_namespaceObject._x)("Uncategorized")
});
}
if (filteredPatterns.some(
(pattern) => pattern.blockTypes?.includes("core/post-content")
)) {
categories.unshift(starterPatternsCategory);
}
if (filteredPatterns.some(
(pattern) => pattern.type === INSERTER_PATTERN_TYPES.user
)) {
categories.unshift(myPatternsCategory);
}
if (filteredPatterns.length > 0) {
categories.unshift({
name: allPatternsCategory.name,
label: allPatternsCategory.label
});
}
(0,external_wp_a11y_namespaceObject.speak)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: number of categories . */
(0,external_wp_i18n_namespaceObject._n)(
"%d category button displayed.",
"%d category buttons displayed.",
categories.length
),
categories.length
)
);
return categories;
}, [allCategories, filteredPatterns]);
return populatedCategories;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-explorer/index.js
function PatternsExplorer({ initialCategory, rootClientId, onModalClose }) {
const [searchValue, setSearchValue] = (0,external_wp_element_namespaceObject.useState)("");
const [selectedCategory, setSelectedCategory] = (0,external_wp_element_namespaceObject.useState)(
initialCategory?.name
);
const patternCategories = usePatternCategories(rootClientId);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-patterns-explorer", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
pattern_explorer_sidebar_default,
{
selectedCategory,
patternCategories,
onClickCategory: setSelectedCategory,
searchValue,
setSearchValue
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
pattern_list_default,
{
searchValue,
selectedCategory,
patternCategories,
rootClientId,
onModalClose
}
)
] });
}
function PatternsExplorerModal({ onModalClose, ...restProps }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
title: (0,external_wp_i18n_namespaceObject.__)("Patterns"),
onRequestClose: onModalClose,
isFullScreen: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsExplorer, { onModalClose, ...restProps })
}
);
}
var block_patterns_explorer_default = PatternsExplorerModal;
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/mobile-tab-navigation.js
function ScreenHeader({ title }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 0, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalView, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginBottom: 0, paddingX: 4, paddingY: 3, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 2, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Navigator.BackButton,
{
style: (
// TODO: This style override is also used in ToolsPanelHeader.
// It should be supported out-of-the-box by Button.
{ minWidth: 24, padding: 0 }
),
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right_default : chevron_left_default,
size: "small",
label: (0,external_wp_i18n_namespaceObject.__)("Back")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { level: 5, children: title }) })
] }) }) }) });
}
function MobileTabNavigation({ categories, children }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Navigator,
{
initialPath: "/",
className: "block-editor-inserter__mobile-tab-navigation",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.Screen, { path: "/", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { children: categories.map((category) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Navigator.Button,
{
path: `/category/${category.name}`,
as: external_wp_components_namespaceObject.__experimentalItem,
isAction: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { children: category.label }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
icon_default,
{
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_default : chevron_right_default
}
)
] })
},
category.name
)) }) }),
categories.map((category) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Navigator.Screen,
{
path: `/category/${category.name}`,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ScreenHeader, { title: (0,external_wp_i18n_namespaceObject.__)("Back") }),
children(category)
]
},
category.name
))
]
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-tab/patterns-filter.js
const getShouldDisableSyncFilter = (sourceFilter) => sourceFilter !== "all" && sourceFilter !== "user";
const getShouldHideSourcesFilter = (category) => {
return category.name === myPatternsCategory.name;
};
const PATTERN_SOURCE_MENU_OPTIONS = [
{
value: "all",
label: (0,external_wp_i18n_namespaceObject._x)("All", "patterns")
},
{
value: INSERTER_PATTERN_TYPES.directory,
label: (0,external_wp_i18n_namespaceObject.__)("Pattern Directory")
},
{
value: INSERTER_PATTERN_TYPES.theme,
label: (0,external_wp_i18n_namespaceObject.__)("Theme & Plugins")
},
{
value: INSERTER_PATTERN_TYPES.user,
label: (0,external_wp_i18n_namespaceObject.__)("User")
}
];
function PatternsFilter({
setPatternSyncFilter,
setPatternSourceFilter,
patternSyncFilter,
patternSourceFilter,
scrollContainerRef,
category
}) {
const currentPatternSourceFilter = category.name === myPatternsCategory.name ? INSERTER_PATTERN_TYPES.user : patternSourceFilter;
const shouldDisableSyncFilter = getShouldDisableSyncFilter(
currentPatternSourceFilter
);
const shouldHideSourcesFilter = getShouldHideSourcesFilter(category);
const patternSyncMenuOptions = (0,external_wp_element_namespaceObject.useMemo)(
() => [
{
value: "all",
label: (0,external_wp_i18n_namespaceObject._x)("All", "patterns")
},
{
value: INSERTER_SYNC_TYPES.full,
label: (0,external_wp_i18n_namespaceObject._x)("Synced", "patterns"),
disabled: shouldDisableSyncFilter
},
{
value: INSERTER_SYNC_TYPES.unsynced,
label: (0,external_wp_i18n_namespaceObject._x)("Not synced", "patterns"),
disabled: shouldDisableSyncFilter
}
],
[shouldDisableSyncFilter]
);
function handleSetSourceFilterChange(newSourceFilter) {
setPatternSourceFilter(newSourceFilter);
if (getShouldDisableSyncFilter(newSourceFilter)) {
setPatternSyncFilter("all");
}
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropdownMenu,
{
popoverProps: {
placement: "right-end"
},
label: (0,external_wp_i18n_namespaceObject.__)("Filter patterns"),
toggleProps: { size: "compact" },
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
icon_default,
{
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SVG,
{
width: "24",
height: "24",
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Path,
{
d: "M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",
fill: "currentColor"
}
)
}
)
}
),
children: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
!shouldHideSourcesFilter && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)("Source"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItemsChoice,
{
choices: PATTERN_SOURCE_MENU_OPTIONS,
onSelect: (value) => {
handleSetSourceFilterChange(value);
scrollContainerRef.current?.scrollTo(
0,
0
);
},
value: currentPatternSourceFilter
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)("Type"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItemsChoice,
{
choices: patternSyncMenuOptions,
onSelect: (value) => {
setPatternSyncFilter(value);
scrollContainerRef.current?.scrollTo(
0,
0
);
},
value: patternSyncFilter
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__patterns-filter-help", children: (0,external_wp_element_namespaceObject.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.__)(
"Patterns are available from the <Link>WordPress.org Pattern Directory</Link>, bundled in the active theme, or created by users on this site. Only patterns created on this site can be synced."
),
{
Link: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ExternalLink,
{
href: (0,external_wp_i18n_namespaceObject.__)(
"https://wordpress.org/patterns/"
)
}
)
}
) })
] })
}
) });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js
const pattern_category_previews_noop = () => {
};
function PatternCategoryPreviews({
rootClientId,
onInsert,
onHover = pattern_category_previews_noop,
category,
showTitlesAsTooltip
}) {
const [allPatterns, , onClickPattern] = use_patterns_state_default(
onInsert,
rootClientId,
category?.name
);
const [patternSyncFilter, setPatternSyncFilter] = (0,external_wp_element_namespaceObject.useState)("all");
const [patternSourceFilter, setPatternSourceFilter] = (0,external_wp_element_namespaceObject.useState)("all");
const availableCategories = usePatternCategories(
rootClientId,
patternSourceFilter
);
const scrollContainerRef = (0,external_wp_element_namespaceObject.useRef)();
const currentCategoryPatterns = (0,external_wp_element_namespaceObject.useMemo)(
() => allPatterns.filter((pattern) => {
if (isPatternFiltered(
pattern,
patternSourceFilter,
patternSyncFilter
)) {
return false;
}
if (category.name === allPatternsCategory.name) {
return true;
}
if (category.name === myPatternsCategory.name && pattern.type === INSERTER_PATTERN_TYPES.user) {
return true;
}
if (category.name === starterPatternsCategory.name && pattern.blockTypes?.includes("core/post-content")) {
return true;
}
if (category.name === "uncategorized") {
if (!pattern.categories) {
return true;
}
return !pattern.categories.some(
(catName) => availableCategories.some((c) => c.name === catName)
);
}
return pattern.categories?.includes(category.name);
}),
[
allPatterns,
availableCategories,
category.name,
patternSourceFilter,
patternSyncFilter
]
);
const pagingProps = usePatternsPaging(
currentCategoryPatterns,
category,
scrollContainerRef
);
const { changePage } = pagingProps;
(0,external_wp_element_namespaceObject.useEffect)(() => () => onHover(null), []);
const onSetPatternSyncFilter = (0,external_wp_element_namespaceObject.useCallback)(
(value) => {
setPatternSyncFilter(value);
changePage(1);
},
[setPatternSyncFilter, changePage]
);
const onSetPatternSourceFilter = (0,external_wp_element_namespaceObject.useCallback)(
(value) => {
setPatternSourceFilter(value);
changePage(1);
},
[setPatternSourceFilter, changePage]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
spacing: 2,
className: "block-editor-inserter__patterns-category-panel-header",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHeading,
{
className: "block-editor-inserter__patterns-category-panel-title",
size: 13,
level: 4,
as: "div",
children: category.label
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PatternsFilter,
{
patternSyncFilter,
patternSourceFilter,
setPatternSyncFilter: onSetPatternSyncFilter,
setPatternSourceFilter: onSetPatternSourceFilter,
scrollContainerRef,
category
}
)
] }),
!currentCategoryPatterns.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalText,
{
variant: "muted",
className: "block-editor-inserter__patterns-category-no-results",
children: (0,external_wp_i18n_namespaceObject.__)("No results found")
}
)
]
}
),
currentCategoryPatterns.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalText,
{
size: "12",
as: "p",
className: "block-editor-inserter__help-text",
children: (0,external_wp_i18n_namespaceObject.__)("Drag and drop patterns into the canvas.")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_patterns_list_default,
{
ref: scrollContainerRef,
blockPatterns: pagingProps.categoryPatterns,
onClickPattern,
onHover,
label: category.label,
orientation: "vertical",
category: category.name,
isDraggable: true,
showTitlesAsTooltip,
patternFilter: patternSourceFilter,
pagingProps
}
)
] })
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/category-tabs/index.js
const { Tabs: category_tabs_Tabs } = unlock(external_wp_components_namespaceObject.privateApis);
function CategoryTabs({
categories,
selectedCategory,
onSelectCategory,
children
}) {
const ANIMATION_DURATION = 0.25;
const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
const defaultTransition = {
type: "tween",
duration: disableMotion ? 0 : ANIMATION_DURATION,
ease: [0.6, 0, 0.4, 1]
};
const previousSelectedCategory = (0,external_wp_compose_namespaceObject.usePrevious)(selectedCategory);
const selectedTabId = selectedCategory ? selectedCategory.name : null;
const [activeTabId, setActiveId] = (0,external_wp_element_namespaceObject.useState)();
const firstTabId = categories?.[0]?.name;
if (selectedTabId === null && !activeTabId && firstTabId) {
setActiveId(firstTabId);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
category_tabs_Tabs,
{
selectOnMove: false,
selectedTabId,
orientation: "vertical",
onSelect: (categoryId) => {
onSelectCategory(
categories.find(
(category) => category.name === categoryId
)
);
},
activeTabId,
onActiveTabIdChange: setActiveId,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(category_tabs_Tabs.TabList, { className: "block-editor-inserter__category-tablist", children: categories.map((category) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
category_tabs_Tabs.Tab,
{
tabId: category.name,
"aria-current": category === selectedCategory ? "true" : void 0,
children: category.label
},
category.name
)) }),
categories.map((category) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
category_tabs_Tabs.TabPanel,
{
tabId: category.name,
focusable: false,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
className: "block-editor-inserter__category-panel",
initial: !previousSelectedCategory ? "closed" : "open",
animate: "open",
variants: {
open: {
transform: "translateX( 0 )",
transitionEnd: {
zIndex: "1"
}
},
closed: {
transform: "translateX( -100% )",
zIndex: "-1"
}
},
transition: defaultTransition,
children
}
)
},
category.name
))
]
}
);
}
var category_tabs_default = CategoryTabs;
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-tab/index.js
function BlockPatternsTab({
onSelectCategory,
selectedCategory,
onInsert,
rootClientId,
children
}) {
const [showPatternsExplorer, setShowPatternsExplorer] = (0,external_wp_element_namespaceObject.useState)(false);
const categories = usePatternCategories(rootClientId);
const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
if (!categories.length) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(no_results_default, {});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
!isMobile && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-inserter__block-patterns-tabs-container", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
category_tabs_default,
{
categories,
selectedCategory,
onSelectCategory,
children
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
className: "block-editor-inserter__patterns-explore-button",
onClick: () => setShowPatternsExplorer(true),
variant: "secondary",
children: (0,external_wp_i18n_namespaceObject.__)("Explore all patterns")
}
)
] }),
isMobile && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MobileTabNavigation, { categories, children: (category) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__category-panel", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PatternCategoryPreviews,
{
onInsert,
rootClientId,
category
},
category.name
) }) }),
showPatternsExplorer && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_patterns_explorer_default,
{
initialCategory: selectedCategory || categories[0],
patternCategories: categories,
onModalClose: () => setShowPatternsExplorer(false),
rootClientId
}
)
] });
}
var block_patterns_tab_default = BlockPatternsTab;
;// ./node_modules/@wordpress/icons/build-module/library/external.js
var external_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/media-tab/utils.js
const mediaTypeTag = { image: "img", video: "video", audio: "audio" };
function getBlockAndPreviewFromMedia(media, mediaType) {
const attributes = {
id: media.id || void 0,
caption: media.caption || void 0
};
const mediaSrc = media.url;
const alt = media.alt || void 0;
if (mediaType === "image") {
attributes.url = mediaSrc;
attributes.alt = alt;
} else if (["video", "audio"].includes(mediaType)) {
attributes.src = mediaSrc;
}
const PreviewTag = mediaTypeTag[mediaType];
const preview = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PreviewTag,
{
src: media.previewUrl || mediaSrc,
alt,
controls: mediaType === "audio" ? true : void 0,
inert: "true",
onError: ({ currentTarget }) => {
if (currentTarget.src === media.previewUrl) {
currentTarget.src = mediaSrc;
}
}
}
);
return [(0,external_wp_blocks_namespaceObject.createBlock)(`core/${mediaType}`, attributes), preview];
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/media-tab/media-preview.js
const ALLOWED_MEDIA_TYPES = ["image"];
const MEDIA_OPTIONS_POPOVER_PROPS = {
placement: "bottom-end",
className: "block-editor-inserter__media-list__item-preview-options__popover"
};
function MediaPreviewOptions({ category, media }) {
if (!category.getReportUrl) {
return null;
}
const reportUrl = category.getReportUrl(media);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropdownMenu,
{
className: "block-editor-inserter__media-list__item-preview-options",
label: (0,external_wp_i18n_namespaceObject.__)("Options"),
popoverProps: MEDIA_OPTIONS_POPOVER_PROPS,
icon: more_vertical_default,
children: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: () => window.open(reportUrl, "_blank").focus(),
icon: external_default,
children: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: The media type to report e.g: "image", "video", "audio" */
(0,external_wp_i18n_namespaceObject.__)("Report %s"),
category.mediaType
)
}
) })
}
);
}
function InsertExternalImageModal({ onClose, onSubmit }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Modal,
{
title: (0,external_wp_i18n_namespaceObject.__)("Insert external image"),
onRequestClose: onClose,
className: "block-editor-inserter-media-tab-media-preview-inserter-external-image-modal",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)(
"This image cannot be uploaded to your Media Library, but it can still be inserted as an external image."
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)(
"External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation."
) })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Flex,
{
className: "block-editor-block-lock-modal__actions",
justify: "flex-end",
expanded: false,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: onClose,
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "primary",
onClick: onSubmit,
children: (0,external_wp_i18n_namespaceObject.__)("Insert")
}
) })
]
}
)
]
}
);
}
function MediaPreview({ media, onClick, category }) {
const [showExternalUploadModal, setShowExternalUploadModal] = (0,external_wp_element_namespaceObject.useState)(false);
const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false);
const [isInserting, setIsInserting] = (0,external_wp_element_namespaceObject.useState)(false);
const [block, preview] = (0,external_wp_element_namespaceObject.useMemo)(
() => getBlockAndPreviewFromMedia(media, category.mediaType),
[media, category.mediaType]
);
const { createErrorNotice, createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const { getSettings, getBlock } = (0,external_wp_data_namespaceObject.useSelect)(store);
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const onMediaInsert = (0,external_wp_element_namespaceObject.useCallback)(
(previewBlock) => {
if (isInserting) {
return;
}
const settings = getSettings();
const clonedBlock = (0,external_wp_blocks_namespaceObject.cloneBlock)(previewBlock);
const { id, url, caption } = clonedBlock.attributes;
if (!id && !settings.mediaUpload) {
setShowExternalUploadModal(true);
return;
}
if (!!id) {
onClick(clonedBlock);
return;
}
setIsInserting(true);
window.fetch(url).then((response) => response.blob()).then((blob) => {
const fileName = (0,external_wp_url_namespaceObject.getFilename)(url) || "image.jpg";
const file = new File([blob], fileName, {
type: blob.type
});
settings.mediaUpload({
filesList: [file],
additionalData: { caption },
onFileChange([img]) {
if ((0,external_wp_blob_namespaceObject.isBlobURL)(img.url)) {
return;
}
if (!getBlock(clonedBlock.clientId)) {
onClick({
...clonedBlock,
attributes: {
...clonedBlock.attributes,
id: img.id,
url: img.url
}
});
createSuccessNotice(
(0,external_wp_i18n_namespaceObject.__)("Image uploaded and inserted."),
{ type: "snackbar", id: "inserter-notice" }
);
} else {
updateBlockAttributes(clonedBlock.clientId, {
...clonedBlock.attributes,
id: img.id,
url: img.url
});
}
setIsInserting(false);
},
allowedTypes: ALLOWED_MEDIA_TYPES,
onError(message) {
createErrorNotice(message, {
type: "snackbar",
id: "inserter-notice"
});
setIsInserting(false);
}
});
}).catch(() => {
setShowExternalUploadModal(true);
setIsInserting(false);
});
},
[
isInserting,
getSettings,
onClick,
createSuccessNotice,
updateBlockAttributes,
createErrorNotice,
getBlock
]
);
const title = typeof media.title === "string" ? media.title : media.title?.rendered || (0,external_wp_i18n_namespaceObject.__)("no title");
const onMouseEnter = (0,external_wp_element_namespaceObject.useCallback)(() => setIsHovered(true), []);
const onMouseLeave = (0,external_wp_element_namespaceObject.useCallback)(() => setIsHovered(false), []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_draggable_blocks_default, { isEnabled: true, blocks: [block], children: ({ draggable, onDragStart, onDragEnd }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx(
"block-editor-inserter__media-list__list-item",
{
"is-hovered": isHovered
}
),
draggable,
onDragStart,
onDragEnd,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
onMouseEnter,
onMouseLeave,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: title, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite.Item,
{
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
"aria-label": title,
role: "option",
className: "block-editor-inserter__media-list__item"
}
),
onClick: () => onMediaInsert(block),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-inserter__media-list__item-preview", children: [
preview,
isInserting && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__media-list__item-preview-spinner", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) })
] })
}
) }),
!isInserting && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
MediaPreviewOptions,
{
category,
media
}
)
]
}
)
}
) }),
showExternalUploadModal && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
InsertExternalImageModal,
{
onClose: () => setShowExternalUploadModal(false),
onSubmit: () => {
onClick((0,external_wp_blocks_namespaceObject.cloneBlock)(block));
createSuccessNotice((0,external_wp_i18n_namespaceObject.__)("Image inserted."), {
type: "snackbar",
id: "inserter-notice"
});
setShowExternalUploadModal(false);
}
}
)
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/media-tab/media-list.js
function MediaList({
mediaList,
category,
onClick,
label = (0,external_wp_i18n_namespaceObject.__)("Media List")
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite,
{
role: "listbox",
className: "block-editor-inserter__media-list",
"aria-label": label,
children: mediaList.map((media, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
MediaPreview,
{
media,
category,
onClick
},
media.id || media.sourceId || index
))
}
);
}
var media_list_default = MediaList;
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/media-tab/hooks.js
function useMediaResults(category, query = {}) {
const [mediaList, setMediaList] = (0,external_wp_element_namespaceObject.useState)();
const [isLoading, setIsLoading] = (0,external_wp_element_namespaceObject.useState)(false);
const lastRequestRef = (0,external_wp_element_namespaceObject.useRef)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
(async () => {
const key = JSON.stringify({
category: category.name,
...query
});
lastRequestRef.current = key;
setIsLoading(true);
setMediaList([]);
const _media = await category.fetch?.(query);
if (key === lastRequestRef.current) {
setMediaList(_media);
setIsLoading(false);
}
})();
}, [category.name, ...Object.values(query)]);
return { mediaList, isLoading };
}
function useMediaCategories(rootClientId) {
const [categories, setCategories] = (0,external_wp_element_namespaceObject.useState)([]);
const inserterMediaCategories = (0,external_wp_data_namespaceObject.useSelect)(
(select) => unlock(select(store)).getInserterMediaCategories(),
[]
);
const { canInsertImage, canInsertVideo, canInsertAudio } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { canInsertBlockType } = select(store);
return {
canInsertImage: canInsertBlockType(
"core/image",
rootClientId
),
canInsertVideo: canInsertBlockType(
"core/video",
rootClientId
),
canInsertAudio: canInsertBlockType(
"core/audio",
rootClientId
)
};
},
[rootClientId]
);
(0,external_wp_element_namespaceObject.useEffect)(() => {
(async () => {
const _categories = [];
if (!inserterMediaCategories) {
return;
}
const categoriesHaveMedia = new Map(
await Promise.all(
inserterMediaCategories.map(async (category) => {
if (category.isExternalResource) {
return [category.name, true];
}
let results = [];
try {
results = await category.fetch({
per_page: 1
});
} catch (e) {
}
return [category.name, !!results.length];
})
)
);
const canInsertMediaType = {
image: canInsertImage,
video: canInsertVideo,
audio: canInsertAudio
};
inserterMediaCategories.forEach((category) => {
if (canInsertMediaType[category.mediaType] && categoriesHaveMedia.get(category.name)) {
_categories.push(category);
}
});
if (!!_categories.length) {
setCategories(_categories);
}
})();
}, [
canInsertImage,
canInsertVideo,
canInsertAudio,
inserterMediaCategories
]);
return categories;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/media-tab/media-panel.js
const INITIAL_MEDIA_ITEMS_PER_PAGE = 10;
function MediaCategoryPanel({ rootClientId, onInsert, category }) {
const [search, setSearch, debouncedSearch] = (0,external_wp_compose_namespaceObject.useDebouncedInput)();
const { mediaList, isLoading } = useMediaResults(category, {
per_page: !!debouncedSearch ? 20 : INITIAL_MEDIA_ITEMS_PER_PAGE,
search: debouncedSearch
});
const baseCssClass = "block-editor-inserter__media-panel";
const searchLabel = category.labels.search_items || (0,external_wp_i18n_namespaceObject.__)("Search");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: baseCssClass, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SearchControl,
{
__nextHasNoMarginBottom: true,
className: `${baseCssClass}-search`,
onChange: setSearch,
value: search,
label: searchLabel,
placeholder: searchLabel
}
),
isLoading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `${baseCssClass}-spinner`, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }),
!isLoading && !mediaList?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(no_results_default, {}),
!isLoading && !!mediaList?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
media_list_default,
{
rootClientId,
onClick: onInsert,
mediaList,
category
}
)
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/media-tab/media-tab.js
const media_tab_ALLOWED_MEDIA_TYPES = ["image", "video", "audio"];
function MediaTab({
rootClientId,
selectedCategory,
onSelectCategory,
onInsert,
children
}) {
const mediaCategories = useMediaCategories(rootClientId);
const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
const baseCssClass = "block-editor-inserter__media-tabs";
const onSelectMedia = (0,external_wp_element_namespaceObject.useCallback)(
(media) => {
if (!media?.url) {
return;
}
const [block] = getBlockAndPreviewFromMedia(media, media.type);
onInsert(block);
},
[onInsert]
);
const categories = (0,external_wp_element_namespaceObject.useMemo)(
() => mediaCategories.map((mediaCategory) => ({
...mediaCategory,
label: mediaCategory.labels.name
})),
[mediaCategories]
);
if (!categories.length) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(no_results_default, {});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
!isMobile && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: `${baseCssClass}-container`, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
category_tabs_default,
{
categories,
selectedCategory,
onSelectCategory,
children
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(check_default, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
media_upload_default,
{
multiple: false,
onSelect: onSelectMedia,
allowedTypes: media_tab_ALLOWED_MEDIA_TYPES,
render: ({ open }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
onClick: (event) => {
event.target.focus();
open();
},
className: "block-editor-inserter__media-library-button",
variant: "secondary",
"data-unstable-ignore-focus-outside-for-relatedtarget": ".media-modal",
children: (0,external_wp_i18n_namespaceObject.__)("Open Media Library")
}
)
}
) })
] }),
isMobile && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MobileTabNavigation, { categories, children: (category) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
MediaCategoryPanel,
{
onInsert,
rootClientId,
category
}
) })
] });
}
var media_tab_default = MediaTab;
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter-menu-extension/index.js
const { Fill: __unstableInserterMenuExtension, Slot } = (0,external_wp_components_namespaceObject.createSlotFill)(
"__unstableInserterMenuExtension"
);
__unstableInserterMenuExtension.Slot = Slot;
var inserter_menu_extension_default = __unstableInserterMenuExtension;
;// ./node_modules/@wordpress/block-editor/build-module/utils/order-inserter-block-items.js
const orderInserterBlockItems = (items, priority) => {
if (!priority) {
return items;
}
items.sort(({ id: aName }, { id: bName }) => {
let aIndex = priority.indexOf(aName);
let bIndex = priority.indexOf(bName);
if (aIndex < 0) {
aIndex = priority.length;
}
if (bIndex < 0) {
bIndex = priority.length;
}
return aIndex - bIndex;
});
return items;
};
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/search-results.js
const INITIAL_INSERTER_RESULTS = 9;
const search_results_EMPTY_ARRAY = [];
function InserterSearchResults({
filterValue,
onSelect,
onHover,
onHoverPattern,
rootClientId,
clientId,
isAppender,
__experimentalInsertionIndex,
maxBlockPatterns,
maxBlockTypes,
showBlockDirectory = false,
isDraggable = true,
shouldFocusBlock = true,
prioritizePatterns,
selectBlockOnInsert,
isQuick
}) {
const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500);
const { prioritizedBlocks } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const blockListSettings = select(store).getBlockListSettings(rootClientId);
return {
prioritizedBlocks: blockListSettings?.prioritizedInserterBlocks || search_results_EMPTY_ARRAY
};
},
[rootClientId]
);
const [destinationRootClientId, onInsertBlocks] = use_insertion_point_default({
onSelect,
rootClientId,
clientId,
isAppender,
insertionIndex: __experimentalInsertionIndex,
shouldFocusBlock,
selectBlockOnInsert
});
const [
blockTypes,
blockTypeCategories,
blockTypeCollections,
onSelectBlockType
] = use_block_types_state_default(destinationRootClientId, onInsertBlocks, isQuick);
const [patterns, , onClickPattern] = use_patterns_state_default(
onInsertBlocks,
destinationRootClientId,
void 0,
isQuick
);
const filteredBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (maxBlockPatterns === 0) {
return [];
}
const results = searchItems(patterns, filterValue);
return maxBlockPatterns !== void 0 ? results.slice(0, maxBlockPatterns) : results;
}, [filterValue, patterns, maxBlockPatterns]);
let maxBlockTypesToShow = maxBlockTypes;
if (prioritizePatterns && filteredBlockPatterns.length > 2) {
maxBlockTypesToShow = 0;
}
const filteredBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (maxBlockTypesToShow === 0) {
return [];
}
const nonPatternBlockTypes = blockTypes.filter(
(blockType) => blockType.name !== "core/block"
);
let orderedItems = orderBy(nonPatternBlockTypes, "frecency", "desc");
if (!filterValue && prioritizedBlocks.length) {
orderedItems = orderInserterBlockItems(
orderedItems,
prioritizedBlocks
);
}
const results = searchBlockItems(
orderedItems,
blockTypeCategories,
blockTypeCollections,
filterValue
);
return maxBlockTypesToShow !== void 0 ? results.slice(0, maxBlockTypesToShow) : results;
}, [
filterValue,
blockTypes,
blockTypeCategories,
blockTypeCollections,
maxBlockTypesToShow,
prioritizedBlocks
]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!filterValue) {
return;
}
const count = filteredBlockTypes.length + filteredBlockPatterns.length;
const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: number of results. */
(0,external_wp_i18n_namespaceObject._n)("%d result found.", "%d results found.", count),
count
);
debouncedSpeak(resultsFoundMessage);
}, [
filterValue,
debouncedSpeak,
filteredBlockTypes,
filteredBlockPatterns
]);
const currentShownBlockTypes = (0,external_wp_compose_namespaceObject.useAsyncList)(filteredBlockTypes, {
step: INITIAL_INSERTER_RESULTS
});
const hasItems = filteredBlockTypes.length > 0 || filteredBlockPatterns.length > 0;
const blocksUI = !!filteredBlockTypes.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
panel_default,
{
title: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { children: (0,external_wp_i18n_namespaceObject.__)("Blocks") }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_types_list_default,
{
items: currentShownBlockTypes,
onSelect: onSelectBlockType,
onHover,
label: (0,external_wp_i18n_namespaceObject.__)("Blocks"),
isDraggable
}
)
}
);
const patternsUI = !!filteredBlockPatterns.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
panel_default,
{
title: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { children: (0,external_wp_i18n_namespaceObject.__)("Block patterns") }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__quick-inserter-patterns", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_patterns_list_default,
{
blockPatterns: filteredBlockPatterns,
onClickPattern,
onHover: onHoverPattern,
isDraggable
}
) })
}
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(inserter_listbox_default, { children: [
!showBlockDirectory && !hasItems && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(no_results_default, {}),
prioritizePatterns ? patternsUI : blocksUI,
!!filteredBlockTypes.length && !!filteredBlockPatterns.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__quick-inserter-separator" }),
prioritizePatterns ? blocksUI : patternsUI,
showBlockDirectory && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inserter_menu_extension_default.Slot,
{
fillProps: {
onSelect: onSelectBlockType,
onHover,
filterValue,
hasItems,
rootClientId: destinationRootClientId
},
children: (fills) => {
if (fills.length) {
return fills;
}
if (!hasItems) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(no_results_default, {});
}
return null;
}
}
)
] });
}
var search_results_search_results_default = InserterSearchResults;
;// ./node_modules/@wordpress/icons/build-module/library/close-small.js
var close_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 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" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/tabbed-sidebar/index.js
const { Tabs: tabbed_sidebar_Tabs } = unlock(external_wp_components_namespaceObject.privateApis);
function TabbedSidebar({ defaultTabId, onClose, onSelect, selectedTab, tabs, closeButtonLabel }, ref) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-tabbed-sidebar", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
tabbed_sidebar_Tabs,
{
selectOnMove: false,
defaultTabId,
onSelect,
selectedTabId: selectedTab,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-tabbed-sidebar__tablist-and-close-button", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
className: "block-editor-tabbed-sidebar__close-button",
icon: close_small_default,
label: closeButtonLabel,
onClick: () => onClose(),
size: "compact"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
tabbed_sidebar_Tabs.TabList,
{
className: "block-editor-tabbed-sidebar__tablist",
ref,
children: tabs.map((tab) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
tabbed_sidebar_Tabs.Tab,
{
tabId: tab.name,
className: "block-editor-tabbed-sidebar__tab",
children: tab.title
},
tab.name
))
}
)
] }),
tabs.map((tab) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
tabbed_sidebar_Tabs.TabPanel,
{
tabId: tab.name,
focusable: false,
className: "block-editor-tabbed-sidebar__tabpanel",
ref: tab.panelRef,
children: tab.panel
},
tab.name
))
]
}
) });
}
var tabbed_sidebar_default = (0,external_wp_element_namespaceObject.forwardRef)(TabbedSidebar);
;// ./node_modules/@wordpress/block-editor/build-module/hooks/use-zoom-out.js
function useZoomOut(enabled = true) {
const { setZoomLevel, resetZoomLevel } = unlock(
(0,external_wp_data_namespaceObject.useDispatch)(store)
);
const { isZoomedOut, isZoomOut } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { isZoomOut: _isZoomOut } = unlock(select(store));
return {
isZoomedOut: _isZoomOut(),
isZoomOut: _isZoomOut
};
}, []);
const controlZoomLevelRef = (0,external_wp_element_namespaceObject.useRef)(false);
const isEnabledRef = (0,external_wp_element_namespaceObject.useRef)(enabled);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (isZoomedOut !== isEnabledRef.current) {
controlZoomLevelRef.current = false;
}
}, [isZoomedOut]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
isEnabledRef.current = enabled;
if (enabled !== isZoomOut()) {
controlZoomLevelRef.current = true;
if (enabled) {
setZoomLevel("auto-scaled");
} else {
resetZoomLevel();
}
}
return () => {
if (controlZoomLevelRef.current && isZoomOut()) {
resetZoomLevel();
}
};
}, [enabled, isZoomOut, resetZoomLevel, setZoomLevel]);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/menu.js
const NOOP = () => {
};
function InserterMenu({
rootClientId,
clientId,
isAppender,
__experimentalInsertionIndex,
onSelect,
showInserterHelpPanel,
showMostUsedBlocks,
__experimentalFilterValue = "",
shouldFocusBlock = true,
onPatternCategorySelection,
onClose,
__experimentalInitialTab,
__experimentalInitialCategory
}, ref) {
const { isZoomOutMode, hasSectionRootClientId } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { isZoomOut, getSectionRootClientId } = unlock(
select(store)
);
return {
isZoomOutMode: isZoomOut(),
hasSectionRootClientId: !!getSectionRootClientId()
};
}, []);
const [filterValue, setFilterValue, delayedFilterValue] = (0,external_wp_compose_namespaceObject.useDebouncedInput)(__experimentalFilterValue);
const [hoveredItem, setHoveredItem] = (0,external_wp_element_namespaceObject.useState)(null);
const [selectedPatternCategory, setSelectedPatternCategory] = (0,external_wp_element_namespaceObject.useState)(
__experimentalInitialCategory
);
const [patternFilter, setPatternFilter] = (0,external_wp_element_namespaceObject.useState)("all");
const [selectedMediaCategory, setSelectedMediaCategory] = (0,external_wp_element_namespaceObject.useState)(null);
const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("large");
function getInitialTab() {
if (__experimentalInitialTab) {
return __experimentalInitialTab;
}
if (isZoomOutMode) {
return "patterns";
}
return "blocks";
}
const [selectedTab, setSelectedTab] = (0,external_wp_element_namespaceObject.useState)(getInitialTab());
const shouldUseZoomOut = hasSectionRootClientId && (selectedTab === "patterns" || selectedTab === "media");
useZoomOut(shouldUseZoomOut && isLargeViewport);
const [destinationRootClientId, onInsertBlocks, onToggleInsertionPoint] = use_insertion_point_default({
rootClientId,
clientId,
isAppender,
insertionIndex: __experimentalInsertionIndex,
shouldFocusBlock
});
const blockTypesTabRef = (0,external_wp_element_namespaceObject.useRef)();
const onInsert = (0,external_wp_element_namespaceObject.useCallback)(
(blocks, meta, shouldForceFocusBlock, _rootClientId) => {
onInsertBlocks(
blocks,
meta,
shouldForceFocusBlock,
_rootClientId
);
onSelect(blocks);
window.requestAnimationFrame(() => {
if (!shouldFocusBlock && !blockTypesTabRef.current?.contains(
ref.current.ownerDocument.activeElement
)) {
blockTypesTabRef.current?.querySelector("button").focus();
}
});
},
[onInsertBlocks, onSelect, shouldFocusBlock]
);
const onInsertPattern = (0,external_wp_element_namespaceObject.useCallback)(
(blocks, patternName, ...args) => {
onToggleInsertionPoint(false);
onInsertBlocks(blocks, { patternName }, ...args);
onSelect();
},
[onInsertBlocks, onSelect]
);
const onHover = (0,external_wp_element_namespaceObject.useCallback)(
(item) => {
onToggleInsertionPoint(item);
setHoveredItem(item);
},
[onToggleInsertionPoint, setHoveredItem]
);
const onClickPatternCategory = (0,external_wp_element_namespaceObject.useCallback)(
(patternCategory, filter) => {
setSelectedPatternCategory(patternCategory);
setPatternFilter(filter);
onPatternCategorySelection?.();
},
[setSelectedPatternCategory, onPatternCategorySelection]
);
const showPatternPanel = selectedTab === "patterns" && !delayedFilterValue && !!selectedPatternCategory;
const showMediaPanel = selectedTab === "media" && !!selectedMediaCategory;
const inserterSearch = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (selectedTab === "media") {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SearchControl,
{
__nextHasNoMarginBottom: true,
className: "block-editor-inserter__search",
onChange: (value) => {
if (hoveredItem) {
setHoveredItem(null);
}
setFilterValue(value);
},
value: filterValue,
label: (0,external_wp_i18n_namespaceObject.__)("Search"),
placeholder: (0,external_wp_i18n_namespaceObject.__)("Search")
}
),
!!delayedFilterValue && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
search_results_search_results_default,
{
filterValue: delayedFilterValue,
onSelect,
onHover,
rootClientId,
clientId,
isAppender,
__experimentalInsertionIndex,
showBlockDirectory: true,
shouldFocusBlock,
prioritizePatterns: selectedTab === "patterns"
}
)
] });
}, [
selectedTab,
hoveredItem,
setHoveredItem,
setFilterValue,
filterValue,
delayedFilterValue,
onSelect,
onHover,
shouldFocusBlock,
clientId,
rootClientId,
__experimentalInsertionIndex,
isAppender
]);
const blocksTab = (0,external_wp_element_namespaceObject.useMemo)(() => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__block-list", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_types_tab_default,
{
ref: blockTypesTabRef,
rootClientId: destinationRootClientId,
onInsert,
onHover,
showMostUsedBlocks
}
) }),
showInserterHelpPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-inserter__tips", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "h2", children: (0,external_wp_i18n_namespaceObject.__)("A tip for using the block editor") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tips_default, {})
] })
] });
}, [
destinationRootClientId,
onInsert,
onHover,
showMostUsedBlocks,
showInserterHelpPanel
]);
const patternsTab = (0,external_wp_element_namespaceObject.useMemo)(() => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_patterns_tab_default,
{
rootClientId: destinationRootClientId,
onInsert: onInsertPattern,
onSelectCategory: onClickPatternCategory,
selectedCategory: selectedPatternCategory,
children: showPatternPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PatternCategoryPreviews,
{
rootClientId: destinationRootClientId,
onInsert: onInsertPattern,
category: selectedPatternCategory,
patternFilter,
showTitlesAsTooltip: true
}
)
}
);
}, [
destinationRootClientId,
onInsertPattern,
onClickPatternCategory,
patternFilter,
selectedPatternCategory,
showPatternPanel
]);
const mediaTab = (0,external_wp_element_namespaceObject.useMemo)(() => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
media_tab_default,
{
rootClientId: destinationRootClientId,
selectedCategory: selectedMediaCategory,
onSelectCategory: setSelectedMediaCategory,
onInsert,
children: showMediaPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
MediaCategoryPanel,
{
rootClientId: destinationRootClientId,
onInsert,
category: selectedMediaCategory
}
)
}
);
}, [
destinationRootClientId,
onInsert,
selectedMediaCategory,
setSelectedMediaCategory,
showMediaPanel
]);
const handleSetSelectedTab = (value) => {
if (value !== "patterns") {
setSelectedPatternCategory(null);
}
setSelectedTab(value);
};
const tabsRef = (0,external_wp_element_namespaceObject.useRef)();
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (tabsRef.current) {
window.requestAnimationFrame(() => {
tabsRef.current.querySelector('[role="tab"][aria-selected="true"]')?.focus();
});
}
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
className: dist_clsx("block-editor-inserter__menu", {
"show-panel": showPatternPanel || showMediaPanel,
"is-zoom-out": isZoomOutMode
}),
ref,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__main-area", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
tabbed_sidebar_default,
{
ref: tabsRef,
onSelect: handleSetSelectedTab,
onClose,
selectedTab,
closeButtonLabel: (0,external_wp_i18n_namespaceObject.__)("Close Block Inserter"),
tabs: [
{
name: "blocks",
title: (0,external_wp_i18n_namespaceObject.__)("Blocks"),
panel: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
inserterSearch,
selectedTab === "blocks" && !delayedFilterValue && blocksTab
] })
},
{
name: "patterns",
title: (0,external_wp_i18n_namespaceObject.__)("Patterns"),
panel: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
inserterSearch,
selectedTab === "patterns" && !delayedFilterValue && patternsTab
] })
},
{
name: "media",
title: (0,external_wp_i18n_namespaceObject.__)("Media"),
panel: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
inserterSearch,
mediaTab
] })
}
]
}
) }),
showInserterHelpPanel && hoveredItem && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Popover,
{
className: "block-editor-inserter__preview-container__popover",
placement: "right-start",
offset: 16,
focusOnMount: false,
animate: false,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(preview_panel_default, { item: hoveredItem })
}
)
]
}
);
}
const PrivateInserterMenu = (0,external_wp_element_namespaceObject.forwardRef)(InserterMenu);
function PublicInserterMenu(props, ref) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PrivateInserterMenu,
{
...props,
onPatternCategorySelection: NOOP,
ref
}
);
}
var menu_default = (0,external_wp_element_namespaceObject.forwardRef)(PublicInserterMenu);
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/quick-inserter.js
const SEARCH_THRESHOLD = 6;
const SHOWN_BLOCK_TYPES = 6;
const SHOWN_BLOCK_PATTERNS = 2;
function QuickInserter({
onSelect,
rootClientId,
clientId,
isAppender,
selectBlockOnInsert,
hasSearch = true
}) {
const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)("");
const [destinationRootClientId, onInsertBlocks] = use_insertion_point_default({
onSelect,
rootClientId,
clientId,
isAppender,
selectBlockOnInsert
});
const [blockTypes] = use_block_types_state_default(
destinationRootClientId,
onInsertBlocks,
true
);
const { setInserterIsOpened, insertionIndex } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getSettings, getBlockIndex, getBlockCount } = select(store);
const settings = getSettings();
const index = getBlockIndex(clientId);
const blockCount = getBlockCount();
return {
setInserterIsOpened: settings.__experimentalSetIsInserterOpened,
insertionIndex: index === -1 ? blockCount : index
};
},
[clientId]
);
const showSearch = hasSearch && blockTypes.length > SEARCH_THRESHOLD;
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (setInserterIsOpened) {
setInserterIsOpened(false);
}
}, [setInserterIsOpened]);
const onBrowseAll = () => {
setInserterIsOpened({
filterValue,
onSelect,
rootClientId,
insertionIndex
});
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
className: dist_clsx("block-editor-inserter__quick-inserter", {
"has-search": showSearch,
"has-expand": setInserterIsOpened
}),
children: [
showSearch && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SearchControl,
{
__nextHasNoMarginBottom: true,
className: "block-editor-inserter__search",
value: filterValue,
onChange: (value) => {
setFilterValue(value);
},
label: (0,external_wp_i18n_namespaceObject.__)("Search"),
placeholder: (0,external_wp_i18n_namespaceObject.__)("Search")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__quick-inserter-results", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
search_results_search_results_default,
{
filterValue,
onSelect,
rootClientId,
clientId,
isAppender,
maxBlockPatterns: !!filterValue ? SHOWN_BLOCK_PATTERNS : 0,
maxBlockTypes: SHOWN_BLOCK_TYPES,
isDraggable: false,
selectBlockOnInsert,
isQuick: true
}
) }),
setInserterIsOpened && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
className: "block-editor-inserter__quick-inserter-expand",
onClick: onBrowseAll,
"aria-label": (0,external_wp_i18n_namespaceObject.__)(
"Browse all. This will open the main inserter panel in the editor toolbar."
),
children: (0,external_wp_i18n_namespaceObject.__)("Browse all")
}
)
]
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/index.js
const defaultRenderToggle = ({
onToggle,
disabled,
isOpen,
blockTitle,
hasSingleBlockType,
toggleProps = {}
}) => {
const {
as: Wrapper = external_wp_components_namespaceObject.Button,
label: labelProp,
onClick,
...rest
} = toggleProps;
let label = labelProp;
if (!label && hasSingleBlockType) {
label = (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: the name of the block when there is only one
(0,external_wp_i18n_namespaceObject._x)("Add %s", "directly add the only allowed block"),
blockTitle
);
} else if (!label) {
label = (0,external_wp_i18n_namespaceObject._x)("Add block", "Generic label for block inserter button");
}
function handleClick(event) {
if (onToggle) {
onToggle(event);
}
if (onClick) {
onClick(event);
}
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Wrapper,
{
__next40pxDefaultSize: toggleProps.as ? void 0 : true,
icon: plus_default,
label,
tooltipPosition: "bottom",
onClick: handleClick,
className: "block-editor-inserter__toggle",
"aria-haspopup": !hasSingleBlockType ? "true" : false,
"aria-expanded": !hasSingleBlockType ? isOpen : false,
disabled,
...rest
}
);
};
class Inserter extends external_wp_element_namespaceObject.Component {
constructor() {
super(...arguments);
this.onToggle = this.onToggle.bind(this);
this.renderToggle = this.renderToggle.bind(this);
this.renderContent = this.renderContent.bind(this);
}
onToggle(isOpen) {
const { onToggle } = this.props;
if (onToggle) {
onToggle(isOpen);
}
}
/**
* Render callback to display Dropdown toggle element.
*
* @param {Object} options
* @param {Function} options.onToggle Callback to invoke when toggle is
* pressed.
* @param {boolean} options.isOpen Whether dropdown is currently open.
*
* @return {Element} Dropdown toggle element.
*/
renderToggle({ onToggle, isOpen }) {
const {
disabled,
blockTitle,
hasSingleBlockType,
directInsertBlock,
toggleProps,
hasItems,
renderToggle = defaultRenderToggle
} = this.props;
return renderToggle({
onToggle,
isOpen,
disabled: disabled || !hasItems,
blockTitle,
hasSingleBlockType,
directInsertBlock,
toggleProps
});
}
/**
* Render callback to display Dropdown content element.
*
* @param {Object} options
* @param {Function} options.onClose Callback to invoke when dropdown is
* closed.
*
* @return {Element} Dropdown content element.
*/
renderContent({ onClose }) {
const {
rootClientId,
clientId,
isAppender,
showInserterHelpPanel,
// This prop is experimental to give some time for the quick inserter to mature
// Feel free to make them stable after a few releases.
__experimentalIsQuick: isQuick,
onSelectOrClose,
selectBlockOnInsert
} = this.props;
if (isQuick) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
QuickInserter,
{
onSelect: (blocks) => {
const firstBlock = Array.isArray(blocks) && blocks?.length ? blocks[0] : blocks;
if (onSelectOrClose && typeof onSelectOrClose === "function") {
onSelectOrClose(firstBlock);
}
onClose();
},
rootClientId,
clientId,
isAppender,
selectBlockOnInsert
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
menu_default,
{
onSelect: () => {
onClose();
},
rootClientId,
clientId,
isAppender,
showInserterHelpPanel
}
);
}
render() {
const {
position,
hasSingleBlockType,
directInsertBlock,
insertOnlyAllowedBlock,
__experimentalIsQuick: isQuick,
onSelectOrClose
} = this.props;
if (hasSingleBlockType || directInsertBlock) {
return this.renderToggle({ onToggle: insertOnlyAllowedBlock });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
className: "block-editor-inserter",
contentClassName: dist_clsx("block-editor-inserter__popover", {
"is-quick": isQuick
}),
popoverProps: { position, shift: true },
onToggle: this.onToggle,
expandOnMobile: true,
headerTitle: (0,external_wp_i18n_namespaceObject.__)("Add a block"),
renderToggle: this.renderToggle,
renderContent: this.renderContent,
onClose: onSelectOrClose
}
);
}
}
var inserter_default = (0,external_wp_compose_namespaceObject.compose)([
(0,external_wp_data_namespaceObject.withSelect)(
(select, { clientId, rootClientId, shouldDirectInsert = true }) => {
const {
getBlockRootClientId,
hasInserterItems,
getAllowedBlocks,
getDirectInsertBlock
} = select(store);
const { getBlockVariations } = select(external_wp_blocks_namespaceObject.store);
rootClientId = rootClientId || getBlockRootClientId(clientId) || void 0;
const allowedBlocks = getAllowedBlocks(rootClientId);
const directInsertBlock = shouldDirectInsert && getDirectInsertBlock(rootClientId);
const hasSingleBlockType = allowedBlocks?.length === 1 && getBlockVariations(allowedBlocks[0].name, "inserter")?.length === 0;
let allowedBlockType = false;
if (hasSingleBlockType) {
allowedBlockType = allowedBlocks[0];
}
return {
hasItems: hasInserterItems(rootClientId),
hasSingleBlockType,
blockTitle: allowedBlockType ? allowedBlockType.title : "",
allowedBlockType,
directInsertBlock,
rootClientId
};
}
),
(0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, { select }) => {
return {
insertOnlyAllowedBlock() {
const {
rootClientId,
clientId,
isAppender,
hasSingleBlockType,
allowedBlockType,
directInsertBlock,
onSelectOrClose,
selectBlockOnInsert
} = ownProps;
if (!hasSingleBlockType && !directInsertBlock) {
return;
}
function getAdjacentBlockAttributes(attributesToCopy) {
const { getBlock, getPreviousBlockClientId } = select(store);
if (!attributesToCopy || !clientId && !rootClientId) {
return {};
}
const result = {};
let adjacentAttributes = {};
if (!clientId) {
const parentBlock = getBlock(rootClientId);
if (parentBlock?.innerBlocks?.length) {
const lastInnerBlock = parentBlock.innerBlocks[parentBlock.innerBlocks.length - 1];
if (directInsertBlock && directInsertBlock?.name === lastInnerBlock.name) {
adjacentAttributes = lastInnerBlock.attributes;
}
}
} else {
const currentBlock = getBlock(clientId);
const previousBlock = getBlock(
getPreviousBlockClientId(clientId)
);
if (currentBlock?.name === previousBlock?.name) {
adjacentAttributes = previousBlock?.attributes || {};
}
}
attributesToCopy.forEach((attribute) => {
if (adjacentAttributes.hasOwnProperty(attribute)) {
result[attribute] = adjacentAttributes[attribute];
}
});
return result;
}
function getInsertionIndex() {
const {
getBlockIndex,
getBlockSelectionEnd,
getBlockOrder,
getBlockRootClientId
} = select(store);
if (clientId) {
return getBlockIndex(clientId);
}
const end = getBlockSelectionEnd();
if (!isAppender && end && getBlockRootClientId(end) === rootClientId) {
return getBlockIndex(end) + 1;
}
return getBlockOrder(rootClientId).length;
}
const { insertBlock } = dispatch(store);
let blockToInsert;
if (directInsertBlock) {
const newAttributes = getAdjacentBlockAttributes(
directInsertBlock.attributesToCopy
);
blockToInsert = (0,external_wp_blocks_namespaceObject.createBlock)(directInsertBlock.name, {
...directInsertBlock.attributes || {},
...newAttributes
});
} else {
blockToInsert = (0,external_wp_blocks_namespaceObject.createBlock)(allowedBlockType.name);
}
insertBlock(
blockToInsert,
getInsertionIndex(),
rootClientId,
selectBlockOnInsert
);
if (onSelectOrClose) {
onSelectOrClose(blockToInsert);
}
const message = (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: the name of the block that has been added
(0,external_wp_i18n_namespaceObject.__)("%s block added"),
allowedBlockType.title
);
(0,external_wp_a11y_namespaceObject.speak)(message);
}
};
}),
// The global inserter should always be visible, we are using ( ! isAppender && ! rootClientId && ! clientId ) as
// a way to detect the global Inserter.
(0,external_wp_compose_namespaceObject.ifCondition)(
({ hasItems, isAppender, rootClientId, clientId }) => hasItems || !isAppender && !rootClientId && !clientId
)
])(Inserter);
;// ./node_modules/@wordpress/block-editor/build-module/components/button-block-appender/index.js
function button_block_appender_ButtonBlockAppender({ rootClientId, className, onFocus, tabIndex, onSelect }, ref) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inserter_default,
{
position: "bottom center",
rootClientId,
__experimentalIsQuick: true,
onSelectOrClose: (...args) => {
if (onSelect && typeof onSelect === "function") {
onSelect(...args);
}
},
renderToggle: ({
onToggle,
disabled,
isOpen,
blockTitle,
hasSingleBlockType
}) => {
const isToggleButton = !hasSingleBlockType;
const label = hasSingleBlockType ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: the name of the block when there is only one
(0,external_wp_i18n_namespaceObject._x)(
"Add %s",
"directly add the only allowed block"
),
blockTitle
) : (0,external_wp_i18n_namespaceObject._x)(
"Add block",
"Generic label for block inserter button"
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
ref,
onFocus,
tabIndex,
className: dist_clsx(
className,
"block-editor-button-block-appender"
),
onClick: onToggle,
"aria-haspopup": isToggleButton ? "true" : void 0,
"aria-expanded": isToggleButton ? isOpen : void 0,
disabled,
label,
showTooltip: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: plus_default })
}
);
},
isAppender: true
}
);
}
const ButtonBlockerAppender = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
external_wp_deprecated_default()(`wp.blockEditor.ButtonBlockerAppender`, {
alternative: "wp.blockEditor.ButtonBlockAppender",
since: "5.9"
});
return button_block_appender_ButtonBlockAppender(props, ref);
});
var button_block_appender_default = (0,external_wp_element_namespaceObject.forwardRef)(button_block_appender_ButtonBlockAppender);
;// ./node_modules/@wordpress/block-editor/build-module/components/grid/grid-visualizer.js
function GridVisualizer({ clientId, contentRef, parentLayout }) {
const isDistractionFree = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).getSettings().isDistractionFree,
[]
);
const gridElement = useBlockElement(clientId);
if (isDistractionFree || !gridElement) {
return null;
}
const isManualGrid = parentLayout?.isManualPlacement && window.__experimentalEnableGridInteractivity;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridVisualizerGrid,
{
gridClientId: clientId,
gridElement,
isManualGrid,
ref: contentRef
}
);
}
const GridVisualizerGrid = (0,external_wp_element_namespaceObject.forwardRef)(
({ gridClientId, gridElement, isManualGrid }, ref) => {
const [gridInfo, setGridInfo] = (0,external_wp_element_namespaceObject.useState)(
() => getGridInfo(gridElement)
);
const [isDroppingAllowed, setIsDroppingAllowed] = (0,external_wp_element_namespaceObject.useState)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const resizeCallback = () => setGridInfo(getGridInfo(gridElement));
const borderBoxSpy = new window.ResizeObserver(resizeCallback);
borderBoxSpy.observe(gridElement, { box: "border-box" });
const contentBoxSpy = new window.ResizeObserver(resizeCallback);
contentBoxSpy.observe(gridElement);
return () => {
borderBoxSpy.disconnect();
contentBoxSpy.disconnect();
};
}, [gridElement]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
function onGlobalDrag() {
setIsDroppingAllowed(true);
}
function onGlobalDragEnd() {
setIsDroppingAllowed(false);
}
document.addEventListener("drag", onGlobalDrag);
document.addEventListener("dragend", onGlobalDragEnd);
return () => {
document.removeEventListener("drag", onGlobalDrag);
document.removeEventListener("dragend", onGlobalDragEnd);
};
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
cover_default,
{
className: dist_clsx("block-editor-grid-visualizer", {
"is-dropping-allowed": isDroppingAllowed
}),
clientId: gridClientId,
__unstablePopoverSlot: "__unstable-block-tools-after",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
ref,
className: "block-editor-grid-visualizer__grid",
style: gridInfo.style,
children: isManualGrid ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ManualGridVisualizer,
{
gridClientId,
gridInfo
}
) : Array.from({ length: gridInfo.numItems }, (_, i) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridVisualizerCell,
{
color: gridInfo.currentColor
},
i
))
}
)
}
);
}
);
function ManualGridVisualizer({ gridClientId, gridInfo }) {
const [highlightedRect, setHighlightedRect] = (0,external_wp_element_namespaceObject.useState)(null);
const gridItemStyles = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockOrder, getBlockStyles } = unlock(
select(store)
);
const blockOrder = getBlockOrder(gridClientId);
return getBlockStyles(blockOrder);
},
[gridClientId]
);
const occupiedRects = (0,external_wp_element_namespaceObject.useMemo)(() => {
const rects = [];
for (const style of Object.values(gridItemStyles)) {
const {
columnStart,
rowStart,
columnSpan = 1,
rowSpan = 1
} = style?.layout ?? {};
if (!columnStart || !rowStart) {
continue;
}
rects.push(
new GridRect({
columnStart,
rowStart,
columnSpan,
rowSpan
})
);
}
return rects;
}, [gridItemStyles]);
return range(1, gridInfo.numRows).map(
(row) => range(1, gridInfo.numColumns).map((column) => {
const isCellOccupied = occupiedRects.some(
(rect) => rect.contains(column, row)
);
const isHighlighted = highlightedRect?.contains(column, row) ?? false;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridVisualizerCell,
{
color: gridInfo.currentColor,
className: isHighlighted && "is-highlighted",
children: isCellOccupied ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridVisualizerDropZone,
{
column,
row,
gridClientId,
gridInfo,
setHighlightedRect
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridVisualizerAppender,
{
column,
row,
gridClientId,
gridInfo,
setHighlightedRect
}
)
},
`${row}-${column}`
);
})
);
}
function GridVisualizerCell({ color, children, className }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx(
"block-editor-grid-visualizer__cell",
className
),
style: {
boxShadow: `inset 0 0 0 1px color-mix(in srgb, ${color} 20%, #0000)`,
color
},
children
}
);
}
function useGridVisualizerDropZone(column, row, gridClientId, gridInfo, setHighlightedRect) {
const {
getBlockAttributes,
getBlockRootClientId,
canInsertBlockType,
getBlockName
} = (0,external_wp_data_namespaceObject.useSelect)(store);
const {
updateBlockAttributes,
moveBlocksToPosition,
__unstableMarkNextChangeAsNotPersistent
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
const getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(
gridClientId,
gridInfo.numColumns
);
return useDropZoneWithValidation({
validateDrag(srcClientId) {
const blockName = getBlockName(srcClientId);
if (!canInsertBlockType(blockName, gridClientId)) {
return false;
}
const attributes = getBlockAttributes(srcClientId);
const rect = new GridRect({
columnStart: column,
rowStart: row,
columnSpan: attributes.style?.layout?.columnSpan,
rowSpan: attributes.style?.layout?.rowSpan
});
const isInBounds = new GridRect({
columnSpan: gridInfo.numColumns,
rowSpan: gridInfo.numRows
}).containsRect(rect);
return isInBounds;
},
onDragEnter(srcClientId) {
const attributes = getBlockAttributes(srcClientId);
setHighlightedRect(
new GridRect({
columnStart: column,
rowStart: row,
columnSpan: attributes.style?.layout?.columnSpan,
rowSpan: attributes.style?.layout?.rowSpan
})
);
},
onDragLeave() {
setHighlightedRect(
(prevHighlightedRect) => prevHighlightedRect?.columnStart === column && prevHighlightedRect?.rowStart === row ? null : prevHighlightedRect
);
},
onDrop(srcClientId) {
setHighlightedRect(null);
const attributes = getBlockAttributes(srcClientId);
updateBlockAttributes(srcClientId, {
style: {
...attributes.style,
layout: {
...attributes.style?.layout,
columnStart: column,
rowStart: row
}
}
});
__unstableMarkNextChangeAsNotPersistent();
moveBlocksToPosition(
[srcClientId],
getBlockRootClientId(srcClientId),
gridClientId,
getNumberOfBlocksBeforeCell(column, row)
);
}
});
}
function GridVisualizerDropZone({
column,
row,
gridClientId,
gridInfo,
setHighlightedRect
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "block-editor-grid-visualizer__drop-zone",
ref: useGridVisualizerDropZone(
column,
row,
gridClientId,
gridInfo,
setHighlightedRect
)
}
);
}
function GridVisualizerAppender({
column,
row,
gridClientId,
gridInfo,
setHighlightedRect
}) {
const {
updateBlockAttributes,
moveBlocksToPosition,
__unstableMarkNextChangeAsNotPersistent
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
const getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(
gridClientId,
gridInfo.numColumns
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
button_block_appender_default,
{
rootClientId: gridClientId,
className: "block-editor-grid-visualizer__appender",
ref: useGridVisualizerDropZone(
column,
row,
gridClientId,
gridInfo,
setHighlightedRect
),
style: {
color: gridInfo.currentColor
},
onSelect: (block) => {
if (!block) {
return;
}
updateBlockAttributes(block.clientId, {
style: {
layout: {
columnStart: column,
rowStart: row
}
}
});
__unstableMarkNextChangeAsNotPersistent();
moveBlocksToPosition(
[block.clientId],
gridClientId,
gridClientId,
getNumberOfBlocksBeforeCell(column, row)
);
}
}
);
}
function useDropZoneWithValidation({
validateDrag,
onDragEnter,
onDragLeave,
onDrop
}) {
const { getDraggedBlockClientIds } = (0,external_wp_data_namespaceObject.useSelect)(store);
return (0,external_wp_compose_namespaceObject.__experimentalUseDropZone)({
onDragEnter() {
const [srcClientId] = getDraggedBlockClientIds();
if (srcClientId && validateDrag(srcClientId)) {
onDragEnter(srcClientId);
}
},
onDragLeave() {
onDragLeave();
},
onDrop() {
const [srcClientId] = getDraggedBlockClientIds();
if (srcClientId && validateDrag(srcClientId)) {
onDrop(srcClientId);
}
}
});
}
;// ./node_modules/@wordpress/block-editor/build-module/components/grid/grid-item-resizer.js
function GridItemResizer({
clientId,
bounds,
onChange,
parentLayout
}) {
const blockElement = useBlockElement(clientId);
const rootBlockElement = blockElement?.parentElement;
const { isManualPlacement } = parentLayout;
if (!blockElement || !rootBlockElement) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridItemResizerInner,
{
clientId,
bounds,
blockElement,
rootBlockElement,
onChange,
isManualGrid: isManualPlacement && window.__experimentalEnableGridInteractivity
}
);
}
function GridItemResizerInner({
clientId,
bounds,
blockElement,
rootBlockElement,
onChange,
isManualGrid
}) {
const [resizeDirection, setResizeDirection] = (0,external_wp_element_namespaceObject.useState)(null);
const [enableSide, setEnableSide] = (0,external_wp_element_namespaceObject.useState)({
top: false,
bottom: false,
left: false,
right: false
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
const observer = new window.ResizeObserver(() => {
const blockClientRect = blockElement.getBoundingClientRect();
const rootBlockClientRect = rootBlockElement.getBoundingClientRect();
setEnableSide({
top: blockClientRect.top > rootBlockClientRect.top,
bottom: blockClientRect.bottom < rootBlockClientRect.bottom,
left: blockClientRect.left > rootBlockClientRect.left,
right: blockClientRect.right < rootBlockClientRect.right
});
});
observer.observe(blockElement);
return () => observer.disconnect();
}, [blockElement, rootBlockElement]);
const justification = {
right: "left",
left: "right"
};
const alignment = {
top: "flex-end",
bottom: "flex-start"
};
const styles = {
display: "flex",
justifyContent: "center",
alignItems: "center",
...justification[resizeDirection] && {
justifyContent: justification[resizeDirection]
},
...alignment[resizeDirection] && {
alignItems: alignment[resizeDirection]
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
cover_default,
{
className: "block-editor-grid-item-resizer",
clientId,
__unstablePopoverSlot: "__unstable-block-tools-after",
additionalStyles: styles,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ResizableBox,
{
className: "block-editor-grid-item-resizer__box",
size: {
width: "100%",
height: "100%"
},
enable: {
bottom: enableSide.bottom,
bottomLeft: false,
bottomRight: false,
left: enableSide.left,
right: enableSide.right,
top: enableSide.top,
topLeft: false,
topRight: false
},
bounds,
boundsByDirection: true,
onPointerDown: ({ target, pointerId }) => {
target.setPointerCapture(pointerId);
},
onResizeStart: (event, direction) => {
setResizeDirection(direction);
},
onResizeStop: (event, direction, boxElement) => {
const columnGap = parseFloat(
utils_getComputedCSS(rootBlockElement, "column-gap")
);
const rowGap = parseFloat(
utils_getComputedCSS(rootBlockElement, "row-gap")
);
const gridColumnTracks = getGridTracks(
utils_getComputedCSS(
rootBlockElement,
"grid-template-columns"
),
columnGap
);
const gridRowTracks = getGridTracks(
utils_getComputedCSS(
rootBlockElement,
"grid-template-rows"
),
rowGap
);
const rect = new window.DOMRect(
blockElement.offsetLeft + boxElement.offsetLeft,
blockElement.offsetTop + boxElement.offsetTop,
boxElement.offsetWidth,
boxElement.offsetHeight
);
const columnStart = getClosestTrack(gridColumnTracks, rect.left) + 1;
const rowStart = getClosestTrack(gridRowTracks, rect.top) + 1;
const columnEnd = getClosestTrack(gridColumnTracks, rect.right, "end") + 1;
const rowEnd = getClosestTrack(gridRowTracks, rect.bottom, "end") + 1;
onChange({
columnSpan: columnEnd - columnStart + 1,
rowSpan: rowEnd - rowStart + 1,
columnStart: isManualGrid ? columnStart : void 0,
rowStart: isManualGrid ? rowStart : void 0
});
}
}
)
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/chevron-up.js
var chevron_up_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/chevron-down.js
var chevron_down_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/grid/grid-item-movers.js
function GridItemMovers({
layout,
parentLayout,
onChange,
gridClientId,
blockClientId
}) {
const { moveBlocksToPosition, __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const columnStart = layout?.columnStart ?? 1;
const rowStart = layout?.rowStart ?? 1;
const columnSpan = layout?.columnSpan ?? 1;
const rowSpan = layout?.rowSpan ?? 1;
const columnEnd = columnStart + columnSpan - 1;
const rowEnd = rowStart + rowSpan - 1;
const columnCount = parentLayout?.columnCount;
const rowCount = parentLayout?.rowCount;
const getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(
gridClientId,
columnCount
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls_default, { group: "parent", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { className: "block-editor-grid-item-mover__move-button-container", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-grid-item-mover__move-horizontal-button-container is-left", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridItemMover,
{
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right_default : chevron_left_default,
label: (0,external_wp_i18n_namespaceObject.__)("Move left"),
description: (0,external_wp_i18n_namespaceObject.__)("Move left"),
isDisabled: columnStart <= 1,
onClick: () => {
onChange({
columnStart: columnStart - 1
});
__unstableMarkNextChangeAsNotPersistent();
moveBlocksToPosition(
[blockClientId],
gridClientId,
gridClientId,
getNumberOfBlocksBeforeCell(
columnStart - 1,
rowStart
)
);
}
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-grid-item-mover__move-vertical-button-container", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridItemMover,
{
className: "is-up-button",
icon: chevron_up_default,
label: (0,external_wp_i18n_namespaceObject.__)("Move up"),
description: (0,external_wp_i18n_namespaceObject.__)("Move up"),
isDisabled: rowStart <= 1,
onClick: () => {
onChange({
rowStart: rowStart - 1
});
__unstableMarkNextChangeAsNotPersistent();
moveBlocksToPosition(
[blockClientId],
gridClientId,
gridClientId,
getNumberOfBlocksBeforeCell(
columnStart,
rowStart - 1
)
);
}
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridItemMover,
{
className: "is-down-button",
icon: chevron_down_default,
label: (0,external_wp_i18n_namespaceObject.__)("Move down"),
description: (0,external_wp_i18n_namespaceObject.__)("Move down"),
isDisabled: rowCount && rowEnd >= rowCount,
onClick: () => {
onChange({
rowStart: rowStart + 1
});
__unstableMarkNextChangeAsNotPersistent();
moveBlocksToPosition(
[blockClientId],
gridClientId,
gridClientId,
getNumberOfBlocksBeforeCell(
columnStart,
rowStart + 1
)
);
}
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-grid-item-mover__move-horizontal-button-container is-right", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridItemMover,
{
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_default : chevron_right_default,
label: (0,external_wp_i18n_namespaceObject.__)("Move right"),
description: (0,external_wp_i18n_namespaceObject.__)("Move right"),
isDisabled: columnCount && columnEnd >= columnCount,
onClick: () => {
onChange({
columnStart: columnStart + 1
});
__unstableMarkNextChangeAsNotPersistent();
moveBlocksToPosition(
[blockClientId],
gridClientId,
gridClientId,
getNumberOfBlocksBeforeCell(
columnStart + 1,
rowStart
)
);
}
}
) })
] }) });
}
function GridItemMover({
className,
icon,
label,
isDisabled,
onClick,
description
}) {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(GridItemMover);
const descriptionId = `block-editor-grid-item-mover-button__description-${instanceId}`;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
className: dist_clsx(
"block-editor-grid-item-mover-button",
className
),
icon,
label,
"aria-describedby": descriptionId,
onClick: isDisabled ? null : onClick,
disabled: isDisabled,
accessibleWhenDisabled: true
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: descriptionId, children: description })
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/layout-child.js
const LAYOUT_CHILD_BLOCK_PROPS_REFERENCE = {};
function useBlockPropsChildLayoutStyles({ style }) {
const shouldRenderChildLayoutStyles = (0,external_wp_data_namespaceObject.useSelect)((select) => {
return !select(store).getSettings().disableLayoutStyles;
});
const layout = style?.layout ?? {};
const {
selfStretch,
flexSize,
columnStart,
rowStart,
columnSpan,
rowSpan
} = layout;
const parentLayout = useLayout() || {};
const { columnCount, minimumColumnWidth } = parentLayout;
const id = (0,external_wp_compose_namespaceObject.useInstanceId)(LAYOUT_CHILD_BLOCK_PROPS_REFERENCE);
const selector = `.wp-container-content-${id}`;
if (false) {}
let css = "";
if (shouldRenderChildLayoutStyles) {
if (selfStretch === "fixed" && flexSize) {
css = `${selector} {
flex-basis: ${flexSize};
box-sizing: border-box;
}`;
} else if (selfStretch === "fill") {
css = `${selector} {
flex-grow: 1;
}`;
} else if (columnStart && columnSpan) {
css = `${selector} {
grid-column: ${columnStart} / span ${columnSpan};
}`;
} else if (columnStart) {
css = `${selector} {
grid-column: ${columnStart};
}`;
} else if (columnSpan) {
css = `${selector} {
grid-column: span ${columnSpan};
}`;
}
if (rowStart && rowSpan) {
css += `${selector} {
grid-row: ${rowStart} / span ${rowSpan};
}`;
} else if (rowStart) {
css += `${selector} {
grid-row: ${rowStart};
}`;
} else if (rowSpan) {
css += `${selector} {
grid-row: span ${rowSpan};
}`;
}
if ((columnSpan || columnStart) && (minimumColumnWidth || !columnCount)) {
let parentColumnValue = parseFloat(minimumColumnWidth);
if (isNaN(parentColumnValue)) {
parentColumnValue = 12;
}
let parentColumnUnit = minimumColumnWidth?.replace(
parentColumnValue,
""
);
if (!["px", "rem", "em"].includes(parentColumnUnit)) {
parentColumnUnit = "rem";
}
let numColsToBreakAt = 2;
if (columnSpan && columnStart) {
numColsToBreakAt = columnSpan + columnStart - 1;
} else if (columnSpan) {
numColsToBreakAt = columnSpan;
} else {
numColsToBreakAt = columnStart;
}
const defaultGapValue = parentColumnUnit === "px" ? 24 : 1.5;
const containerQueryValue = numColsToBreakAt * parentColumnValue + (numColsToBreakAt - 1) * defaultGapValue;
const minimumContainerQueryValue = parentColumnValue * 2 + defaultGapValue - 1;
const gridColumnValue = columnSpan && columnSpan > 1 ? "1/-1" : "auto";
css += `@container (max-width: ${Math.max(
containerQueryValue,
minimumContainerQueryValue
)}${parentColumnUnit}) {
${selector} {
grid-column: ${gridColumnValue};
grid-row: auto;
}
}`;
}
}
useStyleOverride({ css });
if (!css) {
return;
}
return { className: `wp-container-content-${id}` };
}
function ChildLayoutControlsPure({ clientId, style, setAttributes }) {
const parentLayout = useLayout() || {};
const {
type: parentLayoutType = "default",
allowSizingOnChildren = false,
isManualPlacement
} = parentLayout;
if (parentLayoutType !== "grid") {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridTools,
{
clientId,
style,
setAttributes,
allowSizingOnChildren,
isManualPlacement,
parentLayout
}
);
}
function GridTools({
clientId,
style,
setAttributes,
allowSizingOnChildren,
isManualPlacement,
parentLayout
}) {
const { rootClientId, isVisible } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getBlockRootClientId,
getBlockEditingMode,
getTemplateLock
} = select(store);
const _rootClientId = getBlockRootClientId(clientId);
if (getTemplateLock(_rootClientId) || getBlockEditingMode(_rootClientId) !== "default") {
return {
rootClientId: _rootClientId,
isVisible: false
};
}
return {
rootClientId: _rootClientId,
isVisible: true
};
},
[clientId]
);
const [resizerBounds, setResizerBounds] = (0,external_wp_element_namespaceObject.useState)();
if (!isVisible) {
return null;
}
function updateLayout(layout) {
setAttributes({
style: {
...style,
layout: {
...style?.layout,
...layout
}
}
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridVisualizer,
{
clientId: rootClientId,
contentRef: setResizerBounds,
parentLayout
}
),
allowSizingOnChildren && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridItemResizer,
{
clientId,
bounds: resizerBounds,
onChange: updateLayout,
parentLayout
}
),
isManualPlacement && window.__experimentalEnableGridInteractivity && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridItemMovers,
{
layout: style?.layout,
parentLayout,
onChange: updateLayout,
gridClientId: rootClientId,
blockClientId: clientId
}
)
] });
}
var layout_child_default = {
useBlockProps: useBlockPropsChildLayoutStyles,
edit: ChildLayoutControlsPure,
attributeKeys: ["style"],
hasSupport() {
return true;
}
};
;// ./node_modules/@wordpress/block-editor/build-module/hooks/content-lock-ui.js
function ContentLockControlsPure({ clientId }) {
const { templateLock, isLockedByParent, isEditingAsBlocks } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getContentLockingParent,
getTemplateLock,
getTemporarilyEditingAsBlocks
} = unlock(select(store));
return {
templateLock: getTemplateLock(clientId),
isLockedByParent: !!getContentLockingParent(clientId),
isEditingAsBlocks: getTemporarilyEditingAsBlocks() === clientId
};
},
[clientId]
);
const { stopEditingAsBlocks } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
const isContentLocked = !isLockedByParent && templateLock === "contentOnly";
const stopEditingAsBlockCallback = (0,external_wp_element_namespaceObject.useCallback)(() => {
stopEditingAsBlocks(clientId);
}, [clientId, stopEditingAsBlocks]);
if (!isContentLocked && !isEditingAsBlocks) {
return null;
}
const showStopEditingAsBlocks = isEditingAsBlocks && !isContentLocked;
return showStopEditingAsBlocks && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls_default, { group: "other", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: stopEditingAsBlockCallback, children: (0,external_wp_i18n_namespaceObject.__)("Done") }) });
}
var content_lock_ui_default = {
edit: ContentLockControlsPure,
hasSupport() {
return true;
}
};
;// ./node_modules/@wordpress/block-editor/build-module/hooks/metadata.js
const META_ATTRIBUTE_NAME = "metadata";
function addMetaAttribute(blockTypeSettings) {
if (blockTypeSettings?.attributes?.[META_ATTRIBUTE_NAME]?.type) {
return blockTypeSettings;
}
blockTypeSettings.attributes = {
...blockTypeSettings.attributes,
[META_ATTRIBUTE_NAME]: {
type: "object"
}
};
return blockTypeSettings;
}
function metadata_addTransforms(result, source, index, results) {
if (results.length === 1 && result.innerBlocks.length === source.length) {
return result;
}
if (results.length === 1 && source.length > 1 || results.length > 1 && source.length === 1) {
return result;
}
if (results.length > 1 && source.length > 1 && results.length !== source.length) {
return result;
}
const sourceMetadata = source[index]?.attributes?.metadata;
if (!sourceMetadata) {
return result;
}
const preservedMetadata = {};
if (sourceMetadata.noteId && !result.attributes?.metadata?.noteId) {
preservedMetadata.noteId = sourceMetadata.noteId;
}
if (sourceMetadata.name && !result.attributes?.metadata?.name && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(result.name, "renaming", true)) {
preservedMetadata.name = sourceMetadata.name;
}
if (sourceMetadata.blockVisibility !== void 0 && !result.attributes?.metadata?.blockVisibility && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(result.name, "visibility", true)) {
preservedMetadata.blockVisibility = sourceMetadata.blockVisibility;
}
if (Object.keys(preservedMetadata).length > 0) {
return {
...result,
attributes: {
...result.attributes,
metadata: {
...result.attributes.metadata,
...preservedMetadata
}
}
};
}
return result;
}
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.registerBlockType",
"core/metadata/addMetaAttribute",
addMetaAttribute
);
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.switchToBlockType.transformedBlock",
"core/metadata/addTransforms",
metadata_addTransforms
);
;// ./node_modules/@wordpress/block-editor/build-module/hooks/block-hooks.js
const block_hooks_EMPTY_OBJECT = {};
function BlockHooksControlPure({
name,
clientId,
metadata: { ignoredHookedBlocks = [] } = {}
}) {
const blockTypes = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(external_wp_blocks_namespaceObject.store).getBlockTypes(),
[]
);
const hookedBlocksForCurrentBlock = (0,external_wp_element_namespaceObject.useMemo)(
() => blockTypes?.filter(
({ name: blockName, blockHooks }) => blockHooks && name in blockHooks || ignoredHookedBlocks.includes(blockName)
),
[blockTypes, name, ignoredHookedBlocks]
);
const hookedBlockClientIds = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlocks, getBlockRootClientId: getBlockRootClientId2, getGlobalBlockCount } = select(store);
const rootClientId = getBlockRootClientId2(clientId);
const _hookedBlockClientIds = hookedBlocksForCurrentBlock.reduce(
(clientIds, block) => {
if (getGlobalBlockCount(block.name) === 0) {
return clientIds;
}
const relativePosition = block?.blockHooks?.[name];
let candidates;
switch (relativePosition) {
case "before":
case "after":
candidates = getBlocks(rootClientId);
break;
case "first_child":
case "last_child":
candidates = getBlocks(clientId);
break;
case void 0:
candidates = [
...getBlocks(rootClientId),
...getBlocks(clientId)
];
break;
}
const hookedBlock = candidates?.find(
(candidate) => candidate.name === block.name
);
if (hookedBlock) {
return {
...clientIds,
[block.name]: hookedBlock.clientId
};
}
return clientIds;
},
{}
);
if (Object.values(_hookedBlockClientIds).length > 0) {
return _hookedBlockClientIds;
}
return block_hooks_EMPTY_OBJECT;
},
[hookedBlocksForCurrentBlock, name, clientId]
);
const { getBlockIndex, getBlockCount, getBlockRootClientId } = (0,external_wp_data_namespaceObject.useSelect)(store);
const { insertBlock, removeBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store);
if (!hookedBlocksForCurrentBlock.length) {
return null;
}
const groupedHookedBlocks = hookedBlocksForCurrentBlock.reduce(
(groups, block) => {
const [namespace] = block.name.split("/");
if (!groups[namespace]) {
groups[namespace] = [];
}
groups[namespace].push(block);
return groups;
},
{}
);
const insertBlockIntoDesignatedLocation = (block, relativePosition) => {
const blockIndex = getBlockIndex(clientId);
const innerBlocksLength = getBlockCount(clientId);
const rootClientId = getBlockRootClientId(clientId);
switch (relativePosition) {
case "before":
case "after":
insertBlock(
block,
relativePosition === "after" ? blockIndex + 1 : blockIndex,
rootClientId,
// Insert as a child of the current block's parent
false
);
break;
case "first_child":
case "last_child":
insertBlock(
block,
// TODO: It'd be great if insertBlock() would accept negative indices for insertion.
relativePosition === "first_child" ? 0 : innerBlocksLength,
clientId,
// Insert as a child of the current block.
false
);
break;
case void 0:
insertBlock(
block,
blockIndex + 1,
rootClientId,
// Insert as a child of the current block's parent
false
);
break;
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.PanelBody,
{
className: "block-editor-hooks__block-hooks",
title: (0,external_wp_i18n_namespaceObject.__)("Plugins"),
initialOpen: true,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "block-editor-hooks__block-hooks-helptext", children: (0,external_wp_i18n_namespaceObject.__)(
"Manage the inclusion of blocks added automatically by plugins."
) }),
Object.keys(groupedHookedBlocks).map((vendor) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_element_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", { children: vendor }),
groupedHookedBlocks[vendor].map((block) => {
const checked = block.name in hookedBlockClientIds;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
checked,
label: block.title,
onChange: () => {
if (!checked) {
const relativePosition = block.blockHooks[name];
insertBlockIntoDesignatedLocation(
(0,external_wp_blocks_namespaceObject.createBlock)(block.name),
relativePosition
);
return;
}
removeBlock(
hookedBlockClientIds[block.name],
false
);
}
},
block.title
);
})
] }, vendor);
})
]
}
) });
}
var block_hooks_default = {
edit: BlockHooksControlPure,
attributeKeys: ["metadata"],
hasSupport() {
return true;
}
};
;// ./node_modules/@wordpress/block-editor/build-module/hooks/block-bindings.js
const { Menu } = unlock(external_wp_components_namespaceObject.privateApis);
const block_bindings_EMPTY_OBJECT = {};
const getAttributeType = (blockName, attribute) => {
const _attributeType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName).attributes?.[attribute]?.type;
return _attributeType === "rich-text" ? "string" : _attributeType;
};
const block_bindings_useToolsPanelDropdownMenuProps = () => {
const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
return !isMobile ? {
popoverProps: {
placement: "left-start",
// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)
offset: 259
}
} : {};
};
function BlockBindingsPanelMenuContent({ attribute, binding, sources }) {
const { clientId } = useBlockEditContext();
const { updateBlockBindings } = useBlockBindingsUtils();
const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
const blockContext = (0,external_wp_element_namespaceObject.useContext)(block_context_default);
const { attributeType, select } = (0,external_wp_data_namespaceObject.useSelect)(
(_select) => {
const { name: blockName } = _select(store).getBlock(clientId);
return {
attributeType: getAttributeType(blockName, attribute),
select: _select
};
},
[clientId, attribute]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu, { placement: isMobile ? "bottom-start" : "left-start", children: Object.entries(sources).map(([sourceKey, source]) => {
const sourceDataItems = source.data?.filter(
(item) => item?.type === attributeType
);
const noItemsAvailable = !sourceDataItems || sourceDataItems.length === 0;
if (noItemsAvailable) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
Menu,
{
placement: isMobile ? "bottom-start" : "left-start",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.SubmenuTriggerItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.ItemLabel, { children: source.label }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Popover, { gutter: 8, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Group, { children: sourceDataItems.map((item) => {
const itemBindings = {
source: sourceKey,
args: item?.args || {
key: item.key
}
};
let values = {};
try {
values = source.getValues({
select,
context: blockContext,
bindings: {
[attribute]: itemBindings
}
});
} catch (e) {
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
Menu.CheckboxItem,
{
onChange: () => {
const isCurrentlySelected = es6_default()(
binding?.args,
item.args
) ?? // Deprecate key dependency in 7.0.
item.key === binding?.args?.key;
if (isCurrentlySelected) {
updateBlockBindings({
[attribute]: void 0
});
} else {
updateBlockBindings({
[attribute]: itemBindings
});
}
},
name: attribute + "-binding",
value: values[attribute],
checked: es6_default()(
binding?.args,
item.args
) ?? // Deprecate key dependency in 7.0.
item.key === binding?.args?.key,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.ItemLabel, { children: item?.label }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.ItemHelpText, { children: values[attribute] })
]
},
sourceKey + JSON.stringify(
item.args
) || item.key
);
}) }) })
]
},
sourceKey
);
}) });
}
function BlockBindingsAttribute({ attribute, binding, sources, blockName }) {
const { source: sourceName, args } = binding || {};
const source = sources?.[sourceName];
let displayText;
let isValid = true;
const isNotBound = binding === void 0;
if (isNotBound) {
const attributeType = getAttributeType(blockName, attribute);
const hasCompatibleSources = Object.values(sources).some(
(src) => src.data?.some((item) => item?.type === attributeType)
);
if (!hasCompatibleSources) {
displayText = (0,external_wp_i18n_namespaceObject.__)("No sources available");
} else {
displayText = (0,external_wp_i18n_namespaceObject.__)("Not connected");
}
isValid = true;
} else if (!source) {
isValid = false;
displayText = (0,external_wp_i18n_namespaceObject.__)("Source not registered");
if (Object.keys(sources).length === 0) {
displayText = (0,external_wp_i18n_namespaceObject.__)("No sources available");
}
} else {
displayText = source.data?.find((item) => es6_default()(item.args, args))?.label || source.label || sourceName;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { className: "block-editor-bindings__item", spacing: 0, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { truncate: true, children: attribute }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalText,
{
truncate: true,
variant: isValid ? "muted" : void 0,
isDestructive: !isValid,
children: displayText
}
)
] });
}
function ReadOnlyBlockBindingsPanelItem({
attribute,
binding,
sources,
blockName
}) {
const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!binding, label: attribute, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu, { placement: isMobile ? "bottom-start" : "left-start", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.TriggerButton, { render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItem, {}), disabled: true, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockBindingsAttribute,
{
attribute,
binding,
sources,
blockName
}
) }) }) });
}
function EditableBlockBindingsPanelItem({
attribute,
binding,
sources,
blockName
}) {
const { updateBlockBindings } = useBlockBindingsUtils();
const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: () => !!binding,
label: attribute,
onDeselect: () => {
updateBlockBindings({
[attribute]: void 0
});
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Menu, { placement: isMobile ? "bottom-start" : "left-start", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.TriggerButton, { render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItem, {}), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockBindingsAttribute,
{
attribute,
binding,
sources,
blockName
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Popover, { gutter: isMobile ? 8 : 36, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockBindingsPanelMenuContent,
{
attribute,
binding,
sources
}
) })
] })
}
);
}
const BlockBindingsPanel = ({ name: blockName, metadata }) => {
const blockContext = (0,external_wp_element_namespaceObject.useContext)(block_context_default);
const { removeAllBlockBindings } = useBlockBindingsUtils();
const dropdownMenuProps = block_bindings_useToolsPanelDropdownMenuProps();
const _sources = {};
const { sources, canUpdateBlockBindings, bindableAttributes } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { __experimentalBlockBindingsSupportedAttributes } = select(store).getSettings();
const _bindableAttributes = __experimentalBlockBindingsSupportedAttributes?.[blockName];
if (!_bindableAttributes || _bindableAttributes.length === 0) {
return block_bindings_EMPTY_OBJECT;
}
const registeredSources = (0,external_wp_blocks_namespaceObject.getBlockBindingsSources)();
Object.entries(registeredSources).forEach(
([
sourceName,
{ getFieldsList, usesContext, label, getValues }
]) => {
const context = {};
if (usesContext?.length) {
for (const key of usesContext) {
context[key] = blockContext[key];
}
}
if (getFieldsList) {
const fieldsListResult = getFieldsList({
select,
context
});
_sources[sourceName] = {
data: fieldsListResult || [],
label,
getValues
};
} else {
_sources[sourceName] = {
data: [],
label,
getValues
};
}
}
);
return {
sources: Object.values(_sources).length > 0 ? _sources : block_bindings_EMPTY_OBJECT,
canUpdateBlockBindings: select(store).getSettings().canUpdateBlockBindings,
bindableAttributes: _bindableAttributes
};
},
[blockContext, blockName]
);
if (!bindableAttributes || bindableAttributes.length === 0) {
return null;
}
const { bindings } = metadata || {};
const hasCompatibleData = Object.values(sources).some(
(source) => source.data && source.data.length > 0
);
const readOnly = !canUpdateBlockBindings || !hasCompatibleData;
if (bindings === void 0 && !hasCompatibleData) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default, { group: "bindings", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Attributes"),
resetAll: () => {
removeAllBlockBindings();
},
dropdownMenuProps,
className: "block-editor-bindings__panel",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { isBordered: true, isSeparated: true, children: bindableAttributes.map((attribute) => {
const binding = bindings?.[attribute];
const attributeType = getAttributeType(
blockName,
attribute
);
const hasCompatibleDataForAttribute = Object.values(
sources
).some(
(source) => source.data?.some(
(item) => item?.type === attributeType
)
);
const isAttributeReadOnly = readOnly || !hasCompatibleDataForAttribute;
return isAttributeReadOnly ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ReadOnlyBlockBindingsPanelItem,
{
attribute,
binding,
sources,
blockName
},
attribute
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
EditableBlockBindingsPanelItem,
{
attribute,
binding,
sources,
blockName
},
attribute
);
}) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { as: "div", variant: "muted", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)(
"Attributes connected to custom fields or other dynamic data."
) }) })
]
}
) });
};
var block_bindings_default = {
edit: BlockBindingsPanel,
attributeKeys: ["metadata"],
hasSupport(name) {
return ![
"core/post-date",
"core/navigation-link",
"core/navigation-submenu"
].includes(name);
}
};
;// ./node_modules/@wordpress/block-editor/build-module/hooks/block-renaming.js
function addLabelCallback(settings) {
if (settings.__experimentalLabel) {
return settings;
}
const supportsBlockNaming = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(
settings,
"renaming",
true
// default value
);
if (supportsBlockNaming) {
settings.__experimentalLabel = (attributes, { context }) => {
const { metadata } = attributes;
if (context === "list-view" && metadata?.name) {
return metadata.name;
}
};
}
return settings;
}
(0,external_wp_hooks_namespaceObject.addFilter)(
"blocks.registerBlockType",
"core/metadata/addLabelCallback",
addLabelCallback
);
;// ./node_modules/@wordpress/block-editor/build-module/components/grid/use-grid-layout-sync.js
function useGridLayoutSync({ clientId: gridClientId }) {
const { gridLayout, blockOrder, selectedBlockLayout } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockAttributes: getBlockAttributes2, getBlockOrder } = select(store);
const selectedBlock = select(store).getSelectedBlock();
return {
gridLayout: getBlockAttributes2(gridClientId).layout ?? {},
blockOrder: getBlockOrder(gridClientId),
selectedBlockLayout: selectedBlock?.attributes.style?.layout
};
},
[gridClientId]
);
const { getBlockAttributes, getBlockRootClientId } = (0,external_wp_data_namespaceObject.useSelect)(store);
const { updateBlockAttributes, __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const selectedBlockRect = (0,external_wp_element_namespaceObject.useMemo)(
() => selectedBlockLayout ? new GridRect(selectedBlockLayout) : null,
[selectedBlockLayout]
);
const previouslySelectedBlockRect = (0,external_wp_compose_namespaceObject.usePrevious)(selectedBlockRect);
const previousIsManualPlacement = (0,external_wp_compose_namespaceObject.usePrevious)(
gridLayout.isManualPlacement
);
const previousBlockOrder = (0,external_wp_compose_namespaceObject.usePrevious)(blockOrder);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const updates = {};
if (gridLayout.isManualPlacement) {
const occupiedRects = [];
for (const clientId of blockOrder) {
const {
columnStart,
rowStart,
columnSpan = 1,
rowSpan = 1
} = getBlockAttributes(clientId).style?.layout ?? {};
if (!columnStart || !rowStart) {
continue;
}
occupiedRects.push(
new GridRect({
columnStart,
rowStart,
columnSpan,
rowSpan
})
);
}
for (const clientId of blockOrder) {
const attributes = getBlockAttributes(clientId);
const {
columnStart,
rowStart,
columnSpan = 1,
rowSpan = 1
} = attributes.style?.layout ?? {};
if (columnStart && rowStart) {
continue;
}
const [newColumnStart, newRowStart] = placeBlock(
occupiedRects,
gridLayout.columnCount,
columnSpan,
rowSpan,
previouslySelectedBlockRect?.columnEnd,
previouslySelectedBlockRect?.rowEnd
);
occupiedRects.push(
new GridRect({
columnStart: newColumnStart,
rowStart: newRowStart,
columnSpan,
rowSpan
})
);
updates[clientId] = {
style: {
...attributes.style,
layout: {
...attributes.style?.layout,
columnStart: newColumnStart,
rowStart: newRowStart
}
}
};
}
const bottomMostRow = Math.max(
...occupiedRects.map((r) => r.rowEnd)
);
if (!gridLayout.rowCount || gridLayout.rowCount < bottomMostRow) {
updates[gridClientId] = {
layout: {
...gridLayout,
rowCount: bottomMostRow
}
};
}
for (const clientId of previousBlockOrder ?? []) {
if (!blockOrder.includes(clientId)) {
const rootClientId = getBlockRootClientId(clientId);
if (rootClientId === null) {
continue;
}
const rootAttributes = getBlockAttributes(rootClientId);
if (rootAttributes?.layout?.type === "grid") {
continue;
}
const attributes = getBlockAttributes(clientId);
const {
columnStart,
rowStart,
columnSpan,
rowSpan,
...layout
} = attributes.style?.layout ?? {};
if (columnStart || rowStart || columnSpan || rowSpan) {
const hasEmptyLayoutAttribute = Object.keys(layout).length === 0;
updates[clientId] = setImmutably(
attributes,
["style", "layout"],
hasEmptyLayoutAttribute ? void 0 : layout
);
}
}
}
} else {
if (previousIsManualPlacement === true) {
for (const clientId of blockOrder) {
const attributes = getBlockAttributes(clientId);
const { columnStart, rowStart, ...layout } = attributes.style?.layout ?? {};
if (columnStart || rowStart) {
const hasEmptyLayoutAttribute = Object.keys(layout).length === 0;
updates[clientId] = setImmutably(
attributes,
["style", "layout"],
hasEmptyLayoutAttribute ? void 0 : layout
);
}
}
}
if (gridLayout.rowCount) {
updates[gridClientId] = {
layout: {
...gridLayout,
rowCount: void 0
}
};
}
}
if (Object.keys(updates).length) {
__unstableMarkNextChangeAsNotPersistent();
updateBlockAttributes(
Object.keys(updates),
updates,
/* uniqueByBlock: */
true
);
}
}, [
// Actual deps to sync:
gridClientId,
gridLayout,
previousBlockOrder,
blockOrder,
previouslySelectedBlockRect,
previousIsManualPlacement,
// These won't change, but the linter thinks they might:
__unstableMarkNextChangeAsNotPersistent,
getBlockAttributes,
getBlockRootClientId,
updateBlockAttributes
]);
}
function placeBlock(occupiedRects, gridColumnCount, blockColumnSpan, blockRowSpan, startColumn = 1, startRow = 1) {
for (let row = startRow; ; row++) {
for (let column = row === startRow ? startColumn : 1; column <= gridColumnCount; column++) {
const candidateRect = new GridRect({
columnStart: column,
rowStart: row,
columnSpan: blockColumnSpan,
rowSpan: blockRowSpan
});
if (!occupiedRects.some(
(r) => r.intersectsRect(candidateRect)
)) {
return [column, row];
}
}
}
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/grid-visualizer.js
function GridLayoutSync(props) {
useGridLayoutSync(props);
}
function grid_visualizer_GridTools({ clientId, layout }) {
const isVisible = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
isBlockSelected,
isDraggingBlocks,
getTemplateLock,
getBlockEditingMode
} = select(store);
if (!isDraggingBlocks() && !isBlockSelected(clientId) || getTemplateLock(clientId) || getBlockEditingMode(clientId) !== "default") {
return false;
}
return true;
},
[clientId]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GridLayoutSync, { clientId }),
isVisible && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GridVisualizer, { clientId, parentLayout: layout })
] });
}
const addGridVisualizerToBlockEdit = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
(BlockEdit) => (props) => {
if (props.attributes.layout?.type !== "grid") {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { ...props }, "edit");
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
grid_visualizer_GridTools,
{
clientId: props.clientId,
layout: props.attributes.layout
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { ...props }, "edit")
] });
},
"addGridVisualizerToBlockEdit"
);
(0,external_wp_hooks_namespaceObject.addFilter)(
"editor.BlockEdit",
"core/editor/grid-visualizer",
addGridVisualizerToBlockEdit
);
;// ./node_modules/@wordpress/block-editor/build-module/hooks/use-border-props.js
function getBorderClassesAndStyles(attributes) {
const border = attributes.style?.border || {};
const className = getBorderClasses(attributes);
return {
className: className || void 0,
style: getInlineStyles({ border })
};
}
function useBorderProps(attributes) {
const { colors } = useMultipleOriginColorsAndGradients();
const borderProps = getBorderClassesAndStyles(attributes);
const { borderColor } = attributes;
if (borderColor) {
const borderColorObject = getMultiOriginColor({
colors,
namedColor: borderColor
});
borderProps.style.borderColor = borderColorObject.color;
}
return borderProps;
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/use-shadow-props.js
function getShadowClassesAndStyles(attributes) {
const shadow = attributes.style?.shadow || "";
return {
style: getInlineStyles({ shadow })
};
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/use-color-props.js
function getColorClassesAndStyles(attributes) {
const { backgroundColor, textColor, gradient, style } = attributes;
const backgroundClass = getColorClassName(
"background-color",
backgroundColor
);
const textClass = getColorClassName("color", textColor);
const gradientClass = __experimentalGetGradientClass(gradient);
const hasGradient = gradientClass || style?.color?.gradient;
const className = dist_clsx(textClass, gradientClass, {
// Don't apply the background class if there's a gradient.
[backgroundClass]: !hasGradient && !!backgroundClass,
"has-text-color": textColor || style?.color?.text,
"has-background": backgroundColor || style?.color?.background || gradient || style?.color?.gradient,
"has-link-color": style?.elements?.link?.color
});
const colorStyles = style?.color || {};
const styleProp = getInlineStyles({ color: colorStyles });
return {
className: className || void 0,
style: styleProp
};
}
function useColorProps(attributes) {
const { backgroundColor, textColor, gradient } = attributes;
const [
userPalette,
themePalette,
defaultPalette,
userGradients,
themeGradients,
defaultGradients
] = use_settings_useSettings(
"color.palette.custom",
"color.palette.theme",
"color.palette.default",
"color.gradients.custom",
"color.gradients.theme",
"color.gradients.default"
);
const colors = (0,external_wp_element_namespaceObject.useMemo)(
() => [
...userPalette || [],
...themePalette || [],
...defaultPalette || []
],
[userPalette, themePalette, defaultPalette]
);
const gradients = (0,external_wp_element_namespaceObject.useMemo)(
() => [
...userGradients || [],
...themeGradients || [],
...defaultGradients || []
],
[userGradients, themeGradients, defaultGradients]
);
const colorProps = getColorClassesAndStyles(attributes);
if (backgroundColor) {
const backgroundColorObject = getColorObjectByAttributeValues(
colors,
backgroundColor
);
colorProps.style.backgroundColor = backgroundColorObject.color;
}
if (gradient) {
colorProps.style.background = getGradientValueBySlug(
gradients,
gradient
);
}
if (textColor) {
const textColorObject = getColorObjectByAttributeValues(
colors,
textColor
);
colorProps.style.color = textColorObject.color;
}
return colorProps;
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/use-spacing-props.js
function getSpacingClassesAndStyles(attributes) {
const { style } = attributes;
const spacingStyles = style?.spacing || {};
const styleProp = getInlineStyles({ spacing: spacingStyles });
return {
style: styleProp
};
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/use-typography-props.js
const { kebabCase: use_typography_props_kebabCase } = unlock(external_wp_components_namespaceObject.privateApis);
function getTypographyClassesAndStyles(attributes, settings) {
let typographyStyles = attributes?.style?.typography || {};
typographyStyles = {
...typographyStyles,
fontSize: getTypographyFontSizeValue(
{ size: attributes?.style?.typography?.fontSize },
settings
)
};
const style = getInlineStyles({ typography: typographyStyles });
const fontFamilyClassName = !!attributes?.fontFamily ? `has-${use_typography_props_kebabCase(attributes.fontFamily)}-font-family` : "";
const textAlignClassName = !!attributes?.style?.typography?.textAlign ? `has-text-align-${attributes?.style?.typography?.textAlign}` : "";
const className = dist_clsx(
fontFamilyClassName,
textAlignClassName,
getFontSizeClass(attributes?.fontSize)
);
return {
className,
style
};
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/use-cached-truthy.js
function useCachedTruthy(value) {
const [cachedValue, setCachedValue] = (0,external_wp_element_namespaceObject.useState)(value);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (value) {
setCachedValue(value);
}
}, [value]);
return cachedValue;
}
;// ./node_modules/@wordpress/block-editor/build-module/hooks/index.js
createBlockEditFilter(
[
align_default,
text_align_default,
anchor_default,
custom_class_name_default,
style_default,
duotone_default,
fit_text_default,
position_default,
layout_default,
content_lock_ui_default,
block_hooks_default,
block_bindings_default,
layout_child_default,
allowed_blocks_default
].filter(Boolean)
);
createBlockListBlockFilter([
align_default,
text_align_default,
background_default,
style_default,
color_default,
dimensions_default,
duotone_default,
font_family_default,
font_size_default,
fit_text_default,
border_default,
position_default,
block_style_variation_default,
layout_child_default
]);
createBlockSaveFilter([
align_default,
text_align_default,
anchor_default,
aria_label_default,
custom_class_name_default,
border_default,
fit_text_default,
color_default,
style_default,
font_family_default,
font_size_default
]);
;// ./node_modules/@wordpress/block-editor/build-module/components/colors/with-colors.js
const { kebabCase: with_colors_kebabCase } = unlock(external_wp_components_namespaceObject.privateApis);
const upperFirst = ([firstLetter, ...rest]) => firstLetter.toUpperCase() + rest.join("");
const withCustomColorPalette = (colorsArray) => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
(WrappedComponent) => (props) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { ...props, colors: colorsArray }),
"withCustomColorPalette"
);
const withEditorColorPalette = () => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
(WrappedComponent) => (props) => {
const [userPalette, themePalette, defaultPalette] = use_settings_useSettings(
"color.palette.custom",
"color.palette.theme",
"color.palette.default"
);
const allColors = (0,external_wp_element_namespaceObject.useMemo)(
() => [
...userPalette || [],
...themePalette || [],
...defaultPalette || []
],
[userPalette, themePalette, defaultPalette]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { ...props, colors: allColors });
},
"withEditorColorPalette"
);
function createColorHOC(colorTypes, withColorPalette) {
const colorMap = colorTypes.reduce((colorObject, colorType) => {
return {
...colorObject,
...typeof colorType === "string" ? { [colorType]: with_colors_kebabCase(colorType) } : colorType
};
}, {});
return (0,external_wp_compose_namespaceObject.compose)([
withColorPalette,
(WrappedComponent) => {
return class extends external_wp_element_namespaceObject.Component {
constructor(props) {
super(props);
this.setters = this.createSetters();
this.colorUtils = {
getMostReadableColor: this.getMostReadableColor.bind(this)
};
this.state = {};
}
getMostReadableColor(colorValue) {
const { colors } = this.props;
return getMostReadableColor(colors, colorValue);
}
createSetters() {
return Object.keys(colorMap).reduce(
(settersAccumulator, colorAttributeName) => {
const upperFirstColorAttributeName = upperFirst(colorAttributeName);
const customColorAttributeName = `custom${upperFirstColorAttributeName}`;
settersAccumulator[`set${upperFirstColorAttributeName}`] = this.createSetColor(
colorAttributeName,
customColorAttributeName
);
return settersAccumulator;
},
{}
);
}
createSetColor(colorAttributeName, customColorAttributeName) {
return (colorValue) => {
const colorObject = getColorObjectByColorValue(
this.props.colors,
colorValue
);
this.props.setAttributes({
[colorAttributeName]: colorObject && colorObject.slug ? colorObject.slug : void 0,
[customColorAttributeName]: colorObject && colorObject.slug ? void 0 : colorValue
});
};
}
static getDerivedStateFromProps({ attributes, colors }, previousState) {
return Object.entries(colorMap).reduce(
(newState, [colorAttributeName, colorContext]) => {
const colorObject = getColorObjectByAttributeValues(
colors,
attributes[colorAttributeName],
attributes[`custom${upperFirst(
colorAttributeName
)}`]
);
const previousColorObject = previousState[colorAttributeName];
const previousColor = previousColorObject?.color;
if (previousColor === colorObject.color && previousColorObject) {
newState[colorAttributeName] = previousColorObject;
} else {
newState[colorAttributeName] = {
...colorObject,
class: getColorClassName(
colorContext,
colorObject.slug
)
};
}
return newState;
},
{}
);
}
render() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
WrappedComponent,
{
...{
...this.props,
colors: void 0,
...this.state,
...this.setters,
colorUtils: this.colorUtils
}
}
);
}
};
}
]);
}
function createCustomColorsHOC(colorsArray) {
return (...colorTypes) => {
const withColorPalette = withCustomColorPalette(colorsArray);
return (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
createColorHOC(colorTypes, withColorPalette),
"withCustomColors"
);
};
}
function withColors(...colorTypes) {
const withColorPalette = withEditorColorPalette();
return (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
createColorHOC(colorTypes, withColorPalette),
"withColors"
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/colors/index.js
;// ./node_modules/@wordpress/block-editor/build-module/components/gradients/index.js
;// ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/font-size-picker.js
function font_size_picker_FontSizePicker(props) {
const [fontSizes, customFontSize] = use_settings_useSettings(
"typography.fontSizes",
"typography.customFontSize"
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.FontSizePicker,
{
...props,
fontSizes,
disableCustomFontSizes: !customFontSize
}
);
}
var font_size_picker_default = font_size_picker_FontSizePicker;
;// ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/with-font-sizes.js
const DEFAULT_FONT_SIZES = [];
const with_font_sizes_upperFirst = ([firstLetter, ...rest]) => firstLetter.toUpperCase() + rest.join("");
var with_font_sizes_default = (...fontSizeNames) => {
const fontSizeAttributeNames = fontSizeNames.reduce(
(fontSizeAttributeNamesAccumulator, fontSizeAttributeName) => {
fontSizeAttributeNamesAccumulator[fontSizeAttributeName] = `custom${with_font_sizes_upperFirst(fontSizeAttributeName)}`;
return fontSizeAttributeNamesAccumulator;
},
{}
);
return (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
(0,external_wp_compose_namespaceObject.compose)([
(0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
(WrappedComponent) => (props) => {
const [fontSizes] = use_settings_useSettings("typography.fontSizes");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
WrappedComponent,
{
...props,
fontSizes: fontSizes || DEFAULT_FONT_SIZES
}
);
},
"withFontSizes"
),
(WrappedComponent) => {
return class extends external_wp_element_namespaceObject.Component {
constructor(props) {
super(props);
this.setters = this.createSetters();
this.state = {};
}
createSetters() {
return Object.entries(fontSizeAttributeNames).reduce(
(settersAccumulator, [
fontSizeAttributeName,
customFontSizeAttributeName
]) => {
const upperFirstFontSizeAttributeName = with_font_sizes_upperFirst(fontSizeAttributeName);
settersAccumulator[`set${upperFirstFontSizeAttributeName}`] = this.createSetFontSize(
fontSizeAttributeName,
customFontSizeAttributeName
);
return settersAccumulator;
},
{}
);
}
createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName) {
return (fontSizeValue) => {
const fontSizeObject = this.props.fontSizes?.find(
({ size }) => size === Number(fontSizeValue)
);
this.props.setAttributes({
[fontSizeAttributeName]: fontSizeObject && fontSizeObject.slug ? fontSizeObject.slug : void 0,
[customFontSizeAttributeName]: fontSizeObject && fontSizeObject.slug ? void 0 : fontSizeValue
});
};
}
static getDerivedStateFromProps({ attributes, fontSizes }, previousState) {
const didAttributesChange = (customFontSizeAttributeName, fontSizeAttributeName) => {
if (previousState[fontSizeAttributeName]) {
if (attributes[fontSizeAttributeName]) {
return attributes[fontSizeAttributeName] !== previousState[fontSizeAttributeName].slug;
}
return previousState[fontSizeAttributeName].size !== attributes[customFontSizeAttributeName];
}
return true;
};
if (!Object.values(fontSizeAttributeNames).some(
didAttributesChange
)) {
return null;
}
const newState = Object.entries(
fontSizeAttributeNames
).filter(
([key, value]) => didAttributesChange(value, key)
).reduce(
(newStateAccumulator, [
fontSizeAttributeName,
customFontSizeAttributeName
]) => {
const fontSizeAttributeValue = attributes[fontSizeAttributeName];
const fontSizeObject = utils_getFontSize(
fontSizes,
fontSizeAttributeValue,
attributes[customFontSizeAttributeName]
);
newStateAccumulator[fontSizeAttributeName] = {
...fontSizeObject,
class: getFontSizeClass(
fontSizeAttributeValue
)
};
return newStateAccumulator;
},
{}
);
return {
...previousState,
...newState
};
}
render() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
WrappedComponent,
{
...{
...this.props,
fontSizes: void 0,
...this.state,
...this.setters
}
}
);
}
};
}
]),
"withFontSizes"
);
};
;// ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/index.js
;// ./node_modules/@wordpress/block-editor/build-module/autocompleters/block.js
const block_noop = () => {
};
const block_SHOWN_BLOCK_TYPES = 9;
function createBlockCompleter() {
return {
name: "blocks",
className: "block-editor-autocompleters__block",
triggerPrefix: "/",
useItems(filterValue) {
const { rootClientId, selectedBlockId, prioritizedBlocks } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const {
getSelectedBlockClientId,
getBlock,
getBlockListSettings,
getBlockRootClientId
} = select(store);
const { getActiveBlockVariation } = select(external_wp_blocks_namespaceObject.store);
const selectedBlockClientId = getSelectedBlockClientId();
const { name: blockName, attributes } = getBlock(
selectedBlockClientId
);
const activeBlockVariation = getActiveBlockVariation(
blockName,
attributes
);
const _rootClientId = getBlockRootClientId(
selectedBlockClientId
);
return {
selectedBlockId: activeBlockVariation ? `${blockName}/${activeBlockVariation.name}` : blockName,
rootClientId: _rootClientId,
prioritizedBlocks: getBlockListSettings(_rootClientId)?.prioritizedInserterBlocks
};
}, []);
const [items, categories, collections] = use_block_types_state_default(
rootClientId,
block_noop,
true
);
const filteredItems = (0,external_wp_element_namespaceObject.useMemo)(() => {
const initialFilteredItems = !!filterValue.trim() ? searchBlockItems(
items,
categories,
collections,
filterValue
) : orderInserterBlockItems(
orderBy(items, "frecency", "desc"),
prioritizedBlocks
);
return initialFilteredItems.filter((item) => item.id !== selectedBlockId).slice(0, block_SHOWN_BLOCK_TYPES);
}, [
filterValue,
selectedBlockId,
items,
categories,
collections,
prioritizedBlocks
]);
const options = (0,external_wp_element_namespaceObject.useMemo)(
() => filteredItems.map((blockItem) => {
const { title, icon, isDisabled } = blockItem;
return {
key: `block-${blockItem.id}`,
value: blockItem,
label: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_icon_default,
{
icon,
showColors: true
},
"icon"
),
title
] }),
isDisabled
};
}),
[filteredItems]
);
return [options];
},
allowContext(before, after) {
return !(/\S/.test(before) || /\S/.test(after));
},
getOptionCompletion(inserterItem) {
const { name, initialAttributes, innerBlocks, syncStatus, blocks } = inserterItem;
return {
action: "replace",
value: syncStatus === "unsynced" ? (blocks ?? []).map(
(block) => (0,external_wp_blocks_namespaceObject.cloneBlock)(block)
) : (0,external_wp_blocks_namespaceObject.createBlock)(
name,
initialAttributes,
(0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(
innerBlocks
)
)
};
}
};
}
var block_block_default = createBlockCompleter();
;// external ["wp","apiFetch"]
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
;// ./node_modules/@wordpress/icons/build-module/library/post.js
var post_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/autocompleters/link.js
const SHOWN_SUGGESTIONS = 10;
function createLinkCompleter() {
return {
name: "links",
className: "block-editor-autocompleters__link",
triggerPrefix: "[[",
options: async (letters) => {
let options = await external_wp_apiFetch_default()({
path: (0,external_wp_url_namespaceObject.addQueryArgs)("/wp/v2/search", {
per_page: SHOWN_SUGGESTIONS,
search: letters,
type: "post",
order_by: "menu_order"
})
});
options = options.filter((option) => option.title !== "");
return options;
},
getOptionKeywords(item) {
const expansionWords = item.title.split(/\s+/);
return [...expansionWords];
},
getOptionLabel(item) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
icon_default,
{
icon: item.subtype === "page" ? page_default : post_default
},
"icon"
),
(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title)
] });
},
getOptionCompletion(item) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: item.url, children: item.title });
}
};
}
var link_link_default = createLinkCompleter();
;// ./node_modules/@wordpress/block-editor/build-module/components/autocomplete/index.js
const autocomplete_EMPTY_ARRAY = [];
function useCompleters({ completers = autocomplete_EMPTY_ARRAY }) {
const { name } = useBlockEditContext();
return (0,external_wp_element_namespaceObject.useMemo)(() => {
let filteredCompleters = [...completers, link_link_default];
if (name === (0,external_wp_blocks_namespaceObject.getDefaultBlockName)() || (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, "__experimentalSlashInserter", false)) {
filteredCompleters = [...filteredCompleters, block_block_default];
}
if ((0,external_wp_hooks_namespaceObject.hasFilter)("editor.Autocomplete.completers")) {
if (filteredCompleters === completers) {
filteredCompleters = filteredCompleters.map(
(completer) => ({ ...completer })
);
}
filteredCompleters = (0,external_wp_hooks_namespaceObject.applyFilters)(
"editor.Autocomplete.completers",
filteredCompleters,
name
);
}
return filteredCompleters;
}, [completers, name]);
}
function useBlockEditorAutocompleteProps(props) {
return (0,external_wp_components_namespaceObject.__unstableUseAutocompleteProps)({
...props,
completers: useCompleters(props)
});
}
function BlockEditorAutocomplete(props) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Autocomplete, { ...props, completers: useCompleters(props) });
}
var autocomplete_default = BlockEditorAutocomplete;
;// ./node_modules/@wordpress/icons/build-module/library/fullscreen.js
var fullscreen_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/block-full-height-alignment-control/index.js
function BlockFullHeightAlignmentControl({
isActive,
label = (0,external_wp_i18n_namespaceObject.__)("Full height"),
onToggle,
isDisabled
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
isActive,
icon: fullscreen_default,
label,
onClick: () => onToggle(!isActive),
disabled: isDisabled
}
);
}
var block_full_height_alignment_control_default = BlockFullHeightAlignmentControl;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-matrix-control/index.js
const block_alignment_matrix_control_noop = () => {
};
function BlockAlignmentMatrixControl(props) {
const {
label = (0,external_wp_i18n_namespaceObject.__)("Change matrix alignment"),
onChange = block_alignment_matrix_control_noop,
value = "center",
isDisabled
} = props;
const icon = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.AlignmentMatrixControl.Icon, { value });
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
popoverProps: { placement: "bottom-start" },
renderToggle: ({ onToggle, isOpen }) => {
const openOnArrowDown = (event) => {
if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) {
event.preventDefault();
onToggle();
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
onClick: onToggle,
"aria-haspopup": "true",
"aria-expanded": isOpen,
onKeyDown: openOnArrowDown,
label,
icon,
showTooltip: true,
disabled: isDisabled
}
);
},
renderContent: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.AlignmentMatrixControl,
{
hasFocusBorder: false,
onChange,
value
}
)
}
);
}
var block_alignment_matrix_control_default = BlockAlignmentMatrixControl;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-title/use-block-display-title.js
function useBlockDisplayTitle({
clientId,
maximumLength,
context
}) {
const blockTitle = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
if (!clientId) {
return null;
}
const { getBlockName, getBlockAttributes } = select(store);
const { getBlockType, getActiveBlockVariation } = select(external_wp_blocks_namespaceObject.store);
const blockName = getBlockName(clientId);
const blockType = getBlockType(blockName);
if (!blockType) {
return null;
}
const attributes = getBlockAttributes(clientId);
const label = (0,external_wp_blocks_namespaceObject.__experimentalGetBlockLabel)(blockType, attributes, context);
if (label !== blockType.title) {
return label;
}
const match = getActiveBlockVariation(blockName, attributes);
return match?.title || blockType.title;
},
[clientId, context]
);
if (!blockTitle) {
return null;
}
if (maximumLength && maximumLength > 0 && blockTitle.length > maximumLength) {
const omission = "...";
return blockTitle.slice(0, maximumLength - omission.length) + omission;
}
return blockTitle;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-title/index.js
function BlockTitle({ clientId, maximumLength, context }) {
return useBlockDisplayTitle({ clientId, maximumLength, context });
}
;// ./node_modules/@wordpress/block-editor/build-module/utils/get-editor-region.js
function getEditorRegion(editor) {
if (!editor) {
return null;
}
const editorCanvas = Array.from(
document.querySelectorAll('iframe[name="editor-canvas"]').values()
).find((iframe) => {
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
return iframeDocument === editor.ownerDocument;
}) ?? editor;
return editorCanvas?.closest('[role="region"]') ?? editorCanvas;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-breadcrumb/index.js
function BlockBreadcrumb({ rootLabelText }) {
const { selectBlock, clearSelectedBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const { clientId, parents, hasSelection } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const {
getSelectionStart,
getSelectedBlockClientId,
getEnabledBlockParents
} = unlock(select(store));
const selectedBlockClientId = getSelectedBlockClientId();
return {
parents: getEnabledBlockParents(selectedBlockClientId),
clientId: selectedBlockClientId,
hasSelection: !!getSelectionStart().clientId
};
}, []);
const rootLabel = rootLabelText || (0,external_wp_i18n_namespaceObject.__)("Document");
const blockRef = (0,external_wp_element_namespaceObject.useRef)();
useBlockElementRef(clientId, blockRef);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"ul",
{
className: "block-editor-block-breadcrumb",
role: "list",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Block breadcrumb"),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"li",
{
className: !hasSelection ? "block-editor-block-breadcrumb__current" : void 0,
"aria-current": !hasSelection ? "true" : void 0,
children: [
hasSelection && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "small",
className: "block-editor-block-breadcrumb__button",
onClick: () => {
const blockEditor = blockRef.current?.closest(
".editor-styles-wrapper"
);
clearSelectedBlock();
getEditorRegion(blockEditor)?.focus();
},
children: rootLabel
}
),
!hasSelection && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: rootLabel }),
!!clientId && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
icon_default,
{
icon: chevron_right_small_default,
className: "block-editor-block-breadcrumb__separator"
}
)
]
}
),
parents.map((parentClientId) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "small",
className: "block-editor-block-breadcrumb__button",
onClick: () => selectBlock(parentClientId),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockTitle,
{
clientId: parentClientId,
maximumLength: 35
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
icon_default,
{
icon: chevron_right_small_default,
className: "block-editor-block-breadcrumb__separator"
}
)
] }, parentClientId)),
!!clientId && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"li",
{
className: "block-editor-block-breadcrumb__current",
"aria-current": "true",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockTitle, { clientId, maximumLength: 35 })
}
)
]
}
);
}
var block_breadcrumb_default = BlockBreadcrumb;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-content-overlay/index.js
function useBlockOverlayActive(clientId) {
return (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { __unstableHasActiveBlockOverlayActive } = select(store);
return __unstableHasActiveBlockOverlayActive(clientId);
},
[clientId]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/use-block-toolbar-popover-props.js
const COMMON_PROPS = {
placement: "top-start"
};
const DEFAULT_PROPS = {
...COMMON_PROPS,
flip: false,
shift: true
};
const RESTRICTED_HEIGHT_PROPS = {
...COMMON_PROPS,
flip: true,
shift: false
};
function getProps(contentElement, selectedBlockElement, scrollContainer, toolbarHeight, isSticky) {
if (!contentElement || !selectedBlockElement) {
return DEFAULT_PROPS;
}
const scrollTop = scrollContainer?.scrollTop || 0;
const blockRect = getElementBounds(selectedBlockElement);
const contentRect = contentElement.getBoundingClientRect();
const topOfContentElementInViewport = scrollTop + contentRect.top;
const viewportHeight = contentElement.ownerDocument.documentElement.clientHeight;
const restrictedTopArea = topOfContentElementInViewport + toolbarHeight;
const hasSpaceForToolbarAbove = blockRect.top > restrictedTopArea;
const isBlockTallerThanViewport = blockRect.height > viewportHeight - toolbarHeight;
if (!isSticky && (hasSpaceForToolbarAbove || isBlockTallerThanViewport)) {
return DEFAULT_PROPS;
}
return RESTRICTED_HEIGHT_PROPS;
}
function useBlockToolbarPopoverProps({
contentElement,
clientId
}) {
const selectedBlockElement = useBlockElement(clientId);
const [toolbarHeight, setToolbarHeight] = (0,external_wp_element_namespaceObject.useState)(0);
const { blockIndex, isSticky } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockIndex, getBlockAttributes } = select(store);
return {
blockIndex: getBlockIndex(clientId),
isSticky: hasStickyOrFixedPositionValue(
getBlockAttributes(clientId)
)
};
},
[clientId]
);
const scrollContainer = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!contentElement) {
return;
}
return (0,external_wp_dom_namespaceObject.getScrollContainer)(contentElement);
}, [contentElement]);
const [props, setProps] = (0,external_wp_element_namespaceObject.useState)(
() => getProps(
contentElement,
selectedBlockElement,
scrollContainer,
toolbarHeight,
isSticky
)
);
const popoverRef = (0,external_wp_compose_namespaceObject.useRefEffect)((popoverNode) => {
setToolbarHeight(popoverNode.offsetHeight);
}, []);
const updateProps = (0,external_wp_element_namespaceObject.useCallback)(
() => setProps(
getProps(
contentElement,
selectedBlockElement,
scrollContainer,
toolbarHeight,
isSticky
)
),
[contentElement, selectedBlockElement, scrollContainer, toolbarHeight]
);
(0,external_wp_element_namespaceObject.useLayoutEffect)(updateProps, [blockIndex, updateProps]);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (!contentElement || !selectedBlockElement) {
return;
}
const contentView = contentElement?.ownerDocument?.defaultView;
contentView?.addEventHandler?.("resize", updateProps);
let resizeObserver;
const blockView = selectedBlockElement?.ownerDocument?.defaultView;
if (blockView.ResizeObserver) {
resizeObserver = new blockView.ResizeObserver(updateProps);
resizeObserver.observe(selectedBlockElement);
}
return () => {
contentView?.removeEventHandler?.("resize", updateProps);
if (resizeObserver) {
resizeObserver.disconnect();
}
};
}, [updateProps, contentElement, selectedBlockElement]);
return {
...props,
ref: popoverRef
};
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/use-selected-block-tool-props.js
function useSelectedBlockToolProps(clientId) {
const selectedBlockProps = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getBlockRootClientId,
getBlockParents,
__experimentalGetBlockListSettingsForBlocks,
isBlockInsertionPointVisible,
getBlockInsertionPoint,
getBlockOrder,
hasMultiSelection,
getLastMultiSelectedBlockClientId
} = select(store);
const blockParentsClientIds = getBlockParents(clientId);
const parentBlockListSettings = __experimentalGetBlockListSettingsForBlocks(
blockParentsClientIds
);
const capturingClientId = blockParentsClientIds.find(
(parentClientId) => parentBlockListSettings[parentClientId]?.__experimentalCaptureToolbars
);
let isInsertionPointVisible = false;
if (isBlockInsertionPointVisible()) {
const insertionPoint = getBlockInsertionPoint();
const order = getBlockOrder(insertionPoint.rootClientId);
isInsertionPointVisible = order[insertionPoint.index] === clientId;
}
return {
capturingClientId,
isInsertionPointVisible,
lastClientId: hasMultiSelection() ? getLastMultiSelectedBlockClientId() : null,
rootClientId: getBlockRootClientId(clientId)
};
},
[clientId]
);
return selectedBlockProps;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/empty-block-inserter.js
function EmptyBlockInserter({
clientId,
__unstableContentRef
}) {
const {
capturingClientId,
isInsertionPointVisible,
lastClientId,
rootClientId
} = useSelectedBlockToolProps(clientId);
const popoverProps = useBlockToolbarPopoverProps({
contentElement: __unstableContentRef?.current,
clientId
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
cover_default,
{
clientId: capturingClientId || clientId,
bottomClientId: lastClientId,
className: dist_clsx(
"block-editor-block-list__block-side-inserter-popover",
{
"is-insertion-point-visible": isInsertionPointVisible
}
),
__unstableContentRef,
...popoverProps,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-list__empty-block-inserter", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inserter_default,
{
position: "bottom right",
rootClientId,
clientId,
__experimentalIsQuick: true
}
) })
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/use-scroll-when-dragging.js
const SCROLL_INACTIVE_DISTANCE_PX = 50;
const SCROLL_INTERVAL_MS = 25;
const PIXELS_PER_SECOND_PER_PERCENTAGE = 1e3;
const VELOCITY_MULTIPLIER = PIXELS_PER_SECOND_PER_PERCENTAGE * (SCROLL_INTERVAL_MS / 1e3);
function useScrollWhenDragging() {
const dragStartYRef = (0,external_wp_element_namespaceObject.useRef)(null);
const velocityYRef = (0,external_wp_element_namespaceObject.useRef)(null);
const scrollParentYRef = (0,external_wp_element_namespaceObject.useRef)(null);
const scrollEditorIntervalRef = (0,external_wp_element_namespaceObject.useRef)(null);
(0,external_wp_element_namespaceObject.useEffect)(
() => () => {
if (scrollEditorIntervalRef.current) {
clearInterval(scrollEditorIntervalRef.current);
scrollEditorIntervalRef.current = null;
}
},
[]
);
const startScrolling = (0,external_wp_element_namespaceObject.useCallback)((event) => {
dragStartYRef.current = event.clientY;
scrollParentYRef.current = (0,external_wp_dom_namespaceObject.getScrollContainer)(event.target);
scrollEditorIntervalRef.current = setInterval(() => {
if (scrollParentYRef.current && velocityYRef.current) {
const newTop = scrollParentYRef.current.scrollTop + velocityYRef.current;
scrollParentYRef.current.scroll({
top: newTop
});
}
}, SCROLL_INTERVAL_MS);
}, []);
const scrollOnDragOver = (0,external_wp_element_namespaceObject.useCallback)((event) => {
if (!scrollParentYRef.current) {
return;
}
const scrollParentHeight = scrollParentYRef.current.offsetHeight;
const offsetDragStartPosition = dragStartYRef.current - scrollParentYRef.current.offsetTop;
const offsetDragPosition = event.clientY - scrollParentYRef.current.offsetTop;
if (event.clientY > offsetDragStartPosition) {
const moveableDistance = Math.max(
scrollParentHeight - offsetDragStartPosition - SCROLL_INACTIVE_DISTANCE_PX,
0
);
const dragDistance = Math.max(
offsetDragPosition - offsetDragStartPosition - SCROLL_INACTIVE_DISTANCE_PX,
0
);
const distancePercentage = moveableDistance === 0 || dragDistance === 0 ? 0 : dragDistance / moveableDistance;
velocityYRef.current = VELOCITY_MULTIPLIER * distancePercentage;
} else if (event.clientY < offsetDragStartPosition) {
const moveableDistance = Math.max(
offsetDragStartPosition - SCROLL_INACTIVE_DISTANCE_PX,
0
);
const dragDistance = Math.max(
offsetDragStartPosition - offsetDragPosition - SCROLL_INACTIVE_DISTANCE_PX,
0
);
const distancePercentage = moveableDistance === 0 || dragDistance === 0 ? 0 : dragDistance / moveableDistance;
velocityYRef.current = -VELOCITY_MULTIPLIER * distancePercentage;
} else {
velocityYRef.current = 0;
}
}, []);
const stopScrolling = () => {
dragStartYRef.current = null;
scrollParentYRef.current = null;
if (scrollEditorIntervalRef.current) {
clearInterval(scrollEditorIntervalRef.current);
scrollEditorIntervalRef.current = null;
}
};
return [startScrolling, scrollOnDragOver, stopScrolling];
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/index.js
const BlockDraggable = ({
appendToOwnerDocument,
children,
clientIds,
cloneClassname,
elementId,
onDragStart,
onDragEnd,
fadeWhenDisabled = false,
dragComponent
}) => {
const {
srcRootClientId,
isDraggable,
icon,
visibleInserter,
getBlockType
} = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
canMoveBlocks,
getBlockRootClientId: getBlockRootClientId2,
getBlockName,
getBlockAttributes,
isBlockInsertionPointVisible
} = select(store);
const { getBlockType: _getBlockType, getActiveBlockVariation } = select(external_wp_blocks_namespaceObject.store);
const rootClientId = getBlockRootClientId2(clientIds[0]);
const blockName = getBlockName(clientIds[0]);
const variation = getActiveBlockVariation(
blockName,
getBlockAttributes(clientIds[0])
);
return {
srcRootClientId: rootClientId,
isDraggable: canMoveBlocks(clientIds),
icon: variation?.icon || _getBlockType(blockName)?.icon,
visibleInserter: isBlockInsertionPointVisible(),
getBlockType: _getBlockType
};
},
[clientIds]
);
const isDraggingRef = (0,external_wp_element_namespaceObject.useRef)(false);
const [startScrolling, scrollOnDragOver, stopScrolling] = useScrollWhenDragging();
const { getAllowedBlocks, getBlockNamesByClientId, getBlockRootClientId } = (0,external_wp_data_namespaceObject.useSelect)(store);
const { startDraggingBlocks, stopDraggingBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(store);
(0,external_wp_element_namespaceObject.useEffect)(() => {
return () => {
if (isDraggingRef.current) {
stopDraggingBlocks();
}
};
}, []);
const blockEl = useBlockElement(clientIds[0]);
const editorRoot = blockEl?.closest("body");
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!editorRoot || !fadeWhenDisabled) {
return;
}
const onDragOver = (event) => {
if (!event.target.closest("[data-block]")) {
return;
}
const draggedBlockNames = getBlockNamesByClientId(clientIds);
const targetClientId = event.target.closest("[data-block]").getAttribute("data-block");
const allowedBlocks = getAllowedBlocks(targetClientId);
const targetBlockName = getBlockNamesByClientId([
targetClientId
])[0];
let dropTargetValid;
if (allowedBlocks?.length === 0) {
const targetRootClientId = getBlockRootClientId(targetClientId);
const targetRootBlockName = getBlockNamesByClientId([
targetRootClientId
])[0];
const rootAllowedBlocks = getAllowedBlocks(targetRootClientId);
dropTargetValid = isDropTargetValid(
getBlockType,
rootAllowedBlocks,
draggedBlockNames,
targetRootBlockName
);
} else {
dropTargetValid = isDropTargetValid(
getBlockType,
allowedBlocks,
draggedBlockNames,
targetBlockName
);
}
if (!dropTargetValid && !visibleInserter) {
window?.document?.body?.classList?.add(
"block-draggable-invalid-drag-token"
);
} else {
window?.document?.body?.classList?.remove(
"block-draggable-invalid-drag-token"
);
}
};
const throttledOnDragOver = (0,external_wp_compose_namespaceObject.throttle)(onDragOver, 200);
editorRoot.addEventListener("dragover", throttledOnDragOver);
return () => {
editorRoot.removeEventListener("dragover", throttledOnDragOver);
};
}, [
clientIds,
editorRoot,
fadeWhenDisabled,
getAllowedBlocks,
getBlockNamesByClientId,
getBlockRootClientId,
getBlockType,
visibleInserter
]);
if (!isDraggable) {
return children({ draggable: false });
}
const transferData = {
type: "block",
srcClientIds: clientIds,
srcRootClientId
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Draggable,
{
appendToOwnerDocument,
cloneClassname,
__experimentalTransferDataType: "wp-blocks",
transferData,
onDragStart: (event) => {
window.requestAnimationFrame(() => {
startDraggingBlocks(clientIds);
isDraggingRef.current = true;
startScrolling(event);
if (onDragStart) {
onDragStart();
}
});
},
onDragOver: scrollOnDragOver,
onDragEnd: () => {
stopDraggingBlocks();
isDraggingRef.current = false;
stopScrolling();
if (onDragEnd) {
onDragEnd();
}
},
__experimentalDragComponent: (
// Check against `undefined` so that `null` can be used to disable
// the default drag component.
dragComponent !== void 0 ? dragComponent : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockDraggableChip,
{
count: clientIds.length,
icon,
fadeWhenDisabled: true
}
)
),
elementId,
children: ({ onDraggableStart, onDraggableEnd }) => {
return children({
draggable: true,
onDragStart: onDraggableStart,
onDragEnd: onDraggableEnd
});
}
}
);
};
var block_draggable_default = BlockDraggable;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-mover/mover-description.js
const getMovementDirection = (moveDirection, orientation) => {
if (moveDirection === "up") {
if (orientation === "horizontal") {
return (0,external_wp_i18n_namespaceObject.isRTL)() ? "right" : "left";
}
return "up";
} else if (moveDirection === "down") {
if (orientation === "horizontal") {
return (0,external_wp_i18n_namespaceObject.isRTL)() ? "left" : "right";
}
return "down";
}
return null;
};
function getBlockMoverDescription(selectedCount, type, firstIndex, isFirst, isLast, dir, orientation) {
const position = firstIndex + 1;
if (selectedCount > 1) {
return getMultiBlockMoverDescription(
selectedCount,
firstIndex,
isFirst,
isLast,
dir,
orientation
);
}
if (isFirst && isLast) {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Type of block (i.e. Text, Image etc)
(0,external_wp_i18n_namespaceObject.__)("Block %s is the only block, and cannot be moved"),
type
);
}
if (dir > 0 && !isLast) {
const movementDirection = getMovementDirection("down", orientation);
if (movementDirection === "down") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
(0,external_wp_i18n_namespaceObject.__)(
"Move %1$s block from position %2$d down to position %3$d"
),
type,
position,
position + 1
);
}
if (movementDirection === "left") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
(0,external_wp_i18n_namespaceObject.__)(
"Move %1$s block from position %2$d left to position %3$d"
),
type,
position,
position + 1
);
}
if (movementDirection === "right") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
(0,external_wp_i18n_namespaceObject.__)(
"Move %1$s block from position %2$d right to position %3$d"
),
type,
position,
position + 1
);
}
}
if (dir > 0 && isLast) {
const movementDirection = getMovementDirection("down", orientation);
if (movementDirection === "down") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc)
(0,external_wp_i18n_namespaceObject.__)(
"Block %1$s is at the end of the content and can\u2019t be moved down"
),
type
);
}
if (movementDirection === "left") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc)
(0,external_wp_i18n_namespaceObject.__)(
"Block %1$s is at the end of the content and can\u2019t be moved left"
),
type
);
}
if (movementDirection === "right") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc)
(0,external_wp_i18n_namespaceObject.__)(
"Block %1$s is at the end of the content and can\u2019t be moved right"
),
type
);
}
}
if (dir < 0 && !isFirst) {
const movementDirection = getMovementDirection("up", orientation);
if (movementDirection === "up") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
(0,external_wp_i18n_namespaceObject.__)("Move %1$s block from position %2$d up to position %3$d"),
type,
position,
position - 1
);
}
if (movementDirection === "left") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
(0,external_wp_i18n_namespaceObject.__)(
"Move %1$s block from position %2$d left to position %3$d"
),
type,
position,
position - 1
);
}
if (movementDirection === "right") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
(0,external_wp_i18n_namespaceObject.__)(
"Move %1$s block from position %2$d right to position %3$d"
),
type,
position,
position - 1
);
}
}
if (dir < 0 && isFirst) {
const movementDirection = getMovementDirection("up", orientation);
if (movementDirection === "up") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc)
(0,external_wp_i18n_namespaceObject.__)(
"Block %1$s is at the beginning of the content and can\u2019t be moved up"
),
type
);
}
if (movementDirection === "left") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc)
(0,external_wp_i18n_namespaceObject.__)(
"Block %1$s is at the beginning of the content and can\u2019t be moved left"
),
type
);
}
if (movementDirection === "right") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc)
(0,external_wp_i18n_namespaceObject.__)(
"Block %1$s is at the beginning of the content and can\u2019t be moved right"
),
type
);
}
}
}
function getMultiBlockMoverDescription(selectedCount, firstIndex, isFirst, isLast, dir, orientation) {
const position = firstIndex + 1;
if (isFirst && isLast) {
return (0,external_wp_i18n_namespaceObject.__)("All blocks are selected, and cannot be moved");
}
if (dir > 0 && !isLast) {
const movementDirection = getMovementDirection("down", orientation);
if (movementDirection === "down") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,external_wp_i18n_namespaceObject.__)("Move %1$d blocks from position %2$d down by one place"),
selectedCount,
position
);
}
if (movementDirection === "left") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,external_wp_i18n_namespaceObject.__)("Move %1$d blocks from position %2$d left by one place"),
selectedCount,
position
);
}
if (movementDirection === "right") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,external_wp_i18n_namespaceObject.__)("Move %1$d blocks from position %2$d right by one place"),
selectedCount,
position
);
}
}
if (dir > 0 && isLast) {
const movementDirection = getMovementDirection("down", orientation);
if (movementDirection === "down") {
return (0,external_wp_i18n_namespaceObject.__)(
"Blocks cannot be moved down as they are already at the bottom"
);
}
if (movementDirection === "left") {
return (0,external_wp_i18n_namespaceObject.__)(
"Blocks cannot be moved left as they are already are at the leftmost position"
);
}
if (movementDirection === "right") {
return (0,external_wp_i18n_namespaceObject.__)(
"Blocks cannot be moved right as they are already are at the rightmost position"
);
}
}
if (dir < 0 && !isFirst) {
const movementDirection = getMovementDirection("up", orientation);
if (movementDirection === "up") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,external_wp_i18n_namespaceObject.__)("Move %1$d blocks from position %2$d up by one place"),
selectedCount,
position
);
}
if (movementDirection === "left") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,external_wp_i18n_namespaceObject.__)("Move %1$d blocks from position %2$d left by one place"),
selectedCount,
position
);
}
if (movementDirection === "right") {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,external_wp_i18n_namespaceObject.__)("Move %1$d blocks from position %2$d right by one place"),
selectedCount,
position
);
}
}
if (dir < 0 && isFirst) {
const movementDirection = getMovementDirection("up", orientation);
if (movementDirection === "up") {
return (0,external_wp_i18n_namespaceObject.__)(
"Blocks cannot be moved up as they are already at the top"
);
}
if (movementDirection === "left") {
return (0,external_wp_i18n_namespaceObject.__)(
"Blocks cannot be moved left as they are already are at the leftmost position"
);
}
if (movementDirection === "right") {
return (0,external_wp_i18n_namespaceObject.__)(
"Blocks cannot be moved right as they are already are at the rightmost position"
);
}
}
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-mover/button.js
const getArrowIcon = (direction, orientation) => {
if (direction === "up") {
if (orientation === "horizontal") {
return (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right_default : chevron_left_default;
}
return chevron_up_default;
} else if (direction === "down") {
if (orientation === "horizontal") {
return (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_default : chevron_right_default;
}
return chevron_down_default;
}
return null;
};
const getMovementDirectionLabel = (moveDirection, orientation) => {
if (moveDirection === "up") {
if (orientation === "horizontal") {
return (0,external_wp_i18n_namespaceObject.isRTL)() ? (0,external_wp_i18n_namespaceObject.__)("Move right") : (0,external_wp_i18n_namespaceObject.__)("Move left");
}
return (0,external_wp_i18n_namespaceObject.__)("Move up");
} else if (moveDirection === "down") {
if (orientation === "horizontal") {
return (0,external_wp_i18n_namespaceObject.isRTL)() ? (0,external_wp_i18n_namespaceObject.__)("Move left") : (0,external_wp_i18n_namespaceObject.__)("Move right");
}
return (0,external_wp_i18n_namespaceObject.__)("Move down");
}
return null;
};
const BlockMoverButton = (0,external_wp_element_namespaceObject.forwardRef)(
({ clientIds, direction, orientation: moverOrientation, ...props }, ref) => {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockMoverButton);
const normalizedClientIds = Array.isArray(clientIds) ? clientIds : [clientIds];
const blocksCount = normalizedClientIds.length;
const { disabled } = props;
const {
blockType,
isDisabled,
rootClientId,
isFirst,
isLast,
firstIndex,
orientation = "vertical"
} = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getBlockIndex,
getBlockRootClientId,
getBlockOrder,
getBlock,
getBlockListSettings
} = select(store);
const firstClientId = normalizedClientIds[0];
const blockRootClientId = getBlockRootClientId(firstClientId);
const firstBlockIndex = getBlockIndex(firstClientId);
const lastBlockIndex = getBlockIndex(
normalizedClientIds[normalizedClientIds.length - 1]
);
const blockOrder = getBlockOrder(blockRootClientId);
const block = getBlock(firstClientId);
const isFirstBlock = firstBlockIndex === 0;
const isLastBlock = lastBlockIndex === blockOrder.length - 1;
const { orientation: blockListOrientation } = getBlockListSettings(blockRootClientId) || {};
return {
blockType: block ? (0,external_wp_blocks_namespaceObject.getBlockType)(block.name) : null,
isDisabled: disabled || (direction === "up" ? isFirstBlock : isLastBlock),
rootClientId: blockRootClientId,
firstIndex: firstBlockIndex,
isFirst: isFirstBlock,
isLast: isLastBlock,
orientation: moverOrientation || blockListOrientation
};
},
[clientIds, direction]
);
const { moveBlocksDown, moveBlocksUp } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const moverFunction = direction === "up" ? moveBlocksUp : moveBlocksDown;
const onClick = (event) => {
moverFunction(clientIds, rootClientId);
if (props.onClick) {
props.onClick(event);
}
};
const descriptionId = `block-editor-block-mover-button__description-${instanceId}`;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
ref,
className: dist_clsx(
"block-editor-block-mover-button",
`is-${direction}-button`
),
icon: getArrowIcon(direction, orientation),
label: getMovementDirectionLabel(
direction,
orientation
),
"aria-describedby": descriptionId,
...props,
onClick: isDisabled ? null : onClick,
disabled: isDisabled,
accessibleWhenDisabled: true
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: descriptionId, children: getBlockMoverDescription(
blocksCount,
blockType && blockType.title,
firstIndex,
isFirst,
isLast,
direction === "up" ? -1 : 1,
orientation
) })
] });
}
);
const BlockMoverUpButton = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockMoverButton, { direction: "up", ref, ...props });
});
const BlockMoverDownButton = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockMoverButton, { direction: "down", ref, ...props });
});
;// ./node_modules/@wordpress/block-editor/build-module/components/block-mover/index.js
function BlockMover({
clientIds,
hideDragHandle,
isBlockMoverUpButtonDisabled,
isBlockMoverDownButtonDisabled
}) {
const {
canMove,
rootClientId,
isFirst,
isLast,
orientation,
isManualGrid
} = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getBlockIndex,
getBlockListSettings,
canMoveBlocks,
getBlockOrder,
getBlockRootClientId,
getBlockAttributes
} = select(store);
const normalizedClientIds = Array.isArray(clientIds) ? clientIds : [clientIds];
const firstClientId = normalizedClientIds[0];
const _rootClientId = getBlockRootClientId(firstClientId);
const firstIndex = getBlockIndex(firstClientId);
const lastIndex = getBlockIndex(
normalizedClientIds[normalizedClientIds.length - 1]
);
const blockOrder = getBlockOrder(_rootClientId);
const { layout = {} } = getBlockAttributes(_rootClientId) ?? {};
return {
canMove: canMoveBlocks(clientIds),
rootClientId: _rootClientId,
isFirst: firstIndex === 0,
isLast: lastIndex === blockOrder.length - 1,
orientation: getBlockListSettings(_rootClientId)?.orientation,
isManualGrid: layout.type === "grid" && layout.isManualPlacement && window.__experimentalEnableGridInteractivity
};
},
[clientIds]
);
if (!canMove || isFirst && isLast && !rootClientId || hideDragHandle && isManualGrid) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.ToolbarGroup,
{
className: dist_clsx("block-editor-block-mover", {
"is-horizontal": orientation === "horizontal"
}),
children: [
!hideDragHandle && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_draggable_default, { clientIds, fadeWhenDisabled: true, children: (draggableProps) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
icon: drag_handle_default,
className: "block-editor-block-mover__drag-handle",
label: (0,external_wp_i18n_namespaceObject.__)("Drag"),
tabIndex: "-1",
...draggableProps
}
) }),
!isManualGrid && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-mover__move-button-container", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { children: (itemProps) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockMoverUpButton,
{
disabled: isBlockMoverUpButtonDisabled,
clientIds,
...itemProps
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { children: (itemProps) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockMoverDownButton,
{
disabled: isBlockMoverDownButtonDisabled,
clientIds,
...itemProps
}
) })
] })
]
}
);
}
var block_mover_default = BlockMover;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/utils.js
const { clearTimeout: utils_clearTimeout, setTimeout: utils_setTimeout } = window;
const DEBOUNCE_TIMEOUT = 200;
function useDebouncedShowGestures({
ref,
isFocused,
highlightParent,
debounceTimeout = DEBOUNCE_TIMEOUT
}) {
const { getSelectedBlockClientId, getBlockRootClientId } = (0,external_wp_data_namespaceObject.useSelect)(store);
const { toggleBlockHighlight } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const timeoutRef = (0,external_wp_element_namespaceObject.useRef)();
const isDistractionFree = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).getSettings().isDistractionFree,
[]
);
const handleOnChange = (nextIsFocused) => {
if (nextIsFocused && isDistractionFree) {
return;
}
const selectedBlockClientId = getSelectedBlockClientId();
const clientId = highlightParent ? getBlockRootClientId(selectedBlockClientId) : selectedBlockClientId;
toggleBlockHighlight(clientId, nextIsFocused);
};
const getIsHovered = () => {
return ref?.current && ref.current.matches(":hover");
};
const shouldHideGestures = () => {
const isHovered = getIsHovered();
return !isFocused && !isHovered;
};
const clearTimeoutRef = () => {
const timeout = timeoutRef.current;
if (timeout && utils_clearTimeout) {
utils_clearTimeout(timeout);
}
};
const debouncedShowGestures = (event) => {
if (event) {
event.stopPropagation();
}
clearTimeoutRef();
handleOnChange(true);
};
const debouncedHideGestures = (event) => {
if (event) {
event.stopPropagation();
}
clearTimeoutRef();
timeoutRef.current = utils_setTimeout(() => {
if (shouldHideGestures()) {
handleOnChange(false);
}
}, debounceTimeout);
};
(0,external_wp_element_namespaceObject.useEffect)(
() => () => {
handleOnChange(false);
clearTimeoutRef();
},
[]
);
return {
debouncedShowGestures,
debouncedHideGestures
};
}
function useShowHoveredOrFocusedGestures({
ref,
highlightParent = false,
debounceTimeout = DEBOUNCE_TIMEOUT
}) {
const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false);
const { debouncedShowGestures, debouncedHideGestures } = useDebouncedShowGestures({
ref,
debounceTimeout,
isFocused,
highlightParent
});
const registerRef = (0,external_wp_element_namespaceObject.useRef)(false);
const isFocusedWithin = () => {
return ref?.current && ref.current.contains(ref.current.ownerDocument.activeElement);
};
(0,external_wp_element_namespaceObject.useEffect)(() => {
const node = ref.current;
const handleOnFocus = () => {
if (isFocusedWithin()) {
setIsFocused(true);
debouncedShowGestures();
}
};
const handleOnBlur = () => {
if (!isFocusedWithin()) {
setIsFocused(false);
debouncedHideGestures();
}
};
if (node && !registerRef.current) {
node.addEventListener("focus", handleOnFocus, true);
node.addEventListener("blur", handleOnBlur, true);
registerRef.current = true;
}
return () => {
if (node) {
node.removeEventListener("focus", handleOnFocus);
node.removeEventListener("blur", handleOnBlur);
}
};
}, [
ref,
registerRef,
setIsFocused,
debouncedShowGestures,
debouncedHideGestures
]);
return {
onMouseMove: debouncedShowGestures,
onMouseLeave: debouncedHideGestures
};
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-parent-selector/index.js
function BlockParentSelector() {
const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const { parentClientId } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const {
getBlockParents,
getSelectedBlockClientId,
getParentSectionBlock
} = unlock(select(store));
const selectedBlockClientId = getSelectedBlockClientId();
const parentSection = getParentSectionBlock(selectedBlockClientId);
const parents = getBlockParents(selectedBlockClientId);
const _parentClientId = parentSection ?? parents[parents.length - 1];
return {
parentClientId: _parentClientId
};
}, []);
const blockInformation = useBlockDisplayInformation(parentClientId);
const nodeRef = (0,external_wp_element_namespaceObject.useRef)();
const showHoveredOrFocusedGestures = useShowHoveredOrFocusedGestures({
ref: nodeRef,
highlightParent: true
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "block-editor-block-parent-selector",
ref: nodeRef,
...showHoveredOrFocusedGestures,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
className: "block-editor-block-parent-selector__button",
onClick: () => selectBlock(parentClientId),
label: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Name of the block's parent. */
(0,external_wp_i18n_namespaceObject.__)("Select parent block: %s"),
blockInformation?.title
),
showTooltip: true,
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon_default, { icon: blockInformation?.icon })
}
)
},
parentClientId
);
}
;// ./node_modules/@wordpress/icons/build-module/library/copy.js
var copy_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"
}
) });
;// ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/preview-block-popover.js
function PreviewBlockPopover({ blocks }) {
const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
if (isMobile) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-switcher__popover-preview-container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Popover,
{
className: "block-editor-block-switcher__popover-preview",
placement: "right-start",
focusOnMount: false,
offset: 16,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-switcher__preview", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-switcher__preview-title", children: (0,external_wp_i18n_namespaceObject.__)("Preview") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_preview_default, { viewportWidth: 601, blocks })
] })
}
) });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/block-variation-transformations.js
const block_variation_transformations_EMPTY_OBJECT = {};
function useBlockVariationTransforms({ clientIds, blocks }) {
const { activeBlockVariation, blockVariationTransformations } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockAttributes, canRemoveBlocks } = select(store);
const { getActiveBlockVariation, getBlockVariations } = select(external_wp_blocks_namespaceObject.store);
const canRemove = canRemoveBlocks(clientIds);
if (blocks.length !== 1 || !canRemove) {
return block_variation_transformations_EMPTY_OBJECT;
}
const [firstBlock] = blocks;
return {
blockVariationTransformations: getBlockVariations(
firstBlock.name,
"transform"
),
activeBlockVariation: getActiveBlockVariation(
firstBlock.name,
getBlockAttributes(firstBlock.clientId)
)
};
},
[clientIds, blocks]
);
const transformations = (0,external_wp_element_namespaceObject.useMemo)(() => {
return blockVariationTransformations?.filter(
({ name }) => name !== activeBlockVariation?.name
);
}, [blockVariationTransformations, activeBlockVariation]);
return transformations;
}
const BlockVariationTransformations = ({
transformations,
onSelect,
blocks
}) => {
const [hoveredTransformItemName, setHoveredTransformItemName] = (0,external_wp_element_namespaceObject.useState)();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
hoveredTransformItemName && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PreviewBlockPopover,
{
blocks: (0,external_wp_blocks_namespaceObject.cloneBlock)(
blocks[0],
transformations.find(
({ name }) => name === hoveredTransformItemName
).attributes
)
}
),
transformations?.map((item) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockVariationTransformationItem,
{
item,
onSelect,
setHoveredTransformItemName
},
item.name
))
] });
};
function BlockVariationTransformationItem({
item,
onSelect,
setHoveredTransformItemName
}) {
const { name, icon, title } = item;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.MenuItem,
{
className: (0,external_wp_blocks_namespaceObject.getBlockMenuDefaultClassName)(name),
onClick: (event) => {
event.preventDefault();
onSelect(name);
},
onMouseLeave: () => setHoveredTransformItemName(null),
onMouseEnter: () => setHoveredTransformItemName(name),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon_default, { icon, showColors: true }),
title
]
}
);
}
var block_variation_transformations_default = BlockVariationTransformations;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/block-transformations-menu.js
function useGroupedTransforms(possibleBlockTransformations) {
const priorityContentTransformationBlocks = {
"core/paragraph": 1,
"core/heading": 2,
"core/list": 3,
"core/quote": 4
};
const transformations = (0,external_wp_element_namespaceObject.useMemo)(() => {
const priorityTextTransformsNames = Object.keys(
priorityContentTransformationBlocks
);
const groupedPossibleTransforms = possibleBlockTransformations.reduce(
(accumulator, item) => {
const { name } = item;
if (priorityTextTransformsNames.includes(name)) {
accumulator.priorityTextTransformations.push(item);
} else {
accumulator.restTransformations.push(item);
}
return accumulator;
},
{ priorityTextTransformations: [], restTransformations: [] }
);
if (groupedPossibleTransforms.priorityTextTransformations.length === 1 && groupedPossibleTransforms.priorityTextTransformations[0].name === "core/quote") {
const singleQuote = groupedPossibleTransforms.priorityTextTransformations.pop();
groupedPossibleTransforms.restTransformations.push(singleQuote);
}
return groupedPossibleTransforms;
}, [possibleBlockTransformations]);
transformations.priorityTextTransformations.sort(
({ name: currentName }, { name: nextName }) => {
return priorityContentTransformationBlocks[currentName] < priorityContentTransformationBlocks[nextName] ? -1 : 1;
}
);
return transformations;
}
const BlockTransformationsMenu = ({
className,
possibleBlockTransformations,
possibleBlockVariationTransformations,
onSelect,
onSelectVariation,
blocks
}) => {
const [hoveredTransformItemName, setHoveredTransformItemName] = (0,external_wp_element_namespaceObject.useState)();
const { priorityTextTransformations, restTransformations } = useGroupedTransforms(possibleBlockTransformations);
const hasBothContentTransformations = priorityTextTransformations.length && restTransformations.length;
const restTransformItems = !!restTransformations.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
RestTransformationItems,
{
restTransformations,
onSelect,
setHoveredTransformItemName
}
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)("Transform to"), className, children: [
hoveredTransformItemName && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PreviewBlockPopover,
{
blocks: (0,external_wp_blocks_namespaceObject.switchToBlockType)(
blocks,
hoveredTransformItemName
)
}
),
!!possibleBlockVariationTransformations?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_variation_transformations_default,
{
transformations: possibleBlockVariationTransformations,
blocks,
onSelect: onSelectVariation
}
),
priorityTextTransformations.map((item) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockTransformationItem,
{
item,
onSelect,
setHoveredTransformItemName
},
item.name
)),
!hasBothContentTransformations && restTransformItems
] }),
!!hasBothContentTransformations && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { className, children: restTransformItems })
] });
};
function RestTransformationItems({
restTransformations,
onSelect,
setHoveredTransformItemName
}) {
return restTransformations.map((item) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockTransformationItem,
{
item,
onSelect,
setHoveredTransformItemName
},
item.name
));
}
function BlockTransformationItem({
item,
onSelect,
setHoveredTransformItemName
}) {
const { name, icon, title, isDisabled } = item;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.MenuItem,
{
className: (0,external_wp_blocks_namespaceObject.getBlockMenuDefaultClassName)(name),
onClick: (event) => {
event.preventDefault();
onSelect(name);
},
disabled: isDisabled,
onMouseLeave: () => setHoveredTransformItemName(null),
onMouseEnter: () => setHoveredTransformItemName(name),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon_default, { icon, showColors: true }),
title
]
}
);
}
var block_transformations_menu_default = BlockTransformationsMenu;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-styles/utils.js
function getActiveStyle(styles, className) {
for (const style of new (external_wp_tokenList_default())(className).values()) {
if (style.indexOf("is-style-") === -1) {
continue;
}
const potentialStyleName = style.substring(9);
const activeStyle = styles?.find(
({ name }) => name === potentialStyleName
);
if (activeStyle) {
return activeStyle;
}
}
return getDefaultStyle(styles);
}
function replaceActiveStyle(className, activeStyle, newStyle) {
const list = new (external_wp_tokenList_default())(className);
if (activeStyle) {
list.remove("is-style-" + activeStyle.name);
}
list.add("is-style-" + newStyle.name);
return list.value;
}
function getRenderedStyles(styles) {
if (!styles || styles.length === 0) {
return [];
}
return getDefaultStyle(styles) ? styles : [
{
name: "default",
label: (0,external_wp_i18n_namespaceObject._x)("Default", "block style"),
isDefault: true
},
...styles
];
}
function getDefaultStyle(styles) {
return styles?.find((style) => style.isDefault);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-styles/use-styles-for-block.js
function useGenericPreviewBlock(block, type) {
return (0,external_wp_element_namespaceObject.useMemo)(() => {
const example = type?.example;
const blockName = type?.name;
if (example && blockName) {
return (0,external_wp_blocks_namespaceObject.getBlockFromExample)(blockName, {
attributes: example.attributes,
innerBlocks: example.innerBlocks
});
}
if (block) {
return (0,external_wp_blocks_namespaceObject.cloneBlock)(block);
}
}, [type?.example ? block?.name : block, type]);
}
function useStylesForBlocks({ clientId, onSwitch }) {
const selector = (select) => {
const { getBlock } = select(store);
const block2 = getBlock(clientId);
if (!block2) {
return {};
}
const blockType2 = (0,external_wp_blocks_namespaceObject.getBlockType)(block2.name);
const { getBlockStyles } = select(external_wp_blocks_namespaceObject.store);
return {
block: block2,
blockType: blockType2,
styles: getBlockStyles(block2.name),
className: block2.attributes.className || ""
};
};
const { styles, block, blockType, className } = (0,external_wp_data_namespaceObject.useSelect)(selector, [
clientId
]);
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const stylesToRender = getRenderedStyles(styles);
const activeStyle = getActiveStyle(stylesToRender, className);
const genericPreviewBlock = useGenericPreviewBlock(block, blockType);
const onSelect = (style) => {
const styleClassName = replaceActiveStyle(
className,
activeStyle,
style
);
updateBlockAttributes(clientId, {
className: styleClassName
});
onSwitch();
};
return {
onSelect,
stylesToRender,
activeStyle,
genericPreviewBlock,
className
};
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-styles/menu-items.js
const menu_items_noop = () => {
};
function BlockStylesMenuItems({ clientId, onSwitch = menu_items_noop }) {
const { onSelect, stylesToRender, activeStyle } = useStylesForBlocks({
clientId,
onSwitch
});
if (!stylesToRender || stylesToRender.length === 0) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: stylesToRender.map((style) => {
const menuItemText = style.label || style.name;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
icon: activeStyle.name === style.name ? check_check_default : null,
onClick: () => onSelect(style),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalText,
{
as: "span",
limit: 18,
ellipsizeMode: "tail",
truncate: true,
children: menuItemText
}
)
},
style.name
);
}) });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/block-styles-menu.js
function BlockStylesMenu({ hoveredBlock, onSwitch }) {
const { clientId } = hoveredBlock;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuGroup,
{
label: (0,external_wp_i18n_namespaceObject.__)("Styles"),
className: "block-editor-block-switcher__styles__menugroup",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockStylesMenuItems, { clientId, onSwitch })
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/utils.js
const getMatchingBlockByName = (block, selectedBlockName, consumedBlocks = /* @__PURE__ */ new Set()) => {
const { clientId, name, innerBlocks = [] } = block;
if (consumedBlocks.has(clientId)) {
return;
}
if (name === selectedBlockName) {
return block;
}
for (const innerBlock of innerBlocks) {
const match = getMatchingBlockByName(
innerBlock,
selectedBlockName,
consumedBlocks
);
if (match) {
return match;
}
}
};
const getRetainedBlockAttributes = (name, attributes) => {
const contentAttributes = (0,external_wp_blocks_namespaceObject.getBlockAttributesNamesByRole)(name, "content");
if (!contentAttributes?.length) {
return attributes;
}
return contentAttributes.reduce((_accumulator, attribute) => {
if (attributes[attribute]) {
_accumulator[attribute] = attributes[attribute];
}
return _accumulator;
}, {});
};
;// ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/use-transformed-patterns.js
const transformMatchingBlock = (match, selectedBlock) => {
const retainedBlockAttributes = getRetainedBlockAttributes(
selectedBlock.name,
selectedBlock.attributes
);
match.attributes = {
...match.attributes,
...retainedBlockAttributes
};
};
const getPatternTransformedBlocks = (selectedBlocks, patternBlocks) => {
const _patternBlocks = patternBlocks.map(
(block) => (0,external_wp_blocks_namespaceObject.cloneBlock)(block)
);
const consumedBlocks = /* @__PURE__ */ new Set();
for (const selectedBlock of selectedBlocks) {
let isMatch = false;
for (const patternBlock of _patternBlocks) {
const match = getMatchingBlockByName(
patternBlock,
selectedBlock.name,
consumedBlocks
);
if (!match) {
continue;
}
isMatch = true;
consumedBlocks.add(match.clientId);
transformMatchingBlock(match, selectedBlock);
break;
}
if (!isMatch) {
return;
}
}
return _patternBlocks;
};
const useTransformedPatterns = (patterns, selectedBlocks) => {
return (0,external_wp_element_namespaceObject.useMemo)(
() => patterns.reduce((accumulator, _pattern) => {
const transformedBlocks = getPatternTransformedBlocks(
selectedBlocks,
_pattern.blocks
);
if (transformedBlocks) {
accumulator.push({
..._pattern,
transformedBlocks
});
}
return accumulator;
}, []),
[patterns, selectedBlocks]
);
};
var use_transformed_patterns_default = useTransformedPatterns;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/pattern-transformations-menu.js
function PatternTransformationsMenu({
blocks,
patterns: statePatterns,
onSelect
}) {
const [showTransforms, setShowTransforms] = (0,external_wp_element_namespaceObject.useState)(false);
const patterns = use_transformed_patterns_default(statePatterns, blocks);
if (!patterns.length) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { className: "block-editor-block-switcher__pattern__transforms__menugroup", children: [
showTransforms && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PreviewPatternsPopover,
{
patterns,
onSelect
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: (event) => {
event.preventDefault();
setShowTransforms(!showTransforms);
},
icon: chevron_right_default,
children: (0,external_wp_i18n_namespaceObject.__)("Patterns")
}
)
] });
}
function PreviewPatternsPopover({ patterns, onSelect }) {
const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-switcher__popover-preview-container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Popover,
{
className: "block-editor-block-switcher__popover-preview",
placement: isMobile ? "bottom" : "right-start",
offset: 16,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-switcher__preview is-pattern-list-preview", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
pattern_transformations_menu_BlockPatternsList,
{
patterns,
onSelect
}
) })
}
) });
}
function pattern_transformations_menu_BlockPatternsList({ patterns, onSelect }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite,
{
role: "listbox",
className: "block-editor-block-switcher__preview-patterns-container",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Patterns list"),
children: patterns.map((pattern) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
pattern_transformations_menu_BlockPattern,
{
pattern,
onSelect
},
pattern.name
))
}
);
}
function pattern_transformations_menu_BlockPattern({ pattern, onSelect }) {
const baseClassName = "block-editor-block-switcher__preview-patterns-container";
const descriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(
pattern_transformations_menu_BlockPattern,
`${baseClassName}-list__item-description`
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: `${baseClassName}-list__list-item`, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Composite.Item,
{
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
role: "option",
"aria-label": pattern.title,
"aria-describedby": pattern.description ? descriptionId : void 0,
className: `${baseClassName}-list__item`
}
),
onClick: () => onSelect(pattern.transformedBlocks),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_preview_default,
{
blocks: pattern.transformedBlocks,
viewportWidth: pattern.viewportWidth || 500
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `${baseClassName}-list__item-title`, children: pattern.title })
]
}
),
!!pattern.description && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: descriptionId, children: pattern.description })
] });
}
var pattern_transformations_menu_default = PatternTransformationsMenu;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/index.js
function BlockSwitcherDropdownMenuContents({
onClose,
clientIds,
hasBlockStyles,
canRemove
}) {
const { replaceBlocks, multiSelect, updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const { possibleBlockTransformations, patterns, blocks, isUsingBindings } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getBlockAttributes,
getBlocksByClientId,
getBlockRootClientId,
getBlockTransformItems,
__experimentalGetPatternTransformItems
} = select(store);
const rootClientId = getBlockRootClientId(clientIds[0]);
const _blocks = getBlocksByClientId(clientIds);
return {
blocks: _blocks,
possibleBlockTransformations: getBlockTransformItems(
_blocks,
rootClientId
),
patterns: __experimentalGetPatternTransformItems(
_blocks,
rootClientId
),
isUsingBindings: clientIds.every(
(clientId) => !!getBlockAttributes(clientId)?.metadata?.bindings
)
};
},
[clientIds]
);
const blockVariationTransformations = useBlockVariationTransforms({
clientIds,
blocks
});
function selectForMultipleBlocks(insertedBlocks) {
if (insertedBlocks.length > 1) {
multiSelect(
insertedBlocks[0].clientId,
insertedBlocks[insertedBlocks.length - 1].clientId
);
}
}
function onBlockTransform(name) {
const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, name);
replaceBlocks(clientIds, newBlocks);
selectForMultipleBlocks(newBlocks);
}
function onBlockVariationTransform(name) {
updateBlockAttributes(blocks[0].clientId, {
...blockVariationTransformations.find(
({ name: variationName }) => variationName === name
).attributes
});
}
function onPatternTransform(transformedBlocks) {
replaceBlocks(clientIds, transformedBlocks);
selectForMultipleBlocks(transformedBlocks);
}
const isSingleBlock = blocks.length === 1;
const isSynced = isSingleBlock && ((0,external_wp_blocks_namespaceObject.isTemplatePart)(blocks[0]) || (0,external_wp_blocks_namespaceObject.isReusableBlock)(blocks[0]));
const hasPossibleBlockTransformations = !!possibleBlockTransformations?.length && canRemove && !isSynced;
const hasPossibleBlockVariationTransformations = !!blockVariationTransformations?.length;
const hasPatternTransformation = !!patterns?.length && canRemove;
const hasBlockOrBlockVariationTransforms = hasPossibleBlockTransformations || hasPossibleBlockVariationTransformations;
const hasContents = hasBlockStyles || hasBlockOrBlockVariationTransforms || hasPatternTransformation;
if (!hasContents) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "block-editor-block-switcher__no-transforms", children: (0,external_wp_i18n_namespaceObject.__)("No transforms.") });
}
const connectedBlockDescription = isSingleBlock ? (0,external_wp_i18n_namespaceObject._x)(
"This block is connected.",
"block toolbar button label and description"
) : (0,external_wp_i18n_namespaceObject._x)(
"These blocks are connected.",
"block toolbar button label and description"
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-switcher__container", children: [
hasPatternTransformation && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
pattern_transformations_menu_default,
{
blocks,
patterns,
onSelect: (transformedBlocks) => {
onPatternTransform(transformedBlocks);
onClose();
}
}
),
hasBlockOrBlockVariationTransforms && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_transformations_menu_default,
{
className: "block-editor-block-switcher__transforms__menugroup",
possibleBlockTransformations,
possibleBlockVariationTransformations: blockVariationTransformations,
blocks,
onSelect: (name) => {
onBlockTransform(name);
onClose();
},
onSelectVariation: (name) => {
onBlockVariationTransform(name);
onClose();
}
}
),
hasBlockStyles && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockStylesMenu,
{
hoveredBlock: blocks[0],
onSwitch: onClose
}
),
isUsingBindings && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { className: "block-editor-block-switcher__binding-indicator", children: connectedBlockDescription }) })
] });
}
const BlockSwitcher = ({ clientIds }) => {
const {
hasContentOnlyLocking,
canRemove,
hasBlockStyles,
icon,
invalidBlocks,
isReusable,
isTemplate,
isDisabled,
isSectionInSelection
} = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getTemplateLock,
getBlocksByClientId,
getBlockAttributes,
canRemoveBlocks,
getBlockEditingMode,
isSectionBlock
} = unlock(select(store));
const { getBlockStyles, getBlockType, getActiveBlockVariation } = select(external_wp_blocks_namespaceObject.store);
const _blocks = getBlocksByClientId(clientIds);
if (!_blocks.length || _blocks.some((block) => !block)) {
return { invalidBlocks: true };
}
const [{ name: firstBlockName }] = _blocks;
const _isSingleBlockSelected = _blocks.length === 1;
const blockType = getBlockType(firstBlockName);
const editingMode = getBlockEditingMode(clientIds[0]);
let _icon;
let _hasTemplateLock;
if (_isSingleBlockSelected) {
const match = getActiveBlockVariation(
firstBlockName,
getBlockAttributes(clientIds[0])
);
_icon = match?.icon || blockType.icon;
_hasTemplateLock = getTemplateLock(clientIds[0]) === "contentOnly";
} else {
const isSelectionOfSameType = new Set(_blocks.map(({ name }) => name)).size === 1;
_hasTemplateLock = clientIds.some(
(id) => getTemplateLock(id) === "contentOnly"
);
_icon = isSelectionOfSameType ? blockType.icon : copy_default;
}
const _isSectionInSelection = clientIds.some(
(id) => isSectionBlock(id)
);
return {
canRemove: canRemoveBlocks(clientIds),
hasBlockStyles: _isSingleBlockSelected && !!getBlockStyles(firstBlockName)?.length,
icon: _icon,
isReusable: _isSingleBlockSelected && (0,external_wp_blocks_namespaceObject.isReusableBlock)(_blocks[0]),
isTemplate: _isSingleBlockSelected && (0,external_wp_blocks_namespaceObject.isTemplatePart)(_blocks[0]),
hasContentOnlyLocking: _hasTemplateLock,
isDisabled: editingMode !== "default",
isSectionInSelection: _isSectionInSelection
};
},
[clientIds]
);
const blockTitle = useBlockDisplayTitle({
clientId: clientIds?.[0],
maximumLength: 35
});
const showIconLabels = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(external_wp_preferences_namespaceObject.store).get("core", "showIconLabels"),
[]
);
if (invalidBlocks) {
return null;
}
const isSingleBlock = clientIds.length === 1;
const blockSwitcherLabel = isSingleBlock ? blockTitle : (0,external_wp_i18n_namespaceObject.__)("Multiple blocks selected");
const blockIndicatorText = (isReusable || isTemplate) && !showIconLabels && blockTitle ? blockTitle : void 0;
const hideTransformsForSections = window?.__experimentalContentOnlyPatternInsertion && isSectionInSelection;
const hideDropdown = hideTransformsForSections || isDisabled || !hasBlockStyles && !canRemove || hasContentOnlyLocking;
if (hideDropdown) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
disabled: true,
className: "block-editor-block-switcher__no-switcher-icon",
title: blockSwitcherLabel,
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_icon_default,
{
className: "block-editor-block-switcher__toggle",
icon,
showColors: true
}
),
text: blockIndicatorText
}
) });
}
const blockSwitcherDescription = isSingleBlock ? (0,external_wp_i18n_namespaceObject.__)("Change block type or style") : (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: number of blocks. */
(0,external_wp_i18n_namespaceObject._n)(
"Change type of %d block",
"Change type of %d blocks",
clientIds.length
),
clientIds.length
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { children: (toggleProps) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropdownMenu,
{
className: "block-editor-block-switcher",
label: blockSwitcherLabel,
popoverProps: {
placement: "bottom-start",
className: "block-editor-block-switcher__popover"
},
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_icon_default,
{
className: "block-editor-block-switcher__toggle",
icon,
showColors: true
}
),
text: blockIndicatorText,
toggleProps: {
description: blockSwitcherDescription,
...toggleProps
},
menuProps: { orientation: "both" },
children: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockSwitcherDropdownMenuContents,
{
onClose,
clientIds,
hasBlockStyles,
canRemove
}
)
}
) }) });
};
var block_switcher_default = BlockSwitcher;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/block-toolbar-last-item.js
const { Fill: __unstableBlockToolbarLastItem, Slot: block_toolbar_last_item_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)(
"__unstableBlockToolbarLastItem"
);
__unstableBlockToolbarLastItem.Slot = block_toolbar_last_item_Slot;
var block_toolbar_last_item_default = __unstableBlockToolbarLastItem;
;// ./node_modules/@wordpress/block-editor/build-module/hooks/supports.js
const ALIGN_SUPPORT_KEY = "align";
const ALIGN_WIDE_SUPPORT_KEY = "alignWide";
const supports_BORDER_SUPPORT_KEY = "__experimentalBorder";
const supports_COLOR_SUPPORT_KEY = "color";
const CUSTOM_CLASS_NAME_SUPPORT_KEY = "customClassName";
const supports_FONT_FAMILY_SUPPORT_KEY = "typography.__experimentalFontFamily";
const supports_FONT_SIZE_SUPPORT_KEY = "typography.fontSize";
const supports_LINE_HEIGHT_SUPPORT_KEY = "typography.lineHeight";
const supports_FONT_STYLE_SUPPORT_KEY = "typography.__experimentalFontStyle";
const supports_FONT_WEIGHT_SUPPORT_KEY = "typography.__experimentalFontWeight";
const supports_TEXT_ALIGN_SUPPORT_KEY = "typography.textAlign";
const supports_TEXT_COLUMNS_SUPPORT_KEY = "typography.textColumns";
const supports_TEXT_DECORATION_SUPPORT_KEY = "typography.__experimentalTextDecoration";
const supports_WRITING_MODE_SUPPORT_KEY = "typography.__experimentalWritingMode";
const supports_TEXT_TRANSFORM_SUPPORT_KEY = "typography.__experimentalTextTransform";
const supports_LETTER_SPACING_SUPPORT_KEY = "typography.__experimentalLetterSpacing";
const LAYOUT_SUPPORT_KEY = "layout";
const supports_TYPOGRAPHY_SUPPORT_KEYS = [
supports_LINE_HEIGHT_SUPPORT_KEY,
supports_FONT_SIZE_SUPPORT_KEY,
supports_FONT_STYLE_SUPPORT_KEY,
supports_FONT_WEIGHT_SUPPORT_KEY,
supports_FONT_FAMILY_SUPPORT_KEY,
supports_TEXT_ALIGN_SUPPORT_KEY,
supports_TEXT_COLUMNS_SUPPORT_KEY,
supports_TEXT_DECORATION_SUPPORT_KEY,
supports_TEXT_TRANSFORM_SUPPORT_KEY,
supports_WRITING_MODE_SUPPORT_KEY,
supports_LETTER_SPACING_SUPPORT_KEY
];
const EFFECTS_SUPPORT_KEYS = ["shadow"];
const supports_SPACING_SUPPORT_KEY = "spacing";
const supports_styleSupportKeys = [
...EFFECTS_SUPPORT_KEYS,
...supports_TYPOGRAPHY_SUPPORT_KEYS,
supports_BORDER_SUPPORT_KEY,
supports_COLOR_SUPPORT_KEY,
supports_SPACING_SUPPORT_KEY
];
const hasAlignSupport = (nameOrType) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, ALIGN_SUPPORT_KEY);
const getAlignSupport = (nameOrType) => getBlockSupport(nameOrType, ALIGN_SUPPORT_KEY);
const hasAlignWideSupport = (nameOrType) => hasBlockSupport(nameOrType, ALIGN_WIDE_SUPPORT_KEY);
const getAlignWideSupport = (nameOrType) => getBlockSupport(nameOrType, ALIGN_WIDE_SUPPORT_KEY);
function supports_hasBorderSupport(nameOrType, feature = "any") {
if (external_wp_element_namespaceObject.Platform.OS !== "web") {
return false;
}
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(nameOrType, supports_BORDER_SUPPORT_KEY);
if (support === true) {
return true;
}
if (feature === "any") {
return !!(support?.color || support?.radius || support?.width || support?.style);
}
return !!support?.[feature];
}
const getBorderSupport = (nameOrType, feature) => getBlockSupport(nameOrType, [supports_BORDER_SUPPORT_KEY, feature]);
const supports_hasColorSupport = (nameOrType) => {
const colorSupport = getBlockSupport(nameOrType, supports_COLOR_SUPPORT_KEY);
return colorSupport && (colorSupport.link === true || colorSupport.gradient === true || colorSupport.background !== false || colorSupport.text !== false);
};
const supports_hasLinkColorSupport = (nameOrType) => {
if (Platform.OS !== "web") {
return false;
}
const colorSupport = getBlockSupport(nameOrType, supports_COLOR_SUPPORT_KEY);
return colorSupport !== null && typeof colorSupport === "object" && !!colorSupport.link;
};
const supports_hasGradientSupport = (nameOrType) => {
const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(nameOrType, supports_COLOR_SUPPORT_KEY);
return colorSupport !== null && typeof colorSupport === "object" && !!colorSupport.gradients;
};
const supports_hasBackgroundColorSupport = (nameOrType) => {
const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(nameOrType, supports_COLOR_SUPPORT_KEY);
return colorSupport && colorSupport.background !== false;
};
const hasTextAlignSupport = (nameOrType) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, supports_TEXT_ALIGN_SUPPORT_KEY);
const getTextAlignSupport = (nameOrType) => getBlockSupport(nameOrType, supports_TEXT_ALIGN_SUPPORT_KEY);
const supports_hasTextColorSupport = (nameOrType) => {
const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(nameOrType, supports_COLOR_SUPPORT_KEY);
return colorSupport && colorSupport.text !== false;
};
const getColorSupport = (nameOrType, feature) => getBlockSupport(nameOrType, [supports_COLOR_SUPPORT_KEY, feature]);
const hasCustomClassNameSupport = (nameOrType) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true);
const getCustomClassNameSupport = (nameOrType) => getBlockSupport(nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true);
const hasFontFamilySupport = (nameOrType) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, supports_FONT_FAMILY_SUPPORT_KEY);
const getFontFamilySupport = (nameOrType) => getBlockSupport(nameOrType, supports_FONT_FAMILY_SUPPORT_KEY);
const hasFontSizeSupport = (nameOrType) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, supports_FONT_SIZE_SUPPORT_KEY);
const getFontSizeSupport = (nameOrType) => getBlockSupport(nameOrType, supports_FONT_SIZE_SUPPORT_KEY);
const hasLayoutSupport = (nameOrType) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, LAYOUT_SUPPORT_KEY);
const getLayoutSupport = (nameOrType) => getBlockSupport(nameOrType, LAYOUT_SUPPORT_KEY);
const supports_hasStyleSupport = (nameOrType) => supports_styleSupportKeys.some((key) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, key));
;// ./node_modules/@wordpress/block-editor/build-module/components/use-paste-styles/index.js
function hasSerializedBlocks(text) {
try {
const blocks = (0,external_wp_blocks_namespaceObject.parse)(text, {
__unstableSkipMigrationLogs: true,
__unstableSkipAutop: true
});
if (blocks.length === 1 && blocks[0].name === "core/freeform") {
return false;
}
return true;
} catch (err) {
return false;
}
}
const STYLE_ATTRIBUTES = {
align: hasAlignSupport,
borderColor: (nameOrType) => supports_hasBorderSupport(nameOrType, "color"),
backgroundColor: supports_hasBackgroundColorSupport,
textAlign: hasTextAlignSupport,
textColor: supports_hasTextColorSupport,
gradient: supports_hasGradientSupport,
className: hasCustomClassNameSupport,
fontFamily: hasFontFamilySupport,
fontSize: hasFontSizeSupport,
layout: hasLayoutSupport,
style: supports_hasStyleSupport
};
function getStyleAttributes(sourceBlock, targetBlock) {
return Object.entries(STYLE_ATTRIBUTES).reduce(
(attributes, [attributeKey, hasSupport]) => {
if (hasSupport(sourceBlock.name) && hasSupport(targetBlock.name)) {
attributes[attributeKey] = sourceBlock.attributes[attributeKey];
}
return attributes;
},
{}
);
}
function recursivelyUpdateBlockAttributes(targetBlocks, sourceBlocks, updateBlockAttributes) {
for (let index = 0; index < Math.min(sourceBlocks.length, targetBlocks.length); index += 1) {
updateBlockAttributes(
targetBlocks[index].clientId,
getStyleAttributes(sourceBlocks[index], targetBlocks[index])
);
recursivelyUpdateBlockAttributes(
targetBlocks[index].innerBlocks,
sourceBlocks[index].innerBlocks,
updateBlockAttributes
);
}
}
function usePasteStyles() {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const { createSuccessNotice, createWarningNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
return (0,external_wp_element_namespaceObject.useCallback)(
async (targetBlocks) => {
let html = "";
try {
if (!window.navigator.clipboard) {
createErrorNotice(
(0,external_wp_i18n_namespaceObject.__)(
"Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."
),
{ type: "snackbar" }
);
return;
}
html = await window.navigator.clipboard.readText();
} catch (error) {
createErrorNotice(
(0,external_wp_i18n_namespaceObject.__)(
"Unable to paste styles. Please allow browser clipboard permissions before continuing."
),
{
type: "snackbar"
}
);
return;
}
if (!html || !hasSerializedBlocks(html)) {
createWarningNotice(
(0,external_wp_i18n_namespaceObject.__)(
"Unable to paste styles. Block styles couldn't be found within the copied content."
),
{
type: "snackbar"
}
);
return;
}
const copiedBlocks = (0,external_wp_blocks_namespaceObject.parse)(html);
if (copiedBlocks.length === 1) {
registry.batch(() => {
recursivelyUpdateBlockAttributes(
targetBlocks,
targetBlocks.map(() => copiedBlocks[0]),
updateBlockAttributes
);
});
} else {
registry.batch(() => {
recursivelyUpdateBlockAttributes(
targetBlocks,
copiedBlocks,
updateBlockAttributes
);
});
}
if (targetBlocks.length === 1) {
const title = (0,external_wp_blocks_namespaceObject.getBlockType)(targetBlocks[0].name)?.title;
createSuccessNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
// Translators: %s: Name of the block being pasted, e.g. "Paragraph".
(0,external_wp_i18n_namespaceObject.__)("Pasted styles to %s."),
title
),
{ type: "snackbar" }
);
} else {
createSuccessNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
// Translators: %d: The number of the blocks.
(0,external_wp_i18n_namespaceObject.__)("Pasted styles to %d blocks."),
targetBlocks.length
),
{ type: "snackbar" }
);
}
},
[
registry.batch,
updateBlockAttributes,
createSuccessNotice,
createWarningNotice,
createErrorNotice
]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-actions/index.js
function BlockActions({
clientIds,
children,
__experimentalUpdateSelection: updateSelection
}) {
const { getDefaultBlockName, getGroupingBlockName } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store);
const selected = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
canInsertBlockType,
getBlockRootClientId,
getBlocksByClientId: getBlocksByClientId2,
getDirectInsertBlock,
canRemoveBlocks
} = select(store);
const blocks = getBlocksByClientId2(clientIds);
const rootClientId = getBlockRootClientId(clientIds[0]);
const canInsertDefaultBlock = canInsertBlockType(
getDefaultBlockName(),
rootClientId
);
const directInsertBlock = rootClientId ? getDirectInsertBlock(rootClientId) : null;
return {
canRemove: canRemoveBlocks(clientIds),
canInsertBlock: blocks.every((block) => {
return (canInsertDefaultBlock || !!directInsertBlock) && canInsertBlockType(block.name, rootClientId);
}),
canCopyStyles: blocks.every((block) => {
return !!block && ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(block.name, "color") || (0,external_wp_blocks_namespaceObject.hasBlockSupport)(block.name, "typography"));
}),
canDuplicate: blocks.every((block) => {
return !!block && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(block.name, "multiple", true) && canInsertBlockType(block.name, rootClientId);
})
};
},
[clientIds, getDefaultBlockName]
);
const { getBlocksByClientId, getBlocks } = (0,external_wp_data_namespaceObject.useSelect)(store);
const { canRemove, canInsertBlock, canCopyStyles, canDuplicate } = selected;
const {
removeBlocks,
replaceBlocks,
duplicateBlocks,
insertAfterBlock,
insertBeforeBlock,
flashBlock
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
const pasteStyles = usePasteStyles();
return children({
canCopyStyles,
canDuplicate,
canInsertBlock,
canRemove,
onDuplicate() {
return duplicateBlocks(clientIds, updateSelection);
},
onRemove() {
return removeBlocks(clientIds, updateSelection);
},
onInsertBefore() {
insertBeforeBlock(clientIds[0]);
},
onInsertAfter() {
insertAfterBlock(clientIds[clientIds.length - 1]);
},
onGroup() {
if (!clientIds.length) {
return;
}
const groupingBlockName = getGroupingBlockName();
const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(
getBlocksByClientId(clientIds),
groupingBlockName
);
if (!newBlocks) {
return;
}
replaceBlocks(clientIds, newBlocks);
},
onUngroup() {
if (!clientIds.length) {
return;
}
const innerBlocks = getBlocks(clientIds[0]);
if (!innerBlocks.length) {
return;
}
replaceBlocks(clientIds, innerBlocks);
},
onCopy() {
if (clientIds.length === 1) {
flashBlock(clientIds[0]);
}
},
async onPasteStyles() {
await pasteStyles(getBlocksByClientId(clientIds));
}
});
}
;// ./node_modules/@wordpress/block-editor/build-module/components/collab/block-comment-icon-slot.js
const CommentIconSlotFill = (0,external_wp_components_namespaceObject.createSlotFill)(Symbol("CommentIconSlotFill"));
var block_comment_icon_slot_default = CommentIconSlotFill;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-html-convert-button.js
function BlockHTMLConvertButton({ clientId }) {
const block = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).getBlock(clientId),
[clientId]
);
const { replaceBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(store);
if (!block || block.name !== "core/html") {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: () => replaceBlocks(
clientId,
(0,external_wp_blocks_namespaceObject.rawHandler)({ HTML: (0,external_wp_blocks_namespaceObject.getBlockContent)(block) })
),
children: (0,external_wp_i18n_namespaceObject.__)("Convert to Blocks")
}
);
}
var block_html_convert_button_default = BlockHTMLConvertButton;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-settings-menu-first-item.js
const { Fill: __unstableBlockSettingsMenuFirstItem, Slot: block_settings_menu_first_item_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)(
"__unstableBlockSettingsMenuFirstItem"
);
__unstableBlockSettingsMenuFirstItem.Slot = block_settings_menu_first_item_Slot;
var block_settings_menu_first_item_default = __unstableBlockSettingsMenuFirstItem;
;// ./node_modules/@wordpress/block-editor/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js
function useConvertToGroupButtonProps(selectedClientIds) {
return (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getBlocksByClientId,
getSelectedBlockClientIds,
isUngroupable,
isGroupable
} = select(store);
const { getGroupingBlockName, getBlockType } = select(external_wp_blocks_namespaceObject.store);
const clientIds = selectedClientIds?.length ? selectedClientIds : getSelectedBlockClientIds();
const blocksSelection = getBlocksByClientId(clientIds);
const [firstSelectedBlock] = blocksSelection;
const _isUngroupable = clientIds.length === 1 && isUngroupable(clientIds[0]);
return {
clientIds,
isGroupable: isGroupable(clientIds),
isUngroupable: _isUngroupable,
blocksSelection,
groupingBlockName: getGroupingBlockName(),
onUngroup: _isUngroupable && getBlockType(firstSelectedBlock.name)?.transforms?.ungroup
};
},
[selectedClientIds]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/convert-to-group-buttons/index.js
function ConvertToGroupButton({
clientIds,
isGroupable,
isUngroupable,
onUngroup,
blocksSelection,
groupingBlockName,
onClose = () => {
}
}) {
const { getSelectedBlockClientIds } = (0,external_wp_data_namespaceObject.useSelect)(store);
const { replaceBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const onConvertToGroup = () => {
const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(
blocksSelection,
groupingBlockName
);
if (newBlocks) {
replaceBlocks(clientIds, newBlocks);
}
};
const onConvertFromGroup = () => {
let innerBlocks = blocksSelection[0].innerBlocks;
if (!innerBlocks.length) {
return;
}
if (onUngroup) {
innerBlocks = onUngroup(
blocksSelection[0].attributes,
blocksSelection[0].innerBlocks
);
}
replaceBlocks(clientIds, innerBlocks);
};
if (!isGroupable && !isUngroupable) {
return null;
}
const selectedBlockClientIds = getSelectedBlockClientIds();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
isGroupable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
shortcut: selectedBlockClientIds.length > 1 ? external_wp_keycodes_namespaceObject.displayShortcut.primary("g") : void 0,
onClick: () => {
onConvertToGroup();
onClose();
},
children: (0,external_wp_i18n_namespaceObject._x)("Group", "verb")
}
),
isUngroupable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: () => {
onConvertFromGroup();
onClose();
},
children: (0,external_wp_i18n_namespaceObject._x)(
"Ungroup",
"Ungrouping blocks from within a grouping block back into individual blocks within the Editor"
)
}
)
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-lock/use-block-lock.js
function useBlockLock(clientId) {
return (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
canEditBlock,
canMoveBlock,
canRemoveBlock,
canLockBlockType,
getBlockName,
getTemplateLock
} = select(store);
const canEdit = canEditBlock(clientId);
const canMove = canMoveBlock(clientId);
const canRemove = canRemoveBlock(clientId);
return {
canEdit,
canMove,
canRemove,
canLock: canLockBlockType(getBlockName(clientId)),
isContentLocked: getTemplateLock(clientId) === "contentOnly",
isLocked: !canEdit || !canMove || !canRemove
};
},
[clientId]
);
}
;// ./node_modules/@wordpress/icons/build-module/library/unlock.js
var unlock_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/lock-outline.js
var lock_outline_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/lock.js
var lock_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/block-lock/modal.js
const ALLOWS_EDIT_LOCKING = ["core/navigation"];
function getTemplateLockValue(lock) {
if (lock.remove && lock.move) {
return "all";
}
if (lock.remove && !lock.move) {
return "insert";
}
return false;
}
function BlockLockModal({ clientId, onClose }) {
const [lock, setLock] = (0,external_wp_element_namespaceObject.useState)({ move: false, remove: false });
const { canEdit, canMove, canRemove } = useBlockLock(clientId);
const { allowsEditLocking, templateLock, hasTemplateLock } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockName, getBlockAttributes } = select(store);
const blockName = getBlockName(clientId);
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName);
return {
allowsEditLocking: ALLOWS_EDIT_LOCKING.includes(blockName),
templateLock: getBlockAttributes(clientId)?.templateLock,
hasTemplateLock: !!blockType?.attributes?.templateLock
};
},
[clientId]
);
const [applyTemplateLock, setApplyTemplateLock] = (0,external_wp_element_namespaceObject.useState)(
!!templateLock
);
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const blockInformation = useBlockDisplayInformation(clientId);
(0,external_wp_element_namespaceObject.useEffect)(() => {
setLock({
move: !canMove,
remove: !canRemove,
...allowsEditLocking ? { edit: !canEdit } : {}
});
}, [canEdit, canMove, canRemove, allowsEditLocking]);
const isAllChecked = Object.values(lock).every(Boolean);
const isMixed = Object.values(lock).some(Boolean) && !isAllChecked;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
title: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Name of the block. */
(0,external_wp_i18n_namespaceObject.__)("Lock %s"),
blockInformation.title
),
overlayClassName: "block-editor-block-lock-modal",
onRequestClose: onClose,
size: "small",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"form",
{
onSubmit: (event) => {
event.preventDefault();
updateBlockAttributes([clientId], {
lock,
templateLock: applyTemplateLock ? getTemplateLockValue(lock) : void 0
});
onClose();
},
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "block-editor-block-lock-modal__options", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("legend", { children: (0,external_wp_i18n_namespaceObject.__)("Select the features you want to lock") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"ul",
{
role: "list",
className: "block-editor-block-lock-modal__checklist",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CheckboxControl,
{
__nextHasNoMarginBottom: true,
className: "block-editor-block-lock-modal__options-all",
label: (0,external_wp_i18n_namespaceObject.__)("Lock all"),
checked: isAllChecked,
indeterminate: isMixed,
onChange: (newValue) => setLock({
move: newValue,
remove: newValue,
...allowsEditLocking ? { edit: newValue } : {}
})
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"ul",
{
role: "list",
className: "block-editor-block-lock-modal__checklist",
children: [
allowsEditLocking && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: "block-editor-block-lock-modal__checklist-item", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CheckboxControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Lock editing"),
checked: !!lock.edit,
onChange: (edit) => setLock((prevLock) => ({
...prevLock,
edit
}))
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Icon,
{
className: "block-editor-block-lock-modal__lock-icon",
icon: lock.edit ? lock_default : unlock_default
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: "block-editor-block-lock-modal__checklist-item", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CheckboxControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Lock movement"),
checked: lock.move,
onChange: (move) => setLock((prevLock) => ({
...prevLock,
move
}))
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Icon,
{
className: "block-editor-block-lock-modal__lock-icon",
icon: lock.move ? lock_default : unlock_default
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: "block-editor-block-lock-modal__checklist-item", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CheckboxControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Lock removal"),
checked: lock.remove,
onChange: (remove) => setLock((prevLock) => ({
...prevLock,
remove
}))
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Icon,
{
className: "block-editor-block-lock-modal__lock-icon",
icon: lock.remove ? lock_default : unlock_default
}
)
] })
]
}
)
] })
}
),
hasTemplateLock && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
className: "block-editor-block-lock-modal__template-lock",
label: (0,external_wp_i18n_namespaceObject.__)("Apply to all blocks inside"),
checked: applyTemplateLock,
disabled: lock.move && !lock.remove,
onChange: () => setApplyTemplateLock(!applyTemplateLock)
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Flex,
{
className: "block-editor-block-lock-modal__actions",
justify: "flex-end",
expanded: false,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: "tertiary",
onClick: onClose,
__next40pxDefaultSize: true,
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: "primary",
type: "submit",
__next40pxDefaultSize: true,
children: (0,external_wp_i18n_namespaceObject.__)("Apply")
}
) })
]
}
)
]
}
)
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-lock/menu-item.js
function BlockLockMenuItem({ clientId }) {
const { canLock, isLocked } = useBlockLock(clientId);
const [isModalOpen, toggleModal] = (0,external_wp_element_namespaceObject.useReducer)(
(isActive) => !isActive,
false
);
if (!canLock) {
return null;
}
const label = isLocked ? (0,external_wp_i18n_namespaceObject.__)("Unlock") : (0,external_wp_i18n_namespaceObject.__)("Lock");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
icon: isLocked ? unlock_default : lock_outline_default,
onClick: toggleModal,
"aria-expanded": isModalOpen,
"aria-haspopup": "dialog",
children: label
}
),
isModalOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockLockModal, { clientId, onClose: toggleModal })
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-mode-toggle.js
const block_mode_toggle_noop = () => {
};
function BlockModeToggle({ clientId, onToggle = block_mode_toggle_noop }) {
const { blockType, mode, enabled } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlock, getBlockMode, getSettings } = select(store);
const block = getBlock(clientId);
return {
mode: getBlockMode(clientId),
blockType: block ? (0,external_wp_blocks_namespaceObject.getBlockType)(block.name) : null,
enabled: getSettings().codeEditingEnabled && !!block?.isValid
};
},
[clientId]
);
const { toggleBlockMode } = (0,external_wp_data_namespaceObject.useDispatch)(store);
if (!blockType || !(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, "html", true) || !enabled) {
return null;
}
const label = mode === "visual" ? (0,external_wp_i18n_namespaceObject.__)("Edit as HTML") : (0,external_wp_i18n_namespaceObject.__)("Edit visually");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: () => {
toggleBlockMode(clientId);
onToggle();
},
children: label
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/content-lock/modify-content-lock-menu-item.js
function ModifyContentLockMenuItem({ clientId, onClose }) {
const { templateLock, isLockedByParent, isEditingAsBlocks } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getContentLockingParent,
getTemplateLock,
getTemporarilyEditingAsBlocks
} = unlock(select(store));
return {
templateLock: getTemplateLock(clientId),
isLockedByParent: !!getContentLockingParent(clientId),
isEditingAsBlocks: getTemporarilyEditingAsBlocks() === clientId
};
},
[clientId]
);
const blockEditorActions = (0,external_wp_data_namespaceObject.useDispatch)(store);
const isContentLocked = !isLockedByParent && templateLock === "contentOnly";
if (!isContentLocked && !isEditingAsBlocks) {
return null;
}
const { modifyContentLockBlock } = unlock(blockEditorActions);
const showStartEditingAsBlocks = !isEditingAsBlocks && isContentLocked;
return showStartEditingAsBlocks && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: () => {
modifyContentLockBlock(clientId);
onClose();
},
children: (0,external_wp_i18n_namespaceObject._x)("Modify", "Unlock content locked blocks")
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-rename/use-block-rename.js
function useBlockRename(name) {
return {
canRename: (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, "renaming", true)
};
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-rename/is-empty-string.js
function isEmptyString(testString) {
return testString?.trim()?.length === 0;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-rename/modal.js
function BlockRenameModal({ clientId, onClose }) {
const [editedBlockName, setEditedBlockName] = (0,external_wp_element_namespaceObject.useState)();
const blockInformation = useBlockDisplayInformation(clientId);
const { metadata } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockAttributes } = select(store);
return {
metadata: getBlockAttributes(clientId)?.metadata
};
},
[clientId]
);
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const blockName = metadata?.name || "";
const originalBlockName = blockInformation?.title;
const hasOverridesWarning = !!blockName && !!metadata?.bindings && Object.values(metadata.bindings).some(
(binding) => binding.source === "core/pattern-overrides"
);
const nameHasChanged = editedBlockName !== void 0 && editedBlockName !== blockName;
const nameIsOriginal = editedBlockName === originalBlockName;
const nameIsEmpty = isEmptyString(editedBlockName);
const isNameValid = nameHasChanged || nameIsOriginal;
const autoSelectInputText = (event) => event.target.select();
const handleSubmit = () => {
const newName = nameIsOriginal || nameIsEmpty ? void 0 : editedBlockName;
const message = nameIsOriginal || nameIsEmpty ? (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: new name/label for the block */
(0,external_wp_i18n_namespaceObject.__)('Block name reset to: "%s".'),
editedBlockName
) : (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: new name/label for the block */
(0,external_wp_i18n_namespaceObject.__)('Block name changed to: "%s".'),
editedBlockName
);
(0,external_wp_a11y_namespaceObject.speak)(message, "assertive");
updateBlockAttributes([clientId], {
metadata: utils_cleanEmptyObject({
...metadata,
name: newName
})
});
onClose();
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
title: (0,external_wp_i18n_namespaceObject.__)("Rename"),
onRequestClose: onClose,
overlayClassName: "block-editor-block-rename-modal",
focusOnMount: "firstContentElement",
size: "small",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"form",
{
onSubmit: (e) => {
e.preventDefault();
if (!isNameValid) {
return;
}
handleSubmit();
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "3", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
value: editedBlockName ?? blockName,
label: (0,external_wp_i18n_namespaceObject.__)("Name"),
help: hasOverridesWarning ? (0,external_wp_i18n_namespaceObject.__)(
"This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern."
) : void 0,
placeholder: originalBlockName,
onChange: setEditedBlockName,
onFocus: autoSelectInputText
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: onClose,
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
accessibleWhenDisabled: true,
disabled: !isNameValid,
variant: "primary",
type: "submit",
children: (0,external_wp_i18n_namespaceObject.__)("Save")
}
)
] })
] })
}
)
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-rename/rename-control.js
function BlockRenameControl({ clientId }) {
const [renamingBlock, setRenamingBlock] = (0,external_wp_element_namespaceObject.useState)(false);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: () => {
setRenamingBlock(true);
},
"aria-expanded": renamingBlock,
"aria-haspopup": "dialog",
children: (0,external_wp_i18n_namespaceObject.__)("Rename")
}
),
renamingBlock && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockRenameModal,
{
clientId,
onClose: () => setRenamingBlock(false)
}
)
] });
}
;// ./node_modules/@wordpress/icons/build-module/library/seen.js
var seen_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/unseen.js
var unseen_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/block-visibility/menu-item.js
function BlockVisibilityMenuItem({ clientIds }) {
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const blocks = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
return select(store).getBlocksByClientId(clientIds);
},
[clientIds]
);
const listViewShortcut = (0,external_wp_data_namespaceObject.useSelect)((select) => {
return select(external_wp_keyboardShortcuts_namespaceObject.store).getShortcutRepresentation(
"core/editor/toggle-list-view"
);
}, []);
const hasHiddenBlock = blocks.some(
(block) => block.attributes.metadata?.blockVisibility === false
);
const toggleBlockVisibility = () => {
const isHiding = !hasHiddenBlock;
const attributesByClientId = Object.fromEntries(
blocks?.map(({ clientId, attributes }) => [
clientId,
{
metadata: utils_cleanEmptyObject({
...attributes?.metadata,
blockVisibility: isHiding ? false : void 0
})
}
])
);
updateBlockAttributes(clientIds, attributesByClientId, {
uniqueByBlock: true
});
if (isHiding) {
if (blocks.length > 1) {
createSuccessNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The shortcut key to access the List View.
(0,external_wp_i18n_namespaceObject.__)(
"Blocks hidden. You can access them via the List View (%s)."
),
listViewShortcut
),
{
id: "block-visibility-hidden",
type: "snackbar"
}
);
} else {
createSuccessNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The shortcut key to access the List View.
(0,external_wp_i18n_namespaceObject.__)(
"Block hidden. You can access it via the List View (%s)."
),
listViewShortcut
),
{
id: "block-visibility-hidden",
type: "snackbar"
}
);
}
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
icon: hasHiddenBlock ? seen_default : unseen_default,
onClick: toggleBlockVisibility,
children: hasHiddenBlock ? (0,external_wp_i18n_namespaceObject.__)("Show") : (0,external_wp_i18n_namespaceObject.__)("Hide")
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu-controls/index.js
const { Fill, Slot: block_settings_menu_controls_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)("BlockSettingsMenuControls");
const BlockSettingsMenuControlsSlot = ({ fillProps, clientIds = null }) => {
const {
selectedBlocks,
selectedClientIds,
isContentOnly,
canToggleSelectedBlocksVisibility
} = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getBlocksByClientId,
getBlockNamesByClientId,
getSelectedBlockClientIds,
getBlockEditingMode
} = select(store);
const ids = clientIds !== null ? clientIds : getSelectedBlockClientIds();
return {
selectedBlocks: getBlockNamesByClientId(ids),
selectedClientIds: ids,
isContentOnly: getBlockEditingMode(ids[0]) === "contentOnly",
canToggleSelectedBlocksVisibility: getBlocksByClientId(
ids
).every(
(block) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(block.name, "visibility", true)
)
};
},
[clientIds]
);
const { canLock } = useBlockLock(selectedClientIds[0]);
const { canRename } = useBlockRename(selectedBlocks[0]);
const showLockButton = selectedClientIds.length === 1 && canLock && !isContentOnly;
const showRenameButton = selectedClientIds.length === 1 && canRename && !isContentOnly;
const showVisibilityButton = canToggleSelectedBlocksVisibility && !isContentOnly;
const convertToGroupButtonProps = useConvertToGroupButtonProps(selectedClientIds);
const { isGroupable, isUngroupable } = convertToGroupButtonProps;
const showConvertToGroupButton = (isGroupable || isUngroupable) && !isContentOnly;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_settings_menu_controls_Slot,
{
fillProps: {
...fillProps,
selectedBlocks,
selectedClientIds
},
children: (fills) => {
if (!fills?.length > 0 && !showConvertToGroupButton && !showLockButton) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { children: [
showConvertToGroupButton && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ConvertToGroupButton,
{
...convertToGroupButtonProps,
onClose: fillProps?.onClose
}
),
showLockButton && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockLockMenuItem,
{
clientId: selectedClientIds[0]
}
),
showRenameButton && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockRenameControl,
{
clientId: selectedClientIds[0]
}
),
showVisibilityButton && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockVisibilityMenuItem,
{
clientIds: selectedClientIds
}
),
fills,
selectedClientIds.length === 1 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ModifyContentLockMenuItem,
{
clientId: selectedClientIds[0],
onClose: fillProps?.onClose
}
),
fillProps?.count === 1 && !isContentOnly && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockModeToggle,
{
clientId: fillProps?.firstBlockClientId,
onToggle: fillProps?.onClose
}
)
] });
}
}
);
};
function BlockSettingsMenuControls({ ...props }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalStyleProvider, { document, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Fill, { ...props }) });
}
BlockSettingsMenuControls.Slot = BlockSettingsMenuControlsSlot;
var block_settings_menu_controls_default = BlockSettingsMenuControls;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-parent-selector-menu-item.js
function BlockParentSelectorMenuItem({
parentClientId,
parentBlockType
}) {
const isSmallViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const menuItemRef = (0,external_wp_element_namespaceObject.useRef)();
const gesturesProps = useShowHoveredOrFocusedGestures({
ref: menuItemRef,
highlightParent: true
});
if (!isSmallViewport) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
...gesturesProps,
ref: menuItemRef,
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon_default, { icon: parentBlockType.icon }),
onClick: () => selectBlock(parentClientId),
children: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Name of the block's parent. */
(0,external_wp_i18n_namespaceObject.__)("Select parent block (%s)"),
parentBlockType.title
)
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-settings-dropdown.js
const block_settings_dropdown_POPOVER_PROPS = {
className: "block-editor-block-settings-menu__popover",
placement: "bottom-start"
};
function CopyMenuItem({
clientIds,
onCopy,
label,
shortcut,
eventType = "copy",
__experimentalUpdateSelection: updateSelection = false
}) {
const { getBlocksByClientId } = (0,external_wp_data_namespaceObject.useSelect)(store);
const { removeBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const notifyCopy = useNotifyCopy();
const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(
() => (0,external_wp_blocks_namespaceObject.serialize)(getBlocksByClientId(clientIds)),
() => {
switch (eventType) {
case "copy":
case "copyStyles":
onCopy();
notifyCopy(eventType, clientIds);
break;
case "cut":
notifyCopy(eventType, clientIds);
removeBlocks(clientIds, updateSelection);
break;
default:
break;
}
}
);
const copyMenuItemLabel = label ? label : (0,external_wp_i18n_namespaceObject.__)("Copy");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { ref, shortcut, children: copyMenuItemLabel });
}
function BlockSettingsDropdown({
block,
clientIds,
children,
__experimentalSelectBlock,
...props
}) {
const currentClientId = block?.clientId;
const count = clientIds.length;
const firstBlockClientId = clientIds[0];
const {
firstParentClientId,
parentBlockType,
previousBlockClientId,
selectedBlockClientIds,
openedBlockSettingsMenu,
isContentOnly,
isZoomOut
} = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getBlockName,
getBlockRootClientId,
getPreviousBlockClientId,
getSelectedBlockClientIds: getSelectedBlockClientIds2,
getBlockAttributes,
getOpenedBlockSettingsMenu,
getBlockEditingMode,
isZoomOut: _isZoomOut
} = unlock(select(store));
const { getActiveBlockVariation } = select(external_wp_blocks_namespaceObject.store);
const _firstParentClientId = getBlockRootClientId(firstBlockClientId);
const parentBlockName = _firstParentClientId && getBlockName(_firstParentClientId);
return {
firstParentClientId: _firstParentClientId,
parentBlockType: _firstParentClientId && (getActiveBlockVariation(
parentBlockName,
getBlockAttributes(_firstParentClientId)
) || (0,external_wp_blocks_namespaceObject.getBlockType)(parentBlockName)),
previousBlockClientId: getPreviousBlockClientId(firstBlockClientId),
selectedBlockClientIds: getSelectedBlockClientIds2(),
openedBlockSettingsMenu: getOpenedBlockSettingsMenu(),
isContentOnly: getBlockEditingMode(firstBlockClientId) === "contentOnly",
isZoomOut: _isZoomOut()
};
},
[firstBlockClientId]
);
const { getBlockOrder, getSelectedBlockClientIds } = (0,external_wp_data_namespaceObject.useSelect)(store);
const { setOpenedBlockSettingsMenu } = unlock(
(0,external_wp_data_namespaceObject.useDispatch)(store)
);
const shortcuts = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getShortcutRepresentation } = select(external_wp_keyboardShortcuts_namespaceObject.store);
return {
copy: getShortcutRepresentation("core/block-editor/copy"),
cut: getShortcutRepresentation("core/block-editor/cut"),
duplicate: getShortcutRepresentation(
"core/block-editor/duplicate"
),
remove: getShortcutRepresentation("core/block-editor/remove"),
insertAfter: getShortcutRepresentation(
"core/block-editor/insert-after"
),
insertBefore: getShortcutRepresentation(
"core/block-editor/insert-before"
)
};
}, []);
const hasSelectedBlocks = selectedBlockClientIds.length > 0;
async function updateSelectionAfterDuplicate(clientIdsPromise) {
if (!__experimentalSelectBlock) {
return;
}
const ids = await clientIdsPromise;
if (ids && ids[0]) {
__experimentalSelectBlock(ids[0], false);
}
}
function updateSelectionAfterRemove() {
if (!__experimentalSelectBlock) {
return;
}
let blockToFocus = previousBlockClientId || firstParentClientId;
if (!blockToFocus) {
blockToFocus = getBlockOrder()[0];
}
const shouldUpdateSelection = hasSelectedBlocks && getSelectedBlockClientIds().length === 0;
__experimentalSelectBlock(blockToFocus, shouldUpdateSelection);
}
const parentBlockIsSelected = selectedBlockClientIds?.includes(firstParentClientId);
const open = !currentClientId ? void 0 : openedBlockSettingsMenu === currentClientId || false;
function onToggle(localOpen) {
if (localOpen && openedBlockSettingsMenu !== currentClientId) {
setOpenedBlockSettingsMenu(currentClientId);
} else if (!localOpen && openedBlockSettingsMenu && openedBlockSettingsMenu === currentClientId) {
setOpenedBlockSettingsMenu(void 0);
}
}
const shouldShowBlockParentMenuItem = !parentBlockIsSelected && !!firstParentClientId;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockActions,
{
clientIds,
__experimentalUpdateSelection: !__experimentalSelectBlock,
children: ({
canCopyStyles,
canDuplicate,
canInsertBlock,
canRemove,
onDuplicate,
onInsertAfter,
onInsertBefore,
onRemove,
onCopy,
onPasteStyles
}) => {
const isEmpty = !canRemove && !canDuplicate && !canInsertBlock && isContentOnly;
if (isEmpty) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropdownMenu,
{
icon: more_vertical_default,
label: (0,external_wp_i18n_namespaceObject.__)("Options"),
className: "block-editor-block-settings-menu",
popoverProps: block_settings_dropdown_POPOVER_PROPS,
open,
onToggle,
noIcons: true,
...props,
children: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_settings_menu_first_item_default.Slot,
{
fillProps: { onClose }
}
),
shouldShowBlockParentMenuItem && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockParentSelectorMenuItem,
{
parentClientId: firstParentClientId,
parentBlockType
}
),
count === 1 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_html_convert_button_default,
{
clientId: firstBlockClientId
}
),
!isContentOnly && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CopyMenuItem,
{
clientIds,
onCopy,
shortcut: shortcuts.copy
}
),
!isContentOnly && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CopyMenuItem,
{
clientIds,
label: (0,external_wp_i18n_namespaceObject.__)("Cut"),
eventType: "cut",
shortcut: shortcuts.cut,
__experimentalUpdateSelection: !__experimentalSelectBlock
}
),
canDuplicate && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: (0,external_wp_compose_namespaceObject.pipe)(
onClose,
onDuplicate,
updateSelectionAfterDuplicate
),
shortcut: shortcuts.duplicate,
children: (0,external_wp_i18n_namespaceObject.__)("Duplicate")
}
),
canInsertBlock && !isZoomOut && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: (0,external_wp_compose_namespaceObject.pipe)(
onClose,
onInsertBefore
),
shortcut: shortcuts.insertBefore,
children: (0,external_wp_i18n_namespaceObject.__)("Add before")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: (0,external_wp_compose_namespaceObject.pipe)(
onClose,
onInsertAfter
),
shortcut: shortcuts.insertAfter,
children: (0,external_wp_i18n_namespaceObject.__)("Add after")
}
)
] }),
count === 1 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_comment_icon_slot_default.Slot,
{
fillProps: {
clientId: firstBlockClientId,
onClose
}
}
)
] }),
canCopyStyles && !isContentOnly && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CopyMenuItem,
{
clientIds,
onCopy,
label: (0,external_wp_i18n_namespaceObject.__)("Copy styles"),
eventType: "copyStyles"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: onPasteStyles, children: (0,external_wp_i18n_namespaceObject.__)("Paste styles") })
] }),
!isContentOnly && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_settings_menu_controls_default.Slot,
{
fillProps: {
onClose,
count,
firstBlockClientId
},
clientIds
}
),
typeof children === "function" ? children({ onClose }) : external_wp_element_namespaceObject.Children.map(
(child) => (0,external_wp_element_namespaceObject.cloneElement)(child, { onClose })
),
canRemove && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: (0,external_wp_compose_namespaceObject.pipe)(
onClose,
onRemove,
updateSelectionAfterRemove
),
shortcut: shortcuts.remove,
children: (0,external_wp_i18n_namespaceObject.__)("Delete")
}
) })
] })
}
);
}
}
);
}
var block_settings_dropdown_default = BlockSettingsDropdown;
;// ./node_modules/@wordpress/block-editor/build-module/components/collab/block-comment-icon-toolbar-slot.js
const CommentIconToolbarSlotFill = (0,external_wp_components_namespaceObject.createSlotFill)(
Symbol("CommentIconToolbarSlotFill")
);
var block_comment_icon_toolbar_slot_default = CommentIconToolbarSlotFill;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/index.js
function BlockSettingsMenu({ clientIds, ...props }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_comment_icon_toolbar_slot_default.Slot, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { children: (toggleProps) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_settings_dropdown_default,
{
clientIds,
toggleProps,
...props
}
) })
] });
}
var block_settings_menu_default = BlockSettingsMenu;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-lock/toolbar.js
function BlockLockToolbar({ clientId }) {
const { canLock, isLocked } = useBlockLock(clientId);
const [isModalOpen, toggleModal] = (0,external_wp_element_namespaceObject.useReducer)(
(isActive) => !isActive,
false
);
const hasLockButtonShownRef = (0,external_wp_element_namespaceObject.useRef)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (isLocked) {
hasLockButtonShownRef.current = true;
}
}, [isLocked]);
if (!isLocked && !hasLockButtonShownRef.current) {
return null;
}
let label = isLocked ? (0,external_wp_i18n_namespaceObject.__)("Unlock") : (0,external_wp_i18n_namespaceObject.__)("Lock");
if (!canLock && isLocked) {
label = (0,external_wp_i18n_namespaceObject.__)("Locked");
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { className: "block-editor-block-lock-toolbar", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
disabled: !canLock,
icon: isLocked ? lock_default : unlock_default,
label,
onClick: toggleModal,
"aria-expanded": isModalOpen,
"aria-haspopup": "dialog"
}
) }),
isModalOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockLockModal, { clientId, onClose: toggleModal })
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-visibility/toolbar.js
function BlockVisibilityToolbar({ clientIds }) {
const { blocks, canToggleBlockVisibility } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockName, getBlocksByClientId } = select(store);
const _blocks = getBlocksByClientId(clientIds);
return {
blocks: _blocks,
canToggleBlockVisibility: _blocks.every(
({ clientId }) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(
getBlockName(clientId),
"visibility",
true
)
)
};
},
[clientIds]
);
const hasHiddenBlock = blocks.some(
(block) => block.attributes.metadata?.blockVisibility === false
);
const hasBlockVisibilityButtonShownRef = (0,external_wp_element_namespaceObject.useRef)(false);
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (hasHiddenBlock) {
hasBlockVisibilityButtonShownRef.current = true;
}
}, [hasHiddenBlock]);
if (!hasHiddenBlock && !hasBlockVisibilityButtonShownRef.current) {
return null;
}
const toggleBlockVisibility = () => {
const attributesByClientId = Object.fromEntries(
blocks?.map(({ clientId, attributes }) => [
clientId,
{
metadata: utils_cleanEmptyObject({
...attributes?.metadata,
blockVisibility: hasHiddenBlock ? void 0 : false
})
}
])
);
updateBlockAttributes(clientIds, attributesByClientId, {
uniqueByBlock: true
});
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { className: "block-editor-block-lock-toolbar", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
disabled: !canToggleBlockVisibility,
icon: hasHiddenBlock ? unseen_default : seen_default,
label: hasHiddenBlock ? (0,external_wp_i18n_namespaceObject.__)("Hidden") : (0,external_wp_i18n_namespaceObject.__)("Visible"),
onClick: toggleBlockVisibility
}
) }) });
}
;// ./node_modules/@wordpress/icons/build-module/library/group.js
var group_group_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/row.js
var row_row_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 6.5h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4V16h5a.5.5 0 0 0 .5-.5v-7A.5.5 0 0 0 9 8H4V6.5Zm16 0h-5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h5V16h-5a.5.5 0 0 1-.5-.5v-7A.5.5 0 0 1 15 8h5V6.5Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/stack.js
var stack_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.5 4v5a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V4H8v5a.5.5 0 0 0 .5.5h7A.5.5 0 0 0 16 9V4h1.5Zm0 16v-5a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v5H8v-5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v5h1.5Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/grid.js
var grid_grid_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
d: "m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z",
fillRule: "evenodd",
clipRule: "evenodd"
}
) });
;// ./node_modules/@wordpress/block-editor/build-module/components/convert-to-group-buttons/toolbar.js
const layouts = {
group: { type: "constrained" },
row: { type: "flex", flexWrap: "nowrap" },
stack: { type: "flex", orientation: "vertical" },
grid: { type: "grid" }
};
function BlockGroupToolbar() {
const { blocksSelection, clientIds, groupingBlockName, isGroupable } = useConvertToGroupButtonProps();
const { replaceBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const { canRemove, variations } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { canRemoveBlocks } = select(store);
const { getBlockVariations } = select(external_wp_blocks_namespaceObject.store);
return {
canRemove: canRemoveBlocks(clientIds),
variations: getBlockVariations(
groupingBlockName,
"transform"
)
};
},
[clientIds, groupingBlockName]
);
const onConvertToGroup = (layout) => {
const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(
blocksSelection,
groupingBlockName
);
if (typeof layout !== "string") {
layout = "group";
}
if (newBlocks && newBlocks.length > 0) {
newBlocks[0].attributes.layout = layouts[layout];
replaceBlocks(clientIds, newBlocks);
}
};
const onConvertToRow = () => onConvertToGroup("row");
const onConvertToStack = () => onConvertToGroup("stack");
const onConvertToGrid = () => onConvertToGroup("grid");
if (!isGroupable || !canRemove) {
return null;
}
const canInsertRow = !!variations.find(
({ name }) => name === "group-row"
);
const canInsertStack = !!variations.find(
({ name }) => name === "group-stack"
);
const canInsertGrid = !!variations.find(
({ name }) => name === "group-grid"
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
icon: group_group_default,
label: (0,external_wp_i18n_namespaceObject._x)("Group", "action: convert blocks to group"),
onClick: onConvertToGroup
}
),
canInsertRow && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
icon: row_row_default,
label: (0,external_wp_i18n_namespaceObject._x)("Row", "action: convert blocks to row"),
onClick: onConvertToRow
}
),
canInsertStack && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
icon: stack_default,
label: (0,external_wp_i18n_namespaceObject._x)("Stack", "action: convert blocks to stack"),
onClick: onConvertToStack
}
),
canInsertGrid && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
icon: grid_grid_default,
label: (0,external_wp_i18n_namespaceObject._x)("Grid", "action: convert blocks to grid"),
onClick: onConvertToGrid
}
)
] });
}
var toolbar_default = BlockGroupToolbar;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-edit-visually-button/index.js
function BlockEditVisuallyButton({ clientIds }) {
const clientId = clientIds.length === 1 ? clientIds[0] : void 0;
const canEditVisually = (0,external_wp_data_namespaceObject.useSelect)(
(select) => !!clientId && select(store).getBlockMode(clientId) === "html",
[clientId]
);
const { toggleBlockMode } = (0,external_wp_data_namespaceObject.useDispatch)(store);
if (!canEditVisually) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
onClick: () => {
toggleBlockMode(clientId);
},
children: (0,external_wp_i18n_namespaceObject.__)("Edit visually")
}
) });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/block-name-context.js
const __unstableBlockNameContext = (0,external_wp_element_namespaceObject.createContext)("");
__unstableBlockNameContext.displayName = "__unstableBlockNameContext";
var block_name_context_default = __unstableBlockNameContext;
;// ./node_modules/@wordpress/block-editor/build-module/components/navigable-toolbar/index.js
function hasOnlyToolbarItem(elements) {
const dataProp = "toolbarItem";
return !elements.some((element) => !(dataProp in element.dataset));
}
function getAllFocusableToolbarItemsIn(container) {
return Array.from(
container.querySelectorAll("[data-toolbar-item]:not([disabled])")
);
}
function hasFocusWithin(container) {
return container.contains(container.ownerDocument.activeElement);
}
function focusFirstTabbableIn(container) {
const [firstTabbable] = external_wp_dom_namespaceObject.focus.tabbable.find(container);
if (firstTabbable) {
firstTabbable.focus({
// When focusing newly mounted toolbars,
// the position of the popover is often not right on the first render
// This prevents the layout shifts when focusing the dialogs.
preventScroll: true
});
}
}
function useIsAccessibleToolbar(toolbarRef) {
const initialAccessibleToolbarState = true;
const [isAccessibleToolbar, setIsAccessibleToolbar] = (0,external_wp_element_namespaceObject.useState)(
initialAccessibleToolbarState
);
const determineIsAccessibleToolbar = (0,external_wp_element_namespaceObject.useCallback)(() => {
const tabbables = external_wp_dom_namespaceObject.focus.tabbable.find(toolbarRef.current);
const onlyToolbarItem = hasOnlyToolbarItem(tabbables);
if (!onlyToolbarItem) {
external_wp_deprecated_default()("Using custom components as toolbar controls", {
since: "5.6",
alternative: "ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",
link: "https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"
});
}
setIsAccessibleToolbar(onlyToolbarItem);
}, [toolbarRef]);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
const observer = new window.MutationObserver(
determineIsAccessibleToolbar
);
observer.observe(toolbarRef.current, {
childList: true,
subtree: true
});
return () => observer.disconnect();
}, [determineIsAccessibleToolbar, isAccessibleToolbar, toolbarRef]);
return isAccessibleToolbar;
}
function useToolbarFocus({
toolbarRef,
focusOnMount,
isAccessibleToolbar,
defaultIndex,
onIndexChange,
shouldUseKeyboardFocusShortcut,
focusEditorOnEscape
}) {
const [initialFocusOnMount] = (0,external_wp_element_namespaceObject.useState)(focusOnMount);
const [initialIndex] = (0,external_wp_element_namespaceObject.useState)(defaultIndex);
const focusToolbar = (0,external_wp_element_namespaceObject.useCallback)(() => {
focusFirstTabbableIn(toolbarRef.current);
}, [toolbarRef]);
const focusToolbarViaShortcut = () => {
if (shouldUseKeyboardFocusShortcut) {
focusToolbar();
}
};
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)("core/block-editor/focus-toolbar", focusToolbarViaShortcut);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (initialFocusOnMount) {
focusToolbar();
}
}, [isAccessibleToolbar, initialFocusOnMount, focusToolbar]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const navigableToolbarRef = toolbarRef.current;
let raf = 0;
if (!initialFocusOnMount && !hasFocusWithin(navigableToolbarRef)) {
raf = window.requestAnimationFrame(() => {
const items = getAllFocusableToolbarItemsIn(navigableToolbarRef);
const index = initialIndex || 0;
if (items[index] && hasFocusWithin(navigableToolbarRef)) {
items[index].focus({
// When focusing newly mounted toolbars,
// the position of the popover is often not right on the first render
// This prevents the layout shifts when focusing the dialogs.
preventScroll: true
});
}
});
}
return () => {
window.cancelAnimationFrame(raf);
if (!onIndexChange || !navigableToolbarRef) {
return;
}
const items = getAllFocusableToolbarItemsIn(navigableToolbarRef);
const index = items.findIndex((item) => item.tabIndex === 0);
onIndexChange(index);
};
}, [initialIndex, initialFocusOnMount, onIndexChange, toolbarRef]);
const { getLastFocus } = unlock((0,external_wp_data_namespaceObject.useSelect)(store));
(0,external_wp_element_namespaceObject.useEffect)(() => {
const navigableToolbarRef = toolbarRef.current;
if (focusEditorOnEscape) {
const handleKeyDown = (event) => {
const lastFocus = getLastFocus();
if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && lastFocus?.current) {
event.preventDefault();
lastFocus.current.focus();
}
};
navigableToolbarRef.addEventListener("keydown", handleKeyDown);
return () => {
navigableToolbarRef.removeEventListener(
"keydown",
handleKeyDown
);
};
}
}, [focusEditorOnEscape, getLastFocus, toolbarRef]);
}
function NavigableToolbar({
children,
focusOnMount,
focusEditorOnEscape = false,
shouldUseKeyboardFocusShortcut = true,
__experimentalInitialIndex: initialIndex,
__experimentalOnIndexChange: onIndexChange,
orientation = "horizontal",
...props
}) {
const toolbarRef = (0,external_wp_element_namespaceObject.useRef)();
const isAccessibleToolbar = useIsAccessibleToolbar(toolbarRef);
useToolbarFocus({
toolbarRef,
focusOnMount,
defaultIndex: initialIndex,
onIndexChange,
isAccessibleToolbar,
shouldUseKeyboardFocusShortcut,
focusEditorOnEscape
});
if (isAccessibleToolbar) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Toolbar,
{
label: props["aria-label"],
ref: toolbarRef,
orientation,
...props,
children
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.NavigableMenu,
{
orientation,
role: "toolbar",
ref: toolbarRef,
...props,
children
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/use-has-block-toolbar.js
function useHasBlockToolbar() {
const enabled = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getBlockEditingMode, getBlockName, getBlockSelectionStart } = select(store);
const selectedBlockClientId = getBlockSelectionStart();
const blockType = selectedBlockClientId && (0,external_wp_blocks_namespaceObject.getBlockType)(getBlockName(selectedBlockClientId));
return blockType && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, "__experimentalToolbar", true) && getBlockEditingMode(selectedBlockClientId) !== "disabled";
}, []);
return enabled;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/change-design.js
const change_design_EMPTY_ARRAY = [];
const MAX_PATTERNS_TO_SHOW = 6;
const change_design_POPOVER_PROPS = {
placement: "bottom-start"
};
function ChangeDesign({ clientId }) {
const { categories, currentPatternName, patterns } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getBlockAttributes,
getBlockRootClientId,
__experimentalGetAllowedPatterns
} = select(store);
const attributes = getBlockAttributes(clientId);
const _categories = attributes?.metadata?.categories || change_design_EMPTY_ARRAY;
const rootBlock = getBlockRootClientId(clientId);
const _patterns = _categories.length > 0 ? __experimentalGetAllowedPatterns(rootBlock) : change_design_EMPTY_ARRAY;
return {
categories: _categories,
currentPatternName: attributes?.metadata?.patternName,
patterns: _patterns
};
},
[clientId]
);
const { replaceBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const sameCategoryPatternsWithSingleWrapper = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (categories.length === 0 || !patterns || patterns.length === 0) {
return change_design_EMPTY_ARRAY;
}
return patterns.filter((pattern) => {
const isCorePattern = pattern.source === "core" || pattern.source?.startsWith("pattern-directory") && pattern.source !== "pattern-directory/theme";
return (
// Check if the pattern has only one top level block,
// otherwise we may switch to a pattern that doesn't have replacement suggestions.
pattern.blocks.length === 1 && // We exclude the core patterns and pattern directory patterns that are not theme patterns.
!isCorePattern && // Exclude current pattern.
currentPatternName !== pattern.name && pattern.categories?.some((category) => {
return categories.includes(category);
}) && // Check if the pattern is not a synced pattern.
(pattern.syncStatus === "unsynced" || !pattern.id)
);
}).slice(0, MAX_PATTERNS_TO_SHOW);
}, [categories, currentPatternName, patterns]);
if (sameCategoryPatternsWithSingleWrapper.length < 2) {
return null;
}
const onClickPattern = (pattern) => {
const newBlocks = (pattern.blocks ?? []).map((block) => {
return (0,external_wp_blocks_namespaceObject.cloneBlock)(block);
});
newBlocks[0].attributes.metadata = {
...newBlocks[0].attributes.metadata,
categories
};
replaceBlocks(clientId, newBlocks);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
popoverProps: change_design_POPOVER_PROPS,
renderToggle: ({ onToggle, isOpen }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
onClick: () => onToggle(!isOpen),
"aria-expanded": isOpen,
children: (0,external_wp_i18n_namespaceObject.__)("Change design")
}
) });
},
renderContent: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalDropdownContentWrapper,
{
className: "block-editor-block-toolbar-change-design-content-wrapper",
paddingSize: "none",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_patterns_list_default,
{
blockPatterns: sameCategoryPatternsWithSingleWrapper,
onClickPattern,
showTitlesAsTooltip: true
}
)
}
)
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/switch-section-style.js
const styleIcon = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.SVG,
{
viewBox: "0 0 24 24",
xmlns: "http://www.w3.org/2000/svg",
width: "24",
height: "24",
"aria-hidden": "true",
focusable: "false",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Path,
{
stroke: "currentColor",
strokeWidth: "1.5",
d: "M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"
}
)
]
}
);
function SwitchSectionStyle({ clientId }) {
const { stylesToRender, activeStyle, className } = useStylesForBlocks({
clientId
});
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const { merged: mergedConfig } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext);
const { globalSettings, globalStyles, blockName } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const settings = select(store).getSettings();
return {
globalSettings: settings.__experimentalFeatures,
globalStyles: settings[globalStylesDataKey],
blockName: select(store).getBlockName(clientId)
};
},
[clientId]
);
const activeStyleBackground = activeStyle?.name ? getVariationStylesWithRefValues(
{
settings: mergedConfig?.settings ?? globalSettings,
styles: mergedConfig?.styles ?? globalStyles
},
blockName,
activeStyle.name
)?.color?.background : void 0;
if (!stylesToRender || stylesToRender.length === 0) {
return null;
}
const handleStyleSwitch = () => {
const currentIndex = stylesToRender.findIndex(
(style) => style.name === activeStyle.name
);
const nextIndex = (currentIndex + 1) % stylesToRender.length;
const nextStyle = stylesToRender[nextIndex];
const styleClassName = replaceActiveStyle(
className,
activeStyle,
nextStyle
);
updateBlockAttributes(clientId, {
className: styleClassName
});
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
onClick: handleStyleSwitch,
label: (0,external_wp_i18n_namespaceObject.__)("Shuffle styles"),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Icon,
{
icon: styleIcon,
style: {
fill: activeStyleBackground || "transparent"
}
}
)
}
) });
}
var switch_section_style_default = SwitchSectionStyle;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/index.js
function PrivateBlockToolbar({
hideDragHandle,
focusOnMount,
__experimentalInitialIndex,
__experimentalOnIndexChange,
variant = "unstyled"
}) {
const {
blockClientId,
blockClientIds,
isDefaultEditingMode,
blockType,
toolbarKey,
shouldShowVisualToolbar,
showParentSelector,
isUsingBindings,
hasParentPattern,
hasContentOnlyLocking,
showShuffleButton,
showSlots,
showGroupButtons,
showLockButtons,
showBlockVisibilityButton,
showSwitchSectionStyleButton
} = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const {
getBlockName,
getBlockMode,
getBlockParents,
getSelectedBlockClientIds,
isBlockValid,
getBlockEditingMode,
getBlockAttributes,
getBlockParentsByBlockName,
getTemplateLock,
getParentSectionBlock,
isZoomOut,
isSectionBlock
} = unlock(select(store));
const selectedBlockClientIds = getSelectedBlockClientIds();
const selectedBlockClientId = selectedBlockClientIds[0];
const parents = getBlockParents(selectedBlockClientId);
const parentSection = getParentSectionBlock(selectedBlockClientId);
const parentClientId = parentSection ?? parents[parents.length - 1];
const parentBlockName = getBlockName(parentClientId);
const parentBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(parentBlockName);
const editingMode = getBlockEditingMode(selectedBlockClientId);
const _isDefaultEditingMode = editingMode === "default";
const _blockName = getBlockName(selectedBlockClientId);
const isValid = selectedBlockClientIds.every(
(id) => isBlockValid(id)
);
const isVisual = selectedBlockClientIds.every(
(id) => getBlockMode(id) === "visual"
);
const _isUsingBindings = selectedBlockClientIds.every(
(clientId) => !!getBlockAttributes(clientId)?.metadata?.bindings
);
const _hasParentPattern = selectedBlockClientIds.every(
(clientId) => getBlockParentsByBlockName(clientId, "core/block", true).length > 0
);
const _hasTemplateLock = selectedBlockClientIds.some(
(id) => getTemplateLock(id) === "contentOnly"
);
const _isZoomOut = isZoomOut();
const _showSwitchSectionStyleButton = window?.__experimentalContentOnlyPatternInsertion && (_isZoomOut || isSectionBlock(selectedBlockClientId));
return {
blockClientId: selectedBlockClientId,
blockClientIds: selectedBlockClientIds,
isDefaultEditingMode: _isDefaultEditingMode,
blockType: selectedBlockClientId && (0,external_wp_blocks_namespaceObject.getBlockType)(_blockName),
shouldShowVisualToolbar: isValid && isVisual,
toolbarKey: `${selectedBlockClientId}${parentClientId}`,
showParentSelector: !_isZoomOut && parentBlockType && editingMode !== "contentOnly" && getBlockEditingMode(parentClientId) !== "disabled" && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(
parentBlockType,
"__experimentalParentSelector",
true
) && selectedBlockClientIds.length === 1,
isUsingBindings: _isUsingBindings,
hasParentPattern: _hasParentPattern,
hasContentOnlyLocking: _hasTemplateLock,
showShuffleButton: _isZoomOut,
showSlots: !_isZoomOut,
showGroupButtons: !_isZoomOut,
showLockButtons: !_isZoomOut,
showBlockVisibilityButton: !_isZoomOut,
showSwitchSectionStyleButton: _showSwitchSectionStyleButton
};
}, []);
const toolbarWrapperRef = (0,external_wp_element_namespaceObject.useRef)(null);
const nodeRef = (0,external_wp_element_namespaceObject.useRef)();
const showHoveredOrFocusedGestures = useShowHoveredOrFocusedGestures({
ref: nodeRef
});
const isLargeViewport = !(0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
const hasBlockToolbar = useHasBlockToolbar();
if (!hasBlockToolbar) {
return null;
}
const isMultiToolbar = blockClientIds.length > 1;
const isSynced = (0,external_wp_blocks_namespaceObject.isReusableBlock)(blockType) || (0,external_wp_blocks_namespaceObject.isTemplatePart)(blockType);
const classes = dist_clsx("block-editor-block-contextual-toolbar", {
"has-parent": showParentSelector
});
const innerClasses = dist_clsx("block-editor-block-toolbar", {
"is-synced": isSynced,
"is-connected": isUsingBindings
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
NavigableToolbar,
{
focusEditorOnEscape: true,
className: classes,
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Block tools"),
variant: variant === "toolbar" ? void 0 : variant,
focusOnMount,
__experimentalInitialIndex,
__experimentalOnIndexChange,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ref: toolbarWrapperRef, className: innerClasses, children: [
showParentSelector && !isMultiToolbar && isLargeViewport && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockParentSelector, {}),
(shouldShowVisualToolbar || isMultiToolbar) && !hasParentPattern && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
ref: nodeRef,
...showHoveredOrFocusedGestures,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { className: "block-editor-block-toolbar__block-controls", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_switcher_default, { clientIds: blockClientIds }),
isDefaultEditingMode && showBlockVisibilityButton && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockVisibilityToolbar,
{
clientIds: blockClientIds
}
),
!isMultiToolbar && isDefaultEditingMode && showLockButtons && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockLockToolbar,
{
clientId: blockClientId
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_mover_default,
{
clientIds: blockClientIds,
hideDragHandle
}
)
] })
}
),
!hasContentOnlyLocking && shouldShowVisualToolbar && isMultiToolbar && showGroupButtons && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_default, {}),
showShuffleButton && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ChangeDesign, { clientId: blockClientIds[0] }),
showSwitchSectionStyleButton && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(switch_section_style_default, { clientId: blockClientIds[0] }),
shouldShowVisualToolbar && showSlots && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_controls_default.Slot,
{
group: "parent",
className: "block-editor-block-toolbar__slot"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_controls_default.Slot,
{
group: "block",
className: "block-editor-block-toolbar__slot"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls_default.Slot, { className: "block-editor-block-toolbar__slot" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_controls_default.Slot,
{
group: "inline",
className: "block-editor-block-toolbar__slot"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_controls_default.Slot,
{
group: "other",
className: "block-editor-block-toolbar__slot"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_name_context_default.Provider,
{
value: blockType?.name,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_toolbar_last_item_default.Slot, {})
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEditVisuallyButton, { clientIds: blockClientIds }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_settings_menu_default, { clientIds: blockClientIds })
] })
},
toolbarKey
);
}
function BlockToolbar({ hideDragHandle, variant }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PrivateBlockToolbar,
{
hideDragHandle,
variant,
focusOnMount: void 0,
__experimentalInitialIndex: void 0,
__experimentalOnIndexChange: void 0
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/block-toolbar-popover.js
function BlockToolbarPopover({
clientId,
isTyping,
__unstableContentRef
}) {
const { capturingClientId, isInsertionPointVisible, lastClientId } = useSelectedBlockToolProps(clientId);
const initialToolbarItemIndexRef = (0,external_wp_element_namespaceObject.useRef)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
initialToolbarItemIndexRef.current = void 0;
}, [clientId]);
const { stopTyping } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const isToolbarForcedRef = (0,external_wp_element_namespaceObject.useRef)(false);
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)("core/block-editor/focus-toolbar", () => {
isToolbarForcedRef.current = true;
stopTyping(true);
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
isToolbarForcedRef.current = false;
});
const clientIdToPositionOver = capturingClientId || clientId;
const popoverProps = useBlockToolbarPopoverProps({
contentElement: __unstableContentRef?.current,
clientId: clientIdToPositionOver
});
return !isTyping && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PrivateBlockPopover,
{
clientId: clientIdToPositionOver,
bottomClientId: lastClientId,
className: dist_clsx("block-editor-block-list__block-popover", {
"is-insertion-point-visible": isInsertionPointVisible
}),
resize: false,
...popoverProps,
__unstableContentRef,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PrivateBlockToolbar,
{
focusOnMount: isToolbarForcedRef.current,
__experimentalInitialIndex: initialToolbarItemIndexRef.current,
__experimentalOnIndexChange: (index) => {
initialToolbarItemIndexRef.current = index;
},
variant: "toolbar"
}
)
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/zoom-out-mode-inserter-button.js
function ZoomOutModeInserterButton({ onClick }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: "primary",
icon: plus_default,
size: "compact",
className: dist_clsx(
"block-editor-button-pattern-inserter__button",
"block-editor-block-tools__zoom-out-mode-inserter-button"
),
onClick,
label: (0,external_wp_i18n_namespaceObject._x)(
"Add pattern",
"Generic label for pattern inserter button"
)
}
);
}
var zoom_out_mode_inserter_button_default = ZoomOutModeInserterButton;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/zoom-out-mode-inserters.js
function ZoomOutModeInserters() {
const [isReady, setIsReady] = (0,external_wp_element_namespaceObject.useState)(false);
const {
hasSelection,
blockOrder,
setInserterIsOpened,
sectionRootClientId,
selectedBlockClientId,
blockInsertionPoint,
insertionPointVisible
} = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const {
getSettings,
getBlockOrder,
getSelectionStart,
getSelectedBlockClientId,
getSectionRootClientId,
getBlockInsertionPoint,
isBlockInsertionPointVisible
} = unlock(select(store));
const root = getSectionRootClientId();
return {
hasSelection: !!getSelectionStart().clientId,
blockOrder: getBlockOrder(root),
sectionRootClientId: root,
setInserterIsOpened: getSettings().__experimentalSetIsInserterOpened,
selectedBlockClientId: getSelectedBlockClientId(),
blockInsertionPoint: getBlockInsertionPoint(),
insertionPointVisible: isBlockInsertionPointVisible()
};
}, []);
const { showInsertionPoint } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
(0,external_wp_element_namespaceObject.useEffect)(() => {
const timeout = setTimeout(() => {
setIsReady(true);
}, 500);
return () => {
clearTimeout(timeout);
};
}, []);
if (!isReady || !hasSelection) {
return null;
}
const previousClientId = selectedBlockClientId;
const index = blockOrder.findIndex(
(clientId) => selectedBlockClientId === clientId
);
const insertionIndex = index + 1;
const nextClientId = blockOrder[insertionIndex];
if (insertionPointVisible && blockInsertionPoint?.index === insertionIndex) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inbetween_default,
{
previousClientId,
nextClientId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
zoom_out_mode_inserter_button_default,
{
onClick: () => {
setInserterIsOpened({
rootClientId: sectionRootClientId,
insertionIndex,
tab: "patterns",
category: "all"
});
showInsertionPoint(sectionRootClientId, insertionIndex, {
operation: "insert"
});
}
}
)
}
);
}
var zoom_out_mode_inserters_default = ZoomOutModeInserters;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/use-show-block-tools.js
function useShowBlockTools() {
return (0,external_wp_data_namespaceObject.useSelect)((select) => {
const {
getSelectedBlockClientId,
getFirstMultiSelectedBlockClientId,
getBlock,
getBlockMode,
getSettings,
isTyping,
isBlockInterfaceHidden
} = unlock(select(store));
const clientId = getSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();
const block = getBlock(clientId);
const hasSelectedBlock = !!clientId && !!block;
const isEmptyDefaultBlock = hasSelectedBlock && (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(block, "content") && getBlockMode(clientId) !== "html";
const _showEmptyBlockSideInserter = clientId && !isTyping() && isEmptyDefaultBlock;
const _showBlockToolbarPopover = !isBlockInterfaceHidden() && !getSettings().hasFixedToolbar && !_showEmptyBlockSideInserter && hasSelectedBlock && !isEmptyDefaultBlock;
return {
showEmptyBlockSideInserter: _showEmptyBlockSideInserter,
showBlockToolbarPopover: _showBlockToolbarPopover
};
}, []);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/index.js
function block_tools_selector(select) {
const {
getSelectedBlockClientId,
getFirstMultiSelectedBlockClientId,
getSettings,
isTyping,
isDragging,
isZoomOut
} = unlock(select(store));
const clientId = getSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();
return {
clientId,
hasFixedToolbar: getSettings().hasFixedToolbar,
isTyping: isTyping(),
isZoomOutMode: isZoomOut(),
isDragging: isDragging()
};
}
function BlockTools({
children,
__unstableContentRef,
...props
}) {
const { clientId, hasFixedToolbar, isTyping, isZoomOutMode, isDragging } = (0,external_wp_data_namespaceObject.useSelect)(block_tools_selector, []);
const isMatch = (0,external_wp_keyboardShortcuts_namespaceObject.__unstableUseShortcutEventMatch)();
const {
getBlocksByClientId,
getSelectedBlockClientIds,
getBlockRootClientId,
isGroupable,
getBlockName
} = (0,external_wp_data_namespaceObject.useSelect)(store);
const { getGroupingBlockName } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store);
const { showEmptyBlockSideInserter, showBlockToolbarPopover } = useShowBlockTools();
const pasteStyles = usePasteStyles();
const {
duplicateBlocks,
removeBlocks,
replaceBlocks,
insertAfterBlock,
insertBeforeBlock,
selectBlock,
moveBlocksUp,
moveBlocksDown,
expandBlock,
updateBlockAttributes
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
function onKeyDown(event) {
if (event.defaultPrevented) {
return;
}
if (isMatch("core/block-editor/move-up", event) || isMatch("core/block-editor/move-down", event)) {
const clientIds = getSelectedBlockClientIds();
if (clientIds.length) {
event.preventDefault();
const rootClientId = getBlockRootClientId(clientIds[0]);
const direction = isMatch("core/block-editor/move-up", event) ? "up" : "down";
if (direction === "up") {
moveBlocksUp(clientIds, rootClientId);
} else {
moveBlocksDown(clientIds, rootClientId);
}
const blockLength = Array.isArray(clientIds) ? clientIds.length : 1;
const message = (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %d: the name of the block that has been moved
(0,external_wp_i18n_namespaceObject._n)(
"%d block moved.",
"%d blocks moved.",
clientIds.length
),
blockLength
);
(0,external_wp_a11y_namespaceObject.speak)(message);
}
} else if (isMatch("core/block-editor/duplicate", event)) {
const clientIds = getSelectedBlockClientIds();
if (clientIds.length) {
event.preventDefault();
duplicateBlocks(clientIds);
}
} else if (isMatch("core/block-editor/remove", event)) {
const clientIds = getSelectedBlockClientIds();
if (clientIds.length) {
event.preventDefault();
removeBlocks(clientIds);
}
} else if (isMatch("core/block-editor/paste-styles", event)) {
const clientIds = getSelectedBlockClientIds();
if (clientIds.length) {
event.preventDefault();
const blocks = getBlocksByClientId(clientIds);
pasteStyles(blocks);
}
} else if (isMatch("core/block-editor/insert-after", event)) {
const clientIds = getSelectedBlockClientIds();
if (clientIds.length) {
event.preventDefault();
insertAfterBlock(clientIds[clientIds.length - 1]);
}
} else if (isMatch("core/block-editor/insert-before", event)) {
const clientIds = getSelectedBlockClientIds();
if (clientIds.length) {
event.preventDefault();
insertBeforeBlock(clientIds[0]);
}
} else if (isMatch("core/block-editor/unselect", event)) {
if (event.target.closest("[role=toolbar]")) {
return;
}
const clientIds = getSelectedBlockClientIds();
if (clientIds.length > 1) {
event.preventDefault();
selectBlock(clientIds[0]);
}
} else if (isMatch("core/block-editor/collapse-list-view", event)) {
if ((0,external_wp_dom_namespaceObject.isTextField)(event.target) || (0,external_wp_dom_namespaceObject.isTextField)(
event.target?.contentWindow?.document?.activeElement
)) {
return;
}
event.preventDefault();
expandBlock(clientId);
} else if (isMatch("core/block-editor/group", event)) {
const clientIds = getSelectedBlockClientIds();
if (clientIds.length > 1 && isGroupable(clientIds)) {
event.preventDefault();
const blocks = getBlocksByClientId(clientIds);
const groupingBlockName = getGroupingBlockName();
const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(
blocks,
groupingBlockName
);
replaceBlocks(clientIds, newBlocks);
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)("Selected blocks are grouped."));
}
} else if (isMatch("core/block-editor/toggle-block-visibility", event)) {
const clientIds = getSelectedBlockClientIds();
if (clientIds.length) {
event.preventDefault();
const blocks = getBlocksByClientId(clientIds);
const canToggleBlockVisibility = blocks.every(
(block) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(
getBlockName(block.clientId),
"visibility",
true
)
);
if (!canToggleBlockVisibility) {
return;
}
const hasHiddenBlock = blocks.some(
(block) => block.attributes.metadata?.blockVisibility === false
);
const attributesByClientId = Object.fromEntries(
blocks.map(({ clientId: mapClientId, attributes }) => [
mapClientId,
{
metadata: utils_cleanEmptyObject({
...attributes?.metadata,
blockVisibility: hasHiddenBlock ? void 0 : false
})
}
])
);
updateBlockAttributes(clientIds, attributesByClientId, {
uniqueByBlock: true
});
}
}
}
const blockToolbarRef = use_popover_scroll_default(__unstableContentRef);
const blockToolbarAfterRef = use_popover_scroll_default(__unstableContentRef);
return (
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
...props,
onKeyDown,
className: dist_clsx(props.className, {
"block-editor-block-tools--is-dragging": isDragging
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(InsertionPointOpenRef.Provider, { value: (0,external_wp_element_namespaceObject.useRef)(false), children: [
!isTyping && !isZoomOutMode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
InsertionPoint,
{
__unstableContentRef
}
),
showEmptyBlockSideInserter && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
EmptyBlockInserter,
{
__unstableContentRef,
clientId
}
),
showBlockToolbarPopover && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockToolbarPopover,
{
__unstableContentRef,
clientId,
isTyping
}
),
!isZoomOutMode && !hasFixedToolbar && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Popover.Slot,
{
name: "block-toolbar",
ref: blockToolbarRef
}
),
children,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Popover.Slot,
{
name: "__unstable-block-tools-after",
ref: blockToolbarAfterRef
}
),
isZoomOutMode && !isDragging && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
zoom_out_mode_inserters_default,
{
__unstableContentRef
}
)
] })
}
)
);
}
;// external ["wp","commands"]
const external_wp_commands_namespaceObject = window["wp"]["commands"];
;// ./node_modules/@wordpress/icons/build-module/library/ungroup.js
var ungroup_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/trash.js
var trash_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"
}
) });
;// ./node_modules/@wordpress/block-editor/build-module/components/use-block-commands/index.js
const getTransformCommands = () => function useTransformCommands() {
const { replaceBlocks, multiSelect } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const {
blocks,
clientIds,
canRemove,
possibleBlockTransformations,
invalidSelection
} = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const {
getBlockRootClientId,
getBlockTransformItems,
getSelectedBlockClientIds,
getBlocksByClientId,
canRemoveBlocks
} = select(store);
const selectedBlockClientIds = getSelectedBlockClientIds();
const selectedBlocks = getBlocksByClientId(
selectedBlockClientIds
);
if (selectedBlocks.filter((block) => !block).length > 0) {
return {
invalidSelection: true
};
}
const rootClientId = getBlockRootClientId(
selectedBlockClientIds[0]
);
return {
blocks: selectedBlocks,
clientIds: selectedBlockClientIds,
possibleBlockTransformations: getBlockTransformItems(
selectedBlocks,
rootClientId
),
canRemove: canRemoveBlocks(selectedBlockClientIds),
invalidSelection: false
};
}, []);
if (invalidSelection) {
return {
isLoading: false,
commands: []
};
}
const isTemplate = blocks.length === 1 && (0,external_wp_blocks_namespaceObject.isTemplatePart)(blocks[0]);
function selectForMultipleBlocks(insertedBlocks) {
if (insertedBlocks.length > 1) {
multiSelect(
insertedBlocks[0].clientId,
insertedBlocks[insertedBlocks.length - 1].clientId
);
}
}
function onBlockTransform(name) {
const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, name);
replaceBlocks(clientIds, newBlocks);
selectForMultipleBlocks(newBlocks);
}
const hasPossibleBlockTransformations = !!possibleBlockTransformations.length && canRemove && !isTemplate;
if (!clientIds || clientIds.length < 1 || !hasPossibleBlockTransformations) {
return { isLoading: false, commands: [] };
}
const commands = possibleBlockTransformations.map(
(transformation) => {
const { name, title, icon } = transformation;
return {
name: "core/block-editor/transform-to-" + name.replace("/", "-"),
/* translators: %s: Block or block variation name. */
label: (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Transform to %s"), title),
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon_default, { icon }),
callback: ({ close }) => {
onBlockTransform(name);
close();
}
};
}
);
return { isLoading: false, commands };
};
const getQuickActionsCommands = () => function useQuickActionsCommands() {
const { clientIds, isUngroupable, isGroupable } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getSelectedBlockClientIds,
isUngroupable: _isUngroupable,
isGroupable: _isGroupable
} = select(store);
const selectedBlockClientIds = getSelectedBlockClientIds();
return {
clientIds: selectedBlockClientIds,
isUngroupable: _isUngroupable(),
isGroupable: _isGroupable()
};
},
[]
);
const {
canInsertBlockType,
getBlockRootClientId,
getBlocksByClientId,
canRemoveBlocks,
getBlockName
} = (0,external_wp_data_namespaceObject.useSelect)(store);
const { getDefaultBlockName, getGroupingBlockName } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store);
const blocks = getBlocksByClientId(clientIds);
const {
removeBlocks,
replaceBlocks,
duplicateBlocks,
insertAfterBlock,
insertBeforeBlock,
updateBlockAttributes
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
const onGroup = () => {
if (!blocks.length) {
return;
}
const groupingBlockName = getGroupingBlockName();
const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, groupingBlockName);
if (!newBlocks) {
return;
}
replaceBlocks(clientIds, newBlocks);
};
const onUngroup = () => {
if (!blocks.length) {
return;
}
const innerBlocks = blocks[0].innerBlocks;
if (!innerBlocks.length) {
return;
}
replaceBlocks(clientIds, innerBlocks);
};
if (!clientIds || clientIds.length < 1) {
return { isLoading: false, commands: [] };
}
const rootClientId = getBlockRootClientId(clientIds[0]);
const canInsertDefaultBlock = canInsertBlockType(
getDefaultBlockName(),
rootClientId
);
const canDuplicate = blocks.every((block) => {
return !!block && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(block.name, "multiple", true) && canInsertBlockType(block.name, rootClientId);
});
const canRemove = canRemoveBlocks(clientIds);
const canToggleBlockVisibility = blocks.every(
({ clientId }) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(getBlockName(clientId), "visibility", true)
);
const commands = [];
if (canDuplicate) {
commands.push({
name: "duplicate",
label: (0,external_wp_i18n_namespaceObject.__)("Duplicate"),
callback: () => duplicateBlocks(clientIds, true),
icon: copy_default
});
}
if (canInsertDefaultBlock) {
commands.push(
{
name: "add-before",
label: (0,external_wp_i18n_namespaceObject.__)("Add before"),
callback: () => {
const clientId = Array.isArray(clientIds) ? clientIds[0] : clientId;
insertBeforeBlock(clientId);
},
icon: plus_default
},
{
name: "add-after",
label: (0,external_wp_i18n_namespaceObject.__)("Add after"),
callback: () => {
const clientId = Array.isArray(clientIds) ? clientIds[clientIds.length - 1] : clientId;
insertAfterBlock(clientId);
},
icon: plus_default
}
);
}
if (isGroupable) {
commands.push({
name: "Group",
label: (0,external_wp_i18n_namespaceObject.__)("Group"),
callback: onGroup,
icon: group_group_default
});
}
if (isUngroupable) {
commands.push({
name: "ungroup",
label: (0,external_wp_i18n_namespaceObject.__)("Ungroup"),
callback: onUngroup,
icon: ungroup_default
});
}
if (canRemove) {
commands.push({
name: "remove",
label: (0,external_wp_i18n_namespaceObject.__)("Delete"),
callback: () => removeBlocks(clientIds, true),
icon: trash_default
});
}
if (canToggleBlockVisibility) {
const hasHiddenBlock = blocks.some(
(block) => block.attributes.metadata?.blockVisibility === false
);
commands.push({
name: "core/toggle-block-visibility",
label: hasHiddenBlock ? (0,external_wp_i18n_namespaceObject.__)("Show") : (0,external_wp_i18n_namespaceObject.__)("Hide"),
callback: () => {
const attributesByClientId = Object.fromEntries(
blocks?.map(({ clientId, attributes }) => [
clientId,
{
metadata: utils_cleanEmptyObject({
...attributes?.metadata,
blockVisibility: hasHiddenBlock ? void 0 : false
})
}
])
);
updateBlockAttributes(clientIds, attributesByClientId, {
uniqueByBlock: true
});
},
icon: hasHiddenBlock ? seen_default : unseen_default
});
}
return {
isLoading: false,
commands: commands.map((command) => ({
...command,
name: "core/block-editor/action-" + command.name,
callback: ({ close }) => {
command.callback();
close();
}
}))
};
};
const useBlockCommands = () => {
(0,external_wp_commands_namespaceObject.useCommandLoader)({
name: "core/block-editor/blockTransforms",
hook: getTransformCommands()
});
(0,external_wp_commands_namespaceObject.useCommandLoader)({
name: "core/block-editor/blockQuickActions",
hook: getQuickActionsCommands(),
context: "block-selection-edit"
});
};
;// ./node_modules/@wordpress/block-editor/build-module/components/block-canvas/index.js
const EDITOR_STYLE_TRANSFORM_OPTIONS = {
// Don't transform selectors that already specify `.editor-styles-wrapper`.
ignoredSelectors: [/\.editor-styles-wrapper/gi]
};
function ExperimentalBlockCanvas({
shouldIframe = true,
height = "300px",
children = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockList, {}),
styles,
contentRef: contentRefProp,
iframeProps
}) {
useBlockCommands();
const isTabletViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
const resetTypingRef = useMouseMoveTypingReset();
const clearerRef = useBlockSelectionClearer();
const localRef = (0,external_wp_element_namespaceObject.useRef)();
const contentRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([contentRefProp, clearerRef, localRef]);
const zoomLevel = (0,external_wp_data_namespaceObject.useSelect)(
(select) => unlock(select(store)).getZoomLevel(),
[]
);
const zoomOutIframeProps = zoomLevel !== 100 && !isTabletViewport ? {
scale: zoomLevel,
frameSize: "40px"
} : {};
if (!shouldIframe) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
BlockTools,
{
__unstableContentRef: localRef,
style: { height, display: "flex" },
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
editor_styles_default,
{
styles,
scope: ":where(.editor-styles-wrapper)",
transformOptions: EDITOR_STYLE_TRANSFORM_OPTIONS
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
writing_flow_default,
{
ref: contentRef,
className: "editor-styles-wrapper",
tabIndex: -1,
style: {
height: "100%",
width: "100%"
},
children
}
)
]
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockTools,
{
__unstableContentRef: localRef,
style: { height, display: "flex" },
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
iframe_default,
{
...iframeProps,
...zoomOutIframeProps,
ref: resetTypingRef,
contentRef,
style: {
...iframeProps?.style
},
name: "editor-canvas",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_styles_default, { styles }),
children
]
}
)
}
);
}
function BlockCanvas({ children, height, styles }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalBlockCanvas, { height, styles, children });
}
var block_canvas_default = BlockCanvas;
;// ./node_modules/@wordpress/block-editor/build-module/components/color-style-selector/index.js
const ColorSelectorSVGIcon = () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z" }) });
const ColorSelectorIcon = ({ style, className }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-library-colors-selector__icon-container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: `${className} block-library-colors-selector__state-selection`,
style,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorSelectorSVGIcon, {})
}
) });
};
const renderToggleComponent = ({ TextColor, BackgroundColor }) => ({ onToggle, isOpen }) => {
const openOnArrowDown = (event) => {
if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) {
event.preventDefault();
onToggle();
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
className: "components-toolbar__control block-library-colors-selector__toggle",
label: (0,external_wp_i18n_namespaceObject.__)("Open Colors Selector"),
onClick: onToggle,
onKeyDown: openOnArrowDown,
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BackgroundColor, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TextColor, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorSelectorIcon, {}) }) })
}
) });
};
const BlockColorsStyleSelector = ({ children, ...other }) => {
external_wp_deprecated_default()(`wp.blockEditor.BlockColorsStyleSelector`, {
alternative: "block supports API",
since: "6.1",
version: "6.3"
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
popoverProps: { placement: "bottom-start" },
className: "block-library-colors-selector",
contentClassName: "block-library-colors-selector__popover",
renderToggle: renderToggleComponent(other),
renderContent: () => children
}
);
};
var color_style_selector_default = BlockColorsStyleSelector;
;// ./node_modules/@wordpress/icons/build-module/library/list-view.js
var list_view_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/context.js
const ListViewContext = (0,external_wp_element_namespaceObject.createContext)({});
ListViewContext.displayName = "ListViewContext";
const useListViewContext = () => (0,external_wp_element_namespaceObject.useContext)(ListViewContext);
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/aria-referenced-text.js
function AriaReferencedText({ children, ...props }) {
const ref = (0,external_wp_element_namespaceObject.useRef)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (ref.current) {
ref.current.textContent = ref.current.textContent;
}
}, [children]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { hidden: true, ...props, ref, children });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/appender.js
const Appender = (0,external_wp_element_namespaceObject.forwardRef)(
({ nestingLevel, blockCount, clientId, ...props }, ref) => {
const { insertedBlock, setInsertedBlock } = useListViewContext();
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(Appender);
const { directInsert, hideInserter } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockListSettings, getTemplateLock, isZoomOut } = unlock(select(store));
const settings = getBlockListSettings(clientId);
const directInsertValue = settings?.directInsert || false;
const hideInserterValue = !!getTemplateLock(clientId) || isZoomOut();
return {
directInsert: directInsertValue,
hideInserter: hideInserterValue
};
},
[clientId]
);
const blockTitle = useBlockDisplayTitle({
clientId,
context: "list-view"
});
const insertedBlockTitle = useBlockDisplayTitle({
clientId: insertedBlock?.clientId,
context: "list-view"
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!insertedBlockTitle?.length) {
return;
}
(0,external_wp_a11y_namespaceObject.speak)(
(0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: name of block being inserted (i.e. Paragraph, Image, Group etc)
(0,external_wp_i18n_namespaceObject.__)("%s block inserted"),
insertedBlockTitle
),
"assertive"
);
}, [insertedBlockTitle]);
if (hideInserter) {
return null;
}
const descriptionId = `list-view-appender__${instanceId}`;
const description = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: The name of the block. 2: The numerical position of the block. 3: The level of nesting for the block. */
(0,external_wp_i18n_namespaceObject.__)("Append to %1$s block at position %2$d, Level %3$d"),
blockTitle,
blockCount + 1,
nestingLevel
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "list-view-appender", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inserter_default,
{
ref,
rootClientId: clientId,
position: "bottom right",
isAppender: true,
selectBlockOnInsert: false,
shouldDirectInsert: directInsert,
__experimentalIsQuick: true,
...props,
toggleProps: { "aria-describedby": descriptionId },
onSelectOrClose: (maybeInsertedBlock) => {
if (maybeInsertedBlock?.clientId) {
setInsertedBlock(maybeInsertedBlock);
}
}
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(AriaReferencedText, { id: descriptionId, children: description })
] });
}
);
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/leaf.js
const AnimatedTreeGridRow = dist_esm_it(external_wp_components_namespaceObject.__experimentalTreeGridRow);
const ListViewLeaf = (0,external_wp_element_namespaceObject.forwardRef)(
({
isDragged,
isSelected,
position,
level,
rowCount,
children,
className,
path,
...props
}, ref) => {
const animationRef = use_moving_animation_default({
clientId: props["data-block"],
enableAnimation: true,
triggerAnimationOnChange: path
});
const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, animationRef]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
AnimatedTreeGridRow,
{
ref: mergedRef,
className: dist_clsx("block-editor-list-view-leaf", className),
level,
positionInSet: position,
setSize: rowCount,
isExpanded: void 0,
...props,
children
}
);
}
);
var leaf_default = ListViewLeaf;
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-scroll-into-view.js
function useListViewScrollIntoView({
isSelected,
selectedClientIds,
rowItemRef
}) {
const isSingleSelection = selectedClientIds.length === 1;
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (!isSelected || !isSingleSelection || !rowItemRef.current) {
return;
}
const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(rowItemRef.current);
const { ownerDocument } = rowItemRef.current;
const windowScroll = scrollContainer === ownerDocument.body || scrollContainer === ownerDocument.documentElement;
if (windowScroll || !scrollContainer) {
return;
}
const rowRect = rowItemRef.current.getBoundingClientRect();
const scrollContainerRect = scrollContainer.getBoundingClientRect();
if (rowRect.top < scrollContainerRect.top || rowRect.bottom > scrollContainerRect.bottom) {
rowItemRef.current.scrollIntoView();
}
}, [isSelected, isSingleSelection, rowItemRef]);
}
;// ./node_modules/@wordpress/icons/build-module/library/pin-small.js
var pin_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.97 10.159a3.382 3.382 0 0 0-2.857.955l1.724 1.723-2.836 2.913L7 17h1.25l2.913-2.837 1.723 1.723a3.38 3.38 0 0 0 .606-.825c.33-.63.446-1.343.35-2.032L17 10.695 13.305 7l-2.334 3.159Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/lock-small.js
var lock_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"
}
) });
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/expander.js
function ListViewExpander({ onClick }) {
return (
// Keyboard events are handled by TreeGrid see: components/src/tree-grid/index.js
//
// The expander component is implemented as a pseudo element in the w3 example
// https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html
//
// We've mimicked this by adding an icon with aria-hidden set to true to hide this from the accessibility tree.
// For the current tree grid implementation, please do not try to make this a button.
//
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: "block-editor-list-view__expander",
onClick: (event) => onClick(event, { forceToggle: true }),
"aria-hidden": "true",
"data-testid": "list-view-expander",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_small_default : chevron_right_small_default })
}
)
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-images.js
const MAX_IMAGES = 3;
const IMAGE_GETTERS = {
"core/image": ({ clientId, attributes }) => {
if (attributes.url) {
return {
url: attributes.url,
alt: attributes.alt || "",
clientId
};
}
},
"core/cover": ({ clientId, attributes }) => {
if (attributes.backgroundType === "image" && attributes.url) {
return {
url: attributes.url,
alt: attributes.alt || "",
clientId
};
}
},
"core/media-text": ({ clientId, attributes }) => {
if (attributes.mediaType === "image" && attributes.mediaUrl) {
return {
url: attributes.mediaUrl,
alt: attributes.mediaAlt || "",
clientId
};
}
},
"core/gallery": ({ innerBlocks }) => {
const images = [];
const getValues = !!innerBlocks?.length ? IMAGE_GETTERS[innerBlocks[0].name] : void 0;
if (!getValues) {
return images;
}
for (const innerBlock of innerBlocks) {
const img = getValues(innerBlock);
if (img) {
images.push(img);
}
if (images.length >= MAX_IMAGES) {
return images;
}
}
return images;
}
};
function getImagesFromBlock(block, isExpanded) {
const getImages = IMAGE_GETTERS[block.name];
const images = !!getImages ? getImages(block) : void 0;
if (!images) {
return [];
}
if (!Array.isArray(images)) {
return [images];
}
return isExpanded ? [] : images;
}
function useListViewImages({ clientId, isExpanded }) {
const { block } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
return { block: select(store).getBlock(clientId) };
},
[clientId]
);
const images = (0,external_wp_element_namespaceObject.useMemo)(() => {
return getImagesFromBlock(block, isExpanded);
}, [block, isExpanded]);
return images;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/block-select-button.js
const { Badge: block_select_button_Badge } = unlock(external_wp_components_namespaceObject.privateApis);
function ListViewBlockSelectButton({
className,
block: { clientId },
onClick,
onContextMenu,
onMouseDown,
onToggleExpanded,
tabIndex,
onFocus,
onDragStart,
onDragEnd,
draggable,
isExpanded,
ariaDescribedBy
}, ref) {
const blockInformation = useBlockDisplayInformation(clientId);
const blockTitle = useBlockDisplayTitle({
clientId,
context: "list-view"
});
const { isLocked } = useBlockLock(clientId);
const { canToggleBlockVisibility, isBlockHidden, isContentOnly } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockName } = select(store);
const { isBlockHidden: _isBlockHidden } = unlock(
select(store)
);
return {
canToggleBlockVisibility: (0,external_wp_blocks_namespaceObject.hasBlockSupport)(
getBlockName(clientId),
"visibility",
true
),
isBlockHidden: _isBlockHidden(clientId),
isContentOnly: select(store).getBlockEditingMode(
clientId
) === "contentOnly"
};
},
[clientId]
);
const shouldShowLockIcon = isLocked && !isContentOnly;
const shouldShowBlockVisibilityIcon = canToggleBlockVisibility && isBlockHidden;
const isSticky = blockInformation?.positionType === "sticky";
const images = useListViewImages({ clientId, isExpanded });
const onDragStartHandler = (event) => {
event.dataTransfer.clearData();
onDragStart?.(event);
};
function onKeyDown(event) {
if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER || event.keyCode === external_wp_keycodes_namespaceObject.SPACE) {
onClick(event);
}
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"a",
{
className: dist_clsx(
"block-editor-list-view-block-select-button",
className
),
onClick,
onContextMenu,
onKeyDown,
onMouseDown,
ref,
tabIndex,
onFocus,
onDragStart: onDragStartHandler,
onDragEnd,
draggable,
href: `#block-${clientId}`,
"aria-describedby": ariaDescribedBy,
"aria-expanded": isExpanded,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewExpander, { onClick: onToggleExpanded }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_icon_default,
{
icon: blockInformation?.icon,
showColors: true,
context: "list-view"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
alignment: "center",
className: "block-editor-list-view-block-select-button__label-wrapper",
justify: "flex-start",
spacing: 1,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-list-view-block-select-button__title", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { ellipsizeMode: "auto", children: blockTitle }) }),
blockInformation?.anchor && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-list-view-block-select-button__anchor-wrapper", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_select_button_Badge, { className: "block-editor-list-view-block-select-button__anchor", children: blockInformation.anchor }) }),
isSticky && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-list-view-block-select-button__sticky", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: pin_small_default }) }),
images.length ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: "block-editor-list-view-block-select-button__images",
"aria-hidden": true,
children: images.map((image, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: "block-editor-list-view-block-select-button__image",
style: {
backgroundImage: `url(${image.url})`,
zIndex: images.length - index
// Ensure the first image is on top, and subsequent images are behind.
}
},
image.clientId
))
}
) : null,
shouldShowBlockVisibilityIcon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-list-view-block-select-button__block-visibility", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: unseen_default }) }),
shouldShowLockIcon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-list-view-block-select-button__lock", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: lock_small_default }) })
]
}
)
]
}
);
}
var block_select_button_default = (0,external_wp_element_namespaceObject.forwardRef)(ListViewBlockSelectButton);
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/block-contents.js
const ListViewBlockContents = (0,external_wp_element_namespaceObject.forwardRef)(
({
onClick,
onToggleExpanded,
block,
isSelected,
position,
siblingBlockCount,
level,
isExpanded,
selectedClientIds,
...props
}, ref) => {
const { clientId } = block;
const { AdditionalBlockContent, insertedBlock, setInsertedBlock } = useListViewContext();
const draggableClientIds = selectedClientIds.includes(clientId) ? selectedClientIds : [clientId];
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
AdditionalBlockContent && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
AdditionalBlockContent,
{
block,
insertedBlock,
setInsertedBlock
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_draggable_default,
{
appendToOwnerDocument: true,
clientIds: draggableClientIds,
cloneClassname: "block-editor-list-view-draggable-chip",
children: ({ draggable, onDragStart, onDragEnd }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_select_button_default,
{
ref,
className: "block-editor-list-view-block-contents",
block,
onClick,
onToggleExpanded,
isSelected,
position,
siblingBlockCount,
level,
draggable,
onDragStart,
onDragEnd,
isExpanded,
...props
}
)
}
)
] });
}
);
var block_contents_default = ListViewBlockContents;
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/utils.js
const getBlockPositionDescription = (position, siblingCount, level) => (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
(0,external_wp_i18n_namespaceObject.__)("Block %1$d of %2$d, Level %3$d."),
position,
siblingCount,
level
);
const getBlockPropertiesDescription = (blockInformation, isLocked) => [
blockInformation?.positionLabel ? `${(0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Position of selected block, e.g. "Sticky" or "Fixed".
(0,external_wp_i18n_namespaceObject.__)("Position: %s"),
blockInformation.positionLabel
)}.` : void 0,
isLocked ? (0,external_wp_i18n_namespaceObject.__)("This block is locked.") : void 0
].filter(Boolean).join(" ");
const isClientIdSelected = (clientId, selectedBlockClientIds) => Array.isArray(selectedBlockClientIds) && selectedBlockClientIds.length ? selectedBlockClientIds.indexOf(clientId) !== -1 : selectedBlockClientIds === clientId;
function getCommonDepthClientIds(startId, endId, startParents, endParents) {
const startPath = [...startParents, startId];
const endPath = [...endParents, endId];
const depth = Math.min(startPath.length, endPath.length) - 1;
const start = startPath[depth];
const end = endPath[depth];
return {
start,
end
};
}
function focusListItem(focusClientId, treeGridElement) {
const getFocusElement = () => {
const row = treeGridElement?.querySelector(
`[role=row][data-block="${focusClientId}"]`
);
if (!row) {
return null;
}
return external_wp_dom_namespaceObject.focus.focusable.find(row)[0];
};
let focusElement = getFocusElement();
if (focusElement) {
focusElement.focus();
} else {
window.requestAnimationFrame(() => {
focusElement = getFocusElement();
if (focusElement) {
focusElement.focus();
}
});
}
}
function getDragDisplacementValues({
blockIndexes,
blockDropTargetIndex,
blockDropPosition,
clientId,
firstDraggedBlockIndex,
isDragged
}) {
let displacement;
let isNesting;
let isAfterDraggedBlocks;
if (!isDragged) {
isNesting = false;
const thisBlockIndex = blockIndexes[clientId];
isAfterDraggedBlocks = thisBlockIndex > firstDraggedBlockIndex;
if (blockDropTargetIndex !== void 0 && blockDropTargetIndex !== null && firstDraggedBlockIndex !== void 0) {
if (thisBlockIndex !== void 0) {
if (thisBlockIndex >= firstDraggedBlockIndex && thisBlockIndex < blockDropTargetIndex) {
displacement = "up";
} else if (thisBlockIndex < firstDraggedBlockIndex && thisBlockIndex >= blockDropTargetIndex) {
displacement = "down";
} else {
displacement = "normal";
}
isNesting = typeof blockDropTargetIndex === "number" && blockDropTargetIndex - 1 === thisBlockIndex && blockDropPosition === "inside";
}
} else if (blockDropTargetIndex === null && firstDraggedBlockIndex !== void 0) {
if (thisBlockIndex !== void 0 && thisBlockIndex >= firstDraggedBlockIndex) {
displacement = "up";
} else {
displacement = "normal";
}
} else if (blockDropTargetIndex !== void 0 && blockDropTargetIndex !== null && firstDraggedBlockIndex === void 0) {
if (thisBlockIndex !== void 0) {
if (thisBlockIndex < blockDropTargetIndex) {
displacement = "normal";
} else {
displacement = "down";
}
}
} else if (blockDropTargetIndex === null) {
displacement = "normal";
}
}
return {
displacement,
isNesting,
isAfterDraggedBlocks
};
}
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/block.js
function ListViewBlock({
block: { clientId },
displacement,
isAfterDraggedBlocks,
isDragged,
isNesting,
isSelected,
isBranchSelected,
selectBlock,
position,
level,
rowCount,
siblingBlockCount,
showBlockMovers,
path,
isExpanded,
selectedClientIds,
isSyncedBranch
}) {
const cellRef = (0,external_wp_element_namespaceObject.useRef)(null);
const rowRef = (0,external_wp_element_namespaceObject.useRef)(null);
const settingsRef = (0,external_wp_element_namespaceObject.useRef)(null);
const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false);
const [settingsAnchorRect, setSettingsAnchorRect] = (0,external_wp_element_namespaceObject.useState)();
const { isLocked, canEdit, canMove } = useBlockLock(clientId);
const isFirstSelectedBlock = isSelected && selectedClientIds[0] === clientId;
const isLastSelectedBlock = isSelected && selectedClientIds[selectedClientIds.length - 1] === clientId;
const {
toggleBlockHighlight,
duplicateBlocks,
multiSelect,
replaceBlocks,
removeBlocks,
insertAfterBlock,
insertBeforeBlock,
setOpenedBlockSettingsMenu,
updateBlockAttributes
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
const debouncedToggleBlockHighlight = (0,external_wp_compose_namespaceObject.useDebounce)(
toggleBlockHighlight,
50
);
const {
canInsertBlockType,
getSelectedBlockClientIds,
getPreviousBlockClientId,
getBlockRootClientId,
getBlockOrder,
getBlockParents,
getBlocksByClientId,
canRemoveBlocks,
isGroupable
} = (0,external_wp_data_namespaceObject.useSelect)(store);
const { getGroupingBlockName } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store);
const blockInformation = useBlockDisplayInformation(clientId);
const pasteStyles = usePasteStyles();
const { block, blockName, allowRightClickOverrides, isBlockHidden } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlock, getBlockName, getSettings } = select(store);
const { isBlockHidden: _isBlockHidden } = unlock(
select(store)
);
return {
block: getBlock(clientId),
blockName: getBlockName(clientId),
allowRightClickOverrides: getSettings().allowRightClickOverrides,
isBlockHidden: _isBlockHidden(clientId)
};
},
[clientId]
);
const showBlockActions = (
// When a block hides its toolbar it also hides the block settings menu,
// since that menu is part of the toolbar in the editor canvas.
// List View respects this by also hiding the block settings menu.
(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, "__experimentalToolbar", true)
);
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ListViewBlock);
const descriptionId = `list-view-block-select-button__description-${instanceId}`;
const {
expand,
collapse,
collapseAll,
BlockSettingsMenu,
listViewInstanceId,
expandedState,
setInsertedBlock,
treeGridElementRef,
rootClientId
} = useListViewContext();
const isMatch = (0,external_wp_keyboardShortcuts_namespaceObject.__unstableUseShortcutEventMatch)();
function getBlocksToUpdate() {
const selectedBlockClientIds = getSelectedBlockClientIds();
const isUpdatingSelectedBlocks = selectedBlockClientIds.includes(clientId);
const firstBlockClientId = isUpdatingSelectedBlocks ? selectedBlockClientIds[0] : clientId;
const firstBlockRootClientId = getBlockRootClientId(firstBlockClientId);
const blocksToUpdate = isUpdatingSelectedBlocks ? selectedBlockClientIds : [clientId];
return {
blocksToUpdate,
firstBlockClientId,
firstBlockRootClientId,
selectedBlockClientIds
};
}
async function onKeyDown(event) {
if (event.defaultPrevented) {
return;
}
if (event.target.closest("[role=dialog]")) {
return;
}
const isDeleteKey = [external_wp_keycodes_namespaceObject.BACKSPACE, external_wp_keycodes_namespaceObject.DELETE].includes(event.keyCode);
if (isMatch("core/block-editor/unselect", event) && selectedClientIds.length > 0) {
event.stopPropagation();
event.preventDefault();
selectBlock(event, void 0);
} else if (isDeleteKey || isMatch("core/block-editor/remove", event)) {
const {
blocksToUpdate: blocksToDelete,
firstBlockClientId,
firstBlockRootClientId,
selectedBlockClientIds
} = getBlocksToUpdate();
if (!canRemoveBlocks(blocksToDelete)) {
return;
}
let blockToFocus = getPreviousBlockClientId(firstBlockClientId) ?? // If the previous block is not found (when the first block is deleted),
// fallback to focus the parent block.
firstBlockRootClientId;
removeBlocks(blocksToDelete, false);
const shouldUpdateSelection = selectedBlockClientIds.length > 0 && getSelectedBlockClientIds().length === 0;
if (!blockToFocus) {
blockToFocus = getBlockOrder()[0];
}
updateFocusAndSelection(blockToFocus, shouldUpdateSelection);
} else if (isMatch("core/block-editor/paste-styles", event)) {
event.preventDefault();
const { blocksToUpdate } = getBlocksToUpdate();
const blocks = getBlocksByClientId(blocksToUpdate);
pasteStyles(blocks);
} else if (isMatch("core/block-editor/duplicate", event)) {
event.preventDefault();
const { blocksToUpdate, firstBlockRootClientId } = getBlocksToUpdate();
const canDuplicate = getBlocksByClientId(blocksToUpdate).every(
(blockToUpdate) => {
return !!blockToUpdate && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(
blockToUpdate.name,
"multiple",
true
) && canInsertBlockType(
blockToUpdate.name,
firstBlockRootClientId
);
}
);
if (canDuplicate) {
const updatedBlocks = await duplicateBlocks(
blocksToUpdate,
false
);
if (updatedBlocks?.length) {
updateFocusAndSelection(updatedBlocks[0], false);
}
}
} else if (isMatch("core/block-editor/insert-before", event)) {
event.preventDefault();
const { blocksToUpdate } = getBlocksToUpdate();
await insertBeforeBlock(blocksToUpdate[0]);
const newlySelectedBlocks = getSelectedBlockClientIds();
setOpenedBlockSettingsMenu(void 0);
updateFocusAndSelection(newlySelectedBlocks[0], false);
} else if (isMatch("core/block-editor/insert-after", event)) {
event.preventDefault();
const { blocksToUpdate } = getBlocksToUpdate();
await insertAfterBlock(blocksToUpdate.at(-1));
const newlySelectedBlocks = getSelectedBlockClientIds();
setOpenedBlockSettingsMenu(void 0);
updateFocusAndSelection(newlySelectedBlocks[0], false);
} else if (isMatch("core/block-editor/select-all", event)) {
event.preventDefault();
const { firstBlockRootClientId, selectedBlockClientIds } = getBlocksToUpdate();
const blockClientIds = getBlockOrder(firstBlockRootClientId);
if (!blockClientIds.length) {
return;
}
if (external_wp_isShallowEqual_default()(selectedBlockClientIds, blockClientIds)) {
if (firstBlockRootClientId && firstBlockRootClientId !== rootClientId) {
updateFocusAndSelection(firstBlockRootClientId, true);
return;
}
}
multiSelect(
blockClientIds[0],
blockClientIds[blockClientIds.length - 1],
null
);
} else if (isMatch("core/block-editor/collapse-list-view", event)) {
event.preventDefault();
const { firstBlockClientId } = getBlocksToUpdate();
const blockParents = getBlockParents(firstBlockClientId, false);
collapseAll();
expand(blockParents);
} else if (isMatch("core/block-editor/group", event)) {
const { blocksToUpdate } = getBlocksToUpdate();
if (blocksToUpdate.length > 1 && isGroupable(blocksToUpdate)) {
event.preventDefault();
const blocks = getBlocksByClientId(blocksToUpdate);
const groupingBlockName = getGroupingBlockName();
const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(
blocks,
groupingBlockName
);
replaceBlocks(blocksToUpdate, newBlocks);
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)("Selected blocks are grouped."));
const newlySelectedBlocks = getSelectedBlockClientIds();
setOpenedBlockSettingsMenu(void 0);
updateFocusAndSelection(newlySelectedBlocks[0], false);
}
} else if (isMatch("core/block-editor/toggle-block-visibility", event)) {
event.preventDefault();
const { blocksToUpdate } = getBlocksToUpdate();
const blocks = getBlocksByClientId(blocksToUpdate);
const canToggleVisibility = blocks.every(
(blockToUpdate) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockToUpdate.name, "visibility", true)
);
if (!canToggleVisibility) {
return;
}
const hasHiddenBlock = blocks.some(
(blockToUpdate) => blockToUpdate.attributes.metadata?.blockVisibility === false
);
const attributesByClientId = Object.fromEntries(
blocks.map(({ clientId: mapClientId, attributes }) => [
mapClientId,
{
metadata: utils_cleanEmptyObject({
...attributes?.metadata,
blockVisibility: hasHiddenBlock ? void 0 : false
})
}
])
);
updateBlockAttributes(blocksToUpdate, attributesByClientId, {
uniqueByBlock: true
});
}
}
const onMouseEnter = (0,external_wp_element_namespaceObject.useCallback)(() => {
setIsHovered(true);
debouncedToggleBlockHighlight(clientId, true);
}, [clientId, setIsHovered, debouncedToggleBlockHighlight]);
const onMouseLeave = (0,external_wp_element_namespaceObject.useCallback)(() => {
setIsHovered(false);
debouncedToggleBlockHighlight(clientId, false);
}, [clientId, setIsHovered, debouncedToggleBlockHighlight]);
const selectEditorBlock = (0,external_wp_element_namespaceObject.useCallback)(
(event) => {
selectBlock(event, clientId);
event.preventDefault();
},
[clientId, selectBlock]
);
const updateFocusAndSelection = (0,external_wp_element_namespaceObject.useCallback)(
(focusClientId, shouldSelectBlock) => {
if (shouldSelectBlock) {
selectBlock(void 0, focusClientId, null, null);
}
focusListItem(focusClientId, treeGridElementRef?.current);
},
[selectBlock, treeGridElementRef]
);
const toggleExpanded = (0,external_wp_element_namespaceObject.useCallback)(
(event) => {
event.preventDefault();
event.stopPropagation();
if (isExpanded === true) {
collapse(clientId);
} else if (isExpanded === false) {
expand(clientId);
}
},
[clientId, expand, collapse, isExpanded]
);
const onContextMenu = (0,external_wp_element_namespaceObject.useCallback)(
(event) => {
if (showBlockActions && allowRightClickOverrides) {
settingsRef.current?.click();
setSettingsAnchorRect(
new window.DOMRect(event.clientX, event.clientY, 0, 0)
);
event.preventDefault();
}
},
[allowRightClickOverrides, settingsRef, showBlockActions]
);
const onMouseDown = (0,external_wp_element_namespaceObject.useCallback)(
(event) => {
if (allowRightClickOverrides && event.button === 2) {
event.preventDefault();
}
},
[allowRightClickOverrides]
);
const settingsPopoverAnchor = (0,external_wp_element_namespaceObject.useMemo)(() => {
const { ownerDocument } = rowRef?.current || {};
if (!settingsAnchorRect || !ownerDocument) {
return void 0;
}
return {
ownerDocument,
getBoundingClientRect() {
return settingsAnchorRect;
}
};
}, [settingsAnchorRect]);
const clearSettingsAnchorRect = (0,external_wp_element_namespaceObject.useCallback)(() => {
setSettingsAnchorRect(void 0);
}, [setSettingsAnchorRect]);
useListViewScrollIntoView({
isSelected,
rowItemRef: rowRef,
selectedClientIds
});
if (!block) {
return null;
}
const blockPositionDescription = getBlockPositionDescription(
position,
siblingBlockCount,
level
);
const blockPropertiesDescription = getBlockPropertiesDescription(
blockInformation,
isLocked
);
const blockVisibilityDescription = isBlockHidden ? (0,external_wp_i18n_namespaceObject.__)("Block is hidden.") : null;
const hasSiblings = siblingBlockCount > 0;
const hasRenderedMovers = showBlockMovers && hasSiblings;
const moverCellClassName = dist_clsx(
"block-editor-list-view-block__mover-cell",
{ "is-visible": isHovered || isSelected }
);
const listViewBlockSettingsClassName = dist_clsx(
"block-editor-list-view-block__menu-cell",
{ "is-visible": isHovered || isFirstSelectedBlock }
);
let colSpan;
if (hasRenderedMovers) {
colSpan = 2;
} else if (!showBlockActions) {
colSpan = 3;
}
const classes = dist_clsx({
"is-selected": isSelected,
"is-first-selected": isFirstSelectedBlock,
"is-last-selected": isLastSelectedBlock,
"is-branch-selected": isBranchSelected,
"is-synced-branch": isSyncedBranch,
"is-dragging": isDragged,
"has-single-cell": !showBlockActions,
"is-synced": blockInformation?.isSynced,
"is-draggable": canMove,
"is-displacement-normal": displacement === "normal",
"is-displacement-up": displacement === "up",
"is-displacement-down": displacement === "down",
"is-after-dragged-blocks": isAfterDraggedBlocks,
"is-nesting": isNesting
});
const dropdownClientIds = selectedClientIds.includes(clientId) ? selectedClientIds : [clientId];
const currentlyEditingBlockInCanvas = isSelected && selectedClientIds.length === 1;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
leaf_default,
{
className: classes,
isDragged,
onKeyDown,
onMouseEnter,
onMouseLeave,
onFocus: onMouseEnter,
onBlur: onMouseLeave,
level,
position,
rowCount,
path,
id: `list-view-${listViewInstanceId}-block-${clientId}`,
"data-block": clientId,
"data-expanded": canEdit ? isExpanded : void 0,
ref: rowRef,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalTreeGridCell,
{
className: "block-editor-list-view-block__contents-cell",
colSpan,
ref: cellRef,
"aria-selected": !!isSelected,
children: ({ ref, tabIndex, onFocus }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-list-view-block__contents-container", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_contents_default,
{
block,
onClick: selectEditorBlock,
onContextMenu,
onMouseDown,
onToggleExpanded: toggleExpanded,
isSelected,
position,
siblingBlockCount,
level,
ref,
tabIndex: currentlyEditingBlockInCanvas ? 0 : tabIndex,
onFocus,
isExpanded: canEdit ? isExpanded : void 0,
selectedClientIds,
ariaDescribedBy: descriptionId
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(AriaReferencedText, { id: descriptionId, children: [
blockPositionDescription,
blockPropertiesDescription,
blockVisibilityDescription
].filter(Boolean).join(" ") })
] })
}
),
hasRenderedMovers && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalTreeGridCell,
{
className: moverCellClassName,
withoutGridItem: true,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTreeGridItem, { children: ({ ref, tabIndex, onFocus }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockMoverUpButton,
{
orientation: "vertical",
clientIds: [clientId],
ref,
tabIndex,
onFocus
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTreeGridItem, { children: ({ ref, tabIndex, onFocus }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockMoverDownButton,
{
orientation: "vertical",
clientIds: [clientId],
ref,
tabIndex,
onFocus
}
) })
]
}
) }),
showBlockActions && BlockSettingsMenu && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalTreeGridCell,
{
className: listViewBlockSettingsClassName,
"aria-selected": !!isSelected,
ref: settingsRef,
children: ({ ref, tabIndex, onFocus }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockSettingsMenu,
{
clientIds: dropdownClientIds,
block,
icon: more_vertical_default,
label: (0,external_wp_i18n_namespaceObject.__)("Options"),
popoverProps: {
anchor: settingsPopoverAnchor
// Used to position the settings at the cursor on right-click.
},
toggleProps: {
ref,
className: "block-editor-list-view-block__menu",
tabIndex,
onClick: clearSettingsAnchorRect,
onFocus,
size: "small"
},
disableOpenOnArrowDown: true,
expand,
expandedState,
setInsertedBlock,
__experimentalSelectBlock: updateFocusAndSelection
}
)
}
)
]
}
);
}
var list_view_block_block_default = (0,external_wp_element_namespaceObject.memo)(ListViewBlock);
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/branch.js
function countBlocks(block, expandedState, draggedClientIds, isExpandedByDefault) {
const isDragged = draggedClientIds?.includes(block.clientId);
if (isDragged) {
return 0;
}
const isExpanded = expandedState[block.clientId] ?? isExpandedByDefault;
if (isExpanded) {
return 1 + block.innerBlocks.reduce(
countReducer(
expandedState,
draggedClientIds,
isExpandedByDefault
),
0
);
}
return 1;
}
const countReducer = (expandedState, draggedClientIds, isExpandedByDefault) => (count, block) => {
const isDragged = draggedClientIds?.includes(block.clientId);
if (isDragged) {
return count;
}
const isExpanded = expandedState[block.clientId] ?? isExpandedByDefault;
if (isExpanded && block.innerBlocks.length > 0) {
return count + countBlocks(
block,
expandedState,
draggedClientIds,
isExpandedByDefault
);
}
return count + 1;
};
const branch_noop = () => {
};
function ListViewBranch(props) {
const {
blocks,
selectBlock = branch_noop,
showBlockMovers,
selectedClientIds,
level = 1,
path = "",
isBranchSelected = false,
listPosition = 0,
fixedListWindow,
isExpanded,
parentId,
shouldShowInnerBlocks = true,
isSyncedBranch = false,
showAppender: showAppenderProp = true
} = props;
const parentBlockInformation = useBlockDisplayInformation(parentId);
const syncedBranch = isSyncedBranch || !!parentBlockInformation?.isSynced;
const canParentExpand = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
if (!parentId) {
return true;
}
return select(store).canEditBlock(parentId);
},
[parentId]
);
const {
blockDropPosition,
blockDropTargetIndex,
firstDraggedBlockIndex,
blockIndexes,
expandedState,
draggedClientIds
} = useListViewContext();
const nextPositionRef = (0,external_wp_element_namespaceObject.useRef)();
if (!canParentExpand) {
return null;
}
const showAppender = showAppenderProp && level === 1;
const filteredBlocks = blocks.filter(Boolean);
const blockCount = filteredBlocks.length;
const rowCount = showAppender ? blockCount + 1 : blockCount;
nextPositionRef.current = listPosition;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
filteredBlocks.map((block, index) => {
const { clientId, innerBlocks } = block;
if (index > 0) {
nextPositionRef.current += countBlocks(
filteredBlocks[index - 1],
expandedState,
draggedClientIds,
isExpanded
);
}
const isDragged = !!draggedClientIds?.includes(clientId);
const { displacement, isAfterDraggedBlocks, isNesting } = getDragDisplacementValues({
blockIndexes,
blockDropTargetIndex,
blockDropPosition,
clientId,
firstDraggedBlockIndex,
isDragged
});
const { itemInView } = fixedListWindow;
const blockInView = itemInView(nextPositionRef.current);
const position = index + 1;
const updatedPath = path.length > 0 ? `${path}_${position}` : `${position}`;
const hasNestedBlocks = !!innerBlocks?.length;
const shouldExpand = hasNestedBlocks && shouldShowInnerBlocks ? expandedState[clientId] ?? isExpanded : void 0;
const isSelected = isClientIdSelected(
clientId,
selectedClientIds
);
const isSelectedBranch = isBranchSelected || isSelected && hasNestedBlocks;
const showBlock = isDragged || blockInView || isSelected && clientId === selectedClientIds[0] || index === 0 || index === blockCount - 1;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_data_namespaceObject.AsyncModeProvider, { value: !isSelected, children: [
showBlock && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
list_view_block_block_default,
{
block,
selectBlock,
isSelected,
isBranchSelected: isSelectedBranch,
isDragged,
level,
position,
rowCount,
siblingBlockCount: blockCount,
showBlockMovers,
path: updatedPath,
isExpanded: isDragged ? false : shouldExpand,
listPosition: nextPositionRef.current,
selectedClientIds,
isSyncedBranch: syncedBranch,
displacement,
isAfterDraggedBlocks,
isNesting
}
),
!showBlock && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("td", { className: "block-editor-list-view-placeholder" }) }),
hasNestedBlocks && shouldExpand && !isDragged && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ListViewBranch,
{
parentId: clientId,
blocks: innerBlocks,
selectBlock,
showBlockMovers,
level: level + 1,
path: updatedPath,
listPosition: nextPositionRef.current + 1,
fixedListWindow,
isBranchSelected: isSelectedBranch,
selectedClientIds,
isExpanded,
isSyncedBranch: syncedBranch
}
)
] }, clientId);
}),
showAppender && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalTreeGridRow,
{
level,
setSize: rowCount,
positionInSet: rowCount,
isExpanded: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTreeGridCell, { children: (treeGridCellProps) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Appender,
{
clientId: parentId,
nestingLevel: level,
blockCount,
...treeGridCellProps
}
) })
}
)
] });
}
var branch_default = (0,external_wp_element_namespaceObject.memo)(ListViewBranch);
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/drop-indicator.js
function ListViewDropIndicatorPreview({
draggedBlockClientId,
listViewRef,
blockDropTarget
}) {
const blockInformation = useBlockDisplayInformation(draggedBlockClientId);
const blockTitle = useBlockDisplayTitle({
clientId: draggedBlockClientId,
context: "list-view"
});
const { rootClientId, clientId, dropPosition } = blockDropTarget || {};
const [rootBlockElement, blockElement] = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!listViewRef.current) {
return [];
}
const _rootBlockElement = rootClientId ? listViewRef.current.querySelector(
`[data-block="${rootClientId}"]`
) : void 0;
const _blockElement = clientId ? listViewRef.current.querySelector(
`[data-block="${clientId}"]`
) : void 0;
return [_rootBlockElement, _blockElement];
}, [listViewRef, rootClientId, clientId]);
const targetElement = blockElement || rootBlockElement;
const rtl = (0,external_wp_i18n_namespaceObject.isRTL)();
const getDropIndicatorWidth = (0,external_wp_element_namespaceObject.useCallback)(
(targetElementRect, indent) => {
if (!targetElement) {
return 0;
}
let width = targetElement.offsetWidth;
const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(
targetElement,
"horizontal"
);
const ownerDocument = targetElement.ownerDocument;
const windowScroll = scrollContainer === ownerDocument.body || scrollContainer === ownerDocument.documentElement;
if (scrollContainer && !windowScroll) {
const scrollContainerRect = scrollContainer.getBoundingClientRect();
const distanceBetweenContainerAndTarget = (0,external_wp_i18n_namespaceObject.isRTL)() ? scrollContainerRect.right - targetElementRect.right : targetElementRect.left - scrollContainerRect.left;
const scrollContainerWidth = scrollContainer.clientWidth;
if (scrollContainerWidth < width + distanceBetweenContainerAndTarget) {
width = scrollContainerWidth - distanceBetweenContainerAndTarget;
}
if (!rtl && targetElementRect.left + indent < scrollContainerRect.left) {
width -= scrollContainerRect.left - targetElementRect.left;
return width;
}
if (rtl && targetElementRect.right - indent > scrollContainerRect.right) {
width -= targetElementRect.right - scrollContainerRect.right;
return width;
}
}
return width - indent;
},
[rtl, targetElement]
);
const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!targetElement) {
return {};
}
const targetElementRect = targetElement.getBoundingClientRect();
return {
width: getDropIndicatorWidth(targetElementRect, 0)
};
}, [getDropIndicatorWidth, targetElement]);
const horizontalScrollOffsetStyle = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!targetElement) {
return {};
}
const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(targetElement);
const ownerDocument = targetElement.ownerDocument;
const windowScroll = scrollContainer === ownerDocument.body || scrollContainer === ownerDocument.documentElement;
if (scrollContainer && !windowScroll) {
const scrollContainerRect = scrollContainer.getBoundingClientRect();
const targetElementRect = targetElement.getBoundingClientRect();
const distanceBetweenContainerAndTarget = rtl ? scrollContainerRect.right - targetElementRect.right : targetElementRect.left - scrollContainerRect.left;
if (!rtl && scrollContainerRect.left > targetElementRect.left) {
return {
transform: `translateX( ${distanceBetweenContainerAndTarget}px )`
};
}
if (rtl && scrollContainerRect.right < targetElementRect.right) {
return {
transform: `translateX( ${distanceBetweenContainerAndTarget * -1}px )`
};
}
}
return {};
}, [rtl, targetElement]);
const ariaLevel = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!rootBlockElement) {
return 1;
}
const _ariaLevel = parseInt(
rootBlockElement.getAttribute("aria-level"),
10
);
return _ariaLevel ? _ariaLevel + 1 : 1;
}, [rootBlockElement]);
const hasAdjacentSelectedBranch = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!targetElement) {
return false;
}
return targetElement.classList.contains("is-branch-selected");
}, [targetElement]);
const popoverAnchor = (0,external_wp_element_namespaceObject.useMemo)(() => {
const isValidDropPosition = dropPosition === "top" || dropPosition === "bottom" || dropPosition === "inside";
if (!targetElement || !isValidDropPosition) {
return void 0;
}
return {
contextElement: targetElement,
getBoundingClientRect() {
const rect = targetElement.getBoundingClientRect();
let left = rect.left;
let top = 0;
const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(
targetElement,
"horizontal"
);
const doc = targetElement.ownerDocument;
const windowScroll = scrollContainer === doc.body || scrollContainer === doc.documentElement;
if (scrollContainer && !windowScroll) {
const scrollContainerRect = scrollContainer.getBoundingClientRect();
const scrollbarWidth = rtl ? scrollContainer.offsetWidth - scrollContainer.clientWidth : 0;
if (left < scrollContainerRect.left + scrollbarWidth) {
left = scrollContainerRect.left + scrollbarWidth;
}
}
if (dropPosition === "top") {
top = rect.top - rect.height * 2;
} else {
top = rect.top;
}
const width = getDropIndicatorWidth(rect, 0);
const height = rect.height;
return new window.DOMRect(left, top, width, height);
}
};
}, [targetElement, dropPosition, getDropIndicatorWidth, rtl]);
if (!targetElement) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Popover,
{
animate: false,
anchor: popoverAnchor,
focusOnMount: false,
className: "block-editor-list-view-drop-indicator--preview",
variant: "unstyled",
flip: false,
resize: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
style,
className: dist_clsx(
"block-editor-list-view-drop-indicator__line",
{
"block-editor-list-view-drop-indicator__line--darker": hasAdjacentSelectedBranch
}
),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
className: "block-editor-list-view-leaf",
"aria-level": ariaLevel,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
className: dist_clsx(
"block-editor-list-view-block-select-button",
"block-editor-list-view-block-contents"
),
style: horizontalScrollOffsetStyle,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewExpander, { onClick: () => {
} }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_icon_default,
{
icon: blockInformation?.icon,
showColors: true,
context: "list-view"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHStack,
{
alignment: "center",
className: "block-editor-list-view-block-select-button__label-wrapper",
justify: "flex-start",
spacing: 1,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-list-view-block-select-button__title", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { ellipsizeMode: "auto", children: blockTitle }) })
}
)
]
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-list-view-block__menu-cell" })
]
}
)
}
)
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-block-selection.js
function useBlockSelection() {
const { clearSelectedBlock, multiSelect, selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const {
getBlockName,
getBlockParents,
getBlockSelectionStart,
getSelectedBlockClientIds,
hasMultiSelection,
hasSelectedBlock
} = (0,external_wp_data_namespaceObject.useSelect)(store);
const { getBlockType } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store);
const updateBlockSelection = (0,external_wp_element_namespaceObject.useCallback)(
async (event, clientId, destinationClientId, focusPosition) => {
if (!event?.shiftKey && event?.keyCode !== external_wp_keycodes_namespaceObject.ESCAPE) {
selectBlock(clientId, focusPosition);
return;
}
event.preventDefault();
const isOnlyDeselection = event.type === "keydown" && event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE;
const isKeyPress = event.type === "keydown" && (event.keyCode === external_wp_keycodes_namespaceObject.UP || event.keyCode === external_wp_keycodes_namespaceObject.DOWN || event.keyCode === external_wp_keycodes_namespaceObject.HOME || event.keyCode === external_wp_keycodes_namespaceObject.END);
if (!isKeyPress && !hasSelectedBlock() && !hasMultiSelection()) {
selectBlock(clientId, null);
return;
}
const selectedBlocks = getSelectedBlockClientIds();
const clientIdWithParents = [
...getBlockParents(clientId),
clientId
];
if (isOnlyDeselection || isKeyPress && !selectedBlocks.some(
(blockId) => clientIdWithParents.includes(blockId)
)) {
await clearSelectedBlock();
}
if (!isOnlyDeselection) {
let startTarget = getBlockSelectionStart();
let endTarget = clientId;
if (isKeyPress) {
if (!hasSelectedBlock() && !hasMultiSelection()) {
startTarget = clientId;
}
if (destinationClientId) {
endTarget = destinationClientId;
}
}
const startParents = getBlockParents(startTarget);
const endParents = getBlockParents(endTarget);
const { start, end } = getCommonDepthClientIds(
startTarget,
endTarget,
startParents,
endParents
);
await multiSelect(start, end, null);
}
const updatedSelectedBlocks = getSelectedBlockClientIds();
if ((event.keyCode === external_wp_keycodes_namespaceObject.HOME || event.keyCode === external_wp_keycodes_namespaceObject.END) && updatedSelectedBlocks.length > 1) {
return;
}
const selectionDiff = selectedBlocks.filter(
(blockId) => !updatedSelectedBlocks.includes(blockId)
);
let label;
if (selectionDiff.length === 1) {
const title = getBlockType(
getBlockName(selectionDiff[0])
)?.title;
if (title) {
label = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: block name */
(0,external_wp_i18n_namespaceObject.__)("%s deselected."),
title
);
}
} else if (selectionDiff.length > 1) {
label = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: number of deselected blocks */
(0,external_wp_i18n_namespaceObject.__)("%s blocks deselected."),
selectionDiff.length
);
}
if (label) {
(0,external_wp_a11y_namespaceObject.speak)(label, "assertive");
}
},
[
clearSelectedBlock,
getBlockName,
getBlockType,
getBlockParents,
getBlockSelectionStart,
getSelectedBlockClientIds,
hasMultiSelection,
hasSelectedBlock,
multiSelect,
selectBlock
]
);
return {
updateBlockSelection
};
}
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-block-indexes.js
function useListViewBlockIndexes(blocks) {
const blockIndexes = (0,external_wp_element_namespaceObject.useMemo)(() => {
const indexes = {};
let currentGlobalIndex = 0;
const traverseBlocks = (blockList) => {
blockList.forEach((block) => {
indexes[block.clientId] = currentGlobalIndex;
currentGlobalIndex++;
if (block.innerBlocks.length > 0) {
traverseBlocks(block.innerBlocks);
}
});
};
traverseBlocks(blocks);
return indexes;
}, [blocks]);
return blockIndexes;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-client-ids.js
function useListViewClientIds({ blocks, rootClientId }) {
return (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getDraggedBlockClientIds,
getSelectedBlockClientIds,
getEnabledClientIdsTree
} = unlock(select(store));
return {
selectedClientIds: getSelectedBlockClientIds(),
draggedClientIds: getDraggedBlockClientIds(),
clientIdsTree: blocks ?? getEnabledClientIdsTree(rootClientId)
};
},
[blocks, rootClientId]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-collapse-items.js
function useListViewCollapseItems({ collapseAll, expand }) {
const { expandedBlock, getBlockParents } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getBlockParents: _getBlockParents, getExpandedBlock } = unlock(
select(store)
);
return {
expandedBlock: getExpandedBlock(),
getBlockParents: _getBlockParents
};
}, []);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (expandedBlock) {
const blockParents = getBlockParents(expandedBlock, false);
collapseAll();
expand(blockParents);
}
}, [collapseAll, expand, expandedBlock, getBlockParents]);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-drop-zone.js
const NESTING_LEVEL_INDENTATION = 24;
function isUpGesture(point, rect, nestingLevel = 1, rtl = false) {
const blockIndentPosition = rtl ? rect.right - nestingLevel * NESTING_LEVEL_INDENTATION : rect.left + nestingLevel * NESTING_LEVEL_INDENTATION;
return rtl ? point.x > blockIndentPosition : point.x < blockIndentPosition;
}
function getDesiredRelativeParentLevel(point, rect, nestingLevel = 1, rtl = false) {
const blockIndentPosition = rtl ? rect.right - nestingLevel * NESTING_LEVEL_INDENTATION : rect.left + nestingLevel * NESTING_LEVEL_INDENTATION;
const distanceBetweenPointAndBlockIndentPosition = rtl ? blockIndentPosition - point.x : point.x - blockIndentPosition;
const desiredParentLevel = Math.round(
distanceBetweenPointAndBlockIndentPosition / NESTING_LEVEL_INDENTATION
);
return Math.abs(desiredParentLevel);
}
function getCandidateBlockParents(candidateBlockData, blocksData) {
const candidateBlockParents = [];
let currentBlockData = candidateBlockData;
while (currentBlockData) {
candidateBlockParents.push({ ...currentBlockData });
currentBlockData = blocksData.find(
(blockData) => blockData.clientId === currentBlockData.rootClientId
);
}
return candidateBlockParents;
}
function getNextNonDraggedBlock(blocksData, index) {
const nextBlockData = blocksData[index + 1];
if (nextBlockData && nextBlockData.isDraggedBlock) {
return getNextNonDraggedBlock(blocksData, index + 1);
}
return nextBlockData;
}
function isNestingGesture(point, rect, nestingLevel = 1, rtl = false) {
const blockIndentPosition = rtl ? rect.right - nestingLevel * NESTING_LEVEL_INDENTATION : rect.left + nestingLevel * NESTING_LEVEL_INDENTATION;
const isNestingHorizontalGesture = rtl ? point.x < blockIndentPosition - NESTING_LEVEL_INDENTATION : point.x > blockIndentPosition + NESTING_LEVEL_INDENTATION;
return isNestingHorizontalGesture && point.y < rect.bottom;
}
const ALLOWED_DROP_EDGES = ["top", "bottom"];
function getListViewDropTarget(blocksData, position, rtl = false) {
let candidateEdge;
let candidateBlockData;
let candidateDistance;
let candidateRect;
let candidateBlockIndex;
for (let i = 0; i < blocksData.length; i++) {
const blockData = blocksData[i];
if (blockData.isDraggedBlock) {
continue;
}
const rect = blockData.element.getBoundingClientRect();
const [distance, edge] = getDistanceToNearestEdge(
position,
rect,
ALLOWED_DROP_EDGES
);
const isCursorWithinBlock = isPointContainedByRect(position, rect);
if (candidateDistance === void 0 || distance < candidateDistance || isCursorWithinBlock) {
candidateDistance = distance;
const index = blocksData.indexOf(blockData);
const previousBlockData = blocksData[index - 1];
if (edge === "top" && previousBlockData && previousBlockData.rootClientId === blockData.rootClientId && !previousBlockData.isDraggedBlock) {
candidateBlockData = previousBlockData;
candidateEdge = "bottom";
candidateRect = previousBlockData.element.getBoundingClientRect();
candidateBlockIndex = index - 1;
} else {
candidateBlockData = blockData;
candidateEdge = edge;
candidateRect = rect;
candidateBlockIndex = index;
}
if (isCursorWithinBlock) {
break;
}
}
}
if (!candidateBlockData) {
return;
}
const candidateBlockParents = getCandidateBlockParents(
candidateBlockData,
blocksData
);
const isDraggingBelow = candidateEdge === "bottom";
if (isDraggingBelow && candidateBlockData.canInsertDraggedBlocksAsChild && (candidateBlockData.innerBlockCount > 0 && candidateBlockData.isExpanded || isNestingGesture(
position,
candidateRect,
candidateBlockParents.length,
rtl
))) {
const newBlockIndex = candidateBlockData.isExpanded ? 0 : candidateBlockData.innerBlockCount || 0;
return {
rootClientId: candidateBlockData.clientId,
clientId: candidateBlockData.clientId,
blockIndex: newBlockIndex,
dropPosition: "inside"
};
}
if (isDraggingBelow && candidateBlockData.rootClientId && isUpGesture(
position,
candidateRect,
candidateBlockParents.length,
rtl
)) {
const nextBlock = getNextNonDraggedBlock(
blocksData,
candidateBlockIndex
);
const currentLevel = candidateBlockData.nestingLevel;
const nextLevel = nextBlock ? nextBlock.nestingLevel : 1;
if (currentLevel && nextLevel) {
const desiredRelativeLevel = getDesiredRelativeParentLevel(
position,
candidateRect,
candidateBlockParents.length,
rtl
);
const targetParentIndex = Math.max(
Math.min(desiredRelativeLevel, currentLevel - nextLevel),
0
);
if (candidateBlockParents[targetParentIndex]) {
let newBlockIndex = candidateBlockData.blockIndex;
if (candidateBlockParents[targetParentIndex].nestingLevel === nextBlock?.nestingLevel) {
newBlockIndex = nextBlock?.blockIndex;
} else {
for (let i = candidateBlockIndex; i >= 0; i--) {
const blockData = blocksData[i];
if (blockData.rootClientId === candidateBlockParents[targetParentIndex].rootClientId) {
newBlockIndex = blockData.blockIndex + 1;
break;
}
}
}
return {
rootClientId: candidateBlockParents[targetParentIndex].rootClientId,
clientId: candidateBlockData.clientId,
blockIndex: newBlockIndex,
dropPosition: candidateEdge
};
}
}
}
if (!candidateBlockData.canInsertDraggedBlocksAsSibling) {
return;
}
const offset = isDraggingBelow ? 1 : 0;
return {
rootClientId: candidateBlockData.rootClientId,
clientId: candidateBlockData.clientId,
blockIndex: candidateBlockData.blockIndex + offset,
dropPosition: candidateEdge
};
}
const EXPAND_THROTTLE_OPTIONS = {
leading: false,
// Don't call the function immediately on the first call.
trailing: true
// Do call the function on the last call.
};
function useListViewDropZone({
dropZoneElement,
expandedState,
setExpandedState
}) {
const {
getBlockRootClientId,
getBlockIndex,
getBlockCount,
getDraggedBlockClientIds,
canInsertBlocks
} = (0,external_wp_data_namespaceObject.useSelect)(store);
const [target, setTarget] = (0,external_wp_element_namespaceObject.useState)();
const { rootClientId: targetRootClientId, blockIndex: targetBlockIndex } = target || {};
const onBlockDrop = useOnBlockDrop(targetRootClientId, targetBlockIndex);
const rtl = (0,external_wp_i18n_namespaceObject.isRTL)();
const previousRootClientId = (0,external_wp_compose_namespaceObject.usePrevious)(targetRootClientId);
const maybeExpandBlock = (0,external_wp_element_namespaceObject.useCallback)(
(_expandedState, _target) => {
const { rootClientId } = _target || {};
if (!rootClientId) {
return;
}
if (_target?.dropPosition === "inside" && !_expandedState[rootClientId]) {
setExpandedState({
type: "expand",
clientIds: [rootClientId]
});
}
},
[setExpandedState]
);
const throttledMaybeExpandBlock = (0,external_wp_compose_namespaceObject.useThrottle)(
maybeExpandBlock,
500,
EXPAND_THROTTLE_OPTIONS
);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (target?.dropPosition !== "inside" || previousRootClientId !== target?.rootClientId) {
throttledMaybeExpandBlock.cancel();
return;
}
throttledMaybeExpandBlock(expandedState, target);
}, [
expandedState,
previousRootClientId,
target,
throttledMaybeExpandBlock
]);
const draggedBlockClientIds = getDraggedBlockClientIds();
const throttled = (0,external_wp_compose_namespaceObject.useThrottle)(
(0,external_wp_element_namespaceObject.useCallback)(
(event, currentTarget) => {
const position = { x: event.clientX, y: event.clientY };
const isBlockDrag = !!draggedBlockClientIds?.length;
const blockElements = Array.from(
currentTarget.querySelectorAll("[data-block]")
);
const blocksData = blockElements.map((blockElement) => {
const clientId = blockElement.dataset.block;
const isExpanded = blockElement.dataset.expanded === "true";
const isDraggedBlock = blockElement.classList.contains("is-dragging");
const nestingLevel = parseInt(
blockElement.getAttribute("aria-level"),
10
);
const rootClientId = getBlockRootClientId(clientId);
return {
clientId,
isExpanded,
rootClientId,
blockIndex: getBlockIndex(clientId),
element: blockElement,
nestingLevel: nestingLevel || void 0,
isDraggedBlock: isBlockDrag ? isDraggedBlock : false,
innerBlockCount: getBlockCount(clientId),
canInsertDraggedBlocksAsSibling: isBlockDrag ? canInsertBlocks(
draggedBlockClientIds,
rootClientId
) : true,
canInsertDraggedBlocksAsChild: isBlockDrag ? canInsertBlocks(draggedBlockClientIds, clientId) : true
};
});
const newTarget = getListViewDropTarget(
blocksData,
position,
rtl
);
if (newTarget) {
setTarget(newTarget);
}
},
[
canInsertBlocks,
draggedBlockClientIds,
getBlockCount,
getBlockIndex,
getBlockRootClientId,
rtl
]
),
50
);
const ref = (0,external_wp_compose_namespaceObject.__experimentalUseDropZone)({
dropZoneElement,
onDrop(event) {
throttled.cancel();
if (target) {
onBlockDrop(event);
}
setTarget(void 0);
},
onDragLeave() {
throttled.cancel();
setTarget(null);
},
onDragOver(event) {
throttled(event, event.currentTarget);
},
onDragEnd() {
throttled.cancel();
setTarget(void 0);
}
});
return { ref, target };
}
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-expand-selected-item.js
function useListViewExpandSelectedItem({
firstSelectedBlockClientId,
setExpandedState
}) {
const [selectedTreeId, setSelectedTreeId] = (0,external_wp_element_namespaceObject.useState)(null);
const { selectedBlockParentClientIds } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockParents } = select(store);
return {
selectedBlockParentClientIds: getBlockParents(
firstSelectedBlockClientId,
false
)
};
},
[firstSelectedBlockClientId]
);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (selectedTreeId === firstSelectedBlockClientId) {
return;
}
if (selectedBlockParentClientIds?.length) {
setExpandedState({
type: "expand",
clientIds: selectedBlockParentClientIds
});
}
}, [
firstSelectedBlockClientId,
selectedBlockParentClientIds,
selectedTreeId,
setExpandedState
]);
return {
setSelectedTreeId
};
}
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-clipboard-handler.js
function use_clipboard_handler_useClipboardHandler({ selectBlock }) {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const {
getBlockOrder,
getBlockRootClientId,
getBlocksByClientId,
getPreviousBlockClientId,
getSelectedBlockClientIds,
getSettings,
canInsertBlockType,
canRemoveBlocks
} = (0,external_wp_data_namespaceObject.useSelect)(store);
const { flashBlock, removeBlocks, replaceBlocks, insertBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const notifyCopy = useNotifyCopy();
return (0,external_wp_compose_namespaceObject.useRefEffect)((node) => {
function updateFocusAndSelection(focusClientId, shouldSelectBlock) {
if (shouldSelectBlock) {
selectBlock(void 0, focusClientId, null, null);
}
focusListItem(focusClientId, node);
}
function getBlocksToUpdate(clientId) {
const selectedBlockClientIds = getSelectedBlockClientIds();
const isUpdatingSelectedBlocks = selectedBlockClientIds.includes(clientId);
const firstBlockClientId = isUpdatingSelectedBlocks ? selectedBlockClientIds[0] : clientId;
const firstBlockRootClientId = getBlockRootClientId(firstBlockClientId);
const blocksToUpdate = isUpdatingSelectedBlocks ? selectedBlockClientIds : [clientId];
return {
blocksToUpdate,
firstBlockClientId,
firstBlockRootClientId,
originallySelectedBlockClientIds: selectedBlockClientIds
};
}
function handler(event) {
if (event.defaultPrevented) {
return;
}
if (!node.contains(event.target.ownerDocument.activeElement)) {
return;
}
const listViewRow = event.target.ownerDocument.activeElement?.closest(
"[role=row]"
);
const clientId = listViewRow?.dataset?.block;
if (!clientId) {
return;
}
const {
blocksToUpdate: selectedBlockClientIds,
firstBlockClientId,
firstBlockRootClientId,
originallySelectedBlockClientIds
} = getBlocksToUpdate(clientId);
if (selectedBlockClientIds.length === 0) {
return;
}
event.preventDefault();
if (event.type === "copy" || event.type === "cut") {
if (selectedBlockClientIds.length === 1) {
flashBlock(selectedBlockClientIds[0]);
}
notifyCopy(event.type, selectedBlockClientIds);
const blocks = getBlocksByClientId(selectedBlockClientIds);
setClipboardBlocks(event, blocks, registry);
}
if (event.type === "cut") {
if (!canRemoveBlocks(selectedBlockClientIds)) {
return;
}
let blockToFocus = getPreviousBlockClientId(firstBlockClientId) ?? // If the previous block is not found (when the first block is deleted),
// fallback to focus the parent block.
firstBlockRootClientId;
removeBlocks(selectedBlockClientIds, false);
const shouldUpdateSelection = originallySelectedBlockClientIds.length > 0 && getSelectedBlockClientIds().length === 0;
if (!blockToFocus) {
blockToFocus = getBlockOrder()[0];
}
updateFocusAndSelection(blockToFocus, shouldUpdateSelection);
} else if (event.type === "paste") {
const {
__experimentalCanUserUseUnfilteredHTML: canUserUseUnfilteredHTML
} = getSettings();
const blocks = getPasteBlocks(
event,
canUserUseUnfilteredHTML
);
if (selectedBlockClientIds.length === 1) {
const [selectedBlockClientId] = selectedBlockClientIds;
if (blocks.every(
(block) => canInsertBlockType(
block.name,
selectedBlockClientId
)
)) {
insertBlocks(
blocks,
void 0,
selectedBlockClientId
);
updateFocusAndSelection(blocks[0]?.clientId, false);
return;
}
}
replaceBlocks(
selectedBlockClientIds,
blocks,
blocks.length - 1,
-1
);
updateFocusAndSelection(blocks[0]?.clientId, false);
}
}
node.ownerDocument.addEventListener("copy", handler);
node.ownerDocument.addEventListener("cut", handler);
node.ownerDocument.addEventListener("paste", handler);
return () => {
node.ownerDocument.removeEventListener("copy", handler);
node.ownerDocument.removeEventListener("cut", handler);
node.ownerDocument.removeEventListener("paste", handler);
};
}, []);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/index.js
const expanded = (state, action) => {
if (action.type === "clear") {
return {};
}
if (Array.isArray(action.clientIds)) {
return {
...state,
...action.clientIds.reduce(
(newState, id) => ({
...newState,
[id]: action.type === "expand"
}),
{}
)
};
}
return state;
};
const BLOCK_LIST_ITEM_HEIGHT = 32;
function ListViewComponent({
id,
blocks,
dropZoneElement,
showBlockMovers = false,
isExpanded = false,
showAppender = false,
blockSettingsMenu: BlockSettingsMenu = BlockSettingsDropdown,
rootClientId,
description,
onSelect,
additionalBlockContent: AdditionalBlockContent
}, ref) {
if (blocks) {
external_wp_deprecated_default()(
"`blocks` property in `wp.blockEditor.__experimentalListView`",
{
since: "6.3",
alternative: "`rootClientId` property"
}
);
}
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ListViewComponent);
const { clientIdsTree, draggedClientIds, selectedClientIds } = useListViewClientIds({ blocks, rootClientId });
const blockIndexes = useListViewBlockIndexes(clientIdsTree);
const { getBlock } = (0,external_wp_data_namespaceObject.useSelect)(store);
const { visibleBlockCount } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getGlobalBlockCount, getClientIdsOfDescendants } = select(store);
const draggedBlockCount = draggedClientIds?.length > 0 ? getClientIdsOfDescendants(draggedClientIds).length + 1 : 0;
return {
visibleBlockCount: getGlobalBlockCount() - draggedBlockCount
};
},
[draggedClientIds]
);
const { updateBlockSelection } = useBlockSelection();
const [expandedState, setExpandedState] = (0,external_wp_element_namespaceObject.useReducer)(expanded, {});
const [insertedBlock, setInsertedBlock] = (0,external_wp_element_namespaceObject.useState)(null);
const { setSelectedTreeId } = useListViewExpandSelectedItem({
firstSelectedBlockClientId: selectedClientIds[0],
setExpandedState
});
const selectEditorBlock = (0,external_wp_element_namespaceObject.useCallback)(
/**
* @param {MouseEvent | KeyboardEvent | undefined} event
* @param {string} blockClientId
* @param {null | undefined | -1 | 1} focusPosition
*/
(event, blockClientId, focusPosition) => {
updateBlockSelection(event, blockClientId, null, focusPosition);
setSelectedTreeId(blockClientId);
if (onSelect) {
onSelect(getBlock(blockClientId));
}
},
[setSelectedTreeId, updateBlockSelection, onSelect, getBlock]
);
const { ref: dropZoneRef, target: blockDropTarget } = useListViewDropZone({
dropZoneElement,
expandedState,
setExpandedState
});
const elementRef = (0,external_wp_element_namespaceObject.useRef)();
const clipBoardRef = use_clipboard_handler_useClipboardHandler({
selectBlock: selectEditorBlock
});
const treeGridRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([
clipBoardRef,
elementRef,
dropZoneRef,
ref
]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (selectedClientIds?.length) {
focusListItem(selectedClientIds[0], elementRef?.current);
}
}, []);
const expand = (0,external_wp_element_namespaceObject.useCallback)(
(clientId) => {
if (!clientId) {
return;
}
const clientIds = Array.isArray(clientId) ? clientId : [clientId];
setExpandedState({ type: "expand", clientIds });
},
[setExpandedState]
);
const collapse = (0,external_wp_element_namespaceObject.useCallback)(
(clientId) => {
if (!clientId) {
return;
}
setExpandedState({ type: "collapse", clientIds: [clientId] });
},
[setExpandedState]
);
const collapseAll = (0,external_wp_element_namespaceObject.useCallback)(() => {
setExpandedState({ type: "clear" });
}, [setExpandedState]);
const expandRow = (0,external_wp_element_namespaceObject.useCallback)(
(row) => {
expand(row?.dataset?.block);
},
[expand]
);
const collapseRow = (0,external_wp_element_namespaceObject.useCallback)(
(row) => {
collapse(row?.dataset?.block);
},
[collapse]
);
const focusRow = (0,external_wp_element_namespaceObject.useCallback)(
(event, startRow, endRow) => {
if (event.shiftKey) {
updateBlockSelection(
event,
startRow?.dataset?.block,
endRow?.dataset?.block
);
}
},
[updateBlockSelection]
);
useListViewCollapseItems({
collapseAll,
expand
});
const firstDraggedBlockClientId = draggedClientIds?.[0];
const { blockDropTargetIndex, blockDropPosition, firstDraggedBlockIndex } = (0,external_wp_element_namespaceObject.useMemo)(() => {
let _blockDropTargetIndex, _firstDraggedBlockIndex;
if (blockDropTarget?.clientId) {
const foundBlockIndex = blockIndexes[blockDropTarget.clientId];
_blockDropTargetIndex = foundBlockIndex === void 0 || blockDropTarget?.dropPosition === "top" ? foundBlockIndex : foundBlockIndex + 1;
} else if (blockDropTarget === null) {
_blockDropTargetIndex = null;
}
if (firstDraggedBlockClientId) {
const foundBlockIndex = blockIndexes[firstDraggedBlockClientId];
_firstDraggedBlockIndex = foundBlockIndex === void 0 || blockDropTarget?.dropPosition === "top" ? foundBlockIndex : foundBlockIndex + 1;
}
return {
blockDropTargetIndex: _blockDropTargetIndex,
blockDropPosition: blockDropTarget?.dropPosition,
firstDraggedBlockIndex: _firstDraggedBlockIndex
};
}, [blockDropTarget, blockIndexes, firstDraggedBlockClientId]);
const contextValue = (0,external_wp_element_namespaceObject.useMemo)(
() => ({
blockDropPosition,
blockDropTargetIndex,
blockIndexes,
draggedClientIds,
expandedState,
expand,
firstDraggedBlockIndex,
collapse,
collapseAll,
BlockSettingsMenu,
listViewInstanceId: instanceId,
AdditionalBlockContent,
insertedBlock,
setInsertedBlock,
treeGridElementRef: elementRef,
rootClientId
}),
[
blockDropPosition,
blockDropTargetIndex,
blockIndexes,
draggedClientIds,
expandedState,
expand,
firstDraggedBlockIndex,
collapse,
collapseAll,
BlockSettingsMenu,
instanceId,
AdditionalBlockContent,
insertedBlock,
setInsertedBlock,
rootClientId
]
);
const [fixedListWindow] = (0,external_wp_compose_namespaceObject.__experimentalUseFixedWindowList)(
elementRef,
BLOCK_LIST_ITEM_HEIGHT,
visibleBlockCount,
{
// Ensure that the windowing logic is recalculated when the expanded state changes.
// This is necessary because expanding a collapsed block in a short list view can
// switch the list view to a tall list view with a scrollbar, and vice versa.
// When this happens, the windowing logic needs to be recalculated to ensure that
// the correct number of blocks are rendered, by rechecking for a scroll container.
expandedState,
useWindowing: true,
windowOverscan: 40
}
);
if (!clientIdsTree.length && !showAppender) {
return null;
}
const describedById = description && `block-editor-list-view-description-${instanceId}`;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_data_namespaceObject.AsyncModeProvider, { value: true, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ListViewDropIndicatorPreview,
{
draggedBlockClientId: firstDraggedBlockClientId,
listViewRef: elementRef,
blockDropTarget
}
),
description && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: describedById, children: description }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalTreeGrid,
{
id,
className: dist_clsx("block-editor-list-view-tree", {
"is-dragging": draggedClientIds?.length > 0 && blockDropTargetIndex !== void 0
}),
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Block navigation structure"),
ref: treeGridRef,
onCollapseRow: collapseRow,
onExpandRow: expandRow,
onFocusRow: focusRow,
applicationAriaLabel: (0,external_wp_i18n_namespaceObject.__)("Block navigation structure"),
"aria-describedby": describedById,
style: {
"--wp-admin--list-view-dragged-items-height": draggedClientIds?.length ? `${BLOCK_LIST_ITEM_HEIGHT * (draggedClientIds.length - 1)}px` : null
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
branch_default,
{
blocks: clientIdsTree,
parentId: rootClientId,
selectBlock: selectEditorBlock,
showBlockMovers,
fixedListWindow,
selectedClientIds,
isExpanded,
showAppender
}
) })
}
)
] });
}
const PrivateListView = (0,external_wp_element_namespaceObject.forwardRef)(ListViewComponent);
var list_view_list_view_default = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PrivateListView,
{
ref,
...props,
showAppender: false,
rootClientId: null,
onSelect: null,
additionalBlockContent: null,
blockSettingsMenu: void 0
}
);
});
;// ./node_modules/@wordpress/block-editor/build-module/components/block-navigation/dropdown.js
function BlockNavigationDropdownToggle({
isEnabled,
onToggle,
isOpen,
innerRef,
...props
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
...props,
ref: innerRef,
icon: list_view_default,
"aria-expanded": isOpen,
"aria-haspopup": "true",
onClick: isEnabled ? onToggle : void 0,
label: (0,external_wp_i18n_namespaceObject.__)("List view"),
className: "block-editor-block-navigation",
"aria-disabled": !isEnabled
}
);
}
function BlockNavigationDropdown({ isDisabled, ...props }, ref) {
external_wp_deprecated_default()("wp.blockEditor.BlockNavigationDropdown", {
since: "6.1",
alternative: "wp.components.Dropdown and wp.blockEditor.ListView"
});
const hasBlocks = (0,external_wp_data_namespaceObject.useSelect)(
(select) => !!select(store).getBlockCount(),
[]
);
const isEnabled = hasBlocks && !isDisabled;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
contentClassName: "block-editor-block-navigation__popover",
popoverProps: { placement: "bottom-start" },
renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockNavigationDropdownToggle,
{
...props,
innerRef: ref,
isOpen,
onToggle,
isEnabled
}
),
renderContent: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-navigation__container", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "block-editor-block-navigation__label", children: (0,external_wp_i18n_namespaceObject.__)("List view") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(list_view_list_view_default, {})
] })
}
);
}
var dropdown_default = (0,external_wp_element_namespaceObject.forwardRef)(BlockNavigationDropdown);
;// ./node_modules/@wordpress/block-editor/build-module/components/block-styles/preview-panel.js
function BlockStylesPreviewPanel({
genericPreviewBlock,
style,
className,
activeStyle
}) {
const example = (0,external_wp_blocks_namespaceObject.getBlockType)(genericPreviewBlock.name)?.example;
const styleClassName = replaceActiveStyle(className, activeStyle, style);
const previewBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => {
return {
...genericPreviewBlock,
title: style.label || style.name,
description: style.description,
initialAttributes: {
...genericPreviewBlock.attributes,
className: styleClassName + " block-editor-block-styles__block-preview-container"
},
example
};
}, [genericPreviewBlock, styleClassName]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(preview_panel_default, { item: previewBlocks });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-styles/index.js
const block_styles_noop = () => {
};
function BlockStyles({ clientId, onSwitch = block_styles_noop, onHoverClassName = block_styles_noop }) {
const {
onSelect,
stylesToRender,
activeStyle,
genericPreviewBlock,
className: previewClassName
} = useStylesForBlocks({
clientId,
onSwitch
});
const [hoveredStyle, setHoveredStyle] = (0,external_wp_element_namespaceObject.useState)(null);
const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
if (!stylesToRender || stylesToRender.length === 0) {
return null;
}
const debouncedSetHoveredStyle = (0,external_wp_compose_namespaceObject.debounce)(setHoveredStyle, 250);
const onSelectStylePreview = (style) => {
onSelect(style);
onHoverClassName(null);
setHoveredStyle(null);
debouncedSetHoveredStyle.cancel();
};
const styleItemHandler = (item) => {
if (hoveredStyle === item) {
debouncedSetHoveredStyle.cancel();
return;
}
debouncedSetHoveredStyle(item);
onHoverClassName(item?.name ?? null);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-styles", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-styles__variants", children: stylesToRender.map((style) => {
const buttonText = style.label || style.name;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
className: dist_clsx(
"block-editor-block-styles__item",
{
"is-active": activeStyle.name === style.name
}
),
variant: "secondary",
label: buttonText,
onMouseEnter: () => styleItemHandler(style),
onFocus: () => styleItemHandler(style),
onMouseLeave: () => styleItemHandler(null),
onBlur: () => styleItemHandler(null),
onClick: () => onSelectStylePreview(style),
"aria-current": activeStyle.name === style.name,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalTruncate,
{
numberOfLines: 1,
className: "block-editor-block-styles__item-text",
children: buttonText
}
)
},
style.name
);
}) }),
hoveredStyle && !isMobileViewport && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Popover,
{
placement: "left-start",
offset: 34,
focusOnMount: false,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "block-editor-block-styles__preview-panel",
onMouseLeave: () => styleItemHandler(null),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockStylesPreviewPanel,
{
activeStyle,
className: previewClassName,
genericPreviewBlock,
style: hoveredStyle
}
)
}
)
}
)
] });
}
var block_styles_default = BlockStyles;
;// ./node_modules/@wordpress/icons/build-module/library/paragraph.js
var paragraph_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/heading-level-1.js
var heading_level_1_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/heading-level-2.js
var heading_level_2_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M9 11.1H5v-4H3v10h2v-4h4v4h2v-10H9v4zm8 4c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6v1.5h8v-2H17z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/heading-level-3.js
var heading_level_3_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.3 1.7c-.4-.4-1-.7-1.6-.8v-.1c.6-.2 1.1-.5 1.5-.9.3-.4.5-.8.5-1.3 0-.4-.1-.8-.3-1.1-.2-.3-.5-.6-.8-.8-.4-.2-.8-.4-1.2-.5-.6-.1-1.1-.2-1.6-.2-.6 0-1.3.1-1.8.3s-1.1.5-1.6.9l1.2 1.4c.4-.2.7-.4 1.1-.6.3-.2.7-.3 1.1-.3.4 0 .8.1 1.1.3.3.2.4.5.4.8 0 .4-.2.7-.6.9-.7.3-1.5.5-2.2.4v1.6c.5 0 1 0 1.5.1.3.1.7.2 1 .3.2.1.4.2.5.4s.1.4.1.6c0 .3-.2.7-.5.8-.4.2-.9.3-1.4.3s-1-.1-1.4-.3c-.4-.2-.8-.4-1.2-.7L13 15.6c.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.6 0 1.1-.1 1.6-.2.4-.1.9-.2 1.3-.5.4-.2.7-.5.9-.9.2-.4.3-.8.3-1.2 0-.6-.3-1.1-.7-1.5z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/heading-level-4.js
var heading_level_4_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/heading-level-5.js
var heading_level_5_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.7 1.2c-.2-.3-.5-.7-.8-.9-.3-.3-.7-.5-1.1-.6-.5-.1-.9-.2-1.4-.2-.2 0-.5.1-.7.1-.2.1-.5.1-.7.2l.1-1.9h4.3V7H14l-.3 5 1 .6.5-.2.4-.1c.1-.1.3-.1.4-.1h.5c.5 0 1 .1 1.4.4.4.2.6.7.6 1.1 0 .4-.2.8-.6 1.1-.4.3-.9.4-1.4.4-.4 0-.9-.1-1.3-.3-.4-.2-.7-.4-1.1-.7 0 0-1.1 1.4-1 1.5.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.5 0 1-.1 1.5-.3s.9-.4 1.3-.7c.4-.3.7-.7.9-1.1s.3-.9.3-1.4-.1-1-.3-1.4z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/heading-level-6.js
var heading_level_6_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20.7 12.4c-.2-.3-.4-.6-.7-.9s-.6-.5-1-.6c-.4-.2-.8-.2-1.2-.2-.5 0-.9.1-1.3.3s-.8.5-1.2.8c0-.5 0-.9.2-1.4l.6-.9c.2-.2.5-.4.8-.5.6-.2 1.3-.2 1.9 0 .3.1.6.3.8.5 0 0 1.3-1.3 1.3-1.4-.4-.3-.9-.6-1.4-.8-.6-.2-1.3-.3-2-.3-.6 0-1.1.1-1.7.4-.5.2-1 .5-1.4.9-.4.4-.8 1-1 1.6-.3.7-.4 1.5-.4 2.3s.1 1.5.3 2.1c.2.6.6 1.1 1 1.5.4.4.9.7 1.4.9 1 .3 2 .3 3 0 .4-.1.8-.3 1.2-.6.3-.3.6-.6.8-1 .2-.5.3-.9.3-1.4s-.1-.9-.3-1.3zm-2 2.1c-.1.2-.3.4-.4.5-.1.1-.3.2-.5.2-.2.1-.4.1-.6.1-.2.1-.5 0-.7-.1-.2 0-.3-.2-.5-.3-.1-.2-.3-.4-.4-.6-.2-.3-.3-.7-.3-1 .3-.3.6-.5 1-.7.3-.1.7-.2 1-.2.4 0 .8.1 1.1.3.3.3.4.7.4 1.1 0 .2 0 .5-.1.7zM9 11H5V7H3v10h2v-4h4v4h2V7H9v4z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/block-heading-level-dropdown/heading-level-icon.js
const LEVEL_TO_PATH = {
0: paragraph_default,
1: heading_level_1_default,
2: heading_level_2_default,
3: heading_level_3_default,
4: heading_level_4_default,
5: heading_level_5_default,
6: heading_level_6_default
};
function HeadingLevelIcon({ level }) {
if (LEVEL_TO_PATH[level]) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: LEVEL_TO_PATH[level] });
}
return null;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-heading-level-dropdown/index.js
const HEADING_LEVELS = [1, 2, 3, 4, 5, 6];
const block_heading_level_dropdown_POPOVER_PROPS = {
className: "block-library-heading-level-dropdown"
};
function HeadingLevelDropdown({
options = HEADING_LEVELS,
value,
onChange
}) {
const validOptions = options.filter(
(option) => option === 0 || HEADING_LEVELS.includes(option)
).sort((a, b) => a - b);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarDropdownMenu,
{
popoverProps: block_heading_level_dropdown_POPOVER_PROPS,
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HeadingLevelIcon, { level: value }),
label: (0,external_wp_i18n_namespaceObject.__)("Change level"),
controls: validOptions.map((targetLevel) => {
const isActive = targetLevel === value;
return {
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HeadingLevelIcon, { level: targetLevel }),
title: targetLevel === 0 ? (0,external_wp_i18n_namespaceObject.__)("Paragraph") : (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %d: heading level e.g: "1", "2", "3"
(0,external_wp_i18n_namespaceObject.__)("Heading %d"),
targetLevel
),
isActive,
onClick() {
onChange(targetLevel);
},
role: "menuitemradio"
};
})
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/layout.js
var layout_layout_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 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" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/block-variation-picker/index.js
function BlockVariationPicker({
icon = layout_layout_default,
label = (0,external_wp_i18n_namespaceObject.__)("Choose variation"),
instructions = (0,external_wp_i18n_namespaceObject.__)("Select a variation to start with:"),
variations,
onSelect,
allowSkip
}) {
const classes = dist_clsx("block-editor-block-variation-picker", {
"has-many-variations": variations.length > 4
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Placeholder,
{
icon,
label,
instructions,
className: classes,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"ul",
{
className: "block-editor-block-variation-picker__variations",
role: "list",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Block variations"),
children: variations.map((variation) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
icon: variation.icon && variation.icon.src ? variation.icon.src : variation.icon,
iconSize: 48,
onClick: () => onSelect(variation),
className: "block-editor-block-variation-picker__variation",
label: variation.description || variation.title
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-block-variation-picker__variation-label", children: variation.title })
] }, variation.name))
}
),
allowSkip && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-variation-picker__skip", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "link",
onClick: () => onSelect(),
children: (0,external_wp_i18n_namespaceObject.__)("Skip")
}
) })
]
}
);
}
var block_variation_picker_default = BlockVariationPicker;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-pattern-setup/constants.js
const VIEWMODES = {
carousel: "carousel",
grid: "grid"
};
;// ./node_modules/@wordpress/block-editor/build-module/components/block-pattern-setup/setup-toolbar.js
const Actions = ({ onBlockPatternSelect }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-pattern-setup__actions", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "primary",
onClick: onBlockPatternSelect,
children: (0,external_wp_i18n_namespaceObject.__)("Choose")
}
) });
const CarouselNavigation = ({
handlePrevious,
handleNext,
activeSlide,
totalSlides
}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-pattern-setup__navigation", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "compact",
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right_default : chevron_left_default,
label: (0,external_wp_i18n_namespaceObject.__)("Previous pattern"),
onClick: handlePrevious,
disabled: activeSlide === 0,
accessibleWhenDisabled: true
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "compact",
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_default : chevron_right_default,
label: (0,external_wp_i18n_namespaceObject.__)("Next pattern"),
onClick: handleNext,
disabled: activeSlide === totalSlides - 1,
accessibleWhenDisabled: true
}
)
] });
const SetupToolbar = ({
viewMode,
setViewMode,
handlePrevious,
handleNext,
activeSlide,
totalSlides,
onBlockPatternSelect
}) => {
const isCarouselView = viewMode === VIEWMODES.carousel;
const displayControls = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-pattern-setup__display-controls", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "compact",
icon: stretch_full_width_default,
label: (0,external_wp_i18n_namespaceObject.__)("Carousel view"),
onClick: () => setViewMode(VIEWMODES.carousel),
isPressed: isCarouselView
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "compact",
icon: grid_grid_default,
label: (0,external_wp_i18n_namespaceObject.__)("Grid view"),
onClick: () => setViewMode(VIEWMODES.grid),
isPressed: viewMode === VIEWMODES.grid
}
)
] });
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-pattern-setup__toolbar", children: [
isCarouselView && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CarouselNavigation,
{
handlePrevious,
handleNext,
activeSlide,
totalSlides
}
),
displayControls,
isCarouselView && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Actions, { onBlockPatternSelect })
] });
};
var setup_toolbar_default = SetupToolbar;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-pattern-setup/use-patterns-setup.js
function usePatternsSetup(clientId, blockName, filterPatternsFn) {
return (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getBlockRootClientId,
getPatternsByBlockTypes,
__experimentalGetAllowedPatterns
} = select(store);
const rootClientId = getBlockRootClientId(clientId);
if (filterPatternsFn) {
return __experimentalGetAllowedPatterns(rootClientId).filter(
filterPatternsFn
);
}
return getPatternsByBlockTypes(blockName, rootClientId);
},
[clientId, blockName, filterPatternsFn]
);
}
var use_patterns_setup_default = usePatternsSetup;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-pattern-setup/index.js
const SetupContent = ({
viewMode,
activeSlide,
patterns,
onBlockPatternSelect,
showTitles
}) => {
const containerClass = "block-editor-block-pattern-setup__container";
if (viewMode === VIEWMODES.carousel) {
const slideClass = /* @__PURE__ */ new Map([
[activeSlide, "active-slide"],
[activeSlide - 1, "previous-slide"],
[activeSlide + 1, "next-slide"]
]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-pattern-setup__carousel", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: containerClass, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "carousel-container", children: patterns.map((pattern, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockPatternSlide,
{
active: index === activeSlide,
className: slideClass.get(index) || "",
pattern
},
pattern.name
)) }) }) });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-pattern-setup__grid", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite,
{
role: "listbox",
className: containerClass,
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Patterns list"),
children: patterns.map((pattern) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_pattern_setup_BlockPattern,
{
pattern,
onSelect: onBlockPatternSelect,
showTitles
},
pattern.name
))
}
) });
};
function block_pattern_setup_BlockPattern({ pattern, onSelect, showTitles }) {
const baseClassName = "block-editor-block-pattern-setup-list";
const { blocks, description, viewportWidth = 700 } = pattern;
const descriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(
block_pattern_setup_BlockPattern,
`${baseClassName}__item-description`
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `${baseClassName}__list-item`, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Composite.Item,
{
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
"aria-describedby": description ? descriptionId : void 0,
"aria-label": pattern.title,
className: `${baseClassName}__item`
}
),
id: `${baseClassName}__pattern__${pattern.name}`,
role: "option",
onClick: () => onSelect(blocks),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_preview_default,
{
blocks,
viewportWidth
}
),
showTitles && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `${baseClassName}__item-title`, children: pattern.title }),
!!description && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: descriptionId, children: description })
]
}
) });
}
function BlockPatternSlide({ active, className, pattern, minHeight }) {
const { blocks, title, description } = pattern;
const descriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(
BlockPatternSlide,
"block-editor-block-pattern-setup-list__item-description"
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
"aria-hidden": !active,
role: "img",
className: `pattern-slide ${className}`,
"aria-label": title,
"aria-describedby": description ? descriptionId : void 0,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_preview_default, { blocks, minHeight }),
!!description && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: descriptionId, children: description })
]
}
);
}
const BlockPatternSetup = ({
clientId,
blockName,
filterPatternsFn,
onBlockPatternSelect,
initialViewMode = VIEWMODES.carousel,
showTitles = false
}) => {
const [viewMode, setViewMode] = (0,external_wp_element_namespaceObject.useState)(initialViewMode);
const [activeSlide, setActiveSlide] = (0,external_wp_element_namespaceObject.useState)(0);
const { replaceBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const patterns = use_patterns_setup_default(clientId, blockName, filterPatternsFn);
if (!patterns?.length) {
return null;
}
const onBlockPatternSelectDefault = (blocks) => {
const clonedBlocks = blocks.map((block) => (0,external_wp_blocks_namespaceObject.cloneBlock)(block));
replaceBlock(clientId, clonedBlocks);
};
const onPatternSelectCallback = onBlockPatternSelect || onBlockPatternSelectDefault;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
className: `block-editor-block-pattern-setup view-mode-${viewMode}`,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SetupContent,
{
viewMode,
activeSlide,
patterns,
onBlockPatternSelect: onPatternSelectCallback,
showTitles
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
setup_toolbar_default,
{
viewMode,
setViewMode,
activeSlide,
totalSlides: patterns.length,
handleNext: () => {
setActiveSlide(
(active) => Math.min(active + 1, patterns.length - 1)
);
},
handlePrevious: () => {
setActiveSlide(
(active) => Math.max(active - 1, 0)
);
},
onBlockPatternSelect: () => {
onPatternSelectCallback(
patterns[activeSlide].blocks
);
}
}
)
]
}
) });
};
var block_pattern_setup_default = BlockPatternSetup;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-variation-transforms/index.js
function VariationsButtons({
className,
onSelectVariation,
selectedValue,
variations
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "legend", children: (0,external_wp_i18n_namespaceObject.__)("Transform to variation") }),
variations.map((variation) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
size: "compact",
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon_default, { icon: variation.icon, showColors: true }),
isPressed: selectedValue === variation.name,
label: selectedValue === variation.name ? variation.title : (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Block or block variation name. */
(0,external_wp_i18n_namespaceObject.__)("Transform to %s"),
variation.title
),
onClick: () => onSelectVariation(variation.name),
"aria-label": variation.title,
showTooltip: true
},
variation.name
))
] });
}
function VariationsDropdown({
className,
onSelectVariation,
selectedValue,
variations
}) {
const selectOptions = variations.map(
({ name, title, description }) => ({
value: name,
label: title,
info: description
})
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropdownMenu,
{
className,
label: (0,external_wp_i18n_namespaceObject.__)("Transform to variation"),
text: (0,external_wp_i18n_namespaceObject.__)("Transform to variation"),
popoverProps: {
position: "bottom center",
className: `${className}__popover`
},
icon: chevron_down_default,
toggleProps: { iconPosition: "right" },
children: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItemsChoice,
{
choices: selectOptions,
value: selectedValue,
onSelect: onSelectVariation
}
) })
}
);
}
function VariationsToggleGroupControl({
className,
onSelectVariation,
selectedValue,
variations
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Transform to variation"),
value: selectedValue,
hideLabelFromVision: true,
onChange: onSelectVariation,
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
children: variations.map((variation) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon,
{
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon_default, { icon: variation.icon, showColors: true }),
value: variation.name,
label: selectedValue === variation.name ? variation.title : (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Block or block variation name. */
(0,external_wp_i18n_namespaceObject.__)("Transform to %s"),
variation.title
)
},
variation.name
))
}
) });
}
function __experimentalBlockVariationTransforms({ blockClientId }) {
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const {
activeBlockVariation,
unfilteredVariations,
blockName,
isContentOnly,
isSection
} = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getActiveBlockVariation, getBlockVariations } = select(external_wp_blocks_namespaceObject.store);
const {
getBlockName,
getBlockAttributes,
getBlockEditingMode,
isSectionBlock
} = unlock(select(store));
const name = blockClientId && getBlockName(blockClientId);
const { hasContentRoleAttribute } = unlock(select(external_wp_blocks_namespaceObject.store));
const isContentBlock = hasContentRoleAttribute(name);
return {
activeBlockVariation: getActiveBlockVariation(
name,
getBlockAttributes(blockClientId),
"transform"
),
unfilteredVariations: name && getBlockVariations(name, "transform"),
blockName: name,
isContentOnly: getBlockEditingMode(blockClientId) === "contentOnly" && !isContentBlock,
isSection: isSectionBlock(blockClientId)
};
},
[blockClientId]
);
const variations = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (blockName === "core/paragraph") {
if (activeBlockVariation?.name === "stretchy-paragraph" || unfilteredVariations.every(
(v) => ["paragraph", "stretchy-paragraph"].includes(v.name)
)) {
return [];
}
return unfilteredVariations.filter(
(v) => v.name !== "stretchy-paragraph"
);
} else if (blockName === "core/heading") {
if (activeBlockVariation?.name === "stretchy-heading" || unfilteredVariations.every(
(v) => ["heading", "stretchy-heading"].includes(v.name)
)) {
return [];
}
return unfilteredVariations.filter(
(v) => v.name !== "stretchy-heading"
);
}
return unfilteredVariations;
}, [activeBlockVariation?.name, blockName, unfilteredVariations]);
const selectedValue = activeBlockVariation?.name;
const hasUniqueIcons = (0,external_wp_element_namespaceObject.useMemo)(() => {
const variationIcons = /* @__PURE__ */ new Set();
if (!variations) {
return false;
}
variations.forEach((variation) => {
if (variation.icon) {
variationIcons.add(variation.icon?.src || variation.icon);
}
});
return variationIcons.size === variations.length;
}, [variations]);
const onSelectVariation = (variationName) => {
updateBlockAttributes(blockClientId, {
...variations.find(({ name }) => name === variationName).attributes
});
};
const hideVariationsForSections = window?.__experimentalContentOnlyPatternInsertion && isSection;
if (!variations?.length || isContentOnly || hideVariationsForSections) {
return null;
}
const baseClass = "block-editor-block-variation-transforms";
const showButtons = variations.length > 5;
const ButtonComponent = showButtons ? VariationsButtons : VariationsToggleGroupControl;
const Component = hasUniqueIcons ? ButtonComponent : VariationsDropdown;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Component,
{
className: baseClass,
onSelectVariation,
selectedValue,
variations
}
);
}
var block_variation_transforms_default = __experimentalBlockVariationTransforms;
;// ./node_modules/@wordpress/block-editor/build-module/components/color-palette/with-color-context.js
var with_color_context_default = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((WrappedComponent) => {
return (props) => {
const [
defaultColors,
themeColors,
customColors,
enableCustomColors,
enableDefaultColors
] = use_settings_useSettings(
"color.palette.default",
"color.palette.theme",
"color.palette.custom",
"color.custom",
"color.defaultPalette"
);
const _colors = enableDefaultColors ? [
...themeColors || [],
...defaultColors || [],
...customColors || []
] : [...themeColors || [], ...customColors || []];
const { colors = _colors, disableCustomColors = !enableCustomColors } = props;
const hasColorsToChoose = colors && colors.length > 0 || !disableCustomColors;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
WrappedComponent,
{
...{
...props,
colors,
disableCustomColors,
hasColorsToChoose
}
}
);
};
}, "withColorContext");
;// ./node_modules/@wordpress/block-editor/build-module/components/color-palette/index.js
var color_palette_default = with_color_context_default(external_wp_components_namespaceObject.ColorPalette);
;// ./node_modules/@wordpress/block-editor/build-module/components/color-palette/control.js
function ColorPaletteControl({
onChange,
value,
...otherProps
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
control_default,
{
...otherProps,
onColorChange: onChange,
colorValue: value,
gradients: [],
disableCustomGradients: true
}
);
}
;// external ["wp","date"]
const external_wp_date_namespaceObject = window["wp"]["date"];
;// ./node_modules/@wordpress/block-editor/build-module/components/date-format-picker/index.js
const exampleDate = /* @__PURE__ */ new Date();
exampleDate.setDate(20);
exampleDate.setMonth(exampleDate.getMonth() - 3);
if (exampleDate.getMonth() === 4) {
exampleDate.setMonth(3);
}
function DateFormatPicker({
format,
defaultFormat,
onChange
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
as: "fieldset",
spacing: 4,
className: "block-editor-date-format-picker",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "legend", children: (0,external_wp_i18n_namespaceObject.__)("Date format") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Default format"),
help: `${(0,external_wp_i18n_namespaceObject.__)("Example:")} ${(0,external_wp_date_namespaceObject.dateI18n)(
defaultFormat,
exampleDate
)}`,
checked: !format,
onChange: (checked) => onChange(checked ? null : defaultFormat)
}
),
format && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NonDefaultControls, { format, onChange })
]
}
);
}
function NonDefaultControls({ format, onChange }) {
const suggestedFormats = [
.../* @__PURE__ */ new Set([
/* translators: See https://www.php.net/manual/datetime.format.php */
"Y-m-d",
/* translators: See https://www.php.net/manual/datetime.format.php */
(0,external_wp_i18n_namespaceObject._x)("n/j/Y", "short date format"),
/* translators: See https://www.php.net/manual/datetime.format.php */
(0,external_wp_i18n_namespaceObject._x)("n/j/Y g:i A", "short date format with time"),
/* translators: See https://www.php.net/manual/datetime.format.php */
(0,external_wp_i18n_namespaceObject._x)("M j, Y", "medium date format"),
/* translators: See https://www.php.net/manual/datetime.format.php */
(0,external_wp_i18n_namespaceObject._x)("M j, Y g:i A", "medium date format with time"),
/* translators: See https://www.php.net/manual/datetime.format.php */
(0,external_wp_i18n_namespaceObject._x)("F j, Y", "long date format"),
/* translators: See https://www.php.net/manual/datetime.format.php */
(0,external_wp_i18n_namespaceObject._x)("M j", "short date format without the year")
])
];
const suggestedOptions = [
...suggestedFormats.map((suggestedFormat, index) => ({
key: `suggested-${index}`,
name: (0,external_wp_date_namespaceObject.dateI18n)(suggestedFormat, exampleDate),
format: suggestedFormat
})),
{
key: "human-diff",
name: (0,external_wp_date_namespaceObject.humanTimeDiff)(exampleDate),
format: "human-diff"
}
];
const customOption = {
key: "custom",
name: (0,external_wp_i18n_namespaceObject.__)("Custom"),
className: "block-editor-date-format-picker__custom-format-select-control__custom-option",
hint: (0,external_wp_i18n_namespaceObject.__)("Enter your own date format")
};
const [isCustom, setIsCustom] = (0,external_wp_element_namespaceObject.useState)(
() => !!format && !suggestedOptions.some((option) => option.format === format)
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CustomSelectControl,
{
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Choose a format"),
options: [...suggestedOptions, customOption],
value: isCustom ? customOption : suggestedOptions.find(
(option) => option.format === format
) ?? customOption,
onChange: ({ selectedItem }) => {
if (selectedItem === customOption) {
setIsCustom(true);
} else {
setIsCustom(false);
onChange(selectedItem.format);
}
}
}
),
isCustom && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Custom format"),
hideLabelFromVision: true,
help: (0,external_wp_element_namespaceObject.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.__)(
"Enter a date or time <Link>format string</Link>."
),
{
Link: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ExternalLink,
{
href: (0,external_wp_i18n_namespaceObject.__)(
"https://wordpress.org/documentation/article/customize-date-and-time-format/"
)
}
)
}
),
value: format,
onChange: (value) => onChange(value)
}
)
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/dropdown.js
const WithToolsPanelItem = ({ setting, children, panelId, ...props }) => {
const clearValue = () => {
if (setting.colorValue) {
setting.onColorChange();
} else if (setting.gradientValue) {
setting.onGradientChange();
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: () => {
return !!setting.colorValue || !!setting.gradientValue;
},
label: setting.label,
onDeselect: clearValue,
isShownByDefault: setting.isShownByDefault !== void 0 ? setting.isShownByDefault : true,
...props,
className: "block-editor-tools-panel-color-gradient-settings__item",
panelId,
resetAllFilter: setting.resetAllFilter,
children
}
);
};
const dropdown_LabeledColorIndicator = ({ colorValue, label }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ColorIndicator,
{
className: "block-editor-panel-color-gradient-settings__color-indicator",
colorValue
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.FlexItem,
{
className: "block-editor-panel-color-gradient-settings__color-name",
title: label,
children: label
}
)
] });
const dropdown_renderToggle = (settings) => ({ onToggle, isOpen }) => {
const {
clearable,
colorValue,
gradientValue,
onColorChange,
onGradientChange,
label
} = settings;
const colorButtonRef = (0,external_wp_element_namespaceObject.useRef)(void 0);
const toggleProps = {
onClick: onToggle,
className: dist_clsx(
"block-editor-panel-color-gradient-settings__dropdown",
{ "is-open": isOpen }
),
"aria-expanded": isOpen,
ref: colorButtonRef
};
const clearValue = () => {
if (colorValue) {
onColorChange();
} else if (gradientValue) {
onGradientChange();
}
};
const value = colorValue ?? gradientValue;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, ...toggleProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
dropdown_LabeledColorIndicator,
{
colorValue: value,
label
}
) }),
clearable && value && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Reset"),
className: "block-editor-panel-color-gradient-settings__reset",
size: "small",
icon: reset_default,
onClick: () => {
clearValue();
if (isOpen) {
onToggle();
}
colorButtonRef.current?.focus();
}
}
)
] });
};
function ColorGradientSettingsDropdown({
colors,
disableCustomColors,
disableCustomGradients,
enableAlpha,
gradients,
settings,
__experimentalIsRenderedInSidebar,
...props
}) {
let popoverProps;
if (__experimentalIsRenderedInSidebar) {
popoverProps = {
placement: "left-start",
offset: 36,
shift: true
};
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: settings.map((setting, index) => {
const controlProps = {
clearable: false,
colorValue: setting.colorValue,
colors,
disableCustomColors,
disableCustomGradients,
enableAlpha,
gradientValue: setting.gradientValue,
gradients,
label: setting.label,
onColorChange: setting.onColorChange,
onGradientChange: setting.onGradientChange,
showTitle: false,
__experimentalIsRenderedInSidebar,
...setting
};
const toggleSettings = {
clearable: setting.clearable,
label: setting.label,
colorValue: setting.colorValue,
gradientValue: setting.gradientValue,
onColorChange: setting.onColorChange,
onGradientChange: setting.onGradientChange
};
return setting && // If not in an `ItemGroup` wrap the dropdown in a
// `ToolsPanelItem`
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
WithToolsPanelItem,
{
setting,
...props,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
popoverProps,
className: "block-editor-tools-panel-color-gradient-settings__dropdown",
renderToggle: dropdown_renderToggle(toggleSettings),
renderContent: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, { paddingSize: "none", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-panel-color-gradient-settings__dropdown-content", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
control_default,
{
...controlProps
}
) }) })
}
)
},
index
);
}) });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/panel-color-gradient-settings.js
const panel_color_gradient_settings_colorsAndGradientKeys = [
"colors",
"disableCustomColors",
"gradients",
"disableCustomGradients"
];
const PanelColorGradientSettingsInner = ({
className,
colors,
gradients,
disableCustomColors,
disableCustomGradients,
children,
settings,
title,
showTitle = true,
__experimentalIsRenderedInSidebar,
enableAlpha
}) => {
const panelId = (0,external_wp_compose_namespaceObject.useInstanceId)(PanelColorGradientSettingsInner);
const { batch } = (0,external_wp_data_namespaceObject.useRegistry)();
if ((!colors || colors.length === 0) && (!gradients || gradients.length === 0) && disableCustomColors && disableCustomGradients && settings?.every(
(setting) => (!setting.colors || setting.colors.length === 0) && (!setting.gradients || setting.gradients.length === 0) && (setting.disableCustomColors === void 0 || setting.disableCustomColors) && (setting.disableCustomGradients === void 0 || setting.disableCustomGradients)
)) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
className: dist_clsx(
"block-editor-panel-color-gradient-settings",
className
),
label: showTitle ? title : void 0,
resetAll: () => {
batch(() => {
settings.forEach(
({
colorValue,
gradientValue,
onColorChange,
onGradientChange
}) => {
if (colorValue) {
onColorChange();
} else if (gradientValue) {
onGradientChange();
}
}
);
});
},
panelId,
__experimentalFirstVisibleItemClass: "first",
__experimentalLastVisibleItemClass: "last",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ColorGradientSettingsDropdown,
{
settings,
panelId,
...{
colors,
gradients,
disableCustomColors,
disableCustomGradients,
__experimentalIsRenderedInSidebar,
enableAlpha
}
}
),
!!children && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginY: 4 }),
" ",
children
] })
]
}
);
};
const PanelColorGradientSettingsSelect = (props) => {
const colorGradientSettings = useMultipleOriginColorsAndGradients();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PanelColorGradientSettingsInner,
{
...{ ...colorGradientSettings, ...props }
}
);
};
const PanelColorGradientSettings = (props) => {
if (panel_color_gradient_settings_colorsAndGradientKeys.every((key) => props.hasOwnProperty(key))) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelColorGradientSettingsInner, { ...props });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelColorGradientSettingsSelect, { ...props });
};
var panel_color_gradient_settings_default = PanelColorGradientSettings;
;// ./node_modules/@wordpress/icons/build-module/library/aspect-ratio.js
var aspect_ratio_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/constants.js
const MIN_ZOOM = 100;
const MAX_ZOOM = 300;
const constants_POPOVER_PROPS = {
placement: "bottom-start"
};
;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/use-save-image.js
const messages = {
crop: (0,external_wp_i18n_namespaceObject.__)("Image cropped."),
rotate: (0,external_wp_i18n_namespaceObject.__)("Image rotated."),
cropAndRotate: (0,external_wp_i18n_namespaceObject.__)("Image cropped and rotated.")
};
function useSaveImage({
crop,
rotation,
url,
id,
onSaveImage,
onFinishEditing
}) {
const { createErrorNotice, createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const [isInProgress, setIsInProgress] = (0,external_wp_element_namespaceObject.useState)(false);
const { editMediaEntity } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const settings = select(store).getSettings();
return {
editMediaEntity: settings?.[mediaEditKey]
};
}, []);
const cancel = (0,external_wp_element_namespaceObject.useCallback)(() => {
setIsInProgress(false);
onFinishEditing();
}, [onFinishEditing]);
const apply = (0,external_wp_element_namespaceObject.useCallback)(async () => {
if (!editMediaEntity) {
onFinishEditing();
createErrorNotice(
(0,external_wp_i18n_namespaceObject.__)("Sorry, you are not allowed to edit images on this site."),
{
id: "image-editing-error",
type: "snackbar"
}
);
return;
}
setIsInProgress(true);
const modifiers = [];
if (rotation > 0) {
modifiers.push({
type: "rotate",
args: {
angle: rotation
}
});
}
if (crop.width < 99.9 || crop.height < 99.9) {
modifiers.push({
type: "crop",
args: {
left: crop.x,
top: crop.y,
width: crop.width,
height: crop.height
}
});
}
if (modifiers.length === 0) {
setIsInProgress(false);
onFinishEditing();
return;
}
const modifierType = modifiers.length === 1 ? modifiers[0].type : "cropAndRotate";
try {
const savedImage = await editMediaEntity(
id,
{
src: url,
modifiers
},
{ throwOnError: true }
);
if (savedImage) {
onSaveImage({
id: savedImage.id,
url: savedImage.source_url
});
createSuccessNotice(messages[modifierType], {
type: "snackbar",
actions: [
{
label: (0,external_wp_i18n_namespaceObject.__)("Undo"),
onClick: () => {
onSaveImage({
id,
url
});
}
}
]
});
}
} catch (error) {
createErrorNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Error message. */
(0,external_wp_i18n_namespaceObject.__)("Could not edit image. %s"),
(0,external_wp_dom_namespaceObject.__unstableStripHTML)(error.message)
),
{
id: "image-editing-error",
type: "snackbar"
}
);
} finally {
setIsInProgress(false);
onFinishEditing();
}
}, [
crop,
rotation,
id,
url,
onSaveImage,
createErrorNotice,
createSuccessNotice,
onFinishEditing,
editMediaEntity
]);
return (0,external_wp_element_namespaceObject.useMemo)(
() => ({
isInProgress,
apply,
cancel
}),
[isInProgress, apply, cancel]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/use-transform-image.js
function useTransformImage({
url,
naturalWidth,
naturalHeight
}) {
const [editedUrl, setEditedUrl] = (0,external_wp_element_namespaceObject.useState)();
const [crop, setCrop] = (0,external_wp_element_namespaceObject.useState)();
const [position, setPosition] = (0,external_wp_element_namespaceObject.useState)({ x: 0, y: 0 });
const [zoom, setZoom] = (0,external_wp_element_namespaceObject.useState)(100);
const [rotation, setRotation] = (0,external_wp_element_namespaceObject.useState)(0);
const defaultAspect = naturalWidth / naturalHeight;
const [aspect, setAspect] = (0,external_wp_element_namespaceObject.useState)(defaultAspect);
const rotateClockwise = (0,external_wp_element_namespaceObject.useCallback)(() => {
const angle = (rotation + 90) % 360;
let naturalAspectRatio = defaultAspect;
if (rotation % 180 === 90) {
naturalAspectRatio = 1 / defaultAspect;
}
if (angle === 0) {
setEditedUrl();
setRotation(angle);
setAspect(defaultAspect);
setPosition((prevPosition) => ({
x: -(prevPosition.y * naturalAspectRatio),
y: prevPosition.x * naturalAspectRatio
}));
return;
}
function editImage(event) {
const canvas = document.createElement("canvas");
let translateX = 0;
let translateY = 0;
if (angle % 180) {
canvas.width = event.target.height;
canvas.height = event.target.width;
} else {
canvas.width = event.target.width;
canvas.height = event.target.height;
}
if (angle === 90 || angle === 180) {
translateX = canvas.width;
}
if (angle === 270 || angle === 180) {
translateY = canvas.height;
}
const context = canvas.getContext("2d");
context.translate(translateX, translateY);
context.rotate(angle * Math.PI / 180);
context.drawImage(event.target, 0, 0);
canvas.toBlob((blob) => {
setEditedUrl(URL.createObjectURL(blob));
setRotation(angle);
setAspect(canvas.width / canvas.height);
setPosition((prevPosition) => ({
x: -(prevPosition.y * naturalAspectRatio),
y: prevPosition.x * naturalAspectRatio
}));
});
}
const el = new window.Image();
el.src = url;
el.onload = editImage;
const imgCrossOrigin = (0,external_wp_hooks_namespaceObject.applyFilters)(
"media.crossOrigin",
void 0,
url
);
if (typeof imgCrossOrigin === "string") {
el.crossOrigin = imgCrossOrigin;
}
}, [rotation, defaultAspect, url]);
return (0,external_wp_element_namespaceObject.useMemo)(
() => ({
editedUrl,
setEditedUrl,
crop,
setCrop,
position,
setPosition,
zoom,
setZoom,
rotation,
setRotation,
rotateClockwise,
aspect,
setAspect,
defaultAspect
}),
[
editedUrl,
crop,
position,
zoom,
rotation,
rotateClockwise,
aspect,
defaultAspect
]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/context.js
const ImageEditingContext = (0,external_wp_element_namespaceObject.createContext)({});
ImageEditingContext.displayName = "ImageEditingContext";
const useImageEditingContext = () => (0,external_wp_element_namespaceObject.useContext)(ImageEditingContext);
function ImageEditingProvider({
id,
url,
naturalWidth,
naturalHeight,
onFinishEditing,
onSaveImage,
children
}) {
const transformImage = useTransformImage({
url,
naturalWidth,
naturalHeight
});
const saveImage = useSaveImage({
id,
url,
onSaveImage,
onFinishEditing,
...transformImage
});
const providerValue = (0,external_wp_element_namespaceObject.useMemo)(
() => ({
...transformImage,
...saveImage
}),
[transformImage, saveImage]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ImageEditingContext.Provider, { value: providerValue, children });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/aspect-ratio-dropdown.js
function AspectRatioGroup({
aspectRatios,
isDisabled,
label,
onClick,
value
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { label, children: aspectRatios.map(({ name, slug, ratio }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
disabled: isDisabled,
onClick: () => {
onClick(ratio);
},
role: "menuitemradio",
isSelected: ratio === value,
icon: ratio === value ? check_check_default : void 0,
children: name
},
slug
)) });
}
function ratioToNumber(str) {
const [a, b, ...rest] = str.split("/").map(Number);
if (a <= 0 || b <= 0 || Number.isNaN(a) || Number.isNaN(b) || rest.length) {
return NaN;
}
return b ? a / b : a;
}
function presetRatioAsNumber({ ratio, ...rest }) {
return {
ratio: ratioToNumber(ratio),
...rest
};
}
function AspectRatioDropdown({ toggleProps }) {
const { isInProgress, aspect, setAspect, defaultAspect } = useImageEditingContext();
const [defaultRatios, themeRatios, showDefaultRatios] = use_settings_useSettings(
"dimensions.aspectRatios.default",
"dimensions.aspectRatios.theme",
"dimensions.defaultAspectRatios"
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropdownMenu,
{
icon: aspect_ratio_default,
label: (0,external_wp_i18n_namespaceObject.__)("Aspect Ratio"),
popoverProps: constants_POPOVER_PROPS,
toggleProps,
children: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
AspectRatioGroup,
{
isDisabled: isInProgress,
onClick: (newAspect) => {
setAspect(newAspect);
onClose();
},
value: aspect,
aspectRatios: [
// All ratios should be mirrored in AspectRatioTool in @wordpress/block-editor.
{
slug: "original",
name: (0,external_wp_i18n_namespaceObject.__)("Original"),
ratio: defaultAspect
},
...showDefaultRatios ? defaultRatios.map(presetRatioAsNumber).filter(({ ratio }) => ratio === 1) : []
]
}
),
themeRatios?.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
AspectRatioGroup,
{
label: (0,external_wp_i18n_namespaceObject.__)("Theme"),
isDisabled: isInProgress,
onClick: (newAspect) => {
setAspect(newAspect);
onClose();
},
value: aspect,
aspectRatios: themeRatios
}
),
showDefaultRatios && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
AspectRatioGroup,
{
label: (0,external_wp_i18n_namespaceObject.__)("Landscape"),
isDisabled: isInProgress,
onClick: (newAspect) => {
setAspect(newAspect);
onClose();
},
value: aspect,
aspectRatios: defaultRatios.map(presetRatioAsNumber).filter(({ ratio }) => ratio > 1)
}
),
showDefaultRatios && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
AspectRatioGroup,
{
label: (0,external_wp_i18n_namespaceObject.__)("Portrait"),
isDisabled: isInProgress,
onClick: (newAspect) => {
setAspect(newAspect);
onClose();
},
value: aspect,
aspectRatios: defaultRatios.map(presetRatioAsNumber).filter(({ ratio }) => ratio < 1)
}
)
] })
}
);
}
;// ./node_modules/tslib/tslib.es6.mjs
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
}
return __assign.apply(this, arguments);
}
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
}
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
var _, done = false;
for (var i = decorators.length - 1; i >= 0; i--) {
var context = {};
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
if (kind === "accessor") {
if (result === void 0) continue;
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
if (_ = accept(result.get)) descriptor.get = _;
if (_ = accept(result.set)) descriptor.set = _;
if (_ = accept(result.init)) initializers.unshift(_);
}
else if (_ = accept(result)) {
if (kind === "field") initializers.unshift(_);
else descriptor[key] = _;
}
}
if (target) Object.defineProperty(target, contextIn.name, descriptor);
done = true;
};
function __runInitializers(thisArg, initializers, value) {
var useValue = arguments.length > 2;
for (var i = 0; i < initializers.length; i++) {
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
}
return useValue ? value : void 0;
};
function __propKey(x) {
return typeof x === "symbol" ? x : "".concat(x);
};
function __setFunctionName(f, name, prefix) {
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
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;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
var __createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
});
function __exportStar(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
}
/** @deprecated */
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
/** @deprecated */
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}
function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}
function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
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);
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); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}
function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __setModuleDefault = Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
};
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
}
function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
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");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
function __classPrivateFieldSet(receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
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");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}
function __classPrivateFieldIn(state, receiver) {
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
return typeof state === "function" ? receiver === state : state.has(receiver);
}
function __addDisposableResource(env, value, async) {
if (value !== null && value !== void 0) {
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
var dispose, inner;
if (async) {
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
dispose = value[Symbol.asyncDispose];
}
if (dispose === void 0) {
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
dispose = value[Symbol.dispose];
if (async) inner = dispose;
}
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
env.stack.push({ value: value, dispose: dispose, async: async });
}
else if (async) {
env.stack.push({ async: true });
}
return value;
}
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
function __disposeResources(env) {
function fail(e) {
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
env.hasError = true;
}
var r, s = 0;
function next() {
while (r = env.stack.pop()) {
try {
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
if (r.dispose) {
var result = r.dispose.call(r.value);
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
}
else s |= 1;
}
catch (e) {
fail(e);
}
}
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
if (env.hasError) throw env.error;
}
return next();
}
function __rewriteRelativeImportExtension(path, preserveJsx) {
if (typeof path === "string" && /^\.\.?\//.test(path)) {
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
});
}
return path;
}
/* harmony default export */ const tslib_es6 = ({
__extends,
__assign,
__rest,
__decorate,
__param,
__esDecorate,
__runInitializers,
__propKey,
__setFunctionName,
__metadata,
__awaiter,
__generator,
__createBinding,
__exportStar,
__values,
__read,
__spread,
__spreadArrays,
__spreadArray,
__await,
__asyncGenerator,
__asyncDelegator,
__asyncValues,
__makeTemplateObject,
__importStar,
__importDefault,
__classPrivateFieldGet,
__classPrivateFieldSet,
__classPrivateFieldIn,
__addDisposableResource,
__disposeResources,
__rewriteRelativeImportExtension,
});
// EXTERNAL MODULE: ./node_modules/normalize-wheel/index.js
var normalize_wheel = __webpack_require__(7520);
var normalize_wheel_default = /*#__PURE__*/__webpack_require__.n(normalize_wheel);
;// ./node_modules/react-easy-crop/index.module.js
/**
* Compute the dimension of the crop area based on media size,
* aspect ratio and optionally rotation
*/
function getCropSize(mediaWidth, mediaHeight, containerWidth, containerHeight, aspect, rotation) {
if (rotation === void 0) {
rotation = 0;
}
var _a = rotateSize(mediaWidth, mediaHeight, rotation),
width = _a.width,
height = _a.height;
var fittingWidth = Math.min(width, containerWidth);
var fittingHeight = Math.min(height, containerHeight);
if (fittingWidth > fittingHeight * aspect) {
return {
width: fittingHeight * aspect,
height: fittingHeight
};
}
return {
width: fittingWidth,
height: fittingWidth / aspect
};
}
/**
* Compute media zoom.
* We fit the media into the container with "max-width: 100%; max-height: 100%;"
*/
function getMediaZoom(mediaSize) {
// Take the axis with more pixels to improve accuracy
return mediaSize.width > mediaSize.height ? mediaSize.width / mediaSize.naturalWidth : mediaSize.height / mediaSize.naturalHeight;
}
/**
* Ensure a new media position stays in the crop area.
*/
function restrictPosition(position, mediaSize, cropSize, zoom, rotation) {
if (rotation === void 0) {
rotation = 0;
}
var _a = rotateSize(mediaSize.width, mediaSize.height, rotation),
width = _a.width,
height = _a.height;
return {
x: restrictPositionCoord(position.x, width, cropSize.width, zoom),
y: restrictPositionCoord(position.y, height, cropSize.height, zoom)
};
}
function restrictPositionCoord(position, mediaSize, cropSize, zoom) {
var maxPosition = mediaSize * zoom / 2 - cropSize / 2;
return clamp(position, -maxPosition, maxPosition);
}
function getDistanceBetweenPoints(pointA, pointB) {
return Math.sqrt(Math.pow(pointA.y - pointB.y, 2) + Math.pow(pointA.x - pointB.x, 2));
}
function getRotationBetweenPoints(pointA, pointB) {
return Math.atan2(pointB.y - pointA.y, pointB.x - pointA.x) * 180 / Math.PI;
}
/**
* Compute the output cropped area of the media in percentages and pixels.
* x/y are the top-left coordinates on the src media
*/
function computeCroppedArea(crop, mediaSize, cropSize, aspect, zoom, rotation, restrictPosition) {
if (rotation === void 0) {
rotation = 0;
}
if (restrictPosition === void 0) {
restrictPosition = true;
}
// if the media is rotated by the user, we cannot limit the position anymore
// as it might need to be negative.
var limitAreaFn = restrictPosition ? limitArea : noOp;
var mediaBBoxSize = rotateSize(mediaSize.width, mediaSize.height, rotation);
var mediaNaturalBBoxSize = rotateSize(mediaSize.naturalWidth, mediaSize.naturalHeight, rotation);
// calculate the crop area in percentages
// in the rotated space
var croppedAreaPercentages = {
x: limitAreaFn(100, ((mediaBBoxSize.width - cropSize.width / zoom) / 2 - crop.x / zoom) / mediaBBoxSize.width * 100),
y: limitAreaFn(100, ((mediaBBoxSize.height - cropSize.height / zoom) / 2 - crop.y / zoom) / mediaBBoxSize.height * 100),
width: limitAreaFn(100, cropSize.width / mediaBBoxSize.width * 100 / zoom),
height: limitAreaFn(100, cropSize.height / mediaBBoxSize.height * 100 / zoom)
};
// we compute the pixels size naively
var widthInPixels = Math.round(limitAreaFn(mediaNaturalBBoxSize.width, croppedAreaPercentages.width * mediaNaturalBBoxSize.width / 100));
var heightInPixels = Math.round(limitAreaFn(mediaNaturalBBoxSize.height, croppedAreaPercentages.height * mediaNaturalBBoxSize.height / 100));
var isImgWiderThanHigh = mediaNaturalBBoxSize.width >= mediaNaturalBBoxSize.height * aspect;
// then we ensure the width and height exactly match the aspect (to avoid rounding approximations)
// if the media is wider than high, when zoom is 0, the crop height will be equals to image height
// thus we want to compute the width from the height and aspect for accuracy.
// Otherwise, we compute the height from width and aspect.
var sizePixels = isImgWiderThanHigh ? {
width: Math.round(heightInPixels * aspect),
height: heightInPixels
} : {
width: widthInPixels,
height: Math.round(widthInPixels / aspect)
};
var croppedAreaPixels = __assign(__assign({}, sizePixels), {
x: Math.round(limitAreaFn(mediaNaturalBBoxSize.width - sizePixels.width, croppedAreaPercentages.x * mediaNaturalBBoxSize.width / 100)),
y: Math.round(limitAreaFn(mediaNaturalBBoxSize.height - sizePixels.height, croppedAreaPercentages.y * mediaNaturalBBoxSize.height / 100))
});
return {
croppedAreaPercentages: croppedAreaPercentages,
croppedAreaPixels: croppedAreaPixels
};
}
/**
* Ensure the returned value is between 0 and max
*/
function limitArea(max, value) {
return Math.min(max, Math.max(0, value));
}
function noOp(_max, value) {
return value;
}
/**
* Compute crop and zoom from the croppedAreaPercentages.
*/
function getInitialCropFromCroppedAreaPercentages(croppedAreaPercentages, mediaSize, rotation, cropSize, minZoom, maxZoom) {
var mediaBBoxSize = rotateSize(mediaSize.width, mediaSize.height, rotation);
// This is the inverse process of computeCroppedArea
var zoom = clamp(cropSize.width / mediaBBoxSize.width * (100 / croppedAreaPercentages.width), minZoom, maxZoom);
var crop = {
x: zoom * mediaBBoxSize.width / 2 - cropSize.width / 2 - mediaBBoxSize.width * zoom * (croppedAreaPercentages.x / 100),
y: zoom * mediaBBoxSize.height / 2 - cropSize.height / 2 - mediaBBoxSize.height * zoom * (croppedAreaPercentages.y / 100)
};
return {
crop: crop,
zoom: zoom
};
}
/**
* Compute zoom from the croppedAreaPixels
*/
function getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize) {
var mediaZoom = getMediaZoom(mediaSize);
return cropSize.height > cropSize.width ? cropSize.height / (croppedAreaPixels.height * mediaZoom) : cropSize.width / (croppedAreaPixels.width * mediaZoom);
}
/**
* Compute crop and zoom from the croppedAreaPixels
*/
function getInitialCropFromCroppedAreaPixels(croppedAreaPixels, mediaSize, rotation, cropSize, minZoom, maxZoom) {
if (rotation === void 0) {
rotation = 0;
}
var mediaNaturalBBoxSize = rotateSize(mediaSize.naturalWidth, mediaSize.naturalHeight, rotation);
var zoom = clamp(getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize), minZoom, maxZoom);
var cropZoom = cropSize.height > cropSize.width ? cropSize.height / croppedAreaPixels.height : cropSize.width / croppedAreaPixels.width;
var crop = {
x: ((mediaNaturalBBoxSize.width - croppedAreaPixels.width) / 2 - croppedAreaPixels.x) * cropZoom,
y: ((mediaNaturalBBoxSize.height - croppedAreaPixels.height) / 2 - croppedAreaPixels.y) * cropZoom
};
return {
crop: crop,
zoom: zoom
};
}
/**
* Return the point that is the center of point a and b
*/
function getCenter(a, b) {
return {
x: (b.x + a.x) / 2,
y: (b.y + a.y) / 2
};
}
function getRadianAngle(degreeValue) {
return degreeValue * Math.PI / 180;
}
/**
* Returns the new bounding area of a rotated rectangle.
*/
function rotateSize(width, height, rotation) {
var rotRad = getRadianAngle(rotation);
return {
width: Math.abs(Math.cos(rotRad) * width) + Math.abs(Math.sin(rotRad) * height),
height: Math.abs(Math.sin(rotRad) * width) + Math.abs(Math.cos(rotRad) * height)
};
}
/**
* Clamp value between min and max
*/
function clamp(value, min, max) {
return Math.min(Math.max(value, min), max);
}
/**
* Combine multiple class names into a single string.
*/
function classNames() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return args.filter(function (value) {
if (typeof value === 'string' && value.length > 0) {
return true;
}
return false;
}).join(' ').trim();
}
var css_248z = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n";
var index_module_MIN_ZOOM = 1;
var index_module_MAX_ZOOM = 3;
var Cropper = /** @class */function (_super) {
__extends(Cropper, _super);
function Cropper() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.imageRef = external_React_.createRef();
_this.videoRef = external_React_.createRef();
_this.containerPosition = {
x: 0,
y: 0
};
_this.containerRef = null;
_this.styleRef = null;
_this.containerRect = null;
_this.mediaSize = {
width: 0,
height: 0,
naturalWidth: 0,
naturalHeight: 0
};
_this.dragStartPosition = {
x: 0,
y: 0
};
_this.dragStartCrop = {
x: 0,
y: 0
};
_this.gestureZoomStart = 0;
_this.gestureRotationStart = 0;
_this.isTouching = false;
_this.lastPinchDistance = 0;
_this.lastPinchRotation = 0;
_this.rafDragTimeout = null;
_this.rafPinchTimeout = null;
_this.wheelTimer = null;
_this.currentDoc = typeof document !== 'undefined' ? document : null;
_this.currentWindow = typeof window !== 'undefined' ? window : null;
_this.resizeObserver = null;
_this.state = {
cropSize: null,
hasWheelJustStarted: false,
mediaObjectFit: undefined
};
_this.initResizeObserver = function () {
if (typeof window.ResizeObserver === 'undefined' || !_this.containerRef) {
return;
}
var isFirstResize = true;
_this.resizeObserver = new window.ResizeObserver(function (entries) {
if (isFirstResize) {
isFirstResize = false; // observe() is called on mount, we don't want to trigger a recompute on mount
return;
}
_this.computeSizes();
});
_this.resizeObserver.observe(_this.containerRef);
};
// this is to prevent Safari on iOS >= 10 to zoom the page
_this.preventZoomSafari = function (e) {
return e.preventDefault();
};
_this.cleanEvents = function () {
if (!_this.currentDoc) return;
_this.currentDoc.removeEventListener('mousemove', _this.onMouseMove);
_this.currentDoc.removeEventListener('mouseup', _this.onDragStopped);
_this.currentDoc.removeEventListener('touchmove', _this.onTouchMove);
_this.currentDoc.removeEventListener('touchend', _this.onDragStopped);
_this.currentDoc.removeEventListener('gesturemove', _this.onGestureMove);
_this.currentDoc.removeEventListener('gestureend', _this.onGestureEnd);
_this.currentDoc.removeEventListener('scroll', _this.onScroll);
};
_this.clearScrollEvent = function () {
if (_this.containerRef) _this.containerRef.removeEventListener('wheel', _this.onWheel);
if (_this.wheelTimer) {
clearTimeout(_this.wheelTimer);
}
};
_this.onMediaLoad = function () {
var cropSize = _this.computeSizes();
if (cropSize) {
_this.emitCropData();
_this.setInitialCrop(cropSize);
}
if (_this.props.onMediaLoaded) {
_this.props.onMediaLoaded(_this.mediaSize);
}
};
_this.setInitialCrop = function (cropSize) {
if (_this.props.initialCroppedAreaPercentages) {
var _a = getInitialCropFromCroppedAreaPercentages(_this.props.initialCroppedAreaPercentages, _this.mediaSize, _this.props.rotation, cropSize, _this.props.minZoom, _this.props.maxZoom),
crop = _a.crop,
zoom = _a.zoom;
_this.props.onCropChange(crop);
_this.props.onZoomChange && _this.props.onZoomChange(zoom);
} else if (_this.props.initialCroppedAreaPixels) {
var _b = getInitialCropFromCroppedAreaPixels(_this.props.initialCroppedAreaPixels, _this.mediaSize, _this.props.rotation, cropSize, _this.props.minZoom, _this.props.maxZoom),
crop = _b.crop,
zoom = _b.zoom;
_this.props.onCropChange(crop);
_this.props.onZoomChange && _this.props.onZoomChange(zoom);
}
};
_this.computeSizes = function () {
var _a, _b, _c, _d, _e, _f;
var mediaRef = _this.imageRef.current || _this.videoRef.current;
if (mediaRef && _this.containerRef) {
_this.containerRect = _this.containerRef.getBoundingClientRect();
_this.saveContainerPosition();
var containerAspect = _this.containerRect.width / _this.containerRect.height;
var naturalWidth = ((_a = _this.imageRef.current) === null || _a === void 0 ? void 0 : _a.naturalWidth) || ((_b = _this.videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) || 0;
var naturalHeight = ((_c = _this.imageRef.current) === null || _c === void 0 ? void 0 : _c.naturalHeight) || ((_d = _this.videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) || 0;
var isMediaScaledDown = mediaRef.offsetWidth < naturalWidth || mediaRef.offsetHeight < naturalHeight;
var mediaAspect = naturalWidth / naturalHeight;
// We do not rely on the offsetWidth/offsetHeight if the media is scaled down
// as the values they report are rounded. That will result in precision losses
// when calculating zoom. We use the fact that the media is positionned relative
// to the container. That allows us to use the container's dimensions
// and natural aspect ratio of the media to calculate accurate media size.
// However, for this to work, the container should not be rotated
var renderedMediaSize = void 0;
if (isMediaScaledDown) {
switch (_this.state.mediaObjectFit) {
default:
case 'contain':
renderedMediaSize = containerAspect > mediaAspect ? {
width: _this.containerRect.height * mediaAspect,
height: _this.containerRect.height
} : {
width: _this.containerRect.width,
height: _this.containerRect.width / mediaAspect
};
break;
case 'horizontal-cover':
renderedMediaSize = {
width: _this.containerRect.width,
height: _this.containerRect.width / mediaAspect
};
break;
case 'vertical-cover':
renderedMediaSize = {
width: _this.containerRect.height * mediaAspect,
height: _this.containerRect.height
};
break;
}
} else {
renderedMediaSize = {
width: mediaRef.offsetWidth,
height: mediaRef.offsetHeight
};
}
_this.mediaSize = __assign(__assign({}, renderedMediaSize), {
naturalWidth: naturalWidth,
naturalHeight: naturalHeight
});
// set media size in the parent
if (_this.props.setMediaSize) {
_this.props.setMediaSize(_this.mediaSize);
}
var cropSize = _this.props.cropSize ? _this.props.cropSize : getCropSize(_this.mediaSize.width, _this.mediaSize.height, _this.containerRect.width, _this.containerRect.height, _this.props.aspect, _this.props.rotation);
if (((_e = _this.state.cropSize) === null || _e === void 0 ? void 0 : _e.height) !== cropSize.height || ((_f = _this.state.cropSize) === null || _f === void 0 ? void 0 : _f.width) !== cropSize.width) {
_this.props.onCropSizeChange && _this.props.onCropSizeChange(cropSize);
}
_this.setState({
cropSize: cropSize
}, _this.recomputeCropPosition);
// pass crop size to parent
if (_this.props.setCropSize) {
_this.props.setCropSize(cropSize);
}
return cropSize;
}
};
_this.saveContainerPosition = function () {
if (_this.containerRef) {
var bounds = _this.containerRef.getBoundingClientRect();
_this.containerPosition = {
x: bounds.left,
y: bounds.top
};
}
};
_this.onMouseDown = function (e) {
if (!_this.currentDoc) return;
e.preventDefault();
_this.currentDoc.addEventListener('mousemove', _this.onMouseMove);
_this.currentDoc.addEventListener('mouseup', _this.onDragStopped);
_this.saveContainerPosition();
_this.onDragStart(Cropper.getMousePoint(e));
};
_this.onMouseMove = function (e) {
return _this.onDrag(Cropper.getMousePoint(e));
};
_this.onScroll = function (e) {
if (!_this.currentDoc) return;
e.preventDefault();
_this.saveContainerPosition();
};
_this.onTouchStart = function (e) {
if (!_this.currentDoc) return;
_this.isTouching = true;
if (_this.props.onTouchRequest && !_this.props.onTouchRequest(e)) {
return;
}
_this.currentDoc.addEventListener('touchmove', _this.onTouchMove, {
passive: false
}); // iOS 11 now defaults to passive: true
_this.currentDoc.addEventListener('touchend', _this.onDragStopped);
_this.saveContainerPosition();
if (e.touches.length === 2) {
_this.onPinchStart(e);
} else if (e.touches.length === 1) {
_this.onDragStart(Cropper.getTouchPoint(e.touches[0]));
}
};
_this.onTouchMove = function (e) {
// Prevent whole page from scrolling on iOS.
e.preventDefault();
if (e.touches.length === 2) {
_this.onPinchMove(e);
} else if (e.touches.length === 1) {
_this.onDrag(Cropper.getTouchPoint(e.touches[0]));
}
};
_this.onGestureStart = function (e) {
if (!_this.currentDoc) return;
e.preventDefault();
_this.currentDoc.addEventListener('gesturechange', _this.onGestureMove);
_this.currentDoc.addEventListener('gestureend', _this.onGestureEnd);
_this.gestureZoomStart = _this.props.zoom;
_this.gestureRotationStart = _this.props.rotation;
};
_this.onGestureMove = function (e) {
e.preventDefault();
if (_this.isTouching) {
// this is to avoid conflict between gesture and touch events
return;
}
var point = Cropper.getMousePoint(e);
var newZoom = _this.gestureZoomStart - 1 + e.scale;
_this.setNewZoom(newZoom, point, {
shouldUpdatePosition: true
});
if (_this.props.onRotationChange) {
var newRotation = _this.gestureRotationStart + e.rotation;
_this.props.onRotationChange(newRotation);
}
};
_this.onGestureEnd = function (e) {
_this.cleanEvents();
};
_this.onDragStart = function (_a) {
var _b, _c;
var x = _a.x,
y = _a.y;
_this.dragStartPosition = {
x: x,
y: y
};
_this.dragStartCrop = __assign({}, _this.props.crop);
(_c = (_b = _this.props).onInteractionStart) === null || _c === void 0 ? void 0 : _c.call(_b);
};
_this.onDrag = function (_a) {
var x = _a.x,
y = _a.y;
if (!_this.currentWindow) return;
if (_this.rafDragTimeout) _this.currentWindow.cancelAnimationFrame(_this.rafDragTimeout);
_this.rafDragTimeout = _this.currentWindow.requestAnimationFrame(function () {
if (!_this.state.cropSize) return;
if (x === undefined || y === undefined) return;
var offsetX = x - _this.dragStartPosition.x;
var offsetY = y - _this.dragStartPosition.y;
var requestedPosition = {
x: _this.dragStartCrop.x + offsetX,
y: _this.dragStartCrop.y + offsetY
};
var newPosition = _this.props.restrictPosition ? restrictPosition(requestedPosition, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : requestedPosition;
_this.props.onCropChange(newPosition);
});
};
_this.onDragStopped = function () {
var _a, _b;
_this.isTouching = false;
_this.cleanEvents();
_this.emitCropData();
(_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a);
};
_this.onWheel = function (e) {
if (!_this.currentWindow) return;
if (_this.props.onWheelRequest && !_this.props.onWheelRequest(e)) {
return;
}
e.preventDefault();
var point = Cropper.getMousePoint(e);
var pixelY = normalize_wheel_default()(e).pixelY;
var newZoom = _this.props.zoom - pixelY * _this.props.zoomSpeed / 200;
_this.setNewZoom(newZoom, point, {
shouldUpdatePosition: true
});
if (!_this.state.hasWheelJustStarted) {
_this.setState({
hasWheelJustStarted: true
}, function () {
var _a, _b;
return (_b = (_a = _this.props).onInteractionStart) === null || _b === void 0 ? void 0 : _b.call(_a);
});
}
if (_this.wheelTimer) {
clearTimeout(_this.wheelTimer);
}
_this.wheelTimer = _this.currentWindow.setTimeout(function () {
return _this.setState({
hasWheelJustStarted: false
}, function () {
var _a, _b;
return (_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a);
});
}, 250);
};
_this.getPointOnContainer = function (_a, containerTopLeft) {
var x = _a.x,
y = _a.y;
if (!_this.containerRect) {
throw new Error('The Cropper is not mounted');
}
return {
x: _this.containerRect.width / 2 - (x - containerTopLeft.x),
y: _this.containerRect.height / 2 - (y - containerTopLeft.y)
};
};
_this.getPointOnMedia = function (_a) {
var x = _a.x,
y = _a.y;
var _b = _this.props,
crop = _b.crop,
zoom = _b.zoom;
return {
x: (x + crop.x) / zoom,
y: (y + crop.y) / zoom
};
};
_this.setNewZoom = function (zoom, point, _a) {
var _b = _a === void 0 ? {} : _a,
_c = _b.shouldUpdatePosition,
shouldUpdatePosition = _c === void 0 ? true : _c;
if (!_this.state.cropSize || !_this.props.onZoomChange) return;
var newZoom = clamp(zoom, _this.props.minZoom, _this.props.maxZoom);
if (shouldUpdatePosition) {
var zoomPoint = _this.getPointOnContainer(point, _this.containerPosition);
var zoomTarget = _this.getPointOnMedia(zoomPoint);
var requestedPosition = {
x: zoomTarget.x * newZoom - zoomPoint.x,
y: zoomTarget.y * newZoom - zoomPoint.y
};
var newPosition = _this.props.restrictPosition ? restrictPosition(requestedPosition, _this.mediaSize, _this.state.cropSize, newZoom, _this.props.rotation) : requestedPosition;
_this.props.onCropChange(newPosition);
}
_this.props.onZoomChange(newZoom);
};
_this.getCropData = function () {
if (!_this.state.cropSize) {
return null;
}
// this is to ensure the crop is correctly restricted after a zoom back (https://github.com/ValentinH/react-easy-crop/issues/6)
var restrictedPosition = _this.props.restrictPosition ? restrictPosition(_this.props.crop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : _this.props.crop;
return computeCroppedArea(restrictedPosition, _this.mediaSize, _this.state.cropSize, _this.getAspect(), _this.props.zoom, _this.props.rotation, _this.props.restrictPosition);
};
_this.emitCropData = function () {
var cropData = _this.getCropData();
if (!cropData) return;
var croppedAreaPercentages = cropData.croppedAreaPercentages,
croppedAreaPixels = cropData.croppedAreaPixels;
if (_this.props.onCropComplete) {
_this.props.onCropComplete(croppedAreaPercentages, croppedAreaPixels);
}
if (_this.props.onCropAreaChange) {
_this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels);
}
};
_this.emitCropAreaChange = function () {
var cropData = _this.getCropData();
if (!cropData) return;
var croppedAreaPercentages = cropData.croppedAreaPercentages,
croppedAreaPixels = cropData.croppedAreaPixels;
if (_this.props.onCropAreaChange) {
_this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels);
}
};
_this.recomputeCropPosition = function () {
if (!_this.state.cropSize) return;
var newPosition = _this.props.restrictPosition ? restrictPosition(_this.props.crop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : _this.props.crop;
_this.props.onCropChange(newPosition);
_this.emitCropData();
};
return _this;
}
Cropper.prototype.componentDidMount = function () {
if (!this.currentDoc || !this.currentWindow) return;
if (this.containerRef) {
if (this.containerRef.ownerDocument) {
this.currentDoc = this.containerRef.ownerDocument;
}
if (this.currentDoc.defaultView) {
this.currentWindow = this.currentDoc.defaultView;
}
this.initResizeObserver();
// only add window resize listener if ResizeObserver is not supported. Otherwise, it would be redundant
if (typeof window.ResizeObserver === 'undefined') {
this.currentWindow.addEventListener('resize', this.computeSizes);
}
this.props.zoomWithScroll && this.containerRef.addEventListener('wheel', this.onWheel, {
passive: false
});
this.containerRef.addEventListener('gesturestart', this.onGestureStart);
}
this.currentDoc.addEventListener('scroll', this.onScroll);
if (!this.props.disableAutomaticStylesInjection) {
this.styleRef = this.currentDoc.createElement('style');
this.styleRef.setAttribute('type', 'text/css');
if (this.props.nonce) {
this.styleRef.setAttribute('nonce', this.props.nonce);
}
this.styleRef.innerHTML = css_248z;
this.currentDoc.head.appendChild(this.styleRef);
}
// when rendered via SSR, the image can already be loaded and its onLoad callback will never be called
if (this.imageRef.current && this.imageRef.current.complete) {
this.onMediaLoad();
}
// set image and video refs in the parent if the callbacks exist
if (this.props.setImageRef) {
this.props.setImageRef(this.imageRef);
}
if (this.props.setVideoRef) {
this.props.setVideoRef(this.videoRef);
}
};
Cropper.prototype.componentWillUnmount = function () {
var _a, _b;
if (!this.currentDoc || !this.currentWindow) return;
if (typeof window.ResizeObserver === 'undefined') {
this.currentWindow.removeEventListener('resize', this.computeSizes);
}
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
if (this.containerRef) {
this.containerRef.removeEventListener('gesturestart', this.preventZoomSafari);
}
if (this.styleRef) {
(_b = this.styleRef.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(this.styleRef);
}
this.cleanEvents();
this.props.zoomWithScroll && this.clearScrollEvent();
};
Cropper.prototype.componentDidUpdate = function (prevProps) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
if (prevProps.rotation !== this.props.rotation) {
this.computeSizes();
this.recomputeCropPosition();
} else if (prevProps.aspect !== this.props.aspect) {
this.computeSizes();
} else if (prevProps.objectFit !== this.props.objectFit) {
this.computeSizes();
} else if (prevProps.zoom !== this.props.zoom) {
this.recomputeCropPosition();
} else if (((_a = prevProps.cropSize) === null || _a === void 0 ? void 0 : _a.height) !== ((_b = this.props.cropSize) === null || _b === void 0 ? void 0 : _b.height) || ((_c = prevProps.cropSize) === null || _c === void 0 ? void 0 : _c.width) !== ((_d = this.props.cropSize) === null || _d === void 0 ? void 0 : _d.width)) {
this.computeSizes();
} else if (((_e = prevProps.crop) === null || _e === void 0 ? void 0 : _e.x) !== ((_f = this.props.crop) === null || _f === void 0 ? void 0 : _f.x) || ((_g = prevProps.crop) === null || _g === void 0 ? void 0 : _g.y) !== ((_h = this.props.crop) === null || _h === void 0 ? void 0 : _h.y)) {
this.emitCropAreaChange();
}
if (prevProps.zoomWithScroll !== this.props.zoomWithScroll && this.containerRef) {
this.props.zoomWithScroll ? this.containerRef.addEventListener('wheel', this.onWheel, {
passive: false
}) : this.clearScrollEvent();
}
if (prevProps.video !== this.props.video) {
(_j = this.videoRef.current) === null || _j === void 0 ? void 0 : _j.load();
}
var objectFit = this.getObjectFit();
if (objectFit !== this.state.mediaObjectFit) {
this.setState({
mediaObjectFit: objectFit
}, this.computeSizes);
}
};
Cropper.prototype.getAspect = function () {
var _a = this.props,
cropSize = _a.cropSize,
aspect = _a.aspect;
if (cropSize) {
return cropSize.width / cropSize.height;
}
return aspect;
};
Cropper.prototype.getObjectFit = function () {
var _a, _b, _c, _d;
if (this.props.objectFit === 'cover') {
var mediaRef = this.imageRef.current || this.videoRef.current;
if (mediaRef && this.containerRef) {
this.containerRect = this.containerRef.getBoundingClientRect();
var containerAspect = this.containerRect.width / this.containerRect.height;
var naturalWidth = ((_a = this.imageRef.current) === null || _a === void 0 ? void 0 : _a.naturalWidth) || ((_b = this.videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) || 0;
var naturalHeight = ((_c = this.imageRef.current) === null || _c === void 0 ? void 0 : _c.naturalHeight) || ((_d = this.videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) || 0;
var mediaAspect = naturalWidth / naturalHeight;
return mediaAspect < containerAspect ? 'horizontal-cover' : 'vertical-cover';
}
return 'horizontal-cover';
}
return this.props.objectFit;
};
Cropper.prototype.onPinchStart = function (e) {
var pointA = Cropper.getTouchPoint(e.touches[0]);
var pointB = Cropper.getTouchPoint(e.touches[1]);
this.lastPinchDistance = getDistanceBetweenPoints(pointA, pointB);
this.lastPinchRotation = getRotationBetweenPoints(pointA, pointB);
this.onDragStart(getCenter(pointA, pointB));
};
Cropper.prototype.onPinchMove = function (e) {
var _this = this;
if (!this.currentDoc || !this.currentWindow) return;
var pointA = Cropper.getTouchPoint(e.touches[0]);
var pointB = Cropper.getTouchPoint(e.touches[1]);
var center = getCenter(pointA, pointB);
this.onDrag(center);
if (this.rafPinchTimeout) this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout);
this.rafPinchTimeout = this.currentWindow.requestAnimationFrame(function () {
var distance = getDistanceBetweenPoints(pointA, pointB);
var newZoom = _this.props.zoom * (distance / _this.lastPinchDistance);
_this.setNewZoom(newZoom, center, {
shouldUpdatePosition: false
});
_this.lastPinchDistance = distance;
var rotation = getRotationBetweenPoints(pointA, pointB);
var newRotation = _this.props.rotation + (rotation - _this.lastPinchRotation);
_this.props.onRotationChange && _this.props.onRotationChange(newRotation);
_this.lastPinchRotation = rotation;
});
};
Cropper.prototype.render = function () {
var _this = this;
var _a = this.props,
image = _a.image,
video = _a.video,
mediaProps = _a.mediaProps,
transform = _a.transform,
_b = _a.crop,
x = _b.x,
y = _b.y,
rotation = _a.rotation,
zoom = _a.zoom,
cropShape = _a.cropShape,
showGrid = _a.showGrid,
_c = _a.style,
containerStyle = _c.containerStyle,
cropAreaStyle = _c.cropAreaStyle,
mediaStyle = _c.mediaStyle,
_d = _a.classes,
containerClassName = _d.containerClassName,
cropAreaClassName = _d.cropAreaClassName,
mediaClassName = _d.mediaClassName;
var objectFit = this.state.mediaObjectFit;
return external_React_.createElement("div", {
onMouseDown: this.onMouseDown,
onTouchStart: this.onTouchStart,
ref: function ref(el) {
return _this.containerRef = el;
},
"data-testid": "container",
style: containerStyle,
className: classNames('reactEasyCrop_Container', containerClassName)
}, image ? external_React_.createElement("img", __assign({
alt: "",
className: classNames('reactEasyCrop_Image', objectFit === 'contain' && 'reactEasyCrop_Contain', objectFit === 'horizontal-cover' && 'reactEasyCrop_Cover_Horizontal', objectFit === 'vertical-cover' && 'reactEasyCrop_Cover_Vertical', mediaClassName)
}, mediaProps, {
src: image,
ref: this.imageRef,
style: __assign(__assign({}, mediaStyle), {
transform: transform || "translate(".concat(x, "px, ").concat(y, "px) rotate(").concat(rotation, "deg) scale(").concat(zoom, ")")
}),
onLoad: this.onMediaLoad
})) : video && external_React_.createElement("video", __assign({
autoPlay: true,
loop: true,
muted: true,
className: classNames('reactEasyCrop_Video', objectFit === 'contain' && 'reactEasyCrop_Contain', objectFit === 'horizontal-cover' && 'reactEasyCrop_Cover_Horizontal', objectFit === 'vertical-cover' && 'reactEasyCrop_Cover_Vertical', mediaClassName)
}, mediaProps, {
ref: this.videoRef,
onLoadedMetadata: this.onMediaLoad,
style: __assign(__assign({}, mediaStyle), {
transform: transform || "translate(".concat(x, "px, ").concat(y, "px) rotate(").concat(rotation, "deg) scale(").concat(zoom, ")")
}),
controls: false
}), (Array.isArray(video) ? video : [{
src: video
}]).map(function (item) {
return external_React_.createElement("source", __assign({
key: item.src
}, item));
})), this.state.cropSize && external_React_.createElement("div", {
style: __assign(__assign({}, cropAreaStyle), {
width: this.state.cropSize.width,
height: this.state.cropSize.height
}),
"data-testid": "cropper",
className: classNames('reactEasyCrop_CropArea', cropShape === 'round' && 'reactEasyCrop_CropAreaRound', showGrid && 'reactEasyCrop_CropAreaGrid', cropAreaClassName)
}));
};
Cropper.defaultProps = {
zoom: 1,
rotation: 0,
aspect: 4 / 3,
maxZoom: index_module_MAX_ZOOM,
minZoom: index_module_MIN_ZOOM,
cropShape: 'rect',
objectFit: 'contain',
showGrid: true,
style: {},
classes: {},
mediaProps: {},
zoomSpeed: 1,
restrictPosition: true,
zoomWithScroll: true
};
Cropper.getMousePoint = function (e) {
return {
x: Number(e.clientX),
y: Number(e.clientY)
};
};
Cropper.getTouchPoint = function (touch) {
return {
x: Number(touch.clientX),
y: Number(touch.clientY)
};
};
return Cropper;
}(external_React_.Component);
;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/cropper.js
function ImageCropper({
url,
width,
height,
naturalHeight,
naturalWidth,
borderProps
}) {
const {
isInProgress,
editedUrl,
position,
zoom,
aspect,
setPosition,
setCrop,
setZoom,
rotation
} = useImageEditingContext();
const [contentResizeListener, { width: clientWidth }] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
let editedHeight = height || clientWidth * naturalHeight / naturalWidth;
if (rotation % 180 === 90) {
editedHeight = clientWidth * naturalWidth / naturalHeight;
}
const area = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
className: dist_clsx(
"wp-block-image__crop-area",
borderProps?.className,
{
"is-applying": isInProgress
}
),
style: {
...borderProps?.style,
width: width || clientWidth,
height: editedHeight
},
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Cropper,
{
image: editedUrl || url,
disabled: isInProgress,
minZoom: MIN_ZOOM / 100,
maxZoom: MAX_ZOOM / 100,
crop: position,
zoom: zoom / 100,
aspect,
onCropChange: (pos) => {
setPosition(pos);
},
onCropComplete: (newCropPercent) => {
setCrop(newCropPercent);
},
onZoomChange: (newZoom) => {
setZoom(newZoom * 100);
}
}
),
isInProgress && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})
]
}
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
contentResizeListener,
area
] });
}
;// ./node_modules/@wordpress/icons/build-module/library/search.js
var search_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/zoom-dropdown.js
function ZoomDropdown() {
const { isInProgress, zoom, setZoom } = useImageEditingContext();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
contentClassName: "wp-block-image__zoom",
popoverProps: constants_POPOVER_PROPS,
renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
icon: search_default,
label: (0,external_wp_i18n_namespaceObject.__)("Zoom"),
onClick: onToggle,
"aria-expanded": isOpen,
disabled: isInProgress
}
),
renderContent: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, { paddingSize: "medium", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.RangeControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Zoom"),
min: MIN_ZOOM,
max: MAX_ZOOM,
value: Math.round(zoom),
onChange: setZoom
}
) })
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/rotate-right.js
var rotate_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/rotation-button.js
function RotationButton() {
const { isInProgress, rotateClockwise } = useImageEditingContext();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
icon: rotate_right_default,
label: (0,external_wp_i18n_namespaceObject.__)("Rotate"),
onClick: rotateClockwise,
disabled: isInProgress
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/form-controls.js
function FormControls() {
const { isInProgress, apply, cancel } = useImageEditingContext();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: apply, disabled: isInProgress, children: (0,external_wp_i18n_namespaceObject.__)("Apply") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: cancel, children: (0,external_wp_i18n_namespaceObject.__)("Cancel") })
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/index.js
function ImageEditor({
id,
url,
width,
height,
naturalHeight,
naturalWidth,
onSaveImage,
onFinishEditing,
borderProps
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
ImageEditingProvider,
{
id,
url,
naturalWidth,
naturalHeight,
onSaveImage,
onFinishEditing,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ImageCropper,
{
borderProps,
url,
width,
height,
naturalHeight,
naturalWidth
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(block_controls_default, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ZoomDropdown, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { children: (toggleProps) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(AspectRatioDropdown, { toggleProps }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RotationButton, {})
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FormControls, {}) })
] })
]
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/image-size-control/use-dimension-handler.js
function useDimensionHandler(customHeight, customWidth, defaultHeight, defaultWidth, onChange) {
const [currentWidth, setCurrentWidth] = (0,external_wp_element_namespaceObject.useState)(
customWidth ?? defaultWidth ?? ""
);
const [currentHeight, setCurrentHeight] = (0,external_wp_element_namespaceObject.useState)(
customHeight ?? defaultHeight ?? ""
);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (customWidth === void 0 && defaultWidth !== void 0) {
setCurrentWidth(defaultWidth);
}
if (customHeight === void 0 && defaultHeight !== void 0) {
setCurrentHeight(defaultHeight);
}
}, [defaultWidth, defaultHeight]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (customWidth !== void 0 && Number.parseInt(customWidth) !== Number.parseInt(currentWidth)) {
setCurrentWidth(customWidth);
}
if (customHeight !== void 0 && Number.parseInt(customHeight) !== Number.parseInt(currentHeight)) {
setCurrentHeight(customHeight);
}
}, [customWidth, customHeight]);
const updateDimension = (dimension, value) => {
const parsedValue = value === "" ? void 0 : parseInt(value, 10);
if (dimension === "width") {
setCurrentWidth(parsedValue);
} else {
setCurrentHeight(parsedValue);
}
onChange({
[dimension]: parsedValue
});
};
const updateDimensions = (nextHeight, nextWidth) => {
setCurrentHeight(nextHeight ?? defaultHeight);
setCurrentWidth(nextWidth ?? defaultWidth);
onChange({ height: nextHeight, width: nextWidth });
};
return {
currentHeight,
currentWidth,
updateDimension,
updateDimensions
};
}
;// ./node_modules/@wordpress/block-editor/build-module/components/image-size-control/index.js
const IMAGE_SIZE_PRESETS = [25, 50, 75, 100];
const image_size_control_noop = () => {
};
function getScaledWidthAndHeight(scale, imageWidth, imageHeight) {
const scaledWidth = Math.round(imageWidth * (scale / 100));
const scaledHeight = Math.round(imageHeight * (scale / 100));
return {
scaledWidth,
scaledHeight
};
}
function ImageSizeControl({
imageSizeHelp,
imageWidth,
imageHeight,
imageSizeOptions = [],
isResizable = true,
slug,
width,
height,
onChange,
onChangeImage = image_size_control_noop
}) {
const { currentHeight, currentWidth, updateDimension, updateDimensions } = useDimensionHandler(height, width, imageHeight, imageWidth, onChange);
const handleUpdateDimensions = (scale) => {
if (void 0 === scale) {
updateDimensions();
return;
}
const { scaledWidth, scaledHeight } = getScaledWidthAndHeight(
scale,
imageWidth,
imageHeight
);
updateDimensions(scaledHeight, scaledWidth);
};
const selectedValue = IMAGE_SIZE_PRESETS.find((scale) => {
const { scaledWidth, scaledHeight } = getScaledWidthAndHeight(
scale,
imageWidth,
imageHeight
);
return currentWidth === scaledWidth && currentHeight === scaledHeight;
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { className: "block-editor-image-size-control", spacing: "4", children: [
imageSizeOptions && imageSizeOptions.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SelectControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Resolution"),
value: slug,
options: imageSizeOptions,
onChange: onChangeImage,
help: imageSizeHelp,
size: "__unstable-large"
}
),
isResizable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { align: "baseline", spacing: "4", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalNumberControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Width"),
value: currentWidth,
min: 1,
onChange: (value) => updateDimension("width", value),
size: "__unstable-large"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalNumberControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Height"),
value: currentHeight,
min: 1,
onChange: (value) => updateDimension("height", value),
size: "__unstable-large"
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Image size presets"),
hideLabelFromVision: true,
onChange: handleUpdateDimensions,
value: selectedValue,
isBlock: true,
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
children: IMAGE_SIZE_PRESETS.map((scale) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: scale,
label: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: Percentage value. */
(0,external_wp_i18n_namespaceObject.__)("%d%%"),
scale
)
},
scale
);
})
}
)
] })
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/url-popover/link-viewer-url.js
function LinkViewerURL({ url, urlLabel, className }) {
const linkClassName = dist_clsx(
className,
"block-editor-url-popover__link-viewer-url"
);
if (!url) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: linkClassName });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { className: linkClassName, href: url, children: urlLabel || (0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURI)(url)) });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/url-popover/link-viewer.js
function LinkViewer({
className,
linkClassName,
onEditLinkClick,
url,
urlLabel,
...props
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
className: dist_clsx(
"block-editor-url-popover__link-viewer",
className
),
...props,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
LinkViewerURL,
{
url,
urlLabel,
className: linkClassName
}
),
onEditLinkClick && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
icon: pencil_default,
label: (0,external_wp_i18n_namespaceObject.__)("Edit"),
onClick: onEditLinkClick,
size: "compact"
}
)
]
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/url-popover/link-editor.js
function LinkEditor({
autocompleteRef,
className,
onChangeInputValue,
value,
...props
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"form",
{
className: dist_clsx(
"block-editor-url-popover__link-editor",
className
),
...props,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
url_input_default,
{
value,
onChange: onChangeInputValue,
autocompleteRef
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
icon: keyboard_return_default,
label: (0,external_wp_i18n_namespaceObject.__)("Apply"),
type: "submit",
size: "compact"
}
)
]
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/url-popover/index.js
const { __experimentalPopoverLegacyPositionToPlacement } = unlock(
external_wp_components_namespaceObject.privateApis
);
const DEFAULT_PLACEMENT = "bottom";
const URLPopover = (0,external_wp_element_namespaceObject.forwardRef)(
({
additionalControls,
children,
renderSettings,
// The DEFAULT_PLACEMENT value is assigned inside the function's body
placement,
focusOnMount = "firstElement",
// Deprecated
position,
// Rest
...popoverProps
}, ref) => {
if (position !== void 0) {
external_wp_deprecated_default()("`position` prop in wp.blockEditor.URLPopover", {
since: "6.2",
alternative: "`placement` prop"
});
}
let computedPlacement;
if (placement !== void 0) {
computedPlacement = placement;
} else if (position !== void 0) {
computedPlacement = __experimentalPopoverLegacyPositionToPlacement(position);
}
computedPlacement = computedPlacement || DEFAULT_PLACEMENT;
const [isSettingsExpanded, setIsSettingsExpanded] = (0,external_wp_element_namespaceObject.useState)(false);
const showSettings = !!renderSettings && isSettingsExpanded;
const toggleSettingsVisibility = () => {
setIsSettingsExpanded(!isSettingsExpanded);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Popover,
{
ref,
role: "dialog",
"aria-modal": "true",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Edit URL"),
className: "block-editor-url-popover",
focusOnMount,
placement: computedPlacement,
shift: true,
variant: "toolbar",
...popoverProps,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-url-popover__input-container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-url-popover__row", children: [
children,
!!renderSettings && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
className: "block-editor-url-popover__settings-toggle",
icon: chevron_down_default,
label: (0,external_wp_i18n_namespaceObject.__)("Link settings"),
onClick: toggleSettingsVisibility,
"aria-expanded": isSettingsExpanded,
size: "compact"
}
)
] }) }),
showSettings && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-url-popover__settings", children: renderSettings() }),
additionalControls && !showSettings && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-url-popover__additional-controls", children: additionalControls })
]
}
);
}
);
URLPopover.LinkEditor = LinkEditor;
URLPopover.LinkViewer = LinkViewer;
var url_popover_default = URLPopover;
;// ./node_modules/@wordpress/block-editor/build-module/components/media-placeholder/index.js
const media_placeholder_noop = () => {
};
const InsertFromURLPopover = ({
src,
onChange,
onSubmit,
onClose,
popoverAnchor
}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(url_popover_default, { anchor: popoverAnchor, onClose, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"form",
{
className: "block-editor-media-placeholder__url-input-form",
onSubmit,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalInputControl,
{
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("URL"),
type: "text",
hideLabelFromVision: true,
placeholder: (0,external_wp_i18n_namespaceObject.__)("Paste or type URL"),
onChange,
value: src,
suffix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlSuffixWrapper, { variant: "control", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "small",
icon: keyboard_return_default,
label: (0,external_wp_i18n_namespaceObject.__)("Apply"),
type: "submit"
}
) })
}
)
}
) });
const URLSelectionUI = ({ src, onChangeSrc, onSelectURL }) => {
const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
const [isURLInputVisible, setIsURLInputVisible] = (0,external_wp_element_namespaceObject.useState)(false);
const openURLInput = () => {
setIsURLInputVisible(true);
};
const closeURLInput = () => {
setIsURLInputVisible(false);
popoverAnchor?.focus();
};
const onSubmitSrc = (event) => {
event.preventDefault();
if (src && onSelectURL) {
onSelectURL(src);
closeURLInput();
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-media-placeholder__url-input-container", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
className: "block-editor-media-placeholder__button",
onClick: openURLInput,
isPressed: isURLInputVisible,
variant: "secondary",
"aria-haspopup": "dialog",
ref: setPopoverAnchor,
children: (0,external_wp_i18n_namespaceObject.__)("Insert from URL")
}
),
isURLInputVisible && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
InsertFromURLPopover,
{
src,
onChange: onChangeSrc,
onSubmit: onSubmitSrc,
onClose: closeURLInput,
popoverAnchor
}
)
] });
};
function MediaPlaceholder({
value = {},
allowedTypes,
className,
icon,
labels = {},
mediaPreview,
notices,
isAppender,
accept,
addToGallery,
multiple = false,
handleUpload = true,
disableDropZone,
disableMediaButtons,
onError,
onSelect,
onCancel,
onSelectURL,
onToggleFeaturedImage,
onDoubleClick,
onFilesPreUpload = media_placeholder_noop,
onHTMLDrop: deprecatedOnHTMLDrop,
children,
mediaLibraryButton,
placeholder,
style
}) {
if (deprecatedOnHTMLDrop) {
external_wp_deprecated_default()("wp.blockEditor.MediaPlaceholder onHTMLDrop prop", {
since: "6.2",
version: "6.4"
});
}
const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getSettings } = select(store);
return getSettings().mediaUpload;
}, []);
const [src, setSrc] = (0,external_wp_element_namespaceObject.useState)("");
(0,external_wp_element_namespaceObject.useEffect)(() => {
setSrc(value?.src ?? "");
}, [value?.src]);
const onlyAllowsImages = () => {
if (!allowedTypes || allowedTypes.length === 0) {
return false;
}
return allowedTypes.every(
(allowedType) => allowedType === "image" || allowedType.startsWith("image/")
);
};
const onFilesUpload = (files) => {
if (!handleUpload || typeof handleUpload === "function" && !handleUpload(files)) {
return onSelect(files);
}
onFilesPreUpload(files);
let setMedia;
if (multiple) {
if (addToGallery) {
let lastMediaPassed = [];
setMedia = (newMedia) => {
const filteredMedia = (value ?? []).filter((item) => {
if (item.id) {
return !lastMediaPassed.some(
// Be sure to convert to number for comparison.
({ id }) => Number(id) === Number(item.id)
);
}
return !lastMediaPassed.some(
({ urlSlug }) => item.url.includes(urlSlug)
);
});
onSelect(filteredMedia.concat(newMedia));
lastMediaPassed = newMedia.map((media) => {
const cutOffIndex = media.url.lastIndexOf(".");
const urlSlug = media.url.slice(0, cutOffIndex);
return { id: media.id, urlSlug };
});
};
} else {
setMedia = onSelect;
}
} else {
setMedia = ([media]) => onSelect(media);
}
mediaUpload({
allowedTypes,
filesList: files,
onFileChange: setMedia,
onError,
multiple
});
};
async function handleBlocksDrop(event) {
const { blocks } = parseDropEvent(event);
if (!blocks?.length) {
return;
}
const uploadedMediaList = await Promise.all(
blocks.map((block) => {
const blockType = block.name.split("/")[1];
if (block.attributes.id) {
block.attributes.type = blockType;
return block.attributes;
}
return new Promise((resolve, reject) => {
window.fetch(block.attributes.url).then((response) => response.blob()).then(
(blob) => mediaUpload({
filesList: [blob],
additionalData: {
title: block.attributes.title,
alt_text: block.attributes.alt,
caption: block.attributes.caption,
type: blockType
},
onFileChange: ([media]) => {
if (media.id) {
resolve(media);
}
},
allowedTypes,
onError: reject
})
).catch(() => resolve(block.attributes.url));
});
})
).catch((err) => onError(err));
if (!uploadedMediaList?.length) {
return;
}
onSelect(multiple ? uploadedMediaList : uploadedMediaList[0]);
}
const onUpload = (event) => {
onFilesUpload(event.target.files);
};
const defaultRenderPlaceholder = (content) => {
let { instructions, title } = labels;
if (!mediaUpload && !onSelectURL) {
instructions = (0,external_wp_i18n_namespaceObject.__)(
"To edit this block, you need permission to upload media."
);
}
if (instructions === void 0 || title === void 0) {
const typesAllowed = allowedTypes ?? [];
const [firstAllowedType] = typesAllowed;
const isOneType = 1 === typesAllowed.length;
const isAudio = isOneType && "audio" === firstAllowedType;
const isImage = isOneType && "image" === firstAllowedType;
const isVideo = isOneType && "video" === firstAllowedType;
if (instructions === void 0 && mediaUpload) {
instructions = (0,external_wp_i18n_namespaceObject.__)(
"Drag and drop an image or video, upload, or choose from your library."
);
if (isAudio) {
instructions = (0,external_wp_i18n_namespaceObject.__)(
"Drag and drop an audio file, upload, or choose from your library."
);
} else if (isImage) {
instructions = (0,external_wp_i18n_namespaceObject.__)(
"Drag and drop an image, upload, or choose from your library."
);
} else if (isVideo) {
instructions = (0,external_wp_i18n_namespaceObject.__)(
"Drag and drop a video, upload, or choose from your library."
);
}
}
if (title === void 0) {
title = (0,external_wp_i18n_namespaceObject.__)("Media");
if (isAudio) {
title = (0,external_wp_i18n_namespaceObject.__)("Audio");
} else if (isImage) {
title = (0,external_wp_i18n_namespaceObject.__)("Image");
} else if (isVideo) {
title = (0,external_wp_i18n_namespaceObject.__)("Video");
}
}
}
const placeholderClassName = dist_clsx(
"block-editor-media-placeholder",
className,
{
"is-appender": isAppender
}
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Placeholder,
{
icon,
label: title,
instructions,
className: placeholderClassName,
notices,
onDoubleClick,
preview: mediaPreview,
style,
children: [
content,
children
]
}
);
};
const renderPlaceholder = placeholder ?? defaultRenderPlaceholder;
const renderDropZone = () => {
if (disableDropZone) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropZone,
{
onFilesDrop: onFilesUpload,
onDrop: handleBlocksDrop,
isEligible: (dataTransfer) => {
const prefix = "wp-block:core/";
const types = [];
for (const type of dataTransfer.types) {
if (type.startsWith(prefix)) {
types.push(type.slice(prefix.length));
}
}
return types.every(
(type) => allowedTypes.includes(type)
) && (multiple ? true : types.length === 1);
}
}
);
};
const renderCancelLink = () => {
return onCancel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
className: "block-editor-media-placeholder__cancel-button",
title: (0,external_wp_i18n_namespaceObject.__)("Cancel"),
variant: "link",
onClick: onCancel,
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
);
};
const renderUrlSelectionUI = () => {
return onSelectURL && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
URLSelectionUI,
{
src,
onChangeSrc: setSrc,
onSelectURL
}
);
};
const renderFeaturedImageToggle = () => {
return onToggleFeaturedImage && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-media-placeholder__url-input-container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
className: "block-editor-media-placeholder__button",
onClick: onToggleFeaturedImage,
variant: "secondary",
children: (0,external_wp_i18n_namespaceObject.__)("Use featured image")
}
) });
};
const renderMediaUploadChecked = () => {
const defaultButton = ({ open }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "secondary",
onClick: () => {
open();
},
children: (0,external_wp_i18n_namespaceObject.__)("Media Library")
}
);
};
const libraryButton = mediaLibraryButton ?? defaultButton;
const uploadMediaLibraryButton = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
media_upload_default,
{
addToGallery,
gallery: multiple && onlyAllowsImages(),
multiple,
onSelect,
allowedTypes,
mode: "browse",
value: Array.isArray(value) ? value.map(({ id }) => id) : value.id,
render: libraryButton
}
);
if (mediaUpload && isAppender) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
renderDropZone(),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.FormFileUpload,
{
onChange: onUpload,
accept,
multiple: !!multiple,
render: ({ openFileDialog }) => {
const content = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "primary",
className: dist_clsx(
"block-editor-media-placeholder__button",
"block-editor-media-placeholder__upload-button"
),
onClick: openFileDialog,
children: (0,external_wp_i18n_namespaceObject._x)("Upload", "verb")
}
),
uploadMediaLibraryButton,
renderUrlSelectionUI(),
renderFeaturedImageToggle(),
renderCancelLink()
] });
return renderPlaceholder(content);
}
}
)
] });
}
if (mediaUpload) {
const content = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
renderDropZone(),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.FormFileUpload,
{
render: ({ openFileDialog }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
onClick: openFileDialog,
variant: "primary",
className: dist_clsx(
"block-editor-media-placeholder__button",
"block-editor-media-placeholder__upload-button"
),
children: (0,external_wp_i18n_namespaceObject._x)("Upload", "verb")
}
),
onChange: onUpload,
accept,
multiple: !!multiple
}
),
uploadMediaLibraryButton,
renderUrlSelectionUI(),
renderFeaturedImageToggle(),
renderCancelLink()
] });
return renderPlaceholder(content);
}
return renderPlaceholder(uploadMediaLibraryButton);
};
if (disableMediaButtons) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(check_default, { children: renderDropZone() });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
check_default,
{
fallback: renderPlaceholder(renderUrlSelectionUI()),
children: renderMediaUploadChecked()
}
);
}
var media_placeholder_default = (0,external_wp_components_namespaceObject.withFilters)("editor.MediaPlaceholder")(MediaPlaceholder);
;// ./node_modules/@wordpress/block-editor/build-module/components/panel-color-settings/index.js
const PanelColorSettings = ({ colorSettings, ...props }) => {
const settings = colorSettings.map((setting) => {
if (!setting) {
return setting;
}
const { value, onChange, ...otherSettings } = setting;
return {
...otherSettings,
colorValue: value,
onColorChange: onChange
};
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
panel_color_gradient_settings_default,
{
settings,
gradients: [],
disableCustomGradients: true,
...props
}
);
};
var panel_color_settings_default = PanelColorSettings;
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/format-toolbar/index.js
const format_toolbar_POPOVER_PROPS = {
placement: "bottom-start"
};
const FormatToolbar = () => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
["bold", "italic", "link", "unknown"].map((format) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Slot,
{
name: `RichText.ToolbarControls.${format}`
},
format
)),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Slot, { name: "RichText.ToolbarControls", children: (fills) => {
if (!fills.length) {
return null;
}
const allProps = fills.map(([{ props }]) => props);
const hasActive = allProps.some(
({ isActive }) => isActive
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { children: (toggleProps) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropdownMenu,
{
icon: chevron_down_default,
label: (0,external_wp_i18n_namespaceObject.__)("More"),
toggleProps: {
...toggleProps,
className: dist_clsx(
toggleProps.className,
{ "is-pressed": hasActive }
),
description: (0,external_wp_i18n_namespaceObject.__)(
"Displays more block tools"
)
},
controls: orderBy(
fills.map(([{ props }]) => props),
"title"
),
popoverProps: format_toolbar_POPOVER_PROPS
}
) });
} })
] });
};
var format_toolbar_default = FormatToolbar;
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/format-toolbar-container.js
function InlineToolbar({ popoverAnchor }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Popover,
{
placement: "top",
focusOnMount: false,
anchor: popoverAnchor,
className: "block-editor-rich-text__inline-format-toolbar",
__unstableSlotName: "block-toolbar",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
NavigableToolbar,
{
className: "block-editor-rich-text__inline-format-toolbar-group",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Format tools"),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(format_toolbar_default, {}) })
}
)
}
);
}
const FormatToolbarContainer = ({ inline, editableContentElement }) => {
if (inline) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InlineToolbar, { popoverAnchor: editableContentElement });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls_default, { group: "inline", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(format_toolbar_default, {}) });
};
var format_toolbar_container_default = FormatToolbarContainer;
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-mark-persistent.js
function useMarkPersistent({ html, value }) {
const previousTextRef = (0,external_wp_element_namespaceObject.useRef)();
const hasActiveFormats = !!value.activeFormats?.length;
const { __unstableMarkLastChangeAsPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(store);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (!previousTextRef.current) {
previousTextRef.current = value.text;
return;
}
if (previousTextRef.current !== value.text) {
const timeout = window.setTimeout(() => {
__unstableMarkLastChangeAsPersistent();
}, 1e3);
previousTextRef.current = value.text;
return () => {
window.clearTimeout(timeout);
};
}
__unstableMarkLastChangeAsPersistent();
}, [html, hasActiveFormats]);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-format-types.js
function formatTypesSelector(select) {
return select(external_wp_richText_namespaceObject.store).getFormatTypes();
}
const interactiveContentTags = /* @__PURE__ */ new Set([
"a",
"audio",
"button",
"details",
"embed",
"iframe",
"input",
"label",
"select",
"textarea",
"video"
]);
function prefixSelectKeys(selected, prefix) {
if (typeof selected !== "object") {
return { [prefix]: selected };
}
return Object.fromEntries(
Object.entries(selected).map(([key, value]) => [
`${prefix}.${key}`,
value
])
);
}
function getPrefixedSelectKeys(selected, prefix) {
if (selected[prefix]) {
return selected[prefix];
}
return Object.keys(selected).filter((key) => key.startsWith(prefix + ".")).reduce((accumulator, key) => {
accumulator[key.slice(prefix.length + 1)] = selected[key];
return accumulator;
}, {});
}
function useFormatTypes({
clientId,
identifier,
allowedFormats,
withoutInteractiveFormatting,
disableNoneEssentialFormatting = false
}) {
const allFormatTypes = (0,external_wp_data_namespaceObject.useSelect)(formatTypesSelector, []);
const formatTypes = (0,external_wp_element_namespaceObject.useMemo)(() => {
return allFormatTypes.filter(
({
name,
interactive,
tagName,
[essentialFormatKey]: isEssential
}) => {
if (allowedFormats && !allowedFormats.includes(name)) {
return false;
}
if (disableNoneEssentialFormatting && !isEssential) {
return false;
}
if (withoutInteractiveFormatting && (interactive || interactiveContentTags.has(tagName))) {
return false;
}
return true;
}
);
}, [
allFormatTypes,
allowedFormats,
disableNoneEssentialFormatting,
withoutInteractiveFormatting
]);
const keyedSelected = (0,external_wp_data_namespaceObject.useSelect)(
(select) => formatTypes.reduce((accumulator, type) => {
if (!type.__experimentalGetPropsForEditableTreePreparation) {
return accumulator;
}
return {
...accumulator,
...prefixSelectKeys(
type.__experimentalGetPropsForEditableTreePreparation(
select,
{
richTextIdentifier: identifier,
blockClientId: clientId
}
),
type.name
)
};
}, {}),
[formatTypes, clientId, identifier]
);
const dispatch = (0,external_wp_data_namespaceObject.useDispatch)();
const prepareHandlers = [];
const valueHandlers = [];
const changeHandlers = [];
const dependencies = [];
for (const key in keyedSelected) {
dependencies.push(keyedSelected[key]);
}
formatTypes.forEach((type) => {
if (type.__experimentalCreatePrepareEditableTree) {
const handler = type.__experimentalCreatePrepareEditableTree(
getPrefixedSelectKeys(keyedSelected, type.name),
{
richTextIdentifier: identifier,
blockClientId: clientId
}
);
if (type.__experimentalCreateOnChangeEditableValue) {
valueHandlers.push(handler);
} else {
prepareHandlers.push(handler);
}
}
if (type.__experimentalCreateOnChangeEditableValue) {
let dispatchers = {};
if (type.__experimentalGetPropsForEditableTreeChangeHandler) {
dispatchers = type.__experimentalGetPropsForEditableTreeChangeHandler(
dispatch,
{
richTextIdentifier: identifier,
blockClientId: clientId
}
);
}
const selected = getPrefixedSelectKeys(keyedSelected, type.name);
changeHandlers.push(
type.__experimentalCreateOnChangeEditableValue(
{
...typeof selected === "object" ? selected : {},
...dispatchers
},
{
richTextIdentifier: identifier,
blockClientId: clientId
}
)
);
}
});
return {
formatTypes,
prepareHandlers,
valueHandlers,
changeHandlers,
dependencies
};
}
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/before-input-rules.js
const wrapSelectionSettings = ["`", '"', "'", "\u201C\u201D", "\u2018\u2019"];
var before_input_rules_default = (props) => (element) => {
function onInput(event) {
const { inputType, data } = event;
const { value, onChange, registry } = props.current;
if (inputType !== "insertText") {
return;
}
if ((0,external_wp_richText_namespaceObject.isCollapsed)(value)) {
return;
}
const pair = (0,external_wp_hooks_namespaceObject.applyFilters)(
"blockEditor.wrapSelectionSettings",
wrapSelectionSettings
).find(
([startChar2, endChar2]) => startChar2 === data || endChar2 === data
);
if (!pair) {
return;
}
const [startChar, endChar = startChar] = pair;
const start = value.start;
const end = value.end + startChar.length;
let newValue = (0,external_wp_richText_namespaceObject.insert)(value, startChar, start, start);
newValue = (0,external_wp_richText_namespaceObject.insert)(newValue, endChar, end, end);
const {
__unstableMarkLastChangeAsPersistent,
__unstableMarkAutomaticChange
} = registry.dispatch(store);
__unstableMarkLastChangeAsPersistent();
onChange(newValue);
__unstableMarkAutomaticChange();
const init = {};
for (const key in event) {
init[key] = event[key];
}
init.data = endChar;
const { ownerDocument } = element;
const { defaultView } = ownerDocument;
const newEvent = new defaultView.InputEvent("input", init);
window.queueMicrotask(() => {
event.target.dispatchEvent(newEvent);
});
event.preventDefault();
}
element.addEventListener("beforeinput", onInput);
return () => {
element.removeEventListener("beforeinput", onInput);
};
};
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/prevent-event-discovery.js
function preventEventDiscovery(value) {
const searchText = "tales of gutenberg";
const addText = " \u{1F421}\u{1F422}\u{1F980}\u{1F424}\u{1F98B}\u{1F418}\u{1F427}\u{1F439}\u{1F981}\u{1F984}\u{1F98D}\u{1F43C}\u{1F43F}\u{1F383}\u{1F434}\u{1F41D}\u{1F406}\u{1F995}\u{1F994}\u{1F331}\u{1F347}\u03C0\u{1F34C}\u{1F409}\u{1F4A7}\u{1F968}\u{1F30C}\u{1F342}\u{1F360}\u{1F966}\u{1F95A}\u{1F95D}\u{1F39F}\u{1F965}\u{1F952}\u{1F6F5}\u{1F956}\u{1F352}\u{1F36F}\u{1F3BE}\u{1F3B2}\u{1F43A}\u{1F41A}\u{1F42E}\u231B\uFE0F";
const { start, text } = value;
if (start < searchText.length) {
return value;
}
const charactersBefore = text.slice(start - searchText.length, start);
if (charactersBefore.toLowerCase() !== searchText) {
return value;
}
return (0,external_wp_richText_namespaceObject.insert)(value, addText);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/input-rules.js
function findSelection(blocks) {
let i = blocks.length;
while (i--) {
const attributeKey = retrieveSelectedAttribute(
blocks[i].attributes
);
if (attributeKey) {
blocks[i].attributes[attributeKey] = blocks[i].attributes[attributeKey].toString().replace(START_OF_SELECTED_AREA, "");
return [blocks[i].clientId, attributeKey, 0, 0];
}
const nestedSelection = findSelection(blocks[i].innerBlocks);
if (nestedSelection) {
return nestedSelection;
}
}
return [];
}
var input_rules_default = (props) => (element) => {
function inputRule() {
const { getValue, onReplace, selectionChange, registry } = props.current;
if (!onReplace) {
return;
}
const value = getValue();
const { start, text } = value;
const characterBefore = text.slice(start - 1, start);
if (characterBefore !== " ") {
return;
}
const trimmedTextBefore = text.slice(0, start).trim();
const prefixTransforms = (0,external_wp_blocks_namespaceObject.getBlockTransforms)("from").filter(
({ type }) => type === "prefix"
);
const transformation = (0,external_wp_blocks_namespaceObject.findTransform)(
prefixTransforms,
({ prefix }) => {
return trimmedTextBefore === prefix;
}
);
if (!transformation) {
return;
}
const content = (0,external_wp_richText_namespaceObject.toHTMLString)({
value: (0,external_wp_richText_namespaceObject.insert)(value, START_OF_SELECTED_AREA, 0, start)
});
const block = transformation.transform(content);
selectionChange(...findSelection([block]));
onReplace([block]);
registry.dispatch(store).__unstableMarkAutomaticChange();
return true;
}
function onInput(event) {
const { inputType, type } = event;
const {
getValue,
onChange,
__unstableAllowPrefixTransformations,
formatTypes,
registry
} = props.current;
if (inputType !== "insertText" && type !== "compositionend") {
return;
}
if (__unstableAllowPrefixTransformations && inputRule()) {
return;
}
const value = getValue();
const transformed = formatTypes.reduce(
(accumulator, { __unstableInputRule }) => {
if (__unstableInputRule) {
accumulator = __unstableInputRule(accumulator);
}
return accumulator;
},
preventEventDiscovery(value)
);
const {
__unstableMarkLastChangeAsPersistent,
__unstableMarkAutomaticChange
} = registry.dispatch(store);
if (transformed !== value) {
__unstableMarkLastChangeAsPersistent();
onChange({
...transformed,
activeFormats: value.activeFormats
});
__unstableMarkAutomaticChange();
}
}
element.addEventListener("input", onInput);
element.addEventListener("compositionend", onInput);
return () => {
element.removeEventListener("input", onInput);
element.removeEventListener("compositionend", onInput);
};
};
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/insert-replacement-text.js
var insert_replacement_text_default = (props) => (element) => {
function onInput(event) {
if (event.inputType !== "insertReplacementText") {
return;
}
const { registry } = props.current;
registry.dispatch(store).__unstableMarkLastChangeAsPersistent();
}
element.addEventListener("beforeinput", onInput);
return () => {
element.removeEventListener("beforeinput", onInput);
};
};
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js
var remove_browser_shortcuts_default = () => (node) => {
function onKeydown(event) {
if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, "z") || external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, "y") || external_wp_keycodes_namespaceObject.isKeyboardEvent.primaryShift(event, "z")) {
event.preventDefault();
}
}
node.addEventListener("keydown", onKeydown);
return () => {
node.removeEventListener("keydown", onKeydown);
};
};
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/shortcuts.js
var shortcuts_default = (props) => (element) => {
const { keyboardShortcuts } = props.current;
function onKeyDown(event) {
for (const keyboardShortcut of keyboardShortcuts.current) {
keyboardShortcut(event);
}
}
element.addEventListener("keydown", onKeyDown);
return () => {
element.removeEventListener("keydown", onKeyDown);
};
};
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/input-events.js
var input_events_default = (props) => (element) => {
const { inputEvents } = props.current;
function onInput(event) {
for (const keyboardShortcut of inputEvents.current) {
keyboardShortcut(event);
}
}
element.addEventListener("input", onInput);
return () => {
element.removeEventListener("input", onInput);
};
};
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/undo-automatic-change.js
var undo_automatic_change_default = (props) => (element) => {
function onKeyDown(event) {
const { keyCode } = event;
if (event.defaultPrevented) {
return;
}
if (keyCode !== external_wp_keycodes_namespaceObject.BACKSPACE && keyCode !== external_wp_keycodes_namespaceObject.ESCAPE) {
return;
}
const { registry } = props.current;
const { didAutomaticChange, getSettings } = registry.select(store);
const { __experimentalUndo } = getSettings();
if (!__experimentalUndo) {
return;
}
if (!didAutomaticChange()) {
return;
}
event.preventDefault();
__experimentalUndo();
}
element.addEventListener("keydown", onKeyDown);
return () => {
element.removeEventListener("keydown", onKeyDown);
};
};
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/utils.js
function addActiveFormats(value, activeFormats) {
if (activeFormats?.length) {
let index = value.formats.length;
while (index--) {
value.formats[index] = [
...activeFormats,
...value.formats[index] || []
];
}
}
}
function getMultilineTag(multiline) {
if (multiline !== true && multiline !== "p" && multiline !== "li") {
return;
}
return multiline === true ? "p" : multiline;
}
function getAllowedFormats({ allowedFormats, disableFormats }) {
if (disableFormats) {
return getAllowedFormats.EMPTY_ARRAY;
}
return allowedFormats;
}
getAllowedFormats.EMPTY_ARRAY = [];
function createLinkInParagraph(url, onReplace) {
const link = /* @__PURE__ */ jsx("a", { href: url, children: url });
onReplace(
createBlock("core/paragraph", { content: renderToString(link) })
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/paste-handler.js
var paste_handler_default = (props) => (element) => {
function _onPaste(event) {
const {
disableFormats,
onChange,
value,
formatTypes,
tagName,
onReplace,
__unstableEmbedURLOnPaste,
preserveWhiteSpace,
pastePlainText
} = props.current;
if (!element.contains(event.target)) {
return;
}
if (event.defaultPrevented) {
return;
}
const { plainText, html } = getPasteEventData(event);
event.preventDefault();
window.console.log("Received HTML:\n\n", html);
window.console.log("Received plain text:\n\n", plainText);
if (disableFormats) {
onChange((0,external_wp_richText_namespaceObject.insert)(value, plainText));
return;
}
const isInternal = event.clipboardData.getData("rich-text") === "true";
function pasteInline(content2) {
const transformed = formatTypes.reduce(
(accumulator, { __unstablePasteRule }) => {
if (__unstablePasteRule && accumulator === value) {
accumulator = __unstablePasteRule(value, {
html,
plainText
});
}
return accumulator;
},
value
);
if (transformed !== value) {
onChange(transformed);
} else {
const valueToInsert = (0,external_wp_richText_namespaceObject.create)({ html: content2 });
addActiveFormats(valueToInsert, value.activeFormats);
onChange((0,external_wp_richText_namespaceObject.insert)(value, valueToInsert));
}
}
if (isInternal) {
pasteInline(html);
return;
}
if (pastePlainText) {
onChange((0,external_wp_richText_namespaceObject.insert)(value, (0,external_wp_richText_namespaceObject.create)({ text: plainText })));
return;
}
let mode = "INLINE";
const trimmedPlainText = plainText.trim();
if (__unstableEmbedURLOnPaste && (0,external_wp_richText_namespaceObject.isEmpty)(value) && (0,external_wp_url_namespaceObject.isURL)(trimmedPlainText) && // For the link pasting feature, allow only http(s) protocols.
/^https?:/.test(trimmedPlainText)) {
mode = "BLOCKS";
}
const content = (0,external_wp_blocks_namespaceObject.pasteHandler)({
HTML: html,
plainText,
mode,
tagName,
preserveWhiteSpace
});
if (typeof content === "string") {
pasteInline(content);
} else if (content.length > 0) {
if (onReplace && (0,external_wp_richText_namespaceObject.isEmpty)(value)) {
onReplace(content, content.length - 1, -1);
}
}
}
const { defaultView } = element.ownerDocument;
defaultView.addEventListener("paste", _onPaste);
return () => {
defaultView.removeEventListener("paste", _onPaste);
};
};
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/delete.js
var delete_default = (props) => (element) => {
function onKeyDown(event) {
const { keyCode } = event;
if (event.defaultPrevented) {
return;
}
const { value, onMerge, onRemove } = props.current;
if (keyCode === external_wp_keycodes_namespaceObject.DELETE || keyCode === external_wp_keycodes_namespaceObject.BACKSPACE) {
const { start, end, text } = value;
const isReverse = keyCode === external_wp_keycodes_namespaceObject.BACKSPACE;
const hasActiveFormats = value.activeFormats && !!value.activeFormats.length;
if (!(0,external_wp_richText_namespaceObject.isCollapsed)(value) || hasActiveFormats || isReverse && start !== 0 || !isReverse && end !== text.length) {
return;
}
if (onMerge) {
onMerge(!isReverse);
} else if (onRemove && (0,external_wp_richText_namespaceObject.isEmpty)(value) && isReverse) {
onRemove(!isReverse);
}
event.preventDefault();
}
}
element.addEventListener("keydown", onKeyDown);
return () => {
element.removeEventListener("keydown", onKeyDown);
};
};
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/enter.js
var enter_default = (props) => (element) => {
function onKeyDownDeprecated(event) {
if (event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) {
return;
}
const { onReplace, onSplit } = props.current;
if (onReplace && onSplit) {
event.__deprecatedOnSplit = true;
}
}
function onKeyDown(event) {
if (event.defaultPrevented) {
return;
}
if (event.target !== element) {
return;
}
if (event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) {
return;
}
const {
value,
onChange,
disableLineBreaks,
onSplitAtEnd,
onSplitAtDoubleLineEnd,
registry
} = props.current;
event.preventDefault();
const { text, start, end } = value;
if (event.shiftKey) {
if (!disableLineBreaks) {
onChange((0,external_wp_richText_namespaceObject.insert)(value, "\n"));
}
} else if (onSplitAtEnd && start === end && end === text.length) {
onSplitAtEnd();
} else if (
// For some blocks it's desirable to split at the end of the
// block when there are two line breaks at the end of the
// block, so triple Enter exits the block.
onSplitAtDoubleLineEnd && start === end && end === text.length && text.slice(-2) === "\n\n"
) {
registry.batch(() => {
const _value = { ...value };
_value.start = _value.end - 2;
onChange((0,external_wp_richText_namespaceObject.remove)(_value));
onSplitAtDoubleLineEnd();
});
} else if (!disableLineBreaks) {
onChange((0,external_wp_richText_namespaceObject.insert)(value, "\n"));
}
}
const { defaultView } = element.ownerDocument;
defaultView.addEventListener("keydown", onKeyDown);
element.addEventListener("keydown", onKeyDownDeprecated);
return () => {
defaultView.removeEventListener("keydown", onKeyDown);
element.removeEventListener("keydown", onKeyDownDeprecated);
};
};
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/firefox-compat.js
var firefox_compat_default = (props) => (element) => {
function onFocus() {
const { registry } = props.current;
if (!registry.select(store).isMultiSelecting()) {
return;
}
const parentEditable = element.parentElement.closest(
'[contenteditable="true"]'
);
if (parentEditable) {
parentEditable.focus();
}
}
element.addEventListener("focus", onFocus);
return () => {
element.removeEventListener("focus", onFocus);
};
};
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/index.js
const allEventListeners = [
before_input_rules_default,
input_rules_default,
insert_replacement_text_default,
remove_browser_shortcuts_default,
shortcuts_default,
input_events_default,
undo_automatic_change_default,
paste_handler_default,
delete_default,
enter_default,
firefox_compat_default
];
function useEventListeners(props) {
const propsRef = (0,external_wp_element_namespaceObject.useRef)(props);
(0,external_wp_element_namespaceObject.useInsertionEffect)(() => {
propsRef.current = props;
});
const refEffects = (0,external_wp_element_namespaceObject.useMemo)(
() => allEventListeners.map((refEffect) => refEffect(propsRef)),
[propsRef]
);
return (0,external_wp_compose_namespaceObject.useRefEffect)(
(element) => {
if (!props.isSelected) {
return;
}
const cleanups = refEffects.map((effect) => effect(element));
return () => {
cleanups.forEach((cleanup) => cleanup());
};
},
[refEffects, props.isSelected]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/format-edit.js
const format_edit_DEFAULT_BLOCK_CONTEXT = {};
const usesContextKey = Symbol("usesContext");
function format_edit_Edit({ onChange, onFocus, value, forwardedRef, settings }) {
const {
name,
edit: EditFunction,
[usesContextKey]: usesContext
} = settings;
const blockContext = (0,external_wp_element_namespaceObject.useContext)(block_context_default);
const context = (0,external_wp_element_namespaceObject.useMemo)(() => {
return usesContext ? Object.fromEntries(
Object.entries(blockContext).filter(
([key]) => usesContext.includes(key)
)
) : format_edit_DEFAULT_BLOCK_CONTEXT;
}, [usesContext, blockContext]);
if (!EditFunction) {
return null;
}
const activeFormat = (0,external_wp_richText_namespaceObject.getActiveFormat)(value, name);
const isActive = activeFormat !== void 0;
const activeObject = (0,external_wp_richText_namespaceObject.getActiveObject)(value);
const isObjectActive = activeObject !== void 0 && activeObject.type === name;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
EditFunction,
{
isActive,
activeAttributes: isActive ? activeFormat.attributes || {} : {},
isObjectActive,
activeObjectAttributes: isObjectActive ? activeObject.attributes || {} : {},
value,
onChange,
onFocus,
contentRef: forwardedRef,
context
},
name
);
}
function FormatEdit({ formatTypes, ...props }) {
return formatTypes.map((settings) => /* @__PURE__ */ (0,external_React_.createElement)(format_edit_Edit, { settings, ...props, key: settings.name }));
}
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/content.js
function valueToHTMLString(value, multiline) {
if (rich_text_default.isEmpty(value)) {
const multilineTag = getMultilineTag(multiline);
return multilineTag ? `<${multilineTag}></${multilineTag}>` : "";
}
if (Array.isArray(value)) {
external_wp_deprecated_default()("wp.blockEditor.RichText value prop as children type", {
since: "6.1",
version: "6.3",
alternative: "value prop as string",
link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
});
return external_wp_blocks_namespaceObject.children.toHTML(value);
}
if (typeof value === "string") {
return value;
}
return value.toHTMLString();
}
function Content({
value,
tagName: Tag,
multiline,
format,
...props
}) {
value = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: valueToHTMLString(value, multiline) });
return Tag ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...props, children: value }) : value;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/multiline.js
function RichTextMultiline({
children,
identifier,
tagName: TagName = "div",
value = "",
onChange,
multiline,
...props
}, forwardedRef) {
external_wp_deprecated_default()("wp.blockEditor.RichText multiline prop", {
since: "6.1",
version: "6.3",
alternative: "nested blocks (InnerBlocks)",
link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"
});
const { clientId } = useBlockEditContext();
const { getSelectionStart, getSelectionEnd } = (0,external_wp_data_namespaceObject.useSelect)(store);
const { selectionChange } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const multilineTagName = getMultilineTag(multiline);
value = value || `<${multilineTagName}></${multilineTagName}>`;
const padded = `</${multilineTagName}>${value}<${multilineTagName}>`;
const values = padded.split(
`</${multilineTagName}><${multilineTagName}>`
);
values.shift();
values.pop();
function _onChange(newValues) {
onChange(
`<${multilineTagName}>${newValues.join(
`</${multilineTagName}><${multilineTagName}>`
)}</${multilineTagName}>`
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ref: forwardedRef, children: values.map((_value, index) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
RichTextWrapper,
{
identifier: `${identifier}-${index}`,
tagName: multilineTagName,
value: _value,
onChange: (newValue) => {
const newValues = values.slice();
newValues[index] = newValue;
_onChange(newValues);
},
isSelected: void 0,
onKeyDown: (event) => {
if (event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) {
return;
}
event.preventDefault();
const { offset: start } = getSelectionStart();
const { offset: end } = getSelectionEnd();
if (typeof start !== "number" || typeof end !== "number") {
return;
}
const richTextValue = (0,external_wp_richText_namespaceObject.create)({ html: _value });
richTextValue.start = start;
richTextValue.end = end;
const array = (0,external_wp_richText_namespaceObject.split)(richTextValue).map(
(v) => (0,external_wp_richText_namespaceObject.toHTMLString)({ value: v })
);
const newValues = values.slice();
newValues.splice(index, 1, ...array);
_onChange(newValues);
selectionChange(
clientId,
`${identifier}-${index + 1}`,
0,
0
);
},
onMerge: (forward) => {
const newValues = values.slice();
let offset = 0;
if (forward) {
if (!newValues[index + 1]) {
return;
}
newValues.splice(
index,
2,
newValues[index] + newValues[index + 1]
);
offset = newValues[index].length - 1;
} else {
if (!newValues[index - 1]) {
return;
}
newValues.splice(
index - 1,
2,
newValues[index - 1] + newValues[index]
);
offset = newValues[index - 1].length - 1;
}
_onChange(newValues);
selectionChange(
clientId,
`${identifier}-${index - (forward ? 0 : 1)}`,
offset,
offset
);
},
...props
},
index
);
}) });
}
var multiline_default = (0,external_wp_element_namespaceObject.forwardRef)(RichTextMultiline);
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/with-deprecations.js
function withDeprecations(Component) {
return (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
let value = props.value;
let onChange = props.onChange;
if (Array.isArray(value)) {
external_wp_deprecated_default()("wp.blockEditor.RichText value prop as children type", {
since: "6.1",
version: "6.3",
alternative: "value prop as string",
link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
});
value = external_wp_blocks_namespaceObject.children.toHTML(props.value);
onChange = (newValue) => props.onChange(
external_wp_blocks_namespaceObject.children.fromDOM(
(0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, newValue).childNodes
)
);
}
const NewComponent = props.multiline ? multiline_default : Component;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
NewComponent,
{
...props,
value,
onChange,
ref
}
);
});
}
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/index.js
const keyboardShortcutContext = (0,external_wp_element_namespaceObject.createContext)();
keyboardShortcutContext.displayName = "keyboardShortcutContext";
const inputEventContext = (0,external_wp_element_namespaceObject.createContext)();
inputEventContext.displayName = "inputEventContext";
const instanceIdKey = Symbol("instanceId");
function removeNativeProps(props) {
const {
__unstableMobileNoFocusOnMount,
deleteEnter,
placeholderTextColor,
textAlign,
selectionColor,
tagsToEliminate,
disableEditingMenu,
fontSize,
fontFamily,
fontWeight,
fontStyle,
minWidth,
maxWidth,
disableSuggestions,
disableAutocorrection,
...restProps
} = props;
return restProps;
}
function RichTextWrapper({
children,
tagName = "div",
value: adjustedValue = "",
onChange: adjustedOnChange,
isSelected: originalIsSelected,
multiline,
inlineToolbar,
wrapperClassName,
autocompleters,
onReplace,
placeholder,
allowedFormats,
withoutInteractiveFormatting,
onRemove,
onMerge,
onSplit,
__unstableOnSplitAtEnd: onSplitAtEnd,
__unstableOnSplitAtDoubleLineEnd: onSplitAtDoubleLineEnd,
identifier,
preserveWhiteSpace,
__unstablePastePlainText: pastePlainText,
__unstableEmbedURLOnPaste,
__unstableDisableFormats: disableFormats,
disableLineBreaks,
__unstableAllowPrefixTransformations,
readOnly,
...props
}, forwardedRef) {
props = removeNativeProps(props);
if (onSplit) {
external_wp_deprecated_default()("wp.blockEditor.RichText onSplit prop", {
since: "6.4",
alternative: 'block.json support key: "splitting"'
});
}
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(RichTextWrapper);
const anchorRef = (0,external_wp_element_namespaceObject.useRef)();
const context = useBlockEditContext();
const { clientId, isSelected: isBlockSelected } = context;
const blockBindings = context[blockBindingsKey];
const blockContext = (0,external_wp_element_namespaceObject.useContext)(block_context_default);
const { bindableAttributes } = (0,external_wp_element_namespaceObject.useContext)(PrivateBlockContext);
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const selector = (select) => {
if (!isBlockSelected) {
return { isSelected: false };
}
const { getSelectionStart: getSelectionStart2, getSelectionEnd: getSelectionEnd2, getBlockEditingMode } = select(store);
const selectionStart2 = getSelectionStart2();
const selectionEnd2 = getSelectionEnd2();
let isSelected2;
if (originalIsSelected === void 0) {
isSelected2 = selectionStart2.clientId === clientId && selectionEnd2.clientId === clientId && (identifier ? selectionStart2.attributeKey === identifier : selectionStart2[instanceIdKey] === instanceId);
} else if (originalIsSelected) {
isSelected2 = selectionStart2.clientId === clientId;
}
return {
selectionStart: isSelected2 ? selectionStart2.offset : void 0,
selectionEnd: isSelected2 ? selectionEnd2.offset : void 0,
isSelected: isSelected2,
isContentOnly: getBlockEditingMode(clientId) === "contentOnly"
};
};
const { selectionStart, selectionEnd, isSelected, isContentOnly } = (0,external_wp_data_namespaceObject.useSelect)(selector, [
clientId,
identifier,
instanceId,
originalIsSelected,
isBlockSelected
]);
const { disableBoundBlock, bindingsPlaceholder, bindingsLabel } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
if (!blockBindings?.[identifier] || !bindableAttributes) {
return {};
}
const relatedBinding = blockBindings[identifier];
const blockBindingsSource = (0,external_wp_blocks_namespaceObject.getBlockBindingsSource)(
relatedBinding.source
);
const blockBindingsContext = {};
if (blockBindingsSource?.usesContext?.length) {
for (const key of blockBindingsSource.usesContext) {
blockBindingsContext[key] = blockContext[key];
}
}
const _disableBoundBlock = !blockBindingsSource?.canUserEditValue?.({
select,
context: blockBindingsContext,
args: relatedBinding.args
});
if (adjustedValue.length > 0) {
return {
disableBoundBlock: _disableBoundBlock,
// Null values will make them fall back to the default behavior.
bindingsPlaceholder: null,
bindingsLabel: null
};
}
const { getBlockAttributes } = select(store);
const blockAttributes = getBlockAttributes(clientId);
let clientSideFieldLabel = null;
if (blockBindingsSource?.getFieldsList) {
const fieldsItems = blockBindingsSource.getFieldsList({
select,
context: blockBindingsContext
});
clientSideFieldLabel = fieldsItems?.find(
(item) => es6_default()(item.args, relatedBinding?.args)
)?.label;
}
const bindingKey = clientSideFieldLabel ?? blockBindingsSource?.label;
const _bindingsPlaceholder = _disableBoundBlock ? bindingKey : (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: connected field label or source label */
(0,external_wp_i18n_namespaceObject.__)("Add %s"),
bindingKey
);
const _bindingsLabel = _disableBoundBlock ? relatedBinding?.args?.key || blockBindingsSource?.label : (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: source label or key */
(0,external_wp_i18n_namespaceObject.__)("Empty %s; start writing to edit its value"),
relatedBinding?.args?.key || blockBindingsSource?.label
);
return {
disableBoundBlock: _disableBoundBlock,
bindingsPlaceholder: blockAttributes?.placeholder || _bindingsPlaceholder,
bindingsLabel: _bindingsLabel
};
},
[
blockBindings,
identifier,
bindableAttributes,
adjustedValue,
clientId,
blockContext
]
);
const isInsidePatternOverrides = !!blockContext?.["pattern/overrides"];
const hasOverrideEnabled = blockBindings?.__default?.source === "core/pattern-overrides";
const shouldDisableForPattern = isInsidePatternOverrides && !hasOverrideEnabled;
const shouldDisableEditing = readOnly || disableBoundBlock || shouldDisableForPattern;
const { getSelectionStart, getSelectionEnd, getBlockRootClientId } = (0,external_wp_data_namespaceObject.useSelect)(store);
const { selectionChange } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const adjustedAllowedFormats = getAllowedFormats({
allowedFormats,
disableFormats
});
const hasFormats = !adjustedAllowedFormats || adjustedAllowedFormats.length > 0;
const onSelectionChange = (0,external_wp_element_namespaceObject.useCallback)(
(start, end) => {
const selection = {};
const unset = start === void 0 && end === void 0;
const baseSelection = {
clientId,
[identifier ? "attributeKey" : instanceIdKey]: identifier ? identifier : instanceId
};
if (typeof start === "number" || unset) {
if (end === void 0 && getBlockRootClientId(clientId) !== getBlockRootClientId(getSelectionEnd().clientId)) {
return;
}
selection.start = {
...baseSelection,
offset: start
};
}
if (typeof end === "number" || unset) {
if (start === void 0 && getBlockRootClientId(clientId) !== getBlockRootClientId(getSelectionStart().clientId)) {
return;
}
selection.end = {
...baseSelection,
offset: end
};
}
selectionChange(selection);
},
[
clientId,
getBlockRootClientId,
getSelectionEnd,
getSelectionStart,
identifier,
instanceId,
selectionChange
]
);
const {
formatTypes,
prepareHandlers,
valueHandlers,
changeHandlers,
dependencies
} = useFormatTypes({
clientId,
identifier,
allowedFormats: adjustedAllowedFormats,
withoutInteractiveFormatting,
disableNoneEssentialFormatting: isContentOnly
});
function addEditorOnlyFormats(value2) {
return valueHandlers.reduce(
(accumulator, fn) => fn(accumulator, value2.text),
value2.formats
);
}
function removeEditorOnlyFormats(value2) {
formatTypes.forEach((formatType) => {
if (formatType.__experimentalCreatePrepareEditableTree) {
value2 = (0,external_wp_richText_namespaceObject.removeFormat)(
value2,
formatType.name,
0,
value2.text.length
);
}
});
return value2.formats;
}
function addInvisibleFormats(value2) {
return prepareHandlers.reduce(
(accumulator, fn) => fn(accumulator, value2.text),
value2.formats
);
}
const {
value,
getValue,
onChange,
ref: richTextRef
} = (0,external_wp_richText_namespaceObject.__unstableUseRichText)({
value: adjustedValue,
onChange(html, { __unstableFormats, __unstableText }) {
adjustedOnChange(html);
Object.values(changeHandlers).forEach((changeHandler) => {
changeHandler(__unstableFormats, __unstableText);
});
},
selectionStart,
selectionEnd,
onSelectionChange,
placeholder: bindingsPlaceholder || placeholder,
__unstableIsSelected: isSelected,
__unstableDisableFormats: disableFormats,
preserveWhiteSpace,
__unstableDependencies: [...dependencies, tagName],
__unstableAfterParse: addEditorOnlyFormats,
__unstableBeforeSerialize: removeEditorOnlyFormats,
__unstableAddInvisibleFormats: addInvisibleFormats
});
const autocompleteProps = useBlockEditorAutocompleteProps({
onReplace,
completers: autocompleters,
record: value,
onChange
});
useMarkPersistent({ html: adjustedValue, value });
const keyboardShortcuts = (0,external_wp_element_namespaceObject.useRef)(/* @__PURE__ */ new Set());
const inputEvents = (0,external_wp_element_namespaceObject.useRef)(/* @__PURE__ */ new Set());
function onFocus() {
anchorRef.current?.focus();
}
const TagName = tagName;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
isSelected && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboardShortcutContext.Provider, { value: keyboardShortcuts, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inputEventContext.Provider, { value: inputEvents, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Popover.__unstableSlotNameProvider, { value: "__unstable-block-tools-after", children: [
children && children({ value, onChange, onFocus }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FormatEdit,
{
value,
onChange,
onFocus,
formatTypes,
forwardedRef: anchorRef
}
)
] }) }) }),
isSelected && hasFormats && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
format_toolbar_container_default,
{
inline: inlineToolbar,
editableContentElement: anchorRef.current
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
TagName,
{
role: "textbox",
"aria-multiline": !disableLineBreaks,
"aria-readonly": shouldDisableEditing,
...props,
draggable: void 0,
"aria-label": bindingsLabel || props["aria-label"] || placeholder,
...autocompleteProps,
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([
// Rich text ref must be first because its focus listener
// must be set up before any other ref calls .focus() on
// mount.
richTextRef,
forwardedRef,
autocompleteProps.ref,
props.ref,
useEventListeners({
registry,
getValue,
onChange,
__unstableAllowPrefixTransformations,
formatTypes,
onReplace,
selectionChange,
isSelected,
disableFormats,
value,
tagName,
onSplit,
__unstableEmbedURLOnPaste,
pastePlainText,
onMerge,
onRemove,
removeEditorOnlyFormats,
disableLineBreaks,
onSplitAtEnd,
onSplitAtDoubleLineEnd,
keyboardShortcuts,
inputEvents
}),
anchorRef
]),
contentEditable: !shouldDisableEditing,
suppressContentEditableWarning: true,
className: dist_clsx(
"block-editor-rich-text__editable",
props.className,
"rich-text"
),
tabIndex: props.tabIndex === 0 && !shouldDisableEditing ? null : props.tabIndex,
"data-wp-block-attribute-key": identifier
}
)
] });
}
const PrivateRichText = withDeprecations(
(0,external_wp_element_namespaceObject.forwardRef)(RichTextWrapper)
);
PrivateRichText.Content = Content;
PrivateRichText.isEmpty = (value) => {
return !value || value.length === 0;
};
const PublicForwardedRichTextContainer = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
const context = useBlockEditContext();
const isPreviewMode = context[isPreviewModeKey];
if (isPreviewMode) {
const {
children,
tagName: Tag = "div",
value,
onChange,
isSelected,
multiline,
inlineToolbar,
wrapperClassName,
autocompleters,
onReplace,
placeholder,
allowedFormats,
withoutInteractiveFormatting,
onRemove,
onMerge,
onSplit,
__unstableOnSplitAtEnd,
__unstableOnSplitAtDoubleLineEnd,
identifier,
preserveWhiteSpace,
__unstablePastePlainText,
__unstableEmbedURLOnPaste,
__unstableDisableFormats,
disableLineBreaks,
__unstableAllowPrefixTransformations,
readOnly,
...contentProps
} = removeNativeProps(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Tag,
{
ref,
...contentProps,
dangerouslySetInnerHTML: {
__html: valueToHTMLString(value, multiline)
}
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateRichText, { ref, ...props, readOnly: false });
});
PublicForwardedRichTextContainer.Content = Content;
PublicForwardedRichTextContainer.isEmpty = (value) => {
return !value || value.length === 0;
};
var rich_text_default = PublicForwardedRichTextContainer;
;// ./node_modules/@wordpress/block-editor/build-module/components/editable-text/index.js
const EditableText = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(rich_text_default, { ref, ...props, __unstableDisableFormats: true });
});
EditableText.Content = ({ value = "", tagName: Tag = "div", ...props }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...props, children: value });
};
var editable_text_default = EditableText;
;// ./node_modules/@wordpress/block-editor/build-module/components/plain-text/index.js
const PlainText = (0,external_wp_element_namespaceObject.forwardRef)(({ __experimentalVersion, ...props }, ref) => {
if (__experimentalVersion === 2) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(editable_text_default, { ref, ...props });
}
const { className, onChange, ...remainingProps } = props;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
lib/* default */.A,
{
ref,
className: dist_clsx("block-editor-plain-text", className),
onChange: (event) => onChange(event.target.value),
...remainingProps
}
);
});
var plain_text_default = PlainText;
;// ./node_modules/@wordpress/block-editor/build-module/components/responsive-block-control/label.js
function ResponsiveBlockControlLabel({
property,
viewport,
desc
}) {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ResponsiveBlockControlLabel);
const accessibleLabel = desc || (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: property name. 2: viewport name. */
(0,external_wp_i18n_namespaceObject._x)(
"Controls the %1$s property for %2$s viewports.",
"Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."
),
property,
viewport.label
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-describedby": `rbc-desc-${instanceId}`, children: viewport.label }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "span", id: `rbc-desc-${instanceId}`, children: accessibleLabel })
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/responsive-block-control/index.js
function ResponsiveBlockControl(props) {
const {
title,
property,
toggleLabel,
onIsResponsiveChange,
renderDefaultControl,
renderResponsiveControls,
isResponsive = false,
defaultLabel = {
id: "all",
label: (0,external_wp_i18n_namespaceObject._x)("All", "screen sizes")
},
viewports = [
{
id: "small",
label: (0,external_wp_i18n_namespaceObject.__)("Small screens")
},
{
id: "medium",
label: (0,external_wp_i18n_namespaceObject.__)("Medium screens")
},
{
id: "large",
label: (0,external_wp_i18n_namespaceObject.__)("Large screens")
}
]
} = props;
if (!title || !property || !renderDefaultControl) {
return null;
}
const toggleControlLabel = toggleLabel || (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Property value for the control (eg: margin, padding, etc.). */
(0,external_wp_i18n_namespaceObject.__)("Use the same %s on all screen sizes."),
property
);
const toggleHelpText = (0,external_wp_i18n_namespaceObject.__)(
"Choose whether to use the same value for all screen sizes or a unique value for each screen size."
);
const defaultControl = renderDefaultControl(
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ResponsiveBlockControlLabel,
{
property,
viewport: defaultLabel
}
),
defaultLabel
);
const defaultResponsiveControls = () => {
return viewports.map((viewport) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.Fragment, { children: renderDefaultControl(
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ResponsiveBlockControlLabel,
{
property,
viewport
}
),
viewport
) }, viewport.id));
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "block-editor-responsive-block-control", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("legend", { className: "block-editor-responsive-block-control__title", children: title }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-responsive-block-control__inner", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
className: "block-editor-responsive-block-control__toggle",
label: toggleControlLabel,
checked: !isResponsive,
onChange: onIsResponsiveChange,
help: toggleHelpText
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
className: dist_clsx(
"block-editor-responsive-block-control__group",
{
"is-responsive": isResponsive
}
),
children: [
!isResponsive && defaultControl,
isResponsive && (renderResponsiveControls ? renderResponsiveControls(viewports) : defaultResponsiveControls())
]
}
)
] })
] });
}
var responsive_block_control_default = ResponsiveBlockControl;
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/shortcut.js
function RichTextShortcut({ character, type, onUse }) {
const keyboardShortcuts = (0,external_wp_element_namespaceObject.useContext)(keyboardShortcutContext);
const onUseRef = (0,external_wp_element_namespaceObject.useRef)();
onUseRef.current = onUse;
(0,external_wp_element_namespaceObject.useEffect)(() => {
function callback(event) {
if (external_wp_keycodes_namespaceObject.isKeyboardEvent[type](event, character)) {
onUseRef.current();
event.preventDefault();
}
}
keyboardShortcuts.current.add(callback);
return () => {
keyboardShortcuts.current.delete(callback);
};
}, [character, type]);
return null;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/toolbar-button.js
function RichTextToolbarButton({
name,
shortcutType,
shortcutCharacter,
...props
}) {
let shortcut;
let fillName = "RichText.ToolbarControls";
if (name) {
fillName += `.${name}`;
}
if (shortcutType && shortcutCharacter) {
shortcut = external_wp_keycodes_namespaceObject.displayShortcut[shortcutType](shortcutCharacter);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, { name: fillName, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { ...props, shortcut }) });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/input-event.js
function __unstableRichTextInputEvent({ inputType, onInput }) {
const callbacks = (0,external_wp_element_namespaceObject.useContext)(inputEventContext);
const onInputRef = (0,external_wp_element_namespaceObject.useRef)();
onInputRef.current = onInput;
(0,external_wp_element_namespaceObject.useEffect)(() => {
function callback(event) {
if (event.inputType === inputType) {
onInputRef.current();
event.preventDefault();
}
}
callbacks.current.add(callback);
return () => {
callbacks.current.delete(callback);
};
}, [inputType]);
return null;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/unit-control/index.js
function UnitControl({ units: unitsProp, ...props }) {
const [availableUnits] = use_settings_useSettings("spacing.units");
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits: availableUnits || ["%", "px", "em", "rem", "vw"],
units: unitsProp
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { units, ...props });
}
;// ./node_modules/@wordpress/icons/build-module/library/arrow-left.js
var arrow_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/url-input/button.js
function URLInputButton({ url, onChange }) {
const [expanded, toggleExpanded] = (0,external_wp_element_namespaceObject.useReducer)(
(isExpanded) => !isExpanded,
false
);
const submitLink = (event) => {
event.preventDefault();
toggleExpanded();
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-url-input__button", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "compact",
icon: link_default,
label: url ? (0,external_wp_i18n_namespaceObject.__)("Edit link") : (0,external_wp_i18n_namespaceObject.__)("Insert link"),
onClick: toggleExpanded,
className: "components-toolbar__control",
isPressed: !!url
}
),
expanded && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"form",
{
className: "block-editor-url-input__button-modal",
onSubmit: submitLink,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-url-input__button-modal-line", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
className: "block-editor-url-input__back",
icon: arrow_left_default,
label: (0,external_wp_i18n_namespaceObject.__)("Close"),
onClick: toggleExpanded
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
url_input_default,
{
value: url || "",
onChange,
suffix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlSuffixWrapper, { variant: "control", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "small",
icon: keyboard_return_default,
label: (0,external_wp_i18n_namespaceObject.__)("Submit"),
type: "submit"
}
) })
}
)
] })
}
)
] });
}
var button_default = URLInputButton;
;// ./node_modules/@wordpress/icons/build-module/library/image.js
var image_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" }) });
;// ./node_modules/@wordpress/block-editor/build-module/components/url-popover/image-url-input-ui.js
const LINK_DESTINATION_NONE = "none";
const LINK_DESTINATION_CUSTOM = "custom";
const LINK_DESTINATION_MEDIA = "media";
const LINK_DESTINATION_ATTACHMENT = "attachment";
const NEW_TAB_REL = ["noreferrer", "noopener"];
const ImageURLInputUI = ({
linkDestination,
onChangeUrl,
url,
mediaType = "image",
mediaUrl,
mediaLink,
linkTarget,
linkClass,
rel,
showLightboxSetting,
lightboxEnabled,
onSetLightbox,
resetLightbox
}) => {
const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)(false);
const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
const openLinkUI = () => {
setIsOpen(true);
};
const [isEditingLink, setIsEditingLink] = (0,external_wp_element_namespaceObject.useState)(false);
const [urlInput, setUrlInput] = (0,external_wp_element_namespaceObject.useState)(null);
const autocompleteRef = (0,external_wp_element_namespaceObject.useRef)(null);
const wrapperRef = (0,external_wp_element_namespaceObject.useRef)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!wrapperRef.current) {
return;
}
const nextFocusTarget = external_wp_dom_namespaceObject.focus.focusable.find(wrapperRef.current)[0] || wrapperRef.current;
nextFocusTarget.focus();
}, [isEditingLink, url, lightboxEnabled]);
const startEditLink = () => {
if (linkDestination === LINK_DESTINATION_MEDIA || linkDestination === LINK_DESTINATION_ATTACHMENT) {
setUrlInput("");
}
setIsEditingLink(true);
};
const stopEditLink = () => {
setIsEditingLink(false);
};
const closeLinkUI = () => {
setUrlInput(null);
stopEditLink();
setIsOpen(false);
};
const getUpdatedLinkTargetSettings = (value) => {
const newLinkTarget = value ? "_blank" : void 0;
let updatedRel;
if (newLinkTarget) {
const rels = (rel ?? "").split(" ");
NEW_TAB_REL.forEach((relVal) => {
if (!rels.includes(relVal)) {
rels.push(relVal);
}
});
updatedRel = rels.join(" ");
} else {
const rels = (rel ?? "").split(" ").filter(
(relVal) => NEW_TAB_REL.includes(relVal) === false
);
updatedRel = rels.length ? rels.join(" ") : void 0;
}
return {
linkTarget: newLinkTarget,
rel: updatedRel
};
};
const onFocusOutside = () => {
return (event) => {
const autocompleteElement = autocompleteRef.current;
if (autocompleteElement && autocompleteElement.contains(event.target)) {
return;
}
setIsOpen(false);
setUrlInput(null);
stopEditLink();
};
};
const onSubmitLinkChange = () => {
return (event) => {
if (urlInput) {
const selectedDestination = getLinkDestinations().find(
(destination) => destination.url === urlInput
)?.linkDestination || LINK_DESTINATION_CUSTOM;
onChangeUrl({
href: (0,external_wp_url_namespaceObject.prependHTTP)(urlInput),
linkDestination: selectedDestination,
lightbox: { enabled: false }
});
}
stopEditLink();
setUrlInput(null);
event.preventDefault();
};
};
const onLinkRemove = () => {
onChangeUrl({
linkDestination: LINK_DESTINATION_NONE,
href: ""
});
};
const getLinkDestinations = () => {
const linkDestinations = [
{
linkDestination: LINK_DESTINATION_MEDIA,
title: (0,external_wp_i18n_namespaceObject.__)("Link to image file"),
url: mediaType === "image" ? mediaUrl : void 0,
icon: image_default
}
];
if (mediaType === "image" && mediaLink) {
linkDestinations.push({
linkDestination: LINK_DESTINATION_ATTACHMENT,
title: (0,external_wp_i18n_namespaceObject.__)("Link to attachment page"),
url: mediaType === "image" ? mediaLink : void 0,
icon: page_default
});
}
return linkDestinations;
};
const onSetHref = (value) => {
const linkDestinations = getLinkDestinations();
let linkDestinationInput;
if (!value) {
linkDestinationInput = LINK_DESTINATION_NONE;
} else {
linkDestinationInput = (linkDestinations.find((destination) => {
return destination.url === value;
}) || { linkDestination: LINK_DESTINATION_CUSTOM }).linkDestination;
}
onChangeUrl({
linkDestination: linkDestinationInput,
href: value
});
};
const onSetNewTab = (value) => {
const updatedLinkTarget = getUpdatedLinkTargetSettings(value);
onChangeUrl(updatedLinkTarget);
};
const onSetLinkRel = (value) => {
onChangeUrl({ rel: value });
};
const onSetLinkClass = (value) => {
onChangeUrl({ linkClass: value });
};
const advancedOptions = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "3", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Open in new tab"),
onChange: onSetNewTab,
checked: linkTarget === "_blank"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Link relation"),
value: rel ?? "",
onChange: onSetLinkRel,
help: (0,external_wp_element_namespaceObject.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.__)(
"The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document."
),
{
a: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: "https://developer.mozilla.org/docs/Web/HTML/Attributes/rel" })
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Link CSS class"),
value: linkClass || "",
onChange: onSetLinkClass
}
)
] });
const linkEditorValue = urlInput !== null ? urlInput : url;
const hideLightboxPanel = !lightboxEnabled || lightboxEnabled && !showLightboxSetting;
const showLinkEditor = !linkEditorValue && hideLightboxPanel;
const urlLabel = (getLinkDestinations().find(
(destination) => destination.linkDestination === linkDestination
) || {}).title;
const PopoverChildren = () => {
if (lightboxEnabled && showLightboxSetting && !url && !isEditingLink) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-url-popover__expand-on-click", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: fullscreen_default }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "text", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)("Enlarge on click") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "description", children: (0,external_wp_i18n_namespaceObject.__)("Scales the image with a lightbox effect") })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
icon: link_off_default,
label: (0,external_wp_i18n_namespaceObject.__)("Disable enlarge on click"),
onClick: () => {
onSetLightbox?.(false);
},
size: "compact"
}
)
] });
} else if (!url || isEditingLink) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
url_popover_default.LinkEditor,
{
className: "block-editor-format-toolbar__link-container-content",
value: linkEditorValue,
onChangeInputValue: setUrlInput,
onSubmit: onSubmitLinkChange(),
autocompleteRef
}
);
} else if (url && !isEditingLink) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
url_popover_default.LinkViewer,
{
className: "block-editor-format-toolbar__link-container-content",
url,
onEditLinkClick: startEditLink,
urlLabel
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
icon: link_off_default,
label: (0,external_wp_i18n_namespaceObject.__)("Remove link"),
onClick: () => {
onLinkRemove();
resetLightbox?.();
},
size: "compact"
}
)
] });
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
icon: link_default,
className: "components-toolbar__control",
label: (0,external_wp_i18n_namespaceObject.__)("Link"),
"aria-expanded": isOpen,
onClick: openLinkUI,
ref: setPopoverAnchor,
isActive: !!url || lightboxEnabled && showLightboxSetting
}
),
isOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
url_popover_default,
{
ref: wrapperRef,
anchor: popoverAnchor,
onFocusOutside: onFocusOutside(),
onClose: closeLinkUI,
renderSettings: hideLightboxPanel ? () => advancedOptions : null,
additionalControls: showLinkEditor && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.NavigableMenu, { children: [
getLinkDestinations().map((link) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
icon: link.icon,
iconPosition: "left",
onClick: () => {
setUrlInput(null);
onSetHref(link.url);
stopEditLink();
},
children: link.title
},
link.linkDestination
)),
showLightboxSetting && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
className: "block-editor-url-popover__expand-on-click",
icon: fullscreen_default,
info: (0,external_wp_i18n_namespaceObject.__)(
"Scale the image with a lightbox effect."
),
iconPosition: "left",
onClick: () => {
setUrlInput(null);
onChangeUrl({
linkDestination: LINK_DESTINATION_NONE,
href: ""
});
onSetLightbox?.(true);
stopEditLink();
},
children: (0,external_wp_i18n_namespaceObject.__)("Enlarge on click")
},
"expand-on-click"
)
] }),
offset: 13,
children: PopoverChildren()
}
)
] });
};
;// ./node_modules/@wordpress/block-editor/build-module/components/preview-options/index.js
function PreviewOptions() {
external_wp_deprecated_default()("wp.blockEditor.PreviewOptions", {
version: "6.5"
});
return null;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/use-resize-canvas/index.js
function useResizeCanvas(deviceType) {
const [actualWidth, updateActualWidth] = (0,external_wp_element_namespaceObject.useState)(window.innerWidth);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (deviceType === "Desktop") {
return;
}
const resizeListener = () => updateActualWidth(window.innerWidth);
window.addEventListener("resize", resizeListener);
return () => {
window.removeEventListener("resize", resizeListener);
};
}, [deviceType]);
const getCanvasWidth = (device) => {
let deviceWidth;
switch (device) {
case "Tablet":
deviceWidth = 780;
break;
case "Mobile":
deviceWidth = 360;
break;
default:
return null;
}
return deviceWidth < actualWidth ? deviceWidth : actualWidth;
};
const contentInlineStyles = (device) => {
const height = device === "Mobile" ? "768px" : "1024px";
const marginVertical = "40px";
const marginHorizontal = "auto";
switch (device) {
case "Tablet":
case "Mobile":
return {
width: getCanvasWidth(device),
// Keeping margin styles separate to avoid warnings
// when those props get overridden in the iframe component
marginTop: marginVertical,
marginBottom: marginVertical,
marginLeft: marginHorizontal,
marginRight: marginHorizontal,
height,
overflowY: "auto"
};
default:
return {
marginLeft: marginHorizontal,
marginRight: marginHorizontal
};
}
};
return contentInlineStyles(deviceType);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-inspector/edit-contents-button.js
function EditContentsButton({ clientId }) {
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const { attributes } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
return {
attributes: select(store).getBlockAttributes(clientId)
};
},
[clientId]
);
if (!attributes?.metadata?.patternName) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
className: "block-editor-block-inspector-edit-contents-button",
__next40pxDefaultSize: true,
variant: "secondary",
onClick: () => {
const { patternName, ...metadataWithoutPatternName } = attributes?.metadata ?? {};
updateBlockAttributes(clientId, {
...attributes,
metadata: metadataWithoutPatternName
});
},
children: (0,external_wp_i18n_namespaceObject.__)("Edit contents")
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/skip-to-selected-block/index.js
function SkipToSelectedBlock() {
const selectedBlockClientId = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).getBlockSelectionStart(),
[]
);
const ref = (0,external_wp_element_namespaceObject.useRef)();
useBlockElementRef(selectedBlockClientId, ref);
const onClick = () => {
ref.current?.focus();
};
return selectedBlockClientId ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "secondary",
className: "block-editor-skip-to-selected-block",
onClick,
children: (0,external_wp_i18n_namespaceObject.__)("Skip to the selected block")
}
) : null;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/multi-selection-inspector/index.js
function MultiSelectionInspector() {
const selectedBlockCount = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).getSelectedBlockCount(),
[]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
justify: "flex-start",
spacing: 2,
className: "block-editor-multi-selection-inspector__card",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon_default, { icon: copy_default, showColors: true }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-multi-selection-inspector__card-title", children: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: number of blocks */
(0,external_wp_i18n_namespaceObject._n)("%d Block", "%d Blocks", selectedBlockCount),
selectedBlockCount
) })
]
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/cog.js
var cog_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
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",
clipRule: "evenodd"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/styles.js
var styles_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z"
}
) });
;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/utils.js
const TAB_SETTINGS = {
name: "settings",
title: (0,external_wp_i18n_namespaceObject.__)("Settings"),
value: "settings",
icon: cog_default
};
const TAB_STYLES = {
name: "styles",
title: (0,external_wp_i18n_namespaceObject.__)("Styles"),
value: "styles",
icon: styles_default
};
const TAB_CONTENT = {
name: "content",
title: (0,external_wp_i18n_namespaceObject.__)("Content"),
value: "content",
icon: page_default
};
const TAB_LIST_VIEW = {
name: "list",
title: (0,external_wp_i18n_namespaceObject.__)("List View"),
value: "list-view",
icon: list_view_default
};
;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/advanced-controls-panel.js
const AdvancedControls = () => {
const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(InspectorAdvancedControls.slotName);
const privateFills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(
PrivateInspectorControlsAllowedBlocks.name
);
const hasFills = Boolean(fills && fills.length);
const hasPrivateFills = Boolean(privateFills && privateFills.length);
if (!hasFills && !hasPrivateFills) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.PanelBody,
{
className: "block-editor-block-inspector__advanced",
title: (0,external_wp_i18n_namespaceObject.__)("Advanced"),
initialOpen: false,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default.Slot, { group: "advanced" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateInspectorControlsAllowedBlocks.Slot, {})
]
}
);
};
var advanced_controls_panel_default = AdvancedControls;
;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/position-controls-panel.js
const PositionControlsPanel = () => {
const { selectedClientIds, selectedBlocks, hasPositionAttribute } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getBlocksByClientId, getSelectedBlockClientIds } = select(store);
const selectedBlockClientIds = getSelectedBlockClientIds();
const _selectedBlocks = getBlocksByClientId(
selectedBlockClientIds
);
return {
selectedClientIds: selectedBlockClientIds,
selectedBlocks: _selectedBlocks,
hasPositionAttribute: _selectedBlocks?.some(
({ attributes }) => !!attributes?.style?.position?.type
)
};
}, []);
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
function resetPosition() {
if (!selectedClientIds?.length || !selectedBlocks?.length) {
return;
}
const attributesByClientId = Object.fromEntries(
selectedBlocks?.map(({ clientId, attributes }) => [
clientId,
{
style: utils_cleanEmptyObject({
...attributes?.style,
position: {
...attributes?.style?.position,
type: void 0,
top: void 0,
right: void 0,
bottom: void 0,
left: void 0
}
})
}
])
);
updateBlockAttributes(selectedClientIds, attributesByClientId, true);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
className: "block-editor-block-inspector__position",
label: (0,external_wp_i18n_namespaceObject.__)("Position"),
resetAll: resetPosition,
dropdownMenuProps,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
isShownByDefault: hasPositionAttribute,
label: (0,external_wp_i18n_namespaceObject.__)("Position"),
hasValue: () => hasPositionAttribute,
onDeselect: resetPosition,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default.Slot, { group: "position" })
}
)
}
);
};
const PositionControls = () => {
const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(groups_groups_default.position.name);
const hasFills = Boolean(fills && fills.length);
if (!hasFills) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PositionControlsPanel, {});
};
var position_controls_panel_default = PositionControls;
;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/settings-tab.js
const SettingsTab = ({ showAdvancedControls = false }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default.Slot, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(position_controls_panel_default, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default.Slot, { group: "bindings" }),
showAdvancedControls && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(advanced_controls_panel_default, {}) })
] });
var settings_tab_default = SettingsTab;
;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/styles-tab.js
const StylesTab = ({
blockName,
clientId,
hasBlockStyles,
isSectionBlock
}) => {
const borderPanelLabel = useBorderPanelLabel({ blockName });
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
hasBlockStyles && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)("Styles"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_styles_default, { clientId }) }) }),
!isSectionBlock && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inspector_controls_default.Slot,
{
group: "color",
label: (0,external_wp_i18n_namespaceObject.__)("Color"),
className: "color-block-support-panel__inner-wrapper"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inspector_controls_default.Slot,
{
group: "background",
label: (0,external_wp_i18n_namespaceObject.__)("Background image")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default.Slot, { group: "filter" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inspector_controls_default.Slot,
{
group: "typography",
label: (0,external_wp_i18n_namespaceObject.__)("Typography")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inspector_controls_default.Slot,
{
group: "dimensions",
label: (0,external_wp_i18n_namespaceObject.__)("Dimensions")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inspector_controls_default.Slot,
{
group: "border",
label: borderPanelLabel
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default.Slot, { group: "styles" })
] })
] });
};
var styles_tab_default = StylesTab;
;// ./node_modules/@wordpress/block-editor/build-module/components/block-quick-navigation/index.js
function BlockQuickNavigation({ clientIds, onSelect }) {
if (!clientIds.length) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 1, children: clientIds.map((clientId) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockQuickNavigationItem,
{
onSelect,
clientId
},
clientId
)) });
}
function BlockQuickNavigationItem({ clientId, onSelect }) {
const blockInformation = useBlockDisplayInformation(clientId);
const blockTitle = useBlockDisplayTitle({
clientId,
context: "list-view"
});
const { isSelected } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { isBlockSelected, hasSelectedInnerBlock } = select(store);
return {
isSelected: isBlockSelected(clientId) || hasSelectedInnerBlock(
clientId,
/* deep: */
true
)
};
},
[clientId]
);
const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
isPressed: isSelected,
onClick: async () => {
await selectBlock(clientId);
if (onSelect) {
onSelect(clientId);
}
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon_default, { icon: blockInformation?.icon }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { style: { textAlign: "left" }, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { children: blockTitle }) })
] })
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/content-tab.js
const ContentTab = ({ contentClientIds }) => {
if (!contentClientIds || contentClientIds.length === 0) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)("Content"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockQuickNavigation, { clientIds: contentClientIds }) });
};
var content_tab_default = ContentTab;
;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js
const allowlist = ["core/navigation"];
const useIsListViewTabDisabled = (blockName) => {
return !allowlist.includes(blockName);
};
var use_is_list_view_tab_disabled_default = useIsListViewTabDisabled;
;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/index.js
const { Tabs: inspector_controls_tabs_Tabs } = unlock(external_wp_components_namespaceObject.privateApis);
function InspectorControlsTabs({
blockName,
clientId,
hasBlockStyles,
tabs,
isSectionBlock,
contentClientIds
}) {
const showIconLabels = (0,external_wp_data_namespaceObject.useSelect)((select) => {
return select(external_wp_preferences_namespaceObject.store).get("core", "showIconLabels");
}, []);
const initialTabName = !use_is_list_view_tab_disabled_default(blockName) ? TAB_LIST_VIEW.name : void 0;
const [selectedTabId, setSelectedTabId] = (0,external_wp_element_namespaceObject.useState)(
initialTabName ?? tabs[0]?.name
);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (initialTabName) {
return;
}
if (tabs?.length && selectedTabId) {
const activeTab = tabs.find(
(tab) => tab.name === selectedTabId
);
if (!activeTab) {
setSelectedTabId(tabs[0].name);
}
}
}, [tabs, selectedTabId, initialTabName]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-inspector__tabs", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
inspector_controls_tabs_Tabs,
{
defaultTabId: initialTabName,
selectedTabId,
onSelect: setSelectedTabId,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_tabs_Tabs.TabList, { children: tabs.map(
(tab) => showIconLabels ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_tabs_Tabs.Tab, { tabId: tab.name, children: tab.title }, tab.name) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: tab.title, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inspector_controls_tabs_Tabs.Tab,
{
tabId: tab.name,
"aria-label": tab.title,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: tab.icon })
}
) }, tab.name)
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_tabs_Tabs.TabPanel, { tabId: TAB_SETTINGS.name, focusable: false, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(settings_tab_default, { showAdvancedControls: !!blockName }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_tabs_Tabs.TabPanel, { tabId: TAB_STYLES.name, focusable: false, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
styles_tab_default,
{
blockName,
clientId,
hasBlockStyles,
isSectionBlock
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_tabs_Tabs.TabPanel, { tabId: TAB_CONTENT.name, focusable: false, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(content_tab_default, { contentClientIds }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_tabs_Tabs.TabPanel, { tabId: TAB_LIST_VIEW.name, focusable: false, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default.Slot, { group: "list" }) })
]
},
clientId
) });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js
const use_inspector_controls_tabs_EMPTY_ARRAY = [];
function getShowTabs(blockName, tabSettings = {}) {
if (tabSettings[blockName] !== void 0) {
return tabSettings[blockName];
}
if (tabSettings.default !== void 0) {
return tabSettings.default;
}
return true;
}
function useInspectorControlsTabs(blockName, contentClientIds, isSectionBlock, hasBlockStyles) {
const tabs = [];
const {
bindings: bindingsGroup,
border: borderGroup,
color: colorGroup,
default: defaultGroup,
dimensions: dimensionsGroup,
list: listGroup,
position: positionGroup,
styles: stylesGroup,
typography: typographyGroup,
effects: effectsGroup
} = groups_groups_default;
const listViewDisabled = use_is_list_view_tab_disabled_default(blockName);
const listFills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(listGroup.name);
const hasListFills = !listViewDisabled && !!listFills && listFills.length;
const styleFills = [
...(0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(borderGroup.name) || [],
...(0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(colorGroup.name) || [],
...(0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(dimensionsGroup.name) || [],
...(0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(stylesGroup.name) || [],
...(0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(typographyGroup.name) || [],
...(0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(effectsGroup.name) || []
];
const hasStyleFills = styleFills.length;
const advancedFills = [
...(0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(InspectorAdvancedControls.slotName) || [],
...(0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(bindingsGroup.name) || []
];
const settingsFills = [
...(0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(defaultGroup.name) || [],
...(0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(positionGroup.name) || [],
...hasListFills && hasStyleFills > 1 ? advancedFills : []
];
const hasContentTab = !!(contentClientIds && contentClientIds.length > 0);
if (hasListFills && !isSectionBlock) {
tabs.push(TAB_LIST_VIEW);
}
if (hasContentTab) {
tabs.push(TAB_CONTENT);
}
if (settingsFills.length && !isSectionBlock) {
tabs.push(TAB_SETTINGS);
}
if (isSectionBlock ? hasBlockStyles : hasStyleFills) {
tabs.push(TAB_STYLES);
}
const tabSettings = (0,external_wp_data_namespaceObject.useSelect)((select) => {
return select(store).getSettings().blockInspectorTabs;
}, []);
const showTabs = getShowTabs(blockName, tabSettings);
return showTabs ? tabs : use_inspector_controls_tabs_EMPTY_ARRAY;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js
function useBlockInspectorAnimationSettings(blockType) {
return (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
if (blockType) {
const globalBlockInspectorAnimationSettings = select(store).getSettings().blockInspectorAnimation;
const animationParent = globalBlockInspectorAnimationSettings?.animationParent;
const { getSelectedBlockClientId, getBlockParentsByBlockName } = select(store);
const _selectedBlockClientId = getSelectedBlockClientId();
const animationParentBlockClientId = getBlockParentsByBlockName(
_selectedBlockClientId,
animationParent,
true
)[0];
if (!animationParentBlockClientId && blockType.name !== animationParent) {
return null;
}
return globalBlockInspectorAnimationSettings?.[blockType.name];
}
return null;
},
[blockType]
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-inspector/index.js
function BlockStylesPanel({ clientId }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)("Styles"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_styles_default, { clientId }) });
}
function StyleInspectorSlots({
blockName,
showAdvancedControls = true,
showPositionControls = true,
showListControls = false,
showBindingsControls = true
}) {
const borderPanelLabel = useBorderPanelLabel({ blockName });
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default.Slot, {}),
showListControls && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default.Slot, { group: "list" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inspector_controls_default.Slot,
{
group: "color",
label: (0,external_wp_i18n_namespaceObject.__)("Color"),
className: "color-block-support-panel__inner-wrapper"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inspector_controls_default.Slot,
{
group: "background",
label: (0,external_wp_i18n_namespaceObject.__)("Background image")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inspector_controls_default.Slot,
{
group: "typography",
label: (0,external_wp_i18n_namespaceObject.__)("Typography")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inspector_controls_default.Slot,
{
group: "dimensions",
label: (0,external_wp_i18n_namespaceObject.__)("Dimensions")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default.Slot, { group: "border", label: borderPanelLabel }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default.Slot, { group: "styles" }),
showPositionControls && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(position_controls_panel_default, {}),
showBindingsControls && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_default.Slot, { group: "bindings" }),
showAdvancedControls && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(advanced_controls_panel_default, {}) })
] });
}
function BlockInspector() {
const {
selectedBlockCount,
selectedBlockName,
selectedBlockClientId,
blockType,
isSectionBlock,
isSectionBlockInSelection,
hasBlockStyles
} = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const {
getSelectedBlockClientId,
getSelectedBlockClientIds,
getSelectedBlockCount,
getBlockName,
getParentSectionBlock,
isSectionBlock: _isSectionBlock
} = unlock(select(store));
const { getBlockStyles } = select(external_wp_blocks_namespaceObject.store);
const _selectedBlockClientId = getSelectedBlockClientId();
const renderedBlockClientId = getParentSectionBlock(_selectedBlockClientId) || _selectedBlockClientId;
const _selectedBlockName = renderedBlockClientId && getBlockName(renderedBlockClientId);
const _blockType = _selectedBlockName && (0,external_wp_blocks_namespaceObject.getBlockType)(_selectedBlockName);
const selectedBlockClientIds = getSelectedBlockClientIds();
const _isSectionBlockInSelection = selectedBlockClientIds.some(
(id) => _isSectionBlock(id)
);
const blockStyles = _selectedBlockName && getBlockStyles(_selectedBlockName);
const _hasBlockStyles = blockStyles && blockStyles.length > 0;
return {
selectedBlockCount: getSelectedBlockCount(),
selectedBlockClientId: renderedBlockClientId,
selectedBlockName: _selectedBlockName,
blockType: _blockType,
isSectionBlockInSelection: _isSectionBlockInSelection,
isSectionBlock: _isSectionBlock(renderedBlockClientId),
hasBlockStyles: _hasBlockStyles
};
}, []);
const contentClientIds = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
if (!isSectionBlock || !selectedBlockClientId) {
return [];
}
const {
getClientIdsOfDescendants,
getBlockName,
getBlockEditingMode
} = unlock(select(store));
const descendants = getClientIdsOfDescendants(
selectedBlockClientId
);
const navigationDescendants = /* @__PURE__ */ new Set();
descendants.forEach((clientId) => {
if (getBlockName(clientId) === "core/navigation") {
const navChildren = getClientIdsOfDescendants(clientId);
navChildren.forEach(
(childId) => navigationDescendants.add(childId)
);
}
});
return descendants.filter((current) => {
if (navigationDescendants.has(current)) {
return false;
}
return getBlockName(current) !== "core/list-item" && getBlockEditingMode(current) === "contentOnly";
});
},
[isSectionBlock, selectedBlockClientId]
);
const availableTabs = useInspectorControlsTabs(
blockType?.name,
contentClientIds,
isSectionBlock,
hasBlockStyles
);
const hasMultipleTabs = availableTabs?.length > 1;
const blockInspectorAnimationSettings = useBlockInspectorAnimationSettings(blockType);
const hasSelectedBlocks = selectedBlockCount > 1;
if (hasSelectedBlocks && !isSectionBlockInSelection) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-inspector", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MultiSelectionInspector, {}),
hasMultipleTabs ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorControlsTabs, { tabs: availableTabs }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
StyleInspectorSlots,
{
blockName: selectedBlockName,
showAdvancedControls: false,
showPositionControls: false,
showBindingsControls: false
}
)
] });
}
if (hasSelectedBlocks && isSectionBlockInSelection) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-inspector", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MultiSelectionInspector, {}) });
}
const isSelectedBlockUnregistered = selectedBlockName === (0,external_wp_blocks_namespaceObject.getUnregisteredTypeHandlerName)();
const shouldShowWarning = !blockType || !selectedBlockClientId || isSelectedBlockUnregistered;
if (shouldShowWarning) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-block-inspector__no-blocks", children: (0,external_wp_i18n_namespaceObject.__)("No block selected.") });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockInspectorSingleBlockWrapper,
{
animate: blockInspectorAnimationSettings,
wrapper: (children) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
AnimatedContainer,
{
blockInspectorAnimationSettings,
selectedBlockClientId,
children
}
),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockInspectorSingleBlock,
{
clientId: selectedBlockClientId,
blockName: blockType.name,
isSectionBlock,
availableTabs,
contentClientIds,
hasBlockStyles
}
)
}
);
}
const BlockInspectorSingleBlockWrapper = ({ animate, wrapper, children }) => {
return animate ? wrapper(children) : children;
};
const AnimatedContainer = ({
blockInspectorAnimationSettings,
selectedBlockClientId,
children
}) => {
const animationOrigin = blockInspectorAnimationSettings && blockInspectorAnimationSettings.enterDirection === "leftToRight" ? -50 : 50;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
animate: {
x: 0,
opacity: 1,
transition: {
ease: "easeInOut",
duration: 0.14
}
},
initial: {
x: animationOrigin,
opacity: 0
},
children
},
selectedBlockClientId
);
};
const BlockInspectorSingleBlock = ({
clientId,
blockName,
isSectionBlock,
availableTabs,
contentClientIds,
hasBlockStyles
}) => {
const hasMultipleTabs = availableTabs?.length > 1;
const blockInformation = useBlockDisplayInformation(clientId);
const isBlockSynced = blockInformation.isSynced;
const shouldShowTabs = !isBlockSynced && hasMultipleTabs;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-inspector", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
block_card_default,
{
...blockInformation,
className: isBlockSynced && "is-synced",
allowParentNavigation: true,
children: window?.__experimentalContentOnlyPatternInsertion && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditContentsButton, { clientId })
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_variation_transforms_default, { blockClientId: clientId }),
shouldShowTabs && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
InspectorControlsTabs,
{
hasBlockStyles,
clientId,
blockName,
tabs: availableTabs,
isSectionBlock,
contentClientIds
}
),
!shouldShowTabs && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
hasBlockStyles && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockStylesPanel, { clientId }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(content_tab_default, { contentClientIds }),
!isSectionBlock && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
StyleInspectorSlots,
{
blockName,
showListControls: true
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SkipToSelectedBlock, {}, "back")
] });
};
var block_inspector_default = BlockInspector;
;// ./node_modules/@wordpress/block-editor/build-module/components/copy-handler/index.js
const __unstableUseClipboardHandler = () => {
external_wp_deprecated_default()("__unstableUseClipboardHandler", {
alternative: "BlockCanvas or WritingFlow",
since: "6.4",
version: "6.7"
});
return useClipboardHandler();
};
function CopyHandler(props) {
external_wp_deprecated_default()("CopyHandler", {
alternative: "BlockCanvas or WritingFlow",
since: "6.4",
version: "6.7"
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...props, ref: useClipboardHandler() });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/library.js
const library_noop = () => {
};
function InserterLibrary({
rootClientId,
clientId,
isAppender,
showInserterHelpPanel,
showMostUsedBlocks = false,
__experimentalInsertionIndex,
__experimentalInitialTab,
__experimentalInitialCategory,
__experimentalFilterValue,
onPatternCategorySelection,
onSelect = library_noop,
shouldFocusBlock = false,
onClose
}, ref) {
const { destinationRootClientId } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockRootClientId } = select(store);
const _rootClientId = rootClientId || getBlockRootClientId(clientId) || void 0;
return {
destinationRootClientId: _rootClientId
};
},
[clientId, rootClientId]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PrivateInserterMenu,
{
onSelect,
rootClientId: destinationRootClientId,
clientId,
isAppender,
showInserterHelpPanel,
showMostUsedBlocks,
__experimentalInsertionIndex,
__experimentalFilterValue,
onPatternCategorySelection,
__experimentalInitialTab,
__experimentalInitialCategory,
shouldFocusBlock,
ref,
onClose
}
);
}
const PrivateInserterLibrary = (0,external_wp_element_namespaceObject.forwardRef)(InserterLibrary);
function PublicInserterLibrary(props, ref) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PrivateInserterLibrary,
{
...props,
onPatternCategorySelection: void 0,
ref
}
);
}
var library_default = (0,external_wp_element_namespaceObject.forwardRef)(PublicInserterLibrary);
;// ./node_modules/@wordpress/block-editor/build-module/components/selection-scroll-into-view/index.js
function MultiSelectScrollIntoView() {
external_wp_deprecated_default()("wp.blockEditor.MultiSelectScrollIntoView", {
hint: "This behaviour is now built-in.",
since: "5.8"
});
return null;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/typewriter/index.js
const isIE = window.navigator.userAgent.indexOf("Trident") !== -1;
const arrowKeyCodes = /* @__PURE__ */ new Set([external_wp_keycodes_namespaceObject.UP, external_wp_keycodes_namespaceObject.DOWN, external_wp_keycodes_namespaceObject.LEFT, external_wp_keycodes_namespaceObject.RIGHT]);
const initialTriggerPercentage = 0.75;
function useTypewriter() {
const hasSelectedBlock = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).hasSelectedBlock(),
[]
);
return (0,external_wp_compose_namespaceObject.useRefEffect)(
(node) => {
if (!hasSelectedBlock) {
return;
}
const { ownerDocument } = node;
const { defaultView } = ownerDocument;
let scrollResizeRafId;
let onKeyDownRafId;
let caretRect;
function onScrollResize() {
if (scrollResizeRafId) {
return;
}
scrollResizeRafId = defaultView.requestAnimationFrame(() => {
computeCaretRectangle();
scrollResizeRafId = null;
});
}
function onKeyDown(event) {
if (onKeyDownRafId) {
defaultView.cancelAnimationFrame(onKeyDownRafId);
}
onKeyDownRafId = defaultView.requestAnimationFrame(() => {
maintainCaretPosition(event);
onKeyDownRafId = null;
});
}
function maintainCaretPosition({ keyCode }) {
if (!isSelectionEligibleForScroll()) {
return;
}
const currentCaretRect = (0,external_wp_dom_namespaceObject.computeCaretRect)(defaultView);
if (!currentCaretRect) {
return;
}
if (!caretRect) {
caretRect = currentCaretRect;
return;
}
if (arrowKeyCodes.has(keyCode)) {
caretRect = currentCaretRect;
return;
}
const diff = currentCaretRect.top - caretRect.top;
if (diff === 0) {
return;
}
const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(node);
if (!scrollContainer) {
return;
}
const windowScroll = scrollContainer === ownerDocument.body || scrollContainer === ownerDocument.documentElement;
const scrollY = windowScroll ? defaultView.scrollY : scrollContainer.scrollTop;
const scrollContainerY = windowScroll ? 0 : scrollContainer.getBoundingClientRect().top;
const relativeScrollPosition = windowScroll ? caretRect.top / defaultView.innerHeight : (caretRect.top - scrollContainerY) / (defaultView.innerHeight - scrollContainerY);
if (scrollY === 0 && relativeScrollPosition < initialTriggerPercentage && isLastEditableNode()) {
caretRect = currentCaretRect;
return;
}
const scrollContainerHeight = windowScroll ? defaultView.innerHeight : scrollContainer.clientHeight;
if (
// The caret is under the lower fold.
caretRect.top + caretRect.height > scrollContainerY + scrollContainerHeight || // The caret is above the upper fold.
caretRect.top < scrollContainerY
) {
caretRect = currentCaretRect;
return;
}
if (windowScroll) {
defaultView.scrollBy(0, diff);
} else {
scrollContainer.scrollTop += diff;
}
}
function addSelectionChangeListener() {
ownerDocument.addEventListener(
"selectionchange",
computeCaretRectOnSelectionChange
);
}
function computeCaretRectOnSelectionChange() {
ownerDocument.removeEventListener(
"selectionchange",
computeCaretRectOnSelectionChange
);
computeCaretRectangle();
}
function computeCaretRectangle() {
if (isSelectionEligibleForScroll()) {
caretRect = (0,external_wp_dom_namespaceObject.computeCaretRect)(defaultView);
}
}
function isSelectionEligibleForScroll() {
return node.contains(ownerDocument.activeElement) && ownerDocument.activeElement.isContentEditable;
}
function isLastEditableNode() {
const editableNodes = node.querySelectorAll(
'[contenteditable="true"]'
);
const lastEditableNode = editableNodes[editableNodes.length - 1];
return lastEditableNode === ownerDocument.activeElement;
}
defaultView.addEventListener("scroll", onScrollResize, true);
defaultView.addEventListener("resize", onScrollResize, true);
node.addEventListener("keydown", onKeyDown);
node.addEventListener("keyup", maintainCaretPosition);
node.addEventListener("mousedown", addSelectionChangeListener);
node.addEventListener("touchstart", addSelectionChangeListener);
return () => {
defaultView.removeEventListener(
"scroll",
onScrollResize,
true
);
defaultView.removeEventListener(
"resize",
onScrollResize,
true
);
node.removeEventListener("keydown", onKeyDown);
node.removeEventListener("keyup", maintainCaretPosition);
node.removeEventListener(
"mousedown",
addSelectionChangeListener
);
node.removeEventListener(
"touchstart",
addSelectionChangeListener
);
ownerDocument.removeEventListener(
"selectionchange",
computeCaretRectOnSelectionChange
);
defaultView.cancelAnimationFrame(scrollResizeRafId);
defaultView.cancelAnimationFrame(onKeyDownRafId);
};
},
[hasSelectedBlock]
);
}
function Typewriter({ children }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: useTypewriter(), className: "block-editor__typewriter", children });
}
const TypewriterOrIEBypass = isIE ? (props) => props.children : Typewriter;
var typewriter_default = TypewriterOrIEBypass;
;// ./node_modules/@wordpress/block-editor/build-module/components/recursion-provider/index.js
const RenderedRefsContext = (0,external_wp_element_namespaceObject.createContext)({});
RenderedRefsContext.displayName = "RenderedRefsContext";
function addToBlockType(renderedBlocks, blockName, uniqueId) {
const result = {
...renderedBlocks,
[blockName]: renderedBlocks[blockName] ? new Set(renderedBlocks[blockName]) : /* @__PURE__ */ new Set()
};
result[blockName].add(uniqueId);
return result;
}
function RecursionProvider({ children, uniqueId, blockName = "" }) {
const previouslyRenderedBlocks = (0,external_wp_element_namespaceObject.useContext)(RenderedRefsContext);
const { name } = useBlockEditContext();
blockName = blockName || name;
const newRenderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(
() => addToBlockType(previouslyRenderedBlocks, blockName, uniqueId),
[previouslyRenderedBlocks, blockName, uniqueId]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderedRefsContext.Provider, { value: newRenderedBlocks, children });
}
function useHasRecursion(uniqueId, blockName = "") {
const previouslyRenderedBlocks = (0,external_wp_element_namespaceObject.useContext)(RenderedRefsContext);
const { name } = useBlockEditContext();
blockName = blockName || name;
return Boolean(previouslyRenderedBlocks[blockName]?.has(uniqueId));
}
const DeprecatedExperimentalRecursionProvider = (props) => {
external_wp_deprecated_default()("wp.blockEditor.__experimentalRecursionProvider", {
since: "6.5",
alternative: "wp.blockEditor.RecursionProvider"
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RecursionProvider, { ...props });
};
const DeprecatedExperimentalUseHasRecursion = (...args) => {
external_wp_deprecated_default()("wp.blockEditor.__experimentalUseHasRecursion", {
since: "6.5",
alternative: "wp.blockEditor.useHasRecursion"
});
return useHasRecursion(...args);
};
;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-popover-header/index.js
function InspectorPopoverHeader({
title,
help,
actions = [],
onClose
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { className: "block-editor-inspector-popover-header", spacing: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "center", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHeading,
{
className: "block-editor-inspector-popover-header__heading",
level: 2,
size: 13,
children: title
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, {}),
actions.map(({ label, icon, onClick }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "small",
className: "block-editor-inspector-popover-header__action",
label,
icon,
variant: !icon && "tertiary",
onClick,
children: !icon && label
},
label
)),
onClose && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "small",
className: "block-editor-inspector-popover-header__action",
label: (0,external_wp_i18n_namespaceObject.__)("Close"),
icon: close_small_default,
onClick: onClose
}
)
] }),
help && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: help })
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/publish-date-time-picker/index.js
function PublishDateTimePicker({
onClose,
onChange,
showPopoverHeaderActions,
isCompact,
currentDate,
title,
...additionalProps
}, ref) {
const datePickerProps = {
startOfWeek: (0,external_wp_date_namespaceObject.getSettings)().l10n.startOfWeek,
onChange,
currentDate: isCompact ? void 0 : currentDate,
currentTime: isCompact ? currentDate : void 0,
...additionalProps
};
const DatePickerComponent = isCompact ? external_wp_components_namespaceObject.TimePicker : external_wp_components_namespaceObject.DateTimePicker;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ref, className: "block-editor-publish-date-time-picker", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
InspectorPopoverHeader,
{
title: title || (0,external_wp_i18n_namespaceObject.__)("Publish"),
actions: showPopoverHeaderActions ? [
{
label: (0,external_wp_i18n_namespaceObject.__)("Now"),
onClick: () => onChange?.(null)
}
] : void 0,
onClose
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DatePickerComponent, { ...datePickerProps })
] });
}
const PrivatePublishDateTimePicker = (0,external_wp_element_namespaceObject.forwardRef)(PublishDateTimePicker);
function PublicPublishDateTimePicker(props, ref) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PrivatePublishDateTimePicker,
{
...props,
showPopoverHeaderActions: true,
isCompact: false,
ref
}
);
}
var publish_date_time_picker_default = (0,external_wp_element_namespaceObject.forwardRef)(PublicPublishDateTimePicker);
;// ./node_modules/@wordpress/block-editor/build-module/components/index.js
;// ./node_modules/@wordpress/block-editor/build-module/elements/index.js
const elements_ELEMENT_CLASS_NAMES = {
button: "wp-element-button",
caption: "wp-element-caption"
};
const __experimentalGetElementClassName = (element) => {
return elements_ELEMENT_CLASS_NAMES[element] ? elements_ELEMENT_CLASS_NAMES[element] : "";
};
;// ./node_modules/@wordpress/block-editor/build-module/utils/get-px-from-css-unit.js
var get_px_from_css_unit_default = () => "";
;// ./node_modules/@wordpress/block-editor/build-module/utils/index.js
;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/image-settings-panel.js
function useHasImageSettingsPanel(name, value, inheritedValue) {
return name === "core/image" && inheritedValue?.lightbox?.allowEditing || !!value?.lightbox;
}
function ImageSettingsPanel({
onChange,
value,
inheritedValue,
panelId
}) {
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const resetLightbox = () => {
onChange(void 0);
};
const onChangeLightbox = (newSetting) => {
onChange({
enabled: newSetting
});
};
let lightboxChecked = false;
if (inheritedValue?.lightbox?.enabled) {
lightboxChecked = inheritedValue.lightbox.enabled;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject._x)("Settings", "Image settings"),
resetAll: resetLightbox,
panelId,
dropdownMenuProps,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: () => !!value?.lightbox,
label: (0,external_wp_i18n_namespaceObject.__)("Enlarge on click"),
onDeselect: resetLightbox,
isShownByDefault: true,
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Enlarge on click"),
checked: lightboxChecked,
onChange: onChangeLightbox
}
)
}
)
}
) });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/advanced-panel.js
function AdvancedPanel({
value,
onChange,
inheritedValue = value
}) {
const [cssError, setCSSError] = (0,external_wp_element_namespaceObject.useState)(null);
const customCSS = inheritedValue?.css;
function handleOnChange(newValue) {
onChange({
...value,
css: newValue
});
if (cssError) {
const [transformed] = transform_styles_default(
[{ css: newValue }],
".for-validation-only"
);
if (transformed) {
setCSSError(null);
}
}
}
function handleOnBlur(event) {
if (!event?.target?.value) {
setCSSError(null);
return;
}
const [transformed] = transform_styles_default(
[{ css: event.target.value }],
".for-validation-only"
);
setCSSError(
transformed === null ? (0,external_wp_i18n_namespaceObject.__)("There is an error with your CSS structure.") : null
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, children: [
cssError && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "error", onRemove: () => setCSSError(null), children: cssError }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextareaControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Additional CSS"),
__nextHasNoMarginBottom: true,
value: customCSS,
onChange: (newValue) => handleOnChange(newValue),
onBlur: handleOnBlur,
className: "block-editor-global-styles-advanced-panel__custom-css-input",
spellCheck: false
}
)
] });
}
;// ./node_modules/memize/dist/index.js
/**
* Memize options object.
*
* @typedef MemizeOptions
*
* @property {number} [maxSize] Maximum size of the cache.
*/
/**
* Internal cache entry.
*
* @typedef MemizeCacheNode
*
* @property {?MemizeCacheNode|undefined} [prev] Previous node.
* @property {?MemizeCacheNode|undefined} [next] Next node.
* @property {Array<*>} args Function arguments for cache
* entry.
* @property {*} val Function result.
*/
/**
* Properties of the enhanced function for controlling cache.
*
* @typedef MemizeMemoizedFunction
*
* @property {()=>void} clear Clear the cache.
*/
/**
* Accepts a function to be memoized, and returns a new memoized function, with
* optional options.
*
* @template {(...args: any[]) => any} F
*
* @param {F} fn Function to memoize.
* @param {MemizeOptions} [options] Options object.
*
* @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function.
*/
function memize(fn, options) {
var size = 0;
/** @type {?MemizeCacheNode|undefined} */
var head;
/** @type {?MemizeCacheNode|undefined} */
var tail;
options = options || {};
function memoized(/* ...args */) {
var node = head,
len = arguments.length,
args,
i;
searchCache: while (node) {
// Perform a shallow equality test to confirm that whether the node
// under test is a candidate for the arguments passed. Two arrays
// are shallowly equal if their length matches and each entry is
// strictly equal between the two sets. Avoid abstracting to a
// function which could incur an arguments leaking deoptimization.
// Check whether node arguments match arguments length
if (node.args.length !== arguments.length) {
node = node.next;
continue;
}
// Check whether node arguments match arguments values
for (i = 0; i < len; i++) {
if (node.args[i] !== arguments[i]) {
node = node.next;
continue searchCache;
}
}
// At this point we can assume we've found a match
// Surface matched node to head if not already
if (node !== head) {
// As tail, shift to previous. Must only shift if not also
// head, since if both head and tail, there is no previous.
if (node === tail) {
tail = node.prev;
}
// Adjust siblings to point to each other. If node was tail,
// this also handles new tail's empty `next` assignment.
/** @type {MemizeCacheNode} */ (node.prev).next = node.next;
if (node.next) {
node.next.prev = node.prev;
}
node.next = head;
node.prev = null;
/** @type {MemizeCacheNode} */ (head).prev = node;
head = node;
}
// Return immediately
return node.val;
}
// No cached value found. Continue to insertion phase:
// Create a copy of arguments (avoid leaking deoptimization)
args = new Array(len);
for (i = 0; i < len; i++) {
args[i] = arguments[i];
}
node = {
args: args,
// Generate the result from original function
val: fn.apply(null, args),
};
// Don't need to check whether node is already head, since it would
// have been returned above already if it was
// Shift existing head down list
if (head) {
head.prev = node;
node.next = head;
} else {
// If no head, follows that there's no tail (at initial or reset)
tail = node;
}
// Trim tail if we're reached max size and are pending cache insertion
if (size === /** @type {MemizeOptions} */ (options).maxSize) {
tail = /** @type {MemizeCacheNode} */ (tail).prev;
/** @type {MemizeCacheNode} */ (tail).next = null;
} else {
size++;
}
head = node;
return node.val;
}
memoized.clear = function () {
head = null;
tail = null;
size = 0;
};
// Ignore reason: There's not a clear solution to create an intersection of
// the function with additional properties, where the goal is to retain the
// function signature of the incoming argument and add control properties
// on the return value.
// @ts-ignore
return memoized;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/get-global-styles-changes.js
const globalStylesChangesCache = /* @__PURE__ */ new Map();
const get_global_styles_changes_EMPTY_ARRAY = [];
const translationMap = {
caption: (0,external_wp_i18n_namespaceObject.__)("Caption"),
link: (0,external_wp_i18n_namespaceObject.__)("Link"),
button: (0,external_wp_i18n_namespaceObject.__)("Button"),
heading: (0,external_wp_i18n_namespaceObject.__)("Heading"),
h1: (0,external_wp_i18n_namespaceObject.__)("H1"),
h2: (0,external_wp_i18n_namespaceObject.__)("H2"),
h3: (0,external_wp_i18n_namespaceObject.__)("H3"),
h4: (0,external_wp_i18n_namespaceObject.__)("H4"),
h5: (0,external_wp_i18n_namespaceObject.__)("H5"),
h6: (0,external_wp_i18n_namespaceObject.__)("H6"),
"settings.color": (0,external_wp_i18n_namespaceObject.__)("Color"),
"settings.typography": (0,external_wp_i18n_namespaceObject.__)("Typography"),
"settings.shadow": (0,external_wp_i18n_namespaceObject.__)("Shadow"),
"settings.layout": (0,external_wp_i18n_namespaceObject.__)("Layout"),
"styles.color": (0,external_wp_i18n_namespaceObject.__)("Colors"),
"styles.spacing": (0,external_wp_i18n_namespaceObject.__)("Spacing"),
"styles.background": (0,external_wp_i18n_namespaceObject.__)("Background"),
"styles.typography": (0,external_wp_i18n_namespaceObject.__)("Typography")
};
const getBlockNames = memize(
() => (0,external_wp_blocks_namespaceObject.getBlockTypes)().reduce((accumulator, { name, title }) => {
accumulator[name] = title;
return accumulator;
}, {})
);
const isObject = (obj) => obj !== null && typeof obj === "object";
function getTranslation(key) {
if (translationMap[key]) {
return translationMap[key];
}
const keyArray = key.split(".");
if (keyArray?.[0] === "blocks") {
const blockName = getBlockNames()?.[keyArray[1]];
return blockName || keyArray[1];
}
if (keyArray?.[0] === "elements") {
return translationMap[keyArray[1]] || keyArray[1];
}
return void 0;
}
function deepCompare(changedObject, originalObject, parentPath = "") {
if (!isObject(changedObject) && !isObject(originalObject)) {
return changedObject !== originalObject ? parentPath.split(".").slice(0, 2).join(".") : void 0;
}
changedObject = isObject(changedObject) ? changedObject : {};
originalObject = isObject(originalObject) ? originalObject : {};
const allKeys = /* @__PURE__ */ new Set([
...Object.keys(changedObject),
...Object.keys(originalObject)
]);
let diffs = [];
for (const key of allKeys) {
const path = parentPath ? parentPath + "." + key : key;
const changedPath = deepCompare(
changedObject[key],
originalObject[key],
path
);
if (changedPath) {
diffs = diffs.concat(changedPath);
}
}
return diffs;
}
function getGlobalStylesChangelist(next, previous) {
const cacheKey = JSON.stringify({ next, previous });
if (globalStylesChangesCache.has(cacheKey)) {
return globalStylesChangesCache.get(cacheKey);
}
const changedValueTree = deepCompare(
{
styles: {
background: next?.styles?.background,
color: next?.styles?.color,
typography: next?.styles?.typography,
spacing: next?.styles?.spacing
},
blocks: next?.styles?.blocks,
elements: next?.styles?.elements,
settings: next?.settings
},
{
styles: {
background: previous?.styles?.background,
color: previous?.styles?.color,
typography: previous?.styles?.typography,
spacing: previous?.styles?.spacing
},
blocks: previous?.styles?.blocks,
elements: previous?.styles?.elements,
settings: previous?.settings
}
);
if (!changedValueTree.length) {
globalStylesChangesCache.set(cacheKey, get_global_styles_changes_EMPTY_ARRAY);
return get_global_styles_changes_EMPTY_ARRAY;
}
const result = [...new Set(changedValueTree)].reduce((acc, curr) => {
const translation = getTranslation(curr);
if (translation) {
acc.push([curr.split(".")[0], translation]);
}
return acc;
}, []);
globalStylesChangesCache.set(cacheKey, result);
return result;
}
function getGlobalStylesChanges(next, previous, options = {}) {
let changeList = getGlobalStylesChangelist(next, previous);
const changesLength = changeList.length;
const { maxResults } = options;
if (changesLength) {
if (!!maxResults && changesLength > maxResults) {
changeList = changeList.slice(0, maxResults);
}
return Object.entries(
changeList.reduce((acc, curr) => {
const group = acc[curr[0]] || [];
if (!group.includes(curr[1])) {
acc[curr[0]] = [...group, curr[1]];
}
return acc;
}, {})
).map(([key, changeValues]) => {
const changeValuesLength = changeValues.length;
const joinedChangesValue = changeValues.join(
/* translators: Used between list items, there is a space after the comma. */
(0,external_wp_i18n_namespaceObject.__)(", ")
// eslint-disable-line @wordpress/i18n-no-flanking-whitespace
);
switch (key) {
case "blocks": {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: a list of block names separated by a comma.
(0,external_wp_i18n_namespaceObject._n)("%s block.", "%s blocks.", changeValuesLength),
joinedChangesValue
);
}
case "elements": {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: a list of element names separated by a comma.
(0,external_wp_i18n_namespaceObject._n)("%s element.", "%s elements.", changeValuesLength),
joinedChangesValue
);
}
case "settings": {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: a list of theme.json setting labels separated by a comma.
(0,external_wp_i18n_namespaceObject.__)("%s settings."),
joinedChangesValue
);
}
case "styles": {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: a list of theme.json top-level styles labels separated by a comma.
(0,external_wp_i18n_namespaceObject.__)("%s styles."),
joinedChangesValue
);
}
default: {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: a list of global styles changes separated by a comma.
(0,external_wp_i18n_namespaceObject.__)("%s."),
joinedChangesValue
);
}
}
});
}
return get_global_styles_changes_EMPTY_ARRAY;
}
;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/index.js
;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/get-rich-text-values.js
function addValuesForElement(element, values, innerBlocks) {
if (null === element || void 0 === element || false === element) {
return;
}
if (Array.isArray(element)) {
return addValuesForElements(element, values, innerBlocks);
}
switch (typeof element) {
case "string":
case "number":
return;
}
const { type, props } = element;
switch (type) {
case external_wp_element_namespaceObject.StrictMode:
case external_wp_element_namespaceObject.Fragment:
return addValuesForElements(props.children, values, innerBlocks);
case external_wp_element_namespaceObject.RawHTML:
return;
case inner_blocks_default.Content:
return addValuesForBlocks(values, innerBlocks);
case Content:
values.push(props.value);
return;
}
switch (typeof type) {
case "string":
if (typeof props.children !== "undefined") {
return addValuesForElements(
props.children,
values,
innerBlocks
);
}
return;
case "function":
const el = type.prototype && typeof type.prototype.render === "function" ? new type(props).render() : type(props);
return addValuesForElement(el, values, innerBlocks);
}
}
function addValuesForElements(children, ...args) {
children = Array.isArray(children) ? children : [children];
for (let i = 0; i < children.length; i++) {
addValuesForElement(children[i], ...args);
}
}
function addValuesForBlocks(values, blocks) {
for (let i = 0; i < blocks.length; i++) {
const { name, attributes, innerBlocks } = blocks[i];
const saveElement = (0,external_wp_blocks_namespaceObject.getSaveElement)(
name,
attributes,
// Instead of letting save elements use `useInnerBlocksProps.save`,
// force them to use InnerBlocks.Content instead so we can intercept
// a single component.
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(inner_blocks_default.Content, {})
);
addValuesForElement(saveElement, values, innerBlocks);
}
}
function getRichTextValues(blocks = []) {
external_wp_blocks_namespaceObject.__unstableGetBlockProps.skipFilters = true;
const values = [];
addValuesForBlocks(values, blocks);
external_wp_blocks_namespaceObject.__unstableGetBlockProps.skipFilters = false;
return values.map(
(value) => value instanceof external_wp_richText_namespaceObject.RichTextData ? value : external_wp_richText_namespaceObject.RichTextData.fromHTMLString(value)
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/resizable-box-popover/index.js
function ResizableBoxPopover({
clientId,
resizableBoxProps,
...props
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
cover_default,
{
clientId,
__unstablePopoverSlot: "block-toolbar",
...props,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, { ...resizableBoxProps })
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/block-removal-warning-modal/index.js
function BlockRemovalWarningModal({ rules }) {
const { clientIds, selectPrevious, message } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => unlock(select(store)).getRemovalPromptData()
);
const {
clearBlockRemovalPrompt,
setBlockRemovalRules,
privateRemoveBlocks
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
(0,external_wp_element_namespaceObject.useEffect)(() => {
setBlockRemovalRules(rules);
return () => {
setBlockRemovalRules();
};
}, [rules, setBlockRemovalRules]);
if (!message) {
return;
}
const onConfirmRemoval = () => {
privateRemoveBlocks(
clientIds,
selectPrevious,
/* force */
true
);
clearBlockRemovalPrompt();
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Modal,
{
title: (0,external_wp_i18n_namespaceObject.__)("Be careful!"),
onRequestClose: clearBlockRemovalPrompt,
size: "medium",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: message }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: "tertiary",
onClick: clearBlockRemovalPrompt,
__next40pxDefaultSize: true,
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: "primary",
onClick: onConfirmRemoval,
__next40pxDefaultSize: true,
children: (0,external_wp_i18n_namespaceObject.__)("Delete")
}
)
] })
]
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/dimensions-tool/scale-tool.js
const DEFAULT_SCALE_OPTIONS = [
{
value: "fill",
label: (0,external_wp_i18n_namespaceObject._x)("Fill", "Scale option for dimensions control"),
help: (0,external_wp_i18n_namespaceObject.__)("Fill the space by stretching the content.")
},
{
value: "contain",
label: (0,external_wp_i18n_namespaceObject._x)("Contain", "Scale option for dimensions control"),
help: (0,external_wp_i18n_namespaceObject.__)("Fit the content to the space without clipping.")
},
{
value: "cover",
label: (0,external_wp_i18n_namespaceObject._x)("Cover", "Scale option for dimensions control"),
help: (0,external_wp_i18n_namespaceObject.__)("Fill the space by clipping what doesn't fit.")
},
{
value: "none",
label: (0,external_wp_i18n_namespaceObject._x)("None", "Scale option for dimensions control"),
help: (0,external_wp_i18n_namespaceObject.__)(
"Do not adjust the sizing of the content. Content that is too large will be clipped, and content that is too small will have additional padding."
)
},
{
value: "scale-down",
label: (0,external_wp_i18n_namespaceObject._x)("Scale down", "Scale option for dimensions control"),
help: (0,external_wp_i18n_namespaceObject.__)(
"Scale down the content to fit the space if it is too big. Content that is too small will have additional padding."
)
}
];
function ScaleTool({
panelId,
value,
onChange,
options = DEFAULT_SCALE_OPTIONS,
defaultValue = DEFAULT_SCALE_OPTIONS[0].value,
isShownByDefault = true
}) {
const displayValue = value ?? "fill";
const scaleHelp = (0,external_wp_element_namespaceObject.useMemo)(() => {
return options.reduce((acc, option) => {
acc[option.value] = option.help;
return acc;
}, {});
}, [options]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Scale"),
isShownByDefault,
hasValue: () => displayValue !== defaultValue,
onDeselect: () => onChange(defaultValue),
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Scale"),
isBlock: true,
help: scaleHelp[displayValue],
value: displayValue,
onChange,
size: "__unstable-large",
children: options.map((option) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
...option
},
option.value
))
}
)
}
);
}
;// ./node_modules/@babel/runtime/helpers/esm/extends.js
function extends_extends() {
return extends_extends = Object.assign ? Object.assign.bind() : function (n) {
for (var e = 1; e < arguments.length; e++) {
var t = arguments[e];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
}
return n;
}, extends_extends.apply(null, arguments);
}
;// ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
function memoize(fn) {
var cache = Object.create(null);
return function (arg) {
if (cache[arg] === undefined) cache[arg] = fn(arg);
return cache[arg];
};
}
;// ./node_modules/@emotion/styled/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|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|enterKeyHint|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|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|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
var isPropValid = /* #__PURE__ */memoize(function (prop) {
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
/* o */
&& prop.charCodeAt(1) === 110
/* n */
&& prop.charCodeAt(2) < 91;
}
/* Z+1 */
);
;// ./node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js
/*
Based off glamor's StyleSheet, thanks Sunil ❤️
high performance StyleSheet for css-in-js systems
- uses multiple style tags behind the scenes for millions of rules
- uses `insertRule` for appending in production for *much* faster performance
// usage
import { StyleSheet } from '@emotion/sheet'
let styleSheet = new StyleSheet({ key: '', container: document.head })
styleSheet.insert('#box { border: 1px solid red; }')
- appends a css rule into the stylesheet
styleSheet.flush()
- empties the stylesheet of all its contents
*/
// $FlowFixMe
function sheetForTag(tag) {
if (tag.sheet) {
// $FlowFixMe
return tag.sheet;
} // this weirdness brought to you by firefox
/* istanbul ignore next */
for (var i = 0; i < document.styleSheets.length; i++) {
if (document.styleSheets[i].ownerNode === tag) {
// $FlowFixMe
return document.styleSheets[i];
}
}
}
function createStyleElement(options) {
var tag = document.createElement('style');
tag.setAttribute('data-emotion', options.key);
if (options.nonce !== undefined) {
tag.setAttribute('nonce', options.nonce);
}
tag.appendChild(document.createTextNode(''));
tag.setAttribute('data-s', '');
return tag;
}
var StyleSheet = /*#__PURE__*/function () {
// Using Node instead of HTMLElement since container may be a ShadowRoot
function StyleSheet(options) {
var _this = this;
this._insertTag = function (tag) {
var before;
if (_this.tags.length === 0) {
if (_this.insertionPoint) {
before = _this.insertionPoint.nextSibling;
} else if (_this.prepend) {
before = _this.container.firstChild;
} else {
before = _this.before;
}
} else {
before = _this.tags[_this.tags.length - 1].nextSibling;
}
_this.container.insertBefore(tag, before);
_this.tags.push(tag);
};
this.isSpeedy = options.speedy === undefined ? "production" === 'production' : options.speedy;
this.tags = [];
this.ctr = 0;
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
this.key = options.key;
this.container = options.container;
this.prepend = options.prepend;
this.insertionPoint = options.insertionPoint;
this.before = null;
}
var _proto = StyleSheet.prototype;
_proto.hydrate = function hydrate(nodes) {
nodes.forEach(this._insertTag);
};
_proto.insert = function insert(rule) {
// the max length is how many rules we have per style tag, it's 65000 in speedy mode
// it's 1 in dev because we insert source maps that map a single rule to a location
// and you can only have one source map per style tag
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
this._insertTag(createStyleElement(this));
}
var tag = this.tags[this.tags.length - 1];
if (false) { var isImportRule; }
if (this.isSpeedy) {
var sheet = sheetForTag(tag);
try {
// this is the ultrafast version, works across browsers
// the big drawback is that the css won't be editable in devtools
sheet.insertRule(rule, sheet.cssRules.length);
} catch (e) {
if (false) {}
}
} else {
tag.appendChild(document.createTextNode(rule));
}
this.ctr++;
};
_proto.flush = function flush() {
// $FlowFixMe
this.tags.forEach(function (tag) {
return tag.parentNode && tag.parentNode.removeChild(tag);
});
this.tags = [];
this.ctr = 0;
if (false) {}
};
return StyleSheet;
}();
;// ./node_modules/stylis/src/Utility.js
/**
* @param {number}
* @return {number}
*/
var abs = Math.abs
/**
* @param {number}
* @return {string}
*/
var Utility_from = String.fromCharCode
/**
* @param {object}
* @return {object}
*/
var Utility_assign = Object.assign
/**
* @param {string} value
* @param {number} length
* @return {number}
*/
function hash (value, length) {
return Utility_charat(value, 0) ^ 45 ? (((((((length << 2) ^ Utility_charat(value, 0)) << 2) ^ Utility_charat(value, 1)) << 2) ^ Utility_charat(value, 2)) << 2) ^ Utility_charat(value, 3) : 0
}
/**
* @param {string} value
* @return {string}
*/
function trim (value) {
return value.trim()
}
/**
* @param {string} value
* @param {RegExp} pattern
* @return {string?}
*/
function Utility_match (value, pattern) {
return (value = pattern.exec(value)) ? value[0] : value
}
/**
* @param {string} value
* @param {(string|RegExp)} pattern
* @param {string} replacement
* @return {string}
*/
function Utility_replace (value, pattern, replacement) {
return value.replace(pattern, replacement)
}
/**
* @param {string} value
* @param {string} search
* @return {number}
*/
function indexof (value, search) {
return value.indexOf(search)
}
/**
* @param {string} value
* @param {number} index
* @return {number}
*/
function Utility_charat (value, index) {
return value.charCodeAt(index) | 0
}
/**
* @param {string} value
* @param {number} begin
* @param {number} end
* @return {string}
*/
function Utility_substr (value, begin, end) {
return value.slice(begin, end)
}
/**
* @param {string} value
* @return {number}
*/
function Utility_strlen (value) {
return value.length
}
/**
* @param {any[]} value
* @return {number}
*/
function Utility_sizeof (value) {
return value.length
}
/**
* @param {any} value
* @param {any[]} array
* @return {any}
*/
function Utility_append (value, array) {
return array.push(value), value
}
/**
* @param {string[]} array
* @param {function} callback
* @return {string}
*/
function Utility_combine (array, callback) {
return array.map(callback).join('')
}
;// ./node_modules/stylis/src/Tokenizer.js
var line = 1
var column = 1
var Tokenizer_length = 0
var position = 0
var Tokenizer_character = 0
var characters = ''
/**
* @param {string} value
* @param {object | null} root
* @param {object | null} parent
* @param {string} type
* @param {string[] | string} props
* @param {object[] | string} children
* @param {number} length
*/
function node (value, root, parent, type, props, children, length) {
return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}
}
/**
* @param {object} root
* @param {object} props
* @return {object}
*/
function Tokenizer_copy (root, props) {
return Utility_assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)
}
/**
* @return {number}
*/
function Tokenizer_char () {
return Tokenizer_character
}
/**
* @return {number}
*/
function prev () {
Tokenizer_character = position > 0 ? Utility_charat(characters, --position) : 0
if (column--, Tokenizer_character === 10)
column = 1, line--
return Tokenizer_character
}
/**
* @return {number}
*/
function next () {
Tokenizer_character = position < Tokenizer_length ? Utility_charat(characters, position++) : 0
if (column++, Tokenizer_character === 10)
column = 1, line++
return Tokenizer_character
}
/**
* @return {number}
*/
function peek () {
return Utility_charat(characters, position)
}
/**
* @return {number}
*/
function caret () {
return position
}
/**
* @param {number} begin
* @param {number} end
* @return {string}
*/
function slice (begin, end) {
return Utility_substr(characters, begin, end)
}
/**
* @param {number} type
* @return {number}
*/
function token (type) {
switch (type) {
// \0 \t \n \r \s whitespace token
case 0: case 9: case 10: case 13: case 32:
return 5
// ! + , / > @ ~ isolate token
case 33: case 43: case 44: case 47: case 62: case 64: case 126:
// ; { } breakpoint token
case 59: case 123: case 125:
return 4
// : accompanied token
case 58:
return 3
// " ' ( [ opening delimit token
case 34: case 39: case 40: case 91:
return 2
// ) ] closing delimit token
case 41: case 93:
return 1
}
return 0
}
/**
* @param {string} value
* @return {any[]}
*/
function alloc (value) {
return line = column = 1, Tokenizer_length = Utility_strlen(characters = value), position = 0, []
}
/**
* @param {any} value
* @return {any}
*/
function dealloc (value) {
return characters = '', value
}
/**
* @param {number} type
* @return {string}
*/
function delimit (type) {
return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
}
/**
* @param {string} value
* @return {string[]}
*/
function Tokenizer_tokenize (value) {
return dealloc(tokenizer(alloc(value)))
}
/**
* @param {number} type
* @return {string}
*/
function whitespace (type) {
while (Tokenizer_character = peek())
if (Tokenizer_character < 33)
next()
else
break
return token(type) > 2 || token(Tokenizer_character) > 3 ? '' : ' '
}
/**
* @param {string[]} children
* @return {string[]}
*/
function tokenizer (children) {
while (next())
switch (token(Tokenizer_character)) {
case 0: append(identifier(position - 1), children)
break
case 2: append(delimit(Tokenizer_character), children)
break
default: append(from(Tokenizer_character), children)
}
return children
}
/**
* @param {number} index
* @param {number} count
* @return {string}
*/
function escaping (index, count) {
while (--count && next())
// not 0-9 A-F a-f
if (Tokenizer_character < 48 || Tokenizer_character > 102 || (Tokenizer_character > 57 && Tokenizer_character < 65) || (Tokenizer_character > 70 && Tokenizer_character < 97))
break
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))
}
/**
* @param {number} type
* @return {number}
*/
function delimiter (type) {
while (next())
switch (Tokenizer_character) {
// ] ) " '
case type:
return position
// " '
case 34: case 39:
if (type !== 34 && type !== 39)
delimiter(Tokenizer_character)
break
// (
case 40:
if (type === 41)
delimiter(type)
break
// \
case 92:
next()
break
}
return position
}
/**
* @param {number} type
* @param {number} index
* @return {number}
*/
function commenter (type, index) {
while (next())
// //
if (type + Tokenizer_character === 47 + 10)
break
// /*
else if (type + Tokenizer_character === 42 + 42 && peek() === 47)
break
return '/*' + slice(index, position - 1) + '*' + Utility_from(type === 47 ? type : next())
}
/**
* @param {number} index
* @return {string}
*/
function identifier (index) {
while (!token(peek()))
next()
return slice(index, position)
}
;// ./node_modules/stylis/src/Enum.js
var Enum_MS = '-ms-'
var Enum_MOZ = '-moz-'
var Enum_WEBKIT = '-webkit-'
var COMMENT = 'comm'
var Enum_RULESET = 'rule'
var Enum_DECLARATION = 'decl'
var PAGE = '@page'
var MEDIA = '@media'
var IMPORT = '@import'
var CHARSET = '@charset'
var VIEWPORT = '@viewport'
var SUPPORTS = '@supports'
var DOCUMENT = '@document'
var NAMESPACE = '@namespace'
var Enum_KEYFRAMES = '@keyframes'
var FONT_FACE = '@font-face'
var COUNTER_STYLE = '@counter-style'
var FONT_FEATURE_VALUES = '@font-feature-values'
;// ./node_modules/stylis/src/Serializer.js
/**
* @param {object[]} children
* @param {function} callback
* @return {string}
*/
function Serializer_serialize (children, callback) {
var output = ''
var length = Utility_sizeof(children)
for (var i = 0; i < length; i++)
output += callback(children[i], i, children, callback) || ''
return output
}
/**
* @param {object} element
* @param {number} index
* @param {object[]} children
* @param {function} callback
* @return {string}
*/
function Serializer_stringify (element, index, children, callback) {
switch (element.type) {
case IMPORT: case Enum_DECLARATION: return element.return = element.return || element.value
case COMMENT: return ''
case Enum_KEYFRAMES: return element.return = element.value + '{' + Serializer_serialize(element.children, callback) + '}'
case Enum_RULESET: element.value = element.props.join(',')
}
return Utility_strlen(children = Serializer_serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''
}
;// ./node_modules/stylis/src/Middleware.js
/**
* @param {function[]} collection
* @return {function}
*/
function middleware (collection) {
var length = Utility_sizeof(collection)
return function (element, index, children, callback) {
var output = ''
for (var i = 0; i < length; i++)
output += collection[i](element, index, children, callback) || ''
return output
}
}
/**
* @param {function} callback
* @return {function}
*/
function rulesheet (callback) {
return function (element) {
if (!element.root)
if (element = element.return)
callback(element)
}
}
/**
* @param {object} element
* @param {number} index
* @param {object[]} children
* @param {function} callback
*/
function prefixer (element, index, children, callback) {
if (element.length > -1)
if (!element.return)
switch (element.type) {
case DECLARATION: element.return = prefix(element.value, element.length, children)
return
case KEYFRAMES:
return serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)
case RULESET:
if (element.length)
return combine(element.props, function (value) {
switch (match(value, /(::plac\w+|:read-\w+)/)) {
// :read-(only|write)
case ':read-only': case ':read-write':
return serialize([copy(element, {props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]})], callback)
// :placeholder
case '::placeholder':
return serialize([
copy(element, {props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]}),
copy(element, {props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]}),
copy(element, {props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]})
], callback)
}
return ''
})
}
}
/**
* @param {object} element
* @param {number} index
* @param {object[]} children
*/
function namespace (element) {
switch (element.type) {
case RULESET:
element.props = element.props.map(function (value) {
return combine(tokenize(value), function (value, index, children) {
switch (charat(value, 0)) {
// \f
case 12:
return substr(value, 1, strlen(value))
// \0 ( + > ~
case 0: case 40: case 43: case 62: case 126:
return value
// :
case 58:
if (children[++index] === 'global')
children[index] = '', children[++index] = '\f' + substr(children[index], index = 1, -1)
// \s
case 32:
return index === 1 ? '' : value
default:
switch (index) {
case 0: element = value
return sizeof(children) > 1 ? '' : value
case index = sizeof(children) - 1: case 2:
return index === 2 ? value + element + element : value + element
default:
return value
}
}
})
})
}
}
;// ./node_modules/stylis/src/Parser.js
/**
* @param {string} value
* @return {object[]}
*/
function compile (value) {
return dealloc(Parser_parse('', null, null, null, [''], value = alloc(value), 0, [0], value))
}
/**
* @param {string} value
* @param {object} root
* @param {object?} parent
* @param {string[]} rule
* @param {string[]} rules
* @param {string[]} rulesets
* @param {number[]} pseudo
* @param {number[]} points
* @param {string[]} declarations
* @return {object}
*/
function Parser_parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
var index = 0
var offset = 0
var length = pseudo
var atrule = 0
var property = 0
var previous = 0
var variable = 1
var scanning = 1
var ampersand = 1
var character = 0
var type = ''
var props = rules
var children = rulesets
var reference = rule
var characters = type
while (scanning)
switch (previous = character, character = next()) {
// (
case 40:
if (previous != 108 && Utility_charat(characters, length - 1) == 58) {
if (indexof(characters += Utility_replace(delimit(character), '&', '&\f'), '&\f') != -1)
ampersand = -1
break
}
// " ' [
case 34: case 39: case 91:
characters += delimit(character)
break
// \t \n \r \s
case 9: case 10: case 13: case 32:
characters += whitespace(previous)
break
// \
case 92:
characters += escaping(caret() - 1, 7)
continue
// /
case 47:
switch (peek()) {
case 42: case 47:
Utility_append(comment(commenter(next(), caret()), root, parent), declarations)
break
default:
characters += '/'
}
break
// {
case 123 * variable:
points[index++] = Utility_strlen(characters) * ampersand
// } ; \0
case 125 * variable: case 59: case 0:
switch (character) {
// \0 }
case 0: case 125: scanning = 0
// ;
case 59 + offset:
if (property > 0 && (Utility_strlen(characters) - length))
Utility_append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(Utility_replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)
break
// @ ;
case 59: characters += ';'
// { rule/at-rule
default:
Utility_append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)
if (character === 123)
if (offset === 0)
Parser_parse(characters, root, reference, reference, props, rulesets, length, points, children)
else
switch (atrule === 99 && Utility_charat(characters, 3) === 110 ? 100 : atrule) {
// d m s
case 100: case 109: case 115:
Parser_parse(value, reference, reference, rule && Utility_append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)
break
default:
Parser_parse(characters, reference, reference, reference, [''], children, 0, points, children)
}
}
index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo
break
// :
case 58:
length = 1 + Utility_strlen(characters), property = previous
default:
if (variable < 1)
if (character == 123)
--variable
else if (character == 125 && variable++ == 0 && prev() == 125)
continue
switch (characters += Utility_from(character), character * variable) {
// &
case 38:
ampersand = offset > 0 ? 1 : (characters += '\f', -1)
break
// ,
case 44:
points[index++] = (Utility_strlen(characters) - 1) * ampersand, ampersand = 1
break
// @
case 64:
// -
if (peek() === 45)
characters += delimit(next())
atrule = peek(), offset = length = Utility_strlen(type = characters += identifier(caret())), character++
break
// -
case 45:
if (previous === 45 && Utility_strlen(characters) == 2)
variable = 0
}
}
return rulesets
}
/**
* @param {string} value
* @param {object} root
* @param {object?} parent
* @param {number} index
* @param {number} offset
* @param {string[]} rules
* @param {number[]} points
* @param {string} type
* @param {string[]} props
* @param {string[]} children
* @param {number} length
* @return {object}
*/
function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {
var post = offset - 1
var rule = offset === 0 ? rules : ['']
var size = Utility_sizeof(rule)
for (var i = 0, j = 0, k = 0; i < index; ++i)
for (var x = 0, y = Utility_substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
if (z = trim(j > 0 ? rule[x] + ' ' + y : Utility_replace(y, /&\f/g, rule[x])))
props[k++] = z
return node(value, root, parent, offset === 0 ? Enum_RULESET : type, props, children, length)
}
/**
* @param {number} value
* @param {object} root
* @param {object?} parent
* @return {object}
*/
function comment (value, root, parent) {
return node(value, root, parent, COMMENT, Utility_from(Tokenizer_char()), Utility_substr(value, 2, -2), 0)
}
/**
* @param {string} value
* @param {object} root
* @param {object?} parent
* @param {number} length
* @return {object}
*/
function declaration (value, root, parent, length) {
return node(value, root, parent, Enum_DECLARATION, Utility_substr(value, 0, length), Utility_substr(value, length + 1, -1), length)
}
;// ./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js
var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
var previous = 0;
var character = 0;
while (true) {
previous = character;
character = peek(); // &\f
if (previous === 38 && character === 12) {
points[index] = 1;
}
if (token(character)) {
break;
}
next();
}
return slice(begin, position);
};
var toRules = function toRules(parsed, points) {
// pretend we've started with a comma
var index = -1;
var character = 44;
do {
switch (token(character)) {
case 0:
// &\f
if (character === 38 && peek() === 12) {
// this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
// stylis inserts \f after & to know when & where it should replace this sequence with the context selector
// and when it should just concatenate the outer and inner selectors
// it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
points[index] = 1;
}
parsed[index] += identifierWithPointTracking(position - 1, points, index);
break;
case 2:
parsed[index] += delimit(character);
break;
case 4:
// comma
if (character === 44) {
// colon
parsed[++index] = peek() === 58 ? '&\f' : '';
points[index] = parsed[index].length;
break;
}
// fallthrough
default:
parsed[index] += Utility_from(character);
}
} while (character = next());
return parsed;
};
var getRules = function getRules(value, points) {
return dealloc(toRules(alloc(value), points));
}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
var fixedElements = /* #__PURE__ */new WeakMap();
var compat = function compat(element) {
if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
// negative .length indicates that this rule has been already prefixed
element.length < 1) {
return;
}
var value = element.value,
parent = element.parent;
var isImplicitRule = element.column === parent.column && element.line === parent.line;
while (parent.type !== 'rule') {
parent = parent.parent;
if (!parent) return;
} // short-circuit for the simplest case
if (element.props.length === 1 && value.charCodeAt(0) !== 58
/* colon */
&& !fixedElements.get(parent)) {
return;
} // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
// then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
if (isImplicitRule) {
return;
}
fixedElements.set(element, true);
var points = [];
var rules = getRules(value, points);
var parentRules = parent.props;
for (var i = 0, k = 0; i < rules.length; i++) {
for (var j = 0; j < parentRules.length; j++, k++) {
element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
}
}
};
var removeLabel = function removeLabel(element) {
if (element.type === 'decl') {
var value = element.value;
if ( // charcode for l
value.charCodeAt(0) === 108 && // charcode for b
value.charCodeAt(2) === 98) {
// this ignores label
element["return"] = '';
element.value = '';
}
}
};
var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
var isIgnoringComment = function isIgnoringComment(element) {
return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
};
var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
return function (element, index, children) {
if (element.type !== 'rule' || cache.compat) return;
var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
if (unsafePseudoClasses) {
var isNested = element.parent === children[0]; // in nested rules comments become children of the "auto-inserted" rule
//
// considering this input:
// .a {
// .b /* comm */ {}
// color: hotpink;
// }
// we get output corresponding to this:
// .a {
// & {
// /* comm */
// color: hotpink;
// }
// .b {}
// }
var commentContainer = isNested ? children[0].children : // global rule at the root level
children;
for (var i = commentContainer.length - 1; i >= 0; i--) {
var node = commentContainer[i];
if (node.line < element.line) {
break;
} // it is quite weird but comments are *usually* put at `column: element.column - 1`
// so we seek *from the end* for the node that is earlier than the rule's `element` and check that
// this will also match inputs like this:
// .a {
// /* comm */
// .b {}
// }
//
// but that is fine
//
// it would be the easiest to change the placement of the comment to be the first child of the rule:
// .a {
// .b { /* comm */ }
// }
// with such inputs we wouldn't have to search for the comment at all
// TODO: consider changing this comment placement in the next major version
if (node.column < element.column) {
if (isIgnoringComment(node)) {
return;
}
break;
}
}
unsafePseudoClasses.forEach(function (unsafePseudoClass) {
console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
});
}
};
};
var isImportRule = function isImportRule(element) {
return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
};
var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {
for (var i = index - 1; i >= 0; i--) {
if (!isImportRule(children[i])) {
return true;
}
}
return false;
}; // use this to remove incorrect elements from further processing
// so they don't get handed to the `sheet` (or anything else)
// as that could potentially lead to additional logs which in turn could be overhelming to the user
var nullifyElement = function nullifyElement(element) {
element.type = '';
element.value = '';
element["return"] = '';
element.children = '';
element.props = '';
};
var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {
if (!isImportRule(element)) {
return;
}
if (element.parent) {
console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
nullifyElement(element);
} else if (isPrependedWithRegularRules(index, children)) {
console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
nullifyElement(element);
}
};
/* eslint-disable no-fallthrough */
function emotion_cache_browser_esm_prefix(value, length) {
switch (hash(value, length)) {
// color-adjust
case 5103:
return Enum_WEBKIT + 'print-' + value + value;
// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
case 5737:
case 4201:
case 3177:
case 3433:
case 1641:
case 4457:
case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
case 5572:
case 6356:
case 5844:
case 3191:
case 6645:
case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
case 6391:
case 5879:
case 5623:
case 6135:
case 4599:
case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
case 4215:
case 6389:
case 5109:
case 5365:
case 5621:
case 3829:
return Enum_WEBKIT + value + value;
// appearance, user-select, transform, hyphens, text-size-adjust
case 5349:
case 4246:
case 4810:
case 6968:
case 2756:
return Enum_WEBKIT + value + Enum_MOZ + value + Enum_MS + value + value;
// flex, flex-direction
case 6828:
case 4268:
return Enum_WEBKIT + value + Enum_MS + value + value;
// order
case 6165:
return Enum_WEBKIT + value + Enum_MS + 'flex-' + value + value;
// align-items
case 5187:
return Enum_WEBKIT + value + Utility_replace(value, /(\w+).+(:[^]+)/, Enum_WEBKIT + 'box-$1$2' + Enum_MS + 'flex-$1$2') + value;
// align-self
case 5443:
return Enum_WEBKIT + value + Enum_MS + 'flex-item-' + Utility_replace(value, /flex-|-self/, '') + value;
// align-content
case 4675:
return Enum_WEBKIT + value + Enum_MS + 'flex-line-pack' + Utility_replace(value, /align-content|flex-|-self/, '') + value;
// flex-shrink
case 5548:
return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'shrink', 'negative') + value;
// flex-basis
case 5292:
return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'basis', 'preferred-size') + value;
// flex-grow
case 6060:
return Enum_WEBKIT + 'box-' + Utility_replace(value, '-grow', '') + Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'grow', 'positive') + value;
// transition
case 4554:
return Enum_WEBKIT + Utility_replace(value, /([^-])(transform)/g, '$1' + Enum_WEBKIT + '$2') + value;
// cursor
case 6187:
return Utility_replace(Utility_replace(Utility_replace(value, /(zoom-|grab)/, Enum_WEBKIT + '$1'), /(image-set)/, Enum_WEBKIT + '$1'), value, '') + value;
// background, background-image
case 5495:
case 3959:
return Utility_replace(value, /(image-set\([^]*)/, Enum_WEBKIT + '$1' + '$`$1');
// justify-content
case 4968:
return Utility_replace(Utility_replace(value, /(.+:)(flex-)?(.*)/, Enum_WEBKIT + 'box-pack:$3' + Enum_MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + Enum_WEBKIT + value + value;
// (margin|padding)-inline-(start|end)
case 4095:
case 3583:
case 4068:
case 2532:
return Utility_replace(value, /(.+)-inline(.+)/, Enum_WEBKIT + '$1$2') + value;
// (min|max)?(width|height|inline-size|block-size)
case 8116:
case 7059:
case 5753:
case 5535:
case 5445:
case 5701:
case 4933:
case 4677:
case 5533:
case 5789:
case 5021:
case 4765:
// stretch, max-content, min-content, fill-available
if (Utility_strlen(value) - 1 - length > 6) switch (Utility_charat(value, length + 1)) {
// (m)ax-content, (m)in-content
case 109:
// -
if (Utility_charat(value, length + 4) !== 45) break;
// (f)ill-available, (f)it-content
case 102:
return Utility_replace(value, /(.+:)(.+)-([^]+)/, '$1' + Enum_WEBKIT + '$2-$3' + '$1' + Enum_MOZ + (Utility_charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
// (s)tretch
case 115:
return ~indexof(value, 'stretch') ? emotion_cache_browser_esm_prefix(Utility_replace(value, 'stretch', 'fill-available'), length) + value : value;
}
break;
// position: sticky
case 4949:
// (s)ticky?
if (Utility_charat(value, length + 1) !== 115) break;
// display: (flex|inline-flex)
case 6444:
switch (Utility_charat(value, Utility_strlen(value) - 3 - (~indexof(value, '!important') && 10))) {
// stic(k)y
case 107:
return Utility_replace(value, ':', ':' + Enum_WEBKIT) + value;
// (inline-)?fl(e)x
case 101:
return Utility_replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + Enum_WEBKIT + (Utility_charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + Enum_WEBKIT + '$2$3' + '$1' + Enum_MS + '$2box$3') + value;
}
break;
// writing-mode
case 5936:
switch (Utility_charat(value, length + 11)) {
// vertical-l(r)
case 114:
return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
// vertical-r(l)
case 108:
return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
// horizontal(-)tb
case 45:
return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
}
return Enum_WEBKIT + value + Enum_MS + value + value;
}
return value;
}
var emotion_cache_browser_esm_prefixer = function prefixer(element, index, children, callback) {
if (element.length > -1) if (!element["return"]) switch (element.type) {
case Enum_DECLARATION:
element["return"] = emotion_cache_browser_esm_prefix(element.value, element.length);
break;
case Enum_KEYFRAMES:
return Serializer_serialize([Tokenizer_copy(element, {
value: Utility_replace(element.value, '@', '@' + Enum_WEBKIT)
})], callback);
case Enum_RULESET:
if (element.length) return Utility_combine(element.props, function (value) {
switch (Utility_match(value, /(::plac\w+|:read-\w+)/)) {
// :read-(only|write)
case ':read-only':
case ':read-write':
return Serializer_serialize([Tokenizer_copy(element, {
props: [Utility_replace(value, /:(read-\w+)/, ':' + Enum_MOZ + '$1')]
})], callback);
// :placeholder
case '::placeholder':
return Serializer_serialize([Tokenizer_copy(element, {
props: [Utility_replace(value, /:(plac\w+)/, ':' + Enum_WEBKIT + 'input-$1')]
}), Tokenizer_copy(element, {
props: [Utility_replace(value, /:(plac\w+)/, ':' + Enum_MOZ + '$1')]
}), Tokenizer_copy(element, {
props: [Utility_replace(value, /:(plac\w+)/, Enum_MS + 'input-$1')]
})], callback);
}
return '';
});
}
};
var defaultStylisPlugins = [emotion_cache_browser_esm_prefixer];
var createCache = function createCache(options) {
var key = options.key;
if (false) {}
if ( key === 'css') {
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
// document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
// note this very very intentionally targets all style elements regardless of the key to ensure
// that creating a cache works inside of render of a React component
Array.prototype.forEach.call(ssrStyles, function (node) {
// we want to only move elements which have a space in the data-emotion attribute value
// because that indicates that it is an Emotion 11 server-side rendered style elements
// while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
// Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
// so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
// will not result in the Emotion 10 styles being destroyed
var dataEmotionAttribute = node.getAttribute('data-emotion');
if (dataEmotionAttribute.indexOf(' ') === -1) {
return;
}
document.head.appendChild(node);
node.setAttribute('data-s', '');
});
}
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
if (false) {}
var inserted = {};
var container;
var nodesToHydrate = [];
{
container = options.container || document.head;
Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe
for (var i = 1; i < attrib.length; i++) {
inserted[attrib[i]] = true;
}
nodesToHydrate.push(node);
});
}
var _insert;
var omnipresentPlugins = [compat, removeLabel];
if (false) {}
{
var currentSheet;
var finalizingPlugins = [Serializer_stringify, false ? 0 : rulesheet(function (rule) {
currentSheet.insert(rule);
})];
var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
var stylis = function stylis(styles) {
return Serializer_serialize(compile(styles), serializer);
};
_insert = function insert(selector, serialized, sheet, shouldCache) {
currentSheet = sheet;
if (false) {}
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
if (shouldCache) {
cache.inserted[serialized.name] = true;
}
};
}
var cache = {
key: key,
sheet: new StyleSheet({
key: key,
container: container,
nonce: options.nonce,
speedy: options.speedy,
prepend: options.prepend,
insertionPoint: options.insertionPoint
}),
nonce: options.nonce,
inserted: inserted,
registered: {},
insert: _insert
};
cache.sheet.hydrate(nodesToHydrate);
return cache;
};
/* harmony default export */ const emotion_cache_browser_esm = (createCache);
;// ./node_modules/@emotion/hash/dist/emotion-hash.esm.js
/* eslint-disable */
// Inspired by https://github.com/garycourt/murmurhash-js
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
function murmur2(str) {
// 'm' and 'r' are mixing constants generated offline.
// They're not really 'magic', they just happen to work well.
// const m = 0x5bd1e995;
// const r = 24;
// Initialize the hash
var h = 0; // Mix 4 bytes at a time into the hash
var k,
i = 0,
len = str.length;
for (; len >= 4; ++i, len -= 4) {
k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
k =
/* Math.imul(k, m): */
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
k ^=
/* k >>> r: */
k >>> 24;
h =
/* Math.imul(k, m): */
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
} // Handle the last few bytes of the input array
switch (len) {
case 3:
h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
case 2:
h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
case 1:
h ^= str.charCodeAt(i) & 0xff;
h =
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
} // Do a few final mixes of the hash to ensure the last few
// bytes are well-incorporated.
h ^= h >>> 13;
h =
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
return ((h ^ h >>> 15) >>> 0).toString(36);
}
/* harmony default export */ const emotion_hash_esm = (murmur2);
;// ./node_modules/@emotion/unitless/dist/emotion-unitless.esm.js
var unitlessKeys = {
animationIterationCount: 1,
borderImageOutset: 1,
borderImageSlice: 1,
borderImageWidth: 1,
boxFlex: 1,
boxFlexGroup: 1,
boxOrdinalGroup: 1,
columnCount: 1,
columns: 1,
flex: 1,
flexGrow: 1,
flexPositive: 1,
flexShrink: 1,
flexNegative: 1,
flexOrder: 1,
gridRow: 1,
gridRowEnd: 1,
gridRowSpan: 1,
gridRowStart: 1,
gridColumn: 1,
gridColumnEnd: 1,
gridColumnSpan: 1,
gridColumnStart: 1,
msGridRow: 1,
msGridRowSpan: 1,
msGridColumn: 1,
msGridColumnSpan: 1,
fontWeight: 1,
lineHeight: 1,
opacity: 1,
order: 1,
orphans: 1,
tabSize: 1,
widows: 1,
zIndex: 1,
zoom: 1,
WebkitLineClamp: 1,
// SVG-related properties
fillOpacity: 1,
floodOpacity: 1,
stopOpacity: 1,
strokeDasharray: 1,
strokeDashoffset: 1,
strokeMiterlimit: 1,
strokeOpacity: 1,
strokeWidth: 1
};
/* harmony default export */ const emotion_unitless_esm = (unitlessKeys);
;// ./node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
var hyphenateRegex = /[A-Z]|^ms/g;
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
var isCustomProperty = function isCustomProperty(property) {
return property.charCodeAt(1) === 45;
};
var isProcessableValue = function isProcessableValue(value) {
return value != null && typeof value !== 'boolean';
};
var processStyleName = /* #__PURE__ */memoize(function (styleName) {
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
});
var processStyleValue = function processStyleValue(key, value) {
switch (key) {
case 'animation':
case 'animationName':
{
if (typeof value === 'string') {
return value.replace(animationRegex, function (match, p1, p2) {
cursor = {
name: p1,
styles: p2,
next: cursor
};
return p1;
});
}
}
}
if (emotion_unitless_esm[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
return value + 'px';
}
return value;
};
if (false) { var hyphenatedCache, hyphenPattern, msPattern, oldProcessStyleValue, contentValues, contentValuePattern; }
var noComponentSelectorMessage = (/* unused pure expression or super */ null && ('Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.'));
function handleInterpolation(mergedProps, registered, interpolation) {
if (interpolation == null) {
return '';
}
if (interpolation.__emotion_styles !== undefined) {
if (false) {}
return interpolation;
}
switch (typeof interpolation) {
case 'boolean':
{
return '';
}
case 'object':
{
if (interpolation.anim === 1) {
cursor = {
name: interpolation.name,
styles: interpolation.styles,
next: cursor
};
return interpolation.name;
}
if (interpolation.styles !== undefined) {
var next = interpolation.next;
if (next !== undefined) {
// not the most efficient thing ever but this is a pretty rare case
// and there will be very few iterations of this generally
while (next !== undefined) {
cursor = {
name: next.name,
styles: next.styles,
next: cursor
};
next = next.next;
}
}
var styles = interpolation.styles + ";";
if (false) {}
return styles;
}
return createStringFromObject(mergedProps, registered, interpolation);
}
case 'function':
{
if (mergedProps !== undefined) {
var previousCursor = cursor;
var result = interpolation(mergedProps);
cursor = previousCursor;
return handleInterpolation(mergedProps, registered, result);
} else if (false) {}
break;
}
case 'string':
if (false) { var replaced, matched; }
break;
} // finalize string values (regular strings and functions interpolated into css calls)
if (registered == null) {
return interpolation;
}
var cached = registered[interpolation];
return cached !== undefined ? cached : interpolation;
}
function createStringFromObject(mergedProps, registered, obj) {
var string = '';
if (Array.isArray(obj)) {
for (var i = 0; i < obj.length; i++) {
string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
}
} else {
for (var _key in obj) {
var value = obj[_key];
if (typeof value !== 'object') {
if (registered != null && registered[value] !== undefined) {
string += _key + "{" + registered[value] + "}";
} else if (isProcessableValue(value)) {
string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
}
} else {
if (_key === 'NO_COMPONENT_SELECTOR' && "production" !== 'production') {}
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
for (var _i = 0; _i < value.length; _i++) {
if (isProcessableValue(value[_i])) {
string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
}
}
} else {
var interpolated = handleInterpolation(mergedProps, registered, value);
switch (_key) {
case 'animation':
case 'animationName':
{
string += processStyleName(_key) + ":" + interpolated + ";";
break;
}
default:
{
if (false) {}
string += _key + "{" + interpolated + "}";
}
}
}
}
}
}
return string;
}
var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
var sourceMapPattern;
if (false) {} // this is the cursor for keyframes
// keyframes are stored on the SerializedStyles object as a linked list
var cursor;
var emotion_serialize_browser_esm_serializeStyles = function serializeStyles(args, registered, mergedProps) {
if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
return args[0];
}
var stringMode = true;
var styles = '';
cursor = undefined;
var strings = args[0];
if (strings == null || strings.raw === undefined) {
stringMode = false;
styles += handleInterpolation(mergedProps, registered, strings);
} else {
if (false) {}
styles += strings[0];
} // we start at 1 since we've already handled the first arg
for (var i = 1; i < args.length; i++) {
styles += handleInterpolation(mergedProps, registered, args[i]);
if (stringMode) {
if (false) {}
styles += strings[i];
}
}
var sourceMap;
if (false) {} // using a global regex with .exec is stateful so lastIndex has to be reset each time
labelPattern.lastIndex = 0;
var identifierName = '';
var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
while ((match = labelPattern.exec(styles)) !== null) {
identifierName += '-' + // $FlowFixMe we know it's not null
match[1];
}
var name = emotion_hash_esm(styles) + identifierName;
if (false) {}
return {
name: name,
styles: styles,
next: cursor
};
};
;// ./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js
var syncFallback = function syncFallback(create) {
return create();
};
var useInsertionEffect = external_React_['useInsertion' + 'Effect'] ? external_React_['useInsertion' + 'Effect'] : false;
var emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;
var useInsertionEffectWithLayoutFallback = (/* unused pure expression or super */ null && (useInsertionEffect || useLayoutEffect));
;// ./node_modules/@emotion/react/dist/emotion-element-6a883da9.browser.esm.js
var emotion_element_6a883da9_browser_esm_hasOwnProperty = {}.hasOwnProperty;
var EmotionCacheContext = /* #__PURE__ */(0,external_React_.createContext)( // we're doing this to avoid preconstruct's dead code elimination in this one case
// because this module is primarily intended for the browser and node
// but it's also required in react native and similar environments sometimes
// and we could have a special build just for that
// but this is much easier and the native packages
// might use a different theme context in the future anyway
typeof HTMLElement !== 'undefined' ? /* #__PURE__ */emotion_cache_browser_esm({
key: 'css'
}) : null);
if (false) {}
var CacheProvider = EmotionCacheContext.Provider;
var __unsafe_useEmotionCache = function useEmotionCache() {
return useContext(EmotionCacheContext);
};
var withEmotionCache = function withEmotionCache(func) {
// $FlowFixMe
return /*#__PURE__*/(0,external_React_.forwardRef)(function (props, ref) {
// the cache will never be null in the browser
var cache = (0,external_React_.useContext)(EmotionCacheContext);
return func(props, cache, ref);
});
};
var ThemeContext = /* #__PURE__ */(0,external_React_.createContext)({});
if (false) {}
var useTheme = function useTheme() {
return useContext(ThemeContext);
};
var getTheme = function getTheme(outerTheme, theme) {
if (typeof theme === 'function') {
var mergedTheme = theme(outerTheme);
if (false) {}
return mergedTheme;
}
if (false) {}
return _extends({}, outerTheme, theme);
};
var createCacheWithTheme = /* #__PURE__ */(/* unused pure expression or super */ null && (weakMemoize(function (outerTheme) {
return weakMemoize(function (theme) {
return getTheme(outerTheme, theme);
});
})));
var ThemeProvider = function ThemeProvider(props) {
var theme = useContext(ThemeContext);
if (props.theme !== theme) {
theme = createCacheWithTheme(theme)(props.theme);
}
return /*#__PURE__*/createElement(ThemeContext.Provider, {
value: theme
}, props.children);
};
function withTheme(Component) {
var componentName = Component.displayName || Component.name || 'Component';
var render = function render(props, ref) {
var theme = useContext(ThemeContext);
return /*#__PURE__*/createElement(Component, _extends({
theme: theme,
ref: ref
}, props));
}; // $FlowFixMe
var WithTheme = /*#__PURE__*/forwardRef(render);
WithTheme.displayName = "WithTheme(" + componentName + ")";
return hoistNonReactStatics(WithTheme, Component);
}
var getLastPart = function getLastPart(functionName) {
// The match may be something like 'Object.createEmotionProps' or
// 'Loader.prototype.render'
var parts = functionName.split('.');
return parts[parts.length - 1];
};
var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {
// V8
var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line);
if (match) return getLastPart(match[1]); // Safari / Firefox
match = /^([A-Za-z0-9$.]+)@/.exec(line);
if (match) return getLastPart(match[1]);
return undefined;
};
var internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS
// identifiers, thus we only need to replace what is a valid character for JS,
// but not for CSS.
var sanitizeIdentifier = function sanitizeIdentifier(identifier) {
return identifier.replace(/\$/g, '-');
};
var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {
if (!stackTrace) return undefined;
var lines = stackTrace.split('\n');
for (var i = 0; i < lines.length; i++) {
var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just "Error"
if (!functionName) continue; // If we reach one of these, we have gone too far and should quit
if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an
// uppercase letter
if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);
}
return undefined;
};
var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
var createEmotionProps = function createEmotionProps(type, props) {
if (false) {}
var newProps = {};
for (var key in props) {
if (emotion_element_6a883da9_browser_esm_hasOwnProperty.call(props, key)) {
newProps[key] = props[key];
}
}
newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when
// the label hasn't already been computed
if (false) { var label; }
return newProps;
};
var Insertion = function Insertion(_ref) {
var cache = _ref.cache,
serialized = _ref.serialized,
isStringTag = _ref.isStringTag;
registerStyles(cache, serialized, isStringTag);
var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
return insertStyles(cache, serialized, isStringTag);
});
return null;
};
var Emotion = /* #__PURE__ */(/* unused pure expression or super */ null && (withEmotionCache(function (props, cache, ref) {
var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
// not passing the registered cache to serializeStyles because it would
// make certain babel optimisations not possible
if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {
cssProp = cache.registered[cssProp];
}
var WrappedComponent = props[typePropName];
var registeredStyles = [cssProp];
var className = '';
if (typeof props.className === 'string') {
className = getRegisteredStyles(cache.registered, registeredStyles, props.className);
} else if (props.className != null) {
className = props.className + " ";
}
var serialized = serializeStyles(registeredStyles, undefined, useContext(ThemeContext));
if (false) { var labelFromStack; }
className += cache.key + "-" + serialized.name;
var newProps = {};
for (var key in props) {
if (emotion_element_6a883da9_browser_esm_hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( true || 0)) {
newProps[key] = props[key];
}
}
newProps.ref = ref;
newProps.className = className;
return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, {
cache: cache,
serialized: serialized,
isStringTag: typeof WrappedComponent === 'string'
}), /*#__PURE__*/createElement(WrappedComponent, newProps));
})));
if (false) {}
;// ./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js
var isBrowser = "object" !== 'undefined';
function emotion_utils_browser_esm_getRegisteredStyles(registered, registeredStyles, classNames) {
var rawClassName = '';
classNames.split(' ').forEach(function (className) {
if (registered[className] !== undefined) {
registeredStyles.push(registered[className] + ";");
} else {
rawClassName += className + " ";
}
});
return rawClassName;
}
var emotion_utils_browser_esm_registerStyles = function registerStyles(cache, serialized, isStringTag) {
var className = cache.key + "-" + serialized.name;
if ( // we only need to add the styles to the registered cache if the
// class name could be used further down
// the tree but if it's a string tag, we know it won't
// so we don't have to add it to registered cache.
// this improves memory usage since we can avoid storing the whole style string
(isStringTag === false || // we need to always store it if we're in compat mode and
// in node since emotion-server relies on whether a style is in
// the registered cache to know whether a style is global or not
// also, note that this check will be dead code eliminated in the browser
isBrowser === false ) && cache.registered[className] === undefined) {
cache.registered[className] = serialized.styles;
}
};
var emotion_utils_browser_esm_insertStyles = function insertStyles(cache, serialized, isStringTag) {
emotion_utils_browser_esm_registerStyles(cache, serialized, isStringTag);
var className = cache.key + "-" + serialized.name;
if (cache.inserted[serialized.name] === undefined) {
var current = serialized;
do {
var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
current = current.next;
} while (current !== undefined);
}
};
;// ./node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js
var testOmitPropsOnStringTag = isPropValid;
var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
return key !== 'theme';
};
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
return typeof tag === 'string' && // 96 is one less than the char code
// for "a" so this is checking that
// it's a lowercase character
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
};
var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
var shouldForwardProp;
if (options) {
var optionsShouldForwardProp = options.shouldForwardProp;
shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
} : optionsShouldForwardProp;
}
if (typeof shouldForwardProp !== 'function' && isReal) {
shouldForwardProp = tag.__emotion_forwardProp;
}
return shouldForwardProp;
};
var emotion_styled_base_browser_esm_ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
var emotion_styled_base_browser_esm_Insertion = function Insertion(_ref) {
var cache = _ref.cache,
serialized = _ref.serialized,
isStringTag = _ref.isStringTag;
emotion_utils_browser_esm_registerStyles(cache, serialized, isStringTag);
var rules = emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectAlwaysWithSyncFallback(function () {
return emotion_utils_browser_esm_insertStyles(cache, serialized, isStringTag);
});
return null;
};
var createStyled = function createStyled(tag, options) {
if (false) {}
var isReal = tag.__emotion_real === tag;
var baseTag = isReal && tag.__emotion_base || tag;
var identifierName;
var targetClassName;
if (options !== undefined) {
identifierName = options.label;
targetClassName = options.target;
}
var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
var shouldUseAs = !defaultShouldForwardProp('as');
return function () {
var args = arguments;
var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
if (identifierName !== undefined) {
styles.push("label:" + identifierName + ";");
}
if (args[0] == null || args[0].raw === undefined) {
styles.push.apply(styles, args);
} else {
if (false) {}
styles.push(args[0][0]);
var len = args.length;
var i = 1;
for (; i < len; i++) {
if (false) {}
styles.push(args[i], args[0][i]);
}
} // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
var Styled = withEmotionCache(function (props, cache, ref) {
var FinalTag = shouldUseAs && props.as || baseTag;
var className = '';
var classInterpolations = [];
var mergedProps = props;
if (props.theme == null) {
mergedProps = {};
for (var key in props) {
mergedProps[key] = props[key];
}
mergedProps.theme = (0,external_React_.useContext)(ThemeContext);
}
if (typeof props.className === 'string') {
className = emotion_utils_browser_esm_getRegisteredStyles(cache.registered, classInterpolations, props.className);
} else if (props.className != null) {
className = props.className + " ";
}
var serialized = emotion_serialize_browser_esm_serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
className += cache.key + "-" + serialized.name;
if (targetClassName !== undefined) {
className += " " + targetClassName;
}
var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
var newProps = {};
for (var _key in props) {
if (shouldUseAs && _key === 'as') continue;
if ( // $FlowFixMe
finalShouldForwardProp(_key)) {
newProps[_key] = props[_key];
}
}
newProps.className = className;
newProps.ref = ref;
return /*#__PURE__*/(0,external_React_.createElement)(external_React_.Fragment, null, /*#__PURE__*/(0,external_React_.createElement)(emotion_styled_base_browser_esm_Insertion, {
cache: cache,
serialized: serialized,
isStringTag: typeof FinalTag === 'string'
}), /*#__PURE__*/(0,external_React_.createElement)(FinalTag, newProps));
});
Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
Styled.defaultProps = tag.defaultProps;
Styled.__emotion_real = Styled;
Styled.__emotion_base = baseTag;
Styled.__emotion_styles = styles;
Styled.__emotion_forwardProp = shouldForwardProp;
Object.defineProperty(Styled, 'toString', {
value: function value() {
if (targetClassName === undefined && "production" !== 'production') {} // $FlowFixMe: coerce undefined to string
return "." + targetClassName;
}
});
Styled.withComponent = function (nextTag, nextOptions) {
return createStyled(nextTag, extends_extends({}, options, nextOptions, {
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
})).apply(void 0, styles);
};
return Styled;
};
};
/* harmony default export */ const emotion_styled_base_browser_esm = (createStyled);
;// ./node_modules/@emotion/styled/dist/emotion-styled.browser.esm.js
var tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG
'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
var newStyled = emotion_styled_base_browser_esm.bind();
tags.forEach(function (tagName) {
// $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type
newStyled[tagName] = newStyled(tagName);
});
/* harmony default export */ const emotion_styled_browser_esm = (newStyled);
;// ./node_modules/@wordpress/block-editor/build-module/components/dimensions-tool/width-height-tool.js
const SingleColumnToolsPanelItem = emotion_styled_browser_esm((0,external_wp_components_namespaceObject.__experimentalToolsPanelItem))`
grid-column: span 1;
`;
function WidthHeightTool({
panelId,
value = {},
onChange = () => {
},
units,
isShownByDefault = true
}) {
const width = value.width === "auto" ? "" : value.width ?? "";
const height = value.height === "auto" ? "" : value.height ?? "";
const onDimensionChange = (dimension) => (nextDimension) => {
const nextValue = { ...value };
if (!nextDimension) {
delete nextValue[dimension];
} else {
nextValue[dimension] = nextDimension;
}
onChange(nextValue);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SingleColumnToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Width"),
isShownByDefault,
hasValue: () => width !== "",
onDeselect: onDimensionChange("width"),
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Width"),
placeholder: (0,external_wp_i18n_namespaceObject.__)("Auto"),
labelPosition: "top",
units,
min: 0,
value: width,
onChange: onDimensionChange("width"),
size: "__unstable-large"
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SingleColumnToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Height"),
isShownByDefault,
hasValue: () => height !== "",
onDeselect: onDimensionChange("height"),
panelId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Height"),
placeholder: (0,external_wp_i18n_namespaceObject.__)("Auto"),
labelPosition: "top",
units,
min: 0,
value: height,
onChange: onDimensionChange("height"),
size: "__unstable-large"
}
)
}
)
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/components/dimensions-tool/index.js
function DimensionsTool({
panelId,
value = {},
onChange = () => {
},
aspectRatioOptions,
// Default options handled by AspectRatioTool.
defaultAspectRatio = "auto",
// Match CSS default value for aspect-ratio.
scaleOptions,
// Default options handled by ScaleTool.
defaultScale = "fill",
// Match CSS default value for object-fit.
unitsOptions,
// Default options handled by UnitControl.
tools = ["aspectRatio", "widthHeight", "scale"]
}) {
const width = value.width === void 0 || value.width === "auto" ? null : value.width;
const height = value.height === void 0 || value.height === "auto" ? null : value.height;
const aspectRatio = value.aspectRatio === void 0 || value.aspectRatio === "auto" ? null : value.aspectRatio;
const scale = value.scale === void 0 || value.scale === "fill" ? null : value.scale;
const [lastScale, setLastScale] = (0,external_wp_element_namespaceObject.useState)(scale);
const [lastAspectRatio, setLastAspectRatio] = (0,external_wp_element_namespaceObject.useState)(aspectRatio);
const aspectRatioValue = width && height ? "custom" : lastAspectRatio;
const showScaleControl = aspectRatio || width && height;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
tools.includes("aspectRatio") && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
AspectRatioTool,
{
panelId,
options: aspectRatioOptions,
defaultValue: defaultAspectRatio,
value: aspectRatioValue,
onChange: (nextAspectRatio) => {
const nextValue = { ...value };
nextAspectRatio = nextAspectRatio === "auto" ? null : nextAspectRatio;
setLastAspectRatio(nextAspectRatio);
if (!nextAspectRatio) {
delete nextValue.aspectRatio;
} else {
nextValue.aspectRatio = nextAspectRatio;
}
if (!nextAspectRatio) {
delete nextValue.scale;
} else if (lastScale) {
nextValue.scale = lastScale;
} else {
nextValue.scale = defaultScale;
setLastScale(defaultScale);
}
if ("custom" !== nextAspectRatio && width && height) {
delete nextValue.height;
}
onChange(nextValue);
}
}
),
tools.includes("widthHeight") && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
WidthHeightTool,
{
panelId,
units: unitsOptions,
value: { width, height },
onChange: ({ width: nextWidth, height: nextHeight }) => {
const nextValue = { ...value };
nextWidth = nextWidth === "auto" ? null : nextWidth;
nextHeight = nextHeight === "auto" ? null : nextHeight;
if (!nextWidth) {
delete nextValue.width;
} else {
nextValue.width = nextWidth;
}
if (!nextHeight) {
delete nextValue.height;
} else {
nextValue.height = nextHeight;
}
if (nextWidth && nextHeight) {
delete nextValue.aspectRatio;
} else if (lastAspectRatio) {
nextValue.aspectRatio = lastAspectRatio;
} else {
}
if (!lastAspectRatio && !!nextWidth !== !!nextHeight) {
delete nextValue.scale;
} else if (lastScale) {
nextValue.scale = lastScale;
} else {
nextValue.scale = defaultScale;
setLastScale(defaultScale);
}
onChange(nextValue);
}
}
),
tools.includes("scale") && showScaleControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ScaleTool,
{
panelId,
options: scaleOptions,
defaultValue: defaultScale,
value: lastScale,
onChange: (nextScale) => {
const nextValue = { ...value };
nextScale = nextScale === "fill" ? null : nextScale;
setLastScale(nextScale);
if (!nextScale) {
delete nextValue.scale;
} else {
nextValue.scale = nextScale;
}
onChange(nextValue);
}
}
)
] });
}
var dimensions_tool_default = DimensionsTool;
;// ./node_modules/@wordpress/block-editor/build-module/components/resolution-tool/index.js
const DEFAULT_SIZE_OPTIONS = [
{
label: (0,external_wp_i18n_namespaceObject._x)("Thumbnail", "Image size option for resolution control"),
value: "thumbnail"
},
{
label: (0,external_wp_i18n_namespaceObject._x)("Medium", "Image size option for resolution control"),
value: "medium"
},
{
label: (0,external_wp_i18n_namespaceObject._x)("Large", "Image size option for resolution control"),
value: "large"
},
{
label: (0,external_wp_i18n_namespaceObject._x)("Full Size", "Image size option for resolution control"),
value: "full"
}
];
function ResolutionTool({
panelId,
value,
onChange,
options = DEFAULT_SIZE_OPTIONS,
defaultValue = DEFAULT_SIZE_OPTIONS[0].value,
isShownByDefault = true,
resetAllFilter
}) {
const displayValue = value ?? defaultValue;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: () => displayValue !== defaultValue,
label: (0,external_wp_i18n_namespaceObject.__)("Resolution"),
onDeselect: () => onChange(defaultValue),
isShownByDefault,
panelId,
resetAllFilter,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SelectControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Resolution"),
value: displayValue,
options,
onChange,
help: (0,external_wp_i18n_namespaceObject.__)("Select the size of the source image."),
size: "__unstable-large"
}
)
}
);
}
;// ./node_modules/@wordpress/block-editor/build-module/components/html-element-control/messages.js
const htmlElementMessages = {
a: (0,external_wp_i18n_namespaceObject.__)(
"The <a> element should be used for links that navigate to a different page or to a different section within the same page."
),
article: (0,external_wp_i18n_namespaceObject.__)(
"The <article> element should represent a self-contained, syndicatable portion of the document."
),
aside: (0,external_wp_i18n_namespaceObject.__)(
"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."
),
button: (0,external_wp_i18n_namespaceObject.__)(
"The <button> element should be used for interactive controls that perform an action on the current page, such as opening a modal or toggling content visibility."
),
div: (0,external_wp_i18n_namespaceObject.__)(
"The <div> element should only be used if the block is a design element with no semantic meaning."
),
footer: (0,external_wp_i18n_namespaceObject.__)(
"The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.)."
),
header: (0,external_wp_i18n_namespaceObject.__)(
"The <header> element should represent introductory content, typically a group of introductory or navigational aids."
),
main: (0,external_wp_i18n_namespaceObject.__)(
"The <main> element should be used for the primary content of your document only."
),
nav: (0,external_wp_i18n_namespaceObject.__)(
"The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation."
),
section: (0,external_wp_i18n_namespaceObject.__)(
"The <section> element should represent a standalone portion of the document that can't be better represented by another element."
)
};
;// ./node_modules/@wordpress/block-editor/build-module/components/html-element-control/index.js
function HTMLElementControl({
tagName,
onChange,
clientId,
options = [
{ label: (0,external_wp_i18n_namespaceObject.__)("Default (<div>)"), value: "div" },
{ label: "<header>", value: "header" },
{ label: "<main>", value: "main" },
{ label: "<section>", value: "section" },
{ label: "<article>", value: "article" },
{ label: "<aside>", value: "aside" },
{ label: "<footer>", value: "footer" }
]
}) {
const checkForMainTag = !!clientId && options.some((option) => option.value === "main");
const hasMainElementElsewhere = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
if (!checkForMainTag) {
return false;
}
const { getClientIdsWithDescendants, getBlockAttributes } = select(store);
return getClientIdsWithDescendants().some((id) => {
if (id === clientId) {
return false;
}
return getBlockAttributes(id)?.tagName === "main";
});
},
[clientId, checkForMainTag]
);
const modifiedOptions = options.map((option) => {
if (option.value === "main" && hasMainElementElsewhere && tagName !== "main") {
return {
...option,
disabled: true,
label: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: HTML element name */
(0,external_wp_i18n_namespaceObject.__)("%s (Already in use)"),
option.label
)
};
}
return option;
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 2, className: "block-editor-html-element-control", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SelectControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("HTML element"),
options: modifiedOptions,
value: tagName,
onChange,
help: htmlElementMessages[tagName]
}
),
tagName === "main" && hasMainElementElsewhere && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "warning", isDismissible: false, children: (0,external_wp_i18n_namespaceObject.__)(
"Multiple <main> elements detected. The duplicate may be in your content or template. This is not valid HTML and may cause accessibility issues. Please change this HTML element."
) })
] });
}
;// ./node_modules/@wordpress/block-editor/build-module/private-apis.js
const privateApis = {};
lock(privateApis, {
...global_styles_namespaceObject,
ExperimentalBlockCanvas: ExperimentalBlockCanvas,
ExperimentalBlockEditorProvider: ExperimentalBlockEditorProvider,
getDuotoneFilter: getDuotoneFilter,
getRichTextValues: getRichTextValues,
PrivateQuickInserter: QuickInserter,
extractWords: extractWords,
getNormalizedSearchTerms: getNormalizedSearchTerms,
normalizeString: normalizeString,
PrivateListView: PrivateListView,
ResizableBoxPopover: ResizableBoxPopover,
useHasBlockToolbar: useHasBlockToolbar,
cleanEmptyObject: utils_cleanEmptyObject,
BlockQuickNavigation: BlockQuickNavigation,
LayoutStyle: LayoutStyle,
BlockManager: BlockManager,
BlockRemovalWarningModal: BlockRemovalWarningModal,
useLayoutClasses: useLayoutClasses,
useLayoutStyles: useLayoutStyles,
DimensionsTool: dimensions_tool_default,
ResolutionTool: ResolutionTool,
TabbedSidebar: tabbed_sidebar_default,
TextAlignmentControl: TextAlignmentControl,
usesContextKey: usesContextKey,
useFlashEditableBlocks: useFlashEditableBlocks,
HTMLElementControl: HTMLElementControl,
useZoomOut: useZoomOut,
globalStylesDataKey: globalStylesDataKey,
globalStylesLinksDataKey: globalStylesLinksDataKey,
selectBlockPatternsKey: selectBlockPatternsKey,
requiresWrapperOnCopy: requiresWrapperOnCopy,
PrivateRichText: PrivateRichText,
PrivateInserterLibrary: PrivateInserterLibrary,
reusableBlocksSelectKey: reusableBlocksSelectKey,
PrivateBlockPopover: PrivateBlockPopover,
PrivatePublishDateTimePicker: PrivatePublishDateTimePicker,
useSpacingSizes: useSpacingSizes,
useBlockDisplayTitle: useBlockDisplayTitle,
__unstableBlockStyleVariationOverridesWithConfig: __unstableBlockStyleVariationOverridesWithConfig,
setBackgroundStyleDefaults: setBackgroundStyleDefaults,
sectionRootClientIdKey: sectionRootClientIdKey,
CommentIconSlotFill: block_comment_icon_slot_default,
CommentIconToolbarSlotFill: block_comment_icon_toolbar_slot_default,
mediaEditKey: mediaEditKey,
essentialFormatKey: essentialFormatKey,
useBlockElement: useBlockElement,
useBlockElementRef: useBlockElementRef
});
;// ./node_modules/@wordpress/block-editor/build-module/index.js
})();
(window.wp = window.wp || {}).blockEditor = __webpack_exports__;
/******/ })()
; wordcount.js 0000644 00000032404 15121363532 0007132 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 677:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (/* binding */ stripTags)
/* harmony export */ });
function stripTags(settings, text) {
return text.replace(settings.HTMLRegExp, "\n");
}
/***/ }),
/***/ 2125:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (/* binding */ transposeAstralsToCountableChar)
/* harmony export */ });
function transposeAstralsToCountableChar(settings, text) {
return text.replace(settings.astralRegExp, "a");
}
/***/ }),
/***/ 3608:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (/* binding */ stripConnectors)
/* harmony export */ });
function stripConnectors(settings, text) {
return text.replace(settings.connectorRegExp, " ");
}
/***/ }),
/***/ 4516:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (/* binding */ stripShortcodes)
/* harmony export */ });
function stripShortcodes(settings, text) {
if (settings.shortcodesRegExp) {
return text.replace(settings.shortcodesRegExp, "\n");
}
return text;
}
/***/ }),
/***/ 4579:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (/* binding */ stripHTMLComments)
/* harmony export */ });
function stripHTMLComments(settings, text) {
return text.replace(settings.HTMLcommentRegExp, "");
}
/***/ }),
/***/ 4846:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (/* binding */ stripHTMLEntities)
/* harmony export */ });
function stripHTMLEntities(settings, text) {
return text.replace(settings.HTMLEntityRegExp, "");
}
/***/ }),
/***/ 6019:
/***/ (() => {
/***/ }),
/***/ 6542:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (/* binding */ stripRemovables)
/* harmony export */ });
function stripRemovables(settings, text) {
return text.replace(settings.removeRegExp, "");
}
/***/ }),
/***/ 7742:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ L: () => (/* binding */ defaultSettings)
/* harmony export */ });
const defaultSettings = {
HTMLRegExp: /<\/?[a-z][^>]*?>/gi,
HTMLcommentRegExp: /<!--[\s\S]*?-->/g,
spaceRegExp: / | /gi,
HTMLEntityRegExp: /&\S+?;/g,
// \u2014 = em-dash.
connectorRegExp: /--|\u2014/g,
// Characters to be removed from input text.
removeRegExp: new RegExp(
[
"[",
// Basic Latin (extract)
"!-/:-@[-`{-~",
// Latin-1 Supplement (extract)
"\x80-\xBF\xD7\xF7",
/*
* The following range consists of:
* General Punctuation
* Superscripts and Subscripts
* Currency Symbols
* Combining Diacritical Marks for Symbols
* Letterlike Symbols
* Number Forms
* Arrows
* Mathematical Operators
* Miscellaneous Technical
* Control Pictures
* Optical Character Recognition
* Enclosed Alphanumerics
* Box Drawing
* Block Elements
* Geometric Shapes
* Miscellaneous Symbols
* Dingbats
* Miscellaneous Mathematical Symbols-A
* Supplemental Arrows-A
* Braille Patterns
* Supplemental Arrows-B
* Miscellaneous Mathematical Symbols-B
* Supplemental Mathematical Operators
* Miscellaneous Symbols and Arrows
*/
"\u2000-\u2BFF",
// Supplemental Punctuation.
"\u2E00-\u2E7F",
"]"
].join(""),
"g"
),
// Remove UTF-16 surrogate points, see https://en.wikipedia.org/wiki/UTF-16#U.2BD800_to_U.2BDFFF
astralRegExp: /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
wordsRegExp: /\S\s+/g,
characters_excluding_spacesRegExp: /\S/g,
/*
* Match anything that is not a formatting character, excluding:
* \f = form feed
* \n = new line
* \r = carriage return
* \t = tab
* \v = vertical tab
* \u00AD = soft hyphen
* \u2028 = line separator
* \u2029 = paragraph separator
*/
characters_including_spacesRegExp: /[^\f\n\r\t\v\u00AD\u2028\u2029]/g,
l10n: {
type: "words"
}
};
/***/ }),
/***/ 8026:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (/* binding */ transposeHTMLEntitiesToCountableChars)
/* harmony export */ });
function transposeHTMLEntitiesToCountableChars(settings, text) {
return text.replace(settings.HTMLEntityRegExp, "a");
}
/***/ }),
/***/ 8511:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (/* binding */ stripSpaces)
/* harmony export */ });
function stripSpaces(settings, text) {
return text.replace(settings.spaceRegExp, " ");
}
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
(() => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ count: () => (/* binding */ count)
/* harmony export */ });
/* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7742);
/* harmony import */ var _stripTags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(677);
/* harmony import */ var _transposeAstralsToCountableChar__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2125);
/* harmony import */ var _stripHTMLEntities__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4846);
/* harmony import */ var _stripConnectors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3608);
/* harmony import */ var _stripRemovables__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6542);
/* harmony import */ var _stripHTMLComments__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4579);
/* harmony import */ var _stripShortcodes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4516);
/* harmony import */ var _stripSpaces__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8511);
/* harmony import */ var _transposeHTMLEntitiesToCountableChars__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(8026);
/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(6019);
/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_types__WEBPACK_IMPORTED_MODULE_10__);
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _types__WEBPACK_IMPORTED_MODULE_10__) if(["default","count"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _types__WEBPACK_IMPORTED_MODULE_10__[__WEBPACK_IMPORT_KEY__]
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
function loadSettings(type = "words", userSettings = {}) {
const mergedSettings = { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* .defaultSettings */ .L, ...userSettings };
const settings = {
...mergedSettings,
type,
shortcodes: []
};
settings.shortcodes = settings.l10n?.shortcodes ?? [];
if (settings.shortcodes && settings.shortcodes.length) {
settings.shortcodesRegExp = new RegExp(
"\\[\\/?(?:" + settings.shortcodes.join("|") + ")[^\\]]*?\\]",
"g"
);
}
if (settings.type !== "characters_excluding_spaces" && settings.type !== "characters_including_spaces") {
settings.type = "words";
}
return settings;
}
function countWords(text, regex, settings) {
text = [
_stripTags__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.bind(null, settings),
_stripHTMLComments__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.bind(null, settings),
_stripShortcodes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.bind(null, settings),
_stripSpaces__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.bind(null, settings),
_stripHTMLEntities__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.bind(null, settings),
_stripConnectors__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.bind(null, settings),
_stripRemovables__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A.bind(null, settings)
].reduce((result, fn) => fn(result), text);
text = text + "\n";
return text.match(regex)?.length ?? 0;
}
function countCharacters(text, regex, settings) {
text = [
_stripTags__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.bind(null, settings),
_stripHTMLComments__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.bind(null, settings),
_stripShortcodes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.bind(null, settings),
_transposeAstralsToCountableChar__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A.bind(null, settings),
_stripSpaces__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.bind(null, settings),
_transposeHTMLEntitiesToCountableChars__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A.bind(null, settings)
].reduce((result, fn) => fn(result), text);
text = text + "\n";
return text.match(regex)?.length ?? 0;
}
function count(text, type, userSettings) {
const settings = loadSettings(type, userSettings);
let matchRegExp;
switch (settings.type) {
case "words":
matchRegExp = settings.wordsRegExp;
return countWords(text, matchRegExp, settings);
case "characters_including_spaces":
matchRegExp = settings.characters_including_spacesRegExp;
return countCharacters(text, matchRegExp, settings);
case "characters_excluding_spaces":
matchRegExp = settings.characters_excluding_spacesRegExp;
return countCharacters(text, matchRegExp, settings);
default:
return 0;
}
}
})();
(window.wp = window.wp || {}).wordcount = __webpack_exports__;
/******/ })()
; element.min.js 0000644 00000027520 15121363533 0007325 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={4140:(e,t,n)=>{var r=n(5795);t.H=r.createRoot,t.c=r.hydrateRoot},5795:e=>{e.exports=window.ReactDOM}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{Children:()=>o.Children,Component:()=>o.Component,Fragment:()=>o.Fragment,Platform:()=>w,PureComponent:()=>o.PureComponent,RawHTML:()=>I,StrictMode:()=>o.StrictMode,Suspense:()=>o.Suspense,cloneElement:()=>o.cloneElement,concatChildren:()=>g,createContext:()=>o.createContext,createElement:()=>o.createElement,createInterpolateElement:()=>m,createPortal:()=>v.createPortal,createRef:()=>o.createRef,createRoot:()=>b.H,findDOMNode:()=>v.findDOMNode,flushSync:()=>v.flushSync,forwardRef:()=>o.forwardRef,hydrate:()=>v.hydrate,hydrateRoot:()=>b.c,isEmptyElement:()=>k,isValidElement:()=>o.isValidElement,lazy:()=>o.lazy,memo:()=>o.memo,render:()=>v.render,renderToString:()=>Q,startTransition:()=>o.startTransition,switchChildrenNodeName:()=>y,unmountComponentAtNode:()=>v.unmountComponentAtNode,useCallback:()=>o.useCallback,useContext:()=>o.useContext,useDebugValue:()=>o.useDebugValue,useDeferredValue:()=>o.useDeferredValue,useEffect:()=>o.useEffect,useId:()=>o.useId,useImperativeHandle:()=>o.useImperativeHandle,useInsertionEffect:()=>o.useInsertionEffect,useLayoutEffect:()=>o.useLayoutEffect,useMemo:()=>o.useMemo,useReducer:()=>o.useReducer,useRef:()=>o.useRef,useState:()=>o.useState,useSyncExternalStore:()=>o.useSyncExternalStore,useTransition:()=>o.useTransition});const o=window.React;let i,a,s,l;const c=/<(\/)?(\w+)\s*(\/)?>/g;function u(e,t,n,r,o){return{element:e,tokenStart:t,tokenLength:n,prevOffset:r,leadingTextStart:o,children:[]}}const d=e=>{const t="object"==typeof e&&null!==e,n=t&&Object.values(e);return t&&n.length>0&&n.every((e=>(0,o.isValidElement)(e)))};function p(e){const t=function(){const e=c.exec(i);if(null===e)return["no-more-tokens"];const t=e.index,[n,r,o,a]=e,s=n.length;if(a)return["self-closed",o,t,s];if(r)return["closer",o,t,s];return["opener",o,t,s]}(),[n,r,d,p]=t,m=l.length,g=d>a?a:null;if(r&&!e[r])return f(),!1;switch(n){case"no-more-tokens":if(0!==m){const{leadingTextStart:e,tokenStart:t}=l.pop();s.push(i.substr(e,t))}return f(),!1;case"self-closed":return 0===m?(null!==g&&s.push(i.substr(g,d-g)),s.push(e[r]),a=d+p,!0):(h(u(e[r],d,p)),a=d+p,!0);case"opener":return l.push(u(e[r],d,p,d+p,g)),a=d+p,!0;case"closer":if(1===m)return function(e){const{element:t,leadingTextStart:n,prevOffset:r,tokenStart:a,children:c}=l.pop(),u=e?i.substr(r,e-r):i.substr(r);u&&c.push(u);null!==n&&s.push(i.substr(n,a-n));s.push((0,o.cloneElement)(t,null,...c))}(d),a=d+p,!0;const t=l.pop(),n=i.substr(t.prevOffset,d-t.prevOffset);t.children.push(n),t.prevOffset=d+p;const c=u(t.element,t.tokenStart,t.tokenLength,d+p);return c.children=t.children,h(c),a=d+p,!0;default:return f(),!1}}function f(){const e=i.length-a;0!==e&&s.push(i.substr(a,e))}function h(e){const{element:t,tokenStart:n,tokenLength:r,prevOffset:a,children:s}=e,c=l[l.length-1],u=i.substr(c.prevOffset,n-c.prevOffset);u&&c.children.push(u),c.children.push((0,o.cloneElement)(t,null,...s)),c.prevOffset=a||n+r}var m=(e,t)=>{if(i=e,a=0,s=[],l=[],c.lastIndex=0,!d(t))throw new TypeError("The conversionMap provided is not valid. It must be an object with values that are React Elements");do{}while(p(t));return(0,o.createElement)(o.Fragment,null,...s)};function g(...e){return e.reduce(((e,t,n)=>(o.Children.forEach(t,((t,r)=>{(0,o.isValidElement)(t)&&"string"!=typeof t&&(t=(0,o.cloneElement)(t,{key:[n,r].join()})),e.push(t)})),e)),[])}function y(e,t){return e&&o.Children.map(e,((e,n)=>{if("string"==typeof e?.valueOf())return(0,o.createElement)(t,{key:n},e);if(!(0,o.isValidElement)(e))return e;const{children:r,...i}=e.props;return(0,o.createElement)(t,{key:n,...i},r)}))}var v=n(5795),b=n(4140);const k=e=>"number"!=typeof e&&("string"==typeof e?.valueOf()||Array.isArray(e)?!e.length:!e);var w={OS:"web",select:e=>"web"in e?e.web:e.default,isWeb:!0};
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function S(e){return"[object Object]"===Object.prototype.toString.call(e)}var x=function(){return x=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},x.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function O(e){return e.toLowerCase()}var C=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],E=/[^A-Z0-9]+/gi;function R(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function T(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,r=void 0===n?C:n,o=t.stripRegexp,i=void 0===o?E:o,a=t.transform,s=void 0===a?O:a,l=t.delimiter,c=void 0===l?" ":l,u=R(R(e,r,"$1\0$2"),i,"\0"),d=0,p=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(p-1);)p--;return u.slice(d,p).split("\0").map(s).join(c)}(e,x({delimiter:"."},t))}function A(e,t){return void 0===t&&(t={}),T(e,x({delimiter:"-"},t))}const M=window.wp.escapeHtml;function I({children:e,...t}){let n="";return o.Children.toArray(e).forEach((e=>{"string"==typeof e&&""!==e.trim()&&(n+=e)})),(0,o.createElement)("div",{dangerouslySetInnerHTML:{__html:n},...t})}const L=(0,o.createContext)(void 0);L.displayName="ElementContext";const{Provider:P,Consumer:j}=L,H=(0,o.forwardRef)((()=>null)),z=new Set(["string","boolean","number"]),D=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),V=new Set(["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"]),N=new Set(["autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"]),W=new Set(["animation","animationIterationCount","baselineShift","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","cx","cy","fillOpacity","flexGrow","flexShrink","floodOpacity","fontWeight","gridColumnEnd","gridColumnStart","gridRowEnd","gridRowStart","lineHeight","opacity","order","orphans","r","rx","ry","shapeImageThreshold","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","x","y","zIndex","zoom"]);function _(e,t){return t.some((t=>0===e.indexOf(t)))}function F(e){return"key"===e||"children"===e}function U(e,t){return"style"===e?function(e){if(t=e,!1===S(t)||void 0!==(n=t.constructor)&&(!1===S(r=n.prototype)||!1===r.hasOwnProperty("isPrototypeOf")))return e;var t,n,r;let o;const i=e;for(const e in i){const t=i[e];if(null==t)continue;o?o+=";":o="";o+=Y(e)+":"+Z(e,t)}return o}(t):t}const $=["accentHeight","alignmentBaseline","arabicForm","baselineShift","capHeight","clipPath","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","dominantBaseline","enableBackground","fillOpacity","fillRule","floodColor","floodOpacity","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","horizAdvX","horizOriginX","imageRendering","letterSpacing","lightingColor","markerEnd","markerMid","markerStart","overlinePosition","overlineThickness","paintOrder","panose1","pointerEvents","renderingIntent","shapeRendering","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","textAnchor","textDecoration","textRendering","underlinePosition","underlineThickness","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","vHanging","vIdeographic","vMathematical","vectorEffect","vertAdvY","vertOriginX","vertOriginY","wordSpacing","writingMode","xmlnsXlink","xHeight"].reduce(((e,t)=>(e[t.toLowerCase()]=t,e)),{}),q=["allowReorder","attributeName","attributeType","autoReverse","baseFrequency","baseProfile","calcMode","clipPathUnits","contentScriptType","contentStyleType","diffuseConstant","edgeMode","externalResourcesRequired","filterRes","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","suppressContentEditableWarning","suppressHydrationWarning","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector"].reduce(((e,t)=>(e[t.toLowerCase()]=t,e)),{}),X=["xlink:actuate","xlink:arcrole","xlink:href","xlink:role","xlink:show","xlink:title","xlink:type","xml:base","xml:lang","xml:space","xmlns:xlink"].reduce(((e,t)=>(e[t.replace(":","").toLowerCase()]=t,e)),{});function B(e){switch(e){case"htmlFor":return"for";case"className":return"class"}const t=e.toLowerCase();return q[t]?q[t]:$[t]?A($[t]):X[t]?X[t]:t}function Y(e){return e.startsWith("--")?e:_(e,["ms","O","Moz","Webkit"])?"-"+A(e):A(e)}function Z(e,t){return"number"!=typeof t||0===t||_(e,["--"])||W.has(e)?t:t+"px"}function G(e,t,n={}){if(null==e||!1===e)return"";if(Array.isArray(e))return K(e,t,n);switch(typeof e){case"string":return(0,M.escapeHTML)(e);case"number":return e.toString()}const{type:r,props:i}=e;switch(r){case o.StrictMode:case o.Fragment:return K(i.children,t,n);case I:const{children:e,...r}=i;return J(Object.keys(r).length?"div":null,{...r,dangerouslySetInnerHTML:{__html:e}},t,n)}switch(typeof r){case"string":return J(r,i,t,n);case"function":return r.prototype&&"function"==typeof r.prototype.render?function(e,t,n,r={}){const o=new e(t,r);"function"==typeof o.getChildContext&&Object.assign(r,o.getChildContext());const i=G(o.render(),n,r);return i}(r,i,t,n):G(r(i,n),t,n)}switch(r&&r.$$typeof){case P.$$typeof:return K(i.children,i.value,n);case j.$$typeof:return G(i.children(t||r._currentValue),t,n);case H.$$typeof:return G(r.render(i),t,n)}return""}function J(e,t,n,r={}){let o="";if("textarea"===e&&t.hasOwnProperty("value")){o=K(t.value,n,r);const{value:e,...i}=t;t=i}else t.dangerouslySetInnerHTML&&"string"==typeof t.dangerouslySetInnerHTML.__html?o=t.dangerouslySetInnerHTML.__html:void 0!==t.children&&(o=K(t.children,n,r));if(!e)return o;const i=function(e){let t="";for(const n in e){const r=B(n);if(!(0,M.isValidAttributeName)(r))continue;let o=U(n,e[n]);if(!z.has(typeof o))continue;if(F(n))continue;const i=V.has(r);if(i&&!1===o)continue;const a=i||_(n,["data-","aria-"])||N.has(r);("boolean"!=typeof o||a)&&(t+=" "+r,i||("string"==typeof o&&(o=(0,M.escapeAttribute)(o)),t+='="'+o+'"'))}return t}(t);return D.has(e)?"<"+e+i+"/>":"<"+e+i+">"+o+"</"+e+">"}function K(e,t,n={}){let r="";const o=Array.isArray(e)?e:[e];for(let e=0;e<o.length;e++){r+=G(o[e],t,n)}return r}var Q=G;(window.wp=window.wp||{}).element=r})(); i18n.min.js 0000644 00000012302 15121363533 0006443 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var t={d:(n,e)=>{for(var r in e)t.o(e,r)&&!t.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:e[r]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};t.r(n),t.d(n,{__:()=>F,_n:()=>L,_nx:()=>D,_x:()=>w,createI18n:()=>h,defaultI18n:()=>b,getLocaleData:()=>g,hasTranslation:()=>O,isRTL:()=>P,resetLocaleData:()=>x,setLocaleData:()=>v,sprintf:()=>l,subscribe:()=>m});var e,r,a,i,o=/%(((\d+)\$)|(\(([$_a-zA-Z][$_a-zA-Z0-9]*)\)))?[ +0#-]*\d*(\.(\d+|\*))?(ll|[lhqL])?([cduxXefgsp%])/g;function l(t,...n){return function(t,...n){var e=0;return Array.isArray(n[0])&&(n=n[0]),t.replace(o,(function(){var t,r,a,i,o;return t=arguments[3],r=arguments[5],"%"===(i=arguments[9])?"%":("*"===(a=arguments[7])&&(a=n[e],e++),void 0===r?(void 0===t&&(t=e+1),e++,o=n[t-1]):n[0]&&"object"==typeof n[0]&&n[0].hasOwnProperty(r)&&(o=n[0][r]),"f"===i?o=parseFloat(o)||0:"d"===i&&(o=parseInt(o)||0),void 0!==a&&("f"===i?o=o.toFixed(a):"s"===i&&(o=o.substr(0,a))),null!=o?o:"")}))}(t,...n)}e={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},r=["(","?"],a={")":["("],":":["?","?:"]},i=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var s={"!":function(t){return!t},"*":function(t,n){return t*n},"/":function(t,n){return t/n},"%":function(t,n){return t%n},"+":function(t,n){return t+n},"-":function(t,n){return t-n},"<":function(t,n){return t<n},"<=":function(t,n){return t<=n},">":function(t,n){return t>n},">=":function(t,n){return t>=n},"==":function(t,n){return t===n},"!=":function(t,n){return t!==n},"&&":function(t,n){return t&&n},"||":function(t,n){return t||n},"?:":function(t,n,e){if(t)throw n;return e}};function u(t){var n=function(t){for(var n,o,l,s,u=[],d=[];n=t.match(i);){for(o=n[0],(l=t.substr(0,n.index).trim())&&u.push(l);s=d.pop();){if(a[o]){if(a[o][0]===s){o=a[o][1]||o;break}}else if(r.indexOf(s)>=0||e[s]<e[o]){d.push(s);break}u.push(s)}a[o]||d.push(o),t=t.substr(n.index+o.length)}return(t=t.trim())&&u.push(t),u.concat(d.reverse())}(t);return function(t){return function(t,n){var e,r,a,i,o,l,u=[];for(e=0;e<t.length;e++){if(o=t[e],i=s[o]){for(r=i.length,a=Array(r);r--;)a[r]=u.pop();try{l=i.apply(null,a)}catch(t){return t}}else l=n.hasOwnProperty(o)?n[o]:+o;u.push(l)}return u[0]}(n,t)}}var d={contextDelimiter:"",onMissingKey:null};function c(t,n){var e;for(e in this.data=t,this.pluralForms={},this.options={},d)this.options[e]=void 0!==n&&e in n?n[e]:d[e]}c.prototype.getPluralForm=function(t,n){var e,r,a,i=this.pluralForms[t];return i||("function"!=typeof(a=(e=this.data[t][""])["Plural-Forms"]||e["plural-forms"]||e.plural_forms)&&(r=function(t){var n,e,r;for(n=t.split(";"),e=0;e<n.length;e++)if(0===(r=n[e].trim()).indexOf("plural="))return r.substr(7)}(e["Plural-Forms"]||e["plural-forms"]||e.plural_forms),a=function(t){var n=u(t);return function(t){return+n({n:t})}}(r)),i=this.pluralForms[t]=a),i(n)},c.prototype.dcnpgettext=function(t,n,e,r,a){var i,o,l;return i=void 0===a?0:this.getPluralForm(t,a),o=e,n&&(o=n+this.options.contextDelimiter+e),(l=this.data[t][o])&&l[i]?l[i]:(this.options.onMissingKey&&this.options.onMissingKey(e,t),0===i?e:r)};const p={plural_forms:t=>1===t?0:1},f=/^i18n\.(n?gettext|has_translation)(_|$)/,h=(t,n,e)=>{const r=new c({}),a=new Set,i=()=>{a.forEach((t=>t()))},o=(t,n="default")=>{r.data[n]={...r.data[n],...t},r.data[n][""]={...p,...r.data[n]?.[""]},delete r.pluralForms[n]},l=(t,n)=>{o(t,n),i()},s=(t="default",n,e,a,i)=>(r.data[t]||o(void 0,t),r.dcnpgettext(t,n,e,a,i)),u=t=>t||"default",d=(t,n,r)=>{let a=s(r,n,t);return e?(a=e.applyFilters("i18n.gettext_with_context",a,t,n,r),e.applyFilters("i18n.gettext_with_context_"+u(r),a,t,n,r)):a};if(t&&l(t,n),e){const t=t=>{f.test(t)&&i()};e.addAction("hookAdded","core/i18n",t),e.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:(t="default")=>r.data[t],setLocaleData:l,addLocaleData:(t,n="default")=>{r.data[n]={...r.data[n],...t,"":{...p,...r.data[n]?.[""],...t?.[""]}},delete r.pluralForms[n],i()},resetLocaleData:(t,n)=>{r.data={},r.pluralForms={},l(t,n)},subscribe:t=>(a.add(t),()=>a.delete(t)),__:(t,n)=>{let r=s(n,void 0,t);return e?(r=e.applyFilters("i18n.gettext",r,t,n),e.applyFilters("i18n.gettext_"+u(n),r,t,n)):r},_x:d,_n:(t,n,r,a)=>{let i=s(a,void 0,t,n,r);return e?(i=e.applyFilters("i18n.ngettext",i,t,n,r,a),e.applyFilters("i18n.ngettext_"+u(a),i,t,n,r,a)):i},_nx:(t,n,r,a,i)=>{let o=s(i,a,t,n,r);return e?(o=e.applyFilters("i18n.ngettext_with_context",o,t,n,r,a,i),e.applyFilters("i18n.ngettext_with_context_"+u(i),o,t,n,r,a,i)):o},isRTL:()=>"rtl"===d("ltr","text direction"),hasTranslation:(t,n,a)=>{const i=n?n+""+t:t;let o=!!r.data?.[a??"default"]?.[i];return e&&(o=e.applyFilters("i18n.has_translation",o,t,n,a),o=e.applyFilters("i18n.has_translation_"+u(a),o,t,n,a)),o}}},_=window.wp.hooks,y=h(void 0,void 0,_.defaultHooks);var b=y;const g=y.getLocaleData.bind(y),v=y.setLocaleData.bind(y),x=y.resetLocaleData.bind(y),m=y.subscribe.bind(y),F=y.__.bind(y),w=y._x.bind(y),L=y._n.bind(y),D=y._nx.bind(y),P=y.isRTL.bind(y),O=y.hasTranslation.bind(y);(window.wp=window.wp||{}).i18n=n})(); deprecated.min.js 0000644 00000001254 15121363533 0007770 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={d:(n,o)=>{for(var t in o)e.o(o,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:o[t]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n)},n={};e.d(n,{default:()=>i});const o=window.wp.hooks,t=Object.create(null);function i(e,n={}){const{since:i,version:r,alternative:d,plugin:a,link:c,hint:s}=n,l=`${e} is deprecated${i?` since version ${i}`:""}${r?` and will be removed${a?` from ${a}`:""} in version ${r}`:""}.${d?` Please use ${d} instead.`:""}${c?` See: ${c}`:""}${s?` Note: ${s}`:""}`;l in t||((0,o.doAction)("deprecated",e,n,l),console.warn(l),t[l]=!0)}(window.wp=window.wp||{}).deprecated=n.default})(); dom.js 0000644 00000104271 15121363533 0005670 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
__unstableStripHTML: () => (/* reexport */ stripHTML),
computeCaretRect: () => (/* reexport */ computeCaretRect),
documentHasSelection: () => (/* reexport */ documentHasSelection),
documentHasTextSelection: () => (/* reexport */ documentHasTextSelection),
documentHasUncollapsedSelection: () => (/* reexport */ documentHasUncollapsedSelection),
focus: () => (/* binding */ build_module_focus),
getFilesFromDataTransfer: () => (/* reexport */ getFilesFromDataTransfer),
getOffsetParent: () => (/* reexport */ getOffsetParent),
getPhrasingContentSchema: () => (/* reexport */ getPhrasingContentSchema),
getRectangleFromRange: () => (/* reexport */ getRectangleFromRange),
getScrollContainer: () => (/* reexport */ getScrollContainer),
insertAfter: () => (/* reexport */ insertAfter),
isEmpty: () => (/* reexport */ isEmpty),
isEntirelySelected: () => (/* reexport */ isEntirelySelected),
isFormElement: () => (/* reexport */ isFormElement),
isHorizontalEdge: () => (/* reexport */ isHorizontalEdge),
isNumberInput: () => (/* reexport */ isNumberInput),
isPhrasingContent: () => (/* reexport */ isPhrasingContent),
isRTL: () => (/* reexport */ isRTL),
isSelectionForward: () => (/* reexport */ isSelectionForward),
isTextContent: () => (/* reexport */ isTextContent),
isTextField: () => (/* reexport */ isTextField),
isVerticalEdge: () => (/* reexport */ isVerticalEdge),
placeCaretAtHorizontalEdge: () => (/* reexport */ placeCaretAtHorizontalEdge),
placeCaretAtVerticalEdge: () => (/* reexport */ placeCaretAtVerticalEdge),
remove: () => (/* reexport */ remove),
removeInvalidHTML: () => (/* reexport */ removeInvalidHTML),
replace: () => (/* reexport */ replace),
replaceTag: () => (/* reexport */ replaceTag),
safeHTML: () => (/* reexport */ safeHTML),
unwrap: () => (/* reexport */ unwrap),
wrap: () => (/* reexport */ wrap)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/dom/build-module/focusable.js
var focusable_namespaceObject = {};
__webpack_require__.r(focusable_namespaceObject);
__webpack_require__.d(focusable_namespaceObject, {
find: () => (find)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/dom/build-module/tabbable.js
var tabbable_namespaceObject = {};
__webpack_require__.r(tabbable_namespaceObject);
__webpack_require__.d(tabbable_namespaceObject, {
find: () => (tabbable_find),
findNext: () => (findNext),
findPrevious: () => (findPrevious),
isTabbableIndex: () => (isTabbableIndex)
});
;// ./node_modules/@wordpress/dom/build-module/focusable.js
function buildSelector(sequential) {
return [
sequential ? '[tabindex]:not([tabindex^="-"])' : "[tabindex]",
"a[href]",
"button:not([disabled])",
'input:not([type="hidden"]):not([disabled])',
"select:not([disabled])",
"textarea:not([disabled])",
'iframe:not([tabindex^="-"])',
"object",
"embed",
"summary",
"area[href]",
"[contenteditable]:not([contenteditable=false])"
].join(",");
}
function isVisible(element) {
return element.offsetWidth > 0 || element.offsetHeight > 0 || element.getClientRects().length > 0;
}
function isValidFocusableArea(element) {
const map = element.closest("map[name]");
if (!map) {
return false;
}
const img = element.ownerDocument.querySelector(
'img[usemap="#' + map.name + '"]'
);
return !!img && isVisible(img);
}
function find(context, { sequential = false } = {}) {
const elements = context.querySelectorAll(buildSelector(sequential));
return Array.from(elements).filter((element) => {
if (!isVisible(element)) {
return false;
}
const { nodeName } = element;
if ("AREA" === nodeName) {
return isValidFocusableArea(
/** @type {HTMLAreaElement} */
element
);
}
return true;
});
}
;// ./node_modules/@wordpress/dom/build-module/tabbable.js
function getTabIndex(element) {
const tabIndex = element.getAttribute("tabindex");
return tabIndex === null ? 0 : parseInt(tabIndex, 10);
}
function isTabbableIndex(element) {
return getTabIndex(element) !== -1;
}
function createStatefulCollapseRadioGroup() {
const CHOSEN_RADIO_BY_NAME = {};
return function collapseRadioGroup(result, element) {
const { nodeName, type, checked, name } = element;
if (nodeName !== "INPUT" || type !== "radio" || !name) {
return result.concat(element);
}
const hasChosen = CHOSEN_RADIO_BY_NAME.hasOwnProperty(name);
const isChosen = checked || !hasChosen;
if (!isChosen) {
return result;
}
if (hasChosen) {
const hadChosenElement = CHOSEN_RADIO_BY_NAME[name];
result = result.filter((e) => e !== hadChosenElement);
}
CHOSEN_RADIO_BY_NAME[name] = element;
return result.concat(element);
};
}
function mapElementToObjectTabbable(element, index) {
return { element, index };
}
function mapObjectTabbableToElement(object) {
return object.element;
}
function compareObjectTabbables(a, b) {
const aTabIndex = getTabIndex(a.element);
const bTabIndex = getTabIndex(b.element);
if (aTabIndex === bTabIndex) {
return a.index - b.index;
}
return aTabIndex - bTabIndex;
}
function filterTabbable(focusables) {
return focusables.filter(isTabbableIndex).map(mapElementToObjectTabbable).sort(compareObjectTabbables).map(mapObjectTabbableToElement).reduce(createStatefulCollapseRadioGroup(), []);
}
function tabbable_find(context) {
return filterTabbable(find(context));
}
function findPrevious(element) {
return filterTabbable(find(element.ownerDocument.body)).reverse().find(
(focusable) => (
// eslint-disable-next-line no-bitwise
element.compareDocumentPosition(focusable) & element.DOCUMENT_POSITION_PRECEDING
)
);
}
function findNext(element) {
return filterTabbable(find(element.ownerDocument.body)).find(
(focusable) => (
// eslint-disable-next-line no-bitwise
element.compareDocumentPosition(focusable) & element.DOCUMENT_POSITION_FOLLOWING
)
);
}
;// ./node_modules/@wordpress/dom/build-module/utils/assert-is-defined.js
function assertIsDefined(val, name) {
if (false) {}
}
;// ./node_modules/@wordpress/dom/build-module/dom/get-rectangle-from-range.js
function getRectangleFromRange(range) {
if (!range.collapsed) {
const rects2 = Array.from(range.getClientRects());
if (rects2.length === 1) {
return rects2[0];
}
const filteredRects = rects2.filter(({ width }) => width > 1);
if (filteredRects.length === 0) {
return range.getBoundingClientRect();
}
if (filteredRects.length === 1) {
return filteredRects[0];
}
let {
top: furthestTop,
bottom: furthestBottom,
left: furthestLeft,
right: furthestRight
} = filteredRects[0];
for (const { top, bottom, left, right } of filteredRects) {
if (top < furthestTop) {
furthestTop = top;
}
if (bottom > furthestBottom) {
furthestBottom = bottom;
}
if (left < furthestLeft) {
furthestLeft = left;
}
if (right > furthestRight) {
furthestRight = right;
}
}
return new window.DOMRect(
furthestLeft,
furthestTop,
furthestRight - furthestLeft,
furthestBottom - furthestTop
);
}
const { startContainer } = range;
const { ownerDocument } = startContainer;
if (startContainer.nodeName === "BR") {
const { parentNode } = startContainer;
assertIsDefined(parentNode, "parentNode");
const index = (
/** @type {Node[]} */
Array.from(parentNode.childNodes).indexOf(startContainer)
);
assertIsDefined(ownerDocument, "ownerDocument");
range = ownerDocument.createRange();
range.setStart(parentNode, index);
range.setEnd(parentNode, index);
}
const rects = range.getClientRects();
if (rects.length > 1) {
return null;
}
let rect = rects[0];
if (!rect || rect.height === 0) {
assertIsDefined(ownerDocument, "ownerDocument");
const padNode = ownerDocument.createTextNode("\u200B");
range = range.cloneRange();
range.insertNode(padNode);
rect = range.getClientRects()[0];
assertIsDefined(padNode.parentNode, "padNode.parentNode");
padNode.parentNode.removeChild(padNode);
}
return rect;
}
;// ./node_modules/@wordpress/dom/build-module/dom/compute-caret-rect.js
function computeCaretRect(win) {
const selection = win.getSelection();
assertIsDefined(selection, "selection");
const range = selection.rangeCount ? selection.getRangeAt(0) : null;
if (!range) {
return null;
}
return getRectangleFromRange(range);
}
;// ./node_modules/@wordpress/dom/build-module/dom/document-has-text-selection.js
function documentHasTextSelection(doc) {
assertIsDefined(doc.defaultView, "doc.defaultView");
const selection = doc.defaultView.getSelection();
assertIsDefined(selection, "selection");
const range = selection.rangeCount ? selection.getRangeAt(0) : null;
return !!range && !range.collapsed;
}
;// ./node_modules/@wordpress/dom/build-module/dom/is-html-input-element.js
function isHTMLInputElement(node) {
return node?.nodeName === "INPUT";
}
;// ./node_modules/@wordpress/dom/build-module/dom/is-text-field.js
function isTextField(node) {
const nonTextInputs = [
"button",
"checkbox",
"hidden",
"file",
"radio",
"image",
"range",
"reset",
"submit",
"number",
"email",
"time"
];
return isHTMLInputElement(node) && node.type && !nonTextInputs.includes(node.type) || node.nodeName === "TEXTAREA" || /** @type {HTMLElement} */
node.contentEditable === "true";
}
;// ./node_modules/@wordpress/dom/build-module/dom/input-field-has-uncollapsed-selection.js
function inputFieldHasUncollapsedSelection(element) {
if (!isHTMLInputElement(element) && !isTextField(element)) {
return false;
}
try {
const { selectionStart, selectionEnd } = (
/** @type {HTMLInputElement | HTMLTextAreaElement} */
element
);
return (
// `null` means the input type doesn't implement selection, thus we
// cannot determine whether the selection is collapsed, so we
// default to true.
selectionStart === null || // when not null, compare the two points
selectionStart !== selectionEnd
);
} catch (error) {
return true;
}
}
;// ./node_modules/@wordpress/dom/build-module/dom/document-has-uncollapsed-selection.js
function documentHasUncollapsedSelection(doc) {
return documentHasTextSelection(doc) || !!doc.activeElement && inputFieldHasUncollapsedSelection(doc.activeElement);
}
;// ./node_modules/@wordpress/dom/build-module/dom/document-has-selection.js
function documentHasSelection(doc) {
return !!doc.activeElement && (isHTMLInputElement(doc.activeElement) || isTextField(doc.activeElement) || documentHasTextSelection(doc));
}
;// ./node_modules/@wordpress/dom/build-module/dom/get-computed-style.js
function getComputedStyle(element) {
assertIsDefined(
element.ownerDocument.defaultView,
"element.ownerDocument.defaultView"
);
return element.ownerDocument.defaultView.getComputedStyle(element);
}
;// ./node_modules/@wordpress/dom/build-module/dom/get-scroll-container.js
function getScrollContainer(node, direction = "vertical") {
if (!node) {
return void 0;
}
if (direction === "vertical" || direction === "all") {
if (node.scrollHeight > node.clientHeight) {
const { overflowY } = getComputedStyle(node);
if (/(auto|scroll)/.test(overflowY)) {
return node;
}
}
}
if (direction === "horizontal" || direction === "all") {
if (node.scrollWidth > node.clientWidth) {
const { overflowX } = getComputedStyle(node);
if (/(auto|scroll)/.test(overflowX)) {
return node;
}
}
}
if (node.ownerDocument === node.parentNode) {
return node;
}
return getScrollContainer(
/** @type {Element} */
node.parentNode,
direction
);
}
;// ./node_modules/@wordpress/dom/build-module/dom/get-offset-parent.js
function getOffsetParent(node) {
let closestElement;
while (closestElement = /** @type {Node} */
node.parentNode) {
if (closestElement.nodeType === closestElement.ELEMENT_NODE) {
break;
}
}
if (!closestElement) {
return null;
}
if (getComputedStyle(
/** @type {Element} */
closestElement
).position !== "static") {
return closestElement;
}
return (
/** @type {Node & { offsetParent: Node }} */
closestElement.offsetParent
);
}
;// ./node_modules/@wordpress/dom/build-module/dom/is-input-or-text-area.js
function isInputOrTextArea(element) {
return element.tagName === "INPUT" || element.tagName === "TEXTAREA";
}
;// ./node_modules/@wordpress/dom/build-module/dom/is-entirely-selected.js
function isEntirelySelected(element) {
if (isInputOrTextArea(element)) {
return element.selectionStart === 0 && element.value.length === element.selectionEnd;
}
if (!element.isContentEditable) {
return true;
}
const { ownerDocument } = element;
const { defaultView } = ownerDocument;
assertIsDefined(defaultView, "defaultView");
const selection = defaultView.getSelection();
assertIsDefined(selection, "selection");
const range = selection.rangeCount ? selection.getRangeAt(0) : null;
if (!range) {
return true;
}
const { startContainer, endContainer, startOffset, endOffset } = range;
if (startContainer === element && endContainer === element && startOffset === 0 && endOffset === element.childNodes.length) {
return true;
}
const lastChild = element.lastChild;
assertIsDefined(lastChild, "lastChild");
const endContainerContentLength = endContainer.nodeType === endContainer.TEXT_NODE ? (
/** @type {Text} */
endContainer.data.length
) : endContainer.childNodes.length;
return isDeepChild(startContainer, element, "firstChild") && isDeepChild(endContainer, element, "lastChild") && startOffset === 0 && endOffset === endContainerContentLength;
}
function isDeepChild(query, container, propName) {
let candidate = container;
do {
if (query === candidate) {
return true;
}
candidate = candidate[propName];
} while (candidate);
return false;
}
;// ./node_modules/@wordpress/dom/build-module/dom/is-form-element.js
function isFormElement(element) {
if (!element) {
return false;
}
const { tagName } = element;
const checkForInputTextarea = isInputOrTextArea(element);
return checkForInputTextarea || tagName === "BUTTON" || tagName === "SELECT";
}
;// ./node_modules/@wordpress/dom/build-module/dom/is-rtl.js
function isRTL(element) {
return getComputedStyle(element).direction === "rtl";
}
;// ./node_modules/@wordpress/dom/build-module/dom/get-range-height.js
function getRangeHeight(range) {
const rects = Array.from(range.getClientRects());
if (!rects.length) {
return;
}
const highestTop = Math.min(...rects.map(({ top }) => top));
const lowestBottom = Math.max(...rects.map(({ bottom }) => bottom));
return lowestBottom - highestTop;
}
;// ./node_modules/@wordpress/dom/build-module/dom/is-selection-forward.js
function isSelectionForward(selection) {
const { anchorNode, focusNode, anchorOffset, focusOffset } = selection;
assertIsDefined(anchorNode, "anchorNode");
assertIsDefined(focusNode, "focusNode");
const position = anchorNode.compareDocumentPosition(focusNode);
if (position & anchorNode.DOCUMENT_POSITION_PRECEDING) {
return false;
}
if (position & anchorNode.DOCUMENT_POSITION_FOLLOWING) {
return true;
}
if (position === 0) {
return anchorOffset <= focusOffset;
}
return true;
}
;// ./node_modules/@wordpress/dom/build-module/dom/caret-range-from-point.js
function caretRangeFromPoint(doc, x, y) {
if (doc.caretRangeFromPoint) {
return doc.caretRangeFromPoint(x, y);
}
if (!doc.caretPositionFromPoint) {
return null;
}
const point = doc.caretPositionFromPoint(x, y);
if (!point) {
return null;
}
const range = doc.createRange();
range.setStart(point.offsetNode, point.offset);
range.collapse(true);
return range;
}
;// ./node_modules/@wordpress/dom/build-module/dom/hidden-caret-range-from-point.js
function hiddenCaretRangeFromPoint(doc, x, y, container) {
const originalZIndex = container.style.zIndex;
const originalPosition = container.style.position;
const { position = "static" } = getComputedStyle(container);
if (position === "static") {
container.style.position = "relative";
}
container.style.zIndex = "10000";
const range = caretRangeFromPoint(doc, x, y);
container.style.zIndex = originalZIndex;
container.style.position = originalPosition;
return range;
}
;// ./node_modules/@wordpress/dom/build-module/dom/scroll-if-no-range.js
function scrollIfNoRange(container, alignToTop, callback) {
let range = callback();
if (!range || !range.startContainer || !container.contains(range.startContainer)) {
container.scrollIntoView(alignToTop);
range = callback();
if (!range || !range.startContainer || !container.contains(range.startContainer)) {
return null;
}
}
return range;
}
;// ./node_modules/@wordpress/dom/build-module/dom/is-edge.js
function isEdge(container, isReverse, onlyVertical = false) {
if (isInputOrTextArea(container) && typeof container.selectionStart === "number") {
if (container.selectionStart !== container.selectionEnd) {
return false;
}
if (isReverse) {
return container.selectionStart === 0;
}
return container.value.length === container.selectionStart;
}
if (!container.isContentEditable) {
return true;
}
const { ownerDocument } = container;
const { defaultView } = ownerDocument;
assertIsDefined(defaultView, "defaultView");
const selection = defaultView.getSelection();
if (!selection || !selection.rangeCount) {
return false;
}
const range = selection.getRangeAt(0);
const collapsedRange = range.cloneRange();
const isForward = isSelectionForward(selection);
const isCollapsed = selection.isCollapsed;
if (!isCollapsed) {
collapsedRange.collapse(!isForward);
}
const collapsedRangeRect = getRectangleFromRange(collapsedRange);
const rangeRect = getRectangleFromRange(range);
if (!collapsedRangeRect || !rangeRect) {
return false;
}
const rangeHeight = getRangeHeight(range);
if (!isCollapsed && rangeHeight && rangeHeight > collapsedRangeRect.height && isForward === isReverse) {
return false;
}
const isReverseDir = isRTL(container) ? !isReverse : isReverse;
const containerRect = container.getBoundingClientRect();
const x = isReverseDir ? containerRect.left + 1 : containerRect.right - 1;
const y = isReverse ? containerRect.top + 1 : containerRect.bottom - 1;
const testRange = scrollIfNoRange(
container,
isReverse,
() => hiddenCaretRangeFromPoint(ownerDocument, x, y, container)
);
if (!testRange) {
return false;
}
const testRect = getRectangleFromRange(testRange);
if (!testRect) {
return false;
}
const verticalSide = isReverse ? "top" : "bottom";
const horizontalSide = isReverseDir ? "left" : "right";
const verticalDiff = testRect[verticalSide] - rangeRect[verticalSide];
const horizontalDiff = testRect[horizontalSide] - collapsedRangeRect[horizontalSide];
const hasVerticalDiff = Math.abs(verticalDiff) <= 1;
const hasHorizontalDiff = Math.abs(horizontalDiff) <= 1;
return onlyVertical ? hasVerticalDiff : hasVerticalDiff && hasHorizontalDiff;
}
;// ./node_modules/@wordpress/dom/build-module/dom/is-horizontal-edge.js
function isHorizontalEdge(container, isReverse) {
return isEdge(container, isReverse);
}
;// external ["wp","deprecated"]
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
;// ./node_modules/@wordpress/dom/build-module/dom/is-number-input.js
function isNumberInput(node) {
external_wp_deprecated_default()("wp.dom.isNumberInput", {
since: "6.1",
version: "6.5"
});
return isHTMLInputElement(node) && node.type === "number" && !isNaN(node.valueAsNumber);
}
;// ./node_modules/@wordpress/dom/build-module/dom/is-vertical-edge.js
function isVerticalEdge(container, isReverse) {
return isEdge(container, isReverse, true);
}
;// ./node_modules/@wordpress/dom/build-module/dom/place-caret-at-edge.js
function getRange(container, isReverse, x) {
const { ownerDocument } = container;
const isReverseDir = isRTL(container) ? !isReverse : isReverse;
const containerRect = container.getBoundingClientRect();
if (x === void 0) {
x = isReverse ? containerRect.right - 1 : containerRect.left + 1;
} else if (x <= containerRect.left) {
x = containerRect.left + 1;
} else if (x >= containerRect.right) {
x = containerRect.right - 1;
}
const y = isReverseDir ? containerRect.bottom - 1 : containerRect.top + 1;
return hiddenCaretRangeFromPoint(ownerDocument, x, y, container);
}
function placeCaretAtEdge(container, isReverse, x) {
if (!container) {
return;
}
container.focus();
if (isInputOrTextArea(container)) {
if (typeof container.selectionStart !== "number") {
return;
}
if (isReverse) {
container.selectionStart = container.value.length;
container.selectionEnd = container.value.length;
} else {
container.selectionStart = 0;
container.selectionEnd = 0;
}
return;
}
if (!container.isContentEditable) {
return;
}
const range = scrollIfNoRange(
container,
isReverse,
() => getRange(container, isReverse, x)
);
if (!range) {
return;
}
const { ownerDocument } = container;
const { defaultView } = ownerDocument;
assertIsDefined(defaultView, "defaultView");
const selection = defaultView.getSelection();
assertIsDefined(selection, "selection");
selection.removeAllRanges();
selection.addRange(range);
}
;// ./node_modules/@wordpress/dom/build-module/dom/place-caret-at-horizontal-edge.js
function placeCaretAtHorizontalEdge(container, isReverse) {
return placeCaretAtEdge(container, isReverse, void 0);
}
;// ./node_modules/@wordpress/dom/build-module/dom/place-caret-at-vertical-edge.js
function placeCaretAtVerticalEdge(container, isReverse, rect) {
return placeCaretAtEdge(container, isReverse, rect?.left);
}
;// ./node_modules/@wordpress/dom/build-module/dom/insert-after.js
function insertAfter(newNode, referenceNode) {
assertIsDefined(referenceNode.parentNode, "referenceNode.parentNode");
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
}
;// ./node_modules/@wordpress/dom/build-module/dom/remove.js
function remove(node) {
assertIsDefined(node.parentNode, "node.parentNode");
node.parentNode.removeChild(node);
}
;// ./node_modules/@wordpress/dom/build-module/dom/replace.js
function replace(processedNode, newNode) {
assertIsDefined(processedNode.parentNode, "processedNode.parentNode");
insertAfter(newNode, processedNode.parentNode);
remove(processedNode);
}
;// ./node_modules/@wordpress/dom/build-module/dom/unwrap.js
function unwrap(node) {
const parent = node.parentNode;
assertIsDefined(parent, "node.parentNode");
while (node.firstChild) {
parent.insertBefore(node.firstChild, node);
}
parent.removeChild(node);
}
;// ./node_modules/@wordpress/dom/build-module/dom/replace-tag.js
function replaceTag(node, tagName) {
const newNode = node.ownerDocument.createElement(tagName);
while (node.firstChild) {
newNode.appendChild(node.firstChild);
}
assertIsDefined(node.parentNode, "node.parentNode");
node.parentNode.replaceChild(newNode, node);
return newNode;
}
;// ./node_modules/@wordpress/dom/build-module/dom/wrap.js
function wrap(newNode, referenceNode) {
assertIsDefined(referenceNode.parentNode, "referenceNode.parentNode");
referenceNode.parentNode.insertBefore(newNode, referenceNode);
newNode.appendChild(referenceNode);
}
;// ./node_modules/@wordpress/dom/build-module/dom/safe-html.js
function safeHTML(html) {
const { body } = document.implementation.createHTMLDocument("");
body.innerHTML = html;
const elements = body.getElementsByTagName("*");
let elementIndex = elements.length;
while (elementIndex--) {
const element = elements[elementIndex];
if (element.tagName === "SCRIPT") {
remove(element);
} else {
let attributeIndex = element.attributes.length;
while (attributeIndex--) {
const { name: key } = element.attributes[attributeIndex];
if (key.startsWith("on")) {
element.removeAttribute(key);
}
}
}
}
return body.innerHTML;
}
;// ./node_modules/@wordpress/dom/build-module/dom/strip-html.js
function stripHTML(html) {
html = safeHTML(html);
const doc = document.implementation.createHTMLDocument("");
doc.body.innerHTML = html;
return doc.body.textContent || "";
}
;// ./node_modules/@wordpress/dom/build-module/dom/is-empty.js
function isEmpty(element) {
switch (element.nodeType) {
case element.TEXT_NODE:
return /^[ \f\n\r\t\v\u00a0]*$/.test(element.nodeValue || "");
case element.ELEMENT_NODE:
if (element.hasAttributes()) {
return false;
} else if (!element.hasChildNodes()) {
return true;
}
return (
/** @type {Element[]} */
Array.from(element.childNodes).every(isEmpty)
);
default:
return true;
}
}
;// ./node_modules/@wordpress/dom/build-module/phrasing-content.js
const textContentSchema = {
strong: {},
em: {},
s: {},
del: {},
ins: {},
a: { attributes: ["href", "target", "rel", "id"] },
code: {},
abbr: { attributes: ["title"] },
sub: {},
sup: {},
br: {},
small: {},
// To do: fix blockquote.
// cite: {},
q: { attributes: ["cite"] },
dfn: { attributes: ["title"] },
data: { attributes: ["value"] },
time: { attributes: ["datetime"] },
var: {},
samp: {},
kbd: {},
i: {},
b: {},
u: {},
mark: {},
ruby: {},
rt: {},
rp: {},
bdi: { attributes: ["dir"] },
bdo: { attributes: ["dir"] },
wbr: {},
"#text": {}
};
const excludedElements = ["#text", "br"];
Object.keys(textContentSchema).filter((element) => !excludedElements.includes(element)).forEach((tag) => {
const { [tag]: removedTag, ...restSchema } = textContentSchema;
textContentSchema[tag].children = restSchema;
});
const embeddedContentSchema = {
audio: {
attributes: [
"src",
"preload",
"autoplay",
"mediagroup",
"loop",
"muted"
]
},
canvas: { attributes: ["width", "height"] },
embed: { attributes: ["src", "type", "width", "height"] },
img: {
attributes: [
"alt",
"src",
"srcset",
"usemap",
"ismap",
"width",
"height"
]
},
object: {
attributes: [
"data",
"type",
"name",
"usemap",
"form",
"width",
"height"
]
},
video: {
attributes: [
"src",
"poster",
"preload",
"playsinline",
"autoplay",
"mediagroup",
"loop",
"muted",
"controls",
"width",
"height"
]
},
math: {
attributes: ["display", "xmlns"],
children: "*"
}
};
const phrasingContentSchema = {
...textContentSchema,
...embeddedContentSchema
};
function getPhrasingContentSchema(context) {
if (context !== "paste") {
return phrasingContentSchema;
}
const {
u,
// Used to mark misspelling. Shouldn't be pasted.
abbr,
// Invisible.
data,
// Invisible.
time,
// Invisible.
wbr,
// Invisible.
bdi,
// Invisible.
bdo,
// Invisible.
...remainingContentSchema
} = {
...phrasingContentSchema,
// We shouldn't paste potentially sensitive information which is not
// visible to the user when pasted, so strip the attributes.
ins: { children: phrasingContentSchema.ins.children },
del: { children: phrasingContentSchema.del.children }
};
return remainingContentSchema;
}
function isPhrasingContent(node) {
const tag = node.nodeName.toLowerCase();
return getPhrasingContentSchema().hasOwnProperty(tag) || tag === "span";
}
function isTextContent(node) {
const tag = node.nodeName.toLowerCase();
return textContentSchema.hasOwnProperty(tag) || tag === "span";
}
;// ./node_modules/@wordpress/dom/build-module/dom/is-element.js
function isElement(node) {
return !!node && node.nodeType === node.ELEMENT_NODE;
}
;// ./node_modules/@wordpress/dom/build-module/dom/clean-node-list.js
const noop = () => {
};
function cleanNodeList(nodeList, doc, schema, inline) {
Array.from(nodeList).forEach(
(node) => {
const tag = node.nodeName.toLowerCase();
if (schema.hasOwnProperty(tag) && (!schema[tag].isMatch || schema[tag].isMatch?.(node))) {
if (isElement(node)) {
const {
attributes = [],
classes = [],
children,
require: require2 = [],
allowEmpty
} = schema[tag];
if (children && !allowEmpty && isEmpty(node)) {
remove(node);
return;
}
if (node.hasAttributes()) {
Array.from(node.attributes).forEach(({ name }) => {
if (name !== "class" && !attributes.includes(name)) {
node.removeAttribute(name);
}
});
if (node.classList && node.classList.length) {
const mattchers = classes.map((item) => {
if (item === "*") {
return () => true;
} else if (typeof item === "string") {
return (className) => className === item;
} else if (item instanceof RegExp) {
return (className) => item.test(className);
}
return noop;
});
Array.from(node.classList).forEach((name) => {
if (!mattchers.some(
(isMatch) => isMatch(name)
)) {
node.classList.remove(name);
}
});
if (!node.classList.length) {
node.removeAttribute("class");
}
}
}
if (node.hasChildNodes()) {
if (children === "*") {
return;
}
if (children) {
if (require2.length && !node.querySelector(require2.join(","))) {
cleanNodeList(
node.childNodes,
doc,
schema,
inline
);
unwrap(node);
} else if (node.parentNode && node.parentNode.nodeName === "BODY" && isPhrasingContent(node)) {
cleanNodeList(
node.childNodes,
doc,
schema,
inline
);
if (Array.from(node.childNodes).some(
(child) => !isPhrasingContent(child)
)) {
unwrap(node);
}
} else {
cleanNodeList(
node.childNodes,
doc,
children,
inline
);
}
} else {
while (node.firstChild) {
remove(node.firstChild);
}
}
}
}
} else {
cleanNodeList(node.childNodes, doc, schema, inline);
if (inline && !isPhrasingContent(node) && node.nextElementSibling) {
insertAfter(doc.createElement("br"), node);
}
unwrap(node);
}
}
);
}
;// ./node_modules/@wordpress/dom/build-module/dom/remove-invalid-html.js
function removeInvalidHTML(HTML, schema, inline) {
const doc = document.implementation.createHTMLDocument("");
doc.body.innerHTML = HTML;
cleanNodeList(doc.body.childNodes, doc, schema, inline);
return doc.body.innerHTML;
}
;// ./node_modules/@wordpress/dom/build-module/dom/index.js
;// ./node_modules/@wordpress/dom/build-module/data-transfer.js
function getFilesFromDataTransfer(dataTransfer) {
const files = Array.from(dataTransfer.files);
Array.from(dataTransfer.items).forEach((item) => {
const file = item.getAsFile();
if (file && !files.find(
({ name, type, size }) => name === file.name && type === file.type && size === file.size
)) {
files.push(file);
}
});
return files;
}
;// ./node_modules/@wordpress/dom/build-module/index.js
const build_module_focus = { focusable: focusable_namespaceObject, tabbable: tabbable_namespaceObject };
(window.wp = window.wp || {}).dom = __webpack_exports__;
/******/ })()
; notices.js 0000644 00000013531 15121363533 0006553 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
store: () => (/* reexport */ store)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/notices/build-module/store/actions.js
var actions_namespaceObject = {};
__webpack_require__.r(actions_namespaceObject);
__webpack_require__.d(actions_namespaceObject, {
createErrorNotice: () => (createErrorNotice),
createInfoNotice: () => (createInfoNotice),
createNotice: () => (createNotice),
createSuccessNotice: () => (createSuccessNotice),
createWarningNotice: () => (createWarningNotice),
removeAllNotices: () => (removeAllNotices),
removeNotice: () => (removeNotice),
removeNotices: () => (removeNotices)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/notices/build-module/store/selectors.js
var selectors_namespaceObject = {};
__webpack_require__.r(selectors_namespaceObject);
__webpack_require__.d(selectors_namespaceObject, {
getNotices: () => (getNotices)
});
;// external ["wp","data"]
const external_wp_data_namespaceObject = window["wp"]["data"];
;// ./node_modules/@wordpress/notices/build-module/store/utils/on-sub-key.js
const onSubKey = (actionProperty) => (reducer) => (state = {}, action) => {
const key = action[actionProperty];
if (key === void 0) {
return state;
}
const nextKeyState = reducer(state[key], action);
if (nextKeyState === state[key]) {
return state;
}
return {
...state,
[key]: nextKeyState
};
};
var on_sub_key_default = onSubKey;
;// ./node_modules/@wordpress/notices/build-module/store/reducer.js
const notices = on_sub_key_default("context")((state = [], action) => {
switch (action.type) {
case "CREATE_NOTICE":
return [
...state.filter(({ id }) => id !== action.notice.id),
action.notice
];
case "REMOVE_NOTICE":
return state.filter(({ id }) => id !== action.id);
case "REMOVE_NOTICES":
return state.filter(({ id }) => !action.ids.includes(id));
case "REMOVE_ALL_NOTICES":
return state.filter(({ type }) => type !== action.noticeType);
}
return state;
});
var reducer_default = notices;
;// ./node_modules/@wordpress/notices/build-module/store/constants.js
const DEFAULT_CONTEXT = "global";
const DEFAULT_STATUS = "info";
;// ./node_modules/@wordpress/notices/build-module/store/actions.js
let uniqueId = 0;
function createNotice(status = DEFAULT_STATUS, content, options = {}) {
const {
speak = true,
isDismissible = true,
context = DEFAULT_CONTEXT,
id = `${context}${++uniqueId}`,
actions = [],
type = "default",
__unstableHTML,
icon = null,
explicitDismiss = false,
onDismiss
} = options;
content = String(content);
return {
type: "CREATE_NOTICE",
context,
notice: {
id,
status,
content,
spokenMessage: speak ? content : null,
__unstableHTML,
isDismissible,
actions,
type,
icon,
explicitDismiss,
onDismiss
}
};
}
function createSuccessNotice(content, options) {
return createNotice("success", content, options);
}
function createInfoNotice(content, options) {
return createNotice("info", content, options);
}
function createErrorNotice(content, options) {
return createNotice("error", content, options);
}
function createWarningNotice(content, options) {
return createNotice("warning", content, options);
}
function removeNotice(id, context = DEFAULT_CONTEXT) {
return {
type: "REMOVE_NOTICE",
id,
context
};
}
function removeAllNotices(noticeType = "default", context = DEFAULT_CONTEXT) {
return {
type: "REMOVE_ALL_NOTICES",
noticeType,
context
};
}
function removeNotices(ids, context = DEFAULT_CONTEXT) {
return {
type: "REMOVE_NOTICES",
ids,
context
};
}
;// ./node_modules/@wordpress/notices/build-module/store/selectors.js
const DEFAULT_NOTICES = [];
function getNotices(state, context = DEFAULT_CONTEXT) {
return state[context] || DEFAULT_NOTICES;
}
;// ./node_modules/@wordpress/notices/build-module/store/index.js
const store = (0,external_wp_data_namespaceObject.createReduxStore)("core/notices", {
reducer: reducer_default,
actions: actions_namespaceObject,
selectors: selectors_namespaceObject
});
(0,external_wp_data_namespaceObject.register)(store);
;// ./node_modules/@wordpress/notices/build-module/index.js
(window.wp = window.wp || {}).notices = __webpack_exports__;
/******/ })()
; token-list.js 0000644 00000013562 15121363533 0007204 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ TokenList)
/* harmony export */ });
class TokenList {
_currentValue;
_valueAsArray;
/**
* Constructs a new instance of TokenList.
*
* @param initialValue Initial value to assign.
*/
constructor(initialValue = "") {
this._currentValue = "";
this._valueAsArray = [];
this.value = initialValue;
}
entries(...args) {
return this._valueAsArray.entries(...args);
}
forEach(...args) {
return this._valueAsArray.forEach(...args);
}
keys(...args) {
return this._valueAsArray.keys(...args);
}
values(...args) {
return this._valueAsArray.values(...args);
}
/**
* Returns the associated set as string.
*
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-value
*
* @return Token set as string.
*/
get value() {
return this._currentValue;
}
/**
* Replaces the associated set with a new string value.
*
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-value
*
* @param value New token set as string.
*/
set value(value) {
value = String(value);
this._valueAsArray = [
...new Set(value.split(/\s+/g).filter(Boolean))
];
this._currentValue = this._valueAsArray.join(" ");
}
/**
* Returns the number of tokens.
*
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-length
*
* @return Number of tokens.
*/
get length() {
return this._valueAsArray.length;
}
/**
* Returns the stringified form of the TokenList.
*
* @see https://dom.spec.whatwg.org/#DOMTokenList-stringification-behavior
* @see https://www.ecma-international.org/ecma-262/9.0/index.html#sec-tostring
*
* @return Token set as string.
*/
toString() {
return this.value;
}
/**
* Returns an iterator for the TokenList, iterating items of the set.
*
* @see https://dom.spec.whatwg.org/#domtokenlist
*
* @return TokenList iterator.
*/
*[Symbol.iterator]() {
return yield* this._valueAsArray;
}
/**
* Returns the token with index `index`.
*
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-item
*
* @param index Index at which to return token.
*
* @return Token at index.
*/
item(index) {
return this._valueAsArray[index];
}
/**
* Returns true if `token` is present, and false otherwise.
*
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-contains
*
* @param item Token to test.
*
* @return Whether token is present.
*/
contains(item) {
return this._valueAsArray.indexOf(item) !== -1;
}
/**
* Adds all arguments passed, except those already present.
*
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-add
*
* @param items Items to add.
*/
add(...items) {
this.value += " " + items.join(" ");
}
/**
* Removes arguments passed, if they are present.
*
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-remove
*
* @param items Items to remove.
*/
remove(...items) {
this.value = this._valueAsArray.filter((val) => !items.includes(val)).join(" ");
}
/**
* If `force` is not given, "toggles" `token`, removing it if it’s present
* and adding it if it’s not present. If `force` is true, adds token (same
* as add()). If force is false, removes token (same as remove()). Returns
* true if `token` is now present, and false otherwise.
*
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-toggle
*
* @param token Token to toggle.
* @param [force] Presence to force.
*
* @return Whether token is present after toggle.
*/
toggle(token, force) {
if (void 0 === force) {
force = !this.contains(token);
}
if (force) {
this.add(token);
} else {
this.remove(token);
}
return force;
}
/**
* Replaces `token` with `newToken`. Returns true if `token` was replaced
* with `newToken`, and false otherwise.
*
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-replace
*
* @param token Token to replace with `newToken`.
* @param newToken Token to use in place of `token`.
*
* @return Whether replacement occurred.
*/
replace(token, newToken) {
if (!this.contains(token)) {
return false;
}
this.remove(token);
this.add(newToken);
return true;
}
/* eslint-disable @typescript-eslint/no-unused-vars */
/**
* Returns true if `token` is in the associated attribute’s supported
* tokens. Returns false otherwise.
*
* Always returns `true` in this implementation.
*
* @param _token
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-supports
*
* @return Whether token is supported.
*/
supports(_token) {
return true;
}
/* eslint-enable @typescript-eslint/no-unused-vars */
}
(window.wp = window.wp || {}).tokenList = __webpack_exports__["default"];
/******/ })()
; customize-widgets.min.js 0000644 00000104342 15121363533 0011360 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={7734:e=>{e.exports=function e(t,s){if(t===s)return!0;if(t&&s&&"object"==typeof t&&"object"==typeof s){if(t.constructor!==s.constructor)return!1;var i,r,o;if(Array.isArray(t)){if((i=t.length)!=s.length)return!1;for(r=i;0!=r--;)if(!e(t[r],s[r]))return!1;return!0}if(t instanceof Map&&s instanceof Map){if(t.size!==s.size)return!1;for(r of t.entries())if(!s.has(r[0]))return!1;for(r of t.entries())if(!e(r[1],s.get(r[0])))return!1;return!0}if(t instanceof Set&&s instanceof Set){if(t.size!==s.size)return!1;for(r of t.entries())if(!s.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(s)){if((i=t.length)!=s.length)return!1;for(r=i;0!=r--;)if(t[r]!==s[r])return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if((i=(o=Object.keys(t)).length)!==Object.keys(s).length)return!1;for(r=i;0!=r--;)if(!Object.prototype.hasOwnProperty.call(s,o[r]))return!1;for(r=i;0!=r--;){var n=o[r];if(!e(t[n],s[n]))return!1}return!0}return t!=t&&s!=s}}},t={};function s(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,s),o.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};s.r(i),s.d(i,{initialize:()=>Fe,store:()=>N});var r={};s.r(r),s.d(r,{__experimentalGetInsertionPoint:()=>O,isInserterOpened:()=>M});var o={};s.r(o),s.d(o,{setIsInserterOpened:()=>T});const n=window.ReactJSXRuntime,c=window.wp.element,a=window.wp.blockLibrary,d=window.wp.widgets,l=window.wp.blocks,u=window.wp.data,h=window.wp.preferences,p=window.wp.components,m=window.wp.i18n,g=window.wp.blockEditor,b=window.wp.compose,w=window.wp.hooks;function f({text:e,children:t}){const s=(0,b.useCopyToClipboard)(e);return(0,n.jsx)(p.Button,{size:"compact",variant:"secondary",ref:s,children:t})}class _ extends c.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){this.setState({error:e}),(0,w.doAction)("editor.ErrorBoundary.errorLogged",e)}render(){const{error:e}=this.state;return e?(0,n.jsx)(g.Warning,{className:"customize-widgets-error-boundary",actions:[(0,n.jsx)(f,{text:e.stack,children:(0,m.__)("Copy Error")},"copy-error")],children:(0,m.__)("The editor has encountered an unexpected error.")}):this.props.children}}const y=window.wp.coreData,x=window.wp.mediaUtils;var v=function({inspector:e,closeMenu:t,...s}){const i=(0,u.useSelect)((e=>e(g.store).getSelectedBlockClientId()),[]),r=(0,c.useMemo)((()=>document.getElementById(`block-${i}`)),[i]);return(0,n.jsx)(p.MenuItem,{onClick:()=>{e.open({returnFocusWhenClose:r}),t()},...s,children:(0,m.__)("Show more settings")})};function k(e){var t,s,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(s=k(e[t]))&&(i&&(i+=" "),i+=s)}else for(s in e)e[s]&&(i&&(i+=" "),i+=s);return i}const C=function(){for(var e,t,s=0,i="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=k(e))&&(i&&(i+=" "),i+=t);return i},S=window.wp.keycodes,j=window.wp.primitives;var I=(0,n.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(j.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})}),z=(0,n.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(j.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"})}),W=(0,n.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(j.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),B=(0,n.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(j.Path,{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"})});var E=(0,u.combineReducers)({blockInserterPanel:function(e=!1,t){return"SET_IS_INSERTER_OPENED"===t.type?t.value:e}});const A={rootClientId:void 0,insertionIndex:void 0};function M(e){return!!e.blockInserterPanel}function O(e){return"boolean"==typeof e.blockInserterPanel?A:e.blockInserterPanel}function T(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}const P={reducer:E,selectors:r,actions:o},N=(0,u.createReduxStore)("core/customize-widgets",P);(0,u.register)(N);var F=function e({setIsOpened:t}){const s=(0,b.useInstanceId)(e,"customize-widget-layout__inserter-panel-title"),i=(0,u.useSelect)((e=>e(N).__experimentalGetInsertionPoint()),[]);return(0,n.jsxs)("div",{className:"customize-widgets-layout__inserter-panel","aria-labelledby":s,children:[(0,n.jsxs)("div",{className:"customize-widgets-layout__inserter-panel-header",children:[(0,n.jsx)("h2",{id:s,className:"customize-widgets-layout__inserter-panel-header-title",children:(0,m.__)("Add a block")}),(0,n.jsx)(p.Button,{size:"small",icon:B,onClick:()=>t(!1),"aria-label":(0,m.__)("Close inserter")})]}),(0,n.jsx)("div",{className:"customize-widgets-layout__inserter-panel-content",children:(0,n.jsx)(g.__experimentalLibrary,{rootClientId:i.rootClientId,__experimentalInsertionIndex:i.insertionIndex,showInserterHelpPanel:!0,onSelect:()=>t(!1)})})]})},L=(0,n.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(j.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})}),D=(0,n.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(j.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})});const H=window.wp.keyboardShortcuts,R=[{keyCombination:{modifier:"primary",character:"b"},description:(0,m.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,m.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,m.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,m.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,m.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,m.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,m.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,m.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,m.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,m.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,m.__)("Add non breaking space.")}];function G({keyCombination:e,forceAriaLabel:t}){const s=e.modifier?S.displayShortcutList[e.modifier](e.character):e.character,i=e.modifier?S.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,n.jsx)("kbd",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||i,children:(Array.isArray(s)?s:[s]).map(((e,t)=>"+"===e?(0,n.jsx)(c.Fragment,{children:e},t):(0,n.jsx)("kbd",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-key",children:e},t)))})}var V=function({description:e,keyCombination:t,aliases:s=[],ariaLabel:i}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,n.jsxs)("div",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-term",children:[(0,n.jsx)(G,{keyCombination:t,forceAriaLabel:i}),s.map(((e,t)=>(0,n.jsx)(G,{keyCombination:e,forceAriaLabel:i},t)))]})]})};var U=function({name:e}){const{keyCombination:t,description:s,aliases:i}=(0,u.useSelect)((t=>{const{getShortcutKeyCombination:s,getShortcutDescription:i,getShortcutAliases:r}=t(H.store);return{keyCombination:s(e),aliases:r(e),description:i(e)}}),[e]);return t?(0,n.jsx)(V,{keyCombination:t,description:s,aliases:i}):null};const $=({shortcuts:e})=>(0,n.jsx)("ul",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map(((e,t)=>(0,n.jsx)("li",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut",children:"string"==typeof e?(0,n.jsx)(U,{name:e}):(0,n.jsx)(V,{...e})},t)))}),q=({title:e,shortcuts:t,className:s})=>(0,n.jsxs)("section",{className:C("customize-widgets-keyboard-shortcut-help-modal__section",s),children:[!!e&&(0,n.jsx)("h2",{className:"customize-widgets-keyboard-shortcut-help-modal__section-title",children:e}),(0,n.jsx)($,{shortcuts:t})]}),K=({title:e,categoryName:t,additionalShortcuts:s=[]})=>{const i=(0,u.useSelect)((e=>e(H.store).getCategoryShortcuts(t)),[t]);return(0,n.jsx)(q,{title:e,shortcuts:i.concat(s)})};function Z({isModalActive:e,toggleModal:t}){const{registerShortcut:s}=(0,u.useDispatch)(H.store);return(0,c.useEffect)((()=>{s({name:"core/customize-widgets/keyboard-shortcuts",category:"main",description:(0,m.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}})}),[s]),(0,H.useShortcut)("core/customize-widgets/keyboard-shortcuts",t),e?(0,n.jsxs)(p.Modal,{className:"customize-widgets-keyboard-shortcut-help-modal",title:(0,m.__)("Keyboard shortcuts"),onRequestClose:t,children:[(0,n.jsx)(q,{className:"customize-widgets-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/customize-widgets/keyboard-shortcuts"]}),(0,n.jsx)(K,{title:(0,m.__)("Global shortcuts"),categoryName:"global"}),(0,n.jsx)(K,{title:(0,m.__)("Selection shortcuts"),categoryName:"selection"}),(0,n.jsx)(K,{title:(0,m.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,m.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,m.__)("Forward-slash")}]}),(0,n.jsx)(q,{title:(0,m.__)("Text formatting"),shortcuts:R})]}):null}function Y(){const[e,t]=(0,c.useState)(!1),s=()=>t(!e);return(0,H.useShortcut)("core/customize-widgets/keyboard-shortcuts",s),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(p.ToolbarDropdownMenu,{icon:L,label:(0,m.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{tooltipPosition:"bottom",size:"compact"},children:()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(p.MenuGroup,{label:(0,m._x)("View","noun"),children:(0,n.jsx)(h.PreferenceToggleMenuItem,{scope:"core/customize-widgets",name:"fixedToolbar",label:(0,m.__)("Top toolbar"),info:(0,m.__)("Access all block and document tools in a single place"),messageActivated:(0,m.__)("Top toolbar activated"),messageDeactivated:(0,m.__)("Top toolbar deactivated")})}),(0,n.jsxs)(p.MenuGroup,{label:(0,m.__)("Tools"),children:[(0,n.jsx)(p.MenuItem,{onClick:()=>{t(!0)},shortcut:S.displayShortcut.access("h"),children:(0,m.__)("Keyboard shortcuts")}),(0,n.jsx)(h.PreferenceToggleMenuItem,{scope:"core/customize-widgets",name:"welcomeGuide",label:(0,m.__)("Welcome Guide")}),(0,n.jsxs)(p.MenuItem,{role:"menuitem",icon:D,href:(0,m.__)("https://wordpress.org/documentation/article/block-based-widgets-editor/"),target:"_blank",rel:"noopener noreferrer",children:[(0,m.__)("Help"),(0,n.jsx)(p.VisuallyHidden,{as:"span",children:(0,m.__)("(opens in a new tab)")})]})]}),(0,n.jsx)(p.MenuGroup,{label:(0,m.__)("Preferences"),children:(0,n.jsx)(h.PreferenceToggleMenuItem,{scope:"core/customize-widgets",name:"keepCaretInsideBlock",label:(0,m.__)("Contain text cursor inside block"),info:(0,m.__)("Aids screen readers by stopping text caret from leaving blocks."),messageActivated:(0,m.__)("Contain text cursor inside block activated"),messageDeactivated:(0,m.__)("Contain text cursor inside block deactivated")})})]})}),(0,n.jsx)(Z,{isModalActive:e,toggleModal:s})]})}var J=function({sidebar:e,inserter:t,isInserterOpened:s,setIsInserterOpened:i,isFixedToolbarActive:r}){const[[o,a],d]=(0,c.useState)([e.hasUndo(),e.hasRedo()]),l=(0,S.isAppleOS)()?S.displayShortcut.primaryShift("z"):S.displayShortcut.primary("y");return(0,c.useEffect)((()=>e.subscribeHistory((()=>{d([e.hasUndo(),e.hasRedo()])}))),[e]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:C("customize-widgets-header",{"is-fixed-toolbar-active":r}),children:(0,n.jsxs)(g.NavigableToolbar,{className:"customize-widgets-header-toolbar","aria-label":(0,m.__)("Document tools"),children:[(0,n.jsx)(p.ToolbarButton,{icon:(0,m.isRTL)()?z:I,label:(0,m.__)("Undo"),shortcut:S.displayShortcut.primary("z"),disabled:!o,onClick:e.undo,className:"customize-widgets-editor-history-button undo-button"}),(0,n.jsx)(p.ToolbarButton,{icon:(0,m.isRTL)()?I:z,label:(0,m.__)("Redo"),shortcut:l,disabled:!a,onClick:e.redo,className:"customize-widgets-editor-history-button redo-button"}),(0,n.jsx)(p.ToolbarButton,{className:"customize-widgets-header-toolbar__inserter-toggle",isPressed:s,variant:"primary",icon:W,label:(0,m._x)("Add block","Generic label for block inserter button"),onClick:()=>{i((e=>!e))}}),(0,n.jsx)(Y,{})]})}),(0,c.createPortal)((0,n.jsx)(F,{setIsOpened:i}),t.contentContainer[0])]})};var X=s(7734),Q=s.n(X);const ee=window.wp.isShallowEqual;var te=s.n(ee);function se(e){const t=e.match(/^widget_(.+)(?:\[(\d+)\])$/);if(t){return`${t[1]}-${parseInt(t[2],10)}`}return e}function ie(e,t=null){let s;if("core/legacy-widget"===e.name&&(e.attributes.id||e.attributes.instance))if(e.attributes.id)s={id:e.attributes.id};else{const{encoded:i,hash:r,raw:o,...n}=e.attributes.instance;s={idBase:e.attributes.idBase,instance:{...t?.instance,is_widget_customizer_js_value:!0,encoded_serialized_instance:i,instance_hash_key:r,raw_instance:o,...n}}}else{s={idBase:"block",widgetClass:"WP_Widget_Block",instance:{raw_instance:{content:(0,l.serialize)(e)}}}}const{form:i,rendered:r,...o}=t||{};return{...o,...s}}function re({id:e,idBase:t,number:s,instance:i}){let r;const{encoded_serialized_instance:o,instance_hash_key:n,raw_instance:c,...a}=i;if("block"===t){const e=(0,l.parse)(c.content??"",{__unstableSkipAutop:!0});r=e.length?e[0]:(0,l.createBlock)("core/paragraph",{})}else r=s?(0,l.createBlock)("core/legacy-widget",{idBase:t,instance:{encoded:o,hash:n,raw:c,...a}}):(0,l.createBlock)("core/legacy-widget",{id:e});return(0,d.addWidgetIdToBlock)(r,e)}function oe(e){const[t,s]=(0,c.useState)((()=>e.getWidgets().map((e=>re(e)))));(0,c.useEffect)((()=>e.subscribe(((e,t)=>{s((s=>{const i=new Map(e.map((e=>[e.id,e]))),r=new Map(s.map((e=>[(0,d.getWidgetIdFromBlock)(e),e]))),o=t.map((e=>{const t=i.get(e.id);return t&&t===e?r.get(e.id):re(e)}));return te()(s,o)?s:o}))}))),[e]);const i=(0,c.useCallback)((t=>{s((s=>{if(te()(s,t))return s;const i=new Map(s.map((e=>[(0,d.getWidgetIdFromBlock)(e),e]))),r=t.map((t=>{const s=(0,d.getWidgetIdFromBlock)(t);if(s&&i.has(s)){const r=i.get(s),o=e.getWidget(s);return Q()(t,r)&&o?o:ie(t,o)}return ie(t)}));if(te()(e.getWidgets(),r))return s;const o=e.setWidgets(r);return t.reduce(((e,s,i)=>{const r=o[i];return null!==r&&(e===t&&(e=t.slice()),e[i]=(0,d.addWidgetIdToBlock)(s,r)),e}),t)}))}),[e]);return[t,i,i]}const ne=(0,c.createContext)();function ce({api:e,sidebarControls:t,children:s}){const[i,r]=(0,c.useState)({current:null}),o=(0,c.useCallback)((e=>{for(const s of t){if(s.setting.get().includes(e)){s.sectionInstance.expand({completeCallback(){r({current:e})}});break}}}),[t]);(0,c.useEffect)((()=>{function t(e){const t=se(e);o(t)}let s=!1;function i(){e.previewer.preview.bind("focus-control-for-setting",t),s=!0}return e.previewer.bind("ready",i),()=>{e.previewer.unbind("ready",i),s&&e.previewer.preview.unbind("focus-control-for-setting",t)}}),[e,o]);const a=(0,c.useMemo)((()=>[i,o]),[i,o]);return(0,n.jsx)(ne.Provider,{value:a,children:s})}ne.displayName="FocusControlContext";const ae=()=>(0,c.useContext)(ne);const de=window.wp.privateApis,{lock:le,unlock:ue}=(0,de.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/customize-widgets"),{ExperimentalBlockEditorProvider:he}=ue(g.privateApis);function pe({sidebar:e,settings:t,children:s}){const[i,r,o]=oe(e);return function(e){const{selectBlock:t}=(0,u.useDispatch)(g.store),[s]=ae(),i=(0,c.useRef)(e);(0,c.useEffect)((()=>{i.current=e}),[e]),(0,c.useEffect)((()=>{if(s.current){const e=i.current.find((e=>(0,d.getWidgetIdFromBlock)(e)===s.current));if(e){t(e.clientId);const s=document.querySelector(`[data-block="${e.clientId}"]`);s?.focus()}}}),[s,t])}(i),(0,n.jsx)(he,{value:i,onInput:r,onChange:o,settings:t,useSubRegistry:!1,children:s})}function me({sidebar:e}){const{toggle:t}=(0,u.useDispatch)(h.store),s=e.getWidgets().every((e=>e.id.startsWith("block-")));return(0,n.jsxs)("div",{className:"customize-widgets-welcome-guide",children:[(0,n.jsx)("div",{className:"customize-widgets-welcome-guide__image__wrapper",children:(0,n.jsxs)("picture",{children:[(0,n.jsx)("source",{srcSet:"https://s.w.org/images/block-editor/welcome-editor.svg",media:"(prefers-reduced-motion: reduce)"}),(0,n.jsx)("img",{className:"customize-widgets-welcome-guide__image",src:"https://s.w.org/images/block-editor/welcome-editor.gif",width:"312",height:"240",alt:""})]})}),(0,n.jsx)("h1",{className:"customize-widgets-welcome-guide__heading",children:(0,m.__)("Welcome to block Widgets")}),(0,n.jsx)("p",{className:"customize-widgets-welcome-guide__text",children:s?(0,m.__)("Your theme provides different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site."):(0,m.__)("You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.")}),(0,n.jsx)(p.Button,{size:"compact",variant:"primary",onClick:()=>t("core/customize-widgets","welcomeGuide"),children:(0,m.__)("Got it")}),(0,n.jsx)("hr",{className:"customize-widgets-welcome-guide__separator"}),!s&&(0,n.jsxs)("p",{className:"customize-widgets-welcome-guide__more-info",children:[(0,m.__)("Want to stick with the old widgets?"),(0,n.jsx)("br",{}),(0,n.jsx)(p.ExternalLink,{href:(0,m.__)("https://wordpress.org/plugins/classic-widgets/"),children:(0,m.__)("Get the Classic Widgets plugin.")})]}),(0,n.jsxs)("p",{className:"customize-widgets-welcome-guide__more-info",children:[(0,m.__)("New to the block editor?"),(0,n.jsx)("br",{}),(0,n.jsx)(p.ExternalLink,{href:(0,m.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),children:(0,m.__)("Here's a detailed guide.")})]})]})}function ge({undo:e,redo:t,save:s}){return(0,H.useShortcut)("core/customize-widgets/undo",(t=>{e(),t.preventDefault()})),(0,H.useShortcut)("core/customize-widgets/redo",(e=>{t(),e.preventDefault()})),(0,H.useShortcut)("core/customize-widgets/save",(e=>{e.preventDefault(),s()})),null}ge.Register=function(){const{registerShortcut:e,unregisterShortcut:t}=(0,u.useDispatch)(H.store);return(0,c.useEffect)((()=>(e({name:"core/customize-widgets/undo",category:"global",description:(0,m.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/customize-widgets/redo",category:"global",description:(0,m.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,S.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/customize-widgets/save",category:"global",description:(0,m.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),()=>{t("core/customize-widgets/undo"),t("core/customize-widgets/redo"),t("core/customize-widgets/save")})),[e]),null};var be=ge;function we(e){const t=(0,c.useRef)(),s=(0,u.useSelect)((e=>0===e(g.store).getBlockCount()));return(0,c.useEffect)((()=>{if(s&&t.current){const{ownerDocument:e}=t.current;e.activeElement&&e.activeElement!==e.body||t.current.focus()}}),[s]),(0,n.jsx)(g.ButtonBlockAppender,{...e,ref:t})}const{ExperimentalBlockCanvas:fe}=ue(g.privateApis),{BlockKeyboardShortcuts:_e}=ue(a.privateApis);function ye({blockEditorSettings:e,sidebar:t,inserter:s,inspector:i}){const[r,o]=function(e){const t=(0,u.useSelect)((e=>e(N).isInserterOpened()),[]),{setIsInserterOpened:s}=(0,u.useDispatch)(N);return(0,c.useEffect)((()=>{t?e.open():e.close()}),[e,t]),[t,(0,c.useCallback)((e=>{let t=e;"function"==typeof e&&(t=e((0,u.select)(N).isInserterOpened())),s(t)}),[s])]}(s),a=(0,b.useViewportMatch)("small"),{hasUploadPermissions:d,isFixedToolbarActive:l,keepCaretInsideBlock:p,isWelcomeGuideActive:m}=(0,u.useSelect)((e=>{const{get:t}=e(h.store);return{hasUploadPermissions:e(y.store).canUser("create",{kind:"postType",name:"attachment"})??!0,isFixedToolbarActive:!!t("core/customize-widgets","fixedToolbar"),keepCaretInsideBlock:!!t("core/customize-widgets","keepCaretInsideBlock"),isWelcomeGuideActive:!!t("core/customize-widgets","welcomeGuide")}}),[]),w=(0,c.useMemo)((()=>{let t;return d&&(t=({onError:t,...s})=>{(0,x.uploadMedia)({wpAllowedMimeTypes:e.allowedMimeTypes,onError:({message:e})=>t(e),...s})}),{...e,__experimentalSetIsInserterOpened:o,mediaUpload:t,hasFixedToolbar:l||!a,keepCaretInsideBlock:p,editorTool:"edit",__unstableHasCustomAppender:!0}}),[d,e,l,a,p,o]);return m?(0,n.jsx)(me,{sidebar:t}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(be.Register,{}),(0,n.jsx)(_e,{}),(0,n.jsxs)(pe,{sidebar:t,settings:w,children:[(0,n.jsx)(be,{undo:t.undo,redo:t.redo,save:t.save}),(0,n.jsx)(J,{sidebar:t,inserter:s,isInserterOpened:r,setIsInserterOpened:o,isFixedToolbarActive:l||!a}),(l||!a)&&(0,n.jsx)(g.BlockToolbar,{hideDragHandle:!0}),(0,n.jsx)(fe,{shouldIframe:!1,styles:w.defaultEditorStyles,height:"100%",children:(0,n.jsx)(g.BlockList,{renderAppender:we})}),(0,c.createPortal)((0,n.jsx)("form",{onSubmit:e=>e.preventDefault(),children:(0,n.jsx)(g.BlockInspector,{})}),i.contentContainer[0])]}),(0,n.jsx)(g.__unstableBlockSettingsMenuFirstItem,{children:({onClose:e})=>(0,n.jsx)(v,{inspector:i,closeMenu:e})})]})}const xe=(0,c.createContext)();function ve({sidebarControls:e,activeSidebarControl:t,children:s}){const i=(0,c.useMemo)((()=>({sidebarControls:e,activeSidebarControl:t})),[e,t]);return(0,n.jsx)(xe.Provider,{value:i,children:s})}function ke({api:e,sidebarControls:t,blockEditorSettings:s}){const[i,r]=(0,c.useState)(null),o=document.getElementById("customize-theme-controls"),a=(0,c.useRef)();!function(e,t){const{hasSelectedBlock:s,hasMultiSelection:i}=(0,u.useSelect)(g.store),{clearSelectedBlock:r}=(0,u.useDispatch)(g.store);(0,c.useEffect)((()=>{if(t.current&&e){let o=function(e){!s()&&!i()||!e||!l.contains(e)||d.contains(e)||t.current.contains(e)||e.closest('[role="dialog"]')||a.expanded()||r()},n=function(e){o(e.target)},c=function(){o(l.activeElement)};const a=e.inspector,d=e.container[0],l=d.ownerDocument,u=l.defaultView;return l.addEventListener("mousedown",n),u.addEventListener("blur",c),()=>{l.removeEventListener("mousedown",n),u.removeEventListener("blur",c)}}}),[t,e,s,i,r])}(i,a),(0,c.useEffect)((()=>{const e=t.map((e=>e.subscribe((t=>{t&&r(e)}))));return()=>{e.forEach((e=>e()))}}),[t]);const d=i&&(0,c.createPortal)((0,n.jsx)(_,{children:(0,n.jsx)(ye,{blockEditorSettings:s,sidebar:i.sidebarAdapter,inserter:i.inserter,inspector:i.inspector},i.id)}),i.container[0]),l=o&&(0,c.createPortal)((0,n.jsx)("div",{className:"customize-widgets-popover",ref:a,children:(0,n.jsx)(p.Popover.Slot,{})}),o);return(0,n.jsx)(p.SlotFillProvider,{children:(0,n.jsx)(ve,{sidebarControls:t,activeSidebarControl:i,children:(0,n.jsxs)(ce,{api:e,sidebarControls:t,children:[d,l]})})})}xe.displayName="SidebarControlsContext";const Ce=e=>`widgets-inspector-${e}`;function Se(){const{wp:{customize:e}}=window,t=window.matchMedia("(prefers-reduced-motion: reduce)");let s=t.matches;return t.addEventListener("change",(e=>{s=e.matches})),class extends e.Section{ready(){const t=function(){const{wp:{customize:e}}=window;return class extends e.Section{constructor(e,t){super(e,t),this.parentSection=t.parentSection,this.returnFocusWhenClose=null,this._isOpen=!1}get isOpen(){return this._isOpen}set isOpen(e){this._isOpen=e,this.triggerActiveCallbacks()}ready(){this.contentContainer[0].classList.add("customize-widgets-layout__inspector")}isContextuallyActive(){return this.isOpen}onChangeExpanded(e,t){super.onChangeExpanded(e,t),this.parentSection&&!t.unchanged&&(e?this.parentSection.collapse({manualTransition:!0}):this.parentSection.expand({manualTransition:!0,completeCallback:()=>{this.returnFocusWhenClose&&!this.contentContainer[0].contains(this.returnFocusWhenClose)&&this.returnFocusWhenClose.focus()}}))}open({returnFocusWhenClose:e}={}){this.isOpen=!0,this.returnFocusWhenClose=e,this.expand({allowMultiple:!0})}close(){this.collapse({allowMultiple:!0})}collapse(e){this.isOpen=!1,super.collapse(e)}triggerActiveCallbacks(){this.active.callbacks.fireWith(this.active,[!1,!0])}}}();this.inspector=new t(Ce(this.id),{title:(0,m.__)("Block Settings"),parentSection:this,customizeAction:[(0,m.__)("Customizing"),(0,m.__)("Widgets"),this.params.title].join(" ▸ ")}),e.section.add(this.inspector),this.contentContainer[0].classList.add("customize-widgets__sidebar-section")}hasSubSectionOpened(){return this.inspector.expanded()}onChangeExpanded(e,t){const i=this.controls(),r={...t,completeCallback(){i.forEach((t=>{t.onChangeSectionExpanded?.(e,r)})),t.completeCallback?.()}};if(r.manualTransition){e?(this.contentContainer.addClass(["busy","open"]),this.contentContainer.removeClass("is-sub-section-open"),this.contentContainer.closest(".wp-full-overlay").addClass("section-open")):(this.contentContainer.addClass(["busy","is-sub-section-open"]),this.contentContainer.closest(".wp-full-overlay").addClass("section-open"),this.contentContainer.removeClass("open"));const t=()=>{this.contentContainer.removeClass("busy"),r.completeCallback()};s?t():this.contentContainer.one("transitionend",t)}else super.onChangeExpanded(e,r)}}}const{wp:je}=window;function Ie(e){const t=e.match(/^(.+)-(\d+)$/);return t?{idBase:t[1],number:parseInt(t[2],10)}:{idBase:e}}function ze(e){const{idBase:t,number:s}=Ie(e);return s?`widget_${t}[${s}]`:`widget_${t}`}class We{constructor(e,t){this.setting=e,this.api=t,this.locked=!1,this.widgetsCache=new WeakMap,this.subscribers=new Set,this.history=[this._getWidgetIds().map((e=>this.getWidget(e)))],this.historyIndex=0,this.historySubscribers=new Set,this._debounceSetHistory=function(e,t,s){let i,r=!1;function o(...o){const n=(r?t:e).apply(this,o);return r=!0,clearTimeout(i),i=setTimeout((()=>{r=!1}),s),n}return o.cancel=()=>{r=!1,clearTimeout(i)},o}(this._pushHistory,this._replaceHistory,1e3),this.setting.bind(this._handleSettingChange.bind(this)),this.api.bind("change",this._handleAllSettingsChange.bind(this)),this.undo=this.undo.bind(this),this.redo=this.redo.bind(this),this.save=this.save.bind(this)}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}getWidgets(){return this.history[this.historyIndex]}_emit(...e){for(const t of this.subscribers)t(...e)}_getWidgetIds(){return this.setting.get()}_pushHistory(){this.history=[...this.history.slice(0,this.historyIndex+1),this._getWidgetIds().map((e=>this.getWidget(e)))],this.historyIndex+=1,this.historySubscribers.forEach((e=>e()))}_replaceHistory(){this.history[this.historyIndex]=this._getWidgetIds().map((e=>this.getWidget(e)))}_handleSettingChange(){if(this.locked)return;const e=this.getWidgets();this._pushHistory(),this._emit(e,this.getWidgets())}_handleAllSettingsChange(e){if(this.locked)return;if(!e.id.startsWith("widget_"))return;const t=se(e.id);if(!this.setting.get().includes(t))return;const s=this.getWidgets();this._pushHistory(),this._emit(s,this.getWidgets())}_createWidget(e){const t=je.customize.Widgets.availableWidgets.findWhere({id_base:e.idBase});let s=e.number;t.get("is_multi")&&!s&&(t.set("multi_number",t.get("multi_number")+1),s=t.get("multi_number"));const i=s?`widget_${e.idBase}[${s}]`:`widget_${e.idBase}`,r={transport:je.customize.Widgets.data.selectiveRefreshableWidgets[t.get("id_base")]?"postMessage":"refresh",previewer:this.setting.previewer};this.api.create(i,i,"",r).set(e.instance);return se(i)}_removeWidget(e){const t=ze(e.id),s=this.api(t);if(s){const e=s.get();this.widgetsCache.delete(e)}this.api.remove(t)}_updateWidget(e){const t=this.getWidget(e.id);if(t===e)return e.id;if(t.idBase&&e.idBase&&t.idBase===e.idBase){const t=ze(e.id);return this.api(t).set(e.instance),e.id}return this._removeWidget(e),this._createWidget(e)}getWidget(e){if(!e)return null;const{idBase:t,number:s}=Ie(e),i=ze(e),r=this.api(i);if(!r)return null;const o=r.get();if(this.widgetsCache.has(o))return this.widgetsCache.get(o);const n={id:e,idBase:t,number:s,instance:o};return this.widgetsCache.set(o,n),n}_updateWidgets(e){this.locked=!0;const t=[],s=e.map((e=>{if(e.id&&this.getWidget(e.id))return t.push(null),this._updateWidget(e);const s=this._createWidget(e);return t.push(s),s}));return this.getWidgets().filter((e=>!s.includes(e.id))).forEach((e=>this._removeWidget(e))),this.setting.set(s),this.locked=!1,t}setWidgets(e){const t=this._updateWidgets(e);return this._debounceSetHistory(),t}hasUndo(){return this.historyIndex>0}hasRedo(){return this.historyIndex<this.history.length-1}_seek(e){const t=this.getWidgets();this.historyIndex=e;const s=this.history[this.historyIndex];this._updateWidgets(s),this._emit(t,this.getWidgets()),this.historySubscribers.forEach((e=>e())),this._debounceSetHistory.cancel()}undo(){this.hasUndo()&&this._seek(this.historyIndex-1)}redo(){this.hasRedo()&&this._seek(this.historyIndex+1)}subscribeHistory(e){return this.historySubscribers.add(e),()=>{this.historySubscribers.delete(e)}}save(){this.api.previewer.save()}}const Be=window.wp.dom;const Ee=e=>`widgets-inserter-${e}`;function Ae(){const{wp:{customize:e}}=window;return class extends e.Control{constructor(...e){super(...e),this.subscribers=new Set}ready(){const t=function(){const{wp:{customize:e}}=window,t=e.OuterSection;return e.OuterSection=class extends t{onChangeExpanded(t,s){return t&&e.section.each((e=>{"outer"===e.params.type&&e.id!==this.id&&e.expanded()&&e.collapse()})),super.onChangeExpanded(t,s)}},e.sectionConstructor.outer=e.OuterSection,class extends e.OuterSection{constructor(...e){super(...e),this.params.type="outer",this.activeElementBeforeExpanded=null,this.contentContainer[0].ownerDocument.defaultView.addEventListener("keydown",(e=>{!this.expanded()||e.keyCode!==S.ESCAPE&&"Escape"!==e.code||e.defaultPrevented||(e.preventDefault(),e.stopPropagation(),(0,u.dispatch)(N).setIsInserterOpened(!1))}),!0),this.contentContainer.addClass("widgets-inserter"),this.isFromInternalAction=!1,this.expanded.bind((()=>{this.isFromInternalAction||(0,u.dispatch)(N).setIsInserterOpened(this.expanded()),this.isFromInternalAction=!1}))}open(){if(!this.expanded()){const e=this.contentContainer[0];this.activeElementBeforeExpanded=e.ownerDocument.activeElement,this.isFromInternalAction=!0,this.expand({completeCallback(){const t=Be.focus.tabbable.find(e)[1];t&&t.focus()}})}}close(){if(this.expanded()){const e=this.contentContainer[0],t=e.ownerDocument.activeElement;this.isFromInternalAction=!0,this.collapse({completeCallback(){e.contains(t)&&this.activeElementBeforeExpanded&&this.activeElementBeforeExpanded.focus()}})}}}}();this.inserter=new t(Ee(this.id),{}),e.section.add(this.inserter),this.sectionInstance=e.section(this.section()),this.inspector=this.sectionInstance.inspector,this.sidebarAdapter=new We(this.setting,e)}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}onChangeSectionExpanded(e,t){t.unchanged||(e||(0,u.dispatch)(N).setIsInserterOpened(!1),this.subscribers.forEach((s=>s(e,t))))}}}const Me=(0,b.createHigherOrderComponent)((e=>t=>{let s=(0,d.getWidgetIdFromBlock)(t);const i=function(){const{sidebarControls:e}=(0,c.useContext)(xe);return e}(),r=function(){const{activeSidebarControl:e}=(0,c.useContext)(xe);return e}(),o=i?.length>1,a=t.name,l=t.clientId,h=(0,u.useSelect)((e=>e(g.store).canInsertBlockType(a,"")),[a]),p=(0,u.useSelect)((e=>e(g.store).getBlock(l)),[l]),{removeBlock:m}=(0,u.useDispatch)(g.store),[,b]=ae();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e,{...t},"edit"),o&&h&&(0,n.jsx)(g.BlockControls,{children:(0,n.jsx)(d.MoveToWidgetArea,{widgetAreas:i.map((e=>({id:e.id,name:e.params.label,description:e.params.description}))),currentWidgetAreaId:r?.id,onSelect:function(e){const t=i.find((t=>t.id===e));if(s){const e=r.setting,i=t.setting;e(e().filter((e=>e!==s))),i([...i(),s])}else{const e=t.sidebarAdapter;m(l);const i=e.setWidgets([...e.getWidgets(),ie(p)]);s=i.reverse().find((e=>!!e))}b(s)}})})]})}),"withMoveToSidebarToolbarItem");(0,w.addFilter)("editor.BlockEdit","core/customize-widgets/block-edit",Me);(0,w.addFilter)("editor.MediaUpload","core/edit-widgets/replace-media-upload",(()=>x.MediaUpload));const{wp:Oe}=window,Te=(0,b.createHigherOrderComponent)((e=>t=>{const{idBase:s}=t.attributes,i=Oe.customize.Widgets.data.availableWidgets.find((e=>e.id_base===s))?.is_wide??!1;return(0,n.jsx)(e,{...t,isWide:i},"edit")}),"withWideWidgetDisplay");(0,w.addFilter)("editor.BlockEdit","core/customize-widgets/wide-widget-display",Te);const{wp:Pe}=window,Ne=["core/more","core/block","core/freeform","core/template-part"];function Fe(e,t){(0,u.dispatch)(h.store).setDefaults("core/customize-widgets",{fixedToolbar:!1,welcomeGuide:!0}),(0,u.dispatch)(l.store).reapplyBlockTypeFilters();const s=(0,a.__experimentalGetCoreBlocks)().filter((e=>!(Ne.includes(e.name)||e.name.startsWith("core/post")||e.name.startsWith("core/query")||e.name.startsWith("core/site")||e.name.startsWith("core/navigation"))));(0,a.registerCoreBlocks)(s),(0,d.registerLegacyWidgetBlock)(),(0,d.registerLegacyWidgetVariations)(t),(0,d.registerWidgetGroupBlock)(),(0,l.setFreeformContentHandlerName)("core/html");const i=Ae();Pe.customize.sectionConstructor.sidebar=Se(),Pe.customize.controlConstructor.sidebar_block_editor=i;const r=document.createElement("div");document.body.appendChild(r),Pe.customize.bind("ready",(()=>{const e=[];Pe.customize.control.each((t=>{t instanceof i&&e.push(t)})),(0,c.createRoot)(r).render((0,n.jsx)(c.StrictMode,{children:(0,n.jsx)(ke,{api:Pe.customize,sidebarControls:e,blockEditorSettings:t})}))}))}(window.wp=window.wp||{}).customizeWidgets=i})(); data.min.js 0000644 00000061546 15121363533 0006613 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={66:e=>{var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===r}(e)}(e)};var r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function o(e,t,r){return e.concat(t).map((function(e){return n(e,r)}))}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function i(e,t){try{return t in e}catch(e){return!1}}function c(e,t,r){var o={};return r.isMergeableObject(e)&&s(e).forEach((function(t){o[t]=n(e[t],r)})),s(t).forEach((function(s){(function(e,t){return i(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,s)||(i(e,s)&&r.isMergeableObject(t[s])?o[s]=function(e,t){if(!t.customMerge)return a;var r=t.customMerge(e);return"function"==typeof r?r:a}(s,r)(e[s],t[s],r):o[s]=n(t[s],r))})),o}function a(e,r,s){(s=s||{}).arrayMerge=s.arrayMerge||o,s.isMergeableObject=s.isMergeableObject||t,s.cloneUnlessOtherwiseSpecified=n;var i=Array.isArray(r);return i===Array.isArray(e)?i?s.arrayMerge(e,r,s):c(e,r,s):n(r,s)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return a(e,r,t)}),{})};var u=a;e.exports=u},3249:e=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,t){var r=e._map,n=e._arrayTreeMap,o=e._objectTreeMap;if(r.has(t))return r.get(t);for(var s=Object.keys(t).sort(),i=Array.isArray(t)?n:o,c=0;c<s.length;c++){var a=s[c];if(void 0===(i=i.get(a)))return;var u=t[a];if(void 0===(i=i.get(u)))return}var l=i.get("_ekm_value");return l?(r.delete(l[0]),l[0]=t,i.set("_ekm_value",l),r.set(t,l),l):void 0}var o=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.clear(),t instanceof e){var r=[];t.forEach((function(e,t){r.push([t,e])})),t=r}if(null!=t)for(var n=0;n<t.length;n++)this.set(t[n][0],t[n][1])}var o,s,i;return o=e,s=[{key:"set",value:function(r,n){if(null===r||"object"!==t(r))return this._map.set(r,n),this;for(var o=Object.keys(r).sort(),s=[r,n],i=Array.isArray(r)?this._arrayTreeMap:this._objectTreeMap,c=0;c<o.length;c++){var a=o[c];i.has(a)||i.set(a,new e),i=i.get(a);var u=r[a];i.has(u)||i.set(u,new e),i=i.get(u)}var l=i.get("_ekm_value");return l&&this._map.delete(l[0]),i.set("_ekm_value",s),this._map.set(r,s),this}},{key:"get",value:function(e){if(null===e||"object"!==t(e))return this._map.get(e);var r=n(this,e);return r?r[1]:void 0}},{key:"has",value:function(e){return null===e||"object"!==t(e)?this._map.has(e):void 0!==n(this,e)}},{key:"delete",value:function(e){return!!this.has(e)&&(this.set(e,void 0),!0)}},{key:"forEach",value:function(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;this._map.forEach((function(o,s){null!==s&&"object"===t(s)&&(o=o[1]),e.call(n,o,s,r)}))}},{key:"clear",value:function(){this._map=new Map,this._arrayTreeMap=new Map,this._objectTreeMap=new Map}},{key:"size",get:function(){return this._map.size}}],s&&r(o.prototype,s),i&&r(o,i),e}();e.exports=o}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{AsyncModeProvider:()=>Xe,RegistryConsumer:()=>He,RegistryProvider:()=>We,combineReducers:()=>ct,controls:()=>N,createReduxStore:()=>de,createRegistry:()=>Oe,createRegistryControl:()=>R,createRegistrySelector:()=>w,createSelector:()=>W,dispatch:()=>st,plugins:()=>i,register:()=>dt,registerGenericStore:()=>ft,registerStore:()=>pt,resolveSelect:()=>at,select:()=>it,subscribe:()=>lt,suspendSelect:()=>ut,use:()=>gt,useDispatch:()=>ot,useRegistry:()=>$e,useSelect:()=>Ye,useSuspenseSelect:()=>Ze,withDispatch:()=>rt,withRegistry:()=>nt,withSelect:()=>et});var o={};r.r(o),r.d(o,{countSelectorsByStatus:()=>Z,getCachedResolvers:()=>Q,getIsResolving:()=>K,getResolutionError:()=>q,getResolutionState:()=>$,hasFinishedResolution:()=>B,hasResolutionFailed:()=>X,hasResolvingSelectors:()=>Y,hasStartedResolution:()=>z,isResolving:()=>J});var s={};r.r(s),r.d(s,{failResolution:()=>re,failResolutions:()=>se,finishResolution:()=>te,finishResolutions:()=>oe,invalidateResolution:()=>ie,invalidateResolutionForStore:()=>ce,invalidateResolutionForStoreSelector:()=>ae,startResolution:()=>ee,startResolutions:()=>ne});var i={};r.r(i),r.d(i,{persistence:()=>Pe});const c=window.wp.deprecated;var a=r.n(c);function u(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var l=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),f=()=>Math.random().toString(36).substring(7).split("").join("."),p={INIT:`@@redux/INIT${f()}`,REPLACE:`@@redux/REPLACE${f()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${f()}`};function g(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function d(e,t,r){if("function"!=typeof e)throw new Error(u(2));if("function"==typeof t&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(u(0));if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw new Error(u(1));return r(d)(e,t)}let n=e,o=t,s=new Map,i=s,c=0,a=!1;function f(){i===s&&(i=new Map,s.forEach(((e,t)=>{i.set(t,e)})))}function y(){if(a)throw new Error(u(3));return o}function h(e){if("function"!=typeof e)throw new Error(u(4));if(a)throw new Error(u(5));let t=!0;f();const r=c++;return i.set(r,e),function(){if(t){if(a)throw new Error(u(6));t=!1,f(),i.delete(r),s=null}}}function S(e){if(!g(e))throw new Error(u(7));if(void 0===e.type)throw new Error(u(8));if("string"!=typeof e.type)throw new Error(u(17));if(a)throw new Error(u(9));try{a=!0,o=n(o,e)}finally{a=!1}return(s=i).forEach((e=>{e()})),e}S({type:p.INIT});return{dispatch:S,subscribe:h,getState:y,replaceReducer:function(e){if("function"!=typeof e)throw new Error(u(10));n=e,S({type:p.REPLACE})},[l]:function(){const e=h;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(u(11));function r(){const e=t;e.next&&e.next(y())}r();return{unsubscribe:e(r)}},[l](){return this}}}}}function y(...e){return t=>(r,n)=>{const o=t(r,n);let s=()=>{throw new Error(u(15))};const i={getState:o.getState,dispatch:(e,...t)=>s(e,...t)},c=e.map((e=>e(i)));return s=function(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...r)=>e(t(...r))))}(...c)(o.dispatch),{...o,dispatch:s}}}var h=r(3249),S=r.n(h);const v=window.wp.reduxRoutine;var b=r.n(v);const O=window.wp.compose;function m(e){const t=Object.keys(e);return function(r={},n){const o={};let s=!1;for(const i of t){const t=e[i],c=r[i],a=t(c,n);o[i]=a,s=s||a!==c}return s?o:r}}function w(e){const t=new WeakMap,r=(...n)=>{let o=t.get(r.registry);return o||(o=e(r.registry.select),t.set(r.registry,o)),o(...n)};return r.isRegistrySelector=!0,r}function R(e){return e.isRegistryControl=!0,e}const E="@@data/SELECT",_="@@data/RESOLVE_SELECT",I="@@data/DISPATCH";function T(e){return null!==e&&"object"==typeof e}const N={select:function(e,t,...r){return{type:E,storeKey:T(e)?e.name:e,selectorName:t,args:r}},resolveSelect:function(e,t,...r){return{type:_,storeKey:T(e)?e.name:e,selectorName:t,args:r}},dispatch:function(e,t,...r){return{type:I,storeKey:T(e)?e.name:e,actionName:t,args:r}}},A={[E]:R((e=>({storeKey:t,selectorName:r,args:n})=>e.select(t)[r](...n))),[_]:R((e=>({storeKey:t,selectorName:r,args:n})=>{const o=e.select(t)[r].hasResolver?"resolveSelect":"select";return e[o](t)[r](...n)})),[I]:R((e=>({storeKey:t,actionName:r,args:n})=>e.dispatch(t)[r](...n)))},j=window.wp.privateApis,{lock:L,unlock:M}=(0,j.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/data");var P=()=>e=>t=>{return!(r=t)||"object"!=typeof r&&"function"!=typeof r||"function"!=typeof r.then?e(t):t.then((t=>{if(t)return e(t)}));var r};var x=(e,t)=>()=>r=>n=>{const o=e.select(t).getCachedResolvers();return Object.entries(o).forEach((([r,o])=>{const s=e.stores[t]?.resolvers?.[r];s&&s.shouldInvalidate&&o.forEach(((o,i)=>{void 0!==o&&("finished"!==o.status&&"error"!==o.status||s.shouldInvalidate(n,...i)&&e.dispatch(t).invalidateResolution(r,i))}))})),r(n)};function U(e){return()=>t=>r=>"function"==typeof r?r(e):t(r)}function C(e){if(null==e)return[];const t=e.length;let r=t;for(;r>0&&void 0===e[r-1];)r--;return r===t?e:e.slice(0,r)}const k=(F="selectorName",e=>(t={},r)=>{const n=r[F];if(void 0===n)return t;const o=e(t[n],r);return o===t[n]?t:{...t,[n]:o}})(((e=new(S()),t)=>{switch(t.type){case"START_RESOLUTION":{const r=new(S())(e);return r.set(C(t.args),{status:"resolving"}),r}case"FINISH_RESOLUTION":{const r=new(S())(e);return r.set(C(t.args),{status:"finished"}),r}case"FAIL_RESOLUTION":{const r=new(S())(e);return r.set(C(t.args),{status:"error",error:t.error}),r}case"START_RESOLUTIONS":{const r=new(S())(e);for(const e of t.args)r.set(C(e),{status:"resolving"});return r}case"FINISH_RESOLUTIONS":{const r=new(S())(e);for(const e of t.args)r.set(C(e),{status:"finished"});return r}case"FAIL_RESOLUTIONS":{const r=new(S())(e);return t.args.forEach(((e,n)=>{const o={status:"error",error:void 0},s=t.errors[n];s&&(o.error=s),r.set(C(e),o)})),r}case"INVALIDATE_RESOLUTION":{const r=new(S())(e);return r.delete(C(t.args)),r}}return e}));var F;var D=(e={},t)=>{switch(t.type){case"INVALIDATE_RESOLUTION_FOR_STORE":return{};case"INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR":if(t.selectorName in e){const{[t.selectorName]:r,...n}=e;return n}return e;case"START_RESOLUTION":case"FINISH_RESOLUTION":case"FAIL_RESOLUTION":case"START_RESOLUTIONS":case"FINISH_RESOLUTIONS":case"FAIL_RESOLUTIONS":case"INVALIDATE_RESOLUTION":return k(e,t)}return e},V={};function G(e){return[e]}function H(e,t,r){var n;if(e.length!==t.length)return!1;for(n=r;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function W(e,t){var r,n=t||G;function o(){r=new WeakMap}function s(){var t,o,s,i,c,a=arguments.length;for(i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];for(t=function(e){var t,n,o,s,i,c=r,a=!0;for(t=0;t<e.length;t++){if(!(i=n=e[t])||"object"!=typeof i){a=!1;break}c.has(n)?c=c.get(n):(o=new WeakMap,c.set(n,o),c=o)}return c.has(V)||((s=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,c.set(V,s)),c.get(V)}(c=n.apply(null,i)),t.isUniqueByDependants||(t.lastDependants&&!H(c,t.lastDependants,0)&&t.clear(),t.lastDependants=c),o=t.head;o;){if(H(o.args,i,1))return o!==t.head&&(o.prev.next=o.next,o.next&&(o.next.prev=o.prev),o.next=t.head,o.prev=null,t.head.prev=o,t.head=o),o.val;o=o.next}return o={val:e.apply(null,i)},i[0]=null,o.args=i,t.head&&(t.head.prev=o,o.next=t.head),t.head=o,o.val}return s.getDependants=n,s.clear=o,o(),s}function $(e,t,r){const n=e[t];if(n)return n.get(C(r))}function K(e,t,r){a()("wp.data.select( store ).getIsResolving",{since:"6.6",version:"6.8",alternative:"wp.data.select( store ).getResolutionState"});const n=$(e,t,r);return n&&"resolving"===n.status}function z(e,t,r){return void 0!==$(e,t,r)}function B(e,t,r){const n=$(e,t,r)?.status;return"finished"===n||"error"===n}function X(e,t,r){return"error"===$(e,t,r)?.status}function q(e,t,r){const n=$(e,t,r);return"error"===n?.status?n.error:null}function J(e,t,r){return"resolving"===$(e,t,r)?.status}function Q(e){return e}function Y(e){return Object.values(e).some((e=>Array.from(e._map.values()).some((e=>"resolving"===e[1]?.status))))}const Z=W((e=>{const t={};return Object.values(e).forEach((e=>Array.from(e._map.values()).forEach((e=>{const r=e[1]?.status??"error";t[r]||(t[r]=0),t[r]++})))),t}),(e=>[e]));function ee(e,t){return{type:"START_RESOLUTION",selectorName:e,args:t}}function te(e,t){return{type:"FINISH_RESOLUTION",selectorName:e,args:t}}function re(e,t,r){return{type:"FAIL_RESOLUTION",selectorName:e,args:t,error:r}}function ne(e,t){return{type:"START_RESOLUTIONS",selectorName:e,args:t}}function oe(e,t){return{type:"FINISH_RESOLUTIONS",selectorName:e,args:t}}function se(e,t,r){return{type:"FAIL_RESOLUTIONS",selectorName:e,args:t,errors:r}}function ie(e,t){return{type:"INVALIDATE_RESOLUTION",selectorName:e,args:t}}function ce(){return{type:"INVALIDATE_RESOLUTION_FOR_STORE"}}function ae(e){return{type:"INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR",selectorName:e}}const ue=e=>{const t=[...e];for(let e=t.length-1;e>=0;e--)void 0===t[e]&&t.splice(e,1);return t},le=(e,t)=>Object.fromEntries(Object.entries(e??{}).map((([e,r])=>[e,t(r,e)]))),fe=(e,t)=>t instanceof Map?Object.fromEntries(t):t instanceof window.HTMLElement?null:t;function pe(e,t){const r=new WeakMap;return{get(n){const o=e(n);if(!o)return null;let s=r.get(o);return s||(s=t(o,n),r.set(o,s)),s}}}function ge(e,t){return new Proxy(e,{get:(e,r)=>t.get(r)||Reflect.get(e,r)})}function de(e,t){const r={},n={},i={privateActions:r,registerPrivateActions:e=>{Object.assign(r,e)},privateSelectors:n,registerPrivateSelectors:e=>{Object.assign(n,e)}},c={name:e,instantiate:c=>{const a=new Set,u=t.reducer,l=function(e,t,r,n){const o={...t.controls,...A},s=le(o,(e=>e.isRegistryControl?e(r):e)),i=[x(r,e),P,b()(s),U(n)],c=[y(...i)];"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&c.push(window.__REDUX_DEVTOOLS_EXTENSION__({name:e,instanceId:e,serialize:{replacer:fe}}));const{reducer:a,initialState:u}=t,l=m({metadata:D,root:a});return d(l,{root:u},(0,O.compose)(c))}(e,t,c,{registry:c,get dispatch(){return v},get select(){return j},get resolveSelect(){return C}});L(l,i);const f=function(){const e={};return{isRunning:(t,r)=>e[t]&&e[t].get(ue(r)),clear(t,r){e[t]&&e[t].delete(ue(r))},markAsRunning(t,r){e[t]||(e[t]=new(S())),e[t].set(ue(r),!0)}}}();function p(e){return(...t)=>Promise.resolve(l.dispatch(e(...t)))}const g={...le(s,p),...le(t.actions,p)},h=ge(g,pe((e=>r[e]),p)),v=new Proxy((e=>l.dispatch(e)),{get:(e,t)=>h[t]});L(g,h);const w=t.resolvers?le(t.resolvers,ye):{};function R(e,t){e.isRegistrySelector&&(e.registry=c);const r=(...t)=>{t=he(e,t);const r=l.__unstableOriginalGetState();return e.isRegistrySelector&&(e.registry=c),e(r.root,...t)};r.__unstableNormalizeArgs=e.__unstableNormalizeArgs;const n=w[t];return n?function(e,t,r,n,o,s){function i(e){const i=n.getState();o.isRunning(t,e)||"function"==typeof r.isFulfilled&&r.isFulfilled(i,...e)||s.hasStartedResolution(t,e)||(o.markAsRunning(t,e),setTimeout((async()=>{o.clear(t,e),n.dispatch(ee(t,e));try{const o=r.fulfill(...e);o&&await n.dispatch(o),n.dispatch(te(t,e))}catch(r){n.dispatch(re(t,e,r))}}),0))}const c=(...t)=>(i(t=he(e,t)),e(...t));return c.hasResolver=!0,c}(r,t,n,l,f,E):(r.hasResolver=!1,r)}const E=le(o,(function(e){const r=(r,n,...o)=>{if(r){const e=t.selectors?.[r];e&&(n=he(e,n))}const s=l.__unstableOriginalGetState();return e(s.metadata,r,n,...o)};return r.hasResolver=!1,r})),_=le(t.selectors,R),I={...E,..._},T=pe((e=>n[e]),R),N=ge(I,T);for(const e of Object.keys(n))T.get(e);const j=new Proxy((e=>e(l.__unstableOriginalGetState())),{get:(e,t)=>N[t]});L(I,N);const M=function(e,t){return(r,n)=>r.hasResolver?(...o)=>new Promise(((s,i)=>{const c=()=>t.hasFinishedResolution(n,o),a=e=>{if(t.hasResolutionFailed(n,o)){const e=t.getResolutionError(n,o);i(e)}else s(e)},u=()=>r.apply(null,o),l=u();if(c())return a(l);const f=e.subscribe((()=>{c()&&(f(),a(u()))}))})):async(...e)=>r.apply(null,e)}(l,E),C=le(_,M),k=ge(C,pe((e=>T.get(e)),M));L(C,k);const F=function(e,t){return(r,n)=>r.hasResolver?(...o)=>{const s=r.apply(null,o);if(t.hasFinishedResolution(n,o)){if(t.hasResolutionFailed(n,o))throw t.getResolutionError(n,o);return s}throw new Promise((r=>{const s=e.subscribe((()=>{t.hasFinishedResolution(n,o)&&(r(),s())}))}))}:r}(l,E),V={...E,...le(_,F)},G=ge(V,pe((e=>T.get(e)),F));L(V,G);l.__unstableOriginalGetState=l.getState,l.getState=()=>l.__unstableOriginalGetState().root;const H=l&&(e=>(a.add(e),()=>a.delete(e)));let W=l.__unstableOriginalGetState();return l.subscribe((()=>{const e=l.__unstableOriginalGetState(),t=e!==W;if(W=e,t)for(const e of a)e()})),{reducer:u,store:l,actions:g,selectors:I,resolvers:w,getSelectors:()=>I,getResolveSelectors:()=>C,getSuspendSelectors:()=>V,getActions:()=>g,subscribe:H}}};return L(c,i),c}function ye(e){return e.fulfill?e:{...e,fulfill:e}}function he(e,t){return e.__unstableNormalizeArgs&&"function"==typeof e.__unstableNormalizeArgs&&t?.length?e.__unstableNormalizeArgs(t):t}var Se={name:"core/data",instantiate(e){const t=t=>(r,...n)=>e.select(r)[t](...n),r=t=>(r,...n)=>e.dispatch(r)[t](...n);return{getSelectors:()=>Object.fromEntries(["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"].map((e=>[e,t(e)]))),getActions:()=>Object.fromEntries(["startResolution","finishResolution","invalidateResolution","invalidateResolutionForStore","invalidateResolutionForStoreSelector"].map((e=>[e,r(e)]))),subscribe:()=>()=>()=>{}}}};function ve(){let e=!1,t=!1;const r=new Set,n=()=>Array.from(r).forEach((e=>e()));return{get isPaused(){return e},subscribe:e=>(r.add(e),()=>r.delete(e)),pause(){e=!0},resume(){e=!1,t&&(t=!1,n())},emit(){e?t=!0:n()}}}function be(e){return"string"==typeof e?e:e.name}function Oe(e={},t=null){const r={},n=ve();let o=null;function s(){n.emit()}function i(e,n){if(r[e])return console.error('Store "'+e+'" is already registered.'),r[e];const o=n();if("function"!=typeof o.getSelectors)throw new TypeError("store.getSelectors must be a function");if("function"!=typeof o.getActions)throw new TypeError("store.getActions must be a function");if("function"!=typeof o.subscribe)throw new TypeError("store.subscribe must be a function");o.emitter=ve();const i=o.subscribe;if(o.subscribe=e=>{const t=o.emitter.subscribe(e),r=i((()=>{o.emitter.isPaused?o.emitter.emit():e()}));return()=>{r?.(),t?.()}},r[e]=o,o.subscribe(s),t)try{M(o.store).registerPrivateActions(M(t).privateActionsOf(e)),M(o.store).registerPrivateSelectors(M(t).privateSelectorsOf(e))}catch(e){}return o}let c={batch:function(e){if(n.isPaused)e();else{n.pause(),Object.values(r).forEach((e=>e.emitter.pause()));try{e()}finally{n.resume(),Object.values(r).forEach((e=>e.emitter.resume()))}}},stores:r,namespaces:r,subscribe:(e,o)=>{if(!o)return n.subscribe(e);const s=be(o),i=r[s];return i?i.subscribe(e):t?t.subscribe(e,o):n.subscribe(e)},select:function(e){const n=be(e);o?.add(n);const s=r[n];return s?s.getSelectors():t?.select(n)},resolveSelect:function(e){const n=be(e);o?.add(n);const s=r[n];return s?s.getResolveSelectors():t&&t.resolveSelect(n)},suspendSelect:function(e){const n=be(e);o?.add(n);const s=r[n];return s?s.getSuspendSelectors():t&&t.suspendSelect(n)},dispatch:function(e){const n=be(e),o=r[n];return o?o.getActions():t&&t.dispatch(n)},use:function(e,t){if(!e)return;return c={...c,...e(c,t)},c},register:function(e){i(e.name,(()=>e.instantiate(c)))},registerGenericStore:function(e,t){a()("wp.data.registerGenericStore",{since:"5.9",alternative:"wp.data.register( storeDescriptor )"}),i(e,(()=>t))},registerStore:function(e,t){if(!t.reducer)throw new TypeError("Must specify store reducer");return i(e,(()=>de(e,t).instantiate(c))).store},__unstableMarkListeningStores:function(e,t){o=new Set;try{return e.call(this)}finally{t.current=Array.from(o),o=null}}};c.register(Se);for(const[t,r]of Object.entries(e))c.register(de(t,r));t&&t.subscribe(s);const u=(l=c,Object.fromEntries(Object.entries(l).map((([e,t])=>"function"!=typeof t?[e,t]:[e,function(){return c[e].apply(null,arguments)}]))));var l;return L(u,{privateActionsOf:e=>{try{return M(r[e].store).privateActions}catch(e){return{}}},privateSelectorsOf:e=>{try{return M(r[e].store).privateSelectors}catch(e){return{}}}}),u}var me=Oe();
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function we(e){return"[object Object]"===Object.prototype.toString.call(e)}function Re(e){var t,r;return!1!==we(e)&&(void 0===(t=e.constructor)||!1!==we(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}var Ee=r(66),_e=r.n(Ee);let Ie;const Te={getItem:e=>Ie&&Ie[e]?Ie[e]:null,setItem(e,t){Ie||Te.clear(),Ie[e]=String(t)},clear(){Ie=Object.create(null)}};var Ne=Te;let Ae;try{Ae=window.localStorage,Ae.setItem("__wpDataTestLocalStorage",""),Ae.removeItem("__wpDataTestLocalStorage")}catch(e){Ae=Ne}const je=Ae,Le="WP_DATA";function Me(e,t){const r=function(e){const{storage:t=je,storageKey:r=Le}=e;let n;return{get:function(){if(void 0===n){const e=t.getItem(r);if(null===e)n={};else try{n=JSON.parse(e)}catch(e){n={}}}return n},set:function(e,o){n={...n,[e]:o},t.setItem(r,JSON.stringify(n))}}}(t);return{registerStore(t,n){if(!n.persist)return e.registerStore(t,n);const o=r.get()[t];if(void 0!==o){let e=n.reducer(n.initialState,{type:"@@WP/PERSISTENCE_RESTORE"});e=Re(e)&&Re(o)?_e()(e,o,{isMergeableObject:Re}):o,n={...n,initialState:e}}const s=e.registerStore(t,n);return s.subscribe(function(e,t,n){let o;if(Array.isArray(n)){const e=n.reduce(((e,t)=>Object.assign(e,{[t]:(e,r)=>r.nextState[t]})),{});s=ct(e),o=(e,t)=>t.nextState===e?e:s(e,t)}else o=(e,t)=>t.nextState;var s;let i=o(void 0,{nextState:e()});return()=>{const n=o(i,{nextState:e()});n!==i&&(r.set(t,n),i=n)}}(s.getState,t,n.persist)),s}}}Me.__unstableMigrate=()=>{};var Pe=Me;const xe=window.ReactJSXRuntime,Ue=window.wp.priorityQueue,Ce=window.wp.element,ke=window.wp.isShallowEqual;var Fe=r.n(ke);const De=(0,Ce.createContext)(me);De.displayName="RegistryProviderContext";const{Consumer:Ve,Provider:Ge}=De,He=Ve;var We=Ge;function $e(){return(0,Ce.useContext)(De)}const Ke=(0,Ce.createContext)(!1);Ke.displayName="AsyncModeContext";const{Consumer:ze,Provider:Be}=Ke;var Xe=Be;const qe=(0,Ue.createQueue)();function Je(e,t){const r=t?e.suspendSelect:e.select,n={};let o,s,i,c,a=!1;const u=new Map;function l(t){return e.stores[t]?.store?.getState?.()??{}}return(t,f)=>{function p(){if(a&&t===o)return s;const f={current:null},p=e.__unstableMarkListeningStores((()=>t(r,e)),f);if(c)c.updateStores(f.current);else{for(const e of f.current)u.set(e,l(e));c=(t=>{const r=[...t],o=new Set;return{subscribe:function(t){if(a)for(const e of r)u.get(e)!==l(e)&&(a=!1);u.clear();const s=()=>{a=!1,t()},c=()=>{i?qe.add(n,s):s()},f=[];function p(t){f.push(e.subscribe(c,t))}for(const e of r)p(e);return o.add(p),()=>{o.delete(p);for(const e of f.values())e?.();qe.cancel(n)}},updateStores:function(e){for(const t of e)if(!r.includes(t)){r.push(t);for(const e of o)e(t)}}}})(f.current)}Fe()(s,p)||(s=p),o=t,a=!0}return i&&!f&&(a=!1,qe.cancel(n)),p(),i=f,{subscribe:c.subscribe,getValue:function(){return p(),s}}}}function Qe(e,t,r){const n=$e(),o=(0,Ce.useContext)(Ke),s=(0,Ce.useMemo)((()=>Je(n,e)),[n,e]),i=(0,Ce.useCallback)(t,r),{subscribe:c,getValue:a}=s(i,o),u=(0,Ce.useSyncExternalStore)(c,a,a);return(0,Ce.useDebugValue)(u),u}function Ye(e,t){const r="function"!=typeof e,n=(0,Ce.useRef)(r);if(r!==n.current){const e=n.current?"static":"mapping";throw new Error(`Switching useSelect from ${e} to ${r?"static":"mapping"} is not allowed`)}return r?(o=e,$e().select(o)):Qe(!1,e,t);var o}function Ze(e,t){return Qe(!0,e,t)}var et=e=>(0,O.createHigherOrderComponent)((t=>(0,O.pure)((r=>{const n=Ye(((t,n)=>e(t,r,n)));return(0,xe.jsx)(t,{...r,...n})}))),"withSelect");var tt=(e,t)=>{const r=$e(),n=(0,Ce.useRef)(e);return(0,O.useIsomorphicLayoutEffect)((()=>{n.current=e})),(0,Ce.useMemo)((()=>{const e=n.current(r.dispatch,r);return Object.fromEntries(Object.entries(e).map((([e,t])=>("function"!=typeof t&&console.warn(`Property ${e} returned from dispatchMap in useDispatchWithMap must be a function.`),[e,(...t)=>n.current(r.dispatch,r)[e](...t)]))))}),[r,...t])};var rt=e=>(0,O.createHigherOrderComponent)((t=>r=>{const n=tt(((t,n)=>e(t,r,n)),[]);return(0,xe.jsx)(t,{...r,...n})}),"withDispatch");var nt=(0,O.createHigherOrderComponent)((e=>t=>(0,xe.jsx)(He,{children:r=>(0,xe.jsx)(e,{...t,registry:r})})),"withRegistry");var ot=e=>{const{dispatch:t}=$e();return void 0===e?t:t(e)};function st(e){return me.dispatch(e)}function it(e){return me.select(e)}const ct=m,at=me.resolveSelect,ut=me.suspendSelect,lt=me.subscribe,ft=me.registerGenericStore,pt=me.registerStore,gt=me.use,dt=me.register;(window.wp=window.wp||{}).data=n})(); preferences-persistence.min.js 0000644 00000012521 15121363536 0012515 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={n:r=>{var t=r&&r.__esModule?()=>r.default:()=>r;return e.d(t,{a:t}),t},d:(r,t)=>{for(var n in t)e.o(t,n)&&!e.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:t[n]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{__unstableCreatePersistenceLayer:()=>m,create:()=>c});const t=window.wp.apiFetch;var n=e.n(t);const o={},s=window.localStorage;function c({preloadedData:e,localStorageRestoreKey:r="WP_PREFERENCES_RESTORE_DATA",requestDebounceMS:t=2500}={}){let c=e;const i=function(e,r){let t,n;return async function(...o){return n||t?(n&&await n,t&&(clearTimeout(t),t=null),new Promise(((s,c)=>{t=setTimeout((()=>{n=e(...o).then(((...e)=>{s(...e)})).catch((e=>{c(e)})).finally((()=>{n=null,t=null}))}),r)}))):new Promise(((r,t)=>{n=e(...o).then(((...e)=>{r(...e)})).catch((e=>{t(e)})).finally((()=>{n=null}))}))}}(n(),t);return{get:async function(){if(c)return c;const e=await n()({path:"/wp/v2/users/me?context=edit"}),t=e?.meta?.persisted_preferences,i=JSON.parse(s.getItem(r)),a=Date.parse(t?._modified)||0,d=Date.parse(i?._modified)||0;return c=t&&a>=d?t:i||o,c},set:function(e){const t={...e,_modified:(new Date).toISOString()};c=t,s.setItem(r,JSON.stringify(t)),i({path:"/wp/v2/users/me",method:"PUT",keepalive:!0,data:{meta:{persisted_preferences:t}}}).catch((()=>{}))}}}function i(e,r){const t="core/preferences",n="core/interface",o=e?.[n]?.preferences?.features?.[r],s=e?.[r]?.preferences?.features,c=o||s;if(!c)return e;const i=e?.[t]?.preferences;if(i?.[r])return e;let a,d;if(o){const t=e?.[n],o=e?.[n]?.preferences?.features;a={[n]:{...t,preferences:{features:{...o,[r]:void 0}}}}}if(s){const t=e?.[r],n=e?.[r]?.preferences;d={[r]:{...t,preferences:{...n,features:void 0}}}}return{...e,[t]:{preferences:{...i,[r]:c}},...a,...d}}const a=e=>e;function d(e,{from:r,to:t},n,o=a){const s="core/preferences",c=e?.[r]?.preferences?.[n];if(void 0===c)return e;const i=e?.[s]?.preferences?.[t]?.[n];if(i)return e;const d=e?.[s]?.preferences,f=e?.[s]?.preferences?.[t],l=e?.[r],p=e?.[r]?.preferences,u=o({[n]:c});return{...e,[s]:{preferences:{...d,[t]:{...f,...u}}},[r]:{...l,preferences:{...p,[n]:void 0}}}}function f(e){const r=e?.panels??{};return Object.keys(r).reduce(((e,t)=>{const n=r[t];return!1===n?.enabled&&e.inactivePanels.push(t),!0===n?.opened&&e.openPanels.push(t),e}),{inactivePanels:[],openPanels:[]})}function l(e){if(e)return e=i(e,"core/edit-widgets"),e=i(e,"core/customize-widgets"),e=i(e,"core/edit-post"),e=d(e=function(e){const r="core/interface",t="core/preferences",n=e?.[r]?.enableItems;if(!n)return e;const o=e?.[t]?.preferences??{},s=n?.singleEnableItems?.complementaryArea??{},c=Object.keys(s).reduce(((e,r)=>{const t=s[r];return e?.[r]?.complementaryArea?e:{...e,[r]:{...e[r],complementaryArea:t}}}),o),i=n?.multipleEnableItems?.pinnedItems??{},a=Object.keys(i).reduce(((e,r)=>{const t=i[r];return e?.[r]?.pinnedItems?e:{...e,[r]:{...e[r],pinnedItems:t}}}),c),d=e[r];return{...e,[t]:{preferences:a},[r]:{...d,enableItems:void 0}}}(e=function(e){const r="core/interface",t="core/preferences",n=e?.[r]?.preferences?.features,o=n?Object.keys(n):[];return o?.length?o.reduce((function(e,o){if(o.startsWith("core"))return e;const s=n?.[o];if(!s)return e;const c=e?.[t]?.preferences?.[o];if(c)return e;const i=e?.[t]?.preferences,a=e?.[r],d=e?.[r]?.preferences?.features;return{...e,[t]:{preferences:{...i,[o]:s}},[r]:{...a,preferences:{features:{...d,[o]:void 0}}}}}),e):e}(e=i(e,"core/edit-site"))),{from:"core/edit-post",to:"core/edit-post"},"hiddenBlockTypes"),e=d(e,{from:"core/edit-post",to:"core/edit-post"},"editorMode"),e=d(e,{from:"core/edit-post",to:"core/edit-post"},"panels",f),e=d(e,{from:"core/editor",to:"core"},"isPublishSidebarEnabled"),e=d(e,{from:"core/edit-post",to:"core"},"isPublishSidebarEnabled"),e=d(e,{from:"core/edit-site",to:"core/edit-site"},"editorMode"),e?.["core/preferences"]?.preferences}function p(e){const r=function(e){const r=`WP_DATA_USER_${e}`,t=window.localStorage.getItem(r);return JSON.parse(t)}(e);return l(r)}function u(e){let r=(t=e,Object.keys(t).reduce(((e,r)=>{const n=t[r];if(n?.complementaryArea){const t={...n};return delete t.complementaryArea,t.isComplementaryAreaVisible=!0,e[r]=t,e}return e}),t));var t;return r=function(e){let r=e;return["allowRightClickOverrides","distractionFree","editorMode","fixedToolbar","focusMode","hiddenBlockTypes","inactivePanels","keepCaretInsideBlock","mostUsedBlocks","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","isPublishSidebarEnabled","isComplementaryAreaVisible","pinnedItems"].forEach((t=>{void 0!==e?.["core/edit-post"]?.[t]&&(r={...r,core:{...r?.core,[t]:e["core/edit-post"][t]}},delete r["core/edit-post"][t]),void 0!==e?.["core/edit-site"]?.[t]&&delete r["core/edit-site"][t]})),0===Object.keys(r?.["core/edit-post"]??{})?.length&&delete r["core/edit-post"],0===Object.keys(r?.["core/edit-site"]??{})?.length&&delete r["core/edit-site"],r}(r),r}function m(e,r){const t=`WP_PREFERENCES_USER_${r}`,n=JSON.parse(window.localStorage.getItem(t)),o=Date.parse(e&&e._modified)||0,s=Date.parse(n&&n._modified)||0;let i;return i=e&&o>=s?u(e):n?u(n):p(r),c({preloadedData:i,localStorageRestoreKey:t})}(window.wp=window.wp||{}).preferencesPersistence=r})(); api-fetch.js 0000644 00000037703 15121363536 0006761 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": () => (/* binding */ index_default)
});
;// external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/nonce.js
function createNonceMiddleware(nonce) {
const middleware = (options, next) => {
const { headers = {} } = options;
for (const headerName in headers) {
if (headerName.toLowerCase() === "x-wp-nonce" && headers[headerName] === middleware.nonce) {
return next(options);
}
}
return next({
...options,
headers: {
...headers,
"X-WP-Nonce": middleware.nonce
}
});
};
middleware.nonce = nonce;
return middleware;
}
var nonce_default = createNonceMiddleware;
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.js
const namespaceAndEndpointMiddleware = (options, next) => {
let path = options.path;
let namespaceTrimmed, endpointTrimmed;
if (typeof options.namespace === "string" && typeof options.endpoint === "string") {
namespaceTrimmed = options.namespace.replace(/^\/|\/$/g, "");
endpointTrimmed = options.endpoint.replace(/^\//, "");
if (endpointTrimmed) {
path = namespaceTrimmed + "/" + endpointTrimmed;
} else {
path = namespaceTrimmed;
}
}
delete options.namespace;
delete options.endpoint;
return next({
...options,
path
});
};
var namespace_endpoint_default = namespaceAndEndpointMiddleware;
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/root-url.js
const createRootURLMiddleware = (rootURL) => (options, next) => {
return namespace_endpoint_default(options, (optionsWithPath) => {
let url = optionsWithPath.url;
let path = optionsWithPath.path;
let apiRoot;
if (typeof path === "string") {
apiRoot = rootURL;
if (-1 !== rootURL.indexOf("?")) {
path = path.replace("?", "&");
}
path = path.replace(/^\//, "");
if ("string" === typeof apiRoot && -1 !== apiRoot.indexOf("?")) {
path = path.replace("?", "&");
}
url = apiRoot + path;
}
return next({
...optionsWithPath,
url
});
});
};
var root_url_default = createRootURLMiddleware;
;// external ["wp","url"]
const external_wp_url_namespaceObject = window["wp"]["url"];
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/preloading.js
function createPreloadingMiddleware(preloadedData) {
const cache = Object.fromEntries(
Object.entries(preloadedData).map(([path, data]) => [
(0,external_wp_url_namespaceObject.normalizePath)(path),
data
])
);
return (options, next) => {
const { parse = true } = options;
let rawPath = options.path;
if (!rawPath && options.url) {
const { rest_route: pathFromQuery, ...queryArgs } = (0,external_wp_url_namespaceObject.getQueryArgs)(
options.url
);
if (typeof pathFromQuery === "string") {
rawPath = (0,external_wp_url_namespaceObject.addQueryArgs)(pathFromQuery, queryArgs);
}
}
if (typeof rawPath !== "string") {
return next(options);
}
const method = options.method || "GET";
const path = (0,external_wp_url_namespaceObject.normalizePath)(rawPath);
if ("GET" === method && cache[path]) {
const cacheData = cache[path];
delete cache[path];
return prepareResponse(cacheData, !!parse);
} else if ("OPTIONS" === method && cache[method] && cache[method][path]) {
const cacheData = cache[method][path];
delete cache[method][path];
return prepareResponse(cacheData, !!parse);
}
return next(options);
};
}
function prepareResponse(responseData, parse) {
if (parse) {
return Promise.resolve(responseData.body);
}
try {
return Promise.resolve(
new window.Response(JSON.stringify(responseData.body), {
status: 200,
statusText: "OK",
headers: responseData.headers
})
);
} catch {
Object.entries(
responseData.headers
).forEach(([key, value]) => {
if (key.toLowerCase() === "link") {
responseData.headers[key] = value.replace(
/<([^>]+)>/,
(_, url) => `<${encodeURI(url)}>`
);
}
});
return Promise.resolve(
parse ? responseData.body : new window.Response(JSON.stringify(responseData.body), {
status: 200,
statusText: "OK",
headers: responseData.headers
})
);
}
}
var preloading_default = createPreloadingMiddleware;
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/fetch-all-middleware.js
const modifyQuery = ({ path, url, ...options }, queryArgs) => ({
...options,
url: url && (0,external_wp_url_namespaceObject.addQueryArgs)(url, queryArgs),
path: path && (0,external_wp_url_namespaceObject.addQueryArgs)(path, queryArgs)
});
const parseResponse = (response) => response.json ? response.json() : Promise.reject(response);
const parseLinkHeader = (linkHeader) => {
if (!linkHeader) {
return {};
}
const match = linkHeader.match(/<([^>]+)>; rel="next"/);
return match ? {
next: match[1]
} : {};
};
const getNextPageUrl = (response) => {
const { next } = parseLinkHeader(response.headers.get("link"));
return next;
};
const requestContainsUnboundedQuery = (options) => {
const pathIsUnbounded = !!options.path && options.path.indexOf("per_page=-1") !== -1;
const urlIsUnbounded = !!options.url && options.url.indexOf("per_page=-1") !== -1;
return pathIsUnbounded || urlIsUnbounded;
};
const fetchAllMiddleware = async (options, next) => {
if (options.parse === false) {
return next(options);
}
if (!requestContainsUnboundedQuery(options)) {
return next(options);
}
const response = await index_default({
...modifyQuery(options, {
per_page: 100
}),
// Ensure headers are returned for page 1.
parse: false
});
const results = await parseResponse(response);
if (!Array.isArray(results)) {
return results;
}
let nextPage = getNextPageUrl(response);
if (!nextPage) {
return results;
}
let mergedResults = [].concat(results);
while (nextPage) {
const nextResponse = await index_default({
...options,
// Ensure the URL for the next page is used instead of any provided path.
path: void 0,
url: nextPage,
// Ensure we still get headers so we can identify the next page.
parse: false
});
const nextResults = await parseResponse(nextResponse);
mergedResults = mergedResults.concat(nextResults);
nextPage = getNextPageUrl(nextResponse);
}
return mergedResults;
};
var fetch_all_middleware_default = fetchAllMiddleware;
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/http-v1.js
const OVERRIDE_METHODS = /* @__PURE__ */ new Set(["PATCH", "PUT", "DELETE"]);
const DEFAULT_METHOD = "GET";
const httpV1Middleware = (options, next) => {
const { method = DEFAULT_METHOD } = options;
if (OVERRIDE_METHODS.has(method.toUpperCase())) {
options = {
...options,
headers: {
...options.headers,
"X-HTTP-Method-Override": method,
"Content-Type": "application/json"
},
method: "POST"
};
}
return next(options);
};
var http_v1_default = httpV1Middleware;
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/user-locale.js
const userLocaleMiddleware = (options, next) => {
if (typeof options.url === "string" && !(0,external_wp_url_namespaceObject.hasQueryArg)(options.url, "_locale")) {
options.url = (0,external_wp_url_namespaceObject.addQueryArgs)(options.url, { _locale: "user" });
}
if (typeof options.path === "string" && !(0,external_wp_url_namespaceObject.hasQueryArg)(options.path, "_locale")) {
options.path = (0,external_wp_url_namespaceObject.addQueryArgs)(options.path, { _locale: "user" });
}
return next(options);
};
var user_locale_default = userLocaleMiddleware;
;// ./node_modules/@wordpress/api-fetch/build-module/utils/response.js
async function parseJsonAndNormalizeError(response) {
try {
return await response.json();
} catch {
throw {
code: "invalid_json",
message: (0,external_wp_i18n_namespaceObject.__)("The response is not a valid JSON response.")
};
}
}
async function parseResponseAndNormalizeError(response, shouldParseResponse = true) {
if (!shouldParseResponse) {
return response;
}
if (response.status === 204) {
return null;
}
return await parseJsonAndNormalizeError(response);
}
async function parseAndThrowError(response, shouldParseResponse = true) {
if (!shouldParseResponse) {
throw response;
}
throw await parseJsonAndNormalizeError(response);
}
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/media-upload.js
function isMediaUploadRequest(options) {
const isCreateMethod = !!options.method && options.method === "POST";
const isMediaEndpoint = !!options.path && options.path.indexOf("/wp/v2/media") !== -1 || !!options.url && options.url.indexOf("/wp/v2/media") !== -1;
return isMediaEndpoint && isCreateMethod;
}
const mediaUploadMiddleware = (options, next) => {
if (!isMediaUploadRequest(options)) {
return next(options);
}
let retries = 0;
const maxRetries = 5;
const postProcess = (attachmentId) => {
retries++;
return next({
path: `/wp/v2/media/${attachmentId}/post-process`,
method: "POST",
data: { action: "create-image-subsizes" },
parse: false
}).catch(() => {
if (retries < maxRetries) {
return postProcess(attachmentId);
}
next({
path: `/wp/v2/media/${attachmentId}?force=true`,
method: "DELETE"
});
return Promise.reject();
});
};
return next({ ...options, parse: false }).catch((response) => {
if (!(response instanceof globalThis.Response)) {
return Promise.reject(response);
}
const attachmentId = response.headers.get(
"x-wp-upload-attachment-id"
);
if (response.status >= 500 && response.status < 600 && attachmentId) {
return postProcess(attachmentId).catch(() => {
if (options.parse !== false) {
return Promise.reject({
code: "post_process",
message: (0,external_wp_i18n_namespaceObject.__)(
"Media upload failed. If this is a photo or a large image, please scale it down and try again."
)
});
}
return Promise.reject(response);
});
}
return parseAndThrowError(response, options.parse);
}).then(
(response) => parseResponseAndNormalizeError(response, options.parse)
);
};
var media_upload_default = mediaUploadMiddleware;
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/theme-preview.js
const createThemePreviewMiddleware = (themePath) => (options, next) => {
if (typeof options.url === "string") {
const wpThemePreview = (0,external_wp_url_namespaceObject.getQueryArg)(
options.url,
"wp_theme_preview"
);
if (wpThemePreview === void 0) {
options.url = (0,external_wp_url_namespaceObject.addQueryArgs)(options.url, {
wp_theme_preview: themePath
});
} else if (wpThemePreview === "") {
options.url = (0,external_wp_url_namespaceObject.removeQueryArgs)(
options.url,
"wp_theme_preview"
);
}
}
if (typeof options.path === "string") {
const wpThemePreview = (0,external_wp_url_namespaceObject.getQueryArg)(
options.path,
"wp_theme_preview"
);
if (wpThemePreview === void 0) {
options.path = (0,external_wp_url_namespaceObject.addQueryArgs)(options.path, {
wp_theme_preview: themePath
});
} else if (wpThemePreview === "") {
options.path = (0,external_wp_url_namespaceObject.removeQueryArgs)(
options.path,
"wp_theme_preview"
);
}
}
return next(options);
};
var theme_preview_default = createThemePreviewMiddleware;
;// ./node_modules/@wordpress/api-fetch/build-module/index.js
const DEFAULT_HEADERS = {
// The backend uses the Accept header as a condition for considering an
// incoming request as a REST request.
//
// See: https://core.trac.wordpress.org/ticket/44534
Accept: "application/json, */*;q=0.1"
};
const DEFAULT_OPTIONS = {
credentials: "include"
};
const middlewares = [
user_locale_default,
namespace_endpoint_default,
http_v1_default,
fetch_all_middleware_default
];
function registerMiddleware(middleware) {
middlewares.unshift(middleware);
}
const defaultFetchHandler = (nextOptions) => {
const { url, path, data, parse = true, ...remainingOptions } = nextOptions;
let { body, headers } = nextOptions;
headers = { ...DEFAULT_HEADERS, ...headers };
if (data) {
body = JSON.stringify(data);
headers["Content-Type"] = "application/json";
}
const responsePromise = globalThis.fetch(
// Fall back to explicitly passing `window.location` which is the behavior if `undefined` is passed.
url || path || window.location.href,
{
...DEFAULT_OPTIONS,
...remainingOptions,
body,
headers
}
);
return responsePromise.then(
(response) => {
if (!response.ok) {
return parseAndThrowError(response, parse);
}
return parseResponseAndNormalizeError(response, parse);
},
(err) => {
if (err && err.name === "AbortError") {
throw err;
}
if (!globalThis.navigator.onLine) {
throw {
code: "offline_error",
message: (0,external_wp_i18n_namespaceObject.__)(
"Unable to connect. Please check your Internet connection."
)
};
}
throw {
code: "fetch_error",
message: (0,external_wp_i18n_namespaceObject.__)(
"Could not get a valid response from the server."
)
};
}
);
};
let fetchHandler = defaultFetchHandler;
function setFetchHandler(newFetchHandler) {
fetchHandler = newFetchHandler;
}
const apiFetch = (options) => {
const enhancedHandler = middlewares.reduceRight(
(next, middleware) => {
return (workingOptions) => middleware(workingOptions, next);
},
fetchHandler
);
return enhancedHandler(options).catch((error) => {
if (error.code !== "rest_cookie_invalid_nonce") {
return Promise.reject(error);
}
return globalThis.fetch(apiFetch.nonceEndpoint).then((response) => {
if (!response.ok) {
return Promise.reject(error);
}
return response.text();
}).then((text) => {
apiFetch.nonceMiddleware.nonce = text;
return apiFetch(options);
});
});
};
apiFetch.use = registerMiddleware;
apiFetch.setFetchHandler = setFetchHandler;
apiFetch.createNonceMiddleware = nonce_default;
apiFetch.createPreloadingMiddleware = preloading_default;
apiFetch.createRootURLMiddleware = root_url_default;
apiFetch.fetchAllMiddleware = fetch_all_middleware_default;
apiFetch.mediaUploadMiddleware = media_upload_default;
apiFetch.createThemePreviewMiddleware = theme_preview_default;
var index_default = apiFetch;
(window.wp = window.wp || {}).apiFetch = __webpack_exports__["default"];
/******/ })()
; components.js 0000644 00011425477 15121363536 0007321 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 66:
/***/ ((module) => {
"use strict";
var isMergeableObject = function isMergeableObject(value) {
return isNonNullObject(value)
&& !isSpecial(value)
};
function isNonNullObject(value) {
return !!value && typeof value === 'object'
}
function isSpecial(value) {
var stringValue = Object.prototype.toString.call(value);
return stringValue === '[object RegExp]'
|| stringValue === '[object Date]'
|| isReactElement(value)
}
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
function isReactElement(value) {
return value.$$typeof === REACT_ELEMENT_TYPE
}
function emptyTarget(val) {
return Array.isArray(val) ? [] : {}
}
function cloneUnlessOtherwiseSpecified(value, options) {
return (options.clone !== false && options.isMergeableObject(value))
? deepmerge(emptyTarget(value), value, options)
: value
}
function defaultArrayMerge(target, source, options) {
return target.concat(source).map(function(element) {
return cloneUnlessOtherwiseSpecified(element, options)
})
}
function getMergeFunction(key, options) {
if (!options.customMerge) {
return deepmerge
}
var customMerge = options.customMerge(key);
return typeof customMerge === 'function' ? customMerge : deepmerge
}
function getEnumerableOwnPropertySymbols(target) {
return Object.getOwnPropertySymbols
? Object.getOwnPropertySymbols(target).filter(function(symbol) {
return Object.propertyIsEnumerable.call(target, symbol)
})
: []
}
function getKeys(target) {
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
}
function propertyIsOnObject(object, property) {
try {
return property in object
} catch(_) {
return false
}
}
// Protects from prototype poisoning and unexpected merging up the prototype chain.
function propertyIsUnsafe(target, key) {
return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
}
function mergeObject(target, source, options) {
var destination = {};
if (options.isMergeableObject(target)) {
getKeys(target).forEach(function(key) {
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
});
}
getKeys(source).forEach(function(key) {
if (propertyIsUnsafe(target, key)) {
return
}
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
} else {
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
}
});
return destination
}
function deepmerge(target, source, options) {
options = options || {};
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
// implementations can use it. The caller may not replace it.
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
var sourceIsArray = Array.isArray(source);
var targetIsArray = Array.isArray(target);
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
if (!sourceAndTargetTypesMatch) {
return cloneUnlessOtherwiseSpecified(source, options)
} else if (sourceIsArray) {
return options.arrayMerge(target, source, options)
} else {
return mergeObject(target, source, options)
}
}
deepmerge.all = function deepmergeAll(array, options) {
if (!Array.isArray(array)) {
throw new Error('first argument should be an array')
}
return array.reduce(function(prev, next) {
return deepmerge(prev, next, options)
}, {})
};
var deepmerge_1 = deepmerge;
module.exports = deepmerge_1;
/***/ }),
/***/ 83:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var React = __webpack_require__(1609);
function is(x, y) {
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
}
var objectIs = "function" === typeof Object.is ? Object.is : is,
useState = React.useState,
useEffect = React.useEffect,
useLayoutEffect = React.useLayoutEffect,
useDebugValue = React.useDebugValue;
function useSyncExternalStore$2(subscribe, getSnapshot) {
var value = getSnapshot(),
_useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),
inst = _useState[0].inst,
forceUpdate = _useState[1];
useLayoutEffect(
function () {
inst.value = value;
inst.getSnapshot = getSnapshot;
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
},
[subscribe, value, getSnapshot]
);
useEffect(
function () {
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
return subscribe(function () {
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
});
},
[subscribe]
);
useDebugValue(value);
return value;
}
function checkIfSnapshotChanged(inst) {
var latestGetSnapshot = inst.getSnapshot;
inst = inst.value;
try {
var nextValue = latestGetSnapshot();
return !objectIs(inst, nextValue);
} catch (error) {
return !0;
}
}
function useSyncExternalStore$1(subscribe, getSnapshot) {
return getSnapshot();
}
var shim =
"undefined" === typeof window ||
"undefined" === typeof window.document ||
"undefined" === typeof window.document.createElement
? useSyncExternalStore$1
: useSyncExternalStore$2;
exports.useSyncExternalStore =
void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
/***/ }),
/***/ 422:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
if (true) {
module.exports = __webpack_require__(83);
} else {}
/***/ }),
/***/ 1178:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
if (true) {
module.exports = __webpack_require__(2950);
} else {}
/***/ }),
/***/ 1609:
/***/ ((module) => {
"use strict";
module.exports = window["React"];
/***/ }),
/***/ 1880:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var reactIs = __webpack_require__(1178);
/**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
var REACT_STATICS = {
childContextTypes: true,
contextType: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
getDerivedStateFromError: true,
getDerivedStateFromProps: true,
mixins: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
callee: true,
arguments: true,
arity: true
};
var FORWARD_REF_STATICS = {
'$$typeof': true,
render: true,
defaultProps: true,
displayName: true,
propTypes: true
};
var MEMO_STATICS = {
'$$typeof': true,
compare: true,
defaultProps: true,
displayName: true,
propTypes: true,
type: true
};
var TYPE_STATICS = {};
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
function getStatics(component) {
// React v16.11 and below
if (reactIs.isMemo(component)) {
return MEMO_STATICS;
} // React v16.12 and above
return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
}
var defineProperty = Object.defineProperty;
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var getPrototypeOf = Object.getPrototypeOf;
var objectPrototype = Object.prototype;
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
if (typeof sourceComponent !== 'string') {
// don't hoist over string (html) components
if (objectPrototype) {
var inheritedComponent = getPrototypeOf(sourceComponent);
if (inheritedComponent && inheritedComponent !== objectPrototype) {
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
}
}
var keys = getOwnPropertyNames(sourceComponent);
if (getOwnPropertySymbols) {
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
}
var targetStatics = getStatics(targetComponent);
var sourceStatics = getStatics(sourceComponent);
for (var i = 0; i < keys.length; ++i) {
var key = keys[i];
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
try {
// Avoid failures from read-only properties
defineProperty(targetComponent, key, descriptor);
} catch (e) {}
}
}
}
return targetComponent;
}
module.exports = hoistNonReactStatics;
/***/ }),
/***/ 2950:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;
exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};
exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};
exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;
/***/ }),
/***/ 7734:
/***/ ((module) => {
"use strict";
// do not edit .js files directly - edit src/index.jst
var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';
module.exports = function equal(a, b) {
if (a === b) return true;
if (a && b && typeof a == 'object' && typeof b == 'object') {
if (a.constructor !== b.constructor) return false;
var length, i, keys;
if (Array.isArray(a)) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0;)
if (!equal(a[i], b[i])) return false;
return true;
}
if ((a instanceof Map) && (b instanceof Map)) {
if (a.size !== b.size) return false;
for (i of a.entries())
if (!b.has(i[0])) return false;
for (i of a.entries())
if (!equal(i[1], b.get(i[0]))) return false;
return true;
}
if ((a instanceof Set) && (b instanceof Set)) {
if (a.size !== b.size) return false;
for (i of a.entries())
if (!b.has(i[0])) return false;
return true;
}
if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0;)
if (a[i] !== b[i]) return false;
return true;
}
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
keys = Object.keys(a);
length = keys.length;
if (length !== Object.keys(b).length) return false;
for (i = length; i-- !== 0;)
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
for (i = length; i-- !== 0;) {
var key = keys[i];
if (!equal(a[key], b[key])) return false;
}
return true;
}
// true if both NaN, false otherwise
return a!==a && b!==b;
};
/***/ }),
/***/ 8924:
/***/ ((__unused_webpack_module, exports) => {
// Copyright (c) 2014 Rafael Caricio. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var GradientParser = (GradientParser || {});
GradientParser.stringify = (function() {
var visitor = {
'visit_linear-gradient': function(node) {
return visitor.visit_gradient(node);
},
'visit_repeating-linear-gradient': function(node) {
return visitor.visit_gradient(node);
},
'visit_radial-gradient': function(node) {
return visitor.visit_gradient(node);
},
'visit_repeating-radial-gradient': function(node) {
return visitor.visit_gradient(node);
},
'visit_gradient': function(node) {
var orientation = visitor.visit(node.orientation);
if (orientation) {
orientation += ', ';
}
return node.type + '(' + orientation + visitor.visit(node.colorStops) + ')';
},
'visit_shape': function(node) {
var result = node.value,
at = visitor.visit(node.at),
style = visitor.visit(node.style);
if (style) {
result += ' ' + style;
}
if (at) {
result += ' at ' + at;
}
return result;
},
'visit_default-radial': function(node) {
var result = '',
at = visitor.visit(node.at);
if (at) {
result += at;
}
return result;
},
'visit_extent-keyword': function(node) {
var result = node.value,
at = visitor.visit(node.at);
if (at) {
result += ' at ' + at;
}
return result;
},
'visit_position-keyword': function(node) {
return node.value;
},
'visit_position': function(node) {
return visitor.visit(node.value.x) + ' ' + visitor.visit(node.value.y);
},
'visit_%': function(node) {
return node.value + '%';
},
'visit_em': function(node) {
return node.value + 'em';
},
'visit_px': function(node) {
return node.value + 'px';
},
'visit_calc': function(node) {
return 'calc(' + node.value + ')';
},
'visit_literal': function(node) {
return visitor.visit_color(node.value, node);
},
'visit_hex': function(node) {
return visitor.visit_color('#' + node.value, node);
},
'visit_rgb': function(node) {
return visitor.visit_color('rgb(' + node.value.join(', ') + ')', node);
},
'visit_rgba': function(node) {
return visitor.visit_color('rgba(' + node.value.join(', ') + ')', node);
},
'visit_hsl': function(node) {
return visitor.visit_color('hsl(' + node.value[0] + ', ' + node.value[1] + '%, ' + node.value[2] + '%)', node);
},
'visit_hsla': function(node) {
return visitor.visit_color('hsla(' + node.value[0] + ', ' + node.value[1] + '%, ' + node.value[2] + '%, ' + node.value[3] + ')', node);
},
'visit_var': function(node) {
return visitor.visit_color('var(' + node.value + ')', node);
},
'visit_color': function(resultColor, node) {
var result = resultColor,
length = visitor.visit(node.length);
if (length) {
result += ' ' + length;
}
return result;
},
'visit_angular': function(node) {
return node.value + 'deg';
},
'visit_directional': function(node) {
return 'to ' + node.value;
},
'visit_array': function(elements) {
var result = '',
size = elements.length;
elements.forEach(function(element, i) {
result += visitor.visit(element);
if (i < size - 1) {
result += ', ';
}
});
return result;
},
'visit_object': function(obj) {
if (obj.width && obj.height) {
return visitor.visit(obj.width) + ' ' + visitor.visit(obj.height);
}
return '';
},
'visit': function(element) {
if (!element) {
return '';
}
var result = '';
if (element instanceof Array) {
return visitor.visit_array(element);
} else if (typeof element === 'object' && !element.type) {
return visitor.visit_object(element);
} else if (element.type) {
var nodeVisitor = visitor['visit_' + element.type];
if (nodeVisitor) {
return nodeVisitor(element);
} else {
throw Error('Missing visitor visit_' + element.type);
}
} else {
throw Error('Invalid node.');
}
}
};
return function(root) {
return visitor.visit(root);
};
})();
// Copyright (c) 2014 Rafael Caricio. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var GradientParser = (GradientParser || {});
GradientParser.parse = (function() {
var tokens = {
linearGradient: /^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,
repeatingLinearGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,
radialGradient: /^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,
repeatingRadialGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,
sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,
extentKeywords: /^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,
positionKeywords: /^(left|center|right|top|bottom)/i,
pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,
percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,
emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,
angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,
radianValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))rad/,
startCall: /^\(/,
endCall: /^\)/,
comma: /^,/,
hexColor: /^\#([0-9a-fA-F]+)/,
literalColor: /^([a-zA-Z]+)/,
rgbColor: /^rgb/i,
rgbaColor: /^rgba/i,
varColor: /^var/i,
calcValue: /^calc/i,
variableName: /^(--[a-zA-Z0-9-,\s\#]+)/,
number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,
hslColor: /^hsl/i,
hslaColor: /^hsla/i,
};
var input = '';
function error(msg) {
var err = new Error(input + ': ' + msg);
err.source = input;
throw err;
}
function getAST() {
var ast = matchListDefinitions();
if (input.length > 0) {
error('Invalid input not EOF');
}
return ast;
}
function matchListDefinitions() {
return matchListing(matchDefinition);
}
function matchDefinition() {
return matchGradient(
'linear-gradient',
tokens.linearGradient,
matchLinearOrientation) ||
matchGradient(
'repeating-linear-gradient',
tokens.repeatingLinearGradient,
matchLinearOrientation) ||
matchGradient(
'radial-gradient',
tokens.radialGradient,
matchListRadialOrientations) ||
matchGradient(
'repeating-radial-gradient',
tokens.repeatingRadialGradient,
matchListRadialOrientations);
}
function matchGradient(gradientType, pattern, orientationMatcher) {
return matchCall(pattern, function(captures) {
var orientation = orientationMatcher();
if (orientation) {
if (!scan(tokens.comma)) {
error('Missing comma before color stops');
}
}
return {
type: gradientType,
orientation: orientation,
colorStops: matchListing(matchColorStop)
};
});
}
function matchCall(pattern, callback) {
var captures = scan(pattern);
if (captures) {
if (!scan(tokens.startCall)) {
error('Missing (');
}
var result = callback(captures);
if (!scan(tokens.endCall)) {
error('Missing )');
}
return result;
}
}
function matchLinearOrientation() {
// Check for standard CSS3 "to" direction
var sideOrCorner = matchSideOrCorner();
if (sideOrCorner) {
return sideOrCorner;
}
// Check for legacy single keyword direction (e.g., "right", "top")
var legacyDirection = match('position-keyword', tokens.positionKeywords, 1);
if (legacyDirection) {
// For legacy syntax, we convert to the directional type
return {
type: 'directional',
value: legacyDirection.value
};
}
// If neither, check for angle
return matchAngle();
}
function matchSideOrCorner() {
return match('directional', tokens.sideOrCorner, 1);
}
function matchAngle() {
return match('angular', tokens.angleValue, 1) ||
match('angular', tokens.radianValue, 1);
}
function matchListRadialOrientations() {
var radialOrientations,
radialOrientation = matchRadialOrientation(),
lookaheadCache;
if (radialOrientation) {
radialOrientations = [];
radialOrientations.push(radialOrientation);
lookaheadCache = input;
if (scan(tokens.comma)) {
radialOrientation = matchRadialOrientation();
if (radialOrientation) {
radialOrientations.push(radialOrientation);
} else {
input = lookaheadCache;
}
}
}
return radialOrientations;
}
function matchRadialOrientation() {
var radialType = matchCircle() ||
matchEllipse();
if (radialType) {
radialType.at = matchAtPosition();
} else {
var extent = matchExtentKeyword();
if (extent) {
radialType = extent;
var positionAt = matchAtPosition();
if (positionAt) {
radialType.at = positionAt;
}
} else {
// Check for "at" position first, which is a common browser output format
var atPosition = matchAtPosition();
if (atPosition) {
radialType = {
type: 'default-radial',
at: atPosition
};
} else {
var defaultPosition = matchPositioning();
if (defaultPosition) {
radialType = {
type: 'default-radial',
at: defaultPosition
};
}
}
}
}
return radialType;
}
function matchCircle() {
var circle = match('shape', /^(circle)/i, 0);
if (circle) {
circle.style = matchLength() || matchExtentKeyword();
}
return circle;
}
function matchEllipse() {
var ellipse = match('shape', /^(ellipse)/i, 0);
if (ellipse) {
ellipse.style = matchPositioning() || matchDistance() || matchExtentKeyword();
}
return ellipse;
}
function matchExtentKeyword() {
return match('extent-keyword', tokens.extentKeywords, 1);
}
function matchAtPosition() {
if (match('position', /^at/, 0)) {
var positioning = matchPositioning();
if (!positioning) {
error('Missing positioning value');
}
return positioning;
}
}
function matchPositioning() {
var location = matchCoordinates();
if (location.x || location.y) {
return {
type: 'position',
value: location
};
}
}
function matchCoordinates() {
return {
x: matchDistance(),
y: matchDistance()
};
}
function matchListing(matcher) {
var captures = matcher(),
result = [];
if (captures) {
result.push(captures);
while (scan(tokens.comma)) {
captures = matcher();
if (captures) {
result.push(captures);
} else {
error('One extra comma');
}
}
}
return result;
}
function matchColorStop() {
var color = matchColor();
if (!color) {
error('Expected color definition');
}
color.length = matchDistance();
return color;
}
function matchColor() {
return matchHexColor() ||
matchHSLAColor() ||
matchHSLColor() ||
matchRGBAColor() ||
matchRGBColor() ||
matchVarColor() ||
matchLiteralColor();
}
function matchLiteralColor() {
return match('literal', tokens.literalColor, 0);
}
function matchHexColor() {
return match('hex', tokens.hexColor, 1);
}
function matchRGBColor() {
return matchCall(tokens.rgbColor, function() {
return {
type: 'rgb',
value: matchListing(matchNumber)
};
});
}
function matchRGBAColor() {
return matchCall(tokens.rgbaColor, function() {
return {
type: 'rgba',
value: matchListing(matchNumber)
};
});
}
function matchVarColor() {
return matchCall(tokens.varColor, function () {
return {
type: 'var',
value: matchVariableName()
};
});
}
function matchHSLColor() {
return matchCall(tokens.hslColor, function() {
// Check for percentage before trying to parse the hue
var lookahead = scan(tokens.percentageValue);
if (lookahead) {
error('HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage');
}
var hue = matchNumber();
scan(tokens.comma);
var captures = scan(tokens.percentageValue);
var sat = captures ? captures[1] : null;
scan(tokens.comma);
captures = scan(tokens.percentageValue);
var light = captures ? captures[1] : null;
if (!sat || !light) {
error('Expected percentage value for saturation and lightness in HSL');
}
return {
type: 'hsl',
value: [hue, sat, light]
};
});
}
function matchHSLAColor() {
return matchCall(tokens.hslaColor, function() {
var hue = matchNumber();
scan(tokens.comma);
var captures = scan(tokens.percentageValue);
var sat = captures ? captures[1] : null;
scan(tokens.comma);
captures = scan(tokens.percentageValue);
var light = captures ? captures[1] : null;
scan(tokens.comma);
var alpha = matchNumber();
if (!sat || !light) {
error('Expected percentage value for saturation and lightness in HSLA');
}
return {
type: 'hsla',
value: [hue, sat, light, alpha]
};
});
}
function matchPercentage() {
var captures = scan(tokens.percentageValue);
return captures ? captures[1] : null;
}
function matchVariableName() {
return scan(tokens.variableName)[1];
}
function matchNumber() {
return scan(tokens.number)[1];
}
function matchDistance() {
return match('%', tokens.percentageValue, 1) ||
matchPositionKeyword() ||
matchCalc() ||
matchLength();
}
function matchPositionKeyword() {
return match('position-keyword', tokens.positionKeywords, 1);
}
function matchCalc() {
return matchCall(tokens.calcValue, function() {
var openParenCount = 1; // Start with the opening parenthesis from calc(
var i = 0;
// Parse through the content looking for balanced parentheses
while (openParenCount > 0 && i < input.length) {
var char = input.charAt(i);
if (char === '(') {
openParenCount++;
} else if (char === ')') {
openParenCount--;
}
i++;
}
// If we exited because we ran out of input but still have open parentheses, error
if (openParenCount > 0) {
error('Missing closing parenthesis in calc() expression');
}
// Get the content inside the calc() without the last closing paren
var calcContent = input.substring(0, i - 1);
// Consume the calc expression content
consume(i - 1); // -1 because we don't want to consume the closing parenthesis
return {
type: 'calc',
value: calcContent
};
});
}
function matchLength() {
return match('px', tokens.pixelValue, 1) ||
match('em', tokens.emValue, 1);
}
function match(type, pattern, captureIndex) {
var captures = scan(pattern);
if (captures) {
return {
type: type,
value: captures[captureIndex]
};
}
}
function scan(regexp) {
var captures,
blankCaptures;
blankCaptures = /^[\n\r\t\s]+/.exec(input);
if (blankCaptures) {
consume(blankCaptures[0].length);
}
captures = regexp.exec(input);
if (captures) {
consume(captures[0].length);
}
return captures;
}
function consume(size) {
input = input.substr(size);
}
return function(code) {
input = code.toString().trim();
// Remove trailing semicolon if present
if (input.endsWith(';')) {
input = input.slice(0, -1);
}
return getAST();
};
})();
exports.parse = GradientParser.parse;
exports.stringify = GradientParser.stringify;
/***/ }),
/***/ 9664:
/***/ ((module) => {
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __nested_webpack_require_187__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_187__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __nested_webpack_require_187__.m = modules;
/******/
/******/ // expose the module cache
/******/ __nested_webpack_require_187__.c = installedModules;
/******/
/******/ // __webpack_public_path__
/******/ __nested_webpack_require_187__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __nested_webpack_require_187__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __nested_webpack_require_1468__) {
module.exports = __nested_webpack_require_1468__(1);
/***/ }),
/* 1 */
/***/ (function(module, exports, __nested_webpack_require_1587__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _utils = __nested_webpack_require_1587__(2);
Object.defineProperty(exports, 'combineChunks', {
enumerable: true,
get: function get() {
return _utils.combineChunks;
}
});
Object.defineProperty(exports, 'fillInChunks', {
enumerable: true,
get: function get() {
return _utils.fillInChunks;
}
});
Object.defineProperty(exports, 'findAll', {
enumerable: true,
get: function get() {
return _utils.findAll;
}
});
Object.defineProperty(exports, 'findChunks', {
enumerable: true,
get: function get() {
return _utils.findChunks;
}
});
/***/ }),
/* 2 */
/***/ (function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* Creates an array of chunk objects representing both higlightable and non highlightable pieces of text that match each search word.
* @return Array of "chunks" (where a Chunk is { start:number, end:number, highlight:boolean })
*/
var findAll = exports.findAll = function findAll(_ref) {
var autoEscape = _ref.autoEscape,
_ref$caseSensitive = _ref.caseSensitive,
caseSensitive = _ref$caseSensitive === undefined ? false : _ref$caseSensitive,
_ref$findChunks = _ref.findChunks,
findChunks = _ref$findChunks === undefined ? defaultFindChunks : _ref$findChunks,
sanitize = _ref.sanitize,
searchWords = _ref.searchWords,
textToHighlight = _ref.textToHighlight;
return fillInChunks({
chunksToHighlight: combineChunks({
chunks: findChunks({
autoEscape: autoEscape,
caseSensitive: caseSensitive,
sanitize: sanitize,
searchWords: searchWords,
textToHighlight: textToHighlight
})
}),
totalLength: textToHighlight ? textToHighlight.length : 0
});
};
/**
* Takes an array of {start:number, end:number} objects and combines chunks that overlap into single chunks.
* @return {start:number, end:number}[]
*/
var combineChunks = exports.combineChunks = function combineChunks(_ref2) {
var chunks = _ref2.chunks;
chunks = chunks.sort(function (first, second) {
return first.start - second.start;
}).reduce(function (processedChunks, nextChunk) {
// First chunk just goes straight in the array...
if (processedChunks.length === 0) {
return [nextChunk];
} else {
// ... subsequent chunks get checked to see if they overlap...
var prevChunk = processedChunks.pop();
if (nextChunk.start <= prevChunk.end) {
// It may be the case that prevChunk completely surrounds nextChunk, so take the
// largest of the end indeces.
var endIndex = Math.max(prevChunk.end, nextChunk.end);
processedChunks.push({ highlight: false, start: prevChunk.start, end: endIndex });
} else {
processedChunks.push(prevChunk, nextChunk);
}
return processedChunks;
}
}, []);
return chunks;
};
/**
* Examine text for any matches.
* If we find matches, add them to the returned array as a "chunk" object ({start:number, end:number}).
* @return {start:number, end:number}[]
*/
var defaultFindChunks = function defaultFindChunks(_ref3) {
var autoEscape = _ref3.autoEscape,
caseSensitive = _ref3.caseSensitive,
_ref3$sanitize = _ref3.sanitize,
sanitize = _ref3$sanitize === undefined ? defaultSanitize : _ref3$sanitize,
searchWords = _ref3.searchWords,
textToHighlight = _ref3.textToHighlight;
textToHighlight = sanitize(textToHighlight);
return searchWords.filter(function (searchWord) {
return searchWord;
}) // Remove empty words
.reduce(function (chunks, searchWord) {
searchWord = sanitize(searchWord);
if (autoEscape) {
searchWord = escapeRegExpFn(searchWord);
}
var regex = new RegExp(searchWord, caseSensitive ? 'g' : 'gi');
var match = void 0;
while (match = regex.exec(textToHighlight)) {
var _start = match.index;
var _end = regex.lastIndex;
// We do not return zero-length matches
if (_end > _start) {
chunks.push({ highlight: false, start: _start, end: _end });
}
// Prevent browsers like Firefox from getting stuck in an infinite loop
// See http://www.regexguru.com/2008/04/watch-out-for-zero-length-matches/
if (match.index === regex.lastIndex) {
regex.lastIndex++;
}
}
return chunks;
}, []);
};
// Allow the findChunks to be overridden in findAll,
// but for backwards compatibility we export as the old name
exports.findChunks = defaultFindChunks;
/**
* Given a set of chunks to highlight, create an additional set of chunks
* to represent the bits of text between the highlighted text.
* @param chunksToHighlight {start:number, end:number}[]
* @param totalLength number
* @return {start:number, end:number, highlight:boolean}[]
*/
var fillInChunks = exports.fillInChunks = function fillInChunks(_ref4) {
var chunksToHighlight = _ref4.chunksToHighlight,
totalLength = _ref4.totalLength;
var allChunks = [];
var append = function append(start, end, highlight) {
if (end - start > 0) {
allChunks.push({
start: start,
end: end,
highlight: highlight
});
}
};
if (chunksToHighlight.length === 0) {
append(0, totalLength, false);
} else {
var lastIndex = 0;
chunksToHighlight.forEach(function (chunk) {
append(lastIndex, chunk.start, false);
append(chunk.start, chunk.end, true);
lastIndex = chunk.end;
});
append(lastIndex, totalLength, false);
}
return allChunks;
};
function defaultSanitize(string) {
return string;
}
function escapeRegExpFn(string) {
return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
}
/***/ })
/******/ ]);
/***/ }),
/***/ 9681:
/***/ ((module) => {
var characterMap = {
"À": "A",
"Á": "A",
"Â": "A",
"Ã": "A",
"Ä": "A",
"Å": "A",
"Ấ": "A",
"Ắ": "A",
"Ẳ": "A",
"Ẵ": "A",
"Ặ": "A",
"Æ": "AE",
"Ầ": "A",
"Ằ": "A",
"Ȃ": "A",
"Ả": "A",
"Ạ": "A",
"Ẩ": "A",
"Ẫ": "A",
"Ậ": "A",
"Ç": "C",
"Ḉ": "C",
"È": "E",
"É": "E",
"Ê": "E",
"Ë": "E",
"Ế": "E",
"Ḗ": "E",
"Ề": "E",
"Ḕ": "E",
"Ḝ": "E",
"Ȇ": "E",
"Ẻ": "E",
"Ẽ": "E",
"Ẹ": "E",
"Ể": "E",
"Ễ": "E",
"Ệ": "E",
"Ì": "I",
"Í": "I",
"Î": "I",
"Ï": "I",
"Ḯ": "I",
"Ȋ": "I",
"Ỉ": "I",
"Ị": "I",
"Ð": "D",
"Ñ": "N",
"Ò": "O",
"Ó": "O",
"Ô": "O",
"Õ": "O",
"Ö": "O",
"Ø": "O",
"Ố": "O",
"Ṍ": "O",
"Ṓ": "O",
"Ȏ": "O",
"Ỏ": "O",
"Ọ": "O",
"Ổ": "O",
"Ỗ": "O",
"Ộ": "O",
"Ờ": "O",
"Ở": "O",
"Ỡ": "O",
"Ớ": "O",
"Ợ": "O",
"Ù": "U",
"Ú": "U",
"Û": "U",
"Ü": "U",
"Ủ": "U",
"Ụ": "U",
"Ử": "U",
"Ữ": "U",
"Ự": "U",
"Ý": "Y",
"à": "a",
"á": "a",
"â": "a",
"ã": "a",
"ä": "a",
"å": "a",
"ấ": "a",
"ắ": "a",
"ẳ": "a",
"ẵ": "a",
"ặ": "a",
"æ": "ae",
"ầ": "a",
"ằ": "a",
"ȃ": "a",
"ả": "a",
"ạ": "a",
"ẩ": "a",
"ẫ": "a",
"ậ": "a",
"ç": "c",
"ḉ": "c",
"è": "e",
"é": "e",
"ê": "e",
"ë": "e",
"ế": "e",
"ḗ": "e",
"ề": "e",
"ḕ": "e",
"ḝ": "e",
"ȇ": "e",
"ẻ": "e",
"ẽ": "e",
"ẹ": "e",
"ể": "e",
"ễ": "e",
"ệ": "e",
"ì": "i",
"í": "i",
"î": "i",
"ï": "i",
"ḯ": "i",
"ȋ": "i",
"ỉ": "i",
"ị": "i",
"ð": "d",
"ñ": "n",
"ò": "o",
"ó": "o",
"ô": "o",
"õ": "o",
"ö": "o",
"ø": "o",
"ố": "o",
"ṍ": "o",
"ṓ": "o",
"ȏ": "o",
"ỏ": "o",
"ọ": "o",
"ổ": "o",
"ỗ": "o",
"ộ": "o",
"ờ": "o",
"ở": "o",
"ỡ": "o",
"ớ": "o",
"ợ": "o",
"ù": "u",
"ú": "u",
"û": "u",
"ü": "u",
"ủ": "u",
"ụ": "u",
"ử": "u",
"ữ": "u",
"ự": "u",
"ý": "y",
"ÿ": "y",
"Ā": "A",
"ā": "a",
"Ă": "A",
"ă": "a",
"Ą": "A",
"ą": "a",
"Ć": "C",
"ć": "c",
"Ĉ": "C",
"ĉ": "c",
"Ċ": "C",
"ċ": "c",
"Č": "C",
"č": "c",
"C̆": "C",
"c̆": "c",
"Ď": "D",
"ď": "d",
"Đ": "D",
"đ": "d",
"Ē": "E",
"ē": "e",
"Ĕ": "E",
"ĕ": "e",
"Ė": "E",
"ė": "e",
"Ę": "E",
"ę": "e",
"Ě": "E",
"ě": "e",
"Ĝ": "G",
"Ǵ": "G",
"ĝ": "g",
"ǵ": "g",
"Ğ": "G",
"ğ": "g",
"Ġ": "G",
"ġ": "g",
"Ģ": "G",
"ģ": "g",
"Ĥ": "H",
"ĥ": "h",
"Ħ": "H",
"ħ": "h",
"Ḫ": "H",
"ḫ": "h",
"Ĩ": "I",
"ĩ": "i",
"Ī": "I",
"ī": "i",
"Ĭ": "I",
"ĭ": "i",
"Į": "I",
"į": "i",
"İ": "I",
"ı": "i",
"IJ": "IJ",
"ij": "ij",
"Ĵ": "J",
"ĵ": "j",
"Ķ": "K",
"ķ": "k",
"Ḱ": "K",
"ḱ": "k",
"K̆": "K",
"k̆": "k",
"Ĺ": "L",
"ĺ": "l",
"Ļ": "L",
"ļ": "l",
"Ľ": "L",
"ľ": "l",
"Ŀ": "L",
"ŀ": "l",
"Ł": "l",
"ł": "l",
"Ḿ": "M",
"ḿ": "m",
"M̆": "M",
"m̆": "m",
"Ń": "N",
"ń": "n",
"Ņ": "N",
"ņ": "n",
"Ň": "N",
"ň": "n",
"ʼn": "n",
"N̆": "N",
"n̆": "n",
"Ō": "O",
"ō": "o",
"Ŏ": "O",
"ŏ": "o",
"Ő": "O",
"ő": "o",
"Œ": "OE",
"œ": "oe",
"P̆": "P",
"p̆": "p",
"Ŕ": "R",
"ŕ": "r",
"Ŗ": "R",
"ŗ": "r",
"Ř": "R",
"ř": "r",
"R̆": "R",
"r̆": "r",
"Ȓ": "R",
"ȓ": "r",
"Ś": "S",
"ś": "s",
"Ŝ": "S",
"ŝ": "s",
"Ş": "S",
"Ș": "S",
"ș": "s",
"ş": "s",
"Š": "S",
"š": "s",
"Ţ": "T",
"ţ": "t",
"ț": "t",
"Ț": "T",
"Ť": "T",
"ť": "t",
"Ŧ": "T",
"ŧ": "t",
"T̆": "T",
"t̆": "t",
"Ũ": "U",
"ũ": "u",
"Ū": "U",
"ū": "u",
"Ŭ": "U",
"ŭ": "u",
"Ů": "U",
"ů": "u",
"Ű": "U",
"ű": "u",
"Ų": "U",
"ų": "u",
"Ȗ": "U",
"ȗ": "u",
"V̆": "V",
"v̆": "v",
"Ŵ": "W",
"ŵ": "w",
"Ẃ": "W",
"ẃ": "w",
"X̆": "X",
"x̆": "x",
"Ŷ": "Y",
"ŷ": "y",
"Ÿ": "Y",
"Y̆": "Y",
"y̆": "y",
"Ź": "Z",
"ź": "z",
"Ż": "Z",
"ż": "z",
"Ž": "Z",
"ž": "z",
"ſ": "s",
"ƒ": "f",
"Ơ": "O",
"ơ": "o",
"Ư": "U",
"ư": "u",
"Ǎ": "A",
"ǎ": "a",
"Ǐ": "I",
"ǐ": "i",
"Ǒ": "O",
"ǒ": "o",
"Ǔ": "U",
"ǔ": "u",
"Ǖ": "U",
"ǖ": "u",
"Ǘ": "U",
"ǘ": "u",
"Ǚ": "U",
"ǚ": "u",
"Ǜ": "U",
"ǜ": "u",
"Ứ": "U",
"ứ": "u",
"Ṹ": "U",
"ṹ": "u",
"Ǻ": "A",
"ǻ": "a",
"Ǽ": "AE",
"ǽ": "ae",
"Ǿ": "O",
"ǿ": "o",
"Þ": "TH",
"þ": "th",
"Ṕ": "P",
"ṕ": "p",
"Ṥ": "S",
"ṥ": "s",
"X́": "X",
"x́": "x",
"Ѓ": "Г",
"ѓ": "г",
"Ќ": "К",
"ќ": "к",
"A̋": "A",
"a̋": "a",
"E̋": "E",
"e̋": "e",
"I̋": "I",
"i̋": "i",
"Ǹ": "N",
"ǹ": "n",
"Ồ": "O",
"ồ": "o",
"Ṑ": "O",
"ṑ": "o",
"Ừ": "U",
"ừ": "u",
"Ẁ": "W",
"ẁ": "w",
"Ỳ": "Y",
"ỳ": "y",
"Ȁ": "A",
"ȁ": "a",
"Ȅ": "E",
"ȅ": "e",
"Ȉ": "I",
"ȉ": "i",
"Ȍ": "O",
"ȍ": "o",
"Ȑ": "R",
"ȑ": "r",
"Ȕ": "U",
"ȕ": "u",
"B̌": "B",
"b̌": "b",
"Č̣": "C",
"č̣": "c",
"Ê̌": "E",
"ê̌": "e",
"F̌": "F",
"f̌": "f",
"Ǧ": "G",
"ǧ": "g",
"Ȟ": "H",
"ȟ": "h",
"J̌": "J",
"ǰ": "j",
"Ǩ": "K",
"ǩ": "k",
"M̌": "M",
"m̌": "m",
"P̌": "P",
"p̌": "p",
"Q̌": "Q",
"q̌": "q",
"Ř̩": "R",
"ř̩": "r",
"Ṧ": "S",
"ṧ": "s",
"V̌": "V",
"v̌": "v",
"W̌": "W",
"w̌": "w",
"X̌": "X",
"x̌": "x",
"Y̌": "Y",
"y̌": "y",
"A̧": "A",
"a̧": "a",
"B̧": "B",
"b̧": "b",
"Ḑ": "D",
"ḑ": "d",
"Ȩ": "E",
"ȩ": "e",
"Ɛ̧": "E",
"ɛ̧": "e",
"Ḩ": "H",
"ḩ": "h",
"I̧": "I",
"i̧": "i",
"Ɨ̧": "I",
"ɨ̧": "i",
"M̧": "M",
"m̧": "m",
"O̧": "O",
"o̧": "o",
"Q̧": "Q",
"q̧": "q",
"U̧": "U",
"u̧": "u",
"X̧": "X",
"x̧": "x",
"Z̧": "Z",
"z̧": "z",
"й":"и",
"Й":"И",
"ё":"е",
"Ё":"Е",
};
var chars = Object.keys(characterMap).join('|');
var allAccents = new RegExp(chars, 'g');
var firstAccent = new RegExp(chars, '');
function matcher(match) {
return characterMap[match];
}
var removeAccents = function(string) {
return string.replace(allAccents, matcher);
};
var hasAccents = function(string) {
return !!string.match(firstAccent);
};
module.exports = removeAccents;
module.exports.has = hasAccents;
module.exports.remove = removeAccents;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/create fake namespace object */
/******/ (() => {
/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
/******/ var leafPrototypes;
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 16: return value when it's Promise-like
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = this(value);
/******/ if(mode & 8) return value;
/******/ if(typeof value === 'object' && value) {
/******/ if((mode & 4) && value.__esModule) return value;
/******/ if((mode & 16) && typeof value.then === 'function') return value;
/******/ }
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ var def = {};
/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
/******/ }
/******/ def['default'] = () => (value);
/******/ __webpack_require__.d(ns, def);
/******/ return ns;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/nonce */
/******/ (() => {
/******/ __webpack_require__.nc = undefined;
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
(() => {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
AlignmentMatrixControl: () => (/* reexport */ alignment_matrix_control_default),
AnglePickerControl: () => (/* reexport */ angle_picker_control_default),
Animate: () => (/* reexport */ animate_default),
Autocomplete: () => (/* reexport */ Autocomplete),
BaseControl: () => (/* reexport */ base_control_default),
BlockQuotation: () => (/* reexport */ external_wp_primitives_namespaceObject.BlockQuotation),
BorderBoxControl: () => (/* reexport */ border_box_control_component_component_default),
BorderControl: () => (/* reexport */ border_control_component_component_default),
BoxControl: () => (/* reexport */ box_control_default),
Button: () => (/* reexport */ button_default),
ButtonGroup: () => (/* reexport */ button_group_default),
Card: () => (/* reexport */ card_component_component_default),
CardBody: () => (/* reexport */ card_body_component_component_default),
CardDivider: () => (/* reexport */ card_divider_component_component_default),
CardFooter: () => (/* reexport */ card_footer_component_component_default),
CardHeader: () => (/* reexport */ card_header_component_component_default),
CardMedia: () => (/* reexport */ card_media_component_component_default),
CheckboxControl: () => (/* reexport */ checkbox_control_default),
Circle: () => (/* reexport */ external_wp_primitives_namespaceObject.Circle),
ClipboardButton: () => (/* reexport */ ClipboardButton),
ColorIndicator: () => (/* reexport */ color_indicator_default),
ColorPalette: () => (/* reexport */ color_palette_default),
ColorPicker: () => (/* reexport */ LegacyAdapter),
ComboboxControl: () => (/* reexport */ combobox_control_default),
Composite: () => (/* reexport */ composite_Composite),
CustomGradientPicker: () => (/* reexport */ custom_gradient_picker_default),
CustomSelectControl: () => (/* reexport */ custom_select_control_default),
Dashicon: () => (/* reexport */ dashicon_default),
DatePicker: () => (/* reexport */ date_default),
DateTimePicker: () => (/* reexport */ date_time_date_time_default),
Disabled: () => (/* reexport */ disabled_default),
Draggable: () => (/* reexport */ draggable_default),
DropZone: () => (/* reexport */ drop_zone_default),
DropZoneProvider: () => (/* reexport */ DropZoneProvider),
Dropdown: () => (/* reexport */ dropdown_default),
DropdownMenu: () => (/* reexport */ dropdown_menu_default),
DuotonePicker: () => (/* reexport */ duotone_picker_default),
DuotoneSwatch: () => (/* reexport */ duotone_swatch_default),
ExternalLink: () => (/* reexport */ external_link_default),
Fill: () => (/* reexport */ slot_fill_Fill),
Flex: () => (/* reexport */ flex_component_component_default),
FlexBlock: () => (/* reexport */ flex_block_component_component_default),
FlexItem: () => (/* reexport */ flex_item_component_component_default),
FocalPointPicker: () => (/* reexport */ focal_point_picker_default),
FocusReturnProvider: () => (/* reexport */ with_focus_return_Provider),
FocusableIframe: () => (/* reexport */ FocusableIframe),
FontSizePicker: () => (/* reexport */ font_size_picker_default),
FormFileUpload: () => (/* reexport */ form_file_upload_default),
FormToggle: () => (/* reexport */ form_toggle_default),
FormTokenField: () => (/* reexport */ form_token_field_default),
G: () => (/* reexport */ external_wp_primitives_namespaceObject.G),
GradientPicker: () => (/* reexport */ gradient_picker_default),
Guide: () => (/* reexport */ guide_default),
GuidePage: () => (/* reexport */ GuidePage),
HorizontalRule: () => (/* reexport */ external_wp_primitives_namespaceObject.HorizontalRule),
Icon: () => (/* reexport */ icon_icon_default),
IconButton: () => (/* reexport */ deprecated_default),
IsolatedEventContainer: () => (/* reexport */ isolated_event_container_default),
KeyboardShortcuts: () => (/* reexport */ keyboard_shortcuts_default),
Line: () => (/* reexport */ external_wp_primitives_namespaceObject.Line),
MenuGroup: () => (/* reexport */ menu_group_default),
MenuItem: () => (/* reexport */ menu_item_default),
MenuItemsChoice: () => (/* reexport */ menu_items_choice_default),
Modal: () => (/* reexport */ modal_default),
NavigableMenu: () => (/* reexport */ menu_menu_default),
Navigator: () => (/* reexport */ navigator_Navigator),
Notice: () => (/* reexport */ notice_default),
NoticeList: () => (/* reexport */ list_default),
Panel: () => (/* reexport */ panel_default),
PanelBody: () => (/* reexport */ body_default),
PanelHeader: () => (/* reexport */ header_default),
PanelRow: () => (/* reexport */ row_default),
Path: () => (/* reexport */ external_wp_primitives_namespaceObject.Path),
Placeholder: () => (/* reexport */ placeholder_default),
Polygon: () => (/* reexport */ external_wp_primitives_namespaceObject.Polygon),
Popover: () => (/* reexport */ popover_default),
ProgressBar: () => (/* reexport */ progress_bar_default),
QueryControls: () => (/* reexport */ query_controls_default),
RadioControl: () => (/* reexport */ radio_control_default),
RangeControl: () => (/* reexport */ range_control_default),
Rect: () => (/* reexport */ external_wp_primitives_namespaceObject.Rect),
ResizableBox: () => (/* reexport */ resizable_box_default),
ResponsiveWrapper: () => (/* reexport */ responsive_wrapper_default),
SVG: () => (/* reexport */ external_wp_primitives_namespaceObject.SVG),
SandBox: () => (/* reexport */ sandbox_default),
ScrollLock: () => (/* reexport */ scroll_lock_default),
SearchControl: () => (/* reexport */ search_control_default),
SelectControl: () => (/* reexport */ select_control_default),
Slot: () => (/* reexport */ slot_fill_Slot),
SlotFillProvider: () => (/* reexport */ Provider),
Snackbar: () => (/* reexport */ snackbar_default),
SnackbarList: () => (/* reexport */ list_list_default),
Spinner: () => (/* reexport */ spinner_default),
TabPanel: () => (/* reexport */ tab_panel_default),
TabbableContainer: () => (/* reexport */ tabbable_default),
TextControl: () => (/* reexport */ text_control_default),
TextHighlight: () => (/* reexport */ text_highlight_default),
TextareaControl: () => (/* reexport */ textarea_control_default),
TimePicker: () => (/* reexport */ time_default),
Tip: () => (/* reexport */ tip_tip_default),
ToggleControl: () => (/* reexport */ toggle_control_default),
Toolbar: () => (/* reexport */ toolbar_default),
ToolbarButton: () => (/* reexport */ toolbar_button_default),
ToolbarDropdownMenu: () => (/* reexport */ toolbar_dropdown_menu_default),
ToolbarGroup: () => (/* reexport */ toolbar_group_default),
ToolbarItem: () => (/* reexport */ toolbar_item_default),
Tooltip: () => (/* reexport */ tooltip_default),
TreeSelect: () => (/* reexport */ tree_select_default),
VisuallyHidden: () => (/* reexport */ component_component_default),
__experimentalAlignmentMatrixControl: () => (/* reexport */ alignment_matrix_control_default),
__experimentalApplyValueToSides: () => (/* reexport */ applyValueToSides),
__experimentalBorderBoxControl: () => (/* reexport */ border_box_control_component_component_default),
__experimentalBorderControl: () => (/* reexport */ border_control_component_component_default),
__experimentalBoxControl: () => (/* reexport */ box_control_default),
__experimentalConfirmDialog: () => (/* reexport */ confirm_dialog_component_component_default),
__experimentalDimensionControl: () => (/* reexport */ dimension_control_default),
__experimentalDivider: () => (/* reexport */ divider_component_component_default),
__experimentalDropdownContentWrapper: () => (/* reexport */ dropdown_content_wrapper_default),
__experimentalElevation: () => (/* reexport */ elevation_component_component_default),
__experimentalGrid: () => (/* reexport */ grid_component_component_default),
__experimentalHStack: () => (/* reexport */ h_stack_component_component_default),
__experimentalHasSplitBorders: () => (/* reexport */ hasSplitBorders),
__experimentalHeading: () => (/* reexport */ heading_component_component_default),
__experimentalInputControl: () => (/* reexport */ input_control_default),
__experimentalInputControlPrefixWrapper: () => (/* reexport */ input_prefix_wrapper_default),
__experimentalInputControlSuffixWrapper: () => (/* reexport */ input_suffix_wrapper_default),
__experimentalIsDefinedBorder: () => (/* reexport */ isDefinedBorder),
__experimentalIsEmptyBorder: () => (/* reexport */ isEmptyBorder),
__experimentalItem: () => (/* reexport */ item_component_component_default),
__experimentalItemGroup: () => (/* reexport */ item_group_component_component_default),
__experimentalNavigation: () => (/* reexport */ navigation_default),
__experimentalNavigationBackButton: () => (/* reexport */ back_button_default),
__experimentalNavigationGroup: () => (/* reexport */ group_default),
__experimentalNavigationItem: () => (/* reexport */ item_item_default),
__experimentalNavigationMenu: () => (/* reexport */ navigation_menu_menu_default),
__experimentalNavigatorBackButton: () => (/* reexport */ legacy_NavigatorBackButton),
__experimentalNavigatorButton: () => (/* reexport */ legacy_NavigatorButton),
__experimentalNavigatorProvider: () => (/* reexport */ NavigatorProvider),
__experimentalNavigatorScreen: () => (/* reexport */ legacy_NavigatorScreen),
__experimentalNavigatorToParentButton: () => (/* reexport */ legacy_NavigatorToParentButton),
__experimentalNumberControl: () => (/* reexport */ number_control_default),
__experimentalPaletteEdit: () => (/* reexport */ palette_edit_default),
__experimentalParseQuantityAndUnitFromRawValue: () => (/* reexport */ parseQuantityAndUnitFromRawValue),
__experimentalRadio: () => (/* reexport */ radio_default),
__experimentalRadioGroup: () => (/* reexport */ radio_group_default),
__experimentalScrollable: () => (/* reexport */ scrollable_component_component_default),
__experimentalSpacer: () => (/* reexport */ spacer_component_component_default),
__experimentalStyleProvider: () => (/* reexport */ style_provider_default),
__experimentalSurface: () => (/* reexport */ surface_component_component_default),
__experimentalText: () => (/* reexport */ text_component_component_default),
__experimentalToggleGroupControl: () => (/* reexport */ toggle_group_control_component_component_default),
__experimentalToggleGroupControlOption: () => (/* reexport */ toggle_group_control_option_component_component_default),
__experimentalToggleGroupControlOptionIcon: () => (/* reexport */ toggle_group_control_option_icon_component_component_default),
__experimentalToolbarContext: () => (/* reexport */ toolbar_context_default),
__experimentalToolsPanel: () => (/* reexport */ tools_panel_component_component_default),
__experimentalToolsPanelContext: () => (/* reexport */ ToolsPanelContext),
__experimentalToolsPanelItem: () => (/* reexport */ tools_panel_item_component_component_default),
__experimentalTreeGrid: () => (/* reexport */ tree_grid_default),
__experimentalTreeGridCell: () => (/* reexport */ cell_default),
__experimentalTreeGridItem: () => (/* reexport */ tree_grid_item_item_default),
__experimentalTreeGridRow: () => (/* reexport */ row_row_default),
__experimentalTruncate: () => (/* reexport */ truncate_component_component_default),
__experimentalUnitControl: () => (/* reexport */ unit_control_default),
__experimentalUseCustomUnits: () => (/* reexport */ useCustomUnits),
__experimentalUseNavigator: () => (/* reexport */ useNavigator),
__experimentalUseSlot: () => (/* reexport */ useSlot),
__experimentalUseSlotFills: () => (/* reexport */ useSlotFills),
__experimentalVStack: () => (/* reexport */ v_stack_component_component_default),
__experimentalView: () => (/* reexport */ component_default),
__experimentalZStack: () => (/* reexport */ z_stack_component_component_default),
__unstableAnimatePresence: () => (/* reexport */ AnimatePresence),
__unstableComposite: () => (/* reexport */ legacy_Composite),
__unstableCompositeGroup: () => (/* reexport */ legacy_CompositeGroup),
__unstableCompositeItem: () => (/* reexport */ legacy_CompositeItem),
__unstableDisclosureContent: () => (/* reexport */ disclosure_DisclosureContent),
__unstableGetAnimateClassName: () => (/* reexport */ getAnimateClassName),
__unstableMotion: () => (/* reexport */ motion),
__unstableUseAutocompleteProps: () => (/* reexport */ useAutocompleteProps),
__unstableUseCompositeState: () => (/* reexport */ useCompositeState),
__unstableUseNavigateRegions: () => (/* reexport */ useNavigateRegions),
createSlotFill: () => (/* reexport */ createSlotFill),
navigateRegions: () => (/* reexport */ navigate_regions_default),
privateApis: () => (/* reexport */ privateApis),
useBaseControlProps: () => (/* reexport */ useBaseControlProps),
useNavigator: () => (/* reexport */ useNavigator),
withConstrainedTabbing: () => (/* reexport */ with_constrained_tabbing_default),
withFallbackStyles: () => (/* reexport */ with_fallback_styles_default),
withFilters: () => (/* reexport */ withFilters),
withFocusOutside: () => (/* reexport */ with_focus_outside_default),
withFocusReturn: () => (/* reexport */ with_focus_return_default),
withNotices: () => (/* reexport */ with_notices_default),
withSpokenMessages: () => (/* reexport */ with_spoken_messages_default)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/text/styles.js
var text_styles_namespaceObject = {};
__webpack_require__.r(text_styles_namespaceObject);
__webpack_require__.d(text_styles_namespaceObject, {
Text: () => (Text),
block: () => (styles_block),
destructive: () => (destructive),
highlighterText: () => (highlighterText),
muted: () => (muted),
positive: () => (positive),
upperCase: () => (upperCase)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/styles.js
var toggle_group_control_option_base_styles_namespaceObject = {};
__webpack_require__.r(toggle_group_control_option_base_styles_namespaceObject);
__webpack_require__.d(toggle_group_control_option_base_styles_namespaceObject, {
Rp: () => (ButtonContentView),
y0: () => (LabelView),
uG: () => (buttonView),
eh: () => (labelBlock)
});
// NAMESPACE OBJECT: ./node_modules/react-day-picker/dist/esm/components/custom-components.js
var custom_components_namespaceObject = {};
__webpack_require__.r(custom_components_namespaceObject);
__webpack_require__.d(custom_components_namespaceObject, {
Button: () => (Button_Button),
CaptionLabel: () => (CaptionLabel),
Chevron: () => (Chevron),
Day: () => (Day_Day),
DayButton: () => (DayButton_DayButton),
Dropdown: () => (Dropdown_Dropdown),
DropdownNav: () => (DropdownNav),
Footer: () => (Footer_Footer),
Month: () => (Month_Month),
MonthCaption: () => (MonthCaption),
MonthGrid: () => (MonthGrid),
Months: () => (Months),
MonthsDropdown: () => (MonthsDropdown),
Nav: () => (Nav),
NextMonthButton: () => (NextMonthButton),
Option: () => (Option_Option),
PreviousMonthButton: () => (PreviousMonthButton),
Root: () => (Root_Root),
Select: () => (Select_Select),
Week: () => (Week),
WeekNumber: () => (WeekNumber),
WeekNumberHeader: () => (WeekNumberHeader),
Weekday: () => (Weekday),
Weekdays: () => (Weekdays),
Weeks: () => (Weeks),
YearsDropdown: () => (YearsDropdown)
});
// NAMESPACE OBJECT: ./node_modules/react-day-picker/dist/esm/formatters/index.js
var esm_formatters_namespaceObject = {};
__webpack_require__.r(esm_formatters_namespaceObject);
__webpack_require__.d(esm_formatters_namespaceObject, {
formatCaption: () => (formatCaption),
formatDay: () => (formatDay),
formatMonthCaption: () => (formatMonthCaption),
formatMonthDropdown: () => (formatMonthDropdown),
formatWeekNumber: () => (formatWeekNumber),
formatWeekNumberHeader: () => (formatWeekNumberHeader),
formatWeekdayName: () => (formatWeekdayName),
formatYearCaption: () => (formatYearCaption),
formatYearDropdown: () => (formatYearDropdown)
});
// NAMESPACE OBJECT: ./node_modules/react-day-picker/dist/esm/labels/index.js
var labels_namespaceObject = {};
__webpack_require__.r(labels_namespaceObject);
__webpack_require__.d(labels_namespaceObject, {
labelCaption: () => (labelCaption),
labelDay: () => (labelDay),
labelDayButton: () => (labelDayButton),
labelGrid: () => (labelGrid),
labelGridcell: () => (labelGridcell),
labelMonthDropdown: () => (labelMonthDropdown),
labelNav: () => (labelNav),
labelNext: () => (labelNext),
labelPrevious: () => (labelPrevious),
labelWeekNumber: () => (labelWeekNumber),
labelWeekNumberHeader: () => (labelWeekNumberHeader),
labelWeekday: () => (labelWeekday),
labelYearDropdown: () => (labelYearDropdown)
});
;// external ["wp","primitives"]
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
;// ./node_modules/clsx/dist/clsx.mjs
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx);
;// external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// external ["wp","compose"]
const external_wp_compose_namespaceObject = window["wp"]["compose"];
;// external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// ./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js
"use client";
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var _3YLGPPWQ_spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var _3YLGPPWQ_spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
;// ./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js
"use client";
var _3YLGPPWQ_defProp = Object.defineProperty;
var _3YLGPPWQ_defProps = Object.defineProperties;
var _3YLGPPWQ_getOwnPropDescs = Object.getOwnPropertyDescriptors;
var _3YLGPPWQ_getOwnPropSymbols = Object.getOwnPropertySymbols;
var _3YLGPPWQ_hasOwnProp = Object.prototype.hasOwnProperty;
var _3YLGPPWQ_propIsEnum = Object.prototype.propertyIsEnumerable;
var _3YLGPPWQ_defNormalProp = (obj, key, value) => key in obj ? _3YLGPPWQ_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var _chunks_3YLGPPWQ_spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (_3YLGPPWQ_hasOwnProp.call(b, prop))
_3YLGPPWQ_defNormalProp(a, prop, b[prop]);
if (_3YLGPPWQ_getOwnPropSymbols)
for (var prop of _3YLGPPWQ_getOwnPropSymbols(b)) {
if (_3YLGPPWQ_propIsEnum.call(b, prop))
_3YLGPPWQ_defNormalProp(a, prop, b[prop]);
}
return a;
};
var _chunks_3YLGPPWQ_spreadProps = (a, b) => _3YLGPPWQ_defProps(a, _3YLGPPWQ_getOwnPropDescs(b));
var _3YLGPPWQ_objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (_3YLGPPWQ_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && _3YLGPPWQ_getOwnPropSymbols)
for (var prop of _3YLGPPWQ_getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && _3YLGPPWQ_propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
;// ./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js
"use client";
// src/utils/misc.ts
function PBFD2E7P_noop(..._) {
}
function shallowEqual(a, b) {
if (a === b) return true;
if (!a) return false;
if (!b) return false;
if (typeof a !== "object") return false;
if (typeof b !== "object") return false;
const aKeys = Object.keys(a);
const bKeys = Object.keys(b);
const { length } = aKeys;
if (bKeys.length !== length) return false;
for (const key of aKeys) {
if (a[key] !== b[key]) {
return false;
}
}
return true;
}
function applyState(argument, currentValue) {
if (isUpdater(argument)) {
const value = isLazyValue(currentValue) ? currentValue() : currentValue;
return argument(value);
}
return argument;
}
function isUpdater(argument) {
return typeof argument === "function";
}
function isLazyValue(value) {
return typeof value === "function";
}
function isObject(arg) {
return typeof arg === "object" && arg != null;
}
function isEmpty(arg) {
if (Array.isArray(arg)) return !arg.length;
if (isObject(arg)) return !Object.keys(arg).length;
if (arg == null) return true;
if (arg === "") return true;
return false;
}
function isInteger(arg) {
if (typeof arg === "number") {
return Math.floor(arg) === arg;
}
return String(Math.floor(Number(arg))) === arg;
}
function PBFD2E7P_hasOwnProperty(object, prop) {
if (typeof Object.hasOwn === "function") {
return Object.hasOwn(object, prop);
}
return Object.prototype.hasOwnProperty.call(object, prop);
}
function chain(...fns) {
return (...args) => {
for (const fn of fns) {
if (typeof fn === "function") {
fn(...args);
}
}
};
}
function cx(...args) {
return args.filter(Boolean).join(" ") || void 0;
}
function normalizeString(str) {
return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
}
function omit(object, keys) {
const result = _chunks_3YLGPPWQ_spreadValues({}, object);
for (const key of keys) {
if (PBFD2E7P_hasOwnProperty(result, key)) {
delete result[key];
}
}
return result;
}
function pick(object, paths) {
const result = {};
for (const key of paths) {
if (PBFD2E7P_hasOwnProperty(object, key)) {
result[key] = object[key];
}
}
return result;
}
function identity(value) {
return value;
}
function beforePaint(cb = PBFD2E7P_noop) {
const raf = requestAnimationFrame(cb);
return () => cancelAnimationFrame(raf);
}
function afterPaint(cb = PBFD2E7P_noop) {
let raf = requestAnimationFrame(() => {
raf = requestAnimationFrame(cb);
});
return () => cancelAnimationFrame(raf);
}
function invariant(condition, message) {
if (condition) return;
if (typeof message !== "string") throw new Error("Invariant failed");
throw new Error(message);
}
function getKeys(obj) {
return Object.keys(obj);
}
function isFalsyBooleanCallback(booleanOrCallback, ...args) {
const result = typeof booleanOrCallback === "function" ? booleanOrCallback(...args) : booleanOrCallback;
if (result == null) return false;
return !result;
}
function disabledFromProps(props) {
return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true";
}
function removeUndefinedValues(obj) {
const result = {};
for (const key in obj) {
if (obj[key] !== void 0) {
result[key] = obj[key];
}
}
return result;
}
function defaultValue(...values) {
for (const value of values) {
if (value !== void 0) return value;
}
return void 0;
}
// EXTERNAL MODULE: external "React"
var external_React_ = __webpack_require__(1609);
var external_React_namespaceObject = /*#__PURE__*/__webpack_require__.t(external_React_, 2);
var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_);
;// ./node_modules/@ariakit/react-core/esm/__chunks/SK3NAZA3.js
"use client";
// src/utils/misc.ts
function setRef(ref, value) {
if (typeof ref === "function") {
ref(value);
} else if (ref) {
ref.current = value;
}
}
function isValidElementWithRef(element) {
if (!element) return false;
if (!(0,external_React_.isValidElement)(element)) return false;
if ("ref" in element.props) return true;
if ("ref" in element) return true;
return false;
}
function getRefProperty(element) {
if (!isValidElementWithRef(element)) return null;
const props = _3YLGPPWQ_spreadValues({}, element.props);
return props.ref || element.ref;
}
function mergeProps(base, overrides) {
const props = _3YLGPPWQ_spreadValues({}, base);
for (const key in overrides) {
if (!PBFD2E7P_hasOwnProperty(overrides, key)) continue;
if (key === "className") {
const prop = "className";
props[prop] = base[prop] ? `${base[prop]} ${overrides[prop]}` : overrides[prop];
continue;
}
if (key === "style") {
const prop = "style";
props[prop] = base[prop] ? _3YLGPPWQ_spreadValues(_3YLGPPWQ_spreadValues({}, base[prop]), overrides[prop]) : overrides[prop];
continue;
}
const overrideValue = overrides[key];
if (typeof overrideValue === "function" && key.startsWith("on")) {
const baseValue = base[key];
if (typeof baseValue === "function") {
props[key] = (...args) => {
overrideValue(...args);
baseValue(...args);
};
continue;
}
}
props[key] = overrideValue;
}
return props;
}
;// ./node_modules/@ariakit/core/esm/__chunks/DTR5TSDJ.js
"use client";
// src/utils/dom.ts
var canUseDOM = checkIsBrowser();
function checkIsBrowser() {
var _a;
return typeof window !== "undefined" && !!((_a = window.document) == null ? void 0 : _a.createElement);
}
function getDocument(node) {
if (!node) return document;
if ("self" in node) return node.document;
return node.ownerDocument || document;
}
function getWindow(node) {
if (!node) return self;
if ("self" in node) return node.self;
return getDocument(node).defaultView || window;
}
function getActiveElement(node, activeDescendant = false) {
const { activeElement } = getDocument(node);
if (!(activeElement == null ? void 0 : activeElement.nodeName)) {
return null;
}
if (isFrame(activeElement) && activeElement.contentDocument) {
return getActiveElement(
activeElement.contentDocument.body,
activeDescendant
);
}
if (activeDescendant) {
const id = activeElement.getAttribute("aria-activedescendant");
if (id) {
const element = getDocument(activeElement).getElementById(id);
if (element) {
return element;
}
}
}
return activeElement;
}
function contains(parent, child) {
return parent === child || parent.contains(child);
}
function isFrame(element) {
return element.tagName === "IFRAME";
}
function isButton(element) {
const tagName = element.tagName.toLowerCase();
if (tagName === "button") return true;
if (tagName === "input" && element.type) {
return buttonInputTypes.indexOf(element.type) !== -1;
}
return false;
}
var buttonInputTypes = [
"button",
"color",
"file",
"image",
"reset",
"submit"
];
function isVisible(element) {
if (typeof element.checkVisibility === "function") {
return element.checkVisibility();
}
const htmlElement = element;
return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0;
}
function isTextField(element) {
try {
const isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null;
const isTextArea = element.tagName === "TEXTAREA";
return isTextInput || isTextArea || false;
} catch (error) {
return false;
}
}
function isTextbox(element) {
return element.isContentEditable || isTextField(element);
}
function getTextboxValue(element) {
if (isTextField(element)) {
return element.value;
}
if (element.isContentEditable) {
const range = getDocument(element).createRange();
range.selectNodeContents(element);
return range.toString();
}
return "";
}
function getTextboxSelection(element) {
let start = 0;
let end = 0;
if (isTextField(element)) {
start = element.selectionStart || 0;
end = element.selectionEnd || 0;
} else if (element.isContentEditable) {
const selection = getDocument(element).getSelection();
if ((selection == null ? void 0 : selection.rangeCount) && selection.anchorNode && contains(element, selection.anchorNode) && selection.focusNode && contains(element, selection.focusNode)) {
const range = selection.getRangeAt(0);
const nextRange = range.cloneRange();
nextRange.selectNodeContents(element);
nextRange.setEnd(range.startContainer, range.startOffset);
start = nextRange.toString().length;
nextRange.setEnd(range.endContainer, range.endOffset);
end = nextRange.toString().length;
}
}
return { start, end };
}
function getPopupRole(element, fallback) {
const allowedPopupRoles = ["dialog", "menu", "listbox", "tree", "grid"];
const role = element == null ? void 0 : element.getAttribute("role");
if (role && allowedPopupRoles.indexOf(role) !== -1) {
return role;
}
return fallback;
}
function getPopupItemRole(element, fallback) {
var _a;
const itemRoleByPopupRole = {
menu: "menuitem",
listbox: "option",
tree: "treeitem"
};
const popupRole = getPopupRole(element);
if (!popupRole) return fallback;
const key = popupRole;
return (_a = itemRoleByPopupRole[key]) != null ? _a : fallback;
}
function scrollIntoViewIfNeeded(element, arg) {
if (isPartiallyHidden(element) && "scrollIntoView" in element) {
element.scrollIntoView(arg);
}
}
function getScrollingElement(element) {
if (!element) return null;
const isScrollableOverflow = (overflow) => {
if (overflow === "auto") return true;
if (overflow === "scroll") return true;
return false;
};
if (element.clientHeight && element.scrollHeight > element.clientHeight) {
const { overflowY } = getComputedStyle(element);
if (isScrollableOverflow(overflowY)) return element;
} else if (element.clientWidth && element.scrollWidth > element.clientWidth) {
const { overflowX } = getComputedStyle(element);
if (isScrollableOverflow(overflowX)) return element;
}
return getScrollingElement(element.parentElement) || document.scrollingElement || document.body;
}
function isPartiallyHidden(element) {
const elementRect = element.getBoundingClientRect();
const scroller = getScrollingElement(element);
if (!scroller) return false;
const scrollerRect = scroller.getBoundingClientRect();
const isHTML = scroller.tagName === "HTML";
const scrollerTop = isHTML ? scrollerRect.top + scroller.scrollTop : scrollerRect.top;
const scrollerBottom = isHTML ? scroller.clientHeight : scrollerRect.bottom;
const scrollerLeft = isHTML ? scrollerRect.left + scroller.scrollLeft : scrollerRect.left;
const scrollerRight = isHTML ? scroller.clientWidth : scrollerRect.right;
const top = elementRect.top < scrollerTop;
const left = elementRect.left < scrollerLeft;
const bottom = elementRect.bottom > scrollerBottom;
const right = elementRect.right > scrollerRight;
return top || left || bottom || right;
}
function setSelectionRange(element, ...args) {
if (/text|search|password|tel|url/i.test(element.type)) {
element.setSelectionRange(...args);
}
}
function sortBasedOnDOMPosition(items, getElement) {
const pairs = items.map((item, index) => [index, item]);
let isOrderDifferent = false;
pairs.sort(([indexA, a], [indexB, b]) => {
const elementA = getElement(a);
const elementB = getElement(b);
if (elementA === elementB) return 0;
if (!elementA || !elementB) return 0;
if (isElementPreceding(elementA, elementB)) {
if (indexA > indexB) {
isOrderDifferent = true;
}
return -1;
}
if (indexA < indexB) {
isOrderDifferent = true;
}
return 1;
});
if (isOrderDifferent) {
return pairs.map(([_, item]) => item);
}
return items;
}
function isElementPreceding(a, b) {
return Boolean(
b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING
);
}
;// ./node_modules/@ariakit/core/esm/__chunks/QAGXQEUG.js
"use client";
// src/utils/platform.ts
function isTouchDevice() {
return canUseDOM && !!navigator.maxTouchPoints;
}
function isApple() {
if (!canUseDOM) return false;
return /mac|iphone|ipad|ipod/i.test(navigator.platform);
}
function isSafari() {
return canUseDOM && isApple() && /apple/i.test(navigator.vendor);
}
function isFirefox() {
return canUseDOM && /firefox\//i.test(navigator.userAgent);
}
function isMac() {
return canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
}
;// ./node_modules/@ariakit/core/esm/utils/events.js
"use client";
// src/utils/events.ts
function isPortalEvent(event) {
return Boolean(
event.currentTarget && !contains(event.currentTarget, event.target)
);
}
function isSelfTarget(event) {
return event.target === event.currentTarget;
}
function isOpeningInNewTab(event) {
const element = event.currentTarget;
if (!element) return false;
const isAppleDevice = isApple();
if (isAppleDevice && !event.metaKey) return false;
if (!isAppleDevice && !event.ctrlKey) return false;
const tagName = element.tagName.toLowerCase();
if (tagName === "a") return true;
if (tagName === "button" && element.type === "submit") return true;
if (tagName === "input" && element.type === "submit") return true;
return false;
}
function isDownloading(event) {
const element = event.currentTarget;
if (!element) return false;
const tagName = element.tagName.toLowerCase();
if (!event.altKey) return false;
if (tagName === "a") return true;
if (tagName === "button" && element.type === "submit") return true;
if (tagName === "input" && element.type === "submit") return true;
return false;
}
function fireEvent(element, type, eventInit) {
const event = new Event(type, eventInit);
return element.dispatchEvent(event);
}
function fireBlurEvent(element, eventInit) {
const event = new FocusEvent("blur", eventInit);
const defaultAllowed = element.dispatchEvent(event);
const bubbleInit = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, eventInit), { bubbles: true });
element.dispatchEvent(new FocusEvent("focusout", bubbleInit));
return defaultAllowed;
}
function fireFocusEvent(element, eventInit) {
const event = new FocusEvent("focus", eventInit);
const defaultAllowed = element.dispatchEvent(event);
const bubbleInit = __spreadProps(__spreadValues({}, eventInit), { bubbles: true });
element.dispatchEvent(new FocusEvent("focusin", bubbleInit));
return defaultAllowed;
}
function fireKeyboardEvent(element, type, eventInit) {
const event = new KeyboardEvent(type, eventInit);
return element.dispatchEvent(event);
}
function fireClickEvent(element, eventInit) {
const event = new MouseEvent("click", eventInit);
return element.dispatchEvent(event);
}
function isFocusEventOutside(event, container) {
const containerElement = container || event.currentTarget;
const relatedTarget = event.relatedTarget;
return !relatedTarget || !contains(containerElement, relatedTarget);
}
function getInputType(event) {
const nativeEvent = "nativeEvent" in event ? event.nativeEvent : event;
if (!nativeEvent) return;
if (!("inputType" in nativeEvent)) return;
if (typeof nativeEvent.inputType !== "string") return;
return nativeEvent.inputType;
}
function queueBeforeEvent(element, type, callback, timeout) {
const createTimer = (callback2) => {
if (timeout) {
const timerId2 = setTimeout(callback2, timeout);
return () => clearTimeout(timerId2);
}
const timerId = requestAnimationFrame(callback2);
return () => cancelAnimationFrame(timerId);
};
const cancelTimer = createTimer(() => {
element.removeEventListener(type, callSync, true);
callback();
});
const callSync = () => {
cancelTimer();
callback();
};
element.addEventListener(type, callSync, { once: true, capture: true });
return cancelTimer;
}
function addGlobalEventListener(type, listener, options, scope = window) {
const children = [];
try {
scope.document.addEventListener(type, listener, options);
for (const frame of Array.from(scope.frames)) {
children.push(addGlobalEventListener(type, listener, options, frame));
}
} catch (e) {
}
const removeEventListener = () => {
try {
scope.document.removeEventListener(type, listener, options);
} catch (e) {
}
for (const remove of children) {
remove();
}
};
return removeEventListener;
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/ABQUS43J.js
"use client";
// src/utils/hooks.ts
var _React = _3YLGPPWQ_spreadValues({}, external_React_namespaceObject);
var useReactId = _React.useId;
var useReactDeferredValue = _React.useDeferredValue;
var useReactInsertionEffect = _React.useInsertionEffect;
var useSafeLayoutEffect = canUseDOM ? external_React_.useLayoutEffect : external_React_.useEffect;
function useInitialValue(value) {
const [initialValue] = (0,external_React_.useState)(value);
return initialValue;
}
function useLazyValue(init) {
const ref = useRef();
if (ref.current === void 0) {
ref.current = init();
}
return ref.current;
}
function useLiveRef(value) {
const ref = (0,external_React_.useRef)(value);
useSafeLayoutEffect(() => {
ref.current = value;
});
return ref;
}
function usePreviousValue(value) {
const [previousValue, setPreviousValue] = useState(value);
if (value !== previousValue) {
setPreviousValue(value);
}
return previousValue;
}
function useEvent(callback) {
const ref = (0,external_React_.useRef)(() => {
throw new Error("Cannot call an event handler while rendering.");
});
if (useReactInsertionEffect) {
useReactInsertionEffect(() => {
ref.current = callback;
});
} else {
ref.current = callback;
}
return (0,external_React_.useCallback)((...args) => {
var _a;
return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);
}, []);
}
function useTransactionState(callback) {
const [state, setState] = (0,external_React_.useState)(null);
useSafeLayoutEffect(() => {
if (state == null) return;
if (!callback) return;
let prevState = null;
callback((prev) => {
prevState = prev;
return state;
});
return () => {
callback(prevState);
};
}, [state, callback]);
return [state, setState];
}
function useMergeRefs(...refs) {
return (0,external_React_.useMemo)(() => {
if (!refs.some(Boolean)) return;
return (value) => {
for (const ref of refs) {
setRef(ref, value);
}
};
}, refs);
}
function useId(defaultId) {
if (useReactId) {
const reactId = useReactId();
if (defaultId) return defaultId;
return reactId;
}
const [id, setId] = (0,external_React_.useState)(defaultId);
useSafeLayoutEffect(() => {
if (defaultId || id) return;
const random = Math.random().toString(36).slice(2, 8);
setId(`id-${random}`);
}, [defaultId, id]);
return defaultId || id;
}
function useDeferredValue(value) {
if (useReactDeferredValue) {
return useReactDeferredValue(value);
}
const [deferredValue, setDeferredValue] = useState(value);
useEffect(() => {
const raf = requestAnimationFrame(() => setDeferredValue(value));
return () => cancelAnimationFrame(raf);
}, [value]);
return deferredValue;
}
function useTagName(refOrElement, type) {
const stringOrUndefined = (type2) => {
if (typeof type2 !== "string") return;
return type2;
};
const [tagName, setTagName] = (0,external_React_.useState)(() => stringOrUndefined(type));
useSafeLayoutEffect(() => {
const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement;
setTagName((element == null ? void 0 : element.tagName.toLowerCase()) || stringOrUndefined(type));
}, [refOrElement, type]);
return tagName;
}
function useAttribute(refOrElement, attributeName, defaultValue) {
const initialValue = useInitialValue(defaultValue);
const [attribute, setAttribute] = (0,external_React_.useState)(initialValue);
(0,external_React_.useEffect)(() => {
const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement;
if (!element) return;
const callback = () => {
const value = element.getAttribute(attributeName);
setAttribute(value == null ? initialValue : value);
};
const observer = new MutationObserver(callback);
observer.observe(element, { attributeFilter: [attributeName] });
callback();
return () => observer.disconnect();
}, [refOrElement, attributeName, initialValue]);
return attribute;
}
function useUpdateEffect(effect, deps) {
const mounted = (0,external_React_.useRef)(false);
(0,external_React_.useEffect)(() => {
if (mounted.current) {
return effect();
}
mounted.current = true;
}, deps);
(0,external_React_.useEffect)(
() => () => {
mounted.current = false;
},
[]
);
}
function useUpdateLayoutEffect(effect, deps) {
const mounted = useRef(false);
useSafeLayoutEffect(() => {
if (mounted.current) {
return effect();
}
mounted.current = true;
}, deps);
useSafeLayoutEffect(
() => () => {
mounted.current = false;
},
[]
);
}
function useForceUpdate() {
return (0,external_React_.useReducer)(() => [], []);
}
function useBooleanEvent(booleanOrCallback) {
return useEvent(
typeof booleanOrCallback === "function" ? booleanOrCallback : () => booleanOrCallback
);
}
function useWrapElement(props, callback, deps = []) {
const wrapElement = (0,external_React_.useCallback)(
(element) => {
if (props.wrapElement) {
element = props.wrapElement(element);
}
return callback(element);
},
[...deps, props.wrapElement]
);
return _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { wrapElement });
}
function usePortalRef(portalProp = false, portalRefProp) {
const [portalNode, setPortalNode] = (0,external_React_.useState)(null);
const portalRef = useMergeRefs(setPortalNode, portalRefProp);
const domReady = !portalProp || portalNode;
return { portalRef, portalNode, domReady };
}
function useMetadataProps(props, key, value) {
const parent = props.onLoadedMetadataCapture;
const onLoadedMetadataCapture = (0,external_React_.useMemo)(() => {
return Object.assign(() => {
}, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, parent), { [key]: value }));
}, [parent, key, value]);
return [parent == null ? void 0 : parent[key], { onLoadedMetadataCapture }];
}
function useIsMouseMoving() {
(0,external_React_.useEffect)(() => {
addGlobalEventListener("mousemove", setMouseMoving, true);
addGlobalEventListener("mousedown", resetMouseMoving, true);
addGlobalEventListener("mouseup", resetMouseMoving, true);
addGlobalEventListener("keydown", resetMouseMoving, true);
addGlobalEventListener("scroll", resetMouseMoving, true);
}, []);
const isMouseMoving = useEvent(() => mouseMoving);
return isMouseMoving;
}
var mouseMoving = false;
var previousScreenX = 0;
var previousScreenY = 0;
function hasMouseMovement(event) {
const movementX = event.movementX || event.screenX - previousScreenX;
const movementY = event.movementY || event.screenY - previousScreenY;
previousScreenX = event.screenX;
previousScreenY = event.screenY;
return movementX || movementY || "production" === "test";
}
function setMouseMoving(event) {
if (!hasMouseMovement(event)) return;
mouseMoving = true;
}
function resetMouseMoving() {
mouseMoving = false;
}
;// ./node_modules/@ariakit/core/esm/__chunks/BCALMBPZ.js
"use client";
// src/utils/store.ts
function getInternal(store, key) {
const internals = store.__unstableInternals;
invariant(internals, "Invalid store");
return internals[key];
}
function createStore(initialState, ...stores) {
let state = initialState;
let prevStateBatch = state;
let lastUpdate = Symbol();
let destroy = PBFD2E7P_noop;
const instances = /* @__PURE__ */ new Set();
const updatedKeys = /* @__PURE__ */ new Set();
const setups = /* @__PURE__ */ new Set();
const listeners = /* @__PURE__ */ new Set();
const batchListeners = /* @__PURE__ */ new Set();
const disposables = /* @__PURE__ */ new WeakMap();
const listenerKeys = /* @__PURE__ */ new WeakMap();
const storeSetup = (callback) => {
setups.add(callback);
return () => setups.delete(callback);
};
const storeInit = () => {
const initialized = instances.size;
const instance = Symbol();
instances.add(instance);
const maybeDestroy = () => {
instances.delete(instance);
if (instances.size) return;
destroy();
};
if (initialized) return maybeDestroy;
const desyncs = getKeys(state).map(
(key) => chain(
...stores.map((store) => {
var _a;
const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store);
if (!storeState) return;
if (!PBFD2E7P_hasOwnProperty(storeState, key)) return;
return sync(store, [key], (state2) => {
setState(
key,
state2[key],
// @ts-expect-error - Not public API. This is just to prevent
// infinite loops.
true
);
});
})
)
);
const teardowns = [];
for (const setup2 of setups) {
teardowns.push(setup2());
}
const cleanups = stores.map(init);
destroy = chain(...desyncs, ...teardowns, ...cleanups);
return maybeDestroy;
};
const sub = (keys, listener, set = listeners) => {
set.add(listener);
listenerKeys.set(listener, keys);
return () => {
var _a;
(_a = disposables.get(listener)) == null ? void 0 : _a();
disposables.delete(listener);
listenerKeys.delete(listener);
set.delete(listener);
};
};
const storeSubscribe = (keys, listener) => sub(keys, listener);
const storeSync = (keys, listener) => {
disposables.set(listener, listener(state, state));
return sub(keys, listener);
};
const storeBatch = (keys, listener) => {
disposables.set(listener, listener(state, prevStateBatch));
return sub(keys, listener, batchListeners);
};
const storePick = (keys) => createStore(pick(state, keys), finalStore);
const storeOmit = (keys) => createStore(omit(state, keys), finalStore);
const getState = () => state;
const setState = (key, value, fromStores = false) => {
var _a;
if (!PBFD2E7P_hasOwnProperty(state, key)) return;
const nextValue = applyState(value, state[key]);
if (nextValue === state[key]) return;
if (!fromStores) {
for (const store of stores) {
(_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue);
}
}
const prevState = state;
state = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, state), { [key]: nextValue });
const thisUpdate = Symbol();
lastUpdate = thisUpdate;
updatedKeys.add(key);
const run = (listener, prev, uKeys) => {
var _a2;
const keys = listenerKeys.get(listener);
const updated = (k) => uKeys ? uKeys.has(k) : k === key;
if (!keys || keys.some(updated)) {
(_a2 = disposables.get(listener)) == null ? void 0 : _a2();
disposables.set(listener, listener(state, prev));
}
};
for (const listener of listeners) {
run(listener, prevState);
}
queueMicrotask(() => {
if (lastUpdate !== thisUpdate) return;
const snapshot = state;
for (const listener of batchListeners) {
run(listener, prevStateBatch, updatedKeys);
}
prevStateBatch = snapshot;
updatedKeys.clear();
});
};
const finalStore = {
getState,
setState,
__unstableInternals: {
setup: storeSetup,
init: storeInit,
subscribe: storeSubscribe,
sync: storeSync,
batch: storeBatch,
pick: storePick,
omit: storeOmit
}
};
return finalStore;
}
function setup(store, ...args) {
if (!store) return;
return getInternal(store, "setup")(...args);
}
function init(store, ...args) {
if (!store) return;
return getInternal(store, "init")(...args);
}
function subscribe(store, ...args) {
if (!store) return;
return getInternal(store, "subscribe")(...args);
}
function sync(store, ...args) {
if (!store) return;
return getInternal(store, "sync")(...args);
}
function batch(store, ...args) {
if (!store) return;
return getInternal(store, "batch")(...args);
}
function omit2(store, ...args) {
if (!store) return;
return getInternal(store, "omit")(...args);
}
function pick2(store, ...args) {
if (!store) return;
return getInternal(store, "pick")(...args);
}
function mergeStore(...stores) {
const initialState = stores.reduce((state, store2) => {
var _a;
const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2);
if (!nextState) return state;
return Object.assign(state, nextState);
}, {});
const store = createStore(initialState, ...stores);
return Object.assign({}, ...stores, store);
}
function throwOnConflictingProps(props, store) {
if (true) return;
if (!store) return;
const defaultKeys = Object.entries(props).filter(([key, value]) => key.startsWith("default") && value !== void 0).map(([key]) => {
var _a;
const stateKey = key.replace("default", "");
return `${((_a = stateKey[0]) == null ? void 0 : _a.toLowerCase()) || ""}${stateKey.slice(1)}`;
});
if (!defaultKeys.length) return;
const storeState = store.getState();
const conflictingProps = defaultKeys.filter(
(key) => PBFD2E7P_hasOwnProperty(storeState, key)
);
if (!conflictingProps.length) return;
throw new Error(
`Passing a store prop in conjunction with a default state is not supported.
const store = useSelectStore();
<SelectProvider store={store} defaultValue="Apple" />
^ ^
Instead, pass the default state to the topmost store:
const store = useSelectStore({ defaultValue: "Apple" });
<SelectProvider store={store} />
See https://github.com/ariakit/ariakit/pull/2745 for more details.
If there's a particular need for this, please submit a feature request at https://github.com/ariakit/ariakit
`
);
}
// EXTERNAL MODULE: ./node_modules/use-sync-external-store/shim/index.js
var shim = __webpack_require__(422);
;// ./node_modules/@ariakit/react-core/esm/__chunks/YV4JVR4I.js
"use client";
// src/utils/store.tsx
var { useSyncExternalStore } = shim;
var noopSubscribe = () => () => {
};
function useStoreState(store, keyOrSelector = identity) {
const storeSubscribe = external_React_.useCallback(
(callback) => {
if (!store) return noopSubscribe();
return subscribe(store, null, callback);
},
[store]
);
const getSnapshot = () => {
const key = typeof keyOrSelector === "string" ? keyOrSelector : null;
const selector = typeof keyOrSelector === "function" ? keyOrSelector : null;
const state = store == null ? void 0 : store.getState();
if (selector) return selector(state);
if (!state) return;
if (!key) return;
if (!PBFD2E7P_hasOwnProperty(state, key)) return;
return state[key];
};
return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot);
}
function useStoreStateObject(store, object) {
const objRef = external_React_.useRef(
{}
);
const storeSubscribe = external_React_.useCallback(
(callback) => {
if (!store) return noopSubscribe();
return subscribe(store, null, callback);
},
[store]
);
const getSnapshot = () => {
const state = store == null ? void 0 : store.getState();
let updated = false;
const obj = objRef.current;
for (const prop in object) {
const keyOrSelector = object[prop];
if (typeof keyOrSelector === "function") {
const value = keyOrSelector(state);
if (value !== obj[prop]) {
obj[prop] = value;
updated = true;
}
}
if (typeof keyOrSelector === "string") {
if (!state) continue;
if (!PBFD2E7P_hasOwnProperty(state, keyOrSelector)) continue;
const value = state[keyOrSelector];
if (value !== obj[prop]) {
obj[prop] = value;
updated = true;
}
}
}
if (updated) {
objRef.current = _3YLGPPWQ_spreadValues({}, obj);
}
return objRef.current;
};
return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot);
}
function useStoreProps(store, props, key, setKey) {
const value = PBFD2E7P_hasOwnProperty(props, key) ? props[key] : void 0;
const setValue = setKey ? props[setKey] : void 0;
const propsRef = useLiveRef({ value, setValue });
useSafeLayoutEffect(() => {
return sync(store, [key], (state, prev) => {
const { value: value2, setValue: setValue2 } = propsRef.current;
if (!setValue2) return;
if (state[key] === prev[key]) return;
if (state[key] === value2) return;
setValue2(state[key]);
});
}, [store, key]);
useSafeLayoutEffect(() => {
if (value === void 0) return;
store.setState(key, value);
return batch(store, [key], () => {
if (value === void 0) return;
store.setState(key, value);
});
});
}
function YV4JVR4I_useStore(createStore, props) {
const [store, setStore] = external_React_.useState(() => createStore(props));
useSafeLayoutEffect(() => init(store), [store]);
const useState2 = external_React_.useCallback(
(keyOrSelector) => useStoreState(store, keyOrSelector),
[store]
);
const memoizedStore = external_React_.useMemo(
() => _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, store), { useState: useState2 }),
[store, useState2]
);
const updateStore = useEvent(() => {
setStore((store2) => createStore(_3YLGPPWQ_spreadValues(_3YLGPPWQ_spreadValues({}, props), store2.getState())));
});
return [memoizedStore, updateStore];
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/C3IKGW5T.js
"use client";
// src/collection/collection-store.ts
function useCollectionStoreProps(store, update, props) {
useUpdateEffect(update, [props.store]);
useStoreProps(store, props, "items", "setItems");
return store;
}
function useCollectionStore(props = {}) {
const [store, update] = useStore(Core.createCollectionStore, props);
return useCollectionStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/core/esm/__chunks/CYQWQL4J.js
"use client";
// src/collection/collection-store.ts
function getCommonParent(items) {
var _a;
const firstItem = items.find((item) => !!item.element);
const lastItem = [...items].reverse().find((item) => !!item.element);
let parentElement = (_a = firstItem == null ? void 0 : firstItem.element) == null ? void 0 : _a.parentElement;
while (parentElement && (lastItem == null ? void 0 : lastItem.element)) {
const parent = parentElement;
if (lastItem && parent.contains(lastItem.element)) {
return parentElement;
}
parentElement = parentElement.parentElement;
}
return getDocument(parentElement).body;
}
function getPrivateStore(store) {
return store == null ? void 0 : store.__unstablePrivateStore;
}
function createCollectionStore(props = {}) {
var _a;
throwOnConflictingProps(props, props.store);
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
const items = defaultValue(
props.items,
syncState == null ? void 0 : syncState.items,
props.defaultItems,
[]
);
const itemsMap = new Map(items.map((item) => [item.id, item]));
const initialState = {
items,
renderedItems: defaultValue(syncState == null ? void 0 : syncState.renderedItems, [])
};
const syncPrivateStore = getPrivateStore(props.store);
const privateStore = createStore(
{ items, renderedItems: initialState.renderedItems },
syncPrivateStore
);
const collection = createStore(initialState, props.store);
const sortItems = (renderedItems) => {
const sortedItems = sortBasedOnDOMPosition(renderedItems, (i) => i.element);
privateStore.setState("renderedItems", sortedItems);
collection.setState("renderedItems", sortedItems);
};
setup(collection, () => init(privateStore));
setup(privateStore, () => {
return batch(privateStore, ["items"], (state) => {
collection.setState("items", state.items);
});
});
setup(privateStore, () => {
return batch(privateStore, ["renderedItems"], (state) => {
let firstRun = true;
let raf = requestAnimationFrame(() => {
const { renderedItems } = collection.getState();
if (state.renderedItems === renderedItems) return;
sortItems(state.renderedItems);
});
if (typeof IntersectionObserver !== "function") {
return () => cancelAnimationFrame(raf);
}
const ioCallback = () => {
if (firstRun) {
firstRun = false;
return;
}
cancelAnimationFrame(raf);
raf = requestAnimationFrame(() => sortItems(state.renderedItems));
};
const root = getCommonParent(state.renderedItems);
const observer = new IntersectionObserver(ioCallback, { root });
for (const item of state.renderedItems) {
if (!item.element) continue;
observer.observe(item.element);
}
return () => {
cancelAnimationFrame(raf);
observer.disconnect();
};
});
});
const mergeItem = (item, setItems, canDeleteFromMap = false) => {
let prevItem;
setItems((items2) => {
const index = items2.findIndex(({ id }) => id === item.id);
const nextItems = items2.slice();
if (index !== -1) {
prevItem = items2[index];
const nextItem = _chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, prevItem), item);
nextItems[index] = nextItem;
itemsMap.set(item.id, nextItem);
} else {
nextItems.push(item);
itemsMap.set(item.id, item);
}
return nextItems;
});
const unmergeItem = () => {
setItems((items2) => {
if (!prevItem) {
if (canDeleteFromMap) {
itemsMap.delete(item.id);
}
return items2.filter(({ id }) => id !== item.id);
}
const index = items2.findIndex(({ id }) => id === item.id);
if (index === -1) return items2;
const nextItems = items2.slice();
nextItems[index] = prevItem;
itemsMap.set(item.id, prevItem);
return nextItems;
});
};
return unmergeItem;
};
const registerItem = (item) => mergeItem(
item,
(getItems) => privateStore.setState("items", getItems),
true
);
return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, collection), {
registerItem,
renderItem: (item) => chain(
registerItem(item),
mergeItem(
item,
(getItems) => privateStore.setState("renderedItems", getItems)
)
),
item: (id) => {
if (!id) return null;
let item = itemsMap.get(id);
if (!item) {
const { items: items2 } = privateStore.getState();
item = items2.find((item2) => item2.id === id);
if (item) {
itemsMap.set(id, item);
}
}
return item || null;
},
// @ts-expect-error Internal
__unstablePrivateStore: privateStore
});
}
;// ./node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js
"use client";
// src/utils/array.ts
function toArray(arg) {
if (Array.isArray(arg)) {
return arg;
}
return typeof arg !== "undefined" ? [arg] : [];
}
function addItemToArray(array, item, index = -1) {
if (!(index in array)) {
return [...array, item];
}
return [...array.slice(0, index), item, ...array.slice(index)];
}
function flatten2DArray(array) {
const flattened = [];
for (const row of array) {
flattened.push(...row);
}
return flattened;
}
function reverseArray(array) {
return array.slice().reverse();
}
;// ./node_modules/@ariakit/core/esm/__chunks/AJZ4BYF3.js
"use client";
// src/composite/composite-store.ts
var NULL_ITEM = { id: null };
function findFirstEnabledItem(items, excludeId) {
return items.find((item) => {
if (excludeId) {
return !item.disabled && item.id !== excludeId;
}
return !item.disabled;
});
}
function getEnabledItems(items, excludeId) {
return items.filter((item) => {
if (excludeId) {
return !item.disabled && item.id !== excludeId;
}
return !item.disabled;
});
}
function getItemsInRow(items, rowId) {
return items.filter((item) => item.rowId === rowId);
}
function flipItems(items, activeId, shouldInsertNullItem = false) {
const index = items.findIndex((item) => item.id === activeId);
return [
...items.slice(index + 1),
...shouldInsertNullItem ? [NULL_ITEM] : [],
...items.slice(0, index)
];
}
function groupItemsByRows(items) {
const rows = [];
for (const item of items) {
const row = rows.find((currentRow) => {
var _a;
return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId;
});
if (row) {
row.push(item);
} else {
rows.push([item]);
}
}
return rows;
}
function getMaxRowLength(array) {
let maxLength = 0;
for (const { length } of array) {
if (length > maxLength) {
maxLength = length;
}
}
return maxLength;
}
function createEmptyItem(rowId) {
return {
id: "__EMPTY_ITEM__",
disabled: true,
rowId
};
}
function normalizeRows(rows, activeId, focusShift) {
const maxLength = getMaxRowLength(rows);
for (const row of rows) {
for (let i = 0; i < maxLength; i += 1) {
const item = row[i];
if (!item || focusShift && item.disabled) {
const isFirst = i === 0;
const previousItem = isFirst && focusShift ? findFirstEnabledItem(row) : row[i - 1];
row[i] = previousItem && activeId !== previousItem.id && focusShift ? previousItem : createEmptyItem(previousItem == null ? void 0 : previousItem.rowId);
}
}
}
return rows;
}
function verticalizeItems(items) {
const rows = groupItemsByRows(items);
const maxLength = getMaxRowLength(rows);
const verticalized = [];
for (let i = 0; i < maxLength; i += 1) {
for (const row of rows) {
const item = row[i];
if (item) {
verticalized.push(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, item), {
// If there's no rowId, it means that it's not a grid composite, but
// a single row instead. So, instead of verticalizing it, that is,
// assigning a different rowId based on the column index, we keep it
// undefined so they will be part of the same row. This is useful
// when using up/down on one-dimensional composites.
rowId: item.rowId ? `${i}` : void 0
}));
}
}
}
return verticalized;
}
function createCompositeStore(props = {}) {
var _a;
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
const collection = createCollectionStore(props);
const activeId = defaultValue(
props.activeId,
syncState == null ? void 0 : syncState.activeId,
props.defaultActiveId
);
const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, collection.getState()), {
id: defaultValue(
props.id,
syncState == null ? void 0 : syncState.id,
`id-${Math.random().toString(36).slice(2, 8)}`
),
activeId,
baseElement: defaultValue(syncState == null ? void 0 : syncState.baseElement, null),
includesBaseElement: defaultValue(
props.includesBaseElement,
syncState == null ? void 0 : syncState.includesBaseElement,
activeId === null
),
moves: defaultValue(syncState == null ? void 0 : syncState.moves, 0),
orientation: defaultValue(
props.orientation,
syncState == null ? void 0 : syncState.orientation,
"both"
),
rtl: defaultValue(props.rtl, syncState == null ? void 0 : syncState.rtl, false),
virtualFocus: defaultValue(
props.virtualFocus,
syncState == null ? void 0 : syncState.virtualFocus,
false
),
focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),
focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
focusShift: defaultValue(props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
});
const composite = createStore(initialState, collection, props.store);
setup(
composite,
() => sync(composite, ["renderedItems", "activeId"], (state) => {
composite.setState("activeId", (activeId2) => {
var _a2;
if (activeId2 !== void 0) return activeId2;
return (_a2 = findFirstEnabledItem(state.renderedItems)) == null ? void 0 : _a2.id;
});
})
);
const getNextId = (direction = "next", options = {}) => {
var _a2, _b;
const defaultState = composite.getState();
const {
skip = 0,
activeId: activeId2 = defaultState.activeId,
focusShift = defaultState.focusShift,
focusLoop = defaultState.focusLoop,
focusWrap = defaultState.focusWrap,
includesBaseElement = defaultState.includesBaseElement,
renderedItems = defaultState.renderedItems,
rtl = defaultState.rtl
} = options;
const isVerticalDirection = direction === "up" || direction === "down";
const isNextDirection = direction === "next" || direction === "down";
const canReverse = isNextDirection ? rtl && !isVerticalDirection : !rtl || isVerticalDirection;
const canShift = focusShift && !skip;
let items = !isVerticalDirection ? renderedItems : flatten2DArray(
normalizeRows(groupItemsByRows(renderedItems), activeId2, canShift)
);
items = canReverse ? reverseArray(items) : items;
items = isVerticalDirection ? verticalizeItems(items) : items;
if (activeId2 == null) {
return (_a2 = findFirstEnabledItem(items)) == null ? void 0 : _a2.id;
}
const activeItem = items.find((item) => item.id === activeId2);
if (!activeItem) {
return (_b = findFirstEnabledItem(items)) == null ? void 0 : _b.id;
}
const isGrid = items.some((item) => item.rowId);
const activeIndex = items.indexOf(activeItem);
const nextItems = items.slice(activeIndex + 1);
const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId);
if (skip) {
const nextEnabledItemsInRow = getEnabledItems(nextItemsInRow, activeId2);
const nextItem2 = nextEnabledItemsInRow.slice(skip)[0] || // If we can't find an item, just return the last one.
nextEnabledItemsInRow[nextEnabledItemsInRow.length - 1];
return nextItem2 == null ? void 0 : nextItem2.id;
}
const canLoop = focusLoop && (isVerticalDirection ? focusLoop !== "horizontal" : focusLoop !== "vertical");
const canWrap = isGrid && focusWrap && (isVerticalDirection ? focusWrap !== "horizontal" : focusWrap !== "vertical");
const hasNullItem = isNextDirection ? (!isGrid || isVerticalDirection) && canLoop && includesBaseElement : isVerticalDirection ? includesBaseElement : false;
if (canLoop) {
const loopItems = canWrap && !hasNullItem ? items : getItemsInRow(items, activeItem.rowId);
const sortedItems = flipItems(loopItems, activeId2, hasNullItem);
const nextItem2 = findFirstEnabledItem(sortedItems, activeId2);
return nextItem2 == null ? void 0 : nextItem2.id;
}
if (canWrap) {
const nextItem2 = findFirstEnabledItem(
// We can use nextItems, which contains all the next items, including
// items from other rows, to wrap between rows. However, if there is a
// null item (the composite container), we'll only use the next items in
// the row. So moving next from the last item will focus on the
// composite container. On grid composites, horizontal navigation never
// focuses on the composite container, only vertical.
hasNullItem ? nextItemsInRow : nextItems,
activeId2
);
const nextId = hasNullItem ? (nextItem2 == null ? void 0 : nextItem2.id) || null : nextItem2 == null ? void 0 : nextItem2.id;
return nextId;
}
const nextItem = findFirstEnabledItem(nextItemsInRow, activeId2);
if (!nextItem && hasNullItem) {
return null;
}
return nextItem == null ? void 0 : nextItem.id;
};
return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, collection), composite), {
setBaseElement: (element) => composite.setState("baseElement", element),
setActiveId: (id) => composite.setState("activeId", id),
move: (id) => {
if (id === void 0) return;
composite.setState("activeId", id);
composite.setState("moves", (moves) => moves + 1);
},
first: () => {
var _a2;
return (_a2 = findFirstEnabledItem(composite.getState().renderedItems)) == null ? void 0 : _a2.id;
},
last: () => {
var _a2;
return (_a2 = findFirstEnabledItem(reverseArray(composite.getState().renderedItems))) == null ? void 0 : _a2.id;
},
next: (options) => {
if (options !== void 0 && typeof options === "number") {
options = { skip: options };
}
return getNextId("next", options);
},
previous: (options) => {
if (options !== void 0 && typeof options === "number") {
options = { skip: options };
}
return getNextId("previous", options);
},
down: (options) => {
if (options !== void 0 && typeof options === "number") {
options = { skip: options };
}
return getNextId("down", options);
},
up: (options) => {
if (options !== void 0 && typeof options === "number") {
options = { skip: options };
}
return getNextId("up", options);
}
});
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/4CMBR7SL.js
"use client";
// src/composite/composite-store.ts
function useCompositeStoreOptions(props) {
const id = useId(props.id);
return _3YLGPPWQ_spreadValues({ id }, props);
}
function useCompositeStoreProps(store, update, props) {
store = useCollectionStoreProps(store, update, props);
useStoreProps(store, props, "activeId", "setActiveId");
useStoreProps(store, props, "includesBaseElement");
useStoreProps(store, props, "virtualFocus");
useStoreProps(store, props, "orientation");
useStoreProps(store, props, "rtl");
useStoreProps(store, props, "focusLoop");
useStoreProps(store, props, "focusWrap");
useStoreProps(store, props, "focusShift");
return store;
}
function useCompositeStore(props = {}) {
props = useCompositeStoreOptions(props);
const [store, update] = YV4JVR4I_useStore(createCompositeStore, props);
return useCompositeStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/5VQZOHHZ.js
"use client";
// src/composite/utils.ts
var _5VQZOHHZ_NULL_ITEM = { id: null };
function _5VQZOHHZ_flipItems(items, activeId, shouldInsertNullItem = false) {
const index = items.findIndex((item) => item.id === activeId);
return [
...items.slice(index + 1),
...shouldInsertNullItem ? [_5VQZOHHZ_NULL_ITEM] : [],
...items.slice(0, index)
];
}
function _5VQZOHHZ_findFirstEnabledItem(items, excludeId) {
return items.find((item) => {
if (excludeId) {
return !item.disabled && item.id !== excludeId;
}
return !item.disabled;
});
}
function getEnabledItem(store, id) {
if (!id) return null;
return store.item(id) || null;
}
function _5VQZOHHZ_groupItemsByRows(items) {
const rows = [];
for (const item of items) {
const row = rows.find((currentRow) => {
var _a;
return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId;
});
if (row) {
row.push(item);
} else {
rows.push([item]);
}
}
return rows;
}
function selectTextField(element, collapseToEnd = false) {
if (isTextField(element)) {
element.setSelectionRange(
collapseToEnd ? element.value.length : 0,
element.value.length
);
} else if (element.isContentEditable) {
const selection = getDocument(element).getSelection();
selection == null ? void 0 : selection.selectAllChildren(element);
if (collapseToEnd) {
selection == null ? void 0 : selection.collapseToEnd();
}
}
}
var FOCUS_SILENTLY = Symbol("FOCUS_SILENTLY");
function focusSilently(element) {
element[FOCUS_SILENTLY] = true;
element.focus({ preventScroll: true });
}
function silentlyFocused(element) {
const isSilentlyFocused = element[FOCUS_SILENTLY];
delete element[FOCUS_SILENTLY];
return isSilentlyFocused;
}
function isItem(store, element, exclude) {
if (!element) return false;
if (element === exclude) return false;
const item = store.item(element.id);
if (!item) return false;
if (exclude && item.element === exclude) return false;
return true;
}
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// ./node_modules/@ariakit/react-core/esm/__chunks/LMDWO4NN.js
"use client";
// src/utils/system.tsx
function forwardRef2(render) {
const Role = external_React_.forwardRef((props, ref) => render(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { ref })));
Role.displayName = render.displayName || render.name;
return Role;
}
function memo2(Component, propsAreEqual) {
return external_React_.memo(Component, propsAreEqual);
}
function LMDWO4NN_createElement(Type, props) {
const _a = props, { wrapElement, render } = _a, rest = __objRest(_a, ["wrapElement", "render"]);
const mergedRef = useMergeRefs(props.ref, getRefProperty(render));
let element;
if (external_React_.isValidElement(render)) {
const renderProps = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, render.props), { ref: mergedRef });
element = external_React_.cloneElement(render, mergeProps(rest, renderProps));
} else if (render) {
element = render(rest);
} else {
element = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Type, _3YLGPPWQ_spreadValues({}, rest));
}
if (wrapElement) {
return wrapElement(element);
}
return element;
}
function createHook(useProps) {
const useRole = (props = {}) => {
return useProps(props);
};
useRole.displayName = useProps.name;
return useRole;
}
function createStoreContext(providers = [], scopedProviders = []) {
const context = external_React_.createContext(void 0);
const scopedContext = external_React_.createContext(void 0);
const useContext2 = () => external_React_.useContext(context);
const useScopedContext = (onlyScoped = false) => {
const scoped = external_React_.useContext(scopedContext);
const store = useContext2();
if (onlyScoped) return scoped;
return scoped || store;
};
const useProviderContext = () => {
const scoped = external_React_.useContext(scopedContext);
const store = useContext2();
if (scoped && scoped === store) return;
return store;
};
const ContextProvider = (props) => {
return providers.reduceRight(
(children, Provider) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { children })),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(context.Provider, _3YLGPPWQ_spreadValues({}, props))
);
};
const ScopedContextProvider = (props) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextProvider, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { children: scopedProviders.reduceRight(
(children, Provider) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { children })),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(scopedContext.Provider, _3YLGPPWQ_spreadValues({}, props))
) }));
};
return {
context,
scopedContext,
useContext: useContext2,
useScopedContext,
useProviderContext,
ContextProvider,
ScopedContextProvider
};
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/VDHZ5F7K.js
"use client";
// src/collection/collection-context.tsx
var ctx = createStoreContext();
var useCollectionContext = ctx.useContext;
var useCollectionScopedContext = ctx.useScopedContext;
var useCollectionProviderContext = ctx.useProviderContext;
var CollectionContextProvider = ctx.ContextProvider;
var CollectionScopedContextProvider = ctx.ScopedContextProvider;
;// ./node_modules/@ariakit/react-core/esm/__chunks/P7GR5CS5.js
"use client";
// src/composite/composite-context.tsx
var P7GR5CS5_ctx = createStoreContext(
[CollectionContextProvider],
[CollectionScopedContextProvider]
);
var useCompositeContext = P7GR5CS5_ctx.useContext;
var useCompositeScopedContext = P7GR5CS5_ctx.useScopedContext;
var useCompositeProviderContext = P7GR5CS5_ctx.useProviderContext;
var CompositeContextProvider = P7GR5CS5_ctx.ContextProvider;
var CompositeScopedContextProvider = P7GR5CS5_ctx.ScopedContextProvider;
var CompositeItemContext = (0,external_React_.createContext)(
void 0
);
var CompositeRowContext = (0,external_React_.createContext)(
void 0
);
;// ./node_modules/@ariakit/react-core/esm/__chunks/SWN3JYXT.js
"use client";
// src/focusable/focusable-context.tsx
var FocusableContext = (0,external_React_.createContext)(true);
;// ./node_modules/@ariakit/core/esm/utils/focus.js
"use client";
// src/utils/focus.ts
var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";
function hasNegativeTabIndex(element) {
const tabIndex = Number.parseInt(element.getAttribute("tabindex") || "0", 10);
return tabIndex < 0;
}
function isFocusable(element) {
if (!element.matches(selector)) return false;
if (!isVisible(element)) return false;
if (element.closest("[inert]")) return false;
return true;
}
function isTabbable(element) {
if (!isFocusable(element)) return false;
if (hasNegativeTabIndex(element)) return false;
if (!("form" in element)) return true;
if (!element.form) return true;
if (element.checked) return true;
if (element.type !== "radio") return true;
const radioGroup = element.form.elements.namedItem(element.name);
if (!radioGroup) return true;
if (!("length" in radioGroup)) return true;
const activeElement = getActiveElement(element);
if (!activeElement) return true;
if (activeElement === element) return true;
if (!("form" in activeElement)) return true;
if (activeElement.form !== element.form) return true;
if (activeElement.name !== element.name) return true;
return false;
}
function getAllFocusableIn(container, includeContainer) {
const elements = Array.from(
container.querySelectorAll(selector)
);
if (includeContainer) {
elements.unshift(container);
}
const focusableElements = elements.filter(isFocusable);
focusableElements.forEach((element, i) => {
if (isFrame(element) && element.contentDocument) {
const frameBody = element.contentDocument.body;
focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody));
}
});
return focusableElements;
}
function getAllFocusable(includeBody) {
return getAllFocusableIn(document.body, includeBody);
}
function getFirstFocusableIn(container, includeContainer) {
const [first] = getAllFocusableIn(container, includeContainer);
return first || null;
}
function getFirstFocusable(includeBody) {
return getFirstFocusableIn(document.body, includeBody);
}
function getAllTabbableIn(container, includeContainer, fallbackToFocusable) {
const elements = Array.from(
container.querySelectorAll(selector)
);
const tabbableElements = elements.filter(isTabbable);
if (includeContainer && isTabbable(container)) {
tabbableElements.unshift(container);
}
tabbableElements.forEach((element, i) => {
if (isFrame(element) && element.contentDocument) {
const frameBody = element.contentDocument.body;
const allFrameTabbable = getAllTabbableIn(
frameBody,
false,
fallbackToFocusable
);
tabbableElements.splice(i, 1, ...allFrameTabbable);
}
});
if (!tabbableElements.length && fallbackToFocusable) {
return elements;
}
return tabbableElements;
}
function getAllTabbable(fallbackToFocusable) {
return getAllTabbableIn(document.body, false, fallbackToFocusable);
}
function getFirstTabbableIn(container, includeContainer, fallbackToFocusable) {
const [first] = getAllTabbableIn(
container,
includeContainer,
fallbackToFocusable
);
return first || null;
}
function getFirstTabbable(fallbackToFocusable) {
return getFirstTabbableIn(document.body, false, fallbackToFocusable);
}
function getLastTabbableIn(container, includeContainer, fallbackToFocusable) {
const allTabbable = getAllTabbableIn(
container,
includeContainer,
fallbackToFocusable
);
return allTabbable[allTabbable.length - 1] || null;
}
function getLastTabbable(fallbackToFocusable) {
return getLastTabbableIn(document.body, false, fallbackToFocusable);
}
function getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) {
const activeElement = getActiveElement(container);
const allFocusable = getAllFocusableIn(container, includeContainer);
const activeIndex = allFocusable.indexOf(activeElement);
const nextFocusableElements = allFocusable.slice(activeIndex + 1);
return nextFocusableElements.find(isTabbable) || (fallbackToFirst ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? nextFocusableElements[0] : null) || null;
}
function getNextTabbable(fallbackToFirst, fallbackToFocusable) {
return getNextTabbableIn(
document.body,
false,
fallbackToFirst,
fallbackToFocusable
);
}
function getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) {
const activeElement = getActiveElement(container);
const allFocusable = getAllFocusableIn(container, includeContainer).reverse();
const activeIndex = allFocusable.indexOf(activeElement);
const previousFocusableElements = allFocusable.slice(activeIndex + 1);
return previousFocusableElements.find(isTabbable) || (fallbackToLast ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? previousFocusableElements[0] : null) || null;
}
function getPreviousTabbable(fallbackToFirst, fallbackToFocusable) {
return getPreviousTabbableIn(
document.body,
false,
fallbackToFirst,
fallbackToFocusable
);
}
function getClosestFocusable(element) {
while (element && !isFocusable(element)) {
element = element.closest(selector);
}
return element || null;
}
function hasFocus(element) {
const activeElement = getActiveElement(element);
if (!activeElement) return false;
if (activeElement === element) return true;
const activeDescendant = activeElement.getAttribute("aria-activedescendant");
if (!activeDescendant) return false;
return activeDescendant === element.id;
}
function hasFocusWithin(element) {
const activeElement = getActiveElement(element);
if (!activeElement) return false;
if (contains(element, activeElement)) return true;
const activeDescendant = activeElement.getAttribute("aria-activedescendant");
if (!activeDescendant) return false;
if (!("id" in element)) return false;
if (activeDescendant === element.id) return true;
return !!element.querySelector(`#${CSS.escape(activeDescendant)}`);
}
function focusIfNeeded(element) {
if (!hasFocusWithin(element) && isFocusable(element)) {
element.focus();
}
}
function disableFocus(element) {
var _a;
const currentTabindex = (_a = element.getAttribute("tabindex")) != null ? _a : "";
element.setAttribute("data-tabindex", currentTabindex);
element.setAttribute("tabindex", "-1");
}
function disableFocusIn(container, includeContainer) {
const tabbableElements = getAllTabbableIn(container, includeContainer);
for (const element of tabbableElements) {
disableFocus(element);
}
}
function restoreFocusIn(container) {
const elements = container.querySelectorAll("[data-tabindex]");
const restoreTabIndex = (element) => {
const tabindex = element.getAttribute("data-tabindex");
element.removeAttribute("data-tabindex");
if (tabindex) {
element.setAttribute("tabindex", tabindex);
} else {
element.removeAttribute("tabindex");
}
};
if (container.hasAttribute("data-tabindex")) {
restoreTabIndex(container);
}
for (const element of elements) {
restoreTabIndex(element);
}
}
function focusIntoView(element, options) {
if (!("scrollIntoView" in element)) {
element.focus();
} else {
element.focus({ preventScroll: true });
element.scrollIntoView(_chunks_3YLGPPWQ_spreadValues({ block: "nearest", inline: "nearest" }, options));
}
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/LVA2YJMS.js
"use client";
// src/focusable/focusable.tsx
var TagName = "div";
var isSafariBrowser = isSafari();
var alwaysFocusVisibleInputTypes = [
"text",
"search",
"url",
"tel",
"email",
"password",
"number",
"date",
"month",
"week",
"time",
"datetime",
"datetime-local"
];
var safariFocusAncestorSymbol = Symbol("safariFocusAncestor");
function isSafariFocusAncestor(element) {
if (!element) return false;
return !!element[safariFocusAncestorSymbol];
}
function markSafariFocusAncestor(element, value) {
if (!element) return;
element[safariFocusAncestorSymbol] = value;
}
function isAlwaysFocusVisible(element) {
const { tagName, readOnly, type } = element;
if (tagName === "TEXTAREA" && !readOnly) return true;
if (tagName === "SELECT" && !readOnly) return true;
if (tagName === "INPUT" && !readOnly) {
return alwaysFocusVisibleInputTypes.includes(type);
}
if (element.isContentEditable) return true;
const role = element.getAttribute("role");
if (role === "combobox" && element.dataset.name) {
return true;
}
return false;
}
function getLabels(element) {
if ("labels" in element) {
return element.labels;
}
return null;
}
function isNativeCheckboxOrRadio(element) {
const tagName = element.tagName.toLowerCase();
if (tagName === "input" && element.type) {
return element.type === "radio" || element.type === "checkbox";
}
return false;
}
function isNativeTabbable(tagName) {
if (!tagName) return true;
return tagName === "button" || tagName === "summary" || tagName === "input" || tagName === "select" || tagName === "textarea" || tagName === "a";
}
function supportsDisabledAttribute(tagName) {
if (!tagName) return true;
return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea";
}
function getTabIndex(focusable, trulyDisabled, nativeTabbable, supportsDisabled, tabIndexProp) {
if (!focusable) {
return tabIndexProp;
}
if (trulyDisabled) {
if (nativeTabbable && !supportsDisabled) {
return -1;
}
return;
}
if (nativeTabbable) {
return tabIndexProp;
}
return tabIndexProp || 0;
}
function useDisableEvent(onEvent, disabled) {
return useEvent((event) => {
onEvent == null ? void 0 : onEvent(event);
if (event.defaultPrevented) return;
if (disabled) {
event.stopPropagation();
event.preventDefault();
}
});
}
var isKeyboardModality = true;
function onGlobalMouseDown(event) {
const target = event.target;
if (target && "hasAttribute" in target) {
if (!target.hasAttribute("data-focus-visible")) {
isKeyboardModality = false;
}
}
}
function onGlobalKeyDown(event) {
if (event.metaKey) return;
if (event.ctrlKey) return;
if (event.altKey) return;
isKeyboardModality = true;
}
var useFocusable = createHook(
function useFocusable2(_a) {
var _b = _a, {
focusable = true,
accessibleWhenDisabled,
autoFocus,
onFocusVisible
} = _b, props = __objRest(_b, [
"focusable",
"accessibleWhenDisabled",
"autoFocus",
"onFocusVisible"
]);
const ref = (0,external_React_.useRef)(null);
(0,external_React_.useEffect)(() => {
if (!focusable) return;
addGlobalEventListener("mousedown", onGlobalMouseDown, true);
addGlobalEventListener("keydown", onGlobalKeyDown, true);
}, [focusable]);
if (isSafariBrowser) {
(0,external_React_.useEffect)(() => {
if (!focusable) return;
const element = ref.current;
if (!element) return;
if (!isNativeCheckboxOrRadio(element)) return;
const labels = getLabels(element);
if (!labels) return;
const onMouseUp = () => queueMicrotask(() => element.focus());
for (const label of labels) {
label.addEventListener("mouseup", onMouseUp);
}
return () => {
for (const label of labels) {
label.removeEventListener("mouseup", onMouseUp);
}
};
}, [focusable]);
}
const disabled = focusable && disabledFromProps(props);
const trulyDisabled = !!disabled && !accessibleWhenDisabled;
const [focusVisible, setFocusVisible] = (0,external_React_.useState)(false);
(0,external_React_.useEffect)(() => {
if (!focusable) return;
if (trulyDisabled && focusVisible) {
setFocusVisible(false);
}
}, [focusable, trulyDisabled, focusVisible]);
(0,external_React_.useEffect)(() => {
if (!focusable) return;
if (!focusVisible) return;
const element = ref.current;
if (!element) return;
if (typeof IntersectionObserver === "undefined") return;
const observer = new IntersectionObserver(() => {
if (!isFocusable(element)) {
setFocusVisible(false);
}
});
observer.observe(element);
return () => observer.disconnect();
}, [focusable, focusVisible]);
const onKeyPressCapture = useDisableEvent(
props.onKeyPressCapture,
disabled
);
const onMouseDownCapture = useDisableEvent(
props.onMouseDownCapture,
disabled
);
const onClickCapture = useDisableEvent(props.onClickCapture, disabled);
const onMouseDownProp = props.onMouseDown;
const onMouseDown = useEvent((event) => {
onMouseDownProp == null ? void 0 : onMouseDownProp(event);
if (event.defaultPrevented) return;
if (!focusable) return;
const element = event.currentTarget;
if (!isSafariBrowser) return;
if (isPortalEvent(event)) return;
if (!isButton(element) && !isNativeCheckboxOrRadio(element)) return;
let receivedFocus = false;
const onFocus = () => {
receivedFocus = true;
};
const options = { capture: true, once: true };
element.addEventListener("focusin", onFocus, options);
const focusableContainer = getClosestFocusable(element.parentElement);
markSafariFocusAncestor(focusableContainer, true);
queueBeforeEvent(element, "mouseup", () => {
element.removeEventListener("focusin", onFocus, true);
markSafariFocusAncestor(focusableContainer, false);
if (receivedFocus) return;
focusIfNeeded(element);
});
});
const handleFocusVisible = (event, currentTarget) => {
if (currentTarget) {
event.currentTarget = currentTarget;
}
if (!focusable) return;
const element = event.currentTarget;
if (!element) return;
if (!hasFocus(element)) return;
onFocusVisible == null ? void 0 : onFocusVisible(event);
if (event.defaultPrevented) return;
element.dataset.focusVisible = "true";
setFocusVisible(true);
};
const onKeyDownCaptureProp = props.onKeyDownCapture;
const onKeyDownCapture = useEvent((event) => {
onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event);
if (event.defaultPrevented) return;
if (!focusable) return;
if (focusVisible) return;
if (event.metaKey) return;
if (event.altKey) return;
if (event.ctrlKey) return;
if (!isSelfTarget(event)) return;
const element = event.currentTarget;
const applyFocusVisible = () => handleFocusVisible(event, element);
queueBeforeEvent(element, "focusout", applyFocusVisible);
});
const onFocusCaptureProp = props.onFocusCapture;
const onFocusCapture = useEvent((event) => {
onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event);
if (event.defaultPrevented) return;
if (!focusable) return;
if (!isSelfTarget(event)) {
setFocusVisible(false);
return;
}
const element = event.currentTarget;
const applyFocusVisible = () => handleFocusVisible(event, element);
if (isKeyboardModality || isAlwaysFocusVisible(event.target)) {
queueBeforeEvent(event.target, "focusout", applyFocusVisible);
} else {
setFocusVisible(false);
}
});
const onBlurProp = props.onBlur;
const onBlur = useEvent((event) => {
onBlurProp == null ? void 0 : onBlurProp(event);
if (!focusable) return;
if (!isFocusEventOutside(event)) return;
setFocusVisible(false);
});
const autoFocusOnShow = (0,external_React_.useContext)(FocusableContext);
const autoFocusRef = useEvent((element) => {
if (!focusable) return;
if (!autoFocus) return;
if (!element) return;
if (!autoFocusOnShow) return;
queueMicrotask(() => {
if (hasFocus(element)) return;
if (!isFocusable(element)) return;
element.focus();
});
});
const tagName = useTagName(ref);
const nativeTabbable = focusable && isNativeTabbable(tagName);
const supportsDisabled = focusable && supportsDisabledAttribute(tagName);
const styleProp = props.style;
const style = (0,external_React_.useMemo)(() => {
if (trulyDisabled) {
return _3YLGPPWQ_spreadValues({ pointerEvents: "none" }, styleProp);
}
return styleProp;
}, [trulyDisabled, styleProp]);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
"data-focus-visible": focusable && focusVisible || void 0,
"data-autofocus": autoFocus || void 0,
"aria-disabled": disabled || void 0
}, props), {
ref: useMergeRefs(ref, autoFocusRef, props.ref),
style,
tabIndex: getTabIndex(
focusable,
trulyDisabled,
nativeTabbable,
supportsDisabled,
props.tabIndex
),
disabled: supportsDisabled && trulyDisabled ? true : void 0,
// TODO: Test Focusable contentEditable.
contentEditable: disabled ? void 0 : props.contentEditable,
onKeyPressCapture,
onClickCapture,
onMouseDownCapture,
onMouseDown,
onKeyDownCapture,
onFocusCapture,
onBlur
});
return removeUndefinedValues(props);
}
);
var Focusable = forwardRef2(function Focusable2(props) {
const htmlProps = useFocusable(props);
return LMDWO4NN_createElement(TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/ITI7HKP4.js
"use client";
// src/composite/composite.tsx
var ITI7HKP4_TagName = "div";
function isGrid(items) {
return items.some((item) => !!item.rowId);
}
function isPrintableKey(event) {
const target = event.target;
if (target && !isTextField(target)) return false;
return event.key.length === 1 && !event.ctrlKey && !event.metaKey;
}
function isModifierKey(event) {
return event.key === "Shift" || event.key === "Control" || event.key === "Alt" || event.key === "Meta";
}
function useKeyboardEventProxy(store, onKeyboardEvent, previousElementRef) {
return useEvent((event) => {
var _a;
onKeyboardEvent == null ? void 0 : onKeyboardEvent(event);
if (event.defaultPrevented) return;
if (event.isPropagationStopped()) return;
if (!isSelfTarget(event)) return;
if (isModifierKey(event)) return;
if (isPrintableKey(event)) return;
const state = store.getState();
const activeElement = (_a = getEnabledItem(store, state.activeId)) == null ? void 0 : _a.element;
if (!activeElement) return;
const _b = event, { view } = _b, eventInit = __objRest(_b, ["view"]);
const previousElement = previousElementRef == null ? void 0 : previousElementRef.current;
if (activeElement !== previousElement) {
activeElement.focus();
}
if (!fireKeyboardEvent(activeElement, event.type, eventInit)) {
event.preventDefault();
}
if (event.currentTarget.contains(activeElement)) {
event.stopPropagation();
}
});
}
function findFirstEnabledItemInTheLastRow(items) {
return _5VQZOHHZ_findFirstEnabledItem(
flatten2DArray(reverseArray(_5VQZOHHZ_groupItemsByRows(items)))
);
}
function useScheduleFocus(store) {
const [scheduled, setScheduled] = (0,external_React_.useState)(false);
const schedule = (0,external_React_.useCallback)(() => setScheduled(true), []);
const activeItem = store.useState(
(state) => getEnabledItem(store, state.activeId)
);
(0,external_React_.useEffect)(() => {
const activeElement = activeItem == null ? void 0 : activeItem.element;
if (!scheduled) return;
if (!activeElement) return;
setScheduled(false);
activeElement.focus({ preventScroll: true });
}, [activeItem, scheduled]);
return schedule;
}
var useComposite = createHook(
function useComposite2(_a) {
var _b = _a, {
store,
composite = true,
focusOnMove = composite,
moveOnKeyPress = true
} = _b, props = __objRest(_b, [
"store",
"composite",
"focusOnMove",
"moveOnKeyPress"
]);
const context = useCompositeProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const ref = (0,external_React_.useRef)(null);
const previousElementRef = (0,external_React_.useRef)(null);
const scheduleFocus = useScheduleFocus(store);
const moves = store.useState("moves");
const [, setBaseElement] = useTransactionState(
composite ? store.setBaseElement : null
);
(0,external_React_.useEffect)(() => {
var _a2;
if (!store) return;
if (!moves) return;
if (!composite) return;
if (!focusOnMove) return;
const { activeId: activeId2 } = store.getState();
const itemElement = (_a2 = getEnabledItem(store, activeId2)) == null ? void 0 : _a2.element;
if (!itemElement) return;
focusIntoView(itemElement);
}, [store, moves, composite, focusOnMove]);
useSafeLayoutEffect(() => {
if (!store) return;
if (!moves) return;
if (!composite) return;
const { baseElement, activeId: activeId2 } = store.getState();
const isSelfAcive = activeId2 === null;
if (!isSelfAcive) return;
if (!baseElement) return;
const previousElement = previousElementRef.current;
previousElementRef.current = null;
if (previousElement) {
fireBlurEvent(previousElement, { relatedTarget: baseElement });
}
if (!hasFocus(baseElement)) {
baseElement.focus();
}
}, [store, moves, composite]);
const activeId = store.useState("activeId");
const virtualFocus = store.useState("virtualFocus");
useSafeLayoutEffect(() => {
var _a2;
if (!store) return;
if (!composite) return;
if (!virtualFocus) return;
const previousElement = previousElementRef.current;
previousElementRef.current = null;
if (!previousElement) return;
const activeElement = (_a2 = getEnabledItem(store, activeId)) == null ? void 0 : _a2.element;
const relatedTarget = activeElement || getActiveElement(previousElement);
if (relatedTarget === previousElement) return;
fireBlurEvent(previousElement, { relatedTarget });
}, [store, activeId, virtualFocus, composite]);
const onKeyDownCapture = useKeyboardEventProxy(
store,
props.onKeyDownCapture,
previousElementRef
);
const onKeyUpCapture = useKeyboardEventProxy(
store,
props.onKeyUpCapture,
previousElementRef
);
const onFocusCaptureProp = props.onFocusCapture;
const onFocusCapture = useEvent((event) => {
onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event);
if (event.defaultPrevented) return;
if (!store) return;
const { virtualFocus: virtualFocus2 } = store.getState();
if (!virtualFocus2) return;
const previousActiveElement = event.relatedTarget;
const isSilentlyFocused = silentlyFocused(event.currentTarget);
if (isSelfTarget(event) && isSilentlyFocused) {
event.stopPropagation();
previousElementRef.current = previousActiveElement;
}
});
const onFocusProp = props.onFocus;
const onFocus = useEvent((event) => {
onFocusProp == null ? void 0 : onFocusProp(event);
if (event.defaultPrevented) return;
if (!composite) return;
if (!store) return;
const { relatedTarget } = event;
const { virtualFocus: virtualFocus2 } = store.getState();
if (virtualFocus2) {
if (isSelfTarget(event) && !isItem(store, relatedTarget)) {
queueMicrotask(scheduleFocus);
}
} else if (isSelfTarget(event)) {
store.setActiveId(null);
}
});
const onBlurCaptureProp = props.onBlurCapture;
const onBlurCapture = useEvent((event) => {
var _a2;
onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event);
if (event.defaultPrevented) return;
if (!store) return;
const { virtualFocus: virtualFocus2, activeId: activeId2 } = store.getState();
if (!virtualFocus2) return;
const activeElement = (_a2 = getEnabledItem(store, activeId2)) == null ? void 0 : _a2.element;
const nextActiveElement = event.relatedTarget;
const nextActiveElementIsItem = isItem(store, nextActiveElement);
const previousElement = previousElementRef.current;
previousElementRef.current = null;
if (isSelfTarget(event) && nextActiveElementIsItem) {
if (nextActiveElement === activeElement) {
if (previousElement && previousElement !== nextActiveElement) {
fireBlurEvent(previousElement, event);
}
} else if (activeElement) {
fireBlurEvent(activeElement, event);
} else if (previousElement) {
fireBlurEvent(previousElement, event);
}
event.stopPropagation();
} else {
const targetIsItem = isItem(store, event.target);
if (!targetIsItem && activeElement) {
fireBlurEvent(activeElement, event);
}
}
});
const onKeyDownProp = props.onKeyDown;
const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
const onKeyDown = useEvent((event) => {
var _a2;
onKeyDownProp == null ? void 0 : onKeyDownProp(event);
if (event.defaultPrevented) return;
if (!store) return;
if (!isSelfTarget(event)) return;
const { orientation, renderedItems, activeId: activeId2 } = store.getState();
const activeItem = getEnabledItem(store, activeId2);
if ((_a2 = activeItem == null ? void 0 : activeItem.element) == null ? void 0 : _a2.isConnected) return;
const isVertical = orientation !== "horizontal";
const isHorizontal = orientation !== "vertical";
const grid = isGrid(renderedItems);
const isHorizontalKey = event.key === "ArrowLeft" || event.key === "ArrowRight" || event.key === "Home" || event.key === "End";
if (isHorizontalKey && isTextField(event.currentTarget)) return;
const up = () => {
if (grid) {
const item = findFirstEnabledItemInTheLastRow(renderedItems);
return item == null ? void 0 : item.id;
}
return store == null ? void 0 : store.last();
};
const keyMap = {
ArrowUp: (grid || isVertical) && up,
ArrowRight: (grid || isHorizontal) && store.first,
ArrowDown: (grid || isVertical) && store.first,
ArrowLeft: (grid || isHorizontal) && store.last,
Home: store.first,
End: store.last,
PageUp: store.first,
PageDown: store.last
};
const action = keyMap[event.key];
if (action) {
const id = action();
if (id !== void 0) {
if (!moveOnKeyPressProp(event)) return;
event.preventDefault();
store.move(id);
}
}
});
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeContextProvider, { value: store, children: element }),
[store]
);
const activeDescendant = store.useState((state) => {
var _a2;
if (!store) return;
if (!composite) return;
if (!state.virtualFocus) return;
return (_a2 = getEnabledItem(store, state.activeId)) == null ? void 0 : _a2.id;
});
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
"aria-activedescendant": activeDescendant
}, props), {
ref: useMergeRefs(ref, setBaseElement, props.ref),
onKeyDownCapture,
onKeyUpCapture,
onFocusCapture,
onFocus,
onBlurCapture,
onKeyDown
});
const focusable = store.useState(
(state) => composite && (state.virtualFocus || state.activeId === null)
);
props = useFocusable(_3YLGPPWQ_spreadValues({ focusable }, props));
return props;
}
);
var Composite = forwardRef2(function Composite2(props) {
const htmlProps = useComposite(props);
return LMDWO4NN_createElement(ITI7HKP4_TagName, htmlProps);
});
;// ./node_modules/@wordpress/components/build-module/composite/context.js
const CompositeContext = (0,external_wp_element_namespaceObject.createContext)({});
CompositeContext.displayName = "CompositeContext";
const context_useCompositeContext = () => (0,external_wp_element_namespaceObject.useContext)(CompositeContext);
;// ./node_modules/@ariakit/react-core/esm/__chunks/7HVFURXT.js
"use client";
// src/group/group-label-context.tsx
var GroupLabelContext = (0,external_React_.createContext)(void 0);
;// ./node_modules/@ariakit/react-core/esm/__chunks/36LIF33V.js
"use client";
// src/group/group.tsx
var _36LIF33V_TagName = "div";
var useGroup = createHook(
function useGroup2(props) {
const [labelId, setLabelId] = (0,external_React_.useState)();
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GroupLabelContext.Provider, { value: setLabelId, children: element }),
[]
);
props = _3YLGPPWQ_spreadValues({
role: "group",
"aria-labelledby": labelId
}, props);
return removeUndefinedValues(props);
}
);
var Group = forwardRef2(function Group2(props) {
const htmlProps = useGroup(props);
return LMDWO4NN_createElement(_36LIF33V_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/YORGHBM4.js
"use client";
// src/composite/composite-group.tsx
var YORGHBM4_TagName = "div";
var useCompositeGroup = createHook(
function useCompositeGroup2(_a) {
var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
props = useGroup(props);
return props;
}
);
var CompositeGroup = forwardRef2(function CompositeGroup2(props) {
const htmlProps = useCompositeGroup(props);
return LMDWO4NN_createElement(YORGHBM4_TagName, htmlProps);
});
;// ./node_modules/@wordpress/components/build-module/composite/group.js
const group_CompositeGroup = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeGroup2(props, ref) {
var _props$store;
const context = context_useCompositeContext();
const store = (_props$store = props.store) !== null && _props$store !== void 0 ? _props$store : context.store;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeGroup, {
store,
...props,
ref
});
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/YUOJWFSO.js
"use client";
// src/group/group-label.tsx
var YUOJWFSO_TagName = "div";
var useGroupLabel = createHook(
function useGroupLabel2(props) {
const setLabelId = (0,external_React_.useContext)(GroupLabelContext);
const id = useId(props.id);
useSafeLayoutEffect(() => {
setLabelId == null ? void 0 : setLabelId(id);
return () => setLabelId == null ? void 0 : setLabelId(void 0);
}, [setLabelId, id]);
props = _3YLGPPWQ_spreadValues({
id,
"aria-hidden": true
}, props);
return removeUndefinedValues(props);
}
);
var GroupLabel = forwardRef2(function GroupLabel2(props) {
const htmlProps = useGroupLabel(props);
return LMDWO4NN_createElement(YUOJWFSO_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/SWSPTQMT.js
"use client";
// src/composite/composite-group-label.tsx
var SWSPTQMT_TagName = "div";
var useCompositeGroupLabel = createHook(function useCompositeGroupLabel2(_a) {
var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
props = useGroupLabel(props);
return props;
});
var CompositeGroupLabel = forwardRef2(function CompositeGroupLabel2(props) {
const htmlProps = useCompositeGroupLabel(props);
return LMDWO4NN_createElement(SWSPTQMT_TagName, htmlProps);
});
;// ./node_modules/@wordpress/components/build-module/composite/group-label.js
const group_label_CompositeGroupLabel = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeGroupLabel2(props, ref) {
var _props$store;
const context = context_useCompositeContext();
const store = (_props$store = props.store) !== null && _props$store !== void 0 ? _props$store : context.store;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeGroupLabel, {
store,
...props,
ref
});
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/UQQRIHDV.js
"use client";
// src/composite/composite-hover.tsx
var UQQRIHDV_TagName = "div";
function getMouseDestination(event) {
const relatedTarget = event.relatedTarget;
if ((relatedTarget == null ? void 0 : relatedTarget.nodeType) === Node.ELEMENT_NODE) {
return relatedTarget;
}
return null;
}
function hoveringInside(event) {
const nextElement = getMouseDestination(event);
if (!nextElement) return false;
return contains(event.currentTarget, nextElement);
}
var symbol = Symbol("composite-hover");
function movingToAnotherItem(event) {
let dest = getMouseDestination(event);
if (!dest) return false;
do {
if (PBFD2E7P_hasOwnProperty(dest, symbol) && dest[symbol]) return true;
dest = dest.parentElement;
} while (dest);
return false;
}
var useCompositeHover = createHook(
function useCompositeHover2(_a) {
var _b = _a, {
store,
focusOnHover = true,
blurOnHoverEnd = !!focusOnHover
} = _b, props = __objRest(_b, [
"store",
"focusOnHover",
"blurOnHoverEnd"
]);
const context = useCompositeContext();
store = store || context;
invariant(
store,
false && 0
);
const isMouseMoving = useIsMouseMoving();
const onMouseMoveProp = props.onMouseMove;
const focusOnHoverProp = useBooleanEvent(focusOnHover);
const onMouseMove = useEvent((event) => {
onMouseMoveProp == null ? void 0 : onMouseMoveProp(event);
if (event.defaultPrevented) return;
if (!isMouseMoving()) return;
if (!focusOnHoverProp(event)) return;
if (!hasFocusWithin(event.currentTarget)) {
const baseElement = store == null ? void 0 : store.getState().baseElement;
if (baseElement && !hasFocus(baseElement)) {
baseElement.focus();
}
}
store == null ? void 0 : store.setActiveId(event.currentTarget.id);
});
const onMouseLeaveProp = props.onMouseLeave;
const blurOnHoverEndProp = useBooleanEvent(blurOnHoverEnd);
const onMouseLeave = useEvent((event) => {
var _a2;
onMouseLeaveProp == null ? void 0 : onMouseLeaveProp(event);
if (event.defaultPrevented) return;
if (!isMouseMoving()) return;
if (hoveringInside(event)) return;
if (movingToAnotherItem(event)) return;
if (!focusOnHoverProp(event)) return;
if (!blurOnHoverEndProp(event)) return;
store == null ? void 0 : store.setActiveId(null);
(_a2 = store == null ? void 0 : store.getState().baseElement) == null ? void 0 : _a2.focus();
});
const ref = (0,external_React_.useCallback)((element) => {
if (!element) return;
element[symbol] = true;
}, []);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
ref: useMergeRefs(ref, props.ref),
onMouseMove,
onMouseLeave
});
return removeUndefinedValues(props);
}
);
var CompositeHover = memo2(
forwardRef2(function CompositeHover2(props) {
const htmlProps = useCompositeHover(props);
return LMDWO4NN_createElement(UQQRIHDV_TagName, htmlProps);
})
);
;// ./node_modules/@wordpress/components/build-module/composite/hover.js
const hover_CompositeHover = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeHover2(props, ref) {
var _props$store;
const context = context_useCompositeContext();
const store = (_props$store = props.store) !== null && _props$store !== void 0 ? _props$store : context.store;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeHover, {
store,
...props,
ref
});
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/RZ4GPYOB.js
"use client";
// src/collection/collection-item.tsx
var RZ4GPYOB_TagName = "div";
var useCollectionItem = createHook(
function useCollectionItem2(_a) {
var _b = _a, {
store,
shouldRegisterItem = true,
getItem = identity,
element: element
} = _b, props = __objRest(_b, [
"store",
"shouldRegisterItem",
"getItem",
// @ts-expect-error This prop may come from a collection renderer.
"element"
]);
const context = useCollectionContext();
store = store || context;
const id = useId(props.id);
const ref = (0,external_React_.useRef)(element);
(0,external_React_.useEffect)(() => {
const element2 = ref.current;
if (!id) return;
if (!element2) return;
if (!shouldRegisterItem) return;
const item = getItem({ id, element: element2 });
return store == null ? void 0 : store.renderItem(item);
}, [id, shouldRegisterItem, getItem, store]);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
ref: useMergeRefs(ref, props.ref)
});
return removeUndefinedValues(props);
}
);
var CollectionItem = forwardRef2(function CollectionItem2(props) {
const htmlProps = useCollectionItem(props);
return LMDWO4NN_createElement(RZ4GPYOB_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/KUU7WJ55.js
"use client";
// src/command/command.tsx
var KUU7WJ55_TagName = "button";
function isNativeClick(event) {
if (!event.isTrusted) return false;
const element = event.currentTarget;
if (event.key === "Enter") {
return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "A";
}
if (event.key === " ") {
return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "INPUT" || element.tagName === "SELECT";
}
return false;
}
var KUU7WJ55_symbol = Symbol("command");
var useCommand = createHook(
function useCommand2(_a) {
var _b = _a, { clickOnEnter = true, clickOnSpace = true } = _b, props = __objRest(_b, ["clickOnEnter", "clickOnSpace"]);
const ref = (0,external_React_.useRef)(null);
const [isNativeButton, setIsNativeButton] = (0,external_React_.useState)(false);
(0,external_React_.useEffect)(() => {
if (!ref.current) return;
setIsNativeButton(isButton(ref.current));
}, []);
const [active, setActive] = (0,external_React_.useState)(false);
const activeRef = (0,external_React_.useRef)(false);
const disabled = disabledFromProps(props);
const [isDuplicate, metadataProps] = useMetadataProps(props, KUU7WJ55_symbol, true);
const onKeyDownProp = props.onKeyDown;
const onKeyDown = useEvent((event) => {
onKeyDownProp == null ? void 0 : onKeyDownProp(event);
const element = event.currentTarget;
if (event.defaultPrevented) return;
if (isDuplicate) return;
if (disabled) return;
if (!isSelfTarget(event)) return;
if (isTextField(element)) return;
if (element.isContentEditable) return;
const isEnter = clickOnEnter && event.key === "Enter";
const isSpace = clickOnSpace && event.key === " ";
const shouldPreventEnter = event.key === "Enter" && !clickOnEnter;
const shouldPreventSpace = event.key === " " && !clickOnSpace;
if (shouldPreventEnter || shouldPreventSpace) {
event.preventDefault();
return;
}
if (isEnter || isSpace) {
const nativeClick = isNativeClick(event);
if (isEnter) {
if (!nativeClick) {
event.preventDefault();
const _a2 = event, { view } = _a2, eventInit = __objRest(_a2, ["view"]);
const click = () => fireClickEvent(element, eventInit);
if (isFirefox()) {
queueBeforeEvent(element, "keyup", click);
} else {
queueMicrotask(click);
}
}
} else if (isSpace) {
activeRef.current = true;
if (!nativeClick) {
event.preventDefault();
setActive(true);
}
}
}
});
const onKeyUpProp = props.onKeyUp;
const onKeyUp = useEvent((event) => {
onKeyUpProp == null ? void 0 : onKeyUpProp(event);
if (event.defaultPrevented) return;
if (isDuplicate) return;
if (disabled) return;
if (event.metaKey) return;
const isSpace = clickOnSpace && event.key === " ";
if (activeRef.current && isSpace) {
activeRef.current = false;
if (!isNativeClick(event)) {
event.preventDefault();
setActive(false);
const element = event.currentTarget;
const _a2 = event, { view } = _a2, eventInit = __objRest(_a2, ["view"]);
queueMicrotask(() => fireClickEvent(element, eventInit));
}
}
});
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues(_3YLGPPWQ_spreadValues({
"data-active": active || void 0,
type: isNativeButton ? "button" : void 0
}, metadataProps), props), {
ref: useMergeRefs(ref, props.ref),
onKeyDown,
onKeyUp
});
props = useFocusable(props);
return props;
}
);
var Command = forwardRef2(function Command2(props) {
const htmlProps = useCommand(props);
return LMDWO4NN_createElement(KUU7WJ55_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/P2CTZE2T.js
"use client";
// src/composite/composite-item.tsx
var P2CTZE2T_TagName = "button";
function isEditableElement(element) {
if (isTextbox(element)) return true;
return element.tagName === "INPUT" && !isButton(element);
}
function getNextPageOffset(scrollingElement, pageUp = false) {
const height = scrollingElement.clientHeight;
const { top } = scrollingElement.getBoundingClientRect();
const pageSize = Math.max(height * 0.875, height - 40) * 1.5;
const pageOffset = pageUp ? height - pageSize + top : pageSize + top;
if (scrollingElement.tagName === "HTML") {
return pageOffset + scrollingElement.scrollTop;
}
return pageOffset;
}
function getItemOffset(itemElement, pageUp = false) {
const { top } = itemElement.getBoundingClientRect();
if (pageUp) {
return top + itemElement.clientHeight;
}
return top;
}
function findNextPageItemId(element, store, next, pageUp = false) {
var _a;
if (!store) return;
if (!next) return;
const { renderedItems } = store.getState();
const scrollingElement = getScrollingElement(element);
if (!scrollingElement) return;
const nextPageOffset = getNextPageOffset(scrollingElement, pageUp);
let id;
let prevDifference;
for (let i = 0; i < renderedItems.length; i += 1) {
const previousId = id;
id = next(i);
if (!id) break;
if (id === previousId) continue;
const itemElement = (_a = getEnabledItem(store, id)) == null ? void 0 : _a.element;
if (!itemElement) continue;
const itemOffset = getItemOffset(itemElement, pageUp);
const difference = itemOffset - nextPageOffset;
const absDifference = Math.abs(difference);
if (pageUp && difference <= 0 || !pageUp && difference >= 0) {
if (prevDifference !== void 0 && prevDifference < absDifference) {
id = previousId;
}
break;
}
prevDifference = absDifference;
}
return id;
}
function targetIsAnotherItem(event, store) {
if (isSelfTarget(event)) return false;
return isItem(store, event.target);
}
var useCompositeItem = createHook(
function useCompositeItem2(_a) {
var _b = _a, {
store,
rowId: rowIdProp,
preventScrollOnKeyDown = false,
moveOnKeyPress = true,
tabbable = false,
getItem: getItemProp,
"aria-setsize": ariaSetSizeProp,
"aria-posinset": ariaPosInSetProp
} = _b, props = __objRest(_b, [
"store",
"rowId",
"preventScrollOnKeyDown",
"moveOnKeyPress",
"tabbable",
"getItem",
"aria-setsize",
"aria-posinset"
]);
const context = useCompositeContext();
store = store || context;
const id = useId(props.id);
const ref = (0,external_React_.useRef)(null);
const row = (0,external_React_.useContext)(CompositeRowContext);
const disabled = disabledFromProps(props);
const trulyDisabled = disabled && !props.accessibleWhenDisabled;
const {
rowId,
baseElement,
isActiveItem,
ariaSetSize,
ariaPosInSet,
isTabbable
} = useStoreStateObject(store, {
rowId(state) {
if (rowIdProp) return rowIdProp;
if (!state) return;
if (!(row == null ? void 0 : row.baseElement)) return;
if (row.baseElement !== state.baseElement) return;
return row.id;
},
baseElement(state) {
return (state == null ? void 0 : state.baseElement) || void 0;
},
isActiveItem(state) {
return !!state && state.activeId === id;
},
ariaSetSize(state) {
if (ariaSetSizeProp != null) return ariaSetSizeProp;
if (!state) return;
if (!(row == null ? void 0 : row.ariaSetSize)) return;
if (row.baseElement !== state.baseElement) return;
return row.ariaSetSize;
},
ariaPosInSet(state) {
if (ariaPosInSetProp != null) return ariaPosInSetProp;
if (!state) return;
if (!(row == null ? void 0 : row.ariaPosInSet)) return;
if (row.baseElement !== state.baseElement) return;
const itemsInRow = state.renderedItems.filter(
(item) => item.rowId === rowId
);
return row.ariaPosInSet + itemsInRow.findIndex((item) => item.id === id);
},
isTabbable(state) {
if (!(state == null ? void 0 : state.renderedItems.length)) return true;
if (state.virtualFocus) return false;
if (tabbable) return true;
if (state.activeId === null) return false;
const item = store == null ? void 0 : store.item(state.activeId);
if (item == null ? void 0 : item.disabled) return true;
if (!(item == null ? void 0 : item.element)) return true;
return state.activeId === id;
}
});
const getItem = (0,external_React_.useCallback)(
(item) => {
var _a2;
const nextItem = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, item), {
id: id || item.id,
rowId,
disabled: !!trulyDisabled,
children: (_a2 = item.element) == null ? void 0 : _a2.textContent
});
if (getItemProp) {
return getItemProp(nextItem);
}
return nextItem;
},
[id, rowId, trulyDisabled, getItemProp]
);
const onFocusProp = props.onFocus;
const hasFocusedComposite = (0,external_React_.useRef)(false);
const onFocus = useEvent((event) => {
onFocusProp == null ? void 0 : onFocusProp(event);
if (event.defaultPrevented) return;
if (isPortalEvent(event)) return;
if (!id) return;
if (!store) return;
if (targetIsAnotherItem(event, store)) return;
const { virtualFocus, baseElement: baseElement2 } = store.getState();
store.setActiveId(id);
if (isTextbox(event.currentTarget)) {
selectTextField(event.currentTarget);
}
if (!virtualFocus) return;
if (!isSelfTarget(event)) return;
if (isEditableElement(event.currentTarget)) return;
if (!(baseElement2 == null ? void 0 : baseElement2.isConnected)) return;
if (isSafari() && event.currentTarget.hasAttribute("data-autofocus")) {
event.currentTarget.scrollIntoView({
block: "nearest",
inline: "nearest"
});
}
hasFocusedComposite.current = true;
const fromComposite = event.relatedTarget === baseElement2 || isItem(store, event.relatedTarget);
if (fromComposite) {
focusSilently(baseElement2);
} else {
baseElement2.focus();
}
});
const onBlurCaptureProp = props.onBlurCapture;
const onBlurCapture = useEvent((event) => {
onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event);
if (event.defaultPrevented) return;
const state = store == null ? void 0 : store.getState();
if ((state == null ? void 0 : state.virtualFocus) && hasFocusedComposite.current) {
hasFocusedComposite.current = false;
event.preventDefault();
event.stopPropagation();
}
});
const onKeyDownProp = props.onKeyDown;
const preventScrollOnKeyDownProp = useBooleanEvent(preventScrollOnKeyDown);
const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
const onKeyDown = useEvent((event) => {
onKeyDownProp == null ? void 0 : onKeyDownProp(event);
if (event.defaultPrevented) return;
if (!isSelfTarget(event)) return;
if (!store) return;
const { currentTarget } = event;
const state = store.getState();
const item = store.item(id);
const isGrid = !!(item == null ? void 0 : item.rowId);
const isVertical = state.orientation !== "horizontal";
const isHorizontal = state.orientation !== "vertical";
const canHomeEnd = () => {
if (isGrid) return true;
if (isHorizontal) return true;
if (!state.baseElement) return true;
if (!isTextField(state.baseElement)) return true;
return false;
};
const keyMap = {
ArrowUp: (isGrid || isVertical) && store.up,
ArrowRight: (isGrid || isHorizontal) && store.next,
ArrowDown: (isGrid || isVertical) && store.down,
ArrowLeft: (isGrid || isHorizontal) && store.previous,
Home: () => {
if (!canHomeEnd()) return;
if (!isGrid || event.ctrlKey) {
return store == null ? void 0 : store.first();
}
return store == null ? void 0 : store.previous(-1);
},
End: () => {
if (!canHomeEnd()) return;
if (!isGrid || event.ctrlKey) {
return store == null ? void 0 : store.last();
}
return store == null ? void 0 : store.next(-1);
},
PageUp: () => {
return findNextPageItemId(currentTarget, store, store == null ? void 0 : store.up, true);
},
PageDown: () => {
return findNextPageItemId(currentTarget, store, store == null ? void 0 : store.down);
}
};
const action = keyMap[event.key];
if (action) {
if (isTextbox(currentTarget)) {
const selection = getTextboxSelection(currentTarget);
const isLeft = isHorizontal && event.key === "ArrowLeft";
const isRight = isHorizontal && event.key === "ArrowRight";
const isUp = isVertical && event.key === "ArrowUp";
const isDown = isVertical && event.key === "ArrowDown";
if (isRight || isDown) {
const { length: valueLength } = getTextboxValue(currentTarget);
if (selection.end !== valueLength) return;
} else if ((isLeft || isUp) && selection.start !== 0) return;
}
const nextId = action();
if (preventScrollOnKeyDownProp(event) || nextId !== void 0) {
if (!moveOnKeyPressProp(event)) return;
event.preventDefault();
store.move(nextId);
}
}
});
const providerValue = (0,external_React_.useMemo)(
() => ({ id, baseElement }),
[id, baseElement]
);
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeItemContext.Provider, { value: providerValue, children: element }),
[providerValue]
);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
id,
"data-active-item": isActiveItem || void 0
}, props), {
ref: useMergeRefs(ref, props.ref),
tabIndex: isTabbable ? props.tabIndex : -1,
onFocus,
onBlurCapture,
onKeyDown
});
props = useCommand(props);
props = useCollectionItem(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
store
}, props), {
getItem,
shouldRegisterItem: id ? props.shouldRegisterItem : false
}));
return removeUndefinedValues(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
"aria-setsize": ariaSetSize,
"aria-posinset": ariaPosInSet
}));
}
);
var CompositeItem = memo2(
forwardRef2(function CompositeItem2(props) {
const htmlProps = useCompositeItem(props);
return LMDWO4NN_createElement(P2CTZE2T_TagName, htmlProps);
})
);
;// ./node_modules/@wordpress/components/build-module/composite/item.js
const item_CompositeItem = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeItem2(props, ref) {
var _props$store;
const context = context_useCompositeContext();
const store = (_props$store = props.store) !== null && _props$store !== void 0 ? _props$store : context.store;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeItem, {
store,
...props,
ref
});
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/J2LQO3EC.js
"use client";
// src/composite/composite-row.tsx
var J2LQO3EC_TagName = "div";
var useCompositeRow = createHook(
function useCompositeRow2(_a) {
var _b = _a, {
store,
"aria-setsize": ariaSetSize,
"aria-posinset": ariaPosInSet
} = _b, props = __objRest(_b, [
"store",
"aria-setsize",
"aria-posinset"
]);
const context = useCompositeContext();
store = store || context;
invariant(
store,
false && 0
);
const id = useId(props.id);
const baseElement = store.useState(
(state) => state.baseElement || void 0
);
const providerValue = (0,external_React_.useMemo)(
() => ({ id, baseElement, ariaSetSize, ariaPosInSet }),
[id, baseElement, ariaSetSize, ariaPosInSet]
);
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeRowContext.Provider, { value: providerValue, children: element }),
[providerValue]
);
props = _3YLGPPWQ_spreadValues({ id }, props);
return removeUndefinedValues(props);
}
);
var CompositeRow = forwardRef2(function CompositeRow2(props) {
const htmlProps = useCompositeRow(props);
return LMDWO4NN_createElement(J2LQO3EC_TagName, htmlProps);
});
;// ./node_modules/@wordpress/components/build-module/composite/row.js
const row_CompositeRow = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeRow2(props, ref) {
var _props$store;
const context = context_useCompositeContext();
const store = (_props$store = props.store) !== null && _props$store !== void 0 ? _props$store : context.store;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeRow, {
store,
...props,
ref
});
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/T7VMP3TM.js
"use client";
// src/composite/composite-typeahead.tsx
var T7VMP3TM_TagName = "div";
var chars = "";
function clearChars() {
chars = "";
}
function isValidTypeaheadEvent(event) {
const target = event.target;
if (target && isTextField(target)) return false;
if (event.key === " " && chars.length) return true;
return event.key.length === 1 && !event.ctrlKey && !event.altKey && !event.metaKey && /^[\p{Letter}\p{Number}]$/u.test(event.key);
}
function isSelfTargetOrItem(event, items) {
if (isSelfTarget(event)) return true;
const target = event.target;
if (!target) return false;
const isItem = items.some((item) => item.element === target);
return isItem;
}
function T7VMP3TM_getEnabledItems(items) {
return items.filter((item) => !item.disabled);
}
function itemTextStartsWith(item, text) {
var _a;
const itemText = ((_a = item.element) == null ? void 0 : _a.textContent) || item.children || // The composite item object itself doesn't include a value property, but
// other components like Select do. Since CompositeTypeahead is a generic
// component that can be used with those as well, we also consider the value
// property as a fallback for the typeahead text content.
"value" in item && item.value;
if (!itemText) return false;
return normalizeString(itemText).trim().toLowerCase().startsWith(text.toLowerCase());
}
function getSameInitialItems(items, char, activeId) {
if (!activeId) return items;
const activeItem = items.find((item) => item.id === activeId);
if (!activeItem) return items;
if (!itemTextStartsWith(activeItem, char)) return items;
if (chars !== char && itemTextStartsWith(activeItem, chars)) return items;
chars = char;
return _5VQZOHHZ_flipItems(
items.filter((item) => itemTextStartsWith(item, chars)),
activeId
).filter((item) => item.id !== activeId);
}
var useCompositeTypeahead = createHook(function useCompositeTypeahead2(_a) {
var _b = _a, { store, typeahead = true } = _b, props = __objRest(_b, ["store", "typeahead"]);
const context = useCompositeContext();
store = store || context;
invariant(
store,
false && 0
);
const onKeyDownCaptureProp = props.onKeyDownCapture;
const cleanupTimeoutRef = (0,external_React_.useRef)(0);
const onKeyDownCapture = useEvent((event) => {
onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event);
if (event.defaultPrevented) return;
if (!typeahead) return;
if (!store) return;
if (!isValidTypeaheadEvent(event)) {
return clearChars();
}
const { renderedItems, items, activeId, id } = store.getState();
let enabledItems = T7VMP3TM_getEnabledItems(
items.length > renderedItems.length ? items : renderedItems
);
const document = getDocument(event.currentTarget);
const selector = `[data-offscreen-id="${id}"]`;
const offscreenItems = document.querySelectorAll(selector);
for (const element of offscreenItems) {
const disabled = element.ariaDisabled === "true" || "disabled" in element && !!element.disabled;
enabledItems.push({ id: element.id, element, disabled });
}
if (offscreenItems.length) {
enabledItems = sortBasedOnDOMPosition(enabledItems, (i) => i.element);
}
if (!isSelfTargetOrItem(event, enabledItems)) return clearChars();
event.preventDefault();
window.clearTimeout(cleanupTimeoutRef.current);
cleanupTimeoutRef.current = window.setTimeout(() => {
chars = "";
}, 500);
const char = event.key.toLowerCase();
chars += char;
enabledItems = getSameInitialItems(enabledItems, char, activeId);
const item = enabledItems.find((item2) => itemTextStartsWith(item2, chars));
if (item) {
store.move(item.id);
} else {
clearChars();
}
});
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
onKeyDownCapture
});
return removeUndefinedValues(props);
});
var CompositeTypeahead = forwardRef2(function CompositeTypeahead2(props) {
const htmlProps = useCompositeTypeahead(props);
return LMDWO4NN_createElement(T7VMP3TM_TagName, htmlProps);
});
;// ./node_modules/@wordpress/components/build-module/composite/typeahead.js
const typeahead_CompositeTypeahead = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeTypeahead2(props, ref) {
var _props$store;
const context = context_useCompositeContext();
const store = (_props$store = props.store) !== null && _props$store !== void 0 ? _props$store : context.store;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeTypeahead, {
store,
...props,
ref
});
});
;// ./node_modules/@wordpress/components/build-module/composite/index.js
const composite_Composite = Object.assign((0,external_wp_element_namespaceObject.forwardRef)(function Composite2({
// Composite store props
activeId,
defaultActiveId,
setActiveId,
focusLoop = false,
focusWrap = false,
focusShift = false,
virtualFocus = false,
orientation = "both",
rtl = (0,external_wp_i18n_namespaceObject.isRTL)(),
// Composite component props
children,
disabled = false,
// Rest props
...props
}, ref) {
const storeProp = props.store;
const internalStore = useCompositeStore({
activeId,
defaultActiveId,
setActiveId,
focusLoop,
focusWrap,
focusShift,
virtualFocus,
orientation,
rtl
});
const store = storeProp !== null && storeProp !== void 0 ? storeProp : internalStore;
const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
store
}), [store]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Composite, {
disabled,
store,
...props,
ref,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeContext.Provider, {
value: contextValue,
children
})
});
}), {
/**
* Renders a group element for composite items.
*
* @example
* ```jsx
* import { Composite } from '@wordpress/components';
*
* <Composite>
* <Composite.Group>
* <Composite.GroupLabel>Label</Composite.GroupLabel>
* <Composite.Item>Item 1</Composite.Item>
* <Composite.Item>Item 2</Composite.Item>
* </CompositeGroup>
* </Composite>
* ```
*/
Group: Object.assign(group_CompositeGroup, {
displayName: "Composite.Group"
}),
/**
* Renders a label in a composite group. This component must be wrapped with
* `Composite.Group` so the `aria-labelledby` prop is properly set on the
* composite group element.
*
* @example
* ```jsx
* import { Composite } from '@wordpress/components';
*
* <Composite>
* <Composite.Group>
* <Composite.GroupLabel>Label</Composite.GroupLabel>
* <Composite.Item>Item 1</Composite.Item>
* <Composite.Item>Item 2</Composite.Item>
* </CompositeGroup>
* </Composite>
* ```
*/
GroupLabel: Object.assign(group_label_CompositeGroupLabel, {
displayName: "Composite.GroupLabel"
}),
/**
* Renders a composite item.
*
* @example
* ```jsx
* import { Composite } from '@wordpress/components';
*
* <Composite>
* <Composite.Item>Item 1</Composite.Item>
* <Composite.Item>Item 2</Composite.Item>
* <Composite.Item>Item 3</Composite.Item>
* </Composite>
* ```
*/
Item: Object.assign(item_CompositeItem, {
displayName: "Composite.Item"
}),
/**
* Renders a composite row. Wrapping `Composite.Item` elements within
* `Composite.Row` will create a two-dimensional composite widget, such as a
* grid.
*
* @example
* ```jsx
* import { Composite } from '@wordpress/components';
*
* <Composite>
* <Composite.Row>
* <Composite.Item>Item 1.1</Composite.Item>
* <Composite.Item>Item 1.2</Composite.Item>
* <Composite.Item>Item 1.3</Composite.Item>
* </Composite.Row>
* <Composite.Row>
* <Composite.Item>Item 2.1</Composite.Item>
* <Composite.Item>Item 2.2</Composite.Item>
* <Composite.Item>Item 2.3</Composite.Item>
* </Composite.Row>
* </Composite>
* ```
*/
Row: Object.assign(row_CompositeRow, {
displayName: "Composite.Row"
}),
/**
* Renders an element in a composite widget that receives focus on mouse move
* and loses focus to the composite base element on mouse leave. This should
* be combined with the `Composite.Item` component.
*
* @example
* ```jsx
* import { Composite } from '@wordpress/components';
*
* <Composite>
* <Composite.Hover render={ <Composite.Item /> }>
* Item 1
* </Composite.Hover>
* <Composite.Hover render={ <Composite.Item /> }>
* Item 2
* </Composite.Hover>
* </Composite>
* ```
*/
Hover: Object.assign(hover_CompositeHover, {
displayName: "Composite.Hover"
}),
/**
* Renders a component that adds typeahead functionality to composite
* components. Hitting printable character keys will move focus to the next
* composite item that begins with the input characters.
*
* @example
* ```jsx
* import { Composite } from '@wordpress/components';
*
* <Composite render={ <CompositeTypeahead /> }>
* <Composite.Item>Item 1</Composite.Item>
* <Composite.Item>Item 2</Composite.Item>
* </Composite>
* ```
*/
Typeahead: Object.assign(typeahead_CompositeTypeahead, {
displayName: "Composite.Typeahead"
}),
/**
* The React context used by the composite components. It can be used by
* to access the composite store, and to forward the context when composite
* sub-components are rendered across portals (ie. `SlotFill` components)
* that would not otherwise forward the context to the `Fill` children.
*
* @example
* ```jsx
* import { Composite } from '@wordpress/components';
* import { useContext } from '@wordpress/element';
*
* const compositeContext = useContext( Composite.Context );
* ```
*/
Context: Object.assign(CompositeContext, {
displayName: "Composite.Context"
})
});
;// ./node_modules/@ariakit/core/esm/__chunks/RCQ5P4YE.js
"use client";
// src/disclosure/disclosure-store.ts
function createDisclosureStore(props = {}) {
const store = mergeStore(
props.store,
omit2(props.disclosure, ["contentElement", "disclosureElement"])
);
throwOnConflictingProps(props, store);
const syncState = store == null ? void 0 : store.getState();
const open = defaultValue(
props.open,
syncState == null ? void 0 : syncState.open,
props.defaultOpen,
false
);
const animated = defaultValue(props.animated, syncState == null ? void 0 : syncState.animated, false);
const initialState = {
open,
animated,
animating: !!animated && open,
mounted: open,
contentElement: defaultValue(syncState == null ? void 0 : syncState.contentElement, null),
disclosureElement: defaultValue(syncState == null ? void 0 : syncState.disclosureElement, null)
};
const disclosure = createStore(initialState, store);
setup(
disclosure,
() => sync(disclosure, ["animated", "animating"], (state) => {
if (state.animated) return;
disclosure.setState("animating", false);
})
);
setup(
disclosure,
() => subscribe(disclosure, ["open"], () => {
if (!disclosure.getState().animated) return;
disclosure.setState("animating", true);
})
);
setup(
disclosure,
() => sync(disclosure, ["open", "animating"], (state) => {
disclosure.setState("mounted", state.open || state.animating);
})
);
return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, disclosure), {
disclosure: props.disclosure,
setOpen: (value) => disclosure.setState("open", value),
show: () => disclosure.setState("open", true),
hide: () => disclosure.setState("open", false),
toggle: () => disclosure.setState("open", (open2) => !open2),
stopAnimation: () => disclosure.setState("animating", false),
setContentElement: (value) => disclosure.setState("contentElement", value),
setDisclosureElement: (value) => disclosure.setState("disclosureElement", value)
});
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/WYCIER3C.js
"use client";
// src/disclosure/disclosure-store.ts
function useDisclosureStoreProps(store, update, props) {
useUpdateEffect(update, [props.store, props.disclosure]);
useStoreProps(store, props, "open", "setOpen");
useStoreProps(store, props, "mounted", "setMounted");
useStoreProps(store, props, "animated");
return Object.assign(store, { disclosure: props.disclosure });
}
function useDisclosureStore(props = {}) {
const [store, update] = YV4JVR4I_useStore(createDisclosureStore, props);
return useDisclosureStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/core/esm/__chunks/FZZ2AVHF.js
"use client";
// src/dialog/dialog-store.ts
function createDialogStore(props = {}) {
return createDisclosureStore(props);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/BM6PGYQY.js
"use client";
// src/dialog/dialog-store.ts
function useDialogStoreProps(store, update, props) {
return useDisclosureStoreProps(store, update, props);
}
function useDialogStore(props = {}) {
const [store, update] = YV4JVR4I_useStore(createDialogStore, props);
return useDialogStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/O2PQ2652.js
"use client";
// src/popover/popover-store.ts
function usePopoverStoreProps(store, update, props) {
useUpdateEffect(update, [props.popover]);
useStoreProps(store, props, "placement");
return useDialogStoreProps(store, update, props);
}
function usePopoverStore(props = {}) {
const [store, update] = useStore(Core.createPopoverStore, props);
return usePopoverStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/FTXTWCCT.js
"use client";
// src/hovercard/hovercard-store.ts
function useHovercardStoreProps(store, update, props) {
useStoreProps(store, props, "timeout");
useStoreProps(store, props, "showTimeout");
useStoreProps(store, props, "hideTimeout");
return usePopoverStoreProps(store, update, props);
}
function useHovercardStore(props = {}) {
const [store, update] = useStore(Core.createHovercardStore, props);
return useHovercardStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/core/esm/__chunks/ME2CUF3F.js
"use client";
// src/popover/popover-store.ts
function createPopoverStore(_a = {}) {
var _b = _a, {
popover: otherPopover
} = _b, props = _3YLGPPWQ_objRest(_b, [
"popover"
]);
const store = mergeStore(
props.store,
omit2(otherPopover, [
"arrowElement",
"anchorElement",
"contentElement",
"popoverElement",
"disclosureElement"
])
);
throwOnConflictingProps(props, store);
const syncState = store == null ? void 0 : store.getState();
const dialog = createDialogStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), { store }));
const placement = defaultValue(
props.placement,
syncState == null ? void 0 : syncState.placement,
"bottom"
);
const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, dialog.getState()), {
placement,
currentPlacement: placement,
anchorElement: defaultValue(syncState == null ? void 0 : syncState.anchorElement, null),
popoverElement: defaultValue(syncState == null ? void 0 : syncState.popoverElement, null),
arrowElement: defaultValue(syncState == null ? void 0 : syncState.arrowElement, null),
rendered: Symbol("rendered")
});
const popover = createStore(initialState, dialog, store);
return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, dialog), popover), {
setAnchorElement: (element) => popover.setState("anchorElement", element),
setPopoverElement: (element) => popover.setState("popoverElement", element),
setArrowElement: (element) => popover.setState("arrowElement", element),
render: () => popover.setState("rendered", Symbol("rendered"))
});
}
;// ./node_modules/@ariakit/core/esm/__chunks/JTLIIJ4U.js
"use client";
// src/hovercard/hovercard-store.ts
function createHovercardStore(props = {}) {
var _a;
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
const popover = createPopoverStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
placement: defaultValue(
props.placement,
syncState == null ? void 0 : syncState.placement,
"bottom"
)
}));
const timeout = defaultValue(props.timeout, syncState == null ? void 0 : syncState.timeout, 500);
const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, popover.getState()), {
timeout,
showTimeout: defaultValue(props.showTimeout, syncState == null ? void 0 : syncState.showTimeout),
hideTimeout: defaultValue(props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
autoFocusOnShow: defaultValue(syncState == null ? void 0 : syncState.autoFocusOnShow, false)
});
const hovercard = createStore(initialState, popover, props.store);
return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, popover), hovercard), {
setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
});
}
;// ./node_modules/@ariakit/core/esm/tooltip/tooltip-store.js
"use client";
// src/tooltip/tooltip-store.ts
function createTooltipStore(props = {}) {
var _a;
if (false) {}
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
const hovercard = createHovercardStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
placement: defaultValue(
props.placement,
syncState == null ? void 0 : syncState.placement,
"top"
),
hideTimeout: defaultValue(props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0)
}));
const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, hovercard.getState()), {
type: defaultValue(props.type, syncState == null ? void 0 : syncState.type, "description"),
skipTimeout: defaultValue(props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300)
});
const tooltip = createStore(initialState, hovercard, props.store);
return _chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, hovercard), tooltip);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/YTDK2NGG.js
"use client";
// src/tooltip/tooltip-store.ts
function useTooltipStoreProps(store, update, props) {
useStoreProps(store, props, "type");
useStoreProps(store, props, "skipTimeout");
return useHovercardStoreProps(store, update, props);
}
function useTooltipStore(props = {}) {
const [store, update] = YV4JVR4I_useStore(createTooltipStore, props);
return useTooltipStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/XL7CSKGW.js
"use client";
// src/role/role.tsx
var XL7CSKGW_TagName = "div";
var XL7CSKGW_elements = [
"a",
"button",
"details",
"dialog",
"div",
"form",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"header",
"img",
"input",
"label",
"li",
"nav",
"ol",
"p",
"section",
"select",
"span",
"summary",
"textarea",
"ul",
"svg"
];
var useRole = createHook(
function useRole2(props) {
return props;
}
);
var Role = forwardRef2(
// @ts-expect-error
function Role2(props) {
return LMDWO4NN_createElement(XL7CSKGW_TagName, props);
}
);
Object.assign(
Role,
XL7CSKGW_elements.reduce((acc, element) => {
acc[element] = forwardRef2(function Role3(props) {
return LMDWO4NN_createElement(element, props);
});
return acc;
}, {})
);
;// ./node_modules/@ariakit/react-core/esm/__chunks/S6EF7IVO.js
"use client";
// src/disclosure/disclosure-context.tsx
var S6EF7IVO_ctx = createStoreContext();
var useDisclosureContext = S6EF7IVO_ctx.useContext;
var useDisclosureScopedContext = S6EF7IVO_ctx.useScopedContext;
var useDisclosureProviderContext = S6EF7IVO_ctx.useProviderContext;
var DisclosureContextProvider = S6EF7IVO_ctx.ContextProvider;
var DisclosureScopedContextProvider = S6EF7IVO_ctx.ScopedContextProvider;
;// ./node_modules/@ariakit/react-core/esm/__chunks/RS7LB2H4.js
"use client";
// src/dialog/dialog-context.tsx
var RS7LB2H4_ctx = createStoreContext(
[DisclosureContextProvider],
[DisclosureScopedContextProvider]
);
var useDialogContext = RS7LB2H4_ctx.useContext;
var useDialogScopedContext = RS7LB2H4_ctx.useScopedContext;
var useDialogProviderContext = RS7LB2H4_ctx.useProviderContext;
var DialogContextProvider = RS7LB2H4_ctx.ContextProvider;
var DialogScopedContextProvider = RS7LB2H4_ctx.ScopedContextProvider;
var DialogHeadingContext = (0,external_React_.createContext)(void 0);
var DialogDescriptionContext = (0,external_React_.createContext)(void 0);
;// ./node_modules/@ariakit/react-core/esm/__chunks/MTZPJQMC.js
"use client";
// src/popover/popover-context.tsx
var MTZPJQMC_ctx = createStoreContext(
[DialogContextProvider],
[DialogScopedContextProvider]
);
var usePopoverContext = MTZPJQMC_ctx.useContext;
var usePopoverScopedContext = MTZPJQMC_ctx.useScopedContext;
var usePopoverProviderContext = MTZPJQMC_ctx.useProviderContext;
var PopoverContextProvider = MTZPJQMC_ctx.ContextProvider;
var PopoverScopedContextProvider = MTZPJQMC_ctx.ScopedContextProvider;
;// ./node_modules/@ariakit/react-core/esm/__chunks/EM5CXX6A.js
"use client";
// src/hovercard/hovercard-context.tsx
var EM5CXX6A_ctx = createStoreContext(
[PopoverContextProvider],
[PopoverScopedContextProvider]
);
var useHovercardContext = EM5CXX6A_ctx.useContext;
var useHovercardScopedContext = EM5CXX6A_ctx.useScopedContext;
var useHovercardProviderContext = EM5CXX6A_ctx.useProviderContext;
var HovercardContextProvider = EM5CXX6A_ctx.ContextProvider;
var HovercardScopedContextProvider = EM5CXX6A_ctx.ScopedContextProvider;
;// ./node_modules/@ariakit/react-core/esm/__chunks/BYC7LY2E.js
"use client";
// src/hovercard/hovercard-anchor.tsx
var BYC7LY2E_TagName = "a";
var useHovercardAnchor = createHook(
function useHovercardAnchor2(_a) {
var _b = _a, { store, showOnHover = true } = _b, props = __objRest(_b, ["store", "showOnHover"]);
const context = useHovercardProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const disabled = disabledFromProps(props);
const showTimeoutRef = (0,external_React_.useRef)(0);
(0,external_React_.useEffect)(() => () => window.clearTimeout(showTimeoutRef.current), []);
(0,external_React_.useEffect)(() => {
const onMouseLeave = (event) => {
if (!store) return;
const { anchorElement } = store.getState();
if (!anchorElement) return;
if (event.target !== anchorElement) return;
window.clearTimeout(showTimeoutRef.current);
showTimeoutRef.current = 0;
};
return addGlobalEventListener("mouseleave", onMouseLeave, true);
}, [store]);
const onMouseMoveProp = props.onMouseMove;
const showOnHoverProp = useBooleanEvent(showOnHover);
const isMouseMoving = useIsMouseMoving();
const onMouseMove = useEvent((event) => {
onMouseMoveProp == null ? void 0 : onMouseMoveProp(event);
if (disabled) return;
if (!store) return;
if (event.defaultPrevented) return;
if (showTimeoutRef.current) return;
if (!isMouseMoving()) return;
if (!showOnHoverProp(event)) return;
const element = event.currentTarget;
store.setAnchorElement(element);
store.setDisclosureElement(element);
const { showTimeout, timeout } = store.getState();
const showHovercard = () => {
showTimeoutRef.current = 0;
if (!isMouseMoving()) return;
store == null ? void 0 : store.setAnchorElement(element);
store == null ? void 0 : store.show();
queueMicrotask(() => {
store == null ? void 0 : store.setDisclosureElement(element);
});
};
const timeoutMs = showTimeout != null ? showTimeout : timeout;
if (timeoutMs === 0) {
showHovercard();
} else {
showTimeoutRef.current = window.setTimeout(showHovercard, timeoutMs);
}
});
const onClickProp = props.onClick;
const onClick = useEvent((event) => {
onClickProp == null ? void 0 : onClickProp(event);
if (!store) return;
window.clearTimeout(showTimeoutRef.current);
showTimeoutRef.current = 0;
});
const ref = (0,external_React_.useCallback)(
(element) => {
if (!store) return;
const { anchorElement } = store.getState();
if (anchorElement == null ? void 0 : anchorElement.isConnected) return;
store.setAnchorElement(element);
},
[store]
);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
ref: useMergeRefs(ref, props.ref),
onMouseMove,
onClick
});
props = useFocusable(props);
return props;
}
);
var HovercardAnchor = forwardRef2(function HovercardAnchor2(props) {
const htmlProps = useHovercardAnchor(props);
return LMDWO4NN_createElement(BYC7LY2E_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/F4IYJ42G.js
"use client";
// src/tooltip/tooltip-context.tsx
var F4IYJ42G_ctx = createStoreContext(
[HovercardContextProvider],
[HovercardScopedContextProvider]
);
var useTooltipContext = F4IYJ42G_ctx.useContext;
var useTooltipScopedContext = F4IYJ42G_ctx.useScopedContext;
var useTooltipProviderContext = F4IYJ42G_ctx.useProviderContext;
var TooltipContextProvider = F4IYJ42G_ctx.ContextProvider;
var TooltipScopedContextProvider = F4IYJ42G_ctx.ScopedContextProvider;
;// ./node_modules/@ariakit/react-core/esm/tooltip/tooltip-anchor.js
"use client";
// src/tooltip/tooltip-anchor.tsx
var tooltip_anchor_TagName = "div";
var globalStore = createStore({
activeStore: null
});
function createRemoveStoreCallback(store) {
return () => {
const { activeStore } = globalStore.getState();
if (activeStore !== store) return;
globalStore.setState("activeStore", null);
};
}
var useTooltipAnchor = createHook(
function useTooltipAnchor2(_a) {
var _b = _a, { store, showOnHover = true } = _b, props = __objRest(_b, ["store", "showOnHover"]);
const context = useTooltipProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const canShowOnHoverRef = (0,external_React_.useRef)(false);
(0,external_React_.useEffect)(() => {
return sync(store, ["mounted"], (state) => {
if (state.mounted) return;
canShowOnHoverRef.current = false;
});
}, [store]);
(0,external_React_.useEffect)(() => {
if (!store) return;
return chain(
// Immediately remove the current store from the global store when
// the component unmounts. This is useful, for example, to avoid
// showing tooltips immediately on serial tests.
createRemoveStoreCallback(store),
sync(store, ["mounted", "skipTimeout"], (state) => {
if (!store) return;
if (state.mounted) {
const { activeStore } = globalStore.getState();
if (activeStore !== store) {
activeStore == null ? void 0 : activeStore.hide();
}
return globalStore.setState("activeStore", store);
}
const id = setTimeout(
createRemoveStoreCallback(store),
state.skipTimeout
);
return () => clearTimeout(id);
})
);
}, [store]);
const onMouseEnterProp = props.onMouseEnter;
const onMouseEnter = useEvent((event) => {
onMouseEnterProp == null ? void 0 : onMouseEnterProp(event);
canShowOnHoverRef.current = true;
});
const onFocusVisibleProp = props.onFocusVisible;
const onFocusVisible = useEvent((event) => {
onFocusVisibleProp == null ? void 0 : onFocusVisibleProp(event);
if (event.defaultPrevented) return;
store == null ? void 0 : store.setAnchorElement(event.currentTarget);
store == null ? void 0 : store.show();
});
const onBlurProp = props.onBlur;
const onBlur = useEvent((event) => {
onBlurProp == null ? void 0 : onBlurProp(event);
if (event.defaultPrevented) return;
const { activeStore } = globalStore.getState();
canShowOnHoverRef.current = false;
if (activeStore === store) {
globalStore.setState("activeStore", null);
}
});
const type = store.useState("type");
const contentId = store.useState((state) => {
var _a2;
return (_a2 = state.contentElement) == null ? void 0 : _a2.id;
});
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
"aria-labelledby": type === "label" ? contentId : void 0
}, props), {
onMouseEnter,
onFocusVisible,
onBlur
});
props = useHovercardAnchor(_3YLGPPWQ_spreadValues({
store,
showOnHover(event) {
if (!canShowOnHoverRef.current) return false;
if (isFalsyBooleanCallback(showOnHover, event)) return false;
const { activeStore } = globalStore.getState();
if (!activeStore) return true;
store == null ? void 0 : store.show();
return false;
}
}, props));
return props;
}
);
var TooltipAnchor = forwardRef2(function TooltipAnchor2(props) {
const htmlProps = useTooltipAnchor(props);
return LMDWO4NN_createElement(tooltip_anchor_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/X7QOZUD3.js
"use client";
// src/hovercard/utils/polygon.ts
function getEventPoint(event) {
return [event.clientX, event.clientY];
}
function isPointInPolygon(point, polygon) {
const [x, y] = point;
let inside = false;
const length = polygon.length;
for (let l = length, i = 0, j = l - 1; i < l; j = i++) {
const [xi, yi] = polygon[i];
const [xj, yj] = polygon[j];
const [, vy] = polygon[j === 0 ? l - 1 : j - 1] || [0, 0];
const where = (yi - yj) * (x - xi) - (xi - xj) * (y - yi);
if (yj < yi) {
if (y >= yj && y < yi) {
if (where === 0) return true;
if (where > 0) {
if (y === yj) {
if (y > vy) {
inside = !inside;
}
} else {
inside = !inside;
}
}
}
} else if (yi < yj) {
if (y > yi && y <= yj) {
if (where === 0) return true;
if (where < 0) {
if (y === yj) {
if (y < vy) {
inside = !inside;
}
} else {
inside = !inside;
}
}
}
} else if (y === yi && (x >= xj && x <= xi || x >= xi && x <= xj)) {
return true;
}
}
return inside;
}
function getEnterPointPlacement(enterPoint, rect) {
const { top, right, bottom, left } = rect;
const [x, y] = enterPoint;
const placementX = x < left ? "left" : x > right ? "right" : null;
const placementY = y < top ? "top" : y > bottom ? "bottom" : null;
return [placementX, placementY];
}
function getElementPolygon(element, enterPoint) {
const rect = element.getBoundingClientRect();
const { top, right, bottom, left } = rect;
const [x, y] = getEnterPointPlacement(enterPoint, rect);
const polygon = [enterPoint];
if (x) {
if (y !== "top") {
polygon.push([x === "left" ? left : right, top]);
}
polygon.push([x === "left" ? right : left, top]);
polygon.push([x === "left" ? right : left, bottom]);
if (y !== "bottom") {
polygon.push([x === "left" ? left : right, bottom]);
}
} else if (y === "top") {
polygon.push([left, top]);
polygon.push([left, bottom]);
polygon.push([right, bottom]);
polygon.push([right, top]);
} else {
polygon.push([left, bottom]);
polygon.push([left, top]);
polygon.push([right, top]);
polygon.push([right, bottom]);
}
return polygon;
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/63XF7ACK.js
"use client";
// src/dialog/utils/is-backdrop.ts
function _63XF7ACK_isBackdrop(element, ...ids) {
if (!element) return false;
const backdrop = element.getAttribute("data-backdrop");
if (backdrop == null) return false;
if (backdrop === "") return true;
if (backdrop === "true") return true;
if (!ids.length) return true;
return ids.some((id) => backdrop === id);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/K2ZF5NU7.js
"use client";
// src/dialog/utils/orchestrate.ts
var cleanups = /* @__PURE__ */ new WeakMap();
function orchestrate(element, key, setup) {
if (!cleanups.has(element)) {
cleanups.set(element, /* @__PURE__ */ new Map());
}
const elementCleanups = cleanups.get(element);
const prevCleanup = elementCleanups.get(key);
if (!prevCleanup) {
elementCleanups.set(key, setup());
return () => {
var _a;
(_a = elementCleanups.get(key)) == null ? void 0 : _a();
elementCleanups.delete(key);
};
}
const cleanup = setup();
const nextCleanup = () => {
cleanup();
prevCleanup();
elementCleanups.delete(key);
};
elementCleanups.set(key, nextCleanup);
return () => {
const isCurrent = elementCleanups.get(key) === nextCleanup;
if (!isCurrent) return;
cleanup();
elementCleanups.set(key, prevCleanup);
};
}
function setAttribute(element, attr, value) {
const setup = () => {
const previousValue = element.getAttribute(attr);
element.setAttribute(attr, value);
return () => {
if (previousValue == null) {
element.removeAttribute(attr);
} else {
element.setAttribute(attr, previousValue);
}
};
};
return orchestrate(element, attr, setup);
}
function setProperty(element, property, value) {
const setup = () => {
const exists = property in element;
const previousValue = element[property];
element[property] = value;
return () => {
if (!exists) {
delete element[property];
} else {
element[property] = previousValue;
}
};
};
return orchestrate(element, property, setup);
}
function assignStyle(element, style) {
if (!element) return () => {
};
const setup = () => {
const prevStyle = element.style.cssText;
Object.assign(element.style, style);
return () => {
element.style.cssText = prevStyle;
};
};
return orchestrate(element, "style", setup);
}
function setCSSProperty(element, property, value) {
if (!element) return () => {
};
const setup = () => {
const previousValue = element.style.getPropertyValue(property);
element.style.setProperty(property, value);
return () => {
if (previousValue) {
element.style.setProperty(property, previousValue);
} else {
element.style.removeProperty(property);
}
};
};
return orchestrate(element, property, setup);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/AOUGVQZ3.js
"use client";
// src/dialog/utils/walk-tree-outside.ts
var ignoreTags = ["SCRIPT", "STYLE"];
function getSnapshotPropertyName(id) {
return `__ariakit-dialog-snapshot-${id}`;
}
function inSnapshot(id, element) {
const doc = getDocument(element);
const propertyName = getSnapshotPropertyName(id);
if (!doc.body[propertyName]) return true;
do {
if (element === doc.body) return false;
if (element[propertyName]) return true;
if (!element.parentElement) return false;
element = element.parentElement;
} while (true);
}
function isValidElement(id, element, ignoredElements) {
if (ignoreTags.includes(element.tagName)) return false;
if (!inSnapshot(id, element)) return false;
return !ignoredElements.some(
(enabledElement) => enabledElement && contains(element, enabledElement)
);
}
function AOUGVQZ3_walkTreeOutside(id, elements, callback, ancestorCallback) {
for (let element of elements) {
if (!(element == null ? void 0 : element.isConnected)) continue;
const hasAncestorAlready = elements.some((maybeAncestor) => {
if (!maybeAncestor) return false;
if (maybeAncestor === element) return false;
return maybeAncestor.contains(element);
});
const doc = getDocument(element);
const originalElement = element;
while (element.parentElement && element !== doc.body) {
ancestorCallback == null ? void 0 : ancestorCallback(element.parentElement, originalElement);
if (!hasAncestorAlready) {
for (const child of element.parentElement.children) {
if (isValidElement(id, child, elements)) {
callback(child, originalElement);
}
}
}
element = element.parentElement;
}
}
}
function createWalkTreeSnapshot(id, elements) {
const { body } = getDocument(elements[0]);
const cleanups = [];
const markElement = (element) => {
cleanups.push(setProperty(element, getSnapshotPropertyName(id), true));
};
AOUGVQZ3_walkTreeOutside(id, elements, markElement);
return chain(setProperty(body, getSnapshotPropertyName(id), true), () => {
for (const cleanup of cleanups) {
cleanup();
}
});
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/2PGBN2Y4.js
"use client";
// src/dialog/utils/mark-tree-outside.ts
function getPropertyName(id = "", ancestor = false) {
return `__ariakit-dialog-${ancestor ? "ancestor" : "outside"}${id ? `-${id}` : ""}`;
}
function markElement(element, id = "") {
return chain(
setProperty(element, getPropertyName(), true),
setProperty(element, getPropertyName(id), true)
);
}
function markAncestor(element, id = "") {
return chain(
setProperty(element, getPropertyName("", true), true),
setProperty(element, getPropertyName(id, true), true)
);
}
function isElementMarked(element, id) {
const ancestorProperty = getPropertyName(id, true);
if (element[ancestorProperty]) return true;
const elementProperty = getPropertyName(id);
do {
if (element[elementProperty]) return true;
if (!element.parentElement) return false;
element = element.parentElement;
} while (true);
}
function markTreeOutside(id, elements) {
const cleanups = [];
const ids = elements.map((el) => el == null ? void 0 : el.id);
AOUGVQZ3_walkTreeOutside(
id,
elements,
(element) => {
if (_63XF7ACK_isBackdrop(element, ...ids)) return;
cleanups.unshift(markElement(element, id));
},
(ancestor, element) => {
const isAnotherDialogAncestor = element.hasAttribute("data-dialog") && element.id !== id;
if (isAnotherDialogAncestor) return;
cleanups.unshift(markAncestor(ancestor, id));
}
);
const restoreAccessibilityTree = () => {
for (const cleanup of cleanups) {
cleanup();
}
};
return restoreAccessibilityTree;
}
;// external "ReactDOM"
const external_ReactDOM_namespaceObject = window["ReactDOM"];
;// ./node_modules/@ariakit/react-core/esm/__chunks/VGCJ63VH.js
"use client";
// src/disclosure/disclosure-content.tsx
var VGCJ63VH_TagName = "div";
function afterTimeout(timeoutMs, cb) {
const timeoutId = setTimeout(cb, timeoutMs);
return () => clearTimeout(timeoutId);
}
function VGCJ63VH_afterPaint(cb) {
let raf = requestAnimationFrame(() => {
raf = requestAnimationFrame(cb);
});
return () => cancelAnimationFrame(raf);
}
function parseCSSTime(...times) {
return times.join(", ").split(", ").reduce((longestTime, currentTimeString) => {
const multiplier = currentTimeString.endsWith("ms") ? 1 : 1e3;
const currentTime = Number.parseFloat(currentTimeString || "0s") * multiplier;
if (currentTime > longestTime) return currentTime;
return longestTime;
}, 0);
}
function isHidden(mounted, hidden, alwaysVisible) {
return !alwaysVisible && hidden !== false && (!mounted || !!hidden);
}
var useDisclosureContent = createHook(function useDisclosureContent2(_a) {
var _b = _a, { store, alwaysVisible } = _b, props = __objRest(_b, ["store", "alwaysVisible"]);
const context = useDisclosureProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const ref = (0,external_React_.useRef)(null);
const id = useId(props.id);
const [transition, setTransition] = (0,external_React_.useState)(null);
const open = store.useState("open");
const mounted = store.useState("mounted");
const animated = store.useState("animated");
const contentElement = store.useState("contentElement");
const otherElement = useStoreState(store.disclosure, "contentElement");
useSafeLayoutEffect(() => {
if (!ref.current) return;
store == null ? void 0 : store.setContentElement(ref.current);
}, [store]);
useSafeLayoutEffect(() => {
let previousAnimated;
store == null ? void 0 : store.setState("animated", (animated2) => {
previousAnimated = animated2;
return true;
});
return () => {
if (previousAnimated === void 0) return;
store == null ? void 0 : store.setState("animated", previousAnimated);
};
}, [store]);
useSafeLayoutEffect(() => {
if (!animated) return;
if (!(contentElement == null ? void 0 : contentElement.isConnected)) {
setTransition(null);
return;
}
return VGCJ63VH_afterPaint(() => {
setTransition(open ? "enter" : mounted ? "leave" : null);
});
}, [animated, contentElement, open, mounted]);
useSafeLayoutEffect(() => {
if (!store) return;
if (!animated) return;
if (!transition) return;
if (!contentElement) return;
const stopAnimation = () => store == null ? void 0 : store.setState("animating", false);
const stopAnimationSync = () => (0,external_ReactDOM_namespaceObject.flushSync)(stopAnimation);
if (transition === "leave" && open) return;
if (transition === "enter" && !open) return;
if (typeof animated === "number") {
const timeout2 = animated;
return afterTimeout(timeout2, stopAnimationSync);
}
const {
transitionDuration,
animationDuration,
transitionDelay,
animationDelay
} = getComputedStyle(contentElement);
const {
transitionDuration: transitionDuration2 = "0",
animationDuration: animationDuration2 = "0",
transitionDelay: transitionDelay2 = "0",
animationDelay: animationDelay2 = "0"
} = otherElement ? getComputedStyle(otherElement) : {};
const delay = parseCSSTime(
transitionDelay,
animationDelay,
transitionDelay2,
animationDelay2
);
const duration = parseCSSTime(
transitionDuration,
animationDuration,
transitionDuration2,
animationDuration2
);
const timeout = delay + duration;
if (!timeout) {
if (transition === "enter") {
store.setState("animated", false);
}
stopAnimation();
return;
}
const frameRate = 1e3 / 60;
const maxTimeout = Math.max(timeout - frameRate, 0);
return afterTimeout(maxTimeout, stopAnimationSync);
}, [store, animated, contentElement, otherElement, open, transition]);
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogScopedContextProvider, { value: store, children: element }),
[store]
);
const hidden = isHidden(mounted, props.hidden, alwaysVisible);
const styleProp = props.style;
const style = (0,external_React_.useMemo)(() => {
if (hidden) {
return _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, styleProp), { display: "none" });
}
return styleProp;
}, [hidden, styleProp]);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
id,
"data-open": open || void 0,
"data-enter": transition === "enter" || void 0,
"data-leave": transition === "leave" || void 0,
hidden
}, props), {
ref: useMergeRefs(id ? store.setContentElement : null, ref, props.ref),
style
});
return removeUndefinedValues(props);
});
var DisclosureContentImpl = forwardRef2(function DisclosureContentImpl2(props) {
const htmlProps = useDisclosureContent(props);
return LMDWO4NN_createElement(VGCJ63VH_TagName, htmlProps);
});
var DisclosureContent = forwardRef2(function DisclosureContent2(_a) {
var _b = _a, {
unmountOnHide
} = _b, props = __objRest(_b, [
"unmountOnHide"
]);
const context = useDisclosureProviderContext();
const store = props.store || context;
const mounted = useStoreState(
store,
(state) => !unmountOnHide || (state == null ? void 0 : state.mounted)
);
if (mounted === false) return null;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DisclosureContentImpl, _3YLGPPWQ_spreadValues({}, props));
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/63FEHJZV.js
"use client";
// src/dialog/dialog-backdrop.tsx
function DialogBackdrop({
store,
backdrop,
alwaysVisible,
hidden
}) {
const ref = (0,external_React_.useRef)(null);
const disclosure = useDisclosureStore({ disclosure: store });
const contentElement = useStoreState(store, "contentElement");
(0,external_React_.useEffect)(() => {
const backdrop2 = ref.current;
const dialog = contentElement;
if (!backdrop2) return;
if (!dialog) return;
backdrop2.style.zIndex = getComputedStyle(dialog).zIndex;
}, [contentElement]);
useSafeLayoutEffect(() => {
const id = contentElement == null ? void 0 : contentElement.id;
if (!id) return;
const backdrop2 = ref.current;
if (!backdrop2) return;
return markAncestor(backdrop2, id);
}, [contentElement]);
const props = useDisclosureContent({
ref,
store: disclosure,
role: "presentation",
"data-backdrop": (contentElement == null ? void 0 : contentElement.id) || "",
alwaysVisible,
hidden: hidden != null ? hidden : void 0,
style: {
position: "fixed",
top: 0,
right: 0,
bottom: 0,
left: 0
}
});
if (!backdrop) return null;
if ((0,external_React_.isValidElement)(backdrop)) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Role, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { render: backdrop }));
}
const Component = typeof backdrop !== "boolean" ? backdrop : "div";
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Role, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {}) }));
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/IGR4SXG2.js
"use client";
// src/dialog/utils/is-focus-trap.ts
function isFocusTrap(element, ...ids) {
if (!element) return false;
const attr = element.getAttribute("data-focus-trap");
if (attr == null) return false;
if (!ids.length) return true;
if (attr === "") return false;
return ids.some((id) => attr === id);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/ESSM74HH.js
"use client";
// src/dialog/utils/disable-accessibility-tree-outside.ts
function hideElementFromAccessibilityTree(element) {
return setAttribute(element, "aria-hidden", "true");
}
function disableAccessibilityTreeOutside(id, elements) {
const cleanups = [];
const ids = elements.map((el) => el == null ? void 0 : el.id);
walkTreeOutside(id, elements, (element) => {
if (isBackdrop(element, ...ids)) return;
cleanups.unshift(hideElementFromAccessibilityTree(element));
});
const restoreAccessibilityTree = () => {
for (const cleanup of cleanups) {
cleanup();
}
};
return restoreAccessibilityTree;
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/677M2CI3.js
"use client";
// src/dialog/utils/supports-inert.ts
function supportsInert() {
return "inert" in HTMLElement.prototype;
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/KZAQFFOU.js
"use client";
// src/dialog/utils/disable-tree.ts
function disableTree(element, ignoredElements) {
if (!("style" in element)) return PBFD2E7P_noop;
if (supportsInert()) {
return setProperty(element, "inert", true);
}
const tabbableElements = getAllTabbableIn(element, true);
const enableElements = tabbableElements.map((element2) => {
if (ignoredElements == null ? void 0 : ignoredElements.some((el) => el && contains(el, element2))) return PBFD2E7P_noop;
const restoreFocusMethod = orchestrate(element2, "focus", () => {
element2.focus = PBFD2E7P_noop;
return () => {
delete element2.focus;
};
});
return chain(setAttribute(element2, "tabindex", "-1"), restoreFocusMethod);
});
return chain(
...enableElements,
hideElementFromAccessibilityTree(element),
assignStyle(element, {
pointerEvents: "none",
userSelect: "none",
cursor: "default"
})
);
}
function disableTreeOutside(id, elements) {
const cleanups = [];
const ids = elements.map((el) => el == null ? void 0 : el.id);
AOUGVQZ3_walkTreeOutside(
id,
elements,
(element) => {
if (_63XF7ACK_isBackdrop(element, ...ids)) return;
if (isFocusTrap(element, ...ids)) return;
cleanups.unshift(disableTree(element, elements));
},
(element) => {
if (!element.hasAttribute("role")) return;
if (elements.some((el) => el && contains(el, element))) return;
cleanups.unshift(setAttribute(element, "role", "none"));
}
);
const restoreTreeOutside = () => {
for (const cleanup of cleanups) {
cleanup();
}
};
return restoreTreeOutside;
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/YKJECYU7.js
"use client";
// src/dialog/utils/use-root-dialog.ts
function useRootDialog({
attribute,
contentId,
contentElement,
enabled
}) {
const [updated, retry] = useForceUpdate();
const isRootDialog = (0,external_React_.useCallback)(() => {
if (!enabled) return false;
if (!contentElement) return false;
const { body } = getDocument(contentElement);
const id = body.getAttribute(attribute);
return !id || id === contentId;
}, [updated, enabled, contentElement, attribute, contentId]);
(0,external_React_.useEffect)(() => {
if (!enabled) return;
if (!contentId) return;
if (!contentElement) return;
const { body } = getDocument(contentElement);
if (isRootDialog()) {
body.setAttribute(attribute, contentId);
return () => body.removeAttribute(attribute);
}
const observer = new MutationObserver(() => (0,external_ReactDOM_namespaceObject.flushSync)(retry));
observer.observe(body, { attributeFilter: [attribute] });
return () => observer.disconnect();
}, [updated, enabled, contentId, contentElement, isRootDialog, attribute]);
return isRootDialog;
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/BGQ3KQ5M.js
"use client";
// src/dialog/utils/use-prevent-body-scroll.ts
function getPaddingProperty(documentElement) {
const documentLeft = documentElement.getBoundingClientRect().left;
const scrollbarX = Math.round(documentLeft) + documentElement.scrollLeft;
return scrollbarX ? "paddingLeft" : "paddingRight";
}
function usePreventBodyScroll(contentElement, contentId, enabled) {
const isRootDialog = useRootDialog({
attribute: "data-dialog-prevent-body-scroll",
contentElement,
contentId,
enabled
});
(0,external_React_.useEffect)(() => {
if (!isRootDialog()) return;
if (!contentElement) return;
const doc = getDocument(contentElement);
const win = getWindow(contentElement);
const { documentElement, body } = doc;
const cssScrollbarWidth = documentElement.style.getPropertyValue("--scrollbar-width");
const scrollbarWidth = cssScrollbarWidth ? Number.parseInt(cssScrollbarWidth) : win.innerWidth - documentElement.clientWidth;
const setScrollbarWidthProperty = () => setCSSProperty(
documentElement,
"--scrollbar-width",
`${scrollbarWidth}px`
);
const paddingProperty = getPaddingProperty(documentElement);
const setStyle = () => assignStyle(body, {
overflow: "hidden",
[paddingProperty]: `${scrollbarWidth}px`
});
const setIOSStyle = () => {
var _a, _b;
const { scrollX, scrollY, visualViewport } = win;
const offsetLeft = (_a = visualViewport == null ? void 0 : visualViewport.offsetLeft) != null ? _a : 0;
const offsetTop = (_b = visualViewport == null ? void 0 : visualViewport.offsetTop) != null ? _b : 0;
const restoreStyle = assignStyle(body, {
position: "fixed",
overflow: "hidden",
top: `${-(scrollY - Math.floor(offsetTop))}px`,
left: `${-(scrollX - Math.floor(offsetLeft))}px`,
right: "0",
[paddingProperty]: `${scrollbarWidth}px`
});
return () => {
restoreStyle();
if (true) {
win.scrollTo({ left: scrollX, top: scrollY, behavior: "instant" });
}
};
};
const isIOS = isApple() && !isMac();
return chain(
setScrollbarWidthProperty(),
isIOS ? setIOSStyle() : setStyle()
);
}, [isRootDialog, contentElement]);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/TOU75OXH.js
"use client";
// src/dialog/utils/use-nested-dialogs.tsx
var NestedDialogsContext = (0,external_React_.createContext)({});
function useNestedDialogs(store) {
const context = (0,external_React_.useContext)(NestedDialogsContext);
const [dialogs, setDialogs] = (0,external_React_.useState)([]);
const add = (0,external_React_.useCallback)(
(dialog) => {
var _a;
setDialogs((dialogs2) => [...dialogs2, dialog]);
return chain((_a = context.add) == null ? void 0 : _a.call(context, dialog), () => {
setDialogs((dialogs2) => dialogs2.filter((d) => d !== dialog));
});
},
[context]
);
useSafeLayoutEffect(() => {
return sync(store, ["open", "contentElement"], (state) => {
var _a;
if (!state.open) return;
if (!state.contentElement) return;
return (_a = context.add) == null ? void 0 : _a.call(context, store);
});
}, [store, context]);
const providerValue = (0,external_React_.useMemo)(() => ({ store, add }), [store, add]);
const wrapElement = (0,external_React_.useCallback)(
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NestedDialogsContext.Provider, { value: providerValue, children: element }),
[providerValue]
);
return { wrapElement, nestedDialogs: dialogs };
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/HLTQOHKZ.js
"use client";
// src/dialog/utils/use-previous-mouse-down-ref.ts
function usePreviousMouseDownRef(enabled) {
const previousMouseDownRef = (0,external_React_.useRef)();
(0,external_React_.useEffect)(() => {
if (!enabled) {
previousMouseDownRef.current = null;
return;
}
const onMouseDown = (event) => {
previousMouseDownRef.current = event.target;
};
return addGlobalEventListener("mousedown", onMouseDown, true);
}, [enabled]);
return previousMouseDownRef;
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/WBDYNH73.js
"use client";
// src/dialog/utils/use-hide-on-interact-outside.ts
function isInDocument(target) {
if (target.tagName === "HTML") return true;
return contains(getDocument(target).body, target);
}
function isDisclosure(disclosure, target) {
if (!disclosure) return false;
if (contains(disclosure, target)) return true;
const activeId = target.getAttribute("aria-activedescendant");
if (activeId) {
const activeElement = getDocument(disclosure).getElementById(activeId);
if (activeElement) {
return contains(disclosure, activeElement);
}
}
return false;
}
function isMouseEventOnDialog(event, dialog) {
if (!("clientY" in event)) return false;
const rect = dialog.getBoundingClientRect();
if (rect.width === 0 || rect.height === 0) return false;
return rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
}
function useEventOutside({
store,
type,
listener,
capture,
domReady
}) {
const callListener = useEvent(listener);
const open = useStoreState(store, "open");
const focusedRef = (0,external_React_.useRef)(false);
useSafeLayoutEffect(() => {
if (!open) return;
if (!domReady) return;
const { contentElement } = store.getState();
if (!contentElement) return;
const onFocus = () => {
focusedRef.current = true;
};
contentElement.addEventListener("focusin", onFocus, true);
return () => contentElement.removeEventListener("focusin", onFocus, true);
}, [store, open, domReady]);
(0,external_React_.useEffect)(() => {
if (!open) return;
const onEvent = (event) => {
const { contentElement, disclosureElement } = store.getState();
const target = event.target;
if (!contentElement) return;
if (!target) return;
if (!isInDocument(target)) return;
if (contains(contentElement, target)) return;
if (isDisclosure(disclosureElement, target)) return;
if (target.hasAttribute("data-focus-trap")) return;
if (isMouseEventOnDialog(event, contentElement)) return;
const focused = focusedRef.current;
if (focused && !isElementMarked(target, contentElement.id)) return;
if (isSafariFocusAncestor(target)) return;
callListener(event);
};
return addGlobalEventListener(type, onEvent, capture);
}, [open, capture]);
}
function shouldHideOnInteractOutside(hideOnInteractOutside, event) {
if (typeof hideOnInteractOutside === "function") {
return hideOnInteractOutside(event);
}
return !!hideOnInteractOutside;
}
function useHideOnInteractOutside(store, hideOnInteractOutside, domReady) {
const open = useStoreState(store, "open");
const previousMouseDownRef = usePreviousMouseDownRef(open);
const props = { store, domReady, capture: true };
useEventOutside(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
type: "click",
listener: (event) => {
const { contentElement } = store.getState();
const previousMouseDown = previousMouseDownRef.current;
if (!previousMouseDown) return;
if (!isVisible(previousMouseDown)) return;
if (!isElementMarked(previousMouseDown, contentElement == null ? void 0 : contentElement.id)) return;
if (!shouldHideOnInteractOutside(hideOnInteractOutside, event)) return;
store.hide();
}
}));
useEventOutside(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
type: "focusin",
listener: (event) => {
const { contentElement } = store.getState();
if (!contentElement) return;
if (event.target === getDocument(contentElement)) return;
if (!shouldHideOnInteractOutside(hideOnInteractOutside, event)) return;
store.hide();
}
}));
useEventOutside(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
type: "contextmenu",
listener: (event) => {
if (!shouldHideOnInteractOutside(hideOnInteractOutside, event)) return;
store.hide();
}
}));
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/6GXEOXGT.js
"use client";
// src/dialog/utils/prepend-hidden-dismiss.ts
function prependHiddenDismiss(container, onClick) {
const document = getDocument(container);
const button = document.createElement("button");
button.type = "button";
button.tabIndex = -1;
button.textContent = "Dismiss popup";
Object.assign(button.style, {
border: "0px",
clip: "rect(0 0 0 0)",
height: "1px",
margin: "-1px",
overflow: "hidden",
padding: "0px",
position: "absolute",
whiteSpace: "nowrap",
width: "1px"
});
button.addEventListener("click", onClick);
container.prepend(button);
const removeHiddenDismiss = () => {
button.removeEventListener("click", onClick);
button.remove();
};
return removeHiddenDismiss;
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/ZWYATQFU.js
"use client";
// src/focusable/focusable-container.tsx
var ZWYATQFU_TagName = "div";
var useFocusableContainer = createHook(function useFocusableContainer2(_a) {
var _b = _a, { autoFocusOnShow = true } = _b, props = __objRest(_b, ["autoFocusOnShow"]);
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FocusableContext.Provider, { value: autoFocusOnShow, children: element }),
[autoFocusOnShow]
);
return props;
});
var FocusableContainer = forwardRef2(function FocusableContainer2(props) {
const htmlProps = useFocusableContainer(props);
return LMDWO4NN_createElement(ZWYATQFU_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/CZ4GFWYL.js
"use client";
// src/heading/heading-context.tsx
var HeadingContext = (0,external_React_.createContext)(0);
;// ./node_modules/@ariakit/react-core/esm/__chunks/5M6RIVE2.js
"use client";
// src/heading/heading-level.tsx
function HeadingLevel({ level, children }) {
const contextLevel = (0,external_React_.useContext)(HeadingContext);
const nextLevel = Math.max(
Math.min(level || contextLevel + 1, 6),
1
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HeadingContext.Provider, { value: nextLevel, children });
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/XX67R432.js
"use client";
// src/visually-hidden/visually-hidden.tsx
var XX67R432_TagName = "span";
var useVisuallyHidden = createHook(
function useVisuallyHidden2(props) {
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
style: _3YLGPPWQ_spreadValues({
border: 0,
clip: "rect(0 0 0 0)",
height: "1px",
margin: "-1px",
overflow: "hidden",
padding: 0,
position: "absolute",
whiteSpace: "nowrap",
width: "1px"
}, props.style)
});
return props;
}
);
var VisuallyHidden = forwardRef2(function VisuallyHidden2(props) {
const htmlProps = useVisuallyHidden(props);
return LMDWO4NN_createElement(XX67R432_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/W3VI7GFU.js
"use client";
// src/focus-trap/focus-trap.tsx
var W3VI7GFU_TagName = "span";
var useFocusTrap = createHook(
function useFocusTrap2(props) {
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
"data-focus-trap": "",
tabIndex: 0,
"aria-hidden": true
}, props), {
style: _3YLGPPWQ_spreadValues({
// Prevents unintended scroll jumps.
position: "fixed",
top: 0,
left: 0
}, props.style)
});
props = useVisuallyHidden(props);
return props;
}
);
var FocusTrap = forwardRef2(function FocusTrap2(props) {
const htmlProps = useFocusTrap(props);
return LMDWO4NN_createElement(W3VI7GFU_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/AOQQTIBO.js
"use client";
// src/portal/portal-context.tsx
var PortalContext = (0,external_React_.createContext)(null);
;// ./node_modules/@ariakit/react-core/esm/__chunks/O37CNYMR.js
"use client";
// src/portal/portal.tsx
var O37CNYMR_TagName = "div";
function getRootElement(element) {
return getDocument(element).body;
}
function getPortalElement(element, portalElement) {
if (!portalElement) {
return getDocument(element).createElement("div");
}
if (typeof portalElement === "function") {
return portalElement(element);
}
return portalElement;
}
function getRandomId(prefix = "id") {
return `${prefix ? `${prefix}-` : ""}${Math.random().toString(36).slice(2, 8)}`;
}
function queueFocus(element) {
queueMicrotask(() => {
element == null ? void 0 : element.focus();
});
}
var usePortal = createHook(function usePortal2(_a) {
var _b = _a, {
preserveTabOrder,
preserveTabOrderAnchor,
portalElement,
portalRef,
portal = true
} = _b, props = __objRest(_b, [
"preserveTabOrder",
"preserveTabOrderAnchor",
"portalElement",
"portalRef",
"portal"
]);
const ref = (0,external_React_.useRef)(null);
const refProp = useMergeRefs(ref, props.ref);
const context = (0,external_React_.useContext)(PortalContext);
const [portalNode, setPortalNode] = (0,external_React_.useState)(null);
const [anchorPortalNode, setAnchorPortalNode] = (0,external_React_.useState)(
null
);
const outerBeforeRef = (0,external_React_.useRef)(null);
const innerBeforeRef = (0,external_React_.useRef)(null);
const innerAfterRef = (0,external_React_.useRef)(null);
const outerAfterRef = (0,external_React_.useRef)(null);
useSafeLayoutEffect(() => {
const element = ref.current;
if (!element || !portal) {
setPortalNode(null);
return;
}
const portalEl = getPortalElement(element, portalElement);
if (!portalEl) {
setPortalNode(null);
return;
}
const isPortalInDocument = portalEl.isConnected;
if (!isPortalInDocument) {
const rootElement = context || getRootElement(element);
rootElement.appendChild(portalEl);
}
if (!portalEl.id) {
portalEl.id = element.id ? `portal/${element.id}` : getRandomId();
}
setPortalNode(portalEl);
setRef(portalRef, portalEl);
if (isPortalInDocument) return;
return () => {
portalEl.remove();
setRef(portalRef, null);
};
}, [portal, portalElement, context, portalRef]);
useSafeLayoutEffect(() => {
if (!portal) return;
if (!preserveTabOrder) return;
if (!preserveTabOrderAnchor) return;
const doc = getDocument(preserveTabOrderAnchor);
const element = doc.createElement("span");
element.style.position = "fixed";
preserveTabOrderAnchor.insertAdjacentElement("afterend", element);
setAnchorPortalNode(element);
return () => {
element.remove();
setAnchorPortalNode(null);
};
}, [portal, preserveTabOrder, preserveTabOrderAnchor]);
(0,external_React_.useEffect)(() => {
if (!portalNode) return;
if (!preserveTabOrder) return;
let raf = 0;
const onFocus = (event) => {
if (!isFocusEventOutside(event)) return;
const focusing = event.type === "focusin";
cancelAnimationFrame(raf);
if (focusing) {
return restoreFocusIn(portalNode);
}
raf = requestAnimationFrame(() => {
disableFocusIn(portalNode, true);
});
};
portalNode.addEventListener("focusin", onFocus, true);
portalNode.addEventListener("focusout", onFocus, true);
return () => {
cancelAnimationFrame(raf);
portalNode.removeEventListener("focusin", onFocus, true);
portalNode.removeEventListener("focusout", onFocus, true);
};
}, [portalNode, preserveTabOrder]);
props = useWrapElement(
props,
(element) => {
element = // While the portal node is not in the DOM, we need to pass the
// current context to the portal context, otherwise it's going to
// reset to the body element on nested portals.
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PortalContext.Provider, { value: portalNode || context, children: element });
if (!portal) return element;
if (!portalNode) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
ref: refProp,
id: props.id,
style: { position: "fixed" },
hidden: true
}
);
}
element = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FocusTrap,
{
ref: innerBeforeRef,
"data-focus-trap": props.id,
className: "__focus-trap-inner-before",
onFocus: (event) => {
if (isFocusEventOutside(event, portalNode)) {
queueFocus(getNextTabbable());
} else {
queueFocus(outerBeforeRef.current);
}
}
}
),
element,
preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FocusTrap,
{
ref: innerAfterRef,
"data-focus-trap": props.id,
className: "__focus-trap-inner-after",
onFocus: (event) => {
if (isFocusEventOutside(event, portalNode)) {
queueFocus(getPreviousTabbable());
} else {
queueFocus(outerAfterRef.current);
}
}
}
)
] });
if (portalNode) {
element = (0,external_ReactDOM_namespaceObject.createPortal)(element, portalNode);
}
let preserveTabOrderElement = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FocusTrap,
{
ref: outerBeforeRef,
"data-focus-trap": props.id,
className: "__focus-trap-outer-before",
onFocus: (event) => {
const fromOuter = event.relatedTarget === outerAfterRef.current;
if (!fromOuter && isFocusEventOutside(event, portalNode)) {
queueFocus(innerBeforeRef.current);
} else {
queueFocus(getPreviousTabbable());
}
}
}
),
preserveTabOrder && // We're using position: fixed here so that the browser doesn't
// add margin to the element when setting gap on a parent element.
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-owns": portalNode == null ? void 0 : portalNode.id, style: { position: "fixed" } }),
preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FocusTrap,
{
ref: outerAfterRef,
"data-focus-trap": props.id,
className: "__focus-trap-outer-after",
onFocus: (event) => {
if (isFocusEventOutside(event, portalNode)) {
queueFocus(innerAfterRef.current);
} else {
const nextTabbable = getNextTabbable();
if (nextTabbable === innerBeforeRef.current) {
requestAnimationFrame(() => {
var _a2;
return (_a2 = getNextTabbable()) == null ? void 0 : _a2.focus();
});
return;
}
queueFocus(nextTabbable);
}
}
}
)
] });
if (anchorPortalNode && preserveTabOrder) {
preserveTabOrderElement = (0,external_ReactDOM_namespaceObject.createPortal)(
preserveTabOrderElement,
anchorPortalNode
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
preserveTabOrderElement,
element
] });
},
[portalNode, context, portal, props.id, preserveTabOrder, anchorPortalNode]
);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
ref: refProp
});
return props;
});
var Portal = forwardRef2(function Portal2(props) {
const htmlProps = usePortal(props);
return LMDWO4NN_createElement(O37CNYMR_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/JC64G2H7.js
"use client";
// src/dialog/dialog.tsx
var JC64G2H7_TagName = "div";
var JC64G2H7_isSafariBrowser = isSafari();
function isAlreadyFocusingAnotherElement(dialog) {
const activeElement = getActiveElement();
if (!activeElement) return false;
if (dialog && contains(dialog, activeElement)) return false;
if (isFocusable(activeElement)) return true;
return false;
}
function getElementFromProp(prop, focusable = false) {
if (!prop) return null;
const element = "current" in prop ? prop.current : prop;
if (!element) return null;
if (focusable) return isFocusable(element) ? element : null;
return element;
}
var useDialog = createHook(function useDialog2(_a) {
var _b = _a, {
store: storeProp,
open: openProp,
onClose,
focusable = true,
modal = true,
portal = !!modal,
backdrop = !!modal,
hideOnEscape = true,
hideOnInteractOutside = true,
getPersistentElements,
preventBodyScroll = !!modal,
autoFocusOnShow = true,
autoFocusOnHide = true,
initialFocus,
finalFocus,
unmountOnHide,
unstable_treeSnapshotKey
} = _b, props = __objRest(_b, [
"store",
"open",
"onClose",
"focusable",
"modal",
"portal",
"backdrop",
"hideOnEscape",
"hideOnInteractOutside",
"getPersistentElements",
"preventBodyScroll",
"autoFocusOnShow",
"autoFocusOnHide",
"initialFocus",
"finalFocus",
"unmountOnHide",
"unstable_treeSnapshotKey"
]);
const context = useDialogProviderContext();
const ref = (0,external_React_.useRef)(null);
const store = useDialogStore({
store: storeProp || context,
open: openProp,
setOpen(open2) {
if (open2) return;
const dialog = ref.current;
if (!dialog) return;
const event = new Event("close", { bubbles: false, cancelable: true });
if (onClose) {
dialog.addEventListener("close", onClose, { once: true });
}
dialog.dispatchEvent(event);
if (!event.defaultPrevented) return;
store.setOpen(true);
}
});
const { portalRef, domReady } = usePortalRef(portal, props.portalRef);
const preserveTabOrderProp = props.preserveTabOrder;
const preserveTabOrder = useStoreState(
store,
(state) => preserveTabOrderProp && !modal && state.mounted
);
const id = useId(props.id);
const open = useStoreState(store, "open");
const mounted = useStoreState(store, "mounted");
const contentElement = useStoreState(store, "contentElement");
const hidden = isHidden(mounted, props.hidden, props.alwaysVisible);
usePreventBodyScroll(contentElement, id, preventBodyScroll && !hidden);
useHideOnInteractOutside(store, hideOnInteractOutside, domReady);
const { wrapElement, nestedDialogs } = useNestedDialogs(store);
props = useWrapElement(props, wrapElement, [wrapElement]);
useSafeLayoutEffect(() => {
if (!open) return;
const dialog = ref.current;
const activeElement = getActiveElement(dialog, true);
if (!activeElement) return;
if (activeElement.tagName === "BODY") return;
if (dialog && contains(dialog, activeElement)) return;
store.setDisclosureElement(activeElement);
}, [store, open]);
if (JC64G2H7_isSafariBrowser) {
(0,external_React_.useEffect)(() => {
if (!mounted) return;
const { disclosureElement } = store.getState();
if (!disclosureElement) return;
if (!isButton(disclosureElement)) return;
const onMouseDown = () => {
let receivedFocus = false;
const onFocus = () => {
receivedFocus = true;
};
const options = { capture: true, once: true };
disclosureElement.addEventListener("focusin", onFocus, options);
queueBeforeEvent(disclosureElement, "mouseup", () => {
disclosureElement.removeEventListener("focusin", onFocus, true);
if (receivedFocus) return;
focusIfNeeded(disclosureElement);
});
};
disclosureElement.addEventListener("mousedown", onMouseDown);
return () => {
disclosureElement.removeEventListener("mousedown", onMouseDown);
};
}, [store, mounted]);
}
(0,external_React_.useEffect)(() => {
if (!mounted) return;
if (!domReady) return;
const dialog = ref.current;
if (!dialog) return;
const win = getWindow(dialog);
const viewport = win.visualViewport || win;
const setViewportHeight = () => {
var _a2, _b2;
const height = (_b2 = (_a2 = win.visualViewport) == null ? void 0 : _a2.height) != null ? _b2 : win.innerHeight;
dialog.style.setProperty("--dialog-viewport-height", `${height}px`);
};
setViewportHeight();
viewport.addEventListener("resize", setViewportHeight);
return () => {
viewport.removeEventListener("resize", setViewportHeight);
};
}, [mounted, domReady]);
(0,external_React_.useEffect)(() => {
if (!modal) return;
if (!mounted) return;
if (!domReady) return;
const dialog = ref.current;
if (!dialog) return;
const existingDismiss = dialog.querySelector("[data-dialog-dismiss]");
if (existingDismiss) return;
return prependHiddenDismiss(dialog, store.hide);
}, [store, modal, mounted, domReady]);
useSafeLayoutEffect(() => {
if (!supportsInert()) return;
if (open) return;
if (!mounted) return;
if (!domReady) return;
const dialog = ref.current;
if (!dialog) return;
return disableTree(dialog);
}, [open, mounted, domReady]);
const canTakeTreeSnapshot = open && domReady;
useSafeLayoutEffect(() => {
if (!id) return;
if (!canTakeTreeSnapshot) return;
const dialog = ref.current;
return createWalkTreeSnapshot(id, [dialog]);
}, [id, canTakeTreeSnapshot, unstable_treeSnapshotKey]);
const getPersistentElementsProp = useEvent(getPersistentElements);
useSafeLayoutEffect(() => {
if (!id) return;
if (!canTakeTreeSnapshot) return;
const { disclosureElement } = store.getState();
const dialog = ref.current;
const persistentElements = getPersistentElementsProp() || [];
const allElements = [
dialog,
...persistentElements,
...nestedDialogs.map((dialog2) => dialog2.getState().contentElement)
];
if (modal) {
return chain(
markTreeOutside(id, allElements),
disableTreeOutside(id, allElements)
);
}
return markTreeOutside(id, [disclosureElement, ...allElements]);
}, [
id,
store,
canTakeTreeSnapshot,
getPersistentElementsProp,
nestedDialogs,
modal,
unstable_treeSnapshotKey
]);
const mayAutoFocusOnShow = !!autoFocusOnShow;
const autoFocusOnShowProp = useBooleanEvent(autoFocusOnShow);
const [autoFocusEnabled, setAutoFocusEnabled] = (0,external_React_.useState)(false);
(0,external_React_.useEffect)(() => {
if (!open) return;
if (!mayAutoFocusOnShow) return;
if (!domReady) return;
if (!(contentElement == null ? void 0 : contentElement.isConnected)) return;
const element = getElementFromProp(initialFocus, true) || // If no initial focus is specified, we try to focus the first element
// with the autofocus attribute. If it's an Ariakit component, the
// Focusable component will consume the autoFocus prop and add the
// data-autofocus attribute to the element instead.
contentElement.querySelector(
"[data-autofocus=true],[autofocus]"
) || // We have to fallback to the first focusable element otherwise portaled
// dialogs with preserveTabOrder set to true will not receive focus
// properly because the elements aren't tabbable until the dialog receives
// focus.
getFirstTabbableIn(contentElement, true, portal && preserveTabOrder) || // Finally, we fallback to the dialog element itself.
contentElement;
const isElementFocusable = isFocusable(element);
if (!autoFocusOnShowProp(isElementFocusable ? element : null)) return;
setAutoFocusEnabled(true);
queueMicrotask(() => {
element.focus();
if (!JC64G2H7_isSafariBrowser) return;
element.scrollIntoView({ block: "nearest", inline: "nearest" });
});
}, [
open,
mayAutoFocusOnShow,
domReady,
contentElement,
initialFocus,
portal,
preserveTabOrder,
autoFocusOnShowProp
]);
const mayAutoFocusOnHide = !!autoFocusOnHide;
const autoFocusOnHideProp = useBooleanEvent(autoFocusOnHide);
const [hasOpened, setHasOpened] = (0,external_React_.useState)(false);
(0,external_React_.useEffect)(() => {
if (!open) return;
setHasOpened(true);
return () => setHasOpened(false);
}, [open]);
const focusOnHide = (0,external_React_.useCallback)(
(dialog, retry = true) => {
const { disclosureElement } = store.getState();
if (isAlreadyFocusingAnotherElement(dialog)) return;
let element = getElementFromProp(finalFocus) || disclosureElement;
if (element == null ? void 0 : element.id) {
const doc = getDocument(element);
const selector = `[aria-activedescendant="${element.id}"]`;
const composite = doc.querySelector(selector);
if (composite) {
element = composite;
}
}
if (element && !isFocusable(element)) {
const maybeParentDialog = element.closest("[data-dialog]");
if (maybeParentDialog == null ? void 0 : maybeParentDialog.id) {
const doc = getDocument(maybeParentDialog);
const selector = `[aria-controls~="${maybeParentDialog.id}"]`;
const control = doc.querySelector(selector);
if (control) {
element = control;
}
}
}
const isElementFocusable = element && isFocusable(element);
if (!isElementFocusable && retry) {
requestAnimationFrame(() => focusOnHide(dialog, false));
return;
}
if (!autoFocusOnHideProp(isElementFocusable ? element : null)) return;
if (!isElementFocusable) return;
element == null ? void 0 : element.focus();
},
[store, finalFocus, autoFocusOnHideProp]
);
const focusedOnHideRef = (0,external_React_.useRef)(false);
useSafeLayoutEffect(() => {
if (open) return;
if (!hasOpened) return;
if (!mayAutoFocusOnHide) return;
const dialog = ref.current;
focusedOnHideRef.current = true;
focusOnHide(dialog);
}, [open, hasOpened, domReady, mayAutoFocusOnHide, focusOnHide]);
(0,external_React_.useEffect)(() => {
if (!hasOpened) return;
if (!mayAutoFocusOnHide) return;
const dialog = ref.current;
return () => {
if (focusedOnHideRef.current) {
focusedOnHideRef.current = false;
return;
}
focusOnHide(dialog);
};
}, [hasOpened, mayAutoFocusOnHide, focusOnHide]);
const hideOnEscapeProp = useBooleanEvent(hideOnEscape);
(0,external_React_.useEffect)(() => {
if (!domReady) return;
if (!mounted) return;
const onKeyDown = (event) => {
if (event.key !== "Escape") return;
if (event.defaultPrevented) return;
const dialog = ref.current;
if (!dialog) return;
if (isElementMarked(dialog)) return;
const target = event.target;
if (!target) return;
const { disclosureElement } = store.getState();
const isValidTarget = () => {
if (target.tagName === "BODY") return true;
if (contains(dialog, target)) return true;
if (!disclosureElement) return true;
if (contains(disclosureElement, target)) return true;
return false;
};
if (!isValidTarget()) return;
if (!hideOnEscapeProp(event)) return;
store.hide();
};
return addGlobalEventListener("keydown", onKeyDown, true);
}, [store, domReady, mounted, hideOnEscapeProp]);
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HeadingLevel, { level: modal ? 1 : void 0, children: element }),
[modal]
);
const hiddenProp = props.hidden;
const alwaysVisible = props.alwaysVisible;
props = useWrapElement(
props,
(element) => {
if (!backdrop) return element;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DialogBackdrop,
{
store,
backdrop,
hidden: hiddenProp,
alwaysVisible
}
),
element
] });
},
[store, backdrop, hiddenProp, alwaysVisible]
);
const [headingId, setHeadingId] = (0,external_React_.useState)();
const [descriptionId, setDescriptionId] = (0,external_React_.useState)();
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogScopedContextProvider, { value: store, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogHeadingContext.Provider, { value: setHeadingId, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogDescriptionContext.Provider, { value: setDescriptionId, children: element }) }) }),
[store]
);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
id,
"data-dialog": "",
role: "dialog",
tabIndex: focusable ? -1 : void 0,
"aria-labelledby": headingId,
"aria-describedby": descriptionId
}, props), {
ref: useMergeRefs(ref, props.ref)
});
props = useFocusableContainer(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
autoFocusOnShow: autoFocusEnabled
}));
props = useDisclosureContent(_3YLGPPWQ_spreadValues({ store }, props));
props = useFocusable(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { focusable }));
props = usePortal(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ portal }, props), { portalRef, preserveTabOrder }));
return props;
});
function createDialogComponent(Component, useProviderContext = useDialogProviderContext) {
return forwardRef2(function DialogComponent(props) {
const context = useProviderContext();
const store = props.store || context;
const mounted = useStoreState(
store,
(state) => !props.unmountOnHide || (state == null ? void 0 : state.mounted) || !!props.open
);
if (!mounted) return null;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, _3YLGPPWQ_spreadValues({}, props));
});
}
var Dialog = createDialogComponent(
forwardRef2(function Dialog2(props) {
const htmlProps = useDialog(props);
return LMDWO4NN_createElement(JC64G2H7_TagName, htmlProps);
}),
useDialogProviderContext
);
;// ./node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
const floating_ui_utils_sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left']));
const alignments = (/* unused pure expression or super */ null && (['start', 'end']));
const floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (floating_ui_utils_sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), [])));
const floating_ui_utils_min = Math.min;
const floating_ui_utils_max = Math.max;
const round = Math.round;
const floor = Math.floor;
const createCoords = v => ({
x: v,
y: v
});
const oppositeSideMap = {
left: 'right',
right: 'left',
bottom: 'top',
top: 'bottom'
};
const oppositeAlignmentMap = {
start: 'end',
end: 'start'
};
function clamp(start, value, end) {
return floating_ui_utils_max(start, floating_ui_utils_min(value, end));
}
function floating_ui_utils_evaluate(value, param) {
return typeof value === 'function' ? value(param) : value;
}
function floating_ui_utils_getSide(placement) {
return placement.split('-')[0];
}
function floating_ui_utils_getAlignment(placement) {
return placement.split('-')[1];
}
function getOppositeAxis(axis) {
return axis === 'x' ? 'y' : 'x';
}
function getAxisLength(axis) {
return axis === 'y' ? 'height' : 'width';
}
function floating_ui_utils_getSideAxis(placement) {
return ['top', 'bottom'].includes(floating_ui_utils_getSide(placement)) ? 'y' : 'x';
}
function getAlignmentAxis(placement) {
return getOppositeAxis(floating_ui_utils_getSideAxis(placement));
}
function floating_ui_utils_getAlignmentSides(placement, rects, rtl) {
if (rtl === void 0) {
rtl = false;
}
const alignment = floating_ui_utils_getAlignment(placement);
const alignmentAxis = getAlignmentAxis(placement);
const length = getAxisLength(alignmentAxis);
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
if (rects.reference[length] > rects.floating[length]) {
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
}
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
}
function getExpandedPlacements(placement) {
const oppositePlacement = getOppositePlacement(placement);
return [floating_ui_utils_getOppositeAlignmentPlacement(placement), oppositePlacement, floating_ui_utils_getOppositeAlignmentPlacement(oppositePlacement)];
}
function floating_ui_utils_getOppositeAlignmentPlacement(placement) {
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
}
function getSideList(side, isStart, rtl) {
const lr = ['left', 'right'];
const rl = ['right', 'left'];
const tb = ['top', 'bottom'];
const bt = ['bottom', 'top'];
switch (side) {
case 'top':
case 'bottom':
if (rtl) return isStart ? rl : lr;
return isStart ? lr : rl;
case 'left':
case 'right':
return isStart ? tb : bt;
default:
return [];
}
}
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
const alignment = floating_ui_utils_getAlignment(placement);
let list = getSideList(floating_ui_utils_getSide(placement), direction === 'start', rtl);
if (alignment) {
list = list.map(side => side + "-" + alignment);
if (flipAlignment) {
list = list.concat(list.map(floating_ui_utils_getOppositeAlignmentPlacement));
}
}
return list;
}
function getOppositePlacement(placement) {
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
}
function expandPaddingObject(padding) {
return {
top: 0,
right: 0,
bottom: 0,
left: 0,
...padding
};
}
function floating_ui_utils_getPaddingObject(padding) {
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
top: padding,
right: padding,
bottom: padding,
left: padding
};
}
function floating_ui_utils_rectToClientRect(rect) {
return {
...rect,
top: rect.y,
left: rect.x,
right: rect.x + rect.width,
bottom: rect.y + rect.height
};
}
;// ./node_modules/@floating-ui/core/dist/floating-ui.core.mjs
function computeCoordsFromPlacement(_ref, placement, rtl) {
let {
reference,
floating
} = _ref;
const sideAxis = floating_ui_utils_getSideAxis(placement);
const alignmentAxis = getAlignmentAxis(placement);
const alignLength = getAxisLength(alignmentAxis);
const side = floating_ui_utils_getSide(placement);
const isVertical = sideAxis === 'y';
const commonX = reference.x + reference.width / 2 - floating.width / 2;
const commonY = reference.y + reference.height / 2 - floating.height / 2;
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
let coords;
switch (side) {
case 'top':
coords = {
x: commonX,
y: reference.y - floating.height
};
break;
case 'bottom':
coords = {
x: commonX,
y: reference.y + reference.height
};
break;
case 'right':
coords = {
x: reference.x + reference.width,
y: commonY
};
break;
case 'left':
coords = {
x: reference.x - floating.width,
y: commonY
};
break;
default:
coords = {
x: reference.x,
y: reference.y
};
}
switch (floating_ui_utils_getAlignment(placement)) {
case 'start':
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
break;
case 'end':
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
break;
}
return coords;
}
/**
* Computes the `x` and `y` coordinates that will place the floating element
* next to a reference element when it is given a certain positioning strategy.
*
* This export does not have any `platform` interface logic. You will need to
* write one for the platform you are using Floating UI with.
*/
const computePosition = async (reference, floating, config) => {
const {
placement = 'bottom',
strategy = 'absolute',
middleware = [],
platform
} = config;
const validMiddleware = middleware.filter(Boolean);
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
let rects = await platform.getElementRects({
reference,
floating,
strategy
});
let {
x,
y
} = computeCoordsFromPlacement(rects, placement, rtl);
let statefulPlacement = placement;
let middlewareData = {};
let resetCount = 0;
for (let i = 0; i < validMiddleware.length; i++) {
const {
name,
fn
} = validMiddleware[i];
const {
x: nextX,
y: nextY,
data,
reset
} = await fn({
x,
y,
initialPlacement: placement,
placement: statefulPlacement,
strategy,
middlewareData,
rects,
platform,
elements: {
reference,
floating
}
});
x = nextX != null ? nextX : x;
y = nextY != null ? nextY : y;
middlewareData = {
...middlewareData,
[name]: {
...middlewareData[name],
...data
}
};
if (reset && resetCount <= 50) {
resetCount++;
if (typeof reset === 'object') {
if (reset.placement) {
statefulPlacement = reset.placement;
}
if (reset.rects) {
rects = reset.rects === true ? await platform.getElementRects({
reference,
floating,
strategy
}) : reset.rects;
}
({
x,
y
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
}
i = -1;
continue;
}
}
return {
x,
y,
placement: statefulPlacement,
strategy,
middlewareData
};
};
/**
* Resolves with an object of overflow side offsets that determine how much the
* element is overflowing a given clipping boundary on each side.
* - positive = overflowing the boundary by that number of pixels
* - negative = how many pixels left before it will overflow
* - 0 = lies flush with the boundary
* @see https://floating-ui.com/docs/detectOverflow
*/
async function detectOverflow(state, options) {
var _await$platform$isEle;
if (options === void 0) {
options = {};
}
const {
x,
y,
platform,
rects,
elements,
strategy
} = state;
const {
boundary = 'clippingAncestors',
rootBoundary = 'viewport',
elementContext = 'floating',
altBoundary = false,
padding = 0
} = floating_ui_utils_evaluate(options, state);
const paddingObject = floating_ui_utils_getPaddingObject(padding);
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
const element = elements[altBoundary ? altContext : elementContext];
const clippingClientRect = floating_ui_utils_rectToClientRect(await platform.getClippingRect({
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
boundary,
rootBoundary,
strategy
}));
const rect = elementContext === 'floating' ? {
...rects.floating,
x,
y
} : rects.reference;
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
x: 1,
y: 1
} : {
x: 1,
y: 1
};
const elementClientRect = floating_ui_utils_rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
rect,
offsetParent,
strategy
}) : rect);
return {
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
};
}
/**
* Provides data to position an inner element of the floating element so that it
* appears centered to the reference element.
* @see https://floating-ui.com/docs/arrow
*/
const arrow = options => ({
name: 'arrow',
options,
async fn(state) {
const {
x,
y,
placement,
rects,
platform,
elements,
middlewareData
} = state;
// Since `element` is required, we don't Partial<> the type.
const {
element,
padding = 0
} = floating_ui_utils_evaluate(options, state) || {};
if (element == null) {
return {};
}
const paddingObject = floating_ui_utils_getPaddingObject(padding);
const coords = {
x,
y
};
const axis = getAlignmentAxis(placement);
const length = getAxisLength(axis);
const arrowDimensions = await platform.getDimensions(element);
const isYAxis = axis === 'y';
const minProp = isYAxis ? 'top' : 'left';
const maxProp = isYAxis ? 'bottom' : 'right';
const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
const startDiff = coords[axis] - rects.reference[axis];
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
// DOM platform can return `window` as the `offsetParent`.
if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
clientSize = elements.floating[clientProp] || rects.floating[length];
}
const centerToReference = endDiff / 2 - startDiff / 2;
// If the padding is large enough that it causes the arrow to no longer be
// centered, modify the padding so that it is centered.
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
const minPadding = floating_ui_utils_min(paddingObject[minProp], largestPossiblePadding);
const maxPadding = floating_ui_utils_min(paddingObject[maxProp], largestPossiblePadding);
// Make sure the arrow doesn't overflow the floating element if the center
// point is outside the floating element's bounds.
const min$1 = minPadding;
const max = clientSize - arrowDimensions[length] - maxPadding;
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
const offset = clamp(min$1, center, max);
// If the reference is small enough that the arrow's padding causes it to
// to point to nothing for an aligned placement, adjust the offset of the
// floating element itself. To ensure `shift()` continues to take action,
// a single reset is performed when this is true.
const shouldAddOffset = !middlewareData.arrow && floating_ui_utils_getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
return {
[axis]: coords[axis] + alignmentOffset,
data: {
[axis]: offset,
centerOffset: center - offset - alignmentOffset,
...(shouldAddOffset && {
alignmentOffset
})
},
reset: shouldAddOffset
};
}
});
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
return allowedPlacementsSortedByAlignment.filter(placement => {
if (alignment) {
return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
}
return true;
});
}
/**
* Optimizes the visibility of the floating element by choosing the placement
* that has the most space available automatically, without needing to specify a
* preferred placement. Alternative to `flip`.
* @see https://floating-ui.com/docs/autoPlacement
*/
const autoPlacement = function (options) {
if (options === void 0) {
options = {};
}
return {
name: 'autoPlacement',
options,
async fn(state) {
var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
const {
rects,
middlewareData,
placement,
platform,
elements
} = state;
const {
crossAxis = false,
alignment,
allowedPlacements = placements,
autoAlignment = true,
...detectOverflowOptions
} = evaluate(options, state);
const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
const overflow = await detectOverflow(state, detectOverflowOptions);
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
const currentPlacement = placements$1[currentIndex];
if (currentPlacement == null) {
return {};
}
const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
// Make `computeCoords` start from the right place.
if (placement !== currentPlacement) {
return {
reset: {
placement: placements$1[0]
}
};
}
const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
placement: currentPlacement,
overflows: currentOverflows
}];
const nextPlacement = placements$1[currentIndex + 1];
// There are more placements to check.
if (nextPlacement) {
return {
data: {
index: currentIndex + 1,
overflows: allOverflows
},
reset: {
placement: nextPlacement
}
};
}
const placementsSortedByMostSpace = allOverflows.map(d => {
const alignment = getAlignment(d.placement);
return [d.placement, alignment && crossAxis ?
// Check along the mainAxis and main crossAxis side.
d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :
// Check only the mainAxis.
d.overflows[0], d.overflows];
}).sort((a, b) => a[1] - b[1]);
const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,
// Aligned placements should not check their opposite crossAxis
// side.
getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));
const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
if (resetPlacement !== placement) {
return {
data: {
index: currentIndex + 1,
overflows: allOverflows
},
reset: {
placement: resetPlacement
}
};
}
return {};
}
};
};
/**
* Optimizes the visibility of the floating element by flipping the `placement`
* in order to keep it in view when the preferred placement(s) will overflow the
* clipping boundary. Alternative to `autoPlacement`.
* @see https://floating-ui.com/docs/flip
*/
const flip = function (options) {
if (options === void 0) {
options = {};
}
return {
name: 'flip',
options,
async fn(state) {
var _middlewareData$arrow, _middlewareData$flip;
const {
placement,
middlewareData,
rects,
initialPlacement,
platform,
elements
} = state;
const {
mainAxis: checkMainAxis = true,
crossAxis: checkCrossAxis = true,
fallbackPlacements: specifiedFallbackPlacements,
fallbackStrategy = 'bestFit',
fallbackAxisSideDirection = 'none',
flipAlignment = true,
...detectOverflowOptions
} = floating_ui_utils_evaluate(options, state);
// If a reset by the arrow was caused due to an alignment offset being
// added, we should skip any logic now since `flip()` has already done its
// work.
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
return {};
}
const side = floating_ui_utils_getSide(placement);
const isBasePlacement = floating_ui_utils_getSide(initialPlacement) === initialPlacement;
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
}
const placements = [initialPlacement, ...fallbackPlacements];
const overflow = await detectOverflow(state, detectOverflowOptions);
const overflows = [];
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
if (checkMainAxis) {
overflows.push(overflow[side]);
}
if (checkCrossAxis) {
const sides = floating_ui_utils_getAlignmentSides(placement, rects, rtl);
overflows.push(overflow[sides[0]], overflow[sides[1]]);
}
overflowsData = [...overflowsData, {
placement,
overflows
}];
// One or more sides is overflowing.
if (!overflows.every(side => side <= 0)) {
var _middlewareData$flip2, _overflowsData$filter;
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
const nextPlacement = placements[nextIndex];
if (nextPlacement) {
// Try next placement and re-run the lifecycle.
return {
data: {
index: nextIndex,
overflows: overflowsData
},
reset: {
placement: nextPlacement
}
};
}
// First, find the candidates that fit on the mainAxis side of overflow,
// then find the placement that fits the best on the main crossAxis side.
let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
// Otherwise fallback.
if (!resetPlacement) {
switch (fallbackStrategy) {
case 'bestFit':
{
var _overflowsData$map$so;
const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
if (placement) {
resetPlacement = placement;
}
break;
}
case 'initialPlacement':
resetPlacement = initialPlacement;
break;
}
}
if (placement !== resetPlacement) {
return {
reset: {
placement: resetPlacement
}
};
}
}
return {};
}
};
};
function getSideOffsets(overflow, rect) {
return {
top: overflow.top - rect.height,
right: overflow.right - rect.width,
bottom: overflow.bottom - rect.height,
left: overflow.left - rect.width
};
}
function isAnySideFullyClipped(overflow) {
return sides.some(side => overflow[side] >= 0);
}
/**
* Provides data to hide the floating element in applicable situations, such as
* when it is not in the same clipping context as the reference element.
* @see https://floating-ui.com/docs/hide
*/
const hide = function (options) {
if (options === void 0) {
options = {};
}
return {
name: 'hide',
options,
async fn(state) {
const {
rects
} = state;
const {
strategy = 'referenceHidden',
...detectOverflowOptions
} = evaluate(options, state);
switch (strategy) {
case 'referenceHidden':
{
const overflow = await detectOverflow(state, {
...detectOverflowOptions,
elementContext: 'reference'
});
const offsets = getSideOffsets(overflow, rects.reference);
return {
data: {
referenceHiddenOffsets: offsets,
referenceHidden: isAnySideFullyClipped(offsets)
}
};
}
case 'escaped':
{
const overflow = await detectOverflow(state, {
...detectOverflowOptions,
altBoundary: true
});
const offsets = getSideOffsets(overflow, rects.floating);
return {
data: {
escapedOffsets: offsets,
escaped: isAnySideFullyClipped(offsets)
}
};
}
default:
{
return {};
}
}
}
};
};
function getBoundingRect(rects) {
const minX = min(...rects.map(rect => rect.left));
const minY = min(...rects.map(rect => rect.top));
const maxX = max(...rects.map(rect => rect.right));
const maxY = max(...rects.map(rect => rect.bottom));
return {
x: minX,
y: minY,
width: maxX - minX,
height: maxY - minY
};
}
function getRectsByLine(rects) {
const sortedRects = rects.slice().sort((a, b) => a.y - b.y);
const groups = [];
let prevRect = null;
for (let i = 0; i < sortedRects.length; i++) {
const rect = sortedRects[i];
if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {
groups.push([rect]);
} else {
groups[groups.length - 1].push(rect);
}
prevRect = rect;
}
return groups.map(rect => rectToClientRect(getBoundingRect(rect)));
}
/**
* Provides improved positioning for inline reference elements that can span
* over multiple lines, such as hyperlinks or range selections.
* @see https://floating-ui.com/docs/inline
*/
const inline = function (options) {
if (options === void 0) {
options = {};
}
return {
name: 'inline',
options,
async fn(state) {
const {
placement,
elements,
rects,
platform,
strategy
} = state;
// A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
// ClientRect's bounds, despite the event listener being triggered. A
// padding of 2 seems to handle this issue.
const {
padding = 2,
x,
y
} = evaluate(options, state);
const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);
const clientRects = getRectsByLine(nativeClientRects);
const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
const paddingObject = getPaddingObject(padding);
function getBoundingClientRect() {
// There are two rects and they are disjoined.
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
// Find the first rect in which the point is fully inside.
return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
}
// There are 2 or more connected rects.
if (clientRects.length >= 2) {
if (getSideAxis(placement) === 'y') {
const firstRect = clientRects[0];
const lastRect = clientRects[clientRects.length - 1];
const isTop = getSide(placement) === 'top';
const top = firstRect.top;
const bottom = lastRect.bottom;
const left = isTop ? firstRect.left : lastRect.left;
const right = isTop ? firstRect.right : lastRect.right;
const width = right - left;
const height = bottom - top;
return {
top,
bottom,
left,
right,
width,
height,
x: left,
y: top
};
}
const isLeftSide = getSide(placement) === 'left';
const maxRight = max(...clientRects.map(rect => rect.right));
const minLeft = min(...clientRects.map(rect => rect.left));
const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
const top = measureRects[0].top;
const bottom = measureRects[measureRects.length - 1].bottom;
const left = minLeft;
const right = maxRight;
const width = right - left;
const height = bottom - top;
return {
top,
bottom,
left,
right,
width,
height,
x: left,
y: top
};
}
return fallback;
}
const resetRects = await platform.getElementRects({
reference: {
getBoundingClientRect
},
floating: elements.floating,
strategy
});
if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
return {
reset: {
rects: resetRects
}
};
}
return {};
}
};
};
// For type backwards-compatibility, the `OffsetOptions` type was also
// Derivable.
async function convertValueToCoords(state, options) {
const {
placement,
platform,
elements
} = state;
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
const side = floating_ui_utils_getSide(placement);
const alignment = floating_ui_utils_getAlignment(placement);
const isVertical = floating_ui_utils_getSideAxis(placement) === 'y';
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
const crossAxisMulti = rtl && isVertical ? -1 : 1;
const rawValue = floating_ui_utils_evaluate(options, state);
// eslint-disable-next-line prefer-const
let {
mainAxis,
crossAxis,
alignmentAxis
} = typeof rawValue === 'number' ? {
mainAxis: rawValue,
crossAxis: 0,
alignmentAxis: null
} : {
mainAxis: 0,
crossAxis: 0,
alignmentAxis: null,
...rawValue
};
if (alignment && typeof alignmentAxis === 'number') {
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
}
return isVertical ? {
x: crossAxis * crossAxisMulti,
y: mainAxis * mainAxisMulti
} : {
x: mainAxis * mainAxisMulti,
y: crossAxis * crossAxisMulti
};
}
/**
* Modifies the placement by translating the floating element along the
* specified axes.
* A number (shorthand for `mainAxis` or distance), or an axes configuration
* object may be passed.
* @see https://floating-ui.com/docs/offset
*/
const offset = function (options) {
if (options === void 0) {
options = 0;
}
return {
name: 'offset',
options,
async fn(state) {
const {
x,
y
} = state;
const diffCoords = await convertValueToCoords(state, options);
return {
x: x + diffCoords.x,
y: y + diffCoords.y,
data: diffCoords
};
}
};
};
/**
* Optimizes the visibility of the floating element by shifting it in order to
* keep it in view when it will overflow the clipping boundary.
* @see https://floating-ui.com/docs/shift
*/
const shift = function (options) {
if (options === void 0) {
options = {};
}
return {
name: 'shift',
options,
async fn(state) {
const {
x,
y,
placement
} = state;
const {
mainAxis: checkMainAxis = true,
crossAxis: checkCrossAxis = false,
limiter = {
fn: _ref => {
let {
x,
y
} = _ref;
return {
x,
y
};
}
},
...detectOverflowOptions
} = floating_ui_utils_evaluate(options, state);
const coords = {
x,
y
};
const overflow = await detectOverflow(state, detectOverflowOptions);
const crossAxis = floating_ui_utils_getSideAxis(floating_ui_utils_getSide(placement));
const mainAxis = getOppositeAxis(crossAxis);
let mainAxisCoord = coords[mainAxis];
let crossAxisCoord = coords[crossAxis];
if (checkMainAxis) {
const minSide = mainAxis === 'y' ? 'top' : 'left';
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
const min = mainAxisCoord + overflow[minSide];
const max = mainAxisCoord - overflow[maxSide];
mainAxisCoord = clamp(min, mainAxisCoord, max);
}
if (checkCrossAxis) {
const minSide = crossAxis === 'y' ? 'top' : 'left';
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
const min = crossAxisCoord + overflow[minSide];
const max = crossAxisCoord - overflow[maxSide];
crossAxisCoord = clamp(min, crossAxisCoord, max);
}
const limitedCoords = limiter.fn({
...state,
[mainAxis]: mainAxisCoord,
[crossAxis]: crossAxisCoord
});
return {
...limitedCoords,
data: {
x: limitedCoords.x - x,
y: limitedCoords.y - y
}
};
}
};
};
/**
* Built-in `limiter` that will stop `shift()` at a certain point.
*/
const limitShift = function (options) {
if (options === void 0) {
options = {};
}
return {
options,
fn(state) {
const {
x,
y,
placement,
rects,
middlewareData
} = state;
const {
offset = 0,
mainAxis: checkMainAxis = true,
crossAxis: checkCrossAxis = true
} = floating_ui_utils_evaluate(options, state);
const coords = {
x,
y
};
const crossAxis = floating_ui_utils_getSideAxis(placement);
const mainAxis = getOppositeAxis(crossAxis);
let mainAxisCoord = coords[mainAxis];
let crossAxisCoord = coords[crossAxis];
const rawOffset = floating_ui_utils_evaluate(offset, state);
const computedOffset = typeof rawOffset === 'number' ? {
mainAxis: rawOffset,
crossAxis: 0
} : {
mainAxis: 0,
crossAxis: 0,
...rawOffset
};
if (checkMainAxis) {
const len = mainAxis === 'y' ? 'height' : 'width';
const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
if (mainAxisCoord < limitMin) {
mainAxisCoord = limitMin;
} else if (mainAxisCoord > limitMax) {
mainAxisCoord = limitMax;
}
}
if (checkCrossAxis) {
var _middlewareData$offse, _middlewareData$offse2;
const len = mainAxis === 'y' ? 'width' : 'height';
const isOriginSide = ['top', 'left'].includes(floating_ui_utils_getSide(placement));
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
if (crossAxisCoord < limitMin) {
crossAxisCoord = limitMin;
} else if (crossAxisCoord > limitMax) {
crossAxisCoord = limitMax;
}
}
return {
[mainAxis]: mainAxisCoord,
[crossAxis]: crossAxisCoord
};
}
};
};
/**
* Provides data that allows you to change the size of the floating element —
* for instance, prevent it from overflowing the clipping boundary or match the
* width of the reference element.
* @see https://floating-ui.com/docs/size
*/
const size = function (options) {
if (options === void 0) {
options = {};
}
return {
name: 'size',
options,
async fn(state) {
const {
placement,
rects,
platform,
elements
} = state;
const {
apply = () => {},
...detectOverflowOptions
} = floating_ui_utils_evaluate(options, state);
const overflow = await detectOverflow(state, detectOverflowOptions);
const side = floating_ui_utils_getSide(placement);
const alignment = floating_ui_utils_getAlignment(placement);
const isYAxis = floating_ui_utils_getSideAxis(placement) === 'y';
const {
width,
height
} = rects.floating;
let heightSide;
let widthSide;
if (side === 'top' || side === 'bottom') {
heightSide = side;
widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
} else {
widthSide = side;
heightSide = alignment === 'end' ? 'top' : 'bottom';
}
const overflowAvailableHeight = height - overflow[heightSide];
const overflowAvailableWidth = width - overflow[widthSide];
const noShift = !state.middlewareData.shift;
let availableHeight = overflowAvailableHeight;
let availableWidth = overflowAvailableWidth;
if (isYAxis) {
const maximumClippingWidth = width - overflow.left - overflow.right;
availableWidth = alignment || noShift ? floating_ui_utils_min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
} else {
const maximumClippingHeight = height - overflow.top - overflow.bottom;
availableHeight = alignment || noShift ? floating_ui_utils_min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
}
if (noShift && !alignment) {
const xMin = floating_ui_utils_max(overflow.left, 0);
const xMax = floating_ui_utils_max(overflow.right, 0);
const yMin = floating_ui_utils_max(overflow.top, 0);
const yMax = floating_ui_utils_max(overflow.bottom, 0);
if (isYAxis) {
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : floating_ui_utils_max(overflow.left, overflow.right));
} else {
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : floating_ui_utils_max(overflow.top, overflow.bottom));
}
}
await apply({
...state,
availableWidth,
availableHeight
});
const nextDimensions = await platform.getDimensions(elements.floating);
if (width !== nextDimensions.width || height !== nextDimensions.height) {
return {
reset: {
rects: true
}
};
}
return {};
}
};
};
;// ./node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
/**
* Custom positioning reference element.
* @see https://floating-ui.com/docs/virtual-elements
*/
const dist_floating_ui_utils_sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left']));
const floating_ui_utils_alignments = (/* unused pure expression or super */ null && (['start', 'end']));
const dist_floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (dist_floating_ui_utils_sides.reduce((acc, side) => acc.concat(side, side + "-" + floating_ui_utils_alignments[0], side + "-" + floating_ui_utils_alignments[1]), [])));
const dist_floating_ui_utils_min = Math.min;
const dist_floating_ui_utils_max = Math.max;
const floating_ui_utils_round = Math.round;
const floating_ui_utils_floor = Math.floor;
const floating_ui_utils_createCoords = v => ({
x: v,
y: v
});
const floating_ui_utils_oppositeSideMap = {
left: 'right',
right: 'left',
bottom: 'top',
top: 'bottom'
};
const floating_ui_utils_oppositeAlignmentMap = {
start: 'end',
end: 'start'
};
function floating_ui_utils_clamp(start, value, end) {
return dist_floating_ui_utils_max(start, dist_floating_ui_utils_min(value, end));
}
function dist_floating_ui_utils_evaluate(value, param) {
return typeof value === 'function' ? value(param) : value;
}
function dist_floating_ui_utils_getSide(placement) {
return placement.split('-')[0];
}
function dist_floating_ui_utils_getAlignment(placement) {
return placement.split('-')[1];
}
function floating_ui_utils_getOppositeAxis(axis) {
return axis === 'x' ? 'y' : 'x';
}
function floating_ui_utils_getAxisLength(axis) {
return axis === 'y' ? 'height' : 'width';
}
function dist_floating_ui_utils_getSideAxis(placement) {
return ['top', 'bottom'].includes(dist_floating_ui_utils_getSide(placement)) ? 'y' : 'x';
}
function floating_ui_utils_getAlignmentAxis(placement) {
return floating_ui_utils_getOppositeAxis(dist_floating_ui_utils_getSideAxis(placement));
}
function dist_floating_ui_utils_getAlignmentSides(placement, rects, rtl) {
if (rtl === void 0) {
rtl = false;
}
const alignment = dist_floating_ui_utils_getAlignment(placement);
const alignmentAxis = floating_ui_utils_getAlignmentAxis(placement);
const length = floating_ui_utils_getAxisLength(alignmentAxis);
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
if (rects.reference[length] > rects.floating[length]) {
mainAlignmentSide = floating_ui_utils_getOppositePlacement(mainAlignmentSide);
}
return [mainAlignmentSide, floating_ui_utils_getOppositePlacement(mainAlignmentSide)];
}
function floating_ui_utils_getExpandedPlacements(placement) {
const oppositePlacement = floating_ui_utils_getOppositePlacement(placement);
return [dist_floating_ui_utils_getOppositeAlignmentPlacement(placement), oppositePlacement, dist_floating_ui_utils_getOppositeAlignmentPlacement(oppositePlacement)];
}
function dist_floating_ui_utils_getOppositeAlignmentPlacement(placement) {
return placement.replace(/start|end/g, alignment => floating_ui_utils_oppositeAlignmentMap[alignment]);
}
function floating_ui_utils_getSideList(side, isStart, rtl) {
const lr = ['left', 'right'];
const rl = ['right', 'left'];
const tb = ['top', 'bottom'];
const bt = ['bottom', 'top'];
switch (side) {
case 'top':
case 'bottom':
if (rtl) return isStart ? rl : lr;
return isStart ? lr : rl;
case 'left':
case 'right':
return isStart ? tb : bt;
default:
return [];
}
}
function floating_ui_utils_getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
const alignment = dist_floating_ui_utils_getAlignment(placement);
let list = floating_ui_utils_getSideList(dist_floating_ui_utils_getSide(placement), direction === 'start', rtl);
if (alignment) {
list = list.map(side => side + "-" + alignment);
if (flipAlignment) {
list = list.concat(list.map(dist_floating_ui_utils_getOppositeAlignmentPlacement));
}
}
return list;
}
function floating_ui_utils_getOppositePlacement(placement) {
return placement.replace(/left|right|bottom|top/g, side => floating_ui_utils_oppositeSideMap[side]);
}
function floating_ui_utils_expandPaddingObject(padding) {
return {
top: 0,
right: 0,
bottom: 0,
left: 0,
...padding
};
}
function dist_floating_ui_utils_getPaddingObject(padding) {
return typeof padding !== 'number' ? floating_ui_utils_expandPaddingObject(padding) : {
top: padding,
right: padding,
bottom: padding,
left: padding
};
}
function dist_floating_ui_utils_rectToClientRect(rect) {
const {
x,
y,
width,
height
} = rect;
return {
width,
height,
top: y,
left: x,
right: x + width,
bottom: y + height,
x,
y
};
}
;// ./node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
function hasWindow() {
return typeof window !== 'undefined';
}
function getNodeName(node) {
if (isNode(node)) {
return (node.nodeName || '').toLowerCase();
}
// Mocked nodes in testing environments may not be instances of Node. By
// returning `#document` an infinite loop won't occur.
// https://github.com/floating-ui/floating-ui/issues/2317
return '#document';
}
function floating_ui_utils_dom_getWindow(node) {
var _node$ownerDocument;
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
}
function getDocumentElement(node) {
var _ref;
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
}
function isNode(value) {
if (!hasWindow()) {
return false;
}
return value instanceof Node || value instanceof floating_ui_utils_dom_getWindow(value).Node;
}
function isElement(value) {
if (!hasWindow()) {
return false;
}
return value instanceof Element || value instanceof floating_ui_utils_dom_getWindow(value).Element;
}
function isHTMLElement(value) {
if (!hasWindow()) {
return false;
}
return value instanceof HTMLElement || value instanceof floating_ui_utils_dom_getWindow(value).HTMLElement;
}
function isShadowRoot(value) {
if (!hasWindow() || typeof ShadowRoot === 'undefined') {
return false;
}
return value instanceof ShadowRoot || value instanceof floating_ui_utils_dom_getWindow(value).ShadowRoot;
}
function isOverflowElement(element) {
const {
overflow,
overflowX,
overflowY,
display
} = floating_ui_utils_dom_getComputedStyle(element);
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
}
function isTableElement(element) {
return ['table', 'td', 'th'].includes(getNodeName(element));
}
function isTopLayer(element) {
return [':popover-open', ':modal'].some(selector => {
try {
return element.matches(selector);
} catch (e) {
return false;
}
});
}
function isContainingBlock(elementOrCss) {
const webkit = isWebKit();
const css = isElement(elementOrCss) ? floating_ui_utils_dom_getComputedStyle(elementOrCss) : elementOrCss;
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
// https://drafts.csswg.org/css-transforms-2/#individual-transforms
return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
}
function getContainingBlock(element) {
let currentNode = getParentNode(element);
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
if (isContainingBlock(currentNode)) {
return currentNode;
} else if (isTopLayer(currentNode)) {
return null;
}
currentNode = getParentNode(currentNode);
}
return null;
}
function isWebKit() {
if (typeof CSS === 'undefined' || !CSS.supports) return false;
return CSS.supports('-webkit-backdrop-filter', 'none');
}
function isLastTraversableNode(node) {
return ['html', 'body', '#document'].includes(getNodeName(node));
}
function floating_ui_utils_dom_getComputedStyle(element) {
return floating_ui_utils_dom_getWindow(element).getComputedStyle(element);
}
function getNodeScroll(element) {
if (isElement(element)) {
return {
scrollLeft: element.scrollLeft,
scrollTop: element.scrollTop
};
}
return {
scrollLeft: element.scrollX,
scrollTop: element.scrollY
};
}
function getParentNode(node) {
if (getNodeName(node) === 'html') {
return node;
}
const result =
// Step into the shadow DOM of the parent of a slotted node.
node.assignedSlot ||
// DOM Element detected.
node.parentNode ||
// ShadowRoot detected.
isShadowRoot(node) && node.host ||
// Fallback.
getDocumentElement(node);
return isShadowRoot(result) ? result.host : result;
}
function getNearestOverflowAncestor(node) {
const parentNode = getParentNode(node);
if (isLastTraversableNode(parentNode)) {
return node.ownerDocument ? node.ownerDocument.body : node.body;
}
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
return parentNode;
}
return getNearestOverflowAncestor(parentNode);
}
function getOverflowAncestors(node, list, traverseIframes) {
var _node$ownerDocument2;
if (list === void 0) {
list = [];
}
if (traverseIframes === void 0) {
traverseIframes = true;
}
const scrollableAncestor = getNearestOverflowAncestor(node);
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
const win = floating_ui_utils_dom_getWindow(scrollableAncestor);
if (isBody) {
const frameElement = getFrameElement(win);
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
}
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
}
function getFrameElement(win) {
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
}
;// ./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
function getCssDimensions(element) {
const css = floating_ui_utils_dom_getComputedStyle(element);
// In testing environments, the `width` and `height` properties are empty
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
let width = parseFloat(css.width) || 0;
let height = parseFloat(css.height) || 0;
const hasOffset = isHTMLElement(element);
const offsetWidth = hasOffset ? element.offsetWidth : width;
const offsetHeight = hasOffset ? element.offsetHeight : height;
const shouldFallback = floating_ui_utils_round(width) !== offsetWidth || floating_ui_utils_round(height) !== offsetHeight;
if (shouldFallback) {
width = offsetWidth;
height = offsetHeight;
}
return {
width,
height,
$: shouldFallback
};
}
function unwrapElement(element) {
return !isElement(element) ? element.contextElement : element;
}
function getScale(element) {
const domElement = unwrapElement(element);
if (!isHTMLElement(domElement)) {
return floating_ui_utils_createCoords(1);
}
const rect = domElement.getBoundingClientRect();
const {
width,
height,
$
} = getCssDimensions(domElement);
let x = ($ ? floating_ui_utils_round(rect.width) : rect.width) / width;
let y = ($ ? floating_ui_utils_round(rect.height) : rect.height) / height;
// 0, NaN, or Infinity should always fallback to 1.
if (!x || !Number.isFinite(x)) {
x = 1;
}
if (!y || !Number.isFinite(y)) {
y = 1;
}
return {
x,
y
};
}
const noOffsets = /*#__PURE__*/floating_ui_utils_createCoords(0);
function getVisualOffsets(element) {
const win = floating_ui_utils_dom_getWindow(element);
if (!isWebKit() || !win.visualViewport) {
return noOffsets;
}
return {
x: win.visualViewport.offsetLeft,
y: win.visualViewport.offsetTop
};
}
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
if (isFixed === void 0) {
isFixed = false;
}
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== floating_ui_utils_dom_getWindow(element)) {
return false;
}
return isFixed;
}
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
if (includeScale === void 0) {
includeScale = false;
}
if (isFixedStrategy === void 0) {
isFixedStrategy = false;
}
const clientRect = element.getBoundingClientRect();
const domElement = unwrapElement(element);
let scale = floating_ui_utils_createCoords(1);
if (includeScale) {
if (offsetParent) {
if (isElement(offsetParent)) {
scale = getScale(offsetParent);
}
} else {
scale = getScale(element);
}
}
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : floating_ui_utils_createCoords(0);
let x = (clientRect.left + visualOffsets.x) / scale.x;
let y = (clientRect.top + visualOffsets.y) / scale.y;
let width = clientRect.width / scale.x;
let height = clientRect.height / scale.y;
if (domElement) {
const win = floating_ui_utils_dom_getWindow(domElement);
const offsetWin = offsetParent && isElement(offsetParent) ? floating_ui_utils_dom_getWindow(offsetParent) : offsetParent;
let currentWin = win;
let currentIFrame = currentWin.frameElement;
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
const iframeScale = getScale(currentIFrame);
const iframeRect = currentIFrame.getBoundingClientRect();
const css = floating_ui_utils_dom_getComputedStyle(currentIFrame);
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
x *= iframeScale.x;
y *= iframeScale.y;
width *= iframeScale.x;
height *= iframeScale.y;
x += left;
y += top;
currentWin = floating_ui_utils_dom_getWindow(currentIFrame);
currentIFrame = currentWin.frameElement;
}
}
return floating_ui_utils_rectToClientRect({
width,
height,
x,
y
});
}
const topLayerSelectors = [':popover-open', ':modal'];
function floating_ui_dom_isTopLayer(floating) {
return topLayerSelectors.some(selector => {
try {
return floating.matches(selector);
} catch (e) {
return false;
}
});
}
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
let {
elements,
rect,
offsetParent,
strategy
} = _ref;
const isFixed = strategy === 'fixed';
const documentElement = getDocumentElement(offsetParent);
const topLayer = elements ? floating_ui_dom_isTopLayer(elements.floating) : false;
if (offsetParent === documentElement || topLayer && isFixed) {
return rect;
}
let scroll = {
scrollLeft: 0,
scrollTop: 0
};
let scale = floating_ui_utils_createCoords(1);
const offsets = floating_ui_utils_createCoords(0);
const isOffsetParentAnElement = isHTMLElement(offsetParent);
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
scroll = getNodeScroll(offsetParent);
}
if (isHTMLElement(offsetParent)) {
const offsetRect = getBoundingClientRect(offsetParent);
scale = getScale(offsetParent);
offsets.x = offsetRect.x + offsetParent.clientLeft;
offsets.y = offsetRect.y + offsetParent.clientTop;
}
}
return {
width: rect.width * scale.x,
height: rect.height * scale.y,
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
};
}
function getClientRects(element) {
return Array.from(element.getClientRects());
}
function getWindowScrollBarX(element) {
// If <html> has a CSS width greater than the viewport, then this will be
// incorrect for RTL.
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
}
// Gets the entire size of the scrollable document area, even extending outside
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
function getDocumentRect(element) {
const html = getDocumentElement(element);
const scroll = getNodeScroll(element);
const body = element.ownerDocument.body;
const width = dist_floating_ui_utils_max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
const height = dist_floating_ui_utils_max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
const y = -scroll.scrollTop;
if (floating_ui_utils_dom_getComputedStyle(body).direction === 'rtl') {
x += dist_floating_ui_utils_max(html.clientWidth, body.clientWidth) - width;
}
return {
width,
height,
x,
y
};
}
function getViewportRect(element, strategy) {
const win = floating_ui_utils_dom_getWindow(element);
const html = getDocumentElement(element);
const visualViewport = win.visualViewport;
let width = html.clientWidth;
let height = html.clientHeight;
let x = 0;
let y = 0;
if (visualViewport) {
width = visualViewport.width;
height = visualViewport.height;
const visualViewportBased = isWebKit();
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
x = visualViewport.offsetLeft;
y = visualViewport.offsetTop;
}
}
return {
width,
height,
x,
y
};
}
// Returns the inner client rect, subtracting scrollbars if present.
function getInnerBoundingClientRect(element, strategy) {
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
const top = clientRect.top + element.clientTop;
const left = clientRect.left + element.clientLeft;
const scale = isHTMLElement(element) ? getScale(element) : floating_ui_utils_createCoords(1);
const width = element.clientWidth * scale.x;
const height = element.clientHeight * scale.y;
const x = left * scale.x;
const y = top * scale.y;
return {
width,
height,
x,
y
};
}
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
let rect;
if (clippingAncestor === 'viewport') {
rect = getViewportRect(element, strategy);
} else if (clippingAncestor === 'document') {
rect = getDocumentRect(getDocumentElement(element));
} else if (isElement(clippingAncestor)) {
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
} else {
const visualOffsets = getVisualOffsets(element);
rect = {
...clippingAncestor,
x: clippingAncestor.x - visualOffsets.x,
y: clippingAncestor.y - visualOffsets.y
};
}
return floating_ui_utils_rectToClientRect(rect);
}
function hasFixedPositionAncestor(element, stopNode) {
const parentNode = getParentNode(element);
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
return false;
}
return floating_ui_utils_dom_getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
}
// A "clipping ancestor" is an `overflow` element with the characteristic of
// clipping (or hiding) child elements. This returns all clipping ancestors
// of the given element up the tree.
function getClippingElementAncestors(element, cache) {
const cachedResult = cache.get(element);
if (cachedResult) {
return cachedResult;
}
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
let currentContainingBlockComputedStyle = null;
const elementIsFixed = floating_ui_utils_dom_getComputedStyle(element).position === 'fixed';
let currentNode = elementIsFixed ? getParentNode(element) : element;
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
const computedStyle = floating_ui_utils_dom_getComputedStyle(currentNode);
const currentNodeIsContaining = isContainingBlock(currentNode);
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
currentContainingBlockComputedStyle = null;
}
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
if (shouldDropCurrentNode) {
// Drop non-containing blocks.
result = result.filter(ancestor => ancestor !== currentNode);
} else {
// Record last containing block for next iteration.
currentContainingBlockComputedStyle = computedStyle;
}
currentNode = getParentNode(currentNode);
}
cache.set(element, result);
return result;
}
// Gets the maximum area that the element is visible in due to any number of
// clipping ancestors.
function getClippingRect(_ref) {
let {
element,
boundary,
rootBoundary,
strategy
} = _ref;
const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
const firstClippingAncestor = clippingAncestors[0];
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
accRect.top = dist_floating_ui_utils_max(rect.top, accRect.top);
accRect.right = dist_floating_ui_utils_min(rect.right, accRect.right);
accRect.bottom = dist_floating_ui_utils_min(rect.bottom, accRect.bottom);
accRect.left = dist_floating_ui_utils_max(rect.left, accRect.left);
return accRect;
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
return {
width: clippingRect.right - clippingRect.left,
height: clippingRect.bottom - clippingRect.top,
x: clippingRect.left,
y: clippingRect.top
};
}
function getDimensions(element) {
const {
width,
height
} = getCssDimensions(element);
return {
width,
height
};
}
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
const isOffsetParentAnElement = isHTMLElement(offsetParent);
const documentElement = getDocumentElement(offsetParent);
const isFixed = strategy === 'fixed';
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
let scroll = {
scrollLeft: 0,
scrollTop: 0
};
const offsets = floating_ui_utils_createCoords(0);
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
scroll = getNodeScroll(offsetParent);
}
if (isOffsetParentAnElement) {
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
offsets.x = offsetRect.x + offsetParent.clientLeft;
offsets.y = offsetRect.y + offsetParent.clientTop;
} else if (documentElement) {
offsets.x = getWindowScrollBarX(documentElement);
}
}
const x = rect.left + scroll.scrollLeft - offsets.x;
const y = rect.top + scroll.scrollTop - offsets.y;
return {
x,
y,
width: rect.width,
height: rect.height
};
}
function getTrueOffsetParent(element, polyfill) {
if (!isHTMLElement(element) || floating_ui_utils_dom_getComputedStyle(element).position === 'fixed') {
return null;
}
if (polyfill) {
return polyfill(element);
}
return element.offsetParent;
}
// Gets the closest ancestor positioned element. Handles some edge cases,
// such as table ancestors and cross browser bugs.
function getOffsetParent(element, polyfill) {
const window = floating_ui_utils_dom_getWindow(element);
if (!isHTMLElement(element) || floating_ui_dom_isTopLayer(element)) {
return window;
}
let offsetParent = getTrueOffsetParent(element, polyfill);
while (offsetParent && isTableElement(offsetParent) && floating_ui_utils_dom_getComputedStyle(offsetParent).position === 'static') {
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
}
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && floating_ui_utils_dom_getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
return window;
}
return offsetParent || getContainingBlock(element) || window;
}
const getElementRects = async function (data) {
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
const getDimensionsFn = this.getDimensions;
return {
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
floating: {
x: 0,
y: 0,
...(await getDimensionsFn(data.floating))
}
};
};
function isRTL(element) {
return floating_ui_utils_dom_getComputedStyle(element).direction === 'rtl';
}
const platform = {
convertOffsetParentRelativeRectToViewportRelativeRect,
getDocumentElement: getDocumentElement,
getClippingRect,
getOffsetParent,
getElementRects,
getClientRects,
getDimensions,
getScale,
isElement: isElement,
isRTL
};
// https://samthor.au/2021/observing-dom/
function observeMove(element, onMove) {
let io = null;
let timeoutId;
const root = getDocumentElement(element);
function cleanup() {
var _io;
clearTimeout(timeoutId);
(_io = io) == null || _io.disconnect();
io = null;
}
function refresh(skip, threshold) {
if (skip === void 0) {
skip = false;
}
if (threshold === void 0) {
threshold = 1;
}
cleanup();
const {
left,
top,
width,
height
} = element.getBoundingClientRect();
if (!skip) {
onMove();
}
if (!width || !height) {
return;
}
const insetTop = floating_ui_utils_floor(top);
const insetRight = floating_ui_utils_floor(root.clientWidth - (left + width));
const insetBottom = floating_ui_utils_floor(root.clientHeight - (top + height));
const insetLeft = floating_ui_utils_floor(left);
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
const options = {
rootMargin,
threshold: dist_floating_ui_utils_max(0, dist_floating_ui_utils_min(1, threshold)) || 1
};
let isFirstUpdate = true;
function handleObserve(entries) {
const ratio = entries[0].intersectionRatio;
if (ratio !== threshold) {
if (!isFirstUpdate) {
return refresh();
}
if (!ratio) {
timeoutId = setTimeout(() => {
refresh(false, 1e-7);
}, 100);
} else {
refresh(false, ratio);
}
}
isFirstUpdate = false;
}
// Older browsers don't support a `document` as the root and will throw an
// error.
try {
io = new IntersectionObserver(handleObserve, {
...options,
// Handle <iframe>s
root: root.ownerDocument
});
} catch (e) {
io = new IntersectionObserver(handleObserve, options);
}
io.observe(element);
}
refresh(true);
return cleanup;
}
/**
* Automatically updates the position of the floating element when necessary.
* Should only be called when the floating element is mounted on the DOM or
* visible on the screen.
* @returns cleanup function that should be invoked when the floating element is
* removed from the DOM or hidden from the screen.
* @see https://floating-ui.com/docs/autoUpdate
*/
function autoUpdate(reference, floating, update, options) {
if (options === void 0) {
options = {};
}
const {
ancestorScroll = true,
ancestorResize = true,
elementResize = typeof ResizeObserver === 'function',
layoutShift = typeof IntersectionObserver === 'function',
animationFrame = false
} = options;
const referenceEl = unwrapElement(reference);
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
ancestors.forEach(ancestor => {
ancestorScroll && ancestor.addEventListener('scroll', update, {
passive: true
});
ancestorResize && ancestor.addEventListener('resize', update);
});
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
let reobserveFrame = -1;
let resizeObserver = null;
if (elementResize) {
resizeObserver = new ResizeObserver(_ref => {
let [firstEntry] = _ref;
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
// Prevent update loops when using the `size` middleware.
// https://github.com/floating-ui/floating-ui/issues/1740
resizeObserver.unobserve(floating);
cancelAnimationFrame(reobserveFrame);
reobserveFrame = requestAnimationFrame(() => {
var _resizeObserver;
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
});
}
update();
});
if (referenceEl && !animationFrame) {
resizeObserver.observe(referenceEl);
}
resizeObserver.observe(floating);
}
let frameId;
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
if (animationFrame) {
frameLoop();
}
function frameLoop() {
const nextRefRect = getBoundingClientRect(reference);
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
update();
}
prevRefRect = nextRefRect;
frameId = requestAnimationFrame(frameLoop);
}
update();
return () => {
var _resizeObserver2;
ancestors.forEach(ancestor => {
ancestorScroll && ancestor.removeEventListener('scroll', update);
ancestorResize && ancestor.removeEventListener('resize', update);
});
cleanupIo == null || cleanupIo();
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
resizeObserver = null;
if (animationFrame) {
cancelAnimationFrame(frameId);
}
};
}
/**
* Optimizes the visibility of the floating element by choosing the placement
* that has the most space available automatically, without needing to specify a
* preferred placement. Alternative to `flip`.
* @see https://floating-ui.com/docs/autoPlacement
*/
const floating_ui_dom_autoPlacement = (/* unused pure expression or super */ null && (autoPlacement$1));
/**
* Optimizes the visibility of the floating element by shifting it in order to
* keep it in view when it will overflow the clipping boundary.
* @see https://floating-ui.com/docs/shift
*/
const floating_ui_dom_shift = shift;
/**
* Optimizes the visibility of the floating element by flipping the `placement`
* in order to keep it in view when the preferred placement(s) will overflow the
* clipping boundary. Alternative to `autoPlacement`.
* @see https://floating-ui.com/docs/flip
*/
const floating_ui_dom_flip = flip;
/**
* Provides data that allows you to change the size of the floating element —
* for instance, prevent it from overflowing the clipping boundary or match the
* width of the reference element.
* @see https://floating-ui.com/docs/size
*/
const floating_ui_dom_size = size;
/**
* Provides data to hide the floating element in applicable situations, such as
* when it is not in the same clipping context as the reference element.
* @see https://floating-ui.com/docs/hide
*/
const floating_ui_dom_hide = (/* unused pure expression or super */ null && (hide$1));
/**
* Provides data to position an inner element of the floating element so that it
* appears centered to the reference element.
* @see https://floating-ui.com/docs/arrow
*/
const floating_ui_dom_arrow = arrow;
/**
* Provides improved positioning for inline reference elements that can span
* over multiple lines, such as hyperlinks or range selections.
* @see https://floating-ui.com/docs/inline
*/
const floating_ui_dom_inline = (/* unused pure expression or super */ null && (inline$1));
/**
* Built-in `limiter` that will stop `shift()` at a certain point.
*/
const floating_ui_dom_limitShift = limitShift;
/**
* Computes the `x` and `y` coordinates that will place the floating element
* next to a given reference element.
*/
const floating_ui_dom_computePosition = (reference, floating, options) => {
// This caches the expensive `getClippingElementAncestors` function so that
// multiple lifecycle resets re-use the same result. It only lives for a
// single call. If other functions become expensive, we can add them as well.
const cache = new Map();
const mergedOptions = {
platform,
...options
};
const platformWithCache = {
...mergedOptions.platform,
_c: cache
};
return computePosition(reference, floating, {
...mergedOptions,
platform: platformWithCache
});
};
;// ./node_modules/@ariakit/react-core/esm/__chunks/T6C2RYFI.js
"use client";
// src/popover/popover.tsx
var T6C2RYFI_TagName = "div";
function createDOMRect(x = 0, y = 0, width = 0, height = 0) {
if (typeof DOMRect === "function") {
return new DOMRect(x, y, width, height);
}
const rect = {
x,
y,
width,
height,
top: y,
right: x + width,
bottom: y + height,
left: x
};
return _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, rect), { toJSON: () => rect });
}
function getDOMRect(anchorRect) {
if (!anchorRect) return createDOMRect();
const { x, y, width, height } = anchorRect;
return createDOMRect(x, y, width, height);
}
function getAnchorElement(anchorElement, getAnchorRect) {
const contextElement = anchorElement || void 0;
return {
contextElement,
getBoundingClientRect: () => {
const anchor = anchorElement;
const anchorRect = getAnchorRect == null ? void 0 : getAnchorRect(anchor);
if (anchorRect || !anchor) {
return getDOMRect(anchorRect);
}
return anchor.getBoundingClientRect();
}
};
}
function isValidPlacement(flip2) {
return /^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(flip2);
}
function roundByDPR(value) {
const dpr = window.devicePixelRatio || 1;
return Math.round(value * dpr) / dpr;
}
function getOffsetMiddleware(arrowElement, props) {
return offset(({ placement }) => {
var _a;
const arrowOffset = ((arrowElement == null ? void 0 : arrowElement.clientHeight) || 0) / 2;
const finalGutter = typeof props.gutter === "number" ? props.gutter + arrowOffset : (_a = props.gutter) != null ? _a : arrowOffset;
const hasAlignment = !!placement.split("-")[1];
return {
crossAxis: !hasAlignment ? props.shift : void 0,
mainAxis: finalGutter,
alignmentAxis: props.shift
};
});
}
function getFlipMiddleware(props) {
if (props.flip === false) return;
const fallbackPlacements = typeof props.flip === "string" ? props.flip.split(" ") : void 0;
invariant(
!fallbackPlacements || fallbackPlacements.every(isValidPlacement),
false && 0
);
return floating_ui_dom_flip({
padding: props.overflowPadding,
fallbackPlacements
});
}
function getShiftMiddleware(props) {
if (!props.slide && !props.overlap) return;
return floating_ui_dom_shift({
mainAxis: props.slide,
crossAxis: props.overlap,
padding: props.overflowPadding,
limiter: floating_ui_dom_limitShift()
});
}
function getSizeMiddleware(props) {
return floating_ui_dom_size({
padding: props.overflowPadding,
apply({ elements, availableWidth, availableHeight, rects }) {
const wrapper = elements.floating;
const referenceWidth = Math.round(rects.reference.width);
availableWidth = Math.floor(availableWidth);
availableHeight = Math.floor(availableHeight);
wrapper.style.setProperty(
"--popover-anchor-width",
`${referenceWidth}px`
);
wrapper.style.setProperty(
"--popover-available-width",
`${availableWidth}px`
);
wrapper.style.setProperty(
"--popover-available-height",
`${availableHeight}px`
);
if (props.sameWidth) {
wrapper.style.width = `${referenceWidth}px`;
}
if (props.fitViewport) {
wrapper.style.maxWidth = `${availableWidth}px`;
wrapper.style.maxHeight = `${availableHeight}px`;
}
}
});
}
function getArrowMiddleware(arrowElement, props) {
if (!arrowElement) return;
return floating_ui_dom_arrow({
element: arrowElement,
padding: props.arrowPadding
});
}
var usePopover = createHook(
function usePopover2(_a) {
var _b = _a, {
store,
modal = false,
portal = !!modal,
preserveTabOrder = true,
autoFocusOnShow = true,
wrapperProps,
fixed = false,
flip: flip2 = true,
shift: shift2 = 0,
slide = true,
overlap = false,
sameWidth = false,
fitViewport = false,
gutter,
arrowPadding = 4,
overflowPadding = 8,
getAnchorRect,
updatePosition
} = _b, props = __objRest(_b, [
"store",
"modal",
"portal",
"preserveTabOrder",
"autoFocusOnShow",
"wrapperProps",
"fixed",
"flip",
"shift",
"slide",
"overlap",
"sameWidth",
"fitViewport",
"gutter",
"arrowPadding",
"overflowPadding",
"getAnchorRect",
"updatePosition"
]);
const context = usePopoverProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const arrowElement = store.useState("arrowElement");
const anchorElement = store.useState("anchorElement");
const disclosureElement = store.useState("disclosureElement");
const popoverElement = store.useState("popoverElement");
const contentElement = store.useState("contentElement");
const placement = store.useState("placement");
const mounted = store.useState("mounted");
const rendered = store.useState("rendered");
const defaultArrowElementRef = (0,external_React_.useRef)(null);
const [positioned, setPositioned] = (0,external_React_.useState)(false);
const { portalRef, domReady } = usePortalRef(portal, props.portalRef);
const getAnchorRectProp = useEvent(getAnchorRect);
const updatePositionProp = useEvent(updatePosition);
const hasCustomUpdatePosition = !!updatePosition;
useSafeLayoutEffect(() => {
if (!(popoverElement == null ? void 0 : popoverElement.isConnected)) return;
popoverElement.style.setProperty(
"--popover-overflow-padding",
`${overflowPadding}px`
);
const anchor = getAnchorElement(anchorElement, getAnchorRectProp);
const updatePosition2 = async () => {
if (!mounted) return;
if (!arrowElement) {
defaultArrowElementRef.current = defaultArrowElementRef.current || document.createElement("div");
}
const arrow2 = arrowElement || defaultArrowElementRef.current;
const middleware = [
getOffsetMiddleware(arrow2, { gutter, shift: shift2 }),
getFlipMiddleware({ flip: flip2, overflowPadding }),
getShiftMiddleware({ slide, shift: shift2, overlap, overflowPadding }),
getArrowMiddleware(arrow2, { arrowPadding }),
getSizeMiddleware({
sameWidth,
fitViewport,
overflowPadding
})
];
const pos = await floating_ui_dom_computePosition(anchor, popoverElement, {
placement,
strategy: fixed ? "fixed" : "absolute",
middleware
});
store == null ? void 0 : store.setState("currentPlacement", pos.placement);
setPositioned(true);
const x = roundByDPR(pos.x);
const y = roundByDPR(pos.y);
Object.assign(popoverElement.style, {
top: "0",
left: "0",
transform: `translate3d(${x}px,${y}px,0)`
});
if (arrow2 && pos.middlewareData.arrow) {
const { x: arrowX, y: arrowY } = pos.middlewareData.arrow;
const side = pos.placement.split("-")[0];
const centerX = arrow2.clientWidth / 2;
const centerY = arrow2.clientHeight / 2;
const originX = arrowX != null ? arrowX + centerX : -centerX;
const originY = arrowY != null ? arrowY + centerY : -centerY;
popoverElement.style.setProperty(
"--popover-transform-origin",
{
top: `${originX}px calc(100% + ${centerY}px)`,
bottom: `${originX}px ${-centerY}px`,
left: `calc(100% + ${centerX}px) ${originY}px`,
right: `${-centerX}px ${originY}px`
}[side]
);
Object.assign(arrow2.style, {
left: arrowX != null ? `${arrowX}px` : "",
top: arrowY != null ? `${arrowY}px` : "",
[side]: "100%"
});
}
};
const update = async () => {
if (hasCustomUpdatePosition) {
await updatePositionProp({ updatePosition: updatePosition2 });
setPositioned(true);
} else {
await updatePosition2();
}
};
const cancelAutoUpdate = autoUpdate(anchor, popoverElement, update, {
// JSDOM doesn't support ResizeObserver
elementResize: typeof ResizeObserver === "function"
});
return () => {
setPositioned(false);
cancelAutoUpdate();
};
}, [
store,
rendered,
popoverElement,
arrowElement,
anchorElement,
popoverElement,
placement,
mounted,
domReady,
fixed,
flip2,
shift2,
slide,
overlap,
sameWidth,
fitViewport,
gutter,
arrowPadding,
overflowPadding,
getAnchorRectProp,
hasCustomUpdatePosition,
updatePositionProp
]);
useSafeLayoutEffect(() => {
if (!mounted) return;
if (!domReady) return;
if (!(popoverElement == null ? void 0 : popoverElement.isConnected)) return;
if (!(contentElement == null ? void 0 : contentElement.isConnected)) return;
const applyZIndex = () => {
popoverElement.style.zIndex = getComputedStyle(contentElement).zIndex;
};
applyZIndex();
let raf = requestAnimationFrame(() => {
raf = requestAnimationFrame(applyZIndex);
});
return () => cancelAnimationFrame(raf);
}, [mounted, domReady, popoverElement, contentElement]);
const position = fixed ? "fixed" : "absolute";
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, wrapperProps), {
style: _3YLGPPWQ_spreadValues({
// https://floating-ui.com/docs/computeposition#initial-layout
position,
top: 0,
left: 0,
width: "max-content"
}, wrapperProps == null ? void 0 : wrapperProps.style),
ref: store == null ? void 0 : store.setPopoverElement,
children: element
})
),
[store, position, wrapperProps]
);
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PopoverScopedContextProvider, { value: store, children: element }),
[store]
);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
// data-placing is not part of the public API. We're setting this here so
// we can wait for the popover to be positioned before other components
// move focus into it. For example, this attribute is observed by the
// Combobox component with the autoSelect behavior.
"data-placing": !positioned || void 0
}, props), {
style: _3YLGPPWQ_spreadValues({
position: "relative"
}, props.style)
});
props = useDialog(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
store,
modal,
portal,
preserveTabOrder,
preserveTabOrderAnchor: disclosureElement || anchorElement,
autoFocusOnShow: positioned && autoFocusOnShow
}, props), {
portalRef
}));
return props;
}
);
var Popover = createDialogComponent(
forwardRef2(function Popover2(props) {
const htmlProps = usePopover(props);
return LMDWO4NN_createElement(T6C2RYFI_TagName, htmlProps);
}),
usePopoverProviderContext
);
;// ./node_modules/@ariakit/react-core/esm/__chunks/KQKDTOT4.js
"use client";
// src/hovercard/hovercard.tsx
var KQKDTOT4_TagName = "div";
function isMovingOnHovercard(target, card, anchor, nested) {
if (hasFocusWithin(card)) return true;
if (!target) return false;
if (contains(card, target)) return true;
if (anchor && contains(anchor, target)) return true;
if (nested == null ? void 0 : nested.some((card2) => isMovingOnHovercard(target, card2, anchor))) {
return true;
}
return false;
}
function useAutoFocusOnHide(_a) {
var _b = _a, {
store
} = _b, props = __objRest(_b, [
"store"
]);
const [autoFocusOnHide, setAutoFocusOnHide] = (0,external_React_.useState)(false);
const mounted = store.useState("mounted");
(0,external_React_.useEffect)(() => {
if (!mounted) {
setAutoFocusOnHide(false);
}
}, [mounted]);
const onFocusProp = props.onFocus;
const onFocus = useEvent((event) => {
onFocusProp == null ? void 0 : onFocusProp(event);
if (event.defaultPrevented) return;
setAutoFocusOnHide(true);
});
const finalFocusRef = (0,external_React_.useRef)(null);
(0,external_React_.useEffect)(() => {
return sync(store, ["anchorElement"], (state) => {
finalFocusRef.current = state.anchorElement;
});
}, []);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
autoFocusOnHide,
finalFocus: finalFocusRef
}, props), {
onFocus
});
return props;
}
var NestedHovercardContext = (0,external_React_.createContext)(null);
var useHovercard = createHook(
function useHovercard2(_a) {
var _b = _a, {
store,
modal = false,
portal = !!modal,
hideOnEscape = true,
hideOnHoverOutside = true,
disablePointerEventsOnApproach = !!hideOnHoverOutside
} = _b, props = __objRest(_b, [
"store",
"modal",
"portal",
"hideOnEscape",
"hideOnHoverOutside",
"disablePointerEventsOnApproach"
]);
const context = useHovercardProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const ref = (0,external_React_.useRef)(null);
const [nestedHovercards, setNestedHovercards] = (0,external_React_.useState)([]);
const hideTimeoutRef = (0,external_React_.useRef)(0);
const enterPointRef = (0,external_React_.useRef)(null);
const { portalRef, domReady } = usePortalRef(portal, props.portalRef);
const isMouseMoving = useIsMouseMoving();
const mayHideOnHoverOutside = !!hideOnHoverOutside;
const hideOnHoverOutsideProp = useBooleanEvent(hideOnHoverOutside);
const mayDisablePointerEvents = !!disablePointerEventsOnApproach;
const disablePointerEventsProp = useBooleanEvent(
disablePointerEventsOnApproach
);
const open = store.useState("open");
const mounted = store.useState("mounted");
(0,external_React_.useEffect)(() => {
if (!domReady) return;
if (!mounted) return;
if (!mayHideOnHoverOutside && !mayDisablePointerEvents) return;
const element = ref.current;
if (!element) return;
const onMouseMove = (event) => {
if (!store) return;
if (!isMouseMoving()) return;
const { anchorElement, hideTimeout, timeout } = store.getState();
const enterPoint = enterPointRef.current;
const [target] = event.composedPath();
const anchor = anchorElement;
if (isMovingOnHovercard(target, element, anchor, nestedHovercards)) {
enterPointRef.current = target && anchor && contains(anchor, target) ? getEventPoint(event) : null;
window.clearTimeout(hideTimeoutRef.current);
hideTimeoutRef.current = 0;
return;
}
if (hideTimeoutRef.current) return;
if (enterPoint) {
const currentPoint = getEventPoint(event);
const polygon = getElementPolygon(element, enterPoint);
if (isPointInPolygon(currentPoint, polygon)) {
enterPointRef.current = currentPoint;
if (!disablePointerEventsProp(event)) return;
event.preventDefault();
event.stopPropagation();
return;
}
}
if (!hideOnHoverOutsideProp(event)) return;
hideTimeoutRef.current = window.setTimeout(() => {
hideTimeoutRef.current = 0;
store == null ? void 0 : store.hide();
}, hideTimeout != null ? hideTimeout : timeout);
};
return chain(
addGlobalEventListener("mousemove", onMouseMove, true),
() => clearTimeout(hideTimeoutRef.current)
);
}, [
store,
isMouseMoving,
domReady,
mounted,
mayHideOnHoverOutside,
mayDisablePointerEvents,
nestedHovercards,
disablePointerEventsProp,
hideOnHoverOutsideProp
]);
(0,external_React_.useEffect)(() => {
if (!domReady) return;
if (!mounted) return;
if (!mayDisablePointerEvents) return;
const disableEvent = (event) => {
const element = ref.current;
if (!element) return;
const enterPoint = enterPointRef.current;
if (!enterPoint) return;
const polygon = getElementPolygon(element, enterPoint);
if (isPointInPolygon(getEventPoint(event), polygon)) {
if (!disablePointerEventsProp(event)) return;
event.preventDefault();
event.stopPropagation();
}
};
return chain(
// Note: we may need to add pointer events here in the future.
addGlobalEventListener("mouseenter", disableEvent, true),
addGlobalEventListener("mouseover", disableEvent, true),
addGlobalEventListener("mouseout", disableEvent, true),
addGlobalEventListener("mouseleave", disableEvent, true)
);
}, [domReady, mounted, mayDisablePointerEvents, disablePointerEventsProp]);
(0,external_React_.useEffect)(() => {
if (!domReady) return;
if (open) return;
store == null ? void 0 : store.setAutoFocusOnShow(false);
}, [store, domReady, open]);
const openRef = useLiveRef(open);
(0,external_React_.useEffect)(() => {
if (!domReady) return;
return () => {
if (!openRef.current) {
store == null ? void 0 : store.setAutoFocusOnShow(false);
}
};
}, [store, domReady]);
const registerOnParent = (0,external_React_.useContext)(NestedHovercardContext);
useSafeLayoutEffect(() => {
if (modal) return;
if (!portal) return;
if (!mounted) return;
if (!domReady) return;
const element = ref.current;
if (!element) return;
return registerOnParent == null ? void 0 : registerOnParent(element);
}, [modal, portal, mounted, domReady]);
const registerNestedHovercard = (0,external_React_.useCallback)(
(element) => {
setNestedHovercards((prevElements) => [...prevElements, element]);
const parentUnregister = registerOnParent == null ? void 0 : registerOnParent(element);
return () => {
setNestedHovercards(
(prevElements) => prevElements.filter((item) => item !== element)
);
parentUnregister == null ? void 0 : parentUnregister();
};
},
[registerOnParent]
);
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HovercardScopedContextProvider, { value: store, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NestedHovercardContext.Provider, { value: registerNestedHovercard, children: element }) }),
[store, registerNestedHovercard]
);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
ref: useMergeRefs(ref, props.ref)
});
props = useAutoFocusOnHide(_3YLGPPWQ_spreadValues({ store }, props));
const autoFocusOnShow = store.useState(
(state) => modal || state.autoFocusOnShow
);
props = usePopover(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
store,
modal,
portal,
autoFocusOnShow
}, props), {
portalRef,
hideOnEscape(event) {
if (isFalsyBooleanCallback(hideOnEscape, event)) return false;
requestAnimationFrame(() => {
requestAnimationFrame(() => {
store == null ? void 0 : store.hide();
});
});
return true;
}
}));
return props;
}
);
var Hovercard = createDialogComponent(
forwardRef2(function Hovercard2(props) {
const htmlProps = useHovercard(props);
return LMDWO4NN_createElement(KQKDTOT4_TagName, htmlProps);
}),
useHovercardProviderContext
);
;// ./node_modules/@ariakit/react-core/esm/tooltip/tooltip.js
"use client";
// src/tooltip/tooltip.tsx
var tooltip_TagName = "div";
var useTooltip = createHook(
function useTooltip2(_a) {
var _b = _a, {
store,
portal = true,
gutter = 8,
preserveTabOrder = false,
hideOnHoverOutside = true,
hideOnInteractOutside = true
} = _b, props = __objRest(_b, [
"store",
"portal",
"gutter",
"preserveTabOrder",
"hideOnHoverOutside",
"hideOnInteractOutside"
]);
const context = useTooltipProviderContext();
store = store || context;
invariant(
store,
false && 0
);
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TooltipScopedContextProvider, { value: store, children: element }),
[store]
);
const role = store.useState(
(state) => state.type === "description" ? "tooltip" : "none"
);
props = _3YLGPPWQ_spreadValues({ role }, props);
props = useHovercard(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
store,
portal,
gutter,
preserveTabOrder,
hideOnHoverOutside(event) {
if (isFalsyBooleanCallback(hideOnHoverOutside, event)) return false;
const anchorElement = store == null ? void 0 : store.getState().anchorElement;
if (!anchorElement) return true;
if ("focusVisible" in anchorElement.dataset) return false;
return true;
},
hideOnInteractOutside: (event) => {
if (isFalsyBooleanCallback(hideOnInteractOutside, event)) return false;
const anchorElement = store == null ? void 0 : store.getState().anchorElement;
if (!anchorElement) return true;
if (contains(anchorElement, event.target)) return false;
return true;
}
}));
return props;
}
);
var Tooltip = createDialogComponent(
forwardRef2(function Tooltip2(props) {
const htmlProps = useTooltip(props);
return LMDWO4NN_createElement(tooltip_TagName, htmlProps);
}),
useTooltipProviderContext
);
;// external ["wp","deprecated"]
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
;// ./node_modules/@wordpress/components/build-module/shortcut/index.js
function Shortcut(props) {
const {
shortcut,
className
} = props;
if (!shortcut) {
return null;
}
let displayText;
let ariaLabel;
if (typeof shortcut === "string") {
displayText = shortcut;
}
if (shortcut !== null && typeof shortcut === "object") {
displayText = shortcut.display;
ariaLabel = shortcut.ariaLabel;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className,
"aria-label": ariaLabel,
children: displayText
});
}
var shortcut_default = Shortcut;
;// ./node_modules/@wordpress/components/build-module/popover/utils.js
const POSITION_TO_PLACEMENT = {
bottom: "bottom",
top: "top",
"middle left": "left",
"middle right": "right",
"bottom left": "bottom-end",
"bottom center": "bottom",
"bottom right": "bottom-start",
"top left": "top-end",
"top center": "top",
"top right": "top-start",
"middle left left": "left",
"middle left right": "left",
"middle left bottom": "left-end",
"middle left top": "left-start",
"middle right left": "right",
"middle right right": "right",
"middle right bottom": "right-end",
"middle right top": "right-start",
"bottom left left": "bottom-end",
"bottom left right": "bottom-end",
"bottom left bottom": "bottom-end",
"bottom left top": "bottom-end",
"bottom center left": "bottom",
"bottom center right": "bottom",
"bottom center bottom": "bottom",
"bottom center top": "bottom",
"bottom right left": "bottom-start",
"bottom right right": "bottom-start",
"bottom right bottom": "bottom-start",
"bottom right top": "bottom-start",
"top left left": "top-end",
"top left right": "top-end",
"top left bottom": "top-end",
"top left top": "top-end",
"top center left": "top",
"top center right": "top",
"top center bottom": "top",
"top center top": "top",
"top right left": "top-start",
"top right right": "top-start",
"top right bottom": "top-start",
"top right top": "top-start",
// `middle`/`middle center [corner?]` positions are associated to a fallback
// `bottom` placement because there aren't any corresponding placement values.
middle: "bottom",
"middle center": "bottom",
"middle center bottom": "bottom",
"middle center left": "bottom",
"middle center right": "bottom",
"middle center top": "bottom"
};
const positionToPlacement = (position) => {
var _POSITION_TO_PLACEMEN;
return (_POSITION_TO_PLACEMEN = POSITION_TO_PLACEMENT[position]) !== null && _POSITION_TO_PLACEMEN !== void 0 ? _POSITION_TO_PLACEMEN : "bottom";
};
const PLACEMENT_TO_ANIMATION_ORIGIN = {
top: {
originX: 0.5,
originY: 1
},
// open from bottom, center
"top-start": {
originX: 0,
originY: 1
},
// open from bottom, left
"top-end": {
originX: 1,
originY: 1
},
// open from bottom, right
right: {
originX: 0,
originY: 0.5
},
// open from middle, left
"right-start": {
originX: 0,
originY: 0
},
// open from top, left
"right-end": {
originX: 0,
originY: 1
},
// open from bottom, left
bottom: {
originX: 0.5,
originY: 0
},
// open from top, center
"bottom-start": {
originX: 0,
originY: 0
},
// open from top, left
"bottom-end": {
originX: 1,
originY: 0
},
// open from top, right
left: {
originX: 1,
originY: 0.5
},
// open from middle, right
"left-start": {
originX: 1,
originY: 0
},
// open from top, right
"left-end": {
originX: 1,
originY: 1
},
// open from bottom, right
overlay: {
originX: 0.5,
originY: 0.5
}
// open from center, center
};
const placementToMotionAnimationProps = (placement) => {
const translateProp = placement.startsWith("top") || placement.startsWith("bottom") ? "translateY" : "translateX";
const translateDirection = placement.startsWith("top") || placement.startsWith("left") ? 1 : -1;
return {
style: PLACEMENT_TO_ANIMATION_ORIGIN[placement],
initial: {
opacity: 0,
scale: 0,
[translateProp]: `${2 * translateDirection}em`
},
animate: {
opacity: 1,
scale: 1,
[translateProp]: 0
},
transition: {
duration: 0.1,
ease: [0, 0, 0.2, 1]
}
};
};
function isTopBottom(anchorRef) {
return !!anchorRef?.top;
}
function isRef(anchorRef) {
return !!anchorRef?.current;
}
const getReferenceElement = ({
anchor,
anchorRef,
anchorRect,
getAnchorRect,
fallbackReferenceElement
}) => {
var _referenceElement;
let referenceElement = null;
if (anchor) {
referenceElement = anchor;
} else if (isTopBottom(anchorRef)) {
referenceElement = {
getBoundingClientRect() {
const topRect = anchorRef.top.getBoundingClientRect();
const bottomRect = anchorRef.bottom.getBoundingClientRect();
return new window.DOMRect(topRect.x, topRect.y, topRect.width, bottomRect.bottom - topRect.top);
}
};
} else if (isRef(anchorRef)) {
referenceElement = anchorRef.current;
} else if (anchorRef) {
referenceElement = anchorRef;
} else if (anchorRect) {
referenceElement = {
getBoundingClientRect() {
return anchorRect;
}
};
} else if (getAnchorRect) {
referenceElement = {
getBoundingClientRect() {
var _rect$x, _rect$y, _rect$width, _rect$height;
const rect = getAnchorRect(fallbackReferenceElement);
return new window.DOMRect((_rect$x = rect.x) !== null && _rect$x !== void 0 ? _rect$x : rect.left, (_rect$y = rect.y) !== null && _rect$y !== void 0 ? _rect$y : rect.top, (_rect$width = rect.width) !== null && _rect$width !== void 0 ? _rect$width : rect.right - rect.left, (_rect$height = rect.height) !== null && _rect$height !== void 0 ? _rect$height : rect.bottom - rect.top);
}
};
} else if (fallbackReferenceElement) {
referenceElement = fallbackReferenceElement.parentElement;
}
return (_referenceElement = referenceElement) !== null && _referenceElement !== void 0 ? _referenceElement : null;
};
const computePopoverPosition = (c) => c === null || Number.isNaN(c) ? void 0 : Math.round(c);
;// ./node_modules/@wordpress/components/build-module/tooltip/index.js
const TooltipInternalContext = (0,external_wp_element_namespaceObject.createContext)({
isNestedInTooltip: false
});
TooltipInternalContext.displayName = "TooltipInternalContext";
const TOOLTIP_DELAY = 700;
const CONTEXT_VALUE = {
isNestedInTooltip: true
};
function UnforwardedTooltip(props, ref) {
const {
children,
className,
delay = TOOLTIP_DELAY,
hideOnClick = true,
placement,
position,
shortcut,
text,
...restProps
} = props;
const {
isNestedInTooltip
} = (0,external_wp_element_namespaceObject.useContext)(TooltipInternalContext);
const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(tooltip_Tooltip, "tooltip");
const describedById = text || shortcut ? baseId : void 0;
const isOnlyChild = external_wp_element_namespaceObject.Children.count(children) === 1;
if (!isOnlyChild) {
if (false) {}
}
let computedPlacement;
if (placement !== void 0) {
computedPlacement = placement;
} else if (position !== void 0) {
computedPlacement = positionToPlacement(position);
external_wp_deprecated_default()("`position` prop in wp.components.tooltip", {
since: "6.4",
alternative: "`placement` prop"
});
}
computedPlacement = computedPlacement || "bottom";
const tooltipStore = useTooltipStore({
placement: computedPlacement,
showTimeout: delay
});
const mounted = useStoreState(tooltipStore, "mounted");
if (isNestedInTooltip) {
return isOnlyChild ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Role, {
...restProps,
render: children
}) : children;
}
function addDescribedById(element) {
return describedById && mounted && element.props["aria-describedby"] === void 0 && element.props["aria-label"] !== text ? (0,external_wp_element_namespaceObject.cloneElement)(element, {
"aria-describedby": describedById
}) : element;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(TooltipInternalContext.Provider, {
value: CONTEXT_VALUE,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TooltipAnchor, {
onClick: hideOnClick ? tooltipStore.hide : void 0,
store: tooltipStore,
render: isOnlyChild ? addDescribedById(children) : void 0,
ref,
children: isOnlyChild ? void 0 : children
}), isOnlyChild && (text || shortcut) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tooltip, {
...restProps,
className: dist_clsx("components-tooltip", className),
unmountOnHide: true,
gutter: 4,
id: describedById,
overflowPadding: 0.5,
store: tooltipStore,
children: [text, shortcut && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(shortcut_default, {
className: text ? "components-tooltip__shortcut" : "",
shortcut
})]
})]
});
}
const tooltip_Tooltip = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTooltip);
var tooltip_default = tooltip_Tooltip;
;// external ["wp","warning"]
const external_wp_warning_namespaceObject = window["wp"]["warning"];
var external_wp_warning_default = /*#__PURE__*/__webpack_require__.n(external_wp_warning_namespaceObject);
// EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js
var cjs = __webpack_require__(66);
var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
// EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js
var es6 = __webpack_require__(7734);
var es6_default = /*#__PURE__*/__webpack_require__.n(es6);
;// ./node_modules/is-plain-object/dist/is-plain-object.mjs
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function is_plain_object_isObject(o) {
return Object.prototype.toString.call(o) === '[object Object]';
}
function isPlainObject(o) {
var ctor,prot;
if (is_plain_object_isObject(o) === false) return false;
// If has modified constructor
ctor = o.constructor;
if (ctor === undefined) return true;
// If has modified prototype
prot = ctor.prototype;
if (is_plain_object_isObject(prot) === false) return false;
// If constructor does not have an Object-specific method
if (prot.hasOwnProperty('isPrototypeOf') === false) {
return false;
}
// Most likely a plain Object
return true;
}
;// ./node_modules/@wordpress/components/build-module/utils/hooks/use-update-effect.js
function use_update_effect_useUpdateEffect(effect, deps) {
const mountedRef = (0,external_wp_element_namespaceObject.useRef)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (mountedRef.current) {
return effect();
}
mountedRef.current = true;
return void 0;
}, deps);
(0,external_wp_element_namespaceObject.useEffect)(() => () => {
mountedRef.current = false;
}, []);
}
var use_update_effect_default = use_update_effect_useUpdateEffect;
;// ./node_modules/@wordpress/components/build-module/context/context-system-provider.js
const ComponentsContext = (0,external_wp_element_namespaceObject.createContext)(
/** @type {Record<string, any>} */
{}
);
ComponentsContext.displayName = "ComponentsContext";
const useComponentsContext = () => (0,external_wp_element_namespaceObject.useContext)(ComponentsContext);
function useContextSystemBridge({
value
}) {
const parentContext = useComponentsContext();
const valueRef = (0,external_wp_element_namespaceObject.useRef)(value);
use_update_effect_default(() => {
if (
// Objects are equivalent.
es6_default()(valueRef.current, value) && // But not the same reference.
valueRef.current !== value
) {
true ? external_wp_warning_default()(`Please memoize your context: ${JSON.stringify(value)}`) : 0;
}
}, [value]);
const config = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cjs_default()(parentContext !== null && parentContext !== void 0 ? parentContext : {}, value !== null && value !== void 0 ? value : {}, {
isMergeableObject: isPlainObject
});
}, [parentContext, value]);
return config;
}
const BaseContextSystemProvider = ({
children,
value
}) => {
const contextValue = useContextSystemBridge({
value
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ComponentsContext.Provider, {
value: contextValue,
children
});
};
const ContextSystemProvider = (0,external_wp_element_namespaceObject.memo)(BaseContextSystemProvider);
;// ./node_modules/@wordpress/components/build-module/context/constants.js
const COMPONENT_NAMESPACE = "data-wp-component";
const CONNECTED_NAMESPACE = "data-wp-c16t";
const CONNECT_STATIC_NAMESPACE = "__contextSystemKey__";
;// ./node_modules/@wordpress/components/build-module/context/utils.js
function getNamespace(componentName) {
return {
[COMPONENT_NAMESPACE]: componentName
};
}
function getConnectedNamespace() {
return {
[CONNECTED_NAMESPACE]: true
};
}
;// ./node_modules/tslib/tslib.es6.mjs
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
}
return __assign.apply(this, arguments);
}
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
}
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
var _, done = false;
for (var i = decorators.length - 1; i >= 0; i--) {
var context = {};
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
if (kind === "accessor") {
if (result === void 0) continue;
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
if (_ = accept(result.get)) descriptor.get = _;
if (_ = accept(result.set)) descriptor.set = _;
if (_ = accept(result.init)) initializers.unshift(_);
}
else if (_ = accept(result)) {
if (kind === "field") initializers.unshift(_);
else descriptor[key] = _;
}
}
if (target) Object.defineProperty(target, contextIn.name, descriptor);
done = true;
};
function __runInitializers(thisArg, initializers, value) {
var useValue = arguments.length > 2;
for (var i = 0; i < initializers.length; i++) {
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
}
return useValue ? value : void 0;
};
function __propKey(x) {
return typeof x === "symbol" ? x : "".concat(x);
};
function __setFunctionName(f, name, prefix) {
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
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;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
var __createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
});
function __exportStar(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
}
/** @deprecated */
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
/** @deprecated */
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}
function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}
function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
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);
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); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}
function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __setModuleDefault = Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
};
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
}
function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
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");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
function __classPrivateFieldSet(receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
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");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}
function __classPrivateFieldIn(state, receiver) {
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
return typeof state === "function" ? receiver === state : state.has(receiver);
}
function __addDisposableResource(env, value, async) {
if (value !== null && value !== void 0) {
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
var dispose, inner;
if (async) {
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
dispose = value[Symbol.asyncDispose];
}
if (dispose === void 0) {
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
dispose = value[Symbol.dispose];
if (async) inner = dispose;
}
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
env.stack.push({ value: value, dispose: dispose, async: async });
}
else if (async) {
env.stack.push({ async: true });
}
return value;
}
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
function __disposeResources(env) {
function fail(e) {
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
env.hasError = true;
}
var r, s = 0;
function next() {
while (r = env.stack.pop()) {
try {
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
if (r.dispose) {
var result = r.dispose.call(r.value);
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
}
else s |= 1;
}
catch (e) {
fail(e);
}
}
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
if (env.hasError) throw env.error;
}
return next();
}
function __rewriteRelativeImportExtension(path, preserveJsx) {
if (typeof path === "string" && /^\.\.?\//.test(path)) {
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
});
}
return path;
}
/* harmony default export */ const tslib_es6 = ({
__extends,
__assign,
__rest,
__decorate,
__param,
__esDecorate,
__runInitializers,
__propKey,
__setFunctionName,
__metadata,
__awaiter,
__generator,
__createBinding,
__exportStar,
__values,
__read,
__spread,
__spreadArrays,
__spreadArray,
__await,
__asyncGenerator,
__asyncDelegator,
__asyncValues,
__makeTemplateObject,
__importStar,
__importDefault,
__classPrivateFieldGet,
__classPrivateFieldSet,
__classPrivateFieldIn,
__addDisposableResource,
__disposeResources,
__rewriteRelativeImportExtension,
});
;// ./node_modules/lower-case/dist.es2015/index.js
/**
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
*/
var SUPPORTED_LOCALE = {
tr: {
regexp: /\u0130|\u0049|\u0049\u0307/g,
map: {
İ: "\u0069",
I: "\u0131",
İ: "\u0069",
},
},
az: {
regexp: /\u0130/g,
map: {
İ: "\u0069",
I: "\u0131",
İ: "\u0069",
},
},
lt: {
regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
map: {
I: "\u0069\u0307",
J: "\u006A\u0307",
Į: "\u012F\u0307",
Ì: "\u0069\u0307\u0300",
Í: "\u0069\u0307\u0301",
Ĩ: "\u0069\u0307\u0303",
},
},
};
/**
* Localized lower case.
*/
function localeLowerCase(str, locale) {
var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
if (lang)
return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
return lowerCase(str);
}
/**
* Lower case as a function.
*/
function lowerCase(str) {
return str.toLowerCase();
}
;// ./node_modules/no-case/dist.es2015/index.js
// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
// Remove all non-word characters.
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
/**
* Normalize the string into something other libraries can manipulate easier.
*/
function noCase(input, options) {
if (options === void 0) { options = {}; }
var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
var result = dist_es2015_replace(dist_es2015_replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
var start = 0;
var end = result.length;
// Trim the delimiter from around the output string.
while (result.charAt(start) === "\0")
start++;
while (result.charAt(end - 1) === "\0")
end--;
// Transform each token independently.
return result.slice(start, end).split("\0").map(transform).join(delimiter);
}
/**
* Replace `re` in the input string with the replacement value.
*/
function dist_es2015_replace(input, re, value) {
if (re instanceof RegExp)
return input.replace(re, value);
return re.reduce(function (input, re) { return input.replace(re, value); }, input);
}
;// ./node_modules/dot-case/dist.es2015/index.js
function dotCase(input, options) {
if (options === void 0) { options = {}; }
return noCase(input, __assign({ delimiter: "." }, options));
}
;// ./node_modules/param-case/dist.es2015/index.js
function paramCase(input, options) {
if (options === void 0) { options = {}; }
return dotCase(input, __assign({ delimiter: "-" }, options));
}
;// ./node_modules/memize/dist/index.js
/**
* Memize options object.
*
* @typedef MemizeOptions
*
* @property {number} [maxSize] Maximum size of the cache.
*/
/**
* Internal cache entry.
*
* @typedef MemizeCacheNode
*
* @property {?MemizeCacheNode|undefined} [prev] Previous node.
* @property {?MemizeCacheNode|undefined} [next] Next node.
* @property {Array<*>} args Function arguments for cache
* entry.
* @property {*} val Function result.
*/
/**
* Properties of the enhanced function for controlling cache.
*
* @typedef MemizeMemoizedFunction
*
* @property {()=>void} clear Clear the cache.
*/
/**
* Accepts a function to be memoized, and returns a new memoized function, with
* optional options.
*
* @template {(...args: any[]) => any} F
*
* @param {F} fn Function to memoize.
* @param {MemizeOptions} [options] Options object.
*
* @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function.
*/
function memize(fn, options) {
var size = 0;
/** @type {?MemizeCacheNode|undefined} */
var head;
/** @type {?MemizeCacheNode|undefined} */
var tail;
options = options || {};
function memoized(/* ...args */) {
var node = head,
len = arguments.length,
args,
i;
searchCache: while (node) {
// Perform a shallow equality test to confirm that whether the node
// under test is a candidate for the arguments passed. Two arrays
// are shallowly equal if their length matches and each entry is
// strictly equal between the two sets. Avoid abstracting to a
// function which could incur an arguments leaking deoptimization.
// Check whether node arguments match arguments length
if (node.args.length !== arguments.length) {
node = node.next;
continue;
}
// Check whether node arguments match arguments values
for (i = 0; i < len; i++) {
if (node.args[i] !== arguments[i]) {
node = node.next;
continue searchCache;
}
}
// At this point we can assume we've found a match
// Surface matched node to head if not already
if (node !== head) {
// As tail, shift to previous. Must only shift if not also
// head, since if both head and tail, there is no previous.
if (node === tail) {
tail = node.prev;
}
// Adjust siblings to point to each other. If node was tail,
// this also handles new tail's empty `next` assignment.
/** @type {MemizeCacheNode} */ (node.prev).next = node.next;
if (node.next) {
node.next.prev = node.prev;
}
node.next = head;
node.prev = null;
/** @type {MemizeCacheNode} */ (head).prev = node;
head = node;
}
// Return immediately
return node.val;
}
// No cached value found. Continue to insertion phase:
// Create a copy of arguments (avoid leaking deoptimization)
args = new Array(len);
for (i = 0; i < len; i++) {
args[i] = arguments[i];
}
node = {
args: args,
// Generate the result from original function
val: fn.apply(null, args),
};
// Don't need to check whether node is already head, since it would
// have been returned above already if it was
// Shift existing head down list
if (head) {
head.prev = node;
node.next = head;
} else {
// If no head, follows that there's no tail (at initial or reset)
tail = node;
}
// Trim tail if we're reached max size and are pending cache insertion
if (size === /** @type {MemizeOptions} */ (options).maxSize) {
tail = /** @type {MemizeCacheNode} */ (tail).prev;
/** @type {MemizeCacheNode} */ (tail).next = null;
} else {
size++;
}
head = node;
return node.val;
}
memoized.clear = function () {
head = null;
tail = null;
size = 0;
};
// Ignore reason: There's not a clear solution to create an intersection of
// the function with additional properties, where the goal is to retain the
// function signature of the incoming argument and add control properties
// on the return value.
// @ts-ignore
return memoized;
}
;// ./node_modules/@wordpress/components/build-module/context/get-styled-class-name-from-key.js
function getStyledClassName(namespace) {
const kebab = paramCase(namespace);
return `components-${kebab}`;
}
const getStyledClassNameFromKey = memize(getStyledClassName);
;// ./node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js
/*
Based off glamor's StyleSheet, thanks Sunil ❤️
high performance StyleSheet for css-in-js systems
- uses multiple style tags behind the scenes for millions of rules
- uses `insertRule` for appending in production for *much* faster performance
// usage
import { StyleSheet } from '@emotion/sheet'
let styleSheet = new StyleSheet({ key: '', container: document.head })
styleSheet.insert('#box { border: 1px solid red; }')
- appends a css rule into the stylesheet
styleSheet.flush()
- empties the stylesheet of all its contents
*/
// $FlowFixMe
function sheetForTag(tag) {
if (tag.sheet) {
// $FlowFixMe
return tag.sheet;
} // this weirdness brought to you by firefox
/* istanbul ignore next */
for (var i = 0; i < document.styleSheets.length; i++) {
if (document.styleSheets[i].ownerNode === tag) {
// $FlowFixMe
return document.styleSheets[i];
}
}
}
function createStyleElement(options) {
var tag = document.createElement('style');
tag.setAttribute('data-emotion', options.key);
if (options.nonce !== undefined) {
tag.setAttribute('nonce', options.nonce);
}
tag.appendChild(document.createTextNode(''));
tag.setAttribute('data-s', '');
return tag;
}
var StyleSheet = /*#__PURE__*/function () {
// Using Node instead of HTMLElement since container may be a ShadowRoot
function StyleSheet(options) {
var _this = this;
this._insertTag = function (tag) {
var before;
if (_this.tags.length === 0) {
if (_this.insertionPoint) {
before = _this.insertionPoint.nextSibling;
} else if (_this.prepend) {
before = _this.container.firstChild;
} else {
before = _this.before;
}
} else {
before = _this.tags[_this.tags.length - 1].nextSibling;
}
_this.container.insertBefore(tag, before);
_this.tags.push(tag);
};
this.isSpeedy = options.speedy === undefined ? "production" === 'production' : options.speedy;
this.tags = [];
this.ctr = 0;
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
this.key = options.key;
this.container = options.container;
this.prepend = options.prepend;
this.insertionPoint = options.insertionPoint;
this.before = null;
}
var _proto = StyleSheet.prototype;
_proto.hydrate = function hydrate(nodes) {
nodes.forEach(this._insertTag);
};
_proto.insert = function insert(rule) {
// the max length is how many rules we have per style tag, it's 65000 in speedy mode
// it's 1 in dev because we insert source maps that map a single rule to a location
// and you can only have one source map per style tag
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
this._insertTag(createStyleElement(this));
}
var tag = this.tags[this.tags.length - 1];
if (false) { var isImportRule; }
if (this.isSpeedy) {
var sheet = sheetForTag(tag);
try {
// this is the ultrafast version, works across browsers
// the big drawback is that the css won't be editable in devtools
sheet.insertRule(rule, sheet.cssRules.length);
} catch (e) {
if (false) {}
}
} else {
tag.appendChild(document.createTextNode(rule));
}
this.ctr++;
};
_proto.flush = function flush() {
// $FlowFixMe
this.tags.forEach(function (tag) {
return tag.parentNode && tag.parentNode.removeChild(tag);
});
this.tags = [];
this.ctr = 0;
if (false) {}
};
return StyleSheet;
}();
;// ./node_modules/stylis/src/Utility.js
/**
* @param {number}
* @return {number}
*/
var abs = Math.abs
/**
* @param {number}
* @return {string}
*/
var Utility_from = String.fromCharCode
/**
* @param {object}
* @return {object}
*/
var Utility_assign = Object.assign
/**
* @param {string} value
* @param {number} length
* @return {number}
*/
function hash (value, length) {
return Utility_charat(value, 0) ^ 45 ? (((((((length << 2) ^ Utility_charat(value, 0)) << 2) ^ Utility_charat(value, 1)) << 2) ^ Utility_charat(value, 2)) << 2) ^ Utility_charat(value, 3) : 0
}
/**
* @param {string} value
* @return {string}
*/
function trim (value) {
return value.trim()
}
/**
* @param {string} value
* @param {RegExp} pattern
* @return {string?}
*/
function Utility_match (value, pattern) {
return (value = pattern.exec(value)) ? value[0] : value
}
/**
* @param {string} value
* @param {(string|RegExp)} pattern
* @param {string} replacement
* @return {string}
*/
function Utility_replace (value, pattern, replacement) {
return value.replace(pattern, replacement)
}
/**
* @param {string} value
* @param {string} search
* @return {number}
*/
function indexof (value, search) {
return value.indexOf(search)
}
/**
* @param {string} value
* @param {number} index
* @return {number}
*/
function Utility_charat (value, index) {
return value.charCodeAt(index) | 0
}
/**
* @param {string} value
* @param {number} begin
* @param {number} end
* @return {string}
*/
function Utility_substr (value, begin, end) {
return value.slice(begin, end)
}
/**
* @param {string} value
* @return {number}
*/
function Utility_strlen (value) {
return value.length
}
/**
* @param {any[]} value
* @return {number}
*/
function Utility_sizeof (value) {
return value.length
}
/**
* @param {any} value
* @param {any[]} array
* @return {any}
*/
function Utility_append (value, array) {
return array.push(value), value
}
/**
* @param {string[]} array
* @param {function} callback
* @return {string}
*/
function Utility_combine (array, callback) {
return array.map(callback).join('')
}
;// ./node_modules/stylis/src/Tokenizer.js
var line = 1
var column = 1
var Tokenizer_length = 0
var position = 0
var character = 0
var characters = ''
/**
* @param {string} value
* @param {object | null} root
* @param {object | null} parent
* @param {string} type
* @param {string[] | string} props
* @param {object[] | string} children
* @param {number} length
*/
function node (value, root, parent, type, props, children, length) {
return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}
}
/**
* @param {object} root
* @param {object} props
* @return {object}
*/
function Tokenizer_copy (root, props) {
return Utility_assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)
}
/**
* @return {number}
*/
function Tokenizer_char () {
return character
}
/**
* @return {number}
*/
function prev () {
character = position > 0 ? Utility_charat(characters, --position) : 0
if (column--, character === 10)
column = 1, line--
return character
}
/**
* @return {number}
*/
function next () {
character = position < Tokenizer_length ? Utility_charat(characters, position++) : 0
if (column++, character === 10)
column = 1, line++
return character
}
/**
* @return {number}
*/
function peek () {
return Utility_charat(characters, position)
}
/**
* @return {number}
*/
function caret () {
return position
}
/**
* @param {number} begin
* @param {number} end
* @return {string}
*/
function slice (begin, end) {
return Utility_substr(characters, begin, end)
}
/**
* @param {number} type
* @return {number}
*/
function token (type) {
switch (type) {
// \0 \t \n \r \s whitespace token
case 0: case 9: case 10: case 13: case 32:
return 5
// ! + , / > @ ~ isolate token
case 33: case 43: case 44: case 47: case 62: case 64: case 126:
// ; { } breakpoint token
case 59: case 123: case 125:
return 4
// : accompanied token
case 58:
return 3
// " ' ( [ opening delimit token
case 34: case 39: case 40: case 91:
return 2
// ) ] closing delimit token
case 41: case 93:
return 1
}
return 0
}
/**
* @param {string} value
* @return {any[]}
*/
function alloc (value) {
return line = column = 1, Tokenizer_length = Utility_strlen(characters = value), position = 0, []
}
/**
* @param {any} value
* @return {any}
*/
function dealloc (value) {
return characters = '', value
}
/**
* @param {number} type
* @return {string}
*/
function delimit (type) {
return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
}
/**
* @param {string} value
* @return {string[]}
*/
function Tokenizer_tokenize (value) {
return dealloc(tokenizer(alloc(value)))
}
/**
* @param {number} type
* @return {string}
*/
function whitespace (type) {
while (character = peek())
if (character < 33)
next()
else
break
return token(type) > 2 || token(character) > 3 ? '' : ' '
}
/**
* @param {string[]} children
* @return {string[]}
*/
function tokenizer (children) {
while (next())
switch (token(character)) {
case 0: append(identifier(position - 1), children)
break
case 2: append(delimit(character), children)
break
default: append(from(character), children)
}
return children
}
/**
* @param {number} index
* @param {number} count
* @return {string}
*/
function escaping (index, count) {
while (--count && next())
// not 0-9 A-F a-f
if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))
break
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))
}
/**
* @param {number} type
* @return {number}
*/
function delimiter (type) {
while (next())
switch (character) {
// ] ) " '
case type:
return position
// " '
case 34: case 39:
if (type !== 34 && type !== 39)
delimiter(character)
break
// (
case 40:
if (type === 41)
delimiter(type)
break
// \
case 92:
next()
break
}
return position
}
/**
* @param {number} type
* @param {number} index
* @return {number}
*/
function commenter (type, index) {
while (next())
// //
if (type + character === 47 + 10)
break
// /*
else if (type + character === 42 + 42 && peek() === 47)
break
return '/*' + slice(index, position - 1) + '*' + Utility_from(type === 47 ? type : next())
}
/**
* @param {number} index
* @return {string}
*/
function identifier (index) {
while (!token(peek()))
next()
return slice(index, position)
}
;// ./node_modules/stylis/src/Enum.js
var Enum_MS = '-ms-'
var Enum_MOZ = '-moz-'
var Enum_WEBKIT = '-webkit-'
var COMMENT = 'comm'
var Enum_RULESET = 'rule'
var Enum_DECLARATION = 'decl'
var PAGE = '@page'
var MEDIA = '@media'
var IMPORT = '@import'
var CHARSET = '@charset'
var VIEWPORT = '@viewport'
var SUPPORTS = '@supports'
var DOCUMENT = '@document'
var NAMESPACE = '@namespace'
var Enum_KEYFRAMES = '@keyframes'
var FONT_FACE = '@font-face'
var COUNTER_STYLE = '@counter-style'
var FONT_FEATURE_VALUES = '@font-feature-values'
;// ./node_modules/stylis/src/Serializer.js
/**
* @param {object[]} children
* @param {function} callback
* @return {string}
*/
function Serializer_serialize (children, callback) {
var output = ''
var length = Utility_sizeof(children)
for (var i = 0; i < length; i++)
output += callback(children[i], i, children, callback) || ''
return output
}
/**
* @param {object} element
* @param {number} index
* @param {object[]} children
* @param {function} callback
* @return {string}
*/
function stringify (element, index, children, callback) {
switch (element.type) {
case IMPORT: case Enum_DECLARATION: return element.return = element.return || element.value
case COMMENT: return ''
case Enum_KEYFRAMES: return element.return = element.value + '{' + Serializer_serialize(element.children, callback) + '}'
case Enum_RULESET: element.value = element.props.join(',')
}
return Utility_strlen(children = Serializer_serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''
}
;// ./node_modules/stylis/src/Middleware.js
/**
* @param {function[]} collection
* @return {function}
*/
function middleware (collection) {
var length = Utility_sizeof(collection)
return function (element, index, children, callback) {
var output = ''
for (var i = 0; i < length; i++)
output += collection[i](element, index, children, callback) || ''
return output
}
}
/**
* @param {function} callback
* @return {function}
*/
function rulesheet (callback) {
return function (element) {
if (!element.root)
if (element = element.return)
callback(element)
}
}
/**
* @param {object} element
* @param {number} index
* @param {object[]} children
* @param {function} callback
*/
function prefixer (element, index, children, callback) {
if (element.length > -1)
if (!element.return)
switch (element.type) {
case DECLARATION: element.return = prefix(element.value, element.length, children)
return
case KEYFRAMES:
return serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)
case RULESET:
if (element.length)
return combine(element.props, function (value) {
switch (match(value, /(::plac\w+|:read-\w+)/)) {
// :read-(only|write)
case ':read-only': case ':read-write':
return serialize([copy(element, {props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]})], callback)
// :placeholder
case '::placeholder':
return serialize([
copy(element, {props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]}),
copy(element, {props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]}),
copy(element, {props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]})
], callback)
}
return ''
})
}
}
/**
* @param {object} element
* @param {number} index
* @param {object[]} children
*/
function namespace (element) {
switch (element.type) {
case RULESET:
element.props = element.props.map(function (value) {
return combine(tokenize(value), function (value, index, children) {
switch (charat(value, 0)) {
// \f
case 12:
return substr(value, 1, strlen(value))
// \0 ( + > ~
case 0: case 40: case 43: case 62: case 126:
return value
// :
case 58:
if (children[++index] === 'global')
children[index] = '', children[++index] = '\f' + substr(children[index], index = 1, -1)
// \s
case 32:
return index === 1 ? '' : value
default:
switch (index) {
case 0: element = value
return sizeof(children) > 1 ? '' : value
case index = sizeof(children) - 1: case 2:
return index === 2 ? value + element + element : value + element
default:
return value
}
}
})
})
}
}
;// ./node_modules/stylis/src/Parser.js
/**
* @param {string} value
* @return {object[]}
*/
function compile (value) {
return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))
}
/**
* @param {string} value
* @param {object} root
* @param {object?} parent
* @param {string[]} rule
* @param {string[]} rules
* @param {string[]} rulesets
* @param {number[]} pseudo
* @param {number[]} points
* @param {string[]} declarations
* @return {object}
*/
function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
var index = 0
var offset = 0
var length = pseudo
var atrule = 0
var property = 0
var previous = 0
var variable = 1
var scanning = 1
var ampersand = 1
var character = 0
var type = ''
var props = rules
var children = rulesets
var reference = rule
var characters = type
while (scanning)
switch (previous = character, character = next()) {
// (
case 40:
if (previous != 108 && Utility_charat(characters, length - 1) == 58) {
if (indexof(characters += Utility_replace(delimit(character), '&', '&\f'), '&\f') != -1)
ampersand = -1
break
}
// " ' [
case 34: case 39: case 91:
characters += delimit(character)
break
// \t \n \r \s
case 9: case 10: case 13: case 32:
characters += whitespace(previous)
break
// \
case 92:
characters += escaping(caret() - 1, 7)
continue
// /
case 47:
switch (peek()) {
case 42: case 47:
Utility_append(comment(commenter(next(), caret()), root, parent), declarations)
break
default:
characters += '/'
}
break
// {
case 123 * variable:
points[index++] = Utility_strlen(characters) * ampersand
// } ; \0
case 125 * variable: case 59: case 0:
switch (character) {
// \0 }
case 0: case 125: scanning = 0
// ;
case 59 + offset:
if (property > 0 && (Utility_strlen(characters) - length))
Utility_append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(Utility_replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)
break
// @ ;
case 59: characters += ';'
// { rule/at-rule
default:
Utility_append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)
if (character === 123)
if (offset === 0)
parse(characters, root, reference, reference, props, rulesets, length, points, children)
else
switch (atrule === 99 && Utility_charat(characters, 3) === 110 ? 100 : atrule) {
// d m s
case 100: case 109: case 115:
parse(value, reference, reference, rule && Utility_append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)
break
default:
parse(characters, reference, reference, reference, [''], children, 0, points, children)
}
}
index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo
break
// :
case 58:
length = 1 + Utility_strlen(characters), property = previous
default:
if (variable < 1)
if (character == 123)
--variable
else if (character == 125 && variable++ == 0 && prev() == 125)
continue
switch (characters += Utility_from(character), character * variable) {
// &
case 38:
ampersand = offset > 0 ? 1 : (characters += '\f', -1)
break
// ,
case 44:
points[index++] = (Utility_strlen(characters) - 1) * ampersand, ampersand = 1
break
// @
case 64:
// -
if (peek() === 45)
characters += delimit(next())
atrule = peek(), offset = length = Utility_strlen(type = characters += identifier(caret())), character++
break
// -
case 45:
if (previous === 45 && Utility_strlen(characters) == 2)
variable = 0
}
}
return rulesets
}
/**
* @param {string} value
* @param {object} root
* @param {object?} parent
* @param {number} index
* @param {number} offset
* @param {string[]} rules
* @param {number[]} points
* @param {string} type
* @param {string[]} props
* @param {string[]} children
* @param {number} length
* @return {object}
*/
function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {
var post = offset - 1
var rule = offset === 0 ? rules : ['']
var size = Utility_sizeof(rule)
for (var i = 0, j = 0, k = 0; i < index; ++i)
for (var x = 0, y = Utility_substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
if (z = trim(j > 0 ? rule[x] + ' ' + y : Utility_replace(y, /&\f/g, rule[x])))
props[k++] = z
return node(value, root, parent, offset === 0 ? Enum_RULESET : type, props, children, length)
}
/**
* @param {number} value
* @param {object} root
* @param {object?} parent
* @return {object}
*/
function comment (value, root, parent) {
return node(value, root, parent, COMMENT, Utility_from(Tokenizer_char()), Utility_substr(value, 2, -2), 0)
}
/**
* @param {string} value
* @param {object} root
* @param {object?} parent
* @param {number} length
* @return {object}
*/
function declaration (value, root, parent, length) {
return node(value, root, parent, Enum_DECLARATION, Utility_substr(value, 0, length), Utility_substr(value, length + 1, -1), length)
}
;// ./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js
var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
var previous = 0;
var character = 0;
while (true) {
previous = character;
character = peek(); // &\f
if (previous === 38 && character === 12) {
points[index] = 1;
}
if (token(character)) {
break;
}
next();
}
return slice(begin, position);
};
var toRules = function toRules(parsed, points) {
// pretend we've started with a comma
var index = -1;
var character = 44;
do {
switch (token(character)) {
case 0:
// &\f
if (character === 38 && peek() === 12) {
// this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
// stylis inserts \f after & to know when & where it should replace this sequence with the context selector
// and when it should just concatenate the outer and inner selectors
// it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
points[index] = 1;
}
parsed[index] += identifierWithPointTracking(position - 1, points, index);
break;
case 2:
parsed[index] += delimit(character);
break;
case 4:
// comma
if (character === 44) {
// colon
parsed[++index] = peek() === 58 ? '&\f' : '';
points[index] = parsed[index].length;
break;
}
// fallthrough
default:
parsed[index] += Utility_from(character);
}
} while (character = next());
return parsed;
};
var getRules = function getRules(value, points) {
return dealloc(toRules(alloc(value), points));
}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
var fixedElements = /* #__PURE__ */new WeakMap();
var compat = function compat(element) {
if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
// negative .length indicates that this rule has been already prefixed
element.length < 1) {
return;
}
var value = element.value,
parent = element.parent;
var isImplicitRule = element.column === parent.column && element.line === parent.line;
while (parent.type !== 'rule') {
parent = parent.parent;
if (!parent) return;
} // short-circuit for the simplest case
if (element.props.length === 1 && value.charCodeAt(0) !== 58
/* colon */
&& !fixedElements.get(parent)) {
return;
} // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
// then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
if (isImplicitRule) {
return;
}
fixedElements.set(element, true);
var points = [];
var rules = getRules(value, points);
var parentRules = parent.props;
for (var i = 0, k = 0; i < rules.length; i++) {
for (var j = 0; j < parentRules.length; j++, k++) {
element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
}
}
};
var removeLabel = function removeLabel(element) {
if (element.type === 'decl') {
var value = element.value;
if ( // charcode for l
value.charCodeAt(0) === 108 && // charcode for b
value.charCodeAt(2) === 98) {
// this ignores label
element["return"] = '';
element.value = '';
}
}
};
var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
var isIgnoringComment = function isIgnoringComment(element) {
return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
};
var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
return function (element, index, children) {
if (element.type !== 'rule' || cache.compat) return;
var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
if (unsafePseudoClasses) {
var isNested = element.parent === children[0]; // in nested rules comments become children of the "auto-inserted" rule
//
// considering this input:
// .a {
// .b /* comm */ {}
// color: hotpink;
// }
// we get output corresponding to this:
// .a {
// & {
// /* comm */
// color: hotpink;
// }
// .b {}
// }
var commentContainer = isNested ? children[0].children : // global rule at the root level
children;
for (var i = commentContainer.length - 1; i >= 0; i--) {
var node = commentContainer[i];
if (node.line < element.line) {
break;
} // it is quite weird but comments are *usually* put at `column: element.column - 1`
// so we seek *from the end* for the node that is earlier than the rule's `element` and check that
// this will also match inputs like this:
// .a {
// /* comm */
// .b {}
// }
//
// but that is fine
//
// it would be the easiest to change the placement of the comment to be the first child of the rule:
// .a {
// .b { /* comm */ }
// }
// with such inputs we wouldn't have to search for the comment at all
// TODO: consider changing this comment placement in the next major version
if (node.column < element.column) {
if (isIgnoringComment(node)) {
return;
}
break;
}
}
unsafePseudoClasses.forEach(function (unsafePseudoClass) {
console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
});
}
};
};
var isImportRule = function isImportRule(element) {
return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
};
var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {
for (var i = index - 1; i >= 0; i--) {
if (!isImportRule(children[i])) {
return true;
}
}
return false;
}; // use this to remove incorrect elements from further processing
// so they don't get handed to the `sheet` (or anything else)
// as that could potentially lead to additional logs which in turn could be overhelming to the user
var nullifyElement = function nullifyElement(element) {
element.type = '';
element.value = '';
element["return"] = '';
element.children = '';
element.props = '';
};
var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {
if (!isImportRule(element)) {
return;
}
if (element.parent) {
console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
nullifyElement(element);
} else if (isPrependedWithRegularRules(index, children)) {
console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
nullifyElement(element);
}
};
/* eslint-disable no-fallthrough */
function emotion_cache_browser_esm_prefix(value, length) {
switch (hash(value, length)) {
// color-adjust
case 5103:
return Enum_WEBKIT + 'print-' + value + value;
// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
case 5737:
case 4201:
case 3177:
case 3433:
case 1641:
case 4457:
case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
case 5572:
case 6356:
case 5844:
case 3191:
case 6645:
case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
case 6391:
case 5879:
case 5623:
case 6135:
case 4599:
case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
case 4215:
case 6389:
case 5109:
case 5365:
case 5621:
case 3829:
return Enum_WEBKIT + value + value;
// appearance, user-select, transform, hyphens, text-size-adjust
case 5349:
case 4246:
case 4810:
case 6968:
case 2756:
return Enum_WEBKIT + value + Enum_MOZ + value + Enum_MS + value + value;
// flex, flex-direction
case 6828:
case 4268:
return Enum_WEBKIT + value + Enum_MS + value + value;
// order
case 6165:
return Enum_WEBKIT + value + Enum_MS + 'flex-' + value + value;
// align-items
case 5187:
return Enum_WEBKIT + value + Utility_replace(value, /(\w+).+(:[^]+)/, Enum_WEBKIT + 'box-$1$2' + Enum_MS + 'flex-$1$2') + value;
// align-self
case 5443:
return Enum_WEBKIT + value + Enum_MS + 'flex-item-' + Utility_replace(value, /flex-|-self/, '') + value;
// align-content
case 4675:
return Enum_WEBKIT + value + Enum_MS + 'flex-line-pack' + Utility_replace(value, /align-content|flex-|-self/, '') + value;
// flex-shrink
case 5548:
return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'shrink', 'negative') + value;
// flex-basis
case 5292:
return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'basis', 'preferred-size') + value;
// flex-grow
case 6060:
return Enum_WEBKIT + 'box-' + Utility_replace(value, '-grow', '') + Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'grow', 'positive') + value;
// transition
case 4554:
return Enum_WEBKIT + Utility_replace(value, /([^-])(transform)/g, '$1' + Enum_WEBKIT + '$2') + value;
// cursor
case 6187:
return Utility_replace(Utility_replace(Utility_replace(value, /(zoom-|grab)/, Enum_WEBKIT + '$1'), /(image-set)/, Enum_WEBKIT + '$1'), value, '') + value;
// background, background-image
case 5495:
case 3959:
return Utility_replace(value, /(image-set\([^]*)/, Enum_WEBKIT + '$1' + '$`$1');
// justify-content
case 4968:
return Utility_replace(Utility_replace(value, /(.+:)(flex-)?(.*)/, Enum_WEBKIT + 'box-pack:$3' + Enum_MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + Enum_WEBKIT + value + value;
// (margin|padding)-inline-(start|end)
case 4095:
case 3583:
case 4068:
case 2532:
return Utility_replace(value, /(.+)-inline(.+)/, Enum_WEBKIT + '$1$2') + value;
// (min|max)?(width|height|inline-size|block-size)
case 8116:
case 7059:
case 5753:
case 5535:
case 5445:
case 5701:
case 4933:
case 4677:
case 5533:
case 5789:
case 5021:
case 4765:
// stretch, max-content, min-content, fill-available
if (Utility_strlen(value) - 1 - length > 6) switch (Utility_charat(value, length + 1)) {
// (m)ax-content, (m)in-content
case 109:
// -
if (Utility_charat(value, length + 4) !== 45) break;
// (f)ill-available, (f)it-content
case 102:
return Utility_replace(value, /(.+:)(.+)-([^]+)/, '$1' + Enum_WEBKIT + '$2-$3' + '$1' + Enum_MOZ + (Utility_charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
// (s)tretch
case 115:
return ~indexof(value, 'stretch') ? emotion_cache_browser_esm_prefix(Utility_replace(value, 'stretch', 'fill-available'), length) + value : value;
}
break;
// position: sticky
case 4949:
// (s)ticky?
if (Utility_charat(value, length + 1) !== 115) break;
// display: (flex|inline-flex)
case 6444:
switch (Utility_charat(value, Utility_strlen(value) - 3 - (~indexof(value, '!important') && 10))) {
// stic(k)y
case 107:
return Utility_replace(value, ':', ':' + Enum_WEBKIT) + value;
// (inline-)?fl(e)x
case 101:
return Utility_replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + Enum_WEBKIT + (Utility_charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + Enum_WEBKIT + '$2$3' + '$1' + Enum_MS + '$2box$3') + value;
}
break;
// writing-mode
case 5936:
switch (Utility_charat(value, length + 11)) {
// vertical-l(r)
case 114:
return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
// vertical-r(l)
case 108:
return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
// horizontal(-)tb
case 45:
return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
}
return Enum_WEBKIT + value + Enum_MS + value + value;
}
return value;
}
var emotion_cache_browser_esm_prefixer = function prefixer(element, index, children, callback) {
if (element.length > -1) if (!element["return"]) switch (element.type) {
case Enum_DECLARATION:
element["return"] = emotion_cache_browser_esm_prefix(element.value, element.length);
break;
case Enum_KEYFRAMES:
return Serializer_serialize([Tokenizer_copy(element, {
value: Utility_replace(element.value, '@', '@' + Enum_WEBKIT)
})], callback);
case Enum_RULESET:
if (element.length) return Utility_combine(element.props, function (value) {
switch (Utility_match(value, /(::plac\w+|:read-\w+)/)) {
// :read-(only|write)
case ':read-only':
case ':read-write':
return Serializer_serialize([Tokenizer_copy(element, {
props: [Utility_replace(value, /:(read-\w+)/, ':' + Enum_MOZ + '$1')]
})], callback);
// :placeholder
case '::placeholder':
return Serializer_serialize([Tokenizer_copy(element, {
props: [Utility_replace(value, /:(plac\w+)/, ':' + Enum_WEBKIT + 'input-$1')]
}), Tokenizer_copy(element, {
props: [Utility_replace(value, /:(plac\w+)/, ':' + Enum_MOZ + '$1')]
}), Tokenizer_copy(element, {
props: [Utility_replace(value, /:(plac\w+)/, Enum_MS + 'input-$1')]
})], callback);
}
return '';
});
}
};
var defaultStylisPlugins = [emotion_cache_browser_esm_prefixer];
var createCache = function createCache(options) {
var key = options.key;
if (false) {}
if ( key === 'css') {
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
// document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
// note this very very intentionally targets all style elements regardless of the key to ensure
// that creating a cache works inside of render of a React component
Array.prototype.forEach.call(ssrStyles, function (node) {
// we want to only move elements which have a space in the data-emotion attribute value
// because that indicates that it is an Emotion 11 server-side rendered style elements
// while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
// Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
// so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
// will not result in the Emotion 10 styles being destroyed
var dataEmotionAttribute = node.getAttribute('data-emotion');
if (dataEmotionAttribute.indexOf(' ') === -1) {
return;
}
document.head.appendChild(node);
node.setAttribute('data-s', '');
});
}
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
if (false) {}
var inserted = {};
var container;
var nodesToHydrate = [];
{
container = options.container || document.head;
Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe
for (var i = 1; i < attrib.length; i++) {
inserted[attrib[i]] = true;
}
nodesToHydrate.push(node);
});
}
var _insert;
var omnipresentPlugins = [compat, removeLabel];
if (false) {}
{
var currentSheet;
var finalizingPlugins = [stringify, false ? 0 : rulesheet(function (rule) {
currentSheet.insert(rule);
})];
var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
var stylis = function stylis(styles) {
return Serializer_serialize(compile(styles), serializer);
};
_insert = function insert(selector, serialized, sheet, shouldCache) {
currentSheet = sheet;
if (false) {}
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
if (shouldCache) {
cache.inserted[serialized.name] = true;
}
};
}
var cache = {
key: key,
sheet: new StyleSheet({
key: key,
container: container,
nonce: options.nonce,
speedy: options.speedy,
prepend: options.prepend,
insertionPoint: options.insertionPoint
}),
nonce: options.nonce,
inserted: inserted,
registered: {},
insert: _insert
};
cache.sheet.hydrate(nodesToHydrate);
return cache;
};
/* harmony default export */ const emotion_cache_browser_esm = (createCache);
;// ./node_modules/@emotion/hash/dist/emotion-hash.esm.js
/* eslint-disable */
// Inspired by https://github.com/garycourt/murmurhash-js
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
function murmur2(str) {
// 'm' and 'r' are mixing constants generated offline.
// They're not really 'magic', they just happen to work well.
// const m = 0x5bd1e995;
// const r = 24;
// Initialize the hash
var h = 0; // Mix 4 bytes at a time into the hash
var k,
i = 0,
len = str.length;
for (; len >= 4; ++i, len -= 4) {
k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
k =
/* Math.imul(k, m): */
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
k ^=
/* k >>> r: */
k >>> 24;
h =
/* Math.imul(k, m): */
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
} // Handle the last few bytes of the input array
switch (len) {
case 3:
h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
case 2:
h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
case 1:
h ^= str.charCodeAt(i) & 0xff;
h =
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
} // Do a few final mixes of the hash to ensure the last few
// bytes are well-incorporated.
h ^= h >>> 13;
h =
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
return ((h ^ h >>> 15) >>> 0).toString(36);
}
/* harmony default export */ const emotion_hash_esm = (murmur2);
;// ./node_modules/@emotion/unitless/dist/emotion-unitless.esm.js
var unitlessKeys = {
animationIterationCount: 1,
borderImageOutset: 1,
borderImageSlice: 1,
borderImageWidth: 1,
boxFlex: 1,
boxFlexGroup: 1,
boxOrdinalGroup: 1,
columnCount: 1,
columns: 1,
flex: 1,
flexGrow: 1,
flexPositive: 1,
flexShrink: 1,
flexNegative: 1,
flexOrder: 1,
gridRow: 1,
gridRowEnd: 1,
gridRowSpan: 1,
gridRowStart: 1,
gridColumn: 1,
gridColumnEnd: 1,
gridColumnSpan: 1,
gridColumnStart: 1,
msGridRow: 1,
msGridRowSpan: 1,
msGridColumn: 1,
msGridColumnSpan: 1,
fontWeight: 1,
lineHeight: 1,
opacity: 1,
order: 1,
orphans: 1,
tabSize: 1,
widows: 1,
zIndex: 1,
zoom: 1,
WebkitLineClamp: 1,
// SVG-related properties
fillOpacity: 1,
floodOpacity: 1,
stopOpacity: 1,
strokeDasharray: 1,
strokeDashoffset: 1,
strokeMiterlimit: 1,
strokeOpacity: 1,
strokeWidth: 1
};
/* harmony default export */ const emotion_unitless_esm = (unitlessKeys);
;// ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
function memoize(fn) {
var cache = Object.create(null);
return function (arg) {
if (cache[arg] === undefined) cache[arg] = fn(arg);
return cache[arg];
};
}
;// ./node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
var hyphenateRegex = /[A-Z]|^ms/g;
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
var isCustomProperty = function isCustomProperty(property) {
return property.charCodeAt(1) === 45;
};
var isProcessableValue = function isProcessableValue(value) {
return value != null && typeof value !== 'boolean';
};
var processStyleName = /* #__PURE__ */memoize(function (styleName) {
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
});
var processStyleValue = function processStyleValue(key, value) {
switch (key) {
case 'animation':
case 'animationName':
{
if (typeof value === 'string') {
return value.replace(animationRegex, function (match, p1, p2) {
cursor = {
name: p1,
styles: p2,
next: cursor
};
return p1;
});
}
}
}
if (emotion_unitless_esm[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
return value + 'px';
}
return value;
};
if (false) { var hyphenatedCache, hyphenPattern, msPattern, oldProcessStyleValue, contentValues, contentValuePattern; }
var noComponentSelectorMessage = (/* unused pure expression or super */ null && ('Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.'));
function handleInterpolation(mergedProps, registered, interpolation) {
if (interpolation == null) {
return '';
}
if (interpolation.__emotion_styles !== undefined) {
if (false) {}
return interpolation;
}
switch (typeof interpolation) {
case 'boolean':
{
return '';
}
case 'object':
{
if (interpolation.anim === 1) {
cursor = {
name: interpolation.name,
styles: interpolation.styles,
next: cursor
};
return interpolation.name;
}
if (interpolation.styles !== undefined) {
var next = interpolation.next;
if (next !== undefined) {
// not the most efficient thing ever but this is a pretty rare case
// and there will be very few iterations of this generally
while (next !== undefined) {
cursor = {
name: next.name,
styles: next.styles,
next: cursor
};
next = next.next;
}
}
var styles = interpolation.styles + ";";
if (false) {}
return styles;
}
return createStringFromObject(mergedProps, registered, interpolation);
}
case 'function':
{
if (mergedProps !== undefined) {
var previousCursor = cursor;
var result = interpolation(mergedProps);
cursor = previousCursor;
return handleInterpolation(mergedProps, registered, result);
} else if (false) {}
break;
}
case 'string':
if (false) { var replaced, matched; }
break;
} // finalize string values (regular strings and functions interpolated into css calls)
if (registered == null) {
return interpolation;
}
var cached = registered[interpolation];
return cached !== undefined ? cached : interpolation;
}
function createStringFromObject(mergedProps, registered, obj) {
var string = '';
if (Array.isArray(obj)) {
for (var i = 0; i < obj.length; i++) {
string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
}
} else {
for (var _key in obj) {
var value = obj[_key];
if (typeof value !== 'object') {
if (registered != null && registered[value] !== undefined) {
string += _key + "{" + registered[value] + "}";
} else if (isProcessableValue(value)) {
string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
}
} else {
if (_key === 'NO_COMPONENT_SELECTOR' && "production" !== 'production') {}
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
for (var _i = 0; _i < value.length; _i++) {
if (isProcessableValue(value[_i])) {
string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
}
}
} else {
var interpolated = handleInterpolation(mergedProps, registered, value);
switch (_key) {
case 'animation':
case 'animationName':
{
string += processStyleName(_key) + ":" + interpolated + ";";
break;
}
default:
{
if (false) {}
string += _key + "{" + interpolated + "}";
}
}
}
}
}
}
return string;
}
var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
var sourceMapPattern;
if (false) {} // this is the cursor for keyframes
// keyframes are stored on the SerializedStyles object as a linked list
var cursor;
var emotion_serialize_browser_esm_serializeStyles = function serializeStyles(args, registered, mergedProps) {
if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
return args[0];
}
var stringMode = true;
var styles = '';
cursor = undefined;
var strings = args[0];
if (strings == null || strings.raw === undefined) {
stringMode = false;
styles += handleInterpolation(mergedProps, registered, strings);
} else {
if (false) {}
styles += strings[0];
} // we start at 1 since we've already handled the first arg
for (var i = 1; i < args.length; i++) {
styles += handleInterpolation(mergedProps, registered, args[i]);
if (stringMode) {
if (false) {}
styles += strings[i];
}
}
var sourceMap;
if (false) {} // using a global regex with .exec is stateful so lastIndex has to be reset each time
labelPattern.lastIndex = 0;
var identifierName = '';
var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
while ((match = labelPattern.exec(styles)) !== null) {
identifierName += '-' + // $FlowFixMe we know it's not null
match[1];
}
var name = emotion_hash_esm(styles) + identifierName;
if (false) {}
return {
name: name,
styles: styles,
next: cursor
};
};
;// ./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js
var syncFallback = function syncFallback(create) {
return create();
};
var useInsertionEffect = external_React_['useInsertion' + 'Effect'] ? external_React_['useInsertion' + 'Effect'] : false;
var emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;
var emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectWithLayoutFallback = (/* unused pure expression or super */ null && (useInsertionEffect || useLayoutEffect));
;// ./node_modules/@emotion/react/dist/emotion-element-6a883da9.browser.esm.js
var emotion_element_6a883da9_browser_esm_hasOwnProperty = {}.hasOwnProperty;
var EmotionCacheContext = /* #__PURE__ */(0,external_React_.createContext)( // we're doing this to avoid preconstruct's dead code elimination in this one case
// because this module is primarily intended for the browser and node
// but it's also required in react native and similar environments sometimes
// and we could have a special build just for that
// but this is much easier and the native packages
// might use a different theme context in the future anyway
typeof HTMLElement !== 'undefined' ? /* #__PURE__ */emotion_cache_browser_esm({
key: 'css'
}) : null);
if (false) {}
var CacheProvider = EmotionCacheContext.Provider;
var __unsafe_useEmotionCache = function useEmotionCache() {
return (0,external_React_.useContext)(EmotionCacheContext);
};
var emotion_element_6a883da9_browser_esm_withEmotionCache = function withEmotionCache(func) {
// $FlowFixMe
return /*#__PURE__*/(0,external_React_.forwardRef)(function (props, ref) {
// the cache will never be null in the browser
var cache = (0,external_React_.useContext)(EmotionCacheContext);
return func(props, cache, ref);
});
};
var emotion_element_6a883da9_browser_esm_ThemeContext = /* #__PURE__ */(0,external_React_.createContext)({});
if (false) {}
var useTheme = function useTheme() {
return useContext(emotion_element_6a883da9_browser_esm_ThemeContext);
};
var getTheme = function getTheme(outerTheme, theme) {
if (typeof theme === 'function') {
var mergedTheme = theme(outerTheme);
if (false) {}
return mergedTheme;
}
if (false) {}
return _extends({}, outerTheme, theme);
};
var createCacheWithTheme = /* #__PURE__ */(/* unused pure expression or super */ null && (weakMemoize(function (outerTheme) {
return weakMemoize(function (theme) {
return getTheme(outerTheme, theme);
});
})));
var ThemeProvider = function ThemeProvider(props) {
var theme = useContext(emotion_element_6a883da9_browser_esm_ThemeContext);
if (props.theme !== theme) {
theme = createCacheWithTheme(theme)(props.theme);
}
return /*#__PURE__*/createElement(emotion_element_6a883da9_browser_esm_ThemeContext.Provider, {
value: theme
}, props.children);
};
function withTheme(Component) {
var componentName = Component.displayName || Component.name || 'Component';
var render = function render(props, ref) {
var theme = useContext(emotion_element_6a883da9_browser_esm_ThemeContext);
return /*#__PURE__*/createElement(Component, _extends({
theme: theme,
ref: ref
}, props));
}; // $FlowFixMe
var WithTheme = /*#__PURE__*/forwardRef(render);
WithTheme.displayName = "WithTheme(" + componentName + ")";
return hoistNonReactStatics(WithTheme, Component);
}
var getLastPart = function getLastPart(functionName) {
// The match may be something like 'Object.createEmotionProps' or
// 'Loader.prototype.render'
var parts = functionName.split('.');
return parts[parts.length - 1];
};
var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {
// V8
var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line);
if (match) return getLastPart(match[1]); // Safari / Firefox
match = /^([A-Za-z0-9$.]+)@/.exec(line);
if (match) return getLastPart(match[1]);
return undefined;
};
var internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS
// identifiers, thus we only need to replace what is a valid character for JS,
// but not for CSS.
var sanitizeIdentifier = function sanitizeIdentifier(identifier) {
return identifier.replace(/\$/g, '-');
};
var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {
if (!stackTrace) return undefined;
var lines = stackTrace.split('\n');
for (var i = 0; i < lines.length; i++) {
var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just "Error"
if (!functionName) continue; // If we reach one of these, we have gone too far and should quit
if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an
// uppercase letter
if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);
}
return undefined;
};
var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
var emotion_element_6a883da9_browser_esm_createEmotionProps = function createEmotionProps(type, props) {
if (false) {}
var newProps = {};
for (var key in props) {
if (emotion_element_6a883da9_browser_esm_hasOwnProperty.call(props, key)) {
newProps[key] = props[key];
}
}
newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when
// the label hasn't already been computed
if (false) { var label; }
return newProps;
};
var Insertion = function Insertion(_ref) {
var cache = _ref.cache,
serialized = _ref.serialized,
isStringTag = _ref.isStringTag;
registerStyles(cache, serialized, isStringTag);
var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
return insertStyles(cache, serialized, isStringTag);
});
return null;
};
var emotion_element_6a883da9_browser_esm_Emotion = /* #__PURE__ */(/* unused pure expression or super */ null && (emotion_element_6a883da9_browser_esm_withEmotionCache(function (props, cache, ref) {
var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
// not passing the registered cache to serializeStyles because it would
// make certain babel optimisations not possible
if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {
cssProp = cache.registered[cssProp];
}
var WrappedComponent = props[typePropName];
var registeredStyles = [cssProp];
var className = '';
if (typeof props.className === 'string') {
className = getRegisteredStyles(cache.registered, registeredStyles, props.className);
} else if (props.className != null) {
className = props.className + " ";
}
var serialized = serializeStyles(registeredStyles, undefined, useContext(emotion_element_6a883da9_browser_esm_ThemeContext));
if (false) { var labelFromStack; }
className += cache.key + "-" + serialized.name;
var newProps = {};
for (var key in props) {
if (emotion_element_6a883da9_browser_esm_hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( true || 0)) {
newProps[key] = props[key];
}
}
newProps.ref = ref;
newProps.className = className;
return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, {
cache: cache,
serialized: serialized,
isStringTag: typeof WrappedComponent === 'string'
}), /*#__PURE__*/createElement(WrappedComponent, newProps));
})));
if (false) {}
;// ./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js
var isBrowser = "object" !== 'undefined';
function emotion_utils_browser_esm_getRegisteredStyles(registered, registeredStyles, classNames) {
var rawClassName = '';
classNames.split(' ').forEach(function (className) {
if (registered[className] !== undefined) {
registeredStyles.push(registered[className] + ";");
} else {
rawClassName += className + " ";
}
});
return rawClassName;
}
var emotion_utils_browser_esm_registerStyles = function registerStyles(cache, serialized, isStringTag) {
var className = cache.key + "-" + serialized.name;
if ( // we only need to add the styles to the registered cache if the
// class name could be used further down
// the tree but if it's a string tag, we know it won't
// so we don't have to add it to registered cache.
// this improves memory usage since we can avoid storing the whole style string
(isStringTag === false || // we need to always store it if we're in compat mode and
// in node since emotion-server relies on whether a style is in
// the registered cache to know whether a style is global or not
// also, note that this check will be dead code eliminated in the browser
isBrowser === false ) && cache.registered[className] === undefined) {
cache.registered[className] = serialized.styles;
}
};
var emotion_utils_browser_esm_insertStyles = function insertStyles(cache, serialized, isStringTag) {
emotion_utils_browser_esm_registerStyles(cache, serialized, isStringTag);
var className = cache.key + "-" + serialized.name;
if (cache.inserted[serialized.name] === undefined) {
var current = serialized;
do {
var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
current = current.next;
} while (current !== undefined);
}
};
;// ./node_modules/@emotion/css/create-instance/dist/emotion-css-create-instance.esm.js
function insertWithoutScoping(cache, serialized) {
if (cache.inserted[serialized.name] === undefined) {
return cache.insert('', serialized, cache.sheet, true);
}
}
function merge(registered, css, className) {
var registeredStyles = [];
var rawClassName = emotion_utils_browser_esm_getRegisteredStyles(registered, registeredStyles, className);
if (registeredStyles.length < 2) {
return className;
}
return rawClassName + css(registeredStyles);
}
var createEmotion = function createEmotion(options) {
var cache = emotion_cache_browser_esm(options); // $FlowFixMe
cache.sheet.speedy = function (value) {
if (false) {}
this.isSpeedy = value;
};
cache.compat = true;
var css = function css() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var serialized = emotion_serialize_browser_esm_serializeStyles(args, cache.registered, undefined);
emotion_utils_browser_esm_insertStyles(cache, serialized, false);
return cache.key + "-" + serialized.name;
};
var keyframes = function keyframes() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
var serialized = emotion_serialize_browser_esm_serializeStyles(args, cache.registered);
var animation = "animation-" + serialized.name;
insertWithoutScoping(cache, {
name: serialized.name,
styles: "@keyframes " + animation + "{" + serialized.styles + "}"
});
return animation;
};
var injectGlobal = function injectGlobal() {
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
var serialized = emotion_serialize_browser_esm_serializeStyles(args, cache.registered);
insertWithoutScoping(cache, serialized);
};
var cx = function cx() {
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
args[_key4] = arguments[_key4];
}
return merge(cache.registered, css, classnames(args));
};
return {
css: css,
cx: cx,
injectGlobal: injectGlobal,
keyframes: keyframes,
hydrate: function hydrate(ids) {
ids.forEach(function (key) {
cache.inserted[key] = true;
});
},
flush: function flush() {
cache.registered = {};
cache.inserted = {};
cache.sheet.flush();
},
// $FlowFixMe
sheet: cache.sheet,
cache: cache,
getRegisteredStyles: emotion_utils_browser_esm_getRegisteredStyles.bind(null, cache.registered),
merge: merge.bind(null, cache.registered, css)
};
};
var classnames = function classnames(args) {
var cls = '';
for (var i = 0; i < args.length; i++) {
var arg = args[i];
if (arg == null) continue;
var toAdd = void 0;
switch (typeof arg) {
case 'boolean':
break;
case 'object':
{
if (Array.isArray(arg)) {
toAdd = classnames(arg);
} else {
toAdd = '';
for (var k in arg) {
if (arg[k] && k) {
toAdd && (toAdd += ' ');
toAdd += k;
}
}
}
break;
}
default:
{
toAdd = arg;
}
}
if (toAdd) {
cls && (cls += ' ');
cls += toAdd;
}
}
return cls;
};
/* harmony default export */ const emotion_css_create_instance_esm = (createEmotion);
;// ./node_modules/@emotion/css/dist/emotion-css.esm.js
var _createEmotion = emotion_css_create_instance_esm({
key: 'css'
}),
flush = _createEmotion.flush,
hydrate = _createEmotion.hydrate,
emotion_css_esm_cx = _createEmotion.cx,
emotion_css_esm_merge = _createEmotion.merge,
emotion_css_esm_getRegisteredStyles = _createEmotion.getRegisteredStyles,
injectGlobal = _createEmotion.injectGlobal,
keyframes = _createEmotion.keyframes,
emotion_css_esm_css = _createEmotion.css,
sheet = _createEmotion.sheet,
cache = _createEmotion.cache;
;// ./node_modules/@wordpress/components/build-module/utils/hooks/use-cx.js
const isSerializedStyles = (o) => typeof o !== "undefined" && o !== null && ["name", "styles"].every((p) => typeof o[p] !== "undefined");
const useCx = () => {
const cache = __unsafe_useEmotionCache();
const cx = (0,external_wp_element_namespaceObject.useCallback)((...classNames) => {
if (cache === null) {
throw new Error("The `useCx` hook should be only used within a valid Emotion Cache Context");
}
return emotion_css_esm_cx(...classNames.map((arg) => {
if (isSerializedStyles(arg)) {
emotion_utils_browser_esm_insertStyles(cache, arg, false);
return `${cache.key}-${arg.name}`;
}
return arg;
}));
}, [cache]);
return cx;
};
;// ./node_modules/@wordpress/components/build-module/context/use-context-system.js
function useContextSystem(props, namespace) {
const contextSystemProps = useComponentsContext();
if (typeof namespace === "undefined") {
true ? external_wp_warning_default()("useContextSystem: Please provide a namespace") : 0;
}
const contextProps = contextSystemProps?.[namespace] || {};
const finalComponentProps = {
...getConnectedNamespace(),
...getNamespace(namespace)
};
const {
_overrides: overrideProps,
...otherContextProps
} = contextProps;
const initialMergedProps = Object.entries(otherContextProps).length ? Object.assign({}, otherContextProps, props) : props;
const cx = useCx();
const classes = cx(getStyledClassNameFromKey(namespace), props.className);
const rendered = typeof initialMergedProps.renderChildren === "function" ? initialMergedProps.renderChildren(initialMergedProps) : initialMergedProps.children;
for (const key in initialMergedProps) {
finalComponentProps[key] = initialMergedProps[key];
}
for (const key in overrideProps) {
finalComponentProps[key] = overrideProps[key];
}
if (rendered !== void 0) {
finalComponentProps.children = rendered;
}
finalComponentProps.className = classes;
return finalComponentProps;
}
;// ./node_modules/@wordpress/components/build-module/context/context-connect.js
function contextConnect(Component, namespace) {
return _contextConnect(Component, namespace, {
forwardsRef: true
});
}
function contextConnectWithoutRef(Component, namespace) {
return _contextConnect(Component, namespace);
}
function _contextConnect(Component, namespace, options) {
const WrappedComponent = options?.forwardsRef ? (0,external_wp_element_namespaceObject.forwardRef)(Component) : Component;
if (typeof namespace === "undefined") {
true ? external_wp_warning_default()("contextConnect: Please provide a namespace") : 0;
}
let mergedNamespace = WrappedComponent[CONNECT_STATIC_NAMESPACE] || [namespace];
if (Array.isArray(namespace)) {
mergedNamespace = [...mergedNamespace, ...namespace];
}
if (typeof namespace === "string") {
mergedNamespace = [...mergedNamespace, namespace];
}
return Object.assign(WrappedComponent, {
[CONNECT_STATIC_NAMESPACE]: [...new Set(mergedNamespace)],
displayName: namespace,
selector: `.${getStyledClassNameFromKey(namespace)}`
});
}
function getConnectNamespace(Component) {
if (!Component) {
return [];
}
let namespaces = [];
if (Component[CONNECT_STATIC_NAMESPACE]) {
namespaces = Component[CONNECT_STATIC_NAMESPACE];
}
if (Component.type && Component.type[CONNECT_STATIC_NAMESPACE]) {
namespaces = Component.type[CONNECT_STATIC_NAMESPACE];
}
return namespaces;
}
function hasConnectNamespace(Component, match) {
if (!Component) {
return false;
}
if (typeof match === "string") {
return getConnectNamespace(Component).includes(match);
}
if (Array.isArray(match)) {
return match.some((result) => getConnectNamespace(Component).includes(result));
}
return false;
}
;// ./node_modules/@wordpress/components/build-module/visually-hidden/styles.js
const visuallyHidden = {
border: 0,
clip: "rect(1px, 1px, 1px, 1px)",
WebkitClipPath: "inset( 50% )",
clipPath: "inset( 50% )",
height: "1px",
margin: "-1px",
overflow: "hidden",
padding: 0,
position: "absolute",
width: "1px",
wordWrap: "normal"
};
;// ./node_modules/@babel/runtime/helpers/esm/extends.js
function extends_extends() {
return extends_extends = Object.assign ? Object.assign.bind() : function (n) {
for (var e = 1; e < arguments.length; e++) {
var t = arguments[e];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
}
return n;
}, extends_extends.apply(null, arguments);
}
;// ./node_modules/@emotion/styled/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|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|enterKeyHint|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|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|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
var isPropValid = /* #__PURE__ */memoize(function (prop) {
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
/* o */
&& prop.charCodeAt(1) === 110
/* n */
&& prop.charCodeAt(2) < 91;
}
/* Z+1 */
);
;// ./node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js
var testOmitPropsOnStringTag = isPropValid;
var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
return key !== 'theme';
};
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
return typeof tag === 'string' && // 96 is one less than the char code
// for "a" so this is checking that
// it's a lowercase character
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
};
var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
var shouldForwardProp;
if (options) {
var optionsShouldForwardProp = options.shouldForwardProp;
shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
} : optionsShouldForwardProp;
}
if (typeof shouldForwardProp !== 'function' && isReal) {
shouldForwardProp = tag.__emotion_forwardProp;
}
return shouldForwardProp;
};
var emotion_styled_base_browser_esm_ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
var emotion_styled_base_browser_esm_Insertion = function Insertion(_ref) {
var cache = _ref.cache,
serialized = _ref.serialized,
isStringTag = _ref.isStringTag;
emotion_utils_browser_esm_registerStyles(cache, serialized, isStringTag);
var rules = emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectAlwaysWithSyncFallback(function () {
return emotion_utils_browser_esm_insertStyles(cache, serialized, isStringTag);
});
return null;
};
var createStyled = function createStyled(tag, options) {
if (false) {}
var isReal = tag.__emotion_real === tag;
var baseTag = isReal && tag.__emotion_base || tag;
var identifierName;
var targetClassName;
if (options !== undefined) {
identifierName = options.label;
targetClassName = options.target;
}
var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
var shouldUseAs = !defaultShouldForwardProp('as');
return function () {
var args = arguments;
var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
if (identifierName !== undefined) {
styles.push("label:" + identifierName + ";");
}
if (args[0] == null || args[0].raw === undefined) {
styles.push.apply(styles, args);
} else {
if (false) {}
styles.push(args[0][0]);
var len = args.length;
var i = 1;
for (; i < len; i++) {
if (false) {}
styles.push(args[i], args[0][i]);
}
} // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
var Styled = emotion_element_6a883da9_browser_esm_withEmotionCache(function (props, cache, ref) {
var FinalTag = shouldUseAs && props.as || baseTag;
var className = '';
var classInterpolations = [];
var mergedProps = props;
if (props.theme == null) {
mergedProps = {};
for (var key in props) {
mergedProps[key] = props[key];
}
mergedProps.theme = (0,external_React_.useContext)(emotion_element_6a883da9_browser_esm_ThemeContext);
}
if (typeof props.className === 'string') {
className = emotion_utils_browser_esm_getRegisteredStyles(cache.registered, classInterpolations, props.className);
} else if (props.className != null) {
className = props.className + " ";
}
var serialized = emotion_serialize_browser_esm_serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
className += cache.key + "-" + serialized.name;
if (targetClassName !== undefined) {
className += " " + targetClassName;
}
var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
var newProps = {};
for (var _key in props) {
if (shouldUseAs && _key === 'as') continue;
if ( // $FlowFixMe
finalShouldForwardProp(_key)) {
newProps[_key] = props[_key];
}
}
newProps.className = className;
newProps.ref = ref;
return /*#__PURE__*/(0,external_React_.createElement)(external_React_.Fragment, null, /*#__PURE__*/(0,external_React_.createElement)(emotion_styled_base_browser_esm_Insertion, {
cache: cache,
serialized: serialized,
isStringTag: typeof FinalTag === 'string'
}), /*#__PURE__*/(0,external_React_.createElement)(FinalTag, newProps));
});
Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
Styled.defaultProps = tag.defaultProps;
Styled.__emotion_real = Styled;
Styled.__emotion_base = baseTag;
Styled.__emotion_styles = styles;
Styled.__emotion_forwardProp = shouldForwardProp;
Object.defineProperty(Styled, 'toString', {
value: function value() {
if (targetClassName === undefined && "production" !== 'production') {} // $FlowFixMe: coerce undefined to string
return "." + targetClassName;
}
});
Styled.withComponent = function (nextTag, nextOptions) {
return createStyled(nextTag, extends_extends({}, options, nextOptions, {
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
})).apply(void 0, styles);
};
return Styled;
};
};
/* harmony default export */ const emotion_styled_base_browser_esm = (createStyled);
;// ./node_modules/@wordpress/components/build-module/view/component.js
const PolymorphicDiv = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e19lxcc00"
} : 0)( true ? "" : 0);
function UnforwardedView({
as,
...restProps
}, ref) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PolymorphicDiv, {
as,
ref,
...restProps
});
}
const View = Object.assign((0,external_wp_element_namespaceObject.forwardRef)(UnforwardedView), {
selector: ".components-view"
});
var component_default = View;
;// ./node_modules/@wordpress/components/build-module/visually-hidden/component.js
function UnconnectedVisuallyHidden(props, forwardedRef) {
const {
style: styleProp,
...contextProps
} = useContextSystem(props, "VisuallyHidden");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
ref: forwardedRef,
...contextProps,
style: {
...visuallyHidden,
...styleProp || {}
}
});
}
const component_VisuallyHidden = contextConnect(UnconnectedVisuallyHidden, "VisuallyHidden");
var component_component_default = component_VisuallyHidden;
;// ./node_modules/@wordpress/components/build-module/alignment-matrix-control/utils.js
const GRID = [["top left", "top center", "top right"], ["center left", "center center", "center right"], ["bottom left", "bottom center", "bottom right"]];
const ALIGNMENT_LABEL = {
"top left": (0,external_wp_i18n_namespaceObject.__)("Top Left"),
"top center": (0,external_wp_i18n_namespaceObject.__)("Top Center"),
"top right": (0,external_wp_i18n_namespaceObject.__)("Top Right"),
"center left": (0,external_wp_i18n_namespaceObject.__)("Center Left"),
"center center": (0,external_wp_i18n_namespaceObject.__)("Center"),
center: (0,external_wp_i18n_namespaceObject.__)("Center"),
"center right": (0,external_wp_i18n_namespaceObject.__)("Center Right"),
"bottom left": (0,external_wp_i18n_namespaceObject.__)("Bottom Left"),
"bottom center": (0,external_wp_i18n_namespaceObject.__)("Bottom Center"),
"bottom right": (0,external_wp_i18n_namespaceObject.__)("Bottom Right")
};
const ALIGNMENTS = GRID.flat();
function normalize(value) {
const normalized = value === "center" ? "center center" : value;
const transformed = normalized?.replace("-", " ");
return ALIGNMENTS.includes(transformed) ? transformed : void 0;
}
function getItemId(prefixId, value) {
const normalized = normalize(value);
if (!normalized) {
return;
}
const id = normalized.replace(" ", "-");
return `${prefixId}-${id}`;
}
function getItemValue(prefixId, id) {
const value = id?.replace(prefixId + "-", "");
return normalize(value);
}
function getAlignmentIndex(alignment = "center") {
const normalized = normalize(alignment);
if (!normalized) {
return void 0;
}
const index = ALIGNMENTS.indexOf(normalized);
return index > -1 ? index : void 0;
}
// EXTERNAL MODULE: ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
var hoist_non_react_statics_cjs = __webpack_require__(1880);
;// ./node_modules/@emotion/react/dist/emotion-react.browser.esm.js
var pkg = {
name: "@emotion/react",
version: "11.10.6",
main: "dist/emotion-react.cjs.js",
module: "dist/emotion-react.esm.js",
browser: {
"./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js"
},
exports: {
".": {
module: {
worker: "./dist/emotion-react.worker.esm.js",
browser: "./dist/emotion-react.browser.esm.js",
"default": "./dist/emotion-react.esm.js"
},
"default": "./dist/emotion-react.cjs.js"
},
"./jsx-runtime": {
module: {
worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js",
browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js"
},
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
},
"./_isolated-hnrs": {
module: {
worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js",
browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js"
},
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
},
"./jsx-dev-runtime": {
module: {
worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js",
browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js"
},
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
},
"./package.json": "./package.json",
"./types/css-prop": "./types/css-prop.d.ts",
"./macro": "./macro.js"
},
types: "types/index.d.ts",
files: [
"src",
"dist",
"jsx-runtime",
"jsx-dev-runtime",
"_isolated-hnrs",
"types/*.d.ts",
"macro.js",
"macro.d.ts",
"macro.js.flow"
],
sideEffects: false,
author: "Emotion Contributors",
license: "MIT",
scripts: {
"test:typescript": "dtslint types"
},
dependencies: {
"@babel/runtime": "^7.18.3",
"@emotion/babel-plugin": "^11.10.6",
"@emotion/cache": "^11.10.5",
"@emotion/serialize": "^1.1.1",
"@emotion/use-insertion-effect-with-fallbacks": "^1.0.0",
"@emotion/utils": "^1.2.0",
"@emotion/weak-memoize": "^0.3.0",
"hoist-non-react-statics": "^3.3.1"
},
peerDependencies: {
react: ">=16.8.0"
},
peerDependenciesMeta: {
"@types/react": {
optional: true
}
},
devDependencies: {
"@definitelytyped/dtslint": "0.0.112",
"@emotion/css": "11.10.6",
"@emotion/css-prettifier": "1.1.1",
"@emotion/server": "11.10.0",
"@emotion/styled": "11.10.6",
"html-tag-names": "^1.1.2",
react: "16.14.0",
"svg-tag-names": "^1.1.1",
typescript: "^4.5.5"
},
repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
publishConfig: {
access: "public"
},
"umd:main": "dist/emotion-react.umd.min.js",
preconstruct: {
entrypoints: [
"./index.js",
"./jsx-runtime.js",
"./jsx-dev-runtime.js",
"./_isolated-hnrs.js"
],
umdName: "emotionReact",
exports: {
envConditions: [
"browser",
"worker"
],
extra: {
"./types/css-prop": "./types/css-prop.d.ts",
"./macro": "./macro.js"
}
}
}
};
var jsx = function jsx(type, props) {
var args = arguments;
if (props == null || !hasOwnProperty.call(props, 'css')) {
// $FlowFixMe
return createElement.apply(undefined, args);
}
var argsLength = args.length;
var createElementArgArray = new Array(argsLength);
createElementArgArray[0] = Emotion;
createElementArgArray[1] = createEmotionProps(type, props);
for (var i = 2; i < argsLength; i++) {
createElementArgArray[i] = args[i];
} // $FlowFixMe
return createElement.apply(null, createElementArgArray);
};
var warnedAboutCssPropForGlobal = false; // maintain place over rerenders.
// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
// initial client-side render from SSR, use place of hydrating tag
var Global = /* #__PURE__ */(/* unused pure expression or super */ null && (withEmotionCache(function (props, cache) {
if (false) {}
var styles = props.styles;
var serialized = serializeStyles([styles], undefined, useContext(ThemeContext));
// but it is based on a constant that will never change at runtime
// it's effectively like having two implementations and switching them out
// so it's not actually breaking anything
var sheetRef = useRef();
useInsertionEffectWithLayoutFallback(function () {
var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675
var sheet = new cache.sheet.constructor({
key: key,
nonce: cache.sheet.nonce,
container: cache.sheet.container,
speedy: cache.sheet.isSpeedy
});
var rehydrating = false; // $FlowFixMe
var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]");
if (cache.sheet.tags.length) {
sheet.before = cache.sheet.tags[0];
}
if (node !== null) {
rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other <Global/>s
node.setAttribute('data-emotion', key);
sheet.hydrate([node]);
}
sheetRef.current = [sheet, rehydrating];
return function () {
sheet.flush();
};
}, [cache]);
useInsertionEffectWithLayoutFallback(function () {
var sheetRefCurrent = sheetRef.current;
var sheet = sheetRefCurrent[0],
rehydrating = sheetRefCurrent[1];
if (rehydrating) {
sheetRefCurrent[1] = false;
return;
}
if (serialized.next !== undefined) {
// insert keyframes
insertStyles(cache, serialized.next, true);
}
if (sheet.tags.length) {
// if this doesn't exist then it will be null so the style element will be appended
var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
sheet.before = element;
sheet.flush();
}
cache.insert("", serialized, sheet, false);
}, [cache, serialized.name]);
return null;
})));
if (false) {}
function emotion_react_browser_esm_css() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return emotion_serialize_browser_esm_serializeStyles(args);
}
var emotion_react_browser_esm_keyframes = function keyframes() {
var insertable = emotion_react_browser_esm_css.apply(void 0, arguments);
var name = "animation-" + insertable.name; // $FlowFixMe
return {
name: name,
styles: "@keyframes " + name + "{" + insertable.styles + "}",
anim: 1,
toString: function toString() {
return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
}
};
};
var emotion_react_browser_esm_classnames = function classnames(args) {
var len = args.length;
var i = 0;
var cls = '';
for (; i < len; i++) {
var arg = args[i];
if (arg == null) continue;
var toAdd = void 0;
switch (typeof arg) {
case 'boolean':
break;
case 'object':
{
if (Array.isArray(arg)) {
toAdd = classnames(arg);
} else {
if (false) {}
toAdd = '';
for (var k in arg) {
if (arg[k] && k) {
toAdd && (toAdd += ' ');
toAdd += k;
}
}
}
break;
}
default:
{
toAdd = arg;
}
}
if (toAdd) {
cls && (cls += ' ');
cls += toAdd;
}
}
return cls;
};
function emotion_react_browser_esm_merge(registered, css, className) {
var registeredStyles = [];
var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
if (registeredStyles.length < 2) {
return className;
}
return rawClassName + css(registeredStyles);
}
var emotion_react_browser_esm_Insertion = function Insertion(_ref) {
var cache = _ref.cache,
serializedArr = _ref.serializedArr;
var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
for (var i = 0; i < serializedArr.length; i++) {
var res = insertStyles(cache, serializedArr[i], false);
}
});
return null;
};
var ClassNames = /* #__PURE__ */(/* unused pure expression or super */ null && (withEmotionCache(function (props, cache) {
var hasRendered = false;
var serializedArr = [];
var css = function css() {
if (hasRendered && "production" !== 'production') {}
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var serialized = serializeStyles(args, cache.registered);
serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`
registerStyles(cache, serialized, false);
return cache.key + "-" + serialized.name;
};
var cx = function cx() {
if (hasRendered && "production" !== 'production') {}
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return emotion_react_browser_esm_merge(cache.registered, css, emotion_react_browser_esm_classnames(args));
};
var content = {
css: css,
cx: cx,
theme: useContext(ThemeContext)
};
var ele = props.children(content);
hasRendered = true;
return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(emotion_react_browser_esm_Insertion, {
cache: cache,
serializedArr: serializedArr
}), ele);
})));
if (false) {}
if (false) { var globalKey, globalContext, isTestEnv, emotion_react_browser_esm_isBrowser; }
;// ./node_modules/@wordpress/components/build-module/utils/space.js
const GRID_BASE = "4px";
function space(value) {
if (typeof value === "undefined") {
return void 0;
}
if (!value) {
return "0";
}
const asInt = typeof value === "number" ? value : Number(value);
if (typeof window !== "undefined" && window.CSS?.supports?.("margin", value.toString()) || Number.isNaN(asInt)) {
return value.toString();
}
return `calc(${GRID_BASE} * ${value})`;
}
;// ./node_modules/@wordpress/components/build-module/utils/colors-values.js
const white = "#fff";
const GRAY = {
900: "#1e1e1e",
800: "#2f2f2f",
/** Meets 4.6:1 text contrast against white. */
700: "#757575",
/** Meets 3:1 UI or large text contrast against white. */
600: "#949494",
400: "#ccc",
/** Used for most borders. */
300: "#ddd",
/** Used sparingly for light borders. */
200: "#e0e0e0",
/** Used for light gray backgrounds. */
100: "#f0f0f0"
};
const ALERT = {
yellow: "#f0b849",
red: "#d94f4f",
green: "#4ab866"
};
const THEME = {
accent: `var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9))`,
accentDarker10: `var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6))`,
accentDarker20: `var(--wp-components-color-accent-darker-20, var(--wp-admin-theme-color-darker-20, #183ad6))`,
/** Used when placing text on the accent color. */
accentInverted: `var(--wp-components-color-accent-inverted, ${white})`,
background: `var(--wp-components-color-background, ${white})`,
foreground: `var(--wp-components-color-foreground, ${GRAY[900]})`,
/** Used when placing text on the foreground color. */
foregroundInverted: `var(--wp-components-color-foreground-inverted, ${white})`,
gray: {
/** @deprecated Use `COLORS.theme.foreground` instead. */
900: `var(--wp-components-color-foreground, ${GRAY[900]})`,
800: `var(--wp-components-color-gray-800, ${GRAY[800]})`,
700: `var(--wp-components-color-gray-700, ${GRAY[700]})`,
600: `var(--wp-components-color-gray-600, ${GRAY[600]})`,
400: `var(--wp-components-color-gray-400, ${GRAY[400]})`,
300: `var(--wp-components-color-gray-300, ${GRAY[300]})`,
200: `var(--wp-components-color-gray-200, ${GRAY[200]})`,
100: `var(--wp-components-color-gray-100, ${GRAY[100]})`
}
};
const UI = {
background: THEME.background,
backgroundDisabled: THEME.gray[100],
border: THEME.gray[600],
borderHover: THEME.gray[700],
borderFocus: THEME.accent,
borderDisabled: THEME.gray[400],
textDisabled: THEME.gray[600],
// Matches @wordpress/base-styles
darkGrayPlaceholder: `color-mix(in srgb, ${THEME.foreground}, transparent 38%)`,
lightGrayPlaceholder: `color-mix(in srgb, ${THEME.background}, transparent 35%)`
};
const COLORS = Object.freeze({
/**
* The main gray color object.
*
* @deprecated Use semantic aliases in `COLORS.ui` or theme-ready variables in `COLORS.theme.gray`.
*/
gray: GRAY,
// TODO: Stop exporting this when everything is migrated to `theme` or `ui`
/**
* @deprecated Prefer theme-ready variables in `COLORS.theme`.
*/
white,
alert: ALERT,
/**
* Theme-ready variables with fallbacks.
*
* Prefer semantic aliases in `COLORS.ui` when applicable.
*/
theme: THEME,
/**
* Semantic aliases (prefer these over raw variables when applicable).
*/
ui: UI
});
var colors_values_default = (/* unused pure expression or super */ null && (COLORS));
;// ./node_modules/@wordpress/components/build-module/utils/config-values.js
const CONTROL_HEIGHT = "36px";
const CONTROL_PROPS = {
// These values should be shared with TextControl.
controlPaddingX: 12,
controlPaddingXSmall: 8,
controlPaddingXLarge: 12 * 1.3334,
// TODO: Deprecate
controlBoxShadowFocus: `0 0 0 0.5px ${COLORS.theme.accent}`,
controlHeight: CONTROL_HEIGHT,
controlHeightXSmall: `calc( ${CONTROL_HEIGHT} * 0.6 )`,
controlHeightSmall: `calc( ${CONTROL_HEIGHT} * 0.8 )`,
controlHeightLarge: `calc( ${CONTROL_HEIGHT} * 1.2 )`,
controlHeightXLarge: `calc( ${CONTROL_HEIGHT} * 1.4 )`
};
var config_values_default = Object.assign({}, CONTROL_PROPS, {
colorDivider: "rgba(0, 0, 0, 0.1)",
colorScrollbarThumb: "rgba(0, 0, 0, 0.2)",
colorScrollbarThumbHover: "rgba(0, 0, 0, 0.5)",
colorScrollbarTrack: "rgba(0, 0, 0, 0.04)",
elevationIntensity: 1,
radiusXSmall: "1px",
radiusSmall: "2px",
radiusMedium: "4px",
radiusLarge: "8px",
radiusFull: "9999px",
radiusRound: "50%",
borderWidth: "1px",
borderWidthFocus: "1.5px",
borderWidthTab: "4px",
spinnerSize: 16,
fontSize: "13px",
fontSizeH1: "calc(2.44 * 13px)",
fontSizeH2: "calc(1.95 * 13px)",
fontSizeH3: "calc(1.56 * 13px)",
fontSizeH4: "calc(1.25 * 13px)",
fontSizeH5: "13px",
fontSizeH6: "calc(0.8 * 13px)",
fontSizeInputMobile: "16px",
fontSizeMobile: "15px",
fontSizeSmall: "calc(0.92 * 13px)",
fontSizeXSmall: "calc(0.75 * 13px)",
fontLineHeightBase: "1.4",
fontWeight: "normal",
fontWeightHeading: "600",
gridBase: "4px",
cardPaddingXSmall: `${space(2)}`,
cardPaddingSmall: `${space(4)}`,
cardPaddingMedium: `${space(4)} ${space(6)}`,
cardPaddingLarge: `${space(6)} ${space(8)}`,
elevationXSmall: `0 1px 1px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02), 0 3px 3px rgba(0, 0, 0, 0.02), 0 4px 4px rgba(0, 0, 0, 0.01)`,
elevationSmall: `0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.04), 0 6px 6px rgba(0, 0, 0, 0.03), 0 8px 8px rgba(0, 0, 0, 0.02)`,
elevationMedium: `0 2px 3px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.04), 0 12px 12px rgba(0, 0, 0, 0.03), 0 16px 16px rgba(0, 0, 0, 0.02)`,
elevationLarge: `0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 27px rgba(0, 0, 0, 0.07), 0 30px 36px rgba(0, 0, 0, 0.04), 0 50px 43px rgba(0, 0, 0, 0.02)`,
surfaceBackgroundColor: COLORS.white,
surfaceBackgroundSubtleColor: "#F3F3F3",
surfaceBackgroundTintColor: "#F5F5F5",
surfaceBorderColor: "rgba(0, 0, 0, 0.1)",
surfaceBorderBoldColor: "rgba(0, 0, 0, 0.15)",
surfaceBorderSubtleColor: "rgba(0, 0, 0, 0.05)",
surfaceBackgroundTertiaryColor: COLORS.white,
surfaceColor: COLORS.white,
transitionDuration: "200ms",
transitionDurationFast: "160ms",
transitionDurationFaster: "120ms",
transitionDurationFastest: "100ms",
transitionTimingFunction: "cubic-bezier(0.08, 0.52, 0.52, 1)",
transitionTimingFunctionControl: "cubic-bezier(0.12, 0.8, 0.32, 1)"
});
;// ./node_modules/@wordpress/components/build-module/alignment-matrix-control/styles.js
function _EMOTION_STRINGIFIED_CSS_ERROR__() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const rootBase = ({
size = 92
}) => /* @__PURE__ */ emotion_react_browser_esm_css("direction:ltr;display:grid;grid-template-columns:repeat( 3, 1fr );grid-template-rows:repeat( 3, 1fr );box-sizing:border-box;width:", size, "px;aspect-ratio:1;border-radius:", config_values_default.radiusMedium, ";outline:none;" + ( true ? "" : 0), true ? "" : 0);
var _ref = true ? {
name: "e0dnmk",
styles: "cursor:pointer"
} : 0;
const GridContainer = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e1r95csn3"
} : 0)(rootBase, " border:1px solid transparent;", (props) => props.disablePointerEvents ? /* @__PURE__ */ emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0) : _ref, ";" + ( true ? "" : 0));
const GridRow = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e1r95csn2"
} : 0)( true ? {
name: "1fbxn64",
styles: "grid-column:1/-1;box-sizing:border-box;display:grid;grid-template-columns:repeat( 3, 1fr )"
} : 0);
const Cell = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1r95csn1"
} : 0)( true ? {
name: "e2kws5",
styles: "position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;margin:0;padding:0;appearance:none;border:none;outline:none"
} : 0);
const POINT_SIZE = 6;
const Point = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1r95csn0"
} : 0)("display:block;contain:strict;box-sizing:border-box;width:", POINT_SIZE, "px;aspect-ratio:1;margin:auto;color:", COLORS.theme.gray[400], ";border:", POINT_SIZE / 2, "px solid currentColor;", Cell, "[data-active-item] &{color:", COLORS.gray[900], ";transform:scale( calc( 5 / 3 ) );}", Cell, ":not([data-active-item]):hover &{color:", COLORS.theme.accent, ";}", Cell, "[data-focus-visible] &{outline:1px solid ", COLORS.theme.accent, ";outline-offset:1px;}@media not ( prefers-reduced-motion ){transition-property:color,transform;transition-duration:120ms;transition-timing-function:linear;}" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/alignment-matrix-control/cell.js
function cell_Cell({
id,
value,
...props
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip_default, {
text: ALIGNMENT_LABEL[value],
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(composite_Composite.Item, {
id,
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Cell, {
...props,
role: "gridcell"
}),
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
children: value
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Point, {
role: "presentation"
})]
})
});
}
;// ./node_modules/@wordpress/components/build-module/alignment-matrix-control/icon.js
const BASE_SIZE = 24;
const GRID_CELL_SIZE = 7;
const GRID_PADDING = (BASE_SIZE - 3 * GRID_CELL_SIZE) / 2;
const DOT_SIZE = 2;
const DOT_SIZE_SELECTED = 4;
function AlignmentMatrixControlIcon({
className,
disablePointerEvents = true,
size,
width,
height,
style = {},
value = "center",
...props
}) {
var _ref, _ref2;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: `0 0 ${BASE_SIZE} ${BASE_SIZE}`,
width: (_ref = size !== null && size !== void 0 ? size : width) !== null && _ref !== void 0 ? _ref : BASE_SIZE,
height: (_ref2 = size !== null && size !== void 0 ? size : height) !== null && _ref2 !== void 0 ? _ref2 : BASE_SIZE,
role: "presentation",
className: dist_clsx("component-alignment-matrix-control-icon", className),
style: {
pointerEvents: disablePointerEvents ? "none" : void 0,
...style
},
...props,
children: ALIGNMENTS.map((align, index) => {
const dotSize = getAlignmentIndex(value) === index ? DOT_SIZE_SELECTED : DOT_SIZE;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Rect, {
x: GRID_PADDING + index % 3 * GRID_CELL_SIZE + (GRID_CELL_SIZE - dotSize) / 2,
y: GRID_PADDING + Math.floor(index / 3) * GRID_CELL_SIZE + (GRID_CELL_SIZE - dotSize) / 2,
width: dotSize,
height: dotSize,
fill: "currentColor"
}, align);
})
});
}
var icon_default = AlignmentMatrixControlIcon;
;// ./node_modules/@wordpress/components/build-module/alignment-matrix-control/index.js
function UnforwardedAlignmentMatrixControl({
className,
id,
label = (0,external_wp_i18n_namespaceObject.__)("Alignment Matrix Control"),
defaultValue = "center center",
value,
onChange,
width = 92,
...props
}) {
const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(UnforwardedAlignmentMatrixControl, "alignment-matrix-control", id);
const setActiveId = (0,external_wp_element_namespaceObject.useCallback)((nextActiveId) => {
const nextValue = getItemValue(baseId, nextActiveId);
if (nextValue) {
onChange?.(nextValue);
}
}, [baseId, onChange]);
const classes = dist_clsx("component-alignment-matrix-control", className);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(composite_Composite, {
defaultActiveId: getItemId(baseId, defaultValue),
activeId: getItemId(baseId, value),
setActiveId,
rtl: (0,external_wp_i18n_namespaceObject.isRTL)(),
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GridContainer, {
...props,
"aria-label": label,
className: classes,
id: baseId,
role: "grid",
size: width
}),
children: GRID.map((cells, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(composite_Composite.Row, {
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GridRow, {
role: "row"
}),
children: cells.map((cell) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(cell_Cell, {
id: getItemId(baseId, cell),
value: cell
}, cell))
}, index))
});
}
const AlignmentMatrixControl = Object.assign(UnforwardedAlignmentMatrixControl, {
/**
* Render an alignment matrix as an icon.
*
* ```jsx
* import { AlignmentMatrixControl } from '@wordpress/components';
*
* <Icon icon={<AlignmentMatrixControl.Icon value="top left" />} />
* ```
*/
Icon: Object.assign(icon_default, {
displayName: "AlignmentMatrixControl.Icon"
})
});
var alignment_matrix_control_default = AlignmentMatrixControl;
;// ./node_modules/@wordpress/components/build-module/animate/index.js
function getDefaultOrigin(type) {
return type === "appear" ? "top" : "left";
}
function getAnimateClassName(options) {
if (options.type === "loading") {
return "components-animate__loading";
}
const {
type,
origin = getDefaultOrigin(type)
} = options;
if (type === "appear") {
const [yAxis, xAxis = "center"] = origin.split(" ");
return dist_clsx("components-animate__appear", {
["is-from-" + xAxis]: xAxis !== "center",
["is-from-" + yAxis]: yAxis !== "middle"
});
}
if (type === "slide-in") {
return dist_clsx("components-animate__slide-in", "is-from-" + origin);
}
return void 0;
}
function Animate({
type,
options = {},
children
}) {
return children({
className: getAnimateClassName({
type,
...options
})
});
}
var animate_default = Animate;
;// ./node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs
"use client";
const LayoutGroupContext = (0,external_React_.createContext)({});
;// ./node_modules/framer-motion/dist/es/utils/use-constant.mjs
/**
* Creates a constant value over the lifecycle of a component.
*
* Even if `useMemo` is provided an empty array as its final argument, it doesn't offer
* a guarantee that it won't re-run for performance reasons later on. By using `useConstant`
* you can ensure that initialisers don't execute twice or more.
*/
function useConstant(init) {
const ref = (0,external_React_.useRef)(null);
if (ref.current === null) {
ref.current = init();
}
return ref.current;
}
;// ./node_modules/framer-motion/dist/es/context/PresenceContext.mjs
"use client";
/**
* @public
*/
const PresenceContext_PresenceContext = (0,external_React_.createContext)(null);
;// ./node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs
"use client";
/**
* @public
*/
const MotionConfigContext = (0,external_React_.createContext)({
transformPagePoint: (p) => p,
isStatic: false,
reducedMotion: "never",
});
;// ./node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs
"use client";
/**
* Measurement functionality has to be within a separate component
* to leverage snapshot lifecycle.
*/
class PopChildMeasure extends external_React_.Component {
getSnapshotBeforeUpdate(prevProps) {
const element = this.props.childRef.current;
if (element && prevProps.isPresent && !this.props.isPresent) {
const size = this.props.sizeRef.current;
size.height = element.offsetHeight || 0;
size.width = element.offsetWidth || 0;
size.top = element.offsetTop;
size.left = element.offsetLeft;
}
return null;
}
/**
* Required with getSnapshotBeforeUpdate to stop React complaining.
*/
componentDidUpdate() { }
render() {
return this.props.children;
}
}
function PopChild({ children, isPresent }) {
const id = (0,external_React_.useId)();
const ref = (0,external_React_.useRef)(null);
const size = (0,external_React_.useRef)({
width: 0,
height: 0,
top: 0,
left: 0,
});
const { nonce } = (0,external_React_.useContext)(MotionConfigContext);
/**
* We create and inject a style block so we can apply this explicit
* sizing in a non-destructive manner by just deleting the style block.
*
* We can't apply size via render as the measurement happens
* in getSnapshotBeforeUpdate (post-render), likewise if we apply the
* styles directly on the DOM node, we might be overwriting
* styles set via the style prop.
*/
(0,external_React_.useInsertionEffect)(() => {
const { width, height, top, left } = size.current;
if (isPresent || !ref.current || !width || !height)
return;
ref.current.dataset.motionPopId = id;
const style = document.createElement("style");
if (nonce)
style.nonce = nonce;
document.head.appendChild(style);
if (style.sheet) {
style.sheet.insertRule(`
[data-motion-pop-id="${id}"] {
position: absolute !important;
width: ${width}px !important;
height: ${height}px !important;
top: ${top}px !important;
left: ${left}px !important;
}
`);
}
return () => {
document.head.removeChild(style);
};
}, [isPresent]);
return ((0,external_ReactJSXRuntime_namespaceObject.jsx)(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: external_React_.cloneElement(children, { ref }) }));
}
;// ./node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs
"use client";
const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, }) => {
const presenceChildren = useConstant(newChildrenMap);
const id = (0,external_React_.useId)();
const memoizedOnExitComplete = (0,external_React_.useCallback)((childId) => {
presenceChildren.set(childId, true);
for (const isComplete of presenceChildren.values()) {
if (!isComplete)
return; // can stop searching when any is incomplete
}
onExitComplete && onExitComplete();
}, [presenceChildren, onExitComplete]);
const context = (0,external_React_.useMemo)(() => ({
id,
initial,
isPresent,
custom,
onExitComplete: memoizedOnExitComplete,
register: (childId) => {
presenceChildren.set(childId, false);
return () => presenceChildren.delete(childId);
},
}),
/**
* If the presence of a child affects the layout of the components around it,
* we want to make a new context value to ensure they get re-rendered
* so they can detect that layout change.
*/
presenceAffectsLayout
? [Math.random(), memoizedOnExitComplete]
: [isPresent, memoizedOnExitComplete]);
(0,external_React_.useMemo)(() => {
presenceChildren.forEach((_, key) => presenceChildren.set(key, false));
}, [isPresent]);
/**
* If there's no `motion` components to fire exit animations, we want to remove this
* component immediately.
*/
external_React_.useEffect(() => {
!isPresent &&
!presenceChildren.size &&
onExitComplete &&
onExitComplete();
}, [isPresent]);
if (mode === "popLayout") {
children = (0,external_ReactJSXRuntime_namespaceObject.jsx)(PopChild, { isPresent: isPresent, children: children });
}
return ((0,external_ReactJSXRuntime_namespaceObject.jsx)(PresenceContext_PresenceContext.Provider, { value: context, children: children }));
};
function newChildrenMap() {
return new Map();
}
;// ./node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs
/**
* When a component is the child of `AnimatePresence`, it can use `usePresence`
* to access information about whether it's still present in the React tree.
*
* ```jsx
* import { usePresence } from "framer-motion"
*
* export const Component = () => {
* const [isPresent, safeToRemove] = usePresence()
*
* useEffect(() => {
* !isPresent && setTimeout(safeToRemove, 1000)
* }, [isPresent])
*
* return <div />
* }
* ```
*
* If `isPresent` is `false`, it means that a component has been removed the tree, but
* `AnimatePresence` won't really remove it until `safeToRemove` has been called.
*
* @public
*/
function usePresence(subscribe = true) {
const context = (0,external_React_.useContext)(PresenceContext_PresenceContext);
if (context === null)
return [true, null];
const { isPresent, onExitComplete, register } = context;
// It's safe to call the following hooks conditionally (after an early return) because the context will always
// either be null or non-null for the lifespan of the component.
const id = (0,external_React_.useId)();
(0,external_React_.useEffect)(() => {
if (subscribe)
register(id);
}, [subscribe]);
const safeToRemove = (0,external_React_.useCallback)(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);
return !isPresent && onExitComplete ? [false, safeToRemove] : [true];
}
/**
* Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.
* There is no `safeToRemove` function.
*
* ```jsx
* import { useIsPresent } from "framer-motion"
*
* export const Component = () => {
* const isPresent = useIsPresent()
*
* useEffect(() => {
* !isPresent && console.log("I've been removed!")
* }, [isPresent])
*
* return <div />
* }
* ```
*
* @public
*/
function useIsPresent() {
return isPresent(useContext(PresenceContext));
}
function isPresent(context) {
return context === null ? true : context.isPresent;
}
;// ./node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs
const getChildKey = (child) => child.key || "";
function onlyElements(children) {
const filtered = [];
// We use forEach here instead of map as map mutates the component key by preprending `.$`
external_React_.Children.forEach(children, (child) => {
if ((0,external_React_.isValidElement)(child))
filtered.push(child);
});
return filtered;
}
;// ./node_modules/framer-motion/dist/es/utils/is-browser.mjs
const is_browser_isBrowser = typeof window !== "undefined";
;// ./node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs
const useIsomorphicLayoutEffect = is_browser_isBrowser ? external_React_.useLayoutEffect : external_React_.useEffect;
;// ./node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs
"use client";
/**
* `AnimatePresence` enables the animation of components that have been removed from the tree.
*
* When adding/removing more than a single child, every child **must** be given a unique `key` prop.
*
* Any `motion` components that have an `exit` property defined will animate out when removed from
* the tree.
*
* ```jsx
* import { motion, AnimatePresence } from 'framer-motion'
*
* export const Items = ({ items }) => (
* <AnimatePresence>
* {items.map(item => (
* <motion.div
* key={item.id}
* initial={{ opacity: 0 }}
* animate={{ opacity: 1 }}
* exit={{ opacity: 0 }}
* />
* ))}
* </AnimatePresence>
* )
* ```
*
* You can sequence exit animations throughout a tree using variants.
*
* If a child contains multiple `motion` components with `exit` props, it will only unmount the child
* once all `motion` components have finished animating out. Likewise, any components using
* `usePresence` all need to call `safeToRemove`.
*
* @public
*/
const AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false, }) => {
const [isParentPresent, safeToRemove] = usePresence(propagate);
/**
* Filter any children that aren't ReactElements. We can only track components
* between renders with a props.key.
*/
const presentChildren = (0,external_React_.useMemo)(() => onlyElements(children), [children]);
/**
* Track the keys of the currently rendered children. This is used to
* determine which children are exiting.
*/
const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey);
/**
* If `initial={false}` we only want to pass this to components in the first render.
*/
const isInitialRender = (0,external_React_.useRef)(true);
/**
* A ref containing the currently present children. When all exit animations
* are complete, we use this to re-render the component with the latest children
* *committed* rather than the latest children *rendered*.
*/
const pendingPresentChildren = (0,external_React_.useRef)(presentChildren);
/**
* Track which exiting children have finished animating out.
*/
const exitComplete = useConstant(() => new Map());
/**
* Save children to render as React state. To ensure this component is concurrent-safe,
* we check for exiting children via an effect.
*/
const [diffedChildren, setDiffedChildren] = (0,external_React_.useState)(presentChildren);
const [renderedChildren, setRenderedChildren] = (0,external_React_.useState)(presentChildren);
useIsomorphicLayoutEffect(() => {
isInitialRender.current = false;
pendingPresentChildren.current = presentChildren;
/**
* Update complete status of exiting children.
*/
for (let i = 0; i < renderedChildren.length; i++) {
const key = getChildKey(renderedChildren[i]);
if (!presentKeys.includes(key)) {
if (exitComplete.get(key) !== true) {
exitComplete.set(key, false);
}
}
else {
exitComplete.delete(key);
}
}
}, [renderedChildren, presentKeys.length, presentKeys.join("-")]);
const exitingChildren = [];
if (presentChildren !== diffedChildren) {
let nextChildren = [...presentChildren];
/**
* Loop through all the currently rendered components and decide which
* are exiting.
*/
for (let i = 0; i < renderedChildren.length; i++) {
const child = renderedChildren[i];
const key = getChildKey(child);
if (!presentKeys.includes(key)) {
nextChildren.splice(i, 0, child);
exitingChildren.push(child);
}
}
/**
* If we're in "wait" mode, and we have exiting children, we want to
* only render these until they've all exited.
*/
if (mode === "wait" && exitingChildren.length) {
nextChildren = exitingChildren;
}
setRenderedChildren(onlyElements(nextChildren));
setDiffedChildren(presentChildren);
/**
* Early return to ensure once we've set state with the latest diffed
* children, we can immediately re-render.
*/
return;
}
if (false) {}
/**
* If we've been provided a forceRender function by the LayoutGroupContext,
* we can use it to force a re-render amongst all surrounding components once
* all components have finished animating out.
*/
const { forceRender } = (0,external_React_.useContext)(LayoutGroupContext);
return ((0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: renderedChildren.map((child) => {
const key = getChildKey(child);
const isPresent = propagate && !isParentPresent
? false
: presentChildren === renderedChildren ||
presentKeys.includes(key);
const onExit = () => {
if (exitComplete.has(key)) {
exitComplete.set(key, true);
}
else {
return;
}
let isEveryExitComplete = true;
exitComplete.forEach((isExitComplete) => {
if (!isExitComplete)
isEveryExitComplete = false;
});
if (isEveryExitComplete) {
forceRender === null || forceRender === void 0 ? void 0 : forceRender();
setRenderedChildren(pendingPresentChildren.current);
propagate && (safeToRemove === null || safeToRemove === void 0 ? void 0 : safeToRemove());
onExitComplete && onExitComplete();
}
};
return ((0,external_ReactJSXRuntime_namespaceObject.jsx)(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial
? undefined
: false, custom: isPresent ? undefined : custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, onExitComplete: isPresent ? undefined : onExit, children: child }, key));
}) }));
};
;// ./node_modules/framer-motion/dist/es/render/components/create-proxy.mjs
function createDOMMotionComponentProxy(componentFactory) {
if (typeof Proxy === "undefined") {
return componentFactory;
}
/**
* A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.
* Rather than generating them anew every render.
*/
const componentCache = new Map();
const deprecatedFactoryFunction = (...args) => {
if (false) {}
return componentFactory(...args);
};
return new Proxy(deprecatedFactoryFunction, {
/**
* Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
* The prop name is passed through as `key` and we can use that to generate a `motion`
* DOM component with that name.
*/
get: (_target, key) => {
if (key === "create")
return componentFactory;
/**
* If this element doesn't exist in the component cache, create it and cache.
*/
if (!componentCache.has(key)) {
componentCache.set(key, componentFactory(key));
}
return componentCache.get(key);
},
});
}
;// ./node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.mjs
function isAnimationControls(v) {
return (v !== null &&
typeof v === "object" &&
typeof v.start === "function");
}
;// ./node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs
const isKeyframesTarget = (v) => {
return Array.isArray(v);
};
;// ./node_modules/framer-motion/dist/es/utils/shallow-compare.mjs
function shallowCompare(next, prev) {
if (!Array.isArray(prev))
return false;
const prevLength = prev.length;
if (prevLength !== next.length)
return false;
for (let i = 0; i < prevLength; i++) {
if (prev[i] !== next[i])
return false;
}
return true;
}
;// ./node_modules/framer-motion/dist/es/render/utils/is-variant-label.mjs
/**
* Decides if the supplied variable is variant label
*/
function isVariantLabel(v) {
return typeof v === "string" || Array.isArray(v);
}
;// ./node_modules/framer-motion/dist/es/render/utils/resolve-variants.mjs
function getValueState(visualElement) {
const state = [{}, {}];
visualElement === null || visualElement === void 0 ? void 0 : visualElement.values.forEach((value, key) => {
state[0][key] = value.get();
state[1][key] = value.getVelocity();
});
return state;
}
function resolveVariantFromProps(props, definition, custom, visualElement) {
/**
* If the variant definition is a function, resolve.
*/
if (typeof definition === "function") {
const [current, velocity] = getValueState(visualElement);
definition = definition(custom !== undefined ? custom : props.custom, current, velocity);
}
/**
* If the variant definition is a variant label, or
* the function returned a variant label, resolve.
*/
if (typeof definition === "string") {
definition = props.variants && props.variants[definition];
}
/**
* At this point we've resolved both functions and variant labels,
* but the resolved variant label might itself have been a function.
* If so, resolve. This can only have returned a valid target object.
*/
if (typeof definition === "function") {
const [current, velocity] = getValueState(visualElement);
definition = definition(custom !== undefined ? custom : props.custom, current, velocity);
}
return definition;
}
;// ./node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs
function resolveVariant(visualElement, definition, custom) {
const props = visualElement.getProps();
return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement);
}
;// ./node_modules/framer-motion/dist/es/render/utils/variant-props.mjs
const variantPriorityOrder = [
"animate",
"whileInView",
"whileFocus",
"whileHover",
"whileTap",
"whileDrag",
"exit",
];
const variantProps = ["initial", ...variantPriorityOrder];
;// ./node_modules/motion-utils/dist/es/memo.mjs
/*#__NO_SIDE_EFFECTS__*/
function memo(callback) {
let result;
return () => {
if (result === undefined)
result = callback();
return result;
};
}
;// ./node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs
const supportsScrollTimeline = memo(() => window.ScrollTimeline !== undefined);
;// ./node_modules/motion-dom/dist/es/animation/controls/BaseGroup.mjs
class BaseGroup_BaseGroupPlaybackControls {
constructor(animations) {
// Bound to accomodate common `return animation.stop` pattern
this.stop = () => this.runAll("stop");
this.animations = animations.filter(Boolean);
}
get finished() {
// Support for new finished Promise and legacy thennable API
return Promise.all(this.animations.map((animation) => "finished" in animation ? animation.finished : animation));
}
/**
* TODO: Filter out cancelled or stopped animations before returning
*/
getAll(propName) {
return this.animations[0][propName];
}
setAll(propName, newValue) {
for (let i = 0; i < this.animations.length; i++) {
this.animations[i][propName] = newValue;
}
}
attachTimeline(timeline, fallback) {
const subscriptions = this.animations.map((animation) => {
if (supportsScrollTimeline() && animation.attachTimeline) {
return animation.attachTimeline(timeline);
}
else if (typeof fallback === "function") {
return fallback(animation);
}
});
return () => {
subscriptions.forEach((cancel, i) => {
cancel && cancel();
this.animations[i].stop();
});
};
}
get time() {
return this.getAll("time");
}
set time(time) {
this.setAll("time", time);
}
get speed() {
return this.getAll("speed");
}
set speed(speed) {
this.setAll("speed", speed);
}
get startTime() {
return this.getAll("startTime");
}
get duration() {
let max = 0;
for (let i = 0; i < this.animations.length; i++) {
max = Math.max(max, this.animations[i].duration);
}
return max;
}
runAll(methodName) {
this.animations.forEach((controls) => controls[methodName]());
}
flatten() {
this.runAll("flatten");
}
play() {
this.runAll("play");
}
pause() {
this.runAll("pause");
}
cancel() {
this.runAll("cancel");
}
complete() {
this.runAll("complete");
}
}
;// ./node_modules/motion-dom/dist/es/animation/controls/Group.mjs
/**
* TODO: This is a temporary class to support the legacy
* thennable API
*/
class GroupPlaybackControls extends BaseGroup_BaseGroupPlaybackControls {
then(onResolve, onReject) {
return Promise.all(this.animations).then(onResolve).catch(onReject);
}
}
;// ./node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs
function get_value_transition_getValueTransition(transition, key) {
return transition
? transition[key] ||
transition["default"] ||
transition
: undefined;
}
;// ./node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs
/**
* Implement a practical max duration for keyframe generation
* to prevent infinite loops
*/
const maxGeneratorDuration = 20000;
function calcGeneratorDuration(generator) {
let duration = 0;
const timeStep = 50;
let state = generator.next(duration);
while (!state.done && duration < maxGeneratorDuration) {
duration += timeStep;
state = generator.next(duration);
}
return duration >= maxGeneratorDuration ? Infinity : duration;
}
;// ./node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs
function isGenerator(type) {
return typeof type === "function";
}
;// ./node_modules/motion-dom/dist/es/animation/waapi/utils/attach-timeline.mjs
function attachTimeline(animation, timeline) {
animation.timeline = timeline;
animation.onfinish = null;
}
;// ./node_modules/motion-dom/dist/es/utils/is-bezier-definition.mjs
const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number";
;// ./node_modules/motion-dom/dist/es/utils/supports/flags.mjs
/**
* Add the ability for test suites to manually set support flags
* to better test more environments.
*/
const supportsFlags = {
linearEasing: undefined,
};
;// ./node_modules/motion-dom/dist/es/utils/supports/memo.mjs
function memoSupports(callback, supportsFlag) {
const memoized = memo(callback);
return () => { var _a; return (_a = supportsFlags[supportsFlag]) !== null && _a !== void 0 ? _a : memoized(); };
}
;// ./node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs
const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {
try {
document
.createElement("div")
.animate({ opacity: 0 }, { easing: "linear(0, 1)" });
}
catch (e) {
return false;
}
return true;
}, "linearEasing");
;// ./node_modules/motion-utils/dist/es/progress.mjs
/*
Progress within given range
Given a lower limit and an upper limit, we return the progress
(expressed as a number 0-1) represented by the given value, and
limit that progress to within 0-1.
@param [number]: Lower limit
@param [number]: Upper limit
@param [number]: Value to find progress within given range
@return [number]: Progress of value within range as expressed 0-1
*/
/*#__NO_SIDE_EFFECTS__*/
const progress = (from, to, value) => {
const toFromDifference = to - from;
return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
};
;// ./node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs
const generateLinearEasing = (easing, duration, // as milliseconds
resolution = 10 // as milliseconds
) => {
let points = "";
const numPoints = Math.max(Math.round(duration / resolution), 2);
for (let i = 0; i < numPoints; i++) {
points += easing(progress(0, numPoints - 1, i)) + ", ";
}
return `linear(${points.substring(0, points.length - 2)})`;
};
;// ./node_modules/motion-dom/dist/es/animation/waapi/utils/easing.mjs
function isWaapiSupportedEasing(easing) {
return Boolean((typeof easing === "function" && supportsLinearEasing()) ||
!easing ||
(typeof easing === "string" &&
(easing in supportedWaapiEasing || supportsLinearEasing())) ||
isBezierDefinition(easing) ||
(Array.isArray(easing) && easing.every(isWaapiSupportedEasing)));
}
const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;
const supportedWaapiEasing = {
linear: "linear",
ease: "ease",
easeIn: "ease-in",
easeOut: "ease-out",
easeInOut: "ease-in-out",
circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),
circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),
backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),
backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),
};
function easing_mapEasingToNativeEasing(easing, duration) {
if (!easing) {
return undefined;
}
else if (typeof easing === "function" && supportsLinearEasing()) {
return generateLinearEasing(easing, duration);
}
else if (isBezierDefinition(easing)) {
return cubicBezierAsString(easing);
}
else if (Array.isArray(easing)) {
return easing.map((segmentEasing) => easing_mapEasingToNativeEasing(segmentEasing, duration) ||
supportedWaapiEasing.easeOut);
}
else {
return supportedWaapiEasing[easing];
}
}
;// ./node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs
const isDragging = {
x: false,
y: false,
};
function isDragActive() {
return isDragging.x || isDragging.y;
}
;// ./node_modules/motion-dom/dist/es/utils/resolve-elements.mjs
function resolveElements(elementOrSelector, scope, selectorCache) {
var _a;
if (elementOrSelector instanceof Element) {
return [elementOrSelector];
}
else if (typeof elementOrSelector === "string") {
let root = document;
if (scope) {
// TODO: Refactor to utils package
// invariant(
// Boolean(scope.current),
// "Scope provided, but no element detected."
// )
root = scope.current;
}
const elements = (_a = selectorCache === null || selectorCache === void 0 ? void 0 : selectorCache[elementOrSelector]) !== null && _a !== void 0 ? _a : root.querySelectorAll(elementOrSelector);
return elements ? Array.from(elements) : [];
}
return Array.from(elementOrSelector);
}
;// ./node_modules/motion-dom/dist/es/gestures/utils/setup.mjs
function setupGesture(elementOrSelector, options) {
const elements = resolveElements(elementOrSelector);
const gestureAbortController = new AbortController();
const eventOptions = {
passive: true,
...options,
signal: gestureAbortController.signal,
};
const cancel = () => gestureAbortController.abort();
return [elements, eventOptions, cancel];
}
;// ./node_modules/motion-dom/dist/es/gestures/hover.mjs
/**
* Filter out events that are not pointer events, or are triggering
* while a Motion gesture is active.
*/
function filterEvents(callback) {
return (event) => {
if (event.pointerType === "touch" || isDragActive())
return;
callback(event);
};
}
/**
* Create a hover gesture. hover() is different to .addEventListener("pointerenter")
* in that it has an easier syntax, filters out polyfilled touch events, interoperates
* with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends.
*
* @public
*/
function hover(elementOrSelector, onHoverStart, options = {}) {
const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options);
const onPointerEnter = filterEvents((enterEvent) => {
const { target } = enterEvent;
const onHoverEnd = onHoverStart(enterEvent);
if (typeof onHoverEnd !== "function" || !target)
return;
const onPointerLeave = filterEvents((leaveEvent) => {
onHoverEnd(leaveEvent);
target.removeEventListener("pointerleave", onPointerLeave);
});
target.addEventListener("pointerleave", onPointerLeave, eventOptions);
});
elements.forEach((element) => {
element.addEventListener("pointerenter", onPointerEnter, eventOptions);
});
return cancel;
}
;// ./node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs
/**
* Recursively traverse up the tree to check whether the provided child node
* is the parent or a descendant of it.
*
* @param parent - Element to find
* @param child - Element to test against parent
*/
const isNodeOrChild = (parent, child) => {
if (!child) {
return false;
}
else if (parent === child) {
return true;
}
else {
return isNodeOrChild(parent, child.parentElement);
}
};
;// ./node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs
const isPrimaryPointer = (event) => {
if (event.pointerType === "mouse") {
return typeof event.button !== "number" || event.button <= 0;
}
else {
/**
* isPrimary is true for all mice buttons, whereas every touch point
* is regarded as its own input. So subsequent concurrent touch points
* will be false.
*
* Specifically match against false here as incomplete versions of
* PointerEvents in very old browser might have it set as undefined.
*/
return event.isPrimary !== false;
}
};
;// ./node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs
const focusableElements = new Set([
"BUTTON",
"INPUT",
"SELECT",
"TEXTAREA",
"A",
]);
function isElementKeyboardAccessible(element) {
return (focusableElements.has(element.tagName) ||
element.tabIndex !== -1);
}
;// ./node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs
const isPressing = new WeakSet();
;// ./node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs
/**
* Filter out events that are not "Enter" keys.
*/
function keyboard_filterEvents(callback) {
return (event) => {
if (event.key !== "Enter")
return;
callback(event);
};
}
function firePointerEvent(target, type) {
target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true }));
}
const enableKeyboardPress = (focusEvent, eventOptions) => {
const element = focusEvent.currentTarget;
if (!element)
return;
const handleKeydown = keyboard_filterEvents(() => {
if (isPressing.has(element))
return;
firePointerEvent(element, "down");
const handleKeyup = keyboard_filterEvents(() => {
firePointerEvent(element, "up");
});
const handleBlur = () => firePointerEvent(element, "cancel");
element.addEventListener("keyup", handleKeyup, eventOptions);
element.addEventListener("blur", handleBlur, eventOptions);
});
element.addEventListener("keydown", handleKeydown, eventOptions);
/**
* Add an event listener that fires on blur to remove the keydown events.
*/
element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions);
};
;// ./node_modules/motion-dom/dist/es/gestures/press/index.mjs
/**
* Filter out events that are not primary pointer events, or are triggering
* while a Motion gesture is active.
*/
function isValidPressEvent(event) {
return isPrimaryPointer(event) && !isDragActive();
}
/**
* Create a press gesture.
*
* Press is different to `"pointerdown"`, `"pointerup"` in that it
* automatically filters out secondary pointer events like right
* click and multitouch.
*
* It also adds accessibility support for keyboards, where
* an element with a press gesture will receive focus and
* trigger on Enter `"keydown"` and `"keyup"` events.
*
* This is different to a browser's `"click"` event, which does
* respond to keyboards but only for the `"click"` itself, rather
* than the press start and end/cancel. The element also needs
* to be focusable for this to work, whereas a press gesture will
* make an element focusable by default.
*
* @public
*/
function press(elementOrSelector, onPressStart, options = {}) {
const [elements, eventOptions, cancelEvents] = setupGesture(elementOrSelector, options);
const startPress = (startEvent) => {
const element = startEvent.currentTarget;
if (!isValidPressEvent(startEvent) || isPressing.has(element))
return;
isPressing.add(element);
const onPressEnd = onPressStart(startEvent);
const onPointerEnd = (endEvent, success) => {
window.removeEventListener("pointerup", onPointerUp);
window.removeEventListener("pointercancel", onPointerCancel);
if (!isValidPressEvent(endEvent) || !isPressing.has(element)) {
return;
}
isPressing.delete(element);
if (typeof onPressEnd === "function") {
onPressEnd(endEvent, { success });
}
};
const onPointerUp = (upEvent) => {
onPointerEnd(upEvent, options.useGlobalTarget ||
isNodeOrChild(element, upEvent.target));
};
const onPointerCancel = (cancelEvent) => {
onPointerEnd(cancelEvent, false);
};
window.addEventListener("pointerup", onPointerUp, eventOptions);
window.addEventListener("pointercancel", onPointerCancel, eventOptions);
};
elements.forEach((element) => {
if (!isElementKeyboardAccessible(element) &&
element.getAttribute("tabindex") === null) {
element.tabIndex = 0;
}
const target = options.useGlobalTarget ? window : element;
target.addEventListener("pointerdown", startPress, eventOptions);
element.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions), eventOptions);
});
return cancelEvents;
}
;// ./node_modules/motion-utils/dist/es/time-conversion.mjs
/**
* Converts seconds to milliseconds
*
* @param seconds - Time in seconds.
* @return milliseconds - Converted time in milliseconds.
*/
/*#__NO_SIDE_EFFECTS__*/
const time_conversion_secondsToMilliseconds = (seconds) => seconds * 1000;
/*#__NO_SIDE_EFFECTS__*/
const millisecondsToSeconds = (milliseconds) => milliseconds / 1000;
;// ./node_modules/motion-utils/dist/es/noop.mjs
/*#__NO_SIDE_EFFECTS__*/
const noop_noop = (any) => any;
;// ./node_modules/motion-dom/dist/es/animation/waapi/NativeAnimationControls.mjs
class NativeAnimationControls_NativeAnimationControls {
constructor(animation) {
this.animation = animation;
}
get duration() {
var _a, _b, _c;
const durationInMs = ((_b = (_a = this.animation) === null || _a === void 0 ? void 0 : _a.effect) === null || _b === void 0 ? void 0 : _b.getComputedTiming().duration) ||
((_c = this.options) === null || _c === void 0 ? void 0 : _c.duration) ||
300;
return millisecondsToSeconds(Number(durationInMs));
}
get time() {
var _a;
if (this.animation) {
return millisecondsToSeconds(((_a = this.animation) === null || _a === void 0 ? void 0 : _a.currentTime) || 0);
}
return 0;
}
set time(newTime) {
if (this.animation) {
this.animation.currentTime = time_conversion_secondsToMilliseconds(newTime);
}
}
get speed() {
return this.animation ? this.animation.playbackRate : 1;
}
set speed(newSpeed) {
if (this.animation) {
this.animation.playbackRate = newSpeed;
}
}
get state() {
return this.animation ? this.animation.playState : "finished";
}
get startTime() {
return this.animation ? this.animation.startTime : null;
}
get finished() {
return this.animation ? this.animation.finished : Promise.resolve();
}
play() {
this.animation && this.animation.play();
}
pause() {
this.animation && this.animation.pause();
}
stop() {
if (!this.animation ||
this.state === "idle" ||
this.state === "finished") {
return;
}
if (this.animation.commitStyles) {
this.animation.commitStyles();
}
this.cancel();
}
flatten() {
var _a;
if (!this.animation)
return;
(_a = this.animation.effect) === null || _a === void 0 ? void 0 : _a.updateTiming({ easing: "linear" });
}
attachTimeline(timeline) {
if (this.animation)
attachTimeline(this.animation, timeline);
return noop_noop;
}
complete() {
this.animation && this.animation.finish();
}
cancel() {
try {
this.animation && this.animation.cancel();
}
catch (e) { }
}
}
;// ./node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs
/**
* Create a progress => progress easing function from a generator.
*/
function createGeneratorEasing(options, scale = 100, createGenerator) {
const generator = createGenerator({ ...options, keyframes: [0, scale] });
const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);
return {
type: "keyframes",
ease: (progress) => {
return generator.next(duration * progress).value / scale;
},
duration: millisecondsToSeconds(duration),
};
}
;// ./node_modules/motion-dom/dist/es/animation/waapi/utils/convert-options.mjs
const defaultEasing = "easeOut";
function convert_options_applyGeneratorOptions(options) {
var _a;
if (isGenerator(options.type)) {
const generatorOptions = createGeneratorEasing(options, 100, options.type);
options.ease = supportsLinearEasing()
? generatorOptions.ease
: defaultEasing;
options.duration = time_conversion_secondsToMilliseconds(generatorOptions.duration);
options.type = "keyframes";
}
else {
options.duration = time_conversion_secondsToMilliseconds((_a = options.duration) !== null && _a !== void 0 ? _a : 0.3);
options.ease = options.ease || defaultEasing;
}
}
// TODO: Reuse for NativeAnimation
function convertMotionOptionsToNative(valueName, keyframes, options) {
var _a;
const nativeKeyframes = {};
const nativeOptions = {
fill: "both",
easing: "linear",
composite: "replace",
};
nativeOptions.delay = time_conversion_secondsToMilliseconds((_a = options.delay) !== null && _a !== void 0 ? _a : 0);
convert_options_applyGeneratorOptions(options);
nativeOptions.duration = options.duration;
const { ease, times } = options;
if (times)
nativeKeyframes.offset = times;
nativeKeyframes[valueName] = keyframes;
const easing = easing_mapEasingToNativeEasing(ease, options.duration);
/**
* If this is an easing array, apply to keyframes, not animation as a whole
*/
if (Array.isArray(easing)) {
nativeKeyframes.easing = easing;
}
else {
nativeOptions.easing = easing;
}
return {
keyframes: nativeKeyframes,
options: nativeOptions,
};
}
;// ./node_modules/motion-dom/dist/es/animation/waapi/PseudoAnimation.mjs
class PseudoAnimation_PseudoAnimation extends NativeAnimationControls_NativeAnimationControls {
constructor(target, pseudoElement, valueName, keyframes, options) {
const animationOptions = convertMotionOptionsToNative(valueName, keyframes, options);
const animation = target.animate(animationOptions.keyframes, {
pseudoElement,
...animationOptions.options,
});
super(animation);
}
}
;// ./node_modules/motion-dom/dist/es/view/utils/css.mjs
let pendingRules = {};
let style = null;
const css_css = {
set: (selector, values) => {
pendingRules[selector] = values;
},
commit: () => {
if (!style) {
style = document.createElement("style");
style.id = "motion-view";
}
let cssText = "";
for (const selector in pendingRules) {
const rule = pendingRules[selector];
cssText += `${selector} {\n`;
for (const [property, value] of Object.entries(rule)) {
cssText += ` ${property}: ${value};\n`;
}
cssText += "}\n";
}
style.textContent = cssText;
document.head.appendChild(style);
pendingRules = {};
},
remove: () => {
if (style && style.parentElement) {
style.parentElement.removeChild(style);
}
},
};
;// ./node_modules/motion-dom/dist/es/view/start.mjs
const definitionNames = (/* unused pure expression or super */ null && (["layout", "enter", "exit", "new", "old"]));
function start_startViewAnimation(update, defaultOptions, targets) {
if (!document.startViewTransition) {
return new Promise(async (resolve) => {
await update();
resolve(new BaseGroupPlaybackControls([]));
});
}
// TODO: Go over existing targets and ensure they all have ids
/**
* If we don't have any animations defined for the root target,
* remove it from being captured.
*/
if (!hasTarget("root", targets)) {
css.set(":root", {
"view-transition-name": "none",
});
}
/**
* Set the timing curve to linear for all view transition layers.
* This gets baked into the keyframes, which can't be changed
* without breaking the generated animation.
*
* This allows us to set easing via updateTiming - which can be changed.
*/
css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" });
css.commit(); // Write
const transition = document.startViewTransition(async () => {
await update();
// TODO: Go over new targets and ensure they all have ids
});
transition.finished.finally(() => {
css.remove(); // Write
});
return new Promise((resolve) => {
transition.ready.then(() => {
var _a;
const generatedViewAnimations = getViewAnimations();
const animations = [];
/**
* Create animations for our definitions
*/
targets.forEach((definition, target) => {
// TODO: If target is not "root", resolve elements
// and iterate over each
for (const key of definitionNames) {
if (!definition[key])
continue;
const { keyframes, options } = definition[key];
for (let [valueName, valueKeyframes] of Object.entries(keyframes)) {
if (!valueKeyframes)
continue;
const valueOptions = {
...getValueTransition(defaultOptions, valueName),
...getValueTransition(options, valueName),
};
const type = chooseLayerType(key);
/**
* If this is an opacity animation, and keyframes are not an array,
* we need to convert them into an array and set an initial value.
*/
if (valueName === "opacity" &&
!Array.isArray(valueKeyframes)) {
const initialValue = type === "new" ? 0 : 1;
valueKeyframes = [initialValue, valueKeyframes];
}
/**
* Resolve stagger function if provided.
*/
if (typeof valueOptions.delay === "function") {
valueOptions.delay = valueOptions.delay(0, 1);
}
const animation = new PseudoAnimation(document.documentElement, `::view-transition-${type}(${target})`, valueName, valueKeyframes, valueOptions);
animations.push(animation);
}
}
});
/**
* Handle browser generated animations
*/
for (const animation of generatedViewAnimations) {
if (animation.playState === "finished")
continue;
const { effect } = animation;
if (!effect || !(effect instanceof KeyframeEffect))
continue;
const { pseudoElement } = effect;
if (!pseudoElement)
continue;
const name = getLayerName(pseudoElement);
if (!name)
continue;
const targetDefinition = targets.get(name.layer);
if (!targetDefinition) {
/**
* If transition name is group then update the timing of the animation
* whereas if it's old or new then we could possibly replace it using
* the above method.
*/
const transitionName = name.type === "group" ? "layout" : "";
const animationTransition = {
...getValueTransition(defaultOptions, transitionName),
};
applyGeneratorOptions(animationTransition);
const easing = mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration);
effect.updateTiming({
delay: secondsToMilliseconds((_a = animationTransition.delay) !== null && _a !== void 0 ? _a : 0),
duration: animationTransition.duration,
easing,
});
animations.push(new NativeAnimationControls(animation));
}
else if (hasOpacity(targetDefinition, "enter") &&
hasOpacity(targetDefinition, "exit") &&
effect
.getKeyframes()
.some((keyframe) => keyframe.mixBlendMode)) {
animations.push(new NativeAnimationControls(animation));
}
else {
animation.cancel();
}
}
resolve(new BaseGroupPlaybackControls(animations));
});
});
}
function hasOpacity(target, key) {
var _a;
return (_a = target === null || target === void 0 ? void 0 : target[key]) === null || _a === void 0 ? void 0 : _a.keyframes.opacity;
}
;// ./node_modules/motion-dom/dist/es/view/index.mjs
/**
* TODO:
* - Create view transition on next tick
* - Replace animations with Motion animations
* - Return GroupAnimation on next tick
*/
class ViewTransitionBuilder {
constructor(update, options = {}) {
this.currentTarget = "root";
this.targets = new Map();
this.notifyReady = noop;
this.readyPromise = new Promise((resolve) => {
this.notifyReady = resolve;
});
queueMicrotask(() => {
startViewAnimation(update, options, this.targets).then((animation) => this.notifyReady(animation));
});
}
get(selector) {
this.currentTarget = selector;
return this;
}
layout(keyframes, options) {
this.updateTarget("layout", keyframes, options);
return this;
}
new(keyframes, options) {
this.updateTarget("new", keyframes, options);
return this;
}
old(keyframes, options) {
this.updateTarget("old", keyframes, options);
return this;
}
enter(keyframes, options) {
this.updateTarget("enter", keyframes, options);
return this;
}
exit(keyframes, options) {
this.updateTarget("exit", keyframes, options);
return this;
}
crossfade(options) {
this.updateTarget("enter", { opacity: 1 }, options);
this.updateTarget("exit", { opacity: 0 }, options);
return this;
}
updateTarget(target, keyframes, options = {}) {
const { currentTarget, targets } = this;
if (!targets.has(currentTarget)) {
targets.set(currentTarget, {});
}
const targetData = targets.get(currentTarget);
targetData[target] = { keyframes, options };
}
then(resolve, reject) {
return this.readyPromise.then(resolve, reject);
}
}
function view(update, defaultOptions = {}) {
return new ViewTransitionBuilder(update, defaultOptions);
}
;// ./node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs
function setDragLock(axis) {
if (axis === "x" || axis === "y") {
if (isDragging[axis]) {
return null;
}
else {
isDragging[axis] = true;
return () => {
isDragging[axis] = false;
};
}
}
else {
if (isDragging.x || isDragging.y) {
return null;
}
else {
isDragging.x = isDragging.y = true;
return () => {
isDragging.x = isDragging.y = false;
};
}
}
}
;// ./node_modules/motion-dom/dist/es/index.mjs
;// ./node_modules/framer-motion/dist/es/render/html/utils/keys-transform.mjs
/**
* Generate a list of every possible transform key.
*/
const transformPropOrder = [
"transformPerspective",
"x",
"y",
"z",
"translateX",
"translateY",
"translateZ",
"scale",
"scaleX",
"scaleY",
"rotate",
"rotateX",
"rotateY",
"rotateZ",
"skew",
"skewX",
"skewY",
];
/**
* A quick lookup for transform props.
*/
const transformProps = new Set(transformPropOrder);
;// ./node_modules/framer-motion/dist/es/render/html/utils/keys-position.mjs
const positionalKeys = new Set([
"width",
"height",
"top",
"left",
"right",
"bottom",
...transformPropOrder,
]);
;// ./node_modules/framer-motion/dist/es/utils/resolve-value.mjs
const isCustomValue = (v) => {
return Boolean(v && typeof v === "object" && v.mix && v.toValue);
};
const resolveFinalValueInKeyframes = (v) => {
// TODO maybe throw if v.length - 1 is placeholder token?
return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;
};
;// ./node_modules/framer-motion/dist/es/utils/GlobalConfig.mjs
const MotionGlobalConfig = {
skipAnimations: false,
useManualTiming: false,
};
;// ./node_modules/framer-motion/dist/es/frameloop/render-step.mjs
function createRenderStep(runNextFrame) {
/**
* We create and reuse two queues, one to queue jobs for the current frame
* and one for the next. We reuse to avoid triggering GC after x frames.
*/
let thisFrame = new Set();
let nextFrame = new Set();
/**
* Track whether we're currently processing jobs in this step. This way
* we can decide whether to schedule new jobs for this frame or next.
*/
let isProcessing = false;
let flushNextFrame = false;
/**
* A set of processes which were marked keepAlive when scheduled.
*/
const toKeepAlive = new WeakSet();
let latestFrameData = {
delta: 0.0,
timestamp: 0.0,
isProcessing: false,
};
function triggerCallback(callback) {
if (toKeepAlive.has(callback)) {
step.schedule(callback);
runNextFrame();
}
callback(latestFrameData);
}
const step = {
/**
* Schedule a process to run on the next frame.
*/
schedule: (callback, keepAlive = false, immediate = false) => {
const addToCurrentFrame = immediate && isProcessing;
const queue = addToCurrentFrame ? thisFrame : nextFrame;
if (keepAlive)
toKeepAlive.add(callback);
if (!queue.has(callback))
queue.add(callback);
return callback;
},
/**
* Cancel the provided callback from running on the next frame.
*/
cancel: (callback) => {
nextFrame.delete(callback);
toKeepAlive.delete(callback);
},
/**
* Execute all schedule callbacks.
*/
process: (frameData) => {
latestFrameData = frameData;
/**
* If we're already processing we've probably been triggered by a flushSync
* inside an existing process. Instead of executing, mark flushNextFrame
* as true and ensure we flush the following frame at the end of this one.
*/
if (isProcessing) {
flushNextFrame = true;
return;
}
isProcessing = true;
[thisFrame, nextFrame] = [nextFrame, thisFrame];
// Execute this frame
thisFrame.forEach(triggerCallback);
// Clear the frame so no callbacks remain. This is to avoid
// memory leaks should this render step not run for a while.
thisFrame.clear();
isProcessing = false;
if (flushNextFrame) {
flushNextFrame = false;
step.process(frameData);
}
},
};
return step;
}
;// ./node_modules/framer-motion/dist/es/frameloop/batcher.mjs
const stepsOrder = [
"read", // Read
"resolveKeyframes", // Write/Read/Write/Read
"update", // Compute
"preRender", // Compute
"render", // Write
"postRender", // Compute
];
const maxElapsed = 40;
function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
let runNextFrame = false;
let useDefaultElapsed = true;
const state = {
delta: 0.0,
timestamp: 0.0,
isProcessing: false,
};
const flagRunNextFrame = () => (runNextFrame = true);
const steps = stepsOrder.reduce((acc, key) => {
acc[key] = createRenderStep(flagRunNextFrame);
return acc;
}, {});
const { read, resolveKeyframes, update, preRender, render, postRender } = steps;
const processBatch = () => {
const timestamp = MotionGlobalConfig.useManualTiming
? state.timestamp
: performance.now();
runNextFrame = false;
state.delta = useDefaultElapsed
? 1000 / 60
: Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);
state.timestamp = timestamp;
state.isProcessing = true;
// Unrolled render loop for better per-frame performance
read.process(state);
resolveKeyframes.process(state);
update.process(state);
preRender.process(state);
render.process(state);
postRender.process(state);
state.isProcessing = false;
if (runNextFrame && allowKeepAlive) {
useDefaultElapsed = false;
scheduleNextBatch(processBatch);
}
};
const wake = () => {
runNextFrame = true;
useDefaultElapsed = true;
if (!state.isProcessing) {
scheduleNextBatch(processBatch);
}
};
const schedule = stepsOrder.reduce((acc, key) => {
const step = steps[key];
acc[key] = (process, keepAlive = false, immediate = false) => {
if (!runNextFrame)
wake();
return step.schedule(process, keepAlive, immediate);
};
return acc;
}, {});
const cancel = (process) => {
for (let i = 0; i < stepsOrder.length; i++) {
steps[stepsOrder[i]].cancel(process);
}
};
return { schedule, cancel, state, steps };
}
;// ./node_modules/framer-motion/dist/es/frameloop/frame.mjs
const { schedule: frame_frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop_noop, true);
;// ./node_modules/framer-motion/dist/es/frameloop/sync-time.mjs
let now;
function clearTime() {
now = undefined;
}
/**
* An eventloop-synchronous alternative to performance.now().
*
* Ensures that time measurements remain consistent within a synchronous context.
* Usually calling performance.now() twice within the same synchronous context
* will return different values which isn't useful for animations when we're usually
* trying to sync animations to the same frame.
*/
const time = {
now: () => {
if (now === undefined) {
time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming
? frameData.timestamp
: performance.now());
}
return now;
},
set: (newTime) => {
now = newTime;
queueMicrotask(clearTime);
},
};
;// ./node_modules/framer-motion/dist/es/utils/array.mjs
function addUniqueItem(arr, item) {
if (arr.indexOf(item) === -1)
arr.push(item);
}
function removeItem(arr, item) {
const index = arr.indexOf(item);
if (index > -1)
arr.splice(index, 1);
}
// Adapted from array-move
function moveItem([...arr], fromIndex, toIndex) {
const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;
if (startIndex >= 0 && startIndex < arr.length) {
const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;
const [item] = arr.splice(fromIndex, 1);
arr.splice(endIndex, 0, item);
}
return arr;
}
;// ./node_modules/framer-motion/dist/es/utils/subscription-manager.mjs
class SubscriptionManager {
constructor() {
this.subscriptions = [];
}
add(handler) {
addUniqueItem(this.subscriptions, handler);
return () => removeItem(this.subscriptions, handler);
}
notify(a, b, c) {
const numSubscriptions = this.subscriptions.length;
if (!numSubscriptions)
return;
if (numSubscriptions === 1) {
/**
* If there's only a single handler we can just call it without invoking a loop.
*/
this.subscriptions[0](a, b, c);
}
else {
for (let i = 0; i < numSubscriptions; i++) {
/**
* Check whether the handler exists before firing as it's possible
* the subscriptions were modified during this loop running.
*/
const handler = this.subscriptions[i];
handler && handler(a, b, c);
}
}
}
getSize() {
return this.subscriptions.length;
}
clear() {
this.subscriptions.length = 0;
}
}
;// ./node_modules/framer-motion/dist/es/utils/velocity-per-second.mjs
/*
Convert velocity into velocity per second
@param [number]: Unit per frame
@param [number]: Frame duration in ms
*/
function velocityPerSecond(velocity, frameDuration) {
return frameDuration ? velocity * (1000 / frameDuration) : 0;
}
;// ./node_modules/framer-motion/dist/es/value/index.mjs
/**
* Maximum time between the value of two frames, beyond which we
* assume the velocity has since been 0.
*/
const MAX_VELOCITY_DELTA = 30;
const isFloat = (value) => {
return !isNaN(parseFloat(value));
};
const collectMotionValues = {
current: undefined,
};
/**
* `MotionValue` is used to track the state and velocity of motion values.
*
* @public
*/
class MotionValue {
/**
* @param init - The initiating value
* @param config - Optional configuration options
*
* - `transformer`: A function to transform incoming values with.
*
* @internal
*/
constructor(init, options = {}) {
/**
* This will be replaced by the build step with the latest version number.
* When MotionValues are provided to motion components, warn if versions are mixed.
*/
this.version = "11.18.2";
/**
* Tracks whether this value can output a velocity. Currently this is only true
* if the value is numerical, but we might be able to widen the scope here and support
* other value types.
*
* @internal
*/
this.canTrackVelocity = null;
/**
* An object containing a SubscriptionManager for each active event.
*/
this.events = {};
this.updateAndNotify = (v, render = true) => {
const currentTime = time.now();
/**
* If we're updating the value during another frame or eventloop
* than the previous frame, then the we set the previous frame value
* to current.
*/
if (this.updatedAt !== currentTime) {
this.setPrevFrameValue();
}
this.prev = this.current;
this.setCurrent(v);
// Update update subscribers
if (this.current !== this.prev && this.events.change) {
this.events.change.notify(this.current);
}
// Update render subscribers
if (render && this.events.renderRequest) {
this.events.renderRequest.notify(this.current);
}
};
this.hasAnimated = false;
this.setCurrent(init);
this.owner = options.owner;
}
setCurrent(current) {
this.current = current;
this.updatedAt = time.now();
if (this.canTrackVelocity === null && current !== undefined) {
this.canTrackVelocity = isFloat(this.current);
}
}
setPrevFrameValue(prevFrameValue = this.current) {
this.prevFrameValue = prevFrameValue;
this.prevUpdatedAt = this.updatedAt;
}
/**
* Adds a function that will be notified when the `MotionValue` is updated.
*
* It returns a function that, when called, will cancel the subscription.
*
* When calling `onChange` inside a React component, it should be wrapped with the
* `useEffect` hook. As it returns an unsubscribe function, this should be returned
* from the `useEffect` function to ensure you don't add duplicate subscribers..
*
* ```jsx
* export const MyComponent = () => {
* const x = useMotionValue(0)
* const y = useMotionValue(0)
* const opacity = useMotionValue(1)
*
* useEffect(() => {
* function updateOpacity() {
* const maxXY = Math.max(x.get(), y.get())
* const newOpacity = transform(maxXY, [0, 100], [1, 0])
* opacity.set(newOpacity)
* }
*
* const unsubscribeX = x.on("change", updateOpacity)
* const unsubscribeY = y.on("change", updateOpacity)
*
* return () => {
* unsubscribeX()
* unsubscribeY()
* }
* }, [])
*
* return <motion.div style={{ x }} />
* }
* ```
*
* @param subscriber - A function that receives the latest value.
* @returns A function that, when called, will cancel this subscription.
*
* @deprecated
*/
onChange(subscription) {
if (false) {}
return this.on("change", subscription);
}
on(eventName, callback) {
if (!this.events[eventName]) {
this.events[eventName] = new SubscriptionManager();
}
const unsubscribe = this.events[eventName].add(callback);
if (eventName === "change") {
return () => {
unsubscribe();
/**
* If we have no more change listeners by the start
* of the next frame, stop active animations.
*/
frame_frame.read(() => {
if (!this.events.change.getSize()) {
this.stop();
}
});
};
}
return unsubscribe;
}
clearListeners() {
for (const eventManagers in this.events) {
this.events[eventManagers].clear();
}
}
/**
* Attaches a passive effect to the `MotionValue`.
*
* @internal
*/
attach(passiveEffect, stopPassiveEffect) {
this.passiveEffect = passiveEffect;
this.stopPassiveEffect = stopPassiveEffect;
}
/**
* Sets the state of the `MotionValue`.
*
* @remarks
*
* ```jsx
* const x = useMotionValue(0)
* x.set(10)
* ```
*
* @param latest - Latest value to set.
* @param render - Whether to notify render subscribers. Defaults to `true`
*
* @public
*/
set(v, render = true) {
if (!render || !this.passiveEffect) {
this.updateAndNotify(v, render);
}
else {
this.passiveEffect(v, this.updateAndNotify);
}
}
setWithVelocity(prev, current, delta) {
this.set(current);
this.prev = undefined;
this.prevFrameValue = prev;
this.prevUpdatedAt = this.updatedAt - delta;
}
/**
* Set the state of the `MotionValue`, stopping any active animations,
* effects, and resets velocity to `0`.
*/
jump(v, endAnimation = true) {
this.updateAndNotify(v);
this.prev = v;
this.prevUpdatedAt = this.prevFrameValue = undefined;
endAnimation && this.stop();
if (this.stopPassiveEffect)
this.stopPassiveEffect();
}
/**
* Returns the latest state of `MotionValue`
*
* @returns - The latest state of `MotionValue`
*
* @public
*/
get() {
if (collectMotionValues.current) {
collectMotionValues.current.push(this);
}
return this.current;
}
/**
* @public
*/
getPrevious() {
return this.prev;
}
/**
* Returns the latest velocity of `MotionValue`
*
* @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
*
* @public
*/
getVelocity() {
const currentTime = time.now();
if (!this.canTrackVelocity ||
this.prevFrameValue === undefined ||
currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {
return 0;
}
const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);
// Casts because of parseFloat's poor typing
return velocityPerSecond(parseFloat(this.current) -
parseFloat(this.prevFrameValue), delta);
}
/**
* Registers a new animation to control this `MotionValue`. Only one
* animation can drive a `MotionValue` at one time.
*
* ```jsx
* value.start()
* ```
*
* @param animation - A function that starts the provided animation
*
* @internal
*/
start(startAnimation) {
this.stop();
return new Promise((resolve) => {
this.hasAnimated = true;
this.animation = startAnimation(resolve);
if (this.events.animationStart) {
this.events.animationStart.notify();
}
}).then(() => {
if (this.events.animationComplete) {
this.events.animationComplete.notify();
}
this.clearAnimation();
});
}
/**
* Stop the currently active animation.
*
* @public
*/
stop() {
if (this.animation) {
this.animation.stop();
if (this.events.animationCancel) {
this.events.animationCancel.notify();
}
}
this.clearAnimation();
}
/**
* Returns `true` if this value is currently animating.
*
* @public
*/
isAnimating() {
return !!this.animation;
}
clearAnimation() {
delete this.animation;
}
/**
* Destroy and clean up subscribers to this `MotionValue`.
*
* The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
* handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
* created a `MotionValue` via the `motionValue` function.
*
* @public
*/
destroy() {
this.clearListeners();
this.stop();
if (this.stopPassiveEffect) {
this.stopPassiveEffect();
}
}
}
function motionValue(init, options) {
return new MotionValue(init, options);
}
;// ./node_modules/framer-motion/dist/es/render/utils/setters.mjs
/**
* Set VisualElement's MotionValue, creating a new MotionValue for it if
* it doesn't exist.
*/
function setMotionValue(visualElement, key, value) {
if (visualElement.hasValue(key)) {
visualElement.getValue(key).set(value);
}
else {
visualElement.addValue(key, motionValue(value));
}
}
function setTarget(visualElement, definition) {
const resolved = resolveVariant(visualElement, definition);
let { transitionEnd = {}, transition = {}, ...target } = resolved || {};
target = { ...target, ...transitionEnd };
for (const key in target) {
const value = resolveFinalValueInKeyframes(target[key]);
setMotionValue(visualElement, key, value);
}
}
;// ./node_modules/framer-motion/dist/es/value/utils/is-motion-value.mjs
const isMotionValue = (value) => Boolean(value && value.getVelocity);
;// ./node_modules/framer-motion/dist/es/value/use-will-change/is.mjs
function isWillChangeMotionValue(value) {
return Boolean(isMotionValue(value) && value.add);
}
;// ./node_modules/framer-motion/dist/es/value/use-will-change/add-will-change.mjs
function addValueToWillChange(visualElement, key) {
const willChange = visualElement.getValue("willChange");
/**
* It could be that a user has set willChange to a regular MotionValue,
* in which case we can't add the value to it.
*/
if (isWillChangeMotionValue(willChange)) {
return willChange.add(key);
}
}
;// ./node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs
/**
* Convert camelCase to dash-case properties.
*/
const camelToDash = (str) => str.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase();
;// ./node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.mjs
const optimizedAppearDataId = "framerAppearId";
const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId);
;// ./node_modules/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs
function getOptimisedAppearId(visualElement) {
return visualElement.props[optimizedAppearDataAttribute];
}
;// ./node_modules/framer-motion/dist/es/utils/use-instant-transition-state.mjs
const instantAnimationState = {
current: false,
};
;// ./node_modules/framer-motion/dist/es/easing/cubic-bezier.mjs
/*
Bezier function generator
This has been modified from Gaëtan Renaudeau's BezierEasing
https://github.com/gre/bezier-easing/blob/master/src/index.js
https://github.com/gre/bezier-easing/blob/master/LICENSE
I've removed the newtonRaphsonIterate algo because in benchmarking it
wasn't noticiably faster than binarySubdivision, indeed removing it
usually improved times, depending on the curve.
I also removed the lookup table, as for the added bundle size and loop we're
only cutting ~4 or so subdivision iterations. I bumped the max iterations up
to 12 to compensate and this still tended to be faster for no perceivable
loss in accuracy.
Usage
const easeOut = cubicBezier(.17,.67,.83,.67);
const x = easeOut(0.5); // returns 0.627...
*/
// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *
t;
const subdivisionPrecision = 0.0000001;
const subdivisionMaxIterations = 12;
function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {
let currentX;
let currentT;
let i = 0;
do {
currentT = lowerBound + (upperBound - lowerBound) / 2.0;
currentX = calcBezier(currentT, mX1, mX2) - x;
if (currentX > 0.0) {
upperBound = currentT;
}
else {
lowerBound = currentT;
}
} while (Math.abs(currentX) > subdivisionPrecision &&
++i < subdivisionMaxIterations);
return currentT;
}
function cubicBezier(mX1, mY1, mX2, mY2) {
// If this is a linear gradient, return linear easing
if (mX1 === mY1 && mX2 === mY2)
return noop_noop;
const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);
// If animation is at start/end, return t without easing
return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);
}
;// ./node_modules/framer-motion/dist/es/easing/modifiers/mirror.mjs
// Accepts an easing function and returns a new one that outputs mirrored values for
// the second half of the animation. Turns easeIn into easeInOut.
const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;
;// ./node_modules/framer-motion/dist/es/easing/modifiers/reverse.mjs
// Accepts an easing function and returns a new one that outputs reversed values.
// Turns easeIn into easeOut.
const reverseEasing = (easing) => (p) => 1 - easing(1 - p);
;// ./node_modules/framer-motion/dist/es/easing/back.mjs
const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99);
const backIn = /*@__PURE__*/ reverseEasing(backOut);
const backInOut = /*@__PURE__*/ mirrorEasing(backIn);
;// ./node_modules/framer-motion/dist/es/easing/anticipate.mjs
const anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));
;// ./node_modules/framer-motion/dist/es/easing/circ.mjs
const circIn = (p) => 1 - Math.sin(Math.acos(p));
const circOut = reverseEasing(circIn);
const circInOut = mirrorEasing(circIn);
;// ./node_modules/framer-motion/dist/es/utils/is-zero-value-string.mjs
/**
* Check if the value is a zero value string like "0px" or "0%"
*/
const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v);
;// ./node_modules/framer-motion/dist/es/animation/utils/is-none.mjs
function isNone(value) {
if (typeof value === "number") {
return value === 0;
}
else if (value !== null) {
return value === "none" || value === "0" || isZeroValueString(value);
}
else {
return true;
}
}
;// ./node_modules/framer-motion/dist/es/utils/clamp.mjs
const clamp_clamp = (min, max, v) => {
if (v > max)
return max;
if (v < min)
return min;
return v;
};
;// ./node_modules/framer-motion/dist/es/value/types/numbers/index.mjs
const number = {
test: (v) => typeof v === "number",
parse: parseFloat,
transform: (v) => v,
};
const alpha = {
...number,
transform: (v) => clamp_clamp(0, 1, v),
};
const scale = {
...number,
default: 1,
};
;// ./node_modules/framer-motion/dist/es/value/types/utils/sanitize.mjs
// If this number is a decimal, make it just five decimal places
// to avoid exponents
const sanitize = (v) => Math.round(v * 100000) / 100000;
;// ./node_modules/framer-motion/dist/es/value/types/utils/float-regex.mjs
const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
;// ./node_modules/framer-motion/dist/es/value/types/utils/is-nullish.mjs
function isNullish(v) {
return v == null;
}
;// ./node_modules/framer-motion/dist/es/value/types/utils/single-color-regex.mjs
const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;
;// ./node_modules/framer-motion/dist/es/value/types/color/utils.mjs
/**
* Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,
* but false if a number or multiple colors
*/
const isColorString = (type, testProp) => (v) => {
return Boolean((typeof v === "string" &&
singleColorRegex.test(v) &&
v.startsWith(type)) ||
(testProp &&
!isNullish(v) &&
Object.prototype.hasOwnProperty.call(v, testProp)));
};
const splitColor = (aName, bName, cName) => (v) => {
if (typeof v !== "string")
return v;
const [a, b, c, alpha] = v.match(floatRegex);
return {
[aName]: parseFloat(a),
[bName]: parseFloat(b),
[cName]: parseFloat(c),
alpha: alpha !== undefined ? parseFloat(alpha) : 1,
};
};
;// ./node_modules/framer-motion/dist/es/value/types/color/rgba.mjs
const clampRgbUnit = (v) => clamp_clamp(0, 255, v);
const rgbUnit = {
...number,
transform: (v) => Math.round(clampRgbUnit(v)),
};
const rgba = {
test: /*@__PURE__*/ isColorString("rgb", "red"),
parse: /*@__PURE__*/ splitColor("red", "green", "blue"),
transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" +
rgbUnit.transform(red) +
", " +
rgbUnit.transform(green) +
", " +
rgbUnit.transform(blue) +
", " +
sanitize(alpha.transform(alpha$1)) +
")",
};
;// ./node_modules/framer-motion/dist/es/value/types/color/hex.mjs
function parseHex(v) {
let r = "";
let g = "";
let b = "";
let a = "";
// If we have 6 characters, ie #FF0000
if (v.length > 5) {
r = v.substring(1, 3);
g = v.substring(3, 5);
b = v.substring(5, 7);
a = v.substring(7, 9);
// Or we have 3 characters, ie #F00
}
else {
r = v.substring(1, 2);
g = v.substring(2, 3);
b = v.substring(3, 4);
a = v.substring(4, 5);
r += r;
g += g;
b += b;
a += a;
}
return {
red: parseInt(r, 16),
green: parseInt(g, 16),
blue: parseInt(b, 16),
alpha: a ? parseInt(a, 16) / 255 : 1,
};
}
const hex = {
test: /*@__PURE__*/ isColorString("#"),
parse: parseHex,
transform: rgba.transform,
};
;// ./node_modules/framer-motion/dist/es/value/types/numbers/units.mjs
const createUnitType = (unit) => ({
test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1,
parse: parseFloat,
transform: (v) => `${v}${unit}`,
});
const degrees = /*@__PURE__*/ createUnitType("deg");
const percent = /*@__PURE__*/ createUnitType("%");
const px = /*@__PURE__*/ createUnitType("px");
const vh = /*@__PURE__*/ createUnitType("vh");
const vw = /*@__PURE__*/ createUnitType("vw");
const progressPercentage = {
...percent,
parse: (v) => percent.parse(v) / 100,
transform: (v) => percent.transform(v * 100),
};
;// ./node_modules/framer-motion/dist/es/value/types/color/hsla.mjs
const hsla = {
test: /*@__PURE__*/ isColorString("hsl", "hue"),
parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"),
transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {
return ("hsla(" +
Math.round(hue) +
", " +
percent.transform(sanitize(saturation)) +
", " +
percent.transform(sanitize(lightness)) +
", " +
sanitize(alpha.transform(alpha$1)) +
")");
},
};
;// ./node_modules/framer-motion/dist/es/value/types/color/index.mjs
const color = {
test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),
parse: (v) => {
if (rgba.test(v)) {
return rgba.parse(v);
}
else if (hsla.test(v)) {
return hsla.parse(v);
}
else {
return hex.parse(v);
}
},
transform: (v) => {
return typeof v === "string"
? v
: v.hasOwnProperty("red")
? rgba.transform(v)
: hsla.transform(v);
},
};
;// ./node_modules/framer-motion/dist/es/value/types/utils/color-regex.mjs
const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
;// ./node_modules/framer-motion/dist/es/value/types/complex/index.mjs
function test(v) {
var _a, _b;
return (isNaN(v) &&
typeof v === "string" &&
(((_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) || 0) +
(((_b = v.match(colorRegex)) === null || _b === void 0 ? void 0 : _b.length) || 0) >
0);
}
const NUMBER_TOKEN = "number";
const COLOR_TOKEN = "color";
const VAR_TOKEN = "var";
const VAR_FUNCTION_TOKEN = "var(";
const SPLIT_TOKEN = "${}";
// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`
const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
function analyseComplexValue(value) {
const originalValue = value.toString();
const values = [];
const indexes = {
color: [],
number: [],
var: [],
};
const types = [];
let i = 0;
const tokenised = originalValue.replace(complexRegex, (parsedValue) => {
if (color.test(parsedValue)) {
indexes.color.push(i);
types.push(COLOR_TOKEN);
values.push(color.parse(parsedValue));
}
else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {
indexes.var.push(i);
types.push(VAR_TOKEN);
values.push(parsedValue);
}
else {
indexes.number.push(i);
types.push(NUMBER_TOKEN);
values.push(parseFloat(parsedValue));
}
++i;
return SPLIT_TOKEN;
});
const split = tokenised.split(SPLIT_TOKEN);
return { values, split, indexes, types };
}
function parseComplexValue(v) {
return analyseComplexValue(v).values;
}
function createTransformer(source) {
const { split, types } = analyseComplexValue(source);
const numSections = split.length;
return (v) => {
let output = "";
for (let i = 0; i < numSections; i++) {
output += split[i];
if (v[i] !== undefined) {
const type = types[i];
if (type === NUMBER_TOKEN) {
output += sanitize(v[i]);
}
else if (type === COLOR_TOKEN) {
output += color.transform(v[i]);
}
else {
output += v[i];
}
}
}
return output;
};
}
const convertNumbersToZero = (v) => typeof v === "number" ? 0 : v;
function getAnimatableNone(v) {
const parsed = parseComplexValue(v);
const transformer = createTransformer(v);
return transformer(parsed.map(convertNumbersToZero));
}
const complex = {
test,
parse: parseComplexValue,
createTransformer,
getAnimatableNone,
};
;// ./node_modules/framer-motion/dist/es/value/types/complex/filter.mjs
/**
* Properties that should default to 1 or 100%
*/
const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]);
function applyDefaultFilter(v) {
const [name, value] = v.slice(0, -1).split("(");
if (name === "drop-shadow")
return v;
const [number] = value.match(floatRegex) || [];
if (!number)
return v;
const unit = value.replace(number, "");
let defaultValue = maxDefaults.has(name) ? 1 : 0;
if (number !== value)
defaultValue *= 100;
return name + "(" + defaultValue + unit + ")";
}
const functionRegex = /\b([a-z-]*)\(.*?\)/gu;
const filter = {
...complex,
getAnimatableNone: (v) => {
const functions = v.match(functionRegex);
return functions ? functions.map(applyDefaultFilter).join(" ") : v;
},
};
;// ./node_modules/framer-motion/dist/es/render/dom/value-types/number-browser.mjs
const browserNumberValueTypes = {
// Border props
borderWidth: px,
borderTopWidth: px,
borderRightWidth: px,
borderBottomWidth: px,
borderLeftWidth: px,
borderRadius: px,
radius: px,
borderTopLeftRadius: px,
borderTopRightRadius: px,
borderBottomRightRadius: px,
borderBottomLeftRadius: px,
// Positioning props
width: px,
maxWidth: px,
height: px,
maxHeight: px,
top: px,
right: px,
bottom: px,
left: px,
// Spacing props
padding: px,
paddingTop: px,
paddingRight: px,
paddingBottom: px,
paddingLeft: px,
margin: px,
marginTop: px,
marginRight: px,
marginBottom: px,
marginLeft: px,
// Misc
backgroundPositionX: px,
backgroundPositionY: px,
};
;// ./node_modules/framer-motion/dist/es/render/dom/value-types/transform.mjs
const transformValueTypes = {
rotate: degrees,
rotateX: degrees,
rotateY: degrees,
rotateZ: degrees,
scale: scale,
scaleX: scale,
scaleY: scale,
scaleZ: scale,
skew: degrees,
skewX: degrees,
skewY: degrees,
distance: px,
translateX: px,
translateY: px,
translateZ: px,
x: px,
y: px,
z: px,
perspective: px,
transformPerspective: px,
opacity: alpha,
originX: progressPercentage,
originY: progressPercentage,
originZ: px,
};
;// ./node_modules/framer-motion/dist/es/render/dom/value-types/type-int.mjs
const type_int_int = {
...number,
transform: Math.round,
};
;// ./node_modules/framer-motion/dist/es/render/dom/value-types/number.mjs
const numberValueTypes = {
...browserNumberValueTypes,
...transformValueTypes,
zIndex: type_int_int,
size: px,
// SVG
fillOpacity: alpha,
strokeOpacity: alpha,
numOctaves: type_int_int,
};
;// ./node_modules/framer-motion/dist/es/render/dom/value-types/defaults.mjs
/**
* A map of default value types for common values
*/
const defaultValueTypes = {
...numberValueTypes,
// Color props
color: color,
backgroundColor: color,
outlineColor: color,
fill: color,
stroke: color,
// Border props
borderColor: color,
borderTopColor: color,
borderRightColor: color,
borderBottomColor: color,
borderLeftColor: color,
filter: filter,
WebkitFilter: filter,
};
/**
* Gets the default ValueType for the provided value key
*/
const getDefaultValueType = (key) => defaultValueTypes[key];
;// ./node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs
function animatable_none_getAnimatableNone(key, value) {
let defaultValueType = getDefaultValueType(key);
if (defaultValueType !== filter)
defaultValueType = complex;
// If value is not recognised as animatable, ie "none", create an animatable version origin based on the target
return defaultValueType.getAnimatableNone
? defaultValueType.getAnimatableNone(value)
: undefined;
}
;// ./node_modules/framer-motion/dist/es/render/html/utils/make-none-animatable.mjs
/**
* If we encounter keyframes like "none" or "0" and we also have keyframes like
* "#fff" or "200px 200px" we want to find a keyframe to serve as a template for
* the "none" keyframes. In this case "#fff" or "200px 200px" - then these get turned into
* zero equivalents, i.e. "#fff0" or "0px 0px".
*/
const invalidTemplates = new Set(["auto", "none", "0"]);
function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) {
let i = 0;
let animatableTemplate = undefined;
while (i < unresolvedKeyframes.length && !animatableTemplate) {
const keyframe = unresolvedKeyframes[i];
if (typeof keyframe === "string" &&
!invalidTemplates.has(keyframe) &&
analyseComplexValue(keyframe).values.length) {
animatableTemplate = unresolvedKeyframes[i];
}
i++;
}
if (animatableTemplate && name) {
for (const noneIndex of noneKeyframeIndexes) {
unresolvedKeyframes[noneIndex] = animatable_none_getAnimatableNone(name, animatableTemplate);
}
}
}
;// ./node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs
const isNumOrPxType = (v) => v === number || v === px;
const getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(", ")[pos]);
const getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform }) => {
if (transform === "none" || !transform)
return 0;
const matrix3d = transform.match(/^matrix3d\((.+)\)$/u);
if (matrix3d) {
return getPosFromMatrix(matrix3d[1], pos3);
}
else {
const matrix = transform.match(/^matrix\((.+)\)$/u);
if (matrix) {
return getPosFromMatrix(matrix[1], pos2);
}
else {
return 0;
}
}
};
const transformKeys = new Set(["x", "y", "z"]);
const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));
function removeNonTranslationalTransform(visualElement) {
const removedTransforms = [];
nonTranslationalTransformKeys.forEach((key) => {
const value = visualElement.getValue(key);
if (value !== undefined) {
removedTransforms.push([key, value.get()]);
value.set(key.startsWith("scale") ? 1 : 0);
}
});
return removedTransforms;
}
const positionalValues = {
// Dimensions
width: ({ x }, { paddingLeft = "0", paddingRight = "0" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),
height: ({ y }, { paddingTop = "0", paddingBottom = "0" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),
top: (_bbox, { top }) => parseFloat(top),
left: (_bbox, { left }) => parseFloat(left),
bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),
right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),
// Transform
x: getTranslateFromMatrix(4, 13),
y: getTranslateFromMatrix(5, 14),
};
// Alias translate longform names
positionalValues.translateX = positionalValues.x;
positionalValues.translateY = positionalValues.y;
;// ./node_modules/framer-motion/dist/es/render/utils/KeyframesResolver.mjs
const toResolve = new Set();
let isScheduled = false;
let anyNeedsMeasurement = false;
function measureAllKeyframes() {
if (anyNeedsMeasurement) {
const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement);
const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element));
const transformsToRestore = new Map();
/**
* Write pass
* If we're measuring elements we want to remove bounding box-changing transforms.
*/
elementsToMeasure.forEach((element) => {
const removedTransforms = removeNonTranslationalTransform(element);
if (!removedTransforms.length)
return;
transformsToRestore.set(element, removedTransforms);
element.render();
});
// Read
resolversToMeasure.forEach((resolver) => resolver.measureInitialState());
// Write
elementsToMeasure.forEach((element) => {
element.render();
const restore = transformsToRestore.get(element);
if (restore) {
restore.forEach(([key, value]) => {
var _a;
(_a = element.getValue(key)) === null || _a === void 0 ? void 0 : _a.set(value);
});
}
});
// Read
resolversToMeasure.forEach((resolver) => resolver.measureEndState());
// Write
resolversToMeasure.forEach((resolver) => {
if (resolver.suspendedScrollY !== undefined) {
window.scrollTo(0, resolver.suspendedScrollY);
}
});
}
anyNeedsMeasurement = false;
isScheduled = false;
toResolve.forEach((resolver) => resolver.complete());
toResolve.clear();
}
function readAllKeyframes() {
toResolve.forEach((resolver) => {
resolver.readKeyframes();
if (resolver.needsMeasurement) {
anyNeedsMeasurement = true;
}
});
}
function flushKeyframeResolvers() {
readAllKeyframes();
measureAllKeyframes();
}
class KeyframeResolver {
constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {
/**
* Track whether this resolver has completed. Once complete, it never
* needs to attempt keyframe resolution again.
*/
this.isComplete = false;
/**
* Track whether this resolver is async. If it is, it'll be added to the
* resolver queue and flushed in the next frame. Resolvers that aren't going
* to trigger read/write thrashing don't need to be async.
*/
this.isAsync = false;
/**
* Track whether this resolver needs to perform a measurement
* to resolve its keyframes.
*/
this.needsMeasurement = false;
/**
* Track whether this resolver is currently scheduled to resolve
* to allow it to be cancelled and resumed externally.
*/
this.isScheduled = false;
this.unresolvedKeyframes = [...unresolvedKeyframes];
this.onComplete = onComplete;
this.name = name;
this.motionValue = motionValue;
this.element = element;
this.isAsync = isAsync;
}
scheduleResolve() {
this.isScheduled = true;
if (this.isAsync) {
toResolve.add(this);
if (!isScheduled) {
isScheduled = true;
frame_frame.read(readAllKeyframes);
frame_frame.resolveKeyframes(measureAllKeyframes);
}
}
else {
this.readKeyframes();
this.complete();
}
}
readKeyframes() {
const { unresolvedKeyframes, name, element, motionValue } = this;
/**
* If a keyframe is null, we hydrate it either by reading it from
* the instance, or propagating from previous keyframes.
*/
for (let i = 0; i < unresolvedKeyframes.length; i++) {
if (unresolvedKeyframes[i] === null) {
/**
* If the first keyframe is null, we need to find its value by sampling the element
*/
if (i === 0) {
const currentValue = motionValue === null || motionValue === void 0 ? void 0 : motionValue.get();
const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];
if (currentValue !== undefined) {
unresolvedKeyframes[0] = currentValue;
}
else if (element && name) {
const valueAsRead = element.readValue(name, finalKeyframe);
if (valueAsRead !== undefined && valueAsRead !== null) {
unresolvedKeyframes[0] = valueAsRead;
}
}
if (unresolvedKeyframes[0] === undefined) {
unresolvedKeyframes[0] = finalKeyframe;
}
if (motionValue && currentValue === undefined) {
motionValue.set(unresolvedKeyframes[0]);
}
}
else {
unresolvedKeyframes[i] = unresolvedKeyframes[i - 1];
}
}
}
}
setFinalKeyframe() { }
measureInitialState() { }
renderEndStyles() { }
measureEndState() { }
complete() {
this.isComplete = true;
this.onComplete(this.unresolvedKeyframes, this.finalKeyframe);
toResolve.delete(this);
}
cancel() {
if (!this.isComplete) {
this.isScheduled = false;
toResolve.delete(this);
}
}
resume() {
if (!this.isComplete)
this.scheduleResolve();
}
}
;// ./node_modules/motion-utils/dist/es/errors.mjs
let warning = noop_noop;
let errors_invariant = noop_noop;
if (false) {}
;// ./node_modules/framer-motion/dist/es/utils/is-numerical-string.mjs
/**
* Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1"
*/
const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v);
;// ./node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs
const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token);
const isCSSVariableName =
/*@__PURE__*/ checkStringStartsWith("--");
const startsAsVariableToken =
/*@__PURE__*/ checkStringStartsWith("var(--");
const isCSSVariableToken = (value) => {
const startsWithToken = startsAsVariableToken(value);
if (!startsWithToken)
return false;
// Ensure any comments are stripped from the value as this can harm performance of the regex.
return singleCssVariableRegex.test(value.split("/*")[0].trim());
};
const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;
;// ./node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs
/**
* Parse Framer's special CSS variable format into a CSS token and a fallback.
*
* ```
* `var(--foo, #fff)` => [`--foo`, '#fff']
* ```
*
* @param current
*/
const splitCSSVariableRegex =
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;
function parseCSSVariable(current) {
const match = splitCSSVariableRegex.exec(current);
if (!match)
return [,];
const [, token1, token2, fallback] = match;
return [`--${token1 !== null && token1 !== void 0 ? token1 : token2}`, fallback];
}
const maxDepth = 4;
function getVariableValue(current, element, depth = 1) {
errors_invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`);
const [token, fallback] = parseCSSVariable(current);
// No CSS variable detected
if (!token)
return;
// Attempt to read this CSS variable off the element
const resolved = window.getComputedStyle(element).getPropertyValue(token);
if (resolved) {
const trimmed = resolved.trim();
return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;
}
return isCSSVariableToken(fallback)
? getVariableValue(fallback, element, depth + 1)
: fallback;
}
;// ./node_modules/framer-motion/dist/es/render/dom/value-types/test.mjs
/**
* Tests a provided value against a ValueType
*/
const testValueType = (v) => (type) => type.test(v);
;// ./node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.mjs
/**
* ValueType for "auto"
*/
const auto = {
test: (v) => v === "auto",
parse: (v) => v,
};
;// ./node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.mjs
/**
* A list of value types commonly used for dimensions
*/
const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];
/**
* Tests a dimensional value against the list of dimension ValueTypes
*/
const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));
;// ./node_modules/framer-motion/dist/es/render/dom/DOMKeyframesResolver.mjs
class DOMKeyframesResolver extends KeyframeResolver {
constructor(unresolvedKeyframes, onComplete, name, motionValue, element) {
super(unresolvedKeyframes, onComplete, name, motionValue, element, true);
}
readKeyframes() {
const { unresolvedKeyframes, element, name } = this;
if (!element || !element.current)
return;
super.readKeyframes();
/**
* If any keyframe is a CSS variable, we need to find its value by sampling the element
*/
for (let i = 0; i < unresolvedKeyframes.length; i++) {
let keyframe = unresolvedKeyframes[i];
if (typeof keyframe === "string") {
keyframe = keyframe.trim();
if (isCSSVariableToken(keyframe)) {
const resolved = getVariableValue(keyframe, element.current);
if (resolved !== undefined) {
unresolvedKeyframes[i] = resolved;
}
if (i === unresolvedKeyframes.length - 1) {
this.finalKeyframe = keyframe;
}
}
}
}
/**
* Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes.
* This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which
* have a far bigger performance impact.
*/
this.resolveNoneKeyframes();
/**
* Check to see if unit type has changed. If so schedule jobs that will
* temporarily set styles to the destination keyframes.
* Skip if we have more than two keyframes or this isn't a positional value.
* TODO: We can throw if there are multiple keyframes and the value type changes.
*/
if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {
return;
}
const [origin, target] = unresolvedKeyframes;
const originType = findDimensionValueType(origin);
const targetType = findDimensionValueType(target);
/**
* Either we don't recognise these value types or we can animate between them.
*/
if (originType === targetType)
return;
/**
* If both values are numbers or pixels, we can animate between them by
* converting them to numbers.
*/
if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {
for (let i = 0; i < unresolvedKeyframes.length; i++) {
const value = unresolvedKeyframes[i];
if (typeof value === "string") {
unresolvedKeyframes[i] = parseFloat(value);
}
}
}
else {
/**
* Else, the only way to resolve this is by measuring the element.
*/
this.needsMeasurement = true;
}
}
resolveNoneKeyframes() {
const { unresolvedKeyframes, name } = this;
const noneKeyframeIndexes = [];
for (let i = 0; i < unresolvedKeyframes.length; i++) {
if (isNone(unresolvedKeyframes[i])) {
noneKeyframeIndexes.push(i);
}
}
if (noneKeyframeIndexes.length) {
makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name);
}
}
measureInitialState() {
const { element, unresolvedKeyframes, name } = this;
if (!element || !element.current)
return;
if (name === "height") {
this.suspendedScrollY = window.pageYOffset;
}
this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));
unresolvedKeyframes[0] = this.measuredOrigin;
// Set final key frame to measure after next render
const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];
if (measureKeyframe !== undefined) {
element.getValue(name, measureKeyframe).jump(measureKeyframe, false);
}
}
measureEndState() {
var _a;
const { element, name, unresolvedKeyframes } = this;
if (!element || !element.current)
return;
const value = element.getValue(name);
value && value.jump(this.measuredOrigin, false);
const finalKeyframeIndex = unresolvedKeyframes.length - 1;
const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex];
unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));
if (finalKeyframe !== null && this.finalKeyframe === undefined) {
this.finalKeyframe = finalKeyframe;
}
// If we removed transform values, reapply them before the next render
if ((_a = this.removedTransforms) === null || _a === void 0 ? void 0 : _a.length) {
this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => {
element
.getValue(unsetTransformName)
.set(unsetTransformValue);
});
}
this.resolveNoneKeyframes();
}
}
;// ./node_modules/framer-motion/dist/es/animation/utils/is-animatable.mjs
/**
* Check if a value is animatable. Examples:
*
* ✅: 100, "100px", "#fff"
* ❌: "block", "url(2.jpg)"
* @param value
*
* @internal
*/
const isAnimatable = (value, name) => {
// If the list of keys tat might be non-animatable grows, replace with Set
if (name === "zIndex")
return false;
// If it's a number or a keyframes array, we can animate it. We might at some point
// need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,
// but for now lets leave it like this for performance reasons
if (typeof value === "number" || Array.isArray(value))
return true;
if (typeof value === "string" && // It's animatable if we have a string
(complex.test(value) || value === "0") && // And it contains numbers and/or colors
!value.startsWith("url(") // Unless it starts with "url("
) {
return true;
}
return false;
};
;// ./node_modules/framer-motion/dist/es/animation/animators/utils/can-animate.mjs
function hasKeyframesChanged(keyframes) {
const current = keyframes[0];
if (keyframes.length === 1)
return true;
for (let i = 0; i < keyframes.length; i++) {
if (keyframes[i] !== current)
return true;
}
}
function canAnimate(keyframes, name, type, velocity) {
/**
* Check if we're able to animate between the start and end keyframes,
* and throw a warning if we're attempting to animate between one that's
* animatable and another that isn't.
*/
const originKeyframe = keyframes[0];
if (originKeyframe === null)
return false;
/**
* These aren't traditionally animatable but we do support them.
* In future we could look into making this more generic or replacing
* this function with mix() === mixImmediate
*/
if (name === "display" || name === "visibility")
return true;
const targetKeyframe = keyframes[keyframes.length - 1];
const isOriginAnimatable = isAnimatable(originKeyframe, name);
const isTargetAnimatable = isAnimatable(targetKeyframe, name);
warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". ${originKeyframe} is not an animatable value - to enable this animation set ${originKeyframe} to a value animatable to ${targetKeyframe} via the \`style\` property.`);
// Always skip if any of these are true
if (!isOriginAnimatable || !isTargetAnimatable) {
return false;
}
return (hasKeyframesChanged(keyframes) ||
((type === "spring" || isGenerator(type)) && velocity));
}
;// ./node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs
const isNotNull = (value) => value !== null;
function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe) {
const resolvedKeyframes = keyframes.filter(isNotNull);
const index = repeat && repeatType !== "loop" && repeat % 2 === 1
? 0
: resolvedKeyframes.length - 1;
return !index || finalKeyframe === undefined
? resolvedKeyframes[index]
: finalKeyframe;
}
;// ./node_modules/framer-motion/dist/es/animation/animators/BaseAnimation.mjs
/**
* Maximum time allowed between an animation being created and it being
* resolved for us to use the latter as the start time.
*
* This is to ensure that while we prefer to "start" an animation as soon
* as it's triggered, we also want to avoid a visual jump if there's a big delay
* between these two moments.
*/
const MAX_RESOLVE_DELAY = 40;
class BaseAnimation {
constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", ...options }) {
// Track whether the animation has been stopped. Stopped animations won't restart.
this.isStopped = false;
this.hasAttemptedResolve = false;
this.createdAt = time.now();
this.options = {
autoplay,
delay,
type,
repeat,
repeatDelay,
repeatType,
...options,
};
this.updateFinishedPromise();
}
/**
* This method uses the createdAt and resolvedAt to calculate the
* animation startTime. *Ideally*, we would use the createdAt time as t=0
* as the following frame would then be the first frame of the animation in
* progress, which would feel snappier.
*
* However, if there's a delay (main thread work) between the creation of
* the animation and the first commited frame, we prefer to use resolvedAt
* to avoid a sudden jump into the animation.
*/
calcStartTime() {
if (!this.resolvedAt)
return this.createdAt;
return this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY
? this.resolvedAt
: this.createdAt;
}
/**
* A getter for resolved data. If keyframes are not yet resolved, accessing
* this.resolved will synchronously flush all pending keyframe resolvers.
* This is a deoptimisation, but at its worst still batches read/writes.
*/
get resolved() {
if (!this._resolved && !this.hasAttemptedResolve) {
flushKeyframeResolvers();
}
return this._resolved;
}
/**
* A method to be called when the keyframes resolver completes. This method
* will check if its possible to run the animation and, if not, skip it.
* Otherwise, it will call initPlayback on the implementing class.
*/
onKeyframesResolved(keyframes, finalKeyframe) {
this.resolvedAt = time.now();
this.hasAttemptedResolve = true;
const { name, type, velocity, delay, onComplete, onUpdate, isGenerator, } = this.options;
/**
* If we can't animate this value with the resolved keyframes
* then we should complete it immediately.
*/
if (!isGenerator && !canAnimate(keyframes, name, type, velocity)) {
// Finish immediately
if (instantAnimationState.current || !delay) {
onUpdate &&
onUpdate(getFinalKeyframe(keyframes, this.options, finalKeyframe));
onComplete && onComplete();
this.resolveFinishedPromise();
return;
}
// Finish after a delay
else {
this.options.duration = 0;
}
}
const resolvedAnimation = this.initPlayback(keyframes, finalKeyframe);
if (resolvedAnimation === false)
return;
this._resolved = {
keyframes,
finalKeyframe,
...resolvedAnimation,
};
this.onPostResolved();
}
onPostResolved() { }
/**
* Allows the returned animation to be awaited or promise-chained. Currently
* resolves when the animation finishes at all but in a future update could/should
* reject if its cancels.
*/
then(resolve, reject) {
return this.currentFinishedPromise.then(resolve, reject);
}
flatten() {
this.options.type = "keyframes";
this.options.ease = "linear";
}
updateFinishedPromise() {
this.currentFinishedPromise = new Promise((resolve) => {
this.resolveFinishedPromise = resolve;
});
}
}
;// ./node_modules/framer-motion/dist/es/utils/mix/number.mjs
/*
Value in range from progress
Given a lower limit and an upper limit, we return the value within
that range as expressed by progress (usually a number from 0 to 1)
So progress = 0.5 would change
from -------- to
to
from ---- to
E.g. from = 10, to = 20, progress = 0.5 => 15
@param [number]: Lower limit of range
@param [number]: Upper limit of range
@param [number]: The progress between lower and upper limits expressed 0-1
@return [number]: Value as calculated from progress within range (not limited within range)
*/
const mixNumber = (from, to, progress) => {
return from + (to - from) * progress;
};
;// ./node_modules/framer-motion/dist/es/utils/hsla-to-rgba.mjs
// Adapted from https://gist.github.com/mjackson/5311256
function hueToRgb(p, q, t) {
if (t < 0)
t += 1;
if (t > 1)
t -= 1;
if (t < 1 / 6)
return p + (q - p) * 6 * t;
if (t < 1 / 2)
return q;
if (t < 2 / 3)
return p + (q - p) * (2 / 3 - t) * 6;
return p;
}
function hslaToRgba({ hue, saturation, lightness, alpha }) {
hue /= 360;
saturation /= 100;
lightness /= 100;
let red = 0;
let green = 0;
let blue = 0;
if (!saturation) {
red = green = blue = lightness;
}
else {
const q = lightness < 0.5
? lightness * (1 + saturation)
: lightness + saturation - lightness * saturation;
const p = 2 * lightness - q;
red = hueToRgb(p, q, hue + 1 / 3);
green = hueToRgb(p, q, hue);
blue = hueToRgb(p, q, hue - 1 / 3);
}
return {
red: Math.round(red * 255),
green: Math.round(green * 255),
blue: Math.round(blue * 255),
alpha,
};
}
;// ./node_modules/framer-motion/dist/es/utils/mix/immediate.mjs
function mixImmediate(a, b) {
return (p) => (p > 0 ? b : a);
}
;// ./node_modules/framer-motion/dist/es/utils/mix/color.mjs
// Linear color space blending
// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw
// Demonstrated http://codepen.io/osublake/pen/xGVVaN
const mixLinearColor = (from, to, v) => {
const fromExpo = from * from;
const expo = v * (to * to - fromExpo) + fromExpo;
return expo < 0 ? 0 : Math.sqrt(expo);
};
const colorTypes = [hex, rgba, hsla];
const getColorType = (v) => colorTypes.find((type) => type.test(v));
function asRGBA(color) {
const type = getColorType(color);
warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`);
if (!Boolean(type))
return false;
let model = type.parse(color);
if (type === hsla) {
// TODO Remove this cast - needed since Motion's stricter typing
model = hslaToRgba(model);
}
return model;
}
const mixColor = (from, to) => {
const fromRGBA = asRGBA(from);
const toRGBA = asRGBA(to);
if (!fromRGBA || !toRGBA) {
return mixImmediate(from, to);
}
const blended = { ...fromRGBA };
return (v) => {
blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);
blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);
blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);
blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);
return rgba.transform(blended);
};
};
;// ./node_modules/framer-motion/dist/es/utils/pipe.mjs
/**
* Pipe
* Compose other transformers to run linearily
* pipe(min(20), max(40))
* @param {...functions} transformers
* @return {function}
*/
const combineFunctions = (a, b) => (v) => b(a(v));
const pipe = (...transformers) => transformers.reduce(combineFunctions);
;// ./node_modules/framer-motion/dist/es/utils/mix/visibility.mjs
const invisibleValues = new Set(["none", "hidden"]);
/**
* Returns a function that, when provided a progress value between 0 and 1,
* will return the "none" or "hidden" string only when the progress is that of
* the origin or target.
*/
function mixVisibility(origin, target) {
if (invisibleValues.has(origin)) {
return (p) => (p <= 0 ? origin : target);
}
else {
return (p) => (p >= 1 ? target : origin);
}
}
;// ./node_modules/framer-motion/dist/es/utils/mix/complex.mjs
function complex_mixNumber(a, b) {
return (p) => mixNumber(a, b, p);
}
function getMixer(a) {
if (typeof a === "number") {
return complex_mixNumber;
}
else if (typeof a === "string") {
return isCSSVariableToken(a)
? mixImmediate
: color.test(a)
? mixColor
: mixComplex;
}
else if (Array.isArray(a)) {
return mixArray;
}
else if (typeof a === "object") {
return color.test(a) ? mixColor : mixObject;
}
return mixImmediate;
}
function mixArray(a, b) {
const output = [...a];
const numValues = output.length;
const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));
return (p) => {
for (let i = 0; i < numValues; i++) {
output[i] = blendValue[i](p);
}
return output;
};
}
function mixObject(a, b) {
const output = { ...a, ...b };
const blendValue = {};
for (const key in output) {
if (a[key] !== undefined && b[key] !== undefined) {
blendValue[key] = getMixer(a[key])(a[key], b[key]);
}
}
return (v) => {
for (const key in blendValue) {
output[key] = blendValue[key](v);
}
return output;
};
}
function matchOrder(origin, target) {
var _a;
const orderedOrigin = [];
const pointers = { color: 0, var: 0, number: 0 };
for (let i = 0; i < target.values.length; i++) {
const type = target.types[i];
const originIndex = origin.indexes[type][pointers[type]];
const originValue = (_a = origin.values[originIndex]) !== null && _a !== void 0 ? _a : 0;
orderedOrigin[i] = originValue;
pointers[type]++;
}
return orderedOrigin;
}
const mixComplex = (origin, target) => {
const template = complex.createTransformer(target);
const originStats = analyseComplexValue(origin);
const targetStats = analyseComplexValue(target);
const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&
originStats.indexes.color.length === targetStats.indexes.color.length &&
originStats.indexes.number.length >= targetStats.indexes.number.length;
if (canInterpolate) {
if ((invisibleValues.has(origin) &&
!targetStats.values.length) ||
(invisibleValues.has(target) &&
!originStats.values.length)) {
return mixVisibility(origin, target);
}
return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);
}
else {
warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`);
return mixImmediate(origin, target);
}
};
;// ./node_modules/framer-motion/dist/es/utils/mix/index.mjs
function mix(from, to, p) {
if (typeof from === "number" &&
typeof to === "number" &&
typeof p === "number") {
return mixNumber(from, to, p);
}
const mixer = getMixer(from);
return mixer(from, to);
}
;// ./node_modules/framer-motion/dist/es/animation/generators/utils/velocity.mjs
const velocitySampleDuration = 5; // ms
function calcGeneratorVelocity(resolveValue, t, current) {
const prevT = Math.max(t - velocitySampleDuration, 0);
return velocityPerSecond(current - resolveValue(prevT), t - prevT);
}
;// ./node_modules/framer-motion/dist/es/animation/generators/spring/defaults.mjs
const springDefaults = {
// Default spring physics
stiffness: 100,
damping: 10,
mass: 1.0,
velocity: 0.0,
// Default duration/bounce-based options
duration: 800, // in ms
bounce: 0.3,
visualDuration: 0.3, // in seconds
// Rest thresholds
restSpeed: {
granular: 0.01,
default: 2,
},
restDelta: {
granular: 0.005,
default: 0.5,
},
// Limits
minDuration: 0.01, // in seconds
maxDuration: 10.0, // in seconds
minDamping: 0.05,
maxDamping: 1,
};
;// ./node_modules/framer-motion/dist/es/animation/generators/spring/find.mjs
const safeMin = 0.001;
function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {
let envelope;
let derivative;
warning(duration <= time_conversion_secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less");
let dampingRatio = 1 - bounce;
/**
* Restrict dampingRatio and duration to within acceptable ranges.
*/
dampingRatio = clamp_clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);
duration = clamp_clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));
if (dampingRatio < 1) {
/**
* Underdamped spring
*/
envelope = (undampedFreq) => {
const exponentialDecay = undampedFreq * dampingRatio;
const delta = exponentialDecay * duration;
const a = exponentialDecay - velocity;
const b = calcAngularFreq(undampedFreq, dampingRatio);
const c = Math.exp(-delta);
return safeMin - (a / b) * c;
};
derivative = (undampedFreq) => {
const exponentialDecay = undampedFreq * dampingRatio;
const delta = exponentialDecay * duration;
const d = delta * velocity + velocity;
const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;
const f = Math.exp(-delta);
const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);
const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;
return (factor * ((d - e) * f)) / g;
};
}
else {
/**
* Critically-damped spring
*/
envelope = (undampedFreq) => {
const a = Math.exp(-undampedFreq * duration);
const b = (undampedFreq - velocity) * duration + 1;
return -safeMin + a * b;
};
derivative = (undampedFreq) => {
const a = Math.exp(-undampedFreq * duration);
const b = (velocity - undampedFreq) * (duration * duration);
return a * b;
};
}
const initialGuess = 5 / duration;
const undampedFreq = approximateRoot(envelope, derivative, initialGuess);
duration = time_conversion_secondsToMilliseconds(duration);
if (isNaN(undampedFreq)) {
return {
stiffness: springDefaults.stiffness,
damping: springDefaults.damping,
duration,
};
}
else {
const stiffness = Math.pow(undampedFreq, 2) * mass;
return {
stiffness,
damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),
duration,
};
}
}
const rootIterations = 12;
function approximateRoot(envelope, derivative, initialGuess) {
let result = initialGuess;
for (let i = 1; i < rootIterations; i++) {
result = result - envelope(result) / derivative(result);
}
return result;
}
function calcAngularFreq(undampedFreq, dampingRatio) {
return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);
}
;// ./node_modules/framer-motion/dist/es/animation/generators/spring/index.mjs
const durationKeys = ["duration", "bounce"];
const physicsKeys = ["stiffness", "damping", "mass"];
function isSpringType(options, keys) {
return keys.some((key) => options[key] !== undefined);
}
function getSpringOptions(options) {
let springOptions = {
velocity: springDefaults.velocity,
stiffness: springDefaults.stiffness,
damping: springDefaults.damping,
mass: springDefaults.mass,
isResolvedFromDuration: false,
...options,
};
// stiffness/damping/mass overrides duration/bounce
if (!isSpringType(options, physicsKeys) &&
isSpringType(options, durationKeys)) {
if (options.visualDuration) {
const visualDuration = options.visualDuration;
const root = (2 * Math.PI) / (visualDuration * 1.2);
const stiffness = root * root;
const damping = 2 *
clamp_clamp(0.05, 1, 1 - (options.bounce || 0)) *
Math.sqrt(stiffness);
springOptions = {
...springOptions,
mass: springDefaults.mass,
stiffness,
damping,
};
}
else {
const derived = findSpring(options);
springOptions = {
...springOptions,
...derived,
mass: springDefaults.mass,
};
springOptions.isResolvedFromDuration = true;
}
}
return springOptions;
}
function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {
const options = typeof optionsOrVisualDuration !== "object"
? {
visualDuration: optionsOrVisualDuration,
keyframes: [0, 1],
bounce,
}
: optionsOrVisualDuration;
let { restSpeed, restDelta } = options;
const origin = options.keyframes[0];
const target = options.keyframes[options.keyframes.length - 1];
/**
* This is the Iterator-spec return value. We ensure it's mutable rather than using a generator
* to reduce GC during animation.
*/
const state = { done: false, value: origin };
const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({
...options,
velocity: -millisecondsToSeconds(options.velocity || 0),
});
const initialVelocity = velocity || 0.0;
const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));
const initialDelta = target - origin;
const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));
/**
* If we're working on a granular scale, use smaller defaults for determining
* when the spring is finished.
*
* These defaults have been selected emprically based on what strikes a good
* ratio between feeling good and finishing as soon as changes are imperceptible.
*/
const isGranularScale = Math.abs(initialDelta) < 5;
restSpeed || (restSpeed = isGranularScale
? springDefaults.restSpeed.granular
: springDefaults.restSpeed.default);
restDelta || (restDelta = isGranularScale
? springDefaults.restDelta.granular
: springDefaults.restDelta.default);
let resolveSpring;
if (dampingRatio < 1) {
const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);
// Underdamped spring
resolveSpring = (t) => {
const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);
return (target -
envelope *
(((initialVelocity +
dampingRatio * undampedAngularFreq * initialDelta) /
angularFreq) *
Math.sin(angularFreq * t) +
initialDelta * Math.cos(angularFreq * t)));
};
}
else if (dampingRatio === 1) {
// Critically damped spring
resolveSpring = (t) => target -
Math.exp(-undampedAngularFreq * t) *
(initialDelta +
(initialVelocity + undampedAngularFreq * initialDelta) * t);
}
else {
// Overdamped spring
const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);
resolveSpring = (t) => {
const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);
// When performing sinh or cosh values can hit Infinity so we cap them here
const freqForT = Math.min(dampedAngularFreq * t, 300);
return (target -
(envelope *
((initialVelocity +
dampingRatio * undampedAngularFreq * initialDelta) *
Math.sinh(freqForT) +
dampedAngularFreq *
initialDelta *
Math.cosh(freqForT))) /
dampedAngularFreq);
};
}
const generator = {
calculatedDuration: isResolvedFromDuration ? duration || null : null,
next: (t) => {
const current = resolveSpring(t);
if (!isResolvedFromDuration) {
let currentVelocity = 0.0;
/**
* We only need to calculate velocity for under-damped springs
* as over- and critically-damped springs can't overshoot, so
* checking only for displacement is enough.
*/
if (dampingRatio < 1) {
currentVelocity =
t === 0
? time_conversion_secondsToMilliseconds(initialVelocity)
: calcGeneratorVelocity(resolveSpring, t, current);
}
const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;
const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;
state.done =
isBelowVelocityThreshold && isBelowDisplacementThreshold;
}
else {
state.done = t >= duration;
}
state.value = state.done ? target : current;
return state;
},
toString: () => {
const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);
const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);
return calculatedDuration + "ms " + easing;
},
};
return generator;
}
;// ./node_modules/framer-motion/dist/es/animation/generators/inertia.mjs
function inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {
const origin = keyframes[0];
const state = {
done: false,
value: origin,
};
const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);
const nearestBoundary = (v) => {
if (min === undefined)
return max;
if (max === undefined)
return min;
return Math.abs(min - v) < Math.abs(max - v) ? min : max;
};
let amplitude = power * velocity;
const ideal = origin + amplitude;
const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);
/**
* If the target has changed we need to re-calculate the amplitude, otherwise
* the animation will start from the wrong position.
*/
if (target !== ideal)
amplitude = target - origin;
const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);
const calcLatest = (t) => target + calcDelta(t);
const applyFriction = (t) => {
const delta = calcDelta(t);
const latest = calcLatest(t);
state.done = Math.abs(delta) <= restDelta;
state.value = state.done ? target : latest;
};
/**
* Ideally this would resolve for t in a stateless way, we could
* do that by always precalculating the animation but as we know
* this will be done anyway we can assume that spring will
* be discovered during that.
*/
let timeReachedBoundary;
let spring$1;
const checkCatchBoundary = (t) => {
if (!isOutOfBounds(state.value))
return;
timeReachedBoundary = t;
spring$1 = spring({
keyframes: [state.value, nearestBoundary(state.value)],
velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000
damping: bounceDamping,
stiffness: bounceStiffness,
restDelta,
restSpeed,
});
};
checkCatchBoundary(0);
return {
calculatedDuration: null,
next: (t) => {
/**
* We need to resolve the friction to figure out if we need a
* spring but we don't want to do this twice per frame. So here
* we flag if we updated for this frame and later if we did
* we can skip doing it again.
*/
let hasUpdatedFrame = false;
if (!spring$1 && timeReachedBoundary === undefined) {
hasUpdatedFrame = true;
applyFriction(t);
checkCatchBoundary(t);
}
/**
* If we have a spring and the provided t is beyond the moment the friction
* animation crossed the min/max boundary, use the spring.
*/
if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {
return spring$1.next(t - timeReachedBoundary);
}
else {
!hasUpdatedFrame && applyFriction(t);
return state;
}
},
};
}
;// ./node_modules/framer-motion/dist/es/easing/ease.mjs
const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1);
const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1);
const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1);
;// ./node_modules/framer-motion/dist/es/easing/utils/is-easing-array.mjs
const isEasingArray = (ease) => {
return Array.isArray(ease) && typeof ease[0] !== "number";
};
;// ./node_modules/framer-motion/dist/es/easing/utils/map.mjs
const easingLookup = {
linear: noop_noop,
easeIn: easeIn,
easeInOut: easeInOut,
easeOut: easeOut,
circIn: circIn,
circInOut: circInOut,
circOut: circOut,
backIn: backIn,
backInOut: backInOut,
backOut: backOut,
anticipate: anticipate,
};
const easingDefinitionToFunction = (definition) => {
if (isBezierDefinition(definition)) {
// If cubic bezier definition, create bezier curve
errors_invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`);
const [x1, y1, x2, y2] = definition;
return cubicBezier(x1, y1, x2, y2);
}
else if (typeof definition === "string") {
// Else lookup from table
errors_invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`);
return easingLookup[definition];
}
return definition;
};
;// ./node_modules/framer-motion/dist/es/utils/interpolate.mjs
function createMixers(output, ease, customMixer) {
const mixers = [];
const mixerFactory = customMixer || mix;
const numMixers = output.length - 1;
for (let i = 0; i < numMixers; i++) {
let mixer = mixerFactory(output[i], output[i + 1]);
if (ease) {
const easingFunction = Array.isArray(ease) ? ease[i] || noop_noop : ease;
mixer = pipe(easingFunction, mixer);
}
mixers.push(mixer);
}
return mixers;
}
/**
* Create a function that maps from a numerical input array to a generic output array.
*
* Accepts:
* - Numbers
* - Colors (hex, hsl, hsla, rgb, rgba)
* - Complex (combinations of one or more numbers or strings)
*
* ```jsx
* const mixColor = interpolate([0, 1], ['#fff', '#000'])
*
* mixColor(0.5) // 'rgba(128, 128, 128, 1)'
* ```
*
* TODO Revist this approach once we've moved to data models for values,
* probably not needed to pregenerate mixer functions.
*
* @public
*/
function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {
const inputLength = input.length;
errors_invariant(inputLength === output.length, "Both input and output ranges must be the same length");
/**
* If we're only provided a single input, we can just make a function
* that returns the output.
*/
if (inputLength === 1)
return () => output[0];
if (inputLength === 2 && output[0] === output[1])
return () => output[1];
const isZeroDeltaRange = input[0] === input[1];
// If input runs highest -> lowest, reverse both arrays
if (input[0] > input[inputLength - 1]) {
input = [...input].reverse();
output = [...output].reverse();
}
const mixers = createMixers(output, ease, mixer);
const numMixers = mixers.length;
const interpolator = (v) => {
if (isZeroDeltaRange && v < input[0])
return output[0];
let i = 0;
if (numMixers > 1) {
for (; i < input.length - 2; i++) {
if (v < input[i + 1])
break;
}
}
const progressInRange = progress(input[i], input[i + 1], v);
return mixers[i](progressInRange);
};
return isClamp
? (v) => interpolator(clamp_clamp(input[0], input[inputLength - 1], v))
: interpolator;
}
;// ./node_modules/framer-motion/dist/es/utils/offsets/fill.mjs
function fillOffset(offset, remaining) {
const min = offset[offset.length - 1];
for (let i = 1; i <= remaining; i++) {
const offsetProgress = progress(0, remaining, i);
offset.push(mixNumber(min, 1, offsetProgress));
}
}
;// ./node_modules/framer-motion/dist/es/utils/offsets/default.mjs
function defaultOffset(arr) {
const offset = [0];
fillOffset(offset, arr.length - 1);
return offset;
}
;// ./node_modules/framer-motion/dist/es/utils/offsets/time.mjs
function convertOffsetToTimes(offset, duration) {
return offset.map((o) => o * duration);
}
;// ./node_modules/framer-motion/dist/es/animation/generators/keyframes.mjs
function keyframes_defaultEasing(values, easing) {
return values.map(() => easing || easeInOut).splice(0, values.length - 1);
}
function keyframes_keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) {
/**
* Easing functions can be externally defined as strings. Here we convert them
* into actual functions.
*/
const easingFunctions = isEasingArray(ease)
? ease.map(easingDefinitionToFunction)
: easingDefinitionToFunction(ease);
/**
* This is the Iterator-spec return value. We ensure it's mutable rather than using a generator
* to reduce GC during animation.
*/
const state = {
done: false,
value: keyframeValues[0],
};
/**
* Create a times array based on the provided 0-1 offsets
*/
const absoluteTimes = convertOffsetToTimes(
// Only use the provided offsets if they're the correct length
// TODO Maybe we should warn here if there's a length mismatch
times && times.length === keyframeValues.length
? times
: defaultOffset(keyframeValues), duration);
const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {
ease: Array.isArray(easingFunctions)
? easingFunctions
: keyframes_defaultEasing(keyframeValues, easingFunctions),
});
return {
calculatedDuration: duration,
next: (t) => {
state.value = mapTimeToKeyframe(t);
state.done = t >= duration;
return state;
},
};
}
;// ./node_modules/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.mjs
const frameloopDriver = (update) => {
const passTimestamp = ({ timestamp }) => update(timestamp);
return {
start: () => frame_frame.update(passTimestamp, true),
stop: () => cancelFrame(passTimestamp),
/**
* If we're processing this frame we can use the
* framelocked timestamp to keep things in sync.
*/
now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),
};
};
;// ./node_modules/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs
const generators = {
decay: inertia,
inertia: inertia,
tween: keyframes_keyframes,
keyframes: keyframes_keyframes,
spring: spring,
};
const percentToProgress = (percent) => percent / 100;
/**
* Animation that runs on the main thread. Designed to be WAAPI-spec in the subset of
* features we expose publically. Mostly the compatibility is to ensure visual identity
* between both WAAPI and main thread animations.
*/
class MainThreadAnimation extends BaseAnimation {
constructor(options) {
super(options);
/**
* The time at which the animation was paused.
*/
this.holdTime = null;
/**
* The time at which the animation was cancelled.
*/
this.cancelTime = null;
/**
* The current time of the animation.
*/
this.currentTime = 0;
/**
* Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.
*/
this.playbackSpeed = 1;
/**
* The state of the animation to apply when the animation is resolved. This
* allows calls to the public API to control the animation before it is resolved,
* without us having to resolve it first.
*/
this.pendingPlayState = "running";
/**
* The time at which the animation was started.
*/
this.startTime = null;
this.state = "idle";
/**
* This method is bound to the instance to fix a pattern where
* animation.stop is returned as a reference from a useEffect.
*/
this.stop = () => {
this.resolver.cancel();
this.isStopped = true;
if (this.state === "idle")
return;
this.teardown();
const { onStop } = this.options;
onStop && onStop();
};
const { name, motionValue, element, keyframes } = this.options;
const KeyframeResolver$1 = (element === null || element === void 0 ? void 0 : element.KeyframeResolver) || KeyframeResolver;
const onResolved = (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe);
this.resolver = new KeyframeResolver$1(keyframes, onResolved, name, motionValue, element);
this.resolver.scheduleResolve();
}
flatten() {
super.flatten();
// If we've already resolved the animation, re-initialise it
if (this._resolved) {
Object.assign(this._resolved, this.initPlayback(this._resolved.keyframes));
}
}
initPlayback(keyframes$1) {
const { type = "keyframes", repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = this.options;
const generatorFactory = isGenerator(type)
? type
: generators[type] || keyframes_keyframes;
/**
* If our generator doesn't support mixing numbers, we need to replace keyframes with
* [0, 100] and then make a function that maps that to the actual keyframes.
*
* 100 is chosen instead of 1 as it works nicer with spring animations.
*/
let mapPercentToKeyframes;
let mirroredGenerator;
if (generatorFactory !== keyframes_keyframes &&
typeof keyframes$1[0] !== "number") {
if (false) {}
mapPercentToKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));
keyframes$1 = [0, 100];
}
const generator = generatorFactory({ ...this.options, keyframes: keyframes$1 });
/**
* If we have a mirror repeat type we need to create a second generator that outputs the
* mirrored (not reversed) animation and later ping pong between the two generators.
*/
if (repeatType === "mirror") {
mirroredGenerator = generatorFactory({
...this.options,
keyframes: [...keyframes$1].reverse(),
velocity: -velocity,
});
}
/**
* If duration is undefined and we have repeat options,
* we need to calculate a duration from the generator.
*
* We set it to the generator itself to cache the duration.
* Any timeline resolver will need to have already precalculated
* the duration by this step.
*/
if (generator.calculatedDuration === null) {
generator.calculatedDuration = calcGeneratorDuration(generator);
}
const { calculatedDuration } = generator;
const resolvedDuration = calculatedDuration + repeatDelay;
const totalDuration = resolvedDuration * (repeat + 1) - repeatDelay;
return {
generator,
mirroredGenerator,
mapPercentToKeyframes,
calculatedDuration,
resolvedDuration,
totalDuration,
};
}
onPostResolved() {
const { autoplay = true } = this.options;
this.play();
if (this.pendingPlayState === "paused" || !autoplay) {
this.pause();
}
else {
this.state = this.pendingPlayState;
}
}
tick(timestamp, sample = false) {
const { resolved } = this;
// If the animations has failed to resolve, return the final keyframe.
if (!resolved) {
const { keyframes } = this.options;
return { done: true, value: keyframes[keyframes.length - 1] };
}
const { finalKeyframe, generator, mirroredGenerator, mapPercentToKeyframes, keyframes, calculatedDuration, totalDuration, resolvedDuration, } = resolved;
if (this.startTime === null)
return generator.next(0);
const { delay, repeat, repeatType, repeatDelay, onUpdate } = this.options;
/**
* requestAnimationFrame timestamps can come through as lower than
* the startTime as set by performance.now(). Here we prevent this,
* though in the future it could be possible to make setting startTime
* a pending operation that gets resolved here.
*/
if (this.speed > 0) {
this.startTime = Math.min(this.startTime, timestamp);
}
else if (this.speed < 0) {
this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);
}
// Update currentTime
if (sample) {
this.currentTime = timestamp;
}
else if (this.holdTime !== null) {
this.currentTime = this.holdTime;
}
else {
// Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =
// 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for
// example.
this.currentTime =
Math.round(timestamp - this.startTime) * this.speed;
}
// Rebase on delay
const timeWithoutDelay = this.currentTime - delay * (this.speed >= 0 ? 1 : -1);
const isInDelayPhase = this.speed >= 0
? timeWithoutDelay < 0
: timeWithoutDelay > totalDuration;
this.currentTime = Math.max(timeWithoutDelay, 0);
// If this animation has finished, set the current time to the total duration.
if (this.state === "finished" && this.holdTime === null) {
this.currentTime = totalDuration;
}
let elapsed = this.currentTime;
let frameGenerator = generator;
if (repeat) {
/**
* Get the current progress (0-1) of the animation. If t is >
* than duration we'll get values like 2.5 (midway through the
* third iteration)
*/
const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;
/**
* Get the current iteration (0 indexed). For instance the floor of
* 2.5 is 2.
*/
let currentIteration = Math.floor(progress);
/**
* Get the current progress of the iteration by taking the remainder
* so 2.5 is 0.5 through iteration 2
*/
let iterationProgress = progress % 1.0;
/**
* If iteration progress is 1 we count that as the end
* of the previous iteration.
*/
if (!iterationProgress && progress >= 1) {
iterationProgress = 1;
}
iterationProgress === 1 && currentIteration--;
currentIteration = Math.min(currentIteration, repeat + 1);
/**
* Reverse progress if we're not running in "normal" direction
*/
const isOddIteration = Boolean(currentIteration % 2);
if (isOddIteration) {
if (repeatType === "reverse") {
iterationProgress = 1 - iterationProgress;
if (repeatDelay) {
iterationProgress -= repeatDelay / resolvedDuration;
}
}
else if (repeatType === "mirror") {
frameGenerator = mirroredGenerator;
}
}
elapsed = clamp_clamp(0, 1, iterationProgress) * resolvedDuration;
}
/**
* If we're in negative time, set state as the initial keyframe.
* This prevents delay: x, duration: 0 animations from finishing
* instantly.
*/
const state = isInDelayPhase
? { done: false, value: keyframes[0] }
: frameGenerator.next(elapsed);
if (mapPercentToKeyframes) {
state.value = mapPercentToKeyframes(state.value);
}
let { done } = state;
if (!isInDelayPhase && calculatedDuration !== null) {
done =
this.speed >= 0
? this.currentTime >= totalDuration
: this.currentTime <= 0;
}
const isAnimationFinished = this.holdTime === null &&
(this.state === "finished" || (this.state === "running" && done));
if (isAnimationFinished && finalKeyframe !== undefined) {
state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe);
}
if (onUpdate) {
onUpdate(state.value);
}
if (isAnimationFinished) {
this.finish();
}
return state;
}
get duration() {
const { resolved } = this;
return resolved ? millisecondsToSeconds(resolved.calculatedDuration) : 0;
}
get time() {
return millisecondsToSeconds(this.currentTime);
}
set time(newTime) {
newTime = time_conversion_secondsToMilliseconds(newTime);
this.currentTime = newTime;
if (this.holdTime !== null || this.speed === 0) {
this.holdTime = newTime;
}
else if (this.driver) {
this.startTime = this.driver.now() - newTime / this.speed;
}
}
get speed() {
return this.playbackSpeed;
}
set speed(newSpeed) {
const hasChanged = this.playbackSpeed !== newSpeed;
this.playbackSpeed = newSpeed;
if (hasChanged) {
this.time = millisecondsToSeconds(this.currentTime);
}
}
play() {
if (!this.resolver.isScheduled) {
this.resolver.resume();
}
if (!this._resolved) {
this.pendingPlayState = "running";
return;
}
if (this.isStopped)
return;
const { driver = frameloopDriver, onPlay, startTime } = this.options;
if (!this.driver) {
this.driver = driver((timestamp) => this.tick(timestamp));
}
onPlay && onPlay();
const now = this.driver.now();
if (this.holdTime !== null) {
this.startTime = now - this.holdTime;
}
else if (!this.startTime) {
this.startTime = startTime !== null && startTime !== void 0 ? startTime : this.calcStartTime();
}
else if (this.state === "finished") {
this.startTime = now;
}
if (this.state === "finished") {
this.updateFinishedPromise();
}
this.cancelTime = this.startTime;
this.holdTime = null;
/**
* Set playState to running only after we've used it in
* the previous logic.
*/
this.state = "running";
this.driver.start();
}
pause() {
var _a;
if (!this._resolved) {
this.pendingPlayState = "paused";
return;
}
this.state = "paused";
this.holdTime = (_a = this.currentTime) !== null && _a !== void 0 ? _a : 0;
}
complete() {
if (this.state !== "running") {
this.play();
}
this.pendingPlayState = this.state = "finished";
this.holdTime = null;
}
finish() {
this.teardown();
this.state = "finished";
const { onComplete } = this.options;
onComplete && onComplete();
}
cancel() {
if (this.cancelTime !== null) {
this.tick(this.cancelTime);
}
this.teardown();
this.updateFinishedPromise();
}
teardown() {
this.state = "idle";
this.stopDriver();
this.resolveFinishedPromise();
this.updateFinishedPromise();
this.startTime = this.cancelTime = null;
this.resolver.cancel();
}
stopDriver() {
if (!this.driver)
return;
this.driver.stop();
this.driver = undefined;
}
sample(time) {
this.startTime = 0;
return this.tick(time, true);
}
}
// Legacy interface
function animateValue(options) {
return new MainThreadAnimation(options);
}
;// ./node_modules/framer-motion/dist/es/animation/animators/utils/accelerated-values.mjs
/**
* A list of values that can be hardware-accelerated.
*/
const acceleratedValues = new Set([
"opacity",
"clipPath",
"filter",
"transform",
// TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
// or until we implement support for linear() easing.
// "background-color"
]);
;// ./node_modules/framer-motion/dist/es/animation/animators/waapi/index.mjs
function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeInOut", times, } = {}) {
const keyframeOptions = { [valueName]: keyframes };
if (times)
keyframeOptions.offset = times;
const easing = easing_mapEasingToNativeEasing(ease, duration);
/**
* If this is an easing array, apply to keyframes, not animation as a whole
*/
if (Array.isArray(easing))
keyframeOptions.easing = easing;
return element.animate(keyframeOptions, {
delay,
duration,
easing: !Array.isArray(easing) ? easing : "linear",
fill: "both",
iterations: repeat + 1,
direction: repeatType === "reverse" ? "alternate" : "normal",
});
}
;// ./node_modules/framer-motion/dist/es/animation/animators/waapi/utils/supports-waapi.mjs
const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
;// ./node_modules/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs
/**
* 10ms is chosen here as it strikes a balance between smooth
* results (more than one keyframe per frame at 60fps) and
* keyframe quantity.
*/
const sampleDelta = 10; //ms
/**
* Implement a practical max duration for keyframe generation
* to prevent infinite loops
*/
const maxDuration = 20000;
/**
* Check if an animation can run natively via WAAPI or requires pregenerated keyframes.
* WAAPI doesn't support spring or function easings so we run these as JS animation before
* handing off.
*/
function requiresPregeneratedKeyframes(options) {
return (isGenerator(options.type) ||
options.type === "spring" ||
!isWaapiSupportedEasing(options.ease));
}
function pregenerateKeyframes(keyframes, options) {
/**
* Create a main-thread animation to pregenerate keyframes.
* We sample this at regular intervals to generate keyframes that we then
* linearly interpolate between.
*/
const sampleAnimation = new MainThreadAnimation({
...options,
keyframes,
repeat: 0,
delay: 0,
isGenerator: true,
});
let state = { done: false, value: keyframes[0] };
const pregeneratedKeyframes = [];
/**
* Bail after 20 seconds of pre-generated keyframes as it's likely
* we're heading for an infinite loop.
*/
let t = 0;
while (!state.done && t < maxDuration) {
state = sampleAnimation.sample(t);
pregeneratedKeyframes.push(state.value);
t += sampleDelta;
}
return {
times: undefined,
keyframes: pregeneratedKeyframes,
duration: t - sampleDelta,
ease: "linear",
};
}
const unsupportedEasingFunctions = {
anticipate: anticipate,
backInOut: backInOut,
circInOut: circInOut,
};
function isUnsupportedEase(key) {
return key in unsupportedEasingFunctions;
}
class AcceleratedAnimation extends BaseAnimation {
constructor(options) {
super(options);
const { name, motionValue, element, keyframes } = this.options;
this.resolver = new DOMKeyframesResolver(keyframes, (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe), name, motionValue, element);
this.resolver.scheduleResolve();
}
initPlayback(keyframes, finalKeyframe) {
let { duration = 300, times, ease, type, motionValue, name, startTime, } = this.options;
/**
* If element has since been unmounted, return false to indicate
* the animation failed to initialised.
*/
if (!motionValue.owner || !motionValue.owner.current) {
return false;
}
/**
* If the user has provided an easing function name that isn't supported
* by WAAPI (like "anticipate"), we need to provide the corressponding
* function. This will later get converted to a linear() easing function.
*/
if (typeof ease === "string" &&
supportsLinearEasing() &&
isUnsupportedEase(ease)) {
ease = unsupportedEasingFunctions[ease];
}
/**
* If this animation needs pre-generated keyframes then generate.
*/
if (requiresPregeneratedKeyframes(this.options)) {
const { onComplete, onUpdate, motionValue, element, ...options } = this.options;
const pregeneratedAnimation = pregenerateKeyframes(keyframes, options);
keyframes = pregeneratedAnimation.keyframes;
// If this is a very short animation, ensure we have
// at least two keyframes to animate between as older browsers
// can't animate between a single keyframe.
if (keyframes.length === 1) {
keyframes[1] = keyframes[0];
}
duration = pregeneratedAnimation.duration;
times = pregeneratedAnimation.times;
ease = pregeneratedAnimation.ease;
type = "keyframes";
}
const animation = startWaapiAnimation(motionValue.owner.current, name, keyframes, { ...this.options, duration, times, ease });
// Override the browser calculated startTime with one synchronised to other JS
// and WAAPI animations starting this event loop.
animation.startTime = startTime !== null && startTime !== void 0 ? startTime : this.calcStartTime();
if (this.pendingTimeline) {
attachTimeline(animation, this.pendingTimeline);
this.pendingTimeline = undefined;
}
else {
/**
* Prefer the `onfinish` prop as it's more widely supported than
* the `finished` promise.
*
* Here, we synchronously set the provided MotionValue to the end
* keyframe. If we didn't, when the WAAPI animation is finished it would
* be removed from the element which would then revert to its old styles.
*/
animation.onfinish = () => {
const { onComplete } = this.options;
motionValue.set(getFinalKeyframe(keyframes, this.options, finalKeyframe));
onComplete && onComplete();
this.cancel();
this.resolveFinishedPromise();
};
}
return {
animation,
duration,
times,
type,
ease,
keyframes: keyframes,
};
}
get duration() {
const { resolved } = this;
if (!resolved)
return 0;
const { duration } = resolved;
return millisecondsToSeconds(duration);
}
get time() {
const { resolved } = this;
if (!resolved)
return 0;
const { animation } = resolved;
return millisecondsToSeconds(animation.currentTime || 0);
}
set time(newTime) {
const { resolved } = this;
if (!resolved)
return;
const { animation } = resolved;
animation.currentTime = time_conversion_secondsToMilliseconds(newTime);
}
get speed() {
const { resolved } = this;
if (!resolved)
return 1;
const { animation } = resolved;
return animation.playbackRate;
}
set speed(newSpeed) {
const { resolved } = this;
if (!resolved)
return;
const { animation } = resolved;
animation.playbackRate = newSpeed;
}
get state() {
const { resolved } = this;
if (!resolved)
return "idle";
const { animation } = resolved;
return animation.playState;
}
get startTime() {
const { resolved } = this;
if (!resolved)
return null;
const { animation } = resolved;
// Coerce to number as TypeScript incorrectly types this
// as CSSNumberish
return animation.startTime;
}
/**
* Replace the default DocumentTimeline with another AnimationTimeline.
* Currently used for scroll animations.
*/
attachTimeline(timeline) {
if (!this._resolved) {
this.pendingTimeline = timeline;
}
else {
const { resolved } = this;
if (!resolved)
return noop_noop;
const { animation } = resolved;
attachTimeline(animation, timeline);
}
return noop_noop;
}
play() {
if (this.isStopped)
return;
const { resolved } = this;
if (!resolved)
return;
const { animation } = resolved;
if (animation.playState === "finished") {
this.updateFinishedPromise();
}
animation.play();
}
pause() {
const { resolved } = this;
if (!resolved)
return;
const { animation } = resolved;
animation.pause();
}
stop() {
this.resolver.cancel();
this.isStopped = true;
if (this.state === "idle")
return;
this.resolveFinishedPromise();
this.updateFinishedPromise();
const { resolved } = this;
if (!resolved)
return;
const { animation, keyframes, duration, type, ease, times } = resolved;
if (animation.playState === "idle" ||
animation.playState === "finished") {
return;
}
/**
* WAAPI doesn't natively have any interruption capabilities.
*
* Rather than read commited styles back out of the DOM, we can
* create a renderless JS animation and sample it twice to calculate
* its current value, "previous" value, and therefore allow
* Motion to calculate velocity for any subsequent animation.
*/
if (this.time) {
const { motionValue, onUpdate, onComplete, element, ...options } = this.options;
const sampleAnimation = new MainThreadAnimation({
...options,
keyframes,
duration,
type,
ease,
times,
isGenerator: true,
});
const sampleTime = time_conversion_secondsToMilliseconds(this.time);
motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);
}
const { onStop } = this.options;
onStop && onStop();
this.cancel();
}
complete() {
const { resolved } = this;
if (!resolved)
return;
resolved.animation.finish();
}
cancel() {
const { resolved } = this;
if (!resolved)
return;
resolved.animation.cancel();
}
static supports(options) {
const { motionValue, name, repeatDelay, repeatType, damping, type } = options;
if (!motionValue ||
!motionValue.owner ||
!(motionValue.owner.current instanceof HTMLElement)) {
return false;
}
const { onUpdate, transformTemplate } = motionValue.owner.getProps();
return (supportsWaapi() &&
name &&
acceleratedValues.has(name) &&
/**
* If we're outputting values to onUpdate then we can't use WAAPI as there's
* no way to read the value from WAAPI every frame.
*/
!onUpdate &&
!transformTemplate &&
!repeatDelay &&
repeatType !== "mirror" &&
damping !== 0 &&
type !== "inertia");
}
}
;// ./node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs
const underDampedSpring = {
type: "spring",
stiffness: 500,
damping: 25,
restSpeed: 10,
};
const criticallyDampedSpring = (target) => ({
type: "spring",
stiffness: 550,
damping: target === 0 ? 2 * Math.sqrt(550) : 30,
restSpeed: 10,
});
const keyframesTransition = {
type: "keyframes",
duration: 0.8,
};
/**
* Default easing curve is a slightly shallower version of
* the default browser easing curve.
*/
const ease = {
type: "keyframes",
ease: [0.25, 0.1, 0.35, 1],
duration: 0.3,
};
const getDefaultTransition = (valueKey, { keyframes }) => {
if (keyframes.length > 2) {
return keyframesTransition;
}
else if (transformProps.has(valueKey)) {
return valueKey.startsWith("scale")
? criticallyDampedSpring(keyframes[1])
: underDampedSpring;
}
return ease;
};
;// ./node_modules/framer-motion/dist/es/animation/utils/is-transition-defined.mjs
/**
* Decide whether a transition is defined on a given Transition.
* This filters out orchestration options and returns true
* if any options are left.
*/
function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {
return !!Object.keys(transition).length;
}
;// ./node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs
const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {
const valueTransition = get_value_transition_getValueTransition(transition, name) || {};
/**
* Most transition values are currently completely overwritten by value-specific
* transitions. In the future it'd be nicer to blend these transitions. But for now
* delay actually does inherit from the root transition if not value-specific.
*/
const delay = valueTransition.delay || transition.delay || 0;
/**
* Elapsed isn't a public transition option but can be passed through from
* optimized appear effects in milliseconds.
*/
let { elapsed = 0 } = transition;
elapsed = elapsed - time_conversion_secondsToMilliseconds(delay);
let options = {
keyframes: Array.isArray(target) ? target : [null, target],
ease: "easeOut",
velocity: value.getVelocity(),
...valueTransition,
delay: -elapsed,
onUpdate: (v) => {
value.set(v);
valueTransition.onUpdate && valueTransition.onUpdate(v);
},
onComplete: () => {
onComplete();
valueTransition.onComplete && valueTransition.onComplete();
},
name,
motionValue: value,
element: isHandoff ? undefined : element,
};
/**
* If there's no transition defined for this value, we can generate
* unqiue transition settings for this value.
*/
if (!isTransitionDefined(valueTransition)) {
options = {
...options,
...getDefaultTransition(name, options),
};
}
/**
* Both WAAPI and our internal animation functions use durations
* as defined by milliseconds, while our external API defines them
* as seconds.
*/
if (options.duration) {
options.duration = time_conversion_secondsToMilliseconds(options.duration);
}
if (options.repeatDelay) {
options.repeatDelay = time_conversion_secondsToMilliseconds(options.repeatDelay);
}
if (options.from !== undefined) {
options.keyframes[0] = options.from;
}
let shouldSkip = false;
if (options.type === false ||
(options.duration === 0 && !options.repeatDelay)) {
options.duration = 0;
if (options.delay === 0) {
shouldSkip = true;
}
}
if (instantAnimationState.current ||
MotionGlobalConfig.skipAnimations) {
shouldSkip = true;
options.duration = 0;
options.delay = 0;
}
/**
* If we can or must skip creating the animation, and apply only
* the final keyframe, do so. We also check once keyframes are resolved but
* this early check prevents the need to create an animation at all.
*/
if (shouldSkip && !isHandoff && value.get() !== undefined) {
const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);
if (finalKeyframe !== undefined) {
frame_frame.update(() => {
options.onUpdate(finalKeyframe);
options.onComplete();
});
// We still want to return some animation controls here rather
// than returning undefined
return new GroupPlaybackControls([]);
}
}
/**
* Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via
* WAAPI. Therefore, this animation must be JS to ensure it runs "under" the
* optimised animation.
*/
if (!isHandoff && AcceleratedAnimation.supports(options)) {
return new AcceleratedAnimation(options);
}
else {
return new MainThreadAnimation(options);
}
};
;// ./node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs
/**
* Decide whether we should block this animation. Previously, we achieved this
* just by checking whether the key was listed in protectedKeys, but this
* posed problems if an animation was triggered by afterChildren and protectedKeys
* had been set to true in the meantime.
*/
function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {
const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;
needsAnimating[key] = false;
return shouldBlock;
}
function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {
var _a;
let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition;
if (transitionOverride)
transition = transitionOverride;
const animations = [];
const animationTypeState = type &&
visualElement.animationState &&
visualElement.animationState.getState()[type];
for (const key in target) {
const value = visualElement.getValue(key, (_a = visualElement.latestValues[key]) !== null && _a !== void 0 ? _a : null);
const valueTarget = target[key];
if (valueTarget === undefined ||
(animationTypeState &&
shouldBlockAnimation(animationTypeState, key))) {
continue;
}
const valueTransition = {
delay,
...get_value_transition_getValueTransition(transition || {}, key),
};
/**
* If this is the first time a value is being animated, check
* to see if we're handling off from an existing animation.
*/
let isHandoff = false;
if (window.MotionHandoffAnimation) {
const appearId = getOptimisedAppearId(visualElement);
if (appearId) {
const startTime = window.MotionHandoffAnimation(appearId, key, frame_frame);
if (startTime !== null) {
valueTransition.startTime = startTime;
isHandoff = true;
}
}
}
addValueToWillChange(visualElement, key);
value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && positionalKeys.has(key)
? { type: false }
: valueTransition, visualElement, isHandoff));
const animation = value.animation;
if (animation) {
animations.push(animation);
}
}
if (transitionEnd) {
Promise.all(animations).then(() => {
frame_frame.update(() => {
transitionEnd && setTarget(visualElement, transitionEnd);
});
});
}
return animations;
}
;// ./node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs
function animateVariant(visualElement, variant, options = {}) {
var _a;
const resolved = resolveVariant(visualElement, variant, options.type === "exit"
? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom
: undefined);
let { transition = visualElement.getDefaultTransition() || {} } = resolved || {};
if (options.transitionOverride) {
transition = options.transitionOverride;
}
/**
* If we have a variant, create a callback that runs it as an animation.
* Otherwise, we resolve a Promise immediately for a composable no-op.
*/
const getAnimation = resolved
? () => Promise.all(animateTarget(visualElement, resolved, options))
: () => Promise.resolve();
/**
* If we have children, create a callback that runs all their animations.
* Otherwise, we resolve a Promise immediately for a composable no-op.
*/
const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size
? (forwardDelay = 0) => {
const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;
return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options);
}
: () => Promise.resolve();
/**
* If the transition explicitly defines a "when" option, we need to resolve either
* this animation or all children animations before playing the other.
*/
const { when } = transition;
if (when) {
const [first, last] = when === "beforeChildren"
? [getAnimation, getChildAnimations]
: [getChildAnimations, getAnimation];
return first().then(() => last());
}
else {
return Promise.all([getAnimation(), getChildAnimations(options.delay)]);
}
}
function animateChildren(visualElement, variant, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {
const animations = [];
const maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren;
const generateStaggerDuration = staggerDirection === 1
? (i = 0) => i * staggerChildren
: (i = 0) => maxStaggerDuration - i * staggerChildren;
Array.from(visualElement.variantChildren)
.sort(sortByTreeOrder)
.forEach((child, i) => {
child.notify("AnimationStart", variant);
animations.push(animateVariant(child, variant, {
...options,
delay: delayChildren + generateStaggerDuration(i),
}).then(() => child.notify("AnimationComplete", variant)));
});
return Promise.all(animations);
}
function sortByTreeOrder(a, b) {
return a.sortNodePosition(b);
}
;// ./node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs
function animateVisualElement(visualElement, definition, options = {}) {
visualElement.notify("AnimationStart", definition);
let animation;
if (Array.isArray(definition)) {
const animations = definition.map((variant) => animateVariant(visualElement, variant, options));
animation = Promise.all(animations);
}
else if (typeof definition === "string") {
animation = animateVariant(visualElement, definition, options);
}
else {
const resolvedDefinition = typeof definition === "function"
? resolveVariant(visualElement, definition, options.custom)
: definition;
animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));
}
return animation.then(() => {
visualElement.notify("AnimationComplete", definition);
});
}
;// ./node_modules/framer-motion/dist/es/render/utils/get-variant-context.mjs
const numVariantProps = variantProps.length;
function getVariantContext(visualElement) {
if (!visualElement)
return undefined;
if (!visualElement.isControllingVariants) {
const context = visualElement.parent
? getVariantContext(visualElement.parent) || {}
: {};
if (visualElement.props.initial !== undefined) {
context.initial = visualElement.props.initial;
}
return context;
}
const context = {};
for (let i = 0; i < numVariantProps; i++) {
const name = variantProps[i];
const prop = visualElement.props[name];
if (isVariantLabel(prop) || prop === false) {
context[name] = prop;
}
}
return context;
}
;// ./node_modules/framer-motion/dist/es/render/utils/animation-state.mjs
const reversePriorityOrder = [...variantPriorityOrder].reverse();
const numAnimationTypes = variantPriorityOrder.length;
function animateList(visualElement) {
return (animations) => Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options)));
}
function createAnimationState(visualElement) {
let animate = animateList(visualElement);
let state = createState();
let isInitialRender = true;
/**
* This function will be used to reduce the animation definitions for
* each active animation type into an object of resolved values for it.
*/
const buildResolvedTypeValues = (type) => (acc, definition) => {
var _a;
const resolved = resolveVariant(visualElement, definition, type === "exit"
? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom
: undefined);
if (resolved) {
const { transition, transitionEnd, ...target } = resolved;
acc = { ...acc, ...target, ...transitionEnd };
}
return acc;
};
/**
* This just allows us to inject mocked animation functions
* @internal
*/
function setAnimateFunction(makeAnimator) {
animate = makeAnimator(visualElement);
}
/**
* When we receive new props, we need to:
* 1. Create a list of protected keys for each type. This is a directory of
* value keys that are currently being "handled" by types of a higher priority
* so that whenever an animation is played of a given type, these values are
* protected from being animated.
* 2. Determine if an animation type needs animating.
* 3. Determine if any values have been removed from a type and figure out
* what to animate those to.
*/
function animateChanges(changedActiveType) {
const { props } = visualElement;
const context = getVariantContext(visualElement.parent) || {};
/**
* A list of animations that we'll build into as we iterate through the animation
* types. This will get executed at the end of the function.
*/
const animations = [];
/**
* Keep track of which values have been removed. Then, as we hit lower priority
* animation types, we can check if they contain removed values and animate to that.
*/
const removedKeys = new Set();
/**
* A dictionary of all encountered keys. This is an object to let us build into and
* copy it without iteration. Each time we hit an animation type we set its protected
* keys - the keys its not allowed to animate - to the latest version of this object.
*/
let encounteredKeys = {};
/**
* If a variant has been removed at a given index, and this component is controlling
* variant animations, we want to ensure lower-priority variants are forced to animate.
*/
let removedVariantIndex = Infinity;
/**
* Iterate through all animation types in reverse priority order. For each, we want to
* detect which values it's handling and whether or not they've changed (and therefore
* need to be animated). If any values have been removed, we want to detect those in
* lower priority props and flag for animation.
*/
for (let i = 0; i < numAnimationTypes; i++) {
const type = reversePriorityOrder[i];
const typeState = state[type];
const prop = props[type] !== undefined
? props[type]
: context[type];
const propIsVariant = isVariantLabel(prop);
/**
* If this type has *just* changed isActive status, set activeDelta
* to that status. Otherwise set to null.
*/
const activeDelta = type === changedActiveType ? typeState.isActive : null;
if (activeDelta === false)
removedVariantIndex = i;
/**
* If this prop is an inherited variant, rather than been set directly on the
* component itself, we want to make sure we allow the parent to trigger animations.
*
* TODO: Can probably change this to a !isControllingVariants check
*/
let isInherited = prop === context[type] &&
prop !== props[type] &&
propIsVariant;
/**
*
*/
if (isInherited &&
isInitialRender &&
visualElement.manuallyAnimateOnMount) {
isInherited = false;
}
/**
* Set all encountered keys so far as the protected keys for this type. This will
* be any key that has been animated or otherwise handled by active, higher-priortiy types.
*/
typeState.protectedKeys = { ...encounteredKeys };
// Check if we can skip analysing this prop early
if (
// If it isn't active and hasn't *just* been set as inactive
(!typeState.isActive && activeDelta === null) ||
// If we didn't and don't have any defined prop for this animation type
(!prop && !typeState.prevProp) ||
// Or if the prop doesn't define an animation
isAnimationControls(prop) ||
typeof prop === "boolean") {
continue;
}
/**
* As we go look through the values defined on this type, if we detect
* a changed value or a value that was removed in a higher priority, we set
* this to true and add this prop to the animation list.
*/
const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);
let shouldAnimateType = variantDidChange ||
// If we're making this variant active, we want to always make it active
(type === changedActiveType &&
typeState.isActive &&
!isInherited &&
propIsVariant) ||
// If we removed a higher-priority variant (i is in reverse order)
(i > removedVariantIndex && propIsVariant);
let handledRemovedValues = false;
/**
* As animations can be set as variant lists, variants or target objects, we
* coerce everything to an array if it isn't one already
*/
const definitionList = Array.isArray(prop) ? prop : [prop];
/**
* Build an object of all the resolved values. We'll use this in the subsequent
* animateChanges calls to determine whether a value has changed.
*/
let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {});
if (activeDelta === false)
resolvedValues = {};
/**
* Now we need to loop through all the keys in the prev prop and this prop,
* and decide:
* 1. If the value has changed, and needs animating
* 2. If it has been removed, and needs adding to the removedKeys set
* 3. If it has been removed in a higher priority type and needs animating
* 4. If it hasn't been removed in a higher priority but hasn't changed, and
* needs adding to the type's protectedKeys list.
*/
const { prevResolvedValues = {} } = typeState;
const allKeys = {
...prevResolvedValues,
...resolvedValues,
};
const markToAnimate = (key) => {
shouldAnimateType = true;
if (removedKeys.has(key)) {
handledRemovedValues = true;
removedKeys.delete(key);
}
typeState.needsAnimating[key] = true;
const motionValue = visualElement.getValue(key);
if (motionValue)
motionValue.liveStyle = false;
};
for (const key in allKeys) {
const next = resolvedValues[key];
const prev = prevResolvedValues[key];
// If we've already handled this we can just skip ahead
if (encounteredKeys.hasOwnProperty(key))
continue;
/**
* If the value has changed, we probably want to animate it.
*/
let valueHasChanged = false;
if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {
valueHasChanged = !shallowCompare(next, prev);
}
else {
valueHasChanged = next !== prev;
}
if (valueHasChanged) {
if (next !== undefined && next !== null) {
// If next is defined and doesn't equal prev, it needs animating
markToAnimate(key);
}
else {
// If it's undefined, it's been removed.
removedKeys.add(key);
}
}
else if (next !== undefined && removedKeys.has(key)) {
/**
* If next hasn't changed and it isn't undefined, we want to check if it's
* been removed by a higher priority
*/
markToAnimate(key);
}
else {
/**
* If it hasn't changed, we add it to the list of protected values
* to ensure it doesn't get animated.
*/
typeState.protectedKeys[key] = true;
}
}
/**
* Update the typeState so next time animateChanges is called we can compare the
* latest prop and resolvedValues to these.
*/
typeState.prevProp = prop;
typeState.prevResolvedValues = resolvedValues;
/**
*
*/
if (typeState.isActive) {
encounteredKeys = { ...encounteredKeys, ...resolvedValues };
}
if (isInitialRender && visualElement.blockInitialAnimation) {
shouldAnimateType = false;
}
/**
* If this is an inherited prop we want to skip this animation
* unless the inherited variants haven't changed on this render.
*/
const willAnimateViaParent = isInherited && variantDidChange;
const needsAnimating = !willAnimateViaParent || handledRemovedValues;
if (shouldAnimateType && needsAnimating) {
animations.push(...definitionList.map((animation) => ({
animation: animation,
options: { type },
})));
}
}
/**
* If there are some removed value that haven't been dealt with,
* we need to create a new animation that falls back either to the value
* defined in the style prop, or the last read value.
*/
if (removedKeys.size) {
const fallbackAnimation = {};
removedKeys.forEach((key) => {
const fallbackTarget = visualElement.getBaseTarget(key);
const motionValue = visualElement.getValue(key);
if (motionValue)
motionValue.liveStyle = true;
// @ts-expect-error - @mattgperry to figure if we should do something here
fallbackAnimation[key] = fallbackTarget !== null && fallbackTarget !== void 0 ? fallbackTarget : null;
});
animations.push({ animation: fallbackAnimation });
}
let shouldAnimate = Boolean(animations.length);
if (isInitialRender &&
(props.initial === false || props.initial === props.animate) &&
!visualElement.manuallyAnimateOnMount) {
shouldAnimate = false;
}
isInitialRender = false;
return shouldAnimate ? animate(animations) : Promise.resolve();
}
/**
* Change whether a certain animation type is active.
*/
function setActive(type, isActive) {
var _a;
// If the active state hasn't changed, we can safely do nothing here
if (state[type].isActive === isActive)
return Promise.resolve();
// Propagate active change to children
(_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach((child) => { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); });
state[type].isActive = isActive;
const animations = animateChanges(type);
for (const key in state) {
state[key].protectedKeys = {};
}
return animations;
}
return {
animateChanges,
setActive,
setAnimateFunction,
getState: () => state,
reset: () => {
state = createState();
isInitialRender = true;
},
};
}
function checkVariantsDidChange(prev, next) {
if (typeof next === "string") {
return next !== prev;
}
else if (Array.isArray(next)) {
return !shallowCompare(next, prev);
}
return false;
}
function createTypeState(isActive = false) {
return {
isActive,
protectedKeys: {},
needsAnimating: {},
prevResolvedValues: {},
};
}
function createState() {
return {
animate: createTypeState(true),
whileInView: createTypeState(),
whileHover: createTypeState(),
whileTap: createTypeState(),
whileDrag: createTypeState(),
whileFocus: createTypeState(),
exit: createTypeState(),
};
}
;// ./node_modules/framer-motion/dist/es/motion/features/Feature.mjs
class Feature {
constructor(node) {
this.isMounted = false;
this.node = node;
}
update() { }
}
;// ./node_modules/framer-motion/dist/es/motion/features/animation/index.mjs
class AnimationFeature extends Feature {
/**
* We dynamically generate the AnimationState manager as it contains a reference
* to the underlying animation library. We only want to load that if we load this,
* so people can optionally code split it out using the `m` component.
*/
constructor(node) {
super(node);
node.animationState || (node.animationState = createAnimationState(node));
}
updateAnimationControlsSubscription() {
const { animate } = this.node.getProps();
if (isAnimationControls(animate)) {
this.unmountControls = animate.subscribe(this.node);
}
}
/**
* Subscribe any provided AnimationControls to the component's VisualElement
*/
mount() {
this.updateAnimationControlsSubscription();
}
update() {
const { animate } = this.node.getProps();
const { animate: prevAnimate } = this.node.prevProps || {};
if (animate !== prevAnimate) {
this.updateAnimationControlsSubscription();
}
}
unmount() {
var _a;
this.node.animationState.reset();
(_a = this.unmountControls) === null || _a === void 0 ? void 0 : _a.call(this);
}
}
;// ./node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs
let id = 0;
class ExitAnimationFeature extends Feature {
constructor() {
super(...arguments);
this.id = id++;
}
update() {
if (!this.node.presenceContext)
return;
const { isPresent, onExitComplete } = this.node.presenceContext;
const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};
if (!this.node.animationState || isPresent === prevIsPresent) {
return;
}
const exitAnimation = this.node.animationState.setActive("exit", !isPresent);
if (onExitComplete && !isPresent) {
exitAnimation.then(() => onExitComplete(this.id));
}
}
mount() {
const { register } = this.node.presenceContext || {};
if (register) {
this.unmount = register(this.id);
}
}
unmount() { }
}
;// ./node_modules/framer-motion/dist/es/motion/features/animations.mjs
const animations = {
animation: {
Feature: AnimationFeature,
},
exit: {
Feature: ExitAnimationFeature,
},
};
;// ./node_modules/framer-motion/dist/es/events/add-dom-event.mjs
function addDomEvent(target, eventName, handler, options = { passive: true }) {
target.addEventListener(eventName, handler, options);
return () => target.removeEventListener(eventName, handler);
}
;// ./node_modules/framer-motion/dist/es/events/event-info.mjs
function extractEventInfo(event) {
return {
point: {
x: event.pageX,
y: event.pageY,
},
};
}
const addPointerInfo = (handler) => {
return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));
};
;// ./node_modules/framer-motion/dist/es/events/add-pointer-event.mjs
function addPointerEvent(target, eventName, handler, options) {
return addDomEvent(target, eventName, addPointerInfo(handler), options);
}
;// ./node_modules/framer-motion/dist/es/utils/distance.mjs
const distance = (a, b) => Math.abs(a - b);
function distance2D(a, b) {
// Multi-dimensional
const xDelta = distance(a.x, b.x);
const yDelta = distance(a.y, b.y);
return Math.sqrt(xDelta ** 2 + yDelta ** 2);
}
;// ./node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs
/**
* @internal
*/
class PanSession {
constructor(event, handlers, { transformPagePoint, contextWindow, dragSnapToOrigin = false, } = {}) {
/**
* @internal
*/
this.startEvent = null;
/**
* @internal
*/
this.lastMoveEvent = null;
/**
* @internal
*/
this.lastMoveEventInfo = null;
/**
* @internal
*/
this.handlers = {};
/**
* @internal
*/
this.contextWindow = window;
this.updatePoint = () => {
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
return;
const info = getPanInfo(this.lastMoveEventInfo, this.history);
const isPanStarted = this.startEvent !== null;
// Only start panning if the offset is larger than 3 pixels. If we make it
// any larger than this we'll want to reset the pointer history
// on the first update to avoid visual snapping to the cursoe.
const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= 3;
if (!isPanStarted && !isDistancePastThreshold)
return;
const { point } = info;
const { timestamp } = frameData;
this.history.push({ ...point, timestamp });
const { onStart, onMove } = this.handlers;
if (!isPanStarted) {
onStart && onStart(this.lastMoveEvent, info);
this.startEvent = this.lastMoveEvent;
}
onMove && onMove(this.lastMoveEvent, info);
};
this.handlePointerMove = (event, info) => {
this.lastMoveEvent = event;
this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);
// Throttle mouse move event to once per frame
frame_frame.update(this.updatePoint, true);
};
this.handlePointerUp = (event, info) => {
this.end();
const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;
if (this.dragSnapToOrigin)
resumeAnimation && resumeAnimation();
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
return;
const panInfo = getPanInfo(event.type === "pointercancel"
? this.lastMoveEventInfo
: transformPoint(info, this.transformPagePoint), this.history);
if (this.startEvent && onEnd) {
onEnd(event, panInfo);
}
onSessionEnd && onSessionEnd(event, panInfo);
};
// If we have more than one touch, don't start detecting this gesture
if (!isPrimaryPointer(event))
return;
this.dragSnapToOrigin = dragSnapToOrigin;
this.handlers = handlers;
this.transformPagePoint = transformPagePoint;
this.contextWindow = contextWindow || window;
const info = extractEventInfo(event);
const initialInfo = transformPoint(info, this.transformPagePoint);
const { point } = initialInfo;
const { timestamp } = frameData;
this.history = [{ ...point, timestamp }];
const { onSessionStart } = handlers;
onSessionStart &&
onSessionStart(event, getPanInfo(initialInfo, this.history));
this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp));
}
updateHandlers(handlers) {
this.handlers = handlers;
}
end() {
this.removeListeners && this.removeListeners();
cancelFrame(this.updatePoint);
}
}
function transformPoint(info, transformPagePoint) {
return transformPagePoint ? { point: transformPagePoint(info.point) } : info;
}
function subtractPoint(a, b) {
return { x: a.x - b.x, y: a.y - b.y };
}
function getPanInfo({ point }, history) {
return {
point,
delta: subtractPoint(point, lastDevicePoint(history)),
offset: subtractPoint(point, startDevicePoint(history)),
velocity: getVelocity(history, 0.1),
};
}
function startDevicePoint(history) {
return history[0];
}
function lastDevicePoint(history) {
return history[history.length - 1];
}
function getVelocity(history, timeDelta) {
if (history.length < 2) {
return { x: 0, y: 0 };
}
let i = history.length - 1;
let timestampedPoint = null;
const lastPoint = lastDevicePoint(history);
while (i >= 0) {
timestampedPoint = history[i];
if (lastPoint.timestamp - timestampedPoint.timestamp >
time_conversion_secondsToMilliseconds(timeDelta)) {
break;
}
i--;
}
if (!timestampedPoint) {
return { x: 0, y: 0 };
}
const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);
if (time === 0) {
return { x: 0, y: 0 };
}
const currentVelocity = {
x: (lastPoint.x - timestampedPoint.x) / time,
y: (lastPoint.y - timestampedPoint.y) / time,
};
if (currentVelocity.x === Infinity) {
currentVelocity.x = 0;
}
if (currentVelocity.y === Infinity) {
currentVelocity.y = 0;
}
return currentVelocity;
}
;// ./node_modules/framer-motion/dist/es/utils/is-ref-object.mjs
function isRefObject(ref) {
return (ref &&
typeof ref === "object" &&
Object.prototype.hasOwnProperty.call(ref, "current"));
}
;// ./node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs
const SCALE_PRECISION = 0.0001;
const SCALE_MIN = 1 - SCALE_PRECISION;
const SCALE_MAX = 1 + SCALE_PRECISION;
const TRANSLATE_PRECISION = 0.01;
const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION;
const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION;
function calcLength(axis) {
return axis.max - axis.min;
}
function isNear(value, target, maxDistance) {
return Math.abs(value - target) <= maxDistance;
}
function calcAxisDelta(delta, source, target, origin = 0.5) {
delta.origin = origin;
delta.originPoint = mixNumber(source.min, source.max, delta.origin);
delta.scale = calcLength(target) / calcLength(source);
delta.translate =
mixNumber(target.min, target.max, delta.origin) - delta.originPoint;
if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||
isNaN(delta.scale)) {
delta.scale = 1.0;
}
if ((delta.translate >= TRANSLATE_MIN &&
delta.translate <= TRANSLATE_MAX) ||
isNaN(delta.translate)) {
delta.translate = 0.0;
}
}
function calcBoxDelta(delta, source, target, origin) {
calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined);
calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined);
}
function calcRelativeAxis(target, relative, parent) {
target.min = parent.min + relative.min;
target.max = target.min + calcLength(relative);
}
function calcRelativeBox(target, relative, parent) {
calcRelativeAxis(target.x, relative.x, parent.x);
calcRelativeAxis(target.y, relative.y, parent.y);
}
function calcRelativeAxisPosition(target, layout, parent) {
target.min = layout.min - parent.min;
target.max = target.min + calcLength(layout);
}
function calcRelativePosition(target, layout, parent) {
calcRelativeAxisPosition(target.x, layout.x, parent.x);
calcRelativeAxisPosition(target.y, layout.y, parent.y);
}
;// ./node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs
/**
* Apply constraints to a point. These constraints are both physical along an
* axis, and an elastic factor that determines how much to constrain the point
* by if it does lie outside the defined parameters.
*/
function applyConstraints(point, { min, max }, elastic) {
if (min !== undefined && point < min) {
// If we have a min point defined, and this is outside of that, constrain
point = elastic
? mixNumber(min, point, elastic.min)
: Math.max(point, min);
}
else if (max !== undefined && point > max) {
// If we have a max point defined, and this is outside of that, constrain
point = elastic
? mixNumber(max, point, elastic.max)
: Math.min(point, max);
}
return point;
}
/**
* Calculate constraints in terms of the viewport when defined relatively to the
* measured axis. This is measured from the nearest edge, so a max constraint of 200
* on an axis with a max value of 300 would return a constraint of 500 - axis length
*/
function calcRelativeAxisConstraints(axis, min, max) {
return {
min: min !== undefined ? axis.min + min : undefined,
max: max !== undefined
? axis.max + max - (axis.max - axis.min)
: undefined,
};
}
/**
* Calculate constraints in terms of the viewport when
* defined relatively to the measured bounding box.
*/
function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {
return {
x: calcRelativeAxisConstraints(layoutBox.x, left, right),
y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),
};
}
/**
* Calculate viewport constraints when defined as another viewport-relative axis
*/
function calcViewportAxisConstraints(layoutAxis, constraintsAxis) {
let min = constraintsAxis.min - layoutAxis.min;
let max = constraintsAxis.max - layoutAxis.max;
// If the constraints axis is actually smaller than the layout axis then we can
// flip the constraints
if (constraintsAxis.max - constraintsAxis.min <
layoutAxis.max - layoutAxis.min) {
[min, max] = [max, min];
}
return { min, max };
}
/**
* Calculate viewport constraints when defined as another viewport-relative box
*/
function calcViewportConstraints(layoutBox, constraintsBox) {
return {
x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),
y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),
};
}
/**
* Calculate a transform origin relative to the source axis, between 0-1, that results
* in an asthetically pleasing scale/transform needed to project from source to target.
*/
function calcOrigin(source, target) {
let origin = 0.5;
const sourceLength = calcLength(source);
const targetLength = calcLength(target);
if (targetLength > sourceLength) {
origin = progress(target.min, target.max - sourceLength, source.min);
}
else if (sourceLength > targetLength) {
origin = progress(source.min, source.max - targetLength, target.min);
}
return clamp_clamp(0, 1, origin);
}
/**
* Rebase the calculated viewport constraints relative to the layout.min point.
*/
function rebaseAxisConstraints(layout, constraints) {
const relativeConstraints = {};
if (constraints.min !== undefined) {
relativeConstraints.min = constraints.min - layout.min;
}
if (constraints.max !== undefined) {
relativeConstraints.max = constraints.max - layout.min;
}
return relativeConstraints;
}
const defaultElastic = 0.35;
/**
* Accepts a dragElastic prop and returns resolved elastic values for each axis.
*/
function resolveDragElastic(dragElastic = defaultElastic) {
if (dragElastic === false) {
dragElastic = 0;
}
else if (dragElastic === true) {
dragElastic = defaultElastic;
}
return {
x: resolveAxisElastic(dragElastic, "left", "right"),
y: resolveAxisElastic(dragElastic, "top", "bottom"),
};
}
function resolveAxisElastic(dragElastic, minLabel, maxLabel) {
return {
min: resolvePointElastic(dragElastic, minLabel),
max: resolvePointElastic(dragElastic, maxLabel),
};
}
function resolvePointElastic(dragElastic, label) {
return typeof dragElastic === "number"
? dragElastic
: dragElastic[label] || 0;
}
;// ./node_modules/framer-motion/dist/es/projection/geometry/models.mjs
const createAxisDelta = () => ({
translate: 0,
scale: 1,
origin: 0,
originPoint: 0,
});
const createDelta = () => ({
x: createAxisDelta(),
y: createAxisDelta(),
});
const createAxis = () => ({ min: 0, max: 0 });
const createBox = () => ({
x: createAxis(),
y: createAxis(),
});
;// ./node_modules/framer-motion/dist/es/projection/utils/each-axis.mjs
function eachAxis(callback) {
return [callback("x"), callback("y")];
}
;// ./node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs
/**
* Bounding boxes tend to be defined as top, left, right, bottom. For various operations
* it's easier to consider each axis individually. This function returns a bounding box
* as a map of single-axis min/max values.
*/
function convertBoundingBoxToBox({ top, left, right, bottom, }) {
return {
x: { min: left, max: right },
y: { min: top, max: bottom },
};
}
function convertBoxToBoundingBox({ x, y }) {
return { top: y.min, right: x.max, bottom: y.max, left: x.min };
}
/**
* Applies a TransformPoint function to a bounding box. TransformPoint is usually a function
* provided by Framer to allow measured points to be corrected for device scaling. This is used
* when measuring DOM elements and DOM event points.
*/
function transformBoxPoints(point, transformPoint) {
if (!transformPoint)
return point;
const topLeft = transformPoint({ x: point.left, y: point.top });
const bottomRight = transformPoint({ x: point.right, y: point.bottom });
return {
top: topLeft.y,
left: topLeft.x,
bottom: bottomRight.y,
right: bottomRight.x,
};
}
;// ./node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs
function isIdentityScale(scale) {
return scale === undefined || scale === 1;
}
function hasScale({ scale, scaleX, scaleY }) {
return (!isIdentityScale(scale) ||
!isIdentityScale(scaleX) ||
!isIdentityScale(scaleY));
}
function hasTransform(values) {
return (hasScale(values) ||
has2DTranslate(values) ||
values.z ||
values.rotate ||
values.rotateX ||
values.rotateY ||
values.skewX ||
values.skewY);
}
function has2DTranslate(values) {
return is2DTranslate(values.x) || is2DTranslate(values.y);
}
function is2DTranslate(value) {
return value && value !== "0%";
}
;// ./node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs
/**
* Scales a point based on a factor and an originPoint
*/
function scalePoint(point, scale, originPoint) {
const distanceFromOrigin = point - originPoint;
const scaled = scale * distanceFromOrigin;
return originPoint + scaled;
}
/**
* Applies a translate/scale delta to a point
*/
function applyPointDelta(point, translate, scale, originPoint, boxScale) {
if (boxScale !== undefined) {
point = scalePoint(point, boxScale, originPoint);
}
return scalePoint(point, scale, originPoint) + translate;
}
/**
* Applies a translate/scale delta to an axis
*/
function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) {
axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);
axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);
}
/**
* Applies a translate/scale delta to a box
*/
function applyBoxDelta(box, { x, y }) {
applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);
applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);
}
const TREE_SCALE_SNAP_MIN = 0.999999999999;
const TREE_SCALE_SNAP_MAX = 1.0000000000001;
/**
* Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms
* in a tree upon our box before then calculating how to project it into our desired viewport-relative box
*
* This is the final nested loop within updateLayoutDelta for future refactoring
*/
function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) {
const treeLength = treePath.length;
if (!treeLength)
return;
// Reset the treeScale
treeScale.x = treeScale.y = 1;
let node;
let delta;
for (let i = 0; i < treeLength; i++) {
node = treePath[i];
delta = node.projectionDelta;
/**
* TODO: Prefer to remove this, but currently we have motion components with
* display: contents in Framer.
*/
const { visualElement } = node.options;
if (visualElement &&
visualElement.props.style &&
visualElement.props.style.display === "contents") {
continue;
}
if (isSharedTransition &&
node.options.layoutScroll &&
node.scroll &&
node !== node.root) {
transformBox(box, {
x: -node.scroll.offset.x,
y: -node.scroll.offset.y,
});
}
if (delta) {
// Incoporate each ancestor's scale into a culmulative treeScale for this component
treeScale.x *= delta.x.scale;
treeScale.y *= delta.y.scale;
// Apply each ancestor's calculated delta into this component's recorded layout box
applyBoxDelta(box, delta);
}
if (isSharedTransition && hasTransform(node.latestValues)) {
transformBox(box, node.latestValues);
}
}
/**
* Snap tree scale back to 1 if it's within a non-perceivable threshold.
* This will help reduce useless scales getting rendered.
*/
if (treeScale.x < TREE_SCALE_SNAP_MAX &&
treeScale.x > TREE_SCALE_SNAP_MIN) {
treeScale.x = 1.0;
}
if (treeScale.y < TREE_SCALE_SNAP_MAX &&
treeScale.y > TREE_SCALE_SNAP_MIN) {
treeScale.y = 1.0;
}
}
function translateAxis(axis, distance) {
axis.min = axis.min + distance;
axis.max = axis.max + distance;
}
/**
* Apply a transform to an axis from the latest resolved motion values.
* This function basically acts as a bridge between a flat motion value map
* and applyAxisDelta
*/
function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) {
const originPoint = mixNumber(axis.min, axis.max, axisOrigin);
// Apply the axis delta to the final axis
applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale);
}
/**
* Apply a transform to a box from the latest resolved motion values.
*/
function transformBox(box, transform) {
transformAxis(box.x, transform.x, transform.scaleX, transform.scale, transform.originX);
transformAxis(box.y, transform.y, transform.scaleY, transform.scale, transform.originY);
}
;// ./node_modules/framer-motion/dist/es/projection/utils/measure.mjs
function measureViewportBox(instance, transformPoint) {
return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));
}
function measurePageBox(element, rootProjectionNode, transformPagePoint) {
const viewportBox = measureViewportBox(element, transformPagePoint);
const { scroll } = rootProjectionNode;
if (scroll) {
translateAxis(viewportBox.x, scroll.offset.x);
translateAxis(viewportBox.y, scroll.offset.y);
}
return viewportBox;
}
;// ./node_modules/framer-motion/dist/es/utils/get-context-window.mjs
// Fixes https://github.com/motiondivision/motion/issues/2270
const getContextWindow = ({ current }) => {
return current ? current.ownerDocument.defaultView : null;
};
;// ./node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs
const elementDragControls = new WeakMap();
/**
*
*/
// let latestPointerEvent: PointerEvent
class VisualElementDragControls {
constructor(visualElement) {
this.openDragLock = null;
this.isDragging = false;
this.currentDirection = null;
this.originPoint = { x: 0, y: 0 };
/**
* The permitted boundaries of travel, in pixels.
*/
this.constraints = false;
this.hasMutatedConstraints = false;
/**
* The per-axis resolved elastic values.
*/
this.elastic = createBox();
this.visualElement = visualElement;
}
start(originEvent, { snapToCursor = false } = {}) {
/**
* Don't start dragging if this component is exiting
*/
const { presenceContext } = this.visualElement;
if (presenceContext && presenceContext.isPresent === false)
return;
const onSessionStart = (event) => {
const { dragSnapToOrigin } = this.getProps();
// Stop or pause any animations on both axis values immediately. This allows the user to throw and catch
// the component.
dragSnapToOrigin ? this.pauseAnimation() : this.stopAnimation();
if (snapToCursor) {
this.snapToCursor(extractEventInfo(event).point);
}
};
const onStart = (event, info) => {
// Attempt to grab the global drag gesture lock - maybe make this part of PanSession
const { drag, dragPropagation, onDragStart } = this.getProps();
if (drag && !dragPropagation) {
if (this.openDragLock)
this.openDragLock();
this.openDragLock = setDragLock(drag);
// If we don 't have the lock, don't start dragging
if (!this.openDragLock)
return;
}
this.isDragging = true;
this.currentDirection = null;
this.resolveConstraints();
if (this.visualElement.projection) {
this.visualElement.projection.isAnimationBlocked = true;
this.visualElement.projection.target = undefined;
}
/**
* Record gesture origin
*/
eachAxis((axis) => {
let current = this.getAxisMotionValue(axis).get() || 0;
/**
* If the MotionValue is a percentage value convert to px
*/
if (percent.test(current)) {
const { projection } = this.visualElement;
if (projection && projection.layout) {
const measuredAxis = projection.layout.layoutBox[axis];
if (measuredAxis) {
const length = calcLength(measuredAxis);
current = length * (parseFloat(current) / 100);
}
}
}
this.originPoint[axis] = current;
});
// Fire onDragStart event
if (onDragStart) {
frame_frame.postRender(() => onDragStart(event, info));
}
addValueToWillChange(this.visualElement, "transform");
const { animationState } = this.visualElement;
animationState && animationState.setActive("whileDrag", true);
};
const onMove = (event, info) => {
// latestPointerEvent = event
const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();
// If we didn't successfully receive the gesture lock, early return.
if (!dragPropagation && !this.openDragLock)
return;
const { offset } = info;
// Attempt to detect drag direction if directionLock is true
if (dragDirectionLock && this.currentDirection === null) {
this.currentDirection = getCurrentDirection(offset);
// If we've successfully set a direction, notify listener
if (this.currentDirection !== null) {
onDirectionLock && onDirectionLock(this.currentDirection);
}
return;
}
// Update each point with the latest position
this.updateAxis("x", info.point, offset);
this.updateAxis("y", info.point, offset);
/**
* Ideally we would leave the renderer to fire naturally at the end of
* this frame but if the element is about to change layout as the result
* of a re-render we want to ensure the browser can read the latest
* bounding box to ensure the pointer and element don't fall out of sync.
*/
this.visualElement.render();
/**
* This must fire after the render call as it might trigger a state
* change which itself might trigger a layout update.
*/
onDrag && onDrag(event, info);
};
const onSessionEnd = (event, info) => this.stop(event, info);
const resumeAnimation = () => eachAxis((axis) => {
var _a;
return this.getAnimationState(axis) === "paused" &&
((_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.play());
});
const { dragSnapToOrigin } = this.getProps();
this.panSession = new PanSession(originEvent, {
onSessionStart,
onStart,
onMove,
onSessionEnd,
resumeAnimation,
}, {
transformPagePoint: this.visualElement.getTransformPagePoint(),
dragSnapToOrigin,
contextWindow: getContextWindow(this.visualElement),
});
}
stop(event, info) {
const isDragging = this.isDragging;
this.cancel();
if (!isDragging)
return;
const { velocity } = info;
this.startAnimation(velocity);
const { onDragEnd } = this.getProps();
if (onDragEnd) {
frame_frame.postRender(() => onDragEnd(event, info));
}
}
cancel() {
this.isDragging = false;
const { projection, animationState } = this.visualElement;
if (projection) {
projection.isAnimationBlocked = false;
}
this.panSession && this.panSession.end();
this.panSession = undefined;
const { dragPropagation } = this.getProps();
if (!dragPropagation && this.openDragLock) {
this.openDragLock();
this.openDragLock = null;
}
animationState && animationState.setActive("whileDrag", false);
}
updateAxis(axis, _point, offset) {
const { drag } = this.getProps();
// If we're not dragging this axis, do an early return.
if (!offset || !shouldDrag(axis, drag, this.currentDirection))
return;
const axisValue = this.getAxisMotionValue(axis);
let next = this.originPoint[axis] + offset[axis];
// Apply constraints
if (this.constraints && this.constraints[axis]) {
next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);
}
axisValue.set(next);
}
resolveConstraints() {
var _a;
const { dragConstraints, dragElastic } = this.getProps();
const layout = this.visualElement.projection &&
!this.visualElement.projection.layout
? this.visualElement.projection.measure(false)
: (_a = this.visualElement.projection) === null || _a === void 0 ? void 0 : _a.layout;
const prevConstraints = this.constraints;
if (dragConstraints && isRefObject(dragConstraints)) {
if (!this.constraints) {
this.constraints = this.resolveRefConstraints();
}
}
else {
if (dragConstraints && layout) {
this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);
}
else {
this.constraints = false;
}
}
this.elastic = resolveDragElastic(dragElastic);
/**
* If we're outputting to external MotionValues, we want to rebase the measured constraints
* from viewport-relative to component-relative.
*/
if (prevConstraints !== this.constraints &&
layout &&
this.constraints &&
!this.hasMutatedConstraints) {
eachAxis((axis) => {
if (this.constraints !== false &&
this.getAxisMotionValue(axis)) {
this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);
}
});
}
}
resolveRefConstraints() {
const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();
if (!constraints || !isRefObject(constraints))
return false;
const constraintsElement = constraints.current;
errors_invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
const { projection } = this.visualElement;
// TODO
if (!projection || !projection.layout)
return false;
const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());
let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);
/**
* If there's an onMeasureDragConstraints listener we call it and
* if different constraints are returned, set constraints to that
*/
if (onMeasureDragConstraints) {
const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));
this.hasMutatedConstraints = !!userConstraints;
if (userConstraints) {
measuredConstraints = convertBoundingBoxToBox(userConstraints);
}
}
return measuredConstraints;
}
startAnimation(velocity) {
const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();
const constraints = this.constraints || {};
const momentumAnimations = eachAxis((axis) => {
if (!shouldDrag(axis, drag, this.currentDirection)) {
return;
}
let transition = (constraints && constraints[axis]) || {};
if (dragSnapToOrigin)
transition = { min: 0, max: 0 };
/**
* Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame
* of spring animations so we should look into adding a disable spring option to `inertia`.
* We could do something here where we affect the `bounceStiffness` and `bounceDamping`
* using the value of `dragElastic`.
*/
const bounceStiffness = dragElastic ? 200 : 1000000;
const bounceDamping = dragElastic ? 40 : 10000000;
const inertia = {
type: "inertia",
velocity: dragMomentum ? velocity[axis] : 0,
bounceStiffness,
bounceDamping,
timeConstant: 750,
restDelta: 1,
restSpeed: 10,
...dragTransition,
...transition,
};
// If we're not animating on an externally-provided `MotionValue` we can use the
// component's animation controls which will handle interactions with whileHover (etc),
// otherwise we just have to animate the `MotionValue` itself.
return this.startAxisValueAnimation(axis, inertia);
});
// Run all animations and then resolve the new drag constraints.
return Promise.all(momentumAnimations).then(onDragTransitionEnd);
}
startAxisValueAnimation(axis, transition) {
const axisValue = this.getAxisMotionValue(axis);
addValueToWillChange(this.visualElement, axis);
return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false));
}
stopAnimation() {
eachAxis((axis) => this.getAxisMotionValue(axis).stop());
}
pauseAnimation() {
eachAxis((axis) => { var _a; return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.pause(); });
}
getAnimationState(axis) {
var _a;
return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.state;
}
/**
* Drag works differently depending on which props are provided.
*
* - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.
* - Otherwise, we apply the delta to the x/y motion values.
*/
getAxisMotionValue(axis) {
const dragKey = `_drag${axis.toUpperCase()}`;
const props = this.visualElement.getProps();
const externalMotionValue = props[dragKey];
return externalMotionValue
? externalMotionValue
: this.visualElement.getValue(axis, (props.initial
? props.initial[axis]
: undefined) || 0);
}
snapToCursor(point) {
eachAxis((axis) => {
const { drag } = this.getProps();
// If we're not dragging this axis, do an early return.
if (!shouldDrag(axis, drag, this.currentDirection))
return;
const { projection } = this.visualElement;
const axisValue = this.getAxisMotionValue(axis);
if (projection && projection.layout) {
const { min, max } = projection.layout.layoutBox[axis];
axisValue.set(point[axis] - mixNumber(min, max, 0.5));
}
});
}
/**
* When the viewport resizes we want to check if the measured constraints
* have changed and, if so, reposition the element within those new constraints
* relative to where it was before the resize.
*/
scalePositionWithinConstraints() {
if (!this.visualElement.current)
return;
const { drag, dragConstraints } = this.getProps();
const { projection } = this.visualElement;
if (!isRefObject(dragConstraints) || !projection || !this.constraints)
return;
/**
* Stop current animations as there can be visual glitching if we try to do
* this mid-animation
*/
this.stopAnimation();
/**
* Record the relative position of the dragged element relative to the
* constraints box and save as a progress value.
*/
const boxProgress = { x: 0, y: 0 };
eachAxis((axis) => {
const axisValue = this.getAxisMotionValue(axis);
if (axisValue && this.constraints !== false) {
const latest = axisValue.get();
boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);
}
});
/**
* Update the layout of this element and resolve the latest drag constraints
*/
const { transformTemplate } = this.visualElement.getProps();
this.visualElement.current.style.transform = transformTemplate
? transformTemplate({}, "")
: "none";
projection.root && projection.root.updateScroll();
projection.updateLayout();
this.resolveConstraints();
/**
* For each axis, calculate the current progress of the layout axis
* within the new constraints.
*/
eachAxis((axis) => {
if (!shouldDrag(axis, drag, null))
return;
/**
* Calculate a new transform based on the previous box progress
*/
const axisValue = this.getAxisMotionValue(axis);
const { min, max } = this.constraints[axis];
axisValue.set(mixNumber(min, max, boxProgress[axis]));
});
}
addListeners() {
if (!this.visualElement.current)
return;
elementDragControls.set(this.visualElement, this);
const element = this.visualElement.current;
/**
* Attach a pointerdown event listener on this DOM element to initiate drag tracking.
*/
const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => {
const { drag, dragListener = true } = this.getProps();
drag && dragListener && this.start(event);
});
const measureDragConstraints = () => {
const { dragConstraints } = this.getProps();
if (isRefObject(dragConstraints) && dragConstraints.current) {
this.constraints = this.resolveRefConstraints();
}
};
const { projection } = this.visualElement;
const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints);
if (projection && !projection.layout) {
projection.root && projection.root.updateScroll();
projection.updateLayout();
}
frame_frame.read(measureDragConstraints);
/**
* Attach a window resize listener to scale the draggable target within its defined
* constraints as the window resizes.
*/
const stopResizeListener = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints());
/**
* If the element's layout changes, calculate the delta and apply that to
* the drag gesture's origin point.
*/
const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => {
if (this.isDragging && hasLayoutChanged) {
eachAxis((axis) => {
const motionValue = this.getAxisMotionValue(axis);
if (!motionValue)
return;
this.originPoint[axis] += delta[axis].translate;
motionValue.set(motionValue.get() + delta[axis].translate);
});
this.visualElement.render();
}
}));
return () => {
stopResizeListener();
stopPointerListener();
stopMeasureLayoutListener();
stopLayoutUpdateListener && stopLayoutUpdateListener();
};
}
getProps() {
const props = this.visualElement.getProps();
const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;
return {
...props,
drag,
dragDirectionLock,
dragPropagation,
dragConstraints,
dragElastic,
dragMomentum,
};
}
}
function shouldDrag(direction, drag, currentDirection) {
return ((drag === true || drag === direction) &&
(currentDirection === null || currentDirection === direction));
}
/**
* Based on an x/y offset determine the current drag direction. If both axis' offsets are lower
* than the provided threshold, return `null`.
*
* @param offset - The x/y offset from origin.
* @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.
*/
function getCurrentDirection(offset, lockThreshold = 10) {
let direction = null;
if (Math.abs(offset.y) > lockThreshold) {
direction = "y";
}
else if (Math.abs(offset.x) > lockThreshold) {
direction = "x";
}
return direction;
}
;// ./node_modules/framer-motion/dist/es/gestures/drag/index.mjs
class DragGesture extends Feature {
constructor(node) {
super(node);
this.removeGroupControls = noop_noop;
this.removeListeners = noop_noop;
this.controls = new VisualElementDragControls(node);
}
mount() {
// If we've been provided a DragControls for manual control over the drag gesture,
// subscribe this component to it on mount.
const { dragControls } = this.node.getProps();
if (dragControls) {
this.removeGroupControls = dragControls.subscribe(this.controls);
}
this.removeListeners = this.controls.addListeners() || noop_noop;
}
unmount() {
this.removeGroupControls();
this.removeListeners();
}
}
;// ./node_modules/framer-motion/dist/es/gestures/pan/index.mjs
const asyncHandler = (handler) => (event, info) => {
if (handler) {
frame_frame.postRender(() => handler(event, info));
}
};
class PanGesture extends Feature {
constructor() {
super(...arguments);
this.removePointerDownListener = noop_noop;
}
onPointerDown(pointerDownEvent) {
this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {
transformPagePoint: this.node.getTransformPagePoint(),
contextWindow: getContextWindow(this.node),
});
}
createPanHandlers() {
const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();
return {
onSessionStart: asyncHandler(onPanSessionStart),
onStart: asyncHandler(onPanStart),
onMove: onPan,
onEnd: (event, info) => {
delete this.session;
if (onPanEnd) {
frame_frame.postRender(() => onPanEnd(event, info));
}
},
};
}
mount() {
this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event));
}
update() {
this.session && this.session.updateHandlers(this.createPanHandlers());
}
unmount() {
this.removePointerDownListener();
this.session && this.session.end();
}
}
;// ./node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs
"use client";
/**
* Internal, exported only for usage in Framer
*/
const SwitchLayoutGroupContext = (0,external_React_.createContext)({});
;// ./node_modules/framer-motion/dist/es/projection/node/state.mjs
/**
* This should only ever be modified on the client otherwise it'll
* persist through server requests. If we need instanced states we
* could lazy-init via root.
*/
const globalProjectionState = {
/**
* Global flag as to whether the tree has animated since the last time
* we resized the window
*/
hasAnimatedSinceResize: true,
/**
* We set this to true once, on the first update. Any nodes added to the tree beyond that
* update will be given a `data-projection-id` attribute.
*/
hasEverUpdated: false,
};
;// ./node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.mjs
function pixelsToPercent(pixels, axis) {
if (axis.max === axis.min)
return 0;
return (pixels / (axis.max - axis.min)) * 100;
}
/**
* We always correct borderRadius as a percentage rather than pixels to reduce paints.
* For example, if you are projecting a box that is 100px wide with a 10px borderRadius
* into a box that is 200px wide with a 20px borderRadius, that is actually a 10%
* borderRadius in both states. If we animate between the two in pixels that will trigger
* a paint each time. If we animate between the two in percentage we'll avoid a paint.
*/
const correctBorderRadius = {
correct: (latest, node) => {
if (!node.target)
return latest;
/**
* If latest is a string, if it's a percentage we can return immediately as it's
* going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.
*/
if (typeof latest === "string") {
if (px.test(latest)) {
latest = parseFloat(latest);
}
else {
return latest;
}
}
/**
* If latest is a number, it's a pixel value. We use the current viewportBox to calculate that
* pixel value as a percentage of each axis
*/
const x = pixelsToPercent(latest, node.target.x);
const y = pixelsToPercent(latest, node.target.y);
return `${x}% ${y}%`;
},
};
;// ./node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs
const correctBoxShadow = {
correct: (latest, { treeScale, projectionDelta }) => {
const original = latest;
const shadow = complex.parse(latest);
// TODO: Doesn't support multiple shadows
if (shadow.length > 5)
return original;
const template = complex.createTransformer(latest);
const offset = typeof shadow[0] !== "number" ? 1 : 0;
// Calculate the overall context scale
const xScale = projectionDelta.x.scale * treeScale.x;
const yScale = projectionDelta.y.scale * treeScale.y;
shadow[0 + offset] /= xScale;
shadow[1 + offset] /= yScale;
/**
* Ideally we'd correct x and y scales individually, but because blur and
* spread apply to both we have to take a scale average and apply that instead.
* We could potentially improve the outcome of this by incorporating the ratio between
* the two scales.
*/
const averageScale = mixNumber(xScale, yScale, 0.5);
// Blur
if (typeof shadow[2 + offset] === "number")
shadow[2 + offset] /= averageScale;
// Spread
if (typeof shadow[3 + offset] === "number")
shadow[3 + offset] /= averageScale;
return template(shadow);
},
};
;// ./node_modules/framer-motion/dist/es/projection/styles/scale-correction.mjs
const scaleCorrectors = {};
function addScaleCorrector(correctors) {
Object.assign(scaleCorrectors, correctors);
}
;// ./node_modules/framer-motion/dist/es/frameloop/microtask.mjs
const { schedule: microtask, cancel: cancelMicrotask } = createRenderBatcher(queueMicrotask, false);
;// ./node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs
"use client";
class MeasureLayoutWithContext extends external_React_.Component {
/**
* This only mounts projection nodes for components that
* need measuring, we might want to do it for all components
* in order to incorporate transforms
*/
componentDidMount() {
const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;
const { projection } = visualElement;
addScaleCorrector(defaultScaleCorrectors);
if (projection) {
if (layoutGroup.group)
layoutGroup.group.add(projection);
if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {
switchLayoutGroup.register(projection);
}
projection.root.didUpdate();
projection.addEventListener("animationComplete", () => {
this.safeToRemove();
});
projection.setOptions({
...projection.options,
onExitComplete: () => this.safeToRemove(),
});
}
globalProjectionState.hasEverUpdated = true;
}
getSnapshotBeforeUpdate(prevProps) {
const { layoutDependency, visualElement, drag, isPresent } = this.props;
const projection = visualElement.projection;
if (!projection)
return null;
/**
* TODO: We use this data in relegate to determine whether to
* promote a previous element. There's no guarantee its presence data
* will have updated by this point - if a bug like this arises it will
* have to be that we markForRelegation and then find a new lead some other way,
* perhaps in didUpdate
*/
projection.isPresent = isPresent;
if (drag ||
prevProps.layoutDependency !== layoutDependency ||
layoutDependency === undefined) {
projection.willUpdate();
}
else {
this.safeToRemove();
}
if (prevProps.isPresent !== isPresent) {
if (isPresent) {
projection.promote();
}
else if (!projection.relegate()) {
/**
* If there's another stack member taking over from this one,
* it's in charge of the exit animation and therefore should
* be in charge of the safe to remove. Otherwise we call it here.
*/
frame_frame.postRender(() => {
const stack = projection.getStack();
if (!stack || !stack.members.length) {
this.safeToRemove();
}
});
}
}
return null;
}
componentDidUpdate() {
const { projection } = this.props.visualElement;
if (projection) {
projection.root.didUpdate();
microtask.postRender(() => {
if (!projection.currentAnimation && projection.isLead()) {
this.safeToRemove();
}
});
}
}
componentWillUnmount() {
const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props;
const { projection } = visualElement;
if (projection) {
projection.scheduleCheckAfterUnmount();
if (layoutGroup && layoutGroup.group)
layoutGroup.group.remove(projection);
if (promoteContext && promoteContext.deregister)
promoteContext.deregister(projection);
}
}
safeToRemove() {
const { safeToRemove } = this.props;
safeToRemove && safeToRemove();
}
render() {
return null;
}
}
function MeasureLayout(props) {
const [isPresent, safeToRemove] = usePresence();
const layoutGroup = (0,external_React_.useContext)(LayoutGroupContext);
return ((0,external_ReactJSXRuntime_namespaceObject.jsx)(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: (0,external_React_.useContext)(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove }));
}
const defaultScaleCorrectors = {
borderRadius: {
...correctBorderRadius,
applyTo: [
"borderTopLeftRadius",
"borderTopRightRadius",
"borderBottomLeftRadius",
"borderBottomRightRadius",
],
},
borderTopLeftRadius: correctBorderRadius,
borderTopRightRadius: correctBorderRadius,
borderBottomLeftRadius: correctBorderRadius,
borderBottomRightRadius: correctBorderRadius,
boxShadow: correctBoxShadow,
};
;// ./node_modules/framer-motion/dist/es/animation/animate/single-value.mjs
function animateSingleValue(value, keyframes, options) {
const motionValue$1 = isMotionValue(value) ? value : motionValue(value);
motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options));
return motionValue$1.animation;
}
;// ./node_modules/framer-motion/dist/es/render/dom/utils/is-svg-element.mjs
function isSVGElement(element) {
return element instanceof SVGElement && element.tagName !== "svg";
}
;// ./node_modules/framer-motion/dist/es/render/utils/compare-by-depth.mjs
const compareByDepth = (a, b) => a.depth - b.depth;
;// ./node_modules/framer-motion/dist/es/render/utils/flat-tree.mjs
class FlatTree {
constructor() {
this.children = [];
this.isDirty = false;
}
add(child) {
addUniqueItem(this.children, child);
this.isDirty = true;
}
remove(child) {
removeItem(this.children, child);
this.isDirty = true;
}
forEach(callback) {
this.isDirty && this.children.sort(compareByDepth);
this.isDirty = false;
this.children.forEach(callback);
}
}
;// ./node_modules/framer-motion/dist/es/utils/delay.mjs
/**
* Timeout defined in ms
*/
function delay(callback, timeout) {
const start = time.now();
const checkElapsed = ({ timestamp }) => {
const elapsed = timestamp - start;
if (elapsed >= timeout) {
cancelFrame(checkElapsed);
callback(elapsed - timeout);
}
};
frame_frame.read(checkElapsed, true);
return () => cancelFrame(checkElapsed);
}
function delayInSeconds(callback, timeout) {
return delay(callback, secondsToMilliseconds(timeout));
}
;// ./node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.mjs
/**
* If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself
*
* TODO: Remove and move to library
*/
function resolveMotionValue(value) {
const unwrappedValue = isMotionValue(value) ? value.get() : value;
return isCustomValue(unwrappedValue)
? unwrappedValue.toValue()
: unwrappedValue;
}
;// ./node_modules/framer-motion/dist/es/projection/animation/mix-values.mjs
const borders = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"];
const numBorders = borders.length;
const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value;
const isPx = (value) => typeof value === "number" || px.test(value);
function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) {
if (shouldCrossfadeOpacity) {
target.opacity = mixNumber(0,
// TODO Reinstate this if only child
lead.opacity !== undefined ? lead.opacity : 1, easeCrossfadeIn(progress));
target.opacityExit = mixNumber(follow.opacity !== undefined ? follow.opacity : 1, 0, easeCrossfadeOut(progress));
}
else if (isOnlyMember) {
target.opacity = mixNumber(follow.opacity !== undefined ? follow.opacity : 1, lead.opacity !== undefined ? lead.opacity : 1, progress);
}
/**
* Mix border radius
*/
for (let i = 0; i < numBorders; i++) {
const borderLabel = `border${borders[i]}Radius`;
let followRadius = getRadius(follow, borderLabel);
let leadRadius = getRadius(lead, borderLabel);
if (followRadius === undefined && leadRadius === undefined)
continue;
followRadius || (followRadius = 0);
leadRadius || (leadRadius = 0);
const canMix = followRadius === 0 ||
leadRadius === 0 ||
isPx(followRadius) === isPx(leadRadius);
if (canMix) {
target[borderLabel] = Math.max(mixNumber(asNumber(followRadius), asNumber(leadRadius), progress), 0);
if (percent.test(leadRadius) || percent.test(followRadius)) {
target[borderLabel] += "%";
}
}
else {
target[borderLabel] = leadRadius;
}
}
/**
* Mix rotation
*/
if (follow.rotate || lead.rotate) {
target.rotate = mixNumber(follow.rotate || 0, lead.rotate || 0, progress);
}
}
function getRadius(values, radiusName) {
return values[radiusName] !== undefined
? values[radiusName]
: values.borderRadius;
}
// /**
// * We only want to mix the background color if there's a follow element
// * that we're not crossfading opacity between. For instance with switch
// * AnimateSharedLayout animations, this helps the illusion of a continuous
// * element being animated but also cuts down on the number of paints triggered
// * for elements where opacity is doing that work for us.
// */
// if (
// !hasFollowElement &&
// latestLeadValues.backgroundColor &&
// latestFollowValues.backgroundColor
// ) {
// /**
// * This isn't ideal performance-wise as mixColor is creating a new function every frame.
// * We could probably create a mixer that runs at the start of the animation but
// * the idea behind the crossfader is that it runs dynamically between two potentially
// * changing targets (ie opacity or borderRadius may be animating independently via variants)
// */
// leadState.backgroundColor = followState.backgroundColor = mixColor(
// latestFollowValues.backgroundColor as string,
// latestLeadValues.backgroundColor as string
// )(p)
// }
const easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut);
const easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop_noop);
function compress(min, max, easing) {
return (p) => {
// Could replace ifs with clamp
if (p < min)
return 0;
if (p > max)
return 1;
return easing(progress(min, max, p));
};
}
;// ./node_modules/framer-motion/dist/es/projection/geometry/copy.mjs
/**
* Reset an axis to the provided origin box.
*
* This is a mutative operation.
*/
function copyAxisInto(axis, originAxis) {
axis.min = originAxis.min;
axis.max = originAxis.max;
}
/**
* Reset a box to the provided origin box.
*
* This is a mutative operation.
*/
function copyBoxInto(box, originBox) {
copyAxisInto(box.x, originBox.x);
copyAxisInto(box.y, originBox.y);
}
/**
* Reset a delta to the provided origin box.
*
* This is a mutative operation.
*/
function copyAxisDeltaInto(delta, originDelta) {
delta.translate = originDelta.translate;
delta.scale = originDelta.scale;
delta.originPoint = originDelta.originPoint;
delta.origin = originDelta.origin;
}
;// ./node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs
/**
* Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse
*/
function removePointDelta(point, translate, scale, originPoint, boxScale) {
point -= translate;
point = scalePoint(point, 1 / scale, originPoint);
if (boxScale !== undefined) {
point = scalePoint(point, 1 / boxScale, originPoint);
}
return point;
}
/**
* Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse
*/
function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) {
if (percent.test(translate)) {
translate = parseFloat(translate);
const relativeProgress = mixNumber(sourceAxis.min, sourceAxis.max, translate / 100);
translate = relativeProgress - sourceAxis.min;
}
if (typeof translate !== "number")
return;
let originPoint = mixNumber(originAxis.min, originAxis.max, origin);
if (axis === originAxis)
originPoint -= translate;
axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);
axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);
}
/**
* Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse
* and acts as a bridge between motion values and removeAxisDelta
*/
function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) {
removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis);
}
/**
* The names of the motion values we want to apply as translation, scale and origin.
*/
const xKeys = ["x", "scaleX", "originX"];
const yKeys = ["y", "scaleY", "originY"];
/**
* Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse
* and acts as a bridge between motion values and removeAxisDelta
*/
function removeBoxTransforms(box, transforms, originBox, sourceBox) {
removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined);
removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined);
}
;// ./node_modules/framer-motion/dist/es/projection/geometry/utils.mjs
function isAxisDeltaZero(delta) {
return delta.translate === 0 && delta.scale === 1;
}
function isDeltaZero(delta) {
return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y);
}
function axisEquals(a, b) {
return a.min === b.min && a.max === b.max;
}
function boxEquals(a, b) {
return axisEquals(a.x, b.x) && axisEquals(a.y, b.y);
}
function axisEqualsRounded(a, b) {
return (Math.round(a.min) === Math.round(b.min) &&
Math.round(a.max) === Math.round(b.max));
}
function boxEqualsRounded(a, b) {
return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y);
}
function aspectRatio(box) {
return calcLength(box.x) / calcLength(box.y);
}
function axisDeltaEquals(a, b) {
return (a.translate === b.translate &&
a.scale === b.scale &&
a.originPoint === b.originPoint);
}
;// ./node_modules/framer-motion/dist/es/projection/shared/stack.mjs
class NodeStack {
constructor() {
this.members = [];
}
add(node) {
addUniqueItem(this.members, node);
node.scheduleRender();
}
remove(node) {
removeItem(this.members, node);
if (node === this.prevLead) {
this.prevLead = undefined;
}
if (node === this.lead) {
const prevLead = this.members[this.members.length - 1];
if (prevLead) {
this.promote(prevLead);
}
}
}
relegate(node) {
const indexOfNode = this.members.findIndex((member) => node === member);
if (indexOfNode === 0)
return false;
/**
* Find the next projection node that is present
*/
let prevLead;
for (let i = indexOfNode; i >= 0; i--) {
const member = this.members[i];
if (member.isPresent !== false) {
prevLead = member;
break;
}
}
if (prevLead) {
this.promote(prevLead);
return true;
}
else {
return false;
}
}
promote(node, preserveFollowOpacity) {
const prevLead = this.lead;
if (node === prevLead)
return;
this.prevLead = prevLead;
this.lead = node;
node.show();
if (prevLead) {
prevLead.instance && prevLead.scheduleRender();
node.scheduleRender();
node.resumeFrom = prevLead;
if (preserveFollowOpacity) {
node.resumeFrom.preserveOpacity = true;
}
if (prevLead.snapshot) {
node.snapshot = prevLead.snapshot;
node.snapshot.latestValues =
prevLead.animationValues || prevLead.latestValues;
}
if (node.root && node.root.isUpdating) {
node.isLayoutDirty = true;
}
const { crossfade } = node.options;
if (crossfade === false) {
prevLead.hide();
}
/**
* TODO:
* - Test border radius when previous node was deleted
* - boxShadow mixing
* - Shared between element A in scrolled container and element B (scroll stays the same or changes)
* - Shared between element A in transformed container and element B (transform stays the same or changes)
* - Shared between element A in scrolled page and element B (scroll stays the same or changes)
* ---
* - Crossfade opacity of root nodes
* - layoutId changes after animation
* - layoutId changes mid animation
*/
}
}
exitAnimationComplete() {
this.members.forEach((node) => {
const { options, resumingFrom } = node;
options.onExitComplete && options.onExitComplete();
if (resumingFrom) {
resumingFrom.options.onExitComplete &&
resumingFrom.options.onExitComplete();
}
});
}
scheduleRender() {
this.members.forEach((node) => {
node.instance && node.scheduleRender(false);
});
}
/**
* Clear any leads that have been removed this render to prevent them from being
* used in future animations and to prevent memory leaks
*/
removeLeadSnapshot() {
if (this.lead && this.lead.snapshot) {
this.lead.snapshot = undefined;
}
}
}
;// ./node_modules/framer-motion/dist/es/projection/styles/transform.mjs
function buildProjectionTransform(delta, treeScale, latestTransform) {
let transform = "";
/**
* The translations we use to calculate are always relative to the viewport coordinate space.
* But when we apply scales, we also scale the coordinate space of an element and its children.
* For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need
* to move an element 100 pixels, we actually need to move it 200 in within that scaled space.
*/
const xTranslate = delta.x.translate / treeScale.x;
const yTranslate = delta.y.translate / treeScale.y;
const zTranslate = (latestTransform === null || latestTransform === void 0 ? void 0 : latestTransform.z) || 0;
if (xTranslate || yTranslate || zTranslate) {
transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `;
}
/**
* Apply scale correction for the tree transform.
* This will apply scale to the screen-orientated axes.
*/
if (treeScale.x !== 1 || treeScale.y !== 1) {
transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `;
}
if (latestTransform) {
const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } = latestTransform;
if (transformPerspective)
transform = `perspective(${transformPerspective}px) ${transform}`;
if (rotate)
transform += `rotate(${rotate}deg) `;
if (rotateX)
transform += `rotateX(${rotateX}deg) `;
if (rotateY)
transform += `rotateY(${rotateY}deg) `;
if (skewX)
transform += `skewX(${skewX}deg) `;
if (skewY)
transform += `skewY(${skewY}deg) `;
}
/**
* Apply scale to match the size of the element to the size we want it.
* This will apply scale to the element-orientated axes.
*/
const elementScaleX = delta.x.scale * treeScale.x;
const elementScaleY = delta.y.scale * treeScale.y;
if (elementScaleX !== 1 || elementScaleY !== 1) {
transform += `scale(${elementScaleX}, ${elementScaleY})`;
}
return transform || "none";
}
;// ./node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs
const metrics = {
type: "projectionFrame",
totalNodes: 0,
resolvedTargetDeltas: 0,
recalculatedProjection: 0,
};
const isDebug = typeof window !== "undefined" && window.MotionDebug !== undefined;
const transformAxes = ["", "X", "Y", "Z"];
const hiddenVisibility = { visibility: "hidden" };
/**
* We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1
* which has a noticeable difference in spring animations
*/
const animationTarget = 1000;
let create_projection_node_id = 0;
function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) {
const { latestValues } = visualElement;
// Record the distorting transform and then temporarily set it to 0
if (latestValues[key]) {
values[key] = latestValues[key];
visualElement.setStaticValue(key, 0);
if (sharedAnimationValues) {
sharedAnimationValues[key] = 0;
}
}
}
function cancelTreeOptimisedTransformAnimations(projectionNode) {
projectionNode.hasCheckedOptimisedAppear = true;
if (projectionNode.root === projectionNode)
return;
const { visualElement } = projectionNode.options;
if (!visualElement)
return;
const appearId = getOptimisedAppearId(visualElement);
if (window.MotionHasOptimisedAnimation(appearId, "transform")) {
const { layout, layoutId } = projectionNode.options;
window.MotionCancelOptimisedAnimation(appearId, "transform", frame_frame, !(layout || layoutId));
}
const { parent } = projectionNode;
if (parent && !parent.hasCheckedOptimisedAppear) {
cancelTreeOptimisedTransformAnimations(parent);
}
}
function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) {
return class ProjectionNode {
constructor(latestValues = {}, parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent()) {
/**
* A unique ID generated for every projection node.
*/
this.id = create_projection_node_id++;
/**
* An id that represents a unique session instigated by startUpdate.
*/
this.animationId = 0;
/**
* A Set containing all this component's children. This is used to iterate
* through the children.
*
* TODO: This could be faster to iterate as a flat array stored on the root node.
*/
this.children = new Set();
/**
* Options for the node. We use this to configure what kind of layout animations
* we should perform (if any).
*/
this.options = {};
/**
* We use this to detect when its safe to shut down part of a projection tree.
* We have to keep projecting children for scale correction and relative projection
* until all their parents stop performing layout animations.
*/
this.isTreeAnimating = false;
this.isAnimationBlocked = false;
/**
* Flag to true if we think this layout has been changed. We can't always know this,
* currently we set it to true every time a component renders, or if it has a layoutDependency
* if that has changed between renders. Additionally, components can be grouped by LayoutGroup
* and if one node is dirtied, they all are.
*/
this.isLayoutDirty = false;
/**
* Flag to true if we think the projection calculations for this node needs
* recalculating as a result of an updated transform or layout animation.
*/
this.isProjectionDirty = false;
/**
* Flag to true if the layout *or* transform has changed. This then gets propagated
* throughout the projection tree, forcing any element below to recalculate on the next frame.
*/
this.isSharedProjectionDirty = false;
/**
* Flag transform dirty. This gets propagated throughout the whole tree but is only
* respected by shared nodes.
*/
this.isTransformDirty = false;
/**
* Block layout updates for instant layout transitions throughout the tree.
*/
this.updateManuallyBlocked = false;
this.updateBlockedByResize = false;
/**
* Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`
* call.
*/
this.isUpdating = false;
/**
* If this is an SVG element we currently disable projection transforms
*/
this.isSVG = false;
/**
* Flag to true (during promotion) if a node doing an instant layout transition needs to reset
* its projection styles.
*/
this.needsReset = false;
/**
* Flags whether this node should have its transform reset prior to measuring.
*/
this.shouldResetTransform = false;
/**
* Store whether this node has been checked for optimised appear animations. As
* effects fire bottom-up, and we want to look up the tree for appear animations,
* this makes sure we only check each path once, stopping at nodes that
* have already been checked.
*/
this.hasCheckedOptimisedAppear = false;
/**
* An object representing the calculated contextual/accumulated/tree scale.
* This will be used to scale calculcated projection transforms, as these are
* calculated in screen-space but need to be scaled for elements to layoutly
* make it to their calculated destinations.
*
* TODO: Lazy-init
*/
this.treeScale = { x: 1, y: 1 };
/**
*
*/
this.eventHandlers = new Map();
this.hasTreeAnimated = false;
// Note: Currently only running on root node
this.updateScheduled = false;
this.scheduleUpdate = () => this.update();
this.projectionUpdateScheduled = false;
this.checkUpdateFailed = () => {
if (this.isUpdating) {
this.isUpdating = false;
this.clearAllSnapshots();
}
};
/**
* This is a multi-step process as shared nodes might be of different depths. Nodes
* are sorted by depth order, so we need to resolve the entire tree before moving to
* the next step.
*/
this.updateProjection = () => {
this.projectionUpdateScheduled = false;
/**
* Reset debug counts. Manually resetting rather than creating a new
* object each frame.
*/
if (isDebug) {
metrics.totalNodes =
metrics.resolvedTargetDeltas =
metrics.recalculatedProjection =
0;
}
this.nodes.forEach(propagateDirtyNodes);
this.nodes.forEach(resolveTargetDelta);
this.nodes.forEach(calcProjection);
this.nodes.forEach(cleanDirtyNodes);
if (isDebug) {
window.MotionDebug.record(metrics);
}
};
/**
* Frame calculations
*/
this.resolvedRelativeTargetAt = 0.0;
this.hasProjected = false;
this.isVisible = true;
this.animationProgress = 0;
/**
* Shared layout
*/
// TODO Only running on root node
this.sharedNodes = new Map();
this.latestValues = latestValues;
this.root = parent ? parent.root || parent : this;
this.path = parent ? [...parent.path, parent] : [];
this.parent = parent;
this.depth = parent ? parent.depth + 1 : 0;
for (let i = 0; i < this.path.length; i++) {
this.path[i].shouldResetTransform = true;
}
if (this.root === this)
this.nodes = new FlatTree();
}
addEventListener(name, handler) {
if (!this.eventHandlers.has(name)) {
this.eventHandlers.set(name, new SubscriptionManager());
}
return this.eventHandlers.get(name).add(handler);
}
notifyListeners(name, ...args) {
const subscriptionManager = this.eventHandlers.get(name);
subscriptionManager && subscriptionManager.notify(...args);
}
hasListeners(name) {
return this.eventHandlers.has(name);
}
/**
* Lifecycles
*/
mount(instance, isLayoutDirty = this.root.hasTreeAnimated) {
if (this.instance)
return;
this.isSVG = isSVGElement(instance);
this.instance = instance;
const { layoutId, layout, visualElement } = this.options;
if (visualElement && !visualElement.current) {
visualElement.mount(instance);
}
this.root.nodes.add(this);
this.parent && this.parent.children.add(this);
if (isLayoutDirty && (layout || layoutId)) {
this.isLayoutDirty = true;
}
if (attachResizeListener) {
let cancelDelay;
const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false);
attachResizeListener(instance, () => {
this.root.updateBlockedByResize = true;
cancelDelay && cancelDelay();
cancelDelay = delay(resizeUnblockUpdate, 250);
if (globalProjectionState.hasAnimatedSinceResize) {
globalProjectionState.hasAnimatedSinceResize = false;
this.nodes.forEach(finishAnimation);
}
});
}
if (layoutId) {
this.root.registerSharedNode(layoutId, this);
}
// Only register the handler if it requires layout animation
if (this.options.animate !== false &&
visualElement &&
(layoutId || layout)) {
this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeTargetChanged, layout: newLayout, }) => {
if (this.isTreeAnimationBlocked()) {
this.target = undefined;
this.relativeTarget = undefined;
return;
}
// TODO: Check here if an animation exists
const layoutTransition = this.options.transition ||
visualElement.getDefaultTransition() ||
defaultLayoutTransition;
const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps();
/**
* The target layout of the element might stay the same,
* but its position relative to its parent has changed.
*/
const targetChanged = !this.targetLayout ||
!boxEqualsRounded(this.targetLayout, newLayout) ||
hasRelativeTargetChanged;
/**
* If the layout hasn't seemed to have changed, it might be that the
* element is visually in the same place in the document but its position
* relative to its parent has indeed changed. So here we check for that.
*/
const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeTargetChanged;
if (this.options.layoutRoot ||
(this.resumeFrom && this.resumeFrom.instance) ||
hasOnlyRelativeTargetChanged ||
(hasLayoutChanged &&
(targetChanged || !this.currentAnimation))) {
if (this.resumeFrom) {
this.resumingFrom = this.resumeFrom;
this.resumingFrom.resumingFrom = undefined;
}
this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);
const animationOptions = {
...get_value_transition_getValueTransition(layoutTransition, "layout"),
onPlay: onLayoutAnimationStart,
onComplete: onLayoutAnimationComplete,
};
if (visualElement.shouldReduceMotion ||
this.options.layoutRoot) {
animationOptions.delay = 0;
animationOptions.type = false;
}
this.startAnimation(animationOptions);
}
else {
/**
* If the layout hasn't changed and we have an animation that hasn't started yet,
* finish it immediately. Otherwise it will be animating from a location
* that was probably never commited to screen and look like a jumpy box.
*/
if (!hasLayoutChanged) {
finishAnimation(this);
}
if (this.isLead() && this.options.onExitComplete) {
this.options.onExitComplete();
}
}
this.targetLayout = newLayout;
});
}
}
unmount() {
this.options.layoutId && this.willUpdate();
this.root.nodes.remove(this);
const stack = this.getStack();
stack && stack.remove(this);
this.parent && this.parent.children.delete(this);
this.instance = undefined;
cancelFrame(this.updateProjection);
}
// only on the root
blockUpdate() {
this.updateManuallyBlocked = true;
}
unblockUpdate() {
this.updateManuallyBlocked = false;
}
isUpdateBlocked() {
return this.updateManuallyBlocked || this.updateBlockedByResize;
}
isTreeAnimationBlocked() {
return (this.isAnimationBlocked ||
(this.parent && this.parent.isTreeAnimationBlocked()) ||
false);
}
// Note: currently only running on root node
startUpdate() {
if (this.isUpdateBlocked())
return;
this.isUpdating = true;
this.nodes && this.nodes.forEach(resetSkewAndRotation);
this.animationId++;
}
getTransformTemplate() {
const { visualElement } = this.options;
return visualElement && visualElement.getProps().transformTemplate;
}
willUpdate(shouldNotifyListeners = true) {
this.root.hasTreeAnimated = true;
if (this.root.isUpdateBlocked()) {
this.options.onExitComplete && this.options.onExitComplete();
return;
}
/**
* If we're running optimised appear animations then these must be
* cancelled before measuring the DOM. This is so we can measure
* the true layout of the element rather than the WAAPI animation
* which will be unaffected by the resetSkewAndRotate step.
*
* Note: This is a DOM write. Worst case scenario is this is sandwiched
* between other snapshot reads which will cause unnecessary style recalculations.
* This has to happen here though, as we don't yet know which nodes will need
* snapshots in startUpdate(), but we only want to cancel optimised animations
* if a layout animation measurement is actually going to be affected by them.
*/
if (window.MotionCancelOptimisedAnimation &&
!this.hasCheckedOptimisedAppear) {
cancelTreeOptimisedTransformAnimations(this);
}
!this.root.isUpdating && this.root.startUpdate();
if (this.isLayoutDirty)
return;
this.isLayoutDirty = true;
for (let i = 0; i < this.path.length; i++) {
const node = this.path[i];
node.shouldResetTransform = true;
node.updateScroll("snapshot");
if (node.options.layoutRoot) {
node.willUpdate(false);
}
}
const { layoutId, layout } = this.options;
if (layoutId === undefined && !layout)
return;
const transformTemplate = this.getTransformTemplate();
this.prevTransformTemplateValue = transformTemplate
? transformTemplate(this.latestValues, "")
: undefined;
this.updateSnapshot();
shouldNotifyListeners && this.notifyListeners("willUpdate");
}
update() {
this.updateScheduled = false;
const updateWasBlocked = this.isUpdateBlocked();
// When doing an instant transition, we skip the layout update,
// but should still clean up the measurements so that the next
// snapshot could be taken correctly.
if (updateWasBlocked) {
this.unblockUpdate();
this.clearAllSnapshots();
this.nodes.forEach(clearMeasurements);
return;
}
if (!this.isUpdating) {
this.nodes.forEach(clearIsLayoutDirty);
}
this.isUpdating = false;
/**
* Write
*/
this.nodes.forEach(resetTransformStyle);
/**
* Read ==================
*/
// Update layout measurements of updated children
this.nodes.forEach(updateLayout);
/**
* Write
*/
// Notify listeners that the layout is updated
this.nodes.forEach(notifyLayoutUpdate);
this.clearAllSnapshots();
/**
* Manually flush any pending updates. Ideally
* we could leave this to the following requestAnimationFrame but this seems
* to leave a flash of incorrectly styled content.
*/
const now = time.now();
frameData.delta = clamp_clamp(0, 1000 / 60, now - frameData.timestamp);
frameData.timestamp = now;
frameData.isProcessing = true;
frameSteps.update.process(frameData);
frameSteps.preRender.process(frameData);
frameSteps.render.process(frameData);
frameData.isProcessing = false;
}
didUpdate() {
if (!this.updateScheduled) {
this.updateScheduled = true;
microtask.read(this.scheduleUpdate);
}
}
clearAllSnapshots() {
this.nodes.forEach(clearSnapshot);
this.sharedNodes.forEach(removeLeadSnapshots);
}
scheduleUpdateProjection() {
if (!this.projectionUpdateScheduled) {
this.projectionUpdateScheduled = true;
frame_frame.preRender(this.updateProjection, false, true);
}
}
scheduleCheckAfterUnmount() {
/**
* If the unmounting node is in a layoutGroup and did trigger a willUpdate,
* we manually call didUpdate to give a chance to the siblings to animate.
* Otherwise, cleanup all snapshots to prevents future nodes from reusing them.
*/
frame_frame.postRender(() => {
if (this.isLayoutDirty) {
this.root.didUpdate();
}
else {
this.root.checkUpdateFailed();
}
});
}
/**
* Update measurements
*/
updateSnapshot() {
if (this.snapshot || !this.instance)
return;
this.snapshot = this.measure();
}
updateLayout() {
if (!this.instance)
return;
// TODO: Incorporate into a forwarded scroll offset
this.updateScroll();
if (!(this.options.alwaysMeasureLayout && this.isLead()) &&
!this.isLayoutDirty) {
return;
}
/**
* When a node is mounted, it simply resumes from the prevLead's
* snapshot instead of taking a new one, but the ancestors scroll
* might have updated while the prevLead is unmounted. We need to
* update the scroll again to make sure the layout we measure is
* up to date.
*/
if (this.resumeFrom && !this.resumeFrom.instance) {
for (let i = 0; i < this.path.length; i++) {
const node = this.path[i];
node.updateScroll();
}
}
const prevLayout = this.layout;
this.layout = this.measure(false);
this.layoutCorrected = createBox();
this.isLayoutDirty = false;
this.projectionDelta = undefined;
this.notifyListeners("measure", this.layout.layoutBox);
const { visualElement } = this.options;
visualElement &&
visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined);
}
updateScroll(phase = "measure") {
let needsMeasurement = Boolean(this.options.layoutScroll && this.instance);
if (this.scroll &&
this.scroll.animationId === this.root.animationId &&
this.scroll.phase === phase) {
needsMeasurement = false;
}
if (needsMeasurement) {
const isRoot = checkIsScrollRoot(this.instance);
this.scroll = {
animationId: this.root.animationId,
phase,
isRoot,
offset: measureScroll(this.instance),
wasRoot: this.scroll ? this.scroll.isRoot : isRoot,
};
}
}
resetTransform() {
if (!resetTransform)
return;
const isResetRequested = this.isLayoutDirty ||
this.shouldResetTransform ||
this.options.alwaysMeasureLayout;
const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta);
const transformTemplate = this.getTransformTemplate();
const transformTemplateValue = transformTemplate
? transformTemplate(this.latestValues, "")
: undefined;
const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;
if (isResetRequested &&
(hasProjection ||
hasTransform(this.latestValues) ||
transformTemplateHasChanged)) {
resetTransform(this.instance, transformTemplateValue);
this.shouldResetTransform = false;
this.scheduleRender();
}
}
measure(removeTransform = true) {
const pageBox = this.measurePageBox();
let layoutBox = this.removeElementScroll(pageBox);
/**
* Measurements taken during the pre-render stage
* still have transforms applied so we remove them
* via calculation.
*/
if (removeTransform) {
layoutBox = this.removeTransform(layoutBox);
}
roundBox(layoutBox);
return {
animationId: this.root.animationId,
measuredBox: pageBox,
layoutBox,
latestValues: {},
source: this.id,
};
}
measurePageBox() {
var _a;
const { visualElement } = this.options;
if (!visualElement)
return createBox();
const box = visualElement.measureViewportBox();
const wasInScrollRoot = ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) || this.path.some(checkNodeWasScrollRoot);
if (!wasInScrollRoot) {
// Remove viewport scroll to give page-relative coordinates
const { scroll } = this.root;
if (scroll) {
translateAxis(box.x, scroll.offset.x);
translateAxis(box.y, scroll.offset.y);
}
}
return box;
}
removeElementScroll(box) {
var _a;
const boxWithoutScroll = createBox();
copyBoxInto(boxWithoutScroll, box);
if ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) {
return boxWithoutScroll;
}
/**
* Performance TODO: Keep a cumulative scroll offset down the tree
* rather than loop back up the path.
*/
for (let i = 0; i < this.path.length; i++) {
const node = this.path[i];
const { scroll, options } = node;
if (node !== this.root && scroll && options.layoutScroll) {
/**
* If this is a new scroll root, we want to remove all previous scrolls
* from the viewport box.
*/
if (scroll.wasRoot) {
copyBoxInto(boxWithoutScroll, box);
}
translateAxis(boxWithoutScroll.x, scroll.offset.x);
translateAxis(boxWithoutScroll.y, scroll.offset.y);
}
}
return boxWithoutScroll;
}
applyTransform(box, transformOnly = false) {
const withTransforms = createBox();
copyBoxInto(withTransforms, box);
for (let i = 0; i < this.path.length; i++) {
const node = this.path[i];
if (!transformOnly &&
node.options.layoutScroll &&
node.scroll &&
node !== node.root) {
transformBox(withTransforms, {
x: -node.scroll.offset.x,
y: -node.scroll.offset.y,
});
}
if (!hasTransform(node.latestValues))
continue;
transformBox(withTransforms, node.latestValues);
}
if (hasTransform(this.latestValues)) {
transformBox(withTransforms, this.latestValues);
}
return withTransforms;
}
removeTransform(box) {
const boxWithoutTransform = createBox();
copyBoxInto(boxWithoutTransform, box);
for (let i = 0; i < this.path.length; i++) {
const node = this.path[i];
if (!node.instance)
continue;
if (!hasTransform(node.latestValues))
continue;
hasScale(node.latestValues) && node.updateSnapshot();
const sourceBox = createBox();
const nodeBox = node.measurePageBox();
copyBoxInto(sourceBox, nodeBox);
removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox);
}
if (hasTransform(this.latestValues)) {
removeBoxTransforms(boxWithoutTransform, this.latestValues);
}
return boxWithoutTransform;
}
setTargetDelta(delta) {
this.targetDelta = delta;
this.root.scheduleUpdateProjection();
this.isProjectionDirty = true;
}
setOptions(options) {
this.options = {
...this.options,
...options,
crossfade: options.crossfade !== undefined ? options.crossfade : true,
};
}
clearMeasurements() {
this.scroll = undefined;
this.layout = undefined;
this.snapshot = undefined;
this.prevTransformTemplateValue = undefined;
this.targetDelta = undefined;
this.target = undefined;
this.isLayoutDirty = false;
}
forceRelativeParentToResolveTarget() {
if (!this.relativeParent)
return;
/**
* If the parent target isn't up-to-date, force it to update.
* This is an unfortunate de-optimisation as it means any updating relative
* projection will cause all the relative parents to recalculate back
* up the tree.
*/
if (this.relativeParent.resolvedRelativeTargetAt !==
frameData.timestamp) {
this.relativeParent.resolveTargetDelta(true);
}
}
resolveTargetDelta(forceRecalculation = false) {
var _a;
/**
* Once the dirty status of nodes has been spread through the tree, we also
* need to check if we have a shared node of a different depth that has itself
* been dirtied.
*/
const lead = this.getLead();
this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);
this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);
this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);
const isShared = Boolean(this.resumingFrom) || this !== lead;
/**
* We don't use transform for this step of processing so we don't
* need to check whether any nodes have changed transform.
*/
const canSkip = !(forceRecalculation ||
(isShared && this.isSharedProjectionDirty) ||
this.isProjectionDirty ||
((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty) ||
this.attemptToResolveRelativeTarget ||
this.root.updateBlockedByResize);
if (canSkip)
return;
const { layout, layoutId } = this.options;
/**
* If we have no layout, we can't perform projection, so early return
*/
if (!this.layout || !(layout || layoutId))
return;
this.resolvedRelativeTargetAt = frameData.timestamp;
/**
* If we don't have a targetDelta but do have a layout, we can attempt to resolve
* a relativeParent. This will allow a component to perform scale correction
* even if no animation has started.
*/
if (!this.targetDelta && !this.relativeTarget) {
const relativeParent = this.getClosestProjectingParent();
if (relativeParent &&
relativeParent.layout &&
this.animationProgress !== 1) {
this.relativeParent = relativeParent;
this.forceRelativeParentToResolveTarget();
this.relativeTarget = createBox();
this.relativeTargetOrigin = createBox();
calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox);
copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);
}
else {
this.relativeParent = this.relativeTarget = undefined;
}
}
/**
* If we have no relative target or no target delta our target isn't valid
* for this frame.
*/
if (!this.relativeTarget && !this.targetDelta)
return;
/**
* Lazy-init target data structure
*/
if (!this.target) {
this.target = createBox();
this.targetWithTransforms = createBox();
}
/**
* If we've got a relative box for this component, resolve it into a target relative to the parent.
*/
if (this.relativeTarget &&
this.relativeTargetOrigin &&
this.relativeParent &&
this.relativeParent.target) {
this.forceRelativeParentToResolveTarget();
calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target);
/**
* If we've only got a targetDelta, resolve it into a target
*/
}
else if (this.targetDelta) {
if (Boolean(this.resumingFrom)) {
// TODO: This is creating a new object every frame
this.target = this.applyTransform(this.layout.layoutBox);
}
else {
copyBoxInto(this.target, this.layout.layoutBox);
}
applyBoxDelta(this.target, this.targetDelta);
}
else {
/**
* If no target, use own layout as target
*/
copyBoxInto(this.target, this.layout.layoutBox);
}
/**
* If we've been told to attempt to resolve a relative target, do so.
*/
if (this.attemptToResolveRelativeTarget) {
this.attemptToResolveRelativeTarget = false;
const relativeParent = this.getClosestProjectingParent();
if (relativeParent &&
Boolean(relativeParent.resumingFrom) ===
Boolean(this.resumingFrom) &&
!relativeParent.options.layoutScroll &&
relativeParent.target &&
this.animationProgress !== 1) {
this.relativeParent = relativeParent;
this.forceRelativeParentToResolveTarget();
this.relativeTarget = createBox();
this.relativeTargetOrigin = createBox();
calcRelativePosition(this.relativeTargetOrigin, this.target, relativeParent.target);
copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);
}
else {
this.relativeParent = this.relativeTarget = undefined;
}
}
/**
* Increase debug counter for resolved target deltas
*/
if (isDebug) {
metrics.resolvedTargetDeltas++;
}
}
getClosestProjectingParent() {
if (!this.parent ||
hasScale(this.parent.latestValues) ||
has2DTranslate(this.parent.latestValues)) {
return undefined;
}
if (this.parent.isProjecting()) {
return this.parent;
}
else {
return this.parent.getClosestProjectingParent();
}
}
isProjecting() {
return Boolean((this.relativeTarget ||
this.targetDelta ||
this.options.layoutRoot) &&
this.layout);
}
calcProjection() {
var _a;
const lead = this.getLead();
const isShared = Boolean(this.resumingFrom) || this !== lead;
let canSkip = true;
/**
* If this is a normal layout animation and neither this node nor its nearest projecting
* is dirty then we can't skip.
*/
if (this.isProjectionDirty || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty)) {
canSkip = false;
}
/**
* If this is a shared layout animation and this node's shared projection is dirty then
* we can't skip.
*/
if (isShared &&
(this.isSharedProjectionDirty || this.isTransformDirty)) {
canSkip = false;
}
/**
* If we have resolved the target this frame we must recalculate the
* projection to ensure it visually represents the internal calculations.
*/
if (this.resolvedRelativeTargetAt === frameData.timestamp) {
canSkip = false;
}
if (canSkip)
return;
const { layout, layoutId } = this.options;
/**
* If this section of the tree isn't animating we can
* delete our target sources for the following frame.
*/
this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) ||
this.currentAnimation ||
this.pendingAnimation);
if (!this.isTreeAnimating) {
this.targetDelta = this.relativeTarget = undefined;
}
if (!this.layout || !(layout || layoutId))
return;
/**
* Reset the corrected box with the latest values from box, as we're then going
* to perform mutative operations on it.
*/
copyBoxInto(this.layoutCorrected, this.layout.layoutBox);
/**
* Record previous tree scales before updating.
*/
const prevTreeScaleX = this.treeScale.x;
const prevTreeScaleY = this.treeScale.y;
/**
* Apply all the parent deltas to this box to produce the corrected box. This
* is the layout box, as it will appear on screen as a result of the transforms of its parents.
*/
applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared);
/**
* If this layer needs to perform scale correction but doesn't have a target,
* use the layout as the target.
*/
if (lead.layout &&
!lead.target &&
(this.treeScale.x !== 1 || this.treeScale.y !== 1)) {
lead.target = lead.layout.layoutBox;
lead.targetWithTransforms = createBox();
}
const { target } = lead;
if (!target) {
/**
* If we don't have a target to project into, but we were previously
* projecting, we want to remove the stored transform and schedule
* a render to ensure the elements reflect the removed transform.
*/
if (this.prevProjectionDelta) {
this.createProjectionDeltas();
this.scheduleRender();
}
return;
}
if (!this.projectionDelta || !this.prevProjectionDelta) {
this.createProjectionDeltas();
}
else {
copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x);
copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y);
}
/**
* Update the delta between the corrected box and the target box before user-set transforms were applied.
* This will allow us to calculate the corrected borderRadius and boxShadow to compensate
* for our layout reprojection, but still allow them to be scaled correctly by the user.
* It might be that to simplify this we may want to accept that user-set scale is also corrected
* and we wouldn't have to keep and calc both deltas, OR we could support a user setting
* to allow people to choose whether these styles are corrected based on just the
* layout reprojection or the final bounding box.
*/
calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues);
if (this.treeScale.x !== prevTreeScaleX ||
this.treeScale.y !== prevTreeScaleY ||
!axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) ||
!axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) {
this.hasProjected = true;
this.scheduleRender();
this.notifyListeners("projectionUpdate", target);
}
/**
* Increase debug counter for recalculated projections
*/
if (isDebug) {
metrics.recalculatedProjection++;
}
}
hide() {
this.isVisible = false;
// TODO: Schedule render
}
show() {
this.isVisible = true;
// TODO: Schedule render
}
scheduleRender(notifyAll = true) {
var _a;
(_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.scheduleRender();
if (notifyAll) {
const stack = this.getStack();
stack && stack.scheduleRender();
}
if (this.resumingFrom && !this.resumingFrom.instance) {
this.resumingFrom = undefined;
}
}
createProjectionDeltas() {
this.prevProjectionDelta = createDelta();
this.projectionDelta = createDelta();
this.projectionDeltaWithTransform = createDelta();
}
setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) {
const snapshot = this.snapshot;
const snapshotLatestValues = snapshot
? snapshot.latestValues
: {};
const mixedValues = { ...this.latestValues };
const targetDelta = createDelta();
if (!this.relativeParent ||
!this.relativeParent.options.layoutRoot) {
this.relativeTarget = this.relativeTargetOrigin = undefined;
}
this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;
const relativeLayout = createBox();
const snapshotSource = snapshot ? snapshot.source : undefined;
const layoutSource = this.layout ? this.layout.source : undefined;
const isSharedLayoutAnimation = snapshotSource !== layoutSource;
const stack = this.getStack();
const isOnlyMember = !stack || stack.members.length <= 1;
const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation &&
!isOnlyMember &&
this.options.crossfade === true &&
!this.path.some(hasOpacityCrossfade));
this.animationProgress = 0;
let prevRelativeTarget;
this.mixTargetDelta = (latest) => {
const progress = latest / 1000;
mixAxisDelta(targetDelta.x, delta.x, progress);
mixAxisDelta(targetDelta.y, delta.y, progress);
this.setTargetDelta(targetDelta);
if (this.relativeTarget &&
this.relativeTargetOrigin &&
this.layout &&
this.relativeParent &&
this.relativeParent.layout) {
calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox);
mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress);
/**
* If this is an unchanged relative target we can consider the
* projection not dirty.
*/
if (prevRelativeTarget &&
boxEquals(this.relativeTarget, prevRelativeTarget)) {
this.isProjectionDirty = false;
}
if (!prevRelativeTarget)
prevRelativeTarget = createBox();
copyBoxInto(prevRelativeTarget, this.relativeTarget);
}
if (isSharedLayoutAnimation) {
this.animationValues = mixedValues;
mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember);
}
this.root.scheduleUpdateProjection();
this.scheduleRender();
this.animationProgress = progress;
};
this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0);
}
startAnimation(options) {
this.notifyListeners("animationStart");
this.currentAnimation && this.currentAnimation.stop();
if (this.resumingFrom && this.resumingFrom.currentAnimation) {
this.resumingFrom.currentAnimation.stop();
}
if (this.pendingAnimation) {
cancelFrame(this.pendingAnimation);
this.pendingAnimation = undefined;
}
/**
* Start the animation in the next frame to have a frame with progress 0,
* where the target is the same as when the animation started, so we can
* calculate the relative positions correctly for instant transitions.
*/
this.pendingAnimation = frame_frame.update(() => {
globalProjectionState.hasAnimatedSinceResize = true;
this.currentAnimation = animateSingleValue(0, animationTarget, {
...options,
onUpdate: (latest) => {
this.mixTargetDelta(latest);
options.onUpdate && options.onUpdate(latest);
},
onComplete: () => {
options.onComplete && options.onComplete();
this.completeAnimation();
},
});
if (this.resumingFrom) {
this.resumingFrom.currentAnimation = this.currentAnimation;
}
this.pendingAnimation = undefined;
});
}
completeAnimation() {
if (this.resumingFrom) {
this.resumingFrom.currentAnimation = undefined;
this.resumingFrom.preserveOpacity = undefined;
}
const stack = this.getStack();
stack && stack.exitAnimationComplete();
this.resumingFrom =
this.currentAnimation =
this.animationValues =
undefined;
this.notifyListeners("animationComplete");
}
finishAnimation() {
if (this.currentAnimation) {
this.mixTargetDelta && this.mixTargetDelta(animationTarget);
this.currentAnimation.stop();
}
this.completeAnimation();
}
applyTransformsToTarget() {
const lead = this.getLead();
let { targetWithTransforms, target, layout, latestValues } = lead;
if (!targetWithTransforms || !target || !layout)
return;
/**
* If we're only animating position, and this element isn't the lead element,
* then instead of projecting into the lead box we instead want to calculate
* a new target that aligns the two boxes but maintains the layout shape.
*/
if (this !== lead &&
this.layout &&
layout &&
shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) {
target = this.target || createBox();
const xLength = calcLength(this.layout.layoutBox.x);
target.x.min = lead.target.x.min;
target.x.max = target.x.min + xLength;
const yLength = calcLength(this.layout.layoutBox.y);
target.y.min = lead.target.y.min;
target.y.max = target.y.min + yLength;
}
copyBoxInto(targetWithTransforms, target);
/**
* Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.
* This is the final box that we will then project into by calculating a transform delta and
* applying it to the corrected box.
*/
transformBox(targetWithTransforms, latestValues);
/**
* Update the delta between the corrected box and the final target box, after
* user-set transforms are applied to it. This will be used by the renderer to
* create a transform style that will reproject the element from its layout layout
* into the desired bounding box.
*/
calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues);
}
registerSharedNode(layoutId, node) {
if (!this.sharedNodes.has(layoutId)) {
this.sharedNodes.set(layoutId, new NodeStack());
}
const stack = this.sharedNodes.get(layoutId);
stack.add(node);
const config = node.options.initialPromotionConfig;
node.promote({
transition: config ? config.transition : undefined,
preserveFollowOpacity: config && config.shouldPreserveFollowOpacity
? config.shouldPreserveFollowOpacity(node)
: undefined,
});
}
isLead() {
const stack = this.getStack();
return stack ? stack.lead === this : true;
}
getLead() {
var _a;
const { layoutId } = this.options;
return layoutId ? ((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.lead) || this : this;
}
getPrevLead() {
var _a;
const { layoutId } = this.options;
return layoutId ? (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.prevLead : undefined;
}
getStack() {
const { layoutId } = this.options;
if (layoutId)
return this.root.sharedNodes.get(layoutId);
}
promote({ needsReset, transition, preserveFollowOpacity, } = {}) {
const stack = this.getStack();
if (stack)
stack.promote(this, preserveFollowOpacity);
if (needsReset) {
this.projectionDelta = undefined;
this.needsReset = true;
}
if (transition)
this.setOptions({ transition });
}
relegate() {
const stack = this.getStack();
if (stack) {
return stack.relegate(this);
}
else {
return false;
}
}
resetSkewAndRotation() {
const { visualElement } = this.options;
if (!visualElement)
return;
// If there's no detected skew or rotation values, we can early return without a forced render.
let hasDistortingTransform = false;
/**
* An unrolled check for rotation values. Most elements don't have any rotation and
* skipping the nested loop and new object creation is 50% faster.
*/
const { latestValues } = visualElement;
if (latestValues.z ||
latestValues.rotate ||
latestValues.rotateX ||
latestValues.rotateY ||
latestValues.rotateZ ||
latestValues.skewX ||
latestValues.skewY) {
hasDistortingTransform = true;
}
// If there's no distorting values, we don't need to do any more.
if (!hasDistortingTransform)
return;
const resetValues = {};
if (latestValues.z) {
resetDistortingTransform("z", visualElement, resetValues, this.animationValues);
}
// Check the skew and rotate value of all axes and reset to 0
for (let i = 0; i < transformAxes.length; i++) {
resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues);
resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues);
}
// Force a render of this element to apply the transform with all skews and rotations
// set to 0.
visualElement.render();
// Put back all the values we reset
for (const key in resetValues) {
visualElement.setStaticValue(key, resetValues[key]);
if (this.animationValues) {
this.animationValues[key] = resetValues[key];
}
}
// Schedule a render for the next frame. This ensures we won't visually
// see the element with the reset rotate value applied.
visualElement.scheduleRender();
}
getProjectionStyles(styleProp) {
var _a, _b;
if (!this.instance || this.isSVG)
return undefined;
if (!this.isVisible) {
return hiddenVisibility;
}
const styles = {
visibility: "",
};
const transformTemplate = this.getTransformTemplate();
if (this.needsReset) {
this.needsReset = false;
styles.opacity = "";
styles.pointerEvents =
resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || "";
styles.transform = transformTemplate
? transformTemplate(this.latestValues, "")
: "none";
return styles;
}
const lead = this.getLead();
if (!this.projectionDelta || !this.layout || !lead.target) {
const emptyStyles = {};
if (this.options.layoutId) {
emptyStyles.opacity =
this.latestValues.opacity !== undefined
? this.latestValues.opacity
: 1;
emptyStyles.pointerEvents =
resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || "";
}
if (this.hasProjected && !hasTransform(this.latestValues)) {
emptyStyles.transform = transformTemplate
? transformTemplate({}, "")
: "none";
this.hasProjected = false;
}
return emptyStyles;
}
const valuesToRender = lead.animationValues || lead.latestValues;
this.applyTransformsToTarget();
styles.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender);
if (transformTemplate) {
styles.transform = transformTemplate(valuesToRender, styles.transform);
}
const { x, y } = this.projectionDelta;
styles.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`;
if (lead.animationValues) {
/**
* If the lead component is animating, assign this either the entering/leaving
* opacity
*/
styles.opacity =
lead === this
? (_b = (_a = valuesToRender.opacity) !== null && _a !== void 0 ? _a : this.latestValues.opacity) !== null && _b !== void 0 ? _b : 1
: this.preserveOpacity
? this.latestValues.opacity
: valuesToRender.opacityExit;
}
else {
/**
* Or we're not animating at all, set the lead component to its layout
* opacity and other components to hidden.
*/
styles.opacity =
lead === this
? valuesToRender.opacity !== undefined
? valuesToRender.opacity
: ""
: valuesToRender.opacityExit !== undefined
? valuesToRender.opacityExit
: 0;
}
/**
* Apply scale correction
*/
for (const key in scaleCorrectors) {
if (valuesToRender[key] === undefined)
continue;
const { correct, applyTo } = scaleCorrectors[key];
/**
* Only apply scale correction to the value if we have an
* active projection transform. Otherwise these values become
* vulnerable to distortion if the element changes size without
* a corresponding layout animation.
*/
const corrected = styles.transform === "none"
? valuesToRender[key]
: correct(valuesToRender[key], lead);
if (applyTo) {
const num = applyTo.length;
for (let i = 0; i < num; i++) {
styles[applyTo[i]] = corrected;
}
}
else {
styles[key] = corrected;
}
}
/**
* Disable pointer events on follow components. This is to ensure
* that if a follow component covers a lead component it doesn't block
* pointer events on the lead.
*/
if (this.options.layoutId) {
styles.pointerEvents =
lead === this
? resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || ""
: "none";
}
return styles;
}
clearSnapshot() {
this.resumeFrom = this.snapshot = undefined;
}
// Only run on root
resetTree() {
this.root.nodes.forEach((node) => { var _a; return (_a = node.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); });
this.root.nodes.forEach(clearMeasurements);
this.root.sharedNodes.clear();
}
};
}
function updateLayout(node) {
node.updateLayout();
}
function notifyLayoutUpdate(node) {
var _a;
const snapshot = ((_a = node.resumeFrom) === null || _a === void 0 ? void 0 : _a.snapshot) || node.snapshot;
if (node.isLead() &&
node.layout &&
snapshot &&
node.hasListeners("didUpdate")) {
const { layoutBox: layout, measuredBox: measuredLayout } = node.layout;
const { animationType } = node.options;
const isShared = snapshot.source !== node.layout.source;
// TODO Maybe we want to also resize the layout snapshot so we don't trigger
// animations for instance if layout="size" and an element has only changed position
if (animationType === "size") {
eachAxis((axis) => {
const axisSnapshot = isShared
? snapshot.measuredBox[axis]
: snapshot.layoutBox[axis];
const length = calcLength(axisSnapshot);
axisSnapshot.min = layout[axis].min;
axisSnapshot.max = axisSnapshot.min + length;
});
}
else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) {
eachAxis((axis) => {
const axisSnapshot = isShared
? snapshot.measuredBox[axis]
: snapshot.layoutBox[axis];
const length = calcLength(layout[axis]);
axisSnapshot.max = axisSnapshot.min + length;
/**
* Ensure relative target gets resized and rerendererd
*/
if (node.relativeTarget && !node.currentAnimation) {
node.isProjectionDirty = true;
node.relativeTarget[axis].max =
node.relativeTarget[axis].min + length;
}
});
}
const layoutDelta = createDelta();
calcBoxDelta(layoutDelta, layout, snapshot.layoutBox);
const visualDelta = createDelta();
if (isShared) {
calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox);
}
else {
calcBoxDelta(visualDelta, layout, snapshot.layoutBox);
}
const hasLayoutChanged = !isDeltaZero(layoutDelta);
let hasRelativeTargetChanged = false;
if (!node.resumeFrom) {
const relativeParent = node.getClosestProjectingParent();
/**
* If the relativeParent is itself resuming from a different element then
* the relative snapshot is not relavent
*/
if (relativeParent && !relativeParent.resumeFrom) {
const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent;
if (parentSnapshot && parentLayout) {
const relativeSnapshot = createBox();
calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox);
const relativeLayout = createBox();
calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox);
if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {
hasRelativeTargetChanged = true;
}
if (relativeParent.options.layoutRoot) {
node.relativeTarget = relativeLayout;
node.relativeTargetOrigin = relativeSnapshot;
node.relativeParent = relativeParent;
}
}
}
}
node.notifyListeners("didUpdate", {
layout,
snapshot,
delta: visualDelta,
layoutDelta,
hasLayoutChanged,
hasRelativeTargetChanged,
});
}
else if (node.isLead()) {
const { onExitComplete } = node.options;
onExitComplete && onExitComplete();
}
/**
* Clearing transition
* TODO: Investigate why this transition is being passed in as {type: false } from Framer
* and why we need it at all
*/
node.options.transition = undefined;
}
function propagateDirtyNodes(node) {
/**
* Increase debug counter for nodes encountered this frame
*/
if (isDebug) {
metrics.totalNodes++;
}
if (!node.parent)
return;
/**
* If this node isn't projecting, propagate isProjectionDirty. It will have
* no performance impact but it will allow the next child that *is* projecting
* but *isn't* dirty to just check its parent to see if *any* ancestor needs
* correcting.
*/
if (!node.isProjecting()) {
node.isProjectionDirty = node.parent.isProjectionDirty;
}
/**
* Propagate isSharedProjectionDirty and isTransformDirty
* throughout the whole tree. A future revision can take another look at
* this but for safety we still recalcualte shared nodes.
*/
node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty ||
node.parent.isProjectionDirty ||
node.parent.isSharedProjectionDirty));
node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty);
}
function cleanDirtyNodes(node) {
node.isProjectionDirty =
node.isSharedProjectionDirty =
node.isTransformDirty =
false;
}
function clearSnapshot(node) {
node.clearSnapshot();
}
function clearMeasurements(node) {
node.clearMeasurements();
}
function clearIsLayoutDirty(node) {
node.isLayoutDirty = false;
}
function resetTransformStyle(node) {
const { visualElement } = node.options;
if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {
visualElement.notify("BeforeLayoutMeasure");
}
node.resetTransform();
}
function finishAnimation(node) {
node.finishAnimation();
node.targetDelta = node.relativeTarget = node.target = undefined;
node.isProjectionDirty = true;
}
function resolveTargetDelta(node) {
node.resolveTargetDelta();
}
function calcProjection(node) {
node.calcProjection();
}
function resetSkewAndRotation(node) {
node.resetSkewAndRotation();
}
function removeLeadSnapshots(stack) {
stack.removeLeadSnapshot();
}
function mixAxisDelta(output, delta, p) {
output.translate = mixNumber(delta.translate, 0, p);
output.scale = mixNumber(delta.scale, 1, p);
output.origin = delta.origin;
output.originPoint = delta.originPoint;
}
function mixAxis(output, from, to, p) {
output.min = mixNumber(from.min, to.min, p);
output.max = mixNumber(from.max, to.max, p);
}
function mixBox(output, from, to, p) {
mixAxis(output.x, from.x, to.x, p);
mixAxis(output.y, from.y, to.y, p);
}
function hasOpacityCrossfade(node) {
return (node.animationValues && node.animationValues.opacityExit !== undefined);
}
const defaultLayoutTransition = {
duration: 0.45,
ease: [0.4, 0, 0.1, 1],
};
const userAgentContains = (string) => typeof navigator !== "undefined" &&
navigator.userAgent &&
navigator.userAgent.toLowerCase().includes(string);
/**
* Measured bounding boxes must be rounded in Safari and
* left untouched in Chrome, otherwise non-integer layouts within scaled-up elements
* can appear to jump.
*/
const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/")
? Math.round
: noop_noop;
function roundAxis(axis) {
// Round to the nearest .5 pixels to support subpixel layouts
axis.min = roundPoint(axis.min);
axis.max = roundPoint(axis.max);
}
function roundBox(box) {
roundAxis(box.x);
roundAxis(box.y);
}
function shouldAnimatePositionOnly(animationType, snapshot, layout) {
return (animationType === "position" ||
(animationType === "preserve-aspect" &&
!isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2)));
}
function checkNodeWasScrollRoot(node) {
var _a;
return node !== node.root && ((_a = node.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot);
}
;// ./node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs
const DocumentProjectionNode = createProjectionNode({
attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify),
measureScroll: () => ({
x: document.documentElement.scrollLeft || document.body.scrollLeft,
y: document.documentElement.scrollTop || document.body.scrollTop,
}),
checkIsScrollRoot: () => true,
});
;// ./node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs
const rootProjectionNode = {
current: undefined,
};
const HTMLProjectionNode = createProjectionNode({
measureScroll: (instance) => ({
x: instance.scrollLeft,
y: instance.scrollTop,
}),
defaultParent: () => {
if (!rootProjectionNode.current) {
const documentNode = new DocumentProjectionNode({});
documentNode.mount(window);
documentNode.setOptions({ layoutScroll: true });
rootProjectionNode.current = documentNode;
}
return rootProjectionNode.current;
},
resetTransform: (instance, value) => {
instance.style.transform = value !== undefined ? value : "none";
},
checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"),
});
;// ./node_modules/framer-motion/dist/es/motion/features/drag.mjs
const drag = {
pan: {
Feature: PanGesture,
},
drag: {
Feature: DragGesture,
ProjectionNode: HTMLProjectionNode,
MeasureLayout: MeasureLayout,
},
};
;// ./node_modules/framer-motion/dist/es/gestures/hover.mjs
function handleHoverEvent(node, event, lifecycle) {
const { props } = node;
if (node.animationState && props.whileHover) {
node.animationState.setActive("whileHover", lifecycle === "Start");
}
const eventName = ("onHover" + lifecycle);
const callback = props[eventName];
if (callback) {
frame_frame.postRender(() => callback(event, extractEventInfo(event)));
}
}
class HoverGesture extends Feature {
mount() {
const { current } = this.node;
if (!current)
return;
this.unmount = hover(current, (startEvent) => {
handleHoverEvent(this.node, startEvent, "Start");
return (endEvent) => handleHoverEvent(this.node, endEvent, "End");
});
}
unmount() { }
}
;// ./node_modules/framer-motion/dist/es/gestures/focus.mjs
class FocusGesture extends Feature {
constructor() {
super(...arguments);
this.isActive = false;
}
onFocus() {
let isFocusVisible = false;
/**
* If this element doesn't match focus-visible then don't
* apply whileHover. But, if matches throws that focus-visible
* is not a valid selector then in that browser outline styles will be applied
* to the element by default and we want to match that behaviour with whileFocus.
*/
try {
isFocusVisible = this.node.current.matches(":focus-visible");
}
catch (e) {
isFocusVisible = true;
}
if (!isFocusVisible || !this.node.animationState)
return;
this.node.animationState.setActive("whileFocus", true);
this.isActive = true;
}
onBlur() {
if (!this.isActive || !this.node.animationState)
return;
this.node.animationState.setActive("whileFocus", false);
this.isActive = false;
}
mount() {
this.unmount = pipe(addDomEvent(this.node.current, "focus", () => this.onFocus()), addDomEvent(this.node.current, "blur", () => this.onBlur()));
}
unmount() { }
}
;// ./node_modules/framer-motion/dist/es/gestures/press.mjs
function handlePressEvent(node, event, lifecycle) {
const { props } = node;
if (node.animationState && props.whileTap) {
node.animationState.setActive("whileTap", lifecycle === "Start");
}
const eventName = ("onTap" + (lifecycle === "End" ? "" : lifecycle));
const callback = props[eventName];
if (callback) {
frame_frame.postRender(() => callback(event, extractEventInfo(event)));
}
}
class PressGesture extends Feature {
mount() {
const { current } = this.node;
if (!current)
return;
this.unmount = press(current, (startEvent) => {
handlePressEvent(this.node, startEvent, "Start");
return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? "End" : "Cancel");
}, { useGlobalTarget: this.node.props.globalTapTarget });
}
unmount() { }
}
;// ./node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs
/**
* Map an IntersectionHandler callback to an element. We only ever make one handler for one
* element, so even though these handlers might all be triggered by different
* observers, we can keep them in the same map.
*/
const observerCallbacks = new WeakMap();
/**
* Multiple observers can be created for multiple element/document roots. Each with
* different settings. So here we store dictionaries of observers to each root,
* using serialised settings (threshold/margin) as lookup keys.
*/
const observers = new WeakMap();
const fireObserverCallback = (entry) => {
const callback = observerCallbacks.get(entry.target);
callback && callback(entry);
};
const fireAllObserverCallbacks = (entries) => {
entries.forEach(fireObserverCallback);
};
function initIntersectionObserver({ root, ...options }) {
const lookupRoot = root || document;
/**
* If we don't have an observer lookup map for this root, create one.
*/
if (!observers.has(lookupRoot)) {
observers.set(lookupRoot, {});
}
const rootObservers = observers.get(lookupRoot);
const key = JSON.stringify(options);
/**
* If we don't have an observer for this combination of root and settings,
* create one.
*/
if (!rootObservers[key]) {
rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options });
}
return rootObservers[key];
}
function observeIntersection(element, options, callback) {
const rootInteresectionObserver = initIntersectionObserver(options);
observerCallbacks.set(element, callback);
rootInteresectionObserver.observe(element);
return () => {
observerCallbacks.delete(element);
rootInteresectionObserver.unobserve(element);
};
}
;// ./node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs
const thresholdNames = {
some: 0,
all: 1,
};
class InViewFeature extends Feature {
constructor() {
super(...arguments);
this.hasEnteredView = false;
this.isInView = false;
}
startObserver() {
this.unmount();
const { viewport = {} } = this.node.getProps();
const { root, margin: rootMargin, amount = "some", once } = viewport;
const options = {
root: root ? root.current : undefined,
rootMargin,
threshold: typeof amount === "number" ? amount : thresholdNames[amount],
};
const onIntersectionUpdate = (entry) => {
const { isIntersecting } = entry;
/**
* If there's been no change in the viewport state, early return.
*/
if (this.isInView === isIntersecting)
return;
this.isInView = isIntersecting;
/**
* Handle hasEnteredView. If this is only meant to run once, and
* element isn't visible, early return. Otherwise set hasEnteredView to true.
*/
if (once && !isIntersecting && this.hasEnteredView) {
return;
}
else if (isIntersecting) {
this.hasEnteredView = true;
}
if (this.node.animationState) {
this.node.animationState.setActive("whileInView", isIntersecting);
}
/**
* Use the latest committed props rather than the ones in scope
* when this observer is created
*/
const { onViewportEnter, onViewportLeave } = this.node.getProps();
const callback = isIntersecting ? onViewportEnter : onViewportLeave;
callback && callback(entry);
};
return observeIntersection(this.node.current, options, onIntersectionUpdate);
}
mount() {
this.startObserver();
}
update() {
if (typeof IntersectionObserver === "undefined")
return;
const { props, prevProps } = this.node;
const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps));
if (hasOptionsChanged) {
this.startObserver();
}
}
unmount() { }
}
function hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {
return (name) => viewport[name] !== prevViewport[name];
}
;// ./node_modules/framer-motion/dist/es/motion/features/gestures.mjs
const gestureAnimations = {
inView: {
Feature: InViewFeature,
},
tap: {
Feature: PressGesture,
},
focus: {
Feature: FocusGesture,
},
hover: {
Feature: HoverGesture,
},
};
;// ./node_modules/framer-motion/dist/es/motion/features/layout.mjs
const layout = {
layout: {
ProjectionNode: HTMLProjectionNode,
MeasureLayout: MeasureLayout,
},
};
;// ./node_modules/framer-motion/dist/es/context/LazyContext.mjs
"use client";
const LazyContext = (0,external_React_.createContext)({ strict: false });
;// ./node_modules/framer-motion/dist/es/context/MotionContext/index.mjs
"use client";
const MotionContext = (0,external_React_.createContext)({});
;// ./node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.mjs
function isControllingVariants(props) {
return (isAnimationControls(props.animate) ||
variantProps.some((name) => isVariantLabel(props[name])));
}
function isVariantNode(props) {
return Boolean(isControllingVariants(props) || props.variants);
}
;// ./node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs
function getCurrentTreeVariants(props, context) {
if (isControllingVariants(props)) {
const { initial, animate } = props;
return {
initial: initial === false || isVariantLabel(initial)
? initial
: undefined,
animate: isVariantLabel(animate) ? animate : undefined,
};
}
return props.inherit !== false ? context : {};
}
;// ./node_modules/framer-motion/dist/es/context/MotionContext/create.mjs
function useCreateMotionContext(props) {
const { initial, animate } = getCurrentTreeVariants(props, (0,external_React_.useContext)(MotionContext));
return (0,external_React_.useMemo)(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);
}
function variantLabelsAsDependency(prop) {
return Array.isArray(prop) ? prop.join(" ") : prop;
}
;// ./node_modules/framer-motion/dist/es/motion/features/definitions.mjs
const featureProps = {
animation: [
"animate",
"variants",
"whileHover",
"whileTap",
"exit",
"whileInView",
"whileFocus",
"whileDrag",
],
exit: ["exit"],
drag: ["drag", "dragControls"],
focus: ["whileFocus"],
hover: ["whileHover", "onHoverStart", "onHoverEnd"],
tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"],
pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
layout: ["layout", "layoutId"],
};
const featureDefinitions = {};
for (const key in featureProps) {
featureDefinitions[key] = {
isEnabled: (props) => featureProps[key].some((name) => !!props[name]),
};
}
;// ./node_modules/framer-motion/dist/es/motion/features/load-features.mjs
function loadFeatures(features) {
for (const key in features) {
featureDefinitions[key] = {
...featureDefinitions[key],
...features[key],
};
}
}
;// ./node_modules/framer-motion/dist/es/motion/utils/symbol.mjs
const motionComponentSymbol = Symbol.for("motionComponentSymbol");
;// ./node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs
/**
* Creates a ref function that, when called, hydrates the provided
* external ref and VisualElement.
*/
function useMotionRef(visualState, visualElement, externalRef) {
return (0,external_React_.useCallback)((instance) => {
if (instance) {
visualState.onMount && visualState.onMount(instance);
}
if (visualElement) {
if (instance) {
visualElement.mount(instance);
}
else {
visualElement.unmount();
}
}
if (externalRef) {
if (typeof externalRef === "function") {
externalRef(instance);
}
else if (isRefObject(externalRef)) {
externalRef.current = instance;
}
}
},
/**
* Only pass a new ref callback to React if we've received a visual element
* factory. Otherwise we'll be mounting/remounting every time externalRef
* or other dependencies change.
*/
[visualElement]);
}
;// ./node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs
function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor) {
var _a, _b;
const { visualElement: parent } = (0,external_React_.useContext)(MotionContext);
const lazyContext = (0,external_React_.useContext)(LazyContext);
const presenceContext = (0,external_React_.useContext)(PresenceContext_PresenceContext);
const reducedMotionConfig = (0,external_React_.useContext)(MotionConfigContext).reducedMotion;
const visualElementRef = (0,external_React_.useRef)(null);
/**
* If we haven't preloaded a renderer, check to see if we have one lazy-loaded
*/
createVisualElement = createVisualElement || lazyContext.renderer;
if (!visualElementRef.current && createVisualElement) {
visualElementRef.current = createVisualElement(Component, {
visualState,
parent,
props,
presenceContext,
blockInitialAnimation: presenceContext
? presenceContext.initial === false
: false,
reducedMotionConfig,
});
}
const visualElement = visualElementRef.current;
/**
* Load Motion gesture and animation features. These are rendered as renderless
* components so each feature can optionally make use of React lifecycle methods.
*/
const initialLayoutGroupConfig = (0,external_React_.useContext)(SwitchLayoutGroupContext);
if (visualElement &&
!visualElement.projection &&
ProjectionNodeConstructor &&
(visualElement.type === "html" || visualElement.type === "svg")) {
use_visual_element_createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);
}
const isMounted = (0,external_React_.useRef)(false);
(0,external_React_.useInsertionEffect)(() => {
/**
* Check the component has already mounted before calling
* `update` unnecessarily. This ensures we skip the initial update.
*/
if (visualElement && isMounted.current) {
visualElement.update(props, presenceContext);
}
});
/**
* Cache this value as we want to know whether HandoffAppearAnimations
* was present on initial render - it will be deleted after this.
*/
const optimisedAppearId = props[optimizedAppearDataAttribute];
const wantsHandoff = (0,external_React_.useRef)(Boolean(optimisedAppearId) &&
!((_a = window.MotionHandoffIsComplete) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId)) &&
((_b = window.MotionHasOptimisedAnimation) === null || _b === void 0 ? void 0 : _b.call(window, optimisedAppearId)));
useIsomorphicLayoutEffect(() => {
if (!visualElement)
return;
isMounted.current = true;
window.MotionIsMounted = true;
visualElement.updateFeatures();
microtask.render(visualElement.render);
/**
* Ideally this function would always run in a useEffect.
*
* However, if we have optimised appear animations to handoff from,
* it needs to happen synchronously to ensure there's no flash of
* incorrect styles in the event of a hydration error.
*
* So if we detect a situtation where optimised appear animations
* are running, we use useLayoutEffect to trigger animations.
*/
if (wantsHandoff.current && visualElement.animationState) {
visualElement.animationState.animateChanges();
}
});
(0,external_React_.useEffect)(() => {
if (!visualElement)
return;
if (!wantsHandoff.current && visualElement.animationState) {
visualElement.animationState.animateChanges();
}
if (wantsHandoff.current) {
// This ensures all future calls to animateChanges() in this component will run in useEffect
queueMicrotask(() => {
var _a;
(_a = window.MotionHandoffMarkAsComplete) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId);
});
wantsHandoff.current = false;
}
});
return visualElement;
}
function use_visual_element_createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {
const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, } = props;
visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"]
? undefined
: getClosestProjectingNode(visualElement.parent));
visualElement.projection.setOptions({
layoutId,
layout,
alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),
visualElement,
/**
* TODO: Update options in an effect. This could be tricky as it'll be too late
* to update by the time layout animations run.
* We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
* ensuring it gets called if there's no potential layout animations.
*
*/
animationType: typeof layout === "string" ? layout : "both",
initialPromotionConfig,
layoutScroll,
layoutRoot,
});
}
function getClosestProjectingNode(visualElement) {
if (!visualElement)
return undefined;
return visualElement.options.allowProjection !== false
? visualElement.projection
: getClosestProjectingNode(visualElement.parent);
}
;// ./node_modules/framer-motion/dist/es/motion/index.mjs
"use client";
/**
* Create a `motion` component.
*
* This function accepts a Component argument, which can be either a string (ie "div"
* for `motion.div`), or an actual React component.
*
* Alongside this is a config option which provides a way of rendering the provided
* component "offline", or outside the React render cycle.
*/
function createRendererMotionComponent({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component, }) {
var _a, _b;
preloadedFeatures && loadFeatures(preloadedFeatures);
function MotionComponent(props, externalRef) {
/**
* If we need to measure the element we load this functionality in a
* separate class component in order to gain access to getSnapshotBeforeUpdate.
*/
let MeasureLayout;
const configAndProps = {
...(0,external_React_.useContext)(MotionConfigContext),
...props,
layoutId: useLayoutId(props),
};
const { isStatic } = configAndProps;
const context = useCreateMotionContext(props);
const visualState = useVisualState(props, isStatic);
if (!isStatic && is_browser_isBrowser) {
useStrictMode(configAndProps, preloadedFeatures);
const layoutProjection = getProjectionFunctionality(configAndProps);
MeasureLayout = layoutProjection.MeasureLayout;
/**
* Create a VisualElement for this component. A VisualElement provides a common
* interface to renderer-specific APIs (ie DOM/Three.js etc) as well as
* providing a way of rendering to these APIs outside of the React render loop
* for more performant animations and interactions
*/
context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode);
}
/**
* The mount order and hierarchy is specific to ensure our element ref
* is hydrated by the time features fire their effects.
*/
return ((0,external_ReactJSXRuntime_namespaceObject.jsxs)(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? ((0,external_ReactJSXRuntime_namespaceObject.jsx)(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, context.visualElement)] }));
}
MotionComponent.displayName = `motion.${typeof Component === "string"
? Component
: `create(${(_b = (_a = Component.displayName) !== null && _a !== void 0 ? _a : Component.name) !== null && _b !== void 0 ? _b : ""})`}`;
const ForwardRefMotionComponent = (0,external_React_.forwardRef)(MotionComponent);
ForwardRefMotionComponent[motionComponentSymbol] = Component;
return ForwardRefMotionComponent;
}
function useLayoutId({ layoutId }) {
const layoutGroupId = (0,external_React_.useContext)(LayoutGroupContext).id;
return layoutGroupId && layoutId !== undefined
? layoutGroupId + "-" + layoutId
: layoutId;
}
function useStrictMode(configAndProps, preloadedFeatures) {
const isStrict = (0,external_React_.useContext)(LazyContext).strict;
/**
* If we're in development mode, check to make sure we're not rendering a motion component
* as a child of LazyMotion, as this will break the file-size benefits of using it.
*/
if (false) {}
}
function getProjectionFunctionality(props) {
const { drag, layout } = featureDefinitions;
if (!drag && !layout)
return {};
const combined = { ...drag, ...layout };
return {
MeasureLayout: (drag === null || drag === void 0 ? void 0 : drag.isEnabled(props)) || (layout === null || layout === void 0 ? void 0 : layout.isEnabled(props))
? combined.MeasureLayout
: undefined,
ProjectionNode: combined.ProjectionNode,
};
}
;// ./node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs
/**
* We keep these listed separately as we use the lowercase tag names as part
* of the runtime bundle to detect SVG components
*/
const lowercaseSVGElements = [
"animate",
"circle",
"defs",
"desc",
"ellipse",
"g",
"image",
"line",
"filter",
"marker",
"mask",
"metadata",
"path",
"pattern",
"polygon",
"polyline",
"rect",
"stop",
"switch",
"symbol",
"svg",
"text",
"tspan",
"use",
"view",
];
;// ./node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs
function isSVGComponent(Component) {
if (
/**
* If it's not a string, it's a custom React component. Currently we only support
* HTML custom React components.
*/
typeof Component !== "string" ||
/**
* If it contains a dash, the element is a custom HTML webcomponent.
*/
Component.includes("-")) {
return false;
}
else if (
/**
* If it's in our list of lowercase SVG tags, it's an SVG component
*/
lowercaseSVGElements.indexOf(Component) > -1 ||
/**
* If it contains a capital letter, it's an SVG component
*/
/[A-Z]/u.test(Component)) {
return true;
}
return false;
}
;// ./node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs
function makeState({ scrapeMotionValuesFromProps, createRenderState, onUpdate, }, props, context, presenceContext) {
const state = {
latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),
renderState: createRenderState(),
};
if (onUpdate) {
/**
* onMount works without the VisualElement because it could be
* called before the VisualElement payload has been hydrated.
* (e.g. if someone is using m components <m.circle />)
*/
state.onMount = (instance) => onUpdate({ props, current: instance, ...state });
state.onUpdate = (visualElement) => onUpdate(visualElement);
}
return state;
}
const makeUseVisualState = (config) => (props, isStatic) => {
const context = (0,external_React_.useContext)(MotionContext);
const presenceContext = (0,external_React_.useContext)(PresenceContext_PresenceContext);
const make = () => makeState(config, props, context, presenceContext);
return isStatic ? make() : useConstant(make);
};
function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
const values = {};
const motionValues = scrapeMotionValues(props, {});
for (const key in motionValues) {
values[key] = resolveMotionValue(motionValues[key]);
}
let { initial, animate } = props;
const isControllingVariants$1 = isControllingVariants(props);
const isVariantNode$1 = isVariantNode(props);
if (context &&
isVariantNode$1 &&
!isControllingVariants$1 &&
props.inherit !== false) {
if (initial === undefined)
initial = context.initial;
if (animate === undefined)
animate = context.animate;
}
let isInitialAnimationBlocked = presenceContext
? presenceContext.initial === false
: false;
isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;
const variantToSet = isInitialAnimationBlocked ? animate : initial;
if (variantToSet &&
typeof variantToSet !== "boolean" &&
!isAnimationControls(variantToSet)) {
const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];
for (let i = 0; i < list.length; i++) {
const resolved = resolveVariantFromProps(props, list[i]);
if (resolved) {
const { transitionEnd, transition, ...target } = resolved;
for (const key in target) {
let valueTarget = target[key];
if (Array.isArray(valueTarget)) {
/**
* Take final keyframe if the initial animation is blocked because
* we want to initialise at the end of that blocked animation.
*/
const index = isInitialAnimationBlocked
? valueTarget.length - 1
: 0;
valueTarget = valueTarget[index];
}
if (valueTarget !== null) {
values[key] = valueTarget;
}
}
for (const key in transitionEnd) {
values[key] = transitionEnd[key];
}
}
}
}
return values;
}
;// ./node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs
/**
* Provided a value and a ValueType, returns the value as that value type.
*/
const getValueAsType = (value, type) => {
return type && typeof value === "number"
? type.transform(value)
: value;
};
;// ./node_modules/framer-motion/dist/es/render/html/utils/build-transform.mjs
const translateAlias = {
x: "translateX",
y: "translateY",
z: "translateZ",
transformPerspective: "perspective",
};
const numTransforms = transformPropOrder.length;
/**
* Build a CSS transform style from individual x/y/scale etc properties.
*
* This outputs with a default order of transforms/scales/rotations, this can be customised by
* providing a transformTemplate function.
*/
function buildTransform(latestValues, transform, transformTemplate) {
// The transform string we're going to build into.
let transformString = "";
let transformIsDefault = true;
/**
* Loop over all possible transforms in order, adding the ones that
* are present to the transform string.
*/
for (let i = 0; i < numTransforms; i++) {
const key = transformPropOrder[i];
const value = latestValues[key];
if (value === undefined)
continue;
let valueIsDefault = true;
if (typeof value === "number") {
valueIsDefault = value === (key.startsWith("scale") ? 1 : 0);
}
else {
valueIsDefault = parseFloat(value) === 0;
}
if (!valueIsDefault || transformTemplate) {
const valueAsType = getValueAsType(value, numberValueTypes[key]);
if (!valueIsDefault) {
transformIsDefault = false;
const transformName = translateAlias[key] || key;
transformString += `${transformName}(${valueAsType}) `;
}
if (transformTemplate) {
transform[key] = valueAsType;
}
}
}
transformString = transformString.trim();
// If we have a custom `transform` template, pass our transform values and
// generated transformString to that before returning
if (transformTemplate) {
transformString = transformTemplate(transform, transformIsDefault ? "" : transformString);
}
else if (transformIsDefault) {
transformString = "none";
}
return transformString;
}
;// ./node_modules/framer-motion/dist/es/render/html/utils/build-styles.mjs
function buildHTMLStyles(state, latestValues, transformTemplate) {
const { style, vars, transformOrigin } = state;
// Track whether we encounter any transform or transformOrigin values.
let hasTransform = false;
let hasTransformOrigin = false;
/**
* Loop over all our latest animated values and decide whether to handle them
* as a style or CSS variable.
*
* Transforms and transform origins are kept separately for further processing.
*/
for (const key in latestValues) {
const value = latestValues[key];
if (transformProps.has(key)) {
// If this is a transform, flag to enable further transform processing
hasTransform = true;
continue;
}
else if (isCSSVariableName(key)) {
vars[key] = value;
continue;
}
else {
// Convert the value to its default value type, ie 0 -> "0px"
const valueAsType = getValueAsType(value, numberValueTypes[key]);
if (key.startsWith("origin")) {
// If this is a transform origin, flag and enable further transform-origin processing
hasTransformOrigin = true;
transformOrigin[key] =
valueAsType;
}
else {
style[key] = valueAsType;
}
}
}
if (!latestValues.transform) {
if (hasTransform || transformTemplate) {
style.transform = buildTransform(latestValues, state.transform, transformTemplate);
}
else if (style.transform) {
/**
* If we have previously created a transform but currently don't have any,
* reset transform style to none.
*/
style.transform = "none";
}
}
/**
* Build a transformOrigin style. Uses the same defaults as the browser for
* undefined origins.
*/
if (hasTransformOrigin) {
const { originX = "50%", originY = "50%", originZ = 0, } = transformOrigin;
style.transformOrigin = `${originX} ${originY} ${originZ}`;
}
}
;// ./node_modules/framer-motion/dist/es/render/svg/utils/path.mjs
const dashKeys = {
offset: "stroke-dashoffset",
array: "stroke-dasharray",
};
const camelKeys = {
offset: "strokeDashoffset",
array: "strokeDasharray",
};
/**
* Build SVG path properties. Uses the path's measured length to convert
* our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset
* and stroke-dasharray attributes.
*
* This function is mutative to reduce per-frame GC.
*/
function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {
// Normalise path length by setting SVG attribute pathLength to 1
attrs.pathLength = 1;
// We use dash case when setting attributes directly to the DOM node and camel case
// when defining props on a React component.
const keys = useDashCase ? dashKeys : camelKeys;
// Build the dash offset
attrs[keys.offset] = px.transform(-offset);
// Build the dash array
const pathLength = px.transform(length);
const pathSpacing = px.transform(spacing);
attrs[keys.array] = `${pathLength} ${pathSpacing}`;
}
;// ./node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.mjs
function transform_origin_calcOrigin(origin, offset, size) {
return typeof origin === "string"
? origin
: px.transform(offset + size * origin);
}
/**
* The SVG transform origin defaults are different to CSS and is less intuitive,
* so we use the measured dimensions of the SVG to reconcile these.
*/
function calcSVGTransformOrigin(dimensions, originX, originY) {
const pxOriginX = transform_origin_calcOrigin(originX, dimensions.x, dimensions.width);
const pxOriginY = transform_origin_calcOrigin(originY, dimensions.y, dimensions.height);
return `${pxOriginX} ${pxOriginY}`;
}
;// ./node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs
/**
* Build SVG visual attrbutes, like cx and style.transform
*/
function buildSVGAttrs(state, { attrX, attrY, attrScale, originX, originY, pathLength, pathSpacing = 1, pathOffset = 0,
// This is object creation, which we try to avoid per-frame.
...latest }, isSVGTag, transformTemplate) {
buildHTMLStyles(state, latest, transformTemplate);
/**
* For svg tags we just want to make sure viewBox is animatable and treat all the styles
* as normal HTML tags.
*/
if (isSVGTag) {
if (state.style.viewBox) {
state.attrs.viewBox = state.style.viewBox;
}
return;
}
state.attrs = state.style;
state.style = {};
const { attrs, style, dimensions } = state;
/**
* However, we apply transforms as CSS transforms. So if we detect a transform we take it from attrs
* and copy it into style.
*/
if (attrs.transform) {
if (dimensions)
style.transform = attrs.transform;
delete attrs.transform;
}
// Parse transformOrigin
if (dimensions &&
(originX !== undefined || originY !== undefined || style.transform)) {
style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5);
}
// Render attrX/attrY/attrScale as attributes
if (attrX !== undefined)
attrs.x = attrX;
if (attrY !== undefined)
attrs.y = attrY;
if (attrScale !== undefined)
attrs.scale = attrScale;
// Build SVG path if one has been defined
if (pathLength !== undefined) {
buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);
}
}
;// ./node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs
const createHtmlRenderState = () => ({
style: {},
transform: {},
transformOrigin: {},
vars: {},
});
;// ./node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs
const createSvgRenderState = () => ({
...createHtmlRenderState(),
attrs: {},
});
;// ./node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs
const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg";
;// ./node_modules/framer-motion/dist/es/render/html/utils/render.mjs
function renderHTML(element, { style, vars }, styleProp, projection) {
Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp));
// Loop over any CSS variables and assign those.
for (const key in vars) {
element.style.setProperty(key, vars[key]);
}
}
;// ./node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs
/**
* A set of attribute names that are always read/written as camel case.
*/
const camelCaseAttributes = new Set([
"baseFrequency",
"diffuseConstant",
"kernelMatrix",
"kernelUnitLength",
"keySplines",
"keyTimes",
"limitingConeAngle",
"markerHeight",
"markerWidth",
"numOctaves",
"targetX",
"targetY",
"surfaceScale",
"specularConstant",
"specularExponent",
"stdDeviation",
"tableValues",
"viewBox",
"gradientTransform",
"pathLength",
"startOffset",
"textLength",
"lengthAdjust",
]);
;// ./node_modules/framer-motion/dist/es/render/svg/utils/render.mjs
function renderSVG(element, renderState, _styleProp, projection) {
renderHTML(element, renderState, undefined, projection);
for (const key in renderState.attrs) {
element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);
}
}
;// ./node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs
function isForcedMotionValue(key, { layout, layoutId }) {
return (transformProps.has(key) ||
key.startsWith("origin") ||
((layout || layoutId !== undefined) &&
(!!scaleCorrectors[key] || key === "opacity")));
}
;// ./node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs
function scrapeMotionValuesFromProps(props, prevProps, visualElement) {
var _a;
const { style } = props;
const newValues = {};
for (const key in style) {
if (isMotionValue(style[key]) ||
(prevProps.style &&
isMotionValue(prevProps.style[key])) ||
isForcedMotionValue(key, props) ||
((_a = visualElement === null || visualElement === void 0 ? void 0 : visualElement.getValue(key)) === null || _a === void 0 ? void 0 : _a.liveStyle) !== undefined) {
newValues[key] = style[key];
}
}
return newValues;
}
;// ./node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs
function scrape_motion_values_scrapeMotionValuesFromProps(props, prevProps, visualElement) {
const newValues = scrapeMotionValuesFromProps(props, prevProps, visualElement);
for (const key in props) {
if (isMotionValue(props[key]) ||
isMotionValue(prevProps[key])) {
const targetKey = transformPropOrder.indexOf(key) !== -1
? "attr" + key.charAt(0).toUpperCase() + key.substring(1)
: key;
newValues[targetKey] = props[key];
}
}
return newValues;
}
;// ./node_modules/framer-motion/dist/es/render/svg/config-motion.mjs
function updateSVGDimensions(instance, renderState) {
try {
renderState.dimensions =
typeof instance.getBBox === "function"
? instance.getBBox()
: instance.getBoundingClientRect();
}
catch (e) {
// Most likely trying to measure an unrendered element under Firefox
renderState.dimensions = {
x: 0,
y: 0,
width: 0,
height: 0,
};
}
}
const layoutProps = ["x", "y", "width", "height", "cx", "cy", "r"];
const svgMotionConfig = {
useVisualState: makeUseVisualState({
scrapeMotionValuesFromProps: scrape_motion_values_scrapeMotionValuesFromProps,
createRenderState: createSvgRenderState,
onUpdate: ({ props, prevProps, current, renderState, latestValues, }) => {
if (!current)
return;
let hasTransform = !!props.drag;
if (!hasTransform) {
for (const key in latestValues) {
if (transformProps.has(key)) {
hasTransform = true;
break;
}
}
}
if (!hasTransform)
return;
let needsMeasure = !prevProps;
if (prevProps) {
/**
* Check the layout props for changes, if any are found we need to
* measure the element again.
*/
for (let i = 0; i < layoutProps.length; i++) {
const key = layoutProps[i];
if (props[key] !==
prevProps[key]) {
needsMeasure = true;
}
}
}
if (!needsMeasure)
return;
frame_frame.read(() => {
updateSVGDimensions(current, renderState);
frame_frame.render(() => {
buildSVGAttrs(renderState, latestValues, isSVGTag(current.tagName), props.transformTemplate);
renderSVG(current, renderState);
});
});
},
}),
};
;// ./node_modules/framer-motion/dist/es/render/html/config-motion.mjs
const htmlMotionConfig = {
useVisualState: makeUseVisualState({
scrapeMotionValuesFromProps: scrapeMotionValuesFromProps,
createRenderState: createHtmlRenderState,
}),
};
;// ./node_modules/framer-motion/dist/es/render/html/use-props.mjs
function copyRawValuesOnly(target, source, props) {
for (const key in source) {
if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {
target[key] = source[key];
}
}
}
function useInitialMotionValues({ transformTemplate }, visualState) {
return (0,external_React_.useMemo)(() => {
const state = createHtmlRenderState();
buildHTMLStyles(state, visualState, transformTemplate);
return Object.assign({}, state.vars, state.style);
}, [visualState]);
}
function useStyle(props, visualState) {
const styleProp = props.style || {};
const style = {};
/**
* Copy non-Motion Values straight into style
*/
copyRawValuesOnly(style, styleProp, props);
Object.assign(style, useInitialMotionValues(props, visualState));
return style;
}
function useHTMLProps(props, visualState) {
// The `any` isn't ideal but it is the type of createElement props argument
const htmlProps = {};
const style = useStyle(props, visualState);
if (props.drag && props.dragListener !== false) {
// Disable the ghost element when a user drags
htmlProps.draggable = false;
// Disable text selection
style.userSelect =
style.WebkitUserSelect =
style.WebkitTouchCallout =
"none";
// Disable scrolling on the draggable direction
style.touchAction =
props.drag === true
? "none"
: `pan-${props.drag === "x" ? "y" : "x"}`;
}
if (props.tabIndex === undefined &&
(props.onTap || props.onTapStart || props.whileTap)) {
htmlProps.tabIndex = 0;
}
htmlProps.style = style;
return htmlProps;
}
;// ./node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs
/**
* A list of all valid MotionProps.
*
* @privateRemarks
* This doesn't throw if a `MotionProp` name is missing - it should.
*/
const validMotionProps = new Set([
"animate",
"exit",
"variants",
"initial",
"style",
"values",
"variants",
"transition",
"transformTemplate",
"custom",
"inherit",
"onBeforeLayoutMeasure",
"onAnimationStart",
"onAnimationComplete",
"onUpdate",
"onDragStart",
"onDrag",
"onDragEnd",
"onMeasureDragConstraints",
"onDirectionLock",
"onDragTransitionEnd",
"_dragX",
"_dragY",
"onHoverStart",
"onHoverEnd",
"onViewportEnter",
"onViewportLeave",
"globalTapTarget",
"ignoreStrict",
"viewport",
]);
/**
* Check whether a prop name is a valid `MotionProp` key.
*
* @param key - Name of the property to check
* @returns `true` is key is a valid `MotionProp`.
*
* @public
*/
function isValidMotionProp(key) {
return (key.startsWith("while") ||
(key.startsWith("drag") && key !== "draggable") ||
key.startsWith("layout") ||
key.startsWith("onTap") ||
key.startsWith("onPan") ||
key.startsWith("onLayout") ||
validMotionProps.has(key));
}
;// ./node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs
let shouldForward = (key) => !isValidMotionProp(key);
function loadExternalIsValidProp(isValidProp) {
if (!isValidProp)
return;
// Explicitly filter our events
shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key);
}
/**
* Emotion and Styled Components both allow users to pass through arbitrary props to their components
* to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which
* of these should be passed to the underlying DOM node.
*
* However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props
* as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props
* passed through the `custom` prop so it doesn't *need* the payload or computational overhead of
* `@emotion/is-prop-valid`, however to fix this problem we need to use it.
*
* By making it an optionalDependency we can offer this functionality only in the situations where it's
* actually required.
*/
try {
/**
* We attempt to import this package but require won't be defined in esm environments, in that case
* isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed
* in favour of explicit injection.
*/
loadExternalIsValidProp(require("@emotion/is-prop-valid").default);
}
catch (_a) {
// We don't need to actually do anything here - the fallback is the existing `isPropValid`.
}
function filterProps(props, isDom, forwardMotionProps) {
const filteredProps = {};
for (const key in props) {
/**
* values is considered a valid prop by Emotion, so if it's present
* this will be rendered out to the DOM unless explicitly filtered.
*
* We check the type as it could be used with the `feColorMatrix`
* element, which we support.
*/
if (key === "values" && typeof props.values === "object")
continue;
if (shouldForward(key) ||
(forwardMotionProps === true && isValidMotionProp(key)) ||
(!isDom && !isValidMotionProp(key)) ||
// If trying to use native HTML drag events, forward drag listeners
(props["draggable"] &&
key.startsWith("onDrag"))) {
filteredProps[key] =
props[key];
}
}
return filteredProps;
}
;// ./node_modules/framer-motion/dist/es/render/svg/use-props.mjs
function useSVGProps(props, visualState, _isStatic, Component) {
const visualProps = (0,external_React_.useMemo)(() => {
const state = createSvgRenderState();
buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate);
return {
...state.attrs,
style: { ...state.style },
};
}, [visualState]);
if (props.style) {
const rawStyles = {};
copyRawValuesOnly(rawStyles, props.style, props);
visualProps.style = { ...rawStyles, ...visualProps.style };
}
return visualProps;
}
;// ./node_modules/framer-motion/dist/es/render/dom/use-render.mjs
function createUseRender(forwardMotionProps = false) {
const useRender = (Component, props, ref, { latestValues }, isStatic) => {
const useVisualProps = isSVGComponent(Component)
? useSVGProps
: useHTMLProps;
const visualProps = useVisualProps(props, latestValues, isStatic, Component);
const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps);
const elementProps = Component !== external_React_.Fragment
? { ...filteredProps, ...visualProps, ref }
: {};
/**
* If component has been handed a motion value as its child,
* memoise its initial value and render that. Subsequent updates
* will be handled by the onChange handler
*/
const { children } = props;
const renderedChildren = (0,external_React_.useMemo)(() => (isMotionValue(children) ? children.get() : children), [children]);
return (0,external_React_.createElement)(Component, {
...elementProps,
children: renderedChildren,
});
};
return useRender;
}
;// ./node_modules/framer-motion/dist/es/render/components/create-factory.mjs
function createMotionComponentFactory(preloadedFeatures, createVisualElement) {
return function createMotionComponent(Component, { forwardMotionProps } = { forwardMotionProps: false }) {
const baseConfig = isSVGComponent(Component)
? svgMotionConfig
: htmlMotionConfig;
const config = {
...baseConfig,
preloadedFeatures,
useRender: createUseRender(forwardMotionProps),
createVisualElement,
Component,
};
return createRendererMotionComponent(config);
};
}
;// ./node_modules/framer-motion/dist/es/utils/reduced-motion/state.mjs
// Does this device prefer reduced motion? Returns `null` server-side.
const prefersReducedMotion = { current: null };
const hasReducedMotionListener = { current: false };
;// ./node_modules/framer-motion/dist/es/utils/reduced-motion/index.mjs
function initPrefersReducedMotion() {
hasReducedMotionListener.current = true;
if (!is_browser_isBrowser)
return;
if (window.matchMedia) {
const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)");
const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);
motionMediaQuery.addListener(setReducedMotionPreferences);
setReducedMotionPreferences();
}
else {
prefersReducedMotion.current = false;
}
}
;// ./node_modules/framer-motion/dist/es/render/dom/value-types/find.mjs
/**
* A list of all ValueTypes
*/
const valueTypes = [...dimensionValueTypes, color, complex];
/**
* Tests a value against the list of ValueTypes
*/
const findValueType = (v) => valueTypes.find(testValueType(v));
;// ./node_modules/framer-motion/dist/es/render/store.mjs
const visualElementStore = new WeakMap();
;// ./node_modules/framer-motion/dist/es/render/utils/motion-values.mjs
function updateMotionValuesFromProps(element, next, prev) {
for (const key in next) {
const nextValue = next[key];
const prevValue = prev[key];
if (isMotionValue(nextValue)) {
/**
* If this is a motion value found in props or style, we want to add it
* to our visual element's motion value map.
*/
element.addValue(key, nextValue);
/**
* Check the version of the incoming motion value with this version
* and warn against mismatches.
*/
if (false) {}
}
else if (isMotionValue(prevValue)) {
/**
* If we're swapping from a motion value to a static value,
* create a new motion value from that
*/
element.addValue(key, motionValue(nextValue, { owner: element }));
}
else if (prevValue !== nextValue) {
/**
* If this is a flat value that has changed, update the motion value
* or create one if it doesn't exist. We only want to do this if we're
* not handling the value with our animation state.
*/
if (element.hasValue(key)) {
const existingValue = element.getValue(key);
if (existingValue.liveStyle === true) {
existingValue.jump(nextValue);
}
else if (!existingValue.hasAnimated) {
existingValue.set(nextValue);
}
}
else {
const latestValue = element.getStaticValue(key);
element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));
}
}
}
// Handle removed values
for (const key in prev) {
if (next[key] === undefined)
element.removeValue(key);
}
return next;
}
;// ./node_modules/framer-motion/dist/es/render/VisualElement.mjs
const propEventHandlers = [
"AnimationStart",
"AnimationComplete",
"Update",
"BeforeLayoutMeasure",
"LayoutMeasure",
"LayoutAnimationStart",
"LayoutAnimationComplete",
];
/**
* A VisualElement is an imperative abstraction around UI elements such as
* HTMLElement, SVGElement, Three.Object3D etc.
*/
class VisualElement {
/**
* This method takes React props and returns found MotionValues. For example, HTML
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
*
* This isn't an abstract method as it needs calling in the constructor, but it is
* intended to be one.
*/
scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) {
return {};
}
constructor({ parent, props, presenceContext, reducedMotionConfig, blockInitialAnimation, visualState, }, options = {}) {
/**
* A reference to the current underlying Instance, e.g. a HTMLElement
* or Three.Mesh etc.
*/
this.current = null;
/**
* A set containing references to this VisualElement's children.
*/
this.children = new Set();
/**
* Determine what role this visual element should take in the variant tree.
*/
this.isVariantNode = false;
this.isControllingVariants = false;
/**
* Decides whether this VisualElement should animate in reduced motion
* mode.
*
* TODO: This is currently set on every individual VisualElement but feels
* like it could be set globally.
*/
this.shouldReduceMotion = null;
/**
* A map of all motion values attached to this visual element. Motion
* values are source of truth for any given animated value. A motion
* value might be provided externally by the component via props.
*/
this.values = new Map();
this.KeyframeResolver = KeyframeResolver;
/**
* Cleanup functions for active features (hover/tap/exit etc)
*/
this.features = {};
/**
* A map of every subscription that binds the provided or generated
* motion values onChange listeners to this visual element.
*/
this.valueSubscriptions = new Map();
/**
* A reference to the previously-provided motion values as returned
* from scrapeMotionValuesFromProps. We use the keys in here to determine
* if any motion values need to be removed after props are updated.
*/
this.prevMotionValues = {};
/**
* An object containing a SubscriptionManager for each active event.
*/
this.events = {};
/**
* An object containing an unsubscribe function for each prop event subscription.
* For example, every "Update" event can have multiple subscribers via
* VisualElement.on(), but only one of those can be defined via the onUpdate prop.
*/
this.propEventSubscriptions = {};
this.notifyUpdate = () => this.notify("Update", this.latestValues);
this.render = () => {
if (!this.current)
return;
this.triggerBuild();
this.renderInstance(this.current, this.renderState, this.props.style, this.projection);
};
this.renderScheduledAt = 0.0;
this.scheduleRender = () => {
const now = time.now();
if (this.renderScheduledAt < now) {
this.renderScheduledAt = now;
frame_frame.render(this.render, false, true);
}
};
const { latestValues, renderState, onUpdate } = visualState;
this.onUpdate = onUpdate;
this.latestValues = latestValues;
this.baseTarget = { ...latestValues };
this.initialValues = props.initial ? { ...latestValues } : {};
this.renderState = renderState;
this.parent = parent;
this.props = props;
this.presenceContext = presenceContext;
this.depth = parent ? parent.depth + 1 : 0;
this.reducedMotionConfig = reducedMotionConfig;
this.options = options;
this.blockInitialAnimation = Boolean(blockInitialAnimation);
this.isControllingVariants = isControllingVariants(props);
this.isVariantNode = isVariantNode(props);
if (this.isVariantNode) {
this.variantChildren = new Set();
}
this.manuallyAnimateOnMount = Boolean(parent && parent.current);
/**
* Any motion values that are provided to the element when created
* aren't yet bound to the element, as this would technically be impure.
* However, we iterate through the motion values and set them to the
* initial values for this component.
*
* TODO: This is impure and we should look at changing this to run on mount.
* Doing so will break some tests but this isn't necessarily a breaking change,
* more a reflection of the test.
*/
const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);
for (const key in initialMotionValues) {
const value = initialMotionValues[key];
if (latestValues[key] !== undefined && isMotionValue(value)) {
value.set(latestValues[key], false);
}
}
}
mount(instance) {
this.current = instance;
visualElementStore.set(instance, this);
if (this.projection && !this.projection.instance) {
this.projection.mount(instance);
}
if (this.parent && this.isVariantNode && !this.isControllingVariants) {
this.removeFromVariantTree = this.parent.addVariantChild(this);
}
this.values.forEach((value, key) => this.bindToMotionValue(key, value));
if (!hasReducedMotionListener.current) {
initPrefersReducedMotion();
}
this.shouldReduceMotion =
this.reducedMotionConfig === "never"
? false
: this.reducedMotionConfig === "always"
? true
: prefersReducedMotion.current;
if (false) {}
if (this.parent)
this.parent.children.add(this);
this.update(this.props, this.presenceContext);
}
unmount() {
visualElementStore.delete(this.current);
this.projection && this.projection.unmount();
cancelFrame(this.notifyUpdate);
cancelFrame(this.render);
this.valueSubscriptions.forEach((remove) => remove());
this.valueSubscriptions.clear();
this.removeFromVariantTree && this.removeFromVariantTree();
this.parent && this.parent.children.delete(this);
for (const key in this.events) {
this.events[key].clear();
}
for (const key in this.features) {
const feature = this.features[key];
if (feature) {
feature.unmount();
feature.isMounted = false;
}
}
this.current = null;
}
bindToMotionValue(key, value) {
if (this.valueSubscriptions.has(key)) {
this.valueSubscriptions.get(key)();
}
const valueIsTransform = transformProps.has(key);
const removeOnChange = value.on("change", (latestValue) => {
this.latestValues[key] = latestValue;
this.props.onUpdate && frame_frame.preRender(this.notifyUpdate);
if (valueIsTransform && this.projection) {
this.projection.isTransformDirty = true;
}
});
const removeOnRenderRequest = value.on("renderRequest", this.scheduleRender);
let removeSyncCheck;
if (window.MotionCheckAppearSync) {
removeSyncCheck = window.MotionCheckAppearSync(this, key, value);
}
this.valueSubscriptions.set(key, () => {
removeOnChange();
removeOnRenderRequest();
if (removeSyncCheck)
removeSyncCheck();
if (value.owner)
value.stop();
});
}
sortNodePosition(other) {
/**
* If these nodes aren't even of the same type we can't compare their depth.
*/
if (!this.current ||
!this.sortInstanceNodePosition ||
this.type !== other.type) {
return 0;
}
return this.sortInstanceNodePosition(this.current, other.current);
}
updateFeatures() {
let key = "animation";
for (key in featureDefinitions) {
const featureDefinition = featureDefinitions[key];
if (!featureDefinition)
continue;
const { isEnabled, Feature: FeatureConstructor } = featureDefinition;
/**
* If this feature is enabled but not active, make a new instance.
*/
if (!this.features[key] &&
FeatureConstructor &&
isEnabled(this.props)) {
this.features[key] = new FeatureConstructor(this);
}
/**
* If we have a feature, mount or update it.
*/
if (this.features[key]) {
const feature = this.features[key];
if (feature.isMounted) {
feature.update();
}
else {
feature.mount();
feature.isMounted = true;
}
}
}
}
triggerBuild() {
this.build(this.renderState, this.latestValues, this.props);
}
/**
* Measure the current viewport box with or without transforms.
* Only measures axis-aligned boxes, rotate and skew must be manually
* removed with a re-render to work.
*/
measureViewportBox() {
return this.current
? this.measureInstanceViewportBox(this.current, this.props)
: createBox();
}
getStaticValue(key) {
return this.latestValues[key];
}
setStaticValue(key, value) {
this.latestValues[key] = value;
}
/**
* Update the provided props. Ensure any newly-added motion values are
* added to our map, old ones removed, and listeners updated.
*/
update(props, presenceContext) {
if (props.transformTemplate || this.props.transformTemplate) {
this.scheduleRender();
}
this.prevProps = this.props;
this.props = props;
this.prevPresenceContext = this.presenceContext;
this.presenceContext = presenceContext;
/**
* Update prop event handlers ie onAnimationStart, onAnimationComplete
*/
for (let i = 0; i < propEventHandlers.length; i++) {
const key = propEventHandlers[i];
if (this.propEventSubscriptions[key]) {
this.propEventSubscriptions[key]();
delete this.propEventSubscriptions[key];
}
const listenerName = ("on" + key);
const listener = props[listenerName];
if (listener) {
this.propEventSubscriptions[key] = this.on(key, listener);
}
}
this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps, this), this.prevMotionValues);
if (this.handleChildMotionValue) {
this.handleChildMotionValue();
}
this.onUpdate && this.onUpdate(this);
}
getProps() {
return this.props;
}
/**
* Returns the variant definition with a given name.
*/
getVariant(name) {
return this.props.variants ? this.props.variants[name] : undefined;
}
/**
* Returns the defined default transition on this component.
*/
getDefaultTransition() {
return this.props.transition;
}
getTransformPagePoint() {
return this.props.transformPagePoint;
}
getClosestVariantNode() {
return this.isVariantNode
? this
: this.parent
? this.parent.getClosestVariantNode()
: undefined;
}
/**
* Add a child visual element to our set of children.
*/
addVariantChild(child) {
const closestVariantNode = this.getClosestVariantNode();
if (closestVariantNode) {
closestVariantNode.variantChildren &&
closestVariantNode.variantChildren.add(child);
return () => closestVariantNode.variantChildren.delete(child);
}
}
/**
* Add a motion value and bind it to this visual element.
*/
addValue(key, value) {
// Remove existing value if it exists
const existingValue = this.values.get(key);
if (value !== existingValue) {
if (existingValue)
this.removeValue(key);
this.bindToMotionValue(key, value);
this.values.set(key, value);
this.latestValues[key] = value.get();
}
}
/**
* Remove a motion value and unbind any active subscriptions.
*/
removeValue(key) {
this.values.delete(key);
const unsubscribe = this.valueSubscriptions.get(key);
if (unsubscribe) {
unsubscribe();
this.valueSubscriptions.delete(key);
}
delete this.latestValues[key];
this.removeValueFromRenderState(key, this.renderState);
}
/**
* Check whether we have a motion value for this key
*/
hasValue(key) {
return this.values.has(key);
}
getValue(key, defaultValue) {
if (this.props.values && this.props.values[key]) {
return this.props.values[key];
}
let value = this.values.get(key);
if (value === undefined && defaultValue !== undefined) {
value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });
this.addValue(key, value);
}
return value;
}
/**
* If we're trying to animate to a previously unencountered value,
* we need to check for it in our state and as a last resort read it
* directly from the instance (which might have performance implications).
*/
readValue(key, target) {
var _a;
let value = this.latestValues[key] !== undefined || !this.current
? this.latestValues[key]
: (_a = this.getBaseTargetFromProps(this.props, key)) !== null && _a !== void 0 ? _a : this.readValueFromInstance(this.current, key, this.options);
if (value !== undefined && value !== null) {
if (typeof value === "string" &&
(isNumericalString(value) || isZeroValueString(value))) {
// If this is a number read as a string, ie "0" or "200", convert it to a number
value = parseFloat(value);
}
else if (!findValueType(value) && complex.test(target)) {
value = animatable_none_getAnimatableNone(key, target);
}
this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);
}
return isMotionValue(value) ? value.get() : value;
}
/**
* Set the base target to later animate back to. This is currently
* only hydrated on creation and when we first read a value.
*/
setBaseTarget(key, value) {
this.baseTarget[key] = value;
}
/**
* Find the base target for a value thats been removed from all animation
* props.
*/
getBaseTarget(key) {
var _a;
const { initial } = this.props;
let valueFromInitial;
if (typeof initial === "string" || typeof initial === "object") {
const variant = resolveVariantFromProps(this.props, initial, (_a = this.presenceContext) === null || _a === void 0 ? void 0 : _a.custom);
if (variant) {
valueFromInitial = variant[key];
}
}
/**
* If this value still exists in the current initial variant, read that.
*/
if (initial && valueFromInitial !== undefined) {
return valueFromInitial;
}
/**
* Alternatively, if this VisualElement config has defined a getBaseTarget
* so we can read the value from an alternative source, try that.
*/
const target = this.getBaseTargetFromProps(this.props, key);
if (target !== undefined && !isMotionValue(target))
return target;
/**
* If the value was initially defined on initial, but it doesn't any more,
* return undefined. Otherwise return the value as initially read from the DOM.
*/
return this.initialValues[key] !== undefined &&
valueFromInitial === undefined
? undefined
: this.baseTarget[key];
}
on(eventName, callback) {
if (!this.events[eventName]) {
this.events[eventName] = new SubscriptionManager();
}
return this.events[eventName].add(callback);
}
notify(eventName, ...args) {
if (this.events[eventName]) {
this.events[eventName].notify(...args);
}
}
}
;// ./node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs
class DOMVisualElement extends VisualElement {
constructor() {
super(...arguments);
this.KeyframeResolver = DOMKeyframesResolver;
}
sortInstanceNodePosition(a, b) {
/**
* compareDocumentPosition returns a bitmask, by using the bitwise &
* we're returning true if 2 in that bitmask is set to true. 2 is set
* to true if b preceeds a.
*/
return a.compareDocumentPosition(b) & 2 ? 1 : -1;
}
getBaseTargetFromProps(props, key) {
return props.style
? props.style[key]
: undefined;
}
removeValueFromRenderState(key, { vars, style }) {
delete vars[key];
delete style[key];
}
handleChildMotionValue() {
if (this.childSubscription) {
this.childSubscription();
delete this.childSubscription;
}
const { children } = this.props;
if (isMotionValue(children)) {
this.childSubscription = children.on("change", (latest) => {
if (this.current) {
this.current.textContent = `${latest}`;
}
});
}
}
}
;// ./node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs
function HTMLVisualElement_getComputedStyle(element) {
return window.getComputedStyle(element);
}
class HTMLVisualElement extends DOMVisualElement {
constructor() {
super(...arguments);
this.type = "html";
this.renderInstance = renderHTML;
}
readValueFromInstance(instance, key) {
if (transformProps.has(key)) {
const defaultType = getDefaultValueType(key);
return defaultType ? defaultType.default || 0 : 0;
}
else {
const computedStyle = HTMLVisualElement_getComputedStyle(instance);
const value = (isCSSVariableName(key)
? computedStyle.getPropertyValue(key)
: computedStyle[key]) || 0;
return typeof value === "string" ? value.trim() : value;
}
}
measureInstanceViewportBox(instance, { transformPagePoint }) {
return measureViewportBox(instance, transformPagePoint);
}
build(renderState, latestValues, props) {
buildHTMLStyles(renderState, latestValues, props.transformTemplate);
}
scrapeMotionValuesFromProps(props, prevProps, visualElement) {
return scrapeMotionValuesFromProps(props, prevProps, visualElement);
}
}
;// ./node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.mjs
class SVGVisualElement extends DOMVisualElement {
constructor() {
super(...arguments);
this.type = "svg";
this.isSVGTag = false;
this.measureInstanceViewportBox = createBox;
}
getBaseTargetFromProps(props, key) {
return props[key];
}
readValueFromInstance(instance, key) {
if (transformProps.has(key)) {
const defaultType = getDefaultValueType(key);
return defaultType ? defaultType.default || 0 : 0;
}
key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;
return instance.getAttribute(key);
}
scrapeMotionValuesFromProps(props, prevProps, visualElement) {
return scrape_motion_values_scrapeMotionValuesFromProps(props, prevProps, visualElement);
}
build(renderState, latestValues, props) {
buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate);
}
renderInstance(instance, renderState, styleProp, projection) {
renderSVG(instance, renderState, styleProp, projection);
}
mount(instance) {
this.isSVGTag = isSVGTag(instance.tagName);
super.mount(instance);
}
}
;// ./node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs
const createDomVisualElement = (Component, options) => {
return isSVGComponent(Component)
? new SVGVisualElement(options)
: new HTMLVisualElement(options, {
allowProjection: Component !== external_React_.Fragment,
});
};
;// ./node_modules/framer-motion/dist/es/render/components/motion/create.mjs
const createMotionComponent = /*@__PURE__*/ createMotionComponentFactory({
...animations,
...gestureAnimations,
...drag,
...layout,
}, createDomVisualElement);
;// ./node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs
const motion = /*@__PURE__*/ createDOMMotionComponentProxy(createMotionComponent);
;// ./node_modules/@wordpress/components/build-module/utils/use-responsive-value.js
const breakpoints = ["40em", "52em", "64em"];
const useBreakpointIndex = (options = {}) => {
const {
defaultIndex = 0
} = options;
if (typeof defaultIndex !== "number") {
throw new TypeError(`Default breakpoint index should be a number. Got: ${defaultIndex}, ${typeof defaultIndex}`);
} else if (defaultIndex < 0 || defaultIndex > breakpoints.length - 1) {
throw new RangeError(`Default breakpoint index out of range. Theme has ${breakpoints.length} breakpoints, got index ${defaultIndex}`);
}
const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(defaultIndex);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const getIndex = () => breakpoints.filter((bp) => {
return typeof window !== "undefined" ? window.matchMedia(`screen and (min-width: ${bp})`).matches : false;
}).length;
const onResize = () => {
const newValue = getIndex();
if (value !== newValue) {
setValue(newValue);
}
};
onResize();
if (typeof window !== "undefined") {
window.addEventListener("resize", onResize);
}
return () => {
if (typeof window !== "undefined") {
window.removeEventListener("resize", onResize);
}
};
}, [value]);
return value;
};
function useResponsiveValue(values, options = {}) {
const index = useBreakpointIndex(options);
if (!Array.isArray(values) && typeof values !== "function") {
return values;
}
const array = values || [];
return (
/** @type {T[]} */
array[
/* eslint-enable jsdoc/no-undefined-types */
index >= array.length ? array.length - 1 : index
]
);
}
;// ./node_modules/@wordpress/components/build-module/flex/styles.js
function styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const Flex = true ? {
name: "zjik7",
styles: "display:flex"
} : 0;
const Item = true ? {
name: "qgaee5",
styles: "display:block;max-height:100%;max-width:100%;min-height:0;min-width:0"
} : 0;
const block = true ? {
name: "82a6rk",
styles: "flex:1"
} : 0;
const ItemsColumn = true ? {
name: "13nosa1",
styles: ">*{min-height:0;}"
} : 0;
const ItemsRow = true ? {
name: "1pwxzk4",
styles: ">*{min-width:0;}"
} : 0;
;// ./node_modules/@wordpress/components/build-module/flex/flex/hook.js
function useDeprecatedProps(props) {
const {
isReversed,
...otherProps
} = props;
if (typeof isReversed !== "undefined") {
external_wp_deprecated_default()("Flex isReversed", {
alternative: 'Flex direction="row-reverse" or "column-reverse"',
since: "5.9"
});
return {
...otherProps,
direction: isReversed ? "row-reverse" : "row"
};
}
return otherProps;
}
function useFlex(props) {
const {
align,
className,
direction: directionProp = "row",
expanded = true,
gap = 2,
justify = "space-between",
wrap = false,
...otherProps
} = useContextSystem(useDeprecatedProps(props), "Flex");
const directionAsArray = Array.isArray(directionProp) ? directionProp : [directionProp];
const direction = useResponsiveValue(directionAsArray);
const isColumn = typeof direction === "string" && !!direction.includes("column");
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
const base = /* @__PURE__ */ emotion_react_browser_esm_css({
alignItems: align !== null && align !== void 0 ? align : isColumn ? "normal" : "center",
flexDirection: direction,
flexWrap: wrap ? "wrap" : void 0,
gap: space(gap),
justifyContent: justify,
height: isColumn && expanded ? "100%" : void 0,
width: !isColumn && expanded ? "100%" : void 0
}, true ? "" : 0, true ? "" : 0);
return cx(Flex, base, isColumn ? ItemsColumn : ItemsRow, className);
}, [align, className, cx, direction, expanded, gap, isColumn, justify, wrap]);
return {
...otherProps,
className: classes,
isColumn
};
}
;// ./node_modules/@wordpress/components/build-module/flex/context.js
const FlexContext = (0,external_wp_element_namespaceObject.createContext)({
flexItemDisplay: void 0
});
const useFlexContext = () => (0,external_wp_element_namespaceObject.useContext)(FlexContext);
;// ./node_modules/@wordpress/components/build-module/flex/flex/component.js
function UnconnectedFlex(props, forwardedRef) {
const {
children,
isColumn,
...otherProps
} = useFlex(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexContext.Provider, {
value: {
flexItemDisplay: isColumn ? "block" : void 0
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...otherProps,
ref: forwardedRef,
children
})
});
}
const component_Flex = contextConnect(UnconnectedFlex, "Flex");
var flex_component_component_default = component_Flex;
;// ./node_modules/@wordpress/components/build-module/flex/flex-item/hook.js
function useFlexItem(props) {
const {
className,
display: displayProp,
isBlock = false,
...otherProps
} = useContextSystem(props, "FlexItem");
const sx = {};
const contextDisplay = useFlexContext().flexItemDisplay;
sx.Base = /* @__PURE__ */ emotion_react_browser_esm_css({
display: displayProp || contextDisplay
}, true ? "" : 0, true ? "" : 0);
const cx = useCx();
const classes = cx(Item, sx.Base, isBlock && block, className);
return {
...otherProps,
className: classes
};
}
;// ./node_modules/@wordpress/components/build-module/flex/flex-block/hook.js
function useFlexBlock(props) {
const otherProps = useContextSystem(props, "FlexBlock");
const flexItemProps = useFlexItem({
isBlock: true,
...otherProps
});
return flexItemProps;
}
;// ./node_modules/@wordpress/components/build-module/flex/flex-block/component.js
function UnconnectedFlexBlock(props, forwardedRef) {
const flexBlockProps = useFlexBlock(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...flexBlockProps,
ref: forwardedRef
});
}
const FlexBlock = contextConnect(UnconnectedFlexBlock, "FlexBlock");
var flex_block_component_component_default = FlexBlock;
;// ./node_modules/@wordpress/components/build-module/utils/rtl.js
const LOWER_LEFT_REGEXP = new RegExp(/-left/g);
const LOWER_RIGHT_REGEXP = new RegExp(/-right/g);
const UPPER_LEFT_REGEXP = new RegExp(/Left/g);
const UPPER_RIGHT_REGEXP = new RegExp(/Right/g);
function getConvertedKey(key) {
if (key === "left") {
return "right";
}
if (key === "right") {
return "left";
}
if (LOWER_LEFT_REGEXP.test(key)) {
return key.replace(LOWER_LEFT_REGEXP, "-right");
}
if (LOWER_RIGHT_REGEXP.test(key)) {
return key.replace(LOWER_RIGHT_REGEXP, "-left");
}
if (UPPER_LEFT_REGEXP.test(key)) {
return key.replace(UPPER_LEFT_REGEXP, "Right");
}
if (UPPER_RIGHT_REGEXP.test(key)) {
return key.replace(UPPER_RIGHT_REGEXP, "Left");
}
return key;
}
const convertLTRToRTL = (ltrStyles = {}) => {
return Object.fromEntries(Object.entries(ltrStyles).map(([key, value]) => [getConvertedKey(key), value]));
};
function rtl(ltrStyles = {}, rtlStyles) {
return () => {
if (rtlStyles) {
return (0,external_wp_i18n_namespaceObject.isRTL)() ? /* @__PURE__ */ emotion_react_browser_esm_css(rtlStyles, true ? "" : 0, true ? "" : 0) : /* @__PURE__ */ emotion_react_browser_esm_css(ltrStyles, true ? "" : 0, true ? "" : 0);
}
return (0,external_wp_i18n_namespaceObject.isRTL)() ? /* @__PURE__ */ emotion_react_browser_esm_css(convertLTRToRTL(ltrStyles), true ? "" : 0, true ? "" : 0) : /* @__PURE__ */ emotion_react_browser_esm_css(ltrStyles, true ? "" : 0, true ? "" : 0);
};
}
rtl.watch = () => (0,external_wp_i18n_namespaceObject.isRTL)();
;// ./node_modules/@wordpress/components/build-module/spacer/hook.js
function isDefined(o) {
return typeof o !== "undefined" && o !== null;
}
function useSpacer(props) {
const {
className,
margin,
marginBottom = 2,
marginLeft,
marginRight,
marginTop,
marginX,
marginY,
padding,
paddingBottom,
paddingLeft,
paddingRight,
paddingTop,
paddingX,
paddingY,
...otherProps
} = useContextSystem(props, "Spacer");
const cx = useCx();
const classes = cx(isDefined(margin) && /* @__PURE__ */ emotion_react_browser_esm_css("margin:", space(margin), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(marginY) && /* @__PURE__ */ emotion_react_browser_esm_css("margin-bottom:", space(marginY), ";margin-top:", space(marginY), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(marginX) && /* @__PURE__ */ emotion_react_browser_esm_css("margin-left:", space(marginX), ";margin-right:", space(marginX), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(marginTop) && /* @__PURE__ */ emotion_react_browser_esm_css("margin-top:", space(marginTop), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(marginBottom) && /* @__PURE__ */ emotion_react_browser_esm_css("margin-bottom:", space(marginBottom), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(marginLeft) && rtl({
marginLeft: space(marginLeft)
})(), isDefined(marginRight) && rtl({
marginRight: space(marginRight)
})(), isDefined(padding) && /* @__PURE__ */ emotion_react_browser_esm_css("padding:", space(padding), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(paddingY) && /* @__PURE__ */ emotion_react_browser_esm_css("padding-bottom:", space(paddingY), ";padding-top:", space(paddingY), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(paddingX) && /* @__PURE__ */ emotion_react_browser_esm_css("padding-left:", space(paddingX), ";padding-right:", space(paddingX), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(paddingTop) && /* @__PURE__ */ emotion_react_browser_esm_css("padding-top:", space(paddingTop), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(paddingBottom) && /* @__PURE__ */ emotion_react_browser_esm_css("padding-bottom:", space(paddingBottom), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(paddingLeft) && rtl({
paddingLeft: space(paddingLeft)
})(), isDefined(paddingRight) && rtl({
paddingRight: space(paddingRight)
})(), className);
return {
...otherProps,
className: classes
};
}
;// ./node_modules/@wordpress/components/build-module/spacer/component.js
function UnconnectedSpacer(props, forwardedRef) {
const spacerProps = useSpacer(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...spacerProps,
ref: forwardedRef
});
}
const Spacer = contextConnect(UnconnectedSpacer, "Spacer");
var spacer_component_component_default = Spacer;
;// ./node_modules/@wordpress/icons/build-module/library/plus.js
var plus_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/reset.js
var reset_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7 11.5h10V13H7z" }) });
;// ./node_modules/@wordpress/components/build-module/flex/flex-item/component.js
function UnconnectedFlexItem(props, forwardedRef) {
const flexItemProps = useFlexItem(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...flexItemProps,
ref: forwardedRef
});
}
const FlexItem = contextConnect(UnconnectedFlexItem, "FlexItem");
var flex_item_component_component_default = FlexItem;
;// ./node_modules/@wordpress/components/build-module/truncate/styles.js
function truncate_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const Truncate = true ? {
name: "hdknak",
styles: "display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"
} : 0;
;// ./node_modules/@wordpress/components/build-module/utils/values.js
function isValueDefined(value) {
return value !== void 0 && value !== null;
}
function isValueEmpty(value) {
const isEmptyString = value === "";
return !isValueDefined(value) || isEmptyString;
}
function getDefinedValue(values = [], fallbackValue) {
var _values$find;
return (_values$find = values.find(isValueDefined)) !== null && _values$find !== void 0 ? _values$find : fallbackValue;
}
const stringToNumber = (value) => {
return parseFloat(value);
};
const ensureNumber = (value) => {
return typeof value === "string" ? stringToNumber(value) : value;
};
;// ./node_modules/@wordpress/components/build-module/truncate/utils.js
const TRUNCATE_ELLIPSIS = "\u2026";
const TRUNCATE_TYPE = {
auto: "auto",
head: "head",
middle: "middle",
tail: "tail",
none: "none"
};
const TRUNCATE_DEFAULT_PROPS = {
ellipsis: TRUNCATE_ELLIPSIS,
ellipsizeMode: TRUNCATE_TYPE.auto,
limit: 0,
numberOfLines: 0
};
function truncateMiddle(word, headLength, tailLength, ellipsis) {
if (typeof word !== "string") {
return "";
}
const wordLength = word.length;
const frontLength = ~~headLength;
const backLength = ~~tailLength;
const truncateStr = isValueDefined(ellipsis) ? ellipsis : TRUNCATE_ELLIPSIS;
if (frontLength === 0 && backLength === 0 || frontLength >= wordLength || backLength >= wordLength || frontLength + backLength >= wordLength) {
return word;
} else if (backLength === 0) {
return word.slice(0, frontLength) + truncateStr;
}
return word.slice(0, frontLength) + truncateStr + word.slice(wordLength - backLength);
}
function truncateContent(words = "", props) {
const mergedProps = {
...TRUNCATE_DEFAULT_PROPS,
...props
};
const {
ellipsis,
ellipsizeMode,
limit
} = mergedProps;
if (ellipsizeMode === TRUNCATE_TYPE.none) {
return words;
}
let truncateHead;
let truncateTail;
switch (ellipsizeMode) {
case TRUNCATE_TYPE.head:
truncateHead = 0;
truncateTail = limit;
break;
case TRUNCATE_TYPE.middle:
truncateHead = Math.floor(limit / 2);
truncateTail = Math.floor(limit / 2);
break;
default:
truncateHead = limit;
truncateTail = 0;
}
const truncatedContent = ellipsizeMode !== TRUNCATE_TYPE.auto ? truncateMiddle(words, truncateHead, truncateTail, ellipsis) : words;
return truncatedContent;
}
;// ./node_modules/@wordpress/components/build-module/truncate/hook.js
function useTruncate(props) {
const {
className,
children,
ellipsis = TRUNCATE_ELLIPSIS,
ellipsizeMode = TRUNCATE_TYPE.auto,
limit = 0,
numberOfLines = 0,
...otherProps
} = useContextSystem(props, "Truncate");
const cx = useCx();
let childrenAsText;
if (typeof children === "string") {
childrenAsText = children;
} else if (typeof children === "number") {
childrenAsText = children.toString();
}
const truncatedContent = childrenAsText ? truncateContent(childrenAsText, {
ellipsis,
ellipsizeMode,
limit,
numberOfLines
}) : children;
const shouldTruncate = !!childrenAsText && ellipsizeMode === TRUNCATE_TYPE.auto;
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
const truncateLines = /* @__PURE__ */ emotion_react_browser_esm_css(numberOfLines === 1 ? "word-break: break-all;" : "", " -webkit-box-orient:vertical;-webkit-line-clamp:", numberOfLines, ";display:-webkit-box;overflow:hidden;" + ( true ? "" : 0), true ? "" : 0);
return cx(shouldTruncate && !numberOfLines && Truncate, shouldTruncate && !!numberOfLines && truncateLines, className);
}, [className, cx, numberOfLines, shouldTruncate]);
return {
...otherProps,
className: classes,
children: truncatedContent
};
}
;// ./node_modules/colord/index.mjs
var colord_r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},colord_n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},colord_e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},colord_a=function(r){return{r:colord_e(r.r,0,255),g:colord_e(r.g,0,255),b:colord_e(r.b,0,255),a:colord_e(r.a)}},colord_o=function(r){return{r:colord_n(r.r),g:colord_n(r.g),b:colord_n(r.b),a:colord_n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:colord_e(r.s,0,100),l:colord_e(r.l,0,100),a:colord_e(r.a)}},d=function(r){return{h:colord_n(r.h),s:colord_n(r.s),l:colord_n(r.l),a:colord_n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?colord_n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?colord_n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:colord_a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(colord_r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?colord_a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:colord_e(r.s,0,100),v:colord_e(r.v,0,100),a:colord_e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:colord_e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:colord_e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return colord_n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=colord_o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(colord_n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return colord_o(this.rgba)},r.prototype.toRgbString=function(){return r=colord_o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:colord_n(r.h),s:colord_n(r.s),v:colord_n(r.v),a:colord_n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):colord_n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):colord_n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};
;// ./node_modules/colord/plugins/names.mjs
/* harmony default export */ function names(e,f){var a={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])}
;// ./node_modules/@wordpress/components/build-module/utils/colors.js
let colorComputationNode;
k([names]);
function colors_rgba(hexValue = "", alpha = 1) {
return colord(hexValue).alpha(alpha).toRgbString();
}
function getColorComputationNode() {
if (typeof document === "undefined") {
return;
}
if (!colorComputationNode) {
const el = document.createElement("div");
el.setAttribute("data-g2-color-computation-node", "");
document.body.appendChild(el);
colorComputationNode = el;
}
return colorComputationNode;
}
function isColor(value) {
if (typeof value !== "string") {
return false;
}
const test = w(value);
return test.isValid();
}
function _getComputedBackgroundColor(backgroundColor) {
if (typeof backgroundColor !== "string") {
return "";
}
if (isColor(backgroundColor)) {
return backgroundColor;
}
if (!backgroundColor.includes("var(")) {
return "";
}
if (typeof document === "undefined") {
return "";
}
const el = getColorComputationNode();
if (!el) {
return "";
}
el.style.background = backgroundColor;
const computedColor = window?.getComputedStyle(el).background;
el.style.background = "";
return computedColor || "";
}
const getComputedBackgroundColor = memize(_getComputedBackgroundColor);
function getOptimalTextColor(backgroundColor) {
const background = getComputedBackgroundColor(backgroundColor);
return w(background).isLight() ? "#000000" : "#ffffff";
}
function getOptimalTextShade(backgroundColor) {
const result = getOptimalTextColor(backgroundColor);
return result === "#000000" ? "dark" : "light";
}
;// ./node_modules/@wordpress/components/build-module/text/styles.js
function text_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const Text = /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.theme.foreground, ";line-height:", config_values_default.fontLineHeightBase, ";margin:0;text-wrap:balance;text-wrap:pretty;" + ( true ? "" : 0), true ? "" : 0);
const styles_block = true ? {
name: "4zleql",
styles: "display:block"
} : 0;
const positive = /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.alert.green, ";" + ( true ? "" : 0), true ? "" : 0);
const destructive = /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.alert.red, ";" + ( true ? "" : 0), true ? "" : 0);
const muted = /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.gray[700], ";" + ( true ? "" : 0), true ? "" : 0);
const highlighterText = /* @__PURE__ */ emotion_react_browser_esm_css("mark{background:", COLORS.alert.yellow, ";border-radius:", config_values_default.radiusSmall, ";box-shadow:0 0 0 1px rgba( 0, 0, 0, 0.05 ) inset,0 -1px 0 rgba( 0, 0, 0, 0.1 ) inset;}" + ( true ? "" : 0), true ? "" : 0);
const upperCase = true ? {
name: "50zrmy",
styles: "text-transform:uppercase"
} : 0;
// EXTERNAL MODULE: ./node_modules/highlight-words-core/dist/index.js
var dist = __webpack_require__(9664);
;// ./node_modules/@wordpress/components/build-module/text/utils.js
const lowercaseProps = (object) => {
const mapped = {};
for (const key in object) {
mapped[key.toLowerCase()] = object[key];
}
return mapped;
};
const memoizedLowercaseProps = memize(lowercaseProps);
function createHighlighterText({
activeClassName = "",
activeIndex = -1,
activeStyle,
autoEscape,
caseSensitive = false,
children,
findChunks,
highlightClassName = "",
highlightStyle = {},
highlightTag = "mark",
sanitize,
searchWords = [],
unhighlightClassName = "",
unhighlightStyle
}) {
if (!children) {
return null;
}
if (typeof children !== "string") {
return children;
}
const textToHighlight = children;
const chunks = (0,dist.findAll)({
autoEscape,
caseSensitive,
findChunks,
sanitize,
searchWords,
textToHighlight
});
const HighlightTag = highlightTag;
let highlightIndex = -1;
let highlightClassNames = "";
let highlightStyles;
const textContent = chunks.map((chunk, index) => {
const text = textToHighlight.substr(chunk.start, chunk.end - chunk.start);
if (chunk.highlight) {
highlightIndex++;
let highlightClass;
if (typeof highlightClassName === "object") {
if (!caseSensitive) {
highlightClassName = memoizedLowercaseProps(highlightClassName);
highlightClass = highlightClassName[text.toLowerCase()];
} else {
highlightClass = highlightClassName[text];
}
} else {
highlightClass = highlightClassName;
}
const isActive = highlightIndex === +activeIndex;
highlightClassNames = `${highlightClass} ${isActive ? activeClassName : ""}`;
highlightStyles = isActive === true && activeStyle !== null ? Object.assign({}, highlightStyle, activeStyle) : highlightStyle;
const props = {
children: text,
className: highlightClassNames,
key: index,
style: highlightStyles
};
if (typeof HighlightTag !== "string") {
props.highlightIndex = highlightIndex;
}
return (0,external_wp_element_namespaceObject.createElement)(HighlightTag, props);
}
return (0,external_wp_element_namespaceObject.createElement)("span", {
children: text,
className: unhighlightClassName,
key: index,
style: unhighlightStyle
});
});
return textContent;
}
;// ./node_modules/@wordpress/components/build-module/utils/font-size.js
const BASE_FONT_SIZE = 13;
const PRESET_FONT_SIZES = {
body: BASE_FONT_SIZE,
caption: 10,
footnote: 11,
largeTitle: 28,
subheadline: 12,
title: 20
};
const HEADING_FONT_SIZES = [1, 2, 3, 4, 5, 6].flatMap((n) => [n, n.toString()]);
function getFontSize(size = BASE_FONT_SIZE) {
if (size in PRESET_FONT_SIZES) {
return getFontSize(PRESET_FONT_SIZES[size]);
}
if (typeof size !== "number") {
const parsed = parseFloat(size);
if (Number.isNaN(parsed)) {
return size;
}
size = parsed;
}
const ratio = `(${size} / ${BASE_FONT_SIZE})`;
return `calc(${ratio} * ${config_values_default.fontSize})`;
}
function getHeadingFontSize(size = 3) {
if (!HEADING_FONT_SIZES.includes(size)) {
return getFontSize(size);
}
const headingSize = `fontSizeH${size}`;
return config_values_default[headingSize];
}
;// ./node_modules/@wordpress/components/build-module/text/get-line-height.js
function getLineHeight(adjustLineHeightForInnerControls, lineHeight) {
if (lineHeight) {
return lineHeight;
}
if (!adjustLineHeightForInnerControls) {
return;
}
let value = `calc(${config_values_default.controlHeight} + ${space(2)})`;
switch (adjustLineHeightForInnerControls) {
case "large":
value = `calc(${config_values_default.controlHeightLarge} + ${space(2)})`;
break;
case "small":
value = `calc(${config_values_default.controlHeightSmall} + ${space(2)})`;
break;
case "xSmall":
value = `calc(${config_values_default.controlHeightXSmall} + ${space(2)})`;
break;
default:
break;
}
return value;
}
;// ./node_modules/@wordpress/components/build-module/text/hook.js
function hook_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var hook_ref = true ? {
name: "50zrmy",
styles: "text-transform:uppercase"
} : 0;
function useText(props) {
const {
adjustLineHeightForInnerControls,
align,
children,
className,
color,
ellipsizeMode,
isDestructive = false,
display,
highlightEscape = false,
highlightCaseSensitive = false,
highlightWords,
highlightSanitize,
isBlock = false,
letterSpacing,
lineHeight: lineHeightProp,
optimizeReadabilityFor,
size,
truncate = false,
upperCase = false,
variant,
weight = config_values_default.fontWeight,
...otherProps
} = useContextSystem(props, "Text");
let content = children;
const isHighlighter = Array.isArray(highlightWords);
const isCaption = size === "caption";
if (isHighlighter) {
if (typeof children !== "string") {
throw new TypeError("`children` of `Text` must only be `string` types when `highlightWords` is defined");
}
content = createHighlighterText({
autoEscape: highlightEscape,
children,
caseSensitive: highlightCaseSensitive,
searchWords: highlightWords,
sanitize: highlightSanitize
});
}
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
const sx = {};
const lineHeight = getLineHeight(adjustLineHeightForInnerControls, lineHeightProp);
sx.Base = /* @__PURE__ */ emotion_react_browser_esm_css({
color,
display,
fontSize: getFontSize(size),
fontWeight: weight,
lineHeight,
letterSpacing,
textAlign: align
}, true ? "" : 0, true ? "" : 0);
sx.upperCase = hook_ref;
sx.optimalTextColor = null;
if (optimizeReadabilityFor) {
const isOptimalTextColorDark = getOptimalTextShade(optimizeReadabilityFor) === "dark";
sx.optimalTextColor = isOptimalTextColorDark ? /* @__PURE__ */ emotion_react_browser_esm_css({
color: COLORS.gray[900]
}, true ? "" : 0, true ? "" : 0) : /* @__PURE__ */ emotion_react_browser_esm_css({
color: COLORS.white
}, true ? "" : 0, true ? "" : 0);
}
return cx(Text, sx.Base, sx.optimalTextColor, isDestructive && destructive, !!isHighlighter && highlighterText, isBlock && styles_block, isCaption && muted, variant && text_styles_namespaceObject[variant], upperCase && sx.upperCase, className);
}, [adjustLineHeightForInnerControls, align, className, color, cx, display, isBlock, isCaption, isDestructive, isHighlighter, letterSpacing, lineHeightProp, optimizeReadabilityFor, size, upperCase, variant, weight]);
let finalEllipsizeMode;
if (truncate === true) {
finalEllipsizeMode = "auto";
}
if (truncate === false) {
finalEllipsizeMode = "none";
}
const finalComponentProps = {
...otherProps,
className: classes,
children,
ellipsizeMode: ellipsizeMode || finalEllipsizeMode
};
const truncateProps = useTruncate(finalComponentProps);
if (!truncate && Array.isArray(children)) {
content = external_wp_element_namespaceObject.Children.map(children, (child) => {
if (typeof child !== "object" || child === null || !("props" in child)) {
return child;
}
const isLink = hasConnectNamespace(child, ["Link"]);
if (isLink) {
return (0,external_wp_element_namespaceObject.cloneElement)(child, {
size: child.props.size || "inherit"
});
}
return child;
});
}
return {
...truncateProps,
children: truncate ? truncateProps.children : content
};
}
;// ./node_modules/@wordpress/components/build-module/text/component.js
function UnconnectedText(props, forwardedRef) {
const textProps = useText(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
as: "span",
...textProps,
ref: forwardedRef
});
}
const component_Text = contextConnect(UnconnectedText, "Text");
var text_component_component_default = component_Text;
;// ./node_modules/@wordpress/components/build-module/utils/base-label.js
function base_label_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const baseLabelTypography = true ? {
name: "9amh4a",
styles: "font-size:11px;font-weight:500;line-height:1.4;text-transform:uppercase"
} : 0;
;// ./node_modules/@wordpress/components/build-module/input-control/styles/input-control-styles.js
function input_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const Prefix = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "em5sgkm8"
} : 0)( true ? {
name: "pvvbxf",
styles: "box-sizing:border-box;display:block"
} : 0);
const Suffix = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "em5sgkm7"
} : 0)( true ? {
name: "jgf79h",
styles: "align-items:center;align-self:stretch;box-sizing:border-box;display:flex"
} : 0);
const backdropBorderColor = ({
disabled,
isBorderless
}) => {
if (isBorderless) {
return "transparent";
}
if (disabled) {
return COLORS.ui.borderDisabled;
}
return COLORS.ui.border;
};
const BackdropUI = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "em5sgkm6"
} : 0)("&&&{box-sizing:border-box;border-color:", backdropBorderColor, ";border-radius:inherit;border-style:solid;border-width:1px;bottom:0;left:0;margin:0;padding:0;pointer-events:none;position:absolute;right:0;top:0;", rtl({
paddingLeft: 2
}), ";}" + ( true ? "" : 0));
const Root = /* @__PURE__ */ emotion_styled_base_browser_esm(flex_component_component_default, true ? {
target: "em5sgkm5"
} : 0)("box-sizing:border-box;position:relative;border-radius:", config_values_default.radiusSmall, ";padding-top:0;&:focus-within:not( :has( :is( ", Prefix, ", ", Suffix, " ):focus-within ) ){", BackdropUI, "{border-color:", COLORS.ui.borderFocus, ";box-shadow:", config_values_default.controlBoxShadowFocus, ";outline:2px solid transparent;outline-offset:-2px;}}" + ( true ? "" : 0));
const containerDisabledStyles = ({
disabled
}) => {
const backgroundColor = disabled ? COLORS.ui.backgroundDisabled : COLORS.ui.background;
return /* @__PURE__ */ emotion_react_browser_esm_css({
backgroundColor
}, true ? "" : 0, true ? "" : 0);
};
var input_control_styles_ref = true ? {
name: "1d3w5wq",
styles: "width:100%"
} : 0;
const containerWidthStyles = ({
__unstableInputWidth,
labelPosition
}) => {
if (!__unstableInputWidth) {
return input_control_styles_ref;
}
if (labelPosition === "side") {
return "";
}
if (labelPosition === "edge") {
return /* @__PURE__ */ emotion_react_browser_esm_css({
flex: `0 0 ${__unstableInputWidth}`
}, true ? "" : 0, true ? "" : 0);
}
return /* @__PURE__ */ emotion_react_browser_esm_css({
width: __unstableInputWidth
}, true ? "" : 0, true ? "" : 0);
};
const Container = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "em5sgkm4"
} : 0)("align-items:center;box-sizing:border-box;border-radius:inherit;display:flex;flex:1;position:relative;", containerDisabledStyles, " ", containerWidthStyles, ";" + ( true ? "" : 0));
const disabledStyles = ({
disabled
}) => {
if (!disabled) {
return "";
}
return /* @__PURE__ */ emotion_react_browser_esm_css({
color: COLORS.ui.textDisabled
}, true ? "" : 0, true ? "" : 0);
};
const fontSizeStyles = ({
inputSize: size
}) => {
const sizes = {
default: "13px",
small: "11px",
compact: "13px",
"__unstable-large": "13px"
};
const fontSize = sizes[size] || sizes.default;
const fontSizeMobile = "16px";
if (!fontSize) {
return "";
}
return /* @__PURE__ */ emotion_react_browser_esm_css("font-size:", fontSizeMobile, ";@media ( min-width: 600px ){font-size:", fontSize, ";}" + ( true ? "" : 0), true ? "" : 0);
};
const getSizeConfig = ({
inputSize: size,
__next40pxDefaultSize
}) => {
const sizes = {
default: {
height: 40,
lineHeight: 1,
minHeight: 40,
paddingLeft: config_values_default.controlPaddingX,
paddingRight: config_values_default.controlPaddingX
},
small: {
height: 24,
lineHeight: 1,
minHeight: 24,
paddingLeft: config_values_default.controlPaddingXSmall,
paddingRight: config_values_default.controlPaddingXSmall
},
compact: {
height: 32,
lineHeight: 1,
minHeight: 32,
paddingLeft: config_values_default.controlPaddingXSmall,
paddingRight: config_values_default.controlPaddingXSmall
},
"__unstable-large": {
height: 40,
lineHeight: 1,
minHeight: 40,
paddingLeft: config_values_default.controlPaddingX,
paddingRight: config_values_default.controlPaddingX
}
};
if (!__next40pxDefaultSize) {
sizes.default = sizes.compact;
}
return sizes[size] || sizes.default;
};
const sizeStyles = (props) => {
return /* @__PURE__ */ emotion_react_browser_esm_css(getSizeConfig(props), true ? "" : 0, true ? "" : 0);
};
const customPaddings = ({
paddingInlineStart,
paddingInlineEnd
}) => {
return /* @__PURE__ */ emotion_react_browser_esm_css({
paddingInlineStart,
paddingInlineEnd
}, true ? "" : 0, true ? "" : 0);
};
const dragStyles = ({
isDragging,
dragCursor
}) => {
let defaultArrowStyles;
let activeDragCursorStyles;
if (isDragging) {
defaultArrowStyles = /* @__PURE__ */ emotion_react_browser_esm_css("cursor:", dragCursor, ";user-select:none;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}" + ( true ? "" : 0), true ? "" : 0);
}
if (isDragging && dragCursor) {
activeDragCursorStyles = /* @__PURE__ */ emotion_react_browser_esm_css("&:active{cursor:", dragCursor, ";}" + ( true ? "" : 0), true ? "" : 0);
}
return /* @__PURE__ */ emotion_react_browser_esm_css(defaultArrowStyles, " ", activeDragCursorStyles, ";" + ( true ? "" : 0), true ? "" : 0);
};
const Input = /* @__PURE__ */ emotion_styled_base_browser_esm("input", true ? {
target: "em5sgkm3"
} : 0)("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:", COLORS.theme.foreground, ";display:block;font-family:inherit;margin:0;outline:none;width:100%;", dragStyles, " ", disabledStyles, " ", fontSizeStyles, " ", sizeStyles, " ", customPaddings, " &::-webkit-input-placeholder{color:", COLORS.ui.darkGrayPlaceholder, ";}&::-moz-placeholder{color:", COLORS.ui.darkGrayPlaceholder, ";}&:-ms-input-placeholder{color:", COLORS.ui.darkGrayPlaceholder, ";}&[type='email'],&[type='url']{direction:ltr;}}" + ( true ? "" : 0));
const BaseLabel = /* @__PURE__ */ emotion_styled_base_browser_esm(text_component_component_default, true ? {
target: "em5sgkm2"
} : 0)("&&&{", baseLabelTypography, ";box-sizing:border-box;display:block;padding-top:0;padding-bottom:0;max-width:100%;z-index:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}" + ( true ? "" : 0));
const Label = (props) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BaseLabel, {
...props,
as: "label"
});
const LabelWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm(flex_item_component_component_default, true ? {
target: "em5sgkm1"
} : 0)( true ? {
name: "1b6uupn",
styles: "max-width:calc( 100% - 10px )"
} : 0);
const prefixSuffixWrapperStyles = ({
variant = "default",
size,
__next40pxDefaultSize,
isPrefix
}) => {
const {
paddingLeft: padding
} = getSizeConfig({
inputSize: size,
__next40pxDefaultSize
});
const paddingProperty = isPrefix ? "paddingInlineStart" : "paddingInlineEnd";
if (variant === "default") {
return /* @__PURE__ */ emotion_react_browser_esm_css({
[paddingProperty]: padding
}, true ? "" : 0, true ? "" : 0);
}
return /* @__PURE__ */ emotion_react_browser_esm_css({
display: "flex",
[paddingProperty]: padding - 4
}, true ? "" : 0, true ? "" : 0);
};
const PrefixSuffixWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "em5sgkm0"
} : 0)(prefixSuffixWrapperStyles, ";" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/input-control/backdrop.js
function Backdrop({
disabled = false,
isBorderless = false
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BackdropUI, {
"aria-hidden": "true",
className: "components-input-control__backdrop",
disabled,
isBorderless
});
}
const MemoizedBackdrop = (0,external_wp_element_namespaceObject.memo)(Backdrop);
var backdrop_default = MemoizedBackdrop;
;// ./node_modules/@wordpress/components/build-module/input-control/label.js
function label_Label({
children,
hideLabelFromVision,
htmlFor,
...props
}) {
if (!children) {
return null;
}
if (hideLabelFromVision) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
as: "label",
htmlFor,
children
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LabelWrapper, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Label, {
htmlFor,
...props,
children
})
});
}
;// ./node_modules/@wordpress/components/build-module/utils/use-deprecated-props.js
function useDeprecated36pxDefaultSizeProp(props) {
const {
__next36pxDefaultSize,
__next40pxDefaultSize,
...otherProps
} = props;
return {
...otherProps,
__next40pxDefaultSize: __next40pxDefaultSize !== null && __next40pxDefaultSize !== void 0 ? __next40pxDefaultSize : __next36pxDefaultSize
};
}
;// ./node_modules/@wordpress/components/build-module/input-control/input-base.js
function useUniqueId(idProp) {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(InputBase);
const id = `input-base-control-${instanceId}`;
return idProp || id;
}
function getUIFlexProps(labelPosition) {
const props = {};
switch (labelPosition) {
case "top":
props.direction = "column";
props.expanded = false;
props.gap = 0;
break;
case "bottom":
props.direction = "column-reverse";
props.expanded = false;
props.gap = 0;
break;
case "edge":
props.justify = "space-between";
break;
}
return props;
}
function InputBase(props, ref) {
const {
__next40pxDefaultSize,
__unstableInputWidth,
children,
className,
disabled = false,
hideLabelFromVision = false,
labelPosition,
id: idProp,
isBorderless = false,
label,
prefix,
size = "default",
suffix,
...restProps
} = useDeprecated36pxDefaultSizeProp(useContextSystem(props, "InputBase"));
const id = useUniqueId(idProp);
const hideLabel = hideLabelFromVision || !label;
const prefixSuffixContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => {
return {
InputControlPrefixWrapper: {
__next40pxDefaultSize,
size
},
InputControlSuffixWrapper: {
__next40pxDefaultSize,
size
}
};
}, [__next40pxDefaultSize, size]);
return (
// @ts-expect-error The `direction` prop from Flex (FlexDirection) conflicts with legacy SVGAttributes `direction` (string) that come from React intrinsic prop definitions.
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Root, {
...restProps,
...getUIFlexProps(labelPosition),
className,
gap: 2,
ref,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(label_Label, {
className: "components-input-control__label",
hideLabelFromVision,
labelPosition,
htmlFor: id,
children: label
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Container, {
__unstableInputWidth,
className: "components-input-control__container",
disabled,
hideLabel,
labelPosition,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ContextSystemProvider, {
value: prefixSuffixContextValue,
children: [prefix && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Prefix, {
className: "components-input-control__prefix",
children: prefix
}), children, suffix && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Suffix, {
className: "components-input-control__suffix",
children: suffix
})]
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(backdrop_default, {
disabled,
isBorderless
})]
})]
})
);
}
var input_base_default = contextConnect(InputBase, "InputBase");
;// ./node_modules/@use-gesture/core/dist/maths-0ab39ae9.esm.js
function maths_0ab39ae9_esm_clamp(v, min, max) {
return Math.max(min, Math.min(v, max));
}
const V = {
toVector(v, fallback) {
if (v === undefined) v = fallback;
return Array.isArray(v) ? v : [v, v];
},
add(v1, v2) {
return [v1[0] + v2[0], v1[1] + v2[1]];
},
sub(v1, v2) {
return [v1[0] - v2[0], v1[1] - v2[1]];
},
addTo(v1, v2) {
v1[0] += v2[0];
v1[1] += v2[1];
},
subTo(v1, v2) {
v1[0] -= v2[0];
v1[1] -= v2[1];
}
};
function rubberband(distance, dimension, constant) {
if (dimension === 0 || Math.abs(dimension) === Infinity) return Math.pow(distance, constant * 5);
return distance * dimension * constant / (dimension + constant * distance);
}
function rubberbandIfOutOfBounds(position, min, max, constant = 0.15) {
if (constant === 0) return maths_0ab39ae9_esm_clamp(position, min, max);
if (position < min) return -rubberband(min - position, max - min, constant) + min;
if (position > max) return +rubberband(position - max, max - min, constant) + max;
return position;
}
function computeRubberband(bounds, [Vx, Vy], [Rx, Ry]) {
const [[X0, X1], [Y0, Y1]] = bounds;
return [rubberbandIfOutOfBounds(Vx, X0, X1, Rx), rubberbandIfOutOfBounds(Vy, Y0, Y1, Ry)];
}
;// ./node_modules/@use-gesture/core/dist/actions-fe213e88.esm.js
function _toPrimitive(input, hint) {
if (typeof input !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return typeof key === "symbol" ? key : String(key);
}
function _defineProperty(obj, key, value) {
key = _toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function actions_fe213e88_esm_ownKeys(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function (r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread2(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? actions_fe213e88_esm_ownKeys(Object(t), !0).forEach(function (r) {
_defineProperty(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : actions_fe213e88_esm_ownKeys(Object(t)).forEach(function (r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
const EVENT_TYPE_MAP = {
pointer: {
start: 'down',
change: 'move',
end: 'up'
},
mouse: {
start: 'down',
change: 'move',
end: 'up'
},
touch: {
start: 'start',
change: 'move',
end: 'end'
},
gesture: {
start: 'start',
change: 'change',
end: 'end'
}
};
function capitalize(string) {
if (!string) return '';
return string[0].toUpperCase() + string.slice(1);
}
const actionsWithoutCaptureSupported = ['enter', 'leave'];
function hasCapture(capture = false, actionKey) {
return capture && !actionsWithoutCaptureSupported.includes(actionKey);
}
function toHandlerProp(device, action = '', capture = false) {
const deviceProps = EVENT_TYPE_MAP[device];
const actionKey = deviceProps ? deviceProps[action] || action : action;
return 'on' + capitalize(device) + capitalize(actionKey) + (hasCapture(capture, actionKey) ? 'Capture' : '');
}
const pointerCaptureEvents = ['gotpointercapture', 'lostpointercapture'];
function parseProp(prop) {
let eventKey = prop.substring(2).toLowerCase();
const passive = !!~eventKey.indexOf('passive');
if (passive) eventKey = eventKey.replace('passive', '');
const captureKey = pointerCaptureEvents.includes(eventKey) ? 'capturecapture' : 'capture';
const capture = !!~eventKey.indexOf(captureKey);
if (capture) eventKey = eventKey.replace('capture', '');
return {
device: eventKey,
capture,
passive
};
}
function toDomEventType(device, action = '') {
const deviceProps = EVENT_TYPE_MAP[device];
const actionKey = deviceProps ? deviceProps[action] || action : action;
return device + actionKey;
}
function isTouch(event) {
return 'touches' in event;
}
function getPointerType(event) {
if (isTouch(event)) return 'touch';
if ('pointerType' in event) return event.pointerType;
return 'mouse';
}
function getCurrentTargetTouchList(event) {
return Array.from(event.touches).filter(e => {
var _event$currentTarget, _event$currentTarget$;
return e.target === event.currentTarget || ((_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 || (_event$currentTarget$ = _event$currentTarget.contains) === null || _event$currentTarget$ === void 0 ? void 0 : _event$currentTarget$.call(_event$currentTarget, e.target));
});
}
function getTouchList(event) {
return event.type === 'touchend' || event.type === 'touchcancel' ? event.changedTouches : event.targetTouches;
}
function getValueEvent(event) {
return isTouch(event) ? getTouchList(event)[0] : event;
}
function distanceAngle(P1, P2) {
try {
const dx = P2.clientX - P1.clientX;
const dy = P2.clientY - P1.clientY;
const cx = (P2.clientX + P1.clientX) / 2;
const cy = (P2.clientY + P1.clientY) / 2;
const distance = Math.hypot(dx, dy);
const angle = -(Math.atan2(dx, dy) * 180) / Math.PI;
const origin = [cx, cy];
return {
angle,
distance,
origin
};
} catch (_unused) {}
return null;
}
function touchIds(event) {
return getCurrentTargetTouchList(event).map(touch => touch.identifier);
}
function touchDistanceAngle(event, ids) {
const [P1, P2] = Array.from(event.touches).filter(touch => ids.includes(touch.identifier));
return distanceAngle(P1, P2);
}
function pointerId(event) {
const valueEvent = getValueEvent(event);
return isTouch(event) ? valueEvent.identifier : valueEvent.pointerId;
}
function pointerValues(event) {
const valueEvent = getValueEvent(event);
return [valueEvent.clientX, valueEvent.clientY];
}
const LINE_HEIGHT = 40;
const PAGE_HEIGHT = 800;
function wheelValues(event) {
let {
deltaX,
deltaY,
deltaMode
} = event;
if (deltaMode === 1) {
deltaX *= LINE_HEIGHT;
deltaY *= LINE_HEIGHT;
} else if (deltaMode === 2) {
deltaX *= PAGE_HEIGHT;
deltaY *= PAGE_HEIGHT;
}
return [deltaX, deltaY];
}
function scrollValues(event) {
var _ref, _ref2;
const {
scrollX,
scrollY,
scrollLeft,
scrollTop
} = event.currentTarget;
return [(_ref = scrollX !== null && scrollX !== void 0 ? scrollX : scrollLeft) !== null && _ref !== void 0 ? _ref : 0, (_ref2 = scrollY !== null && scrollY !== void 0 ? scrollY : scrollTop) !== null && _ref2 !== void 0 ? _ref2 : 0];
}
function getEventDetails(event) {
const payload = {};
if ('buttons' in event) payload.buttons = event.buttons;
if ('shiftKey' in event) {
const {
shiftKey,
altKey,
metaKey,
ctrlKey
} = event;
Object.assign(payload, {
shiftKey,
altKey,
metaKey,
ctrlKey
});
}
return payload;
}
function call(v, ...args) {
if (typeof v === 'function') {
return v(...args);
} else {
return v;
}
}
function actions_fe213e88_esm_noop() {}
function actions_fe213e88_esm_chain(...fns) {
if (fns.length === 0) return actions_fe213e88_esm_noop;
if (fns.length === 1) return fns[0];
return function () {
let result;
for (const fn of fns) {
result = fn.apply(this, arguments) || result;
}
return result;
};
}
function assignDefault(value, fallback) {
return Object.assign({}, fallback, value || {});
}
const BEFORE_LAST_KINEMATICS_DELAY = 32;
class Engine {
constructor(ctrl, args, key) {
this.ctrl = ctrl;
this.args = args;
this.key = key;
if (!this.state) {
this.state = {};
this.computeValues([0, 0]);
this.computeInitial();
if (this.init) this.init();
this.reset();
}
}
get state() {
return this.ctrl.state[this.key];
}
set state(state) {
this.ctrl.state[this.key] = state;
}
get shared() {
return this.ctrl.state.shared;
}
get eventStore() {
return this.ctrl.gestureEventStores[this.key];
}
get timeoutStore() {
return this.ctrl.gestureTimeoutStores[this.key];
}
get config() {
return this.ctrl.config[this.key];
}
get sharedConfig() {
return this.ctrl.config.shared;
}
get handler() {
return this.ctrl.handlers[this.key];
}
reset() {
const {
state,
shared,
ingKey,
args
} = this;
shared[ingKey] = state._active = state.active = state._blocked = state._force = false;
state._step = [false, false];
state.intentional = false;
state._movement = [0, 0];
state._distance = [0, 0];
state._direction = [0, 0];
state._delta = [0, 0];
state._bounds = [[-Infinity, Infinity], [-Infinity, Infinity]];
state.args = args;
state.axis = undefined;
state.memo = undefined;
state.elapsedTime = state.timeDelta = 0;
state.direction = [0, 0];
state.distance = [0, 0];
state.overflow = [0, 0];
state._movementBound = [false, false];
state.velocity = [0, 0];
state.movement = [0, 0];
state.delta = [0, 0];
state.timeStamp = 0;
}
start(event) {
const state = this.state;
const config = this.config;
if (!state._active) {
this.reset();
this.computeInitial();
state._active = true;
state.target = event.target;
state.currentTarget = event.currentTarget;
state.lastOffset = config.from ? call(config.from, state) : state.offset;
state.offset = state.lastOffset;
state.startTime = state.timeStamp = event.timeStamp;
}
}
computeValues(values) {
const state = this.state;
state._values = values;
state.values = this.config.transform(values);
}
computeInitial() {
const state = this.state;
state._initial = state._values;
state.initial = state.values;
}
compute(event) {
const {
state,
config,
shared
} = this;
state.args = this.args;
let dt = 0;
if (event) {
state.event = event;
if (config.preventDefault && event.cancelable) state.event.preventDefault();
state.type = event.type;
shared.touches = this.ctrl.pointerIds.size || this.ctrl.touchIds.size;
shared.locked = !!document.pointerLockElement;
Object.assign(shared, getEventDetails(event));
shared.down = shared.pressed = shared.buttons % 2 === 1 || shared.touches > 0;
dt = event.timeStamp - state.timeStamp;
state.timeStamp = event.timeStamp;
state.elapsedTime = state.timeStamp - state.startTime;
}
if (state._active) {
const _absoluteDelta = state._delta.map(Math.abs);
V.addTo(state._distance, _absoluteDelta);
}
if (this.axisIntent) this.axisIntent(event);
const [_m0, _m1] = state._movement;
const [t0, t1] = config.threshold;
const {
_step,
values
} = state;
if (config.hasCustomTransform) {
if (_step[0] === false) _step[0] = Math.abs(_m0) >= t0 && values[0];
if (_step[1] === false) _step[1] = Math.abs(_m1) >= t1 && values[1];
} else {
if (_step[0] === false) _step[0] = Math.abs(_m0) >= t0 && Math.sign(_m0) * t0;
if (_step[1] === false) _step[1] = Math.abs(_m1) >= t1 && Math.sign(_m1) * t1;
}
state.intentional = _step[0] !== false || _step[1] !== false;
if (!state.intentional) return;
const movement = [0, 0];
if (config.hasCustomTransform) {
const [v0, v1] = values;
movement[0] = _step[0] !== false ? v0 - _step[0] : 0;
movement[1] = _step[1] !== false ? v1 - _step[1] : 0;
} else {
movement[0] = _step[0] !== false ? _m0 - _step[0] : 0;
movement[1] = _step[1] !== false ? _m1 - _step[1] : 0;
}
if (this.restrictToAxis && !state._blocked) this.restrictToAxis(movement);
const previousOffset = state.offset;
const gestureIsActive = state._active && !state._blocked || state.active;
if (gestureIsActive) {
state.first = state._active && !state.active;
state.last = !state._active && state.active;
state.active = shared[this.ingKey] = state._active;
if (event) {
if (state.first) {
if ('bounds' in config) state._bounds = call(config.bounds, state);
if (this.setup) this.setup();
}
state.movement = movement;
this.computeOffset();
}
}
const [ox, oy] = state.offset;
const [[x0, x1], [y0, y1]] = state._bounds;
state.overflow = [ox < x0 ? -1 : ox > x1 ? 1 : 0, oy < y0 ? -1 : oy > y1 ? 1 : 0];
state._movementBound[0] = state.overflow[0] ? state._movementBound[0] === false ? state._movement[0] : state._movementBound[0] : false;
state._movementBound[1] = state.overflow[1] ? state._movementBound[1] === false ? state._movement[1] : state._movementBound[1] : false;
const rubberband = state._active ? config.rubberband || [0, 0] : [0, 0];
state.offset = computeRubberband(state._bounds, state.offset, rubberband);
state.delta = V.sub(state.offset, previousOffset);
this.computeMovement();
if (gestureIsActive && (!state.last || dt > BEFORE_LAST_KINEMATICS_DELAY)) {
state.delta = V.sub(state.offset, previousOffset);
const absoluteDelta = state.delta.map(Math.abs);
V.addTo(state.distance, absoluteDelta);
state.direction = state.delta.map(Math.sign);
state._direction = state._delta.map(Math.sign);
if (!state.first && dt > 0) {
state.velocity = [absoluteDelta[0] / dt, absoluteDelta[1] / dt];
state.timeDelta = dt;
}
}
}
emit() {
const state = this.state;
const shared = this.shared;
const config = this.config;
if (!state._active) this.clean();
if ((state._blocked || !state.intentional) && !state._force && !config.triggerAllEvents) return;
const memo = this.handler(_objectSpread2(_objectSpread2(_objectSpread2({}, shared), state), {}, {
[this.aliasKey]: state.values
}));
if (memo !== undefined) state.memo = memo;
}
clean() {
this.eventStore.clean();
this.timeoutStore.clean();
}
}
function selectAxis([dx, dy], threshold) {
const absDx = Math.abs(dx);
const absDy = Math.abs(dy);
if (absDx > absDy && absDx > threshold) {
return 'x';
}
if (absDy > absDx && absDy > threshold) {
return 'y';
}
return undefined;
}
class CoordinatesEngine extends Engine {
constructor(...args) {
super(...args);
_defineProperty(this, "aliasKey", 'xy');
}
reset() {
super.reset();
this.state.axis = undefined;
}
init() {
this.state.offset = [0, 0];
this.state.lastOffset = [0, 0];
}
computeOffset() {
this.state.offset = V.add(this.state.lastOffset, this.state.movement);
}
computeMovement() {
this.state.movement = V.sub(this.state.offset, this.state.lastOffset);
}
axisIntent(event) {
const state = this.state;
const config = this.config;
if (!state.axis && event) {
const threshold = typeof config.axisThreshold === 'object' ? config.axisThreshold[getPointerType(event)] : config.axisThreshold;
state.axis = selectAxis(state._movement, threshold);
}
state._blocked = (config.lockDirection || !!config.axis) && !state.axis || !!config.axis && config.axis !== state.axis;
}
restrictToAxis(v) {
if (this.config.axis || this.config.lockDirection) {
switch (this.state.axis) {
case 'x':
v[1] = 0;
break;
case 'y':
v[0] = 0;
break;
}
}
}
}
const actions_fe213e88_esm_identity = v => v;
const DEFAULT_RUBBERBAND = 0.15;
const commonConfigResolver = {
enabled(value = true) {
return value;
},
eventOptions(value, _k, config) {
return _objectSpread2(_objectSpread2({}, config.shared.eventOptions), value);
},
preventDefault(value = false) {
return value;
},
triggerAllEvents(value = false) {
return value;
},
rubberband(value = 0) {
switch (value) {
case true:
return [DEFAULT_RUBBERBAND, DEFAULT_RUBBERBAND];
case false:
return [0, 0];
default:
return V.toVector(value);
}
},
from(value) {
if (typeof value === 'function') return value;
if (value != null) return V.toVector(value);
},
transform(value, _k, config) {
const transform = value || config.shared.transform;
this.hasCustomTransform = !!transform;
if (false) {}
return transform || actions_fe213e88_esm_identity;
},
threshold(value) {
return V.toVector(value, 0);
}
};
if (false) {}
const DEFAULT_AXIS_THRESHOLD = 0;
const coordinatesConfigResolver = _objectSpread2(_objectSpread2({}, commonConfigResolver), {}, {
axis(_v, _k, {
axis
}) {
this.lockDirection = axis === 'lock';
if (!this.lockDirection) return axis;
},
axisThreshold(value = DEFAULT_AXIS_THRESHOLD) {
return value;
},
bounds(value = {}) {
if (typeof value === 'function') {
return state => coordinatesConfigResolver.bounds(value(state));
}
if ('current' in value) {
return () => value.current;
}
if (typeof HTMLElement === 'function' && value instanceof HTMLElement) {
return value;
}
const {
left = -Infinity,
right = Infinity,
top = -Infinity,
bottom = Infinity
} = value;
return [[left, right], [top, bottom]];
}
});
const KEYS_DELTA_MAP = {
ArrowRight: (displacement, factor = 1) => [displacement * factor, 0],
ArrowLeft: (displacement, factor = 1) => [-1 * displacement * factor, 0],
ArrowUp: (displacement, factor = 1) => [0, -1 * displacement * factor],
ArrowDown: (displacement, factor = 1) => [0, displacement * factor]
};
class DragEngine extends CoordinatesEngine {
constructor(...args) {
super(...args);
_defineProperty(this, "ingKey", 'dragging');
}
reset() {
super.reset();
const state = this.state;
state._pointerId = undefined;
state._pointerActive = false;
state._keyboardActive = false;
state._preventScroll = false;
state._delayed = false;
state.swipe = [0, 0];
state.tap = false;
state.canceled = false;
state.cancel = this.cancel.bind(this);
}
setup() {
const state = this.state;
if (state._bounds instanceof HTMLElement) {
const boundRect = state._bounds.getBoundingClientRect();
const targetRect = state.currentTarget.getBoundingClientRect();
const _bounds = {
left: boundRect.left - targetRect.left + state.offset[0],
right: boundRect.right - targetRect.right + state.offset[0],
top: boundRect.top - targetRect.top + state.offset[1],
bottom: boundRect.bottom - targetRect.bottom + state.offset[1]
};
state._bounds = coordinatesConfigResolver.bounds(_bounds);
}
}
cancel() {
const state = this.state;
if (state.canceled) return;
state.canceled = true;
state._active = false;
setTimeout(() => {
this.compute();
this.emit();
}, 0);
}
setActive() {
this.state._active = this.state._pointerActive || this.state._keyboardActive;
}
clean() {
this.pointerClean();
this.state._pointerActive = false;
this.state._keyboardActive = false;
super.clean();
}
pointerDown(event) {
const config = this.config;
const state = this.state;
if (event.buttons != null && (Array.isArray(config.pointerButtons) ? !config.pointerButtons.includes(event.buttons) : config.pointerButtons !== -1 && config.pointerButtons !== event.buttons)) return;
const ctrlIds = this.ctrl.setEventIds(event);
if (config.pointerCapture) {
event.target.setPointerCapture(event.pointerId);
}
if (ctrlIds && ctrlIds.size > 1 && state._pointerActive) return;
this.start(event);
this.setupPointer(event);
state._pointerId = pointerId(event);
state._pointerActive = true;
this.computeValues(pointerValues(event));
this.computeInitial();
if (config.preventScrollAxis && getPointerType(event) !== 'mouse') {
state._active = false;
this.setupScrollPrevention(event);
} else if (config.delay > 0) {
this.setupDelayTrigger(event);
if (config.triggerAllEvents) {
this.compute(event);
this.emit();
}
} else {
this.startPointerDrag(event);
}
}
startPointerDrag(event) {
const state = this.state;
state._active = true;
state._preventScroll = true;
state._delayed = false;
this.compute(event);
this.emit();
}
pointerMove(event) {
const state = this.state;
const config = this.config;
if (!state._pointerActive) return;
const id = pointerId(event);
if (state._pointerId !== undefined && id !== state._pointerId) return;
const _values = pointerValues(event);
if (document.pointerLockElement === event.target) {
state._delta = [event.movementX, event.movementY];
} else {
state._delta = V.sub(_values, state._values);
this.computeValues(_values);
}
V.addTo(state._movement, state._delta);
this.compute(event);
if (state._delayed && state.intentional) {
this.timeoutStore.remove('dragDelay');
state.active = false;
this.startPointerDrag(event);
return;
}
if (config.preventScrollAxis && !state._preventScroll) {
if (state.axis) {
if (state.axis === config.preventScrollAxis || config.preventScrollAxis === 'xy') {
state._active = false;
this.clean();
return;
} else {
this.timeoutStore.remove('startPointerDrag');
this.startPointerDrag(event);
return;
}
} else {
return;
}
}
this.emit();
}
pointerUp(event) {
this.ctrl.setEventIds(event);
try {
if (this.config.pointerCapture && event.target.hasPointerCapture(event.pointerId)) {
;
event.target.releasePointerCapture(event.pointerId);
}
} catch (_unused) {
if (false) {}
}
const state = this.state;
const config = this.config;
if (!state._active || !state._pointerActive) return;
const id = pointerId(event);
if (state._pointerId !== undefined && id !== state._pointerId) return;
this.state._pointerActive = false;
this.setActive();
this.compute(event);
const [dx, dy] = state._distance;
state.tap = dx <= config.tapsThreshold && dy <= config.tapsThreshold;
if (state.tap && config.filterTaps) {
state._force = true;
} else {
const [_dx, _dy] = state._delta;
const [_mx, _my] = state._movement;
const [svx, svy] = config.swipe.velocity;
const [sx, sy] = config.swipe.distance;
const sdt = config.swipe.duration;
if (state.elapsedTime < sdt) {
const _vx = Math.abs(_dx / state.timeDelta);
const _vy = Math.abs(_dy / state.timeDelta);
if (_vx > svx && Math.abs(_mx) > sx) state.swipe[0] = Math.sign(_dx);
if (_vy > svy && Math.abs(_my) > sy) state.swipe[1] = Math.sign(_dy);
}
}
this.emit();
}
pointerClick(event) {
if (!this.state.tap && event.detail > 0) {
event.preventDefault();
event.stopPropagation();
}
}
setupPointer(event) {
const config = this.config;
const device = config.device;
if (false) {}
if (config.pointerLock) {
event.currentTarget.requestPointerLock();
}
if (!config.pointerCapture) {
this.eventStore.add(this.sharedConfig.window, device, 'change', this.pointerMove.bind(this));
this.eventStore.add(this.sharedConfig.window, device, 'end', this.pointerUp.bind(this));
this.eventStore.add(this.sharedConfig.window, device, 'cancel', this.pointerUp.bind(this));
}
}
pointerClean() {
if (this.config.pointerLock && document.pointerLockElement === this.state.currentTarget) {
document.exitPointerLock();
}
}
preventScroll(event) {
if (this.state._preventScroll && event.cancelable) {
event.preventDefault();
}
}
setupScrollPrevention(event) {
this.state._preventScroll = false;
persistEvent(event);
const remove = this.eventStore.add(this.sharedConfig.window, 'touch', 'change', this.preventScroll.bind(this), {
passive: false
});
this.eventStore.add(this.sharedConfig.window, 'touch', 'end', remove);
this.eventStore.add(this.sharedConfig.window, 'touch', 'cancel', remove);
this.timeoutStore.add('startPointerDrag', this.startPointerDrag.bind(this), this.config.preventScrollDelay, event);
}
setupDelayTrigger(event) {
this.state._delayed = true;
this.timeoutStore.add('dragDelay', () => {
this.state._step = [0, 0];
this.startPointerDrag(event);
}, this.config.delay);
}
keyDown(event) {
const deltaFn = KEYS_DELTA_MAP[event.key];
if (deltaFn) {
const state = this.state;
const factor = event.shiftKey ? 10 : event.altKey ? 0.1 : 1;
this.start(event);
state._delta = deltaFn(this.config.keyboardDisplacement, factor);
state._keyboardActive = true;
V.addTo(state._movement, state._delta);
this.compute(event);
this.emit();
}
}
keyUp(event) {
if (!(event.key in KEYS_DELTA_MAP)) return;
this.state._keyboardActive = false;
this.setActive();
this.compute(event);
this.emit();
}
bind(bindFunction) {
const device = this.config.device;
bindFunction(device, 'start', this.pointerDown.bind(this));
if (this.config.pointerCapture) {
bindFunction(device, 'change', this.pointerMove.bind(this));
bindFunction(device, 'end', this.pointerUp.bind(this));
bindFunction(device, 'cancel', this.pointerUp.bind(this));
bindFunction('lostPointerCapture', '', this.pointerUp.bind(this));
}
if (this.config.keys) {
bindFunction('key', 'down', this.keyDown.bind(this));
bindFunction('key', 'up', this.keyUp.bind(this));
}
if (this.config.filterTaps) {
bindFunction('click', '', this.pointerClick.bind(this), {
capture: true,
passive: false
});
}
}
}
function persistEvent(event) {
'persist' in event && typeof event.persist === 'function' && event.persist();
}
const actions_fe213e88_esm_isBrowser = typeof window !== 'undefined' && window.document && window.document.createElement;
function supportsTouchEvents() {
return actions_fe213e88_esm_isBrowser && 'ontouchstart' in window;
}
function isTouchScreen() {
return supportsTouchEvents() || actions_fe213e88_esm_isBrowser && window.navigator.maxTouchPoints > 1;
}
function supportsPointerEvents() {
return actions_fe213e88_esm_isBrowser && 'onpointerdown' in window;
}
function supportsPointerLock() {
return actions_fe213e88_esm_isBrowser && 'exitPointerLock' in window.document;
}
function supportsGestureEvents() {
try {
return 'constructor' in GestureEvent;
} catch (e) {
return false;
}
}
const SUPPORT = {
isBrowser: actions_fe213e88_esm_isBrowser,
gesture: supportsGestureEvents(),
touch: supportsTouchEvents(),
touchscreen: isTouchScreen(),
pointer: supportsPointerEvents(),
pointerLock: supportsPointerLock()
};
const DEFAULT_PREVENT_SCROLL_DELAY = 250;
const DEFAULT_DRAG_DELAY = 180;
const DEFAULT_SWIPE_VELOCITY = 0.5;
const DEFAULT_SWIPE_DISTANCE = 50;
const DEFAULT_SWIPE_DURATION = 250;
const DEFAULT_KEYBOARD_DISPLACEMENT = 10;
const DEFAULT_DRAG_AXIS_THRESHOLD = {
mouse: 0,
touch: 0,
pen: 8
};
const dragConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, {
device(_v, _k, {
pointer: {
touch = false,
lock = false,
mouse = false
} = {}
}) {
this.pointerLock = lock && SUPPORT.pointerLock;
if (SUPPORT.touch && touch) return 'touch';
if (this.pointerLock) return 'mouse';
if (SUPPORT.pointer && !mouse) return 'pointer';
if (SUPPORT.touch) return 'touch';
return 'mouse';
},
preventScrollAxis(value, _k, {
preventScroll
}) {
this.preventScrollDelay = typeof preventScroll === 'number' ? preventScroll : preventScroll || preventScroll === undefined && value ? DEFAULT_PREVENT_SCROLL_DELAY : undefined;
if (!SUPPORT.touchscreen || preventScroll === false) return undefined;
return value ? value : preventScroll !== undefined ? 'y' : undefined;
},
pointerCapture(_v, _k, {
pointer: {
capture = true,
buttons = 1,
keys = true
} = {}
}) {
this.pointerButtons = buttons;
this.keys = keys;
return !this.pointerLock && this.device === 'pointer' && capture;
},
threshold(value, _k, {
filterTaps = false,
tapsThreshold = 3,
axis = undefined
}) {
const threshold = V.toVector(value, filterTaps ? tapsThreshold : axis ? 1 : 0);
this.filterTaps = filterTaps;
this.tapsThreshold = tapsThreshold;
return threshold;
},
swipe({
velocity = DEFAULT_SWIPE_VELOCITY,
distance = DEFAULT_SWIPE_DISTANCE,
duration = DEFAULT_SWIPE_DURATION
} = {}) {
return {
velocity: this.transform(V.toVector(velocity)),
distance: this.transform(V.toVector(distance)),
duration
};
},
delay(value = 0) {
switch (value) {
case true:
return DEFAULT_DRAG_DELAY;
case false:
return 0;
default:
return value;
}
},
axisThreshold(value) {
if (!value) return DEFAULT_DRAG_AXIS_THRESHOLD;
return _objectSpread2(_objectSpread2({}, DEFAULT_DRAG_AXIS_THRESHOLD), value);
},
keyboardDisplacement(value = DEFAULT_KEYBOARD_DISPLACEMENT) {
return value;
}
});
if (false) {}
function clampStateInternalMovementToBounds(state) {
const [ox, oy] = state.overflow;
const [dx, dy] = state._delta;
const [dirx, diry] = state._direction;
if (ox < 0 && dx > 0 && dirx < 0 || ox > 0 && dx < 0 && dirx > 0) {
state._movement[0] = state._movementBound[0];
}
if (oy < 0 && dy > 0 && diry < 0 || oy > 0 && dy < 0 && diry > 0) {
state._movement[1] = state._movementBound[1];
}
}
const SCALE_ANGLE_RATIO_INTENT_DEG = 30;
const PINCH_WHEEL_RATIO = 100;
class PinchEngine extends Engine {
constructor(...args) {
super(...args);
_defineProperty(this, "ingKey", 'pinching');
_defineProperty(this, "aliasKey", 'da');
}
init() {
this.state.offset = [1, 0];
this.state.lastOffset = [1, 0];
this.state._pointerEvents = new Map();
}
reset() {
super.reset();
const state = this.state;
state._touchIds = [];
state.canceled = false;
state.cancel = this.cancel.bind(this);
state.turns = 0;
}
computeOffset() {
const {
type,
movement,
lastOffset
} = this.state;
if (type === 'wheel') {
this.state.offset = V.add(movement, lastOffset);
} else {
this.state.offset = [(1 + movement[0]) * lastOffset[0], movement[1] + lastOffset[1]];
}
}
computeMovement() {
const {
offset,
lastOffset
} = this.state;
this.state.movement = [offset[0] / lastOffset[0], offset[1] - lastOffset[1]];
}
axisIntent() {
const state = this.state;
const [_m0, _m1] = state._movement;
if (!state.axis) {
const axisMovementDifference = Math.abs(_m0) * SCALE_ANGLE_RATIO_INTENT_DEG - Math.abs(_m1);
if (axisMovementDifference < 0) state.axis = 'angle';else if (axisMovementDifference > 0) state.axis = 'scale';
}
}
restrictToAxis(v) {
if (this.config.lockDirection) {
if (this.state.axis === 'scale') v[1] = 0;else if (this.state.axis === 'angle') v[0] = 0;
}
}
cancel() {
const state = this.state;
if (state.canceled) return;
setTimeout(() => {
state.canceled = true;
state._active = false;
this.compute();
this.emit();
}, 0);
}
touchStart(event) {
this.ctrl.setEventIds(event);
const state = this.state;
const ctrlTouchIds = this.ctrl.touchIds;
if (state._active) {
if (state._touchIds.every(id => ctrlTouchIds.has(id))) return;
}
if (ctrlTouchIds.size < 2) return;
this.start(event);
state._touchIds = Array.from(ctrlTouchIds).slice(0, 2);
const payload = touchDistanceAngle(event, state._touchIds);
if (!payload) return;
this.pinchStart(event, payload);
}
pointerStart(event) {
if (event.buttons != null && event.buttons % 2 !== 1) return;
this.ctrl.setEventIds(event);
event.target.setPointerCapture(event.pointerId);
const state = this.state;
const _pointerEvents = state._pointerEvents;
const ctrlPointerIds = this.ctrl.pointerIds;
if (state._active) {
if (Array.from(_pointerEvents.keys()).every(id => ctrlPointerIds.has(id))) return;
}
if (_pointerEvents.size < 2) {
_pointerEvents.set(event.pointerId, event);
}
if (state._pointerEvents.size < 2) return;
this.start(event);
const payload = distanceAngle(...Array.from(_pointerEvents.values()));
if (!payload) return;
this.pinchStart(event, payload);
}
pinchStart(event, payload) {
const state = this.state;
state.origin = payload.origin;
this.computeValues([payload.distance, payload.angle]);
this.computeInitial();
this.compute(event);
this.emit();
}
touchMove(event) {
if (!this.state._active) return;
const payload = touchDistanceAngle(event, this.state._touchIds);
if (!payload) return;
this.pinchMove(event, payload);
}
pointerMove(event) {
const _pointerEvents = this.state._pointerEvents;
if (_pointerEvents.has(event.pointerId)) {
_pointerEvents.set(event.pointerId, event);
}
if (!this.state._active) return;
const payload = distanceAngle(...Array.from(_pointerEvents.values()));
if (!payload) return;
this.pinchMove(event, payload);
}
pinchMove(event, payload) {
const state = this.state;
const prev_a = state._values[1];
const delta_a = payload.angle - prev_a;
let delta_turns = 0;
if (Math.abs(delta_a) > 270) delta_turns += Math.sign(delta_a);
this.computeValues([payload.distance, payload.angle - 360 * delta_turns]);
state.origin = payload.origin;
state.turns = delta_turns;
state._movement = [state._values[0] / state._initial[0] - 1, state._values[1] - state._initial[1]];
this.compute(event);
this.emit();
}
touchEnd(event) {
this.ctrl.setEventIds(event);
if (!this.state._active) return;
if (this.state._touchIds.some(id => !this.ctrl.touchIds.has(id))) {
this.state._active = false;
this.compute(event);
this.emit();
}
}
pointerEnd(event) {
const state = this.state;
this.ctrl.setEventIds(event);
try {
event.target.releasePointerCapture(event.pointerId);
} catch (_unused) {}
if (state._pointerEvents.has(event.pointerId)) {
state._pointerEvents.delete(event.pointerId);
}
if (!state._active) return;
if (state._pointerEvents.size < 2) {
state._active = false;
this.compute(event);
this.emit();
}
}
gestureStart(event) {
if (event.cancelable) event.preventDefault();
const state = this.state;
if (state._active) return;
this.start(event);
this.computeValues([event.scale, event.rotation]);
state.origin = [event.clientX, event.clientY];
this.compute(event);
this.emit();
}
gestureMove(event) {
if (event.cancelable) event.preventDefault();
if (!this.state._active) return;
const state = this.state;
this.computeValues([event.scale, event.rotation]);
state.origin = [event.clientX, event.clientY];
const _previousMovement = state._movement;
state._movement = [event.scale - 1, event.rotation];
state._delta = V.sub(state._movement, _previousMovement);
this.compute(event);
this.emit();
}
gestureEnd(event) {
if (!this.state._active) return;
this.state._active = false;
this.compute(event);
this.emit();
}
wheel(event) {
const modifierKey = this.config.modifierKey;
if (modifierKey && (Array.isArray(modifierKey) ? !modifierKey.find(k => event[k]) : !event[modifierKey])) return;
if (!this.state._active) this.wheelStart(event);else this.wheelChange(event);
this.timeoutStore.add('wheelEnd', this.wheelEnd.bind(this));
}
wheelStart(event) {
this.start(event);
this.wheelChange(event);
}
wheelChange(event) {
const isR3f = ('uv' in event);
if (!isR3f) {
if (event.cancelable) {
event.preventDefault();
}
if (false) {}
}
const state = this.state;
state._delta = [-wheelValues(event)[1] / PINCH_WHEEL_RATIO * state.offset[0], 0];
V.addTo(state._movement, state._delta);
clampStateInternalMovementToBounds(state);
this.state.origin = [event.clientX, event.clientY];
this.compute(event);
this.emit();
}
wheelEnd() {
if (!this.state._active) return;
this.state._active = false;
this.compute();
this.emit();
}
bind(bindFunction) {
const device = this.config.device;
if (!!device) {
bindFunction(device, 'start', this[device + 'Start'].bind(this));
bindFunction(device, 'change', this[device + 'Move'].bind(this));
bindFunction(device, 'end', this[device + 'End'].bind(this));
bindFunction(device, 'cancel', this[device + 'End'].bind(this));
bindFunction('lostPointerCapture', '', this[device + 'End'].bind(this));
}
if (this.config.pinchOnWheel) {
bindFunction('wheel', '', this.wheel.bind(this), {
passive: false
});
}
}
}
const pinchConfigResolver = _objectSpread2(_objectSpread2({}, commonConfigResolver), {}, {
device(_v, _k, {
shared,
pointer: {
touch = false
} = {}
}) {
const sharedConfig = shared;
if (sharedConfig.target && !SUPPORT.touch && SUPPORT.gesture) return 'gesture';
if (SUPPORT.touch && touch) return 'touch';
if (SUPPORT.touchscreen) {
if (SUPPORT.pointer) return 'pointer';
if (SUPPORT.touch) return 'touch';
}
},
bounds(_v, _k, {
scaleBounds = {},
angleBounds = {}
}) {
const _scaleBounds = state => {
const D = assignDefault(call(scaleBounds, state), {
min: -Infinity,
max: Infinity
});
return [D.min, D.max];
};
const _angleBounds = state => {
const A = assignDefault(call(angleBounds, state), {
min: -Infinity,
max: Infinity
});
return [A.min, A.max];
};
if (typeof scaleBounds !== 'function' && typeof angleBounds !== 'function') return [_scaleBounds(), _angleBounds()];
return state => [_scaleBounds(state), _angleBounds(state)];
},
threshold(value, _k, config) {
this.lockDirection = config.axis === 'lock';
const threshold = V.toVector(value, this.lockDirection ? [0.1, 3] : 0);
return threshold;
},
modifierKey(value) {
if (value === undefined) return 'ctrlKey';
return value;
},
pinchOnWheel(value = true) {
return value;
}
});
class MoveEngine extends CoordinatesEngine {
constructor(...args) {
super(...args);
_defineProperty(this, "ingKey", 'moving');
}
move(event) {
if (this.config.mouseOnly && event.pointerType !== 'mouse') return;
if (!this.state._active) this.moveStart(event);else this.moveChange(event);
this.timeoutStore.add('moveEnd', this.moveEnd.bind(this));
}
moveStart(event) {
this.start(event);
this.computeValues(pointerValues(event));
this.compute(event);
this.computeInitial();
this.emit();
}
moveChange(event) {
if (!this.state._active) return;
const values = pointerValues(event);
const state = this.state;
state._delta = V.sub(values, state._values);
V.addTo(state._movement, state._delta);
this.computeValues(values);
this.compute(event);
this.emit();
}
moveEnd(event) {
if (!this.state._active) return;
this.state._active = false;
this.compute(event);
this.emit();
}
bind(bindFunction) {
bindFunction('pointer', 'change', this.move.bind(this));
bindFunction('pointer', 'leave', this.moveEnd.bind(this));
}
}
const moveConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, {
mouseOnly: (value = true) => value
});
class ScrollEngine extends CoordinatesEngine {
constructor(...args) {
super(...args);
_defineProperty(this, "ingKey", 'scrolling');
}
scroll(event) {
if (!this.state._active) this.start(event);
this.scrollChange(event);
this.timeoutStore.add('scrollEnd', this.scrollEnd.bind(this));
}
scrollChange(event) {
if (event.cancelable) event.preventDefault();
const state = this.state;
const values = scrollValues(event);
state._delta = V.sub(values, state._values);
V.addTo(state._movement, state._delta);
this.computeValues(values);
this.compute(event);
this.emit();
}
scrollEnd() {
if (!this.state._active) return;
this.state._active = false;
this.compute();
this.emit();
}
bind(bindFunction) {
bindFunction('scroll', '', this.scroll.bind(this));
}
}
const scrollConfigResolver = coordinatesConfigResolver;
class WheelEngine extends CoordinatesEngine {
constructor(...args) {
super(...args);
_defineProperty(this, "ingKey", 'wheeling');
}
wheel(event) {
if (!this.state._active) this.start(event);
this.wheelChange(event);
this.timeoutStore.add('wheelEnd', this.wheelEnd.bind(this));
}
wheelChange(event) {
const state = this.state;
state._delta = wheelValues(event);
V.addTo(state._movement, state._delta);
clampStateInternalMovementToBounds(state);
this.compute(event);
this.emit();
}
wheelEnd() {
if (!this.state._active) return;
this.state._active = false;
this.compute();
this.emit();
}
bind(bindFunction) {
bindFunction('wheel', '', this.wheel.bind(this));
}
}
const wheelConfigResolver = coordinatesConfigResolver;
class HoverEngine extends CoordinatesEngine {
constructor(...args) {
super(...args);
_defineProperty(this, "ingKey", 'hovering');
}
enter(event) {
if (this.config.mouseOnly && event.pointerType !== 'mouse') return;
this.start(event);
this.computeValues(pointerValues(event));
this.compute(event);
this.emit();
}
leave(event) {
if (this.config.mouseOnly && event.pointerType !== 'mouse') return;
const state = this.state;
if (!state._active) return;
state._active = false;
const values = pointerValues(event);
state._movement = state._delta = V.sub(values, state._values);
this.computeValues(values);
this.compute(event);
state.delta = state.movement;
this.emit();
}
bind(bindFunction) {
bindFunction('pointer', 'enter', this.enter.bind(this));
bindFunction('pointer', 'leave', this.leave.bind(this));
}
}
const hoverConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, {
mouseOnly: (value = true) => value
});
const actions_fe213e88_esm_EngineMap = new Map();
const ConfigResolverMap = new Map();
function actions_fe213e88_esm_registerAction(action) {
actions_fe213e88_esm_EngineMap.set(action.key, action.engine);
ConfigResolverMap.set(action.key, action.resolver);
}
const actions_fe213e88_esm_dragAction = {
key: 'drag',
engine: DragEngine,
resolver: dragConfigResolver
};
const actions_fe213e88_esm_hoverAction = {
key: 'hover',
engine: HoverEngine,
resolver: hoverConfigResolver
};
const actions_fe213e88_esm_moveAction = {
key: 'move',
engine: MoveEngine,
resolver: moveConfigResolver
};
const actions_fe213e88_esm_pinchAction = {
key: 'pinch',
engine: PinchEngine,
resolver: pinchConfigResolver
};
const actions_fe213e88_esm_scrollAction = {
key: 'scroll',
engine: ScrollEngine,
resolver: scrollConfigResolver
};
const actions_fe213e88_esm_wheelAction = {
key: 'wheel',
engine: WheelEngine,
resolver: wheelConfigResolver
};
;// ./node_modules/@use-gesture/core/dist/use-gesture-core.esm.js
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
function _objectWithoutProperties(source, excluded) {
if (source == null) return {};
var target = _objectWithoutPropertiesLoose(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
const sharedConfigResolver = {
target(value) {
if (value) {
return () => 'current' in value ? value.current : value;
}
return undefined;
},
enabled(value = true) {
return value;
},
window(value = SUPPORT.isBrowser ? window : undefined) {
return value;
},
eventOptions({
passive = true,
capture = false
} = {}) {
return {
passive,
capture
};
},
transform(value) {
return value;
}
};
const _excluded = ["target", "eventOptions", "window", "enabled", "transform"];
function resolveWith(config = {}, resolvers) {
const result = {};
for (const [key, resolver] of Object.entries(resolvers)) {
switch (typeof resolver) {
case 'function':
if (false) {} else {
result[key] = resolver.call(result, config[key], key, config);
}
break;
case 'object':
result[key] = resolveWith(config[key], resolver);
break;
case 'boolean':
if (resolver) result[key] = config[key];
break;
}
}
return result;
}
function use_gesture_core_esm_parse(newConfig, gestureKey, _config = {}) {
const _ref = newConfig,
{
target,
eventOptions,
window,
enabled,
transform
} = _ref,
rest = _objectWithoutProperties(_ref, _excluded);
_config.shared = resolveWith({
target,
eventOptions,
window,
enabled,
transform
}, sharedConfigResolver);
if (gestureKey) {
const resolver = ConfigResolverMap.get(gestureKey);
_config[gestureKey] = resolveWith(_objectSpread2({
shared: _config.shared
}, rest), resolver);
} else {
for (const key in rest) {
const resolver = ConfigResolverMap.get(key);
if (resolver) {
_config[key] = resolveWith(_objectSpread2({
shared: _config.shared
}, rest[key]), resolver);
} else if (false) {}
}
}
return _config;
}
class EventStore {
constructor(ctrl, gestureKey) {
_defineProperty(this, "_listeners", new Set());
this._ctrl = ctrl;
this._gestureKey = gestureKey;
}
add(element, device, action, handler, options) {
const listeners = this._listeners;
const type = toDomEventType(device, action);
const _options = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {};
const eventOptions = _objectSpread2(_objectSpread2({}, _options), options);
element.addEventListener(type, handler, eventOptions);
const remove = () => {
element.removeEventListener(type, handler, eventOptions);
listeners.delete(remove);
};
listeners.add(remove);
return remove;
}
clean() {
this._listeners.forEach(remove => remove());
this._listeners.clear();
}
}
class TimeoutStore {
constructor() {
_defineProperty(this, "_timeouts", new Map());
}
add(key, callback, ms = 140, ...args) {
this.remove(key);
this._timeouts.set(key, window.setTimeout(callback, ms, ...args));
}
remove(key) {
const timeout = this._timeouts.get(key);
if (timeout) window.clearTimeout(timeout);
}
clean() {
this._timeouts.forEach(timeout => void window.clearTimeout(timeout));
this._timeouts.clear();
}
}
class Controller {
constructor(handlers) {
_defineProperty(this, "gestures", new Set());
_defineProperty(this, "_targetEventStore", new EventStore(this));
_defineProperty(this, "gestureEventStores", {});
_defineProperty(this, "gestureTimeoutStores", {});
_defineProperty(this, "handlers", {});
_defineProperty(this, "config", {});
_defineProperty(this, "pointerIds", new Set());
_defineProperty(this, "touchIds", new Set());
_defineProperty(this, "state", {
shared: {
shiftKey: false,
metaKey: false,
ctrlKey: false,
altKey: false
}
});
resolveGestures(this, handlers);
}
setEventIds(event) {
if (isTouch(event)) {
this.touchIds = new Set(touchIds(event));
return this.touchIds;
} else if ('pointerId' in event) {
if (event.type === 'pointerup' || event.type === 'pointercancel') this.pointerIds.delete(event.pointerId);else if (event.type === 'pointerdown') this.pointerIds.add(event.pointerId);
return this.pointerIds;
}
}
applyHandlers(handlers, nativeHandlers) {
this.handlers = handlers;
this.nativeHandlers = nativeHandlers;
}
applyConfig(config, gestureKey) {
this.config = use_gesture_core_esm_parse(config, gestureKey, this.config);
}
clean() {
this._targetEventStore.clean();
for (const key of this.gestures) {
this.gestureEventStores[key].clean();
this.gestureTimeoutStores[key].clean();
}
}
effect() {
if (this.config.shared.target) this.bind();
return () => this._targetEventStore.clean();
}
bind(...args) {
const sharedConfig = this.config.shared;
const props = {};
let target;
if (sharedConfig.target) {
target = sharedConfig.target();
if (!target) return;
}
if (sharedConfig.enabled) {
for (const gestureKey of this.gestures) {
const gestureConfig = this.config[gestureKey];
const bindFunction = bindToProps(props, gestureConfig.eventOptions, !!target);
if (gestureConfig.enabled) {
const Engine = actions_fe213e88_esm_EngineMap.get(gestureKey);
new Engine(this, args, gestureKey).bind(bindFunction);
}
}
const nativeBindFunction = bindToProps(props, sharedConfig.eventOptions, !!target);
for (const eventKey in this.nativeHandlers) {
nativeBindFunction(eventKey, '', event => this.nativeHandlers[eventKey](_objectSpread2(_objectSpread2({}, this.state.shared), {}, {
event,
args
})), undefined, true);
}
}
for (const handlerProp in props) {
props[handlerProp] = actions_fe213e88_esm_chain(...props[handlerProp]);
}
if (!target) return props;
for (const handlerProp in props) {
const {
device,
capture,
passive
} = parseProp(handlerProp);
this._targetEventStore.add(target, device, '', props[handlerProp], {
capture,
passive
});
}
}
}
function use_gesture_core_esm_setupGesture(ctrl, gestureKey) {
ctrl.gestures.add(gestureKey);
ctrl.gestureEventStores[gestureKey] = new EventStore(ctrl, gestureKey);
ctrl.gestureTimeoutStores[gestureKey] = new TimeoutStore();
}
function resolveGestures(ctrl, internalHandlers) {
if (internalHandlers.drag) use_gesture_core_esm_setupGesture(ctrl, 'drag');
if (internalHandlers.wheel) use_gesture_core_esm_setupGesture(ctrl, 'wheel');
if (internalHandlers.scroll) use_gesture_core_esm_setupGesture(ctrl, 'scroll');
if (internalHandlers.move) use_gesture_core_esm_setupGesture(ctrl, 'move');
if (internalHandlers.pinch) use_gesture_core_esm_setupGesture(ctrl, 'pinch');
if (internalHandlers.hover) use_gesture_core_esm_setupGesture(ctrl, 'hover');
}
const bindToProps = (props, eventOptions, withPassiveOption) => (device, action, handler, options = {}, isNative = false) => {
var _options$capture, _options$passive;
const capture = (_options$capture = options.capture) !== null && _options$capture !== void 0 ? _options$capture : eventOptions.capture;
const passive = (_options$passive = options.passive) !== null && _options$passive !== void 0 ? _options$passive : eventOptions.passive;
let handlerProp = isNative ? device : toHandlerProp(device, action, capture);
if (withPassiveOption && passive) handlerProp += 'Passive';
props[handlerProp] = props[handlerProp] || [];
props[handlerProp].push(handler);
};
const RE_NOT_NATIVE = /^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;
function sortHandlers(_handlers) {
const native = {};
const handlers = {};
const actions = new Set();
for (let key in _handlers) {
if (RE_NOT_NATIVE.test(key)) {
actions.add(RegExp.lastMatch);
handlers[key] = _handlers[key];
} else {
native[key] = _handlers[key];
}
}
return [handlers, native, actions];
}
function registerGesture(actions, handlers, handlerKey, key, internalHandlers, config) {
if (!actions.has(handlerKey)) return;
if (!EngineMap.has(key)) {
if (false) {}
return;
}
const startKey = handlerKey + 'Start';
const endKey = handlerKey + 'End';
const fn = state => {
let memo = undefined;
if (state.first && startKey in handlers) handlers[startKey](state);
if (handlerKey in handlers) memo = handlers[handlerKey](state);
if (state.last && endKey in handlers) handlers[endKey](state);
return memo;
};
internalHandlers[key] = fn;
config[key] = config[key] || {};
}
function use_gesture_core_esm_parseMergedHandlers(mergedHandlers, mergedConfig) {
const [handlers, nativeHandlers, actions] = sortHandlers(mergedHandlers);
const internalHandlers = {};
registerGesture(actions, handlers, 'onDrag', 'drag', internalHandlers, mergedConfig);
registerGesture(actions, handlers, 'onWheel', 'wheel', internalHandlers, mergedConfig);
registerGesture(actions, handlers, 'onScroll', 'scroll', internalHandlers, mergedConfig);
registerGesture(actions, handlers, 'onPinch', 'pinch', internalHandlers, mergedConfig);
registerGesture(actions, handlers, 'onMove', 'move', internalHandlers, mergedConfig);
registerGesture(actions, handlers, 'onHover', 'hover', internalHandlers, mergedConfig);
return {
handlers: internalHandlers,
config: mergedConfig,
nativeHandlers
};
}
;// ./node_modules/@use-gesture/react/dist/use-gesture-react.esm.js
function useRecognizers(handlers, config = {}, gestureKey, nativeHandlers) {
const ctrl = external_React_default().useMemo(() => new Controller(handlers), []);
ctrl.applyHandlers(handlers, nativeHandlers);
ctrl.applyConfig(config, gestureKey);
external_React_default().useEffect(ctrl.effect.bind(ctrl));
external_React_default().useEffect(() => {
return ctrl.clean.bind(ctrl);
}, []);
if (config.target === undefined) {
return ctrl.bind.bind(ctrl);
}
return undefined;
}
function useDrag(handler, config) {
actions_fe213e88_esm_registerAction(actions_fe213e88_esm_dragAction);
return useRecognizers({
drag: handler
}, config || {}, 'drag');
}
function usePinch(handler, config) {
registerAction(pinchAction);
return useRecognizers({
pinch: handler
}, config || {}, 'pinch');
}
function useWheel(handler, config) {
registerAction(wheelAction);
return useRecognizers({
wheel: handler
}, config || {}, 'wheel');
}
function useScroll(handler, config) {
registerAction(scrollAction);
return useRecognizers({
scroll: handler
}, config || {}, 'scroll');
}
function useMove(handler, config) {
registerAction(moveAction);
return useRecognizers({
move: handler
}, config || {}, 'move');
}
function useHover(handler, config) {
registerAction(hoverAction);
return useRecognizers({
hover: handler
}, config || {}, 'hover');
}
function createUseGesture(actions) {
actions.forEach(registerAction);
return function useGesture(_handlers, _config) {
const {
handlers,
nativeHandlers,
config
} = parseMergedHandlers(_handlers, _config || {});
return useRecognizers(handlers, config, undefined, nativeHandlers);
};
}
function useGesture(handlers, config) {
const hook = createUseGesture([dragAction, pinchAction, scrollAction, wheelAction, moveAction, hoverAction]);
return hook(handlers, config || {});
}
;// ./node_modules/@wordpress/components/build-module/input-control/utils.js
function getDragCursor(dragDirection) {
let dragCursor = "ns-resize";
switch (dragDirection) {
case "n":
case "s":
dragCursor = "ns-resize";
break;
case "e":
case "w":
dragCursor = "ew-resize";
break;
}
return dragCursor;
}
function useDragCursor(isDragging, dragDirection) {
const dragCursor = getDragCursor(dragDirection);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (isDragging) {
document.documentElement.style.cursor = dragCursor;
} else {
document.documentElement.style.cursor = null;
}
}, [isDragging, dragCursor]);
return dragCursor;
}
function useDraft(props) {
const previousValueRef = (0,external_wp_element_namespaceObject.useRef)(props.value);
const [draft, setDraft] = (0,external_wp_element_namespaceObject.useState)({});
const value = draft.value !== void 0 ? draft.value : props.value;
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
const {
current: previousValue
} = previousValueRef;
previousValueRef.current = props.value;
if (draft.value !== void 0 && !draft.isStale) {
setDraft({
...draft,
isStale: true
});
} else if (draft.isStale && props.value !== previousValue) {
setDraft({});
}
}, [props.value, draft]);
const onChange = (nextValue, extra) => {
setDraft((current) => Object.assign(current, {
value: nextValue,
isStale: false
}));
props.onChange(nextValue, extra);
};
const onBlur = (event) => {
setDraft({});
props.onBlur?.(event);
};
return {
value,
onBlur,
onChange
};
}
;// ./node_modules/@wordpress/components/build-module/input-control/reducer/state.js
const initialStateReducer = (state) => state;
const initialInputControlState = {
error: null,
initialValue: "",
isDirty: false,
isDragEnabled: false,
isDragging: false,
isPressEnterToChange: false,
value: ""
};
;// ./node_modules/@wordpress/components/build-module/input-control/reducer/actions.js
const CHANGE = "CHANGE";
const COMMIT = "COMMIT";
const CONTROL = "CONTROL";
const DRAG_END = "DRAG_END";
const DRAG_START = "DRAG_START";
const DRAG = "DRAG";
const INVALIDATE = "INVALIDATE";
const PRESS_DOWN = "PRESS_DOWN";
const PRESS_ENTER = "PRESS_ENTER";
const PRESS_UP = "PRESS_UP";
const RESET = "RESET";
;// ./node_modules/@wordpress/components/build-module/input-control/reducer/reducer.js
function mergeInitialState(initialState = initialInputControlState) {
const {
value
} = initialState;
return {
...initialInputControlState,
...initialState,
initialValue: value
};
}
function inputControlStateReducer(composedStateReducers) {
return (state, action) => {
const nextState = {
...state
};
switch (action.type) {
/*
* Controlled updates
*/
case CONTROL:
nextState.value = action.payload.value;
nextState.isDirty = false;
nextState._event = void 0;
return nextState;
/**
* Keyboard events
*/
case PRESS_UP:
nextState.isDirty = false;
break;
case PRESS_DOWN:
nextState.isDirty = false;
break;
/**
* Drag events
*/
case DRAG_START:
nextState.isDragging = true;
break;
case DRAG_END:
nextState.isDragging = false;
break;
/**
* Input events
*/
case CHANGE:
nextState.error = null;
nextState.value = action.payload.value;
if (state.isPressEnterToChange) {
nextState.isDirty = true;
}
break;
case COMMIT:
nextState.value = action.payload.value;
nextState.isDirty = false;
break;
case RESET:
nextState.error = null;
nextState.isDirty = false;
nextState.value = action.payload.value || state.initialValue;
break;
/**
* Validation
*/
case INVALIDATE:
nextState.error = action.payload.error;
break;
}
nextState._event = action.payload.event;
return composedStateReducers(nextState, action);
};
}
function useInputControlStateReducer(stateReducer = initialStateReducer, initialState = initialInputControlState, onChangeHandler) {
const [state, dispatch] = (0,external_wp_element_namespaceObject.useReducer)(inputControlStateReducer(stateReducer), mergeInitialState(initialState));
const createChangeEvent = (type) => (nextValue, event) => {
dispatch({
type,
payload: {
value: nextValue,
event
}
});
};
const createKeyEvent = (type) => (event) => {
dispatch({
type,
payload: {
event
}
});
};
const createDragEvent = (type) => (payload) => {
dispatch({
type,
payload
});
};
const change = createChangeEvent(CHANGE);
const invalidate = (error, event) => dispatch({
type: INVALIDATE,
payload: {
error,
event
}
});
const reset = createChangeEvent(RESET);
const commit = createChangeEvent(COMMIT);
const dragStart = createDragEvent(DRAG_START);
const drag = createDragEvent(DRAG);
const dragEnd = createDragEvent(DRAG_END);
const pressUp = createKeyEvent(PRESS_UP);
const pressDown = createKeyEvent(PRESS_DOWN);
const pressEnter = createKeyEvent(PRESS_ENTER);
const currentStateRef = (0,external_wp_element_namespaceObject.useRef)(state);
const refPropsRef = (0,external_wp_element_namespaceObject.useRef)({
value: initialState.value,
onChangeHandler
});
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
currentStateRef.current = state;
refPropsRef.current = {
value: initialState.value,
onChangeHandler
};
});
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (currentStateRef.current._event !== void 0 && state.value !== refPropsRef.current.value && !state.isDirty) {
var _state$value;
refPropsRef.current.onChangeHandler((_state$value = state.value) !== null && _state$value !== void 0 ? _state$value : "", {
event: currentStateRef.current._event
});
}
}, [state.value, state.isDirty]);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (initialState.value !== currentStateRef.current.value && !currentStateRef.current.isDirty) {
var _initialState$value;
dispatch({
type: CONTROL,
payload: {
value: (_initialState$value = initialState.value) !== null && _initialState$value !== void 0 ? _initialState$value : ""
}
});
}
}, [initialState.value]);
return {
change,
commit,
dispatch,
drag,
dragEnd,
dragStart,
invalidate,
pressDown,
pressEnter,
pressUp,
reset,
state
};
}
;// ./node_modules/@wordpress/components/build-module/utils/with-ignore-ime-events.js
function withIgnoreIMEEvents(handler) {
return (event) => {
const {
isComposing
} = "nativeEvent" in event ? event.nativeEvent : event;
if (isComposing || // Workaround for Mac Safari where the final Enter/Backspace of an IME composition
// is `isComposing=false`, even though it's technically still part of the composition.
// These can only be detected by keyCode.
event.keyCode === 229) {
return;
}
handler(event);
};
}
;// ./node_modules/@wordpress/components/build-module/input-control/input-field.js
const input_field_noop = () => {
};
function InputField({
disabled = false,
dragDirection = "n",
dragThreshold = 10,
id,
isDragEnabled = false,
isPressEnterToChange = false,
onBlur = input_field_noop,
onChange = input_field_noop,
onDrag = input_field_noop,
onDragEnd = input_field_noop,
onDragStart = input_field_noop,
onKeyDown = input_field_noop,
onValidate = input_field_noop,
size = "default",
stateReducer = (state) => state,
value: valueProp,
type,
...props
}, ref) {
const {
// State.
state,
// Actions.
change,
commit,
drag,
dragEnd,
dragStart,
invalidate,
pressDown,
pressEnter,
pressUp,
reset
} = useInputControlStateReducer(stateReducer, {
isDragEnabled,
value: valueProp,
isPressEnterToChange
}, onChange);
const {
value,
isDragging,
isDirty
} = state;
const wasDirtyOnBlur = (0,external_wp_element_namespaceObject.useRef)(false);
const dragCursor = useDragCursor(isDragging, dragDirection);
const handleOnBlur = (event) => {
onBlur(event);
if (isDirty || !event.target.validity.valid) {
wasDirtyOnBlur.current = true;
handleOnCommit(event);
}
};
const handleOnChange = (event) => {
const nextValue = event.target.value;
change(nextValue, event);
};
const handleOnCommit = (event) => {
const nextValue = event.currentTarget.value;
try {
onValidate(nextValue);
commit(nextValue, event);
} catch (err) {
invalidate(err, event);
}
};
const handleOnKeyDown = (event) => {
const {
key
} = event;
onKeyDown(event);
switch (key) {
case "ArrowUp":
pressUp(event);
break;
case "ArrowDown":
pressDown(event);
break;
case "Enter":
pressEnter(event);
if (isPressEnterToChange) {
event.preventDefault();
handleOnCommit(event);
}
break;
case "Escape":
if (isPressEnterToChange && isDirty) {
event.preventDefault();
reset(valueProp, event);
}
break;
}
};
const dragGestureProps = useDrag((dragProps2) => {
const {
distance,
dragging,
event,
target
} = dragProps2;
dragProps2.event = {
...dragProps2.event,
target
};
if (!distance) {
return;
}
event.stopPropagation();
if (!dragging) {
onDragEnd(dragProps2);
dragEnd(dragProps2);
return;
}
onDrag(dragProps2);
drag(dragProps2);
if (!isDragging) {
onDragStart(dragProps2);
dragStart(dragProps2);
}
}, {
axis: dragDirection === "e" || dragDirection === "w" ? "x" : "y",
threshold: dragThreshold,
enabled: isDragEnabled,
pointer: {
capture: false
}
});
const dragProps = isDragEnabled ? dragGestureProps() : {};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Input, {
...props,
...dragProps,
className: "components-input-control__input",
disabled,
dragCursor,
isDragging,
id,
onBlur: handleOnBlur,
onChange: handleOnChange,
onKeyDown: withIgnoreIMEEvents(handleOnKeyDown),
ref,
inputSize: size,
value: value !== null && value !== void 0 ? value : "",
type
});
}
const ForwardedComponent = (0,external_wp_element_namespaceObject.forwardRef)(InputField);
var input_field_default = ForwardedComponent;
;// ./node_modules/@wordpress/components/build-module/utils/font-values.js
var font_values_default = {
"default.fontFamily": "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif",
"default.fontSize": "13px",
"helpText.fontSize": "12px",
mobileTextMinFontSize: "16px"
};
;// ./node_modules/@wordpress/components/build-module/utils/font.js
function font(value) {
var _FONT$value;
return (_FONT$value = font_values_default[value]) !== null && _FONT$value !== void 0 ? _FONT$value : "";
}
;// ./node_modules/@wordpress/components/build-module/utils/box-sizing.js
function box_sizing_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const boxSizingReset = true ? {
name: "kv6lnz",
styles: "box-sizing:border-box;*,*::before,*::after{box-sizing:inherit;}"
} : 0;
;// ./node_modules/@wordpress/components/build-module/base-control/styles/base-control-styles.js
function base_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const Wrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "ej5x27r4"
} : 0)("font-family:", font("default.fontFamily"), ";font-size:", font("default.fontSize"), ";", boxSizingReset, ";" + ( true ? "" : 0));
const deprecatedMarginField = ({
__nextHasNoMarginBottom = false
}) => {
return !__nextHasNoMarginBottom && /* @__PURE__ */ emotion_react_browser_esm_css("margin-bottom:", space(2), ";" + ( true ? "" : 0), true ? "" : 0);
};
const StyledField = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "ej5x27r3"
} : 0)(deprecatedMarginField, " .components-panel__row &{margin-bottom:inherit;}" + ( true ? "" : 0));
const labelStyles = /* @__PURE__ */ emotion_react_browser_esm_css(baseLabelTypography, ";display:block;margin-bottom:", space(2), ";padding:0;" + ( true ? "" : 0), true ? "" : 0);
const StyledLabel = /* @__PURE__ */ emotion_styled_base_browser_esm("label", true ? {
target: "ej5x27r2"
} : 0)(labelStyles, ";" + ( true ? "" : 0));
var base_control_styles_ref = true ? {
name: "11yad0w",
styles: "margin-bottom:revert"
} : 0;
const deprecatedMarginHelp = ({
__nextHasNoMarginBottom = false
}) => {
return !__nextHasNoMarginBottom && base_control_styles_ref;
};
const StyledHelp = /* @__PURE__ */ emotion_styled_base_browser_esm("p", true ? {
target: "ej5x27r1"
} : 0)("margin-top:", space(2), ";margin-bottom:0;font-size:", font("helpText.fontSize"), ";font-style:normal;color:", COLORS.gray[700], ";", deprecatedMarginHelp, ";" + ( true ? "" : 0));
const StyledVisualLabel = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "ej5x27r0"
} : 0)(labelStyles, ";" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/base-control/index.js
const UnconnectedBaseControl = (props) => {
const {
__nextHasNoMarginBottom = false,
__associatedWPComponentName = "BaseControl",
id,
label,
hideLabelFromVision = false,
help,
className,
children
} = useContextSystem(props, "BaseControl");
if (!__nextHasNoMarginBottom) {
external_wp_deprecated_default()(`Bottom margin styles for wp.components.${__associatedWPComponentName}`, {
since: "6.7",
version: "7.0",
hint: "Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Wrapper, {
className,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(StyledField, {
className: "components-base-control__field",
__nextHasNoMarginBottom,
children: [label && id && (hideLabelFromVision ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
as: "label",
htmlFor: id,
children: label
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledLabel, {
className: "components-base-control__label",
htmlFor: id,
children: label
})), label && !id && (hideLabelFromVision ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
as: "label",
children: label
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(VisualLabel, {
children: label
})), children]
}), !!help && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledHelp, {
id: id ? id + "__help" : void 0,
className: "components-base-control__help",
__nextHasNoMarginBottom,
children: help
})]
});
};
const UnforwardedVisualLabel = (props, ref) => {
const {
className,
children,
...restProps
} = props;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledVisualLabel, {
ref,
...restProps,
className: dist_clsx("components-base-control__label", className),
children
});
};
const VisualLabel = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedVisualLabel);
const BaseControl = Object.assign(contextConnectWithoutRef(UnconnectedBaseControl, "BaseControl"), {
/**
* `BaseControl.VisualLabel` is used to render a purely visual label inside a `BaseControl` component.
*
* It should only be used in cases where the children being rendered inside `BaseControl` are already accessibly labeled,
* e.g., a button, but we want an additional visual label for that section equivalent to the labels `BaseControl` would
* otherwise use if the `label` prop was passed.
*
* ```jsx
* import { BaseControl } from '@wordpress/components';
*
* const MyBaseControl = () => (
* <BaseControl
* __nextHasNoMarginBottom
* help="This button is already accessibly labeled."
* >
* <BaseControl.VisualLabel>Author</BaseControl.VisualLabel>
* <Button>Select an author</Button>
* </BaseControl>
* );
* ```
*/
VisualLabel
});
var base_control_default = BaseControl;
;// ./node_modules/@wordpress/components/build-module/utils/deprecated-36px-size.js
function maybeWarnDeprecated36pxSize({
componentName,
__next40pxDefaultSize,
size,
__shouldNotWarnDeprecated36pxSize
}) {
if (__shouldNotWarnDeprecated36pxSize || __next40pxDefaultSize || size !== void 0 && size !== "default") {
return;
}
external_wp_deprecated_default()(`36px default size for wp.components.${componentName}`, {
since: "6.8",
version: "7.1",
hint: "Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."
});
}
;// ./node_modules/@wordpress/components/build-module/input-control/index.js
const input_control_noop = () => {
};
function input_control_useUniqueId(idProp) {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(InputControl);
const id = `inspector-input-control-${instanceId}`;
return idProp || id;
}
function UnforwardedInputControl(props, ref) {
const {
__next40pxDefaultSize,
__shouldNotWarnDeprecated36pxSize,
__unstableStateReducer: stateReducer = (state) => state,
__unstableInputWidth,
className,
disabled = false,
help,
hideLabelFromVision = false,
id: idProp,
isPressEnterToChange = false,
label,
labelPosition = "top",
onChange = input_control_noop,
onValidate = input_control_noop,
onKeyDown = input_control_noop,
prefix,
size = "default",
style,
suffix,
value,
...restProps
} = useDeprecated36pxDefaultSizeProp(props);
const id = input_control_useUniqueId(idProp);
const classes = dist_clsx("components-input-control", className);
const draftHookProps = useDraft({
value,
onBlur: restProps.onBlur,
onChange
});
const helpProp = !!help ? {
"aria-describedby": `${id}__help`
} : {};
maybeWarnDeprecated36pxSize({
componentName: "InputControl",
__next40pxDefaultSize,
size,
__shouldNotWarnDeprecated36pxSize
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default, {
className: classes,
help,
id,
__nextHasNoMarginBottom: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(input_base_default, {
__next40pxDefaultSize,
__unstableInputWidth,
disabled,
gap: 3,
hideLabelFromVision,
id,
justify: "left",
label,
labelPosition,
prefix,
size,
style,
suffix,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(input_field_default, {
...restProps,
...helpProp,
__next40pxDefaultSize,
className: "components-input-control__input",
disabled,
id,
isPressEnterToChange,
onKeyDown,
onValidate,
paddingInlineStart: prefix ? space(1) : void 0,
paddingInlineEnd: suffix ? space(1) : void 0,
ref,
size,
stateReducer,
...draftHookProps
})
})
});
}
const InputControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedInputControl);
var input_control_default = InputControl;
;// ./node_modules/@wordpress/components/build-module/dashicon/index.js
function Dashicon({
icon,
className,
size = 20,
style = {},
...extraProps
}) {
const iconClass = ["dashicon", "dashicons", "dashicons-" + icon, className].filter(Boolean).join(" ");
const sizeStyles = (
// using `!=` to catch both 20 and "20"
// eslint-disable-next-line eqeqeq
20 != size ? {
fontSize: `${size}px`,
width: `${size}px`,
height: `${size}px`
} : {}
);
const styles = {
...sizeStyles,
...style
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: iconClass,
style: styles,
...extraProps
});
}
var dashicon_default = Dashicon;
;// ./node_modules/@wordpress/components/build-module/icon/index.js
function Icon({
icon = null,
size = "string" === typeof icon ? 20 : 24,
...additionalProps
}) {
if ("string" === typeof icon) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dashicon_default, {
icon,
size,
...additionalProps
});
}
if ((0,external_wp_element_namespaceObject.isValidElement)(icon) && dashicon_default === icon.type) {
return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
...additionalProps
});
}
if ("function" === typeof icon) {
return (0,external_wp_element_namespaceObject.createElement)(icon, {
size,
...additionalProps
});
}
if (icon && (icon.type === "svg" || icon.type === external_wp_primitives_namespaceObject.SVG)) {
const appliedProps = {
...icon.props,
width: size,
height: size,
...additionalProps
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
...appliedProps
});
}
if ((0,external_wp_element_namespaceObject.isValidElement)(icon)) {
return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
// @ts-ignore Just forwarding the size prop along
size,
width: size,
height: size,
...additionalProps
});
}
return icon;
}
var icon_icon_default = Icon;
;// ./node_modules/@wordpress/components/build-module/button/index.js
const disabledEventsOnDisabledButton = ["onMouseDown", "onClick"];
function button_useDeprecatedProps({
__experimentalIsFocusable,
isDefault,
isPrimary,
isSecondary,
isTertiary,
isLink,
isPressed,
isSmall,
size,
variant,
describedBy,
...otherProps
}) {
let computedSize = size;
let computedVariant = variant;
const newProps = {
accessibleWhenDisabled: __experimentalIsFocusable,
// @todo Mark `isPressed` as deprecated
"aria-pressed": isPressed,
description: describedBy
};
if (isSmall) {
var _computedSize;
(_computedSize = computedSize) !== null && _computedSize !== void 0 ? _computedSize : computedSize = "small";
}
if (isPrimary) {
var _computedVariant;
(_computedVariant = computedVariant) !== null && _computedVariant !== void 0 ? _computedVariant : computedVariant = "primary";
}
if (isTertiary) {
var _computedVariant2;
(_computedVariant2 = computedVariant) !== null && _computedVariant2 !== void 0 ? _computedVariant2 : computedVariant = "tertiary";
}
if (isSecondary) {
var _computedVariant3;
(_computedVariant3 = computedVariant) !== null && _computedVariant3 !== void 0 ? _computedVariant3 : computedVariant = "secondary";
}
if (isDefault) {
var _computedVariant4;
external_wp_deprecated_default()("wp.components.Button `isDefault` prop", {
since: "5.4",
alternative: 'variant="secondary"'
});
(_computedVariant4 = computedVariant) !== null && _computedVariant4 !== void 0 ? _computedVariant4 : computedVariant = "secondary";
}
if (isLink) {
var _computedVariant5;
(_computedVariant5 = computedVariant) !== null && _computedVariant5 !== void 0 ? _computedVariant5 : computedVariant = "link";
}
return {
...newProps,
...otherProps,
size: computedSize,
variant: computedVariant
};
}
function UnforwardedButton(props, ref) {
const {
__next40pxDefaultSize,
accessibleWhenDisabled,
isBusy,
isDestructive,
className,
disabled,
icon,
iconPosition = "left",
iconSize,
showTooltip,
tooltipPosition,
shortcut,
label,
children,
size = "default",
text,
variant,
description,
...buttonOrAnchorProps
} = button_useDeprecatedProps(props);
const {
href,
target,
"aria-checked": ariaChecked,
"aria-pressed": ariaPressed,
"aria-selected": ariaSelected,
...additionalProps
} = "href" in buttonOrAnchorProps ? buttonOrAnchorProps : {
href: void 0,
target: void 0,
...buttonOrAnchorProps
};
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(Button, "components-button__description");
const hasChildren = "string" === typeof children && !!children || Array.isArray(children) && children?.[0] && children[0] !== null && // Tooltip should not considered as a child
children?.[0]?.props?.className !== "components-tooltip";
const truthyAriaPressedValues = [true, "true", "mixed"];
const classes = dist_clsx("components-button", className, {
"is-next-40px-default-size": __next40pxDefaultSize,
"is-secondary": variant === "secondary",
"is-primary": variant === "primary",
"is-small": size === "small",
"is-compact": size === "compact",
"is-tertiary": variant === "tertiary",
"is-pressed": truthyAriaPressedValues.includes(ariaPressed),
"is-pressed-mixed": ariaPressed === "mixed",
"is-busy": isBusy,
"is-link": variant === "link",
"is-destructive": isDestructive,
"has-text": !!icon && (hasChildren || text),
"has-icon": !!icon,
"has-icon-right": iconPosition === "right"
});
const trulyDisabled = disabled && !accessibleWhenDisabled;
const Tag = href !== void 0 && !disabled ? "a" : "button";
const buttonProps = Tag === "button" ? {
type: "button",
disabled: trulyDisabled,
"aria-checked": ariaChecked,
"aria-pressed": ariaPressed,
"aria-selected": ariaSelected
} : {};
const anchorProps = Tag === "a" ? {
href,
target
} : {};
const disableEventProps = {};
if (disabled && accessibleWhenDisabled) {
buttonProps["aria-disabled"] = true;
anchorProps["aria-disabled"] = true;
for (const disabledEvent of disabledEventsOnDisabledButton) {
disableEventProps[disabledEvent] = (event) => {
if (event) {
event.stopPropagation();
event.preventDefault();
}
};
}
}
const shouldShowTooltip = !trulyDisabled && // An explicit tooltip is passed or...
(showTooltip && !!label || // There's a shortcut or...
!!shortcut || // There's a label and...
!!label && // The children are empty and...
!children?.length && // The tooltip is not explicitly disabled.
false !== showTooltip);
const descriptionId = description ? instanceId : void 0;
const describedById = additionalProps["aria-describedby"] || descriptionId;
const commonProps = {
className: classes,
"aria-label": additionalProps["aria-label"] || label,
"aria-describedby": describedById,
ref
};
const elementChildren = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [icon && iconPosition === "left" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
icon,
size: iconSize
}), text && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: text
}), children, icon && iconPosition === "right" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
icon,
size: iconSize
})]
});
const element = Tag === "a" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
...anchorProps,
...additionalProps,
...disableEventProps,
...commonProps,
children: elementChildren
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("button", {
...buttonProps,
...additionalProps,
...disableEventProps,
...commonProps,
children: elementChildren
});
const tooltipProps = shouldShowTooltip ? {
text: children?.length && description ? description : label,
shortcut,
placement: tooltipPosition && // Convert legacy `position` values to be used with the new `placement` prop
positionToPlacement(tooltipPosition)
} : {};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip_default, {
...tooltipProps,
children: element
}), description && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
id: descriptionId,
children: description
})
})]
});
}
const Button = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedButton);
var button_default = Button;
;// ./node_modules/@wordpress/components/build-module/number-control/styles/number-control-styles.js
function number_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var number_control_styles_ref = true ? {
name: "euqsgg",
styles: "input[type='number']::-webkit-outer-spin-button,input[type='number']::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}input[type='number']{-moz-appearance:textfield;}"
} : 0;
const htmlArrowStyles = ({
hideHTMLArrows
}) => {
if (!hideHTMLArrows) {
return ``;
}
return number_control_styles_ref;
};
const number_control_styles_Input = /* @__PURE__ */ emotion_styled_base_browser_esm(input_control_default, true ? {
target: "ep09it41"
} : 0)(htmlArrowStyles, ";" + ( true ? "" : 0));
const SpinButton = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
target: "ep09it40"
} : 0)("&&&&&{color:", COLORS.theme.accent, ";}" + ( true ? "" : 0));
const smallSpinButtons = /* @__PURE__ */ emotion_react_browser_esm_css("width:", space(5), ";min-width:", space(5), ";height:", space(5), ";" + ( true ? "" : 0), true ? "" : 0);
const styles = {
smallSpinButtons
};
;// ./node_modules/@wordpress/components/build-module/utils/math.js
function getNumber(value) {
const number = Number(value);
return isNaN(number) ? 0 : number;
}
function add(...args) {
return args.reduce(
/** @type {(sum:number, arg: number|string) => number} */
(sum, arg) => sum + getNumber(arg),
0
);
}
function subtract(...args) {
return args.reduce(
/** @type {(diff:number, arg: number|string, index:number) => number} */
(diff, arg, index) => {
const value = getNumber(arg);
return index === 0 ? value : diff - value;
},
0
);
}
function getPrecision(value) {
const split = (value + "").split(".");
return split[1] !== void 0 ? split[1].length : 0;
}
function math_clamp(value, min, max) {
const baseValue = getNumber(value);
return Math.max(min, Math.min(baseValue, max));
}
function ensureValidStep(value, min, step) {
const baseValue = getNumber(value);
const minValue = getNumber(min);
const stepValue = getNumber(step);
const precision = Math.max(getPrecision(step), getPrecision(min));
const tare = minValue % stepValue ? minValue : 0;
const rounded = Math.round((baseValue - tare) / stepValue) * stepValue;
const fromMin = rounded + tare;
return precision ? getNumber(fromMin.toFixed(precision)) : fromMin;
}
;// ./node_modules/@wordpress/components/build-module/h-stack/utils.js
const H_ALIGNMENTS = {
bottom: {
align: "flex-end",
justify: "center"
},
bottomLeft: {
align: "flex-end",
justify: "flex-start"
},
bottomRight: {
align: "flex-end",
justify: "flex-end"
},
center: {
align: "center",
justify: "center"
},
edge: {
align: "center",
justify: "space-between"
},
left: {
align: "center",
justify: "flex-start"
},
right: {
align: "center",
justify: "flex-end"
},
stretch: {
align: "stretch"
},
top: {
align: "flex-start",
justify: "center"
},
topLeft: {
align: "flex-start",
justify: "flex-start"
},
topRight: {
align: "flex-start",
justify: "flex-end"
}
};
const V_ALIGNMENTS = {
bottom: {
justify: "flex-end",
align: "center"
},
bottomLeft: {
justify: "flex-end",
align: "flex-start"
},
bottomRight: {
justify: "flex-end",
align: "flex-end"
},
center: {
justify: "center",
align: "center"
},
edge: {
justify: "space-between",
align: "center"
},
left: {
justify: "center",
align: "flex-start"
},
right: {
justify: "center",
align: "flex-end"
},
stretch: {
align: "stretch"
},
top: {
justify: "flex-start",
align: "center"
},
topLeft: {
justify: "flex-start",
align: "flex-start"
},
topRight: {
justify: "flex-start",
align: "flex-end"
}
};
function getAlignmentProps(alignment, direction = "row") {
if (!isValueDefined(alignment)) {
return {};
}
const isVertical = direction === "column";
const props = isVertical ? V_ALIGNMENTS : H_ALIGNMENTS;
const alignmentProps = alignment in props ? props[alignment] : {
align: alignment
};
return alignmentProps;
}
;// ./node_modules/@wordpress/components/build-module/utils/get-valid-children.js
function getValidChildren(children) {
if (typeof children === "string") {
return [children];
}
return external_wp_element_namespaceObject.Children.toArray(children).filter((child) => (0,external_wp_element_namespaceObject.isValidElement)(child));
}
;// ./node_modules/@wordpress/components/build-module/h-stack/hook.js
function useHStack(props) {
const {
alignment = "edge",
children,
direction,
spacing = 2,
...otherProps
} = useContextSystem(props, "HStack");
const align = getAlignmentProps(alignment, direction);
const validChildren = getValidChildren(children);
const clonedChildren = validChildren.map((child, index) => {
const _isSpacer = hasConnectNamespace(child, ["Spacer"]);
if (_isSpacer) {
const childElement = child;
const _key = childElement.key || `hstack-${index}`;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_item_component_component_default, {
isBlock: true,
...childElement.props
}, _key);
}
return child;
});
const propsForFlex = {
children: clonedChildren,
direction,
justify: "center",
...align,
...otherProps,
gap: spacing
};
const {
isColumn,
...flexProps
} = useFlex(propsForFlex);
return flexProps;
}
;// ./node_modules/@wordpress/components/build-module/h-stack/component.js
function UnconnectedHStack(props, forwardedRef) {
const hStackProps = useHStack(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...hStackProps,
ref: forwardedRef
});
}
const HStack = contextConnect(UnconnectedHStack, "HStack");
var h_stack_component_component_default = HStack;
;// ./node_modules/@wordpress/components/build-module/number-control/index.js
const number_control_noop = () => {
};
function UnforwardedNumberControl(props, forwardedRef) {
const {
__unstableStateReducer: stateReducerProp,
className,
dragDirection = "n",
hideHTMLArrows = false,
spinControls = hideHTMLArrows ? "none" : "native",
isDragEnabled = true,
isShiftStepEnabled = true,
label,
max = Infinity,
min = -Infinity,
required = false,
shiftStep = 10,
step = 1,
spinFactor = 1,
type: typeProp = "number",
value: valueProp,
size = "default",
suffix,
onChange = number_control_noop,
__shouldNotWarnDeprecated36pxSize,
...restProps
} = useDeprecated36pxDefaultSizeProp(props);
maybeWarnDeprecated36pxSize({
componentName: "NumberControl",
size,
__next40pxDefaultSize: restProps.__next40pxDefaultSize,
__shouldNotWarnDeprecated36pxSize
});
if (hideHTMLArrows) {
external_wp_deprecated_default()("wp.components.NumberControl hideHTMLArrows prop ", {
alternative: 'spinControls="none"',
since: "6.2",
version: "6.3"
});
}
const inputRef = (0,external_wp_element_namespaceObject.useRef)();
const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([inputRef, forwardedRef]);
const isStepAny = step === "any";
const baseStep = isStepAny ? 1 : ensureNumber(step);
const baseSpin = ensureNumber(spinFactor) * baseStep;
const constrainValue = (value, stepOverride) => {
if (!isStepAny) {
value = ensureValidStep(value, min, stepOverride !== null && stepOverride !== void 0 ? stepOverride : baseStep);
}
return `${math_clamp(value, min, max)}`;
};
const baseValue = constrainValue(0);
const autoComplete = typeProp === "number" ? "off" : void 0;
const classes = dist_clsx("components-number-control", className);
const cx = useCx();
const spinButtonClasses = cx(size === "small" && styles.smallSpinButtons);
const spinValue = (value, direction, event) => {
event?.preventDefault();
const shift = event?.shiftKey && isShiftStepEnabled;
const delta = shift ? ensureNumber(shiftStep) * baseSpin : baseSpin;
let nextValue = isValueEmpty(value) ? baseValue : value;
if (direction === "up") {
nextValue = add(nextValue, delta);
} else if (direction === "down") {
nextValue = subtract(nextValue, delta);
}
return constrainValue(nextValue, shift ? delta : void 0);
};
const numberControlStateReducer = (state, action) => {
const nextState = {
...state
};
const {
type,
payload
} = action;
const event = payload.event;
const currentValue = nextState.value;
if (type === PRESS_UP || type === PRESS_DOWN) {
nextState.value = spinValue(currentValue, type === PRESS_UP ? "up" : "down", event);
}
if (type === DRAG && isDragEnabled) {
const [x, y] = payload.delta;
const enableShift = payload.shiftKey && isShiftStepEnabled;
const modifier = enableShift ? ensureNumber(shiftStep) * baseSpin : baseSpin;
let directionModifier;
let delta;
switch (dragDirection) {
case "n":
delta = y;
directionModifier = -1;
break;
case "e":
delta = x;
directionModifier = (0,external_wp_i18n_namespaceObject.isRTL)() ? -1 : 1;
break;
case "s":
delta = y;
directionModifier = 1;
break;
case "w":
delta = x;
directionModifier = (0,external_wp_i18n_namespaceObject.isRTL)() ? 1 : -1;
break;
}
if (delta !== 0) {
delta = Math.ceil(Math.abs(delta)) * Math.sign(delta);
const distance = delta * modifier * directionModifier;
nextState.value = constrainValue(
// @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined
add(currentValue, distance),
enableShift ? modifier : void 0
);
}
}
if (type === PRESS_ENTER || type === COMMIT) {
const applyEmptyValue = required === false && currentValue === "";
nextState.value = applyEmptyValue ? currentValue : (
// @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined
constrainValue(currentValue)
);
}
return nextState;
};
const buildSpinButtonClickHandler = (direction) => (event) => onChange(String(spinValue(valueProp, direction, event)), {
// Set event.target to the <input> so that consumers can use
// e.g. event.target.validity.
event: {
...event,
target: inputRef.current
}
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(number_control_styles_Input, {
autoComplete,
inputMode: "numeric",
...restProps,
className: classes,
dragDirection,
hideHTMLArrows: spinControls !== "native",
isDragEnabled,
label,
max: max === Infinity ? void 0 : max,
min: min === -Infinity ? void 0 : min,
ref: mergedRef,
required,
step,
type: typeProp,
value: valueProp,
__unstableStateReducer: (state, action) => {
var _stateReducerProp;
const baseState = numberControlStateReducer(state, action);
return (_stateReducerProp = stateReducerProp?.(baseState, action)) !== null && _stateReducerProp !== void 0 ? _stateReducerProp : baseState;
},
size,
__shouldNotWarnDeprecated36pxSize: true,
suffix: spinControls === "custom" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [suffix, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {
marginBottom: 0,
marginRight: 2,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
spacing: 1,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SpinButton, {
className: spinButtonClasses,
icon: plus_default,
size: "small",
label: (0,external_wp_i18n_namespaceObject.__)("Increment"),
onClick: buildSpinButtonClickHandler("up")
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SpinButton, {
className: spinButtonClasses,
icon: reset_default,
size: "small",
label: (0,external_wp_i18n_namespaceObject.__)("Decrement"),
onClick: buildSpinButtonClickHandler("down")
})]
})
})]
}) : suffix,
onChange
});
}
const NumberControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedNumberControl);
var number_control_default = NumberControl;
;// ./node_modules/@wordpress/components/build-module/angle-picker-control/styles/angle-picker-control-styles.js
function angle_picker_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const CIRCLE_SIZE = 32;
const INNER_CIRCLE_SIZE = 6;
const CircleRoot = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "eln3bjz3"
} : 0)("border-radius:", config_values_default.radiusRound, ";border:", config_values_default.borderWidth, " solid ", COLORS.ui.border, ";box-sizing:border-box;cursor:grab;height:", CIRCLE_SIZE, "px;overflow:hidden;width:", CIRCLE_SIZE, "px;:active{cursor:grabbing;}" + ( true ? "" : 0));
const CircleIndicatorWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "eln3bjz2"
} : 0)( true ? {
name: "1r307gh",
styles: "box-sizing:border-box;position:relative;width:100%;height:100%;:focus-visible{outline:none;}"
} : 0);
const CircleIndicator = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "eln3bjz1"
} : 0)("background:", COLORS.theme.accent, ";border-radius:", config_values_default.radiusRound, ";box-sizing:border-box;display:block;left:50%;top:4px;transform:translateX( -50% );position:absolute;width:", INNER_CIRCLE_SIZE, "px;height:", INNER_CIRCLE_SIZE, "px;" + ( true ? "" : 0));
const UnitText = /* @__PURE__ */ emotion_styled_base_browser_esm(text_component_component_default, true ? {
target: "eln3bjz0"
} : 0)("color:", COLORS.theme.accent, ";margin-right:", space(3), ";" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/angle-picker-control/angle-circle.js
function AngleCircle({
value,
onChange,
...props
}) {
const angleCircleRef = (0,external_wp_element_namespaceObject.useRef)(null);
const angleCircleCenterRef = (0,external_wp_element_namespaceObject.useRef)();
const previousCursorValueRef = (0,external_wp_element_namespaceObject.useRef)();
const setAngleCircleCenter = () => {
if (angleCircleRef.current === null) {
return;
}
const rect = angleCircleRef.current.getBoundingClientRect();
angleCircleCenterRef.current = {
x: rect.x + rect.width / 2,
y: rect.y + rect.height / 2
};
};
const changeAngleToPosition = (event) => {
if (event === void 0) {
return;
}
event.preventDefault();
event.target?.focus();
if (angleCircleCenterRef.current !== void 0 && onChange !== void 0) {
const {
x: centerX,
y: centerY
} = angleCircleCenterRef.current;
onChange(getAngle(centerX, centerY, event.clientX, event.clientY));
}
};
const {
startDrag,
isDragging
} = (0,external_wp_compose_namespaceObject.__experimentalUseDragging)({
onDragStart: (event) => {
setAngleCircleCenter();
changeAngleToPosition(event);
},
onDragMove: changeAngleToPosition,
onDragEnd: changeAngleToPosition
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (isDragging) {
if (previousCursorValueRef.current === void 0) {
previousCursorValueRef.current = document.body.style.cursor;
}
document.body.style.cursor = "grabbing";
} else {
document.body.style.cursor = previousCursorValueRef.current || "";
previousCursorValueRef.current = void 0;
}
}, [isDragging]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CircleRoot, {
ref: angleCircleRef,
onMouseDown: startDrag,
className: "components-angle-picker-control__angle-circle",
...props,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CircleIndicatorWrapper, {
style: value ? {
transform: `rotate(${value}deg)`
} : void 0,
className: "components-angle-picker-control__angle-circle-indicator-wrapper",
tabIndex: -1,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CircleIndicator, {
className: "components-angle-picker-control__angle-circle-indicator"
})
})
});
}
function getAngle(centerX, centerY, pointX, pointY) {
const y = pointY - centerY;
const x = pointX - centerX;
const angleInRadians = Math.atan2(y, x);
const angleInDeg = Math.round(angleInRadians * (180 / Math.PI)) + 90;
if (angleInDeg < 0) {
return 360 + angleInDeg;
}
return angleInDeg;
}
var angle_circle_default = AngleCircle;
;// ./node_modules/@wordpress/components/build-module/angle-picker-control/index.js
function UnforwardedAnglePickerControl(props, ref) {
const {
className,
label = (0,external_wp_i18n_namespaceObject.__)("Angle"),
onChange,
value,
...restProps
} = props;
const handleOnNumberChange = (unprocessedValue) => {
if (onChange === void 0) {
return;
}
const inputValue = unprocessedValue !== void 0 && unprocessedValue !== "" ? parseInt(unprocessedValue, 10) : 0;
onChange(inputValue);
};
const classes = dist_clsx("components-angle-picker-control", className);
const unitText = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(UnitText, {
children: "\xB0"
});
const [prefixedUnitText, suffixedUnitText] = (0,external_wp_i18n_namespaceObject.isRTL)() ? [unitText, null] : [null, unitText];
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(flex_component_component_default, {
...restProps,
ref,
className: classes,
gap: 2,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_block_component_component_default, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(number_control_default, {
__next40pxDefaultSize: true,
label,
className: "components-angle-picker-control__input-field",
max: 360,
min: 0,
onChange: handleOnNumberChange,
step: "1",
value,
spinControls: "none",
prefix: prefixedUnitText,
suffix: suffixedUnitText
})
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {
marginBottom: "1",
marginTop: "auto",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(angle_circle_default, {
"aria-hidden": "true",
value,
onChange
})
})]
});
}
const AnglePickerControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedAnglePickerControl);
var angle_picker_control_default = AnglePickerControl;
// EXTERNAL MODULE: ./node_modules/remove-accents/index.js
var remove_accents = __webpack_require__(9681);
var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
;// external ["wp","richText"]
const external_wp_richText_namespaceObject = window["wp"]["richText"];
;// external ["wp","a11y"]
const external_wp_a11y_namespaceObject = window["wp"]["a11y"];
;// external ["wp","keycodes"]
const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
;// ./node_modules/@wordpress/components/build-module/utils/strings.js
const ALL_UNICODE_DASH_CHARACTERS = new RegExp(/[\u007e\u00ad\u2053\u207b\u208b\u2212\p{Pd}]/gu);
const normalizeTextString = (value) => {
return remove_accents_default()(value).normalize("NFKC").toLocaleLowerCase().replace(ALL_UNICODE_DASH_CHARACTERS, "-");
};
function kebabCase(str) {
var _str$toString;
let input = (_str$toString = str?.toString?.()) !== null && _str$toString !== void 0 ? _str$toString : "";
input = input.replace(/['\u2019]/, "");
return paramCase(input, {
splitRegexp: [
/(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g,
// fooBar => foo-bar, 3Bar => 3-bar
/(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g,
// 3bar => 3-bar
/([A-Za-z])([0-9])/g,
// Foo3 => foo-3, foo3 => foo-3
/([A-Z])([A-Z][a-z])/g
// FOOBar => foo-bar
]
});
}
function escapeRegExp(string) {
return string.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&");
}
;// ./node_modules/@wordpress/components/build-module/autocomplete/get-default-use-items.js
function filterOptions(search, options = [], maxResults = 10) {
const filtered = [];
for (let i = 0; i < options.length; i++) {
const option = options[i];
let {
keywords = []
} = option;
if ("string" === typeof option.label) {
keywords = [...keywords, option.label];
}
const isMatch = keywords.some((keyword) => search.test(remove_accents_default()(keyword)));
if (!isMatch) {
continue;
}
filtered.push(option);
if (filtered.length === maxResults) {
break;
}
}
return filtered;
}
function getDefaultUseItems(autocompleter) {
return (filterValue) => {
const [items, setItems] = (0,external_wp_element_namespaceObject.useState)([]);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
const {
options,
isDebounced
} = autocompleter;
const loadOptions = (0,external_wp_compose_namespaceObject.debounce)(() => {
const promise2 = Promise.resolve(typeof options === "function" ? options(filterValue) : options).then((optionsData) => {
if (promise2.canceled) {
return;
}
const keyedOptions = optionsData.map((optionData, optionIndex) => ({
key: `${autocompleter.name}-${optionIndex}`,
value: optionData,
label: autocompleter.getOptionLabel(optionData),
keywords: autocompleter.getOptionKeywords ? autocompleter.getOptionKeywords(optionData) : [],
isDisabled: autocompleter.isOptionDisabled ? autocompleter.isOptionDisabled(optionData) : false
}));
const search = new RegExp("(?:\\b|\\s|^)" + escapeRegExp(filterValue), "i");
setItems(filterOptions(search, keyedOptions));
});
return promise2;
}, isDebounced ? 250 : 0);
const promise = loadOptions();
return () => {
loadOptions.cancel();
if (promise) {
promise.canceled = true;
}
};
}, [filterValue]);
return [items];
};
}
;// ./node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
/**
* Provides data to position an inner element of the floating element so that it
* appears centered to the reference element.
* This wraps the core `arrow` middleware to allow React refs as the element.
* @see https://floating-ui.com/docs/arrow
*/
const floating_ui_react_dom_arrow = options => {
function isRef(value) {
return {}.hasOwnProperty.call(value, 'current');
}
return {
name: 'arrow',
options,
fn(state) {
const {
element,
padding
} = typeof options === 'function' ? options(state) : options;
if (element && isRef(element)) {
if (element.current != null) {
return floating_ui_dom_arrow({
element: element.current,
padding
}).fn(state);
}
return {};
}
if (element) {
return floating_ui_dom_arrow({
element,
padding
}).fn(state);
}
return {};
}
};
};
var index = typeof document !== 'undefined' ? external_React_.useLayoutEffect : external_React_.useEffect;
// Fork of `fast-deep-equal` that only does the comparisons we need and compares
// functions
function deepEqual(a, b) {
if (a === b) {
return true;
}
if (typeof a !== typeof b) {
return false;
}
if (typeof a === 'function' && a.toString() === b.toString()) {
return true;
}
let length;
let i;
let keys;
if (a && b && typeof a === 'object') {
if (Array.isArray(a)) {
length = a.length;
if (length !== b.length) return false;
for (i = length; i-- !== 0;) {
if (!deepEqual(a[i], b[i])) {
return false;
}
}
return true;
}
keys = Object.keys(a);
length = keys.length;
if (length !== Object.keys(b).length) {
return false;
}
for (i = length; i-- !== 0;) {
if (!{}.hasOwnProperty.call(b, keys[i])) {
return false;
}
}
for (i = length; i-- !== 0;) {
const key = keys[i];
if (key === '_owner' && a.$$typeof) {
continue;
}
if (!deepEqual(a[key], b[key])) {
return false;
}
}
return true;
}
// biome-ignore lint/suspicious/noSelfCompare: in source
return a !== a && b !== b;
}
function getDPR(element) {
if (typeof window === 'undefined') {
return 1;
}
const win = element.ownerDocument.defaultView || window;
return win.devicePixelRatio || 1;
}
function floating_ui_react_dom_roundByDPR(element, value) {
const dpr = getDPR(element);
return Math.round(value * dpr) / dpr;
}
function useLatestRef(value) {
const ref = external_React_.useRef(value);
index(() => {
ref.current = value;
});
return ref;
}
/**
* Provides data to position a floating element.
* @see https://floating-ui.com/docs/useFloating
*/
function useFloating(options) {
if (options === void 0) {
options = {};
}
const {
placement = 'bottom',
strategy = 'absolute',
middleware = [],
platform,
elements: {
reference: externalReference,
floating: externalFloating
} = {},
transform = true,
whileElementsMounted,
open
} = options;
const [data, setData] = external_React_.useState({
x: 0,
y: 0,
strategy,
placement,
middlewareData: {},
isPositioned: false
});
const [latestMiddleware, setLatestMiddleware] = external_React_.useState(middleware);
if (!deepEqual(latestMiddleware, middleware)) {
setLatestMiddleware(middleware);
}
const [_reference, _setReference] = external_React_.useState(null);
const [_floating, _setFloating] = external_React_.useState(null);
const setReference = external_React_.useCallback(node => {
if (node !== referenceRef.current) {
referenceRef.current = node;
_setReference(node);
}
}, []);
const setFloating = external_React_.useCallback(node => {
if (node !== floatingRef.current) {
floatingRef.current = node;
_setFloating(node);
}
}, []);
const referenceEl = externalReference || _reference;
const floatingEl = externalFloating || _floating;
const referenceRef = external_React_.useRef(null);
const floatingRef = external_React_.useRef(null);
const dataRef = external_React_.useRef(data);
const hasWhileElementsMounted = whileElementsMounted != null;
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
const platformRef = useLatestRef(platform);
const update = external_React_.useCallback(() => {
if (!referenceRef.current || !floatingRef.current) {
return;
}
const config = {
placement,
strategy,
middleware: latestMiddleware
};
if (platformRef.current) {
config.platform = platformRef.current;
}
floating_ui_dom_computePosition(referenceRef.current, floatingRef.current, config).then(data => {
const fullData = {
...data,
isPositioned: true
};
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
dataRef.current = fullData;
external_ReactDOM_namespaceObject.flushSync(() => {
setData(fullData);
});
}
});
}, [latestMiddleware, placement, strategy, platformRef]);
index(() => {
if (open === false && dataRef.current.isPositioned) {
dataRef.current.isPositioned = false;
setData(data => ({
...data,
isPositioned: false
}));
}
}, [open]);
const isMountedRef = external_React_.useRef(false);
index(() => {
isMountedRef.current = true;
return () => {
isMountedRef.current = false;
};
}, []);
// biome-ignore lint/correctness/useExhaustiveDependencies: `hasWhileElementsMounted` is intentionally included.
index(() => {
if (referenceEl) referenceRef.current = referenceEl;
if (floatingEl) floatingRef.current = floatingEl;
if (referenceEl && floatingEl) {
if (whileElementsMountedRef.current) {
return whileElementsMountedRef.current(referenceEl, floatingEl, update);
}
update();
}
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
const refs = external_React_.useMemo(() => ({
reference: referenceRef,
floating: floatingRef,
setReference,
setFloating
}), [setReference, setFloating]);
const elements = external_React_.useMemo(() => ({
reference: referenceEl,
floating: floatingEl
}), [referenceEl, floatingEl]);
const floatingStyles = external_React_.useMemo(() => {
const initialStyles = {
position: strategy,
left: 0,
top: 0
};
if (!elements.floating) {
return initialStyles;
}
const x = floating_ui_react_dom_roundByDPR(elements.floating, data.x);
const y = floating_ui_react_dom_roundByDPR(elements.floating, data.y);
if (transform) {
return {
...initialStyles,
transform: "translate(" + x + "px, " + y + "px)",
...(getDPR(elements.floating) >= 1.5 && {
willChange: 'transform'
})
};
}
return {
position: strategy,
left: x,
top: y
};
}, [strategy, transform, elements.floating, data.x, data.y]);
return external_React_.useMemo(() => ({
...data,
update,
refs,
elements,
floatingStyles
}), [data, update, refs, elements, floatingStyles]);
}
;// ./node_modules/@wordpress/icons/build-module/library/close.js
var close_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" }) });
;// ./node_modules/@wordpress/components/build-module/scroll-lock/index.js
let previousScrollTop = 0;
function setLocked(locked) {
const scrollingElement = document.scrollingElement || document.body;
if (locked) {
previousScrollTop = scrollingElement.scrollTop;
}
const methodName = locked ? "add" : "remove";
scrollingElement.classList[methodName]("lockscroll");
document.documentElement.classList[methodName]("lockscroll");
if (!locked) {
scrollingElement.scrollTop = previousScrollTop;
}
}
let lockCounter = 0;
function ScrollLock() {
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (lockCounter === 0) {
setLocked(true);
}
++lockCounter;
return () => {
if (lockCounter === 1) {
setLocked(false);
}
--lockCounter;
};
}, []);
return null;
}
var scroll_lock_default = ScrollLock;
;// ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-context.js
const initialContextValue = {
slots: (0,external_wp_compose_namespaceObject.observableMap)(),
fills: (0,external_wp_compose_namespaceObject.observableMap)(),
registerSlot: () => {
true ? external_wp_warning_default()("Components must be wrapped within `SlotFillProvider`. See https://developer.wordpress.org/block-editor/components/slot-fill/") : 0;
},
updateSlot: () => {
},
unregisterSlot: () => {
},
registerFill: () => {
},
unregisterFill: () => {
},
// This helps the provider know if it's using the default context value or not.
isDefault: true
};
const SlotFillContext = (0,external_wp_element_namespaceObject.createContext)(initialContextValue);
SlotFillContext.displayName = "SlotFillContext";
var slot_fill_context_default = SlotFillContext;
;// ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js
function useSlot(name) {
const registry = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context_default);
const slot = (0,external_wp_compose_namespaceObject.useObservableValue)(registry.slots, name);
return {
...slot
};
}
;// ./node_modules/@wordpress/components/build-module/slot-fill/context.js
const initialValue = {
slots: (0,external_wp_compose_namespaceObject.observableMap)(),
fills: (0,external_wp_compose_namespaceObject.observableMap)(),
registerSlot: () => {
},
unregisterSlot: () => {
},
registerFill: () => {
},
unregisterFill: () => {
},
updateFill: () => {
}
};
const context_SlotFillContext = (0,external_wp_element_namespaceObject.createContext)(initialValue);
context_SlotFillContext.displayName = "SlotFillContext";
var context_default = context_SlotFillContext;
;// ./node_modules/@wordpress/components/build-module/slot-fill/fill.js
function Fill({
name,
children
}) {
const registry = (0,external_wp_element_namespaceObject.useContext)(context_default);
const instanceRef = (0,external_wp_element_namespaceObject.useRef)({});
const childrenRef = (0,external_wp_element_namespaceObject.useRef)(children);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
childrenRef.current = children;
}, [children]);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
const instance = instanceRef.current;
registry.registerFill(name, instance, childrenRef.current);
return () => registry.unregisterFill(name, instance);
}, [registry, name]);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
registry.updateFill(name, instanceRef.current, childrenRef.current);
});
return null;
}
;// ./node_modules/@wordpress/components/build-module/slot-fill/slot.js
function isFunction(maybeFunc) {
return typeof maybeFunc === "function";
}
function addKeysToChildren(children) {
return external_wp_element_namespaceObject.Children.map(children, (child, childIndex) => {
if (!child || typeof child === "string") {
return child;
}
let childKey = childIndex;
if (typeof child === "object" && "key" in child && child?.key) {
childKey = child.key;
}
return (0,external_wp_element_namespaceObject.cloneElement)(child, {
key: childKey
});
});
}
function Slot(props) {
var _useObservableValue;
const registry = (0,external_wp_element_namespaceObject.useContext)(context_default);
const instanceRef = (0,external_wp_element_namespaceObject.useRef)({});
const {
name,
children,
fillProps = {}
} = props;
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
const instance = instanceRef.current;
registry.registerSlot(name, instance);
return () => registry.unregisterSlot(name, instance);
}, [registry, name]);
let fills = (_useObservableValue = (0,external_wp_compose_namespaceObject.useObservableValue)(registry.fills, name)) !== null && _useObservableValue !== void 0 ? _useObservableValue : [];
const currentSlot = (0,external_wp_compose_namespaceObject.useObservableValue)(registry.slots, name);
if (currentSlot !== instanceRef.current) {
fills = [];
}
const renderedFills = fills.map((fill) => {
const fillChildren = isFunction(fill.children) ? fill.children(fillProps) : fill.children;
return addKeysToChildren(fillChildren);
}).filter(
// In some cases fills are rendered only when some conditions apply.
// This ensures that we only use non-empty fills when rendering, i.e.,
// it allows us to render wrappers only when the fills are actually present.
(element) => !(0,external_wp_element_namespaceObject.isEmptyElement)(element)
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: isFunction(children) ? children(renderedFills) : renderedFills
});
}
var slot_default = Slot;
;// ./node_modules/@wordpress/components/node_modules/uuid/dist/esm-browser/native.js
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
/* harmony default export */ const esm_browser_native = ({
randomUUID
});
;// ./node_modules/@wordpress/components/node_modules/uuid/dist/esm-browser/rng.js
// Unique ID creation requires a high quality random # generator. In the browser we therefore
// require the crypto API and do not support built-in fallback to lower quality random number
// generators (like Math.random()).
let getRandomValues;
const rnds8 = new Uint8Array(16);
function rng() {
// lazy load so that environments that need to polyfill have a chance to do so
if (!getRandomValues) {
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
if (!getRandomValues) {
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
}
}
return getRandomValues(rnds8);
}
;// ./node_modules/@wordpress/components/node_modules/uuid/dist/esm-browser/stringify.js
/**
* Convert array of 16 byte values to UUID string format of the form:
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
*/
const byteToHex = [];
for (let i = 0; i < 256; ++i) {
byteToHex.push((i + 0x100).toString(16).slice(1));
}
function unsafeStringify(arr, offset = 0) {
// Note: Be careful editing this code! It's been tuned for performance
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
}
function stringify_stringify(arr, offset = 0) {
const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
// of the following:
// - One or more input array values don't map to a hex octet (leading to
// "undefined" in the uuid)
// - Invalid input values for the RFC `version` or `variant` fields
if (!validate(uuid)) {
throw TypeError('Stringified UUID is invalid');
}
return uuid;
}
/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify_stringify)));
;// ./node_modules/@wordpress/components/node_modules/uuid/dist/esm-browser/v4.js
function v4(options, buf, offset) {
if (esm_browser_native.randomUUID && !buf && !options) {
return esm_browser_native.randomUUID();
}
options = options || {};
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
rnds[6] = rnds[6] & 0x0f | 0x40;
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
if (buf) {
offset = offset || 0;
for (let i = 0; i < 16; ++i) {
buf[offset + i] = rnds[i];
}
return buf;
}
return unsafeStringify(rnds);
}
/* harmony default export */ const esm_browser_v4 = (v4);
;// ./node_modules/@wordpress/components/build-module/style-provider/index.js
const uuidCache = /* @__PURE__ */ new Set();
const containerCacheMap = /* @__PURE__ */ new WeakMap();
const memoizedCreateCacheWithContainer = (container) => {
if (containerCacheMap.has(container)) {
return containerCacheMap.get(container);
}
let key = esm_browser_v4().replace(/[0-9]/g, "");
while (uuidCache.has(key)) {
key = esm_browser_v4().replace(/[0-9]/g, "");
}
uuidCache.add(key);
const cache = emotion_cache_browser_esm({
container,
key
});
containerCacheMap.set(container, cache);
return cache;
};
function StyleProvider(props) {
const {
children,
document
} = props;
if (!document) {
return null;
}
const cache = memoizedCreateCacheWithContainer(document.head);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CacheProvider, {
value: cache,
children
});
}
var style_provider_default = StyleProvider;
;// ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/fill.js
function fill_Fill({
name,
children
}) {
var _slot$fillProps;
const registry = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context_default);
const slot = (0,external_wp_compose_namespaceObject.useObservableValue)(registry.slots, name);
const instanceRef = (0,external_wp_element_namespaceObject.useRef)({});
(0,external_wp_element_namespaceObject.useEffect)(() => {
const instance = instanceRef.current;
registry.registerFill(name, instance);
return () => registry.unregisterFill(name, instance);
}, [registry, name]);
if (!slot || !slot.ref.current) {
return null;
}
const wrappedChildren = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(style_provider_default, {
document: slot.ref.current.ownerDocument,
children: typeof children === "function" ? children((_slot$fillProps = slot.fillProps) !== null && _slot$fillProps !== void 0 ? _slot$fillProps : {}) : children
});
return (0,external_wp_element_namespaceObject.createPortal)(wrappedChildren, slot.ref.current);
}
;// ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot.js
function slot_Slot(props, forwardedRef) {
const {
name,
fillProps = {},
as,
// `children` is not allowed. However, if it is passed,
// it will be displayed as is, so remove `children`.
children,
...restProps
} = props;
const registry = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context_default);
const ref = (0,external_wp_element_namespaceObject.useRef)(null);
const fillPropsRef = (0,external_wp_element_namespaceObject.useRef)(fillProps);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
fillPropsRef.current = fillProps;
}, [fillProps]);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
registry.registerSlot(name, ref, fillPropsRef.current);
return () => registry.unregisterSlot(name, ref);
}, [registry, name]);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
registry.updateSlot(name, ref, fillPropsRef.current);
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
as,
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, ref]),
...restProps
});
}
var slot_slot_default = (0,external_wp_element_namespaceObject.forwardRef)(slot_Slot);
;// external ["wp","isShallowEqual"]
const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"];
var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject);
;// ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js
function createSlotRegistry() {
const slots = (0,external_wp_compose_namespaceObject.observableMap)();
const fills = (0,external_wp_compose_namespaceObject.observableMap)();
const registerSlot = (name, ref, fillProps) => {
slots.set(name, {
ref,
fillProps
});
};
const unregisterSlot = (name, ref) => {
const slot = slots.get(name);
if (!slot) {
return;
}
if (slot.ref !== ref) {
return;
}
slots.delete(name);
};
const updateSlot = (name, ref, fillProps) => {
const slot = slots.get(name);
if (!slot) {
return;
}
if (slot.ref !== ref) {
return;
}
if (external_wp_isShallowEqual_default()(slot.fillProps, fillProps)) {
return;
}
slots.set(name, {
ref,
fillProps
});
};
const registerFill = (name, ref) => {
fills.set(name, [...fills.get(name) || [], ref]);
};
const unregisterFill = (name, ref) => {
const fillsForName = fills.get(name);
if (!fillsForName) {
return;
}
fills.set(name, fillsForName.filter((fillRef) => fillRef !== ref));
};
return {
slots,
fills,
registerSlot,
updateSlot,
unregisterSlot,
registerFill,
unregisterFill
};
}
function SlotFillProvider({
children
}) {
const [registry] = (0,external_wp_element_namespaceObject.useState)(createSlotRegistry);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_context_default.Provider, {
value: registry,
children
});
}
;// ./node_modules/@wordpress/components/build-module/slot-fill/provider.js
function provider_createSlotRegistry() {
const slots = (0,external_wp_compose_namespaceObject.observableMap)();
const fills = (0,external_wp_compose_namespaceObject.observableMap)();
function registerSlot(name, instance) {
slots.set(name, instance);
}
function unregisterSlot(name, instance) {
if (slots.get(name) !== instance) {
return;
}
slots.delete(name);
}
function registerFill(name, instance, children) {
fills.set(name, [...fills.get(name) || [], {
instance,
children
}]);
}
function unregisterFill(name, instance) {
const fillsForName = fills.get(name);
if (!fillsForName) {
return;
}
fills.set(name, fillsForName.filter((fill) => fill.instance !== instance));
}
function updateFill(name, instance, children) {
const fillsForName = fills.get(name);
if (!fillsForName) {
return;
}
const fillForInstance = fillsForName.find((f) => f.instance === instance);
if (!fillForInstance) {
return;
}
if (fillForInstance.children === children) {
return;
}
fills.set(name, fillsForName.map((f) => {
if (f.instance === instance) {
return {
instance,
children
};
}
return f;
}));
}
return {
slots,
fills,
registerSlot,
unregisterSlot,
registerFill,
unregisterFill,
updateFill
};
}
function provider_SlotFillProvider({
children
}) {
const [contextValue] = (0,external_wp_element_namespaceObject.useState)(provider_createSlotRegistry);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(context_default.Provider, {
value: contextValue,
children
});
}
var provider_default = provider_SlotFillProvider;
;// ./node_modules/@wordpress/components/build-module/slot-fill/index.js
function slot_fill_Fill(props) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Fill, {
...props
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(fill_Fill, {
...props
})]
});
}
function UnforwardedSlot(props, ref) {
const {
bubblesVirtually,
...restProps
} = props;
if (bubblesVirtually) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_slot_default, {
...restProps,
ref
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_default, {
...restProps
});
}
const slot_fill_Slot = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSlot);
function Provider({
children,
passthrough = false
}) {
const parent = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context_default);
if (!parent.isDefault && passthrough) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(provider_default, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SlotFillProvider, {
children
})
});
}
Provider.displayName = "SlotFillProvider";
function createSlotFill(key) {
const baseName = typeof key === "symbol" ? key.description : key;
const FillComponent = (props) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_Fill, {
name: key,
...props
});
FillComponent.displayName = `${baseName}Fill`;
const SlotComponent = (props) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_Slot, {
name: key,
...props
});
SlotComponent.displayName = `${baseName}Slot`;
SlotComponent.__unstableName = key;
return {
name: key,
Fill: FillComponent,
Slot: SlotComponent
};
}
;// ./node_modules/@wordpress/components/build-module/popover/overlay-middlewares.js
function overlayMiddlewares() {
return [{
name: "overlay",
fn({
rects
}) {
return rects.reference;
}
}, floating_ui_dom_size({
apply({
rects,
elements
}) {
var _elements$floating;
const {
firstElementChild
} = (_elements$floating = elements.floating) !== null && _elements$floating !== void 0 ? _elements$floating : {};
if (!(firstElementChild instanceof HTMLElement)) {
return;
}
Object.assign(firstElementChild.style, {
width: `${rects.reference.width}px`,
height: `${rects.reference.height}px`
});
}
})];
}
;// ./node_modules/@wordpress/components/build-module/popover/index.js
const SLOT_NAME = "Popover";
const OVERFLOW_PADDING = 8;
const ArrowTriangle = () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 100 100",
className: "components-popover__triangle",
role: "presentation",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
className: "components-popover__triangle-bg",
d: "M 0 0 L 50 50 L 100 0"
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
className: "components-popover__triangle-border",
d: "M 0 0 L 50 50 L 100 0",
vectorEffect: "non-scaling-stroke"
})]
});
const slotNameContext = (0,external_wp_element_namespaceObject.createContext)(void 0);
slotNameContext.displayName = "__unstableSlotNameContext";
const fallbackContainerClassname = "components-popover__fallback-container";
const getPopoverFallbackContainer = () => {
let container = document.body.querySelector("." + fallbackContainerClassname);
if (!container) {
container = document.createElement("div");
container.className = fallbackContainerClassname;
document.body.append(container);
}
return container;
};
const UnforwardedPopover = (props, forwardedRef) => {
const {
animate = true,
headerTitle,
constrainTabbing,
onClose,
children,
className,
noArrow = true,
position,
placement: placementProp = "bottom-start",
offset: offsetProp = 0,
focusOnMount = "firstElement",
anchor,
expandOnMobile,
onFocusOutside,
__unstableSlotName = SLOT_NAME,
flip = true,
resize = true,
shift = false,
inline = false,
variant,
style: contentStyle,
// Deprecated props
__unstableForcePosition,
anchorRef,
anchorRect,
getAnchorRect,
isAlternate,
// Rest
...contentProps
} = useContextSystem(props, "Popover");
let computedFlipProp = flip;
let computedResizeProp = resize;
if (__unstableForcePosition !== void 0) {
external_wp_deprecated_default()("`__unstableForcePosition` prop in wp.components.Popover", {
since: "6.1",
version: "6.3",
alternative: "`flip={ false }` and `resize={ false }`"
});
computedFlipProp = !__unstableForcePosition;
computedResizeProp = !__unstableForcePosition;
}
if (anchorRef !== void 0) {
external_wp_deprecated_default()("`anchorRef` prop in wp.components.Popover", {
since: "6.1",
alternative: "`anchor` prop"
});
}
if (anchorRect !== void 0) {
external_wp_deprecated_default()("`anchorRect` prop in wp.components.Popover", {
since: "6.1",
alternative: "`anchor` prop"
});
}
if (getAnchorRect !== void 0) {
external_wp_deprecated_default()("`getAnchorRect` prop in wp.components.Popover", {
since: "6.1",
alternative: "`anchor` prop"
});
}
const computedVariant = isAlternate ? "toolbar" : variant;
if (isAlternate !== void 0) {
external_wp_deprecated_default()("`isAlternate` prop in wp.components.Popover", {
since: "6.2",
alternative: "`variant` prop with the `'toolbar'` value"
});
}
const arrowRef = (0,external_wp_element_namespaceObject.useRef)(null);
const [fallbackReferenceElement, setFallbackReferenceElement] = (0,external_wp_element_namespaceObject.useState)(null);
const anchorRefFallback = (0,external_wp_element_namespaceObject.useCallback)((node) => {
setFallbackReferenceElement(node);
}, []);
const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
const isExpanded = expandOnMobile && isMobileViewport;
const hasArrow = !isExpanded && !noArrow;
const normalizedPlacementFromProps = position ? positionToPlacement(position) : placementProp;
const middleware = [...placementProp === "overlay" ? overlayMiddlewares() : [], offset(offsetProp), computedFlipProp && floating_ui_dom_flip(), computedResizeProp && floating_ui_dom_size({
padding: OVERFLOW_PADDING,
apply(sizeProps) {
var _refs$floating$curren;
const {
firstElementChild
} = (_refs$floating$curren = refs.floating.current) !== null && _refs$floating$curren !== void 0 ? _refs$floating$curren : {};
if (!(firstElementChild instanceof HTMLElement)) {
return;
}
Object.assign(firstElementChild.style, {
maxHeight: `${Math.max(0, sizeProps.availableHeight)}px`,
overflow: "auto"
});
}
}), shift && floating_ui_dom_shift({
crossAxis: true,
limiter: floating_ui_dom_limitShift(),
padding: 1
// Necessary to avoid flickering at the edge of the viewport.
}), floating_ui_react_dom_arrow({
element: arrowRef
})];
const slotName = (0,external_wp_element_namespaceObject.useContext)(slotNameContext) || __unstableSlotName;
const slot = useSlot(slotName);
let onDialogClose;
if (onClose || onFocusOutside) {
onDialogClose = (type, event) => {
if (type === "focus-outside" && onFocusOutside) {
onFocusOutside(event);
} else if (onClose) {
onClose();
}
};
}
const [dialogRef, dialogProps] = (0,external_wp_compose_namespaceObject.__experimentalUseDialog)({
constrainTabbing,
focusOnMount,
__unstableOnClose: onDialogClose,
// @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)
onClose: onDialogClose
});
const {
// Positioning coordinates
x,
y,
// Object with "regular" refs to both "reference" and "floating"
refs,
// Type of CSS position property to use (absolute or fixed)
strategy,
update,
placement: computedPlacement,
middlewareData: {
arrow: arrowData
}
} = useFloating({
placement: normalizedPlacementFromProps === "overlay" ? void 0 : normalizedPlacementFromProps,
middleware,
whileElementsMounted: (referenceParam, floatingParam, updateParam) => autoUpdate(referenceParam, floatingParam, updateParam, {
layoutShift: false,
animationFrame: true
})
});
const arrowCallbackRef = (0,external_wp_element_namespaceObject.useCallback)((node) => {
arrowRef.current = node;
update();
}, [update]);
const anchorRefTop = anchorRef?.top;
const anchorRefBottom = anchorRef?.bottom;
const anchorRefStartContainer = anchorRef?.startContainer;
const anchorRefCurrent = anchorRef?.current;
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
const resultingReferenceElement = getReferenceElement({
anchor,
anchorRef,
anchorRect,
getAnchorRect,
fallbackReferenceElement
});
refs.setReference(resultingReferenceElement);
}, [anchor, anchorRef, anchorRefTop, anchorRefBottom, anchorRefStartContainer, anchorRefCurrent, anchorRect, getAnchorRect, fallbackReferenceElement, refs]);
const mergedFloatingRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([refs.setFloating, dialogRef, forwardedRef]);
const style = isExpanded ? void 0 : {
position: strategy,
top: 0,
left: 0,
// `x` and `y` are framer-motion specific props and are shorthands
// for `translateX` and `translateY`. Currently it is not possible
// to use `translateX` and `translateY` because those values would
// be overridden by the return value of the
// `placementToMotionAnimationProps` function.
x: computePopoverPosition(x),
y: computePopoverPosition(y)
};
const shouldReduceMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
const shouldAnimate = animate && !isExpanded && !shouldReduceMotion;
const [animationFinished, setAnimationFinished] = (0,external_wp_element_namespaceObject.useState)(false);
const {
style: motionInlineStyles,
...otherMotionProps
} = (0,external_wp_element_namespaceObject.useMemo)(() => placementToMotionAnimationProps(computedPlacement), [computedPlacement]);
const animationProps = shouldAnimate ? {
style: {
...contentStyle,
...motionInlineStyles,
...style
},
onAnimationComplete: () => setAnimationFinished(true),
...otherMotionProps
} : {
animate: false,
style: {
...contentStyle,
...style
}
};
const isPositioned = (!shouldAnimate || animationFinished) && x !== null && y !== null;
let content = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(motion.div, {
className: dist_clsx(className, {
"is-expanded": isExpanded,
"is-positioned": isPositioned,
// Use the 'alternate' classname for 'toolbar' variant for back compat.
[`is-${computedVariant === "toolbar" ? "alternate" : computedVariant}`]: computedVariant
}),
...animationProps,
...contentProps,
ref: mergedFloatingRef,
...dialogProps,
tabIndex: -1,
children: [isExpanded && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(scroll_lock_default, {}), isExpanded && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-popover__header",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "components-popover__header-title",
children: headerTitle
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
className: "components-popover__close",
size: "small",
icon: close_default,
onClick: onClose,
label: (0,external_wp_i18n_namespaceObject.__)("Close")
})]
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "components-popover__content",
children
}), hasArrow && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
ref: arrowCallbackRef,
className: ["components-popover__arrow", `is-${computedPlacement.split("-")[0]}`].join(" "),
style: {
left: typeof arrowData?.x !== "undefined" && Number.isFinite(arrowData.x) ? `${arrowData.x}px` : "",
top: typeof arrowData?.y !== "undefined" && Number.isFinite(arrowData.y) ? `${arrowData.y}px` : ""
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ArrowTriangle, {})
})]
});
const shouldRenderWithinSlot = slot.ref && !inline;
const hasAnchor = anchorRef || anchorRect || anchor;
if (shouldRenderWithinSlot) {
content = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_Fill, {
name: slotName,
children: content
});
} else if (!inline) {
content = (0,external_wp_element_namespaceObject.createPortal)(/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleProvider, {
document,
children: content
}), getPopoverFallbackContainer());
}
if (hasAnchor) {
return content;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
ref: anchorRefFallback
}), content]
});
};
const PopoverSlot = (0,external_wp_element_namespaceObject.forwardRef)(({
name = SLOT_NAME
}, ref) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_Slot, {
bubblesVirtually: true,
name,
className: "popover-slot",
ref
});
});
const popover_Popover = Object.assign(contextConnect(UnforwardedPopover, "Popover"), {
/**
* Renders a slot that is used internally by Popover for rendering content.
*/
Slot: Object.assign(PopoverSlot, {
displayName: "Popover.Slot"
}),
/**
* Provides a context to manage popover slot names.
*
* This is marked as unstable and should not be used directly.
*/
__unstableSlotNameProvider: Object.assign(slotNameContext.Provider, {
displayName: "Popover.__unstableSlotNameProvider"
})
});
var popover_default = popover_Popover;
;// ./node_modules/@wordpress/components/build-module/autocomplete/autocompleter-ui.js
function ListBox({
items,
onSelect,
selectedIndex,
instanceId,
listBoxId,
className,
Component = "div"
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
id: listBoxId,
role: "listbox",
className: "components-autocomplete__results",
children: items.map((option, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
id: `components-autocomplete-item-${instanceId}-${option.key}`,
role: "option",
__next40pxDefaultSize: true,
"aria-selected": index === selectedIndex,
accessibleWhenDisabled: true,
disabled: option.isDisabled,
className: dist_clsx("components-autocomplete__result", className, {
// Unused, for backwards compatibility.
"is-selected": index === selectedIndex
}),
variant: index === selectedIndex ? "primary" : void 0,
onClick: () => onSelect(option),
children: option.label
}, option.key))
});
}
function getAutoCompleterUI(autocompleter) {
var _autocompleter$useIte;
const useItems = (_autocompleter$useIte = autocompleter.useItems) !== null && _autocompleter$useIte !== void 0 ? _autocompleter$useIte : getDefaultUseItems(autocompleter);
function AutocompleterUI({
filterValue,
instanceId,
listBoxId,
className,
selectedIndex,
onChangeOptions,
onSelect,
onReset,
reset,
contentRef
}) {
const [items] = useItems(filterValue);
const popoverAnchor = (0,external_wp_richText_namespaceObject.useAnchor)({
editableContentElement: contentRef.current
});
const [needsA11yCompat, setNeedsA11yCompat] = (0,external_wp_element_namespaceObject.useState)(false);
const popoverRef = (0,external_wp_element_namespaceObject.useRef)(null);
const popoverRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([popoverRef, (0,external_wp_compose_namespaceObject.useRefEffect)((node) => {
if (!contentRef.current) {
return;
}
setNeedsA11yCompat(node.ownerDocument !== contentRef.current.ownerDocument);
}, [contentRef])]);
useOnClickOutside(popoverRef, reset);
const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500);
function announce(options) {
if (!debouncedSpeak) {
return;
}
if (!!options.length) {
if (filterValue) {
debouncedSpeak((0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: number of results. */
(0,external_wp_i18n_namespaceObject._n)("%d result found, use up and down arrow keys to navigate.", "%d results found, use up and down arrow keys to navigate.", options.length),
options.length
), "assertive");
} else {
debouncedSpeak((0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: number of results. */
(0,external_wp_i18n_namespaceObject._n)("Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.", "Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.", options.length),
options.length
), "assertive");
}
} else {
debouncedSpeak((0,external_wp_i18n_namespaceObject.__)("No results."), "assertive");
}
}
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
onChangeOptions(items);
announce(items);
}, [items]);
if (items.length === 0) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(popover_default, {
focusOnMount: false,
onClose: onReset,
placement: "top-start",
className: "components-autocomplete__popover",
anchor: popoverAnchor,
ref: popoverRefs,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ListBox, {
items,
onSelect,
selectedIndex,
instanceId,
listBoxId,
className
})
}), contentRef.current && needsA11yCompat && (0,external_ReactDOM_namespaceObject.createPortal)(/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ListBox, {
items,
onSelect,
selectedIndex,
instanceId,
listBoxId,
className,
Component: component_component_default
}), contentRef.current.ownerDocument.body)]
});
}
return AutocompleterUI;
}
function useOnClickOutside(ref, handler) {
(0,external_wp_element_namespaceObject.useEffect)(() => {
const listener = (event) => {
if (!ref.current || ref.current.contains(event.target)) {
return;
}
handler(event);
};
document.addEventListener("mousedown", listener);
document.addEventListener("touchstart", listener);
return () => {
document.removeEventListener("mousedown", listener);
document.removeEventListener("touchstart", listener);
};
}, [handler, ref]);
}
;// ./node_modules/@wordpress/components/build-module/utils/get-node-text.js
const getNodeText = (node) => {
if (node === null) {
return "";
}
switch (typeof node) {
case "string":
case "number":
return node.toString();
case "object": {
if (node instanceof Array) {
return node.map(getNodeText).join("");
}
if ("props" in node) {
return getNodeText(node.props.children);
}
return "";
}
default:
return "";
}
};
var get_node_text_default = getNodeText;
;// ./node_modules/@wordpress/components/build-module/autocomplete/index.js
const EMPTY_FILTERED_OPTIONS = [];
const AUTOCOMPLETE_HOOK_REFERENCE = {};
function useAutocomplete({
record,
onChange,
onReplace,
completers,
contentRef
}) {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(AUTOCOMPLETE_HOOK_REFERENCE);
const [selectedIndex, setSelectedIndex] = (0,external_wp_element_namespaceObject.useState)(0);
const [filteredOptions, setFilteredOptions] = (0,external_wp_element_namespaceObject.useState)(EMPTY_FILTERED_OPTIONS);
const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)("");
const [autocompleter, setAutocompleter] = (0,external_wp_element_namespaceObject.useState)(null);
const [AutocompleterUI, setAutocompleterUI] = (0,external_wp_element_namespaceObject.useState)(null);
const backspacingRef = (0,external_wp_element_namespaceObject.useRef)(false);
function insertCompletion(replacement) {
if (autocompleter === null) {
return;
}
const end = record.start;
const start = end - autocompleter.triggerPrefix.length - filterValue.length;
const toInsert = (0,external_wp_richText_namespaceObject.create)({
html: (0,external_wp_element_namespaceObject.renderToString)(replacement)
});
onChange((0,external_wp_richText_namespaceObject.insert)(record, toInsert, start, end));
}
function select(option) {
const {
getOptionCompletion
} = autocompleter || {};
if (option.isDisabled) {
return;
}
if (getOptionCompletion) {
const completion = getOptionCompletion(option.value, filterValue);
const isCompletionObject = (obj) => {
return obj !== null && typeof obj === "object" && "action" in obj && obj.action !== void 0 && "value" in obj && obj.value !== void 0;
};
const completionObject = isCompletionObject(completion) ? completion : {
action: "insert-at-caret",
value: completion
};
if ("replace" === completionObject.action) {
onReplace([completionObject.value]);
return;
} else if ("insert-at-caret" === completionObject.action) {
insertCompletion(completionObject.value);
}
}
reset();
contentRef.current?.focus();
}
function reset() {
setSelectedIndex(0);
setFilteredOptions(EMPTY_FILTERED_OPTIONS);
setFilterValue("");
setAutocompleter(null);
setAutocompleterUI(null);
}
function onChangeOptions(options) {
setSelectedIndex(options.length === filteredOptions.length ? selectedIndex : 0);
setFilteredOptions(options);
}
function handleKeyDown(event) {
backspacingRef.current = event.key === "Backspace";
if (!autocompleter) {
return;
}
if (filteredOptions.length === 0) {
return;
}
if (event.defaultPrevented) {
return;
}
switch (event.key) {
case "ArrowUp": {
const newIndex = (selectedIndex === 0 ? filteredOptions.length : selectedIndex) - 1;
setSelectedIndex(newIndex);
if ((0,external_wp_keycodes_namespaceObject.isAppleOS)()) {
(0,external_wp_a11y_namespaceObject.speak)(get_node_text_default(filteredOptions[newIndex].label), "assertive");
}
break;
}
case "ArrowDown": {
const newIndex = (selectedIndex + 1) % filteredOptions.length;
setSelectedIndex(newIndex);
if ((0,external_wp_keycodes_namespaceObject.isAppleOS)()) {
(0,external_wp_a11y_namespaceObject.speak)(get_node_text_default(filteredOptions[newIndex].label), "assertive");
}
break;
}
case "Escape":
setAutocompleter(null);
setAutocompleterUI(null);
event.preventDefault();
break;
case "Enter":
select(filteredOptions[selectedIndex]);
break;
case "ArrowLeft":
case "ArrowRight":
reset();
return;
default:
return;
}
event.preventDefault();
}
const textContent = (0,external_wp_element_namespaceObject.useMemo)(() => {
if ((0,external_wp_richText_namespaceObject.isCollapsed)(record)) {
return (0,external_wp_richText_namespaceObject.getTextContent)((0,external_wp_richText_namespaceObject.slice)(record, 0));
}
return "";
}, [record]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!textContent) {
if (autocompleter) {
reset();
}
return;
}
const completer = completers.reduce((lastTrigger, currentCompleter) => {
const triggerIndex2 = textContent.lastIndexOf(currentCompleter.triggerPrefix);
const lastTriggerIndex = lastTrigger !== null ? textContent.lastIndexOf(lastTrigger.triggerPrefix) : -1;
return triggerIndex2 > lastTriggerIndex ? currentCompleter : lastTrigger;
}, null);
if (!completer) {
if (autocompleter) {
reset();
}
return;
}
const {
allowContext,
triggerPrefix
} = completer;
const triggerIndex = textContent.lastIndexOf(triggerPrefix);
const textWithoutTrigger = textContent.slice(triggerIndex + triggerPrefix.length);
const tooDistantFromTrigger = textWithoutTrigger.length > 50;
if (tooDistantFromTrigger) {
return;
}
const mismatch = filteredOptions.length === 0;
const wordsFromTrigger = textWithoutTrigger.split(/\s/);
const hasOneTriggerWord = wordsFromTrigger.length === 1;
const matchingWhileBackspacing = backspacingRef.current && wordsFromTrigger.length <= 3;
if (mismatch && !(matchingWhileBackspacing || hasOneTriggerWord)) {
if (autocompleter) {
reset();
}
return;
}
const textAfterSelection = (0,external_wp_richText_namespaceObject.getTextContent)((0,external_wp_richText_namespaceObject.slice)(record, void 0, (0,external_wp_richText_namespaceObject.getTextContent)(record).length));
if (allowContext && !allowContext(textContent.slice(0, triggerIndex), textAfterSelection)) {
if (autocompleter) {
reset();
}
return;
}
if (/^\s/.test(textWithoutTrigger) || /\s\s+$/.test(textWithoutTrigger)) {
if (autocompleter) {
reset();
}
return;
}
if (!/[\u0000-\uFFFF]*$/.test(textWithoutTrigger)) {
if (autocompleter) {
reset();
}
return;
}
const safeTrigger = escapeRegExp(completer.triggerPrefix);
const text = remove_accents_default()(textContent);
const match = text.slice(text.lastIndexOf(completer.triggerPrefix)).match(new RegExp(`${safeTrigger}([\0-\uFFFF]*)$`));
const query = match && match[1];
setAutocompleter(completer);
setAutocompleterUI(() => completer !== autocompleter ? getAutoCompleterUI(completer) : AutocompleterUI);
setFilterValue(query === null ? "" : query);
}, [textContent]);
const {
key: selectedKey = ""
} = filteredOptions[selectedIndex] || {};
const {
className
} = autocompleter || {};
const isExpanded = !!autocompleter && filteredOptions.length > 0;
const listBoxId = isExpanded ? `components-autocomplete-listbox-${instanceId}` : void 0;
const activeId = isExpanded ? `components-autocomplete-item-${instanceId}-${selectedKey}` : null;
const hasSelection = record.start !== void 0;
const showPopover = !!textContent && hasSelection && !!AutocompleterUI;
return {
listBoxId,
activeId,
onKeyDown: withIgnoreIMEEvents(handleKeyDown),
popover: showPopover && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(AutocompleterUI, {
className,
filterValue,
instanceId,
listBoxId,
selectedIndex,
onChangeOptions,
onSelect: select,
value: record,
contentRef,
reset
})
};
}
function useLastDifferentValue(value) {
const history = (0,external_wp_element_namespaceObject.useRef)(/* @__PURE__ */ new Set());
history.current.add(value);
if (history.current.size > 2) {
history.current.delete(Array.from(history.current)[0]);
}
return Array.from(history.current)[0];
}
function useAutocompleteProps(options) {
const ref = (0,external_wp_element_namespaceObject.useRef)(null);
const onKeyDownRef = (0,external_wp_element_namespaceObject.useRef)();
const {
record
} = options;
const previousRecord = useLastDifferentValue(record);
const {
popover,
listBoxId,
activeId,
onKeyDown
} = useAutocomplete({
...options,
contentRef: ref
});
onKeyDownRef.current = onKeyDown;
const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useRefEffect)((element) => {
function _onKeyDown(event) {
onKeyDownRef.current?.(event);
}
element.addEventListener("keydown", _onKeyDown);
return () => {
element.removeEventListener("keydown", _onKeyDown);
};
}, [])]);
const didUserInput = record.text !== previousRecord?.text;
if (!didUserInput) {
return {
ref: mergedRefs
};
}
return {
ref: mergedRefs,
children: popover,
"aria-autocomplete": listBoxId ? "list" : void 0,
"aria-owns": listBoxId,
"aria-activedescendant": activeId
};
}
function Autocomplete({
children,
isSelected,
...options
}) {
const {
popover,
...props
} = useAutocomplete(options);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [children(props), isSelected && popover]
});
}
;// ./node_modules/@wordpress/components/build-module/base-control/hooks.js
function useBaseControlProps(props) {
const {
help,
id: preferredId,
...restProps
} = props;
const uniqueId = (0,external_wp_compose_namespaceObject.useInstanceId)(base_control_default, "wp-components-base-control", preferredId);
return {
baseControlProps: {
id: uniqueId,
help,
...restProps
},
controlProps: {
id: uniqueId,
...!!help ? {
"aria-describedby": `${uniqueId}__help`
} : {}
}
};
}
;// ./node_modules/@wordpress/icons/build-module/library/link.js
var link_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/link-off.js
var link_off_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z" }) });
;// ./node_modules/@wordpress/components/build-module/border-box-control/styles.js
function border_box_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const borderBoxControl = /* @__PURE__ */ emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0);
const linkedBorderControl = () => /* @__PURE__ */ emotion_react_browser_esm_css("flex:1;", rtl({
marginRight: "24px"
})(), ";" + ( true ? "" : 0), true ? "" : 0);
const wrapper = true ? {
name: "bjn8wh",
styles: "position:relative"
} : 0;
const borderBoxControlLinkedButton = (size) => {
return /* @__PURE__ */ emotion_react_browser_esm_css("position:absolute;top:", size === "__unstable-large" ? "8px" : "3px", ";", rtl({
right: 0
})(), " line-height:0;" + ( true ? "" : 0), true ? "" : 0);
};
const borderBoxStyleWithFallback = (border) => {
const {
color = COLORS.gray[200],
style = "solid",
width = config_values_default.borderWidth
} = border || {};
const clampedWidth = width !== config_values_default.borderWidth ? `clamp(1px, ${width}, 10px)` : width;
const hasVisibleBorder = !!width && width !== "0" || !!color;
const borderStyle = hasVisibleBorder ? style || "solid" : style;
return `${color} ${borderStyle} ${clampedWidth}`;
};
const borderBoxControlVisualizer = (borders, size) => {
return /* @__PURE__ */ emotion_react_browser_esm_css("position:absolute;top:", size === "__unstable-large" ? "20px" : "15px", ";right:", size === "__unstable-large" ? "39px" : "29px", ";bottom:", size === "__unstable-large" ? "20px" : "15px", ";left:", size === "__unstable-large" ? "39px" : "29px", ";border-top:", borderBoxStyleWithFallback(borders?.top), ";border-bottom:", borderBoxStyleWithFallback(borders?.bottom), ";", rtl({
borderLeft: borderBoxStyleWithFallback(borders?.left)
})(), " ", rtl({
borderRight: borderBoxStyleWithFallback(borders?.right)
})(), ";" + ( true ? "" : 0), true ? "" : 0);
};
const borderBoxControlSplitControls = (size) => /* @__PURE__ */ emotion_react_browser_esm_css("position:relative;flex:1;width:", size === "__unstable-large" ? void 0 : "80%", ";" + ( true ? "" : 0), true ? "" : 0);
const centeredBorderControl = true ? {
name: "1nwbfnf",
styles: "grid-column:span 2;margin:0 auto"
} : 0;
const rightBorderControl = () => /* @__PURE__ */ emotion_react_browser_esm_css(rtl({
marginLeft: "auto"
})(), ";" + ( true ? "" : 0), true ? "" : 0);
;// ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-linked-button/hook.js
function useBorderBoxControlLinkedButton(props) {
const {
className,
size = "default",
...otherProps
} = useContextSystem(props, "BorderBoxControlLinkedButton");
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(borderBoxControlLinkedButton(size), className);
}, [className, cx, size]);
return {
...otherProps,
className: classes
};
}
;// ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-linked-button/component.js
const BorderBoxControlLinkedButton = (props, forwardedRef) => {
const {
className,
isLinked,
...buttonProps
} = useBorderBoxControlLinkedButton(props);
const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)("Unlink sides") : (0,external_wp_i18n_namespaceObject.__)("Link sides");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
...buttonProps,
size: "small",
icon: isLinked ? link_default : link_off_default,
iconSize: 24,
label,
ref: forwardedRef,
className
});
};
const ConnectedBorderBoxControlLinkedButton = contextConnect(BorderBoxControlLinkedButton, "BorderBoxControlLinkedButton");
var border_box_control_linked_button_component_component_default = ConnectedBorderBoxControlLinkedButton;
;// ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-visualizer/hook.js
function useBorderBoxControlVisualizer(props) {
const {
className,
value,
size = "default",
...otherProps
} = useContextSystem(props, "BorderBoxControlVisualizer");
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(borderBoxControlVisualizer(value, size), className);
}, [cx, className, value, size]);
return {
...otherProps,
className: classes,
value
};
}
;// ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-visualizer/component.js
const BorderBoxControlVisualizer = (props, forwardedRef) => {
const {
value,
...otherProps
} = useBorderBoxControlVisualizer(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...otherProps,
ref: forwardedRef
});
};
const ConnectedBorderBoxControlVisualizer = contextConnect(BorderBoxControlVisualizer, "BorderBoxControlVisualizer");
var border_box_control_visualizer_component_component_default = ConnectedBorderBoxControlVisualizer;
;// ./node_modules/@wordpress/icons/build-module/library/line-solid.js
var line_solid_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5 11.25h14v1.5H5z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/line-dashed.js
var line_dashed_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
d: "M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",
clipRule: "evenodd"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/line-dotted.js
var line_dotted_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
d: "M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",
clipRule: "evenodd"
}
) });
;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/styles.js
function toggle_group_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const toggleGroupControl = ({
isBlock,
isDeselectable,
size
}) => /* @__PURE__ */ emotion_react_browser_esm_css("background:", COLORS.ui.background, ";border:1px solid transparent;border-radius:", config_values_default.radiusSmall, ";display:inline-flex;min-width:0;position:relative;", toggleGroupControlSize(size), " ", !isDeselectable && enclosingBorders(isBlock), "@media not ( prefers-reduced-motion ){&[data-indicator-animated]::before{transition-property:transform,border-radius;transition-duration:0.2s;transition-timing-function:ease-out;}}&::before{content:'';position:absolute;pointer-events:none;background:", COLORS.theme.foreground, ";outline:2px solid transparent;outline-offset:-3px;--antialiasing-factor:100;border-radius:calc(\n ", config_values_default.radiusXSmall, " /\n (\n var( --selected-width, 0 ) /\n var( --antialiasing-factor )\n )\n )/", config_values_default.radiusXSmall, ";left:-1px;width:calc( var( --antialiasing-factor ) * 1px );height:calc( var( --selected-height, 0 ) * 1px );transform-origin:left top;transform:translateX( calc( var( --selected-left, 0 ) * 1px ) ) scaleX(\n calc(\n var( --selected-width, 0 ) / var( --antialiasing-factor )\n )\n );}" + ( true ? "" : 0), true ? "" : 0);
const enclosingBorders = (isBlock) => {
const enclosingBorder = /* @__PURE__ */ emotion_react_browser_esm_css("border-color:", COLORS.ui.border, ";" + ( true ? "" : 0), true ? "" : 0);
return /* @__PURE__ */ emotion_react_browser_esm_css(isBlock && enclosingBorder, " &:hover{border-color:", COLORS.ui.borderHover, ";}&:focus-within{border-color:", COLORS.ui.borderFocus, ";box-shadow:", config_values_default.controlBoxShadowFocus, ";z-index:1;outline:2px solid transparent;outline-offset:-2px;}" + ( true ? "" : 0), true ? "" : 0);
};
var styles_ref = true ? {
name: "1aqh2c7",
styles: "min-height:40px;padding:3px"
} : 0;
var _ref2 = true ? {
name: "1ndywgm",
styles: "min-height:36px;padding:2px"
} : 0;
const toggleGroupControlSize = (size) => {
const styles = {
default: _ref2,
"__unstable-large": styles_ref
};
return styles[size];
};
const toggle_group_control_styles_block = true ? {
name: "7whenc",
styles: "display:flex;width:100%"
} : 0;
const VisualLabelWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "eakva830"
} : 0)( true ? {
name: "zjik7",
styles: "display:flex"
} : 0);
;// ./node_modules/@ariakit/core/esm/radio/radio-store.js
"use client";
// src/radio/radio-store.ts
function createRadioStore(_a = {}) {
var props = _3YLGPPWQ_objRest(_a, []);
var _a2;
const syncState = (_a2 = props.store) == null ? void 0 : _a2.getState();
const composite = createCompositeStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
}));
const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, composite.getState()), {
value: defaultValue(
props.value,
syncState == null ? void 0 : syncState.value,
props.defaultValue,
null
)
});
const radio = createStore(initialState, composite, props.store);
return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, composite), radio), {
setValue: (value) => radio.setState("value", value)
});
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/4BXJGRNH.js
"use client";
// src/radio/radio-store.ts
function useRadioStoreProps(store, update, props) {
store = useCompositeStoreProps(store, update, props);
useStoreProps(store, props, "value", "setValue");
return store;
}
function useRadioStore(props = {}) {
const [store, update] = YV4JVR4I_useStore(createRadioStore, props);
return useRadioStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/UVUMR3WP.js
"use client";
// src/radio/radio-context.tsx
var UVUMR3WP_ctx = createStoreContext(
[CompositeContextProvider],
[CompositeScopedContextProvider]
);
var useRadioContext = UVUMR3WP_ctx.useContext;
var useRadioScopedContext = UVUMR3WP_ctx.useScopedContext;
var useRadioProviderContext = UVUMR3WP_ctx.useProviderContext;
var RadioContextProvider = UVUMR3WP_ctx.ContextProvider;
var RadioScopedContextProvider = UVUMR3WP_ctx.ScopedContextProvider;
;// ./node_modules/@ariakit/react-core/esm/radio/radio-group.js
"use client";
// src/radio/radio-group.tsx
var radio_group_TagName = "div";
var useRadioGroup = createHook(
function useRadioGroup2(_a) {
var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
const context = useRadioProviderContext();
store = store || context;
invariant(
store,
false && 0
);
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RadioScopedContextProvider, { value: store, children: element }),
[store]
);
props = _3YLGPPWQ_spreadValues({
role: "radiogroup"
}, props);
props = useComposite(_3YLGPPWQ_spreadValues({ store }, props));
return props;
}
);
var RadioGroup = forwardRef2(function RadioGroup2(props) {
const htmlProps = useRadioGroup(props);
return LMDWO4NN_createElement(radio_group_TagName, htmlProps);
});
;// ./node_modules/@wordpress/components/build-module/toggle-group-control/context.js
const ToggleGroupControlContext = (0,external_wp_element_namespaceObject.createContext)({});
ToggleGroupControlContext.displayName = "ToggleGroupControlContext";
const useToggleGroupControlContext = () => (0,external_wp_element_namespaceObject.useContext)(ToggleGroupControlContext);
var context_context_default = ToggleGroupControlContext;
;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/utils.js
function useComputeControlledOrUncontrolledValue(valueProp) {
const isInitialRenderRef = (0,external_wp_element_namespaceObject.useRef)(true);
const prevValueProp = (0,external_wp_compose_namespaceObject.usePrevious)(valueProp);
const prevIsControlledRef = (0,external_wp_element_namespaceObject.useRef)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (isInitialRenderRef.current) {
isInitialRenderRef.current = false;
}
}, []);
const isControlled = prevIsControlledRef.current || !isInitialRenderRef.current && prevValueProp !== valueProp;
(0,external_wp_element_namespaceObject.useEffect)(() => {
prevIsControlledRef.current = isControlled;
}, [isControlled]);
if (isControlled) {
return {
value: valueProp !== null && valueProp !== void 0 ? valueProp : "",
defaultValue: void 0
};
}
return {
value: void 0,
defaultValue: valueProp
};
}
;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/as-radio-group.js
function UnforwardedToggleGroupControlAsRadioGroup({
children,
isAdaptiveWidth,
label,
onChange: onChangeProp,
size,
value: valueProp,
id: idProp,
setSelectedElement,
...otherProps
}, forwardedRef) {
const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControlAsRadioGroup, "toggle-group-control-as-radio-group");
const baseId = idProp || generatedId;
const {
value,
defaultValue
} = useComputeControlledOrUncontrolledValue(valueProp);
const wrappedOnChangeProp = onChangeProp ? (v) => {
onChangeProp(v !== null && v !== void 0 ? v : void 0);
} : void 0;
const radio = useRadioStore({
defaultValue,
value,
setValue: wrappedOnChangeProp,
rtl: (0,external_wp_i18n_namespaceObject.isRTL)()
});
const selectedValue = useStoreState(radio, "value");
const setValue = radio.setValue;
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (selectedValue === "") {
radio.setActiveId(void 0);
}
}, [radio, selectedValue]);
const groupContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
activeItemIsNotFirstItem: () => radio.getState().activeId !== radio.first(),
baseId,
isBlock: !isAdaptiveWidth,
size,
// @ts-expect-error - This is wrong and we should fix it.
value: selectedValue,
// @ts-expect-error - This is wrong and we should fix it.
setValue,
setSelectedElement
}), [baseId, isAdaptiveWidth, radio, selectedValue, setSelectedElement, setValue, size]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(context_context_default.Provider, {
value: groupContextValue,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RadioGroup, {
store: radio,
"aria-label": label,
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {}),
...otherProps,
id: baseId,
ref: forwardedRef,
children
})
});
}
const ToggleGroupControlAsRadioGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlAsRadioGroup);
;// ./node_modules/@wordpress/components/build-module/utils/hooks/use-controlled-value.js
function useControlledValue({
defaultValue,
onChange,
value: valueProp
}) {
const hasValue = typeof valueProp !== "undefined";
const initialValue = hasValue ? valueProp : defaultValue;
const [state, setState] = (0,external_wp_element_namespaceObject.useState)(initialValue);
const value = hasValue ? valueProp : state;
const uncontrolledSetValue = (0,external_wp_element_namespaceObject.useCallback)((nextValue, ...args) => {
setState(nextValue);
onChange?.(nextValue, ...args);
}, [onChange]);
let setValue;
if (hasValue && typeof onChange === "function") {
setValue = onChange;
} else if (!hasValue && typeof onChange === "function") {
setValue = uncontrolledSetValue;
} else {
setValue = setState;
}
return [value, setValue];
}
;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/as-button-group.js
function UnforwardedToggleGroupControlAsButtonGroup({
children,
isAdaptiveWidth,
label,
onChange,
size,
value: valueProp,
id: idProp,
setSelectedElement,
...otherProps
}, forwardedRef) {
const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControlAsButtonGroup, "toggle-group-control-as-button-group");
const baseId = idProp || generatedId;
const {
value,
defaultValue
} = useComputeControlledOrUncontrolledValue(valueProp);
const [selectedValue, setSelectedValue] = useControlledValue({
defaultValue,
value,
onChange
});
const groupContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
baseId,
value: selectedValue,
setValue: setSelectedValue,
isBlock: !isAdaptiveWidth,
isDeselectable: true,
size,
setSelectedElement
}), [baseId, selectedValue, setSelectedValue, isAdaptiveWidth, size, setSelectedElement]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(context_context_default.Provider, {
value: groupContextValue,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
"aria-label": label,
...otherProps,
ref: forwardedRef,
role: "group",
children
})
});
}
const ToggleGroupControlAsButtonGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlAsButtonGroup);
;// ./node_modules/@wordpress/components/build-module/utils/element-rect.js
const NULL_ELEMENT_OFFSET_RECT = {
element: void 0,
top: 0,
right: 0,
bottom: 0,
left: 0,
width: 0,
height: 0
};
function getElementOffsetRect(element) {
var _offsetParent$getBoun, _offsetParent$scrollL, _offsetParent$scrollT;
const rect = element.getBoundingClientRect();
if (rect.width === 0 || rect.height === 0) {
return;
}
const offsetParent = element.offsetParent;
const offsetParentRect = (_offsetParent$getBoun = offsetParent?.getBoundingClientRect()) !== null && _offsetParent$getBoun !== void 0 ? _offsetParent$getBoun : NULL_ELEMENT_OFFSET_RECT;
const offsetParentScrollX = (_offsetParent$scrollL = offsetParent?.scrollLeft) !== null && _offsetParent$scrollL !== void 0 ? _offsetParent$scrollL : 0;
const offsetParentScrollY = (_offsetParent$scrollT = offsetParent?.scrollTop) !== null && _offsetParent$scrollT !== void 0 ? _offsetParent$scrollT : 0;
const computedWidth = parseFloat(getComputedStyle(element).width);
const computedHeight = parseFloat(getComputedStyle(element).height);
const scaleX = computedWidth / rect.width;
const scaleY = computedHeight / rect.height;
return {
element,
// To obtain the adjusted values for the position:
// 1. Compute the element's position relative to the offset parent.
// 2. Correct for the scale factor.
// 3. Adjust for the scroll position of the offset parent.
top: (rect.top - offsetParentRect?.top) * scaleY + offsetParentScrollY,
right: (offsetParentRect?.right - rect.right) * scaleX - offsetParentScrollX,
bottom: (offsetParentRect?.bottom - rect.bottom) * scaleY - offsetParentScrollY,
left: (rect.left - offsetParentRect?.left) * scaleX + offsetParentScrollX,
// Computed dimensions don't need any adjustments.
width: computedWidth,
height: computedHeight
};
}
const POLL_RATE = 100;
function useTrackElementOffsetRect(targetElement, deps = []) {
const [indicatorPosition, setIndicatorPosition] = (0,external_wp_element_namespaceObject.useState)(NULL_ELEMENT_OFFSET_RECT);
const intervalRef = (0,external_wp_element_namespaceObject.useRef)();
const measure = (0,external_wp_compose_namespaceObject.useEvent)(() => {
if (targetElement && targetElement.isConnected) {
const elementOffsetRect = getElementOffsetRect(targetElement);
if (elementOffsetRect) {
setIndicatorPosition(elementOffsetRect);
clearInterval(intervalRef.current);
return true;
}
} else {
clearInterval(intervalRef.current);
}
return false;
});
const setElement = (0,external_wp_compose_namespaceObject.useResizeObserver)(() => {
if (!measure()) {
requestAnimationFrame(() => {
if (!measure()) {
intervalRef.current = setInterval(measure, POLL_RATE);
}
});
}
});
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
setElement(targetElement);
if (!targetElement) {
setIndicatorPosition(NULL_ELEMENT_OFFSET_RECT);
}
}, [setElement, targetElement]);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
measure();
}, deps);
return indicatorPosition;
}
;// ./node_modules/@wordpress/components/build-module/utils/hooks/use-on-value-update.js
function useOnValueUpdate(value, onUpdate) {
const previousValueRef = (0,external_wp_element_namespaceObject.useRef)(value);
const updateCallbackEvent = (0,external_wp_compose_namespaceObject.useEvent)(onUpdate);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (previousValueRef.current !== value) {
updateCallbackEvent({
previousValue: previousValueRef.current
});
previousValueRef.current = value;
}
}, [updateCallbackEvent, value]);
}
;// ./node_modules/@wordpress/components/build-module/utils/hooks/use-animated-offset-rect.js
function useAnimatedOffsetRect(container, rect, {
prefix = "subelement",
dataAttribute = `${prefix}-animated`,
transitionEndFilter = () => true,
roundRect = false
} = {}) {
const setProperties = (0,external_wp_compose_namespaceObject.useEvent)(() => {
Object.keys(rect).forEach((property) => property !== "element" && container?.style.setProperty(`--${prefix}-${property}`, String(roundRect ? Math.floor(rect[property]) : rect[property])));
});
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
setProperties();
}, [rect, setProperties]);
useOnValueUpdate(rect.element, ({
previousValue
}) => {
if (rect.element && previousValue) {
container?.setAttribute(`data-${dataAttribute}`, "");
}
});
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
function onTransitionEnd(event) {
if (transitionEndFilter(event)) {
container?.removeAttribute(`data-${dataAttribute}`);
}
}
container?.addEventListener("transitionend", onTransitionEnd);
return () => container?.removeEventListener("transitionend", onTransitionEnd);
}, [dataAttribute, container, transitionEndFilter]);
}
;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/component.js
function UnconnectedToggleGroupControl(props, forwardedRef) {
const {
__nextHasNoMarginBottom = false,
__next40pxDefaultSize = false,
__shouldNotWarnDeprecated36pxSize,
className,
isAdaptiveWidth = false,
isBlock = false,
isDeselectable = false,
label,
hideLabelFromVision = false,
help,
onChange,
size = "default",
value,
children,
...otherProps
} = useContextSystem(props, "ToggleGroupControl");
const normalizedSize = __next40pxDefaultSize && size === "default" ? "__unstable-large" : size;
const [selectedElement, setSelectedElement] = (0,external_wp_element_namespaceObject.useState)();
const [controlElement, setControlElement] = (0,external_wp_element_namespaceObject.useState)();
const refs = (0,external_wp_compose_namespaceObject.useMergeRefs)([setControlElement, forwardedRef]);
const selectedRect = useTrackElementOffsetRect(value !== null && value !== void 0 ? selectedElement : void 0);
useAnimatedOffsetRect(controlElement, selectedRect, {
prefix: "selected",
dataAttribute: "indicator-animated",
transitionEndFilter: (event) => event.pseudoElement === "::before",
roundRect: true
});
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(toggleGroupControl({
isBlock,
isDeselectable,
size: normalizedSize
}), isBlock && toggle_group_control_styles_block, className), [className, cx, isBlock, isDeselectable, normalizedSize]);
const MainControl = isDeselectable ? ToggleGroupControlAsButtonGroup : ToggleGroupControlAsRadioGroup;
maybeWarnDeprecated36pxSize({
componentName: "ToggleGroupControl",
size,
__next40pxDefaultSize,
__shouldNotWarnDeprecated36pxSize
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(base_control_default, {
help,
__nextHasNoMarginBottom,
__associatedWPComponentName: "ToggleGroupControl",
children: [!hideLabelFromVision && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(VisualLabelWrapper, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default.VisualLabel, {
children: label
})
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MainControl, {
...otherProps,
setSelectedElement,
className: classes,
isAdaptiveWidth,
label,
onChange,
ref: refs,
size: normalizedSize,
value,
children
})]
});
}
const ToggleGroupControl = contextConnect(UnconnectedToggleGroupControl, "ToggleGroupControl");
var toggle_group_control_component_component_default = ToggleGroupControl;
;// ./node_modules/@ariakit/react-core/esm/__chunks/NLEBE274.js
"use client";
// src/radio/radio.tsx
var NLEBE274_TagName = "input";
function getIsChecked(value, storeValue) {
if (storeValue === void 0) return;
if (value != null && storeValue != null) {
return storeValue === value;
}
return !!storeValue;
}
function isNativeRadio(tagName, type) {
return tagName === "input" && (!type || type === "radio");
}
var useRadio = createHook(function useRadio2(_a) {
var _b = _a, {
store,
name,
value,
checked
} = _b, props = __objRest(_b, [
"store",
"name",
"value",
"checked"
]);
const context = useRadioContext();
store = store || context;
const id = useId(props.id);
const ref = (0,external_React_.useRef)(null);
const isChecked = useStoreState(
store,
(state) => checked != null ? checked : getIsChecked(value, state == null ? void 0 : state.value)
);
(0,external_React_.useEffect)(() => {
if (!id) return;
if (!isChecked) return;
const isActiveItem = (store == null ? void 0 : store.getState().activeId) === id;
if (isActiveItem) return;
store == null ? void 0 : store.setActiveId(id);
}, [store, isChecked, id]);
const onChangeProp = props.onChange;
const tagName = useTagName(ref, NLEBE274_TagName);
const nativeRadio = isNativeRadio(tagName, props.type);
const disabled = disabledFromProps(props);
const [propertyUpdated, schedulePropertyUpdate] = useForceUpdate();
(0,external_React_.useEffect)(() => {
const element = ref.current;
if (!element) return;
if (nativeRadio) return;
if (isChecked !== void 0) {
element.checked = isChecked;
}
if (name !== void 0) {
element.name = name;
}
if (value !== void 0) {
element.value = `${value}`;
}
}, [propertyUpdated, nativeRadio, isChecked, name, value]);
const onChange = useEvent((event) => {
if (disabled) {
event.preventDefault();
event.stopPropagation();
return;
}
if ((store == null ? void 0 : store.getState().value) === value) return;
if (!nativeRadio) {
event.currentTarget.checked = true;
schedulePropertyUpdate();
}
onChangeProp == null ? void 0 : onChangeProp(event);
if (event.defaultPrevented) return;
store == null ? void 0 : store.setValue(value);
});
const onClickProp = props.onClick;
const onClick = useEvent((event) => {
onClickProp == null ? void 0 : onClickProp(event);
if (event.defaultPrevented) return;
if (nativeRadio) return;
onChange(event);
});
const onFocusProp = props.onFocus;
const onFocus = useEvent((event) => {
onFocusProp == null ? void 0 : onFocusProp(event);
if (event.defaultPrevented) return;
if (!nativeRadio) return;
if (!store) return;
const { moves, activeId } = store.getState();
if (!moves) return;
if (id && activeId !== id) return;
onChange(event);
});
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
id,
role: !nativeRadio ? "radio" : void 0,
type: nativeRadio ? "radio" : void 0,
"aria-checked": isChecked
}, props), {
ref: useMergeRefs(ref, props.ref),
onChange,
onClick,
onFocus
});
props = useCompositeItem(_3YLGPPWQ_spreadValues({
store,
clickOnEnter: !nativeRadio
}, props));
return removeUndefinedValues(_3YLGPPWQ_spreadValues({
name: nativeRadio ? name : void 0,
value: nativeRadio ? value : void 0,
checked: isChecked
}, props));
});
var Radio = memo2(
forwardRef2(function Radio2(props) {
const htmlProps = useRadio(props);
return LMDWO4NN_createElement(NLEBE274_TagName, htmlProps);
})
);
;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/styles.js
function toggle_group_control_option_base_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const LabelView = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "et6ln9s1"
} : 0)( true ? {
name: "sln1fl",
styles: "display:inline-flex;max-width:100%;min-width:0;position:relative"
} : 0);
const labelBlock = true ? {
name: "82a6rk",
styles: "flex:1"
} : 0;
const buttonView = ({
isDeselectable,
isIcon,
isPressed,
size
}) => /* @__PURE__ */ emotion_react_browser_esm_css("align-items:center;appearance:none;background:transparent;border:none;border-radius:", config_values_default.radiusXSmall, ";color:", COLORS.theme.gray[700], ";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;@media not ( prefers-reduced-motion ){transition:background ", config_values_default.transitionDurationFast, " linear,color ", config_values_default.transitionDurationFast, " linear,font-weight 60ms linear;}user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&[disabled]{opacity:0.4;cursor:default;}&:active{background:", COLORS.ui.background, ";}", isDeselectable && deselectable, " ", isIcon && isIconStyles({
size
}), " ", isPressed && pressed, ";" + ( true ? "" : 0), true ? "" : 0);
const pressed = /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.theme.foregroundInverted, ";&:active{background:transparent;}" + ( true ? "" : 0), true ? "" : 0);
const deselectable = /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.theme.foreground, ";&:focus{box-shadow:inset 0 0 0 1px ", COLORS.ui.background, ",0 0 0 ", config_values_default.borderWidthFocus, " ", COLORS.theme.accent, ";outline:2px solid transparent;}" + ( true ? "" : 0), true ? "" : 0);
const ButtonContentView = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "et6ln9s0"
} : 0)("display:flex;font-size:", config_values_default.fontSize, ";line-height:1;" + ( true ? "" : 0));
const isIconStyles = ({
size = "default"
}) => {
const iconButtonSizes = {
default: "30px",
"__unstable-large": "32px"
};
return /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.theme.foreground, ";height:", iconButtonSizes[size], ";aspect-ratio:1;padding-left:0;padding-right:0;" + ( true ? "" : 0), true ? "" : 0);
};
;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/component.js
const {
/* ButtonContentView */ "Rp": component_ButtonContentView,
/* LabelView */ "y0": component_LabelView
} = toggle_group_control_option_base_styles_namespaceObject;
const WithToolTip = ({
showTooltip,
text,
children
}) => {
if (showTooltip && text) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip_default, {
text,
placement: "top",
children
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children
});
};
function ToggleGroupControlOptionBase(props, forwardedRef) {
const toggleGroupControlContext = useToggleGroupControlContext();
const id = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControlOptionBase, toggleGroupControlContext.baseId || "toggle-group-control-option-base");
const buttonProps = useContextSystem({
...props,
id
}, "ToggleGroupControlOptionBase");
const {
isBlock = false,
isDeselectable = false,
size = "default"
} = toggleGroupControlContext;
const {
className,
isIcon = false,
value,
children,
showTooltip = false,
disabled,
...otherButtonProps
} = buttonProps;
const isPressed = toggleGroupControlContext.value === value;
const cx = useCx();
const labelViewClasses = (0,external_wp_element_namespaceObject.useMemo)(() => cx(isBlock && labelBlock), [cx, isBlock]);
const itemClasses = (0,external_wp_element_namespaceObject.useMemo)(() => cx(buttonView({
isDeselectable,
isIcon,
isPressed,
size
}), className), [cx, isDeselectable, isIcon, isPressed, size, className]);
const buttonOnClick = () => {
if (isDeselectable && isPressed) {
toggleGroupControlContext.setValue(void 0);
} else {
toggleGroupControlContext.setValue(value);
}
};
const commonProps = {
...otherButtonProps,
className: itemClasses,
"data-value": value,
ref: forwardedRef
};
const labelRef = (0,external_wp_element_namespaceObject.useRef)(null);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (isPressed && labelRef.current) {
toggleGroupControlContext.setSelectedElement(labelRef.current);
}
}, [isPressed, toggleGroupControlContext]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_LabelView, {
ref: labelRef,
className: labelViewClasses,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WithToolTip, {
showTooltip,
text: otherButtonProps["aria-label"],
children: isDeselectable ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("button", {
...commonProps,
disabled,
"aria-pressed": isPressed,
type: "button",
onClick: buttonOnClick,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_ButtonContentView, {
children
})
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Radio, {
disabled,
onFocusVisible: () => {
const selectedValueIsEmpty = toggleGroupControlContext.value === null || toggleGroupControlContext.value === "";
if (!selectedValueIsEmpty || toggleGroupControlContext.activeItemIsNotFirstItem?.()) {
toggleGroupControlContext.setValue(value);
}
},
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("button", {
type: "button",
...commonProps
}),
value,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_ButtonContentView, {
children
})
})
})
});
}
const ConnectedToggleGroupControlOptionBase = contextConnect(ToggleGroupControlOptionBase, "ToggleGroupControlOptionBase");
var toggle_group_control_option_base_component_component_default = ConnectedToggleGroupControlOptionBase;
;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-icon/component.js
function UnforwardedToggleGroupControlOptionIcon(props, ref) {
const {
icon,
label,
...restProps
} = props;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_option_base_component_component_default, {
...restProps,
isIcon: true,
"aria-label": label,
showTooltip: true,
ref,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
icon
})
});
}
const ToggleGroupControlOptionIcon = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlOptionIcon);
var toggle_group_control_option_icon_component_component_default = ToggleGroupControlOptionIcon;
;// ./node_modules/@wordpress/components/build-module/border-control/border-control-style-picker/component.js
const BORDER_STYLES = [{
label: (0,external_wp_i18n_namespaceObject.__)("Solid"),
icon: line_solid_default,
value: "solid"
}, {
label: (0,external_wp_i18n_namespaceObject.__)("Dashed"),
icon: line_dashed_default,
value: "dashed"
}, {
label: (0,external_wp_i18n_namespaceObject.__)("Dotted"),
icon: line_dotted_default,
value: "dotted"
}];
function UnconnectedBorderControlStylePicker({
onChange,
...restProps
}, forwardedRef) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_component_component_default, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
ref: forwardedRef,
isDeselectable: true,
onChange: (value) => {
onChange?.(value);
},
...restProps,
children: BORDER_STYLES.map((borderStyle) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_option_icon_component_component_default, {
value: borderStyle.value,
icon: borderStyle.icon,
label: borderStyle.label
}, borderStyle.value))
});
}
const BorderControlStylePicker = contextConnect(UnconnectedBorderControlStylePicker, "BorderControlStylePicker");
var border_control_style_picker_component_component_default = BorderControlStylePicker;
;// ./node_modules/@wordpress/components/build-module/color-indicator/index.js
function UnforwardedColorIndicator(props, forwardedRef) {
const {
className,
colorValue,
...additionalProps
} = props;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: dist_clsx("component-color-indicator", className),
style: {
background: colorValue
},
ref: forwardedRef,
...additionalProps
});
}
const ColorIndicator = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedColorIndicator);
var color_indicator_default = ColorIndicator;
;// ./node_modules/colord/plugins/a11y.mjs
var a11y_o=function(o){var t=o/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},a11y_t=function(t){return.2126*a11y_o(t.r)+.7152*a11y_o(t.g)+.0722*a11y_o(t.b)};/* harmony default export */ function a11y(o){o.prototype.luminance=function(){return o=a11y_t(this.rgba),void 0===(r=2)&&(r=0),void 0===n&&(n=Math.pow(10,r)),Math.round(n*o)/n+0;var o,r,n},o.prototype.contrast=function(r){void 0===r&&(r="#FFF");var n,a,i,e,v,u,d,c=r instanceof o?r:new o(r);return e=this.rgba,v=c.toRgb(),u=a11y_t(e),d=a11y_t(v),n=u>d?(u+.05)/(d+.05):(d+.05)/(u+.05),void 0===(a=2)&&(a=0),void 0===i&&(i=Math.pow(10,a)),Math.floor(i*n)/i+0},o.prototype.isReadable=function(o,t){return void 0===o&&(o="#FFF"),void 0===t&&(t={}),this.contrast(o)>=(e=void 0===(i=(r=t).size)?"normal":i,"AAA"===(a=void 0===(n=r.level)?"AA":n)&&"normal"===e?7:"AA"===a&&"large"===e?3:4.5);var r,n,a,i,e}}
;// ./node_modules/@wordpress/components/build-module/dropdown/index.js
const UnconnectedDropdown = (props, forwardedRef) => {
const {
renderContent,
renderToggle,
className,
contentClassName,
expandOnMobile,
headerTitle,
focusOnMount,
popoverProps,
onClose,
onToggle,
style,
open,
defaultOpen,
// Deprecated props
position,
// From context system
variant
} = useContextSystem(props, "Dropdown");
if (position !== void 0) {
external_wp_deprecated_default()("`position` prop in wp.components.Dropdown", {
since: "6.2",
alternative: "`popoverProps.placement` prop",
hint: "Note that the `position` prop will override any values passed through the `popoverProps.placement` prop."
});
}
const [fallbackPopoverAnchor, setFallbackPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
const containerRef = (0,external_wp_element_namespaceObject.useRef)();
const [isOpen, setIsOpen] = useControlledValue({
defaultValue: defaultOpen,
value: open,
onChange: onToggle
});
function closeIfFocusOutside() {
if (!containerRef.current) {
return;
}
const {
ownerDocument
} = containerRef.current;
const dialog = ownerDocument?.activeElement?.closest('[role="dialog"]');
if (!containerRef.current.contains(ownerDocument.activeElement) && (!dialog || dialog.contains(containerRef.current))) {
close();
}
}
function close() {
onClose?.();
setIsOpen(false);
}
const args = {
isOpen: !!isOpen,
onToggle: () => setIsOpen(!isOpen),
onClose: close
};
const popoverPropsHaveAnchor = !!popoverProps?.anchor || // Note: `anchorRef`, `getAnchorRect` and `anchorRect` are deprecated and
// be removed from `Popover` from WordPress 6.3
!!popoverProps?.anchorRef || !!popoverProps?.getAnchorRect || !!popoverProps?.anchorRect;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className,
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([containerRef, forwardedRef, setFallbackPopoverAnchor]),
tabIndex: -1,
style,
children: [renderToggle(args), isOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(popover_default, {
position,
onClose: close,
onFocusOutside: closeIfFocusOutside,
expandOnMobile,
headerTitle,
focusOnMount,
offset: 13,
anchor: !popoverPropsHaveAnchor ? fallbackPopoverAnchor : void 0,
variant,
...popoverProps,
className: dist_clsx("components-dropdown__content", popoverProps?.className, contentClassName),
children: renderContent(args)
})]
});
};
const Dropdown = contextConnect(UnconnectedDropdown, "Dropdown");
var dropdown_default = Dropdown;
;// ./node_modules/@wordpress/components/build-module/input-control/input-suffix-wrapper.js
function UnconnectedInputControlSuffixWrapper(props, forwardedRef) {
const derivedProps = useContextSystem(props, "InputControlSuffixWrapper");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PrefixSuffixWrapper, {
...derivedProps,
ref: forwardedRef
});
}
const InputControlSuffixWrapper = contextConnect(UnconnectedInputControlSuffixWrapper, "InputControlSuffixWrapper");
var input_suffix_wrapper_default = InputControlSuffixWrapper;
;// ./node_modules/@wordpress/components/build-module/select-control/styles/select-control-styles.js
function select_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const select_control_styles_disabledStyles = ({
disabled
}) => {
if (!disabled) {
return "";
}
return /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.ui.textDisabled, ";cursor:default;" + ( true ? "" : 0), true ? "" : 0);
};
var select_control_styles_ref2 = true ? {
name: "1lv1yo7",
styles: "display:inline-flex"
} : 0;
const inputBaseVariantStyles = ({
variant
}) => {
if (variant === "minimal") {
return select_control_styles_ref2;
}
return "";
};
const StyledInputBase = /* @__PURE__ */ emotion_styled_base_browser_esm(input_base_default, true ? {
target: "e1mv6sxx3"
} : 0)("color:", COLORS.theme.foreground, ";cursor:pointer;", select_control_styles_disabledStyles, " ", inputBaseVariantStyles, ";" + ( true ? "" : 0));
const select_control_styles_sizeStyles = ({
__next40pxDefaultSize,
multiple,
selectSize = "default"
}) => {
if (multiple) {
return;
}
const sizes = {
default: {
height: 40,
minHeight: 40,
paddingTop: 0,
paddingBottom: 0
},
small: {
height: 24,
minHeight: 24,
paddingTop: 0,
paddingBottom: 0
},
compact: {
height: 32,
minHeight: 32,
paddingTop: 0,
paddingBottom: 0
},
"__unstable-large": {
height: 40,
minHeight: 40,
paddingTop: 0,
paddingBottom: 0
}
};
if (!__next40pxDefaultSize) {
sizes.default = sizes.compact;
}
const style = sizes[selectSize] || sizes.default;
return /* @__PURE__ */ emotion_react_browser_esm_css(style, true ? "" : 0, true ? "" : 0);
};
const chevronIconSize = 18;
const sizePaddings = ({
__next40pxDefaultSize,
multiple,
selectSize = "default"
}) => {
const padding = {
default: config_values_default.controlPaddingX,
small: config_values_default.controlPaddingXSmall,
compact: config_values_default.controlPaddingXSmall,
"__unstable-large": config_values_default.controlPaddingX
};
if (!__next40pxDefaultSize) {
padding.default = padding.compact;
}
const selectedPadding = padding[selectSize] || padding.default;
return rtl({
paddingLeft: selectedPadding,
paddingRight: selectedPadding + chevronIconSize,
...multiple ? {
paddingTop: selectedPadding,
paddingBottom: selectedPadding
} : {}
});
};
const overflowStyles = ({
multiple
}) => {
return {
overflow: multiple ? "auto" : "hidden"
};
};
var select_control_styles_ref = true ? {
name: "n1jncc",
styles: "field-sizing:content"
} : 0;
const variantStyles = ({
variant
}) => {
if (variant === "minimal") {
return select_control_styles_ref;
}
return "";
};
const Select = /* @__PURE__ */ emotion_styled_base_browser_esm("select", true ? {
target: "e1mv6sxx2"
} : 0)("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:currentColor;cursor:inherit;display:block;font-family:inherit;margin:0;width:100%;max-width:none;white-space:nowrap;text-overflow:ellipsis;", fontSizeStyles, ";", select_control_styles_sizeStyles, ";", sizePaddings, ";", overflowStyles, " ", variantStyles, ";}" + ( true ? "" : 0));
const DownArrowWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e1mv6sxx1"
} : 0)("margin-inline-end:", space(-1), ";line-height:0;path{fill:currentColor;}" + ( true ? "" : 0));
const InputControlSuffixWrapperWithClickThrough = /* @__PURE__ */ emotion_styled_base_browser_esm(input_suffix_wrapper_default, true ? {
target: "e1mv6sxx0"
} : 0)("position:absolute;pointer-events:none;", rtl({
right: 0
}), ";" + ( true ? "" : 0));
;// ./node_modules/@wordpress/icons/build-module/icon/index.js
var build_module_icon_icon_default = (0,external_wp_element_namespaceObject.forwardRef)(
({ icon, size = 24, ...props }, ref) => {
return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
width: size,
height: size,
...props,
ref
});
}
);
;// ./node_modules/@wordpress/icons/build-module/library/chevron-down.js
var chevron_down_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" }) });
;// ./node_modules/@wordpress/components/build-module/select-control/chevron-down.js
const SelectControlChevronDown = () => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputControlSuffixWrapperWithClickThrough, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DownArrowWrapper, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
icon: chevron_down_default,
size: chevronIconSize
})
})
});
};
var chevron_down_chevron_down_default = SelectControlChevronDown;
;// ./node_modules/@wordpress/components/build-module/select-control/index.js
function select_control_useUniqueId(idProp) {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(SelectControl);
const id = `inspector-select-control-${instanceId}`;
return idProp || id;
}
function SelectOptions({
options
}) {
return options.map(({
id,
label,
value,
...optionProps
}, index) => {
const key = id || `${label}-${value}-${index}`;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("option", {
value,
...optionProps,
children: label
}, key);
});
}
function UnforwardedSelectControl(props, ref) {
const {
className,
disabled = false,
help,
hideLabelFromVision,
id: idProp,
label,
multiple = false,
onChange,
options = [],
size = "default",
value: valueProp,
labelPosition = "top",
children,
prefix,
suffix,
variant = "default",
__next40pxDefaultSize = false,
__nextHasNoMarginBottom = false,
__shouldNotWarnDeprecated36pxSize,
...restProps
} = useDeprecated36pxDefaultSizeProp(props);
const id = select_control_useUniqueId(idProp);
const helpId = help ? `${id}__help` : void 0;
if (!options?.length && !children) {
return null;
}
const handleOnChange = (event) => {
if (props.multiple) {
const selectedOptions = Array.from(event.target.options).filter(({
selected
}) => selected);
const newValues = selectedOptions.map(({
value
}) => value);
props.onChange?.(newValues, {
event
});
return;
}
props.onChange?.(event.target.value, {
event
});
};
const classes = dist_clsx("components-select-control", className);
maybeWarnDeprecated36pxSize({
componentName: "SelectControl",
__next40pxDefaultSize,
size,
__shouldNotWarnDeprecated36pxSize
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default, {
help,
id,
className: classes,
__nextHasNoMarginBottom,
__associatedWPComponentName: "SelectControl",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledInputBase, {
disabled,
hideLabelFromVision,
id,
isBorderless: variant === "minimal",
label,
size,
suffix: suffix || !multiple && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(chevron_down_chevron_down_default, {}),
prefix,
labelPosition,
__unstableInputWidth: variant === "minimal" ? "auto" : void 0,
variant,
__next40pxDefaultSize,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Select, {
...restProps,
__next40pxDefaultSize,
"aria-describedby": helpId,
className: "components-select-control__input",
disabled,
id,
multiple,
onChange: handleOnChange,
ref,
selectSize: size,
value: valueProp,
variant,
children: children || /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectOptions, {
options
})
})
})
});
}
const SelectControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSelectControl);
var select_control_default = SelectControl;
;// ./node_modules/@wordpress/components/build-module/utils/hooks/use-controlled-state.js
const defaultOptions = {
initial: void 0,
/**
* Defaults to empty string, as that is preferred for usage with
* <input />, <textarea />, and <select /> form elements.
*/
fallback: ""
};
function useControlledState(currentState, options = defaultOptions) {
const {
initial,
fallback
} = {
...defaultOptions,
...options
};
const [internalState, setInternalState] = (0,external_wp_element_namespaceObject.useState)(currentState);
const hasCurrentState = isValueDefined(currentState);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (hasCurrentState && internalState) {
setInternalState(void 0);
}
}, [hasCurrentState, internalState]);
const state = getDefinedValue([currentState, internalState, initial], fallback);
const setState = (0,external_wp_element_namespaceObject.useCallback)((nextState) => {
if (!hasCurrentState) {
setInternalState(nextState);
}
}, [hasCurrentState]);
return [state, setState];
}
var use_controlled_state_default = useControlledState;
;// ./node_modules/@wordpress/components/build-module/range-control/utils.js
function floatClamp(value, min, max) {
if (typeof value !== "number") {
return null;
}
return parseFloat(`${math_clamp(value, min, max)}`);
}
function useControlledRangeValue(settings) {
const {
min,
max,
value: valueProp,
initial
} = settings;
const [state, setInternalState] = use_controlled_state_default(floatClamp(valueProp, min, max), {
initial: floatClamp(initial !== null && initial !== void 0 ? initial : null, min, max),
fallback: null
});
const setState = (0,external_wp_element_namespaceObject.useCallback)((nextValue) => {
if (nextValue === null) {
setInternalState(null);
} else {
setInternalState(floatClamp(nextValue, min, max));
}
}, [min, max, setInternalState]);
return [state, setState];
}
;// ./node_modules/@wordpress/components/build-module/range-control/styles/range-control-styles.js
function range_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const rangeHeightValue = 30;
const railHeight = 4;
const rangeHeight = () => /* @__PURE__ */ emotion_react_browser_esm_css({
height: rangeHeightValue,
minHeight: rangeHeightValue
}, true ? "" : 0, true ? "" : 0);
const thumbSize = 12;
const deprecatedHeight = ({
__next40pxDefaultSize
}) => !__next40pxDefaultSize && /* @__PURE__ */ emotion_react_browser_esm_css({
minHeight: rangeHeightValue
}, true ? "" : 0, true ? "" : 0);
const range_control_styles_Root = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e1epgpqk14"
} : 0)("-webkit-tap-highlight-color:transparent;align-items:center;display:flex;justify-content:flex-start;padding:0;position:relative;touch-action:none;width:100%;min-height:40px;", deprecatedHeight, ";" + ( true ? "" : 0));
const wrapperColor = ({
color = COLORS.ui.borderFocus
}) => /* @__PURE__ */ emotion_react_browser_esm_css({
color
}, true ? "" : 0, true ? "" : 0);
const wrapperMargin = ({
marks,
__nextHasNoMarginBottom
}) => {
if (!__nextHasNoMarginBottom) {
return /* @__PURE__ */ emotion_react_browser_esm_css({
marginBottom: marks ? 16 : void 0
}, true ? "" : 0, true ? "" : 0);
}
return "";
};
const range_control_styles_Wrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
shouldForwardProp: (prop) => !["color", "__nextHasNoMarginBottom", "marks"].includes(prop),
target: "e1epgpqk13"
} : 0)("display:block;flex:1;position:relative;width:100%;", wrapperColor, ";", rangeHeight, ";", wrapperMargin, ";" + ( true ? "" : 0));
const BeforeIconWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1epgpqk12"
} : 0)("display:flex;margin-top:", railHeight, "px;", rtl({
marginRight: 6
}), ";" + ( true ? "" : 0));
const AfterIconWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1epgpqk11"
} : 0)("display:flex;margin-top:", railHeight, "px;", rtl({
marginLeft: 6
}), ";" + ( true ? "" : 0));
const railBackgroundColor = ({
disabled,
railColor
}) => {
let background = railColor || "";
if (disabled) {
background = COLORS.ui.backgroundDisabled;
}
return /* @__PURE__ */ emotion_react_browser_esm_css({
background
}, true ? "" : 0, true ? "" : 0);
};
const Rail = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1epgpqk10"
} : 0)("background-color:", COLORS.gray[300], ";left:0;pointer-events:none;right:0;display:block;height:", railHeight, "px;position:absolute;margin-top:", (rangeHeightValue - railHeight) / 2, "px;top:0;border-radius:", config_values_default.radiusFull, ";", railBackgroundColor, ";" + ( true ? "" : 0));
const trackBackgroundColor = ({
disabled,
trackColor
}) => {
let background = trackColor || "currentColor";
if (disabled) {
background = COLORS.gray[400];
}
return /* @__PURE__ */ emotion_react_browser_esm_css({
background
}, true ? "" : 0, true ? "" : 0);
};
const Track = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1epgpqk9"
} : 0)("background-color:currentColor;border-radius:", config_values_default.radiusFull, ";height:", railHeight, "px;pointer-events:none;display:block;position:absolute;margin-top:", (rangeHeightValue - railHeight) / 2, "px;top:0;.is-marked &{@media not ( prefers-reduced-motion ){transition:width ease 0.1s;}}", trackBackgroundColor, ";" + ( true ? "" : 0));
const MarksWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1epgpqk8"
} : 0)( true ? {
name: "g5kg28",
styles: "display:block;pointer-events:none;position:relative;width:100%;user-select:none;margin-top:17px"
} : 0);
const Mark = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1epgpqk7"
} : 0)("position:absolute;left:0;top:-4px;height:4px;width:2px;transform:translateX( -50% );background-color:", COLORS.ui.background, ";z-index:1;" + ( true ? "" : 0));
const markLabelFill = ({
isFilled
}) => {
return /* @__PURE__ */ emotion_react_browser_esm_css({
color: isFilled ? COLORS.gray[700] : COLORS.gray[300]
}, true ? "" : 0, true ? "" : 0);
};
const MarkLabel = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1epgpqk6"
} : 0)("color:", COLORS.gray[300], ";font-size:11px;position:absolute;top:8px;white-space:nowrap;", rtl({
left: 0
}), ";", rtl({
transform: "translateX( -50% )"
}, {
transform: "translateX( 50% )"
}), ";", markLabelFill, ";" + ( true ? "" : 0));
const thumbColor = ({
disabled
}) => disabled ? /* @__PURE__ */ emotion_react_browser_esm_css("background-color:", COLORS.gray[400], ";" + ( true ? "" : 0), true ? "" : 0) : /* @__PURE__ */ emotion_react_browser_esm_css("background-color:", COLORS.theme.accent, ";" + ( true ? "" : 0), true ? "" : 0);
const ThumbWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1epgpqk5"
} : 0)("align-items:center;display:flex;height:", thumbSize, "px;justify-content:center;margin-top:", (rangeHeightValue - thumbSize) / 2, "px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:", thumbSize, "px;border-radius:", config_values_default.radiusRound, ";z-index:3;.is-marked &{@media not ( prefers-reduced-motion ){transition:left ease 0.1s;}}", thumbColor, ";", rtl({
marginLeft: -10
}), ";", rtl({
transform: "translateX( 4.5px )"
}, {
transform: "translateX( -4.5px )"
}), ";" + ( true ? "" : 0));
const thumbFocus = ({
isFocused
}) => {
return isFocused ? /* @__PURE__ */ emotion_react_browser_esm_css("&::before{content:' ';position:absolute;background-color:", COLORS.theme.accent, ";opacity:0.4;border-radius:", config_values_default.radiusRound, ";height:", thumbSize + 8, "px;width:", thumbSize + 8, "px;top:-4px;left:-4px;}" + ( true ? "" : 0), true ? "" : 0) : "";
};
const Thumb = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1epgpqk4"
} : 0)("align-items:center;border-radius:", config_values_default.radiusRound, ";height:100%;outline:0;position:absolute;user-select:none;width:100%;box-shadow:", config_values_default.elevationXSmall, ";", thumbColor, ";", thumbFocus, ";" + ( true ? "" : 0));
const InputRange = /* @__PURE__ */ emotion_styled_base_browser_esm("input", true ? {
target: "e1epgpqk3"
} : 0)("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -", thumbSize / 2, "px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ", thumbSize, "px );" + ( true ? "" : 0));
const tooltipShow = ({
show
}) => {
return /* @__PURE__ */ emotion_react_browser_esm_css("display:", show ? "inline-block" : "none", ";opacity:", show ? 1 : 0, ";@media not ( prefers-reduced-motion ){transition:opacity 120ms ease,display 120ms ease allow-discrete;}@starting-style{opacity:0;}" + ( true ? "" : 0), true ? "" : 0);
};
var range_control_styles_ref = true ? {
name: "1cypxip",
styles: "top:-80%"
} : 0;
var range_control_styles_ref2 = true ? {
name: "1lr98c4",
styles: "bottom:-80%"
} : 0;
const tooltipPlacement = ({
placement
}) => {
const isBottom = placement === "bottom";
if (isBottom) {
return range_control_styles_ref2;
}
return range_control_styles_ref;
};
const range_control_styles_Tooltip = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1epgpqk2"
} : 0)("background:rgba( 0, 0, 0, 0.8 );border-radius:", config_values_default.radiusSmall, ";color:white;font-size:12px;min-width:32px;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;user-select:none;line-height:1.4;", tooltipShow, ";", tooltipPlacement, ";", rtl({
transform: "translateX(-50%)"
}, {
transform: "translateX(50%)"
}), ";" + ( true ? "" : 0));
const InputNumber = /* @__PURE__ */ emotion_styled_base_browser_esm(number_control_default, true ? {
target: "e1epgpqk1"
} : 0)("display:inline-block;font-size:13px;margin-top:0;input[type='number']&{", rangeHeight, ";}", rtl({
marginLeft: `${space(4)} !important`
}), ";" + ( true ? "" : 0));
const ActionRightWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1epgpqk0"
} : 0)("display:block;margin-top:0;button,button.is-small{margin-left:0;", rangeHeight, ";}", rtl({
marginLeft: 8
}), ";" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/range-control/input-range.js
function input_range_InputRange(props, ref) {
const {
describedBy,
label,
value,
...otherProps
} = props;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputRange, {
...otherProps,
"aria-describedby": describedBy,
"aria-label": label,
"aria-hidden": false,
ref,
tabIndex: 0,
type: "range",
value
});
}
const input_range_ForwardedComponent = (0,external_wp_element_namespaceObject.forwardRef)(input_range_InputRange);
var input_range_default = input_range_ForwardedComponent;
;// ./node_modules/@wordpress/components/build-module/range-control/mark.js
function RangeMark(props) {
const {
className,
isFilled = false,
label,
style = {},
...otherProps
} = props;
const classes = dist_clsx("components-range-control__mark", isFilled && "is-filled", className);
const labelClasses = dist_clsx("components-range-control__mark-label", isFilled && "is-filled");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Mark, {
...otherProps,
"aria-hidden": "true",
className: classes,
style
}), label && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MarkLabel, {
"aria-hidden": "true",
className: labelClasses,
isFilled,
style,
children: label
})]
});
}
;// ./node_modules/@wordpress/components/build-module/range-control/rail.js
function RangeRail(props) {
const {
disabled = false,
marks = false,
min = 0,
max = 100,
step = 1,
value = 0,
...restProps
} = props;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Rail, {
disabled,
...restProps
}), marks && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Marks, {
disabled,
marks,
min,
max,
step,
value
})]
});
}
function Marks(props) {
const {
disabled = false,
marks = false,
min = 0,
max = 100,
step: stepProp = 1,
value = 0
} = props;
const step = stepProp === "any" ? 1 : stepProp;
const marksData = useMarks({
marks,
min,
max,
step,
value
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MarksWrapper, {
"aria-hidden": "true",
className: "components-range-control__marks",
children: marksData.map((mark) => /* @__PURE__ */ (0,external_React_.createElement)(RangeMark, {
...mark,
key: mark.key,
"aria-hidden": "true",
disabled
}))
});
}
function useMarks({
marks,
min = 0,
max = 100,
step = 1,
value = 0
}) {
if (!marks) {
return [];
}
const range = max - min;
if (!Array.isArray(marks)) {
marks = [];
const count = 1 + Math.round(range / step);
while (count > marks.push({
value: step * marks.length + min
})) {
}
}
const placedMarks = [];
marks.forEach((mark, index) => {
if (mark.value < min || mark.value > max) {
return;
}
const key = `mark-${index}`;
const isFilled = mark.value <= value;
const offset = `${(mark.value - min) / range * 100}%`;
const offsetStyle = {
[(0,external_wp_i18n_namespaceObject.isRTL)() ? "right" : "left"]: offset
};
placedMarks.push({
...mark,
isFilled,
key,
style: offsetStyle
});
});
return placedMarks;
}
;// ./node_modules/@wordpress/components/build-module/range-control/tooltip.js
function SimpleTooltip(props) {
const {
className,
inputRef,
tooltipPlacement,
show = false,
style = {},
value = 0,
renderTooltipContent = (v) => v,
zIndex = 100,
...restProps
} = props;
const placement = useTooltipPlacement({
inputRef,
tooltipPlacement
});
const classes = dist_clsx("components-simple-tooltip", className);
const styles = {
...style,
zIndex
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(range_control_styles_Tooltip, {
...restProps,
"aria-hidden": "false",
className: classes,
placement,
show,
role: "tooltip",
style: styles,
children: renderTooltipContent(value)
});
}
function useTooltipPlacement({
inputRef,
tooltipPlacement
}) {
const [placement, setPlacement] = (0,external_wp_element_namespaceObject.useState)();
const setTooltipPlacement = (0,external_wp_element_namespaceObject.useCallback)(() => {
if (inputRef && inputRef.current) {
setPlacement(tooltipPlacement);
}
}, [tooltipPlacement, inputRef]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
setTooltipPlacement();
}, [setTooltipPlacement]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
window.addEventListener("resize", setTooltipPlacement);
return () => {
window.removeEventListener("resize", setTooltipPlacement);
};
});
return placement;
}
;// ./node_modules/@wordpress/components/build-module/range-control/index.js
const range_control_noop = () => {
};
function computeResetValue({
resetFallbackValue,
initialPosition
}) {
if (resetFallbackValue !== void 0) {
return !Number.isNaN(resetFallbackValue) ? resetFallbackValue : null;
}
if (initialPosition !== void 0) {
return !Number.isNaN(initialPosition) ? initialPosition : null;
}
return null;
}
function UnforwardedRangeControl(props, forwardedRef) {
const {
__nextHasNoMarginBottom = false,
afterIcon,
allowReset = false,
beforeIcon,
className,
color: colorProp = COLORS.theme.accent,
currentInput,
disabled = false,
help,
hideLabelFromVision = false,
initialPosition,
isShiftStepEnabled = true,
label,
marks = false,
max = 100,
min = 0,
onBlur = range_control_noop,
onChange = range_control_noop,
onFocus = range_control_noop,
onMouseLeave = range_control_noop,
onMouseMove = range_control_noop,
railColor,
renderTooltipContent = (v) => v,
resetFallbackValue,
__next40pxDefaultSize = false,
shiftStep = 10,
showTooltip: showTooltipProp,
step = 1,
trackColor,
value: valueProp,
withInputField = true,
__shouldNotWarnDeprecated36pxSize,
...otherProps
} = props;
const [value, setValue] = useControlledRangeValue({
min,
max,
value: valueProp !== null && valueProp !== void 0 ? valueProp : null,
initial: initialPosition
});
const isResetPendent = (0,external_wp_element_namespaceObject.useRef)(false);
let hasTooltip = showTooltipProp;
let hasInputField = withInputField;
if (step === "any") {
hasTooltip = false;
hasInputField = false;
}
const [showTooltip, setShowTooltip] = (0,external_wp_element_namespaceObject.useState)(hasTooltip);
const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false);
const inputRef = (0,external_wp_element_namespaceObject.useRef)();
const isCurrentlyFocused = inputRef.current?.matches(":focus");
const isThumbFocused = !disabled && isFocused;
const isValueReset = value === null;
const currentValue = value !== void 0 ? value : currentInput;
const inputSliderValue = isValueReset ? "" : currentValue;
const rangeFillValue = isValueReset ? (max - min) / 2 + min : value;
const fillValue = isValueReset ? 50 : (value - min) / (max - min) * 100;
const fillValueOffset = `${math_clamp(fillValue, 0, 100)}%`;
const classes = dist_clsx("components-range-control", className);
const wrapperClasses = dist_clsx("components-range-control__wrapper", !!marks && "is-marked");
const id = (0,external_wp_compose_namespaceObject.useInstanceId)(UnforwardedRangeControl, "inspector-range-control");
const describedBy = !!help ? `${id}__help` : void 0;
const enableTooltip = hasTooltip !== false && Number.isFinite(value);
const handleOnRangeChange = (event) => {
const nextValue = parseFloat(event.target.value);
setValue(nextValue);
onChange(nextValue);
};
const handleOnChange = (next) => {
let nextValue = parseFloat(next);
setValue(nextValue);
if (!isNaN(nextValue)) {
if (nextValue < min || nextValue > max) {
nextValue = floatClamp(nextValue, min, max);
}
onChange(nextValue);
isResetPendent.current = false;
} else if (allowReset) {
isResetPendent.current = true;
}
};
const handleOnInputNumberBlur = () => {
if (isResetPendent.current) {
handleOnReset();
isResetPendent.current = false;
}
};
const handleOnReset = () => {
const resetValue = Number.isNaN(resetFallbackValue) ? null : resetFallbackValue !== null && resetFallbackValue !== void 0 ? resetFallbackValue : null;
setValue(resetValue);
onChange(resetValue !== null && resetValue !== void 0 ? resetValue : void 0);
};
const handleShowTooltip = () => setShowTooltip(true);
const handleHideTooltip = () => setShowTooltip(false);
const handleOnBlur = (event) => {
onBlur(event);
setIsFocused(false);
handleHideTooltip();
};
const handleOnFocus = (event) => {
onFocus(event);
setIsFocused(true);
handleShowTooltip();
};
const offsetStyle = {
[(0,external_wp_i18n_namespaceObject.isRTL)() ? "right" : "left"]: fillValueOffset
};
maybeWarnDeprecated36pxSize({
componentName: "RangeControl",
__next40pxDefaultSize,
size: void 0,
__shouldNotWarnDeprecated36pxSize
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default, {
__nextHasNoMarginBottom,
__associatedWPComponentName: "RangeControl",
className: classes,
label,
hideLabelFromVision,
id: `${id}`,
help,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(range_control_styles_Root, {
className: "components-range-control__root",
__next40pxDefaultSize,
children: [beforeIcon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BeforeIconWrapper, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
icon: beforeIcon
})
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(range_control_styles_Wrapper, {
__nextHasNoMarginBottom,
className: wrapperClasses,
color: colorProp,
marks: !!marks,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(input_range_default, {
...otherProps,
className: "components-range-control__slider",
describedBy,
disabled,
id: `${id}`,
label,
max,
min,
onBlur: handleOnBlur,
onChange: handleOnRangeChange,
onFocus: handleOnFocus,
onMouseMove,
onMouseLeave,
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([inputRef, forwardedRef]),
step,
value: inputSliderValue !== null && inputSliderValue !== void 0 ? inputSliderValue : void 0
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RangeRail, {
"aria-hidden": true,
disabled,
marks,
max,
min,
railColor,
step,
value: rangeFillValue
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Track, {
"aria-hidden": true,
className: "components-range-control__track",
disabled,
style: {
width: fillValueOffset
},
trackColor
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ThumbWrapper, {
className: "components-range-control__thumb-wrapper",
style: offsetStyle,
disabled,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Thumb, {
"aria-hidden": true,
isFocused: isThumbFocused,
disabled
})
}), enableTooltip && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SimpleTooltip, {
className: "components-range-control__tooltip",
inputRef,
tooltipPlacement: "bottom",
renderTooltipContent,
show: isCurrentlyFocused || showTooltip,
style: offsetStyle,
value
})]
}), afterIcon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(AfterIconWrapper, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
icon: afterIcon
})
}), hasInputField && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputNumber, {
"aria-label": label,
className: "components-range-control__number",
disabled,
inputMode: "decimal",
isShiftStepEnabled,
max,
min,
onBlur: handleOnInputNumberBlur,
onChange: handleOnChange,
shiftStep,
size: __next40pxDefaultSize ? "__unstable-large" : "default",
__unstableInputWidth: __next40pxDefaultSize ? space(20) : space(16),
step,
value: inputSliderValue,
__shouldNotWarnDeprecated36pxSize: true
}), allowReset && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionRightWrapper, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
className: "components-range-control__reset",
accessibleWhenDisabled: !disabled,
disabled: disabled || value === computeResetValue({
resetFallbackValue,
initialPosition
}),
variant: "secondary",
size: "small",
onClick: handleOnReset,
children: (0,external_wp_i18n_namespaceObject.__)("Reset")
})
})]
})
});
}
const RangeControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedRangeControl);
var range_control_default = RangeControl;
;// ./node_modules/@wordpress/components/build-module/color-picker/styles.js
const NumberControlWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm(number_control_default, true ? {
target: "ez9hsf46"
} : 0)("width:", space(24), ";" + ( true ? "" : 0));
const styles_SelectControl = /* @__PURE__ */ emotion_styled_base_browser_esm(select_control_default, true ? {
target: "ez9hsf45"
} : 0)("margin-left:", space(-2), ";" + ( true ? "" : 0));
const styles_RangeControl = /* @__PURE__ */ emotion_styled_base_browser_esm(range_control_default, true ? {
target: "ez9hsf44"
} : 0)("flex:1;margin-right:", space(2), ";" + ( true ? "" : 0));
const interactiveHueStyles = `
.react-colorful__interactive {
width: calc( 100% - ${space(2)} );
margin-left: ${space(1)};
}`;
const AuxiliaryColorArtefactWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "ez9hsf43"
} : 0)("padding-top:", space(2), ";padding-right:0;padding-left:0;padding-bottom:0;" + ( true ? "" : 0));
const AuxiliaryColorArtefactHStackHeader = /* @__PURE__ */ emotion_styled_base_browser_esm(h_stack_component_component_default, true ? {
target: "ez9hsf42"
} : 0)("padding-left:", space(4), ";padding-right:", space(4), ";" + ( true ? "" : 0));
const ColorInputWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm(flex_component_component_default, true ? {
target: "ez9hsf41"
} : 0)("padding-top:", space(4), ";padding-left:", space(4), ";padding-right:", space(3), ";padding-bottom:", space(5), ";" + ( true ? "" : 0));
const ColorfulWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "ez9hsf40"
} : 0)(boxSizingReset, ";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:", space(4), ";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:", config_values_default.radiusFull, ";margin-bottom:", space(2), ";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;@media not ( prefers-reduced-motion ){transition:transform ", config_values_default.transitionDurationFast, " ease-in-out;}}.react-colorful__interactive:focus .react-colorful__pointer{box-shadow:0 0 0 ", config_values_default.borderWidthFocus, " ", config_values_default.surfaceColor, ";border:", config_values_default.borderWidthFocus, " solid black;transform:translate( -50%, -50% ) scale( 1.5 );}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ", config_values_default.borderWidthFocus, " #fff;}", interactiveHueStyles, ";" + ( true ? "" : 0));
;// ./node_modules/@wordpress/icons/build-module/library/check.js
var check_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/copy.js
var copy_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"
}
) });
;// ./node_modules/@wordpress/components/build-module/color-picker/color-copy-button.js
const ColorCopyButton = (props) => {
const {
color,
colorType
} = props;
const [copiedColor, setCopiedColor] = (0,external_wp_element_namespaceObject.useState)(null);
const copyTimerRef = (0,external_wp_element_namespaceObject.useRef)();
const copyRef = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(() => {
switch (colorType) {
case "hsl": {
return color.toHslString();
}
case "rgb": {
return color.toRgbString();
}
default:
case "hex": {
return color.toHex();
}
}
}, () => {
if (copyTimerRef.current) {
clearTimeout(copyTimerRef.current);
}
setCopiedColor(color.toHex());
copyTimerRef.current = setTimeout(() => {
setCopiedColor(null);
copyTimerRef.current = void 0;
}, 3e3);
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
return () => {
if (copyTimerRef.current) {
clearTimeout(copyTimerRef.current);
}
};
}, []);
const isCopied = copiedColor === color.toHex();
const label = isCopied ? (0,external_wp_i18n_namespaceObject.__)("Copied!") : (0,external_wp_i18n_namespaceObject.__)("Copy");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip_default, {
delay: 0,
hideOnClick: false,
text: label,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Button, {
size: "compact",
"aria-label": label,
ref: copyRef,
icon: isCopied ? check_default : copy_default,
showTooltip: false
})
});
};
;// ./node_modules/@wordpress/components/build-module/input-control/input-prefix-wrapper.js
function UnconnectedInputControlPrefixWrapper(props, forwardedRef) {
const derivedProps = useContextSystem(props, "InputControlPrefixWrapper");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PrefixSuffixWrapper, {
...derivedProps,
isPrefix: true,
ref: forwardedRef
});
}
const InputControlPrefixWrapper = contextConnect(UnconnectedInputControlPrefixWrapper, "InputControlPrefixWrapper");
var input_prefix_wrapper_default = InputControlPrefixWrapper;
;// ./node_modules/@wordpress/components/build-module/color-picker/input-with-slider.js
const InputWithSlider = ({
min,
max,
label,
abbreviation,
onChange,
value
}) => {
const onNumberControlChange = (newValue) => {
if (!newValue) {
onChange(0);
return;
}
if (typeof newValue === "string") {
onChange(parseInt(newValue, 10));
return;
}
onChange(newValue);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
spacing: 4,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NumberControlWrapper, {
__next40pxDefaultSize: true,
min,
max,
label,
hideLabelFromVision: true,
value,
onChange: onNumberControlChange,
prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(input_prefix_wrapper_default, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(text_component_component_default, {
color: COLORS.theme.accent,
lineHeight: 1,
children: abbreviation
})
}),
spinControls: "none"
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_RangeControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label,
hideLabelFromVision: true,
min,
max,
value,
onChange,
withInputField: false
})]
});
};
;// ./node_modules/@wordpress/components/build-module/color-picker/rgb-input.js
const RgbInput = ({
color,
onChange,
enableAlpha
}) => {
const {
r,
g,
b,
a
} = color.toRgb();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
min: 0,
max: 255,
label: "Red",
abbreviation: "R",
value: r,
onChange: (nextR) => onChange(w({
r: nextR,
g,
b,
a
}))
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
min: 0,
max: 255,
label: "Green",
abbreviation: "G",
value: g,
onChange: (nextG) => onChange(w({
r,
g: nextG,
b,
a
}))
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
min: 0,
max: 255,
label: "Blue",
abbreviation: "B",
value: b,
onChange: (nextB) => onChange(w({
r,
g,
b: nextB,
a
}))
}), enableAlpha && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
min: 0,
max: 100,
label: "Alpha",
abbreviation: "A",
value: Math.trunc(a * 100),
onChange: (nextA) => onChange(w({
r,
g,
b,
a: nextA / 100
}))
})]
});
};
;// ./node_modules/@wordpress/components/build-module/color-picker/hsl-input.js
const HslInput = ({
color,
onChange,
enableAlpha
}) => {
const colorPropHSLA = (0,external_wp_element_namespaceObject.useMemo)(() => color.toHsl(), [color]);
const [internalHSLA, setInternalHSLA] = (0,external_wp_element_namespaceObject.useState)({
...colorPropHSLA
});
const isInternalColorSameAsReceivedColor = color.isEqual(w(internalHSLA));
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isInternalColorSameAsReceivedColor) {
setInternalHSLA(colorPropHSLA);
}
}, [colorPropHSLA, isInternalColorSameAsReceivedColor]);
const colorValue = isInternalColorSameAsReceivedColor ? internalHSLA : colorPropHSLA;
const updateHSLAValue = (partialNewValue) => {
const nextOnChangeValue = w({
...colorValue,
...partialNewValue
});
if (!color.isEqual(nextOnChangeValue)) {
onChange(nextOnChangeValue);
} else {
setInternalHSLA((prevHSLA) => ({
...prevHSLA,
...partialNewValue
}));
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
min: 0,
max: 359,
label: "Hue",
abbreviation: "H",
value: colorValue.h,
onChange: (nextH) => {
updateHSLAValue({
h: nextH
});
}
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
min: 0,
max: 100,
label: "Saturation",
abbreviation: "S",
value: colorValue.s,
onChange: (nextS) => {
updateHSLAValue({
s: nextS
});
}
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
min: 0,
max: 100,
label: "Lightness",
abbreviation: "L",
value: colorValue.l,
onChange: (nextL) => {
updateHSLAValue({
l: nextL
});
}
}), enableAlpha && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
min: 0,
max: 100,
label: "Alpha",
abbreviation: "A",
value: Math.trunc(100 * colorValue.a),
onChange: (nextA) => {
updateHSLAValue({
a: nextA / 100
});
}
})]
});
};
;// ./node_modules/@wordpress/components/build-module/color-picker/hex-input.js
const HexInput = ({
color,
onChange,
enableAlpha
}) => {
const handleChange = (nextValue) => {
if (!nextValue) {
return;
}
const hexValue = nextValue.startsWith("#") ? nextValue : "#" + nextValue;
onChange(w(hexValue));
};
const stateReducer = (state, action) => {
const nativeEvent = action.payload?.event?.nativeEvent;
if ("insertFromPaste" !== nativeEvent?.inputType) {
return {
...state
};
}
const value = state.value?.startsWith("#") ? state.value.slice(1).toUpperCase() : state.value?.toUpperCase();
return {
...state,
value
};
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputControl, {
prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(input_prefix_wrapper_default, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(text_component_component_default, {
color: COLORS.theme.accent,
lineHeight: 1,
children: "#"
})
}),
value: color.toHex().slice(1).toUpperCase(),
onChange: handleChange,
maxLength: enableAlpha ? 9 : 7,
label: (0,external_wp_i18n_namespaceObject.__)("Hex color"),
hideLabelFromVision: true,
size: "__unstable-large",
__unstableStateReducer: stateReducer,
__unstableInputWidth: "9em"
});
};
;// ./node_modules/@wordpress/components/build-module/color-picker/color-input.js
const ColorInput = ({
colorType,
color,
onChange,
enableAlpha
}) => {
const props = {
color,
onChange,
enableAlpha
};
switch (colorType) {
case "hsl":
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HslInput, {
...props
});
case "rgb":
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RgbInput, {
...props
});
default:
case "hex":
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HexInput, {
...props
});
}
};
;// ./node_modules/react-colorful/dist/index.mjs
function dist_u(){return(dist_u=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function dist_c(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r.indexOf(t=a[n])>=0||(o[t]=e[t]);return o}function dist_i(e){var t=(0,external_React_.useRef)(e),n=(0,external_React_.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var dist_s=function(e,r,t){return void 0===r&&(r=0),void 0===t&&(t=1),e>t?t:e<r?r:e},dist_f=function(e){return"touches"in e},dist_v=function(e){return e&&e.ownerDocument.defaultView||self},dist_d=function(e,r,t){var n=e.getBoundingClientRect(),o=dist_f(r)?function(e,r){for(var t=0;t<e.length;t++)if(e[t].identifier===r)return e[t];return e[0]}(r.touches,t):r;return{left:dist_s((o.pageX-(n.left+dist_v(e).pageXOffset))/n.width),top:dist_s((o.pageY-(n.top+dist_v(e).pageYOffset))/n.height)}},dist_h=function(e){!dist_f(e)&&e.preventDefault()},dist_m=external_React_.memo(function(o){var a=o.onMove,l=o.onKey,s=dist_c(o,["onMove","onKey"]),m=(0,external_React_.useRef)(null),g=dist_i(a),p=dist_i(l),b=(0,external_React_.useRef)(null),_=(0,external_React_.useRef)(!1),x=(0,external_React_.useMemo)(function(){var e=function(e){dist_h(e),(dist_f(e)?e.touches.length>0:e.buttons>0)&&m.current?g(dist_d(m.current,e,b.current)):t(!1)},r=function(){return t(!1)};function t(t){var n=_.current,o=dist_v(m.current),a=t?o.addEventListener:o.removeEventListener;a(n?"touchmove":"mousemove",e),a(n?"touchend":"mouseup",r)}return[function(e){var r=e.nativeEvent,n=m.current;if(n&&(dist_h(r),!function(e,r){return r&&!dist_f(e)}(r,_.current)&&n)){if(dist_f(r)){_.current=!0;var o=r.changedTouches||[];o.length&&(b.current=o[0].identifier)}n.focus(),g(dist_d(n,r,b.current)),t(!0)}},function(e){var r=e.which||e.keyCode;r<37||r>40||(e.preventDefault(),p({left:39===r?.05:37===r?-.05:0,top:40===r?.05:38===r?-.05:0}))},t]},[p,g]),C=x[0],E=x[1],H=x[2];return (0,external_React_.useEffect)(function(){return H},[H]),external_React_.createElement("div",dist_u({},s,{onTouchStart:C,onMouseDown:C,className:"react-colorful__interactive",ref:m,onKeyDown:E,tabIndex:0,role:"slider"}))}),dist_g=function(e){return e.filter(Boolean).join(" ")},dist_p=function(r){var t=r.color,n=r.left,o=r.top,a=void 0===o?.5:o,l=dist_g(["react-colorful__pointer",r.className]);return external_React_.createElement("div",{className:l,style:{top:100*a+"%",left:100*n+"%"}},external_React_.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},dist_b=function(e,r,t){return void 0===r&&(r=0),void 0===t&&(t=Math.pow(10,r)),Math.round(t*e)/t},_={grad:.9,turn:360,rad:360/(2*Math.PI)},dist_x=function(e){return L(C(e))},C=function(e){return"#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?dist_b(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?dist_b(parseInt(e.substring(6,8),16)/255,2):1}},dist_E=function(e,r){return void 0===r&&(r="deg"),Number(e)*(_[r]||1)},dist_H=function(e){var r=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?dist_N({h:dist_E(r[1],r[2]),s:Number(r[3]),l:Number(r[4]),a:void 0===r[5]?1:Number(r[5])/(r[6]?100:1)}):{h:0,s:0,v:0,a:1}},dist_M=dist_H,dist_N=function(e){var r=e.s,t=e.l;return{h:e.h,s:(r*=(t<50?t:100-t)/100)>0?2*r/(t+r)*100:0,v:t+r,a:e.a}},dist_w=function(e){return K(dist_I(e))},dist_y=function(e){var r=e.s,t=e.v,n=e.a,o=(200-r)*t/100;return{h:dist_b(e.h),s:dist_b(o>0&&o<200?r*t/100/(o<=100?o:200-o)*100:0),l:dist_b(o/2),a:dist_b(n,2)}},q=function(e){var r=dist_y(e);return"hsl("+r.h+", "+r.s+"%, "+r.l+"%)"},dist_k=function(e){var r=dist_y(e);return"hsla("+r.h+", "+r.s+"%, "+r.l+"%, "+r.a+")"},dist_I=function(e){var r=e.h,t=e.s,n=e.v,o=e.a;r=r/360*6,t/=100,n/=100;var a=Math.floor(r),l=n*(1-t),u=n*(1-(r-a)*t),c=n*(1-(1-r+a)*t),i=a%6;return{r:dist_b(255*[n,u,l,l,c,n][i]),g:dist_b(255*[c,n,n,u,l,l][i]),b:dist_b(255*[l,l,c,n,n,u][i]),a:dist_b(o,2)}},O=function(e){var r=/hsva?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?A({h:dist_E(r[1],r[2]),s:Number(r[3]),v:Number(r[4]),a:void 0===r[5]?1:Number(r[5])/(r[6]?100:1)}):{h:0,s:0,v:0,a:1}},dist_j=O,z=function(e){var r=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?L({r:Number(r[1])/(r[2]?100/255:1),g:Number(r[3])/(r[4]?100/255:1),b:Number(r[5])/(r[6]?100/255:1),a:void 0===r[7]?1:Number(r[7])/(r[8]?100:1)}):{h:0,s:0,v:0,a:1}},B=z,D=function(e){var r=e.toString(16);return r.length<2?"0"+r:r},K=function(e){var r=e.r,t=e.g,n=e.b,o=e.a,a=o<1?D(dist_b(255*o)):"";return"#"+D(r)+D(t)+D(n)+a},L=function(e){var r=e.r,t=e.g,n=e.b,o=e.a,a=Math.max(r,t,n),l=a-Math.min(r,t,n),u=l?a===r?(t-n)/l:a===t?2+(n-r)/l:4+(r-t)/l:0;return{h:dist_b(60*(u<0?u+6:u)),s:dist_b(a?l/a*100:0),v:dist_b(a/255*100),a:o}},A=function(e){return{h:dist_b(e.h),s:dist_b(e.s),v:dist_b(e.v),a:dist_b(e.a,2)}},dist_S=external_React_.memo(function(r){var t=r.hue,n=r.onChange,o=dist_g(["react-colorful__hue",r.className]);return external_React_.createElement("div",{className:o},external_React_.createElement(dist_m,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:dist_s(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":dist_b(t),"aria-valuemax":"360","aria-valuemin":"0"},external_React_.createElement(dist_p,{className:"react-colorful__hue-pointer",left:t/360,color:q({h:t,s:100,v:100,a:1})})))}),T=external_React_.memo(function(r){var t=r.hsva,n=r.onChange,o={backgroundColor:q({h:t.h,s:100,v:100,a:1})};return external_React_.createElement("div",{className:"react-colorful__saturation",style:o},external_React_.createElement(dist_m,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:dist_s(t.s+100*e.left,0,100),v:dist_s(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+dist_b(t.s)+"%, Brightness "+dist_b(t.v)+"%"},external_React_.createElement(dist_p,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:q(t)})))}),F=function(e,r){if(e===r)return!0;for(var t in e)if(e[t]!==r[t])return!1;return!0},P=function(e,r){return e.replace(/\s/g,"")===r.replace(/\s/g,"")},X=function(e,r){return e.toLowerCase()===r.toLowerCase()||F(C(e),C(r))};function Y(e,t,l){var u=dist_i(l),c=(0,external_React_.useState)(function(){return e.toHsva(t)}),s=c[0],f=c[1],v=(0,external_React_.useRef)({color:t,hsva:s});(0,external_React_.useEffect)(function(){if(!e.equal(t,v.current.color)){var r=e.toHsva(t);v.current={hsva:r,color:t},f(r)}},[t,e]),(0,external_React_.useEffect)(function(){var r;F(s,v.current.hsva)||e.equal(r=e.fromHsva(s),v.current.color)||(v.current={hsva:s,color:r},u(r))},[s,e,u]);var d=(0,external_React_.useCallback)(function(e){f(function(r){return Object.assign({},r,e)})},[]);return[s,d]}var R,dist_V="undefined"!=typeof window?external_React_.useLayoutEffect:external_React_.useEffect,dist_$=function(){return R||( true?__webpack_require__.nc:0)},G=function(e){R=e},J=new Map,Q=function(e){dist_V(function(){var r=e.current?e.current.ownerDocument:document;if(void 0!==r&&!J.has(r)){var t=r.createElement("style");t.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',J.set(r,t);var n=dist_$();n&&t.setAttribute("nonce",n),r.head.appendChild(t)}},[])},U=function(t){var n=t.className,o=t.colorModel,a=t.color,l=void 0===a?o.defaultColor:a,i=t.onChange,s=dist_c(t,["className","colorModel","color","onChange"]),f=(0,external_React_.useRef)(null);Q(f);var v=Y(o,l,i),d=v[0],h=v[1],m=dist_g(["react-colorful",n]);return external_React_.createElement("div",dist_u({},s,{ref:f,className:m}),external_React_.createElement(T,{hsva:d,onChange:h}),external_React_.createElement(dist_S,{hue:d.h,onChange:h,className:"react-colorful__last-control"}))},W={defaultColor:"000",toHsva:dist_x,fromHsva:function(e){return dist_w({h:e.h,s:e.s,v:e.v,a:1})},equal:X},Z=function(r){return e.createElement(U,dist_u({},r,{colorModel:W}))},ee=function(r){var t=r.className,n=r.hsva,o=r.onChange,a={backgroundImage:"linear-gradient(90deg, "+dist_k(Object.assign({},n,{a:0}))+", "+dist_k(Object.assign({},n,{a:1}))+")"},l=dist_g(["react-colorful__alpha",t]),u=dist_b(100*n.a);return external_React_.createElement("div",{className:l},external_React_.createElement("div",{className:"react-colorful__alpha-gradient",style:a}),external_React_.createElement(dist_m,{onMove:function(e){o({a:e.left})},onKey:function(e){o({a:dist_s(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":u+"%","aria-valuenow":u,"aria-valuemin":"0","aria-valuemax":"100"},external_React_.createElement(dist_p,{className:"react-colorful__alpha-pointer",left:n.a,color:dist_k(n)})))},re=function(t){var n=t.className,o=t.colorModel,a=t.color,l=void 0===a?o.defaultColor:a,i=t.onChange,s=dist_c(t,["className","colorModel","color","onChange"]),f=(0,external_React_.useRef)(null);Q(f);var v=Y(o,l,i),d=v[0],h=v[1],m=dist_g(["react-colorful",n]);return external_React_.createElement("div",dist_u({},s,{ref:f,className:m}),external_React_.createElement(T,{hsva:d,onChange:h}),external_React_.createElement(dist_S,{hue:d.h,onChange:h}),external_React_.createElement(ee,{hsva:d,onChange:h,className:"react-colorful__last-control"}))},te={defaultColor:"0001",toHsva:dist_x,fromHsva:dist_w,equal:X},ne=function(r){return e.createElement(re,dist_u({},r,{colorModel:te}))},oe={defaultColor:{h:0,s:0,l:0,a:1},toHsva:dist_N,fromHsva:dist_y,equal:F},ae=function(r){return e.createElement(re,dist_u({},r,{colorModel:oe}))},le={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:dist_H,fromHsva:dist_k,equal:P},ue=function(r){return e.createElement(re,dist_u({},r,{colorModel:le}))},ce={defaultColor:{h:0,s:0,l:0},toHsva:function(e){return dist_N({h:e.h,s:e.s,l:e.l,a:1})},fromHsva:function(e){return{h:(r=dist_y(e)).h,s:r.s,l:r.l};var r},equal:F},ie=function(r){return e.createElement(U,dist_u({},r,{colorModel:ce}))},se={defaultColor:"hsl(0, 0%, 0%)",toHsva:dist_M,fromHsva:q,equal:P},fe=function(r){return e.createElement(U,dist_u({},r,{colorModel:se}))},ve={defaultColor:{h:0,s:0,v:0,a:1},toHsva:function(e){return e},fromHsva:A,equal:F},de=function(r){return e.createElement(re,dist_u({},r,{colorModel:ve}))},he={defaultColor:"hsva(0, 0%, 0%, 1)",toHsva:O,fromHsva:function(e){var r=A(e);return"hsva("+r.h+", "+r.s+"%, "+r.v+"%, "+r.a+")"},equal:P},me=function(r){return e.createElement(re,dist_u({},r,{colorModel:he}))},ge={defaultColor:{h:0,s:0,v:0},toHsva:function(e){return{h:e.h,s:e.s,v:e.v,a:1}},fromHsva:function(e){var r=A(e);return{h:r.h,s:r.s,v:r.v}},equal:F},pe=function(r){return e.createElement(U,dist_u({},r,{colorModel:ge}))},be={defaultColor:"hsv(0, 0%, 0%)",toHsva:dist_j,fromHsva:function(e){var r=A(e);return"hsv("+r.h+", "+r.s+"%, "+r.v+"%)"},equal:P},_e=function(r){return e.createElement(U,dist_u({},r,{colorModel:be}))},xe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:L,fromHsva:dist_I,equal:F},Ce=function(r){return e.createElement(re,dist_u({},r,{colorModel:xe}))},Ee={defaultColor:"rgba(0, 0, 0, 1)",toHsva:z,fromHsva:function(e){var r=dist_I(e);return"rgba("+r.r+", "+r.g+", "+r.b+", "+r.a+")"},equal:P},He=function(r){return external_React_.createElement(re,dist_u({},r,{colorModel:Ee}))},Me={defaultColor:{r:0,g:0,b:0},toHsva:function(e){return L({r:e.r,g:e.g,b:e.b,a:1})},fromHsva:function(e){return{r:(r=dist_I(e)).r,g:r.g,b:r.b};var r},equal:F},Ne=function(r){return e.createElement(U,dist_u({},r,{colorModel:Me}))},we={defaultColor:"rgb(0, 0, 0)",toHsva:B,fromHsva:function(e){var r=dist_I(e);return"rgb("+r.r+", "+r.g+", "+r.b+")"},equal:P},ye=function(r){return external_React_.createElement(U,dist_u({},r,{colorModel:we}))},qe=/^#?([0-9A-F]{3,8})$/i,ke=function(r){var t=r.color,l=void 0===t?"":t,s=r.onChange,f=r.onBlur,v=r.escape,d=r.validate,h=r.format,m=r.process,g=dist_c(r,["color","onChange","onBlur","escape","validate","format","process"]),p=o(function(){return v(l)}),b=p[0],_=p[1],x=dist_i(s),C=dist_i(f),E=a(function(e){var r=v(e.target.value);_(r),d(r)&&x(m?m(r):r)},[v,m,d,x]),H=a(function(e){d(e.target.value)||_(v(l)),C(e)},[l,v,d,C]);return n(function(){_(v(l))},[l,v]),e.createElement("input",dist_u({},g,{value:h?h(b):b,spellCheck:"false",onChange:E,onBlur:H}))},Ie=function(e){return"#"+e},Oe=function(r){var t=r.prefixed,n=r.alpha,o=dist_c(r,["prefixed","alpha"]),l=a(function(e){return e.replace(/([^0-9A-F]+)/gi,"").substring(0,n?8:6)},[n]),i=a(function(e){return function(e,r){var t=qe.exec(e),n=t?t[1].length:0;return 3===n||6===n||!!r&&4===n||!!r&&8===n}(e,n)},[n]);return e.createElement(ke,dist_u({},o,{escape:l,format:t?Ie:void 0,process:Ie,validate:i}))};
//# sourceMappingURL=index.module.js.map
;// ./node_modules/@wordpress/components/build-module/color-picker/picker.js
const Picker = ({
color,
enableAlpha,
onChange
}) => {
const Component = enableAlpha ? He : ye;
const rgbColor = (0,external_wp_element_namespaceObject.useMemo)(() => color.toRgbString(), [color]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
color: rgbColor,
onChange: (nextColor) => {
onChange(w(nextColor));
},
onPointerDown: ({
currentTarget,
pointerId
}) => {
currentTarget.setPointerCapture(pointerId);
},
onPointerUp: ({
currentTarget,
pointerId
}) => {
currentTarget.releasePointerCapture(pointerId);
}
});
};
;// ./node_modules/@wordpress/components/build-module/color-picker/component.js
k([names]);
const options = [{
label: "RGB",
value: "rgb"
}, {
label: "HSL",
value: "hsl"
}, {
label: "Hex",
value: "hex"
}];
const UnconnectedColorPicker = (props, forwardedRef) => {
const {
enableAlpha = false,
color: colorProp,
onChange,
defaultValue = "#fff",
copyFormat,
...divProps
} = useContextSystem(props, "ColorPicker");
const [color, setColor] = useControlledValue({
onChange,
value: colorProp,
defaultValue
});
const safeColordColor = (0,external_wp_element_namespaceObject.useMemo)(() => {
return w(color || "");
}, [color]);
const debouncedSetColor = (0,external_wp_compose_namespaceObject.useDebounce)(setColor);
const handleChange = (0,external_wp_element_namespaceObject.useCallback)((nextValue) => {
debouncedSetColor(nextValue.toHex());
}, [debouncedSetColor]);
const [colorType, setColorType] = (0,external_wp_element_namespaceObject.useState)(copyFormat || "hex");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ColorfulWrapper, {
ref: forwardedRef,
...divProps,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Picker, {
onChange: handleChange,
color: safeColordColor,
enableAlpha
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(AuxiliaryColorArtefactWrapper, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(AuxiliaryColorArtefactHStackHeader, {
justify: "space-between",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_SelectControl, {
__nextHasNoMarginBottom: true,
size: "compact",
options,
value: colorType,
onChange: (nextColorType) => setColorType(nextColorType),
label: (0,external_wp_i18n_namespaceObject.__)("Color format"),
hideLabelFromVision: true,
variant: "minimal"
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorCopyButton, {
color: safeColordColor,
colorType: copyFormat || colorType
})]
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorInputWrapper, {
direction: "column",
gap: 2,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorInput, {
colorType,
color: safeColordColor,
onChange: handleChange,
enableAlpha
})
})]
})]
});
};
const ColorPicker = contextConnect(UnconnectedColorPicker, "ColorPicker");
var color_picker_component_component_default = ColorPicker;
;// ./node_modules/@wordpress/components/build-module/color-picker/use-deprecated-props.js
function isLegacyProps(props) {
return typeof props.onChangeComplete !== "undefined" || typeof props.disableAlpha !== "undefined" || typeof props.color?.hex === "string";
}
function getColorFromLegacyProps(color) {
if (color === void 0) {
return;
}
if (typeof color === "string") {
return color;
}
if (color.hex) {
return color.hex;
}
return void 0;
}
const transformColorStringToLegacyColor = memize((color) => {
const colordColor = w(color);
const hex = colordColor.toHex();
const rgb = colordColor.toRgb();
const hsv = colordColor.toHsv();
const hsl = colordColor.toHsl();
return {
hex,
rgb,
hsv,
hsl,
source: "hex",
oldHue: hsl.h
};
});
function use_deprecated_props_useDeprecatedProps(props) {
const {
onChangeComplete
} = props;
const legacyChangeHandler = (0,external_wp_element_namespaceObject.useCallback)((color) => {
onChangeComplete(transformColorStringToLegacyColor(color));
}, [onChangeComplete]);
if (isLegacyProps(props)) {
return {
color: getColorFromLegacyProps(props.color),
enableAlpha: !props.disableAlpha,
onChange: legacyChangeHandler
};
}
return {
...props,
color: props.color,
enableAlpha: props.enableAlpha,
onChange: props.onChange
};
}
;// ./node_modules/@wordpress/components/build-module/color-picker/legacy-adapter.js
const LegacyAdapter = (props) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(color_picker_component_component_default, {
...use_deprecated_props_useDeprecatedProps(props)
});
};
;// ./node_modules/@wordpress/components/build-module/circular-option-picker/circular-option-picker-context.js
const CircularOptionPickerContext = (0,external_wp_element_namespaceObject.createContext)({});
CircularOptionPickerContext.displayName = "CircularOptionPickerContext";
;// ./node_modules/@wordpress/components/build-module/circular-option-picker/circular-option-picker-option.js
function UnforwardedOptionAsButton(props, forwardedRef) {
const {
isPressed,
label,
...additionalProps
} = props;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
...additionalProps,
"aria-pressed": isPressed,
ref: forwardedRef,
label
});
}
const OptionAsButton = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedOptionAsButton);
function UnforwardedOptionAsOption(props, forwardedRef) {
const {
id,
isSelected,
label,
...additionalProps
} = props;
const {
setActiveId,
activeId
} = (0,external_wp_element_namespaceObject.useContext)(CircularOptionPickerContext);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (isSelected && !activeId) {
window.setTimeout(() => setActiveId?.(id), 0);
}
}, [isSelected, setActiveId, activeId, id]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(composite_Composite.Item, {
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
...additionalProps,
role: "option",
"aria-selected": !!isSelected,
ref: forwardedRef,
label
}),
id
});
}
const OptionAsOption = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedOptionAsOption);
function Option({
className,
isSelected,
selectedIconProps = {},
tooltipText,
...additionalProps
}) {
const {
baseId,
setActiveId
} = (0,external_wp_element_namespaceObject.useContext)(CircularOptionPickerContext);
const id = (0,external_wp_compose_namespaceObject.useInstanceId)(Option, baseId || "components-circular-option-picker__option");
const commonProps = {
id,
className: "components-circular-option-picker__option",
__next40pxDefaultSize: true,
...additionalProps
};
const isListbox = setActiveId !== void 0;
const optionControl = isListbox ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(OptionAsOption, {
...commonProps,
label: tooltipText,
isSelected
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(OptionAsButton, {
...commonProps,
label: tooltipText,
isPressed: isSelected
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: dist_clsx(className, "components-circular-option-picker__option-wrapper"),
children: [optionControl, isSelected && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
icon: check_default,
...selectedIconProps
})]
});
}
;// ./node_modules/@wordpress/components/build-module/circular-option-picker/circular-option-picker-option-group.js
function OptionGroup({
className,
options,
...additionalProps
}) {
const role = "aria-label" in additionalProps || "aria-labelledby" in additionalProps ? "group" : void 0;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...additionalProps,
role,
className: dist_clsx("components-circular-option-picker__option-group", "components-circular-option-picker__swatches", className),
children: options
});
}
;// ./node_modules/@wordpress/components/build-module/circular-option-picker/circular-option-picker-actions.js
function DropdownLinkAction({
buttonProps,
className,
dropdownProps,
linkText
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_default, {
className: dist_clsx("components-circular-option-picker__dropdown-link-action", className),
renderToggle: ({
isOpen,
onToggle
}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
"aria-expanded": isOpen,
"aria-haspopup": "true",
onClick: onToggle,
variant: "link",
...buttonProps,
children: linkText
}),
...dropdownProps
});
}
function ButtonAction({
className,
children,
...additionalProps
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
__next40pxDefaultSize: true,
className: dist_clsx("components-circular-option-picker__clear", className),
variant: "tertiary",
...additionalProps,
children
});
}
;// ./node_modules/@wordpress/components/build-module/circular-option-picker/circular-option-picker.js
function ListboxCircularOptionPicker(props) {
const {
actions,
options,
baseId,
className,
loop = true,
children,
...additionalProps
} = props;
const [activeId, setActiveId] = (0,external_wp_element_namespaceObject.useState)(void 0);
const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
baseId,
activeId,
setActiveId
}), [baseId, activeId, setActiveId]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(CircularOptionPickerContext.Provider, {
value: contextValue,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(composite_Composite, {
...additionalProps,
id: baseId,
focusLoop: loop,
rtl: (0,external_wp_i18n_namespaceObject.isRTL)(),
role: "listbox",
activeId,
setActiveId,
children: options
}), children, actions]
})
});
}
function ButtonsCircularOptionPicker(props) {
const {
actions,
options,
children,
baseId,
...additionalProps
} = props;
const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
baseId
}), [baseId]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...additionalProps,
role: "group",
id: baseId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(CircularOptionPickerContext.Provider, {
value: contextValue,
children: [options, children, actions]
})
});
}
function CircularOptionPicker(props) {
const {
asButtons,
actions: actionsProp,
options: optionsProp,
children,
className,
...additionalProps
} = props;
const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(CircularOptionPicker, "components-circular-option-picker", additionalProps.id);
const OptionPickerImplementation = asButtons ? ButtonsCircularOptionPicker : ListboxCircularOptionPicker;
const actions = actionsProp ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "components-circular-option-picker__custom-clear-wrapper",
children: actionsProp
}) : void 0;
const options = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "components-circular-option-picker__swatches",
children: optionsProp
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(OptionPickerImplementation, {
...additionalProps,
baseId,
className: dist_clsx("components-circular-option-picker", className),
actions,
options,
children
});
}
CircularOptionPicker.Option = Option;
CircularOptionPicker.OptionGroup = OptionGroup;
CircularOptionPicker.ButtonAction = ButtonAction;
CircularOptionPicker.DropdownLinkAction = DropdownLinkAction;
var circular_option_picker_default = CircularOptionPicker;
;// ./node_modules/@wordpress/components/build-module/circular-option-picker/index.js
var circular_option_picker_circular_option_picker_default = circular_option_picker_default;
;// ./node_modules/@wordpress/components/build-module/circular-option-picker/utils.js
function getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby) {
const metaProps = asButtons ? {
asButtons: true
} : {
asButtons: false,
loop
};
const labelProps = {
"aria-labelledby": ariaLabelledby,
"aria-label": ariaLabelledby ? void 0 : ariaLabel || (0,external_wp_i18n_namespaceObject.__)("Custom color picker")
};
return {
metaProps,
labelProps
};
}
;// ./node_modules/@wordpress/components/build-module/v-stack/hook.js
function useVStack(props) {
const {
expanded = false,
alignment = "stretch",
...otherProps
} = useContextSystem(props, "VStack");
const hStackProps = useHStack({
direction: "column",
expanded,
alignment,
...otherProps
});
return hStackProps;
}
;// ./node_modules/@wordpress/components/build-module/v-stack/component.js
function UnconnectedVStack(props, forwardedRef) {
const vStackProps = useVStack(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...vStackProps,
ref: forwardedRef
});
}
const VStack = contextConnect(UnconnectedVStack, "VStack");
var v_stack_component_component_default = VStack;
;// ./node_modules/@wordpress/components/build-module/truncate/component.js
function UnconnectedTruncate(props, forwardedRef) {
const truncateProps = useTruncate(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
as: "span",
...truncateProps,
ref: forwardedRef
});
}
const component_Truncate = contextConnect(UnconnectedTruncate, "Truncate");
var truncate_component_component_default = component_Truncate;
;// ./node_modules/@wordpress/components/build-module/heading/hook.js
function useHeading(props) {
const {
as: asProp,
level = 2,
color = COLORS.theme.foreground,
isBlock = true,
weight = config_values_default.fontWeightHeading,
...otherProps
} = useContextSystem(props, "Heading");
const as = asProp || `h${level}`;
const a11yProps = {};
if (typeof as === "string" && as[0] !== "h") {
a11yProps.role = "heading";
a11yProps["aria-level"] = typeof level === "string" ? parseInt(level) : level;
}
const textProps = useText({
color,
isBlock,
weight,
size: getHeadingFontSize(level),
...otherProps
});
return {
...textProps,
...a11yProps,
as
};
}
;// ./node_modules/@wordpress/components/build-module/heading/component.js
function UnconnectedHeading(props, forwardedRef) {
const headerProps = useHeading(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...headerProps,
ref: forwardedRef
});
}
const Heading = contextConnect(UnconnectedHeading, "Heading");
var heading_component_component_default = Heading;
;// ./node_modules/@wordpress/components/build-module/color-palette/styles.js
function color_palette_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const ColorHeading = /* @__PURE__ */ emotion_styled_base_browser_esm(heading_component_component_default, true ? {
target: "ev9wop70"
} : 0)( true ? {
name: "13lxv2o",
styles: "text-transform:uppercase;line-height:24px;font-weight:500;&&&{font-size:11px;margin-bottom:0;}"
} : 0);
;// ./node_modules/@wordpress/components/build-module/dropdown/styles.js
const padding = ({
paddingSize = "small"
}) => {
if (paddingSize === "none") {
return;
}
const paddingValues = {
small: space(2),
medium: space(4)
};
return /* @__PURE__ */ emotion_react_browser_esm_css("padding:", paddingValues[paddingSize] || paddingValues.small, ";" + ( true ? "" : 0), true ? "" : 0);
};
const DropdownContentWrapperDiv = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "eovvns30"
} : 0)("margin-left:", space(-2), ";margin-right:", space(-2), ";&:first-of-type{margin-top:", space(-2), ";}&:last-of-type{margin-bottom:", space(-2), ";}", padding, ";" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/dropdown/dropdown-content-wrapper.js
function UnconnectedDropdownContentWrapper(props, forwardedRef) {
const {
paddingSize = "small",
...derivedProps
} = useContextSystem(props, "DropdownContentWrapper");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownContentWrapperDiv, {
...derivedProps,
paddingSize,
ref: forwardedRef
});
}
const DropdownContentWrapper = contextConnect(UnconnectedDropdownContentWrapper, "DropdownContentWrapper");
var dropdown_content_wrapper_default = DropdownContentWrapper;
;// ./node_modules/@wordpress/components/build-module/color-palette/utils.js
k([names, a11y]);
const isSimpleCSSColor = (value) => {
const valueIsCssVariable = /var\(/.test(value !== null && value !== void 0 ? value : "");
const valueIsColorMix = /color-mix\(/.test(value !== null && value !== void 0 ? value : "");
return !valueIsCssVariable && !valueIsColorMix;
};
const extractColorNameFromCurrentValue = (currentValue, colors = [], showMultiplePalettes = false) => {
if (!currentValue) {
return "";
}
const currentValueIsSimpleColor = currentValue ? isSimpleCSSColor(currentValue) : false;
const normalizedCurrentValue = currentValueIsSimpleColor ? w(currentValue).toHex() : currentValue;
const colorPalettes = showMultiplePalettes ? colors : [{
colors
}];
for (const {
colors: paletteColors
} of colorPalettes) {
for (const {
name: colorName,
color: colorValue
} of paletteColors) {
const normalizedColorValue = currentValueIsSimpleColor ? w(colorValue).toHex() : colorValue;
if (normalizedCurrentValue === normalizedColorValue) {
return colorName;
}
}
}
return (0,external_wp_i18n_namespaceObject.__)("Custom");
};
const isMultiplePaletteObject = (obj) => Array.isArray(obj.colors) && !("color" in obj);
const isMultiplePaletteArray = (arr) => {
return arr.length > 0 && arr.every((colorObj) => isMultiplePaletteObject(colorObj));
};
const normalizeColorValue = (value, element) => {
if (!value || !element || isSimpleCSSColor(value)) {
return value;
}
const {
ownerDocument
} = element;
const {
defaultView
} = ownerDocument;
const computedBackgroundColor = defaultView?.getComputedStyle(element).backgroundColor;
return computedBackgroundColor ? w(computedBackgroundColor).toHex() : value;
};
;// ./node_modules/@wordpress/components/build-module/color-palette/index.js
k([names, a11y]);
function SinglePalette({
className,
clearColor,
colors,
onChange,
value,
...additionalProps
}) {
const colorOptions = (0,external_wp_element_namespaceObject.useMemo)(() => {
return colors.map(({
color,
name
}, index) => {
const colordColor = w(color);
const isSelected = value === color;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.Option, {
isSelected,
selectedIconProps: isSelected ? {
fill: colordColor.contrast() > colordColor.contrast("#000") ? "#fff" : "#000"
} : {},
tooltipText: name || // translators: %s: color hex code e.g: "#f00".
(0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Color code: %s"), color),
style: {
backgroundColor: color,
color
},
onClick: isSelected ? clearColor : () => onChange(color, index)
}, `${color}-${index}`);
});
}, [colors, value, onChange, clearColor]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.OptionGroup, {
className,
options: colorOptions,
...additionalProps
});
}
function MultiplePalettes({
className,
clearColor,
colors,
onChange,
value,
headingLevel
}) {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(MultiplePalettes, "color-palette");
if (colors.length === 0) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(v_stack_component_component_default, {
spacing: 3,
className,
children: colors.map(({
name,
colors: colorPalette
}, index) => {
const id = `${instanceId}-${index}`;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
spacing: 2,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorHeading, {
id,
level: headingLevel,
children: name
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SinglePalette, {
clearColor,
colors: colorPalette,
onChange: (newColor) => onChange(newColor, index),
value,
"aria-labelledby": id
})]
}, index);
})
});
}
function CustomColorPickerDropdown({
isRenderedInSidebar,
popoverProps: receivedPopoverProps,
...props
}) {
const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
shift: true,
// Disabling resize as it would otherwise cause the popover to show
// scrollbars while dragging the color picker's handle close to the
// popover edge.
resize: false,
...isRenderedInSidebar ? {
// When in the sidebar: open to the left (stacking),
// leaving the same gap as the parent popover.
placement: "left-start",
offset: 34
} : {
// Default behavior: open below the anchor
placement: "bottom",
offset: 8
},
...receivedPopoverProps
}), [isRenderedInSidebar, receivedPopoverProps]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_default, {
contentClassName: "components-color-palette__custom-color-dropdown-content",
popoverProps,
...props
});
}
function UnforwardedColorPalette(props, forwardedRef) {
const {
asButtons,
loop,
clearable = true,
colors = [],
disableCustomColors = false,
enableAlpha = false,
onChange,
value,
__experimentalIsRenderedInSidebar = false,
headingLevel = 2,
"aria-label": ariaLabel,
"aria-labelledby": ariaLabelledby,
...additionalProps
} = props;
const [normalizedColorValue, setNormalizedColorValue] = (0,external_wp_element_namespaceObject.useState)(value);
const clearColor = (0,external_wp_element_namespaceObject.useCallback)(() => onChange(void 0), [onChange]);
const customColorPaletteCallbackRef = (0,external_wp_element_namespaceObject.useCallback)((node) => {
setNormalizedColorValue(normalizeColorValue(value, node));
}, [value]);
const hasMultipleColorOrigins = isMultiplePaletteArray(colors);
const buttonLabelName = (0,external_wp_element_namespaceObject.useMemo)(() => extractColorNameFromCurrentValue(value, colors, hasMultipleColorOrigins), [value, colors, hasMultipleColorOrigins]);
const renderCustomColorPicker = () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_content_wrapper_default, {
paddingSize: "none",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LegacyAdapter, {
color: normalizedColorValue,
onChange: (color) => onChange(color),
enableAlpha
})
});
const isHex = value?.startsWith("#");
const displayValue = value?.replace(/^var\((.+)\)$/, "$1");
const customColorAccessibleLabel = !!displayValue ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: The name of the color e.g: "vivid red". 2: The color's hex code e.g: "#f00".
(0,external_wp_i18n_namespaceObject.__)('Custom color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),
buttonLabelName,
displayValue
) : (0,external_wp_i18n_namespaceObject.__)("Custom color picker");
const paletteCommonProps = {
clearColor,
onChange,
value
};
const actions = !!clearable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.ButtonAction, {
onClick: clearColor,
accessibleWhenDisabled: true,
disabled: !value,
children: (0,external_wp_i18n_namespaceObject.__)("Clear")
});
const {
metaProps,
labelProps
} = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
spacing: 3,
ref: forwardedRef,
...additionalProps,
children: [!disableCustomColors && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomColorPickerDropdown, {
isRenderedInSidebar: __experimentalIsRenderedInSidebar,
renderContent: renderCustomColorPicker,
renderToggle: ({
isOpen,
onToggle
}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
className: "components-color-palette__custom-color-wrapper",
spacing: 0,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("button", {
ref: customColorPaletteCallbackRef,
className: "components-color-palette__custom-color-button",
"aria-expanded": isOpen,
"aria-haspopup": "true",
onClick: onToggle,
"aria-label": customColorAccessibleLabel,
style: {
background: value
},
type: "button"
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
className: "components-color-palette__custom-color-text-wrapper",
spacing: 0.5,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(truncate_component_component_default, {
className: "components-color-palette__custom-color-name",
children: value ? buttonLabelName : (0,external_wp_i18n_namespaceObject.__)("No color selected")
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(truncate_component_component_default, {
className: dist_clsx("components-color-palette__custom-color-value", {
"components-color-palette__custom-color-value--is-hex": isHex
}),
children: displayValue
})]
})]
})
}), (colors.length > 0 || actions) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default, {
...metaProps,
...labelProps,
actions,
options: hasMultipleColorOrigins ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MultiplePalettes, {
...paletteCommonProps,
headingLevel,
colors,
value
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SinglePalette, {
...paletteCommonProps,
colors,
value
})
})]
});
}
const ColorPalette = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedColorPalette);
var color_palette_default = ColorPalette;
;// ./node_modules/@wordpress/components/build-module/unit-control/styles/unit-control-styles.js
const ValueInput = /* @__PURE__ */ emotion_styled_base_browser_esm(number_control_default, true ? {
target: "e1bagdl32"
} : 0)("&&&{input{display:block;width:100%;}", BackdropUI, "{transition:box-shadow 0.1s linear;}}" + ( true ? "" : 0));
const baseUnitLabelStyles = ({
selectSize
}) => {
const sizes = {
small: /* @__PURE__ */ emotion_react_browser_esm_css("box-sizing:border-box;padding:2px 1px;width:20px;font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;&:not( :disabled ){color:", COLORS.gray[800], ";}" + ( true ? "" : 0), true ? "" : 0),
default: /* @__PURE__ */ emotion_react_browser_esm_css("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:", space(2), ";padding:", space(1), ";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;field-sizing:content;&:not( :disabled ){color:", COLORS.theme.accent, ";}" + ( true ? "" : 0), true ? "" : 0)
};
return sizes[selectSize];
};
const UnitLabel = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e1bagdl31"
} : 0)("&&&{pointer-events:none;", baseUnitLabelStyles, ";color:", COLORS.gray[900], ";}" + ( true ? "" : 0));
const unitSelectSizes = ({
selectSize = "default"
}) => {
const sizes = {
small: /* @__PURE__ */ emotion_react_browser_esm_css("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;", rtl({
borderTopLeftRadius: 0,
borderBottomLeftRadius: 0
})(), " &:not(:disabled):hover{background-color:", COLORS.gray[100], ";}&:focus{border:1px solid ", COLORS.ui.borderFocus, ";box-shadow:inset 0 0 0 ", config_values_default.borderWidth + " " + COLORS.ui.borderFocus, ";outline-offset:0;outline:2px solid transparent;z-index:1;}" + ( true ? "" : 0), true ? "" : 0),
default: /* @__PURE__ */ emotion_react_browser_esm_css("display:flex;justify-content:center;align-items:center;&:where( :not( :disabled ) ):hover{box-shadow:0 0 0 ", config_values_default.borderWidth + " " + COLORS.ui.borderFocus, ";outline:", config_values_default.borderWidth, " solid transparent;}&:focus{box-shadow:0 0 0 ", config_values_default.borderWidthFocus + " " + COLORS.ui.borderFocus, ";outline:", config_values_default.borderWidthFocus, " solid transparent;}" + ( true ? "" : 0), true ? "" : 0)
};
return sizes[selectSize];
};
const UnitSelect = /* @__PURE__ */ emotion_styled_base_browser_esm("select", true ? {
target: "e1bagdl30"
} : 0)("&&&{appearance:none;background:transparent;border-radius:", config_values_default.radiusXSmall, ";border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;", baseUnitLabelStyles, ";", unitSelectSizes, ";&:not( :disabled ){cursor:pointer;}}" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/border-control/styles.js
function border_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const focusBoxShadow = /* @__PURE__ */ emotion_react_browser_esm_css("box-shadow:inset ", config_values_default.controlBoxShadowFocus, ";" + ( true ? "" : 0), true ? "" : 0);
const borderControl = /* @__PURE__ */ emotion_react_browser_esm_css("border:0;padding:0;margin:0;", boxSizingReset, ";" + ( true ? "" : 0), true ? "" : 0);
const innerWrapper = () => /* @__PURE__ */ emotion_react_browser_esm_css(ValueInput, "{flex:1 1 40%;}&& ", UnitSelect, "{min-height:0;}" + ( true ? "" : 0), true ? "" : 0);
const styles_wrapperWidth = /* @__PURE__ */ emotion_react_browser_esm_css(ValueInput, "{flex:0 0 auto;}" + ( true ? "" : 0), true ? "" : 0);
const wrapperHeight = (size) => {
return /* @__PURE__ */ emotion_react_browser_esm_css("height:", size === "__unstable-large" ? "40px" : "30px", ";" + ( true ? "" : 0), true ? "" : 0);
};
const borderControlDropdown = /* @__PURE__ */ emotion_react_browser_esm_css("background:#fff;&&>button{aspect-ratio:1;padding:0;display:flex;align-items:center;justify-content:center;", rtl({
borderRadius: `2px 0 0 2px`
}, {
borderRadius: `0 2px 2px 0`
})(), " border:", config_values_default.borderWidth, " solid ", COLORS.ui.border, ";&:focus,&:hover:not( :disabled ){", focusBoxShadow, " border-color:", COLORS.ui.borderFocus, ";z-index:1;position:relative;}}" + ( true ? "" : 0), true ? "" : 0);
const colorIndicatorBorder = (border) => {
const {
color,
style
} = border || {};
const fallbackColor = !!style && style !== "none" ? COLORS.gray[300] : void 0;
return /* @__PURE__ */ emotion_react_browser_esm_css("border-style:", style === "none" ? "solid" : style, ";border-color:", color || fallbackColor, ";" + ( true ? "" : 0), true ? "" : 0);
};
const colorIndicatorWrapper = (border, size) => {
const {
style
} = border || {};
return /* @__PURE__ */ emotion_react_browser_esm_css("border-radius:", config_values_default.radiusFull, ";border:2px solid transparent;", style ? colorIndicatorBorder(border) : void 0, " width:", size === "__unstable-large" ? "24px" : "22px", ";height:", size === "__unstable-large" ? "24px" : "22px", ";padding:", size === "__unstable-large" ? "2px" : "1px", ";&>span{height:", space(4), ";width:", space(4), ";background:linear-gradient(\n -45deg,\n transparent 48%,\n rgb( 0 0 0 / 20% ) 48%,\n rgb( 0 0 0 / 20% ) 52%,\n transparent 52%\n );}" + ( true ? "" : 0), true ? "" : 0);
};
const swatchSize = 28;
const swatchGap = 12;
const borderControlPopoverControls = /* @__PURE__ */ emotion_react_browser_esm_css("width:", swatchSize * 6 + swatchGap * 5, "px;>div:first-of-type>", StyledLabel, "{margin-bottom:0;}&& ", StyledLabel, "+button:not( .has-text ){min-width:24px;padding:0;}" + ( true ? "" : 0), true ? "" : 0);
const borderControlPopoverContent = /* @__PURE__ */ emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0);
const borderColorIndicator = /* @__PURE__ */ emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0);
const resetButtonWrapper = true ? {
name: "1ghe26v",
styles: "display:flex;justify-content:flex-end;margin-top:12px"
} : 0;
const borderSlider = () => /* @__PURE__ */ emotion_react_browser_esm_css("flex:1 1 60%;", rtl({
marginRight: space(3)
})(), ";" + ( true ? "" : 0), true ? "" : 0);
;// ./node_modules/@wordpress/components/build-module/unit-control/utils.js
const isWeb = external_wp_element_namespaceObject.Platform.OS === "web";
const allUnits = {
px: {
value: "px",
label: isWeb ? "px" : (0,external_wp_i18n_namespaceObject.__)("Pixels (px)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Pixels (px)"),
step: 1
},
"%": {
value: "%",
label: isWeb ? "%" : (0,external_wp_i18n_namespaceObject.__)("Percentage (%)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Percent (%)"),
step: 0.1
},
em: {
value: "em",
label: isWeb ? "em" : (0,external_wp_i18n_namespaceObject.__)("Relative to parent font size (em)"),
a11yLabel: (0,external_wp_i18n_namespaceObject._x)("ems", "Relative to parent font size (em)"),
step: 0.01
},
rem: {
value: "rem",
label: isWeb ? "rem" : (0,external_wp_i18n_namespaceObject.__)("Relative to root font size (rem)"),
a11yLabel: (0,external_wp_i18n_namespaceObject._x)("rems", "Relative to root font size (rem)"),
step: 0.01
},
vw: {
value: "vw",
label: isWeb ? "vw" : (0,external_wp_i18n_namespaceObject.__)("Viewport width (vw)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Viewport width (vw)"),
step: 0.1
},
vh: {
value: "vh",
label: isWeb ? "vh" : (0,external_wp_i18n_namespaceObject.__)("Viewport height (vh)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Viewport height (vh)"),
step: 0.1
},
vmin: {
value: "vmin",
label: isWeb ? "vmin" : (0,external_wp_i18n_namespaceObject.__)("Viewport smallest dimension (vmin)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Viewport smallest dimension (vmin)"),
step: 0.1
},
vmax: {
value: "vmax",
label: isWeb ? "vmax" : (0,external_wp_i18n_namespaceObject.__)("Viewport largest dimension (vmax)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Viewport largest dimension (vmax)"),
step: 0.1
},
ch: {
value: "ch",
label: isWeb ? "ch" : (0,external_wp_i18n_namespaceObject.__)("Width of the zero (0) character (ch)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Width of the zero (0) character (ch)"),
step: 0.01
},
ex: {
value: "ex",
label: isWeb ? "ex" : (0,external_wp_i18n_namespaceObject.__)("x-height of the font (ex)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("x-height of the font (ex)"),
step: 0.01
},
cm: {
value: "cm",
label: isWeb ? "cm" : (0,external_wp_i18n_namespaceObject.__)("Centimeters (cm)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Centimeters (cm)"),
step: 1e-3
},
mm: {
value: "mm",
label: isWeb ? "mm" : (0,external_wp_i18n_namespaceObject.__)("Millimeters (mm)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Millimeters (mm)"),
step: 0.1
},
in: {
value: "in",
label: isWeb ? "in" : (0,external_wp_i18n_namespaceObject.__)("Inches (in)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Inches (in)"),
step: 1e-3
},
pc: {
value: "pc",
label: isWeb ? "pc" : (0,external_wp_i18n_namespaceObject.__)("Picas (pc)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Picas (pc)"),
step: 1
},
pt: {
value: "pt",
label: isWeb ? "pt" : (0,external_wp_i18n_namespaceObject.__)("Points (pt)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Points (pt)"),
step: 1
},
svw: {
value: "svw",
label: isWeb ? "svw" : (0,external_wp_i18n_namespaceObject.__)("Small viewport width (svw)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Small viewport width (svw)"),
step: 0.1
},
svh: {
value: "svh",
label: isWeb ? "svh" : (0,external_wp_i18n_namespaceObject.__)("Small viewport height (svh)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Small viewport height (svh)"),
step: 0.1
},
svi: {
value: "svi",
label: isWeb ? "svi" : (0,external_wp_i18n_namespaceObject.__)("Viewport smallest size in the inline direction (svi)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Small viewport width or height (svi)"),
step: 0.1
},
svb: {
value: "svb",
label: isWeb ? "svb" : (0,external_wp_i18n_namespaceObject.__)("Viewport smallest size in the block direction (svb)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Small viewport width or height (svb)"),
step: 0.1
},
svmin: {
value: "svmin",
label: isWeb ? "svmin" : (0,external_wp_i18n_namespaceObject.__)("Small viewport smallest dimension (svmin)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Small viewport smallest dimension (svmin)"),
step: 0.1
},
lvw: {
value: "lvw",
label: isWeb ? "lvw" : (0,external_wp_i18n_namespaceObject.__)("Large viewport width (lvw)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Large viewport width (lvw)"),
step: 0.1
},
lvh: {
value: "lvh",
label: isWeb ? "lvh" : (0,external_wp_i18n_namespaceObject.__)("Large viewport height (lvh)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Large viewport height (lvh)"),
step: 0.1
},
lvi: {
value: "lvi",
label: isWeb ? "lvi" : (0,external_wp_i18n_namespaceObject.__)("Large viewport width or height (lvi)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Large viewport width or height (lvi)"),
step: 0.1
},
lvb: {
value: "lvb",
label: isWeb ? "lvb" : (0,external_wp_i18n_namespaceObject.__)("Large viewport width or height (lvb)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Large viewport width or height (lvb)"),
step: 0.1
},
lvmin: {
value: "lvmin",
label: isWeb ? "lvmin" : (0,external_wp_i18n_namespaceObject.__)("Large viewport smallest dimension (lvmin)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Large viewport smallest dimension (lvmin)"),
step: 0.1
},
dvw: {
value: "dvw",
label: isWeb ? "dvw" : (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport width (dvw)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport width (dvw)"),
step: 0.1
},
dvh: {
value: "dvh",
label: isWeb ? "dvh" : (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport height (dvh)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport height (dvh)"),
step: 0.1
},
dvi: {
value: "dvi",
label: isWeb ? "dvi" : (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport width or height (dvi)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport width or height (dvi)"),
step: 0.1
},
dvb: {
value: "dvb",
label: isWeb ? "dvb" : (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport width or height (dvb)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport width or height (dvb)"),
step: 0.1
},
dvmin: {
value: "dvmin",
label: isWeb ? "dvmin" : (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport smallest dimension (dvmin)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport smallest dimension (dvmin)"),
step: 0.1
},
dvmax: {
value: "dvmax",
label: isWeb ? "dvmax" : (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport largest dimension (dvmax)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport largest dimension (dvmax)"),
step: 0.1
},
svmax: {
value: "svmax",
label: isWeb ? "svmax" : (0,external_wp_i18n_namespaceObject.__)("Small viewport largest dimension (svmax)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Small viewport largest dimension (svmax)"),
step: 0.1
},
lvmax: {
value: "lvmax",
label: isWeb ? "lvmax" : (0,external_wp_i18n_namespaceObject.__)("Large viewport largest dimension (lvmax)"),
a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Large viewport largest dimension (lvmax)"),
step: 0.1
}
};
const ALL_CSS_UNITS = Object.values(allUnits);
const CSS_UNITS = [allUnits.px, allUnits["%"], allUnits.em, allUnits.rem, allUnits.vw, allUnits.vh];
const DEFAULT_UNIT = allUnits.px;
function getParsedQuantityAndUnit(rawValue, fallbackUnit, allowedUnits) {
const initialValue = fallbackUnit ? `${rawValue !== null && rawValue !== void 0 ? rawValue : ""}${fallbackUnit}` : rawValue;
return parseQuantityAndUnitFromRawValue(initialValue, allowedUnits);
}
function hasUnits(units) {
return Array.isArray(units) && !!units.length;
}
function parseQuantityAndUnitFromRawValue(rawValue, allowedUnits = ALL_CSS_UNITS) {
let trimmedValue;
let quantityToReturn;
if (typeof rawValue !== "undefined" || rawValue === null) {
trimmedValue = `${rawValue}`.trim();
const parsedQuantity = parseFloat(trimmedValue);
quantityToReturn = !isFinite(parsedQuantity) ? void 0 : parsedQuantity;
}
const unitMatch = trimmedValue?.match(/[\d.\-\+]*\s*(.*)/);
const matchedUnit = unitMatch?.[1]?.toLowerCase();
let unitToReturn;
if (hasUnits(allowedUnits)) {
const match = allowedUnits.find((item) => item.value === matchedUnit);
unitToReturn = match?.value;
} else {
unitToReturn = DEFAULT_UNIT.value;
}
return [quantityToReturn, unitToReturn];
}
function getValidParsedQuantityAndUnit(rawValue, allowedUnits, fallbackQuantity, fallbackUnit) {
const [parsedQuantity, parsedUnit] = parseQuantityAndUnitFromRawValue(rawValue, allowedUnits);
const quantityToReturn = parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : fallbackQuantity;
let unitToReturn = parsedUnit || fallbackUnit;
if (!unitToReturn && hasUnits(allowedUnits)) {
unitToReturn = allowedUnits[0].value;
}
return [quantityToReturn, unitToReturn];
}
function getAccessibleLabelForUnit(unit) {
const match = ALL_CSS_UNITS.find((item) => item.value === unit);
return match?.a11yLabel ? match?.a11yLabel : match?.value;
}
function filterUnitsWithSettings(allowedUnitValues = [], availableUnits) {
return Array.isArray(availableUnits) ? availableUnits.filter((unit) => allowedUnitValues.includes(unit.value)) : [];
}
const useCustomUnits = ({
units = ALL_CSS_UNITS,
availableUnits = [],
defaultValues
}) => {
const customUnitsToReturn = filterUnitsWithSettings(availableUnits, units);
if (!defaultValues) {
return customUnitsToReturn;
}
return customUnitsToReturn.map((unit) => {
const [defaultValue] = defaultValues[unit.value] ? parseQuantityAndUnitFromRawValue(defaultValues[unit.value]) : [];
return {
...unit,
default: defaultValue
};
});
};
function getUnitsWithCurrentUnit(rawValue, legacyUnit, units = ALL_CSS_UNITS) {
const unitsToReturn = Array.isArray(units) ? [...units] : [];
const [, currentUnit] = getParsedQuantityAndUnit(rawValue, legacyUnit, ALL_CSS_UNITS);
if (currentUnit && !unitsToReturn.some((unit) => unit.value === currentUnit)) {
if (allUnits[currentUnit]) {
unitsToReturn.unshift(allUnits[currentUnit]);
}
}
return unitsToReturn;
}
;// ./node_modules/@wordpress/components/build-module/border-control/border-control-dropdown/hook.js
function useBorderControlDropdown(props) {
const {
border,
className,
colors = [],
enableAlpha = false,
enableStyle = true,
onChange,
previousStyleSelection,
size = "default",
__experimentalIsRenderedInSidebar = false,
...otherProps
} = useContextSystem(props, "BorderControlDropdown");
const [widthValue] = parseQuantityAndUnitFromRawValue(border?.width);
const hasZeroWidth = widthValue === 0;
const onColorChange = (color) => {
const style = border?.style === "none" ? previousStyleSelection : border?.style;
const width = hasZeroWidth && !!color ? "1px" : border?.width;
onChange({
color,
style,
width
});
};
const onStyleChange = (style) => {
const width = hasZeroWidth && !!style ? "1px" : border?.width;
onChange({
...border,
style,
width
});
};
const onReset = () => {
onChange({
...border,
color: void 0,
style: void 0
});
};
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(borderControlDropdown, className);
}, [className, cx]);
const indicatorClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(borderColorIndicator);
}, [cx]);
const indicatorWrapperClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(colorIndicatorWrapper(border, size));
}, [border, cx, size]);
const popoverControlsClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(borderControlPopoverControls);
}, [cx]);
const popoverContentClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(borderControlPopoverContent);
}, [cx]);
const resetButtonWrapperClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(resetButtonWrapper);
}, [cx]);
return {
...otherProps,
border,
className: classes,
colors,
enableAlpha,
enableStyle,
indicatorClassName,
indicatorWrapperClassName,
onColorChange,
onStyleChange,
onReset,
popoverContentClassName,
popoverControlsClassName,
resetButtonWrapperClassName,
size,
__experimentalIsRenderedInSidebar
};
}
;// ./node_modules/@wordpress/components/build-module/border-control/border-control-dropdown/component.js
const getAriaLabelColorValue = (colorValue) => {
return colorValue.replace(/^var\((.+)\)$/, "$1");
};
const getColorObject = (colorValue, colors) => {
if (!colorValue || !colors) {
return;
}
if (isMultiplePaletteArray(colors)) {
let matchedColor;
colors.some((origin) => origin.colors.some((color) => {
if (color.color === colorValue) {
matchedColor = color;
return true;
}
return false;
}));
return matchedColor;
}
return colors.find((color) => color.color === colorValue);
};
const getToggleAriaLabel = (colorValue, colorObject, style, isStyleEnabled) => {
if (isStyleEnabled) {
if (colorObject) {
const ariaLabelValue = getAriaLabelColorValue(colorObject.color);
return style ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: The name of the color e.g. "vivid red". 2: The color's hex code e.g.: "#f00:". 3: The current border style selection e.g. "solid".
(0,external_wp_i18n_namespaceObject.__)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s". The currently selected style is "%3$s".'),
colorObject.name,
ariaLabelValue,
style
) : (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: The name of the color e.g. "vivid red". 2: The color's hex code e.g.: "#f00:".
(0,external_wp_i18n_namespaceObject.__)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),
colorObject.name,
ariaLabelValue
);
}
if (colorValue) {
const ariaLabelValue = getAriaLabelColorValue(colorValue);
return style ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: The color's hex code e.g.: "#f00:". 2: The current border style selection e.g. "solid".
(0,external_wp_i18n_namespaceObject.__)('Border color and style picker. The currently selected color has a value of "%1$s". The currently selected style is "%2$s".'),
ariaLabelValue,
style
) : (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The color's hex code e.g: "#f00".
(0,external_wp_i18n_namespaceObject.__)('Border color and style picker. The currently selected color has a value of "%s".'),
ariaLabelValue
);
}
return (0,external_wp_i18n_namespaceObject.__)("Border color and style picker.");
}
if (colorObject) {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: The name of the color e.g. "vivid red". 2: The color's hex code e.g: "#f00".
(0,external_wp_i18n_namespaceObject.__)('Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),
colorObject.name,
getAriaLabelColorValue(colorObject.color)
);
}
if (colorValue) {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The color's hex code e.g: "#f00".
(0,external_wp_i18n_namespaceObject.__)('Border color picker. The currently selected color has a value of "%s".'),
getAriaLabelColorValue(colorValue)
);
}
return (0,external_wp_i18n_namespaceObject.__)("Border color picker.");
};
const BorderControlDropdown = (props, forwardedRef) => {
const {
__experimentalIsRenderedInSidebar,
border,
colors,
disableCustomColors,
enableAlpha,
enableStyle,
indicatorClassName,
indicatorWrapperClassName,
isStyleSettable,
onReset,
onColorChange,
onStyleChange,
popoverContentClassName,
popoverControlsClassName,
resetButtonWrapperClassName,
size,
__unstablePopoverProps,
...otherProps
} = useBorderControlDropdown(props);
const {
color,
style
} = border || {};
const colorObject = getColorObject(color, colors);
const toggleAriaLabel = getToggleAriaLabel(color, colorObject, style, enableStyle);
const enableResetButton = color || style && style !== "none";
const dropdownPosition = __experimentalIsRenderedInSidebar ? "bottom left" : void 0;
const renderToggle = ({
onToggle
}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
onClick: onToggle,
variant: "tertiary",
"aria-label": toggleAriaLabel,
tooltipPosition: dropdownPosition,
label: (0,external_wp_i18n_namespaceObject.__)("Border color and style picker"),
showTooltip: true,
__next40pxDefaultSize: size === "__unstable-large",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: indicatorWrapperClassName,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(color_indicator_default, {
className: indicatorClassName,
colorValue: color
})
})
});
const renderContent = () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(dropdown_content_wrapper_default, {
paddingSize: "medium",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
className: popoverControlsClassName,
spacing: 6,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(color_palette_default, {
className: popoverContentClassName,
value: color,
onChange: onColorChange,
colors,
disableCustomColors,
__experimentalIsRenderedInSidebar,
clearable: false,
enableAlpha
}), enableStyle && isStyleSettable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_control_style_picker_component_component_default, {
label: (0,external_wp_i18n_namespaceObject.__)("Style"),
value: style,
onChange: onStyleChange
})]
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: resetButtonWrapperClassName,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
variant: "tertiary",
onClick: () => {
onReset();
},
disabled: !enableResetButton,
accessibleWhenDisabled: true,
__next40pxDefaultSize: true,
children: (0,external_wp_i18n_namespaceObject.__)("Reset")
})
})]
})
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_default, {
renderToggle,
renderContent,
popoverProps: {
...__unstablePopoverProps
},
...otherProps,
ref: forwardedRef
});
};
const ConnectedBorderControlDropdown = contextConnect(BorderControlDropdown, "BorderControlDropdown");
var border_control_dropdown_component_component_default = ConnectedBorderControlDropdown;
;// ./node_modules/@wordpress/components/build-module/unit-control/unit-select-control.js
function UnitSelectControl({
className,
isUnitSelectTabbable: isTabbable = true,
onChange,
size = "default",
unit = "px",
units = CSS_UNITS,
...props
}, ref) {
if (!hasUnits(units) || units?.length === 1) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(UnitLabel, {
className: "components-unit-control__unit-label",
selectSize: size,
children: unit
});
}
const handleOnChange = (event) => {
const {
value: unitValue
} = event.target;
const data = units.find((option) => option.value === unitValue);
onChange?.(unitValue, {
event,
data
});
};
const classes = dist_clsx("components-unit-control__select", className);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(UnitSelect, {
ref,
className: classes,
onChange: handleOnChange,
selectSize: size,
tabIndex: isTabbable ? void 0 : -1,
value: unit,
...props,
children: units.map((option) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("option", {
value: option.value,
children: option.label
}, option.value))
});
}
var unit_select_control_default = (0,external_wp_element_namespaceObject.forwardRef)(UnitSelectControl);
;// ./node_modules/@wordpress/components/build-module/unit-control/index.js
function UnforwardedUnitControl(unitControlProps, forwardedRef) {
const {
__unstableStateReducer,
autoComplete = "off",
// @ts-expect-error Ensure that children is omitted from restProps
children,
className,
disabled = false,
disableUnits = false,
isPressEnterToChange = false,
isResetValueOnUnitChange = false,
isUnitSelectTabbable = true,
label,
onChange: onChangeProp,
onUnitChange,
size = "default",
unit: unitProp,
units: unitsProp = CSS_UNITS,
value: valueProp,
onFocus: onFocusProp,
__shouldNotWarnDeprecated36pxSize,
...props
} = useDeprecated36pxDefaultSizeProp(unitControlProps);
maybeWarnDeprecated36pxSize({
componentName: "UnitControl",
__next40pxDefaultSize: props.__next40pxDefaultSize,
size,
__shouldNotWarnDeprecated36pxSize
});
if ("unit" in unitControlProps) {
external_wp_deprecated_default()("UnitControl unit prop", {
since: "5.6",
hint: "The unit should be provided within the `value` prop.",
version: "6.2"
});
}
const nonNullValueProp = valueProp !== null && valueProp !== void 0 ? valueProp : void 0;
const [units, reFirstCharacterOfUnits] = (0,external_wp_element_namespaceObject.useMemo)(() => {
const list = getUnitsWithCurrentUnit(nonNullValueProp, unitProp, unitsProp);
const [{
value: firstUnitValue = ""
} = {}, ...rest] = list;
const firstCharacters = rest.reduce((carry, {
value
}) => {
const first = escapeRegExp(value?.substring(0, 1) || "");
return carry.includes(first) ? carry : `${carry}|${first}`;
}, escapeRegExp(firstUnitValue.substring(0, 1)));
return [list, new RegExp(`^(?:${firstCharacters})$`, "i")];
}, [nonNullValueProp, unitProp, unitsProp]);
const [parsedQuantity, parsedUnit] = getParsedQuantityAndUnit(nonNullValueProp, unitProp, units);
const [unit, setUnit] = use_controlled_state_default(units.length === 1 ? units[0].value : unitProp, {
initial: parsedUnit,
fallback: ""
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (parsedUnit !== void 0) {
setUnit(parsedUnit);
}
}, [parsedUnit, setUnit]);
const classes = dist_clsx(
"components-unit-control",
// This class is added for legacy purposes to maintain it on the outer
// wrapper. See: https://github.com/WordPress/gutenberg/pull/45139
"components-unit-control-wrapper",
className
);
const handleOnQuantityChange = (nextQuantityValue, changeProps) => {
if (nextQuantityValue === "" || typeof nextQuantityValue === "undefined" || nextQuantityValue === null) {
onChangeProp?.("", changeProps);
return;
}
const onChangeValue = getValidParsedQuantityAndUnit(nextQuantityValue, units, parsedQuantity, unit).join("");
onChangeProp?.(onChangeValue, changeProps);
};
const handleOnUnitChange = (nextUnitValue, changeProps) => {
const {
data
} = changeProps;
let nextValue = `${parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : ""}${nextUnitValue}`;
if (isResetValueOnUnitChange && data?.default !== void 0) {
nextValue = `${data.default}${nextUnitValue}`;
}
onChangeProp?.(nextValue, changeProps);
onUnitChange?.(nextUnitValue, changeProps);
setUnit(nextUnitValue);
};
let handleOnKeyDown;
if (!disableUnits && isUnitSelectTabbable && units.length) {
handleOnKeyDown = (event) => {
props.onKeyDown?.(event);
if (!event.metaKey && !event.ctrlKey && reFirstCharacterOfUnits.test(event.key)) {
refInputSuffix.current?.focus();
}
};
}
const refInputSuffix = (0,external_wp_element_namespaceObject.useRef)(null);
const inputSuffix = !disableUnits ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(unit_select_control_default, {
ref: refInputSuffix,
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Select unit"),
disabled,
isUnitSelectTabbable,
onChange: handleOnUnitChange,
size: ["small", "compact"].includes(size) || size === "default" && !props.__next40pxDefaultSize ? "small" : "default",
unit,
units,
onFocus: onFocusProp,
onBlur: unitControlProps.onBlur
}) : null;
let step = props.step;
if (!step && units) {
var _activeUnit$step;
const activeUnit = units.find((option) => option.value === unit);
step = (_activeUnit$step = activeUnit?.step) !== null && _activeUnit$step !== void 0 ? _activeUnit$step : 1;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ValueInput, {
...props,
__shouldNotWarnDeprecated36pxSize: true,
autoComplete,
className: classes,
disabled,
spinControls: "none",
isPressEnterToChange,
label,
onKeyDown: handleOnKeyDown,
onChange: handleOnQuantityChange,
ref: forwardedRef,
size,
suffix: inputSuffix,
type: isPressEnterToChange ? "text" : "number",
value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : "",
step,
onFocus: onFocusProp,
__unstableStateReducer
});
}
const UnitControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedUnitControl);
var unit_control_default = UnitControl;
;// ./node_modules/@wordpress/components/build-module/border-control/border-control/hook.js
const isValidBorder = (border) => {
const hasWidth = border?.width !== void 0 && border.width !== "";
const hasColor = border?.color !== void 0;
return hasWidth || hasColor;
};
function useBorderControl(props) {
const {
className,
colors = [],
isCompact,
onChange,
enableAlpha = true,
enableStyle = true,
shouldSanitizeBorder = true,
size = "default",
value: border,
width,
__experimentalIsRenderedInSidebar = false,
__next40pxDefaultSize,
__shouldNotWarnDeprecated36pxSize,
...otherProps
} = useContextSystem(props, "BorderControl");
maybeWarnDeprecated36pxSize({
componentName: "BorderControl",
__next40pxDefaultSize,
size,
__shouldNotWarnDeprecated36pxSize
});
const computedSize = size === "default" && __next40pxDefaultSize ? "__unstable-large" : size;
const [widthValue, originalWidthUnit] = parseQuantityAndUnitFromRawValue(border?.width);
const widthUnit = originalWidthUnit || "px";
const hadPreviousZeroWidth = widthValue === 0;
const [colorSelection, setColorSelection] = (0,external_wp_element_namespaceObject.useState)();
const [styleSelection, setStyleSelection] = (0,external_wp_element_namespaceObject.useState)();
const isStyleSettable = shouldSanitizeBorder ? isValidBorder(border) : true;
const onBorderChange = (0,external_wp_element_namespaceObject.useCallback)((newBorder) => {
if (shouldSanitizeBorder && !isValidBorder(newBorder)) {
onChange(void 0);
return;
}
onChange(newBorder);
}, [onChange, shouldSanitizeBorder]);
const onWidthChange = (0,external_wp_element_namespaceObject.useCallback)((newWidth) => {
const newWidthValue = newWidth === "" ? void 0 : newWidth;
const [parsedValue] = parseQuantityAndUnitFromRawValue(newWidth);
const hasZeroWidth = parsedValue === 0;
const updatedBorder = {
...border,
width: newWidthValue
};
if (hasZeroWidth && !hadPreviousZeroWidth) {
setColorSelection(border?.color);
setStyleSelection(border?.style);
updatedBorder.color = void 0;
updatedBorder.style = "none";
}
if (!hasZeroWidth && hadPreviousZeroWidth) {
if (updatedBorder.color === void 0) {
updatedBorder.color = colorSelection;
}
if (updatedBorder.style === "none") {
updatedBorder.style = styleSelection;
}
}
onBorderChange(updatedBorder);
}, [border, hadPreviousZeroWidth, colorSelection, styleSelection, onBorderChange]);
const onSliderChange = (0,external_wp_element_namespaceObject.useCallback)((value) => {
onWidthChange(`${value}${widthUnit}`);
}, [onWidthChange, widthUnit]);
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(borderControl, className);
}, [className, cx]);
let wrapperWidth = width;
if (isCompact) {
wrapperWidth = size === "__unstable-large" ? "116px" : "90px";
}
const innerWrapperClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
const widthStyle = !!wrapperWidth && styles_wrapperWidth;
const heightStyle = wrapperHeight(computedSize);
return cx(innerWrapper(), widthStyle, heightStyle);
}, [wrapperWidth, cx, computedSize]);
const sliderClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(borderSlider());
}, [cx]);
return {
...otherProps,
className: classes,
colors,
enableAlpha,
enableStyle,
innerWrapperClassName,
inputWidth: wrapperWidth,
isStyleSettable,
onBorderChange,
onSliderChange,
onWidthChange,
previousStyleSelection: styleSelection,
sliderClassName,
value: border,
widthUnit,
widthValue,
size: computedSize,
__experimentalIsRenderedInSidebar,
__next40pxDefaultSize
};
}
;// ./node_modules/@wordpress/components/build-module/border-control/border-control/component.js
const BorderLabel = (props) => {
const {
label,
hideLabelFromVision
} = props;
if (!label) {
return null;
}
return hideLabelFromVision ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
as: "legend",
children: label
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledLabel, {
as: "legend",
children: label
});
};
const UnconnectedBorderControl = (props, forwardedRef) => {
const {
__next40pxDefaultSize = false,
colors,
disableCustomColors,
disableUnits,
enableAlpha,
enableStyle,
hideLabelFromVision,
innerWrapperClassName,
inputWidth,
isStyleSettable,
label,
onBorderChange,
onSliderChange,
onWidthChange,
placeholder,
__unstablePopoverProps,
previousStyleSelection,
showDropdownHeader,
size,
sliderClassName,
value: border,
widthUnit,
widthValue,
withSlider,
__experimentalIsRenderedInSidebar,
...otherProps
} = useBorderControl(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(component_default, {
as: "fieldset",
...otherProps,
ref: forwardedRef,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BorderLabel, {
label,
hideLabelFromVision
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
spacing: 4,
className: innerWrapperClassName,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(unit_control_default, {
__next40pxDefaultSize,
__shouldNotWarnDeprecated36pxSize: true,
prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {
marginRight: 1,
marginBottom: 0,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_control_dropdown_component_component_default, {
border,
colors,
__unstablePopoverProps,
disableCustomColors,
enableAlpha,
enableStyle,
isStyleSettable,
onChange: onBorderChange,
previousStyleSelection,
__experimentalIsRenderedInSidebar,
size
})
}),
label: (0,external_wp_i18n_namespaceObject.__)("Border width"),
hideLabelFromVision: true,
min: 0,
onChange: onWidthChange,
value: border?.width || "",
placeholder,
disableUnits,
__unstableInputWidth: inputWidth,
size
}), withSlider && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(range_control_default, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Border width"),
hideLabelFromVision: true,
className: sliderClassName,
initialPosition: 0,
max: 100,
min: 0,
onChange: onSliderChange,
step: ["px", "%"].includes(widthUnit) ? 1 : 0.1,
value: widthValue || void 0,
withInputField: false,
__next40pxDefaultSize,
__shouldNotWarnDeprecated36pxSize: true
})]
})]
});
};
const BorderControl = contextConnect(UnconnectedBorderControl, "BorderControl");
var border_control_component_component_default = BorderControl;
;// ./node_modules/@wordpress/components/build-module/grid/utils.js
const utils_ALIGNMENTS = {
bottom: {
alignItems: "flex-end",
justifyContent: "center"
},
bottomLeft: {
alignItems: "flex-start",
justifyContent: "flex-end"
},
bottomRight: {
alignItems: "flex-end",
justifyContent: "flex-end"
},
center: {
alignItems: "center",
justifyContent: "center"
},
spaced: {
alignItems: "center",
justifyContent: "space-between"
},
left: {
alignItems: "center",
justifyContent: "flex-start"
},
right: {
alignItems: "center",
justifyContent: "flex-end"
},
stretch: {
alignItems: "stretch"
},
top: {
alignItems: "flex-start",
justifyContent: "center"
},
topLeft: {
alignItems: "flex-start",
justifyContent: "flex-start"
},
topRight: {
alignItems: "flex-start",
justifyContent: "flex-end"
}
};
function utils_getAlignmentProps(alignment) {
const alignmentProps = alignment ? utils_ALIGNMENTS[alignment] : {};
return alignmentProps;
}
;// ./node_modules/@wordpress/components/build-module/grid/hook.js
function useGrid(props) {
const {
align,
alignment,
className,
columnGap,
columns = 2,
gap = 3,
isInline = false,
justify,
rowGap,
rows,
templateColumns,
templateRows,
...otherProps
} = useContextSystem(props, "Grid");
const columnsAsArray = Array.isArray(columns) ? columns : [columns];
const column = useResponsiveValue(columnsAsArray);
const rowsAsArray = Array.isArray(rows) ? rows : [rows];
const row = useResponsiveValue(rowsAsArray);
const gridTemplateColumns = templateColumns || !!columns && `repeat( ${column}, 1fr )`;
const gridTemplateRows = templateRows || !!rows && `repeat( ${row}, 1fr )`;
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
const alignmentProps = utils_getAlignmentProps(alignment);
const gridClasses = /* @__PURE__ */ emotion_react_browser_esm_css({
alignItems: align,
display: isInline ? "inline-grid" : "grid",
gap: `calc( ${config_values_default.gridBase} * ${gap} )`,
gridTemplateColumns: gridTemplateColumns || void 0,
gridTemplateRows: gridTemplateRows || void 0,
gridRowGap: rowGap,
gridColumnGap: columnGap,
justifyContent: justify,
verticalAlign: isInline ? "middle" : void 0,
...alignmentProps
}, true ? "" : 0, true ? "" : 0);
return cx(gridClasses, className);
}, [align, alignment, className, columnGap, cx, gap, gridTemplateColumns, gridTemplateRows, isInline, justify, rowGap]);
return {
...otherProps,
className: classes
};
}
;// ./node_modules/@wordpress/components/build-module/grid/component.js
function UnconnectedGrid(props, forwardedRef) {
const gridProps = useGrid(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...gridProps,
ref: forwardedRef
});
}
const Grid = contextConnect(UnconnectedGrid, "Grid");
var grid_component_component_default = Grid;
;// ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-split-controls/hook.js
function useBorderBoxControlSplitControls(props) {
const {
className,
colors = [],
enableAlpha = false,
enableStyle = true,
size = "default",
__experimentalIsRenderedInSidebar = false,
...otherProps
} = useContextSystem(props, "BorderBoxControlSplitControls");
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(borderBoxControlSplitControls(size), className);
}, [cx, className, size]);
const centeredClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(centeredBorderControl, className);
}, [cx, className]);
const rightAlignedClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(rightBorderControl(), className);
}, [cx, className]);
return {
...otherProps,
centeredClassName,
className: classes,
colors,
enableAlpha,
enableStyle,
rightAlignedClassName,
size,
__experimentalIsRenderedInSidebar
};
}
;// ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-split-controls/component.js
const BorderBoxControlSplitControls = (props, forwardedRef) => {
const {
centeredClassName,
colors,
disableCustomColors,
enableAlpha,
enableStyle,
onChange,
popoverPlacement,
popoverOffset,
rightAlignedClassName,
size = "default",
value,
__experimentalIsRenderedInSidebar,
...otherProps
} = useBorderBoxControlSplitControls(props);
const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => popoverPlacement ? {
placement: popoverPlacement,
offset: popoverOffset,
anchor: popoverAnchor,
shift: true
} : void 0, [popoverPlacement, popoverOffset, popoverAnchor]);
const sharedBorderControlProps = {
colors,
disableCustomColors,
enableAlpha,
enableStyle,
isCompact: true,
__experimentalIsRenderedInSidebar,
size,
__shouldNotWarnDeprecated36pxSize: true
};
const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, forwardedRef]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(grid_component_component_default, {
...otherProps,
ref: mergedRef,
gap: 3,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_box_control_visualizer_component_component_default, {
value,
size
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_control_component_component_default, {
className: centeredClassName,
hideLabelFromVision: true,
label: (0,external_wp_i18n_namespaceObject.__)("Top border"),
onChange: (newBorder) => onChange(newBorder, "top"),
__unstablePopoverProps: popoverProps,
value: value?.top,
...sharedBorderControlProps
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_control_component_component_default, {
hideLabelFromVision: true,
label: (0,external_wp_i18n_namespaceObject.__)("Left border"),
onChange: (newBorder) => onChange(newBorder, "left"),
__unstablePopoverProps: popoverProps,
value: value?.left,
...sharedBorderControlProps
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_control_component_component_default, {
className: rightAlignedClassName,
hideLabelFromVision: true,
label: (0,external_wp_i18n_namespaceObject.__)("Right border"),
onChange: (newBorder) => onChange(newBorder, "right"),
__unstablePopoverProps: popoverProps,
value: value?.right,
...sharedBorderControlProps
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_control_component_component_default, {
className: centeredClassName,
hideLabelFromVision: true,
label: (0,external_wp_i18n_namespaceObject.__)("Bottom border"),
onChange: (newBorder) => onChange(newBorder, "bottom"),
__unstablePopoverProps: popoverProps,
value: value?.bottom,
...sharedBorderControlProps
})]
});
};
const ConnectedBorderBoxControlSplitControls = contextConnect(BorderBoxControlSplitControls, "BorderBoxControlSplitControls");
var border_box_control_split_controls_component_component_default = ConnectedBorderBoxControlSplitControls;
;// ./node_modules/@wordpress/components/build-module/utils/unit-values.js
const UNITED_VALUE_REGEX = /^([\d.\-+]*)\s*(fr|cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax|%|cap|ic|rlh|vi|vb|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx|svw|lvw|dvw|svh|lvh|dvh|svi|lvi|dvi|svb|lvb|dvb|svmin|lvmin|dvmin|svmax|lvmax|dvmax)?$/;
function parseCSSUnitValue(toParse) {
const value = toParse.trim();
const matched = value.match(UNITED_VALUE_REGEX);
if (!matched) {
return [void 0, void 0];
}
const [, num, unit] = matched;
let numParsed = parseFloat(num);
numParsed = Number.isNaN(numParsed) ? void 0 : numParsed;
return [numParsed, unit];
}
function createCSSUnitValue(value, unit) {
return `${value}${unit}`;
}
;// ./node_modules/@wordpress/components/build-module/border-box-control/utils.js
const utils_sides = ["top", "right", "bottom", "left"];
const borderProps = ["color", "style", "width"];
const isEmptyBorder = (border) => {
if (!border) {
return true;
}
return !borderProps.some((prop) => border[prop] !== void 0);
};
const isDefinedBorder = (border) => {
if (!border) {
return false;
}
if (hasSplitBorders(border)) {
const allSidesEmpty = utils_sides.every((side) => isEmptyBorder(border[side]));
return !allSidesEmpty;
}
return !isEmptyBorder(border);
};
const isCompleteBorder = (border) => {
if (!border) {
return false;
}
return borderProps.every((prop) => border[prop] !== void 0);
};
const hasSplitBorders = (border = {}) => {
return Object.keys(border).some((side) => utils_sides.indexOf(side) !== -1);
};
const hasMixedBorders = (borders) => {
if (!hasSplitBorders(borders)) {
return false;
}
const shorthandBorders = utils_sides.map((side) => getShorthandBorderStyle(borders?.[side]));
return !shorthandBorders.every((border) => border === shorthandBorders[0]);
};
const getSplitBorders = (border) => {
if (!border || isEmptyBorder(border)) {
return void 0;
}
return {
top: border,
right: border,
bottom: border,
left: border
};
};
const getBorderDiff = (original, updated) => {
const diff = {};
if (original.color !== updated.color) {
diff.color = updated.color;
}
if (original.style !== updated.style) {
diff.style = updated.style;
}
if (original.width !== updated.width) {
diff.width = updated.width;
}
return diff;
};
const getCommonBorder = (borders) => {
if (!borders) {
return void 0;
}
const colors = [];
const styles = [];
const widths = [];
utils_sides.forEach((side) => {
colors.push(borders[side]?.color);
styles.push(borders[side]?.style);
widths.push(borders[side]?.width);
});
const allColorsMatch = colors.every((value) => value === colors[0]);
const allStylesMatch = styles.every((value) => value === styles[0]);
const allWidthsMatch = widths.every((value) => value === widths[0]);
return {
color: allColorsMatch ? colors[0] : void 0,
style: allStylesMatch ? styles[0] : void 0,
width: allWidthsMatch ? widths[0] : getMostCommonUnit(widths)
};
};
const getShorthandBorderStyle = (border, fallbackBorder) => {
if (isEmptyBorder(border)) {
return fallbackBorder;
}
const {
color: fallbackColor,
style: fallbackStyle,
width: fallbackWidth
} = fallbackBorder || {};
const {
color = fallbackColor,
style = fallbackStyle,
width = fallbackWidth
} = border;
const hasVisibleBorder = !!width && width !== "0" || !!color;
const borderStyle = hasVisibleBorder ? style || "solid" : style;
return [width, borderStyle, color].filter(Boolean).join(" ");
};
const getMostCommonUnit = (values) => {
const units = values.map((value) => value === void 0 ? void 0 : parseCSSUnitValue(`${value}`)[1]);
const filteredUnits = units.filter((value) => value !== void 0);
return mode(filteredUnits);
};
function mode(values) {
if (values.length === 0) {
return void 0;
}
const map = {};
let maxCount = 0;
let currentMode;
values.forEach((value) => {
map[value] = map[value] === void 0 ? 1 : map[value] + 1;
if (map[value] > maxCount) {
currentMode = value;
maxCount = map[value];
}
});
return currentMode;
}
;// ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control/hook.js
function useBorderBoxControl(props) {
const {
className,
colors = [],
onChange,
enableAlpha = false,
enableStyle = true,
size = "default",
value,
__experimentalIsRenderedInSidebar = false,
__next40pxDefaultSize,
...otherProps
} = useContextSystem(props, "BorderBoxControl");
maybeWarnDeprecated36pxSize({
componentName: "BorderBoxControl",
__next40pxDefaultSize,
size
});
const computedSize = size === "default" && __next40pxDefaultSize ? "__unstable-large" : size;
const mixedBorders = hasMixedBorders(value);
const splitBorders = hasSplitBorders(value);
const linkedValue = splitBorders ? getCommonBorder(value) : value;
const splitValue = splitBorders ? value : getSplitBorders(value);
const hasWidthValue = !isNaN(parseFloat(`${linkedValue?.width}`));
const [isLinked, setIsLinked] = (0,external_wp_element_namespaceObject.useState)(!mixedBorders);
const toggleLinked = () => setIsLinked(!isLinked);
const onLinkedChange = (newBorder) => {
if (!newBorder) {
return onChange(void 0);
}
if (!mixedBorders || isCompleteBorder(newBorder)) {
return onChange(isEmptyBorder(newBorder) ? void 0 : newBorder);
}
const changes = getBorderDiff(linkedValue, newBorder);
const updatedBorders = {
top: {
...value?.top,
...changes
},
right: {
...value?.right,
...changes
},
bottom: {
...value?.bottom,
...changes
},
left: {
...value?.left,
...changes
}
};
if (hasMixedBorders(updatedBorders)) {
return onChange(updatedBorders);
}
const filteredResult = isEmptyBorder(updatedBorders.top) ? void 0 : updatedBorders.top;
onChange(filteredResult);
};
const onSplitChange = (newBorder, side) => {
const updatedBorders = {
...splitValue,
[side]: newBorder
};
if (hasMixedBorders(updatedBorders)) {
onChange(updatedBorders);
} else {
onChange(newBorder);
}
};
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(borderBoxControl, className);
}, [cx, className]);
const linkedControlClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(linkedBorderControl());
}, [cx]);
const wrapperClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(wrapper);
}, [cx]);
return {
...otherProps,
className: classes,
colors,
disableUnits: mixedBorders && !hasWidthValue,
enableAlpha,
enableStyle,
hasMixedBorders: mixedBorders,
isLinked,
linkedControlClassName,
onLinkedChange,
onSplitChange,
toggleLinked,
linkedValue,
size: computedSize,
splitValue,
wrapperClassName,
__experimentalIsRenderedInSidebar
};
}
;// ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control/component.js
const component_BorderLabel = (props) => {
const {
label,
hideLabelFromVision
} = props;
if (!label) {
return null;
}
return hideLabelFromVision ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
as: "label",
children: label
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledLabel, {
children: label
});
};
const UnconnectedBorderBoxControl = (props, forwardedRef) => {
const {
className,
colors,
disableCustomColors,
disableUnits,
enableAlpha,
enableStyle,
hasMixedBorders,
hideLabelFromVision,
isLinked,
label,
linkedControlClassName,
linkedValue,
onLinkedChange,
onSplitChange,
popoverPlacement,
popoverOffset,
size,
splitValue,
toggleLinked,
wrapperClassName,
__experimentalIsRenderedInSidebar,
...otherProps
} = useBorderBoxControl(props);
const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => popoverPlacement ? {
placement: popoverPlacement,
offset: popoverOffset,
anchor: popoverAnchor,
shift: true
} : void 0, [popoverPlacement, popoverOffset, popoverAnchor]);
const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, forwardedRef]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(component_default, {
className,
...otherProps,
ref: mergedRef,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_BorderLabel, {
label,
hideLabelFromVision
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(component_default, {
className: wrapperClassName,
children: [isLinked ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_control_component_component_default, {
className: linkedControlClassName,
colors,
disableUnits,
disableCustomColors,
enableAlpha,
enableStyle,
onChange: onLinkedChange,
placeholder: hasMixedBorders ? (0,external_wp_i18n_namespaceObject.__)("Mixed") : void 0,
__unstablePopoverProps: popoverProps,
shouldSanitizeBorder: false,
value: linkedValue,
withSlider: true,
width: size === "__unstable-large" ? "116px" : "110px",
__experimentalIsRenderedInSidebar,
__shouldNotWarnDeprecated36pxSize: true,
size
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_box_control_split_controls_component_component_default, {
colors,
disableCustomColors,
enableAlpha,
enableStyle,
onChange: onSplitChange,
popoverPlacement,
popoverOffset,
value: splitValue,
__experimentalIsRenderedInSidebar,
size
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_box_control_linked_button_component_component_default, {
onClick: toggleLinked,
isLinked,
size
})]
})]
});
};
const BorderBoxControl = contextConnect(UnconnectedBorderBoxControl, "BorderBoxControl");
var border_box_control_component_component_default = BorderBoxControl;
;// ./node_modules/@wordpress/icons/build-module/library/settings.js
var settings_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z" })
] });
;// ./node_modules/@wordpress/components/build-module/box-control/utils.js
const CUSTOM_VALUE_SETTINGS = {
px: {
max: 300,
step: 1
},
"%": {
max: 100,
step: 1
},
vw: {
max: 100,
step: 1
},
vh: {
max: 100,
step: 1
},
em: {
max: 10,
step: 0.1
},
rm: {
max: 10,
step: 0.1
},
svw: {
max: 100,
step: 1
},
lvw: {
max: 100,
step: 1
},
dvw: {
max: 100,
step: 1
},
svh: {
max: 100,
step: 1
},
lvh: {
max: 100,
step: 1
},
dvh: {
max: 100,
step: 1
},
vi: {
max: 100,
step: 1
},
svi: {
max: 100,
step: 1
},
lvi: {
max: 100,
step: 1
},
dvi: {
max: 100,
step: 1
},
vb: {
max: 100,
step: 1
},
svb: {
max: 100,
step: 1
},
lvb: {
max: 100,
step: 1
},
dvb: {
max: 100,
step: 1
},
vmin: {
max: 100,
step: 1
},
svmin: {
max: 100,
step: 1
},
lvmin: {
max: 100,
step: 1
},
dvmin: {
max: 100,
step: 1
},
vmax: {
max: 100,
step: 1
},
svmax: {
max: 100,
step: 1
},
lvmax: {
max: 100,
step: 1
},
dvmax: {
max: 100,
step: 1
}
};
const LABELS = {
all: (0,external_wp_i18n_namespaceObject.__)("All sides"),
top: (0,external_wp_i18n_namespaceObject.__)("Top side"),
bottom: (0,external_wp_i18n_namespaceObject.__)("Bottom side"),
left: (0,external_wp_i18n_namespaceObject.__)("Left side"),
right: (0,external_wp_i18n_namespaceObject.__)("Right side"),
vertical: (0,external_wp_i18n_namespaceObject.__)("Top and bottom sides"),
horizontal: (0,external_wp_i18n_namespaceObject.__)("Left and right sides")
};
const DEFAULT_VALUES = {
top: void 0,
right: void 0,
bottom: void 0,
left: void 0
};
const ALL_SIDES = ["top", "right", "bottom", "left"];
function utils_mode(arr) {
return arr.sort((a, b) => arr.filter((v) => v === a).length - arr.filter((v) => v === b).length).pop();
}
function getMergedValue(values = {}, availableSides = ALL_SIDES) {
const sides = normalizeSides(availableSides);
if (sides.every((side) => values[side] === values[sides[0]])) {
return values[sides[0]];
}
return void 0;
}
function isValueMixed(values = {}, availableSides = ALL_SIDES) {
const sides = normalizeSides(availableSides);
return sides.some((side) => values[side] !== values[sides[0]]);
}
function getAllUnitFallback(selectedUnits) {
if (!selectedUnits || typeof selectedUnits !== "object") {
return void 0;
}
const filteredUnits = Object.values(selectedUnits).filter(Boolean);
return utils_mode(filteredUnits);
}
function isValuesDefined(values) {
return values && Object.values(values).filter(
// Switching units when input is empty causes values only
// containing units. This gives false positive on mixed values
// unless filtered.
(value) => !!value && /\d/.test(value)
).length > 0;
}
function getInitialSide(isLinked, splitOnAxis) {
let initialSide = "all";
if (!isLinked) {
initialSide = splitOnAxis ? "vertical" : "top";
}
return initialSide;
}
function normalizeSides(sides) {
const filteredSides = [];
if (!sides?.length) {
return ALL_SIDES;
}
if (sides.includes("vertical")) {
filteredSides.push(...["top", "bottom"]);
} else if (sides.includes("horizontal")) {
filteredSides.push(...["left", "right"]);
} else {
const newSides = ALL_SIDES.filter((side) => sides.includes(side));
filteredSides.push(...newSides);
}
return filteredSides;
}
function applyValueToSides(currentValues, newValue, sides) {
external_wp_deprecated_default()("applyValueToSides", {
since: "6.8",
version: "7.0"
});
const newValues = {
...currentValues
};
if (sides?.length) {
sides.forEach((side) => {
if (side === "vertical") {
newValues.top = newValue;
newValues.bottom = newValue;
} else if (side === "horizontal") {
newValues.left = newValue;
newValues.right = newValue;
} else {
newValues[side] = newValue;
}
});
} else {
ALL_SIDES.forEach((side) => newValues[side] = newValue);
}
return newValues;
}
function getAllowedSides(sides) {
const allowedSides = new Set(!sides ? ALL_SIDES : []);
sides?.forEach((allowedSide) => {
if (allowedSide === "vertical") {
allowedSides.add("top");
allowedSides.add("bottom");
} else if (allowedSide === "horizontal") {
allowedSides.add("right");
allowedSides.add("left");
} else {
allowedSides.add(allowedSide);
}
});
return allowedSides;
}
function isValuePreset(value, presetKey) {
return value.startsWith(`var:preset|${presetKey}|`);
}
function getPresetIndexFromValue(value, presetKey, presets) {
if (!isValuePreset(value, presetKey)) {
return void 0;
}
const match = value.match(new RegExp(`^var:preset\\|${presetKey}\\|(.+)$`));
if (!match) {
return void 0;
}
const slug = match[1];
const index = presets.findIndex((preset) => {
return preset.slug === slug;
});
return index !== -1 ? index : void 0;
}
function getPresetValueFromIndex(index, presetKey, presets) {
const preset = presets[index];
return `var:preset|${presetKey}|${preset.slug}`;
}
;// ./node_modules/@wordpress/components/build-module/box-control/styles/box-control-icon-styles.js
function box_control_icon_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const box_control_icon_styles_Root = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1j5nr4z8"
} : 0)( true ? {
name: "1w884gc",
styles: "box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px"
} : 0);
const Viewbox = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1j5nr4z7"
} : 0)( true ? {
name: "i6vjox",
styles: "box-sizing:border-box;display:block;position:relative;width:100%;height:100%"
} : 0);
const strokeFocus = ({
isFocused
}) => {
return /* @__PURE__ */ emotion_react_browser_esm_css({
backgroundColor: "currentColor",
opacity: isFocused ? 1 : 0.3
}, true ? "" : 0, true ? "" : 0);
};
const Stroke = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1j5nr4z6"
} : 0)("box-sizing:border-box;display:block;pointer-events:none;position:absolute;", strokeFocus, ";" + ( true ? "" : 0));
const VerticalStroke = /* @__PURE__ */ emotion_styled_base_browser_esm(Stroke, true ? {
target: "e1j5nr4z5"
} : 0)( true ? {
name: "1k2w39q",
styles: "bottom:3px;top:3px;width:2px"
} : 0);
const HorizontalStroke = /* @__PURE__ */ emotion_styled_base_browser_esm(Stroke, true ? {
target: "e1j5nr4z4"
} : 0)( true ? {
name: "1q9b07k",
styles: "height:2px;left:3px;right:3px"
} : 0);
const TopStroke = /* @__PURE__ */ emotion_styled_base_browser_esm(HorizontalStroke, true ? {
target: "e1j5nr4z3"
} : 0)( true ? {
name: "abcix4",
styles: "top:0"
} : 0);
const RightStroke = /* @__PURE__ */ emotion_styled_base_browser_esm(VerticalStroke, true ? {
target: "e1j5nr4z2"
} : 0)( true ? {
name: "1wf8jf",
styles: "right:0"
} : 0);
const BottomStroke = /* @__PURE__ */ emotion_styled_base_browser_esm(HorizontalStroke, true ? {
target: "e1j5nr4z1"
} : 0)( true ? {
name: "8tapst",
styles: "bottom:0"
} : 0);
const LeftStroke = /* @__PURE__ */ emotion_styled_base_browser_esm(VerticalStroke, true ? {
target: "e1j5nr4z0"
} : 0)( true ? {
name: "1ode3cm",
styles: "left:0"
} : 0);
;// ./node_modules/@wordpress/components/build-module/box-control/icon.js
const BASE_ICON_SIZE = 24;
function BoxControlIcon({
size = 24,
side = "all",
sides,
...props
}) {
const isSideDisabled = (value) => sides?.length && !sides.includes(value);
const hasSide = (value) => {
if (isSideDisabled(value)) {
return false;
}
return side === "all" || side === value;
};
const top = hasSide("top") || hasSide("vertical");
const right = hasSide("right") || hasSide("horizontal");
const bottom = hasSide("bottom") || hasSide("vertical");
const left = hasSide("left") || hasSide("horizontal");
const scale = size / BASE_ICON_SIZE;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(box_control_icon_styles_Root, {
style: {
transform: `scale(${scale})`
},
...props,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Viewbox, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TopStroke, {
isFocused: top
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RightStroke, {
isFocused: right
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BottomStroke, {
isFocused: bottom
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LeftStroke, {
isFocused: left
})]
})
});
}
;// ./node_modules/@wordpress/components/build-module/box-control/styles/box-control-styles.js
function box_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const StyledUnitControl = /* @__PURE__ */ emotion_styled_base_browser_esm(unit_control_default, true ? {
target: "e1jovhle5"
} : 0)( true ? {
name: "1ejyr19",
styles: "max-width:90px"
} : 0);
const InputWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm(h_stack_component_component_default, true ? {
target: "e1jovhle4"
} : 0)( true ? {
name: "1j1lmoi",
styles: "grid-column:1/span 3"
} : 0);
const ResetButton = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
target: "e1jovhle3"
} : 0)( true ? {
name: "tkya7b",
styles: "grid-area:1/2;justify-self:end"
} : 0);
const LinkedButtonWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e1jovhle2"
} : 0)( true ? {
name: "1dfa8al",
styles: "grid-area:1/3;justify-self:end"
} : 0);
const FlexedBoxControlIcon = /* @__PURE__ */ emotion_styled_base_browser_esm(BoxControlIcon, true ? {
target: "e1jovhle1"
} : 0)( true ? {
name: "ou8xsw",
styles: "flex:0 0 auto"
} : 0);
const FlexedRangeControl = /* @__PURE__ */ emotion_styled_base_browser_esm(range_control_default, true ? {
target: "e1jovhle0"
} : 0)("width:100%;margin-inline-end:", space(2), ";" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/box-control/input-control.js
const box_control_input_control_noop = () => {
};
function getSidesToModify(side, sides, isAlt) {
const allowedSides = getAllowedSides(sides);
let modifiedSides = [];
switch (side) {
case "all":
modifiedSides = ["top", "bottom", "left", "right"];
break;
case "horizontal":
modifiedSides = ["left", "right"];
break;
case "vertical":
modifiedSides = ["top", "bottom"];
break;
default:
modifiedSides = [side];
}
if (isAlt) {
switch (side) {
case "top":
modifiedSides.push("bottom");
break;
case "bottom":
modifiedSides.push("top");
break;
case "left":
modifiedSides.push("left");
break;
case "right":
modifiedSides.push("right");
break;
}
}
return modifiedSides.filter((s) => allowedSides.has(s));
}
function BoxInputControl({
__next40pxDefaultSize,
onChange = box_control_input_control_noop,
onFocus = box_control_input_control_noop,
values,
selectedUnits,
setSelectedUnits,
sides,
side,
min = 0,
presets,
presetKey,
...props
}) {
var _CUSTOM_VALUE_SETTING, _CUSTOM_VALUE_SETTING2;
const defaultValuesToModify = getSidesToModify(side, sides);
const handleOnFocus = (event) => {
onFocus(event, {
side
});
};
const handleOnChange = (nextValues) => {
onChange(nextValues);
};
const handleRawOnValueChange = (next) => {
const nextValues = {
...values
};
defaultValuesToModify.forEach((modifiedSide) => {
nextValues[modifiedSide] = next;
});
handleOnChange(nextValues);
};
const handleOnValueChange = (next, extra) => {
const nextValues = {
...values
};
const isNumeric = next !== void 0 && !isNaN(parseFloat(next));
const nextValue = isNumeric ? next : void 0;
const modifiedSides = getSidesToModify(
side,
sides,
/**
* Supports changing pair sides. For example, holding the ALT key
* when changing the TOP will also update BOTTOM.
*/
// @ts-expect-error - TODO: event.altKey is only present when the change event was
// triggered by a keyboard event. Should this feature be implemented differently so
// it also works with drag events?
!!extra?.event.altKey
);
modifiedSides.forEach((modifiedSide) => {
nextValues[modifiedSide] = nextValue;
});
handleOnChange(nextValues);
};
const handleOnUnitChange = (next) => {
const newUnits = {
...selectedUnits
};
defaultValuesToModify.forEach((modifiedSide) => {
newUnits[modifiedSide] = next;
});
setSelectedUnits(newUnits);
};
const mergedValue = getMergedValue(values, defaultValuesToModify);
const hasValues = isValuesDefined(values);
const isMixed = hasValues && defaultValuesToModify.length > 1 && isValueMixed(values, defaultValuesToModify);
const [parsedQuantity, parsedUnit] = parseQuantityAndUnitFromRawValue(mergedValue);
const computedUnit = hasValues ? parsedUnit : selectedUnits[defaultValuesToModify[0]];
const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(BoxInputControl, "box-control-input");
const inputId = [generatedId, side].join("-");
const isMixedUnit = defaultValuesToModify.length > 1 && mergedValue === void 0 && defaultValuesToModify.some((s) => selectedUnits[s] !== computedUnit);
const usedValue = mergedValue === void 0 && computedUnit ? computedUnit : mergedValue;
const mixedPlaceholder = isMixed || isMixedUnit ? (0,external_wp_i18n_namespaceObject.__)("Mixed") : void 0;
const hasPresets = presets && presets.length > 0 && presetKey;
const hasPresetValue = hasPresets && mergedValue !== void 0 && !isMixed && isValuePreset(mergedValue, presetKey);
const [showCustomValueControl, setShowCustomValueControl] = (0,external_wp_element_namespaceObject.useState)(!hasPresets || !hasPresetValue && !isMixed && mergedValue !== void 0);
const presetIndex = hasPresetValue ? getPresetIndexFromValue(mergedValue, presetKey, presets) : void 0;
const marks = hasPresets ? [{
value: 0,
label: "",
tooltip: (0,external_wp_i18n_namespaceObject.__)("None")
}, ...presets.map((preset, index) => {
var _preset$name;
return {
value: index + 1,
label: "",
tooltip: (_preset$name = preset.name) !== null && _preset$name !== void 0 ? _preset$name : preset.slug
};
})] : [];
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(InputWrapper, {
expanded: true,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexedBoxControlIcon, {
side,
sides
}), showCustomValueControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip_default, {
placement: "top-end",
text: LABELS[side],
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledUnitControl, {
...props,
min,
__shouldNotWarnDeprecated36pxSize: true,
__next40pxDefaultSize,
className: "component-box-control__unit-control",
id: inputId,
isPressEnterToChange: true,
disableUnits: isMixed || isMixedUnit,
value: usedValue,
onChange: handleOnValueChange,
onUnitChange: handleOnUnitChange,
onFocus: handleOnFocus,
label: LABELS[side],
placeholder: mixedPlaceholder,
hideLabelFromVision: true
})
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexedRangeControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize,
__shouldNotWarnDeprecated36pxSize: true,
"aria-controls": inputId,
label: LABELS[side],
hideLabelFromVision: true,
onChange: (newValue) => {
handleOnValueChange(newValue !== void 0 ? [newValue, computedUnit].join("") : void 0);
},
min: isFinite(min) ? min : 0,
max: (_CUSTOM_VALUE_SETTING = CUSTOM_VALUE_SETTINGS[computedUnit !== null && computedUnit !== void 0 ? computedUnit : "px"]?.max) !== null && _CUSTOM_VALUE_SETTING !== void 0 ? _CUSTOM_VALUE_SETTING : 10,
step: (_CUSTOM_VALUE_SETTING2 = CUSTOM_VALUE_SETTINGS[computedUnit !== null && computedUnit !== void 0 ? computedUnit : "px"]?.step) !== null && _CUSTOM_VALUE_SETTING2 !== void 0 ? _CUSTOM_VALUE_SETTING2 : 0.1,
value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : 0,
withInputField: false
})]
}), hasPresets && !showCustomValueControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexedRangeControl, {
__next40pxDefaultSize: true,
className: "spacing-sizes-control__range-control",
value: presetIndex !== void 0 ? presetIndex + 1 : 0,
onChange: (newIndex) => {
const newValue = newIndex === 0 || newIndex === void 0 ? void 0 : getPresetValueFromIndex(newIndex - 1, presetKey, presets);
handleRawOnValueChange(newValue);
},
withInputField: false,
"aria-valuenow": presetIndex !== void 0 ? presetIndex + 1 : 0,
"aria-valuetext": marks[presetIndex !== void 0 ? presetIndex + 1 : 0].tooltip,
renderTooltipContent: (index) => marks[!index ? 0 : index].tooltip,
min: 0,
max: marks.length - 1,
marks,
label: LABELS[side],
hideLabelFromVision: true,
__nextHasNoMarginBottom: true
}), hasPresets && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
label: showCustomValueControl ? (0,external_wp_i18n_namespaceObject.__)("Use size preset") : (0,external_wp_i18n_namespaceObject.__)("Set custom size"),
icon: settings_default,
onClick: () => {
setShowCustomValueControl(!showCustomValueControl);
},
isPressed: showCustomValueControl,
size: "small",
iconSize: 24
})]
}, `box-control-${side}`);
}
;// ./node_modules/@wordpress/components/build-module/box-control/linked-button.js
function LinkedButton({
isLinked,
...props
}) {
const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)("Unlink sides") : (0,external_wp_i18n_namespaceObject.__)("Link sides");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
...props,
className: "component-box-control__linked-button",
size: "small",
icon: isLinked ? link_default : link_off_default,
iconSize: 24,
label
});
}
;// ./node_modules/@wordpress/components/build-module/box-control/index.js
const defaultInputProps = {
min: 0
};
const box_control_noop = () => {
};
function box_control_useUniqueId(idProp) {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(BoxControl, "inspector-box-control");
return idProp || instanceId;
}
function BoxControl({
__next40pxDefaultSize = false,
id: idProp,
inputProps = defaultInputProps,
onChange = box_control_noop,
label = (0,external_wp_i18n_namespaceObject.__)("Box Control"),
values: valuesProp,
units,
sides,
splitOnAxis = false,
allowReset = true,
resetValues = DEFAULT_VALUES,
presets,
presetKey,
onMouseOver,
onMouseOut
}) {
const [values, setValues] = use_controlled_state_default(valuesProp, {
fallback: DEFAULT_VALUES
});
const inputValues = values || DEFAULT_VALUES;
const hasInitialValue = isValuesDefined(valuesProp);
const hasOneSide = sides?.length === 1;
const [isDirty, setIsDirty] = (0,external_wp_element_namespaceObject.useState)(hasInitialValue);
const [isLinked, setIsLinked] = (0,external_wp_element_namespaceObject.useState)(!hasInitialValue || !isValueMixed(inputValues) || hasOneSide);
const [side, setSide] = (0,external_wp_element_namespaceObject.useState)(getInitialSide(isLinked, splitOnAxis));
const [selectedUnits, setSelectedUnits] = (0,external_wp_element_namespaceObject.useState)({
top: parseQuantityAndUnitFromRawValue(valuesProp?.top)[1],
right: parseQuantityAndUnitFromRawValue(valuesProp?.right)[1],
bottom: parseQuantityAndUnitFromRawValue(valuesProp?.bottom)[1],
left: parseQuantityAndUnitFromRawValue(valuesProp?.left)[1]
});
const id = box_control_useUniqueId(idProp);
const headingId = `${id}-heading`;
const toggleLinked = () => {
setIsLinked(!isLinked);
setSide(getInitialSide(!isLinked, splitOnAxis));
};
const handleOnFocus = (_event, {
side: nextSide
}) => {
setSide(nextSide);
};
const handleOnChange = (nextValues) => {
onChange(nextValues);
setValues(nextValues);
setIsDirty(true);
};
const handleOnReset = () => {
onChange(resetValues);
setValues(resetValues);
setSelectedUnits(resetValues);
setIsDirty(false);
};
const inputControlProps = {
onMouseOver,
onMouseOut,
...inputProps,
onChange: handleOnChange,
onFocus: handleOnFocus,
isLinked,
units,
selectedUnits,
setSelectedUnits,
sides,
values: inputValues,
__next40pxDefaultSize,
presets,
presetKey
};
maybeWarnDeprecated36pxSize({
componentName: "BoxControl",
__next40pxDefaultSize,
size: void 0
});
const sidesToRender = getAllowedSides(sides);
if (presets && !presetKey || !presets && presetKey) {
const definedProp = presets ? "presets" : "presetKey";
const missingProp = presets ? "presetKey" : "presets";
true ? external_wp_warning_default()(`wp.components.BoxControl: the '${missingProp}' prop is required when the '${definedProp}' prop is defined.`) : 0;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(grid_component_component_default, {
id,
columns: 3,
templateColumns: "1fr min-content min-content",
role: "group",
"aria-labelledby": headingId,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BaseControl.VisualLabel, {
id: headingId,
children: label
}), isLinked && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWrapper, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BoxInputControl, {
side: "all",
...inputControlProps
})
}), !hasOneSide && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkedButtonWrapper, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkedButton, {
onClick: toggleLinked,
isLinked
})
}), !isLinked && splitOnAxis && ["vertical", "horizontal"].map((axis) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BoxInputControl, {
side: axis,
...inputControlProps
}, axis)), !isLinked && !splitOnAxis && Array.from(sidesToRender).map((axis) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BoxInputControl, {
side: axis,
...inputControlProps
}, axis)), allowReset && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ResetButton, {
className: "component-box-control__reset-button",
variant: "secondary",
size: "small",
onClick: handleOnReset,
disabled: !isDirty,
children: (0,external_wp_i18n_namespaceObject.__)("Reset")
})]
});
}
var box_control_default = BoxControl;
;// ./node_modules/@wordpress/components/build-module/button-group/index.js
function UnforwardedButtonGroup(props, ref) {
const {
className,
__shouldNotWarnDeprecated,
...restProps
} = props;
const classes = dist_clsx("components-button-group", className);
if (!__shouldNotWarnDeprecated) {
external_wp_deprecated_default()("wp.components.ButtonGroup", {
since: "6.8",
alternative: "wp.components.__experimentalToggleGroupControl"
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
ref,
role: "group",
className: classes,
...restProps
});
}
const ButtonGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedButtonGroup);
var button_group_default = ButtonGroup;
;// ./node_modules/@wordpress/components/build-module/elevation/styles.js
function elevation_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const Elevation = true ? {
name: "12ip69d",
styles: "background:transparent;display:block;margin:0!important;pointer-events:none;position:absolute;will-change:box-shadow"
} : 0;
;// ./node_modules/@wordpress/components/build-module/elevation/hook.js
function getBoxShadow(value) {
const boxShadowColor = `rgba(0, 0, 0, ${value / 20})`;
const boxShadow = `0 ${value}px ${value * 2}px 0
${boxShadowColor}`;
return boxShadow;
}
function useElevation(props) {
const {
active,
borderRadius = "inherit",
className,
focus,
hover,
isInteractive = false,
offset = 0,
value = 0,
...otherProps
} = useContextSystem(props, "Elevation");
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
let hoverValue = isValueDefined(hover) ? hover : value * 2;
let activeValue = isValueDefined(active) ? active : value / 2;
if (!isInteractive) {
hoverValue = isValueDefined(hover) ? hover : void 0;
activeValue = isValueDefined(active) ? active : void 0;
}
const transition = `box-shadow ${config_values_default.transitionDuration} ${config_values_default.transitionTimingFunction}`;
const sx = {};
sx.Base = /* @__PURE__ */ emotion_react_browser_esm_css({
borderRadius,
bottom: offset,
boxShadow: getBoxShadow(value),
opacity: config_values_default.elevationIntensity,
left: offset,
right: offset,
top: offset
}, /* @__PURE__ */ emotion_react_browser_esm_css("@media not ( prefers-reduced-motion ){transition:", transition, ";}" + ( true ? "" : 0), true ? "" : 0), true ? "" : 0, true ? "" : 0);
if (isValueDefined(hoverValue)) {
sx.hover = /* @__PURE__ */ emotion_react_browser_esm_css("*:hover>&{box-shadow:", getBoxShadow(hoverValue), ";}" + ( true ? "" : 0), true ? "" : 0);
}
if (isValueDefined(activeValue)) {
sx.active = /* @__PURE__ */ emotion_react_browser_esm_css("*:active>&{box-shadow:", getBoxShadow(activeValue), ";}" + ( true ? "" : 0), true ? "" : 0);
}
if (isValueDefined(focus)) {
sx.focus = /* @__PURE__ */ emotion_react_browser_esm_css("*:focus>&{box-shadow:", getBoxShadow(focus), ";}" + ( true ? "" : 0), true ? "" : 0);
}
return cx(Elevation, sx.Base, sx.hover, sx.focus, sx.active, className);
}, [active, borderRadius, className, cx, focus, hover, isInteractive, offset, value]);
return {
...otherProps,
className: classes,
"aria-hidden": true
};
}
;// ./node_modules/@wordpress/components/build-module/elevation/component.js
function UnconnectedElevation(props, forwardedRef) {
const elevationProps = useElevation(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...elevationProps,
ref: forwardedRef
});
}
const component_Elevation = contextConnect(UnconnectedElevation, "Elevation");
var elevation_component_component_default = component_Elevation;
;// ./node_modules/@wordpress/components/build-module/card/styles.js
function card_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const adjustedBorderRadius = `calc(${config_values_default.radiusLarge} - 1px)`;
const Card = /* @__PURE__ */ emotion_react_browser_esm_css("box-shadow:0 0 0 1px ", config_values_default.surfaceBorderColor, ";outline:none;" + ( true ? "" : 0), true ? "" : 0);
const Header = true ? {
name: "1showjb",
styles: "border-bottom:1px solid;box-sizing:border-box;&:last-child{border-bottom:none;}"
} : 0;
const Footer = true ? {
name: "14n5oej",
styles: "border-top:1px solid;box-sizing:border-box;&:first-of-type{border-top:none;}"
} : 0;
const Content = true ? {
name: "13udsys",
styles: "height:100%"
} : 0;
const Body = true ? {
name: "6ywzd",
styles: "box-sizing:border-box;height:auto;max-height:100%"
} : 0;
const Media = true ? {
name: "dq805e",
styles: "box-sizing:border-box;overflow:hidden;&>img,&>iframe{display:block;height:auto;max-width:100%;width:100%;}"
} : 0;
const Divider = true ? {
name: "c990dr",
styles: "box-sizing:border-box;display:block;width:100%"
} : 0;
const borderRadius = /* @__PURE__ */ emotion_react_browser_esm_css("&:first-of-type{border-top-left-radius:", adjustedBorderRadius, ";border-top-right-radius:", adjustedBorderRadius, ";}&:last-of-type{border-bottom-left-radius:", adjustedBorderRadius, ";border-bottom-right-radius:", adjustedBorderRadius, ";}" + ( true ? "" : 0), true ? "" : 0);
const borderColor = /* @__PURE__ */ emotion_react_browser_esm_css("border-color:", config_values_default.colorDivider, ";" + ( true ? "" : 0), true ? "" : 0);
const boxShadowless = true ? {
name: "1t90u8d",
styles: "box-shadow:none"
} : 0;
const borderless = true ? {
name: "1e1ncky",
styles: "border:none"
} : 0;
const rounded = /* @__PURE__ */ emotion_react_browser_esm_css("border-radius:", adjustedBorderRadius, ";" + ( true ? "" : 0), true ? "" : 0);
const xSmallCardPadding = /* @__PURE__ */ emotion_react_browser_esm_css("padding:", config_values_default.cardPaddingXSmall, ";" + ( true ? "" : 0), true ? "" : 0);
const cardPaddings = {
large: /* @__PURE__ */ emotion_react_browser_esm_css("padding:", config_values_default.cardPaddingLarge, ";" + ( true ? "" : 0), true ? "" : 0),
medium: /* @__PURE__ */ emotion_react_browser_esm_css("padding:", config_values_default.cardPaddingMedium, ";" + ( true ? "" : 0), true ? "" : 0),
small: /* @__PURE__ */ emotion_react_browser_esm_css("padding:", config_values_default.cardPaddingSmall, ";" + ( true ? "" : 0), true ? "" : 0),
xSmall: xSmallCardPadding,
// The `extraSmall` size is not officially documented, but the following styles
// are kept for legacy reasons to support older values of the `size` prop.
extraSmall: xSmallCardPadding
};
const shady = /* @__PURE__ */ emotion_react_browser_esm_css("background-color:", COLORS.ui.backgroundDisabled, ";" + ( true ? "" : 0), true ? "" : 0);
;// ./node_modules/@wordpress/components/build-module/surface/styles.js
const Surface = /* @__PURE__ */ emotion_react_browser_esm_css("background-color:", config_values_default.surfaceColor, ";color:", COLORS.gray[900], ";position:relative;" + ( true ? "" : 0), true ? "" : 0);
const background = /* @__PURE__ */ emotion_react_browser_esm_css("background-color:", config_values_default.surfaceBackgroundColor, ";" + ( true ? "" : 0), true ? "" : 0);
function getBorders({
borderBottom,
borderLeft,
borderRight,
borderTop
}) {
const borderStyle = `1px solid ${config_values_default.surfaceBorderColor}`;
return /* @__PURE__ */ emotion_react_browser_esm_css({
borderBottom: borderBottom ? borderStyle : void 0,
borderLeft: borderLeft ? borderStyle : void 0,
borderRight: borderRight ? borderStyle : void 0,
borderTop: borderTop ? borderStyle : void 0
}, true ? "" : 0, true ? "" : 0);
}
const primary = /* @__PURE__ */ emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0);
const secondary = /* @__PURE__ */ emotion_react_browser_esm_css("background:", config_values_default.surfaceBackgroundTintColor, ";" + ( true ? "" : 0), true ? "" : 0);
const tertiary = /* @__PURE__ */ emotion_react_browser_esm_css("background:", config_values_default.surfaceBackgroundTertiaryColor, ";" + ( true ? "" : 0), true ? "" : 0);
const customBackgroundSize = (surfaceBackgroundSize) => [surfaceBackgroundSize, surfaceBackgroundSize].join(" ");
const dottedBackground1 = (surfaceBackgroundSizeDotted) => ["90deg", [config_values_default.surfaceBackgroundColor, surfaceBackgroundSizeDotted].join(" "), "transparent 1%"].join(",");
const dottedBackground2 = (surfaceBackgroundSizeDotted) => [[config_values_default.surfaceBackgroundColor, surfaceBackgroundSizeDotted].join(" "), "transparent 1%"].join(",");
const dottedBackgroundCombined = (surfaceBackgroundSizeDotted) => [`linear-gradient( ${dottedBackground1(surfaceBackgroundSizeDotted)} ) center`, `linear-gradient( ${dottedBackground2(surfaceBackgroundSizeDotted)} ) center`, config_values_default.surfaceBorderBoldColor].join(",");
const getDotted = (surfaceBackgroundSize, surfaceBackgroundSizeDotted) => /* @__PURE__ */ emotion_react_browser_esm_css("background:", dottedBackgroundCombined(surfaceBackgroundSizeDotted), ";background-size:", customBackgroundSize(surfaceBackgroundSize), ";" + ( true ? "" : 0), true ? "" : 0);
const gridBackground1 = [`${config_values_default.surfaceBorderSubtleColor} 1px`, "transparent 1px"].join(",");
const gridBackground2 = ["90deg", `${config_values_default.surfaceBorderSubtleColor} 1px`, "transparent 1px"].join(",");
const gridBackgroundCombined = [`linear-gradient( ${gridBackground1} )`, `linear-gradient( ${gridBackground2} )`].join(",");
const getGrid = (surfaceBackgroundSize) => {
return /* @__PURE__ */ emotion_react_browser_esm_css("background:", config_values_default.surfaceBackgroundColor, ";background-image:", gridBackgroundCombined, ";background-size:", customBackgroundSize(surfaceBackgroundSize), ";" + ( true ? "" : 0), true ? "" : 0);
};
const getVariant = (variant, surfaceBackgroundSize, surfaceBackgroundSizeDotted) => {
switch (variant) {
case "dotted": {
return getDotted(surfaceBackgroundSize, surfaceBackgroundSizeDotted);
}
case "grid": {
return getGrid(surfaceBackgroundSize);
}
case "primary": {
return primary;
}
case "secondary": {
return secondary;
}
case "tertiary": {
return tertiary;
}
}
};
;// ./node_modules/@wordpress/components/build-module/surface/hook.js
function useSurface(props) {
const {
backgroundSize = 12,
borderBottom = false,
borderLeft = false,
borderRight = false,
borderTop = false,
className,
variant = "primary",
...otherProps
} = useContextSystem(props, "Surface");
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
const sx = {
borders: getBorders({
borderBottom,
borderLeft,
borderRight,
borderTop
})
};
return cx(Surface, sx.borders, getVariant(variant, `${backgroundSize}px`, `${backgroundSize - 1}px`), className);
}, [backgroundSize, borderBottom, borderLeft, borderRight, borderTop, className, cx, variant]);
return {
...otherProps,
className: classes
};
}
;// ./node_modules/@wordpress/components/build-module/card/card/hook.js
function hook_useDeprecatedProps({
elevation,
isElevated,
...otherProps
}) {
const propsToReturn = {
...otherProps
};
let computedElevation = elevation;
if (isElevated) {
var _computedElevation;
external_wp_deprecated_default()("Card isElevated prop", {
since: "5.9",
alternative: "elevation"
});
(_computedElevation = computedElevation) !== null && _computedElevation !== void 0 ? _computedElevation : computedElevation = 2;
}
if (typeof computedElevation !== "undefined") {
propsToReturn.elevation = computedElevation;
}
return propsToReturn;
}
function useCard(props) {
const {
className,
elevation = 0,
isBorderless = false,
isRounded = true,
size = "medium",
...otherProps
} = useContextSystem(hook_useDeprecatedProps(props), "Card");
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(Card, isBorderless && boxShadowless, isRounded && rounded, className);
}, [className, cx, isBorderless, isRounded]);
const surfaceProps = useSurface({
...otherProps,
className: classes
});
return {
...surfaceProps,
elevation,
isBorderless,
isRounded,
size
};
}
;// ./node_modules/@wordpress/components/build-module/card/card/component.js
function UnconnectedCard(props, forwardedRef) {
const {
children,
elevation,
isBorderless,
isRounded,
size,
...otherProps
} = useCard(props);
const elevationBorderRadius = isRounded ? config_values_default.radiusLarge : 0;
const cx = useCx();
const elevationClassName = (0,external_wp_element_namespaceObject.useMemo)(() => cx(/* @__PURE__ */ emotion_react_browser_esm_css({
borderRadius: elevationBorderRadius
}, true ? "" : 0, true ? "" : 0)), [cx, elevationBorderRadius]);
const contextProviderValue = (0,external_wp_element_namespaceObject.useMemo)(() => {
const contextProps = {
size,
isBorderless
};
return {
CardBody: contextProps,
CardHeader: contextProps,
CardFooter: contextProps
};
}, [isBorderless, size]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextSystemProvider, {
value: contextProviderValue,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(component_default, {
...otherProps,
ref: forwardedRef,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
className: cx(Content),
children
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(elevation_component_component_default, {
className: elevationClassName,
isInteractive: false,
value: elevation ? 1 : 0
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(elevation_component_component_default, {
className: elevationClassName,
isInteractive: false,
value: elevation
})]
})
});
}
const component_Card = contextConnect(UnconnectedCard, "Card");
var card_component_component_default = component_Card;
;// ./node_modules/@wordpress/components/build-module/scrollable/styles.js
function scrollable_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const scrollableScrollbar = /* @__PURE__ */ emotion_react_browser_esm_css("@media only screen and ( min-device-width: 40em ){&::-webkit-scrollbar{height:12px;width:12px;}&::-webkit-scrollbar-track{background-color:transparent;}&::-webkit-scrollbar-track{background:", config_values_default.colorScrollbarTrack, ";border-radius:8px;}&::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:", config_values_default.colorScrollbarThumb, ";border:2px solid rgba( 0, 0, 0, 0 );border-radius:7px;}&:hover::-webkit-scrollbar-thumb{background-color:", config_values_default.colorScrollbarThumbHover, ";}}" + ( true ? "" : 0), true ? "" : 0);
const Scrollable = true ? {
name: "13udsys",
styles: "height:100%"
} : 0;
const styles_Content = true ? {
name: "bjn8wh",
styles: "position:relative"
} : 0;
const styles_smoothScroll = true ? {
name: "7zq9w",
styles: "scroll-behavior:smooth"
} : 0;
const scrollX = true ? {
name: "q33xhg",
styles: "overflow-x:auto;overflow-y:hidden"
} : 0;
const scrollY = true ? {
name: "103x71s",
styles: "overflow-x:hidden;overflow-y:auto"
} : 0;
const scrollAuto = true ? {
name: "umwchj",
styles: "overflow-y:auto"
} : 0;
;// ./node_modules/@wordpress/components/build-module/scrollable/hook.js
function useScrollable(props) {
const {
className,
scrollDirection = "y",
smoothScroll = false,
...otherProps
} = useContextSystem(props, "Scrollable");
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(Scrollable, scrollableScrollbar, smoothScroll && styles_smoothScroll, scrollDirection === "x" && scrollX, scrollDirection === "y" && scrollY, scrollDirection === "auto" && scrollAuto, className), [className, cx, scrollDirection, smoothScroll]);
return {
...otherProps,
className: classes
};
}
;// ./node_modules/@wordpress/components/build-module/scrollable/component.js
function UnconnectedScrollable(props, forwardedRef) {
const scrollableProps = useScrollable(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...scrollableProps,
ref: forwardedRef
});
}
const component_Scrollable = contextConnect(UnconnectedScrollable, "Scrollable");
var scrollable_component_component_default = component_Scrollable;
;// ./node_modules/@wordpress/components/build-module/card/card-body/hook.js
function useCardBody(props) {
const {
className,
isScrollable = false,
isShady = false,
size = "medium",
...otherProps
} = useContextSystem(props, "CardBody");
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(
Body,
borderRadius,
cardPaddings[size],
isShady && shady,
// This classname is added for legacy compatibility reasons.
"components-card__body",
className
), [className, cx, isShady, size]);
return {
...otherProps,
className: classes,
isScrollable
};
}
;// ./node_modules/@wordpress/components/build-module/card/card-body/component.js
function UnconnectedCardBody(props, forwardedRef) {
const {
isScrollable,
...otherProps
} = useCardBody(props);
if (isScrollable) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(scrollable_component_component_default, {
...otherProps,
ref: forwardedRef
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...otherProps,
ref: forwardedRef
});
}
const CardBody = contextConnect(UnconnectedCardBody, "CardBody");
var card_body_component_component_default = CardBody;
;// ./node_modules/@ariakit/react-core/esm/__chunks/A3CZKICO.js
"use client";
// src/separator/separator.tsx
var A3CZKICO_TagName = "hr";
var useSeparator = createHook(
function useSeparator2(_a) {
var _b = _a, { orientation = "horizontal" } = _b, props = __objRest(_b, ["orientation"]);
props = _3YLGPPWQ_spreadValues({
role: "separator",
"aria-orientation": orientation
}, props);
return props;
}
);
var Separator = forwardRef2(function Separator2(props) {
const htmlProps = useSeparator(props);
return LMDWO4NN_createElement(A3CZKICO_TagName, htmlProps);
});
;// ./node_modules/@wordpress/components/build-module/divider/styles.js
function divider_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const MARGIN_DIRECTIONS = {
vertical: {
start: "marginLeft",
end: "marginRight"
},
horizontal: {
start: "marginTop",
end: "marginBottom"
}
};
const renderMargin = ({
"aria-orientation": orientation = "horizontal",
margin,
marginStart,
marginEnd
}) => /* @__PURE__ */ emotion_react_browser_esm_css(rtl({
[MARGIN_DIRECTIONS[orientation].start]: space(marginStart !== null && marginStart !== void 0 ? marginStart : margin),
[MARGIN_DIRECTIONS[orientation].end]: space(marginEnd !== null && marginEnd !== void 0 ? marginEnd : margin)
})(), true ? "" : 0, true ? "" : 0);
var divider_styles_ref = true ? {
name: "1u4hpl4",
styles: "display:inline"
} : 0;
const renderDisplay = ({
"aria-orientation": orientation = "horizontal"
}) => {
return orientation === "vertical" ? divider_styles_ref : void 0;
};
const renderBorder = ({
"aria-orientation": orientation = "horizontal"
}) => {
return /* @__PURE__ */ emotion_react_browser_esm_css({
[orientation === "vertical" ? "borderRight" : "borderBottom"]: "1px solid currentColor"
}, true ? "" : 0, true ? "" : 0);
};
const renderSize = ({
"aria-orientation": orientation = "horizontal"
}) => /* @__PURE__ */ emotion_react_browser_esm_css({
height: orientation === "vertical" ? "auto" : 0,
width: orientation === "vertical" ? 0 : "auto"
}, true ? "" : 0, true ? "" : 0);
const DividerView = /* @__PURE__ */ emotion_styled_base_browser_esm("hr", true ? {
target: "e19on6iw0"
} : 0)("border:0;margin:0;", renderDisplay, " ", renderBorder, " ", renderSize, " ", renderMargin, ";" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/divider/component.js
function UnconnectedDivider(props, forwardedRef) {
const contextProps = useContextSystem(props, "Divider");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Separator, {
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DividerView, {}),
...contextProps,
ref: forwardedRef
});
}
const component_Divider = contextConnect(UnconnectedDivider, "Divider");
var divider_component_component_default = component_Divider;
;// ./node_modules/@wordpress/components/build-module/card/card-divider/hook.js
function useCardDivider(props) {
const {
className,
...otherProps
} = useContextSystem(props, "CardDivider");
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(
Divider,
borderColor,
// This classname is added for legacy compatibility reasons.
"components-card__divider",
className
), [className, cx]);
return {
...otherProps,
className: classes
};
}
;// ./node_modules/@wordpress/components/build-module/card/card-divider/component.js
function UnconnectedCardDivider(props, forwardedRef) {
const dividerProps = useCardDivider(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(divider_component_component_default, {
...dividerProps,
ref: forwardedRef
});
}
const CardDivider = contextConnect(UnconnectedCardDivider, "CardDivider");
var card_divider_component_component_default = CardDivider;
;// ./node_modules/@wordpress/components/build-module/card/card-footer/hook.js
function useCardFooter(props) {
const {
className,
justify,
isBorderless = false,
isShady = false,
size = "medium",
...otherProps
} = useContextSystem(props, "CardFooter");
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(
Footer,
borderRadius,
borderColor,
cardPaddings[size],
isBorderless && borderless,
isShady && shady,
// This classname is added for legacy compatibility reasons.
"components-card__footer",
className
), [className, cx, isBorderless, isShady, size]);
return {
...otherProps,
className: classes,
justify
};
}
;// ./node_modules/@wordpress/components/build-module/card/card-footer/component.js
function UnconnectedCardFooter(props, forwardedRef) {
const footerProps = useCardFooter(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_component_component_default, {
...footerProps,
ref: forwardedRef
});
}
const CardFooter = contextConnect(UnconnectedCardFooter, "CardFooter");
var card_footer_component_component_default = CardFooter;
;// ./node_modules/@wordpress/components/build-module/card/card-header/hook.js
function useCardHeader(props) {
const {
className,
isBorderless = false,
isShady = false,
size = "medium",
...otherProps
} = useContextSystem(props, "CardHeader");
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(
Header,
borderRadius,
borderColor,
cardPaddings[size],
isBorderless && borderless,
isShady && shady,
// This classname is added for legacy compatibility reasons.
"components-card__header",
className
), [className, cx, isBorderless, isShady, size]);
return {
...otherProps,
className: classes
};
}
;// ./node_modules/@wordpress/components/build-module/card/card-header/component.js
function UnconnectedCardHeader(props, forwardedRef) {
const headerProps = useCardHeader(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_component_component_default, {
...headerProps,
ref: forwardedRef
});
}
const CardHeader = contextConnect(UnconnectedCardHeader, "CardHeader");
var card_header_component_component_default = CardHeader;
;// ./node_modules/@wordpress/components/build-module/card/card-media/hook.js
function useCardMedia(props) {
const {
className,
...otherProps
} = useContextSystem(props, "CardMedia");
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(
Media,
borderRadius,
// This classname is added for legacy compatibility reasons.
"components-card__media",
className
), [className, cx]);
return {
...otherProps,
className: classes
};
}
;// ./node_modules/@wordpress/components/build-module/card/card-media/component.js
function UnconnectedCardMedia(props, forwardedRef) {
const cardMediaProps = useCardMedia(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...cardMediaProps,
ref: forwardedRef
});
}
const CardMedia = contextConnect(UnconnectedCardMedia, "CardMedia");
var card_media_component_component_default = CardMedia;
;// ./node_modules/@wordpress/components/build-module/checkbox-control/index.js
function CheckboxControl(props) {
const {
__nextHasNoMarginBottom,
label,
className,
heading,
checked,
indeterminate,
help,
id: idProp,
onChange,
onClick,
...additionalProps
} = props;
if (heading) {
external_wp_deprecated_default()("`heading` prop in `CheckboxControl`", {
alternative: "a separate element to implement a heading",
since: "5.8"
});
}
const [showCheckedIcon, setShowCheckedIcon] = (0,external_wp_element_namespaceObject.useState)(false);
const [showIndeterminateIcon, setShowIndeterminateIcon] = (0,external_wp_element_namespaceObject.useState)(false);
const ref = (0,external_wp_compose_namespaceObject.useRefEffect)((node) => {
if (!node) {
return;
}
node.indeterminate = !!indeterminate;
setShowCheckedIcon(node.matches(":checked"));
setShowIndeterminateIcon(node.matches(":indeterminate"));
}, [checked, indeterminate]);
const id = (0,external_wp_compose_namespaceObject.useInstanceId)(CheckboxControl, "inspector-checkbox-control", idProp);
const onChangeValue = (event) => onChange(event.target.checked);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default, {
__nextHasNoMarginBottom,
__associatedWPComponentName: "CheckboxControl",
label: heading,
id,
help: help && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "components-checkbox-control__help",
children: help
}),
className: dist_clsx("components-checkbox-control", className),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
spacing: 0,
justify: "start",
alignment: "top",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
className: "components-checkbox-control__input-container",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
ref,
id,
className: "components-checkbox-control__input",
type: "checkbox",
value: "1",
onChange: onChangeValue,
checked,
"aria-describedby": !!help ? id + "__help" : void 0,
onClick: (event) => {
event.currentTarget.focus();
onClick?.(event);
},
...additionalProps
}), showIndeterminateIcon ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
icon: reset_default,
className: "components-checkbox-control__indeterminate",
role: "presentation"
}) : null, showCheckedIcon ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
icon: check_default,
className: "components-checkbox-control__checked",
role: "presentation"
}) : null]
}), label && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("label", {
className: "components-checkbox-control__label",
htmlFor: id,
children: label
})]
})
});
}
var checkbox_control_default = CheckboxControl;
;// ./node_modules/@wordpress/components/build-module/clipboard-button/index.js
const TIMEOUT = 4e3;
function ClipboardButton({
className,
children,
onCopy,
onFinishCopy,
text,
...buttonProps
}) {
external_wp_deprecated_default()("wp.components.ClipboardButton", {
since: "5.8",
alternative: "wp.compose.useCopyToClipboard"
});
const timeoutIdRef = (0,external_wp_element_namespaceObject.useRef)();
const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text, () => {
onCopy();
if (timeoutIdRef.current) {
clearTimeout(timeoutIdRef.current);
}
if (onFinishCopy) {
timeoutIdRef.current = setTimeout(() => onFinishCopy(), TIMEOUT);
}
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
return () => {
if (timeoutIdRef.current) {
clearTimeout(timeoutIdRef.current);
}
};
}, []);
const classes = dist_clsx("components-clipboard-button", className);
const focusOnCopyEventTarget = (event) => {
event.target.focus();
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
...buttonProps,
className: classes,
ref,
onCopy: focusOnCopyEventTarget,
children
});
}
;// ./node_modules/@wordpress/icons/build-module/library/more-vertical.js
var more_vertical_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) });
;// ./node_modules/@wordpress/components/build-module/item-group/styles.js
function item_group_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const unstyledButton = (as) => {
return /* @__PURE__ */ emotion_react_browser_esm_css("font-size:", font("default.fontSize"), ";font-family:inherit;appearance:none;border:1px solid transparent;cursor:pointer;background:none;text-align:start;text-decoration:", as === "a" ? "none" : void 0, ";svg,path{fill:currentColor;}&:hover{color:", COLORS.theme.accent, ";}&:focus{box-shadow:none;outline:none;}&:focus-visible{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ", COLORS.theme.accent, ";outline:2px solid transparent;outline-offset:0;}" + ( true ? "" : 0), true ? "" : 0);
};
const itemWrapper = true ? {
name: "1bcj5ek",
styles: "width:100%;display:block"
} : 0;
const item = true ? {
name: "150ruhm",
styles: "box-sizing:border-box;width:100%;display:block;margin:0;color:inherit"
} : 0;
const bordered = /* @__PURE__ */ emotion_react_browser_esm_css("border:1px solid ", config_values_default.surfaceBorderColor, ";" + ( true ? "" : 0), true ? "" : 0);
const separated = /* @__PURE__ */ emotion_react_browser_esm_css(">*:not( marquee )>*{border-bottom:1px solid ", config_values_default.surfaceBorderColor, ";}>*:last-of-type>*{border-bottom-color:transparent;}" + ( true ? "" : 0), true ? "" : 0);
const styles_borderRadius = config_values_default.radiusSmall;
const styles_spacedAround = /* @__PURE__ */ emotion_react_browser_esm_css("border-radius:", styles_borderRadius, ";" + ( true ? "" : 0), true ? "" : 0);
const styles_rounded = /* @__PURE__ */ emotion_react_browser_esm_css("border-radius:", styles_borderRadius, ";>*:first-of-type>*{border-top-left-radius:", styles_borderRadius, ";border-top-right-radius:", styles_borderRadius, ";}>*:last-of-type>*{border-bottom-left-radius:", styles_borderRadius, ";border-bottom-right-radius:", styles_borderRadius, ";}" + ( true ? "" : 0), true ? "" : 0);
const baseFontHeight = `calc(${config_values_default.fontSize} * ${config_values_default.fontLineHeightBase})`;
const paddingY = `calc((${config_values_default.controlHeight} - ${baseFontHeight} - 2px) / 2)`;
const paddingYSmall = `calc((${config_values_default.controlHeightSmall} - ${baseFontHeight} - 2px) / 2)`;
const paddingYLarge = `calc((${config_values_default.controlHeightLarge} - ${baseFontHeight} - 2px) / 2)`;
const itemSizes = {
small: /* @__PURE__ */ emotion_react_browser_esm_css("padding:", paddingYSmall, " ", config_values_default.controlPaddingXSmall, "px;" + ( true ? "" : 0), true ? "" : 0),
medium: /* @__PURE__ */ emotion_react_browser_esm_css("padding:", paddingY, " ", config_values_default.controlPaddingX, "px;" + ( true ? "" : 0), true ? "" : 0),
large: /* @__PURE__ */ emotion_react_browser_esm_css("padding:", paddingYLarge, " ", config_values_default.controlPaddingXLarge, "px;" + ( true ? "" : 0), true ? "" : 0)
};
;// ./node_modules/@wordpress/components/build-module/item-group/context.js
const ItemGroupContext = (0,external_wp_element_namespaceObject.createContext)({
size: "medium"
});
ItemGroupContext.displayName = "ItemGroupContext";
const useItemGroupContext = () => (0,external_wp_element_namespaceObject.useContext)(ItemGroupContext);
;// ./node_modules/@wordpress/components/build-module/item-group/item/hook.js
function useItem(props) {
const {
as: asProp,
className,
onClick,
role = "listitem",
size: sizeProp,
...otherProps
} = useContextSystem(props, "Item");
const {
spacedAround,
size: contextSize
} = useItemGroupContext();
const size = sizeProp || contextSize;
const as = asProp || (typeof onClick !== "undefined" ? "button" : "div");
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx((as === "button" || as === "a") && unstyledButton(as), itemSizes[size] || itemSizes.medium, item, spacedAround && styles_spacedAround, className), [as, className, cx, size, spacedAround]);
const wrapperClassName = cx(itemWrapper);
return {
as,
className: classes,
onClick,
wrapperClassName,
role,
...otherProps
};
}
;// ./node_modules/@wordpress/components/build-module/item-group/item/component.js
function UnconnectedItem(props, forwardedRef) {
const {
role,
wrapperClassName,
...otherProps
} = useItem(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
role,
className: wrapperClassName,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...otherProps,
ref: forwardedRef
})
});
}
const component_Item = contextConnect(UnconnectedItem, "Item");
var item_component_component_default = component_Item;
;// ./node_modules/@wordpress/components/build-module/item-group/item-group/hook.js
function useItemGroup(props) {
const {
className,
isBordered = false,
isRounded = true,
isSeparated = false,
role = "list",
...otherProps
} = useContextSystem(props, "ItemGroup");
const cx = useCx();
const classes = cx(isBordered && bordered, isSeparated && separated, isRounded && styles_rounded, className);
return {
isBordered,
className: classes,
role,
isSeparated,
...otherProps
};
}
;// ./node_modules/@wordpress/components/build-module/item-group/item-group/component.js
function UnconnectedItemGroup(props, forwardedRef) {
const {
isBordered,
isSeparated,
size: sizeProp,
...otherProps
} = useItemGroup(props);
const {
size: contextSize
} = useItemGroupContext();
const spacedAround = !isBordered && !isSeparated;
const size = sizeProp || contextSize;
const contextValue = {
spacedAround,
size
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemGroupContext.Provider, {
value: contextValue,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...otherProps,
ref: forwardedRef
})
});
}
const ItemGroup = contextConnect(UnconnectedItemGroup, "ItemGroup");
var item_group_component_component_default = ItemGroup;
;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/gradient-bar/constants.js
const GRADIENT_MARKERS_WIDTH = 16;
const INSERT_POINT_WIDTH = 16;
const MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT = 10;
const MINIMUM_DISTANCE_BETWEEN_POINTS = 0;
const MINIMUM_SIGNIFICANT_MOVE = 5;
const KEYBOARD_CONTROL_POINT_VARIATION = MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT;
const MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_MARKER = (INSERT_POINT_WIDTH + GRADIENT_MARKERS_WIDTH) / 2;
;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/gradient-bar/utils.js
function clampPercent(value) {
return Math.max(0, Math.min(100, value));
}
function isOverlapping(value, initialIndex, newPosition, minDistance = MINIMUM_DISTANCE_BETWEEN_POINTS) {
const initialPosition = value[initialIndex].position;
const minPosition = Math.min(initialPosition, newPosition);
const maxPosition = Math.max(initialPosition, newPosition);
return value.some(({
position
}, index) => {
return index !== initialIndex && (Math.abs(position - newPosition) < minDistance || minPosition < position && position < maxPosition);
});
}
function addControlPoint(points, position, color) {
const nextIndex = points.findIndex((point) => point.position > position);
const newPoint = {
color,
position
};
const newPoints = points.slice();
newPoints.splice(nextIndex - 1, 0, newPoint);
return newPoints;
}
function removeControlPoint(points, index) {
return points.filter((_point, pointIndex) => {
return pointIndex !== index;
});
}
function updateControlPoint(points, index, newPoint) {
const newValue = points.slice();
newValue[index] = newPoint;
return newValue;
}
function updateControlPointPosition(points, index, newPosition) {
if (isOverlapping(points, index, newPosition)) {
return points;
}
const newPoint = {
...points[index],
position: newPosition
};
return updateControlPoint(points, index, newPoint);
}
function updateControlPointColor(points, index, newColor) {
const newPoint = {
...points[index],
color: newColor
};
return updateControlPoint(points, index, newPoint);
}
function updateControlPointColorByPosition(points, position, newColor) {
const index = points.findIndex((point) => point.position === position);
return updateControlPointColor(points, index, newColor);
}
function getHorizontalRelativeGradientPosition(mouseXCoordinate, containerElement) {
if (!containerElement) {
return;
}
const {
x,
width
} = containerElement.getBoundingClientRect();
const absolutePositionValue = mouseXCoordinate - x;
return Math.round(clampPercent(absolutePositionValue * 100 / width));
}
;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/gradient-bar/control-points.js
function ControlPointButton({
isOpen,
position,
color,
...additionalProps
}) {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ControlPointButton);
const descriptionId = `components-custom-gradient-picker__control-point-button-description-${instanceId}`;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
"aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: gradient position e.g: 70. 2: gradient color code e.g: rgb(52,121,151).
(0,external_wp_i18n_namespaceObject.__)("Gradient control point at position %1$d%% with color code %2$s."),
position,
color
),
"aria-describedby": descriptionId,
"aria-haspopup": "true",
"aria-expanded": isOpen,
__next40pxDefaultSize: true,
className: dist_clsx("components-custom-gradient-picker__control-point-button", {
"is-active": isOpen
}),
...additionalProps
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
id: descriptionId,
children: (0,external_wp_i18n_namespaceObject.__)("Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.")
})]
});
}
function GradientColorPickerDropdown({
isRenderedInSidebar,
className,
...props
}) {
const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
placement: "bottom",
offset: 8,
// Disabling resize as it would otherwise cause the popover to show
// scrollbars while dragging the color picker's handle close to the
// popover edge.
resize: false
}), []);
const mergedClassName = dist_clsx("components-custom-gradient-picker__control-point-dropdown", className);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomColorPickerDropdown, {
isRenderedInSidebar,
popoverProps,
className: mergedClassName,
...props
});
}
function ControlPoints({
disableRemove,
disableAlpha,
gradientPickerDomRef,
ignoreMarkerPosition,
value: controlPoints,
onChange,
onStartControlPointChange,
onStopControlPointChange,
__experimentalIsRenderedInSidebar
}) {
const controlPointMoveStateRef = (0,external_wp_element_namespaceObject.useRef)();
const onMouseMove = (event) => {
if (controlPointMoveStateRef.current === void 0 || gradientPickerDomRef.current === null) {
return;
}
const relativePosition = getHorizontalRelativeGradientPosition(event.clientX, gradientPickerDomRef.current);
const {
initialPosition,
index,
significantMoveHappened
} = controlPointMoveStateRef.current;
if (!significantMoveHappened && Math.abs(initialPosition - relativePosition) >= MINIMUM_SIGNIFICANT_MOVE) {
controlPointMoveStateRef.current.significantMoveHappened = true;
}
onChange(updateControlPointPosition(controlPoints, index, relativePosition));
};
const cleanEventListeners = () => {
if (window && window.removeEventListener && controlPointMoveStateRef.current && controlPointMoveStateRef.current.listenersActivated) {
window.removeEventListener("mousemove", onMouseMove);
window.removeEventListener("mouseup", cleanEventListeners);
onStopControlPointChange();
controlPointMoveStateRef.current.listenersActivated = false;
}
};
const cleanEventListenersRef = (0,external_wp_element_namespaceObject.useRef)();
cleanEventListenersRef.current = cleanEventListeners;
(0,external_wp_element_namespaceObject.useEffect)(() => {
return () => {
cleanEventListenersRef.current?.();
};
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: controlPoints.map((point, index) => {
const initialPosition = point?.position;
return ignoreMarkerPosition !== initialPosition && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GradientColorPickerDropdown, {
isRenderedInSidebar: __experimentalIsRenderedInSidebar,
onClose: onStopControlPointChange,
renderToggle: ({
isOpen,
onToggle
}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlPointButton, {
onClick: () => {
if (controlPointMoveStateRef.current && controlPointMoveStateRef.current.significantMoveHappened) {
return;
}
if (isOpen) {
onStopControlPointChange();
} else {
onStartControlPointChange();
}
onToggle();
},
onMouseDown: () => {
if (window && window.addEventListener) {
controlPointMoveStateRef.current = {
initialPosition,
index,
significantMoveHappened: false,
listenersActivated: true
};
onStartControlPointChange();
window.addEventListener("mousemove", onMouseMove);
window.addEventListener("mouseup", cleanEventListeners);
}
},
onKeyDown: (event) => {
if (event.code === "ArrowLeft") {
event.stopPropagation();
onChange(updateControlPointPosition(controlPoints, index, clampPercent(point.position - KEYBOARD_CONTROL_POINT_VARIATION)));
} else if (event.code === "ArrowRight") {
event.stopPropagation();
onChange(updateControlPointPosition(controlPoints, index, clampPercent(point.position + KEYBOARD_CONTROL_POINT_VARIATION)));
}
},
isOpen,
position: point.position,
color: point.color
}, index),
renderContent: ({
onClose
}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(dropdown_content_wrapper_default, {
paddingSize: "none",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LegacyAdapter, {
enableAlpha: !disableAlpha,
color: point.color,
onChange: (color) => {
onChange(updateControlPointColor(controlPoints, index, w(color).toRgbString()));
}
}), !disableRemove && controlPoints.length > 2 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(h_stack_component_component_default, {
className: "components-custom-gradient-picker__remove-control-point-wrapper",
alignment: "center",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
onClick: () => {
onChange(removeControlPoint(controlPoints, index));
onClose();
},
variant: "link",
children: (0,external_wp_i18n_namespaceObject.__)("Remove Control Point")
})
})]
}),
style: {
left: `${point.position}%`,
transform: "translateX( -50% )"
}
}, index);
})
});
}
function InsertPoint({
value: controlPoints,
onChange,
onOpenInserter,
onCloseInserter,
insertPosition,
disableAlpha,
__experimentalIsRenderedInSidebar
}) {
const [alreadyInsertedPoint, setAlreadyInsertedPoint] = (0,external_wp_element_namespaceObject.useState)(false);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GradientColorPickerDropdown, {
isRenderedInSidebar: __experimentalIsRenderedInSidebar,
className: "components-custom-gradient-picker__inserter",
onClose: () => {
onCloseInserter();
},
renderToggle: ({
isOpen,
onToggle
}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
__next40pxDefaultSize: true,
"aria-expanded": isOpen,
"aria-haspopup": "true",
onClick: () => {
if (isOpen) {
onCloseInserter();
} else {
setAlreadyInsertedPoint(false);
onOpenInserter();
}
onToggle();
},
className: "components-custom-gradient-picker__insert-point-dropdown",
icon: plus_default
}),
renderContent: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_content_wrapper_default, {
paddingSize: "none",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LegacyAdapter, {
enableAlpha: !disableAlpha,
onChange: (color) => {
if (!alreadyInsertedPoint) {
onChange(addControlPoint(controlPoints, insertPosition, w(color).toRgbString()));
setAlreadyInsertedPoint(true);
} else {
onChange(updateControlPointColorByPosition(controlPoints, insertPosition, w(color).toRgbString()));
}
}
})
}),
style: insertPosition !== null ? {
left: `${insertPosition}%`,
transform: "translateX( -50% )"
} : void 0
});
}
ControlPoints.InsertPoint = InsertPoint;
var control_points_default = ControlPoints;
;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/gradient-bar/index.js
const customGradientBarReducer = (state, action) => {
switch (action.type) {
case "MOVE_INSERTER":
if (state.id === "IDLE" || state.id === "MOVING_INSERTER") {
return {
id: "MOVING_INSERTER",
insertPosition: action.insertPosition
};
}
break;
case "STOP_INSERTER_MOVE":
if (state.id === "MOVING_INSERTER") {
return {
id: "IDLE"
};
}
break;
case "OPEN_INSERTER":
if (state.id === "MOVING_INSERTER") {
return {
id: "INSERTING_CONTROL_POINT",
insertPosition: state.insertPosition
};
}
break;
case "CLOSE_INSERTER":
if (state.id === "INSERTING_CONTROL_POINT") {
return {
id: "IDLE"
};
}
break;
case "START_CONTROL_CHANGE":
if (state.id === "IDLE") {
return {
id: "MOVING_CONTROL_POINT"
};
}
break;
case "STOP_CONTROL_CHANGE":
if (state.id === "MOVING_CONTROL_POINT") {
return {
id: "IDLE"
};
}
break;
}
return state;
};
const customGradientBarReducerInitialState = {
id: "IDLE"
};
function CustomGradientBar({
background,
hasGradient,
value: controlPoints,
onChange,
disableInserter = false,
disableAlpha = false,
__experimentalIsRenderedInSidebar = false
}) {
const gradientMarkersContainerDomRef = (0,external_wp_element_namespaceObject.useRef)(null);
const [gradientBarState, gradientBarStateDispatch] = (0,external_wp_element_namespaceObject.useReducer)(customGradientBarReducer, customGradientBarReducerInitialState);
const onMouseEnterAndMove = (event) => {
if (!gradientMarkersContainerDomRef.current) {
return;
}
const insertPosition = getHorizontalRelativeGradientPosition(event.clientX, gradientMarkersContainerDomRef.current);
if (controlPoints.some(({
position
}) => {
return Math.abs(insertPosition - position) < MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT;
})) {
if (gradientBarState.id === "MOVING_INSERTER") {
gradientBarStateDispatch({
type: "STOP_INSERTER_MOVE"
});
}
return;
}
gradientBarStateDispatch({
type: "MOVE_INSERTER",
insertPosition
});
};
const onMouseLeave = () => {
gradientBarStateDispatch({
type: "STOP_INSERTER_MOVE"
});
};
const isMovingInserter = gradientBarState.id === "MOVING_INSERTER";
const isInsertingControlPoint = gradientBarState.id === "INSERTING_CONTROL_POINT";
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: dist_clsx("components-custom-gradient-picker__gradient-bar", {
"has-gradient": hasGradient
}),
onMouseEnter: onMouseEnterAndMove,
onMouseMove: onMouseEnterAndMove,
onMouseLeave,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "components-custom-gradient-picker__gradient-bar-background",
style: {
background,
opacity: hasGradient ? 1 : 0.4
}
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
ref: gradientMarkersContainerDomRef,
className: "components-custom-gradient-picker__markers-container",
children: [!disableInserter && (isMovingInserter || isInsertingControlPoint) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(control_points_default.InsertPoint, {
__experimentalIsRenderedInSidebar,
disableAlpha,
insertPosition: gradientBarState.insertPosition,
value: controlPoints,
onChange,
onOpenInserter: () => {
gradientBarStateDispatch({
type: "OPEN_INSERTER"
});
},
onCloseInserter: () => {
gradientBarStateDispatch({
type: "CLOSE_INSERTER"
});
}
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(control_points_default, {
__experimentalIsRenderedInSidebar,
disableAlpha,
disableRemove: disableInserter,
gradientPickerDomRef: gradientMarkersContainerDomRef,
ignoreMarkerPosition: isInsertingControlPoint ? gradientBarState.insertPosition : void 0,
value: controlPoints,
onChange,
onStartControlPointChange: () => {
gradientBarStateDispatch({
type: "START_CONTROL_CHANGE"
});
},
onStopControlPointChange: () => {
gradientBarStateDispatch({
type: "STOP_CONTROL_CHANGE"
});
}
})]
})]
});
}
// EXTERNAL MODULE: ./node_modules/gradient-parser/build/node.js
var build_node = __webpack_require__(8924);
;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/constants.js
const DEFAULT_GRADIENT = "linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)";
const DEFAULT_LINEAR_GRADIENT_ANGLE = 180;
const HORIZONTAL_GRADIENT_ORIENTATION = {
type: "angular",
value: "90"
};
const GRADIENT_OPTIONS = [{
value: "linear-gradient",
label: (0,external_wp_i18n_namespaceObject.__)("Linear")
}, {
value: "radial-gradient",
label: (0,external_wp_i18n_namespaceObject.__)("Radial")
}];
const DIRECTIONAL_ORIENTATION_ANGLE_MAP = {
top: 0,
"top right": 45,
"right top": 45,
right: 90,
"right bottom": 135,
"bottom right": 135,
bottom: 180,
"bottom left": 225,
"left bottom": 225,
left: 270,
"top left": 315,
"left top": 315
};
;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/serializer.js
function serializeGradientColor({
type,
value
}) {
if (type === "literal") {
return value;
}
if (type === "hex") {
return `#${value}`;
}
if (type === "var") {
return `var(${value})`;
}
if (type === "hsl") {
const [hue, saturation, lightness] = value;
return `hsl(${hue},${saturation}%,${lightness}%)`;
}
if (type === "hsla") {
const [hue, saturation, lightness, alpha] = value;
return `hsla(${hue},${saturation}%,${lightness}%,${alpha})`;
}
return `${type}(${value.join(",")})`;
}
function serializeGradientPosition(position) {
if (!position) {
return "";
}
const {
value,
type
} = position;
if (type === "calc") {
return `calc(${value})`;
}
return `${value}${type}`;
}
function serializeGradientColorStop({
type,
value,
length
}) {
return `${serializeGradientColor({
type,
value
})} ${serializeGradientPosition(length)}`;
}
function serializeGradientOrientation(orientation) {
if (Array.isArray(orientation) || !orientation || orientation.type !== "angular") {
return;
}
return `${orientation.value}deg`;
}
function serializeGradient({
type,
orientation,
colorStops
}) {
const serializedOrientation = serializeGradientOrientation(orientation);
const serializedColorStops = colorStops.sort((colorStop1, colorStop2) => {
const getNumericStopValue = (colorStop) => {
return colorStop?.length?.value === void 0 ? 0 : parseInt(colorStop.length.value);
};
return getNumericStopValue(colorStop1) - getNumericStopValue(colorStop2);
}).map(serializeGradientColorStop);
return `${type}(${[serializedOrientation, ...serializedColorStops].filter(Boolean).join(",")})`;
}
;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/utils.js
k([names]);
function getLinearGradientRepresentation(gradientAST) {
return serializeGradient({
type: "linear-gradient",
orientation: HORIZONTAL_GRADIENT_ORIENTATION,
colorStops: gradientAST.colorStops
});
}
function hasUnsupportedLength(item) {
return item.length === void 0 || item.length.type !== "%";
}
function getGradientAstWithDefault(value) {
let gradientAST;
let hasGradient = !!value;
const valueToParse = value !== null && value !== void 0 ? value : DEFAULT_GRADIENT;
try {
gradientAST = build_node.parse(valueToParse)[0];
} catch (error) {
console.warn("wp.components.CustomGradientPicker failed to parse the gradient with error", error);
gradientAST = build_node.parse(DEFAULT_GRADIENT)[0];
hasGradient = false;
}
if (!Array.isArray(gradientAST.orientation) && gradientAST.orientation?.type === "directional") {
gradientAST.orientation = {
type: "angular",
value: DIRECTIONAL_ORIENTATION_ANGLE_MAP[gradientAST.orientation.value].toString()
};
}
if (gradientAST.colorStops.some(hasUnsupportedLength)) {
const {
colorStops
} = gradientAST;
const step = 100 / (colorStops.length - 1);
colorStops.forEach((stop, index) => {
stop.length = {
value: `${step * index}`,
type: "%"
};
});
}
return {
gradientAST,
hasGradient
};
}
function getGradientAstWithControlPoints(gradientAST, newControlPoints) {
return {
...gradientAST,
colorStops: newControlPoints.map(({
position,
color
}) => {
const {
r,
g,
b,
a
} = w(color).toRgb();
return {
length: {
type: "%",
value: position?.toString()
},
type: a < 1 ? "rgba" : "rgb",
value: a < 1 ? [`${r}`, `${g}`, `${b}`, `${a}`] : [`${r}`, `${g}`, `${b}`]
};
})
};
}
function getStopCssColor(colorStop) {
switch (colorStop.type) {
case "hex":
return `#${colorStop.value}`;
case "literal":
return colorStop.value;
case "var":
return `${colorStop.type}(${colorStop.value})`;
case "rgb":
case "rgba":
return `${colorStop.type}(${colorStop.value.join(",")})`;
case "hsl": {
const [hue, saturation, lightness] = colorStop.value;
return `hsl(${hue},${saturation}%,${lightness}%)`;
}
case "hsla": {
const [hue, saturation, lightness, alpha] = colorStop.value;
return `hsla(${hue},${saturation}%,${lightness}%,${alpha})`;
}
default:
return "transparent";
}
}
;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/styles/custom-gradient-picker-styles.js
function custom_gradient_picker_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const SelectWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm(flex_block_component_component_default, true ? {
target: "e10bzpgi1"
} : 0)( true ? {
name: "1gvx10y",
styles: "flex-grow:5"
} : 0);
const AccessoryWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm(flex_block_component_component_default, true ? {
target: "e10bzpgi0"
} : 0)( true ? {
name: "1gvx10y",
styles: "flex-grow:5"
} : 0);
;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/index.js
const GradientAnglePicker = ({
gradientAST,
hasGradient,
onChange
}) => {
var _gradientAST$orientat;
const angle = (_gradientAST$orientat = gradientAST?.orientation?.value) !== null && _gradientAST$orientat !== void 0 ? _gradientAST$orientat : DEFAULT_LINEAR_GRADIENT_ANGLE;
const onAngleChange = (newAngle) => {
onChange(serializeGradient({
...gradientAST,
orientation: {
type: "angular",
value: `${newAngle}`
}
}));
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(angle_picker_control_default, {
onChange: onAngleChange,
value: hasGradient ? angle : ""
});
};
const GradientTypePicker = ({
gradientAST,
hasGradient,
onChange
}) => {
const {
type
} = gradientAST;
const onSetLinearGradient = () => {
onChange(serializeGradient({
...gradientAST,
orientation: gradientAST.orientation ? void 0 : HORIZONTAL_GRADIENT_ORIENTATION,
type: "linear-gradient"
}));
};
const onSetRadialGradient = () => {
const {
orientation,
...restGradientAST
} = gradientAST;
onChange(serializeGradient({
...restGradientAST,
type: "radial-gradient"
}));
};
const handleOnChange = (next) => {
if (next === "linear-gradient") {
onSetLinearGradient();
}
if (next === "radial-gradient") {
onSetRadialGradient();
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(select_control_default, {
__nextHasNoMarginBottom: true,
className: "components-custom-gradient-picker__type-picker",
label: (0,external_wp_i18n_namespaceObject.__)("Type"),
labelPosition: "top",
onChange: handleOnChange,
options: GRADIENT_OPTIONS,
size: "__unstable-large",
value: hasGradient ? type : void 0
});
};
function CustomGradientPicker({
value,
onChange,
enableAlpha = true,
__experimentalIsRenderedInSidebar = false
}) {
const {
gradientAST,
hasGradient
} = getGradientAstWithDefault(value);
const background = getLinearGradientRepresentation(gradientAST);
const controlPoints = gradientAST.colorStops.map((colorStop) => {
return {
color: getStopCssColor(colorStop),
// Although it's already been checked by `hasUnsupportedLength` in `getGradientAstWithDefault`,
// TypeScript doesn't know that `colorStop.length` is not undefined here.
// @ts-expect-error
position: parseInt(colorStop.length.value)
};
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
spacing: 4,
className: "components-custom-gradient-picker",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomGradientBar, {
__experimentalIsRenderedInSidebar,
disableAlpha: !enableAlpha,
background,
hasGradient,
value: controlPoints,
onChange: (newControlPoints) => {
onChange(serializeGradient(getGradientAstWithControlPoints(gradientAST, newControlPoints)));
}
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(flex_component_component_default, {
gap: 3,
className: "components-custom-gradient-picker__ui-line",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectWrapper, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GradientTypePicker, {
gradientAST,
hasGradient,
onChange
})
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(AccessoryWrapper, {
children: gradientAST.type === "linear-gradient" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GradientAnglePicker, {
gradientAST,
hasGradient,
onChange
})
})]
})]
});
}
var custom_gradient_picker_default = CustomGradientPicker;
;// ./node_modules/@wordpress/components/build-module/gradient-picker/index.js
const isMultipleOriginObject = (obj) => Array.isArray(obj.gradients) && !("gradient" in obj);
const isMultipleOriginArray = (arr) => {
return arr.length > 0 && arr.every((gradientObj) => isMultipleOriginObject(gradientObj));
};
function SingleOrigin({
className,
clearGradient,
gradients,
onChange,
value,
...additionalProps
}) {
const gradientOptions = (0,external_wp_element_namespaceObject.useMemo)(() => {
return gradients.map(({
gradient,
name,
slug
}, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.Option, {
value: gradient,
isSelected: value === gradient,
tooltipText: name || // translators: %s: gradient code e.g: "linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);".
(0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Gradient code: %s"), gradient),
style: {
color: "rgba( 0,0,0,0 )",
background: gradient
},
onClick: value === gradient ? clearGradient : () => onChange(gradient, index),
"aria-label": name ? (
// translators: %s: The name of the gradient e.g: "Angular red to blue".
(0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Gradient: %s"), name)
) : (
// translators: %s: gradient code e.g: "linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);".
(0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Gradient code: %s"), gradient)
)
}, slug));
}, [gradients, value, onChange, clearGradient]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.OptionGroup, {
className,
options: gradientOptions,
...additionalProps
});
}
function MultipleOrigin({
className,
clearGradient,
gradients,
onChange,
value,
headingLevel
}) {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(MultipleOrigin);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(v_stack_component_component_default, {
spacing: 3,
className,
children: gradients.map(({
name,
gradients: gradientSet
}, index) => {
const id = `color-palette-${instanceId}-${index}`;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
spacing: 2,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorHeading, {
level: headingLevel,
id,
children: name
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleOrigin, {
clearGradient,
gradients: gradientSet,
onChange: (gradient) => onChange(gradient, index),
value,
"aria-labelledby": id
})]
}, index);
})
});
}
function Component(props) {
const {
asButtons,
loop,
actions,
headingLevel,
"aria-label": ariaLabel,
"aria-labelledby": ariaLabelledby,
...additionalProps
} = props;
const options = isMultipleOriginArray(props.gradients) ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MultipleOrigin, {
headingLevel,
...additionalProps
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleOrigin, {
...additionalProps
});
const {
metaProps,
labelProps
} = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default, {
...metaProps,
...labelProps,
actions,
options
});
}
function GradientPicker({
className,
gradients = [],
onChange,
value,
clearable = true,
enableAlpha = true,
disableCustomGradients = false,
__experimentalIsRenderedInSidebar,
headingLevel = 2,
...additionalProps
}) {
const clearGradient = (0,external_wp_element_namespaceObject.useCallback)(() => onChange(void 0), [onChange]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
spacing: gradients.length ? 4 : 0,
children: [!disableCustomGradients && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(custom_gradient_picker_default, {
__experimentalIsRenderedInSidebar,
enableAlpha,
value,
onChange
}), (gradients.length > 0 || clearable) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
...additionalProps,
className,
clearGradient,
gradients,
onChange,
value,
actions: clearable && !disableCustomGradients && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.ButtonAction, {
onClick: clearGradient,
accessibleWhenDisabled: true,
disabled: !value,
children: (0,external_wp_i18n_namespaceObject.__)("Clear")
}),
headingLevel
})]
});
}
var gradient_picker_default = GradientPicker;
;// ./node_modules/@wordpress/icons/build-module/library/menu.js
var menu_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z" }) });
;// external ["wp","dom"]
const external_wp_dom_namespaceObject = window["wp"]["dom"];
;// ./node_modules/@wordpress/components/build-module/navigable-container/container.js
const container_noop = () => {
};
const MENU_ITEM_ROLES = ["menuitem", "menuitemradio", "menuitemcheckbox"];
function cycleValue(value, total, offset) {
const nextValue = value + offset;
if (nextValue < 0) {
return total + nextValue;
} else if (nextValue >= total) {
return nextValue - total;
}
return nextValue;
}
class NavigableContainer extends external_wp_element_namespaceObject.Component {
constructor(args) {
super(args);
this.onKeyDown = this.onKeyDown.bind(this);
this.bindContainer = this.bindContainer.bind(this);
this.getFocusableContext = this.getFocusableContext.bind(this);
this.getFocusableIndex = this.getFocusableIndex.bind(this);
}
componentDidMount() {
if (!this.container) {
return;
}
this.container.addEventListener("keydown", this.onKeyDown);
}
componentWillUnmount() {
if (!this.container) {
return;
}
this.container.removeEventListener("keydown", this.onKeyDown);
}
bindContainer(ref) {
const {
forwardedRef
} = this.props;
this.container = ref;
if (typeof forwardedRef === "function") {
forwardedRef(ref);
} else if (forwardedRef && "current" in forwardedRef) {
forwardedRef.current = ref;
}
}
getFocusableContext(target) {
if (!this.container) {
return null;
}
const {
onlyBrowserTabstops
} = this.props;
const finder = onlyBrowserTabstops ? external_wp_dom_namespaceObject.focus.tabbable : external_wp_dom_namespaceObject.focus.focusable;
const focusables = finder.find(this.container);
const index = this.getFocusableIndex(focusables, target);
if (index > -1 && target) {
return {
index,
target,
focusables
};
}
return null;
}
getFocusableIndex(focusables, target) {
return focusables.indexOf(target);
}
onKeyDown(event) {
if (this.props.onKeyDown) {
this.props.onKeyDown(event);
}
const {
getFocusableContext
} = this;
const {
cycle = true,
eventToOffset,
onNavigate = container_noop,
stopNavigationEvents
} = this.props;
const offset = eventToOffset(event);
if (offset !== void 0 && stopNavigationEvents) {
event.stopImmediatePropagation();
const targetRole = event.target?.getAttribute("role");
const targetHasMenuItemRole = !!targetRole && MENU_ITEM_ROLES.includes(targetRole);
if (targetHasMenuItemRole) {
event.preventDefault();
}
}
if (!offset) {
return;
}
const activeElement = event.target?.ownerDocument?.activeElement;
if (!activeElement) {
return;
}
const context = getFocusableContext(activeElement);
if (!context) {
return;
}
const {
index,
focusables
} = context;
const nextIndex = cycle ? cycleValue(index, focusables.length, offset) : index + offset;
if (nextIndex >= 0 && nextIndex < focusables.length) {
focusables[nextIndex].focus();
onNavigate(nextIndex, focusables[nextIndex]);
if (event.code === "Tab") {
event.preventDefault();
}
}
}
render() {
const {
children,
stopNavigationEvents,
eventToOffset,
onNavigate,
onKeyDown,
cycle,
onlyBrowserTabstops,
forwardedRef,
...restProps
} = this.props;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
ref: this.bindContainer,
...restProps,
children
});
}
}
const forwardedNavigableContainer = (props, ref) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableContainer, {
...props,
forwardedRef: ref
});
};
forwardedNavigableContainer.displayName = "NavigableContainer";
var container_default = (0,external_wp_element_namespaceObject.forwardRef)(forwardedNavigableContainer);
;// ./node_modules/@wordpress/components/build-module/navigable-container/menu.js
function UnforwardedNavigableMenu({
role = "menu",
orientation = "vertical",
...rest
}, ref) {
const eventToOffset = (evt) => {
const {
code
} = evt;
let next = ["ArrowDown"];
let previous = ["ArrowUp"];
if (orientation === "horizontal") {
next = ["ArrowRight"];
previous = ["ArrowLeft"];
}
if (orientation === "both") {
next = ["ArrowRight", "ArrowDown"];
previous = ["ArrowLeft", "ArrowUp"];
}
if (next.includes(code)) {
return 1;
} else if (previous.includes(code)) {
return -1;
} else if (["ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"].includes(code)) {
return 0;
}
return void 0;
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(container_default, {
ref,
stopNavigationEvents: true,
onlyBrowserTabstops: false,
role,
"aria-orientation": role !== "presentation" && (orientation === "vertical" || orientation === "horizontal") ? orientation : void 0,
eventToOffset,
...rest
});
}
const NavigableMenu = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedNavigableMenu);
var menu_menu_default = NavigableMenu;
;// ./node_modules/@wordpress/components/build-module/dropdown-menu/index.js
function dropdown_menu_mergeProps(defaultProps = {}, props = {}) {
const mergedProps = {
...defaultProps,
...props
};
if (props.className && defaultProps.className) {
mergedProps.className = dist_clsx(props.className, defaultProps.className);
}
return mergedProps;
}
function dropdown_menu_isFunction(maybeFunc) {
return typeof maybeFunc === "function";
}
function UnconnectedDropdownMenu(dropdownMenuProps) {
const {
children,
className,
controls,
icon = menu_default,
label,
popoverProps,
toggleProps,
menuProps,
disableOpenOnArrowDown = false,
text,
noIcons,
open,
defaultOpen,
onToggle: onToggleProp,
// Context
variant
} = useContextSystem(dropdownMenuProps, "DropdownMenu");
if (!controls?.length && !dropdown_menu_isFunction(children)) {
return null;
}
let controlSets;
if (controls?.length) {
controlSets = controls;
if (!Array.isArray(controlSets[0])) {
controlSets = [controls];
}
}
const mergedPopoverProps = dropdown_menu_mergeProps({
className: "components-dropdown-menu__popover",
variant
}, popoverProps);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_default, {
className,
popoverProps: mergedPopoverProps,
renderToggle: ({
isOpen,
onToggle
}) => {
var _toggleProps$showTool;
const openOnArrowDown = (event) => {
if (disableOpenOnArrowDown) {
return;
}
if (!isOpen && event.code === "ArrowDown") {
event.preventDefault();
onToggle();
}
};
const {
as: Toggle = button_default,
...restToggleProps
} = toggleProps !== null && toggleProps !== void 0 ? toggleProps : {};
const mergedToggleProps = dropdown_menu_mergeProps({
className: dist_clsx("components-dropdown-menu__toggle", {
"is-opened": isOpen
})
}, restToggleProps);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Toggle, {
...mergedToggleProps,
icon,
onClick: (event) => {
onToggle();
if (mergedToggleProps.onClick) {
mergedToggleProps.onClick(event);
}
},
onKeyDown: (event) => {
openOnArrowDown(event);
if (mergedToggleProps.onKeyDown) {
mergedToggleProps.onKeyDown(event);
}
},
"aria-haspopup": "true",
"aria-expanded": isOpen,
label,
text,
showTooltip: (_toggleProps$showTool = toggleProps?.showTooltip) !== null && _toggleProps$showTool !== void 0 ? _toggleProps$showTool : true,
children: mergedToggleProps.children
});
},
renderContent: (props) => {
const mergedMenuProps = dropdown_menu_mergeProps({
"aria-label": label,
className: dist_clsx("components-dropdown-menu__menu", {
"no-icons": noIcons
})
}, menuProps);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(menu_menu_default, {
...mergedMenuProps,
role: "menu",
children: [dropdown_menu_isFunction(children) ? children(props) : null, controlSets?.flatMap((controlSet, indexOfSet) => controlSet.map((control, indexOfControl) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
__next40pxDefaultSize: true,
onClick: (event) => {
event.stopPropagation();
props.onClose();
if (control.onClick) {
control.onClick();
}
},
className: dist_clsx("components-dropdown-menu__menu-item", {
"has-separator": indexOfSet > 0 && indexOfControl === 0,
"is-active": control.isActive,
"is-icon-only": !control.title
}),
icon: control.icon,
label: control.label,
"aria-checked": control.role === "menuitemcheckbox" || control.role === "menuitemradio" ? control.isActive : void 0,
role: control.role === "menuitemcheckbox" || control.role === "menuitemradio" ? control.role : "menuitem",
accessibleWhenDisabled: true,
disabled: control.isDisabled,
children: control.title
}, [indexOfSet, indexOfControl].join())))]
});
},
open,
defaultOpen,
onToggle: onToggleProp
});
}
const DropdownMenu = contextConnectWithoutRef(UnconnectedDropdownMenu, "DropdownMenu");
var dropdown_menu_default = DropdownMenu;
;// ./node_modules/@wordpress/components/build-module/palette-edit/styles.js
function palette_edit_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const IndicatorStyled = /* @__PURE__ */ emotion_styled_base_browser_esm(color_indicator_default, true ? {
target: "e1lpqc908"
} : 0)("&&{flex-shrink:0;width:", space(6), ";height:", space(6), ";}" + ( true ? "" : 0));
const NameInputControl = /* @__PURE__ */ emotion_styled_base_browser_esm(input_control_default, true ? {
target: "e1lpqc907"
} : 0)(Container, "{background:", COLORS.gray[100], ";border-radius:", config_values_default.radiusXSmall, ";", Input, Input, Input, Input, "{height:", space(8), ";}", BackdropUI, BackdropUI, BackdropUI, "{border-color:transparent;box-shadow:none;}}" + ( true ? "" : 0));
const NameContainer = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e1lpqc906"
} : 0)("line-height:", space(8), ";margin-left:", space(2), ";margin-right:", space(2), ";white-space:nowrap;overflow:hidden;" + ( true ? "" : 0));
const PaletteHeading = /* @__PURE__ */ emotion_styled_base_browser_esm(heading_component_component_default, true ? {
target: "e1lpqc905"
} : 0)("text-transform:uppercase;line-height:", space(6), ";font-weight:500;&&&{font-size:11px;margin-bottom:0;}" + ( true ? "" : 0));
const PaletteActionsContainer = /* @__PURE__ */ emotion_styled_base_browser_esm(component_default, true ? {
target: "e1lpqc904"
} : 0)("height:", space(6), ";display:flex;" + ( true ? "" : 0));
const PaletteEditContents = /* @__PURE__ */ emotion_styled_base_browser_esm(component_default, true ? {
target: "e1lpqc903"
} : 0)("margin-top:", space(2), ";" + ( true ? "" : 0));
const PaletteEditStyles = /* @__PURE__ */ emotion_styled_base_browser_esm(component_default, true ? {
target: "e1lpqc902"
} : 0)( true ? {
name: "u6wnko",
styles: "&&&{.components-button.has-icon{min-width:0;padding:0;}}"
} : 0);
const DoneButton = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
target: "e1lpqc901"
} : 0)("&&{color:", COLORS.theme.accent, ";}" + ( true ? "" : 0));
const RemoveButton = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
target: "e1lpqc900"
} : 0)("&&{margin-top:", space(1), ";}" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/palette-edit/index.js
const DEFAULT_COLOR = "#000";
function NameInput({
value,
onChange,
label
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NameInputControl, {
size: "compact",
label,
hideLabelFromVision: true,
value,
onChange
});
}
function deduplicateElementSlugs(elements) {
const slugCounts = {};
return elements.map((element) => {
var _newSlug;
let newSlug;
const {
slug
} = element;
slugCounts[slug] = (slugCounts[slug] || 0) + 1;
if (slugCounts[slug] > 1) {
newSlug = `${slug}-${slugCounts[slug] - 1}`;
}
return {
...element,
slug: (_newSlug = newSlug) !== null && _newSlug !== void 0 ? _newSlug : slug
};
});
}
function getNameAndSlugForPosition(elements, slugPrefix) {
const nameRegex = new RegExp(`^${slugPrefix}color-([\\d]+)$`);
const position = elements.reduce((previousValue, currentValue) => {
if (typeof currentValue?.slug === "string") {
const matches = currentValue?.slug.match(nameRegex);
if (matches) {
const id = parseInt(matches[1], 10);
if (id >= previousValue) {
return id + 1;
}
}
}
return previousValue;
}, 1);
return {
name: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: is an id for a custom color */
(0,external_wp_i18n_namespaceObject.__)("Color %d"),
position
),
slug: `${slugPrefix}color-${position}`
};
}
function ColorPickerPopover({
isGradient,
element,
onChange,
popoverProps: receivedPopoverProps,
onClose = () => {
}
}) {
const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
shift: true,
offset: 20,
// Disabling resize as it would otherwise cause the popover to show
// scrollbars while dragging the color picker's handle close to the
// popover edge.
resize: false,
placement: "left-start",
...receivedPopoverProps,
className: dist_clsx("components-palette-edit__popover", receivedPopoverProps?.className)
}), [receivedPopoverProps]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(popover_default, {
...popoverProps,
onClose,
children: [!isGradient && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LegacyAdapter, {
color: element.color,
enableAlpha: true,
onChange: (newColor) => {
onChange({
...element,
color: newColor
});
}
}), isGradient && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "components-palette-edit__popover-gradient-picker",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(custom_gradient_picker_default, {
__experimentalIsRenderedInSidebar: true,
value: element.gradient,
onChange: (newGradient) => {
onChange({
...element,
gradient: newGradient
});
}
})
})]
});
}
function palette_edit_Option({
canOnlyChangeValues,
element,
onChange,
onRemove,
popoverProps: receivedPopoverProps,
slugPrefix,
isGradient
}) {
const value = isGradient ? element.gradient : element.color;
const [isEditingColor, setIsEditingColor] = (0,external_wp_element_namespaceObject.useState)(false);
const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
...receivedPopoverProps,
// Use the custom palette color item as the popover anchor.
anchor: popoverAnchor
}), [popoverAnchor, receivedPopoverProps]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(item_component_component_default, {
ref: setPopoverAnchor,
size: "small",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
justify: "flex-start",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
size: "small",
onClick: () => {
setIsEditingColor(true);
},
"aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s is a color or gradient name, e.g. "Red".
(0,external_wp_i18n_namespaceObject.__)("Edit: %s"),
element.name.trim().length ? element.name : value || ""
),
style: {
padding: 0
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(IndicatorStyled, {
colorValue: value
})
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_block_component_component_default, {
children: !canOnlyChangeValues ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NameInput, {
label: isGradient ? (0,external_wp_i18n_namespaceObject.__)("Gradient name") : (0,external_wp_i18n_namespaceObject.__)("Color name"),
value: element.name,
onChange: (nextName) => onChange({
...element,
name: nextName,
slug: slugPrefix + kebabCase(nextName !== null && nextName !== void 0 ? nextName : "")
})
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NameContainer, {
children: element.name.trim().length ? element.name : (
/* Fall back to non-breaking space to maintain height */
"\xA0"
)
})
}), !canOnlyChangeValues && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_item_component_component_default, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RemoveButton, {
size: "small",
icon: line_solid_default,
label: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s is a color or gradient name, e.g. "Red".
(0,external_wp_i18n_namespaceObject.__)("Remove color: %s"),
element.name.trim().length ? element.name : value || ""
),
onClick: onRemove
})
})]
}), isEditingColor && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorPickerPopover, {
isGradient,
onChange,
element,
popoverProps,
onClose: () => setIsEditingColor(false)
})]
});
}
function PaletteEditListView({
elements,
onChange,
canOnlyChangeValues,
slugPrefix,
isGradient,
popoverProps,
addColorRef
}) {
const elementsReferenceRef = (0,external_wp_element_namespaceObject.useRef)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
elementsReferenceRef.current = elements;
}, [elements]);
const debounceOnChange = (0,external_wp_compose_namespaceObject.useDebounce)((updatedElements) => onChange(deduplicateElementSlugs(updatedElements)), 100);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(v_stack_component_component_default, {
spacing: 3,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(item_group_component_component_default, {
isRounded: true,
isBordered: true,
isSeparated: true,
children: elements.map((element, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(palette_edit_Option, {
isGradient,
canOnlyChangeValues,
element,
onChange: (newElement) => {
debounceOnChange(elements.map((currentElement, currentIndex) => {
if (currentIndex === index) {
return newElement;
}
return currentElement;
}));
},
onRemove: () => {
const newElements = elements.filter((_currentElement, currentIndex) => {
if (currentIndex === index) {
return false;
}
return true;
});
onChange(newElements.length ? newElements : void 0);
addColorRef.current?.focus();
},
slugPrefix,
popoverProps
}, index))
})
});
}
const EMPTY_ARRAY = [];
function PaletteEdit({
gradients,
colors = EMPTY_ARRAY,
onChange,
paletteLabel,
paletteLabelHeadingLevel = 2,
emptyMessage,
canOnlyChangeValues,
canReset,
slugPrefix = "",
popoverProps
}) {
const isGradient = !!gradients;
const elements = isGradient ? gradients : colors;
const [isEditing, setIsEditing] = (0,external_wp_element_namespaceObject.useState)(false);
const [editingElement, setEditingElement] = (0,external_wp_element_namespaceObject.useState)(null);
const isAdding = isEditing && !!editingElement && elements[editingElement] && !elements[editingElement].slug;
const elementsLength = elements.length;
const hasElements = elementsLength > 0;
const debounceOnChange = (0,external_wp_compose_namespaceObject.useDebounce)(onChange, 100);
const onSelectPaletteItem = (0,external_wp_element_namespaceObject.useCallback)((value, newEditingElementIndex) => {
const selectedElement = newEditingElementIndex === void 0 ? void 0 : elements[newEditingElementIndex];
const key = isGradient ? "gradient" : "color";
if (!!selectedElement && selectedElement[key] === value) {
setEditingElement(newEditingElementIndex);
} else {
setIsEditing(true);
}
}, [isGradient, elements]);
const addColorRef = (0,external_wp_element_namespaceObject.useRef)(null);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(PaletteEditStyles, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PaletteHeading, {
level: paletteLabelHeadingLevel,
children: paletteLabel
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(PaletteActionsContainer, {
children: [hasElements && isEditing && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DoneButton, {
size: "small",
onClick: () => {
setIsEditing(false);
setEditingElement(null);
},
children: (0,external_wp_i18n_namespaceObject.__)("Done")
}), !canOnlyChangeValues && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
ref: addColorRef,
size: "small",
isPressed: isAdding,
icon: plus_default,
label: isGradient ? (0,external_wp_i18n_namespaceObject.__)("Add gradient") : (0,external_wp_i18n_namespaceObject.__)("Add color"),
onClick: () => {
const {
name,
slug
} = getNameAndSlugForPosition(elements, slugPrefix);
if (!!gradients) {
onChange([...gradients, {
gradient: DEFAULT_GRADIENT,
name,
slug
}]);
} else {
onChange([...colors, {
color: DEFAULT_COLOR,
name,
slug
}]);
}
setIsEditing(true);
setEditingElement(elements.length);
}
}), hasElements && (!isEditing || !canOnlyChangeValues || canReset) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_menu_default, {
icon: more_vertical_default,
label: isGradient ? (0,external_wp_i18n_namespaceObject.__)("Gradient options") : (0,external_wp_i18n_namespaceObject.__)("Color options"),
toggleProps: {
size: "small"
},
children: ({
onClose
}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(menu_menu_default, {
role: "menu",
children: [!isEditing && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: () => {
setIsEditing(true);
onClose();
},
className: "components-palette-edit__menu-button",
children: (0,external_wp_i18n_namespaceObject.__)("Show details")
}), !canOnlyChangeValues && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: () => {
setEditingElement(null);
setIsEditing(false);
onChange();
onClose();
},
className: "components-palette-edit__menu-button",
children: isGradient ? (0,external_wp_i18n_namespaceObject.__)("Remove all gradients") : (0,external_wp_i18n_namespaceObject.__)("Remove all colors")
}), canReset && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
__next40pxDefaultSize: true,
className: "components-palette-edit__menu-button",
variant: "tertiary",
onClick: () => {
setEditingElement(null);
onChange();
onClose();
},
children: isGradient ? (0,external_wp_i18n_namespaceObject.__)("Reset gradient") : (0,external_wp_i18n_namespaceObject.__)("Reset colors")
})]
})
})
})]
})]
}), hasElements && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(PaletteEditContents, {
children: [isEditing && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PaletteEditListView, {
canOnlyChangeValues,
elements,
onChange,
slugPrefix,
isGradient,
popoverProps,
addColorRef
}), !isEditing && editingElement !== null && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorPickerPopover, {
isGradient,
onClose: () => setEditingElement(null),
onChange: (newElement) => {
debounceOnChange(
// @ts-expect-error TODO: Don't know how to resolve
elements.map((currentElement, currentIndex) => {
if (currentIndex === editingElement) {
return newElement;
}
return currentElement;
})
);
},
element: elements[editingElement !== null && editingElement !== void 0 ? editingElement : -1],
popoverProps
}), !isEditing && (isGradient ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(gradient_picker_default, {
gradients,
onChange: onSelectPaletteItem,
clearable: false,
disableCustomGradients: true
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(color_palette_default, {
colors,
onChange: onSelectPaletteItem,
clearable: false,
disableCustomColors: true
}))]
}), !hasElements && emptyMessage && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PaletteEditContents, {
children: emptyMessage
})]
});
}
var palette_edit_default = PaletteEdit;
;// ./node_modules/@wordpress/icons/build-module/library/close-small.js
var close_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 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" }) });
;// ./node_modules/@wordpress/components/build-module/combobox-control/styles.js
const deprecatedDefaultSize = ({
__next40pxDefaultSize
}) => !__next40pxDefaultSize && /* @__PURE__ */ emotion_react_browser_esm_css("height:28px;padding-left:", space(1), ";padding-right:", space(1), ";" + ( true ? "" : 0), true ? "" : 0);
const InputWrapperFlex = /* @__PURE__ */ emotion_styled_base_browser_esm(flex_component_component_default, true ? {
target: "evuatpg0"
} : 0)("height:38px;padding-left:", space(2), ";padding-right:", space(2), ";", deprecatedDefaultSize, ";" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/form-token-field/token-input.js
function UnForwardedTokenInput(props, ref) {
const {
value,
isExpanded,
instanceId,
selectedSuggestionIndex,
className,
onChange,
onFocus,
onBlur,
...restProps
} = props;
const [hasFocus, setHasFocus] = (0,external_wp_element_namespaceObject.useState)(false);
const size = value ? value.length + 1 : 0;
const onChangeHandler = (event) => {
if (onChange) {
onChange({
value: event.target.value
});
}
};
const onFocusHandler = (e) => {
setHasFocus(true);
onFocus?.(e);
};
const onBlurHandler = (e) => {
setHasFocus(false);
onBlur?.(e);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
ref,
id: `components-form-token-input-${instanceId}`,
type: "text",
...restProps,
value: value || "",
onChange: onChangeHandler,
onFocus: onFocusHandler,
onBlur: onBlurHandler,
size,
className: dist_clsx(className, "components-form-token-field__input"),
autoComplete: "off",
role: "combobox",
"aria-expanded": isExpanded,
"aria-autocomplete": "list",
"aria-owns": isExpanded ? `components-form-token-suggestions-${instanceId}` : void 0,
"aria-activedescendant": (
// Only add the `aria-activedescendant` attribute when:
// - the user is actively interacting with the input (`hasFocus`)
// - there is a selected suggestion (`selectedSuggestionIndex !== -1`)
// - the list of suggestions are rendered in the DOM (`isExpanded`)
hasFocus && selectedSuggestionIndex !== -1 && isExpanded ? `components-form-token-suggestions-${instanceId}-${selectedSuggestionIndex}` : void 0
),
"aria-describedby": `components-form-token-suggestions-howto-${instanceId}`
});
}
const TokenInput = (0,external_wp_element_namespaceObject.forwardRef)(UnForwardedTokenInput);
var token_input_default = TokenInput;
;// ./node_modules/@wordpress/components/build-module/form-token-field/suggestions-list.js
const handleMouseDown = (e) => {
e.preventDefault();
};
function SuggestionsList({
selectedIndex,
scrollIntoView,
match,
onHover,
onSelect,
suggestions = [],
displayTransform,
instanceId,
__experimentalRenderItem
}) {
const listRef = (0,external_wp_compose_namespaceObject.useRefEffect)((listNode) => {
if (selectedIndex > -1 && scrollIntoView && listNode.children[selectedIndex]) {
listNode.children[selectedIndex].scrollIntoView({
behavior: "instant",
block: "nearest",
inline: "nearest"
});
}
}, [selectedIndex, scrollIntoView]);
const handleHover = (suggestion) => {
return () => {
onHover?.(suggestion);
};
};
const handleClick = (suggestion) => {
return () => {
onSelect?.(suggestion);
};
};
const computeSuggestionMatch = (suggestion) => {
const matchText = displayTransform(match).normalize("NFKC").toLocaleLowerCase();
if (matchText.length === 0) {
return null;
}
const transformedSuggestion = displayTransform(suggestion);
const indexOfMatch = transformedSuggestion.normalize("NFKC").toLocaleLowerCase().indexOf(matchText);
return {
suggestionBeforeMatch: transformedSuggestion.substring(0, indexOfMatch),
suggestionMatch: transformedSuggestion.substring(indexOfMatch, indexOfMatch + matchText.length),
suggestionAfterMatch: transformedSuggestion.substring(indexOfMatch + matchText.length)
};
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("ul", {
ref: listRef,
className: "components-form-token-field__suggestions-list",
id: `components-form-token-suggestions-${instanceId}`,
role: "listbox",
children: [suggestions.map((suggestion, index) => {
const matchText = computeSuggestionMatch(suggestion);
const isSelected = index === selectedIndex;
const isDisabled = typeof suggestion === "object" && suggestion?.disabled;
const key = typeof suggestion === "object" && "value" in suggestion ? suggestion?.value : displayTransform(suggestion);
const className = dist_clsx("components-form-token-field__suggestion", {
"is-selected": isSelected
});
let output;
if (typeof __experimentalRenderItem === "function") {
output = __experimentalRenderItem({
item: suggestion
});
} else if (matchText) {
output = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
"aria-label": displayTransform(suggestion),
children: [matchText.suggestionBeforeMatch, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {
className: "components-form-token-field__suggestion-match",
children: matchText.suggestionMatch
}), matchText.suggestionAfterMatch]
});
} else {
output = displayTransform(suggestion);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("li", {
id: `components-form-token-suggestions-${instanceId}-${index}`,
role: "option",
className,
onMouseDown: handleMouseDown,
onClick: handleClick(suggestion),
onMouseEnter: handleHover(suggestion),
"aria-selected": index === selectedIndex,
"aria-disabled": isDisabled,
children: output
}, key);
}), suggestions.length === 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("li", {
className: "components-form-token-field__suggestion is-empty",
children: (0,external_wp_i18n_namespaceObject.__)("No items found")
})]
});
}
var suggestions_list_default = SuggestionsList;
;// ./node_modules/@wordpress/components/build-module/higher-order/with-focus-outside/index.js
var with_focus_outside_default = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((WrappedComponent) => (props) => {
const [handleFocusOutside, setHandleFocusOutside] = (0,external_wp_element_namespaceObject.useState)(void 0);
const bindFocusOutsideHandler = (0,external_wp_element_namespaceObject.useCallback)((node) => setHandleFocusOutside(() => node?.handleFocusOutside ? node.handleFocusOutside.bind(node) : void 0), []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...(0,external_wp_compose_namespaceObject.__experimentalUseFocusOutside)(handleFocusOutside),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
ref: bindFocusOutsideHandler,
...props
})
});
}, "withFocusOutside");
;// ./node_modules/@wordpress/components/build-module/spinner/styles.js
function spinner_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const spinAnimation = emotion_react_browser_esm_keyframes`
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
`;
const StyledSpinner = /* @__PURE__ */ emotion_styled_base_browser_esm("svg", true ? {
target: "ea4tfvq2"
} : 0)("width:", config_values_default.spinnerSize, "px;height:", config_values_default.spinnerSize, "px;display:inline-block;margin:5px 11px 0;position:relative;color:", COLORS.theme.accent, ";overflow:visible;opacity:1;background-color:transparent;" + ( true ? "" : 0));
const commonPathProps = true ? {
name: "9s4963",
styles: "fill:transparent;stroke-width:1.5px"
} : 0;
const SpinnerTrack = /* @__PURE__ */ emotion_styled_base_browser_esm("circle", true ? {
target: "ea4tfvq1"
} : 0)(commonPathProps, ";stroke:", COLORS.gray[300], ";" + ( true ? "" : 0));
const SpinnerIndicator = /* @__PURE__ */ emotion_styled_base_browser_esm("path", true ? {
target: "ea4tfvq0"
} : 0)(commonPathProps, ";stroke:currentColor;stroke-linecap:round;transform-origin:50% 50%;animation:1.4s linear infinite both ", spinAnimation, ";" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/spinner/index.js
function UnforwardedSpinner({
className,
...props
}, forwardedRef) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(StyledSpinner, {
className: dist_clsx("components-spinner", className),
viewBox: "0 0 100 100",
width: "16",
height: "16",
xmlns: "http://www.w3.org/2000/svg",
role: "presentation",
focusable: "false",
...props,
ref: forwardedRef,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SpinnerTrack, {
cx: "50",
cy: "50",
r: "50",
vectorEffect: "non-scaling-stroke"
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SpinnerIndicator, {
d: "m 50 0 a 50 50 0 0 1 50 50",
vectorEffect: "non-scaling-stroke"
})]
});
}
const Spinner = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSpinner);
var spinner_default = Spinner;
;// ./node_modules/@wordpress/components/build-module/combobox-control/index.js
const combobox_control_noop = () => {
};
const DetectOutside = with_focus_outside_default(class extends external_wp_element_namespaceObject.Component {
handleFocusOutside(event) {
this.props.onFocusOutside(event);
}
render() {
return this.props.children;
}
});
const getIndexOfMatchingSuggestion = (selectedSuggestion, matchingSuggestions) => selectedSuggestion === null ? -1 : matchingSuggestions.indexOf(selectedSuggestion);
function ComboboxControl(props) {
var _currentOption$label;
const {
__nextHasNoMarginBottom = false,
__next40pxDefaultSize = false,
value: valueProp,
label,
options,
onChange: onChangeProp,
onFilterValueChange = combobox_control_noop,
hideLabelFromVision,
help,
allowReset = true,
className,
isLoading = false,
messages = {
selected: (0,external_wp_i18n_namespaceObject.__)("Item selected.")
},
__experimentalRenderItem,
expandOnFocus = true,
placeholder
} = useDeprecated36pxDefaultSizeProp(props);
const [value, setValue] = useControlledValue({
value: valueProp,
onChange: onChangeProp
});
const currentOption = options.find((option) => option.value === value);
const currentLabel = (_currentOption$label = currentOption?.label) !== null && _currentOption$label !== void 0 ? _currentOption$label : "";
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ComboboxControl, "combobox-control");
const [selectedSuggestion, setSelectedSuggestion] = (0,external_wp_element_namespaceObject.useState)(currentOption || null);
const [isExpanded, setIsExpanded] = (0,external_wp_element_namespaceObject.useState)(false);
const [inputHasFocus, setInputHasFocus] = (0,external_wp_element_namespaceObject.useState)(false);
const [inputValue, setInputValue] = (0,external_wp_element_namespaceObject.useState)("");
const inputContainer = (0,external_wp_element_namespaceObject.useRef)(null);
const matchingSuggestions = (0,external_wp_element_namespaceObject.useMemo)(() => {
const startsWithMatch = [];
const containsMatch = [];
const match = normalizeTextString(inputValue);
options.forEach((option) => {
const index = normalizeTextString(option.label).indexOf(match);
if (index === 0) {
startsWithMatch.push(option);
} else if (index > 0) {
containsMatch.push(option);
}
});
return startsWithMatch.concat(containsMatch);
}, [inputValue, options]);
const onSuggestionSelected = (newSelectedSuggestion) => {
if (newSelectedSuggestion.disabled) {
return;
}
setValue(newSelectedSuggestion.value);
(0,external_wp_a11y_namespaceObject.speak)(messages.selected, "assertive");
setSelectedSuggestion(newSelectedSuggestion);
setInputValue("");
setIsExpanded(false);
};
const handleArrowNavigation = (offset = 1) => {
const index = getIndexOfMatchingSuggestion(selectedSuggestion, matchingSuggestions);
let nextIndex = index + offset;
if (nextIndex < 0) {
nextIndex = matchingSuggestions.length - 1;
} else if (nextIndex >= matchingSuggestions.length) {
nextIndex = 0;
}
setSelectedSuggestion(matchingSuggestions[nextIndex]);
setIsExpanded(true);
};
const onKeyDown = withIgnoreIMEEvents((event) => {
let preventDefault = false;
if (event.defaultPrevented) {
return;
}
switch (event.code) {
case "Enter":
if (selectedSuggestion) {
onSuggestionSelected(selectedSuggestion);
preventDefault = true;
}
break;
case "ArrowUp":
handleArrowNavigation(-1);
preventDefault = true;
break;
case "ArrowDown":
handleArrowNavigation(1);
preventDefault = true;
break;
case "Escape":
setIsExpanded(false);
setSelectedSuggestion(null);
preventDefault = true;
break;
default:
break;
}
if (preventDefault) {
event.preventDefault();
}
});
const onBlur = () => {
setInputHasFocus(false);
};
const onFocus = () => {
setInputHasFocus(true);
if (expandOnFocus) {
setIsExpanded(true);
}
onFilterValueChange("");
setInputValue("");
};
const onClick = () => {
setIsExpanded(true);
};
const onFocusOutside = () => {
setIsExpanded(false);
};
const onInputChange = (event) => {
const text = event.value;
setInputValue(text);
onFilterValueChange(text);
if (inputHasFocus) {
setIsExpanded(true);
}
};
const handleOnReset = () => {
setValue(null);
inputContainer.current?.focus();
};
const handleResetStopPropagation = (event) => {
event.stopPropagation();
};
(0,external_wp_element_namespaceObject.useEffect)(() => {
const hasMatchingSuggestions = matchingSuggestions.length > 0;
const hasSelectedMatchingSuggestions = getIndexOfMatchingSuggestion(selectedSuggestion, matchingSuggestions) > 0;
if (hasMatchingSuggestions && !hasSelectedMatchingSuggestions) {
setSelectedSuggestion(matchingSuggestions[0]);
}
}, [matchingSuggestions, selectedSuggestion]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const hasMatchingSuggestions = matchingSuggestions.length > 0;
if (isExpanded) {
const message = hasMatchingSuggestions ? (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: number of results. */
(0,external_wp_i18n_namespaceObject._n)("%d result found, use up and down arrow keys to navigate.", "%d results found, use up and down arrow keys to navigate.", matchingSuggestions.length),
matchingSuggestions.length
) : (0,external_wp_i18n_namespaceObject.__)("No results.");
(0,external_wp_a11y_namespaceObject.speak)(message, "polite");
}
}, [matchingSuggestions, isExpanded]);
maybeWarnDeprecated36pxSize({
componentName: "ComboboxControl",
__next40pxDefaultSize,
size: void 0
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DetectOutside, {
onFocusOutside,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default, {
__nextHasNoMarginBottom,
__associatedWPComponentName: "ComboboxControl",
className: dist_clsx(className, "components-combobox-control"),
label,
id: `components-form-token-input-${instanceId}`,
hideLabelFromVision,
help,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-combobox-control__suggestions-container",
tabIndex: -1,
onKeyDown,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(InputWrapperFlex, {
__next40pxDefaultSize,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_block_component_component_default, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(token_input_default, {
className: "components-combobox-control__input",
instanceId,
ref: inputContainer,
placeholder,
value: isExpanded ? inputValue : currentLabel,
onFocus,
onBlur,
onClick,
isExpanded,
selectedSuggestionIndex: getIndexOfMatchingSuggestion(selectedSuggestion, matchingSuggestions),
onChange: onInputChange
})
}), isLoading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spinner_default, {}), allowReset && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
size: "small",
icon: close_small_default,
disabled: !value,
onClick: handleOnReset,
onKeyDown: handleResetStopPropagation,
label: (0,external_wp_i18n_namespaceObject.__)("Reset")
})]
}), isExpanded && !isLoading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(suggestions_list_default, {
instanceId,
match: {
label: inputValue,
value: ""
},
displayTransform: (suggestion) => suggestion.label,
suggestions: matchingSuggestions,
selectedIndex: getIndexOfMatchingSuggestion(selectedSuggestion, matchingSuggestions),
onHover: setSelectedSuggestion,
onSelect: onSuggestionSelected,
scrollIntoView: true,
__experimentalRenderItem
})]
})
})
});
}
var combobox_control_default = ComboboxControl;
;// ./node_modules/@wordpress/components/build-module/composite/legacy/index.js
function mapLegacyStatePropsToComponentProps(legacyProps) {
if (legacyProps.state) {
const {
state,
...rest
} = legacyProps;
const {
store,
...props
} = mapLegacyStatePropsToComponentProps(state);
return {
...rest,
...props,
store
};
}
return legacyProps;
}
const LEGACY_TO_NEW_DISPLAY_NAME = {
__unstableComposite: "Composite",
__unstableCompositeGroup: "Composite.Group or Composite.Row",
__unstableCompositeItem: "Composite.Item",
__unstableUseCompositeState: "Composite"
};
function proxyComposite(ProxiedComponent, propMap = {}) {
var _ProxiedComponent$dis;
const displayName = (_ProxiedComponent$dis = ProxiedComponent.displayName) !== null && _ProxiedComponent$dis !== void 0 ? _ProxiedComponent$dis : "";
const Component = (legacyProps) => {
external_wp_deprecated_default()(`wp.components.${displayName}`, {
since: "6.7",
alternative: LEGACY_TO_NEW_DISPLAY_NAME.hasOwnProperty(displayName) ? LEGACY_TO_NEW_DISPLAY_NAME[displayName] : void 0
});
const {
store,
...rest
} = mapLegacyStatePropsToComponentProps(legacyProps);
let props = rest;
props = {
...props,
id: (0,external_wp_compose_namespaceObject.useInstanceId)(store, props.baseId, props.id)
};
Object.entries(propMap).forEach(([from, to]) => {
if (props.hasOwnProperty(from)) {
Object.assign(props, {
[to]: props[from]
});
delete props[from];
}
});
delete props.baseId;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ProxiedComponent, {
...props,
store
});
};
Component.displayName = displayName;
return Component;
}
const UnproxiedCompositeGroup = (0,external_wp_element_namespaceObject.forwardRef)(({
role,
...props
}, ref) => {
const Component = role === "row" ? composite_Composite.Row : composite_Composite.Group;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
ref,
role,
...props
});
});
const legacy_Composite = proxyComposite(Object.assign(composite_Composite, {
displayName: "__unstableComposite"
}), {
baseId: "id"
});
const legacy_CompositeGroup = proxyComposite(Object.assign(UnproxiedCompositeGroup, {
displayName: "__unstableCompositeGroup"
}));
const legacy_CompositeItem = proxyComposite(Object.assign(composite_Composite.Item, {
displayName: "__unstableCompositeItem"
}), {
focusable: "accessibleWhenDisabled"
});
function useCompositeState(legacyStateOptions = {}) {
external_wp_deprecated_default()(`wp.components.__unstableUseCompositeState`, {
since: "6.7",
alternative: LEGACY_TO_NEW_DISPLAY_NAME.__unstableUseCompositeState
});
const {
baseId,
currentId: defaultActiveId,
orientation,
rtl = false,
loop: focusLoop = false,
wrap: focusWrap = false,
shift: focusShift = false,
// eslint-disable-next-line camelcase
unstable_virtual: virtualFocus
} = legacyStateOptions;
return {
baseId: (0,external_wp_compose_namespaceObject.useInstanceId)(legacy_Composite, "composite", baseId),
store: useCompositeStore({
defaultActiveId,
rtl,
orientation,
focusLoop,
focusShift,
focusWrap,
virtualFocus
})
};
}
;// ./node_modules/@wordpress/components/build-module/modal/aria-helper.js
const LIVE_REGION_ARIA_ROLES = /* @__PURE__ */ new Set(["alert", "status", "log", "marquee", "timer"]);
const hiddenElementsByDepth = [];
function modalize(modalElement) {
const elements = Array.from(document.body.children);
const hiddenElements = [];
hiddenElementsByDepth.push(hiddenElements);
for (const element of elements) {
if (element === modalElement) {
continue;
}
if (elementShouldBeHidden(element)) {
element.setAttribute("aria-hidden", "true");
hiddenElements.push(element);
}
}
}
function elementShouldBeHidden(element) {
const role = element.getAttribute("role");
return !(element.tagName === "SCRIPT" || element.hasAttribute("hidden") || element.hasAttribute("aria-hidden") || element.hasAttribute("aria-live") || role && LIVE_REGION_ARIA_ROLES.has(role));
}
function unmodalize() {
const hiddenElements = hiddenElementsByDepth.pop();
if (!hiddenElements) {
return;
}
for (const element of hiddenElements) {
element.removeAttribute("aria-hidden");
}
}
;// ./node_modules/@wordpress/components/build-module/modal/use-modal-exit-animation.js
const FRAME_ANIMATION_DURATION = config_values_default.transitionDuration;
const FRAME_ANIMATION_DURATION_NUMBER = Number.parseInt(config_values_default.transitionDuration);
const EXIT_ANIMATION_NAME = "components-modal__disappear-animation";
function useModalExitAnimation() {
const frameRef = (0,external_wp_element_namespaceObject.useRef)();
const [isAnimatingOut, setIsAnimatingOut] = (0,external_wp_element_namespaceObject.useState)(false);
const isReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
const closeModal = (0,external_wp_element_namespaceObject.useCallback)(() => new Promise((closeModalResolve) => {
const frameEl = frameRef.current;
if (isReducedMotion) {
closeModalResolve();
return;
}
if (!frameEl) {
true ? external_wp_warning_default()("wp.components.Modal: the Modal component can't be closed with an exit animation because of a missing reference to the modal frame element.") : 0;
closeModalResolve();
return;
}
let handleAnimationEnd;
const startAnimation = () => new Promise((animationResolve) => {
handleAnimationEnd = (e) => {
if (e.animationName === EXIT_ANIMATION_NAME) {
animationResolve();
}
};
frameEl.addEventListener("animationend", handleAnimationEnd);
setIsAnimatingOut(true);
});
const animationTimeout = () => new Promise((timeoutResolve) => {
setTimeout(
() => timeoutResolve(),
// Allow an extra 20% of the animation duration for the
// animationend event to fire, in case the animation frame is
// slightly delayes by some other events in the event loop.
FRAME_ANIMATION_DURATION_NUMBER * 1.2
);
});
Promise.race([startAnimation(), animationTimeout()]).then(() => {
if (handleAnimationEnd) {
frameEl.removeEventListener("animationend", handleAnimationEnd);
}
setIsAnimatingOut(false);
closeModalResolve();
});
}), [isReducedMotion]);
return {
overlayClassname: isAnimatingOut ? "is-animating-out" : void 0,
frameRef,
frameStyle: {
"--modal-frame-animation-duration": `${FRAME_ANIMATION_DURATION}`
},
closeModal
};
}
;// ./node_modules/@wordpress/components/build-module/modal/index.js
const ModalContext = (0,external_wp_element_namespaceObject.createContext)(/* @__PURE__ */ new Set());
ModalContext.displayName = "ModalContext";
const bodyOpenClasses = /* @__PURE__ */ new Map();
function UnforwardedModal(props, forwardedRef) {
const {
bodyOpenClassName = "modal-open",
role = "dialog",
title = null,
focusOnMount = true,
shouldCloseOnEsc = true,
shouldCloseOnClickOutside = true,
isDismissible = true,
/* Accessibility. */
aria = {
labelledby: void 0,
describedby: void 0
},
onRequestClose,
icon,
closeButtonLabel,
children,
style,
overlayClassName: overlayClassnameProp,
className,
contentLabel,
onKeyDown,
isFullScreen = false,
size,
headerActions = null,
__experimentalHideHeader = false
} = props;
const ref = (0,external_wp_element_namespaceObject.useRef)();
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(Modal);
const headingId = title ? `components-modal-header-${instanceId}` : aria.labelledby;
const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)(focusOnMount === "firstContentElement" ? "firstElement" : focusOnMount);
const constrainedTabbingRef = (0,external_wp_compose_namespaceObject.useConstrainedTabbing)();
const focusReturnRef = (0,external_wp_compose_namespaceObject.useFocusReturn)();
const contentRef = (0,external_wp_element_namespaceObject.useRef)(null);
const childrenContainerRef = (0,external_wp_element_namespaceObject.useRef)(null);
const [hasScrolledContent, setHasScrolledContent] = (0,external_wp_element_namespaceObject.useState)(false);
const [hasScrollableContent, setHasScrollableContent] = (0,external_wp_element_namespaceObject.useState)(false);
let sizeClass;
if (isFullScreen || size === "fill") {
sizeClass = "is-full-screen";
} else if (size) {
sizeClass = `has-size-${size}`;
}
const isContentScrollable = (0,external_wp_element_namespaceObject.useCallback)(() => {
if (!contentRef.current) {
return;
}
const closestScrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(contentRef.current);
if (contentRef.current === closestScrollContainer) {
setHasScrollableContent(true);
} else {
setHasScrollableContent(false);
}
}, [contentRef]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
modalize(ref.current);
return () => unmodalize();
}, []);
const onRequestCloseRef = (0,external_wp_element_namespaceObject.useRef)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
onRequestCloseRef.current = onRequestClose;
}, [onRequestClose]);
const dismissers = (0,external_wp_element_namespaceObject.useContext)(ModalContext);
const [nestedDismissers] = (0,external_wp_element_namespaceObject.useState)(() => /* @__PURE__ */ new Set());
(0,external_wp_element_namespaceObject.useEffect)(() => {
dismissers.add(onRequestCloseRef);
for (const dismisser of dismissers) {
if (dismisser !== onRequestCloseRef) {
dismisser.current?.();
}
}
return () => {
for (const dismisser of nestedDismissers) {
dismisser.current?.();
}
dismissers.delete(onRequestCloseRef);
};
}, [dismissers, nestedDismissers]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
var _bodyOpenClasses$get;
const theClass = bodyOpenClassName;
const oneMore = 1 + ((_bodyOpenClasses$get = bodyOpenClasses.get(theClass)) !== null && _bodyOpenClasses$get !== void 0 ? _bodyOpenClasses$get : 0);
bodyOpenClasses.set(theClass, oneMore);
document.body.classList.add(bodyOpenClassName);
return () => {
const oneLess = bodyOpenClasses.get(theClass) - 1;
if (oneLess === 0) {
document.body.classList.remove(theClass);
bodyOpenClasses.delete(theClass);
} else {
bodyOpenClasses.set(theClass, oneLess);
}
};
}, [bodyOpenClassName]);
const {
closeModal,
frameRef,
frameStyle,
overlayClassname
} = useModalExitAnimation();
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (!window.ResizeObserver || !childrenContainerRef.current) {
return;
}
const resizeObserver = new ResizeObserver(isContentScrollable);
resizeObserver.observe(childrenContainerRef.current);
isContentScrollable();
return () => {
resizeObserver.disconnect();
};
}, [isContentScrollable, childrenContainerRef]);
function handleEscapeKeyDown(event) {
if (shouldCloseOnEsc && (event.code === "Escape" || event.key === "Escape") && !event.defaultPrevented) {
event.preventDefault();
closeModal().then(() => onRequestClose(event));
}
}
const onContentContainerScroll = (0,external_wp_element_namespaceObject.useCallback)((e) => {
var _e$currentTarget$scro;
const scrollY = (_e$currentTarget$scro = e?.currentTarget?.scrollTop) !== null && _e$currentTarget$scro !== void 0 ? _e$currentTarget$scro : -1;
if (!hasScrolledContent && scrollY > 0) {
setHasScrolledContent(true);
} else if (hasScrolledContent && scrollY <= 0) {
setHasScrolledContent(false);
}
}, [hasScrolledContent]);
let pressTarget = null;
const overlayPressHandlers = {
onPointerDown: (event) => {
if (event.target === event.currentTarget) {
pressTarget = event.target;
event.preventDefault();
}
},
// Closes the modal with two exceptions. 1. Opening the context menu on
// the overlay. 2. Pressing on the overlay then dragging the pointer
// over the modal and releasing. Due to the modal being a child of the
// overlay, such a gesture is a `click` on the overlay and cannot be
// excepted by a `click` handler. Thus the tactic of handling
// `pointerup` and comparing its target to that of the `pointerdown`.
onPointerUp: ({
target,
button
}) => {
const isSameTarget = target === pressTarget;
pressTarget = null;
if (button === 0 && isSameTarget) {
closeModal().then(() => onRequestClose());
}
}
};
const modal = (
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, forwardedRef]),
className: dist_clsx("components-modal__screen-overlay", overlayClassname, overlayClassnameProp),
onKeyDown: withIgnoreIMEEvents(handleEscapeKeyDown),
...shouldCloseOnClickOutside ? overlayPressHandlers : {},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(style_provider_default, {
document,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: dist_clsx("components-modal__frame", sizeClass, className),
style: {
...frameStyle,
...style
},
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([frameRef, constrainedTabbingRef, focusReturnRef, focusOnMount !== "firstContentElement" ? focusOnMountRef : null]),
role,
"aria-label": contentLabel,
"aria-labelledby": contentLabel ? void 0 : headingId,
"aria-describedby": aria.describedby,
tabIndex: -1,
onKeyDown,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: dist_clsx("components-modal__content", {
"hide-header": __experimentalHideHeader,
"is-scrollable": hasScrollableContent,
"has-scrolled-content": hasScrolledContent
}),
role: "document",
onScroll: onContentContainerScroll,
ref: contentRef,
"aria-label": hasScrollableContent ? (0,external_wp_i18n_namespaceObject.__)("Scrollable section") : void 0,
tabIndex: hasScrollableContent ? 0 : void 0,
children: [!__experimentalHideHeader && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-modal__header",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-modal__header-heading-container",
children: [icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "components-modal__icon-container",
"aria-hidden": true,
children: icon
}), title && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", {
id: headingId,
className: "components-modal__header-heading",
children: title
})]
}), headerActions, isDismissible && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {
marginBottom: 0,
marginLeft: 2
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
size: "compact",
onClick: (event) => closeModal().then(() => onRequestClose(event)),
icon: close_default,
label: closeButtonLabel || (0,external_wp_i18n_namespaceObject.__)("Close")
})]
})]
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([childrenContainerRef, focusOnMount === "firstContentElement" ? focusOnMountRef : null]),
children
})]
})
})
})
})
);
return (0,external_wp_element_namespaceObject.createPortal)(/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ModalContext.Provider, {
value: nestedDismissers,
children: modal
}), document.body);
}
const Modal = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedModal);
var modal_default = Modal;
;// ./node_modules/@wordpress/components/build-module/confirm-dialog/styles.js
function confirm_dialog_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const styles_wrapper = true ? {
name: "7g5ii0",
styles: "&&{z-index:1000001;}"
} : 0;
;// ./node_modules/@wordpress/components/build-module/confirm-dialog/component.js
const UnconnectedConfirmDialog = (props, forwardedRef) => {
const {
isOpen: isOpenProp,
onConfirm,
onCancel,
children,
confirmButtonText,
cancelButtonText,
...otherProps
} = useContextSystem(props, "ConfirmDialog");
const cx = useCx();
const wrapperClassName = cx(styles_wrapper);
const cancelButtonRef = (0,external_wp_element_namespaceObject.useRef)();
const confirmButtonRef = (0,external_wp_element_namespaceObject.useRef)();
const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)();
const [shouldSelfClose, setShouldSelfClose] = (0,external_wp_element_namespaceObject.useState)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
const isIsOpenSet = typeof isOpenProp !== "undefined";
setIsOpen(isIsOpenSet ? isOpenProp : true);
setShouldSelfClose(!isIsOpenSet);
}, [isOpenProp]);
const handleEvent = (0,external_wp_element_namespaceObject.useCallback)((callback) => (event) => {
callback?.(event);
if (shouldSelfClose) {
setIsOpen(false);
}
}, [shouldSelfClose, setIsOpen]);
const handleEnter = (0,external_wp_element_namespaceObject.useCallback)((event) => {
const isConfirmOrCancelButton = event.target === cancelButtonRef.current || event.target === confirmButtonRef.current;
if (!isConfirmOrCancelButton && event.key === "Enter") {
handleEvent(onConfirm)(event);
}
}, [handleEvent, onConfirm]);
const cancelLabel = cancelButtonText !== null && cancelButtonText !== void 0 ? cancelButtonText : (0,external_wp_i18n_namespaceObject.__)("Cancel");
const confirmLabel = confirmButtonText !== null && confirmButtonText !== void 0 ? confirmButtonText : (0,external_wp_i18n_namespaceObject.__)("OK");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: isOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(modal_default, {
onRequestClose: handleEvent(onCancel),
onKeyDown: handleEnter,
closeButtonLabel: cancelLabel,
isDismissible: true,
ref: forwardedRef,
overlayClassName: wrapperClassName,
__experimentalHideHeader: true,
...otherProps,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
spacing: 8,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(text_component_component_default, {
children
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(flex_component_component_default, {
direction: "row",
justify: "flex-end",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
__next40pxDefaultSize: true,
ref: cancelButtonRef,
variant: "tertiary",
onClick: handleEvent(onCancel),
children: cancelLabel
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
__next40pxDefaultSize: true,
ref: confirmButtonRef,
variant: "primary",
onClick: handleEvent(onConfirm),
children: confirmLabel
})]
})]
})
})
});
};
const ConfirmDialog = contextConnect(UnconnectedConfirmDialog, "ConfirmDialog");
var confirm_dialog_component_component_default = ConfirmDialog;
;// ./node_modules/@ariakit/react-core/esm/__chunks/VEVQD5MH.js
"use client";
// src/combobox/combobox-context.tsx
var ComboboxListRoleContext = (0,external_React_.createContext)(
void 0
);
var VEVQD5MH_ctx = createStoreContext(
[PopoverContextProvider, CompositeContextProvider],
[PopoverScopedContextProvider, CompositeScopedContextProvider]
);
var useComboboxContext = VEVQD5MH_ctx.useContext;
var useComboboxScopedContext = VEVQD5MH_ctx.useScopedContext;
var useComboboxProviderContext = VEVQD5MH_ctx.useProviderContext;
var ComboboxContextProvider = VEVQD5MH_ctx.ContextProvider;
var ComboboxScopedContextProvider = VEVQD5MH_ctx.ScopedContextProvider;
var ComboboxItemValueContext = (0,external_React_.createContext)(
void 0
);
var ComboboxItemCheckedContext = (0,external_React_.createContext)(false);
;// ./node_modules/@ariakit/core/esm/select/select-store.js
"use client";
// src/select/select-store.ts
function createSelectStore(_a = {}) {
var _b = _a, {
combobox
} = _b, props = _3YLGPPWQ_objRest(_b, [
"combobox"
]);
const store = mergeStore(
props.store,
omit2(combobox, [
"value",
"items",
"renderedItems",
"baseElement",
"arrowElement",
"anchorElement",
"contentElement",
"popoverElement",
"disclosureElement"
])
);
throwOnConflictingProps(props, store);
const syncState = store.getState();
const composite = createCompositeStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
store,
virtualFocus: defaultValue(
props.virtualFocus,
syncState.virtualFocus,
true
),
includesBaseElement: defaultValue(
props.includesBaseElement,
syncState.includesBaseElement,
false
),
activeId: defaultValue(
props.activeId,
syncState.activeId,
props.defaultActiveId,
null
),
orientation: defaultValue(
props.orientation,
syncState.orientation,
"vertical"
)
}));
const popover = createPopoverStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
store,
placement: defaultValue(
props.placement,
syncState.placement,
"bottom-start"
)
}));
const initialValue = new String("");
const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, composite.getState()), popover.getState()), {
value: defaultValue(
props.value,
syncState.value,
props.defaultValue,
initialValue
),
setValueOnMove: defaultValue(
props.setValueOnMove,
syncState.setValueOnMove,
false
),
labelElement: defaultValue(syncState.labelElement, null),
selectElement: defaultValue(syncState.selectElement, null),
listElement: defaultValue(syncState.listElement, null)
});
const select = createStore(initialState, composite, popover, store);
setup(
select,
() => sync(select, ["value", "items"], (state) => {
if (state.value !== initialValue) return;
if (!state.items.length) return;
const item = state.items.find(
(item2) => !item2.disabled && item2.value != null
);
if ((item == null ? void 0 : item.value) == null) return;
select.setState("value", item.value);
})
);
setup(
select,
() => sync(select, ["mounted"], (state) => {
if (state.mounted) return;
select.setState("activeId", initialState.activeId);
})
);
setup(
select,
() => sync(select, ["mounted", "items", "value"], (state) => {
if (combobox) return;
if (state.mounted) return;
const values = toArray(state.value);
const lastValue = values[values.length - 1];
if (lastValue == null) return;
const item = state.items.find(
(item2) => !item2.disabled && item2.value === lastValue
);
if (!item) return;
select.setState("activeId", item.id);
})
);
setup(
select,
() => batch(select, ["setValueOnMove", "moves"], (state) => {
const { mounted, value, activeId } = select.getState();
if (!state.setValueOnMove && mounted) return;
if (Array.isArray(value)) return;
if (!state.moves) return;
if (!activeId) return;
const item = composite.item(activeId);
if (!item || item.disabled || item.value == null) return;
select.setState("value", item.value);
})
);
return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, composite), popover), select), {
combobox,
setValue: (value) => select.setState("value", value),
setLabelElement: (element) => select.setState("labelElement", element),
setSelectElement: (element) => select.setState("selectElement", element),
setListElement: (element) => select.setState("listElement", element)
});
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/S5WQ44SQ.js
"use client";
// src/select/select-store.ts
function useSelectStoreOptions(props) {
const combobox = useComboboxProviderContext();
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
combobox: props.combobox !== void 0 ? props.combobox : combobox
});
return useCompositeStoreOptions(props);
}
function useSelectStoreProps(store, update, props) {
useUpdateEffect(update, [props.combobox]);
useStoreProps(store, props, "value", "setValue");
useStoreProps(store, props, "setValueOnMove");
return Object.assign(
usePopoverStoreProps(
useCompositeStoreProps(store, update, props),
update,
props
),
{ combobox: props.combobox }
);
}
function useSelectStore(props = {}) {
props = useSelectStoreOptions(props);
const [store, update] = YV4JVR4I_useStore(createSelectStore, props);
return useSelectStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/KPEX55MY.js
"use client";
// src/select/select-context.tsx
var KPEX55MY_ctx = createStoreContext(
[PopoverContextProvider, CompositeContextProvider],
[PopoverScopedContextProvider, CompositeScopedContextProvider]
);
var useSelectContext = KPEX55MY_ctx.useContext;
var useSelectScopedContext = KPEX55MY_ctx.useScopedContext;
var useSelectProviderContext = KPEX55MY_ctx.useProviderContext;
var SelectContextProvider = KPEX55MY_ctx.ContextProvider;
var SelectScopedContextProvider = KPEX55MY_ctx.ScopedContextProvider;
var SelectItemCheckedContext = (0,external_React_.createContext)(false);
var SelectHeadingContext = (0,external_React_.createContext)(null);
;// ./node_modules/@ariakit/react-core/esm/select/select-label.js
"use client";
// src/select/select-label.tsx
var select_label_TagName = "div";
var useSelectLabel = createHook(
function useSelectLabel2(_a) {
var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
const context = useSelectProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const id = useId(props.id);
const onClickProp = props.onClick;
const onClick = useEvent((event) => {
onClickProp == null ? void 0 : onClickProp(event);
if (event.defaultPrevented) return;
queueMicrotask(() => {
const select = store == null ? void 0 : store.getState().selectElement;
select == null ? void 0 : select.focus();
});
});
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
id
}, props), {
ref: useMergeRefs(store.setLabelElement, props.ref),
onClick,
style: _3YLGPPWQ_spreadValues({
cursor: "default"
}, props.style)
});
return removeUndefinedValues(props);
}
);
var SelectLabel = memo2(
forwardRef2(function SelectLabel2(props) {
const htmlProps = useSelectLabel(props);
return LMDWO4NN_createElement(select_label_TagName, htmlProps);
})
);
;// ./node_modules/@ariakit/react-core/esm/__chunks/X5NMLKT6.js
"use client";
// src/button/button.tsx
var X5NMLKT6_TagName = "button";
var useButton = createHook(
function useButton2(props) {
const ref = (0,external_React_.useRef)(null);
const tagName = useTagName(ref, X5NMLKT6_TagName);
const [isNativeButton, setIsNativeButton] = (0,external_React_.useState)(
() => !!tagName && isButton({ tagName, type: props.type })
);
(0,external_React_.useEffect)(() => {
if (!ref.current) return;
setIsNativeButton(isButton(ref.current));
}, []);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
role: !isNativeButton && tagName !== "a" ? "button" : void 0
}, props), {
ref: useMergeRefs(ref, props.ref)
});
props = useCommand(props);
return props;
}
);
var X5NMLKT6_Button = forwardRef2(function Button2(props) {
const htmlProps = useButton(props);
return LMDWO4NN_createElement(X5NMLKT6_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/P4IRICAX.js
"use client";
// src/disclosure/disclosure.tsx
var P4IRICAX_TagName = "button";
var P4IRICAX_symbol = Symbol("disclosure");
var useDisclosure = createHook(
function useDisclosure2(_a) {
var _b = _a, { store, toggleOnClick = true } = _b, props = __objRest(_b, ["store", "toggleOnClick"]);
const context = useDisclosureProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const ref = (0,external_React_.useRef)(null);
const [expanded, setExpanded] = (0,external_React_.useState)(false);
const disclosureElement = store.useState("disclosureElement");
const open = store.useState("open");
(0,external_React_.useEffect)(() => {
let isCurrentDisclosure = disclosureElement === ref.current;
if (!(disclosureElement == null ? void 0 : disclosureElement.isConnected)) {
store == null ? void 0 : store.setDisclosureElement(ref.current);
isCurrentDisclosure = true;
}
setExpanded(open && isCurrentDisclosure);
}, [disclosureElement, store, open]);
const onClickProp = props.onClick;
const toggleOnClickProp = useBooleanEvent(toggleOnClick);
const [isDuplicate, metadataProps] = useMetadataProps(props, P4IRICAX_symbol, true);
const onClick = useEvent((event) => {
onClickProp == null ? void 0 : onClickProp(event);
if (event.defaultPrevented) return;
if (isDuplicate) return;
if (!toggleOnClickProp(event)) return;
store == null ? void 0 : store.setDisclosureElement(event.currentTarget);
store == null ? void 0 : store.toggle();
});
const contentElement = store.useState("contentElement");
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues(_3YLGPPWQ_spreadValues({
"aria-expanded": expanded,
"aria-controls": contentElement == null ? void 0 : contentElement.id
}, metadataProps), props), {
ref: useMergeRefs(ref, props.ref),
onClick
});
props = useButton(props);
return props;
}
);
var Disclosure = forwardRef2(function Disclosure2(props) {
const htmlProps = useDisclosure(props);
return LMDWO4NN_createElement(P4IRICAX_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/AXB53BZF.js
"use client";
// src/dialog/dialog-disclosure.tsx
var AXB53BZF_TagName = "button";
var useDialogDisclosure = createHook(
function useDialogDisclosure2(_a) {
var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
const context = useDialogProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const contentElement = store.useState("contentElement");
props = _3YLGPPWQ_spreadValues({
"aria-haspopup": getPopupRole(contentElement, "dialog")
}, props);
props = useDisclosure(_3YLGPPWQ_spreadValues({ store }, props));
return props;
}
);
var DialogDisclosure = forwardRef2(function DialogDisclosure2(props) {
const htmlProps = useDialogDisclosure(props);
return LMDWO4NN_createElement(AXB53BZF_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/OMU7RWRV.js
"use client";
// src/popover/popover-anchor.tsx
var OMU7RWRV_TagName = "div";
var usePopoverAnchor = createHook(
function usePopoverAnchor2(_a) {
var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
const context = usePopoverProviderContext();
store = store || context;
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
ref: useMergeRefs(store == null ? void 0 : store.setAnchorElement, props.ref)
});
return props;
}
);
var PopoverAnchor = forwardRef2(function PopoverAnchor2(props) {
const htmlProps = usePopoverAnchor(props);
return LMDWO4NN_createElement(OMU7RWRV_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/QYJ6MIDR.js
"use client";
// src/popover/popover-disclosure.tsx
var QYJ6MIDR_TagName = "button";
var usePopoverDisclosure = createHook(function usePopoverDisclosure2(_a) {
var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
const context = usePopoverProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const onClickProp = props.onClick;
const onClick = useEvent((event) => {
store == null ? void 0 : store.setAnchorElement(event.currentTarget);
onClickProp == null ? void 0 : onClickProp(event);
});
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PopoverScopedContextProvider, { value: store, children: element }),
[store]
);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
onClick
});
props = usePopoverAnchor(_3YLGPPWQ_spreadValues({ store }, props));
props = useDialogDisclosure(_3YLGPPWQ_spreadValues({ store }, props));
return props;
});
var PopoverDisclosure = forwardRef2(function PopoverDisclosure2(props) {
const htmlProps = usePopoverDisclosure(props);
return LMDWO4NN_createElement(QYJ6MIDR_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/DR55NYVS.js
"use client";
// src/popover/popover-disclosure-arrow.tsx
var DR55NYVS_TagName = "span";
var pointsMap = {
top: "4,10 8,6 12,10",
right: "6,4 10,8 6,12",
bottom: "4,6 8,10 12,6",
left: "10,4 6,8 10,12"
};
var usePopoverDisclosureArrow = createHook(function usePopoverDisclosureArrow2(_a) {
var _b = _a, { store, placement } = _b, props = __objRest(_b, ["store", "placement"]);
const context = usePopoverContext();
store = store || context;
invariant(
store,
false && 0
);
const position = store.useState((state) => placement || state.placement);
const dir = position.split("-")[0];
const points = pointsMap[dir];
const children = (0,external_React_.useMemo)(
() => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"svg",
{
display: "block",
fill: "none",
stroke: "currentColor",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: 1.5,
viewBox: "0 0 16 16",
height: "1em",
width: "1em",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("polyline", { points })
}
),
[points]
);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
children,
"aria-hidden": true
}, props), {
style: _3YLGPPWQ_spreadValues({
width: "1em",
height: "1em",
pointerEvents: "none"
}, props.style)
});
return removeUndefinedValues(props);
});
var PopoverDisclosureArrow = forwardRef2(
function PopoverDisclosureArrow2(props) {
const htmlProps = usePopoverDisclosureArrow(props);
return LMDWO4NN_createElement(DR55NYVS_TagName, htmlProps);
}
);
;// ./node_modules/@ariakit/react-core/esm/__chunks/UD53QJDV.js
"use client";
// src/select/select-arrow.tsx
var UD53QJDV_TagName = "span";
var useSelectArrow = createHook(
function useSelectArrow2(_a) {
var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
const context = useSelectContext();
store = store || context;
props = usePopoverDisclosureArrow(_3YLGPPWQ_spreadValues({ store }, props));
return props;
}
);
var SelectArrow = forwardRef2(function SelectArrow2(props) {
const htmlProps = useSelectArrow(props);
return LMDWO4NN_createElement(UD53QJDV_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/select/select.js
"use client";
// src/select/select.tsx
var select_TagName = "button";
function getSelectedValues(select) {
return Array.from(select.selectedOptions).map((option) => option.value);
}
function nextWithValue(store, next) {
return () => {
const nextId = next();
if (!nextId) return;
let i = 0;
let nextItem = store.item(nextId);
const firstItem = nextItem;
while (nextItem && nextItem.value == null) {
const nextId2 = next(++i);
if (!nextId2) return;
nextItem = store.item(nextId2);
if (nextItem === firstItem) break;
}
return nextItem == null ? void 0 : nextItem.id;
};
}
var useSelect = createHook(function useSelect2(_a) {
var _b = _a, {
store,
name,
form,
required,
showOnKeyDown = true,
moveOnKeyDown = true,
toggleOnPress = true,
toggleOnClick = toggleOnPress
} = _b, props = __objRest(_b, [
"store",
"name",
"form",
"required",
"showOnKeyDown",
"moveOnKeyDown",
"toggleOnPress",
"toggleOnClick"
]);
const context = useSelectProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const onKeyDownProp = props.onKeyDown;
const showOnKeyDownProp = useBooleanEvent(showOnKeyDown);
const moveOnKeyDownProp = useBooleanEvent(moveOnKeyDown);
const placement = store.useState("placement");
const dir = placement.split("-")[0];
const value = store.useState("value");
const multiSelectable = Array.isArray(value);
const onKeyDown = useEvent((event) => {
var _a2;
onKeyDownProp == null ? void 0 : onKeyDownProp(event);
if (event.defaultPrevented) return;
if (!store) return;
const { orientation, items: items2, activeId } = store.getState();
const isVertical = orientation !== "horizontal";
const isHorizontal = orientation !== "vertical";
const isGrid = !!((_a2 = items2.find((item) => !item.disabled && item.value != null)) == null ? void 0 : _a2.rowId);
const moveKeyMap = {
ArrowUp: (isGrid || isVertical) && nextWithValue(store, store.up),
ArrowRight: (isGrid || isHorizontal) && nextWithValue(store, store.next),
ArrowDown: (isGrid || isVertical) && nextWithValue(store, store.down),
ArrowLeft: (isGrid || isHorizontal) && nextWithValue(store, store.previous)
};
const getId = moveKeyMap[event.key];
if (getId && moveOnKeyDownProp(event)) {
event.preventDefault();
store.move(getId());
}
const isTopOrBottom = dir === "top" || dir === "bottom";
const isLeft = dir === "left";
const isRight = dir === "right";
const canShowKeyMap = {
ArrowDown: isTopOrBottom,
ArrowUp: isTopOrBottom,
ArrowLeft: isLeft,
ArrowRight: isRight
};
const canShow = canShowKeyMap[event.key];
if (canShow && showOnKeyDownProp(event)) {
event.preventDefault();
store.move(activeId);
queueBeforeEvent(event.currentTarget, "keyup", store.show);
}
});
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectScopedContextProvider, { value: store, children: element }),
[store]
);
const [autofill, setAutofill] = (0,external_React_.useState)(false);
const nativeSelectChangedRef = (0,external_React_.useRef)(false);
(0,external_React_.useEffect)(() => {
const nativeSelectChanged = nativeSelectChangedRef.current;
nativeSelectChangedRef.current = false;
if (nativeSelectChanged) return;
setAutofill(false);
}, [value]);
const labelId = store.useState((state) => {
var _a2;
return (_a2 = state.labelElement) == null ? void 0 : _a2.id;
});
const label = props["aria-label"];
const labelledBy = props["aria-labelledby"] || labelId;
const items = store.useState((state) => {
if (!name) return;
return state.items;
});
const values = (0,external_React_.useMemo)(() => {
return [...new Set(items == null ? void 0 : items.map((i) => i.value).filter((v) => v != null))];
}, [items]);
props = useWrapElement(
props,
(element) => {
if (!name) return element;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"select",
{
style: {
border: 0,
clip: "rect(0 0 0 0)",
height: "1px",
margin: "-1px",
overflow: "hidden",
padding: 0,
position: "absolute",
whiteSpace: "nowrap",
width: "1px"
},
tabIndex: -1,
"aria-hidden": true,
"aria-label": label,
"aria-labelledby": labelledBy,
name,
form,
required,
value,
multiple: multiSelectable,
onFocus: () => {
var _a2;
return (_a2 = store == null ? void 0 : store.getState().selectElement) == null ? void 0 : _a2.focus();
},
onChange: (event) => {
nativeSelectChangedRef.current = true;
setAutofill(true);
store == null ? void 0 : store.setValue(
multiSelectable ? getSelectedValues(event.target) : event.target.value
);
},
children: [
toArray(value).map((value2) => {
if (value2 == null) return null;
if (values.includes(value2)) return null;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("option", { value: value2, children: value2 }, value2);
}),
values.map((value2) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("option", { value: value2, children: value2 }, value2))
]
}
),
element
] });
},
[
store,
label,
labelledBy,
name,
form,
required,
value,
multiSelectable,
values
]
);
const children = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
value,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectArrow, {})
] });
const contentElement = store.useState("contentElement");
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
role: "combobox",
"aria-autocomplete": "none",
"aria-labelledby": labelId,
"aria-haspopup": getPopupRole(contentElement, "listbox"),
"data-autofill": autofill || void 0,
"data-name": name,
children
}, props), {
ref: useMergeRefs(store.setSelectElement, props.ref),
onKeyDown
});
props = usePopoverDisclosure(_3YLGPPWQ_spreadValues({ store, toggleOnClick }, props));
props = useCompositeTypeahead(_3YLGPPWQ_spreadValues({ store }, props));
return props;
});
var select_Select = forwardRef2(function Select2(props) {
const htmlProps = useSelect(props);
return LMDWO4NN_createElement(select_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/XRBJGF7I.js
"use client";
// src/select/select-list.tsx
var XRBJGF7I_TagName = "div";
var SelectListContext = (0,external_React_.createContext)(null);
var useSelectList = createHook(
function useSelectList2(_a) {
var _b = _a, {
store,
resetOnEscape = true,
hideOnEnter = true,
focusOnMove = true,
composite,
alwaysVisible
} = _b, props = __objRest(_b, [
"store",
"resetOnEscape",
"hideOnEnter",
"focusOnMove",
"composite",
"alwaysVisible"
]);
const context = useSelectContext();
store = store || context;
invariant(
store,
false && 0
);
const id = useId(props.id);
const value = store.useState("value");
const multiSelectable = Array.isArray(value);
const [defaultValue, setDefaultValue] = (0,external_React_.useState)(value);
const mounted = store.useState("mounted");
(0,external_React_.useEffect)(() => {
if (mounted) return;
setDefaultValue(value);
}, [mounted, value]);
resetOnEscape = resetOnEscape && !multiSelectable;
const onKeyDownProp = props.onKeyDown;
const resetOnEscapeProp = useBooleanEvent(resetOnEscape);
const hideOnEnterProp = useBooleanEvent(hideOnEnter);
const onKeyDown = useEvent((event) => {
onKeyDownProp == null ? void 0 : onKeyDownProp(event);
if (event.defaultPrevented) return;
if (event.key === "Escape" && resetOnEscapeProp(event)) {
store == null ? void 0 : store.setValue(defaultValue);
}
if (event.key === " " || event.key === "Enter") {
if (isSelfTarget(event) && hideOnEnterProp(event)) {
event.preventDefault();
store == null ? void 0 : store.hide();
}
}
});
const headingContext = (0,external_React_.useContext)(SelectHeadingContext);
const headingState = (0,external_React_.useState)();
const [headingId, setHeadingId] = headingContext || headingState;
const headingContextValue = (0,external_React_.useMemo)(
() => [headingId, setHeadingId],
[headingId]
);
const [childStore, setChildStore] = (0,external_React_.useState)(null);
const setStore = (0,external_React_.useContext)(SelectListContext);
(0,external_React_.useEffect)(() => {
if (!setStore) return;
setStore(store);
return () => setStore(null);
}, [setStore, store]);
props = useWrapElement(
props,
(element2) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectScopedContextProvider, { value: store, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectListContext.Provider, { value: setChildStore, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectHeadingContext.Provider, { value: headingContextValue, children: element2 }) }) }),
[store, headingContextValue]
);
const hasCombobox = !!store.combobox;
composite = composite != null ? composite : !hasCombobox && childStore !== store;
const [element, setElement] = useTransactionState(
composite ? store.setListElement : null
);
const role = useAttribute(element, "role", props.role);
const isCompositeRole = role === "listbox" || role === "menu" || role === "tree" || role === "grid";
const ariaMultiSelectable = composite || isCompositeRole ? multiSelectable || void 0 : void 0;
const hidden = isHidden(mounted, props.hidden, alwaysVisible);
const style = hidden ? _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props.style), { display: "none" }) : props.style;
if (composite) {
props = _3YLGPPWQ_spreadValues({
role: "listbox",
"aria-multiselectable": ariaMultiSelectable
}, props);
}
const labelId = store.useState(
(state) => {
var _a2;
return headingId || ((_a2 = state.labelElement) == null ? void 0 : _a2.id);
}
);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
id,
"aria-labelledby": labelId,
hidden
}, props), {
ref: useMergeRefs(setElement, props.ref),
style,
onKeyDown
});
props = useComposite(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ store }, props), { composite }));
props = useCompositeTypeahead(_3YLGPPWQ_spreadValues({ store, typeahead: !hasCombobox }, props));
return props;
}
);
var SelectList = forwardRef2(function SelectList2(props) {
const htmlProps = useSelectList(props);
return LMDWO4NN_createElement(XRBJGF7I_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/select/select-popover.js
"use client";
// src/select/select-popover.tsx
var select_popover_TagName = "div";
var useSelectPopover = createHook(
function useSelectPopover2(_a) {
var _b = _a, { store, alwaysVisible } = _b, props = __objRest(_b, ["store", "alwaysVisible"]);
const context = useSelectProviderContext();
store = store || context;
props = useSelectList(_3YLGPPWQ_spreadValues({ store, alwaysVisible }, props));
props = usePopover(_3YLGPPWQ_spreadValues({ store, alwaysVisible }, props));
return props;
}
);
var SelectPopover = createDialogComponent(
forwardRef2(function SelectPopover2(props) {
const htmlProps = useSelectPopover(props);
return LMDWO4NN_createElement(select_popover_TagName, htmlProps);
}),
useSelectProviderContext
);
;// ./node_modules/@ariakit/react-core/esm/__chunks/YF2ICFG4.js
"use client";
// src/select/select-item.tsx
var YF2ICFG4_TagName = "div";
function isSelected(storeValue, itemValue) {
if (itemValue == null) return;
if (storeValue == null) return false;
if (Array.isArray(storeValue)) {
return storeValue.includes(itemValue);
}
return storeValue === itemValue;
}
var useSelectItem = createHook(
function useSelectItem2(_a) {
var _b = _a, {
store,
value,
getItem: getItemProp,
hideOnClick,
setValueOnClick = value != null,
preventScrollOnKeyDown = true,
focusOnHover = true
} = _b, props = __objRest(_b, [
"store",
"value",
"getItem",
"hideOnClick",
"setValueOnClick",
"preventScrollOnKeyDown",
"focusOnHover"
]);
var _a2;
const context = useSelectScopedContext();
store = store || context;
invariant(
store,
false && 0
);
const id = useId(props.id);
const disabled = disabledFromProps(props);
const { listElement, multiSelectable, selected, autoFocus } = useStoreStateObject(store, {
listElement: "listElement",
multiSelectable(state) {
return Array.isArray(state.value);
},
selected(state) {
return isSelected(state.value, value);
},
autoFocus(state) {
if (value == null) return false;
if (state.value == null) return false;
if (state.activeId !== id && (store == null ? void 0 : store.item(state.activeId))) {
return false;
}
if (Array.isArray(state.value)) {
return state.value[state.value.length - 1] === value;
}
return state.value === value;
}
});
const getItem = (0,external_React_.useCallback)(
(item) => {
const nextItem = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, item), {
value: disabled ? void 0 : value,
children: value
});
if (getItemProp) {
return getItemProp(nextItem);
}
return nextItem;
},
[disabled, value, getItemProp]
);
hideOnClick = hideOnClick != null ? hideOnClick : value != null && !multiSelectable;
const onClickProp = props.onClick;
const setValueOnClickProp = useBooleanEvent(setValueOnClick);
const hideOnClickProp = useBooleanEvent(hideOnClick);
const onClick = useEvent((event) => {
onClickProp == null ? void 0 : onClickProp(event);
if (event.defaultPrevented) return;
if (isDownloading(event)) return;
if (isOpeningInNewTab(event)) return;
if (setValueOnClickProp(event) && value != null) {
store == null ? void 0 : store.setValue((prevValue) => {
if (!Array.isArray(prevValue)) return value;
if (prevValue.includes(value)) {
return prevValue.filter((v) => v !== value);
}
return [...prevValue, value];
});
}
if (hideOnClickProp(event)) {
store == null ? void 0 : store.hide();
}
});
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectItemCheckedContext.Provider, { value: selected != null ? selected : false, children: element }),
[selected]
);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
id,
role: getPopupItemRole(listElement),
"aria-selected": selected,
children: value
}, props), {
autoFocus: (_a2 = props.autoFocus) != null ? _a2 : autoFocus,
onClick
});
props = useCompositeItem(_3YLGPPWQ_spreadValues({
store,
getItem,
preventScrollOnKeyDown
}, props));
const focusOnHoverProp = useBooleanEvent(focusOnHover);
props = useCompositeHover(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
store
}, props), {
// We have to disable focusOnHover when the popup is closed, otherwise
// the active item will change to null (the container) when the popup is
// closed by clicking on an item.
focusOnHover(event) {
if (!focusOnHoverProp(event)) return false;
const state = store == null ? void 0 : store.getState();
return !!(state == null ? void 0 : state.open);
}
}));
return props;
}
);
var SelectItem = memo2(
forwardRef2(function SelectItem2(props) {
const htmlProps = useSelectItem(props);
return LMDWO4NN_createElement(YF2ICFG4_TagName, htmlProps);
})
);
;// ./node_modules/@ariakit/react-core/esm/__chunks/EYKMH5G5.js
"use client";
// src/checkbox/checkbox-checked-context.tsx
var CheckboxCheckedContext = (0,external_React_.createContext)(false);
;// ./node_modules/@ariakit/react-core/esm/__chunks/5JCRYSSV.js
"use client";
// src/checkbox/checkbox-check.tsx
var _5JCRYSSV_TagName = "span";
var checkmark = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"svg",
{
display: "block",
fill: "none",
stroke: "currentColor",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: 1.5,
viewBox: "0 0 16 16",
height: "1em",
width: "1em",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("polyline", { points: "4,8 7,12 12,4" })
}
);
function getChildren(props) {
if (props.checked) {
return props.children || checkmark;
}
if (typeof props.children === "function") {
return props.children;
}
return null;
}
var useCheckboxCheck = createHook(
function useCheckboxCheck2(_a) {
var _b = _a, { store, checked } = _b, props = __objRest(_b, ["store", "checked"]);
const context = (0,external_React_.useContext)(CheckboxCheckedContext);
checked = checked != null ? checked : context;
const children = getChildren({ checked, children: props.children });
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
"aria-hidden": true
}, props), {
children,
style: _3YLGPPWQ_spreadValues({
width: "1em",
height: "1em",
pointerEvents: "none"
}, props.style)
});
return removeUndefinedValues(props);
}
);
var CheckboxCheck = forwardRef2(function CheckboxCheck2(props) {
const htmlProps = useCheckboxCheck(props);
return LMDWO4NN_createElement(_5JCRYSSV_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/select/select-item-check.js
"use client";
// src/select/select-item-check.tsx
var select_item_check_TagName = "span";
var useSelectItemCheck = createHook(
function useSelectItemCheck2(_a) {
var _b = _a, { store, checked } = _b, props = __objRest(_b, ["store", "checked"]);
const context = (0,external_React_.useContext)(SelectItemCheckedContext);
checked = checked != null ? checked : context;
props = useCheckboxCheck(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { checked }));
return props;
}
);
var SelectItemCheck = forwardRef2(function SelectItemCheck2(props) {
const htmlProps = useSelectItemCheck(props);
return LMDWO4NN_createElement(select_item_check_TagName, htmlProps);
});
;// ./node_modules/@wordpress/components/build-module/custom-select-control-v2/styles.js
function custom_select_control_v2_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const ANIMATION_PARAMS = {
SLIDE_AMOUNT: "2px",
DURATION: "400ms",
EASING: "cubic-bezier( 0.16, 1, 0.3, 1 )"
};
const INLINE_PADDING = {
compact: config_values_default.controlPaddingXSmall,
small: config_values_default.controlPaddingXSmall,
default: config_values_default.controlPaddingX
};
const getSelectSize = (size, heightProperty) => {
const sizes = {
compact: {
[heightProperty]: 32,
paddingInlineStart: INLINE_PADDING.compact,
paddingInlineEnd: INLINE_PADDING.compact + chevronIconSize
},
default: {
[heightProperty]: 40,
paddingInlineStart: INLINE_PADDING.default,
paddingInlineEnd: INLINE_PADDING.default + chevronIconSize
},
small: {
[heightProperty]: 24,
paddingInlineStart: INLINE_PADDING.small,
paddingInlineEnd: INLINE_PADDING.small + chevronIconSize
}
};
return sizes[size] || sizes.default;
};
const getSelectItemSize = (size) => {
const checkmarkCorrection = 6;
const sizes = {
compact: {
paddingInlineStart: INLINE_PADDING.compact,
paddingInlineEnd: INLINE_PADDING.compact - checkmarkCorrection
},
default: {
paddingInlineStart: INLINE_PADDING.default,
paddingInlineEnd: INLINE_PADDING.default - checkmarkCorrection
},
small: {
paddingInlineStart: INLINE_PADDING.small,
paddingInlineEnd: INLINE_PADDING.small - checkmarkCorrection
}
};
return sizes[size] || sizes.default;
};
const styles_Select = /* @__PURE__ */ emotion_styled_base_browser_esm(select_Select, true ? {
// Do not forward `hasCustomRenderProp` to the underlying Ariakit.Select component
shouldForwardProp: (prop) => prop !== "hasCustomRenderProp",
target: "e1p3eej77"
} : 0)(({
size,
hasCustomRenderProp
}) => /* @__PURE__ */ emotion_react_browser_esm_css("display:block;background-color:", COLORS.theme.background, ";border:none;color:", COLORS.theme.foreground, ";cursor:pointer;font-family:inherit;text-align:start;user-select:none;width:100%;&[data-focus-visible]{outline:none;}", getSelectSize(size, hasCustomRenderProp ? "minHeight" : "height"), " ", !hasCustomRenderProp && truncateStyles, " ", fontSizeStyles({
inputSize: size
}), ";" + ( true ? "" : 0), true ? "" : 0), true ? "" : 0);
const slideDownAndFade = emotion_react_browser_esm_keyframes({
"0%": {
opacity: 0,
transform: `translateY(-${ANIMATION_PARAMS.SLIDE_AMOUNT})`
},
"100%": {
opacity: 1,
transform: "translateY(0)"
}
});
const styles_SelectPopover = /* @__PURE__ */ emotion_styled_base_browser_esm(SelectPopover, true ? {
target: "e1p3eej76"
} : 0)("display:flex;flex-direction:column;background-color:", COLORS.theme.background, ";border-radius:", config_values_default.radiusSmall, ";border:1px solid ", COLORS.theme.foreground, ";box-shadow:", config_values_default.elevationMedium, ";z-index:1000000;max-height:min( var( --popover-available-height, 400px ), 400px );overflow:auto;overscroll-behavior:contain;min-width:min-content;&[data-open]{@media not ( prefers-reduced-motion ){animation-duration:", ANIMATION_PARAMS.DURATION, ";animation-timing-function:", ANIMATION_PARAMS.EASING, ";animation-name:", slideDownAndFade, ";will-change:transform,opacity;}}&[data-focus-visible]{outline:none;}" + ( true ? "" : 0));
const styles_SelectItem = /* @__PURE__ */ emotion_styled_base_browser_esm(SelectItem, true ? {
target: "e1p3eej75"
} : 0)(({
size
}) => /* @__PURE__ */ emotion_react_browser_esm_css("cursor:default;display:flex;align-items:center;justify-content:space-between;font-size:", config_values_default.fontSize, ";line-height:28px;padding-block:", space(2), ";scroll-margin:", space(1), ";user-select:none;&[aria-disabled='true']{cursor:not-allowed;}&[data-active-item]{background-color:", COLORS.theme.gray[300], ";}", getSelectItemSize(size), ";" + ( true ? "" : 0), true ? "" : 0), true ? "" : 0);
const truncateStyles = true ? {
name: "1h52dri",
styles: "overflow:hidden;text-overflow:ellipsis;white-space:nowrap"
} : 0;
const SelectedExperimentalHintWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e1p3eej74"
} : 0)(truncateStyles, ";" + ( true ? "" : 0));
const SelectedExperimentalHintItem = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1p3eej73"
} : 0)("color:", COLORS.theme.gray[600], ";margin-inline-start:", space(2), ";" + ( true ? "" : 0));
const WithHintItemWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e1p3eej72"
} : 0)("display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;flex:1;column-gap:", space(4), ";" + ( true ? "" : 0));
const WithHintItemHint = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1p3eej71"
} : 0)("color:", COLORS.theme.gray[600], ";text-align:initial;line-height:", config_values_default.fontLineHeightBase, ";padding-inline-end:", space(1), ";margin-block:", space(1), ";" + ( true ? "" : 0));
const SelectedItemCheck = /* @__PURE__ */ emotion_styled_base_browser_esm(SelectItemCheck, true ? {
target: "e1p3eej70"
} : 0)("display:flex;align-items:center;margin-inline-start:", space(2), ";fill:currentColor;align-self:start;margin-block-start:2px;font-size:0;", WithHintItemWrapper, "~&,&:not(:empty){font-size:24px;}" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/custom-select-control-v2/custom-select.js
const CustomSelectContext = (0,external_wp_element_namespaceObject.createContext)(void 0);
CustomSelectContext.displayName = "CustomSelectContext";
function defaultRenderSelectedValue(value) {
const isValueEmpty = Array.isArray(value) ? value.length === 0 : value === void 0 || value === null;
if (isValueEmpty) {
return (0,external_wp_i18n_namespaceObject.__)("Select an item");
}
if (Array.isArray(value)) {
return value.length === 1 ? value[0] : (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %d: number of items selected (it will always be 2 or more items)
(0,external_wp_i18n_namespaceObject._n)("%d item selected", "%d items selected", value.length),
value.length
);
}
return value;
}
const CustomSelectButton = ({
renderSelectedValue,
size = "default",
store,
...restProps
}) => {
const {
value: currentValue
} = useStoreState(store);
const computedRenderSelectedValue = (0,external_wp_element_namespaceObject.useMemo)(() => renderSelectedValue !== null && renderSelectedValue !== void 0 ? renderSelectedValue : defaultRenderSelectedValue, [renderSelectedValue]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_Select, {
...restProps,
size,
hasCustomRenderProp: !!renderSelectedValue,
store,
children: computedRenderSelectedValue(currentValue)
});
};
function _CustomSelect(props) {
const {
children,
hideLabelFromVision = false,
label,
size,
store,
className,
isLegacy = false,
...restProps
} = props;
const onSelectPopoverKeyDown = (0,external_wp_element_namespaceObject.useCallback)((e) => {
if (isLegacy) {
e.stopPropagation();
}
}, [isLegacy]);
const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
store,
size
}), [store, size]);
return (
// Where should `restProps` be forwarded to?
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectLabel, {
store,
render: hideLabelFromVision ? (
// @ts-expect-error `children` are passed via the render prop
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {})
) : (
// @ts-expect-error `children` are passed via the render prop
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default.VisualLabel, {
as: "div"
})
),
children: label
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(input_base_default, {
__next40pxDefaultSize: true,
size,
suffix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(chevron_down_chevron_down_default, {}),
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomSelectButton, {
...restProps,
size,
store,
showOnKeyDown: !isLegacy
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_SelectPopover, {
gutter: 12,
store,
sameWidth: true,
slide: false,
onKeyDown: onSelectPopoverKeyDown,
flip: !isLegacy,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomSelectContext.Provider, {
value: contextValue,
children
})
})]
})]
})
);
}
var custom_select_default = _CustomSelect;
;// ./node_modules/@wordpress/components/build-module/custom-select-control-v2/item.js
function CustomSelectItem({
children,
...props
}) {
var _customSelectContext$;
const customSelectContext = (0,external_wp_element_namespaceObject.useContext)(CustomSelectContext);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_SelectItem, {
store: customSelectContext?.store,
size: (_customSelectContext$ = customSelectContext?.size) !== null && _customSelectContext$ !== void 0 ? _customSelectContext$ : "default",
...props,
children: [children !== null && children !== void 0 ? children : props.value, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectedItemCheck, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
icon: check_default
})
})]
});
}
CustomSelectItem.displayName = "CustomSelectControlV2.Item";
var item_default = CustomSelectItem;
;// ./node_modules/@wordpress/components/build-module/custom-select-control/index.js
function custom_select_control_useDeprecatedProps({
__experimentalShowSelectedHint,
...otherProps
}) {
return {
showSelectedHint: __experimentalShowSelectedHint,
...otherProps
};
}
function applyOptionDeprecations({
__experimentalHint,
...rest
}) {
return {
hint: __experimentalHint,
...rest
};
}
function getDescribedBy(currentValue, describedBy) {
if (describedBy) {
return describedBy;
}
return (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Currently selected: %s"), currentValue);
}
function CustomSelectControl(props) {
const {
__next40pxDefaultSize = false,
__shouldNotWarnDeprecated36pxSize,
describedBy,
options,
onChange,
size = "default",
value,
className: classNameProp,
showSelectedHint = false,
...restProps
} = custom_select_control_useDeprecatedProps(props);
maybeWarnDeprecated36pxSize({
componentName: "CustomSelectControl",
__next40pxDefaultSize,
size,
__shouldNotWarnDeprecated36pxSize
});
const descriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(CustomSelectControl, "custom-select-control__description");
const store = useSelectStore({
async setValue(nextValue) {
const nextOption = options.find((item) => item.name === nextValue);
if (!onChange || !nextOption) {
return;
}
await Promise.resolve();
const state = store.getState();
const changeObject = {
highlightedIndex: state.renderedItems.findIndex((item) => item.value === nextValue),
inputValue: "",
isOpen: state.open,
selectedItem: nextOption,
type: ""
};
onChange(changeObject);
},
value: value?.name,
// Setting the first option as a default value when no value is provided
// is already done natively by the underlying Ariakit component,
// but doing this explicitly avoids the `onChange` callback from firing
// on initial render, thus making this implementation closer to the v1.
defaultValue: options[0]?.name
});
const children = options.map(applyOptionDeprecations).map(({
name,
key,
hint,
style,
className
}) => {
const withHint = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(WithHintItemWrapper, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
children: name
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WithHintItemHint, {
// Keeping the classname for legacy reasons
className: "components-custom-select-control__item-hint",
children: hint
})]
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(item_default, {
value: name,
children: hint ? withHint : name,
style,
className: dist_clsx(
className,
// Keeping the classnames for legacy reasons
"components-custom-select-control__item",
{
"has-hint": hint
}
)
}, key);
});
const currentValue = useStoreState(store, "value");
const renderSelectedValueHint = () => {
const selectedOptionHint = options?.map(applyOptionDeprecations)?.find(({
name
}) => currentValue === name)?.hint;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(SelectedExperimentalHintWrapper, {
children: [currentValue, selectedOptionHint && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectedExperimentalHintItem, {
// Keeping the classname for legacy reasons
className: "components-custom-select-control__hint",
children: selectedOptionHint
})]
});
};
const translatedSize = (() => {
if (__next40pxDefaultSize && size === "default" || size === "__unstable-large") {
return "default";
}
if (!__next40pxDefaultSize && size === "default") {
return "compact";
}
return size;
})();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(custom_select_default, {
"aria-describedby": descriptionId,
renderSelectedValue: showSelectedHint ? renderSelectedValueHint : void 0,
size: translatedSize,
store,
className: dist_clsx(
// Keeping the classname for legacy reasons
"components-custom-select-control",
classNameProp
),
isLegacy: true,
...restProps,
children
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
id: descriptionId,
children: getDescribedBy(currentValue, describedBy)
})
})]
});
}
var custom_select_control_default = CustomSelectControl;
;// ./node_modules/date-fns/toDate.mjs
/**
* @name toDate
* @category Common Helpers
* @summary Convert the given argument to an instance of Date.
*
* @description
* Convert the given argument to an instance of Date.
*
* If the argument is an instance of Date, the function returns its clone.
*
* If the argument is a number, it is treated as a timestamp.
*
* If the argument is none of the above, the function returns Invalid Date.
*
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param argument - The value to convert
*
* @returns The parsed date in the local time zone
*
* @example
* // Clone the date:
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
* //=> Tue Feb 11 2014 11:30:30
*
* @example
* // Convert the timestamp to date:
* const result = toDate(1392098430000)
* //=> Tue Feb 11 2014 11:30:30
*/
function toDate(argument) {
const argStr = Object.prototype.toString.call(argument);
// Clone the date
if (
argument instanceof Date ||
(typeof argument === "object" && argStr === "[object Date]")
) {
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
return new argument.constructor(+argument);
} else if (
typeof argument === "number" ||
argStr === "[object Number]" ||
typeof argument === "string" ||
argStr === "[object String]"
) {
// TODO: Can we get rid of as?
return new Date(argument);
} else {
// TODO: Can we get rid of as?
return new Date(NaN);
}
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_toDate = ((/* unused pure expression or super */ null && (toDate)));
;// ./node_modules/date-fns/startOfDay.mjs
/**
* @name startOfDay
* @category Day Helpers
* @summary Return the start of a day for the given date.
*
* @description
* Return the start of a day for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
*
* @returns The start of a day
*
* @example
* // The start of a day for 2 September 2014 11:55:00:
* const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
* //=> Tue Sep 02 2014 00:00:00
*/
function startOfDay(date) {
const _date = toDate(date);
_date.setHours(0, 0, 0, 0);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfDay = ((/* unused pure expression or super */ null && (startOfDay)));
;// ./node_modules/date-fns/constructFrom.mjs
/**
* @name constructFrom
* @category Generic Helpers
* @summary Constructs a date using the reference date and the value
*
* @description
* The function constructs a new date using the constructor from the reference
* date and the given value. It helps to build generic functions that accept
* date extensions.
*
* It defaults to `Date` if the passed reference date is a number or a string.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The reference date to take constructor from
* @param value - The value to create the date
*
* @returns Date initialized using the given date and value
*
* @example
* import { constructFrom } from 'date-fns'
*
* // A function that clones a date preserving the original type
* function cloneDate<DateType extends Date(date: DateType): DateType {
* return constructFrom(
* date, // Use contrustor from the given date
* date.getTime() // Use the date value to create a new date
* )
* }
*/
function constructFrom(date, value) {
if (date instanceof Date) {
return new date.constructor(value);
} else {
return new Date(value);
}
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_constructFrom = ((/* unused pure expression or super */ null && (constructFrom)));
;// ./node_modules/date-fns/addMonths.mjs
/**
* @name addMonths
* @category Month Helpers
* @summary Add the specified number of months to the given date.
*
* @description
* Add the specified number of months to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to be changed
* @param amount - The amount of months to be added.
*
* @returns The new date with the months added
*
* @example
* // Add 5 months to 1 September 2014:
* const result = addMonths(new Date(2014, 8, 1), 5)
* //=> Sun Feb 01 2015 00:00:00
*
* // Add one month to 30 January 2023:
* const result = addMonths(new Date(2023, 0, 30), 1)
* //=> Tue Feb 28 2023 00:00:00
*/
function addMonths(date, amount) {
const _date = toDate(date);
if (isNaN(amount)) return constructFrom(date, NaN);
if (!amount) {
// If 0 months, no-op to avoid changing times in the hour before end of DST
return _date;
}
const dayOfMonth = _date.getDate();
// The JS Date object supports date math by accepting out-of-bounds values for
// month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
// new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
// want except that dates will wrap around the end of a month, meaning that
// new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
// we'll default to the end of the desired month by adding 1 to the desired
// month and using a date of 0 to back up one day to the end of the desired
// month.
const endOfDesiredMonth = constructFrom(date, _date.getTime());
endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
const daysInMonth = endOfDesiredMonth.getDate();
if (dayOfMonth >= daysInMonth) {
// If we're already at the end of the month, then this is the correct date
// and we're done.
return endOfDesiredMonth;
} else {
// Otherwise, we now know that setting the original day-of-month value won't
// cause an overflow, so set the desired day-of-month. Note that we can't
// just set the date of `endOfDesiredMonth` because that object may have had
// its time changed in the unusual case where where a DST transition was on
// the last day of the month and its local time was in the hour skipped or
// repeated next to a DST transition. So we use `date` instead which is
// guaranteed to still have the original time.
_date.setFullYear(
endOfDesiredMonth.getFullYear(),
endOfDesiredMonth.getMonth(),
dayOfMonth,
);
return _date;
}
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_addMonths = ((/* unused pure expression or super */ null && (addMonths)));
;// ./node_modules/date-fns/subMonths.mjs
/**
* @name subMonths
* @category Month Helpers
* @summary Subtract the specified number of months from the given date.
*
* @description
* Subtract the specified number of months from the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to be changed
* @param amount - The amount of months to be subtracted.
*
* @returns The new date with the months subtracted
*
* @example
* // Subtract 5 months from 1 February 2015:
* const result = subMonths(new Date(2015, 1, 1), 5)
* //=> Mon Sep 01 2014 00:00:00
*/
function subMonths(date, amount) {
return addMonths(date, -amount);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_subMonths = ((/* unused pure expression or super */ null && (subMonths)));
;// ./node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs
const formatDistanceLocale = {
lessThanXSeconds: {
one: "less than a second",
other: "less than {{count}} seconds",
},
xSeconds: {
one: "1 second",
other: "{{count}} seconds",
},
halfAMinute: "half a minute",
lessThanXMinutes: {
one: "less than a minute",
other: "less than {{count}} minutes",
},
xMinutes: {
one: "1 minute",
other: "{{count}} minutes",
},
aboutXHours: {
one: "about 1 hour",
other: "about {{count}} hours",
},
xHours: {
one: "1 hour",
other: "{{count}} hours",
},
xDays: {
one: "1 day",
other: "{{count}} days",
},
aboutXWeeks: {
one: "about 1 week",
other: "about {{count}} weeks",
},
xWeeks: {
one: "1 week",
other: "{{count}} weeks",
},
aboutXMonths: {
one: "about 1 month",
other: "about {{count}} months",
},
xMonths: {
one: "1 month",
other: "{{count}} months",
},
aboutXYears: {
one: "about 1 year",
other: "about {{count}} years",
},
xYears: {
one: "1 year",
other: "{{count}} years",
},
overXYears: {
one: "over 1 year",
other: "over {{count}} years",
},
almostXYears: {
one: "almost 1 year",
other: "almost {{count}} years",
},
};
const formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", count.toString());
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "in " + result;
} else {
return result + " ago";
}
}
return result;
};
;// ./node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs
function buildFormatLongFn(args) {
return (options = {}) => {
// TODO: Remove String()
const width = options.width ? String(options.width) : args.defaultWidth;
const format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
;// ./node_modules/date-fns/locale/en-US/_lib/formatLong.mjs
const dateFormats = {
full: "EEEE, MMMM do, y",
long: "MMMM do, y",
medium: "MMM d, y",
short: "MM/dd/yyyy",
};
const timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a",
};
const dateTimeFormats = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};
;// ./node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs
const formatRelativeLocale = {
lastWeek: "'last' eeee 'at' p",
yesterday: "'yesterday at' p",
today: "'today at' p",
tomorrow: "'tomorrow at' p",
nextWeek: "eeee 'at' p",
other: "P",
};
const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];
;// ./node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs
/* eslint-disable no-unused-vars */
/**
* The localize function argument callback which allows to convert raw value to
* the actual type.
*
* @param value - The value to convert
*
* @returns The converted value
*/
/**
* The map of localized values for each width.
*/
/**
* The index type of the locale unit value. It types conversion of units of
* values that don't start at 0 (i.e. quarters).
*/
/**
* Converts the unit value to the tuple of values.
*/
/**
* The tuple of localized era values. The first element represents BC,
* the second element represents AD.
*/
/**
* The tuple of localized quarter values. The first element represents Q1.
*/
/**
* The tuple of localized day values. The first element represents Sunday.
*/
/**
* The tuple of localized month values. The first element represents January.
*/
function buildLocalizeFn(args) {
return (value, options) => {
const context = options?.context ? String(options.context) : "standalone";
let valuesArray;
if (context === "formatting" && args.formattingValues) {
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
const width = options?.width ? String(options.width) : defaultWidth;
valuesArray =
args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
const defaultWidth = args.defaultWidth;
const width = options?.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[width] || args.values[defaultWidth];
}
const index = args.argumentCallback ? args.argumentCallback(value) : value;
// @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
return valuesArray[index];
};
}
;// ./node_modules/date-fns/locale/en-US/_lib/localize.mjs
const eraValues = {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"],
};
// Note: in English, the names of days of the week and months are capitalized.
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
// Generally, formatted dates should look like they are in the middle of a sentence,
// e.g. in Spanish language the weekdays and months should be in the lowercase.
const monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
],
wide: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
],
};
const dayValues = {
narrow: ["S", "M", "T", "W", "T", "F", "S"],
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
wide: [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
],
};
const dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
// If ordinal numbers depend on context, for example,
// if they are different for different grammatical genders,
// use `options.unit`.
//
// `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
// 'day', 'hour', 'minute', 'second'.
const rem100 = number % 100;
if (rem100 > 20 || rem100 < 10) {
switch (rem100 % 10) {
case 1:
return number + "st";
case 2:
return number + "nd";
case 3:
return number + "rd";
}
}
return number + "th";
};
const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};
;// ./node_modules/date-fns/locale/_lib/buildMatchFn.mjs
function buildMatchFn(args) {
return (string, options = {}) => {
const width = options.width;
const matchPattern =
(width && args.matchPatterns[width]) ||
args.matchPatterns[args.defaultMatchWidth];
const matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
const matchedString = matchResult[0];
const parsePatterns =
(width && args.parsePatterns[width]) ||
args.parsePatterns[args.defaultParseWidth];
const key = Array.isArray(parsePatterns)
? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))
: // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
findKey(parsePatterns, (pattern) => pattern.test(matchedString));
let value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback
? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
options.valueCallback(value)
: value;
const rest = string.slice(matchedString.length);
return { value, rest };
};
}
function findKey(object, predicate) {
for (const key in object) {
if (
Object.prototype.hasOwnProperty.call(object, key) &&
predicate(object[key])
) {
return key;
}
}
return undefined;
}
function findIndex(array, predicate) {
for (let key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return undefined;
}
;// ./node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs
function buildMatchPatternFn(args) {
return (string, options = {}) => {
const matchResult = string.match(args.matchPattern);
if (!matchResult) return null;
const matchedString = matchResult[0];
const parseResult = string.match(args.parsePattern);
if (!parseResult) return null;
let value = args.valueCallback
? args.valueCallback(parseResult[0])
: parseResult[0];
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
value = options.valueCallback ? options.valueCallback(value) : value;
const rest = string.slice(matchedString.length);
return { value, rest };
};
}
;// ./node_modules/date-fns/locale/en-US/_lib/match.mjs
const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(b|a)/i,
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
wide: /^(before christ|before common era|anno domini|common era)/i,
};
const parseEraPatterns = {
any: [/^b/i, /^(a|c)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](th|st|nd|rd)? quarter/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,
};
const parseMonthPatterns = {
narrow: [
/^j/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^j/i,
/^j/i,
/^a/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
any: [
/^ja/i,
/^f/i,
/^mar/i,
/^ap/i,
/^may/i,
/^jun/i,
/^jul/i,
/^au/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
};
const matchDayPatterns = {
narrow: /^[smtwf]/i,
short: /^(su|mo|tu|we|th|fr|sa)/i,
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,
};
const parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
};
const matchDayPeriodPatterns = {
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^mi/i,
noon: /^no/i,
morning: /morning/i,
afternoon: /afternoon/i,
evening: /evening/i,
night: /night/i,
},
};
const match_match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};
;// ./node_modules/date-fns/locale/en-US.mjs
/**
* @category Locales
* @summary English locale (United States).
* @language English
* @iso-639-2 eng
* @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
* @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
*/
const enUS = {
code: "en-US",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match_match,
options: {
weekStartsOn: 0 /* Sunday */,
firstWeekContainsDate: 1,
},
};
// Fallback for modularized imports:
/* harmony default export */ const en_US = ((/* unused pure expression or super */ null && (enUS)));
;// ./node_modules/date-fns/_lib/defaultOptions.mjs
let defaultOptions_defaultOptions = {};
function getDefaultOptions() {
return defaultOptions_defaultOptions;
}
function setDefaultOptions(newOptions) {
defaultOptions_defaultOptions = newOptions;
}
;// ./node_modules/date-fns/constants.mjs
/**
* @module constants
* @summary Useful constants
* @description
* Collection of useful date constants.
*
* The constants could be imported from `date-fns/constants`:
*
* ```ts
* import { maxTime, minTime } from "./constants/date-fns/constants";
*
* function isAllowedTime(time) {
* return time <= maxTime && time >= minTime;
* }
* ```
*/
/**
* @constant
* @name daysInWeek
* @summary Days in 1 week.
*/
const daysInWeek = 7;
/**
* @constant
* @name daysInYear
* @summary Days in 1 year.
*
* @description
* How many days in a year.
*
* One years equals 365.2425 days according to the formula:
*
* > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.
* > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
*/
const daysInYear = 365.2425;
/**
* @constant
* @name maxTime
* @summary Maximum allowed time.
*
* @example
* import { maxTime } from "./constants/date-fns/constants";
*
* const isValid = 8640000000000001 <= maxTime;
* //=> false
*
* new Date(8640000000000001);
* //=> Invalid Date
*/
const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
/**
* @constant
* @name minTime
* @summary Minimum allowed time.
*
* @example
* import { minTime } from "./constants/date-fns/constants";
*
* const isValid = -8640000000000001 >= minTime;
* //=> false
*
* new Date(-8640000000000001)
* //=> Invalid Date
*/
const minTime = -maxTime;
/**
* @constant
* @name millisecondsInWeek
* @summary Milliseconds in 1 week.
*/
const millisecondsInWeek = 604800000;
/**
* @constant
* @name millisecondsInDay
* @summary Milliseconds in 1 day.
*/
const millisecondsInDay = 86400000;
/**
* @constant
* @name millisecondsInMinute
* @summary Milliseconds in 1 minute
*/
const millisecondsInMinute = 60000;
/**
* @constant
* @name millisecondsInHour
* @summary Milliseconds in 1 hour
*/
const millisecondsInHour = 3600000;
/**
* @constant
* @name millisecondsInSecond
* @summary Milliseconds in 1 second
*/
const millisecondsInSecond = 1000;
/**
* @constant
* @name minutesInYear
* @summary Minutes in 1 year.
*/
const minutesInYear = 525600;
/**
* @constant
* @name minutesInMonth
* @summary Minutes in 1 month.
*/
const minutesInMonth = 43200;
/**
* @constant
* @name minutesInDay
* @summary Minutes in 1 day.
*/
const minutesInDay = 1440;
/**
* @constant
* @name minutesInHour
* @summary Minutes in 1 hour.
*/
const minutesInHour = 60;
/**
* @constant
* @name monthsInQuarter
* @summary Months in 1 quarter.
*/
const monthsInQuarter = 3;
/**
* @constant
* @name monthsInYear
* @summary Months in 1 year.
*/
const monthsInYear = 12;
/**
* @constant
* @name quartersInYear
* @summary Quarters in 1 year
*/
const quartersInYear = 4;
/**
* @constant
* @name secondsInHour
* @summary Seconds in 1 hour.
*/
const secondsInHour = 3600;
/**
* @constant
* @name secondsInMinute
* @summary Seconds in 1 minute.
*/
const secondsInMinute = 60;
/**
* @constant
* @name secondsInDay
* @summary Seconds in 1 day.
*/
const secondsInDay = secondsInHour * 24;
/**
* @constant
* @name secondsInWeek
* @summary Seconds in 1 week.
*/
const secondsInWeek = secondsInDay * 7;
/**
* @constant
* @name secondsInYear
* @summary Seconds in 1 year.
*/
const secondsInYear = secondsInDay * daysInYear;
/**
* @constant
* @name secondsInMonth
* @summary Seconds in 1 month
*/
const secondsInMonth = secondsInYear / 12;
/**
* @constant
* @name secondsInQuarter
* @summary Seconds in 1 quarter.
*/
const secondsInQuarter = secondsInMonth * 3;
;// ./node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs
/**
* Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
* They usually appear for dates that denote time before the timezones were introduced
* (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
* and GMT+01:00:00 after that date)
*
* Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
* which would lead to incorrect calculations.
*
* This function returns the timezone offset in milliseconds that takes seconds in account.
*/
function getTimezoneOffsetInMilliseconds(date) {
const _date = toDate(date);
const utcDate = new Date(
Date.UTC(
_date.getFullYear(),
_date.getMonth(),
_date.getDate(),
_date.getHours(),
_date.getMinutes(),
_date.getSeconds(),
_date.getMilliseconds(),
),
);
utcDate.setUTCFullYear(_date.getFullYear());
return +date - +utcDate;
}
;// ./node_modules/date-fns/differenceInCalendarDays.mjs
/**
* @name differenceInCalendarDays
* @category Day Helpers
* @summary Get the number of calendar days between the given dates.
*
* @description
* Get the number of calendar days between the given dates. This means that the times are removed
* from the dates and then the difference in days is calculated.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param dateLeft - The later date
* @param dateRight - The earlier date
*
* @returns The number of calendar days
*
* @example
* // How many calendar days are between
* // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
* const result = differenceInCalendarDays(
* new Date(2012, 6, 2, 0, 0),
* new Date(2011, 6, 2, 23, 0)
* )
* //=> 366
* // How many calendar days are between
* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
* const result = differenceInCalendarDays(
* new Date(2011, 6, 3, 0, 1),
* new Date(2011, 6, 2, 23, 59)
* )
* //=> 1
*/
function differenceInCalendarDays(dateLeft, dateRight) {
const startOfDayLeft = startOfDay(dateLeft);
const startOfDayRight = startOfDay(dateRight);
const timestampLeft =
+startOfDayLeft - getTimezoneOffsetInMilliseconds(startOfDayLeft);
const timestampRight =
+startOfDayRight - getTimezoneOffsetInMilliseconds(startOfDayRight);
// Round the number of days to the nearest integer because the number of
// milliseconds in a day is not constant (e.g. it's different in the week of
// the daylight saving time clock shift).
return Math.round((timestampLeft - timestampRight) / millisecondsInDay);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_differenceInCalendarDays = ((/* unused pure expression or super */ null && (differenceInCalendarDays)));
;// ./node_modules/date-fns/startOfYear.mjs
/**
* @name startOfYear
* @category Year Helpers
* @summary Return the start of a year for the given date.
*
* @description
* Return the start of a year for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
*
* @returns The start of a year
*
* @example
* // The start of a year for 2 September 2014 11:55:00:
* const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
* //=> Wed Jan 01 2014 00:00:00
*/
function startOfYear(date) {
const cleanDate = toDate(date);
const _date = constructFrom(date, 0);
_date.setFullYear(cleanDate.getFullYear(), 0, 1);
_date.setHours(0, 0, 0, 0);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfYear = ((/* unused pure expression or super */ null && (startOfYear)));
;// ./node_modules/date-fns/getDayOfYear.mjs
/**
* @name getDayOfYear
* @category Day Helpers
* @summary Get the day of the year of the given date.
*
* @description
* Get the day of the year of the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The given date
*
* @returns The day of year
*
* @example
* // Which day of the year is 2 July 2014?
* const result = getDayOfYear(new Date(2014, 6, 2))
* //=> 183
*/
function getDayOfYear(date) {
const _date = toDate(date);
const diff = differenceInCalendarDays(_date, startOfYear(_date));
const dayOfYear = diff + 1;
return dayOfYear;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_getDayOfYear = ((/* unused pure expression or super */ null && (getDayOfYear)));
;// ./node_modules/date-fns/startOfWeek.mjs
/**
* The {@link startOfWeek} function options.
*/
/**
* @name startOfWeek
* @category Week Helpers
* @summary Return the start of a week for the given date.
*
* @description
* Return the start of a week for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
* @param options - An object with options
*
* @returns The start of a week
*
* @example
* // The start of a week for 2 September 2014 11:55:00:
* const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
* //=> Sun Aug 31 2014 00:00:00
*
* @example
* // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
* const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
* //=> Mon Sep 01 2014 00:00:00
*/
function startOfWeek(date, options) {
const defaultOptions = getDefaultOptions();
const weekStartsOn =
options?.weekStartsOn ??
options?.locale?.options?.weekStartsOn ??
defaultOptions.weekStartsOn ??
defaultOptions.locale?.options?.weekStartsOn ??
0;
const _date = toDate(date);
const day = _date.getDay();
const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
_date.setDate(_date.getDate() - diff);
_date.setHours(0, 0, 0, 0);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfWeek = ((/* unused pure expression or super */ null && (startOfWeek)));
;// ./node_modules/date-fns/startOfISOWeek.mjs
/**
* @name startOfISOWeek
* @category ISO Week Helpers
* @summary Return the start of an ISO week for the given date.
*
* @description
* Return the start of an ISO week for the given date.
* The result will be in the local timezone.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
*
* @returns The start of an ISO week
*
* @example
* // The start of an ISO week for 2 September 2014 11:55:00:
* const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
* //=> Mon Sep 01 2014 00:00:00
*/
function startOfISOWeek(date) {
return startOfWeek(date, { weekStartsOn: 1 });
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfISOWeek = ((/* unused pure expression or super */ null && (startOfISOWeek)));
;// ./node_modules/date-fns/getISOWeekYear.mjs
/**
* @name getISOWeekYear
* @category ISO Week-Numbering Year Helpers
* @summary Get the ISO week-numbering year of the given date.
*
* @description
* Get the ISO week-numbering year of the given date,
* which always starts 3 days before the year's first Thursday.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The given date
*
* @returns The ISO week-numbering year
*
* @example
* // Which ISO-week numbering year is 2 January 2005?
* const result = getISOWeekYear(new Date(2005, 0, 2))
* //=> 2004
*/
function getISOWeekYear(date) {
const _date = toDate(date);
const year = _date.getFullYear();
const fourthOfJanuaryOfNextYear = constructFrom(date, 0);
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
const fourthOfJanuaryOfThisYear = constructFrom(date, 0);
fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
if (_date.getTime() >= startOfNextYear.getTime()) {
return year + 1;
} else if (_date.getTime() >= startOfThisYear.getTime()) {
return year;
} else {
return year - 1;
}
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_getISOWeekYear = ((/* unused pure expression or super */ null && (getISOWeekYear)));
;// ./node_modules/date-fns/startOfISOWeekYear.mjs
/**
* @name startOfISOWeekYear
* @category ISO Week-Numbering Year Helpers
* @summary Return the start of an ISO week-numbering year for the given date.
*
* @description
* Return the start of an ISO week-numbering year,
* which always starts 3 days before the year's first Thursday.
* The result will be in the local timezone.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
*
* @returns The start of an ISO week-numbering year
*
* @example
* // The start of an ISO week-numbering year for 2 July 2005:
* const result = startOfISOWeekYear(new Date(2005, 6, 2))
* //=> Mon Jan 03 2005 00:00:00
*/
function startOfISOWeekYear(date) {
const year = getISOWeekYear(date);
const fourthOfJanuary = constructFrom(date, 0);
fourthOfJanuary.setFullYear(year, 0, 4);
fourthOfJanuary.setHours(0, 0, 0, 0);
return startOfISOWeek(fourthOfJanuary);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfISOWeekYear = ((/* unused pure expression or super */ null && (startOfISOWeekYear)));
;// ./node_modules/date-fns/getISOWeek.mjs
/**
* @name getISOWeek
* @category ISO Week Helpers
* @summary Get the ISO week of the given date.
*
* @description
* Get the ISO week of the given date.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The given date
*
* @returns The ISO week
*
* @example
* // Which week of the ISO-week numbering year is 2 January 2005?
* const result = getISOWeek(new Date(2005, 0, 2))
* //=> 53
*/
function getISOWeek(date) {
const _date = toDate(date);
const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
// Round the number of weeks to the nearest integer because the number of
// milliseconds in a week is not constant (e.g. it's different in the week of
// the daylight saving time clock shift).
return Math.round(diff / millisecondsInWeek) + 1;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_getISOWeek = ((/* unused pure expression or super */ null && (getISOWeek)));
;// ./node_modules/date-fns/getWeekYear.mjs
/**
* The {@link getWeekYear} function options.
*/
/**
* @name getWeekYear
* @category Week-Numbering Year Helpers
* @summary Get the local week-numbering year of the given date.
*
* @description
* Get the local week-numbering year of the given date.
* The exact calculation depends on the values of
* `options.weekStartsOn` (which is the index of the first day of the week)
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
* the first week of the week-numbering year)
*
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The given date
* @param options - An object with options.
*
* @returns The local week-numbering year
*
* @example
* // Which week numbering year is 26 December 2004 with the default settings?
* const result = getWeekYear(new Date(2004, 11, 26))
* //=> 2005
*
* @example
* // Which week numbering year is 26 December 2004 if week starts on Saturday?
* const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
* //=> 2004
*
* @example
* // Which week numbering year is 26 December 2004 if the first week contains 4 January?
* const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
* //=> 2004
*/
function getWeekYear(date, options) {
const _date = toDate(date);
const year = _date.getFullYear();
const defaultOptions = getDefaultOptions();
const firstWeekContainsDate =
options?.firstWeekContainsDate ??
options?.locale?.options?.firstWeekContainsDate ??
defaultOptions.firstWeekContainsDate ??
defaultOptions.locale?.options?.firstWeekContainsDate ??
1;
const firstWeekOfNextYear = constructFrom(date, 0);
firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
firstWeekOfNextYear.setHours(0, 0, 0, 0);
const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
const firstWeekOfThisYear = constructFrom(date, 0);
firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
firstWeekOfThisYear.setHours(0, 0, 0, 0);
const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
if (_date.getTime() >= startOfNextYear.getTime()) {
return year + 1;
} else if (_date.getTime() >= startOfThisYear.getTime()) {
return year;
} else {
return year - 1;
}
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_getWeekYear = ((/* unused pure expression or super */ null && (getWeekYear)));
;// ./node_modules/date-fns/startOfWeekYear.mjs
/**
* The {@link startOfWeekYear} function options.
*/
/**
* @name startOfWeekYear
* @category Week-Numbering Year Helpers
* @summary Return the start of a local week-numbering year for the given date.
*
* @description
* Return the start of a local week-numbering year.
* The exact calculation depends on the values of
* `options.weekStartsOn` (which is the index of the first day of the week)
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
* the first week of the week-numbering year)
*
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
* @param options - An object with options
*
* @returns The start of a week-numbering year
*
* @example
* // The start of an a week-numbering year for 2 July 2005 with default settings:
* const result = startOfWeekYear(new Date(2005, 6, 2))
* //=> Sun Dec 26 2004 00:00:00
*
* @example
* // The start of a week-numbering year for 2 July 2005
* // if Monday is the first day of week
* // and 4 January is always in the first week of the year:
* const result = startOfWeekYear(new Date(2005, 6, 2), {
* weekStartsOn: 1,
* firstWeekContainsDate: 4
* })
* //=> Mon Jan 03 2005 00:00:00
*/
function startOfWeekYear(date, options) {
const defaultOptions = getDefaultOptions();
const firstWeekContainsDate =
options?.firstWeekContainsDate ??
options?.locale?.options?.firstWeekContainsDate ??
defaultOptions.firstWeekContainsDate ??
defaultOptions.locale?.options?.firstWeekContainsDate ??
1;
const year = getWeekYear(date, options);
const firstWeek = constructFrom(date, 0);
firstWeek.setFullYear(year, 0, firstWeekContainsDate);
firstWeek.setHours(0, 0, 0, 0);
const _date = startOfWeek(firstWeek, options);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfWeekYear = ((/* unused pure expression or super */ null && (startOfWeekYear)));
;// ./node_modules/date-fns/getWeek.mjs
/**
* The {@link getWeek} function options.
*/
/**
* @name getWeek
* @category Week Helpers
* @summary Get the local week index of the given date.
*
* @description
* Get the local week index of the given date.
* The exact calculation depends on the values of
* `options.weekStartsOn` (which is the index of the first day of the week)
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
* the first week of the week-numbering year)
*
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The given date
* @param options - An object with options
*
* @returns The week
*
* @example
* // Which week of the local week numbering year is 2 January 2005 with default options?
* const result = getWeek(new Date(2005, 0, 2))
* //=> 2
*
* @example
* // Which week of the local week numbering year is 2 January 2005,
* // if Monday is the first day of the week,
* // and the first week of the year always contains 4 January?
* const result = getWeek(new Date(2005, 0, 2), {
* weekStartsOn: 1,
* firstWeekContainsDate: 4
* })
* //=> 53
*/
function getWeek(date, options) {
const _date = toDate(date);
const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
// Round the number of weeks to the nearest integer because the number of
// milliseconds in a week is not constant (e.g. it's different in the week of
// the daylight saving time clock shift).
return Math.round(diff / millisecondsInWeek) + 1;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_getWeek = ((/* unused pure expression or super */ null && (getWeek)));
;// ./node_modules/date-fns/_lib/addLeadingZeros.mjs
function addLeadingZeros(number, targetLength) {
const sign = number < 0 ? "-" : "";
const output = Math.abs(number).toString().padStart(targetLength, "0");
return sign + output;
}
;// ./node_modules/date-fns/_lib/format/lightFormatters.mjs
/*
* | | Unit | | Unit |
* |-----|--------------------------------|-----|--------------------------------|
* | a | AM, PM | A* | |
* | d | Day of month | D | |
* | h | Hour [1-12] | H | Hour [0-23] |
* | m | Minute | M | Month |
* | s | Second | S | Fraction of second |
* | y | Year (abs) | Y | |
*
* Letters marked by * are not implemented but reserved by Unicode standard.
*/
const lightFormatters = {
// Year
y(date, token) {
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
// | Year | y | yy | yyy | yyyy | yyyyy |
// |----------|-------|----|-------|-------|-------|
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
const signedYear = date.getFullYear();
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const year = signedYear > 0 ? signedYear : 1 - signedYear;
return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
},
// Month
M(date, token) {
const month = date.getMonth();
return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
},
// Day of the month
d(date, token) {
return addLeadingZeros(date.getDate(), token.length);
},
// AM or PM
a(date, token) {
const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
switch (token) {
case "a":
case "aa":
return dayPeriodEnumValue.toUpperCase();
case "aaa":
return dayPeriodEnumValue;
case "aaaaa":
return dayPeriodEnumValue[0];
case "aaaa":
default:
return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
}
},
// Hour [1-12]
h(date, token) {
return addLeadingZeros(date.getHours() % 12 || 12, token.length);
},
// Hour [0-23]
H(date, token) {
return addLeadingZeros(date.getHours(), token.length);
},
// Minute
m(date, token) {
return addLeadingZeros(date.getMinutes(), token.length);
},
// Second
s(date, token) {
return addLeadingZeros(date.getSeconds(), token.length);
},
// Fraction of second
S(date, token) {
const numberOfDigits = token.length;
const milliseconds = date.getMilliseconds();
const fractionalSeconds = Math.trunc(
milliseconds * Math.pow(10, numberOfDigits - 3),
);
return addLeadingZeros(fractionalSeconds, token.length);
},
};
;// ./node_modules/date-fns/_lib/format/formatters.mjs
const dayPeriodEnum = {
am: "am",
pm: "pm",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
};
/*
* | | Unit | | Unit |
* |-----|--------------------------------|-----|--------------------------------|
* | a | AM, PM | A* | Milliseconds in day |
* | b | AM, PM, noon, midnight | B | Flexible day period |
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
* | d | Day of month | D | Day of year |
* | e | Local day of week | E | Day of week |
* | f | | F* | Day of week in month |
* | g* | Modified Julian day | G | Era |
* | h | Hour [1-12] | H | Hour [0-23] |
* | i! | ISO day of week | I! | ISO week of year |
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
* | k | Hour [1-24] | K | Hour [0-11] |
* | l* | (deprecated) | L | Stand-alone month |
* | m | Minute | M | Month |
* | n | | N | |
* | o! | Ordinal number modifier | O | Timezone (GMT) |
* | p! | Long localized time | P! | Long localized date |
* | q | Stand-alone quarter | Q | Quarter |
* | r* | Related Gregorian year | R! | ISO week-numbering year |
* | s | Second | S | Fraction of second |
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
* | u | Extended year | U* | Cyclic year |
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
* | w | Local week of year | W* | Week of month |
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
* | y | Year (abs) | Y | Local week-numbering year |
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
*
* Letters marked by * are not implemented but reserved by Unicode standard.
*
* Letters marked by ! are non-standard, but implemented by date-fns:
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
* i.e. 7 for Sunday, 1 for Monday, etc.
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
* `R` is supposed to be used in conjunction with `I` and `i`
* for universal ISO week-numbering date, whereas
* `Y` is supposed to be used in conjunction with `w` and `e`
* for week-numbering date specific to the locale.
* - `P` is long localized date format
* - `p` is long localized time format
*/
const formatters = {
// Era
G: function (date, token, localize) {
const era = date.getFullYear() > 0 ? 1 : 0;
switch (token) {
// AD, BC
case "G":
case "GG":
case "GGG":
return localize.era(era, { width: "abbreviated" });
// A, B
case "GGGGG":
return localize.era(era, { width: "narrow" });
// Anno Domini, Before Christ
case "GGGG":
default:
return localize.era(era, { width: "wide" });
}
},
// Year
y: function (date, token, localize) {
// Ordinal number
if (token === "yo") {
const signedYear = date.getFullYear();
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const year = signedYear > 0 ? signedYear : 1 - signedYear;
return localize.ordinalNumber(year, { unit: "year" });
}
return lightFormatters.y(date, token);
},
// Local week-numbering year
Y: function (date, token, localize, options) {
const signedWeekYear = getWeekYear(date, options);
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
// Two digit year
if (token === "YY") {
const twoDigitYear = weekYear % 100;
return addLeadingZeros(twoDigitYear, 2);
}
// Ordinal number
if (token === "Yo") {
return localize.ordinalNumber(weekYear, { unit: "year" });
}
// Padding
return addLeadingZeros(weekYear, token.length);
},
// ISO week-numbering year
R: function (date, token) {
const isoWeekYear = getISOWeekYear(date);
// Padding
return addLeadingZeros(isoWeekYear, token.length);
},
// Extended year. This is a single number designating the year of this calendar system.
// The main difference between `y` and `u` localizers are B.C. years:
// | Year | `y` | `u` |
// |------|-----|-----|
// | AC 1 | 1 | 1 |
// | BC 1 | 1 | 0 |
// | BC 2 | 2 | -1 |
// Also `yy` always returns the last two digits of a year,
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
u: function (date, token) {
const year = date.getFullYear();
return addLeadingZeros(year, token.length);
},
// Quarter
Q: function (date, token, localize) {
const quarter = Math.ceil((date.getMonth() + 1) / 3);
switch (token) {
// 1, 2, 3, 4
case "Q":
return String(quarter);
// 01, 02, 03, 04
case "QQ":
return addLeadingZeros(quarter, 2);
// 1st, 2nd, 3rd, 4th
case "Qo":
return localize.ordinalNumber(quarter, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "QQQ":
return localize.quarter(quarter, {
width: "abbreviated",
context: "formatting",
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "QQQQQ":
return localize.quarter(quarter, {
width: "narrow",
context: "formatting",
});
// 1st quarter, 2nd quarter, ...
case "QQQQ":
default:
return localize.quarter(quarter, {
width: "wide",
context: "formatting",
});
}
},
// Stand-alone quarter
q: function (date, token, localize) {
const quarter = Math.ceil((date.getMonth() + 1) / 3);
switch (token) {
// 1, 2, 3, 4
case "q":
return String(quarter);
// 01, 02, 03, 04
case "qq":
return addLeadingZeros(quarter, 2);
// 1st, 2nd, 3rd, 4th
case "qo":
return localize.ordinalNumber(quarter, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "qqq":
return localize.quarter(quarter, {
width: "abbreviated",
context: "standalone",
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "qqqqq":
return localize.quarter(quarter, {
width: "narrow",
context: "standalone",
});
// 1st quarter, 2nd quarter, ...
case "qqqq":
default:
return localize.quarter(quarter, {
width: "wide",
context: "standalone",
});
}
},
// Month
M: function (date, token, localize) {
const month = date.getMonth();
switch (token) {
case "M":
case "MM":
return lightFormatters.M(date, token);
// 1st, 2nd, ..., 12th
case "Mo":
return localize.ordinalNumber(month + 1, { unit: "month" });
// Jan, Feb, ..., Dec
case "MMM":
return localize.month(month, {
width: "abbreviated",
context: "formatting",
});
// J, F, ..., D
case "MMMMM":
return localize.month(month, {
width: "narrow",
context: "formatting",
});
// January, February, ..., December
case "MMMM":
default:
return localize.month(month, { width: "wide", context: "formatting" });
}
},
// Stand-alone month
L: function (date, token, localize) {
const month = date.getMonth();
switch (token) {
// 1, 2, ..., 12
case "L":
return String(month + 1);
// 01, 02, ..., 12
case "LL":
return addLeadingZeros(month + 1, 2);
// 1st, 2nd, ..., 12th
case "Lo":
return localize.ordinalNumber(month + 1, { unit: "month" });
// Jan, Feb, ..., Dec
case "LLL":
return localize.month(month, {
width: "abbreviated",
context: "standalone",
});
// J, F, ..., D
case "LLLLL":
return localize.month(month, {
width: "narrow",
context: "standalone",
});
// January, February, ..., December
case "LLLL":
default:
return localize.month(month, { width: "wide", context: "standalone" });
}
},
// Local week of year
w: function (date, token, localize, options) {
const week = getWeek(date, options);
if (token === "wo") {
return localize.ordinalNumber(week, { unit: "week" });
}
return addLeadingZeros(week, token.length);
},
// ISO week of year
I: function (date, token, localize) {
const isoWeek = getISOWeek(date);
if (token === "Io") {
return localize.ordinalNumber(isoWeek, { unit: "week" });
}
return addLeadingZeros(isoWeek, token.length);
},
// Day of the month
d: function (date, token, localize) {
if (token === "do") {
return localize.ordinalNumber(date.getDate(), { unit: "date" });
}
return lightFormatters.d(date, token);
},
// Day of year
D: function (date, token, localize) {
const dayOfYear = getDayOfYear(date);
if (token === "Do") {
return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
}
return addLeadingZeros(dayOfYear, token.length);
},
// Day of week
E: function (date, token, localize) {
const dayOfWeek = date.getDay();
switch (token) {
// Tue
case "E":
case "EE":
case "EEE":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "EEEEE":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "EEEEEE":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "EEEE":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// Local day of week
e: function (date, token, localize, options) {
const dayOfWeek = date.getDay();
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
// Numerical value (Nth day of week with current locale or weekStartsOn)
case "e":
return String(localDayOfWeek);
// Padded numerical value
case "ee":
return addLeadingZeros(localDayOfWeek, 2);
// 1st, 2nd, ..., 7th
case "eo":
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
case "eee":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "eeeee":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "eeeeee":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "eeee":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// Stand-alone local day of week
c: function (date, token, localize, options) {
const dayOfWeek = date.getDay();
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
// Numerical value (same as in `e`)
case "c":
return String(localDayOfWeek);
// Padded numerical value
case "cc":
return addLeadingZeros(localDayOfWeek, token.length);
// 1st, 2nd, ..., 7th
case "co":
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
case "ccc":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "standalone",
});
// T
case "ccccc":
return localize.day(dayOfWeek, {
width: "narrow",
context: "standalone",
});
// Tu
case "cccccc":
return localize.day(dayOfWeek, {
width: "short",
context: "standalone",
});
// Tuesday
case "cccc":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "standalone",
});
}
},
// ISO day of week
i: function (date, token, localize) {
const dayOfWeek = date.getDay();
const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
switch (token) {
// 2
case "i":
return String(isoDayOfWeek);
// 02
case "ii":
return addLeadingZeros(isoDayOfWeek, token.length);
// 2nd
case "io":
return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
// Tue
case "iii":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "iiiii":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "iiiiii":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "iiii":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// AM or PM
a: function (date, token, localize) {
const hours = date.getHours();
const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
switch (token) {
case "a":
case "aa":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "aaa":
return localize
.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
})
.toLowerCase();
case "aaaaa":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "aaaa":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// AM, PM, midnight, noon
b: function (date, token, localize) {
const hours = date.getHours();
let dayPeriodEnumValue;
if (hours === 12) {
dayPeriodEnumValue = dayPeriodEnum.noon;
} else if (hours === 0) {
dayPeriodEnumValue = dayPeriodEnum.midnight;
} else {
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
}
switch (token) {
case "b":
case "bb":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "bbb":
return localize
.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
})
.toLowerCase();
case "bbbbb":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "bbbb":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// in the morning, in the afternoon, in the evening, at night
B: function (date, token, localize) {
const hours = date.getHours();
let dayPeriodEnumValue;
if (hours >= 17) {
dayPeriodEnumValue = dayPeriodEnum.evening;
} else if (hours >= 12) {
dayPeriodEnumValue = dayPeriodEnum.afternoon;
} else if (hours >= 4) {
dayPeriodEnumValue = dayPeriodEnum.morning;
} else {
dayPeriodEnumValue = dayPeriodEnum.night;
}
switch (token) {
case "B":
case "BB":
case "BBB":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "BBBBB":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "BBBB":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// Hour [1-12]
h: function (date, token, localize) {
if (token === "ho") {
let hours = date.getHours() % 12;
if (hours === 0) hours = 12;
return localize.ordinalNumber(hours, { unit: "hour" });
}
return lightFormatters.h(date, token);
},
// Hour [0-23]
H: function (date, token, localize) {
if (token === "Ho") {
return localize.ordinalNumber(date.getHours(), { unit: "hour" });
}
return lightFormatters.H(date, token);
},
// Hour [0-11]
K: function (date, token, localize) {
const hours = date.getHours() % 12;
if (token === "Ko") {
return localize.ordinalNumber(hours, { unit: "hour" });
}
return addLeadingZeros(hours, token.length);
},
// Hour [1-24]
k: function (date, token, localize) {
let hours = date.getHours();
if (hours === 0) hours = 24;
if (token === "ko") {
return localize.ordinalNumber(hours, { unit: "hour" });
}
return addLeadingZeros(hours, token.length);
},
// Minute
m: function (date, token, localize) {
if (token === "mo") {
return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
}
return lightFormatters.m(date, token);
},
// Second
s: function (date, token, localize) {
if (token === "so") {
return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
}
return lightFormatters.s(date, token);
},
// Fraction of second
S: function (date, token) {
return lightFormatters.S(date, token);
},
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
X: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
if (timezoneOffset === 0) {
return "Z";
}
switch (token) {
// Hours and optional minutes
case "X":
return formatTimezoneWithOptionalMinutes(timezoneOffset);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XX`
case "XXXX":
case "XX": // Hours and minutes without `:` delimiter
return formatTimezone(timezoneOffset);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XXX`
case "XXXXX":
case "XXX": // Hours and minutes with `:` delimiter
default:
return formatTimezone(timezoneOffset, ":");
}
},
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
x: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Hours and optional minutes
case "x":
return formatTimezoneWithOptionalMinutes(timezoneOffset);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xx`
case "xxxx":
case "xx": // Hours and minutes without `:` delimiter
return formatTimezone(timezoneOffset);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xxx`
case "xxxxx":
case "xxx": // Hours and minutes with `:` delimiter
default:
return formatTimezone(timezoneOffset, ":");
}
},
// Timezone (GMT)
O: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Short
case "O":
case "OO":
case "OOO":
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
// Long
case "OOOO":
default:
return "GMT" + formatTimezone(timezoneOffset, ":");
}
},
// Timezone (specific non-location)
z: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Short
case "z":
case "zz":
case "zzz":
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
// Long
case "zzzz":
default:
return "GMT" + formatTimezone(timezoneOffset, ":");
}
},
// Seconds timestamp
t: function (date, token, _localize) {
const timestamp = Math.trunc(date.getTime() / 1000);
return addLeadingZeros(timestamp, token.length);
},
// Milliseconds timestamp
T: function (date, token, _localize) {
const timestamp = date.getTime();
return addLeadingZeros(timestamp, token.length);
},
};
function formatTimezoneShort(offset, delimiter = "") {
const sign = offset > 0 ? "-" : "+";
const absOffset = Math.abs(offset);
const hours = Math.trunc(absOffset / 60);
const minutes = absOffset % 60;
if (minutes === 0) {
return sign + String(hours);
}
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
}
function formatTimezoneWithOptionalMinutes(offset, delimiter) {
if (offset % 60 === 0) {
const sign = offset > 0 ? "-" : "+";
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
}
return formatTimezone(offset, delimiter);
}
function formatTimezone(offset, delimiter = "") {
const sign = offset > 0 ? "-" : "+";
const absOffset = Math.abs(offset);
const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
const minutes = addLeadingZeros(absOffset % 60, 2);
return sign + hours + delimiter + minutes;
}
;// ./node_modules/date-fns/_lib/format/longFormatters.mjs
const dateLongFormatter = (pattern, formatLong) => {
switch (pattern) {
case "P":
return formatLong.date({ width: "short" });
case "PP":
return formatLong.date({ width: "medium" });
case "PPP":
return formatLong.date({ width: "long" });
case "PPPP":
default:
return formatLong.date({ width: "full" });
}
};
const timeLongFormatter = (pattern, formatLong) => {
switch (pattern) {
case "p":
return formatLong.time({ width: "short" });
case "pp":
return formatLong.time({ width: "medium" });
case "ppp":
return formatLong.time({ width: "long" });
case "pppp":
default:
return formatLong.time({ width: "full" });
}
};
const dateTimeLongFormatter = (pattern, formatLong) => {
const matchResult = pattern.match(/(P+)(p+)?/) || [];
const datePattern = matchResult[1];
const timePattern = matchResult[2];
if (!timePattern) {
return dateLongFormatter(pattern, formatLong);
}
let dateTimeFormat;
switch (datePattern) {
case "P":
dateTimeFormat = formatLong.dateTime({ width: "short" });
break;
case "PP":
dateTimeFormat = formatLong.dateTime({ width: "medium" });
break;
case "PPP":
dateTimeFormat = formatLong.dateTime({ width: "long" });
break;
case "PPPP":
default:
dateTimeFormat = formatLong.dateTime({ width: "full" });
break;
}
return dateTimeFormat
.replace("{{date}}", dateLongFormatter(datePattern, formatLong))
.replace("{{time}}", timeLongFormatter(timePattern, formatLong));
};
const longFormatters = {
p: timeLongFormatter,
P: dateTimeLongFormatter,
};
;// ./node_modules/date-fns/_lib/protectedTokens.mjs
const dayOfYearTokenRE = /^D+$/;
const weekYearTokenRE = /^Y+$/;
const throwTokens = ["D", "DD", "YY", "YYYY"];
function isProtectedDayOfYearToken(token) {
return dayOfYearTokenRE.test(token);
}
function isProtectedWeekYearToken(token) {
return weekYearTokenRE.test(token);
}
function warnOrThrowProtectedError(token, format, input) {
const _message = message(token, format, input);
console.warn(_message);
if (throwTokens.includes(token)) throw new RangeError(_message);
}
function message(token, format, input) {
const subject = token[0] === "Y" ? "years" : "days of the month";
return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
}
;// ./node_modules/date-fns/isDate.mjs
/**
* @name isDate
* @category Common Helpers
* @summary Is the given value a date?
*
* @description
* Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
*
* @param value - The value to check
*
* @returns True if the given value is a date
*
* @example
* // For a valid date:
* const result = isDate(new Date())
* //=> true
*
* @example
* // For an invalid date:
* const result = isDate(new Date(NaN))
* //=> true
*
* @example
* // For some value:
* const result = isDate('2014-02-31')
* //=> false
*
* @example
* // For an object:
* const result = isDate({})
* //=> false
*/
function isDate(value) {
return (
value instanceof Date ||
(typeof value === "object" &&
Object.prototype.toString.call(value) === "[object Date]")
);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_isDate = ((/* unused pure expression or super */ null && (isDate)));
;// ./node_modules/date-fns/isValid.mjs
/**
* @name isValid
* @category Common Helpers
* @summary Is the given date valid?
*
* @description
* Returns false if argument is Invalid Date and true otherwise.
* Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
* Invalid Date is a Date, whose time value is NaN.
*
* Time value of Date: http://es5.github.io/#x15.9.1.1
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to check
*
* @returns The date is valid
*
* @example
* // For the valid date:
* const result = isValid(new Date(2014, 1, 31))
* //=> true
*
* @example
* // For the value, convertable into a date:
* const result = isValid(1393804800000)
* //=> true
*
* @example
* // For the invalid date:
* const result = isValid(new Date(''))
* //=> false
*/
function isValid(date) {
if (!isDate(date) && typeof date !== "number") {
return false;
}
const _date = toDate(date);
return !isNaN(Number(_date));
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_isValid = ((/* unused pure expression or super */ null && (isValid)));
;// ./node_modules/date-fns/format.mjs
// Rexports of internal for libraries to use.
// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874
// This RegExp consists of three parts separated by `|`:
// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
// (one of the certain letters followed by `o`)
// - (\w)\1* matches any sequences of the same letter
// - '' matches two quote characters in a row
// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
// except a single quote symbol, which ends the sequence.
// Two quote characters do not end the sequence.
// If there is no matching single quote
// then the sequence will continue until the end of the string.
// - . matches any single character unmatched by previous parts of the RegExps
const formattingTokensRegExp =
/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
// This RegExp catches symbols escaped by quotes, and also
// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
const escapedStringRegExp = /^'([^]*?)'?$/;
const doubleQuoteRegExp = /''/g;
const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
/**
* The {@link format} function options.
*/
/**
* @name format
* @alias formatDate
* @category Common Helpers
* @summary Format the date.
*
* @description
* Return the formatted date string in the given format. The result may vary by locale.
*
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
* > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* The characters wrapped between two single quotes characters (') are escaped.
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
* (see the last example)
*
* Format of the string is based on Unicode Technical Standard #35:
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
* with a few additions (see note 7 below the table).
*
* Accepted patterns:
* | Unit | Pattern | Result examples | Notes |
* |---------------------------------|---------|-----------------------------------|-------|
* | Era | G..GGG | AD, BC | |
* | | GGGG | Anno Domini, Before Christ | 2 |
* | | GGGGG | A, B | |
* | Calendar year | y | 44, 1, 1900, 2017 | 5 |
* | | yo | 44th, 1st, 0th, 17th | 5,7 |
* | | yy | 44, 01, 00, 17 | 5 |
* | | yyy | 044, 001, 1900, 2017 | 5 |
* | | yyyy | 0044, 0001, 1900, 2017 | 5 |
* | | yyyyy | ... | 3,5 |
* | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
* | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
* | | YY | 44, 01, 00, 17 | 5,8 |
* | | YYY | 044, 001, 1900, 2017 | 5 |
* | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
* | | YYYYY | ... | 3,5 |
* | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
* | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
* | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
* | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
* | | RRRRR | ... | 3,5,7 |
* | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
* | | uu | -43, 01, 1900, 2017 | 5 |
* | | uuu | -043, 001, 1900, 2017 | 5 |
* | | uuuu | -0043, 0001, 1900, 2017 | 5 |
* | | uuuuu | ... | 3,5 |
* | Quarter (formatting) | Q | 1, 2, 3, 4 | |
* | | Qo | 1st, 2nd, 3rd, 4th | 7 |
* | | QQ | 01, 02, 03, 04 | |
* | | QQQ | Q1, Q2, Q3, Q4 | |
* | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
* | | QQQQQ | 1, 2, 3, 4 | 4 |
* | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
* | | qo | 1st, 2nd, 3rd, 4th | 7 |
* | | qq | 01, 02, 03, 04 | |
* | | qqq | Q1, Q2, Q3, Q4 | |
* | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
* | | qqqqq | 1, 2, 3, 4 | 4 |
* | Month (formatting) | M | 1, 2, ..., 12 | |
* | | Mo | 1st, 2nd, ..., 12th | 7 |
* | | MM | 01, 02, ..., 12 | |
* | | MMM | Jan, Feb, ..., Dec | |
* | | MMMM | January, February, ..., December | 2 |
* | | MMMMM | J, F, ..., D | |
* | Month (stand-alone) | L | 1, 2, ..., 12 | |
* | | Lo | 1st, 2nd, ..., 12th | 7 |
* | | LL | 01, 02, ..., 12 | |
* | | LLL | Jan, Feb, ..., Dec | |
* | | LLLL | January, February, ..., December | 2 |
* | | LLLLL | J, F, ..., D | |
* | Local week of year | w | 1, 2, ..., 53 | |
* | | wo | 1st, 2nd, ..., 53th | 7 |
* | | ww | 01, 02, ..., 53 | |
* | ISO week of year | I | 1, 2, ..., 53 | 7 |
* | | Io | 1st, 2nd, ..., 53th | 7 |
* | | II | 01, 02, ..., 53 | 7 |
* | Day of month | d | 1, 2, ..., 31 | |
* | | do | 1st, 2nd, ..., 31st | 7 |
* | | dd | 01, 02, ..., 31 | |
* | Day of year | D | 1, 2, ..., 365, 366 | 9 |
* | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
* | | DD | 01, 02, ..., 365, 366 | 9 |
* | | DDD | 001, 002, ..., 365, 366 | |
* | | DDDD | ... | 3 |
* | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
* | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
* | | EEEEE | M, T, W, T, F, S, S | |
* | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
* | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
* | | io | 1st, 2nd, ..., 7th | 7 |
* | | ii | 01, 02, ..., 07 | 7 |
* | | iii | Mon, Tue, Wed, ..., Sun | 7 |
* | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
* | | iiiii | M, T, W, T, F, S, S | 7 |
* | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
* | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
* | | eo | 2nd, 3rd, ..., 1st | 7 |
* | | ee | 02, 03, ..., 01 | |
* | | eee | Mon, Tue, Wed, ..., Sun | |
* | | eeee | Monday, Tuesday, ..., Sunday | 2 |
* | | eeeee | M, T, W, T, F, S, S | |
* | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
* | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
* | | co | 2nd, 3rd, ..., 1st | 7 |
* | | cc | 02, 03, ..., 01 | |
* | | ccc | Mon, Tue, Wed, ..., Sun | |
* | | cccc | Monday, Tuesday, ..., Sunday | 2 |
* | | ccccc | M, T, W, T, F, S, S | |
* | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
* | AM, PM | a..aa | AM, PM | |
* | | aaa | am, pm | |
* | | aaaa | a.m., p.m. | 2 |
* | | aaaaa | a, p | |
* | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
* | | bbb | am, pm, noon, midnight | |
* | | bbbb | a.m., p.m., noon, midnight | 2 |
* | | bbbbb | a, p, n, mi | |
* | Flexible day period | B..BBB | at night, in the morning, ... | |
* | | BBBB | at night, in the morning, ... | 2 |
* | | BBBBB | at night, in the morning, ... | |
* | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
* | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
* | | hh | 01, 02, ..., 11, 12 | |
* | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
* | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
* | | HH | 00, 01, 02, ..., 23 | |
* | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
* | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
* | | KK | 01, 02, ..., 11, 00 | |
* | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
* | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
* | | kk | 24, 01, 02, ..., 23 | |
* | Minute | m | 0, 1, ..., 59 | |
* | | mo | 0th, 1st, ..., 59th | 7 |
* | | mm | 00, 01, ..., 59 | |
* | Second | s | 0, 1, ..., 59 | |
* | | so | 0th, 1st, ..., 59th | 7 |
* | | ss | 00, 01, ..., 59 | |
* | Fraction of second | S | 0, 1, ..., 9 | |
* | | SS | 00, 01, ..., 99 | |
* | | SSS | 000, 001, ..., 999 | |
* | | SSSS | ... | 3 |
* | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
* | | XX | -0800, +0530, Z | |
* | | XXX | -08:00, +05:30, Z | |
* | | XXXX | -0800, +0530, Z, +123456 | 2 |
* | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
* | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
* | | xx | -0800, +0530, +0000 | |
* | | xxx | -08:00, +05:30, +00:00 | 2 |
* | | xxxx | -0800, +0530, +0000, +123456 | |
* | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
* | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
* | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
* | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
* | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
* | Seconds timestamp | t | 512969520 | 7 |
* | | tt | ... | 3,7 |
* | Milliseconds timestamp | T | 512969520900 | 7 |
* | | TT | ... | 3,7 |
* | Long localized date | P | 04/29/1453 | 7 |
* | | PP | Apr 29, 1453 | 7 |
* | | PPP | April 29th, 1453 | 7 |
* | | PPPP | Friday, April 29th, 1453 | 2,7 |
* | Long localized time | p | 12:00 AM | 7 |
* | | pp | 12:00:00 AM | 7 |
* | | ppp | 12:00:00 AM GMT+2 | 7 |
* | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
* | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
* | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
* | | PPPppp | April 29th, 1453 at ... | 7 |
* | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
* Notes:
* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
* are the same as "stand-alone" units, but are different in some languages.
* "Formatting" units are declined according to the rules of the language
* in the context of a date. "Stand-alone" units are always nominative singular:
*
* `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
*
* `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
*
* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
* the single quote characters (see below).
* If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
* the output will be the same as default pattern for this unit, usually
* the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
* are marked with "2" in the last column of the table.
*
* `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
*
* `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
*
* `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
*
* `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
*
* `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
*
* 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
* The output will be padded with zeros to match the length of the pattern.
*
* `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
*
* 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
* These tokens represent the shortest form of the quarter.
*
* 5. The main difference between `y` and `u` patterns are B.C. years:
*
* | Year | `y` | `u` |
* |------|-----|-----|
* | AC 1 | 1 | 1 |
* | BC 1 | 1 | 0 |
* | BC 2 | 2 | -1 |
*
* Also `yy` always returns the last two digits of a year,
* while `uu` pads single digit years to 2 characters and returns other years unchanged:
*
* | Year | `yy` | `uu` |
* |------|------|------|
* | 1 | 01 | 01 |
* | 14 | 14 | 14 |
* | 376 | 76 | 376 |
* | 1453 | 53 | 1453 |
*
* The same difference is true for local and ISO week-numbering years (`Y` and `R`),
* except local week-numbering years are dependent on `options.weekStartsOn`
* and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
* and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
*
* 6. Specific non-location timezones are currently unavailable in `date-fns`,
* so right now these tokens fall back to GMT timezones.
*
* 7. These patterns are not in the Unicode Technical Standard #35:
* - `i`: ISO day of week
* - `I`: ISO week of year
* - `R`: ISO week-numbering year
* - `t`: seconds timestamp
* - `T`: milliseconds timestamp
* - `o`: ordinal number modifier
* - `P`: long localized date
* - `p`: long localized time
*
* 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
* @param format - The string of tokens
* @param options - An object with options
*
* @returns The formatted date string
*
* @throws `date` must not be Invalid Date
* @throws `options.locale` must contain `localize` property
* @throws `options.locale` must contain `formatLong` property
* @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws format string contains an unescaped latin alphabet character
*
* @example
* // Represent 11 February 2014 in middle-endian format:
* const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
* //=> '02/11/2014'
*
* @example
* // Represent 2 July 2014 in Esperanto:
* import { eoLocale } from 'date-fns/locale/eo'
* const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
* locale: eoLocale
* })
* //=> '2-a de julio 2014'
*
* @example
* // Escape string by single quote characters:
* const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
* //=> "3 o'clock"
*/
function format(date, formatStr, options) {
const defaultOptions = getDefaultOptions();
const locale = options?.locale ?? defaultOptions.locale ?? enUS;
const firstWeekContainsDate =
options?.firstWeekContainsDate ??
options?.locale?.options?.firstWeekContainsDate ??
defaultOptions.firstWeekContainsDate ??
defaultOptions.locale?.options?.firstWeekContainsDate ??
1;
const weekStartsOn =
options?.weekStartsOn ??
options?.locale?.options?.weekStartsOn ??
defaultOptions.weekStartsOn ??
defaultOptions.locale?.options?.weekStartsOn ??
0;
const originalDate = toDate(date);
if (!isValid(originalDate)) {
throw new RangeError("Invalid time value");
}
let parts = formatStr
.match(longFormattingTokensRegExp)
.map((substring) => {
const firstCharacter = substring[0];
if (firstCharacter === "p" || firstCharacter === "P") {
const longFormatter = longFormatters[firstCharacter];
return longFormatter(substring, locale.formatLong);
}
return substring;
})
.join("")
.match(formattingTokensRegExp)
.map((substring) => {
// Replace two single quote characters with one single quote character
if (substring === "''") {
return { isToken: false, value: "'" };
}
const firstCharacter = substring[0];
if (firstCharacter === "'") {
return { isToken: false, value: cleanEscapedString(substring) };
}
if (formatters[firstCharacter]) {
return { isToken: true, value: substring };
}
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
throw new RangeError(
"Format string contains an unescaped latin alphabet character `" +
firstCharacter +
"`",
);
}
return { isToken: false, value: substring };
});
// invoke localize preprocessor (only for french locales at the moment)
if (locale.localize.preprocessor) {
parts = locale.localize.preprocessor(originalDate, parts);
}
const formatterOptions = {
firstWeekContainsDate,
weekStartsOn,
locale,
};
return parts
.map((part) => {
if (!part.isToken) return part.value;
const token = part.value;
if (
(!options?.useAdditionalWeekYearTokens &&
isProtectedWeekYearToken(token)) ||
(!options?.useAdditionalDayOfYearTokens &&
isProtectedDayOfYearToken(token))
) {
warnOrThrowProtectedError(token, formatStr, String(date));
}
const formatter = formatters[token[0]];
return formatter(originalDate, token, locale.localize, formatterOptions);
})
.join("");
}
function cleanEscapedString(input) {
const matched = input.match(escapedStringRegExp);
if (!matched) {
return input;
}
return matched[1].replace(doubleQuoteRegExp, "'");
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_format = ((/* unused pure expression or super */ null && (format)));
;// ./node_modules/date-fns/isSameMonth.mjs
/**
* @name isSameMonth
* @category Month Helpers
* @summary Are the given dates in the same month (and year)?
*
* @description
* Are the given dates in the same month (and year)?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param dateLeft - The first date to check
* @param dateRight - The second date to check
*
* @returns The dates are in the same month (and year)
*
* @example
* // Are 2 September 2014 and 25 September 2014 in the same month?
* const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))
* //=> true
*
* @example
* // Are 2 September 2014 and 25 September 2015 in the same month?
* const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))
* //=> false
*/
function isSameMonth(dateLeft, dateRight) {
const _dateLeft = toDate(dateLeft);
const _dateRight = toDate(dateRight);
return (
_dateLeft.getFullYear() === _dateRight.getFullYear() &&
_dateLeft.getMonth() === _dateRight.getMonth()
);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_isSameMonth = ((/* unused pure expression or super */ null && (isSameMonth)));
;// ./node_modules/date-fns/isEqual.mjs
/**
* @name isEqual
* @category Common Helpers
* @summary Are the given dates equal?
*
* @description
* Are the given dates equal?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param dateLeft - The first date to compare
* @param dateRight - The second date to compare
*
* @returns The dates are equal
*
* @example
* // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?
* const result = isEqual(
* new Date(2014, 6, 2, 6, 30, 45, 0),
* new Date(2014, 6, 2, 6, 30, 45, 500)
* )
* //=> false
*/
function isEqual(leftDate, rightDate) {
const _dateLeft = toDate(leftDate);
const _dateRight = toDate(rightDate);
return +_dateLeft === +_dateRight;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_isEqual = ((/* unused pure expression or super */ null && (isEqual)));
;// ./node_modules/date-fns/isSameDay.mjs
/**
* @name isSameDay
* @category Day Helpers
* @summary Are the given dates in the same day (and year and month)?
*
* @description
* Are the given dates in the same day (and year and month)?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param dateLeft - The first date to check
* @param dateRight - The second date to check
* @returns The dates are in the same day (and year and month)
*
* @example
* // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
* const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
* //=> true
*
* @example
* // Are 4 September and 4 October in the same day?
* const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
* //=> false
*
* @example
* // Are 4 September, 2014 and 4 September, 2015 in the same day?
* const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
* //=> false
*/
function isSameDay(dateLeft, dateRight) {
const dateLeftStartOfDay = startOfDay(dateLeft);
const dateRightStartOfDay = startOfDay(dateRight);
return +dateLeftStartOfDay === +dateRightStartOfDay;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_isSameDay = ((/* unused pure expression or super */ null && (isSameDay)));
;// ./node_modules/date-fns/addDays.mjs
/**
* @name addDays
* @category Day Helpers
* @summary Add the specified number of days to the given date.
*
* @description
* Add the specified number of days to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to be changed
* @param amount - The amount of days to be added.
*
* @returns The new date with the days added
*
* @example
* // Add 10 days to 1 September 2014:
* const result = addDays(new Date(2014, 8, 1), 10)
* //=> Thu Sep 11 2014 00:00:00
*/
function addDays(date, amount) {
const _date = toDate(date);
if (isNaN(amount)) return constructFrom(date, NaN);
if (!amount) {
// If 0 days, no-op to avoid changing times in the hour before end of DST
return _date;
}
_date.setDate(_date.getDate() + amount);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_addDays = ((/* unused pure expression or super */ null && (addDays)));
;// ./node_modules/date-fns/addWeeks.mjs
/**
* @name addWeeks
* @category Week Helpers
* @summary Add the specified number of weeks to the given date.
*
* @description
* Add the specified number of week to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to be changed
* @param amount - The amount of weeks to be added.
*
* @returns The new date with the weeks added
*
* @example
* // Add 4 weeks to 1 September 2014:
* const result = addWeeks(new Date(2014, 8, 1), 4)
* //=> Mon Sep 29 2014 00:00:00
*/
function addWeeks(date, amount) {
const days = amount * 7;
return addDays(date, days);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_addWeeks = ((/* unused pure expression or super */ null && (addWeeks)));
;// ./node_modules/date-fns/subWeeks.mjs
/**
* @name subWeeks
* @category Week Helpers
* @summary Subtract the specified number of weeks from the given date.
*
* @description
* Subtract the specified number of weeks from the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to be changed
* @param amount - The amount of weeks to be subtracted.
*
* @returns The new date with the weeks subtracted
*
* @example
* // Subtract 4 weeks from 1 September 2014:
* const result = subWeeks(new Date(2014, 8, 1), 4)
* //=> Mon Aug 04 2014 00:00:00
*/
function subWeeks(date, amount) {
return addWeeks(date, -amount);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_subWeeks = ((/* unused pure expression or super */ null && (subWeeks)));
;// ./node_modules/date-fns/endOfWeek.mjs
/**
* The {@link endOfWeek} function options.
*/
/**
* @name endOfWeek
* @category Week Helpers
* @summary Return the end of a week for the given date.
*
* @description
* Return the end of a week for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
* @param options - An object with options
*
* @returns The end of a week
*
* @example
* // The end of a week for 2 September 2014 11:55:00:
* const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))
* //=> Sat Sep 06 2014 23:59:59.999
*
* @example
* // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:
* const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
* //=> Sun Sep 07 2014 23:59:59.999
*/
function endOfWeek(date, options) {
const defaultOptions = getDefaultOptions();
const weekStartsOn =
options?.weekStartsOn ??
options?.locale?.options?.weekStartsOn ??
defaultOptions.weekStartsOn ??
defaultOptions.locale?.options?.weekStartsOn ??
0;
const _date = toDate(date);
const day = _date.getDay();
const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
_date.setDate(_date.getDate() + diff);
_date.setHours(23, 59, 59, 999);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_endOfWeek = ((/* unused pure expression or super */ null && (endOfWeek)));
;// ./node_modules/@wordpress/icons/build-module/library/arrow-right.js
var arrow_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/arrow-left.js
var arrow_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z" }) });
;// external ["wp","date"]
const external_wp_date_namespaceObject = window["wp"]["date"];
;// ./node_modules/date-fns/isAfter.mjs
/**
* @name isAfter
* @category Common Helpers
* @summary Is the first date after the second one?
*
* @description
* Is the first date after the second one?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date that should be after the other one to return true
* @param dateToCompare - The date to compare with
*
* @returns The first date is after the second date
*
* @example
* // Is 10 July 1989 after 11 February 1987?
* const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
* //=> true
*/
function isAfter(date, dateToCompare) {
const _date = toDate(date);
const _dateToCompare = toDate(dateToCompare);
return _date.getTime() > _dateToCompare.getTime();
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_isAfter = ((/* unused pure expression or super */ null && (isAfter)));
;// ./node_modules/date-fns/isBefore.mjs
/**
* @name isBefore
* @category Common Helpers
* @summary Is the first date before the second one?
*
* @description
* Is the first date before the second one?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date that should be before the other one to return true
* @param dateToCompare - The date to compare with
*
* @returns The first date is before the second date
*
* @example
* // Is 10 July 1989 before 11 February 1987?
* const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
* //=> false
*/
function isBefore(date, dateToCompare) {
const _date = toDate(date);
const _dateToCompare = toDate(dateToCompare);
return +_date < +_dateToCompare;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_isBefore = ((/* unused pure expression or super */ null && (isBefore)));
;// ./node_modules/date-fns/getDaysInMonth.mjs
/**
* @name getDaysInMonth
* @category Month Helpers
* @summary Get the number of days in a month of the given date.
*
* @description
* Get the number of days in a month of the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The given date
*
* @returns The number of days in a month
*
* @example
* // How many days are in February 2000?
* const result = getDaysInMonth(new Date(2000, 1))
* //=> 29
*/
function getDaysInMonth(date) {
const _date = toDate(date);
const year = _date.getFullYear();
const monthIndex = _date.getMonth();
const lastDayOfMonth = constructFrom(date, 0);
lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);
lastDayOfMonth.setHours(0, 0, 0, 0);
return lastDayOfMonth.getDate();
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_getDaysInMonth = ((/* unused pure expression or super */ null && (getDaysInMonth)));
;// ./node_modules/date-fns/setMonth.mjs
/**
* @name setMonth
* @category Month Helpers
* @summary Set the month to the given date.
*
* @description
* Set the month to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to be changed
* @param month - The month index to set (0-11)
*
* @returns The new date with the month set
*
* @example
* // Set February to 1 September 2014:
* const result = setMonth(new Date(2014, 8, 1), 1)
* //=> Sat Feb 01 2014 00:00:00
*/
function setMonth(date, month) {
const _date = toDate(date);
const year = _date.getFullYear();
const day = _date.getDate();
const dateWithDesiredMonth = constructFrom(date, 0);
dateWithDesiredMonth.setFullYear(year, month, 15);
dateWithDesiredMonth.setHours(0, 0, 0, 0);
const daysInMonth = getDaysInMonth(dateWithDesiredMonth);
// Set the last day of the new month
// if the original date was the last day of the longer month
_date.setMonth(month, Math.min(day, daysInMonth));
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_setMonth = ((/* unused pure expression or super */ null && (setMonth)));
;// ./node_modules/date-fns/set.mjs
/**
* @name set
* @category Common Helpers
* @summary Set date values to a given date.
*
* @description
* Set date values to a given date.
*
* Sets time values to date from object `values`.
* A value is not set if it is undefined or null or doesn't exist in `values`.
*
* Note about bundle size: `set` does not internally use `setX` functions from date-fns but instead opts
* to use native `Date#setX` methods. If you use this function, you may not want to include the
* other `setX` functions that date-fns provides if you are concerned about the bundle size.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to be changed
* @param values - The date values to be set
*
* @returns The new date with options set
*
* @example
* // Transform 1 September 2014 into 20 October 2015 in a single line:
* const result = set(new Date(2014, 8, 20), { year: 2015, month: 9, date: 20 })
* //=> Tue Oct 20 2015 00:00:00
*
* @example
* // Set 12 PM to 1 September 2014 01:23:45 to 1 September 2014 12:00:00:
* const result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 })
* //=> Mon Sep 01 2014 12:23:45
*/
function set(date, values) {
let _date = toDate(date);
// Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
if (isNaN(+_date)) {
return constructFrom(date, NaN);
}
if (values.year != null) {
_date.setFullYear(values.year);
}
if (values.month != null) {
_date = setMonth(_date, values.month);
}
if (values.date != null) {
_date.setDate(values.date);
}
if (values.hours != null) {
_date.setHours(values.hours);
}
if (values.minutes != null) {
_date.setMinutes(values.minutes);
}
if (values.seconds != null) {
_date.setSeconds(values.seconds);
}
if (values.milliseconds != null) {
_date.setMilliseconds(values.milliseconds);
}
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_set = ((/* unused pure expression or super */ null && (set)));
;// ./node_modules/date-fns/startOfToday.mjs
/**
* @name startOfToday
* @category Day Helpers
* @summary Return the start of today.
* @pure false
*
* @description
* Return the start of today.
*
* @returns The start of today
*
* @example
* // If today is 6 October 2014:
* const result = startOfToday()
* //=> Mon Oct 6 2014 00:00:00
*/
function startOfToday() {
return startOfDay(Date.now());
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfToday = ((/* unused pure expression or super */ null && (startOfToday)));
;// ./node_modules/date-fns/setYear.mjs
/**
* @name setYear
* @category Year Helpers
* @summary Set the year to the given date.
*
* @description
* Set the year to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to be changed
* @param year - The year of the new date
*
* @returns The new date with the year set
*
* @example
* // Set year 2013 to 1 September 2014:
* const result = setYear(new Date(2014, 8, 1), 2013)
* //=> Sun Sep 01 2013 00:00:00
*/
function setYear(date, year) {
const _date = toDate(date);
// Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
if (isNaN(+_date)) {
return constructFrom(date, NaN);
}
_date.setFullYear(year);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_setYear = ((/* unused pure expression or super */ null && (setYear)));
;// ./node_modules/date-fns/addYears.mjs
/**
* @name addYears
* @category Year Helpers
* @summary Add the specified number of years to the given date.
*
* @description
* Add the specified number of years to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to be changed
* @param amount - The amount of years to be added.
*
* @returns The new date with the years added
*
* @example
* // Add 5 years to 1 September 2014:
* const result = addYears(new Date(2014, 8, 1), 5)
* //=> Sun Sep 01 2019 00:00:00
*/
function addYears(date, amount) {
return addMonths(date, amount * 12);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_addYears = ((/* unused pure expression or super */ null && (addYears)));
;// ./node_modules/date-fns/subYears.mjs
/**
* @name subYears
* @category Year Helpers
* @summary Subtract the specified number of years from the given date.
*
* @description
* Subtract the specified number of years from the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to be changed
* @param amount - The amount of years to be subtracted.
*
* @returns The new date with the years subtracted
*
* @example
* // Subtract 5 years from 1 September 2014:
* const result = subYears(new Date(2014, 8, 1), 5)
* //=> Tue Sep 01 2009 00:00:00
*/
function subYears(date, amount) {
return addYears(date, -amount);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_subYears = ((/* unused pure expression or super */ null && (subYears)));
;// ./node_modules/date-fns/eachDayOfInterval.mjs
/**
* The {@link eachDayOfInterval} function options.
*/
/**
* @name eachDayOfInterval
* @category Interval Helpers
* @summary Return the array of dates within the specified time interval.
*
* @description
* Return the array of dates within the specified time interval.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param interval - The interval.
* @param options - An object with options.
*
* @returns The array with starts of days from the day of the interval start to the day of the interval end
*
* @example
* // Each day between 6 October 2014 and 10 October 2014:
* const result = eachDayOfInterval({
* start: new Date(2014, 9, 6),
* end: new Date(2014, 9, 10)
* })
* //=> [
* // Mon Oct 06 2014 00:00:00,
* // Tue Oct 07 2014 00:00:00,
* // Wed Oct 08 2014 00:00:00,
* // Thu Oct 09 2014 00:00:00,
* // Fri Oct 10 2014 00:00:00
* // ]
*/
function eachDayOfInterval(interval, options) {
const startDate = toDate(interval.start);
const endDate = toDate(interval.end);
let reversed = +startDate > +endDate;
const endTime = reversed ? +startDate : +endDate;
const currentDate = reversed ? endDate : startDate;
currentDate.setHours(0, 0, 0, 0);
let step = options?.step ?? 1;
if (!step) return [];
if (step < 0) {
step = -step;
reversed = !reversed;
}
const dates = [];
while (+currentDate <= endTime) {
dates.push(toDate(currentDate));
currentDate.setDate(currentDate.getDate() + step);
currentDate.setHours(0, 0, 0, 0);
}
return reversed ? dates.reverse() : dates;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_eachDayOfInterval = ((/* unused pure expression or super */ null && (eachDayOfInterval)));
;// ./node_modules/date-fns/eachMonthOfInterval.mjs
/**
* The {@link eachMonthOfInterval} function options.
*/
/**
* @name eachMonthOfInterval
* @category Interval Helpers
* @summary Return the array of months within the specified time interval.
*
* @description
* Return the array of months within the specified time interval.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param interval - The interval
*
* @returns The array with starts of months from the month of the interval start to the month of the interval end
*
* @example
* // Each month between 6 February 2014 and 10 August 2014:
* const result = eachMonthOfInterval({
* start: new Date(2014, 1, 6),
* end: new Date(2014, 7, 10)
* })
* //=> [
* // Sat Feb 01 2014 00:00:00,
* // Sat Mar 01 2014 00:00:00,
* // Tue Apr 01 2014 00:00:00,
* // Thu May 01 2014 00:00:00,
* // Sun Jun 01 2014 00:00:00,
* // Tue Jul 01 2014 00:00:00,
* // Fri Aug 01 2014 00:00:00
* // ]
*/
function eachMonthOfInterval(interval, options) {
const startDate = toDate(interval.start);
const endDate = toDate(interval.end);
let reversed = +startDate > +endDate;
const endTime = reversed ? +startDate : +endDate;
const currentDate = reversed ? endDate : startDate;
currentDate.setHours(0, 0, 0, 0);
currentDate.setDate(1);
let step = options?.step ?? 1;
if (!step) return [];
if (step < 0) {
step = -step;
reversed = !reversed;
}
const dates = [];
while (+currentDate <= endTime) {
dates.push(toDate(currentDate));
currentDate.setMonth(currentDate.getMonth() + step);
}
return reversed ? dates.reverse() : dates;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_eachMonthOfInterval = ((/* unused pure expression or super */ null && (eachMonthOfInterval)));
;// ./node_modules/date-fns/startOfMonth.mjs
/**
* @name startOfMonth
* @category Month Helpers
* @summary Return the start of a month for the given date.
*
* @description
* Return the start of a month for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
*
* @returns The start of a month
*
* @example
* // The start of a month for 2 September 2014 11:55:00:
* const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
* //=> Mon Sep 01 2014 00:00:00
*/
function startOfMonth(date) {
const _date = toDate(date);
_date.setDate(1);
_date.setHours(0, 0, 0, 0);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfMonth = ((/* unused pure expression or super */ null && (startOfMonth)));
;// ./node_modules/date-fns/endOfMonth.mjs
/**
* @name endOfMonth
* @category Month Helpers
* @summary Return the end of a month for the given date.
*
* @description
* Return the end of a month for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
*
* @returns The end of a month
*
* @example
* // The end of a month for 2 September 2014 11:55:00:
* const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
* //=> Tue Sep 30 2014 23:59:59.999
*/
function endOfMonth(date) {
const _date = toDate(date);
const month = _date.getMonth();
_date.setFullYear(_date.getFullYear(), month + 1, 0);
_date.setHours(23, 59, 59, 999);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_endOfMonth = ((/* unused pure expression or super */ null && (endOfMonth)));
;// ./node_modules/date-fns/eachWeekOfInterval.mjs
/**
* The {@link eachWeekOfInterval} function options.
*/
/**
* @name eachWeekOfInterval
* @category Interval Helpers
* @summary Return the array of weeks within the specified time interval.
*
* @description
* Return the array of weeks within the specified time interval.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param interval - The interval.
* @param options - An object with options.
*
* @returns The array with starts of weeks from the week of the interval start to the week of the interval end
*
* @example
* // Each week within interval 6 October 2014 - 23 November 2014:
* const result = eachWeekOfInterval({
* start: new Date(2014, 9, 6),
* end: new Date(2014, 10, 23)
* })
* //=> [
* // Sun Oct 05 2014 00:00:00,
* // Sun Oct 12 2014 00:00:00,
* // Sun Oct 19 2014 00:00:00,
* // Sun Oct 26 2014 00:00:00,
* // Sun Nov 02 2014 00:00:00,
* // Sun Nov 09 2014 00:00:00,
* // Sun Nov 16 2014 00:00:00,
* // Sun Nov 23 2014 00:00:00
* // ]
*/
function eachWeekOfInterval(interval, options) {
const startDate = toDate(interval.start);
const endDate = toDate(interval.end);
let reversed = +startDate > +endDate;
const startDateWeek = reversed
? startOfWeek(endDate, options)
: startOfWeek(startDate, options);
const endDateWeek = reversed
? startOfWeek(startDate, options)
: startOfWeek(endDate, options);
// Some timezones switch DST at midnight, making start of day unreliable in these timezones, 3pm is a safe bet
startDateWeek.setHours(15);
endDateWeek.setHours(15);
const endTime = +endDateWeek.getTime();
let currentDate = startDateWeek;
let step = options?.step ?? 1;
if (!step) return [];
if (step < 0) {
step = -step;
reversed = !reversed;
}
const dates = [];
while (+currentDate <= endTime) {
currentDate.setHours(0);
dates.push(toDate(currentDate));
currentDate = addWeeks(currentDate, step);
currentDate.setHours(15);
}
return reversed ? dates.reverse() : dates;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_eachWeekOfInterval = ((/* unused pure expression or super */ null && (eachWeekOfInterval)));
;// ./node_modules/@wordpress/components/build-module/date-time/date/use-lilius/index.js
let Month = /* @__PURE__ */ (function(Month2) {
Month2[Month2["JANUARY"] = 0] = "JANUARY";
Month2[Month2["FEBRUARY"] = 1] = "FEBRUARY";
Month2[Month2["MARCH"] = 2] = "MARCH";
Month2[Month2["APRIL"] = 3] = "APRIL";
Month2[Month2["MAY"] = 4] = "MAY";
Month2[Month2["JUNE"] = 5] = "JUNE";
Month2[Month2["JULY"] = 6] = "JULY";
Month2[Month2["AUGUST"] = 7] = "AUGUST";
Month2[Month2["SEPTEMBER"] = 8] = "SEPTEMBER";
Month2[Month2["OCTOBER"] = 9] = "OCTOBER";
Month2[Month2["NOVEMBER"] = 10] = "NOVEMBER";
Month2[Month2["DECEMBER"] = 11] = "DECEMBER";
return Month2;
})({});
let Day = /* @__PURE__ */ (function(Day2) {
Day2[Day2["SUNDAY"] = 0] = "SUNDAY";
Day2[Day2["MONDAY"] = 1] = "MONDAY";
Day2[Day2["TUESDAY"] = 2] = "TUESDAY";
Day2[Day2["WEDNESDAY"] = 3] = "WEDNESDAY";
Day2[Day2["THURSDAY"] = 4] = "THURSDAY";
Day2[Day2["FRIDAY"] = 5] = "FRIDAY";
Day2[Day2["SATURDAY"] = 6] = "SATURDAY";
return Day2;
})({});
const inRange = (date, min, max) => (isEqual(date, min) || isAfter(date, min)) && (isEqual(date, max) || isBefore(date, max));
const use_lilius_clearTime = (date) => set(date, {
hours: 0,
minutes: 0,
seconds: 0,
milliseconds: 0
});
const useLilius = ({
weekStartsOn = Day.SUNDAY,
viewing: initialViewing = /* @__PURE__ */ new Date(),
selected: initialSelected = [],
numberOfMonths = 1
} = {}) => {
const [viewing, setViewing] = (0,external_wp_element_namespaceObject.useState)(initialViewing);
const viewToday = (0,external_wp_element_namespaceObject.useCallback)(() => setViewing(startOfToday()), [setViewing]);
const viewMonth = (0,external_wp_element_namespaceObject.useCallback)((month) => setViewing((v) => setMonth(v, month)), []);
const viewPreviousMonth = (0,external_wp_element_namespaceObject.useCallback)(() => setViewing((v) => subMonths(v, 1)), []);
const viewNextMonth = (0,external_wp_element_namespaceObject.useCallback)(() => setViewing((v) => addMonths(v, 1)), []);
const viewYear = (0,external_wp_element_namespaceObject.useCallback)((year) => setViewing((v) => setYear(v, year)), []);
const viewPreviousYear = (0,external_wp_element_namespaceObject.useCallback)(() => setViewing((v) => subYears(v, 1)), []);
const viewNextYear = (0,external_wp_element_namespaceObject.useCallback)(() => setViewing((v) => addYears(v, 1)), []);
const [selected, setSelected] = (0,external_wp_element_namespaceObject.useState)(initialSelected.map(use_lilius_clearTime));
const clearSelected = () => setSelected([]);
const isSelected = (0,external_wp_element_namespaceObject.useCallback)((date) => selected.findIndex((s) => isEqual(s, date)) > -1, [selected]);
const select = (0,external_wp_element_namespaceObject.useCallback)((date, replaceExisting) => {
if (replaceExisting) {
setSelected(Array.isArray(date) ? date : [date]);
} else {
setSelected((selectedItems) => selectedItems.concat(Array.isArray(date) ? date : [date]));
}
}, []);
const deselect = (0,external_wp_element_namespaceObject.useCallback)((date) => setSelected((selectedItems) => Array.isArray(date) ? selectedItems.filter((s) => !date.map((d) => d.getTime()).includes(s.getTime())) : selectedItems.filter((s) => !isEqual(s, date))), []);
const toggle = (0,external_wp_element_namespaceObject.useCallback)((date, replaceExisting) => isSelected(date) ? deselect(date) : select(date, replaceExisting), [deselect, isSelected, select]);
const selectRange = (0,external_wp_element_namespaceObject.useCallback)((start, end, replaceExisting) => {
if (replaceExisting) {
setSelected(eachDayOfInterval({
start,
end
}));
} else {
setSelected((selectedItems) => selectedItems.concat(eachDayOfInterval({
start,
end
})));
}
}, []);
const deselectRange = (0,external_wp_element_namespaceObject.useCallback)((start, end) => {
setSelected((selectedItems) => selectedItems.filter((s) => !eachDayOfInterval({
start,
end
}).map((d) => d.getTime()).includes(s.getTime())));
}, []);
const calendar = (0,external_wp_element_namespaceObject.useMemo)(() => eachMonthOfInterval({
start: startOfMonth(viewing),
end: endOfMonth(addMonths(viewing, numberOfMonths - 1))
}).map((month) => eachWeekOfInterval({
start: startOfMonth(month),
end: endOfMonth(month)
}, {
weekStartsOn
}).map((week) => eachDayOfInterval({
start: startOfWeek(week, {
weekStartsOn
}),
end: endOfWeek(week, {
weekStartsOn
})
}))), [viewing, weekStartsOn, numberOfMonths]);
return {
clearTime: use_lilius_clearTime,
inRange,
viewing,
setViewing,
viewToday,
viewMonth,
viewPreviousMonth,
viewNextMonth,
viewYear,
viewPreviousYear,
viewNextYear,
selected,
setSelected,
clearSelected,
isSelected,
select,
deselect,
toggle,
selectRange,
deselectRange,
calendar
};
};
;// ./node_modules/@wordpress/components/build-module/date-time/date/styles.js
function date_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const styles_Wrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e105ri6r7"
} : 0)(boxSizingReset, ";" + ( true ? "" : 0));
const Navigator = /* @__PURE__ */ emotion_styled_base_browser_esm(h_stack_component_component_default, true ? {
target: "e105ri6r6"
} : 0)("column-gap:", space(2), ";display:grid;grid-template-columns:0.5fr repeat( 5, 1fr ) 0.5fr;justify-items:center;margin-bottom:", space(4), ";" + ( true ? "" : 0));
const ViewPreviousMonthButton = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
target: "e105ri6r5"
} : 0)( true ? {
name: "sarfoe",
styles: "grid-column:1/2"
} : 0);
const ViewNextMonthButton = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
target: "e105ri6r4"
} : 0)( true ? {
name: "1v98r3z",
styles: "grid-column:7/8"
} : 0);
const NavigatorHeading = /* @__PURE__ */ emotion_styled_base_browser_esm(heading_component_component_default, true ? {
target: "e105ri6r3"
} : 0)("font-size:", config_values_default.fontSize, ";font-weight:", config_values_default.fontWeight, ";grid-column:2/7;strong{font-weight:", config_values_default.fontWeightHeading, ";}" + ( true ? "" : 0));
const Calendar = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e105ri6r2"
} : 0)("column-gap:", space(2), ";display:grid;grid-template-columns:0.5fr repeat( 5, 1fr ) 0.5fr;justify-items:center;row-gap:", space(2), ";" + ( true ? "" : 0));
const DayOfWeek = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e105ri6r1"
} : 0)("color:", COLORS.theme.gray[700], ";font-size:", config_values_default.fontSize, ";line-height:", config_values_default.fontLineHeightBase, ";" + ( true ? "" : 0));
const DayButton = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
shouldForwardProp: (prop) => !["column", "isSelected", "isToday", "hasEvents"].includes(prop),
target: "e105ri6r0"
} : 0)("grid-column:", (props) => props.column, ";position:relative;justify-content:center;", (props) => props.disabled && `
pointer-events: none;
`, " &&&{border-radius:", config_values_default.radiusRound, ";height:", space(7), ";width:", space(7), ";", (props) => props.isSelected && `
background: ${COLORS.theme.accent};
&,
&:hover:not(:disabled, [aria-disabled=true]) {
color: ${COLORS.theme.accentInverted};
}
&:focus:not(:disabled),
&:focus:not(:disabled) {
border: ${config_values_default.borderWidthFocus} solid currentColor;
}
/* Highlight the selected day for high-contrast mode */
&::after {
content: '';
position: absolute;
pointer-events: none;
inset: 0;
border-radius: inherit;
border: 1px solid transparent;
}
`, " ", (props) => !props.isSelected && props.isToday && `
background: ${COLORS.theme.gray[200]};
`, ";}", (props) => props.hasEvents && `
::before {
border: 2px solid ${props.isSelected ? COLORS.theme.accentInverted : COLORS.theme.accent};
border-radius: ${config_values_default.radiusRound};
content: " ";
left: 50%;
position: absolute;
transform: translate(-50%, 9px);
}
`, ";" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/date-time/utils.js
function inputToDate(input) {
if (typeof input === "string") {
return new Date(input);
}
return toDate(input);
}
function from12hTo24h(hours, isPm) {
return isPm ? (hours % 12 + 12) % 24 : hours % 12;
}
function from24hTo12h(hours) {
return hours % 12 || 12;
}
function buildPadInputStateReducer(pad) {
return (state, action) => {
const nextState = {
...state
};
if (action.type === COMMIT || action.type === PRESS_UP || action.type === PRESS_DOWN) {
if (nextState.value !== void 0) {
nextState.value = nextState.value.toString().padStart(pad, "0");
}
}
return nextState;
};
}
function validateInputElementTarget(event) {
var _ownerDocument$defaul;
const HTMLInputElementInstance = (_ownerDocument$defaul = event.target?.ownerDocument.defaultView?.HTMLInputElement) !== null && _ownerDocument$defaul !== void 0 ? _ownerDocument$defaul : HTMLInputElement;
if (!(event.target instanceof HTMLInputElementInstance)) {
return false;
}
return event.target.validity.valid;
}
;// ./node_modules/@wordpress/components/build-module/date-time/constants.js
const TIMEZONELESS_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
;// ./node_modules/@wordpress/components/build-module/date-time/date/index.js
function DatePicker({
currentDate,
onChange,
events = [],
isInvalidDate,
onMonthPreviewed,
startOfWeek: weekStartsOn = 0
}) {
const date = currentDate ? inputToDate(currentDate) : /* @__PURE__ */ new Date();
const {
calendar,
viewing,
setSelected,
setViewing,
isSelected,
viewPreviousMonth,
viewNextMonth
} = useLilius({
selected: [startOfDay(date)],
viewing: startOfDay(date),
weekStartsOn
});
const [focusable, setFocusable] = (0,external_wp_element_namespaceObject.useState)(startOfDay(date));
const [isFocusWithinCalendar, setIsFocusWithinCalendar] = (0,external_wp_element_namespaceObject.useState)(false);
const [prevCurrentDate, setPrevCurrentDate] = (0,external_wp_element_namespaceObject.useState)(currentDate);
if (currentDate !== prevCurrentDate) {
setPrevCurrentDate(currentDate);
setSelected([startOfDay(date)]);
setViewing(startOfDay(date));
setFocusable(startOfDay(date));
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_Wrapper, {
className: "components-datetime__date",
role: "application",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Calendar"),
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Navigator, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ViewPreviousMonthButton, {
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? arrow_right_default : arrow_left_default,
variant: "tertiary",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("View previous month"),
onClick: () => {
viewPreviousMonth();
setFocusable(subMonths(focusable, 1));
onMonthPreviewed?.(format(subMonths(viewing, 1), TIMEZONELESS_FORMAT));
},
size: "compact"
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(NavigatorHeading, {
level: 3,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {
children: (0,external_wp_date_namespaceObject.dateI18n)("F", viewing, -viewing.getTimezoneOffset())
}), " ", (0,external_wp_date_namespaceObject.dateI18n)("Y", viewing, -viewing.getTimezoneOffset())]
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ViewNextMonthButton, {
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? arrow_left_default : arrow_right_default,
variant: "tertiary",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("View next month"),
onClick: () => {
viewNextMonth();
setFocusable(addMonths(focusable, 1));
onMonthPreviewed?.(format(addMonths(viewing, 1), TIMEZONELESS_FORMAT));
},
size: "compact"
})]
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Calendar, {
onFocus: () => setIsFocusWithinCalendar(true),
onBlur: () => setIsFocusWithinCalendar(false),
children: [calendar[0][0].map((day) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DayOfWeek, {
children: (0,external_wp_date_namespaceObject.dateI18n)("D", day, -day.getTimezoneOffset())
}, day.toString())), calendar[0].map((week) => week.map((day, index) => {
if (!isSameMonth(day, viewing)) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(date_Day, {
day,
column: index + 1,
isSelected: isSelected(day),
isFocusable: isEqual(day, focusable),
isFocusAllowed: isFocusWithinCalendar,
isToday: isSameDay(day, /* @__PURE__ */ new Date()),
isInvalid: isInvalidDate ? isInvalidDate(day) : false,
numEvents: events.filter((event) => isSameDay(event.date, day)).length,
onClick: () => {
setSelected([day]);
setFocusable(day);
onChange?.(format(
// Don't change the selected date's time fields.
new Date(day.getFullYear(), day.getMonth(), day.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()),
TIMEZONELESS_FORMAT
));
},
onKeyDown: (event) => {
let nextFocusable;
if (event.key === "ArrowLeft") {
nextFocusable = addDays(day, (0,external_wp_i18n_namespaceObject.isRTL)() ? 1 : -1);
}
if (event.key === "ArrowRight") {
nextFocusable = addDays(day, (0,external_wp_i18n_namespaceObject.isRTL)() ? -1 : 1);
}
if (event.key === "ArrowUp") {
nextFocusable = subWeeks(day, 1);
}
if (event.key === "ArrowDown") {
nextFocusable = addWeeks(day, 1);
}
if (event.key === "PageUp") {
nextFocusable = subMonths(day, 1);
}
if (event.key === "PageDown") {
nextFocusable = addMonths(day, 1);
}
if (event.key === "Home") {
nextFocusable = startOfWeek(day);
}
if (event.key === "End") {
nextFocusable = startOfDay(endOfWeek(day));
}
if (nextFocusable) {
event.preventDefault();
setFocusable(nextFocusable);
if (!isSameMonth(nextFocusable, viewing)) {
setViewing(nextFocusable);
onMonthPreviewed?.(format(nextFocusable, TIMEZONELESS_FORMAT));
}
}
}
}, day.toString());
}))]
})]
});
}
function date_Day({
day,
column,
isSelected,
isFocusable,
isFocusAllowed,
isToday,
isInvalid,
numEvents,
onClick,
onKeyDown
}) {
const ref = (0,external_wp_element_namespaceObject.useRef)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (ref.current && isFocusable && isFocusAllowed) {
ref.current.focus();
}
}, [isFocusable]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DayButton, {
__next40pxDefaultSize: true,
ref,
className: "components-datetime__date__day",
disabled: isInvalid,
tabIndex: isFocusable ? 0 : -1,
"aria-label": getDayLabel(day, isSelected, numEvents),
column,
isSelected,
isToday,
hasEvents: numEvents > 0,
onClick,
onKeyDown,
children: (0,external_wp_date_namespaceObject.dateI18n)("j", day, -day.getTimezoneOffset())
});
}
function getDayLabel(date, isSelected, numEvents) {
const {
formats
} = (0,external_wp_date_namespaceObject.getSettings)();
const localizedDate = (0,external_wp_date_namespaceObject.dateI18n)(formats.date, date, -date.getTimezoneOffset());
if (isSelected && numEvents > 0) {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: The calendar date. 2: Number of events on the calendar date.
(0,external_wp_i18n_namespaceObject._n)("%1$s. Selected. There is %2$d event", "%1$s. Selected. There are %2$d events", numEvents),
localizedDate,
numEvents
);
} else if (isSelected) {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: The calendar date.
(0,external_wp_i18n_namespaceObject.__)("%1$s. Selected"),
localizedDate
);
} else if (numEvents > 0) {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: The calendar date. 2: Number of events on the calendar date.
(0,external_wp_i18n_namespaceObject._n)("%1$s. There is %2$d event", "%1$s. There are %2$d events", numEvents),
localizedDate,
numEvents
);
}
return localizedDate;
}
var date_default = DatePicker;
;// ./node_modules/date-fns/startOfMinute.mjs
/**
* @name startOfMinute
* @category Minute Helpers
* @summary Return the start of a minute for the given date.
*
* @description
* Return the start of a minute for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
*
* @returns The start of a minute
*
* @example
* // The start of a minute for 1 December 2014 22:15:45.400:
* const result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))
* //=> Mon Dec 01 2014 22:15:00
*/
function startOfMinute(date) {
const _date = toDate(date);
_date.setSeconds(0, 0);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfMinute = ((/* unused pure expression or super */ null && (startOfMinute)));
;// ./node_modules/@wordpress/components/build-module/date-time/time/styles.js
function time_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const time_styles_Wrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "evcr2319"
} : 0)("box-sizing:border-box;font-size:", config_values_default.fontSize, ";" + ( true ? "" : 0));
const Fieldset = /* @__PURE__ */ emotion_styled_base_browser_esm("fieldset", true ? {
target: "evcr2318"
} : 0)("border:0;margin:0 0 ", space(2 * 2), " 0;padding:0;&:last-child{margin-bottom:0;}" + ( true ? "" : 0));
const TimeWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "evcr2317"
} : 0)( true ? {
name: "pd0mhc",
styles: "direction:ltr;display:flex"
} : 0);
const baseInput = /* @__PURE__ */ emotion_react_browser_esm_css("&&& ", Input, "{padding-left:", space(2), ";padding-right:", space(2), ";text-align:center;}" + ( true ? "" : 0), true ? "" : 0);
const HoursInput = /* @__PURE__ */ emotion_styled_base_browser_esm(number_control_default, true ? {
target: "evcr2316"
} : 0)(baseInput, " width:", space(9), ";&&& ", Input, "{padding-right:0;}&&& ", BackdropUI, "{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;}" + ( true ? "" : 0));
const TimeSeparator = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "evcr2315"
} : 0)("border-top:", config_values_default.borderWidth, " solid ", COLORS.gray[700], ";border-bottom:", config_values_default.borderWidth, " solid ", COLORS.gray[700], ";font-size:", config_values_default.fontSize, ";line-height:calc(\n ", config_values_default.controlHeight, " - ", config_values_default.borderWidth, " * 2\n );display:inline-block;" + ( true ? "" : 0));
const MinutesInput = /* @__PURE__ */ emotion_styled_base_browser_esm(number_control_default, true ? {
target: "evcr2314"
} : 0)(baseInput, " width:", space(9), ";&&& ", Input, "{padding-left:0;}&&& ", BackdropUI, "{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;}" + ( true ? "" : 0));
const MonthSelectWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "evcr2313"
} : 0)( true ? {
name: "1ff36h2",
styles: "flex-grow:1"
} : 0);
const DayInput = /* @__PURE__ */ emotion_styled_base_browser_esm(number_control_default, true ? {
target: "evcr2312"
} : 0)(baseInput, " width:", space(9), ";" + ( true ? "" : 0));
const YearInput = /* @__PURE__ */ emotion_styled_base_browser_esm(number_control_default, true ? {
target: "evcr2311"
} : 0)(baseInput, " width:", space(14), ";" + ( true ? "" : 0));
const TimeZone = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "evcr2310"
} : 0)( true ? {
name: "ebu3jh",
styles: "text-decoration:underline dotted"
} : 0);
;// ./node_modules/@wordpress/components/build-module/date-time/time/timezone.js
const timezone_TimeZone = () => {
const {
timezone
} = (0,external_wp_date_namespaceObject.getSettings)();
const userTimezoneOffset = -1 * ((/* @__PURE__ */ new Date()).getTimezoneOffset() / 60);
if (Number(timezone.offset) === userTimezoneOffset) {
return null;
}
const offsetSymbol = Number(timezone.offset) >= 0 ? "+" : "";
const zoneAbbr = "" !== timezone.abbr && isNaN(Number(timezone.abbr)) ? timezone.abbr : `UTC${offsetSymbol}${timezone.offsetFormatted}`;
const prettyTimezoneString = timezone.string.replace("_", " ");
const timezoneDetail = "UTC" === timezone.string ? (0,external_wp_i18n_namespaceObject.__)("Coordinated Universal Time") : `(${zoneAbbr}) ${prettyTimezoneString}`;
const hasNoAdditionalTimezoneDetail = prettyTimezoneString.trim().length === 0;
return hasNoAdditionalTimezoneDetail ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TimeZone, {
className: "components-datetime__timezone",
children: zoneAbbr
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip_default, {
placement: "top",
text: timezoneDetail,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TimeZone, {
className: "components-datetime__timezone",
children: zoneAbbr
})
});
};
var timezone_default = timezone_TimeZone;
;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option/component.js
function UnforwardedToggleGroupControlOption(props, ref) {
const {
label,
...restProps
} = props;
const optionLabel = restProps["aria-label"] || label;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_option_base_component_component_default, {
...restProps,
"aria-label": optionLabel,
ref,
children: label
});
}
const ToggleGroupControlOption = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlOption);
var toggle_group_control_option_component_component_default = ToggleGroupControlOption;
;// ./node_modules/@wordpress/components/build-module/date-time/time/time-input/index.js
function TimeInput({
value: valueProp,
defaultValue,
is12Hour,
label,
minutesProps,
onChange
}) {
const [value = {
hours: (/* @__PURE__ */ new Date()).getHours(),
minutes: (/* @__PURE__ */ new Date()).getMinutes()
}, setValue] = useControlledValue({
value: valueProp,
onChange,
defaultValue
});
const dayPeriod = parseDayPeriod(value.hours);
const hours12Format = from24hTo12h(value.hours);
const buildNumberControlChangeCallback = (method) => {
return (_value, {
event
}) => {
if (!validateInputElementTarget(event)) {
return;
}
const numberValue = Number(_value);
setValue({
...value,
[method]: method === "hours" && is12Hour ? from12hTo24h(numberValue, dayPeriod === "PM") : numberValue
});
};
};
const buildAmPmChangeCallback = (_value) => {
return () => {
if (dayPeriod === _value) {
return;
}
setValue({
...value,
hours: from12hTo24h(hours12Format, _value === "PM")
});
};
};
function parseDayPeriod(_hours) {
return _hours < 12 ? "AM" : "PM";
}
const Wrapper = label ? Fieldset : external_wp_element_namespaceObject.Fragment;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Wrapper, {
children: [label && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default.VisualLabel, {
as: "legend",
children: label
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
alignment: "left",
expanded: false,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(TimeWrapper, {
className: "components-datetime__time-field components-datetime__time-field-time",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HoursInput, {
className: "components-datetime__time-field-hours-input",
label: (0,external_wp_i18n_namespaceObject.__)("Hours"),
hideLabelFromVision: true,
__next40pxDefaultSize: true,
value: String(is12Hour ? hours12Format : value.hours).padStart(2, "0"),
step: 1,
min: is12Hour ? 1 : 0,
max: is12Hour ? 12 : 23,
required: true,
spinControls: "none",
isPressEnterToChange: true,
isDragEnabled: false,
isShiftStepEnabled: false,
onChange: buildNumberControlChangeCallback("hours"),
__unstableStateReducer: buildPadInputStateReducer(2)
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TimeSeparator, {
className: "components-datetime__time-separator",
"aria-hidden": "true",
children: ":"
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MinutesInput, {
className: dist_clsx(
"components-datetime__time-field-minutes-input",
// Unused, for backwards compatibility.
minutesProps?.className
),
label: (0,external_wp_i18n_namespaceObject.__)("Minutes"),
hideLabelFromVision: true,
__next40pxDefaultSize: true,
value: String(value.minutes).padStart(2, "0"),
step: 1,
min: 0,
max: 59,
required: true,
spinControls: "none",
isPressEnterToChange: true,
isDragEnabled: false,
isShiftStepEnabled: false,
onChange: (...args) => {
buildNumberControlChangeCallback("minutes")(...args);
minutesProps?.onChange?.(...args);
},
__unstableStateReducer: buildPadInputStateReducer(2),
...minutesProps
})]
}), is12Hour && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(toggle_group_control_component_component_default, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
isBlock: true,
label: (0,external_wp_i18n_namespaceObject.__)("Select AM or PM"),
hideLabelFromVision: true,
value: dayPeriod,
onChange: (newValue) => {
buildAmPmChangeCallback(newValue)();
},
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_option_component_component_default, {
value: "AM",
label: (0,external_wp_i18n_namespaceObject.__)("AM")
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_option_component_component_default, {
value: "PM",
label: (0,external_wp_i18n_namespaceObject.__)("PM")
})]
})]
})]
});
}
var time_input_default = (/* unused pure expression or super */ null && (TimeInput));
;// ./node_modules/@wordpress/components/build-module/date-time/time/index.js
const VALID_DATE_ORDERS = ["dmy", "mdy", "ymd"];
function TimePicker({
is12Hour,
currentTime,
onChange,
dateOrder: dateOrderProp,
hideLabelFromVision = false
}) {
const [date, setDate] = (0,external_wp_element_namespaceObject.useState)(() => (
// Truncate the date at the minutes, see: #15495.
currentTime ? startOfMinute(inputToDate(currentTime)) : /* @__PURE__ */ new Date()
));
(0,external_wp_element_namespaceObject.useEffect)(() => {
setDate(currentTime ? startOfMinute(inputToDate(currentTime)) : /* @__PURE__ */ new Date());
}, [currentTime]);
const monthOptions = [{
value: "01",
label: (0,external_wp_i18n_namespaceObject.__)("January")
}, {
value: "02",
label: (0,external_wp_i18n_namespaceObject.__)("February")
}, {
value: "03",
label: (0,external_wp_i18n_namespaceObject.__)("March")
}, {
value: "04",
label: (0,external_wp_i18n_namespaceObject.__)("April")
}, {
value: "05",
label: (0,external_wp_i18n_namespaceObject.__)("May")
}, {
value: "06",
label: (0,external_wp_i18n_namespaceObject.__)("June")
}, {
value: "07",
label: (0,external_wp_i18n_namespaceObject.__)("July")
}, {
value: "08",
label: (0,external_wp_i18n_namespaceObject.__)("August")
}, {
value: "09",
label: (0,external_wp_i18n_namespaceObject.__)("September")
}, {
value: "10",
label: (0,external_wp_i18n_namespaceObject.__)("October")
}, {
value: "11",
label: (0,external_wp_i18n_namespaceObject.__)("November")
}, {
value: "12",
label: (0,external_wp_i18n_namespaceObject.__)("December")
}];
const {
day,
month,
year,
minutes,
hours
} = (0,external_wp_element_namespaceObject.useMemo)(() => ({
day: format(date, "dd"),
month: format(date, "MM"),
year: format(date, "yyyy"),
minutes: format(date, "mm"),
hours: format(date, "HH"),
am: format(date, "a")
}), [date]);
const buildNumberControlChangeCallback = (method) => {
const callback = (value, {
event
}) => {
if (!validateInputElementTarget(event)) {
return;
}
const numberValue = Number(value);
const newDate = set(date, {
[method]: numberValue
});
setDate(newDate);
onChange?.(format(newDate, TIMEZONELESS_FORMAT));
};
return callback;
};
const onTimeInputChangeCallback = ({
hours: newHours,
minutes: newMinutes
}) => {
const newDate = set(date, {
hours: newHours,
minutes: newMinutes
});
setDate(newDate);
onChange?.(format(newDate, TIMEZONELESS_FORMAT));
};
const dayField = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DayInput, {
className: "components-datetime__time-field components-datetime__time-field-day",
label: (0,external_wp_i18n_namespaceObject.__)("Day"),
hideLabelFromVision: true,
__next40pxDefaultSize: true,
value: day,
step: 1,
min: 1,
max: 31,
required: true,
spinControls: "none",
isPressEnterToChange: true,
isDragEnabled: false,
isShiftStepEnabled: false,
onChange: buildNumberControlChangeCallback("date")
}, "day");
const monthField = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MonthSelectWrapper, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(select_control_default, {
className: "components-datetime__time-field components-datetime__time-field-month",
label: (0,external_wp_i18n_namespaceObject.__)("Month"),
hideLabelFromVision: true,
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
value: month,
options: monthOptions,
onChange: (value) => {
const newDate = setMonth(date, Number(value) - 1);
setDate(newDate);
onChange?.(format(newDate, TIMEZONELESS_FORMAT));
}
})
}, "month");
const yearField = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(YearInput, {
className: "components-datetime__time-field components-datetime__time-field-year",
label: (0,external_wp_i18n_namespaceObject.__)("Year"),
hideLabelFromVision: true,
__next40pxDefaultSize: true,
value: year,
step: 1,
min: 1,
max: 9999,
required: true,
spinControls: "none",
isPressEnterToChange: true,
isDragEnabled: false,
isShiftStepEnabled: false,
onChange: buildNumberControlChangeCallback("year"),
__unstableStateReducer: buildPadInputStateReducer(4)
}, "year");
const defaultDateOrder = is12Hour ? "mdy" : "dmy";
const dateOrder = dateOrderProp && VALID_DATE_ORDERS.includes(dateOrderProp) ? dateOrderProp : defaultDateOrder;
const fields = dateOrder.split("").map((field) => {
switch (field) {
case "d":
return dayField;
case "m":
return monthField;
case "y":
return yearField;
default:
return null;
}
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(time_styles_Wrapper, {
className: "components-datetime__time",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Fieldset, {
children: [hideLabelFromVision ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
as: "legend",
children: (0,external_wp_i18n_namespaceObject.__)("Time")
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default.VisualLabel, {
as: "legend",
className: "components-datetime__time-legend",
children: (0,external_wp_i18n_namespaceObject.__)("Time")
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
className: "components-datetime__time-wrapper",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TimeInput, {
value: {
hours: Number(hours),
minutes: Number(minutes)
},
is12Hour,
onChange: onTimeInputChangeCallback
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(timezone_default, {})]
})]
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Fieldset, {
children: [hideLabelFromVision ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
as: "legend",
children: (0,external_wp_i18n_namespaceObject.__)("Date")
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default.VisualLabel, {
as: "legend",
className: "components-datetime__time-legend",
children: (0,external_wp_i18n_namespaceObject.__)("Date")
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(h_stack_component_component_default, {
className: "components-datetime__time-wrapper",
children: fields
})]
})]
});
}
TimePicker.TimeInput = TimeInput;
Object.assign(TimePicker.TimeInput, {
displayName: "TimePicker.TimeInput"
});
var time_default = TimePicker;
;// ./node_modules/@wordpress/components/build-module/date-time/date-time/styles.js
function date_time_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const date_time_styles_Wrapper = /* @__PURE__ */ emotion_styled_base_browser_esm(v_stack_component_component_default, true ? {
target: "e1p5onf00"
} : 0)( true ? {
name: "1khn195",
styles: "box-sizing:border-box"
} : 0);
;// ./node_modules/@wordpress/components/build-module/date-time/date-time/index.js
const date_time_noop = () => {
};
function UnforwardedDateTimePicker({
currentDate,
is12Hour,
dateOrder,
isInvalidDate,
onMonthPreviewed = date_time_noop,
onChange,
events,
startOfWeek
}, ref) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(date_time_styles_Wrapper, {
ref,
className: "components-datetime",
spacing: 4,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(time_default, {
currentTime: currentDate,
onChange,
is12Hour,
dateOrder
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(date_default, {
currentDate,
onChange,
isInvalidDate,
events,
onMonthPreviewed,
startOfWeek
})]
})
});
}
const DateTimePicker = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedDateTimePicker);
var date_time_default = DateTimePicker;
;// ./node_modules/@wordpress/components/build-module/date-time/index.js
var date_time_date_time_default = date_time_default;
;// ./node_modules/@wordpress/components/build-module/dimension-control/sizes.js
const findSizeBySlug = (sizes, slug) => sizes.find((size) => slug === size.slug);
var sizes_default = [{
name: (0,external_wp_i18n_namespaceObject._x)("None", "Size of a UI element"),
slug: "none"
}, {
name: (0,external_wp_i18n_namespaceObject._x)("Small", "Size of a UI element"),
slug: "small"
}, {
name: (0,external_wp_i18n_namespaceObject._x)("Medium", "Size of a UI element"),
slug: "medium"
}, {
name: (0,external_wp_i18n_namespaceObject._x)("Large", "Size of a UI element"),
slug: "large"
}, {
name: (0,external_wp_i18n_namespaceObject._x)("Extra Large", "Size of a UI element"),
slug: "xlarge"
}];
;// ./node_modules/@wordpress/components/build-module/dimension-control/index.js
const dimension_control_CONTEXT_VALUE = {
BaseControl: {
// Temporary during deprecation grace period: Overrides the underlying `__associatedWPComponentName`
// via the context system to override the value set by SelectControl.
_overrides: {
__associatedWPComponentName: "DimensionControl"
}
}
};
function DimensionControl(props) {
const {
__next40pxDefaultSize = false,
__nextHasNoMarginBottom = false,
label,
value,
sizes = sizes_default,
icon,
onChange,
className = ""
} = props;
external_wp_deprecated_default()("wp.components.DimensionControl", {
since: "6.7",
version: "7.0"
});
maybeWarnDeprecated36pxSize({
componentName: "DimensionControl",
__next40pxDefaultSize,
size: void 0
});
const onChangeSpacingSize = (val) => {
const theSize = findSizeBySlug(sizes, val);
if (!theSize || value === theSize.slug) {
onChange?.(void 0);
} else if (typeof onChange === "function") {
onChange(theSize.slug);
}
};
const formatSizesAsOptions = (theSizes) => {
const options = theSizes.map(({
name,
slug
}) => ({
label: name,
value: slug
}));
return [{
label: (0,external_wp_i18n_namespaceObject.__)("Default"),
value: ""
}, ...options];
};
const selectLabel = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
icon
}), label]
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextSystemProvider, {
value: dimension_control_CONTEXT_VALUE,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(select_control_default, {
__next40pxDefaultSize,
__shouldNotWarnDeprecated36pxSize: true,
__nextHasNoMarginBottom,
className: dist_clsx(className, "block-editor-dimension-control"),
label: selectLabel,
hideLabelFromVision: false,
value,
onChange: onChangeSpacingSize,
options: formatSizesAsOptions(sizes)
})
});
}
var dimension_control_default = DimensionControl;
;// ./node_modules/@wordpress/components/build-module/disabled/styles/disabled-styles.js
function disabled_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const disabled_styles_disabledStyles = true ? {
name: "u2jump",
styles: "position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}"
} : 0;
;// ./node_modules/@wordpress/components/build-module/disabled/index.js
const Context = (0,external_wp_element_namespaceObject.createContext)(false);
Context.displayName = "DisabledContext";
const {
Consumer,
Provider: disabled_Provider
} = Context;
function Disabled({
className,
children,
isDisabled = true,
...props
}) {
const cx = useCx();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(disabled_Provider, {
value: isDisabled,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
// @ts-ignore Reason: inert is a recent HTML attribute
inert: isDisabled ? "true" : void 0,
className: isDisabled ? cx(disabled_styles_disabledStyles, className, "components-disabled") : void 0,
...props,
children
})
});
}
Disabled.Context = Context;
Disabled.Consumer = Consumer;
var disabled_default = Disabled;
;// ./node_modules/@wordpress/components/build-module/disclosure/index.js
const UnforwardedDisclosureContent = ({
visible,
children,
...props
}, ref) => {
const disclosure = useDisclosureStore({
open: visible
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DisclosureContent, {
store: disclosure,
ref,
...props,
children
});
};
const disclosure_DisclosureContent = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedDisclosureContent);
var disclosure_default = (/* unused pure expression or super */ null && (disclosure_DisclosureContent));
;// ./node_modules/@wordpress/components/build-module/draggable/index.js
const dragImageClass = "components-draggable__invisible-drag-image";
const cloneWrapperClass = "components-draggable__clone";
const clonePadding = 0;
const bodyClass = "is-dragging-components-draggable";
function Draggable({
children,
onDragStart,
onDragOver,
onDragEnd,
appendToOwnerDocument = false,
cloneClassname,
elementId,
transferData,
__experimentalTransferDataType: transferDataType = "text",
__experimentalDragComponent: dragComponent
}) {
const dragComponentRef = (0,external_wp_element_namespaceObject.useRef)(null);
const cleanupRef = (0,external_wp_element_namespaceObject.useRef)(() => {
});
function end(event) {
event.preventDefault();
cleanupRef.current();
if (onDragEnd) {
onDragEnd(event);
}
}
function start(event) {
const {
ownerDocument
} = event.target;
event.dataTransfer.setData(transferDataType, JSON.stringify(transferData));
const cloneWrapper = ownerDocument.createElement("div");
cloneWrapper.style.top = "0";
cloneWrapper.style.left = "0";
const dragImage = ownerDocument.createElement("div");
if ("function" === typeof event.dataTransfer.setDragImage) {
dragImage.classList.add(dragImageClass);
ownerDocument.body.appendChild(dragImage);
event.dataTransfer.setDragImage(dragImage, 0, 0);
}
cloneWrapper.classList.add(cloneWrapperClass);
if (cloneClassname) {
cloneWrapper.classList.add(cloneClassname);
}
let x = 0;
let y = 0;
if (dragComponentRef.current) {
x = event.clientX;
y = event.clientY;
cloneWrapper.style.transform = `translate( ${x}px, ${y}px )`;
const clonedDragComponent = ownerDocument.createElement("div");
clonedDragComponent.innerHTML = dragComponentRef.current.innerHTML;
cloneWrapper.appendChild(clonedDragComponent);
ownerDocument.body.appendChild(cloneWrapper);
} else {
const element = ownerDocument.getElementById(elementId);
const elementRect = element.getBoundingClientRect();
const elementWrapper = element.parentNode;
const elementTopOffset = elementRect.top;
const elementLeftOffset = elementRect.left;
cloneWrapper.style.width = `${elementRect.width + clonePadding * 2}px`;
const clone = element.cloneNode(true);
clone.id = `clone-${elementId}`;
x = elementLeftOffset - clonePadding;
y = elementTopOffset - clonePadding;
cloneWrapper.style.transform = `translate( ${x}px, ${y}px )`;
Array.from(clone.querySelectorAll("iframe")).forEach((child) => child.parentNode?.removeChild(child));
cloneWrapper.appendChild(clone);
if (appendToOwnerDocument) {
ownerDocument.body.appendChild(cloneWrapper);
} else {
elementWrapper?.appendChild(cloneWrapper);
}
}
let cursorLeft = event.clientX;
let cursorTop = event.clientY;
function over(e) {
if (cursorLeft === e.clientX && cursorTop === e.clientY) {
return;
}
const nextX = x + e.clientX - cursorLeft;
const nextY = y + e.clientY - cursorTop;
cloneWrapper.style.transform = `translate( ${nextX}px, ${nextY}px )`;
cursorLeft = e.clientX;
cursorTop = e.clientY;
x = nextX;
y = nextY;
if (onDragOver) {
onDragOver(e);
}
}
const throttledDragOver = (0,external_wp_compose_namespaceObject.throttle)(over, 16);
ownerDocument.addEventListener("dragover", throttledDragOver);
ownerDocument.body.classList.add(bodyClass);
if (onDragStart) {
onDragStart(event);
}
cleanupRef.current = () => {
if (cloneWrapper && cloneWrapper.parentNode) {
cloneWrapper.parentNode.removeChild(cloneWrapper);
}
if (dragImage && dragImage.parentNode) {
dragImage.parentNode.removeChild(dragImage);
}
ownerDocument.body.classList.remove(bodyClass);
ownerDocument.removeEventListener("dragover", throttledDragOver);
};
}
(0,external_wp_element_namespaceObject.useEffect)(() => () => {
cleanupRef.current();
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [children({
onDraggableStart: start,
onDraggableEnd: end
}), dragComponent && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "components-draggable-drag-component-root",
style: {
display: "none"
},
ref: dragComponentRef,
children: dragComponent
})]
});
}
var draggable_default = Draggable;
;// ./node_modules/@wordpress/icons/build-module/library/upload.js
var upload_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z" }) });
;// ./node_modules/@wordpress/components/build-module/drop-zone/index.js
function DropZoneComponent({
className,
icon = upload_default,
label,
onFilesDrop,
onHTMLDrop,
onDrop,
isEligible = () => true,
...restProps
}) {
const [isDraggingOverDocument, setIsDraggingOverDocument] = (0,external_wp_element_namespaceObject.useState)();
const [isDraggingOverElement, setIsDraggingOverElement] = (0,external_wp_element_namespaceObject.useState)();
const [isActive, setIsActive] = (0,external_wp_element_namespaceObject.useState)();
const ref = (0,external_wp_compose_namespaceObject.__experimentalUseDropZone)({
onDrop(event) {
if (!event.dataTransfer) {
return;
}
const files = (0,external_wp_dom_namespaceObject.getFilesFromDataTransfer)(event.dataTransfer);
const html = event.dataTransfer.getData("text/html");
if (html && onHTMLDrop) {
onHTMLDrop(html);
} else if (files.length && onFilesDrop) {
onFilesDrop(files);
} else if (onDrop) {
onDrop(event);
}
},
onDragStart(event) {
setIsDraggingOverDocument(true);
if (!event.dataTransfer) {
return;
}
if (event.dataTransfer.types.includes("text/html")) {
setIsActive(!!onHTMLDrop);
} else if (
// Check for the types because sometimes the files themselves
// are only available on drop.
event.dataTransfer.types.includes("Files") || (0,external_wp_dom_namespaceObject.getFilesFromDataTransfer)(event.dataTransfer).length > 0
) {
setIsActive(!!onFilesDrop);
} else {
setIsActive(!!onDrop && isEligible(event.dataTransfer));
}
},
onDragEnd() {
setIsDraggingOverElement(false);
setIsDraggingOverDocument(false);
setIsActive(void 0);
},
onDragEnter() {
setIsDraggingOverElement(true);
},
onDragLeave() {
setIsDraggingOverElement(false);
}
});
const classes = dist_clsx("components-drop-zone", className, {
"is-active": isActive,
"is-dragging-over-document": isDraggingOverDocument,
"is-dragging-over-element": isDraggingOverElement
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...restProps,
ref,
className: classes,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "components-drop-zone__content",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-drop-zone__content-inner",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
icon,
className: "components-drop-zone__content-icon"
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "components-drop-zone__content-text",
children: label ? label : (0,external_wp_i18n_namespaceObject.__)("Drop files to upload")
})]
})
})
});
}
var drop_zone_default = DropZoneComponent;
;// ./node_modules/@wordpress/components/build-module/drop-zone/provider.js
function DropZoneProvider({
children
}) {
external_wp_deprecated_default()("wp.components.DropZoneProvider", {
since: "5.8",
hint: "wp.component.DropZone no longer needs a provider. wp.components.DropZoneProvider is safe to remove from your code."
});
return children;
}
;// ./node_modules/@wordpress/icons/build-module/library/swatch.js
var swatch_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7.1 5.7 8 6.9c.4-.3.9-.6 1.5-.8l-.6-1.4c-.7.3-1.3.6-1.8 1ZM4.6 8.9l1.4.6c.2-.5.5-1 .8-1.5l-1.2-.9c-.4.6-.8 1.2-1 1.8Zm14.8 0c-.3-.7-.6-1.3-1-1.8l-1.2.9c.3.4.6.9.8 1.5l1.4-.6ZM7.1 18.3c.6.4 1.2.8 1.8 1l.6-1.4c-.5-.2-1-.5-1.5-.8l-.9 1.2ZM5.5 12v-.9h-.7l-.7-.2v2l1.5-.2v-.9Zm-.7 3h-.2c.3.7.6 1.3 1 1.9l1.2-.9c-.3-.4-.6-.9-.8-1.5l-1.2.5Zm9.7 3 .5 1.2v.2c.7-.3 1.3-.6 1.9-1l-.9-1.2c-.4.3-.9.6-1.5.8Zm-2.5.5h-.9l-.2 1.3v.2h2l-.2-1.5h-.9Zm7.9-7.5-1.5.2V13h.7l.7.2v-2ZM18 14.5c-.2.5-.5 1-.8 1.5l1.2.9c.4-.6.8-1.2 1-1.8h-.2l-1.2-.6ZM11 4.1l.2 1.5H13V4.2h-1.9ZM14.5 6c.5.2 1 .5 1.5.8l.9-1.2c-.6-.4-1.2-.8-1.8-1L14.5 6Z" }) });
;// ./node_modules/@wordpress/components/build-module/duotone-picker/color-list-picker/index.js
function ColorOption({
label,
value,
colors,
disableCustomColors,
enableAlpha,
onChange
}) {
const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)(false);
const idRoot = (0,external_wp_compose_namespaceObject.useInstanceId)(ColorOption, "color-list-picker-option");
const labelId = `${idRoot}__label`;
const contentId = `${idRoot}__content`;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
__next40pxDefaultSize: true,
className: "components-color-list-picker__swatch-button",
id: labelId,
onClick: () => setIsOpen((prev) => !prev),
"aria-expanded": isOpen,
"aria-controls": contentId,
icon: value ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(color_indicator_default, {
colorValue: value,
className: "components-color-list-picker__swatch-color"
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
icon: swatch_default
}),
text: label
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
role: "group",
id: contentId,
"aria-labelledby": labelId,
"aria-hidden": !isOpen,
children: isOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(color_palette_default, {
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Color options"),
className: "components-color-list-picker__color-picker",
colors,
value,
clearable: false,
onChange,
disableCustomColors,
enableAlpha
})
})]
});
}
function ColorListPicker({
colors,
labels,
value = [],
disableCustomColors,
enableAlpha,
onChange
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "components-color-list-picker",
children: labels.map((label, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorOption, {
label,
value: value[index],
colors,
disableCustomColors,
enableAlpha,
onChange: (newColor) => {
const newColors = value.slice();
newColors[index] = newColor;
onChange(newColors);
}
}, index))
});
}
var color_list_picker_default = ColorListPicker;
;// ./node_modules/@wordpress/components/build-module/duotone-picker/utils.js
k([names]);
function getDefaultColors(palette) {
if (!palette || palette.length < 2) {
return ["#000", "#fff"];
}
return palette.map(({
color
}) => ({
color,
brightness: w(color).brightness()
})).reduce(([min, max], current) => {
return [current.brightness <= min.brightness ? current : min, current.brightness >= max.brightness ? current : max];
}, [{
brightness: 1,
color: ""
}, {
brightness: 0,
color: ""
}]).map(({
color
}) => color);
}
function getGradientFromCSSColors(colors = [], angle = "90deg") {
const l = 100 / colors.length;
const stops = colors.map((c, i) => `${c} ${i * l}%, ${c} ${(i + 1) * l}%`).join(", ");
return `linear-gradient( ${angle}, ${stops} )`;
}
function getColorStopsFromColors(colors) {
return colors.map((color, i) => ({
position: i * 100 / (colors.length - 1),
color
}));
}
function getColorsFromColorStops(colorStops = []) {
return colorStops.map(({
color
}) => color);
}
;// ./node_modules/@wordpress/components/build-module/duotone-picker/custom-duotone-bar.js
const PLACEHOLDER_VALUES = ["#333", "#CCC"];
function CustomDuotoneBar({
value,
onChange
}) {
const hasGradient = !!value;
const values = hasGradient ? value : PLACEHOLDER_VALUES;
const background = getGradientFromCSSColors(values);
const controlPoints = getColorStopsFromColors(values);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomGradientBar, {
disableInserter: true,
background,
hasGradient,
value: controlPoints,
onChange: (newColorStops) => {
const newValue = getColorsFromColorStops(newColorStops);
onChange(newValue);
}
});
}
;// ./node_modules/@wordpress/components/build-module/duotone-picker/duotone-picker.js
function DuotonePicker({
asButtons,
loop,
clearable = true,
unsetable = true,
colorPalette,
duotonePalette,
disableCustomColors,
disableCustomDuotone,
value,
onChange,
"aria-label": ariaLabel,
"aria-labelledby": ariaLabelledby,
...otherProps
}) {
const [defaultDark, defaultLight] = (0,external_wp_element_namespaceObject.useMemo)(() => getDefaultColors(colorPalette), [colorPalette]);
const isUnset = value === "unset";
const unsetOptionLabel = (0,external_wp_i18n_namespaceObject.__)("Unset");
const unsetOption = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.Option, {
value: "unset",
isSelected: isUnset,
tooltipText: unsetOptionLabel,
"aria-label": unsetOptionLabel,
className: "components-duotone-picker__color-indicator",
onClick: () => {
onChange(isUnset ? void 0 : "unset");
}
}, "unset");
const duotoneOptions = duotonePalette.map(({
colors,
slug,
name
}) => {
const style = {
background: getGradientFromCSSColors(colors, "135deg"),
color: "transparent"
};
const tooltipText = name !== null && name !== void 0 ? name : (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: duotone code e.g: "dark-grayscale" or "7f7f7f-ffffff".
(0,external_wp_i18n_namespaceObject.__)("Duotone code: %s"),
slug
);
const label = name ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The name of the option e.g: "Dark grayscale".
(0,external_wp_i18n_namespaceObject.__)("Duotone: %s"),
name
) : tooltipText;
const isSelected = es6_default()(colors, value);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.Option, {
value: colors,
isSelected,
"aria-label": label,
tooltipText,
style,
onClick: () => {
onChange(isSelected ? void 0 : colors);
}
}, slug);
});
const {
metaProps,
labelProps
} = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby);
const options = unsetable ? [unsetOption, ...duotoneOptions] : duotoneOptions;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default, {
...otherProps,
...metaProps,
...labelProps,
options,
actions: !!clearable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.ButtonAction, {
onClick: () => onChange(void 0),
accessibleWhenDisabled: true,
disabled: !value,
children: (0,external_wp_i18n_namespaceObject.__)("Clear")
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {
paddingTop: options.length === 0 ? 0 : 4,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
spacing: 3,
children: [!disableCustomColors && !disableCustomDuotone && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomDuotoneBar, {
value: isUnset ? void 0 : value,
onChange
}), !disableCustomDuotone && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(color_list_picker_default, {
labels: [(0,external_wp_i18n_namespaceObject.__)("Shadows"), (0,external_wp_i18n_namespaceObject.__)("Highlights")],
colors: colorPalette,
value: isUnset ? void 0 : value,
disableCustomColors,
enableAlpha: true,
onChange: (newColors) => {
if (!newColors[0]) {
newColors[0] = defaultDark;
}
if (!newColors[1]) {
newColors[1] = defaultLight;
}
const newValue = newColors.length >= 2 ? newColors : void 0;
onChange(newValue);
}
})]
})
})
});
}
var duotone_picker_default = DuotonePicker;
;// ./node_modules/@wordpress/components/build-module/duotone-picker/duotone-swatch.js
function DuotoneSwatch({
values
}) {
return values ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(color_indicator_default, {
colorValue: getGradientFromCSSColors(values, "135deg")
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
icon: swatch_default
});
}
var duotone_swatch_default = DuotoneSwatch;
;// ./node_modules/@wordpress/components/build-module/external-link/index.js
function UnforwardedExternalLink(props, ref) {
const {
href,
children,
className,
rel = "",
...additionalProps
} = props;
const optimizedRel = [...new Set([...rel.split(" "), "external", "noreferrer", "noopener"].filter(Boolean))].join(" ");
const classes = dist_clsx("components-external-link", className);
const isInternalAnchor = !!href?.startsWith("#");
const onClickHandler = (event) => {
if (isInternalAnchor) {
event.preventDefault();
}
if (props.onClick) {
props.onClick(event);
}
};
return (
/* eslint-disable react/jsx-no-target-blank */
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", {
...additionalProps,
className: classes,
href,
onClick: onClickHandler,
target: "_blank",
rel: optimizedRel,
ref,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "components-external-link__contents",
children
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "components-external-link__icon",
"aria-label": (
/* translators: accessibility text */
(0,external_wp_i18n_namespaceObject.__)("(opens in a new tab)")
),
children: "\u2197"
})]
})
);
}
const ExternalLink = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedExternalLink);
var external_link_default = ExternalLink;
;// ./node_modules/@wordpress/components/build-module/focal-point-picker/utils.js
const INITIAL_BOUNDS = {
width: 200,
height: 170
};
const VIDEO_EXTENSIONS = ["avi", "mpg", "mpeg", "mov", "mp4", "m4v", "ogg", "ogv", "webm", "wmv"];
function getExtension(filename = "") {
const parts = filename.split(".");
return parts[parts.length - 1];
}
function isVideoType(filename = "") {
if (!filename) {
return false;
}
return filename.startsWith("data:video/") || VIDEO_EXTENSIONS.includes(getExtension(filename));
}
function fractionToPercentage(fraction) {
return Math.round(fraction * 100);
}
;// ./node_modules/@wordpress/components/build-module/focal-point-picker/styles/focal-point-picker-style.js
function focal_point_picker_style_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const MediaWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "eeew7dm8"
} : 0)( true ? {
name: "jqnsxy",
styles: "background-color:transparent;display:flex;text-align:center;width:100%"
} : 0);
const MediaContainer = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "eeew7dm7"
} : 0)("align-items:center;border-radius:", config_values_default.radiusSmall, ";cursor:pointer;display:inline-flex;justify-content:center;margin:auto;position:relative;height:100%;&:after{border-radius:inherit;bottom:0;box-shadow:inset 0 0 0 1px rgba( 0, 0, 0, 0.1 );content:'';left:0;pointer-events:none;position:absolute;right:0;top:0;}img,video{border-radius:inherit;box-sizing:border-box;display:block;height:auto;margin:0;max-height:100%;max-width:100%;pointer-events:none;user-select:none;width:100%;}" + ( true ? "" : 0));
const MediaPlaceholder = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "eeew7dm6"
} : 0)("background:", COLORS.gray[100], ";border-radius:inherit;box-sizing:border-box;height:", INITIAL_BOUNDS.height, "px;max-width:280px;min-width:", INITIAL_BOUNDS.width, "px;width:100%;" + ( true ? "" : 0));
const focal_point_picker_style_StyledUnitControl = /* @__PURE__ */ emotion_styled_base_browser_esm(unit_control_default, true ? {
target: "eeew7dm5"
} : 0)( true ? {
name: "1d3w5wq",
styles: "width:100%"
} : 0);
var focal_point_picker_style_ref2 = true ? {
name: "1mn7kwb",
styles: "padding-bottom:1em"
} : 0;
const deprecatedBottomMargin = ({
__nextHasNoMarginBottom
}) => {
return !__nextHasNoMarginBottom ? focal_point_picker_style_ref2 : void 0;
};
var focal_point_picker_style_ref = true ? {
name: "1mn7kwb",
styles: "padding-bottom:1em"
} : 0;
const extraHelpTextMargin = ({
hasHelpText = false
}) => {
return hasHelpText ? focal_point_picker_style_ref : void 0;
};
const ControlWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm(flex_component_component_default, true ? {
target: "eeew7dm4"
} : 0)("max-width:320px;padding-top:1em;", extraHelpTextMargin, " ", deprecatedBottomMargin, ";" + ( true ? "" : 0));
const GridView = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "eeew7dm3"
} : 0)("left:50%;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate3d( -50%, -50%, 0 );z-index:1;@media not ( prefers-reduced-motion ){transition:opacity 100ms linear;}opacity:", ({
showOverlay
}) => showOverlay ? 1 : 0, ";" + ( true ? "" : 0));
const GridLine = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "eeew7dm2"
} : 0)( true ? {
name: "1yzbo24",
styles: "background:rgba( 255, 255, 255, 0.4 );backdrop-filter:blur( 16px ) saturate( 180% );position:absolute;transform:translateZ( 0 )"
} : 0);
const GridLineX = /* @__PURE__ */ emotion_styled_base_browser_esm(GridLine, true ? {
target: "eeew7dm1"
} : 0)( true ? {
name: "1sw8ur",
styles: "height:1px;left:1px;right:1px"
} : 0);
const GridLineY = /* @__PURE__ */ emotion_styled_base_browser_esm(GridLine, true ? {
target: "eeew7dm0"
} : 0)( true ? {
name: "188vg4t",
styles: "width:1px;top:1px;bottom:1px"
} : 0);
;// ./node_modules/@wordpress/components/build-module/focal-point-picker/controls.js
const TEXTCONTROL_MIN = 0;
const TEXTCONTROL_MAX = 100;
const controls_noop = () => {
};
function FocalPointPickerControls({
__nextHasNoMarginBottom,
hasHelpText,
onChange = controls_noop,
point = {
x: 0.5,
y: 0.5
}
}) {
const valueX = fractionToPercentage(point.x);
const valueY = fractionToPercentage(point.y);
const handleChange = (value, axis) => {
if (value === void 0) {
return;
}
const num = parseInt(value, 10);
if (!isNaN(num)) {
onChange({
...point,
[axis]: num / 100
});
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ControlWrapper, {
className: "focal-point-picker__controls",
__nextHasNoMarginBottom,
hasHelpText,
gap: 4,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FocalPointUnitControl, {
label: (0,external_wp_i18n_namespaceObject.__)("Left"),
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Focal point left position"),
value: [valueX, "%"].join(""),
onChange: (next) => handleChange(next, "x"),
dragDirection: "e"
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FocalPointUnitControl, {
label: (0,external_wp_i18n_namespaceObject.__)("Top"),
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Focal point top position"),
value: [valueY, "%"].join(""),
onChange: (next) => handleChange(next, "y"),
dragDirection: "s"
})]
});
}
function FocalPointUnitControl(props) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(focal_point_picker_style_StyledUnitControl, {
__next40pxDefaultSize: true,
className: "focal-point-picker__controls-position-unit-control",
labelPosition: "top",
max: TEXTCONTROL_MAX,
min: TEXTCONTROL_MIN,
units: [{
value: "%",
label: "%"
}],
...props
});
}
;// ./node_modules/@wordpress/components/build-module/focal-point-picker/styles/focal-point-style.js
const PointerCircle = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e19snlhg0"
} : 0)("background-color:transparent;cursor:grab;height:40px;margin:-20px 0 0 -20px;position:absolute;user-select:none;width:40px;will-change:transform;z-index:10000;background:rgba( 255, 255, 255, 0.4 );border:1px solid rgba( 255, 255, 255, 0.4 );border-radius:", config_values_default.radiusRound, ";backdrop-filter:blur( 16px ) saturate( 180% );box-shadow:rgb( 0 0 0 / 10% ) 0px 0px 8px;@media not ( prefers-reduced-motion ){transition:transform 100ms linear;}", ({
isDragging
}) => isDragging && `
box-shadow: rgb( 0 0 0 / 12% ) 0px 0px 10px;
transform: scale( 1.1 );
cursor: grabbing;
`, ";" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/focal-point-picker/focal-point.js
function FocalPoint({
left = "50%",
top = "50%",
...props
}) {
const style = {
left,
top
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PointerCircle, {
...props,
className: "components-focal-point-picker__icon_container",
style
});
}
;// ./node_modules/@wordpress/components/build-module/focal-point-picker/grid.js
function FocalPointPickerGrid({
bounds,
...props
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(GridView, {
...props,
className: "components-focal-point-picker__grid",
style: {
width: bounds.width,
height: bounds.height
},
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GridLineX, {
style: {
top: "33%"
}
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GridLineX, {
style: {
top: "66%"
}
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GridLineY, {
style: {
left: "33%"
}
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GridLineY, {
style: {
left: "66%"
}
})]
});
}
;// ./node_modules/@wordpress/components/build-module/focal-point-picker/media.js
function media_Media({
alt,
autoPlay,
src,
onLoad,
mediaRef,
// Exposing muted prop for test rendering purposes
// https://github.com/testing-library/react-testing-library/issues/470
muted = true,
...props
}) {
if (!src) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MediaPlaceholder, {
className: "components-focal-point-picker__media components-focal-point-picker__media--placeholder",
ref: mediaRef,
...props
});
}
const isVideo = isVideoType(src);
return isVideo ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("video", {
...props,
autoPlay,
className: "components-focal-point-picker__media components-focal-point-picker__media--video",
loop: true,
muted,
onLoadedData: onLoad,
ref: mediaRef,
src
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
...props,
alt,
className: "components-focal-point-picker__media components-focal-point-picker__media--image",
onLoad,
ref: mediaRef,
src
});
}
;// ./node_modules/@wordpress/components/build-module/focal-point-picker/index.js
const GRID_OVERLAY_TIMEOUT = 600;
function FocalPointPicker({
__nextHasNoMarginBottom,
autoPlay = true,
className,
help,
label,
onChange,
onDrag,
onDragEnd,
onDragStart,
resolvePoint,
url,
value: valueProp = {
x: 0.5,
y: 0.5
},
...restProps
}) {
const [point, setPoint] = (0,external_wp_element_namespaceObject.useState)(valueProp);
const [showGridOverlay, setShowGridOverlay] = (0,external_wp_element_namespaceObject.useState)(false);
const {
startDrag,
endDrag,
isDragging
} = (0,external_wp_compose_namespaceObject.__experimentalUseDragging)({
onDragStart: (event) => {
dragAreaRef.current?.focus();
const value = getValueWithinDragArea(event);
if (!value) {
return;
}
onDragStart?.(value, event);
setPoint(value);
},
onDragMove: (event) => {
event.preventDefault();
const value = getValueWithinDragArea(event);
if (!value) {
return;
}
onDrag?.(value, event);
setPoint(value);
},
onDragEnd: () => {
onDragEnd?.();
onChange?.(point);
}
});
const {
x,
y
} = isDragging ? point : valueProp;
const dragAreaRef = (0,external_wp_element_namespaceObject.useRef)(null);
const [bounds, setBounds] = (0,external_wp_element_namespaceObject.useState)(INITIAL_BOUNDS);
const refUpdateBounds = (0,external_wp_element_namespaceObject.useRef)(() => {
if (!dragAreaRef.current) {
return;
}
const {
clientWidth: width,
clientHeight: height
} = dragAreaRef.current;
setBounds(width > 0 && height > 0 ? {
width,
height
} : {
...INITIAL_BOUNDS
});
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
const updateBounds = refUpdateBounds.current;
if (!dragAreaRef.current) {
return;
}
const {
defaultView
} = dragAreaRef.current.ownerDocument;
defaultView?.addEventListener("resize", updateBounds);
return () => defaultView?.removeEventListener("resize", updateBounds);
}, []);
(0,external_wp_compose_namespaceObject.useIsomorphicLayoutEffect)(() => void refUpdateBounds.current(), []);
const getValueWithinDragArea = ({
clientX,
clientY,
shiftKey
}) => {
if (!dragAreaRef.current) {
return;
}
const {
top,
left
} = dragAreaRef.current.getBoundingClientRect();
let nextX = (clientX - left) / bounds.width;
let nextY = (clientY - top) / bounds.height;
if (shiftKey) {
nextX = Math.round(nextX / 0.1) * 0.1;
nextY = Math.round(nextY / 0.1) * 0.1;
}
return getFinalValue({
x: nextX,
y: nextY
});
};
const getFinalValue = (value) => {
var _resolvePoint;
const resolvedValue = (_resolvePoint = resolvePoint?.(value)) !== null && _resolvePoint !== void 0 ? _resolvePoint : value;
resolvedValue.x = Math.max(0, Math.min(resolvedValue.x, 1));
resolvedValue.y = Math.max(0, Math.min(resolvedValue.y, 1));
const roundToTwoDecimalPlaces = (n) => Math.round(n * 100) / 100;
return {
x: roundToTwoDecimalPlaces(resolvedValue.x),
y: roundToTwoDecimalPlaces(resolvedValue.y)
};
};
const arrowKeyStep = (event) => {
const {
code,
shiftKey
} = event;
if (!["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(code)) {
return;
}
event.preventDefault();
const value = {
x,
y
};
const step = shiftKey ? 0.1 : 0.01;
const delta = code === "ArrowUp" || code === "ArrowLeft" ? -1 * step : step;
const axis = code === "ArrowUp" || code === "ArrowDown" ? "y" : "x";
value[axis] = value[axis] + delta;
onChange?.(getFinalValue(value));
};
const focalPointPosition = {
left: x !== void 0 ? x * bounds.width : 0.5 * bounds.width,
top: y !== void 0 ? y * bounds.height : 0.5 * bounds.height
};
const classes = dist_clsx("components-focal-point-picker-control", className);
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(FocalPointPicker);
const id = `inspector-focal-point-picker-control-${instanceId}`;
use_update_effect_default(() => {
setShowGridOverlay(true);
const timeout = window.setTimeout(() => {
setShowGridOverlay(false);
}, GRID_OVERLAY_TIMEOUT);
return () => window.clearTimeout(timeout);
}, [x, y]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(base_control_default, {
...restProps,
__nextHasNoMarginBottom,
__associatedWPComponentName: "FocalPointPicker",
label,
id,
help,
className: classes,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MediaWrapper, {
className: "components-focal-point-picker-wrapper",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(MediaContainer, {
className: "components-focal-point-picker",
onKeyDown: arrowKeyStep,
onMouseDown: startDrag,
onBlur: () => {
if (isDragging) {
endDrag();
}
},
ref: dragAreaRef,
role: "button",
tabIndex: -1,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FocalPointPickerGrid, {
bounds,
showOverlay: showGridOverlay
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(media_Media, {
alt: (0,external_wp_i18n_namespaceObject.__)("Media preview"),
autoPlay,
onLoad: refUpdateBounds.current,
src: url
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FocalPoint, {
...focalPointPosition,
isDragging
})]
})
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FocalPointPickerControls, {
__nextHasNoMarginBottom,
hasHelpText: !!help,
point: {
x,
y
},
onChange: (value) => {
onChange?.(getFinalValue(value));
}
})]
});
}
var focal_point_picker_default = FocalPointPicker;
;// ./node_modules/@wordpress/components/build-module/focusable-iframe/index.js
function FocusableIframe({
iframeRef,
...props
}) {
const ref = (0,external_wp_compose_namespaceObject.useMergeRefs)([iframeRef, (0,external_wp_compose_namespaceObject.useFocusableIframe)()]);
external_wp_deprecated_default()("wp.components.FocusableIframe", {
since: "5.9",
alternative: "wp.compose.useFocusableIframe"
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("iframe", {
ref,
...props
});
}
;// ./node_modules/@wordpress/components/build-module/font-size-picker/styles.js
function font_size_picker_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const styles_Container = /* @__PURE__ */ emotion_styled_base_browser_esm("fieldset", true ? {
target: "e8tqeku4"
} : 0)( true ? {
name: "k2q51s",
styles: "border:0;margin:0;padding:0;display:contents"
} : 0);
const styles_Header = /* @__PURE__ */ emotion_styled_base_browser_esm(h_stack_component_component_default, true ? {
target: "e8tqeku3"
} : 0)("height:", space(4), ";" + ( true ? "" : 0));
const HeaderToggle = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
target: "e8tqeku2"
} : 0)("margin-top:", space(-1), ";" + ( true ? "" : 0));
const HeaderLabel = /* @__PURE__ */ emotion_styled_base_browser_esm(base_control_default.VisualLabel, true ? {
target: "e8tqeku1"
} : 0)("display:flex;gap:", space(1), ";justify-content:flex-start;margin-bottom:0;" + ( true ? "" : 0));
const StyledCustomSelectControl = /* @__PURE__ */ emotion_styled_base_browser_esm(custom_select_control_default, true ? {
target: "e8tqeku0"
} : 0)( true ? {
name: "anvx77",
styles: ".components-custom-select-control__item .components-custom-select-control__item-hint{width:100%;}"
} : 0);
;// ./node_modules/@wordpress/components/build-module/font-size-picker/utils.js
function isSimpleCssValue(value) {
const sizeRegex = /^[\d\.]+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i;
return sizeRegex.test(String(value));
}
function generateFontSizeHint(fontSize) {
if (fontSize.hint) {
return fontSize.hint;
}
if (isSimpleCssValue(fontSize.size)) {
return String(fontSize.size);
}
return void 0;
}
;// ./node_modules/@wordpress/components/build-module/font-size-picker/font-size-picker-select.js
const DEFAULT_OPTION = {
key: "default",
name: (0,external_wp_i18n_namespaceObject.__)("Default"),
value: void 0
};
const FontSizePickerSelect = (props) => {
const {
__next40pxDefaultSize,
fontSizes,
value,
size,
valueMode = "literal",
onChange
} = props;
const options = [DEFAULT_OPTION, ...fontSizes.map((fontSize) => {
const hint = generateFontSizeHint(fontSize);
return {
key: fontSize.slug,
name: fontSize.name || fontSize.slug,
value: fontSize.size,
hint
};
})];
const selectedOption = (0,external_wp_element_namespaceObject.useMemo)(() => {
var _options$find;
if (value === void 0) {
return DEFAULT_OPTION;
}
if (valueMode === "slug") {
const optionBySlug = options.find((option) => option.key === value);
if (optionBySlug) {
return optionBySlug;
}
}
return (_options$find = options.find((option) => option.value === value)) !== null && _options$find !== void 0 ? _options$find : DEFAULT_OPTION;
}, [value, valueMode, options]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledCustomSelectControl, {
__next40pxDefaultSize,
__shouldNotWarnDeprecated36pxSize: true,
className: "components-font-size-picker__select",
label: (0,external_wp_i18n_namespaceObject.__)("Font size"),
hideLabelFromVision: true,
describedBy: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Currently selected font size.
(0,external_wp_i18n_namespaceObject.__)("Currently selected font size: %s"),
selectedOption.name
),
options,
value: selectedOption,
showSelectedHint: true,
onChange: ({
selectedItem
}) => {
const matchingFontSize = selectedItem.key === "default" ? void 0 : fontSizes.find((fontSize) => fontSize.slug === selectedItem.key);
onChange(selectedItem.value, matchingFontSize);
},
size
});
};
var font_size_picker_select_default = FontSizePickerSelect;
;// ./node_modules/@wordpress/components/build-module/font-size-picker/constants.js
const T_SHIRT_ABBREVIATIONS = [
/* translators: S stands for 'small' and is a size label. */
(0,external_wp_i18n_namespaceObject.__)("S"),
/* translators: M stands for 'medium' and is a size label. */
(0,external_wp_i18n_namespaceObject.__)("M"),
/* translators: L stands for 'large' and is a size label. */
(0,external_wp_i18n_namespaceObject.__)("L"),
/* translators: XL stands for 'extra large' and is a size label. */
(0,external_wp_i18n_namespaceObject.__)("XL"),
/* translators: XXL stands for 'extra extra large' and is a size label. */
(0,external_wp_i18n_namespaceObject.__)("XXL")
];
const T_SHIRT_NAMES = [(0,external_wp_i18n_namespaceObject.__)("Small"), (0,external_wp_i18n_namespaceObject.__)("Medium"), (0,external_wp_i18n_namespaceObject.__)("Large"), (0,external_wp_i18n_namespaceObject.__)("Extra Large"), (0,external_wp_i18n_namespaceObject.__)("Extra Extra Large")];
;// ./node_modules/@wordpress/components/build-module/font-size-picker/font-size-picker-toggle-group.js
const FontSizePickerToggleGroup = (props) => {
const {
fontSizes,
value,
valueMode = "literal",
__next40pxDefaultSize,
size,
onChange
} = props;
const currentValue = (() => {
if (!value) {
return void 0;
}
if (valueMode === "slug") {
return String(value);
}
const matchingFontSizes = fontSizes.filter((fontSize) => fontSize.size === value);
if (matchingFontSizes.length > 1) {
return void 0;
}
const fontSizeBySize = fontSizes.find((fontSize) => fontSize.size === value);
return fontSizeBySize?.slug;
})();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_component_component_default, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize,
__shouldNotWarnDeprecated36pxSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Font size"),
hideLabelFromVision: true,
value: currentValue,
onChange: (newSlug) => {
if (newSlug === void 0) {
onChange(void 0);
} else {
const selectedFontSize = fontSizes.find((fontSize) => fontSize.slug === String(newSlug));
if (selectedFontSize) {
onChange(selectedFontSize.size, selectedFontSize);
}
}
},
isBlock: true,
size,
children: fontSizes.map((fontSize, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_option_component_component_default, {
value: fontSize.slug,
label: T_SHIRT_ABBREVIATIONS[index],
"aria-label": fontSize.name || T_SHIRT_NAMES[index],
showTooltip: true
}, fontSize.slug))
});
};
var font_size_picker_toggle_group_default = FontSizePickerToggleGroup;
;// ./node_modules/@wordpress/components/build-module/font-size-picker/index.js
const DEFAULT_UNITS = ["px", "em", "rem", "vw", "vh"];
const MAX_TOGGLE_GROUP_SIZES = 5;
const UnforwardedFontSizePicker = (props, ref) => {
const {
__next40pxDefaultSize = false,
fallbackFontSize,
fontSizes = [],
disableCustomFontSizes = false,
onChange,
size = "default",
units: unitsProp = DEFAULT_UNITS,
value,
valueMode = "literal",
withSlider = false,
withReset = true
} = props;
const labelId = (0,external_wp_compose_namespaceObject.useInstanceId)(UnforwardedFontSizePicker, "font-size-picker-label");
const units = useCustomUnits({
availableUnits: unitsProp
});
const selectedFontSize = (() => {
if (!value) {
return void 0;
}
if (valueMode === "slug") {
return fontSizes.find((fontSize) => fontSize.slug === value);
}
return fontSizes.find((fontSize) => fontSize.size === value);
})();
const isCustomValue = !!value && !selectedFontSize;
const [userRequestedCustom, setUserRequestedCustom] = (0,external_wp_element_namespaceObject.useState)(isCustomValue);
const resolvedValueForControls = valueMode === "slug" ? selectedFontSize?.size : value;
let currentPickerType;
if (!disableCustomFontSizes && userRequestedCustom) {
currentPickerType = "custom";
} else {
currentPickerType = fontSizes.length > MAX_TOGGLE_GROUP_SIZES ? "select" : "togglegroup";
}
if (fontSizes.length === 0 && disableCustomFontSizes) {
return null;
}
const hasUnits = typeof resolvedValueForControls === "string" || typeof fontSizes[0]?.size === "string";
const [valueQuantity, valueUnit] = parseQuantityAndUnitFromRawValue(resolvedValueForControls, units);
const isValueUnitRelative = !!valueUnit && ["em", "rem", "vw", "vh"].includes(valueUnit);
const isDisabled = value === void 0;
maybeWarnDeprecated36pxSize({
componentName: "FontSizePicker",
__next40pxDefaultSize,
size
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_Container, {
ref,
className: "components-font-size-picker",
"aria-labelledby": labelId,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_Header, {
className: "components-font-size-picker__header",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HeaderLabel, {
id: labelId,
children: (0,external_wp_i18n_namespaceObject.__)("Font size")
}), !disableCustomFontSizes && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HeaderToggle, {
label: currentPickerType === "custom" ? (0,external_wp_i18n_namespaceObject.__)("Use size preset") : (0,external_wp_i18n_namespaceObject.__)("Set custom size"),
icon: settings_default,
onClick: () => setUserRequestedCustom(!userRequestedCustom),
isPressed: currentPickerType === "custom",
size: "small"
})]
})
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
children: [currentPickerType === "select" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(font_size_picker_select_default, {
__next40pxDefaultSize,
fontSizes,
value,
valueMode,
disableCustomFontSizes,
size,
onChange: (newValue, selectedItem) => {
if (newValue === void 0) {
onChange?.(void 0, selectedItem);
} else {
onChange?.(hasUnits ? newValue : Number(newValue), selectedItem);
}
},
onSelectCustom: () => setUserRequestedCustom(true)
}), currentPickerType === "togglegroup" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(font_size_picker_toggle_group_default, {
fontSizes,
value,
valueMode,
__next40pxDefaultSize,
size,
onChange: (newValue, selectedItem) => {
if (newValue === void 0) {
onChange?.(void 0, selectedItem);
} else {
onChange?.(hasUnits ? newValue : Number(newValue), selectedItem);
}
}
}), currentPickerType === "custom" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(flex_component_component_default, {
className: "components-font-size-picker__custom-size-control",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_item_component_component_default, {
isBlock: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(unit_control_default, {
__next40pxDefaultSize,
__shouldNotWarnDeprecated36pxSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Font size"),
labelPosition: "top",
hideLabelFromVision: true,
value: hasUnits ? `${valueQuantity !== null && valueQuantity !== void 0 ? valueQuantity : ""}${valueUnit !== null && valueUnit !== void 0 ? valueUnit : ""}` : resolvedValueForControls,
onChange: (newValue) => {
setUserRequestedCustom(true);
if (newValue === void 0 || newValue === "") {
onChange?.(void 0);
} else {
onChange?.(hasUnits ? newValue : parseInt(newValue, 10));
}
},
size,
units: hasUnits ? units : [],
min: 0
})
}), withSlider && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_item_component_component_default, {
isBlock: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {
marginX: 2,
marginBottom: 0,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(range_control_default, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize,
__shouldNotWarnDeprecated36pxSize: true,
className: "components-font-size-picker__custom-input",
label: (0,external_wp_i18n_namespaceObject.__)("Font size"),
hideLabelFromVision: true,
value: valueQuantity,
initialPosition: fallbackFontSize,
withInputField: false,
onChange: (newValue) => {
setUserRequestedCustom(true);
if (newValue === void 0) {
onChange?.(void 0);
} else if (hasUnits) {
onChange?.(newValue + (valueUnit !== null && valueUnit !== void 0 ? valueUnit : "px"));
} else {
onChange?.(newValue);
}
},
min: 0,
max: isValueUnitRelative ? 10 : 100,
step: isValueUnitRelative ? 0.1 : 1
})
})
}), withReset && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_item_component_component_default, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Button, {
disabled: isDisabled,
accessibleWhenDisabled: true,
onClick: () => {
onChange?.(void 0);
},
variant: "secondary",
__next40pxDefaultSize: true,
size: size === "__unstable-large" || props.__next40pxDefaultSize ? "default" : "small",
children: (0,external_wp_i18n_namespaceObject.__)("Reset")
})
})]
})]
})]
});
};
const FontSizePicker = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedFontSizePicker);
var font_size_picker_default = FontSizePicker;
;// ./node_modules/@wordpress/components/build-module/form-file-upload/index.js
function FormFileUpload({
accept,
children,
multiple = false,
onChange,
onClick,
render,
...props
}) {
const ref = (0,external_wp_element_namespaceObject.useRef)(null);
const openFileDialog = () => {
ref.current?.click();
};
if (!render) {
maybeWarnDeprecated36pxSize({
componentName: "FormFileUpload",
__next40pxDefaultSize: props.__next40pxDefaultSize,
// @ts-expect-error - We don't "officially" support all Button props but this likely happens.
size: props.size
});
}
const ui = render ? render({
openFileDialog
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
onClick: openFileDialog,
...props,
children
});
const compatAccept = accept?.includes("audio/*") ? `${accept}, audio/mp3, audio/x-m4a, audio/x-m4b, audio/x-m4p, audio/x-wav, audio/webm` : accept;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-form-file-upload",
children: [ui, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
type: "file",
ref,
multiple,
style: {
display: "none"
},
accept: compatAccept,
onChange,
onClick,
"data-testid": "form-file-upload-input"
})]
});
}
var form_file_upload_default = FormFileUpload;
;// ./node_modules/@wordpress/components/build-module/form-toggle/index.js
const form_toggle_noop = () => {
};
function UnforwardedFormToggle(props, ref) {
const {
className,
checked,
id,
disabled,
onChange = form_toggle_noop,
onClick,
...additionalProps
} = props;
const wrapperClasses = dist_clsx("components-form-toggle", className, {
"is-checked": checked,
"is-disabled": disabled
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
className: wrapperClasses,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
className: "components-form-toggle__input",
id,
type: "checkbox",
checked,
onChange,
disabled,
onClick: (event) => {
event.currentTarget.focus();
onClick?.(event);
},
...additionalProps,
ref
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "components-form-toggle__track"
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "components-form-toggle__thumb"
})]
});
}
const FormToggle = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedFormToggle);
var form_toggle_default = FormToggle;
;// ./node_modules/@wordpress/components/build-module/form-token-field/token.js
const token_noop = () => {
};
function Token({
value,
status,
title,
displayTransform,
isBorderless = false,
disabled = false,
onClickRemove = token_noop,
onMouseEnter,
onMouseLeave,
messages,
termPosition,
termsCount
}) {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(Token);
const tokenClasses = dist_clsx("components-form-token-field__token", {
"is-error": "error" === status,
"is-success": "success" === status,
"is-validating": "validating" === status,
"is-borderless": isBorderless,
"is-disabled": disabled
});
const onClick = () => onClickRemove({
value
});
const transformedValue = displayTransform(value);
const termPositionAndCount = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: term name, 2: term position in a set of terms, 3: total term set count. */
(0,external_wp_i18n_namespaceObject.__)("%1$s (%2$d of %3$d)"),
transformedValue,
termPosition,
termsCount
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
className: tokenClasses,
onMouseEnter,
onMouseLeave,
title,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
className: "components-form-token-field__token-text",
id: `components-form-token-field__token-text-${instanceId}`,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
as: "span",
children: termPositionAndCount
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
"aria-hidden": "true",
children: transformedValue
})]
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
className: "components-form-token-field__remove-token",
size: "small",
icon: close_small_default,
onClick: !disabled ? onClick : void 0,
disabled,
label: messages.remove,
"aria-describedby": `components-form-token-field__token-text-${instanceId}`
})]
});
}
;// ./node_modules/@wordpress/components/build-module/form-token-field/styles.js
const deprecatedPaddings = ({
__next40pxDefaultSize,
hasTokens
}) => !__next40pxDefaultSize && /* @__PURE__ */ emotion_react_browser_esm_css("padding-top:", space(hasTokens ? 1 : 0.5), ";padding-bottom:", space(hasTokens ? 1 : 0.5), ";" + ( true ? "" : 0), true ? "" : 0);
const TokensAndInputWrapperFlex = /* @__PURE__ */ emotion_styled_base_browser_esm(flex_component_component_default, true ? {
target: "ehq8nmi0"
} : 0)("padding:7px;", boxSizingReset, " ", deprecatedPaddings, ";" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/form-token-field/index.js
const form_token_field_identity = (value) => value;
function FormTokenField(props) {
const {
autoCapitalize,
autoComplete,
maxLength,
placeholder,
label = (0,external_wp_i18n_namespaceObject.__)("Add item"),
className,
suggestions = [],
maxSuggestions = 100,
value = [],
displayTransform = form_token_field_identity,
saveTransform = (token) => token.trim(),
onChange = () => {
},
onInputChange = () => {
},
onFocus = void 0,
isBorderless = false,
disabled = false,
tokenizeOnSpace = false,
messages = {
added: (0,external_wp_i18n_namespaceObject.__)("Item added."),
removed: (0,external_wp_i18n_namespaceObject.__)("Item removed."),
remove: (0,external_wp_i18n_namespaceObject.__)("Remove item"),
__experimentalInvalid: (0,external_wp_i18n_namespaceObject.__)("Invalid item")
},
__experimentalRenderItem,
__experimentalExpandOnFocus = false,
__experimentalValidateInput = () => true,
__experimentalShowHowTo = true,
__next40pxDefaultSize = false,
__experimentalAutoSelectFirstMatch = false,
__nextHasNoMarginBottom = false,
tokenizeOnBlur = false
} = useDeprecated36pxDefaultSizeProp(props);
if (!__nextHasNoMarginBottom) {
external_wp_deprecated_default()("Bottom margin styles for wp.components.FormTokenField", {
since: "6.7",
version: "7.0",
hint: "Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."
});
}
maybeWarnDeprecated36pxSize({
componentName: "FormTokenField",
size: void 0,
__next40pxDefaultSize
});
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(FormTokenField);
const [incompleteTokenValue, setIncompleteTokenValue] = (0,external_wp_element_namespaceObject.useState)("");
const [inputOffsetFromEnd, setInputOffsetFromEnd] = (0,external_wp_element_namespaceObject.useState)(0);
const [isActive, setIsActive] = (0,external_wp_element_namespaceObject.useState)(false);
const [isExpanded, setIsExpanded] = (0,external_wp_element_namespaceObject.useState)(false);
const [selectedSuggestionIndex, setSelectedSuggestionIndex] = (0,external_wp_element_namespaceObject.useState)(-1);
const [selectedSuggestionScroll, setSelectedSuggestionScroll] = (0,external_wp_element_namespaceObject.useState)(false);
const prevSuggestions = (0,external_wp_compose_namespaceObject.usePrevious)(suggestions);
const prevValue = (0,external_wp_compose_namespaceObject.usePrevious)(value);
const input = (0,external_wp_element_namespaceObject.useRef)(null);
const tokensAndInput = (0,external_wp_element_namespaceObject.useRef)(null);
const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (isActive && !hasFocus()) {
focus();
}
}, [isActive]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const suggestionsDidUpdate = !external_wp_isShallowEqual_default()(suggestions, prevSuggestions || []);
if (suggestionsDidUpdate || value !== prevValue) {
updateSuggestions(suggestionsDidUpdate);
}
}, [suggestions, prevSuggestions, value, prevValue]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
updateSuggestions();
}, [incompleteTokenValue]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
updateSuggestions();
}, [__experimentalAutoSelectFirstMatch]);
if (disabled && isActive) {
setIsActive(false);
setIncompleteTokenValue("");
}
function focus() {
input.current?.focus();
}
function hasFocus() {
return input.current === input.current?.ownerDocument.activeElement;
}
function onFocusHandler(event) {
if (hasFocus() || event.target === tokensAndInput.current) {
setIsActive(true);
setIsExpanded(__experimentalExpandOnFocus || isExpanded);
} else {
setIsActive(false);
}
if ("function" === typeof onFocus) {
onFocus(event);
}
}
function onBlur(event) {
if (inputHasValidValue() && __experimentalValidateInput(incompleteTokenValue)) {
setIsActive(false);
if (tokenizeOnBlur && inputHasValidValue()) {
addNewToken(incompleteTokenValue);
}
} else {
setIncompleteTokenValue("");
setInputOffsetFromEnd(0);
setIsActive(false);
if (__experimentalExpandOnFocus) {
const hasFocusWithin = event.relatedTarget === tokensAndInput.current;
setIsExpanded(hasFocusWithin);
} else {
setIsExpanded(false);
}
setSelectedSuggestionIndex(-1);
setSelectedSuggestionScroll(false);
}
}
function onKeyDown(event) {
let preventDefault = false;
if (event.defaultPrevented) {
return;
}
switch (event.key) {
case "Backspace":
preventDefault = handleDeleteKey(deleteTokenBeforeInput);
break;
case "Enter":
preventDefault = addCurrentToken();
break;
case "ArrowLeft":
preventDefault = handleLeftArrowKey();
break;
case "ArrowUp":
preventDefault = handleUpArrowKey();
break;
case "ArrowRight":
preventDefault = handleRightArrowKey();
break;
case "ArrowDown":
preventDefault = handleDownArrowKey();
break;
case "Delete":
preventDefault = handleDeleteKey(deleteTokenAfterInput);
break;
case "Space":
if (tokenizeOnSpace) {
preventDefault = addCurrentToken();
}
break;
case "Escape":
preventDefault = handleEscapeKey(event);
break;
case "Tab":
preventDefault = handleTabKey(event);
break;
default:
break;
}
if (preventDefault) {
event.preventDefault();
}
}
function onKeyPress(event) {
let preventDefault = false;
switch (event.key) {
case ",":
preventDefault = handleCommaKey();
break;
default:
break;
}
if (preventDefault) {
event.preventDefault();
}
}
function onContainerTouched(event) {
if (event.target === tokensAndInput.current && isActive) {
event.preventDefault();
}
}
function onTokenClickRemove(event) {
deleteToken(event.value);
focus();
}
function onSuggestionHovered(suggestion) {
const index = getMatchingSuggestions().indexOf(suggestion);
if (index >= 0) {
setSelectedSuggestionIndex(index);
setSelectedSuggestionScroll(false);
}
}
function onSuggestionSelected(suggestion) {
addNewToken(suggestion);
}
function onInputChangeHandler(event) {
const text = event.value;
const separator = tokenizeOnSpace ? /[ ,\t]+/ : /[,\t]+/;
const items = text.split(separator);
const tokenValue = items[items.length - 1] || "";
if (items.length > 1) {
addNewTokens(items.slice(0, -1));
}
setIncompleteTokenValue(tokenValue);
onInputChange(tokenValue);
}
function handleDeleteKey(_deleteToken) {
let preventDefault = false;
if (hasFocus() && isInputEmpty()) {
_deleteToken();
preventDefault = true;
}
return preventDefault;
}
function handleLeftArrowKey() {
let preventDefault = false;
if (isInputEmpty()) {
moveInputBeforePreviousToken();
preventDefault = true;
}
return preventDefault;
}
function handleRightArrowKey() {
let preventDefault = false;
if (isInputEmpty()) {
moveInputAfterNextToken();
preventDefault = true;
}
return preventDefault;
}
function handleUpArrowKey() {
setSelectedSuggestionIndex((index) => {
return (index === 0 ? getMatchingSuggestions(incompleteTokenValue, suggestions, value, maxSuggestions, saveTransform).length : index) - 1;
});
setSelectedSuggestionScroll(true);
return true;
}
function handleDownArrowKey() {
setSelectedSuggestionIndex((index) => {
return (index + 1) % getMatchingSuggestions(incompleteTokenValue, suggestions, value, maxSuggestions, saveTransform).length;
});
setSelectedSuggestionScroll(true);
return true;
}
function collapseSuggestionsList(event) {
if (event.target instanceof HTMLInputElement) {
setIncompleteTokenValue(event.target.value);
setIsExpanded(false);
setSelectedSuggestionIndex(-1);
setSelectedSuggestionScroll(false);
}
}
function handleEscapeKey(event) {
collapseSuggestionsList(event);
return true;
}
function handleTabKey(event) {
collapseSuggestionsList(event);
return false;
}
function handleCommaKey() {
if (inputHasValidValue()) {
addNewToken(incompleteTokenValue);
}
return true;
}
function moveInputToIndex(index) {
setInputOffsetFromEnd(value.length - Math.max(index, -1) - 1);
}
function moveInputBeforePreviousToken() {
setInputOffsetFromEnd((prevInputOffsetFromEnd) => {
return Math.min(prevInputOffsetFromEnd + 1, value.length);
});
}
function moveInputAfterNextToken() {
setInputOffsetFromEnd((prevInputOffsetFromEnd) => {
return Math.max(prevInputOffsetFromEnd - 1, 0);
});
}
function deleteTokenBeforeInput() {
const index = getIndexOfInput() - 1;
if (index > -1) {
deleteToken(value[index]);
}
}
function deleteTokenAfterInput() {
const index = getIndexOfInput();
if (index < value.length) {
deleteToken(value[index]);
moveInputToIndex(index);
}
}
function addCurrentToken() {
let preventDefault = false;
const selectedSuggestion = getSelectedSuggestion();
if (selectedSuggestion) {
addNewToken(selectedSuggestion);
preventDefault = true;
} else if (inputHasValidValue()) {
addNewToken(incompleteTokenValue);
preventDefault = true;
}
return preventDefault;
}
function addNewTokens(tokens) {
const tokensToAdd = [...new Set(tokens.map(saveTransform).filter(Boolean).filter((token) => !valueContainsToken(token)))];
if (tokensToAdd.length > 0) {
const newValue = [...value];
newValue.splice(getIndexOfInput(), 0, ...tokensToAdd);
onChange(newValue);
}
}
function addNewToken(token) {
if (!__experimentalValidateInput(token)) {
(0,external_wp_a11y_namespaceObject.speak)(messages.__experimentalInvalid, "assertive");
return;
}
addNewTokens([token]);
(0,external_wp_a11y_namespaceObject.speak)(messages.added, "assertive");
setIncompleteTokenValue("");
setSelectedSuggestionIndex(-1);
setSelectedSuggestionScroll(false);
setIsExpanded(!__experimentalExpandOnFocus);
if (isActive && !tokenizeOnBlur) {
focus();
}
}
function deleteToken(token) {
const newTokens = value.filter((item) => {
return getTokenValue(item) !== getTokenValue(token);
});
onChange(newTokens);
(0,external_wp_a11y_namespaceObject.speak)(messages.removed, "assertive");
}
function getTokenValue(token) {
if ("object" === typeof token) {
return token.value;
}
return token;
}
function getMatchingSuggestions(searchValue = incompleteTokenValue, _suggestions = suggestions, _value = value, _maxSuggestions = maxSuggestions, _saveTransform = saveTransform) {
let match = _saveTransform(searchValue);
const startsWithMatch = [];
const containsMatch = [];
const normalizedValue = _value.map((item) => {
if (typeof item === "string") {
return item;
}
return item.value;
});
if (match.length === 0) {
_suggestions = _suggestions.filter((suggestion) => !normalizedValue.includes(suggestion));
} else {
match = match.normalize("NFKC").toLocaleLowerCase();
_suggestions.forEach((suggestion) => {
const index = suggestion.normalize("NFKC").toLocaleLowerCase().indexOf(match);
if (normalizedValue.indexOf(suggestion) === -1) {
if (index === 0) {
startsWithMatch.push(suggestion);
} else if (index > 0) {
containsMatch.push(suggestion);
}
}
});
_suggestions = startsWithMatch.concat(containsMatch);
}
return _suggestions.slice(0, _maxSuggestions);
}
function getSelectedSuggestion() {
if (selectedSuggestionIndex !== -1) {
return getMatchingSuggestions()[selectedSuggestionIndex];
}
return void 0;
}
function valueContainsToken(token) {
return value.some((item) => {
return getTokenValue(token) === getTokenValue(item);
});
}
function getIndexOfInput() {
return value.length - inputOffsetFromEnd;
}
function isInputEmpty() {
return incompleteTokenValue.length === 0;
}
function inputHasValidValue() {
return saveTransform(incompleteTokenValue).length > 0;
}
function updateSuggestions(resetSelectedSuggestion = true) {
const inputHasMinimumChars = incompleteTokenValue.trim().length > 1;
const matchingSuggestions2 = getMatchingSuggestions(incompleteTokenValue);
const hasMatchingSuggestions = matchingSuggestions2.length > 0;
const shouldExpandIfFocuses = hasFocus() && __experimentalExpandOnFocus;
setIsExpanded(shouldExpandIfFocuses || inputHasMinimumChars && hasMatchingSuggestions);
if (resetSelectedSuggestion) {
if (__experimentalAutoSelectFirstMatch && inputHasMinimumChars && hasMatchingSuggestions) {
setSelectedSuggestionIndex(0);
setSelectedSuggestionScroll(true);
} else {
setSelectedSuggestionIndex(-1);
setSelectedSuggestionScroll(false);
}
}
if (inputHasMinimumChars) {
const message = hasMatchingSuggestions ? (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: number of results. */
(0,external_wp_i18n_namespaceObject._n)("%d result found, use up and down arrow keys to navigate.", "%d results found, use up and down arrow keys to navigate.", matchingSuggestions2.length),
matchingSuggestions2.length
) : (0,external_wp_i18n_namespaceObject.__)("No results.");
debouncedSpeak(message, "assertive");
}
}
function renderTokensAndInput() {
const components = value.map(renderToken);
components.splice(getIndexOfInput(), 0, renderInput());
return components;
}
function renderToken(token, index, tokens) {
const _value = getTokenValue(token);
const status = typeof token !== "string" ? token.status : void 0;
const termPosition = index + 1;
const termsCount = tokens.length;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_item_component_component_default, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Token, {
value: _value,
status,
title: typeof token !== "string" ? token.title : void 0,
displayTransform,
onClickRemove: onTokenClickRemove,
isBorderless: typeof token !== "string" && token.isBorderless || isBorderless,
onMouseEnter: typeof token !== "string" ? token.onMouseEnter : void 0,
onMouseLeave: typeof token !== "string" ? token.onMouseLeave : void 0,
disabled: "error" !== status && disabled,
messages,
termsCount,
termPosition
})
}, "token-" + _value);
}
function renderInput() {
const inputProps = {
instanceId,
autoCapitalize,
autoComplete,
placeholder: value.length === 0 ? placeholder : "",
disabled,
value: incompleteTokenValue,
onBlur,
isExpanded,
selectedSuggestionIndex
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(token_input_default, {
...inputProps,
onChange: !(maxLength && value.length >= maxLength) ? onInputChangeHandler : void 0,
ref: input
}, "input");
}
const classes = dist_clsx(className, "components-form-token-field__input-container", {
"is-active": isActive,
"is-disabled": disabled
});
let tokenFieldProps = {
className: "components-form-token-field",
tabIndex: -1
};
const matchingSuggestions = getMatchingSuggestions();
if (!disabled) {
tokenFieldProps = Object.assign({}, tokenFieldProps, {
onKeyDown: withIgnoreIMEEvents(onKeyDown),
onKeyPress,
onFocus: onFocusHandler
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
...tokenFieldProps,
children: [label && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledLabel, {
htmlFor: `components-form-token-input-${instanceId}`,
className: "components-form-token-field__label",
children: label
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
ref: tokensAndInput,
className: classes,
tabIndex: -1,
onMouseDown: onContainerTouched,
onTouchStart: onContainerTouched,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TokensAndInputWrapperFlex, {
justify: "flex-start",
align: "center",
gap: 1,
wrap: true,
__next40pxDefaultSize,
hasTokens: !!value.length,
children: renderTokensAndInput()
}), isExpanded && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(suggestions_list_default, {
instanceId,
match: saveTransform(incompleteTokenValue),
displayTransform,
suggestions: matchingSuggestions,
selectedIndex: selectedSuggestionIndex,
scrollIntoView: selectedSuggestionScroll,
onHover: onSuggestionHovered,
onSelect: onSuggestionSelected,
__experimentalRenderItem
})]
}), !__nextHasNoMarginBottom && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {
marginBottom: 2
}), __experimentalShowHowTo && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledHelp, {
id: `components-form-token-suggestions-howto-${instanceId}`,
className: "components-form-token-field__help",
__nextHasNoMarginBottom,
children: tokenizeOnSpace ? (0,external_wp_i18n_namespaceObject.__)("Separate with commas, spaces, or the Enter key.") : (0,external_wp_i18n_namespaceObject.__)("Separate with commas or the Enter key.")
})]
});
}
var form_token_field_default = FormTokenField;
;// ./node_modules/@wordpress/components/build-module/guide/icons.js
const PageControlIcon = () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "8",
height: "8",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Circle, {
cx: "4",
cy: "4",
r: "4"
})
});
;// ./node_modules/@wordpress/components/build-module/guide/page-control.js
function PageControl({
currentPage,
numberOfPages,
setCurrentPage
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", {
className: "components-guide__page-control",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Guide controls"),
children: Array.from({
length: numberOfPages
}).map((_, page) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("li", {
// Set aria-current="step" on the active page, see https://www.w3.org/TR/wai-aria-1.1/#aria-current
"aria-current": page === currentPage ? "step" : void 0,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
size: "small",
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PageControlIcon, {}),
"aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: current page number 2: total number of pages */
(0,external_wp_i18n_namespaceObject.__)("Page %1$d of %2$d"),
page + 1,
numberOfPages
),
onClick: () => setCurrentPage(page)
}, page)
}, page))
});
}
;// ./node_modules/@wordpress/components/build-module/guide/index.js
function Guide({
children,
className,
contentLabel,
finishButtonText = (0,external_wp_i18n_namespaceObject.__)("Finish"),
nextButtonText = (0,external_wp_i18n_namespaceObject.__)("Next"),
previousButtonText = (0,external_wp_i18n_namespaceObject.__)("Previous"),
onFinish,
pages = []
}) {
const ref = (0,external_wp_element_namespaceObject.useRef)(null);
const [currentPage, setCurrentPage] = (0,external_wp_element_namespaceObject.useState)(0);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const frame = ref.current?.querySelector(".components-guide");
if (frame instanceof HTMLElement) {
frame.focus();
}
}, [currentPage]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (external_wp_element_namespaceObject.Children.count(children)) {
external_wp_deprecated_default()("Passing children to <Guide>", {
since: "5.5",
alternative: "the `pages` prop"
});
}
}, [children]);
if (external_wp_element_namespaceObject.Children.count(children)) {
var _Children$map;
pages = (_Children$map = external_wp_element_namespaceObject.Children.map(children, (child) => ({
content: child
}))) !== null && _Children$map !== void 0 ? _Children$map : [];
}
const canGoBack = currentPage > 0;
const canGoForward = currentPage < pages.length - 1;
const goBack = () => {
if (canGoBack) {
setCurrentPage(currentPage - 1);
}
};
const goForward = () => {
if (canGoForward) {
setCurrentPage(currentPage + 1);
}
};
if (pages.length === 0) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(modal_default, {
className: dist_clsx("components-guide", className),
contentLabel,
isDismissible: pages.length > 1,
onRequestClose: onFinish,
onKeyDown: (event) => {
if (event.code === "ArrowLeft") {
goBack();
event.preventDefault();
} else if (event.code === "ArrowRight") {
goForward();
event.preventDefault();
}
},
ref,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-guide__container",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-guide__page",
children: [pages[currentPage].image, pages.length > 1 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PageControl, {
currentPage,
numberOfPages: pages.length,
setCurrentPage
}), pages[currentPage].content]
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-guide__footer",
children: [canGoBack && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
className: "components-guide__back-button",
variant: "tertiary",
onClick: goBack,
__next40pxDefaultSize: true,
children: previousButtonText
}), canGoForward && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
className: "components-guide__forward-button",
variant: "primary",
onClick: goForward,
__next40pxDefaultSize: true,
children: nextButtonText
}), !canGoForward && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
className: "components-guide__finish-button",
variant: "primary",
onClick: onFinish,
__next40pxDefaultSize: true,
children: finishButtonText
})]
})]
})
});
}
var guide_default = Guide;
;// ./node_modules/@wordpress/components/build-module/guide/page.js
function GuidePage(props) {
(0,external_wp_element_namespaceObject.useEffect)(() => {
external_wp_deprecated_default()("<GuidePage>", {
since: "5.5",
alternative: "the `pages` prop in <Guide>"
});
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...props
});
}
;// ./node_modules/@wordpress/components/build-module/button/deprecated.js
function UnforwardedIconButton({
label,
labelPosition,
size,
tooltip,
...props
}, ref) {
external_wp_deprecated_default()("wp.components.IconButton", {
since: "5.4",
alternative: "wp.components.Button",
version: "6.2"
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
...props,
ref,
tooltipPosition: labelPosition,
iconSize: size,
showTooltip: tooltip !== void 0 ? !!tooltip : void 0,
label: tooltip || label
});
}
var deprecated_default = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedIconButton);
;// ./node_modules/@wordpress/components/build-module/keyboard-shortcuts/index.js
function KeyboardShortcut({
target,
callback,
shortcut,
bindGlobal,
eventName
}) {
(0,external_wp_compose_namespaceObject.useKeyboardShortcut)(shortcut, callback, {
bindGlobal,
target,
eventName
});
return null;
}
function KeyboardShortcuts({
children,
shortcuts,
bindGlobal,
eventName
}) {
const target = (0,external_wp_element_namespaceObject.useRef)(null);
const element = Object.entries(shortcuts !== null && shortcuts !== void 0 ? shortcuts : {}).map(([shortcut, callback]) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(KeyboardShortcut, {
shortcut,
callback,
bindGlobal,
eventName,
target
}, shortcut));
if (!external_wp_element_namespaceObject.Children.count(children)) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: element
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
ref: target,
children: [element, children]
});
}
var keyboard_shortcuts_default = KeyboardShortcuts;
;// ./node_modules/@wordpress/components/build-module/menu-group/index.js
function MenuGroup(props) {
const {
children,
className = "",
label,
hideSeparator
} = props;
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(MenuGroup);
if (!external_wp_element_namespaceObject.Children.count(children)) {
return null;
}
const labelId = `components-menu-group-label-${instanceId}`;
const classNames = dist_clsx(className, "components-menu-group", {
"has-hidden-separator": hideSeparator
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: classNames,
children: [label && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "components-menu-group__label",
id: labelId,
"aria-hidden": "true",
children: label
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
role: "group",
"aria-labelledby": label ? labelId : void 0,
children
})]
});
}
var menu_group_default = MenuGroup;
;// ./node_modules/@wordpress/components/build-module/menu-item/index.js
function UnforwardedMenuItem(props, ref) {
let {
children,
info,
className,
icon,
iconPosition = "right",
shortcut,
isSelected,
role = "menuitem",
suffix,
...buttonProps
} = props;
className = dist_clsx("components-menu-item__button", className);
if (info) {
children = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
className: "components-menu-item__info-wrapper",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "components-menu-item__item",
children
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "components-menu-item__info",
children: info
})]
});
}
if (icon && typeof icon !== "string") {
icon = (0,external_wp_element_namespaceObject.cloneElement)(icon, {
className: dist_clsx("components-menu-items__item-icon", {
"has-icon-right": iconPosition === "right"
})
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(button_default, {
__next40pxDefaultSize: true,
ref,
"aria-checked": role === "menuitemcheckbox" || role === "menuitemradio" ? isSelected : void 0,
role,
icon: iconPosition === "left" ? icon : void 0,
className,
accessibleWhenDisabled: true,
...buttonProps,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "components-menu-item__item",
children
}), !suffix && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(shortcut_default, {
className: "components-menu-item__shortcut",
shortcut
}), !suffix && icon && iconPosition === "right" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
icon
}), suffix]
});
}
const MenuItem = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedMenuItem);
var menu_item_default = MenuItem;
;// ./node_modules/@wordpress/components/build-module/menu-items-choice/index.js
const menu_items_choice_noop = () => {
};
function MenuItemsChoice({
choices = [],
onHover = menu_items_choice_noop,
onSelect,
value
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: choices.map((item) => {
const isSelected = value === item.value;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_item_default, {
role: "menuitemradio",
disabled: item.disabled,
icon: isSelected ? check_default : null,
info: item.info,
isSelected,
shortcut: item.shortcut,
className: "components-menu-items-choice",
onClick: () => {
if (!isSelected) {
onSelect(item.value);
}
},
onMouseEnter: () => onHover(item.value),
onMouseLeave: () => onHover(null),
"aria-label": item["aria-label"],
children: item.label
}, item.value);
})
});
}
var menu_items_choice_default = MenuItemsChoice;
;// ./node_modules/@wordpress/components/build-module/navigable-container/tabbable.js
function UnforwardedTabbableContainer({
eventToOffset,
...props
}, ref) {
const innerEventToOffset = (evt) => {
const {
code,
shiftKey
} = evt;
if ("Tab" === code) {
return shiftKey ? -1 : 1;
}
if (eventToOffset) {
return eventToOffset(evt);
}
return void 0;
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(container_default, {
ref,
stopNavigationEvents: true,
onlyBrowserTabstops: true,
eventToOffset: innerEventToOffset,
...props
});
}
const TabbableContainer = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTabbableContainer);
var tabbable_default = TabbableContainer;
;// ./node_modules/@wordpress/components/build-module/navigation/constants.js
const ROOT_MENU = "root";
const SEARCH_FOCUS_DELAY = 100;
;// ./node_modules/@wordpress/components/build-module/navigation/context.js
const context_noop = () => {
};
const defaultIsEmpty = () => false;
const defaultGetter = () => void 0;
const NavigationContext = (0,external_wp_element_namespaceObject.createContext)({
activeItem: void 0,
activeMenu: ROOT_MENU,
setActiveMenu: context_noop,
navigationTree: {
items: {},
getItem: defaultGetter,
addItem: context_noop,
removeItem: context_noop,
menus: {},
getMenu: defaultGetter,
addMenu: context_noop,
removeMenu: context_noop,
childMenu: {},
traverseMenu: context_noop,
isMenuEmpty: defaultIsEmpty
}
});
NavigationContext.displayName = "NavigationContext";
const useNavigationContext = () => (0,external_wp_element_namespaceObject.useContext)(NavigationContext);
;// ./node_modules/@wordpress/components/build-module/navigation/styles/navigation-styles.js
function navigation_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const NavigationUI = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "eeiismy11"
} : 0)("width:100%;box-sizing:border-box;padding:0 ", space(4), ";overflow:hidden;" + ( true ? "" : 0));
const MenuUI = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "eeiismy10"
} : 0)("margin-top:", space(6), ";margin-bottom:", space(6), ";display:flex;flex-direction:column;ul{padding:0;margin:0;list-style:none;}.components-navigation__back-button{margin-bottom:", space(6), ";}.components-navigation__group+.components-navigation__group{margin-top:", space(6), ";}" + ( true ? "" : 0));
const MenuBackButtonUI = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
target: "eeiismy9"
} : 0)( true ? {
name: "26l0q2",
styles: "&.is-tertiary{color:inherit;opacity:0.7;&:hover:not( :disabled ){opacity:1;box-shadow:none;color:inherit;}&:active:not( :disabled ){background:transparent;opacity:1;color:inherit;}}"
} : 0);
const MenuTitleUI = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "eeiismy8"
} : 0)( true ? {
name: "1aubja5",
styles: "overflow:hidden;width:100%"
} : 0);
const MenuTitleSearchControlWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "eeiismy7"
} : 0)( true ? {
name: "rgorny",
styles: "margin:11px 0;padding:1px"
} : 0);
const MenuTitleActionsUI = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "eeiismy6"
} : 0)("height:", space(6), ";.components-button.is-small{color:inherit;opacity:0.7;margin-right:", space(1), ";padding:0;&:active:not( :disabled ){background:none;opacity:1;color:inherit;}&:hover:not( :disabled ){box-shadow:none;opacity:1;color:inherit;}}" + ( true ? "" : 0));
const GroupTitleUI = /* @__PURE__ */ emotion_styled_base_browser_esm(heading_component_component_default, true ? {
target: "eeiismy5"
} : 0)("min-height:", space(12), ";align-items:center;color:inherit;display:flex;justify-content:space-between;margin-bottom:", space(2), ";padding:", () => (0,external_wp_i18n_namespaceObject.isRTL)() ? `${space(1)} ${space(4)} ${space(1)} ${space(2)}` : `${space(1)} ${space(2)} ${space(1)} ${space(4)}`, ";" + ( true ? "" : 0));
const ItemBaseUI = /* @__PURE__ */ emotion_styled_base_browser_esm("li", true ? {
target: "eeiismy4"
} : 0)("border-radius:", config_values_default.radiusSmall, ";color:inherit;margin-bottom:0;>button,>a.components-button,>a{width:100%;color:inherit;opacity:0.7;padding:", space(2), " ", space(4), ";", rtl({
textAlign: "left"
}, {
textAlign: "right"
}), " &:hover,&:focus:not( [aria-disabled='true'] ):active,&:active:not( [aria-disabled='true'] ):active{color:inherit;opacity:1;}}&.is-active{background-color:", COLORS.theme.accent, ";color:", COLORS.theme.accentInverted, ";>button,.components-button:hover,>a{color:", COLORS.theme.accentInverted, ";opacity:1;}}>svg path{color:", COLORS.gray[600], ";}" + ( true ? "" : 0));
const ItemUI = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "eeiismy3"
} : 0)("display:flex;align-items:center;height:auto;min-height:40px;margin:0;padding:", space(1.5), " ", space(4), ";font-weight:400;line-height:20px;width:100%;color:inherit;opacity:0.7;" + ( true ? "" : 0));
const ItemIconUI = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "eeiismy2"
} : 0)("display:flex;margin-right:", space(2), ";" + ( true ? "" : 0));
const ItemBadgeUI = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "eeiismy1"
} : 0)("margin-left:", () => (0,external_wp_i18n_namespaceObject.isRTL)() ? "0" : space(2), ";margin-right:", () => (0,external_wp_i18n_namespaceObject.isRTL)() ? space(2) : "0", ";display:inline-flex;padding:", space(1), " ", space(3), ";border-radius:", config_values_default.radiusSmall, ";@keyframes fade-in{from{opacity:0;}to{opacity:1;}}@media not ( prefers-reduced-motion ){animation:fade-in 250ms ease-out;}" + ( true ? "" : 0));
const ItemTitleUI = /* @__PURE__ */ emotion_styled_base_browser_esm(text_component_component_default, true ? {
target: "eeiismy0"
} : 0)(() => (0,external_wp_i18n_namespaceObject.isRTL)() ? "margin-left: auto;" : "margin-right: auto;", " font-size:14px;line-height:20px;color:inherit;" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/navigation/use-navigation-tree-nodes.js
function useNavigationTreeNodes() {
const [nodes, setNodes] = (0,external_wp_element_namespaceObject.useState)({});
const getNode = (key) => nodes[key];
const addNode = (key, value) => {
const {
children,
...newNode
} = value;
return setNodes((original) => ({
...original,
[key]: newNode
}));
};
const removeNode = (key) => {
return setNodes((original) => {
const {
[key]: removedNode,
...remainingNodes
} = original;
return remainingNodes;
});
};
return {
nodes,
getNode,
addNode,
removeNode
};
}
;// ./node_modules/@wordpress/components/build-module/navigation/use-create-navigation-tree.js
const useCreateNavigationTree = () => {
const {
nodes: items,
getNode: getItem,
addNode: addItem,
removeNode: removeItem
} = useNavigationTreeNodes();
const {
nodes: menus,
getNode: getMenu,
addNode: addMenu,
removeNode: removeMenu
} = useNavigationTreeNodes();
const [childMenu, setChildMenu] = (0,external_wp_element_namespaceObject.useState)({});
const getChildMenu = (menu) => childMenu[menu] || [];
const traverseMenu = (startMenu, callback) => {
const visited = [];
let queue = [startMenu];
let current;
while (queue.length > 0) {
current = getMenu(queue.shift());
if (!current || visited.includes(current.menu)) {
continue;
}
visited.push(current.menu);
queue = [...queue, ...getChildMenu(current.menu)];
if (callback(current) === false) {
break;
}
}
};
const isMenuEmpty = (menuToCheck) => {
let isEmpty = true;
traverseMenu(menuToCheck, (current) => {
if (!current.isEmpty) {
isEmpty = false;
return false;
}
return void 0;
});
return isEmpty;
};
return {
items,
getItem,
addItem,
removeItem,
menus,
getMenu,
addMenu: (key, value) => {
setChildMenu((state) => {
const newState = {
...state
};
if (!value.parentMenu) {
return newState;
}
if (!newState[value.parentMenu]) {
newState[value.parentMenu] = [];
}
newState[value.parentMenu].push(key);
return newState;
});
addMenu(key, value);
},
removeMenu,
childMenu,
traverseMenu,
isMenuEmpty
};
};
;// ./node_modules/@wordpress/components/build-module/navigation/index.js
const navigation_noop = () => {
};
function Navigation({
activeItem,
activeMenu = ROOT_MENU,
children,
className,
onActivateMenu = navigation_noop
}) {
const [menu, setMenu] = (0,external_wp_element_namespaceObject.useState)(activeMenu);
const [slideOrigin, setSlideOrigin] = (0,external_wp_element_namespaceObject.useState)();
const navigationTree = useCreateNavigationTree();
const defaultSlideOrigin = (0,external_wp_i18n_namespaceObject.isRTL)() ? "right" : "left";
external_wp_deprecated_default()("wp.components.Navigation (and all subcomponents)", {
since: "6.8",
version: "7.1",
alternative: "wp.components.Navigator"
});
const setActiveMenu = (menuId, slideInOrigin = defaultSlideOrigin) => {
if (!navigationTree.getMenu(menuId)) {
return;
}
setSlideOrigin(slideInOrigin);
setMenu(menuId);
onActivateMenu(menuId);
};
const isMountedRef = (0,external_wp_element_namespaceObject.useRef)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isMountedRef.current) {
isMountedRef.current = true;
}
}, []);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (activeMenu !== menu) {
setActiveMenu(activeMenu);
}
}, [activeMenu]);
const context = {
activeItem,
activeMenu: menu,
setActiveMenu,
navigationTree
};
const classes = dist_clsx("components-navigation", className);
const animateClassName = getAnimateClassName({
type: "slide-in",
origin: slideOrigin
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationUI, {
className: classes,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: animateClassName ? dist_clsx({
[animateClassName]: isMountedRef.current && slideOrigin
}) : void 0,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationContext.Provider, {
value: context,
children
})
}, menu)
});
}
var navigation_default = Navigation;
;// ./node_modules/@wordpress/icons/build-module/library/chevron-right.js
var chevron_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/chevron-left.js
var chevron_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) });
;// ./node_modules/@wordpress/components/build-module/navigation/back-button/index.js
function UnforwardedNavigationBackButton({
backButtonLabel,
className,
href,
onClick,
parentMenu
}, ref) {
const {
setActiveMenu,
navigationTree
} = useNavigationContext();
const classes = dist_clsx("components-navigation__back-button", className);
const parentMenuTitle = parentMenu !== void 0 ? navigationTree.getMenu(parentMenu)?.title : void 0;
const handleOnClick = (event) => {
if (typeof onClick === "function") {
onClick(event);
}
const animationDirection = (0,external_wp_i18n_namespaceObject.isRTL)() ? "left" : "right";
if (parentMenu && !event.defaultPrevented) {
setActiveMenu(parentMenu, animationDirection);
}
};
const icon = (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right_default : chevron_left_default;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(MenuBackButtonUI, {
__next40pxDefaultSize: true,
className: classes,
href,
variant: "tertiary",
ref,
onClick: handleOnClick,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
icon
}), backButtonLabel || parentMenuTitle || (0,external_wp_i18n_namespaceObject.__)("Back")]
});
}
const NavigationBackButton = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedNavigationBackButton);
var back_button_default = NavigationBackButton;
;// ./node_modules/@wordpress/components/build-module/navigation/group/context.js
const NavigationGroupContext = (0,external_wp_element_namespaceObject.createContext)({
group: void 0
});
NavigationGroupContext.displayName = "NavigationGroupContext";
const useNavigationGroupContext = () => (0,external_wp_element_namespaceObject.useContext)(NavigationGroupContext);
;// ./node_modules/@wordpress/components/build-module/navigation/group/index.js
let uniqueId = 0;
function NavigationGroup({
children,
className,
title
}) {
const [groupId] = (0,external_wp_element_namespaceObject.useState)(`group-${++uniqueId}`);
const {
navigationTree: {
items
}
} = useNavigationContext();
const context = {
group: groupId
};
if (!Object.values(items).some((item) => item.group === groupId && item._isVisible)) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationGroupContext.Provider, {
value: context,
children
});
}
const groupTitleId = `components-navigation__group-title-${groupId}`;
const classes = dist_clsx("components-navigation__group", className);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationGroupContext.Provider, {
value: context,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", {
className: classes,
children: [title && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GroupTitleUI, {
className: "components-navigation__group-title",
id: groupTitleId,
level: 3,
children: title
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", {
"aria-labelledby": groupTitleId,
role: "group",
children
})]
})
});
}
var group_default = NavigationGroup;
;// ./node_modules/@wordpress/components/build-module/navigation/item/base-content.js
function NavigationItemBaseContent(props) {
const {
badge,
title
} = props;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [title && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemTitleUI, {
className: "components-navigation__item-title",
as: "span",
children: title
}), badge && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemBadgeUI, {
className: "components-navigation__item-badge",
children: badge
})]
});
}
;// ./node_modules/@wordpress/components/build-module/navigation/menu/context.js
const NavigationMenuContext = (0,external_wp_element_namespaceObject.createContext)({
menu: void 0,
search: ""
});
NavigationMenuContext.displayName = "NavigationMenuContext";
const useNavigationMenuContext = () => (0,external_wp_element_namespaceObject.useContext)(NavigationMenuContext);
;// ./node_modules/@wordpress/components/build-module/navigation/utils.js
const normalizeInput = (input) => remove_accents_default()(input).replace(/^\//, "").toLowerCase();
const normalizedSearch = (title, search) => -1 !== normalizeInput(title).indexOf(normalizeInput(search));
;// ./node_modules/@wordpress/components/build-module/navigation/item/use-navigation-tree-item.js
const useNavigationTreeItem = (itemId, props) => {
const {
activeMenu,
navigationTree: {
addItem,
removeItem
}
} = useNavigationContext();
const {
group
} = useNavigationGroupContext();
const {
menu,
search
} = useNavigationMenuContext();
(0,external_wp_element_namespaceObject.useEffect)(() => {
const isMenuActive = activeMenu === menu;
const isItemVisible = !search || props.title !== void 0 && normalizedSearch(props.title, search);
addItem(itemId, {
...props,
group,
menu,
_isVisible: isMenuActive && isItemVisible
});
return () => {
removeItem(itemId);
};
}, [activeMenu, search]);
};
;// ./node_modules/@wordpress/components/build-module/navigation/item/base.js
let base_uniqueId = 0;
function NavigationItemBase(props) {
const {
children,
className,
title,
href,
...restProps
} = props;
const [itemId] = (0,external_wp_element_namespaceObject.useState)(`item-${++base_uniqueId}`);
useNavigationTreeItem(itemId, props);
const {
navigationTree
} = useNavigationContext();
if (!navigationTree.getItem(itemId)?._isVisible) {
return null;
}
const classes = dist_clsx("components-navigation__item", className);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemBaseUI, {
className: classes,
...restProps,
children
});
}
;// ./node_modules/@wordpress/components/build-module/navigation/item/index.js
const item_noop = () => {
};
function NavigationItem(props) {
const {
badge,
children,
className,
href,
item,
navigateToMenu,
onClick = item_noop,
title,
icon,
hideIfTargetMenuEmpty,
isText,
...restProps
} = props;
const {
activeItem,
setActiveMenu,
navigationTree: {
isMenuEmpty
}
} = useNavigationContext();
if (hideIfTargetMenuEmpty && navigateToMenu && isMenuEmpty(navigateToMenu)) {
return null;
}
const isActive = item && activeItem === item;
const classes = dist_clsx(className, {
"is-active": isActive
});
const onItemClick = (event) => {
if (navigateToMenu) {
setActiveMenu(navigateToMenu);
}
onClick(event);
};
const navigationIcon = (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_default : chevron_right_default;
const baseProps = children ? props : {
...props,
onClick: void 0
};
const itemProps = isText ? restProps : {
as: button_default,
__next40pxDefaultSize: "as" in restProps ? restProps.as === void 0 : true,
href,
onClick: onItemClick,
"aria-current": isActive ? "page" : void 0,
...restProps
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationItemBase, {
...baseProps,
className: classes,
children: children || /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ItemUI, {
...itemProps,
children: [icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemIconUI, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
icon
})
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationItemBaseContent, {
title,
badge
}), navigateToMenu && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
icon: navigationIcon
})]
})
});
}
var item_item_default = NavigationItem;
;// ./node_modules/@wordpress/components/build-module/navigation/menu/use-navigation-tree-menu.js
const useNavigationTreeMenu = (props) => {
const {
navigationTree: {
addMenu,
removeMenu
}
} = useNavigationContext();
const key = props.menu || ROOT_MENU;
(0,external_wp_element_namespaceObject.useEffect)(() => {
addMenu(key, {
...props,
menu: key
});
return () => {
removeMenu(key);
};
}, []);
};
;// ./node_modules/@wordpress/icons/build-module/library/search.js
var search_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) });
;// ./node_modules/@wordpress/components/build-module/higher-order/with-spoken-messages/index.js
var with_spoken_messages_default = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((Component) => (props) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
...props,
speak: external_wp_a11y_namespaceObject.speak,
debouncedSpeak: (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500)
}), "withSpokenMessages");
;// ./node_modules/@wordpress/components/build-module/search-control/styles.js
function search_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const StyledInputControl = /* @__PURE__ */ emotion_styled_base_browser_esm(input_control_default, true ? {
target: "effl84m1"
} : 0)( true ? {
name: "37btb2",
styles: "input[type='search']{&::-webkit-search-decoration,&::-webkit-search-cancel-button,&::-webkit-search-results-button,&::-webkit-search-results-decoration{-webkit-appearance:none;}}"
} : 0);
const StyledIcon = /* @__PURE__ */ emotion_styled_base_browser_esm(icon_icon_default, true ? {
target: "effl84m0"
} : 0)( true ? {
name: "1i54h4p",
styles: "&:dir( ltr ){transform:scaleX( -1 );}"
} : 0);
;// ./node_modules/@wordpress/components/build-module/search-control/index.js
function SuffixItem({
searchRef,
value,
onChange,
onClose
}) {
if (!onClose && !value) {
return null;
}
if (onClose) {
external_wp_deprecated_default()("`onClose` prop in wp.components.SearchControl", {
since: "6.8"
});
}
const onReset = () => {
onChange("");
searchRef.current?.focus();
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputControlSuffixWrapper, {
variant: "control",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
size: "small",
icon: close_small_default,
label: onClose ? (0,external_wp_i18n_namespaceObject.__)("Close search") : (0,external_wp_i18n_namespaceObject.__)("Reset search"),
onClick: onClose !== null && onClose !== void 0 ? onClose : onReset
})
});
}
function UnforwardedSearchControl({
__nextHasNoMarginBottom = false,
className,
onChange,
value,
label = (0,external_wp_i18n_namespaceObject.__)("Search"),
placeholder = (0,external_wp_i18n_namespaceObject.__)("Search"),
hideLabelFromVision = true,
onClose,
size = "default",
...restProps
}, forwardedRef) {
const {
disabled,
...filteredRestProps
} = restProps;
const searchRef = (0,external_wp_element_namespaceObject.useRef)(null);
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(SearchControl, "components-search-control");
const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
BaseControl: {
// Overrides the underlying BaseControl `__nextHasNoMarginBottom` via the context system
// to provide backwards compatible margin for SearchControl.
// (In a standard InputControl, the BaseControl `__nextHasNoMarginBottom` is always set to true.)
_overrides: {
__nextHasNoMarginBottom
},
__associatedWPComponentName: "SearchControl"
}
}), [__nextHasNoMarginBottom]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextSystemProvider, {
value: contextValue,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledInputControl, {
__next40pxDefaultSize: true,
id: instanceId,
hideLabelFromVision,
label,
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([searchRef, forwardedRef]),
type: "search",
size,
className: dist_clsx("components-search-control", className),
onChange: (nextValue) => onChange(nextValue !== null && nextValue !== void 0 ? nextValue : ""),
autoComplete: "off",
placeholder,
value: value !== null && value !== void 0 ? value : "",
prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputControlPrefixWrapper, {
variant: "icon",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledIcon, {
icon: search_default,
fill: "currentColor"
})
}),
suffix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SuffixItem, {
searchRef,
value,
onChange,
onClose
}),
...filteredRestProps
})
});
}
const SearchControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSearchControl);
var search_control_default = SearchControl;
;// ./node_modules/@wordpress/components/build-module/navigation/menu/menu-title-search.js
function MenuTitleSearch({
debouncedSpeak,
onCloseSearch,
onSearch,
search,
title
}) {
const {
navigationTree: {
items
}
} = useNavigationContext();
const {
menu
} = useNavigationMenuContext();
const inputRef = (0,external_wp_element_namespaceObject.useRef)(null);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const delayedFocus = setTimeout(() => {
inputRef.current?.focus();
}, SEARCH_FOCUS_DELAY);
return () => {
clearTimeout(delayedFocus);
};
}, []);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!search) {
return;
}
const count = Object.values(items).filter((item) => item._isVisible).length;
const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: number of results. */
(0,external_wp_i18n_namespaceObject._n)("%d result found.", "%d results found.", count),
count
);
debouncedSpeak(resultsFoundMessage);
}, [items, search]);
const onClose = () => {
onSearch?.("");
onCloseSearch();
};
const onKeyDown = (event) => {
if (event.code === "Escape" && !event.defaultPrevented) {
event.preventDefault();
onClose();
}
};
const inputId = `components-navigation__menu-title-search-${menu}`;
const placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: placeholder for menu search box. %s: menu title */
(0,external_wp_i18n_namespaceObject.__)("Search %s"),
title?.toLowerCase() || ""
).trim();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuTitleSearchControlWrapper, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(search_control_default, {
__nextHasNoMarginBottom: true,
className: "components-navigation__menu-search-input",
id: inputId,
onChange: (value) => onSearch?.(value),
onKeyDown,
placeholder,
onClose,
ref: inputRef,
value: search
})
});
}
var menu_title_search_default = with_spoken_messages_default(MenuTitleSearch);
;// ./node_modules/@wordpress/components/build-module/navigation/menu/menu-title.js
function NavigationMenuTitle({
hasSearch,
onSearch,
search,
title,
titleAction
}) {
const [isSearching, setIsSearching] = (0,external_wp_element_namespaceObject.useState)(false);
const {
menu
} = useNavigationMenuContext();
const searchButtonRef = (0,external_wp_element_namespaceObject.useRef)(null);
if (!title) {
return null;
}
const onCloseSearch = () => {
setIsSearching(false);
setTimeout(() => {
searchButtonRef.current?.focus();
}, SEARCH_FOCUS_DELAY);
};
const menuTitleId = `components-navigation__menu-title-${menu}`;
const searchButtonLabel = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Search in %s"), title);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(MenuTitleUI, {
className: "components-navigation__menu-title",
children: [!isSearching && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(GroupTitleUI, {
as: "h2",
className: "components-navigation__menu-title-heading",
level: 3,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
id: menuTitleId,
children: title
}), (hasSearch || titleAction) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(MenuTitleActionsUI, {
children: [titleAction, hasSearch && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
size: "small",
variant: "tertiary",
label: searchButtonLabel,
onClick: () => setIsSearching(true),
ref: searchButtonRef,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
icon: search_default
})
})]
})]
}), isSearching && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: getAnimateClassName({
type: "slide-in",
origin: "left"
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_title_search_default, {
onCloseSearch,
onSearch,
search,
title
})
})]
});
}
;// ./node_modules/@wordpress/components/build-module/navigation/menu/search-no-results-found.js
function NavigationSearchNoResultsFound({
search
}) {
const {
navigationTree: {
items
}
} = useNavigationContext();
const resultsCount = Object.values(items).filter((item) => item._isVisible).length;
if (!search || !!resultsCount) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemBaseUI, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ItemUI, {
children: [(0,external_wp_i18n_namespaceObject.__)("No results found."), " "]
})
});
}
;// ./node_modules/@wordpress/components/build-module/navigation/menu/index.js
function NavigationMenu(props) {
const {
backButtonLabel,
children,
className,
hasSearch,
menu = ROOT_MENU,
onBackButtonClick,
onSearch: setControlledSearch,
parentMenu,
search: controlledSearch,
isSearchDebouncing,
title,
titleAction
} = props;
const [uncontrolledSearch, setUncontrolledSearch] = (0,external_wp_element_namespaceObject.useState)("");
useNavigationTreeMenu(props);
const {
activeMenu
} = useNavigationContext();
const context = {
menu,
search: uncontrolledSearch
};
if (activeMenu !== menu) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuContext.Provider, {
value: context,
children
});
}
const isControlledSearch = !!setControlledSearch;
const search = isControlledSearch ? controlledSearch : uncontrolledSearch;
const onSearch = isControlledSearch ? setControlledSearch : setUncontrolledSearch;
const menuTitleId = `components-navigation__menu-title-${menu}`;
const classes = dist_clsx("components-navigation__menu", className);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuContext.Provider, {
value: context,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(MenuUI, {
className: classes,
children: [(parentMenu || onBackButtonClick) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(back_button_default, {
backButtonLabel,
parentMenu,
onClick: onBackButtonClick
}), title && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuTitle, {
hasSearch,
onSearch,
search,
title,
titleAction
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_menu_default, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("ul", {
"aria-labelledby": menuTitleId,
children: [children, search && !isSearchDebouncing && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationSearchNoResultsFound, {
search
})]
})
})]
})
});
}
var navigation_menu_menu_default = NavigationMenu;
;// ./node_modules/path-to-regexp/dist.es2015/index.js
/**
* Tokenize input string.
*/
function lexer(str) {
var tokens = [];
var i = 0;
while (i < str.length) {
var char = str[i];
if (char === "*" || char === "+" || char === "?") {
tokens.push({ type: "MODIFIER", index: i, value: str[i++] });
continue;
}
if (char === "\\") {
tokens.push({ type: "ESCAPED_CHAR", index: i++, value: str[i++] });
continue;
}
if (char === "{") {
tokens.push({ type: "OPEN", index: i, value: str[i++] });
continue;
}
if (char === "}") {
tokens.push({ type: "CLOSE", index: i, value: str[i++] });
continue;
}
if (char === ":") {
var name = "";
var j = i + 1;
while (j < str.length) {
var code = str.charCodeAt(j);
if (
// `0-9`
(code >= 48 && code <= 57) ||
// `A-Z`
(code >= 65 && code <= 90) ||
// `a-z`
(code >= 97 && code <= 122) ||
// `_`
code === 95) {
name += str[j++];
continue;
}
break;
}
if (!name)
throw new TypeError("Missing parameter name at ".concat(i));
tokens.push({ type: "NAME", index: i, value: name });
i = j;
continue;
}
if (char === "(") {
var count = 1;
var pattern = "";
var j = i + 1;
if (str[j] === "?") {
throw new TypeError("Pattern cannot start with \"?\" at ".concat(j));
}
while (j < str.length) {
if (str[j] === "\\") {
pattern += str[j++] + str[j++];
continue;
}
if (str[j] === ")") {
count--;
if (count === 0) {
j++;
break;
}
}
else if (str[j] === "(") {
count++;
if (str[j + 1] !== "?") {
throw new TypeError("Capturing groups are not allowed at ".concat(j));
}
}
pattern += str[j++];
}
if (count)
throw new TypeError("Unbalanced pattern at ".concat(i));
if (!pattern)
throw new TypeError("Missing pattern at ".concat(i));
tokens.push({ type: "PATTERN", index: i, value: pattern });
i = j;
continue;
}
tokens.push({ type: "CHAR", index: i, value: str[i++] });
}
tokens.push({ type: "END", index: i, value: "" });
return tokens;
}
/**
* Parse a string for the raw tokens.
*/
function dist_es2015_parse(str, options) {
if (options === void 0) { options = {}; }
var tokens = lexer(str);
var _a = options.prefixes, prefixes = _a === void 0 ? "./" : _a, _b = options.delimiter, delimiter = _b === void 0 ? "/#?" : _b;
var result = [];
var key = 0;
var i = 0;
var path = "";
var tryConsume = function (type) {
if (i < tokens.length && tokens[i].type === type)
return tokens[i++].value;
};
var mustConsume = function (type) {
var value = tryConsume(type);
if (value !== undefined)
return value;
var _a = tokens[i], nextType = _a.type, index = _a.index;
throw new TypeError("Unexpected ".concat(nextType, " at ").concat(index, ", expected ").concat(type));
};
var consumeText = function () {
var result = "";
var value;
while ((value = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR"))) {
result += value;
}
return result;
};
var isSafe = function (value) {
for (var _i = 0, delimiter_1 = delimiter; _i < delimiter_1.length; _i++) {
var char = delimiter_1[_i];
if (value.indexOf(char) > -1)
return true;
}
return false;
};
var safePattern = function (prefix) {
var prev = result[result.length - 1];
var prevText = prefix || (prev && typeof prev === "string" ? prev : "");
if (prev && !prevText) {
throw new TypeError("Must have text between two parameters, missing text after \"".concat(prev.name, "\""));
}
if (!prevText || isSafe(prevText))
return "[^".concat(escapeString(delimiter), "]+?");
return "(?:(?!".concat(escapeString(prevText), ")[^").concat(escapeString(delimiter), "])+?");
};
while (i < tokens.length) {
var char = tryConsume("CHAR");
var name = tryConsume("NAME");
var pattern = tryConsume("PATTERN");
if (name || pattern) {
var prefix = char || "";
if (prefixes.indexOf(prefix) === -1) {
path += prefix;
prefix = "";
}
if (path) {
result.push(path);
path = "";
}
result.push({
name: name || key++,
prefix: prefix,
suffix: "",
pattern: pattern || safePattern(prefix),
modifier: tryConsume("MODIFIER") || "",
});
continue;
}
var value = char || tryConsume("ESCAPED_CHAR");
if (value) {
path += value;
continue;
}
if (path) {
result.push(path);
path = "";
}
var open = tryConsume("OPEN");
if (open) {
var prefix = consumeText();
var name_1 = tryConsume("NAME") || "";
var pattern_1 = tryConsume("PATTERN") || "";
var suffix = consumeText();
mustConsume("CLOSE");
result.push({
name: name_1 || (pattern_1 ? key++ : ""),
pattern: name_1 && !pattern_1 ? safePattern(prefix) : pattern_1,
prefix: prefix,
suffix: suffix,
modifier: tryConsume("MODIFIER") || "",
});
continue;
}
mustConsume("END");
}
return result;
}
/**
* Compile a string to a template function for the path.
*/
function dist_es2015_compile(str, options) {
return tokensToFunction(dist_es2015_parse(str, options), options);
}
/**
* Expose a method for transforming tokens into the path function.
*/
function tokensToFunction(tokens, options) {
if (options === void 0) { options = {}; }
var reFlags = flags(options);
var _a = options.encode, encode = _a === void 0 ? function (x) { return x; } : _a, _b = options.validate, validate = _b === void 0 ? true : _b;
// Compile all the tokens into regexps.
var matches = tokens.map(function (token) {
if (typeof token === "object") {
return new RegExp("^(?:".concat(token.pattern, ")$"), reFlags);
}
});
return function (data) {
var path = "";
for (var i = 0; i < tokens.length; i++) {
var token = tokens[i];
if (typeof token === "string") {
path += token;
continue;
}
var value = data ? data[token.name] : undefined;
var optional = token.modifier === "?" || token.modifier === "*";
var repeat = token.modifier === "*" || token.modifier === "+";
if (Array.isArray(value)) {
if (!repeat) {
throw new TypeError("Expected \"".concat(token.name, "\" to not repeat, but got an array"));
}
if (value.length === 0) {
if (optional)
continue;
throw new TypeError("Expected \"".concat(token.name, "\" to not be empty"));
}
for (var j = 0; j < value.length; j++) {
var segment = encode(value[j], token);
if (validate && !matches[i].test(segment)) {
throw new TypeError("Expected all \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\""));
}
path += token.prefix + segment + token.suffix;
}
continue;
}
if (typeof value === "string" || typeof value === "number") {
var segment = encode(String(value), token);
if (validate && !matches[i].test(segment)) {
throw new TypeError("Expected \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\""));
}
path += token.prefix + segment + token.suffix;
continue;
}
if (optional)
continue;
var typeOfMessage = repeat ? "an array" : "a string";
throw new TypeError("Expected \"".concat(token.name, "\" to be ").concat(typeOfMessage));
}
return path;
};
}
/**
* Create path match function from `path-to-regexp` spec.
*/
function dist_es2015_match(str, options) {
var keys = [];
var re = pathToRegexp(str, keys, options);
return regexpToFunction(re, keys, options);
}
/**
* Create a path match function from `path-to-regexp` output.
*/
function regexpToFunction(re, keys, options) {
if (options === void 0) { options = {}; }
var _a = options.decode, decode = _a === void 0 ? function (x) { return x; } : _a;
return function (pathname) {
var m = re.exec(pathname);
if (!m)
return false;
var path = m[0], index = m.index;
var params = Object.create(null);
var _loop_1 = function (i) {
if (m[i] === undefined)
return "continue";
var key = keys[i - 1];
if (key.modifier === "*" || key.modifier === "+") {
params[key.name] = m[i].split(key.prefix + key.suffix).map(function (value) {
return decode(value, key);
});
}
else {
params[key.name] = decode(m[i], key);
}
};
for (var i = 1; i < m.length; i++) {
_loop_1(i);
}
return { path: path, index: index, params: params };
};
}
/**
* Escape a regular expression string.
*/
function escapeString(str) {
return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
}
/**
* Get the flags for a regexp from the options.
*/
function flags(options) {
return options && options.sensitive ? "" : "i";
}
/**
* Pull out keys from a regexp.
*/
function regexpToRegexp(path, keys) {
if (!keys)
return path;
var groupsRegex = /\((?:\?<(.*?)>)?(?!\?)/g;
var index = 0;
var execResult = groupsRegex.exec(path.source);
while (execResult) {
keys.push({
// Use parenthesized substring match if available, index otherwise
name: execResult[1] || index++,
prefix: "",
suffix: "",
modifier: "",
pattern: "",
});
execResult = groupsRegex.exec(path.source);
}
return path;
}
/**
* Transform an array into a regexp.
*/
function arrayToRegexp(paths, keys, options) {
var parts = paths.map(function (path) { return pathToRegexp(path, keys, options).source; });
return new RegExp("(?:".concat(parts.join("|"), ")"), flags(options));
}
/**
* Create a path regexp from string input.
*/
function stringToRegexp(path, keys, options) {
return tokensToRegexp(dist_es2015_parse(path, options), keys, options);
}
/**
* Expose a function for taking tokens and returning a RegExp.
*/
function tokensToRegexp(tokens, keys, options) {
if (options === void 0) { options = {}; }
var _a = options.strict, strict = _a === void 0 ? false : _a, _b = options.start, start = _b === void 0 ? true : _b, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function (x) { return x; } : _d, _e = options.delimiter, delimiter = _e === void 0 ? "/#?" : _e, _f = options.endsWith, endsWith = _f === void 0 ? "" : _f;
var endsWithRe = "[".concat(escapeString(endsWith), "]|$");
var delimiterRe = "[".concat(escapeString(delimiter), "]");
var route = start ? "^" : "";
// Iterate over the tokens and create our regexp string.
for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {
var token = tokens_1[_i];
if (typeof token === "string") {
route += escapeString(encode(token));
}
else {
var prefix = escapeString(encode(token.prefix));
var suffix = escapeString(encode(token.suffix));
if (token.pattern) {
if (keys)
keys.push(token);
if (prefix || suffix) {
if (token.modifier === "+" || token.modifier === "*") {
var mod = token.modifier === "*" ? "?" : "";
route += "(?:".concat(prefix, "((?:").concat(token.pattern, ")(?:").concat(suffix).concat(prefix, "(?:").concat(token.pattern, "))*)").concat(suffix, ")").concat(mod);
}
else {
route += "(?:".concat(prefix, "(").concat(token.pattern, ")").concat(suffix, ")").concat(token.modifier);
}
}
else {
if (token.modifier === "+" || token.modifier === "*") {
throw new TypeError("Can not repeat \"".concat(token.name, "\" without a prefix and suffix"));
}
route += "(".concat(token.pattern, ")").concat(token.modifier);
}
}
else {
route += "(?:".concat(prefix).concat(suffix, ")").concat(token.modifier);
}
}
}
if (end) {
if (!strict)
route += "".concat(delimiterRe, "?");
route += !options.endsWith ? "$" : "(?=".concat(endsWithRe, ")");
}
else {
var endToken = tokens[tokens.length - 1];
var isEndDelimited = typeof endToken === "string"
? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1
: endToken === undefined;
if (!strict) {
route += "(?:".concat(delimiterRe, "(?=").concat(endsWithRe, "))?");
}
if (!isEndDelimited) {
route += "(?=".concat(delimiterRe, "|").concat(endsWithRe, ")");
}
}
return new RegExp(route, flags(options));
}
/**
* Normalize the given path string, returning a regular expression.
*
* An empty array can be passed in for the keys, which will hold the
* placeholder key descriptions. For example, using `/user/:id`, `keys` will
* contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
*/
function pathToRegexp(path, keys, options) {
if (path instanceof RegExp)
return regexpToRegexp(path, keys);
if (Array.isArray(path))
return arrayToRegexp(path, keys, options);
return stringToRegexp(path, keys, options);
}
;// ./node_modules/@wordpress/components/build-module/navigator/utils/router.js
function matchPath(path, pattern) {
const matchingFunction = dist_es2015_match(pattern, {
decode: decodeURIComponent
});
return matchingFunction(path);
}
function patternMatch(path, screens) {
for (const screen of screens) {
const matched = matchPath(path, screen.path);
if (matched) {
return {
params: matched.params,
id: screen.id
};
}
}
return void 0;
}
function findParent(path, screens) {
if (!path.startsWith("/")) {
return void 0;
}
const pathParts = path.split("/");
let parentPath;
while (pathParts.length > 1 && parentPath === void 0) {
pathParts.pop();
const potentialParentPath = pathParts.join("/") === "" ? "/" : pathParts.join("/");
if (screens.find((screen) => {
return matchPath(potentialParentPath, screen.path) !== false;
})) {
parentPath = potentialParentPath;
}
}
return parentPath;
}
;// ./node_modules/@wordpress/components/build-module/navigator/context.js
const context_initialContextValue = {
location: {},
goTo: () => {
},
goBack: () => {
},
goToParent: () => {
},
addScreen: () => {
},
removeScreen: () => {
},
params: {}
};
const NavigatorContext = (0,external_wp_element_namespaceObject.createContext)(context_initialContextValue);
NavigatorContext.displayName = "NavigatorContext";
;// ./node_modules/@wordpress/components/build-module/navigator/styles.js
function navigator_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const navigatorWrapper = true ? {
name: "1br0vvk",
styles: "position:relative;overflow-x:clip;contain:layout;display:grid;grid-template-columns:1fr;grid-template-rows:1fr;align-items:start"
} : 0;
const fadeIn = emotion_react_browser_esm_keyframes({
from: {
opacity: 0
}
});
const fadeOut = emotion_react_browser_esm_keyframes({
to: {
opacity: 0
}
});
const slideFromRight = emotion_react_browser_esm_keyframes({
from: {
transform: "translateX(100px)"
}
});
const slideToLeft = emotion_react_browser_esm_keyframes({
to: {
transform: "translateX(-80px)"
}
});
const slideFromLeft = emotion_react_browser_esm_keyframes({
from: {
transform: "translateX(-100px)"
}
});
const slideToRight = emotion_react_browser_esm_keyframes({
to: {
transform: "translateX(80px)"
}
});
const FADE = {
DURATION: 70,
EASING: "linear",
DELAY: {
IN: 70,
OUT: 40
}
};
const SLIDE = {
DURATION: 300,
EASING: "cubic-bezier(0.33, 0, 0, 1)"
};
const TOTAL_ANIMATION_DURATION = {
IN: Math.max(FADE.DURATION + FADE.DELAY.IN, SLIDE.DURATION),
OUT: Math.max(FADE.DURATION + FADE.DELAY.OUT, SLIDE.DURATION)
};
const ANIMATION_END_NAMES = {
end: {
in: slideFromRight.name,
out: slideToLeft.name
},
start: {
in: slideFromLeft.name,
out: slideToRight.name
}
};
const ANIMATION = {
end: {
in: /* @__PURE__ */ emotion_react_browser_esm_css(FADE.DURATION, "ms ", FADE.EASING, " ", FADE.DELAY.IN, "ms both ", fadeIn, ",", SLIDE.DURATION, "ms ", SLIDE.EASING, " both ", slideFromRight, ";" + ( true ? "" : 0), true ? "" : 0),
out: /* @__PURE__ */ emotion_react_browser_esm_css(FADE.DURATION, "ms ", FADE.EASING, " ", FADE.DELAY.OUT, "ms both ", fadeOut, ",", SLIDE.DURATION, "ms ", SLIDE.EASING, " both ", slideToLeft, ";" + ( true ? "" : 0), true ? "" : 0)
},
start: {
in: /* @__PURE__ */ emotion_react_browser_esm_css(FADE.DURATION, "ms ", FADE.EASING, " ", FADE.DELAY.IN, "ms both ", fadeIn, ",", SLIDE.DURATION, "ms ", SLIDE.EASING, " both ", slideFromLeft, ";" + ( true ? "" : 0), true ? "" : 0),
out: /* @__PURE__ */ emotion_react_browser_esm_css(FADE.DURATION, "ms ", FADE.EASING, " ", FADE.DELAY.OUT, "ms both ", fadeOut, ",", SLIDE.DURATION, "ms ", SLIDE.EASING, " both ", slideToRight, ";" + ( true ? "" : 0), true ? "" : 0)
}
};
const navigatorScreenAnimation = /* @__PURE__ */ emotion_react_browser_esm_css("z-index:1;&[data-animation-type='out']{z-index:0;}@media not ( prefers-reduced-motion ){&:not( [data-skip-animation] ){", ["start", "end"].map((direction) => ["in", "out"].map((type) => /* @__PURE__ */ emotion_react_browser_esm_css("&[data-animation-direction='", direction, "'][data-animation-type='", type, "']{animation:", ANIMATION[direction][type], ";}" + ( true ? "" : 0), true ? "" : 0))), ";}}" + ( true ? "" : 0), true ? "" : 0);
const navigatorScreen = true ? {
name: "14di7zd",
styles: "overflow-x:auto;max-height:100%;box-sizing:border-box;position:relative;grid-column:1/-1;grid-row:1/-1"
} : 0;
;// ./node_modules/@wordpress/components/build-module/navigator/navigator/component.js
function addScreen({
screens
}, screen) {
if (screens.some((s) => s.path === screen.path)) {
true ? external_wp_warning_default()(`Navigator: a screen with path ${screen.path} already exists.
The screen with id ${screen.id} will not be added.`) : 0;
return screens;
}
return [...screens, screen];
}
function removeScreen({
screens
}, screen) {
return screens.filter((s) => s.id !== screen.id);
}
function goTo(state, path, options = {}) {
var _focusSelectorsCopy2;
const {
focusSelectors
} = state;
const currentLocation = {
...state.currentLocation
};
const {
// Default assignments
isBack = false,
skipFocus = false,
// Extract to avoid forwarding
replace,
focusTargetSelector,
// Rest
...restOptions
} = options;
if (currentLocation.path === path) {
return {
currentLocation,
focusSelectors
};
}
let focusSelectorsCopy;
function getFocusSelectorsCopy() {
var _focusSelectorsCopy;
focusSelectorsCopy = (_focusSelectorsCopy = focusSelectorsCopy) !== null && _focusSelectorsCopy !== void 0 ? _focusSelectorsCopy : new Map(state.focusSelectors);
return focusSelectorsCopy;
}
if (focusTargetSelector && currentLocation.path) {
getFocusSelectorsCopy().set(currentLocation.path, focusTargetSelector);
}
let currentFocusSelector;
if (focusSelectors.get(path)) {
if (isBack) {
currentFocusSelector = focusSelectors.get(path);
}
getFocusSelectorsCopy().delete(path);
}
return {
currentLocation: {
...restOptions,
isInitial: false,
path,
isBack,
hasRestoredFocus: false,
focusTargetSelector: currentFocusSelector,
skipFocus
},
focusSelectors: (_focusSelectorsCopy2 = focusSelectorsCopy) !== null && _focusSelectorsCopy2 !== void 0 ? _focusSelectorsCopy2 : focusSelectors
};
}
function goToParent(state, options = {}) {
const {
screens,
focusSelectors
} = state;
const currentLocation = {
...state.currentLocation
};
const currentPath = currentLocation.path;
if (currentPath === void 0) {
return {
currentLocation,
focusSelectors
};
}
const parentPath = findParent(currentPath, screens);
if (parentPath === void 0) {
return {
currentLocation,
focusSelectors
};
}
return goTo(state, parentPath, {
...options,
isBack: true
});
}
function routerReducer(state, action) {
let {
screens,
currentLocation,
matchedPath,
focusSelectors,
...restState
} = state;
switch (action.type) {
case "add":
screens = addScreen(state, action.screen);
break;
case "remove":
screens = removeScreen(state, action.screen);
break;
case "goto":
({
currentLocation,
focusSelectors
} = goTo(state, action.path, action.options));
break;
case "gotoparent":
({
currentLocation,
focusSelectors
} = goToParent(state, action.options));
break;
}
if (screens === state.screens && currentLocation === state.currentLocation) {
return state;
}
const currentPath = currentLocation.path;
matchedPath = currentPath !== void 0 ? patternMatch(currentPath, screens) : void 0;
if (matchedPath && state.matchedPath && matchedPath.id === state.matchedPath.id && external_wp_isShallowEqual_default()(matchedPath.params, state.matchedPath.params)) {
matchedPath = state.matchedPath;
}
return {
...restState,
screens,
currentLocation,
matchedPath,
focusSelectors
};
}
function UnconnectedNavigator(props, forwardedRef) {
const {
initialPath: initialPathProp,
children,
className,
...otherProps
} = useContextSystem(props, "Navigator");
const [routerState, dispatch] = (0,external_wp_element_namespaceObject.useReducer)(routerReducer, initialPathProp, (path) => ({
screens: [],
currentLocation: {
path,
isInitial: true
},
matchedPath: void 0,
focusSelectors: /* @__PURE__ */ new Map(),
initialPath: initialPathProp
}));
const methods = (0,external_wp_element_namespaceObject.useMemo)(() => ({
// Note: calling goBack calls `goToParent` internally, as it was established
// that `goBack` should behave like `goToParent`, and `goToParent` should
// be marked as deprecated.
goBack: (options) => dispatch({
type: "gotoparent",
options
}),
goTo: (path, options) => dispatch({
type: "goto",
path,
options
}),
goToParent: (options) => {
external_wp_deprecated_default()(`wp.components.useNavigator().goToParent`, {
since: "6.7",
alternative: "wp.components.useNavigator().goBack"
});
dispatch({
type: "gotoparent",
options
});
},
addScreen: (screen) => dispatch({
type: "add",
screen
}),
removeScreen: (screen) => dispatch({
type: "remove",
screen
})
}), []);
const {
currentLocation,
matchedPath
} = routerState;
const navigatorContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => {
var _matchedPath$params;
return {
location: currentLocation,
params: (_matchedPath$params = matchedPath?.params) !== null && _matchedPath$params !== void 0 ? _matchedPath$params : {},
match: matchedPath?.id,
...methods
};
}, [currentLocation, matchedPath, methods]);
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(navigatorWrapper, className), [className, cx]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
ref: forwardedRef,
className: classes,
...otherProps,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigatorContext.Provider, {
value: navigatorContextValue,
children
})
});
}
const component_Navigator = contextConnect(UnconnectedNavigator, "Navigator");
;// external ["wp","escapeHtml"]
const external_wp_escapeHtml_namespaceObject = window["wp"]["escapeHtml"];
;// ./node_modules/@wordpress/components/build-module/navigator/navigator-screen/use-screen-animate-presence.js
const ANIMATION_TIMEOUT_MARGIN = 1.2;
const isEnterAnimation = (animationDirection, animationStatus, animationName) => animationStatus === "ANIMATING_IN" && animationName === ANIMATION_END_NAMES[animationDirection].in;
const isExitAnimation = (animationDirection, animationStatus, animationName) => animationStatus === "ANIMATING_OUT" && animationName === ANIMATION_END_NAMES[animationDirection].out;
function useScreenAnimatePresence({
isMatch,
skipAnimation,
isBack,
onAnimationEnd
}) {
const isRTL = (0,external_wp_i18n_namespaceObject.isRTL)();
const prefersReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
const [animationStatus, setAnimationStatus] = (0,external_wp_element_namespaceObject.useState)("INITIAL");
const becameSelected = animationStatus !== "ANIMATING_IN" && animationStatus !== "IN" && isMatch;
const becameUnselected = animationStatus !== "ANIMATING_OUT" && animationStatus !== "OUT" && !isMatch;
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (becameSelected) {
setAnimationStatus(skipAnimation || prefersReducedMotion ? "IN" : "ANIMATING_IN");
} else if (becameUnselected) {
setAnimationStatus(skipAnimation || prefersReducedMotion ? "OUT" : "ANIMATING_OUT");
}
}, [becameSelected, becameUnselected, skipAnimation, prefersReducedMotion]);
const animationDirection = isRTL && isBack || !isRTL && !isBack ? "end" : "start";
const isAnimatingIn = animationStatus === "ANIMATING_IN";
const isAnimatingOut = animationStatus === "ANIMATING_OUT";
let animationType;
if (isAnimatingIn) {
animationType = "in";
} else if (isAnimatingOut) {
animationType = "out";
}
const onScreenAnimationEnd = (0,external_wp_element_namespaceObject.useCallback)((e) => {
onAnimationEnd?.(e);
if (isExitAnimation(animationDirection, animationStatus, e.animationName)) {
setAnimationStatus("OUT");
} else if (isEnterAnimation(animationDirection, animationStatus, e.animationName)) {
setAnimationStatus("IN");
}
}, [onAnimationEnd, animationStatus, animationDirection]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
let animationTimeout;
if (isAnimatingOut) {
animationTimeout = window.setTimeout(() => {
setAnimationStatus("OUT");
animationTimeout = void 0;
}, TOTAL_ANIMATION_DURATION.OUT * ANIMATION_TIMEOUT_MARGIN);
} else if (isAnimatingIn) {
animationTimeout = window.setTimeout(() => {
setAnimationStatus("IN");
animationTimeout = void 0;
}, TOTAL_ANIMATION_DURATION.IN * ANIMATION_TIMEOUT_MARGIN);
}
return () => {
if (animationTimeout) {
window.clearTimeout(animationTimeout);
animationTimeout = void 0;
}
};
}, [isAnimatingOut, isAnimatingIn]);
return {
animationStyles: navigatorScreenAnimation,
// Render the screen's contents in the DOM not only when the screen is
// selected, but also while it is animating out.
shouldRenderScreen: isMatch || animationStatus === "IN" || animationStatus === "ANIMATING_OUT",
screenProps: {
onAnimationEnd: onScreenAnimationEnd,
"data-animation-direction": animationDirection,
"data-animation-type": animationType,
"data-skip-animation": skipAnimation || void 0
}
};
}
;// ./node_modules/@wordpress/components/build-module/navigator/navigator-screen/component.js
function UnconnectedNavigatorScreen(props, forwardedRef) {
if (!/^\//.test(props.path)) {
true ? external_wp_warning_default()("wp.components.Navigator.Screen: the `path` should follow a URL-like scheme; it should start with and be separated by the `/` character.") : 0;
}
const screenId = (0,external_wp_element_namespaceObject.useId)();
const {
children,
className,
path,
onAnimationEnd: onAnimationEndProp,
...otherProps
} = useContextSystem(props, "Navigator.Screen");
const {
location,
match,
addScreen,
removeScreen
} = (0,external_wp_element_namespaceObject.useContext)(NavigatorContext);
const {
isInitial,
isBack,
focusTargetSelector,
skipFocus
} = location;
const isMatch = match === screenId;
const wrapperRef = (0,external_wp_element_namespaceObject.useRef)(null);
const skipAnimationAndFocusRestoration = !!isInitial && !isBack;
(0,external_wp_element_namespaceObject.useEffect)(() => {
const screen = {
id: screenId,
path: (0,external_wp_escapeHtml_namespaceObject.escapeAttribute)(path)
};
addScreen(screen);
return () => removeScreen(screen);
}, [screenId, path, addScreen, removeScreen]);
const {
animationStyles,
shouldRenderScreen,
screenProps
} = useScreenAnimatePresence({
isMatch,
isBack,
onAnimationEnd: onAnimationEndProp,
skipAnimation: skipAnimationAndFocusRestoration
});
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(navigatorScreen, animationStyles, className), [className, cx, animationStyles]);
const locationRef = (0,external_wp_element_namespaceObject.useRef)(location);
(0,external_wp_element_namespaceObject.useEffect)(() => {
locationRef.current = location;
}, [location]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const wrapperEl = wrapperRef.current;
if (skipAnimationAndFocusRestoration || !isMatch || !wrapperEl || locationRef.current.hasRestoredFocus || skipFocus) {
return;
}
const activeElement = wrapperEl.ownerDocument.activeElement;
if (wrapperEl.contains(activeElement)) {
return;
}
let elementToFocus = null;
if (isBack && focusTargetSelector) {
elementToFocus = wrapperEl.querySelector(focusTargetSelector);
}
if (!elementToFocus) {
const [firstTabbable] = external_wp_dom_namespaceObject.focus.tabbable.find(wrapperEl);
elementToFocus = firstTabbable !== null && firstTabbable !== void 0 ? firstTabbable : wrapperEl;
}
locationRef.current.hasRestoredFocus = true;
elementToFocus.focus();
}, [skipAnimationAndFocusRestoration, isMatch, isBack, focusTargetSelector, skipFocus]);
const mergedWrapperRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, wrapperRef]);
return shouldRenderScreen ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
ref: mergedWrapperRef,
className: classes,
...screenProps,
...otherProps,
children
}) : null;
}
const NavigatorScreen = contextConnect(UnconnectedNavigatorScreen, "Navigator.Screen");
;// ./node_modules/@wordpress/components/build-module/navigator/use-navigator.js
function useNavigator() {
const {
location,
params,
goTo,
goBack,
goToParent
} = (0,external_wp_element_namespaceObject.useContext)(NavigatorContext);
return {
location,
goTo,
goBack,
goToParent,
params
};
}
;// ./node_modules/@wordpress/components/build-module/navigator/navigator-button/hook.js
const cssSelectorForAttribute = (attrName, attrValue) => `[${attrName}="${attrValue}"]`;
function useNavigatorButton(props) {
const {
path,
onClick,
as = button_default,
attributeName = "id",
...otherProps
} = useContextSystem(props, "Navigator.Button");
const escapedPath = (0,external_wp_escapeHtml_namespaceObject.escapeAttribute)(path);
const {
goTo
} = useNavigator();
const handleClick = (0,external_wp_element_namespaceObject.useCallback)((e) => {
e.preventDefault();
goTo(escapedPath, {
focusTargetSelector: cssSelectorForAttribute(attributeName, escapedPath)
});
onClick?.(e);
}, [goTo, onClick, attributeName, escapedPath]);
return {
as,
onClick: handleClick,
...otherProps,
[attributeName]: escapedPath
};
}
;// ./node_modules/@wordpress/components/build-module/navigator/navigator-button/component.js
function UnconnectedNavigatorButton(props, forwardedRef) {
const navigatorButtonProps = useNavigatorButton(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
ref: forwardedRef,
...navigatorButtonProps
});
}
const NavigatorButton = contextConnect(UnconnectedNavigatorButton, "Navigator.Button");
;// ./node_modules/@wordpress/components/build-module/navigator/navigator-back-button/hook.js
function useNavigatorBackButton(props) {
const {
onClick,
as = button_default,
...otherProps
} = useContextSystem(props, "Navigator.BackButton");
const {
goBack
} = useNavigator();
const handleClick = (0,external_wp_element_namespaceObject.useCallback)((e) => {
e.preventDefault();
goBack();
onClick?.(e);
}, [goBack, onClick]);
return {
as,
onClick: handleClick,
...otherProps
};
}
;// ./node_modules/@wordpress/components/build-module/navigator/navigator-back-button/component.js
function UnconnectedNavigatorBackButton(props, forwardedRef) {
const navigatorBackButtonProps = useNavigatorBackButton(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
ref: forwardedRef,
...navigatorBackButtonProps
});
}
const NavigatorBackButton = contextConnect(UnconnectedNavigatorBackButton, "Navigator.BackButton");
;// ./node_modules/@wordpress/components/build-module/navigator/navigator-to-parent-button/component.js
function UnconnectedNavigatorToParentButton(props, forwardedRef) {
external_wp_deprecated_default()("wp.components.NavigatorToParentButton", {
since: "6.7",
alternative: "wp.components.Navigator.BackButton"
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigatorBackButton, {
ref: forwardedRef,
...props
});
}
const NavigatorToParentButton = contextConnect(UnconnectedNavigatorToParentButton, "Navigator.ToParentButton");
;// ./node_modules/@wordpress/components/build-module/navigator/legacy.js
const NavigatorProvider = Object.assign(component_Navigator, {
displayName: "NavigatorProvider"
});
const legacy_NavigatorScreen = Object.assign(NavigatorScreen, {
displayName: "NavigatorScreen"
});
const legacy_NavigatorButton = Object.assign(NavigatorButton, {
displayName: "NavigatorButton"
});
const legacy_NavigatorBackButton = Object.assign(NavigatorBackButton, {
displayName: "NavigatorBackButton"
});
const legacy_NavigatorToParentButton = Object.assign(NavigatorToParentButton, {
displayName: "NavigatorToParentButton"
});
;// ./node_modules/@wordpress/components/build-module/navigator/index.js
const navigator_Navigator = Object.assign(component_Navigator, {
/**
* The `Navigator.Screen` component represents a single view/screen/panel and
* should be used in combination with the `Navigator`, the `Navigator.Button`
* and the `Navigator.BackButton` components.
*
* @example
* ```jsx
* import { Navigator } from '@wordpress/components';
*
* const MyNavigation = () => (
* <Navigator initialPath="/">
* <Navigator.Screen path="/">
* <p>This is the home screen.</p>
* <Navigator.Button path="/child">
* Navigate to child screen.
* </Navigator.Button>
* </Navigator.Screen>
*
* <Navigator.Screen path="/child">
* <p>This is the child screen.</p>
* <Navigator.BackButton>
* Go back
* </Navigator.BackButton>
* </Navigator.Screen>
* </Navigator>
* );
* ```
*/
Screen: Object.assign(NavigatorScreen, {
displayName: "Navigator.Screen"
}),
/**
* The `Navigator.Button` component can be used to navigate to a screen and
* should be used in combination with the `Navigator`, the `Navigator.Screen`
* and the `Navigator.BackButton` components.
*
* @example
* ```jsx
* import { Navigator } from '@wordpress/components';
*
* const MyNavigation = () => (
* <Navigator initialPath="/">
* <Navigator.Screen path="/">
* <p>This is the home screen.</p>
* <Navigator.Button path="/child">
* Navigate to child screen.
* </Navigator.Button>
* </Navigator.Screen>
*
* <Navigator.Screen path="/child">
* <p>This is the child screen.</p>
* <Navigator.BackButton>
* Go back
* </Navigator.BackButton>
* </Navigator.Screen>
* </Navigator>
* );
* ```
*/
Button: Object.assign(NavigatorButton, {
displayName: "Navigator.Button"
}),
/**
* The `Navigator.BackButton` component can be used to navigate to a screen and
* should be used in combination with the `Navigator`, the `Navigator.Screen`
* and the `Navigator.Button` components.
*
* @example
* ```jsx
* import { Navigator } from '@wordpress/components';
*
* const MyNavigation = () => (
* <Navigator initialPath="/">
* <Navigator.Screen path="/">
* <p>This is the home screen.</p>
* <Navigator.Button path="/child">
* Navigate to child screen.
* </Navigator.Button>
* </Navigator.Screen>
*
* <Navigator.Screen path="/child">
* <p>This is the child screen.</p>
* <Navigator.BackButton>
* Go back
* </Navigator.BackButton>
* </Navigator.Screen>
* </Navigator>
* );
* ```
*/
BackButton: Object.assign(NavigatorBackButton, {
displayName: "Navigator.BackButton"
})
});
;// ./node_modules/@wordpress/components/build-module/notice/index.js
const notice_noop = () => {
};
function useSpokenMessage(message, politeness) {
const spokenMessage = typeof message === "string" ? message : (0,external_wp_element_namespaceObject.renderToString)(message);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (spokenMessage) {
(0,external_wp_a11y_namespaceObject.speak)(spokenMessage, politeness);
}
}, [spokenMessage, politeness]);
}
function getDefaultPoliteness(status) {
switch (status) {
case "success":
case "warning":
case "info":
return "polite";
// The default will also catch the 'error' status.
default:
return "assertive";
}
}
function getStatusLabel(status) {
switch (status) {
case "warning":
return (0,external_wp_i18n_namespaceObject.__)("Warning notice");
case "info":
return (0,external_wp_i18n_namespaceObject.__)("Information notice");
case "error":
return (0,external_wp_i18n_namespaceObject.__)("Error notice");
// The default will also catch the 'success' status.
default:
return (0,external_wp_i18n_namespaceObject.__)("Notice");
}
}
function Notice({
className,
status = "info",
children,
spokenMessage = children,
onRemove = notice_noop,
isDismissible = true,
actions = [],
politeness = getDefaultPoliteness(status),
__unstableHTML,
// onDismiss is a callback executed when the notice is dismissed.
// It is distinct from onRemove, which _looks_ like a callback but is
// actually the function to call to remove the notice from the UI.
onDismiss = notice_noop
}) {
useSpokenMessage(spokenMessage, politeness);
const classes = dist_clsx(className, "components-notice", "is-" + status, {
"is-dismissible": isDismissible
});
if (__unstableHTML && typeof children === "string") {
children = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, {
children
});
}
const onDismissNotice = () => {
onDismiss();
onRemove();
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: classes,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
children: getStatusLabel(status)
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-notice__content",
children: [children, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "components-notice__actions",
children: actions.map(({
className: buttonCustomClasses,
label,
isPrimary,
variant,
noDefaultClasses = false,
onClick,
url
}, index) => {
let computedVariant = variant;
if (variant !== "primary" && !noDefaultClasses) {
computedVariant = !url ? "secondary" : "link";
}
if (typeof computedVariant === "undefined" && isPrimary) {
computedVariant = "primary";
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
__next40pxDefaultSize: true,
href: url,
variant: computedVariant,
onClick: url ? void 0 : onClick,
className: dist_clsx("components-notice__action", buttonCustomClasses),
children: label
}, index);
})
})]
}), isDismissible && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
size: "small",
className: "components-notice__dismiss",
icon: close_default,
label: (0,external_wp_i18n_namespaceObject.__)("Close"),
onClick: onDismissNotice
})]
});
}
var notice_default = Notice;
;// ./node_modules/@wordpress/components/build-module/notice/list.js
const list_noop = () => {
};
function NoticeList({
notices,
onRemove = list_noop,
className,
children
}) {
const removeNotice = (id) => () => onRemove(id);
className = dist_clsx("components-notice-list", className);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className,
children: [children, [...notices].reverse().map((notice) => {
const {
content,
...restNotice
} = notice;
return /* @__PURE__ */ (0,external_React_.createElement)(notice_default, {
...restNotice,
key: notice.id,
onRemove: removeNotice(notice.id)
}, notice.content);
})]
});
}
var list_default = NoticeList;
;// ./node_modules/@wordpress/components/build-module/panel/header.js
function PanelHeader({
label,
children
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-panel__header",
children: [label && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", {
children: label
}), children]
});
}
var header_default = PanelHeader;
;// ./node_modules/@wordpress/components/build-module/panel/index.js
function UnforwardedPanel({
header,
className,
children
}, ref) {
const classNames = dist_clsx(className, "components-panel");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: classNames,
ref,
children: [header && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(header_default, {
label: header
}), children]
});
}
const Panel = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedPanel);
var panel_default = Panel;
;// ./node_modules/@wordpress/icons/build-module/library/chevron-up.js
var chevron_up_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" }) });
;// ./node_modules/@wordpress/components/build-module/panel/body.js
const body_noop = () => {
};
function UnforwardedPanelBody(props, ref) {
const {
buttonProps = {},
children,
className,
icon,
initialOpen,
onToggle = body_noop,
opened,
title,
scrollAfterOpen = true
} = props;
const [isOpened, setIsOpened] = use_controlled_state_default(opened, {
initial: initialOpen === void 0 ? true : initialOpen,
fallback: false
});
const nodeRef = (0,external_wp_element_namespaceObject.useRef)(null);
const scrollBehavior = (0,external_wp_compose_namespaceObject.useReducedMotion)() ? "auto" : "smooth";
const handleOnToggle = (event) => {
event.preventDefault();
const next = !isOpened;
setIsOpened(next);
onToggle(next);
};
const scrollAfterOpenRef = (0,external_wp_element_namespaceObject.useRef)();
scrollAfterOpenRef.current = scrollAfterOpen;
use_update_effect_default(() => {
if (isOpened && scrollAfterOpenRef.current && nodeRef.current?.scrollIntoView) {
nodeRef.current.scrollIntoView({
inline: "nearest",
block: "nearest",
behavior: scrollBehavior
});
}
}, [isOpened, scrollBehavior]);
const classes = dist_clsx("components-panel__body", className, {
"is-opened": isOpened
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: classes,
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([nodeRef, ref]),
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelBodyTitle, {
icon,
isOpened: Boolean(isOpened),
onClick: handleOnToggle,
title,
...buttonProps
}), typeof children === "function" ? children({
opened: Boolean(isOpened)
}) : isOpened && children]
});
}
const PanelBodyTitle = (0,external_wp_element_namespaceObject.forwardRef)(({
isOpened,
icon,
title,
...props
}, ref) => {
if (!title) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", {
className: "components-panel__body-title",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(button_default, {
__next40pxDefaultSize: true,
className: "components-panel__body-toggle",
"aria-expanded": isOpened,
ref,
...props,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
"aria-hidden": "true",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
className: "components-panel__arrow",
icon: isOpened ? chevron_up_default : chevron_down_default
})
}), title, icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
icon,
className: "components-panel__icon",
size: 20
})]
})
});
});
const PanelBody = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedPanelBody);
var body_default = PanelBody;
;// ./node_modules/@wordpress/components/build-module/panel/row.js
function UnforwardedPanelRow({
className,
children
}, ref) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: dist_clsx("components-panel__row", className),
ref,
children
});
}
const PanelRow = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedPanelRow);
var row_default = PanelRow;
;// ./node_modules/@wordpress/components/build-module/placeholder/index.js
const PlaceholderIllustration = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
className: "components-placeholder__illustration",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 60 60",
preserveAspectRatio: "none",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
vectorEffect: "non-scaling-stroke",
d: "M60 60 0 0"
})
});
function Placeholder(props) {
const {
icon,
children,
label,
instructions,
className,
notices,
preview,
isColumnLayout,
withIllustration,
...additionalProps
} = props;
const [resizeListener, {
width
}] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
let modifierClassNames;
if (typeof width === "number") {
modifierClassNames = {
"is-large": width >= 480,
"is-medium": width >= 160 && width < 480,
"is-small": width < 160
};
}
const classes = dist_clsx("components-placeholder", className, modifierClassNames, withIllustration ? "has-illustration" : null);
const fieldsetClasses = dist_clsx("components-placeholder__fieldset", {
"is-column-layout": isColumnLayout
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (instructions) {
(0,external_wp_a11y_namespaceObject.speak)(instructions);
}
}, [instructions]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
...additionalProps,
className: classes,
children: [withIllustration ? PlaceholderIllustration : null, resizeListener, notices, preview && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "components-placeholder__preview",
children: preview
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-placeholder__label",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
icon
}), label]
}), !!instructions && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "components-placeholder__instructions",
children: instructions
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: fieldsetClasses,
children
})]
});
}
var placeholder_default = Placeholder;
;// ./node_modules/@wordpress/components/build-module/progress-bar/styles.js
function progress_bar_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
function animateProgressBar(isRtl = false) {
const animationDirection = isRtl ? "right" : "left";
return emotion_react_browser_esm_keyframes({
"0%": {
[animationDirection]: "-50%"
},
"100%": {
[animationDirection]: "100%"
}
});
}
const INDETERMINATE_TRACK_WIDTH = 50;
const styles_Track = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e15u147w2"
} : 0)("position:relative;overflow:hidden;height:", config_values_default.borderWidthFocus, ";background-color:color-mix(\n in srgb,\n ", COLORS.theme.foreground, ",\n transparent 90%\n );border-radius:", config_values_default.radiusFull, ";outline:2px solid transparent;outline-offset:2px;:where( & ){width:160px;}" + ( true ? "" : 0));
var progress_bar_styles_ref = true ? {
name: "152sa26",
styles: "width:var(--indicator-width);transition:width 0.4s ease-in-out"
} : 0;
const Indicator = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e15u147w1"
} : 0)("display:inline-block;position:absolute;top:0;height:100%;border-radius:", config_values_default.radiusFull, ";background-color:color-mix(\n in srgb,\n ", COLORS.theme.foreground, ",\n transparent 10%\n );outline:2px solid transparent;outline-offset:-2px;", ({
isIndeterminate
}) => isIndeterminate ? /* @__PURE__ */ emotion_react_browser_esm_css({
animationDuration: "1.5s",
animationTimingFunction: "ease-in-out",
animationIterationCount: "infinite",
animationName: animateProgressBar((0,external_wp_i18n_namespaceObject.isRTL)()),
width: `${INDETERMINATE_TRACK_WIDTH}%`
}, true ? "" : 0, true ? "" : 0) : progress_bar_styles_ref, ";" + ( true ? "" : 0));
const ProgressElement = /* @__PURE__ */ emotion_styled_base_browser_esm("progress", true ? {
target: "e15u147w0"
} : 0)( true ? {
name: "11fb690",
styles: "position:absolute;top:0;left:0;opacity:0;width:100%;height:100%"
} : 0);
;// ./node_modules/@wordpress/components/build-module/progress-bar/index.js
function UnforwardedProgressBar(props, ref) {
const {
className,
value,
...progressProps
} = props;
const isIndeterminate = !Number.isFinite(value);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_Track, {
className,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Indicator, {
style: {
"--indicator-width": !isIndeterminate ? `${value}%` : void 0
},
isIndeterminate
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ProgressElement, {
max: 100,
value,
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Loading \u2026"),
ref,
...progressProps
})]
});
}
const ProgressBar = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedProgressBar);
var progress_bar_default = ProgressBar;
;// ./node_modules/@wordpress/components/build-module/query-controls/terms.js
const ensureParentsAreDefined = (terms) => {
return terms.every((term) => term.parent !== null);
};
function buildTermsTree(flatTerms) {
const flatTermsWithParentAndChildren = flatTerms.map((term) => ({
children: [],
parent: null,
...term,
id: String(term.id)
}));
if (!ensureParentsAreDefined(flatTermsWithParentAndChildren)) {
return flatTermsWithParentAndChildren;
}
const termsByParent = flatTermsWithParentAndChildren.reduce((acc, term) => {
const {
parent
} = term;
if (!acc[parent]) {
acc[parent] = [];
}
acc[parent].push(term);
return acc;
}, {});
const fillWithChildren = (terms) => {
return terms.map((term) => {
const children = termsByParent[term.id];
return {
...term,
children: children && children.length ? fillWithChildren(children) : []
};
});
};
return fillWithChildren(termsByParent["0"] || []);
}
;// external ["wp","htmlEntities"]
const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
;// ./node_modules/@wordpress/components/build-module/tree-select/index.js
const tree_select_CONTEXT_VALUE = {
BaseControl: {
// Temporary during deprecation grace period: Overrides the underlying `__associatedWPComponentName`
// via the context system to override the value set by SelectControl.
_overrides: {
__associatedWPComponentName: "TreeSelect"
}
}
};
function getSelectOptions(tree, level = 0) {
return tree.flatMap((treeNode) => [{
value: treeNode.id,
label: "\xA0".repeat(level * 3) + (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(treeNode.name)
}, ...getSelectOptions(treeNode.children || [], level + 1)]);
}
function TreeSelect(props) {
const {
label,
noOptionLabel,
onChange,
selectedId,
tree = [],
...restProps
} = useDeprecated36pxDefaultSizeProp(props);
const options = (0,external_wp_element_namespaceObject.useMemo)(() => {
return [noOptionLabel && {
value: "",
label: noOptionLabel
}, ...getSelectOptions(tree)].filter((option) => !!option);
}, [noOptionLabel, tree]);
maybeWarnDeprecated36pxSize({
componentName: "TreeSelect",
size: restProps.size,
__next40pxDefaultSize: restProps.__next40pxDefaultSize
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextSystemProvider, {
value: tree_select_CONTEXT_VALUE,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectControl, {
__shouldNotWarnDeprecated36pxSize: true,
label,
options,
onChange,
value: selectedId,
...restProps
})
});
}
var tree_select_default = TreeSelect;
;// ./node_modules/@wordpress/components/build-module/query-controls/author-select.js
function AuthorSelect({
__next40pxDefaultSize,
label,
noOptionLabel,
authorList,
selectedAuthorId,
onChange: onChangeProp
}) {
if (!authorList) {
return null;
}
const termsTree = buildTermsTree(authorList);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tree_select_default, {
label,
noOptionLabel,
onChange: onChangeProp,
tree: termsTree,
selectedId: selectedAuthorId !== void 0 ? String(selectedAuthorId) : void 0,
__nextHasNoMarginBottom: true,
__next40pxDefaultSize
});
}
;// ./node_modules/@wordpress/components/build-module/query-controls/category-select.js
function CategorySelect({
__next40pxDefaultSize,
label,
noOptionLabel,
categoriesList,
selectedCategoryId,
onChange: onChangeProp,
...props
}) {
const termsTree = (0,external_wp_element_namespaceObject.useMemo)(() => {
return buildTermsTree(categoriesList);
}, [categoriesList]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tree_select_default, {
label,
noOptionLabel,
onChange: onChangeProp,
tree: termsTree,
selectedId: selectedCategoryId !== void 0 ? String(selectedCategoryId) : void 0,
...props,
__nextHasNoMarginBottom: true,
__next40pxDefaultSize
});
}
;// ./node_modules/@wordpress/components/build-module/query-controls/index.js
const DEFAULT_MIN_ITEMS = 1;
const DEFAULT_MAX_ITEMS = 100;
const MAX_CATEGORIES_SUGGESTIONS = 20;
function isSingleCategorySelection(props) {
return "categoriesList" in props;
}
function isMultipleCategorySelection(props) {
return "categorySuggestions" in props;
}
const defaultOrderByOptions = [{
label: (0,external_wp_i18n_namespaceObject.__)("Newest to oldest"),
value: "date/desc"
}, {
label: (0,external_wp_i18n_namespaceObject.__)("Oldest to newest"),
value: "date/asc"
}, {
/* translators: Label for ordering posts by title in ascending order. */
label: (0,external_wp_i18n_namespaceObject.__)("A \u2192 Z"),
value: "title/asc"
}, {
/* translators: Label for ordering posts by title in descending order. */
label: (0,external_wp_i18n_namespaceObject.__)("Z \u2192 A"),
value: "title/desc"
}];
function QueryControls({
authorList,
selectedAuthorId,
numberOfItems,
order,
orderBy,
orderByOptions = defaultOrderByOptions,
maxItems = DEFAULT_MAX_ITEMS,
minItems = DEFAULT_MIN_ITEMS,
onAuthorChange,
onNumberOfItemsChange,
onOrderChange,
onOrderByChange,
// Props for single OR multiple category selection are not destructured here,
// but instead are destructured inline where necessary.
...props
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(v_stack_component_component_default, {
spacing: "4",
className: "components-query-controls",
children: [onOrderChange && onOrderByChange && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(select_control_default, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Order by"),
value: orderBy === void 0 || order === void 0 ? void 0 : `${orderBy}/${order}`,
options: orderByOptions,
onChange: (value) => {
if (typeof value !== "string") {
return;
}
const [newOrderBy, newOrder] = value.split("/");
if (newOrder !== order) {
onOrderChange(newOrder);
}
if (newOrderBy !== orderBy) {
onOrderByChange(newOrderBy);
}
}
}, "query-controls-order-select"), isSingleCategorySelection(props) && props.categoriesList && props.onCategoryChange && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CategorySelect, {
__next40pxDefaultSize: true,
categoriesList: props.categoriesList,
label: (0,external_wp_i18n_namespaceObject.__)("Category"),
noOptionLabel: (0,external_wp_i18n_namespaceObject._x)("All", "categories"),
selectedCategoryId: props.selectedCategoryId,
onChange: props.onCategoryChange
}, "query-controls-category-select"), isMultipleCategorySelection(props) && props.categorySuggestions && props.onCategoryChange && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(form_token_field_default, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Categories"),
value: props.selectedCategories && props.selectedCategories.map((item) => ({
id: item.id,
// Keeping the fallback to `item.value` for legacy reasons,
// even if items of `selectedCategories` should not have a
// `value` property.
// @ts-expect-error
value: item.name || item.value
})),
suggestions: Object.keys(props.categorySuggestions),
onChange: props.onCategoryChange,
maxSuggestions: MAX_CATEGORIES_SUGGESTIONS
}, "query-controls-categories-select"), onAuthorChange && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(AuthorSelect, {
__next40pxDefaultSize: true,
authorList,
label: (0,external_wp_i18n_namespaceObject.__)("Author"),
noOptionLabel: (0,external_wp_i18n_namespaceObject._x)("All", "authors"),
selectedAuthorId,
onChange: onAuthorChange
}, "query-controls-author-select"), onNumberOfItemsChange && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(range_control_default, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Number of items"),
value: numberOfItems,
onChange: onNumberOfItemsChange,
min: minItems,
max: maxItems,
required: true
}, "query-controls-range-control")]
});
}
var query_controls_default = QueryControls;
;// ./node_modules/@wordpress/components/build-module/radio-group/context.js
const RadioGroupContext = (0,external_wp_element_namespaceObject.createContext)({
store: void 0,
disabled: void 0
});
RadioGroupContext.displayName = "RadioGroupContext";
;// ./node_modules/@wordpress/components/build-module/radio-group/radio.js
function UnforwardedRadio({
value,
children,
...props
}, ref) {
const {
store,
disabled
} = (0,external_wp_element_namespaceObject.useContext)(RadioGroupContext);
const selectedValue = useStoreState(store, "value");
const isChecked = selectedValue !== void 0 && selectedValue === value;
maybeWarnDeprecated36pxSize({
componentName: "Radio",
size: void 0,
__next40pxDefaultSize: props.__next40pxDefaultSize
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Radio, {
disabled,
store,
ref,
value,
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
variant: isChecked ? "primary" : "secondary",
...props
}),
children: children || value
});
}
const radio_Radio = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedRadio);
var radio_default = radio_Radio;
;// ./node_modules/@wordpress/components/build-module/radio-group/index.js
function UnforwardedRadioGroup({
label,
checked,
defaultChecked,
disabled,
onChange,
children,
...props
}, ref) {
const radioStore = useRadioStore({
value: checked,
defaultValue: defaultChecked,
setValue: (newValue) => {
onChange?.(newValue !== null && newValue !== void 0 ? newValue : void 0);
},
rtl: (0,external_wp_i18n_namespaceObject.isRTL)()
});
const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
store: radioStore,
disabled
}), [radioStore, disabled]);
external_wp_deprecated_default()("wp.components.__experimentalRadioGroup", {
alternative: "wp.components.RadioControl or wp.components.__experimentalToggleGroupControl",
since: "6.8"
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RadioGroupContext.Provider, {
value: contextValue,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RadioGroup, {
store: radioStore,
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_group_default, {
__shouldNotWarnDeprecated: true,
children
}),
"aria-label": label,
ref,
...props
})
});
}
const radio_group_RadioGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedRadioGroup);
var radio_group_default = radio_group_RadioGroup;
;// ./node_modules/@wordpress/components/build-module/radio-control/index.js
function generateOptionDescriptionId(radioGroupId, index) {
return `${radioGroupId}-${index}-option-description`;
}
function generateOptionId(radioGroupId, index) {
return `${radioGroupId}-${index}`;
}
function generateHelpId(radioGroupId) {
return `${radioGroupId}__help`;
}
function RadioControl(props) {
const {
label,
className,
selected,
help,
onChange,
onClick,
hideLabelFromVision,
options = [],
id: preferredId,
...additionalProps
} = props;
const id = (0,external_wp_compose_namespaceObject.useInstanceId)(RadioControl, "inspector-radio-control", preferredId);
const onChangeValue = (event) => onChange(event.target.value);
if (!options?.length) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", {
id,
className: dist_clsx(className, "components-radio-control"),
"aria-describedby": !!help ? generateHelpId(id) : void 0,
children: [hideLabelFromVision ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
as: "legend",
children: label
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default.VisualLabel, {
as: "legend",
children: label
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(v_stack_component_component_default, {
spacing: 3,
className: dist_clsx("components-radio-control__group-wrapper", {
"has-help": !!help
}),
children: options.map((option, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-radio-control__option",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
id: generateOptionId(id, index),
className: "components-radio-control__input",
type: "radio",
name: id,
value: option.value,
onChange: onChangeValue,
checked: option.value === selected,
"aria-describedby": !!option.description ? generateOptionDescriptionId(id, index) : void 0,
onClick: (event) => {
event.currentTarget.focus();
onClick?.(event);
},
...additionalProps
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("label", {
className: "components-radio-control__label",
htmlFor: generateOptionId(id, index),
children: option.label
}), !!option.description ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledHelp, {
__nextHasNoMarginBottom: true,
id: generateOptionDescriptionId(id, index),
className: "components-radio-control__option-description",
children: option.description
}) : null]
}, generateOptionId(id, index)))
}), !!help && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledHelp, {
__nextHasNoMarginBottom: true,
id: generateHelpId(id),
className: "components-base-control__help",
children: help
})]
});
}
var radio_control_default = RadioControl;
;// ./node_modules/re-resizable/lib/resizer.js
var resizer_extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var resizer_assign = (undefined && undefined.__assign) || function () {
resizer_assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return resizer_assign.apply(this, arguments);
};
var rowSizeBase = {
width: '100%',
height: '10px',
top: '0px',
left: '0px',
cursor: 'row-resize',
};
var colSizeBase = {
width: '10px',
height: '100%',
top: '0px',
left: '0px',
cursor: 'col-resize',
};
var edgeBase = {
width: '20px',
height: '20px',
position: 'absolute',
};
var resizer_styles = {
top: resizer_assign(resizer_assign({}, rowSizeBase), { top: '-5px' }),
right: resizer_assign(resizer_assign({}, colSizeBase), { left: undefined, right: '-5px' }),
bottom: resizer_assign(resizer_assign({}, rowSizeBase), { top: undefined, bottom: '-5px' }),
left: resizer_assign(resizer_assign({}, colSizeBase), { left: '-5px' }),
topRight: resizer_assign(resizer_assign({}, edgeBase), { right: '-10px', top: '-10px', cursor: 'ne-resize' }),
bottomRight: resizer_assign(resizer_assign({}, edgeBase), { right: '-10px', bottom: '-10px', cursor: 'se-resize' }),
bottomLeft: resizer_assign(resizer_assign({}, edgeBase), { left: '-10px', bottom: '-10px', cursor: 'sw-resize' }),
topLeft: resizer_assign(resizer_assign({}, edgeBase), { left: '-10px', top: '-10px', cursor: 'nw-resize' }),
};
var Resizer = /** @class */ (function (_super) {
resizer_extends(Resizer, _super);
function Resizer() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.onMouseDown = function (e) {
_this.props.onResizeStart(e, _this.props.direction);
};
_this.onTouchStart = function (e) {
_this.props.onResizeStart(e, _this.props.direction);
};
return _this;
}
Resizer.prototype.render = function () {
return (external_React_.createElement("div", { className: this.props.className || '', style: resizer_assign(resizer_assign({ position: 'absolute', userSelect: 'none' }, resizer_styles[this.props.direction]), (this.props.replaceStyles || {})), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children));
};
return Resizer;
}(external_React_.PureComponent));
;// ./node_modules/re-resizable/lib/index.js
var lib_extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var lib_assign = (undefined && undefined.__assign) || function () {
lib_assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return lib_assign.apply(this, arguments);
};
var DEFAULT_SIZE = {
width: 'auto',
height: 'auto',
};
var lib_clamp = function (n, min, max) { return Math.max(Math.min(n, max), min); };
var snap = function (n, size) { return Math.round(n / size) * size; };
var hasDirection = function (dir, target) {
return new RegExp(dir, 'i').test(target);
};
// INFO: In case of window is a Proxy and does not porxy Events correctly, use isTouchEvent & isMouseEvent to distinguish event type instead of `instanceof`.
var isTouchEvent = function (event) {
return Boolean(event.touches && event.touches.length);
};
var isMouseEvent = function (event) {
return Boolean((event.clientX || event.clientX === 0) &&
(event.clientY || event.clientY === 0));
};
var findClosestSnap = function (n, snapArray, snapGap) {
if (snapGap === void 0) { snapGap = 0; }
var closestGapIndex = snapArray.reduce(function (prev, curr, index) { return (Math.abs(curr - n) < Math.abs(snapArray[prev] - n) ? index : prev); }, 0);
var gap = Math.abs(snapArray[closestGapIndex] - n);
return snapGap === 0 || gap < snapGap ? snapArray[closestGapIndex] : n;
};
var getStringSize = function (n) {
n = n.toString();
if (n === 'auto') {
return n;
}
if (n.endsWith('px')) {
return n;
}
if (n.endsWith('%')) {
return n;
}
if (n.endsWith('vh')) {
return n;
}
if (n.endsWith('vw')) {
return n;
}
if (n.endsWith('vmax')) {
return n;
}
if (n.endsWith('vmin')) {
return n;
}
return n + "px";
};
var getPixelSize = function (size, parentSize, innerWidth, innerHeight) {
if (size && typeof size === 'string') {
if (size.endsWith('px')) {
return Number(size.replace('px', ''));
}
if (size.endsWith('%')) {
var ratio = Number(size.replace('%', '')) / 100;
return parentSize * ratio;
}
if (size.endsWith('vw')) {
var ratio = Number(size.replace('vw', '')) / 100;
return innerWidth * ratio;
}
if (size.endsWith('vh')) {
var ratio = Number(size.replace('vh', '')) / 100;
return innerHeight * ratio;
}
}
return size;
};
var calculateNewMax = function (parentSize, innerWidth, innerHeight, maxWidth, maxHeight, minWidth, minHeight) {
maxWidth = getPixelSize(maxWidth, parentSize.width, innerWidth, innerHeight);
maxHeight = getPixelSize(maxHeight, parentSize.height, innerWidth, innerHeight);
minWidth = getPixelSize(minWidth, parentSize.width, innerWidth, innerHeight);
minHeight = getPixelSize(minHeight, parentSize.height, innerWidth, innerHeight);
return {
maxWidth: typeof maxWidth === 'undefined' ? undefined : Number(maxWidth),
maxHeight: typeof maxHeight === 'undefined' ? undefined : Number(maxHeight),
minWidth: typeof minWidth === 'undefined' ? undefined : Number(minWidth),
minHeight: typeof minHeight === 'undefined' ? undefined : Number(minHeight),
};
};
var definedProps = [
'as',
'style',
'className',
'grid',
'snap',
'bounds',
'boundsByDirection',
'size',
'defaultSize',
'minWidth',
'minHeight',
'maxWidth',
'maxHeight',
'lockAspectRatio',
'lockAspectRatioExtraWidth',
'lockAspectRatioExtraHeight',
'enable',
'handleStyles',
'handleClasses',
'handleWrapperStyle',
'handleWrapperClass',
'children',
'onResizeStart',
'onResize',
'onResizeStop',
'handleComponent',
'scale',
'resizeRatio',
'snapGap',
];
// HACK: This class is used to calculate % size.
var baseClassName = '__resizable_base__';
var Resizable = /** @class */ (function (_super) {
lib_extends(Resizable, _super);
function Resizable(props) {
var _this = _super.call(this, props) || this;
_this.ratio = 1;
_this.resizable = null;
// For parent boundary
_this.parentLeft = 0;
_this.parentTop = 0;
// For boundary
_this.resizableLeft = 0;
_this.resizableRight = 0;
_this.resizableTop = 0;
_this.resizableBottom = 0;
// For target boundary
_this.targetLeft = 0;
_this.targetTop = 0;
_this.appendBase = function () {
if (!_this.resizable || !_this.window) {
return null;
}
var parent = _this.parentNode;
if (!parent) {
return null;
}
var element = _this.window.document.createElement('div');
element.style.width = '100%';
element.style.height = '100%';
element.style.position = 'absolute';
element.style.transform = 'scale(0, 0)';
element.style.left = '0';
element.style.flex = '0 0 100%';
if (element.classList) {
element.classList.add(baseClassName);
}
else {
element.className += baseClassName;
}
parent.appendChild(element);
return element;
};
_this.removeBase = function (base) {
var parent = _this.parentNode;
if (!parent) {
return;
}
parent.removeChild(base);
};
_this.ref = function (c) {
if (c) {
_this.resizable = c;
}
};
_this.state = {
isResizing: false,
width: typeof (_this.propsSize && _this.propsSize.width) === 'undefined'
? 'auto'
: _this.propsSize && _this.propsSize.width,
height: typeof (_this.propsSize && _this.propsSize.height) === 'undefined'
? 'auto'
: _this.propsSize && _this.propsSize.height,
direction: 'right',
original: {
x: 0,
y: 0,
width: 0,
height: 0,
},
backgroundStyle: {
height: '100%',
width: '100%',
backgroundColor: 'rgba(0,0,0,0)',
cursor: 'auto',
opacity: 0,
position: 'fixed',
zIndex: 9999,
top: '0',
left: '0',
bottom: '0',
right: '0',
},
flexBasis: undefined,
};
_this.onResizeStart = _this.onResizeStart.bind(_this);
_this.onMouseMove = _this.onMouseMove.bind(_this);
_this.onMouseUp = _this.onMouseUp.bind(_this);
return _this;
}
Object.defineProperty(Resizable.prototype, "parentNode", {
get: function () {
if (!this.resizable) {
return null;
}
return this.resizable.parentNode;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Resizable.prototype, "window", {
get: function () {
if (!this.resizable) {
return null;
}
if (!this.resizable.ownerDocument) {
return null;
}
return this.resizable.ownerDocument.defaultView;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Resizable.prototype, "propsSize", {
get: function () {
return this.props.size || this.props.defaultSize || DEFAULT_SIZE;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Resizable.prototype, "size", {
get: function () {
var width = 0;
var height = 0;
if (this.resizable && this.window) {
var orgWidth = this.resizable.offsetWidth;
var orgHeight = this.resizable.offsetHeight;
// HACK: Set position `relative` to get parent size.
// This is because when re-resizable set `absolute`, I can not get base width correctly.
var orgPosition = this.resizable.style.position;
if (orgPosition !== 'relative') {
this.resizable.style.position = 'relative';
}
// INFO: Use original width or height if set auto.
width = this.resizable.style.width !== 'auto' ? this.resizable.offsetWidth : orgWidth;
height = this.resizable.style.height !== 'auto' ? this.resizable.offsetHeight : orgHeight;
// Restore original position
this.resizable.style.position = orgPosition;
}
return { width: width, height: height };
},
enumerable: false,
configurable: true
});
Object.defineProperty(Resizable.prototype, "sizeStyle", {
get: function () {
var _this = this;
var size = this.props.size;
var getSize = function (key) {
if (typeof _this.state[key] === 'undefined' || _this.state[key] === 'auto') {
return 'auto';
}
if (_this.propsSize && _this.propsSize[key] && _this.propsSize[key].toString().endsWith('%')) {
if (_this.state[key].toString().endsWith('%')) {
return _this.state[key].toString();
}
var parentSize = _this.getParentSize();
var value = Number(_this.state[key].toString().replace('px', ''));
var percent = (value / parentSize[key]) * 100;
return percent + "%";
}
return getStringSize(_this.state[key]);
};
var width = size && typeof size.width !== 'undefined' && !this.state.isResizing
? getStringSize(size.width)
: getSize('width');
var height = size && typeof size.height !== 'undefined' && !this.state.isResizing
? getStringSize(size.height)
: getSize('height');
return { width: width, height: height };
},
enumerable: false,
configurable: true
});
Resizable.prototype.getParentSize = function () {
if (!this.parentNode) {
if (!this.window) {
return { width: 0, height: 0 };
}
return { width: this.window.innerWidth, height: this.window.innerHeight };
}
var base = this.appendBase();
if (!base) {
return { width: 0, height: 0 };
}
// INFO: To calculate parent width with flex layout
var wrapChanged = false;
var wrap = this.parentNode.style.flexWrap;
if (wrap !== 'wrap') {
wrapChanged = true;
this.parentNode.style.flexWrap = 'wrap';
// HACK: Use relative to get parent padding size
}
base.style.position = 'relative';
base.style.minWidth = '100%';
base.style.minHeight = '100%';
var size = {
width: base.offsetWidth,
height: base.offsetHeight,
};
if (wrapChanged) {
this.parentNode.style.flexWrap = wrap;
}
this.removeBase(base);
return size;
};
Resizable.prototype.bindEvents = function () {
if (this.window) {
this.window.addEventListener('mouseup', this.onMouseUp);
this.window.addEventListener('mousemove', this.onMouseMove);
this.window.addEventListener('mouseleave', this.onMouseUp);
this.window.addEventListener('touchmove', this.onMouseMove, {
capture: true,
passive: false,
});
this.window.addEventListener('touchend', this.onMouseUp);
}
};
Resizable.prototype.unbindEvents = function () {
if (this.window) {
this.window.removeEventListener('mouseup', this.onMouseUp);
this.window.removeEventListener('mousemove', this.onMouseMove);
this.window.removeEventListener('mouseleave', this.onMouseUp);
this.window.removeEventListener('touchmove', this.onMouseMove, true);
this.window.removeEventListener('touchend', this.onMouseUp);
}
};
Resizable.prototype.componentDidMount = function () {
if (!this.resizable || !this.window) {
return;
}
var computedStyle = this.window.getComputedStyle(this.resizable);
this.setState({
width: this.state.width || this.size.width,
height: this.state.height || this.size.height,
flexBasis: computedStyle.flexBasis !== 'auto' ? computedStyle.flexBasis : undefined,
});
};
Resizable.prototype.componentWillUnmount = function () {
if (this.window) {
this.unbindEvents();
}
};
Resizable.prototype.createSizeForCssProperty = function (newSize, kind) {
var propsSize = this.propsSize && this.propsSize[kind];
return this.state[kind] === 'auto' &&
this.state.original[kind] === newSize &&
(typeof propsSize === 'undefined' || propsSize === 'auto')
? 'auto'
: newSize;
};
Resizable.prototype.calculateNewMaxFromBoundary = function (maxWidth, maxHeight) {
var boundsByDirection = this.props.boundsByDirection;
var direction = this.state.direction;
var widthByDirection = boundsByDirection && hasDirection('left', direction);
var heightByDirection = boundsByDirection && hasDirection('top', direction);
var boundWidth;
var boundHeight;
if (this.props.bounds === 'parent') {
var parent_1 = this.parentNode;
if (parent_1) {
boundWidth = widthByDirection
? this.resizableRight - this.parentLeft
: parent_1.offsetWidth + (this.parentLeft - this.resizableLeft);
boundHeight = heightByDirection
? this.resizableBottom - this.parentTop
: parent_1.offsetHeight + (this.parentTop - this.resizableTop);
}
}
else if (this.props.bounds === 'window') {
if (this.window) {
boundWidth = widthByDirection ? this.resizableRight : this.window.innerWidth - this.resizableLeft;
boundHeight = heightByDirection ? this.resizableBottom : this.window.innerHeight - this.resizableTop;
}
}
else if (this.props.bounds) {
boundWidth = widthByDirection
? this.resizableRight - this.targetLeft
: this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft);
boundHeight = heightByDirection
? this.resizableBottom - this.targetTop
: this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop);
}
if (boundWidth && Number.isFinite(boundWidth)) {
maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth;
}
if (boundHeight && Number.isFinite(boundHeight)) {
maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight;
}
return { maxWidth: maxWidth, maxHeight: maxHeight };
};
Resizable.prototype.calculateNewSizeFromDirection = function (clientX, clientY) {
var scale = this.props.scale || 1;
var resizeRatio = this.props.resizeRatio || 1;
var _a = this.state, direction = _a.direction, original = _a.original;
var _b = this.props, lockAspectRatio = _b.lockAspectRatio, lockAspectRatioExtraHeight = _b.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _b.lockAspectRatioExtraWidth;
var newWidth = original.width;
var newHeight = original.height;
var extraHeight = lockAspectRatioExtraHeight || 0;
var extraWidth = lockAspectRatioExtraWidth || 0;
if (hasDirection('right', direction)) {
newWidth = original.width + ((clientX - original.x) * resizeRatio) / scale;
if (lockAspectRatio) {
newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;
}
}
if (hasDirection('left', direction)) {
newWidth = original.width - ((clientX - original.x) * resizeRatio) / scale;
if (lockAspectRatio) {
newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;
}
}
if (hasDirection('bottom', direction)) {
newHeight = original.height + ((clientY - original.y) * resizeRatio) / scale;
if (lockAspectRatio) {
newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;
}
}
if (hasDirection('top', direction)) {
newHeight = original.height - ((clientY - original.y) * resizeRatio) / scale;
if (lockAspectRatio) {
newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;
}
}
return { newWidth: newWidth, newHeight: newHeight };
};
Resizable.prototype.calculateNewSizeFromAspectRatio = function (newWidth, newHeight, max, min) {
var _a = this.props, lockAspectRatio = _a.lockAspectRatio, lockAspectRatioExtraHeight = _a.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _a.lockAspectRatioExtraWidth;
var computedMinWidth = typeof min.width === 'undefined' ? 10 : min.width;
var computedMaxWidth = typeof max.width === 'undefined' || max.width < 0 ? newWidth : max.width;
var computedMinHeight = typeof min.height === 'undefined' ? 10 : min.height;
var computedMaxHeight = typeof max.height === 'undefined' || max.height < 0 ? newHeight : max.height;
var extraHeight = lockAspectRatioExtraHeight || 0;
var extraWidth = lockAspectRatioExtraWidth || 0;
if (lockAspectRatio) {
var extraMinWidth = (computedMinHeight - extraHeight) * this.ratio + extraWidth;
var extraMaxWidth = (computedMaxHeight - extraHeight) * this.ratio + extraWidth;
var extraMinHeight = (computedMinWidth - extraWidth) / this.ratio + extraHeight;
var extraMaxHeight = (computedMaxWidth - extraWidth) / this.ratio + extraHeight;
var lockedMinWidth = Math.max(computedMinWidth, extraMinWidth);
var lockedMaxWidth = Math.min(computedMaxWidth, extraMaxWidth);
var lockedMinHeight = Math.max(computedMinHeight, extraMinHeight);
var lockedMaxHeight = Math.min(computedMaxHeight, extraMaxHeight);
newWidth = lib_clamp(newWidth, lockedMinWidth, lockedMaxWidth);
newHeight = lib_clamp(newHeight, lockedMinHeight, lockedMaxHeight);
}
else {
newWidth = lib_clamp(newWidth, computedMinWidth, computedMaxWidth);
newHeight = lib_clamp(newHeight, computedMinHeight, computedMaxHeight);
}
return { newWidth: newWidth, newHeight: newHeight };
};
Resizable.prototype.setBoundingClientRect = function () {
// For parent boundary
if (this.props.bounds === 'parent') {
var parent_2 = this.parentNode;
if (parent_2) {
var parentRect = parent_2.getBoundingClientRect();
this.parentLeft = parentRect.left;
this.parentTop = parentRect.top;
}
}
// For target(html element) boundary
if (this.props.bounds && typeof this.props.bounds !== 'string') {
var targetRect = this.props.bounds.getBoundingClientRect();
this.targetLeft = targetRect.left;
this.targetTop = targetRect.top;
}
// For boundary
if (this.resizable) {
var _a = this.resizable.getBoundingClientRect(), left = _a.left, top_1 = _a.top, right = _a.right, bottom = _a.bottom;
this.resizableLeft = left;
this.resizableRight = right;
this.resizableTop = top_1;
this.resizableBottom = bottom;
}
};
Resizable.prototype.onResizeStart = function (event, direction) {
if (!this.resizable || !this.window) {
return;
}
var clientX = 0;
var clientY = 0;
if (event.nativeEvent && isMouseEvent(event.nativeEvent)) {
clientX = event.nativeEvent.clientX;
clientY = event.nativeEvent.clientY;
}
else if (event.nativeEvent && isTouchEvent(event.nativeEvent)) {
clientX = event.nativeEvent.touches[0].clientX;
clientY = event.nativeEvent.touches[0].clientY;
}
if (this.props.onResizeStart) {
if (this.resizable) {
var startResize = this.props.onResizeStart(event, direction, this.resizable);
if (startResize === false) {
return;
}
}
}
// Fix #168
if (this.props.size) {
if (typeof this.props.size.height !== 'undefined' && this.props.size.height !== this.state.height) {
this.setState({ height: this.props.size.height });
}
if (typeof this.props.size.width !== 'undefined' && this.props.size.width !== this.state.width) {
this.setState({ width: this.props.size.width });
}
}
// For lockAspectRatio case
this.ratio =
typeof this.props.lockAspectRatio === 'number' ? this.props.lockAspectRatio : this.size.width / this.size.height;
var flexBasis;
var computedStyle = this.window.getComputedStyle(this.resizable);
if (computedStyle.flexBasis !== 'auto') {
var parent_3 = this.parentNode;
if (parent_3) {
var dir = this.window.getComputedStyle(parent_3).flexDirection;
this.flexDir = dir.startsWith('row') ? 'row' : 'column';
flexBasis = computedStyle.flexBasis;
}
}
// For boundary
this.setBoundingClientRect();
this.bindEvents();
var state = {
original: {
x: clientX,
y: clientY,
width: this.size.width,
height: this.size.height,
},
isResizing: true,
backgroundStyle: lib_assign(lib_assign({}, this.state.backgroundStyle), { cursor: this.window.getComputedStyle(event.target).cursor || 'auto' }),
direction: direction,
flexBasis: flexBasis,
};
this.setState(state);
};
Resizable.prototype.onMouseMove = function (event) {
var _this = this;
if (!this.state.isResizing || !this.resizable || !this.window) {
return;
}
if (this.window.TouchEvent && isTouchEvent(event)) {
try {
event.preventDefault();
event.stopPropagation();
}
catch (e) {
// Ignore on fail
}
}
var _a = this.props, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, minWidth = _a.minWidth, minHeight = _a.minHeight;
var clientX = isTouchEvent(event) ? event.touches[0].clientX : event.clientX;
var clientY = isTouchEvent(event) ? event.touches[0].clientY : event.clientY;
var _b = this.state, direction = _b.direction, original = _b.original, width = _b.width, height = _b.height;
var parentSize = this.getParentSize();
var max = calculateNewMax(parentSize, this.window.innerWidth, this.window.innerHeight, maxWidth, maxHeight, minWidth, minHeight);
maxWidth = max.maxWidth;
maxHeight = max.maxHeight;
minWidth = max.minWidth;
minHeight = max.minHeight;
// Calculate new size
var _c = this.calculateNewSizeFromDirection(clientX, clientY), newHeight = _c.newHeight, newWidth = _c.newWidth;
// Calculate max size from boundary settings
var boundaryMax = this.calculateNewMaxFromBoundary(maxWidth, maxHeight);
if (this.props.snap && this.props.snap.x) {
newWidth = findClosestSnap(newWidth, this.props.snap.x, this.props.snapGap);
}
if (this.props.snap && this.props.snap.y) {
newHeight = findClosestSnap(newHeight, this.props.snap.y, this.props.snapGap);
}
// Calculate new size from aspect ratio
var newSize = this.calculateNewSizeFromAspectRatio(newWidth, newHeight, { width: boundaryMax.maxWidth, height: boundaryMax.maxHeight }, { width: minWidth, height: minHeight });
newWidth = newSize.newWidth;
newHeight = newSize.newHeight;
if (this.props.grid) {
var newGridWidth = snap(newWidth, this.props.grid[0]);
var newGridHeight = snap(newHeight, this.props.grid[1]);
var gap = this.props.snapGap || 0;
newWidth = gap === 0 || Math.abs(newGridWidth - newWidth) <= gap ? newGridWidth : newWidth;
newHeight = gap === 0 || Math.abs(newGridHeight - newHeight) <= gap ? newGridHeight : newHeight;
}
var delta = {
width: newWidth - original.width,
height: newHeight - original.height,
};
if (width && typeof width === 'string') {
if (width.endsWith('%')) {
var percent = (newWidth / parentSize.width) * 100;
newWidth = percent + "%";
}
else if (width.endsWith('vw')) {
var vw = (newWidth / this.window.innerWidth) * 100;
newWidth = vw + "vw";
}
else if (width.endsWith('vh')) {
var vh = (newWidth / this.window.innerHeight) * 100;
newWidth = vh + "vh";
}
}
if (height && typeof height === 'string') {
if (height.endsWith('%')) {
var percent = (newHeight / parentSize.height) * 100;
newHeight = percent + "%";
}
else if (height.endsWith('vw')) {
var vw = (newHeight / this.window.innerWidth) * 100;
newHeight = vw + "vw";
}
else if (height.endsWith('vh')) {
var vh = (newHeight / this.window.innerHeight) * 100;
newHeight = vh + "vh";
}
}
var newState = {
width: this.createSizeForCssProperty(newWidth, 'width'),
height: this.createSizeForCssProperty(newHeight, 'height'),
};
if (this.flexDir === 'row') {
newState.flexBasis = newState.width;
}
else if (this.flexDir === 'column') {
newState.flexBasis = newState.height;
}
// For v18, update state sync
(0,external_ReactDOM_namespaceObject.flushSync)(function () {
_this.setState(newState);
});
if (this.props.onResize) {
this.props.onResize(event, direction, this.resizable, delta);
}
};
Resizable.prototype.onMouseUp = function (event) {
var _a = this.state, isResizing = _a.isResizing, direction = _a.direction, original = _a.original;
if (!isResizing || !this.resizable) {
return;
}
var delta = {
width: this.size.width - original.width,
height: this.size.height - original.height,
};
if (this.props.onResizeStop) {
this.props.onResizeStop(event, direction, this.resizable, delta);
}
if (this.props.size) {
this.setState(this.props.size);
}
this.unbindEvents();
this.setState({
isResizing: false,
backgroundStyle: lib_assign(lib_assign({}, this.state.backgroundStyle), { cursor: 'auto' }),
});
};
Resizable.prototype.updateSize = function (size) {
this.setState({ width: size.width, height: size.height });
};
Resizable.prototype.renderResizer = function () {
var _this = this;
var _a = this.props, enable = _a.enable, handleStyles = _a.handleStyles, handleClasses = _a.handleClasses, handleWrapperStyle = _a.handleWrapperStyle, handleWrapperClass = _a.handleWrapperClass, handleComponent = _a.handleComponent;
if (!enable) {
return null;
}
var resizers = Object.keys(enable).map(function (dir) {
if (enable[dir] !== false) {
return (external_React_.createElement(Resizer, { key: dir, direction: dir, onResizeStart: _this.onResizeStart, replaceStyles: handleStyles && handleStyles[dir], className: handleClasses && handleClasses[dir] }, handleComponent && handleComponent[dir] ? handleComponent[dir] : null));
}
return null;
});
// #93 Wrap the resize box in span (will not break 100% width/height)
return (external_React_.createElement("div", { className: handleWrapperClass, style: handleWrapperStyle }, resizers));
};
Resizable.prototype.render = function () {
var _this = this;
var extendsProps = Object.keys(this.props).reduce(function (acc, key) {
if (definedProps.indexOf(key) !== -1) {
return acc;
}
acc[key] = _this.props[key];
return acc;
}, {});
var style = lib_assign(lib_assign(lib_assign({ position: 'relative', userSelect: this.state.isResizing ? 'none' : 'auto' }, this.props.style), this.sizeStyle), { maxWidth: this.props.maxWidth, maxHeight: this.props.maxHeight, minWidth: this.props.minWidth, minHeight: this.props.minHeight, boxSizing: 'border-box', flexShrink: 0 });
if (this.state.flexBasis) {
style.flexBasis = this.state.flexBasis;
}
var Wrapper = this.props.as || 'div';
return (external_React_.createElement(Wrapper, lib_assign({ ref: this.ref, style: style, className: this.props.className }, extendsProps),
this.state.isResizing && external_React_.createElement("div", { style: this.state.backgroundStyle }),
this.props.children,
this.renderResizer()));
};
Resizable.defaultProps = {
as: 'div',
onResizeStart: function () { },
onResize: function () { },
onResizeStop: function () { },
enable: {
top: true,
right: true,
bottom: true,
left: true,
topRight: true,
bottomRight: true,
bottomLeft: true,
topLeft: true,
},
style: {},
grid: [1, 1],
lockAspectRatio: false,
lockAspectRatioExtraWidth: 0,
lockAspectRatioExtraHeight: 0,
scale: 1,
resizeRatio: 1,
snapGap: 0,
};
return Resizable;
}(external_React_.PureComponent));
;// ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/utils.js
const utils_noop = () => {
};
const POSITIONS = {
bottom: "bottom",
corner: "corner"
};
function useResizeLabel({
axis,
fadeTimeout = 180,
onResize = utils_noop,
position = POSITIONS.bottom,
showPx = false
}) {
const [resizeListener, sizes] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
const isAxisControlled = !!axis;
const [moveX, setMoveX] = (0,external_wp_element_namespaceObject.useState)(false);
const [moveY, setMoveY] = (0,external_wp_element_namespaceObject.useState)(false);
const {
width,
height
} = sizes;
const heightRef = (0,external_wp_element_namespaceObject.useRef)(height);
const widthRef = (0,external_wp_element_namespaceObject.useRef)(width);
const moveTimeoutRef = (0,external_wp_element_namespaceObject.useRef)();
const debounceUnsetMoveXY = (0,external_wp_element_namespaceObject.useCallback)(() => {
const unsetMoveXY = () => {
if (isAxisControlled) {
return;
}
setMoveX(false);
setMoveY(false);
};
if (moveTimeoutRef.current) {
window.clearTimeout(moveTimeoutRef.current);
}
moveTimeoutRef.current = window.setTimeout(unsetMoveXY, fadeTimeout);
}, [fadeTimeout, isAxisControlled]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const isRendered = width !== null || height !== null;
if (!isRendered) {
return;
}
const didWidthChange = width !== widthRef.current;
const didHeightChange = height !== heightRef.current;
if (!didWidthChange && !didHeightChange) {
return;
}
if (width && !widthRef.current && height && !heightRef.current) {
widthRef.current = width;
heightRef.current = height;
return;
}
if (didWidthChange) {
setMoveX(true);
widthRef.current = width;
}
if (didHeightChange) {
setMoveY(true);
heightRef.current = height;
}
onResize({
width,
height
});
debounceUnsetMoveXY();
}, [width, height, onResize, debounceUnsetMoveXY]);
const label = getSizeLabel({
axis,
height,
moveX,
moveY,
position,
showPx,
width
});
return {
label,
resizeListener
};
}
function getSizeLabel({
axis,
height,
moveX = false,
moveY = false,
position = POSITIONS.bottom,
showPx = false,
width
}) {
if (!moveX && !moveY) {
return void 0;
}
if (position === POSITIONS.corner) {
return `${width} x ${height}`;
}
const labelUnit = showPx ? " px" : "";
if (axis) {
if (axis === "x" && moveX) {
return `${width}${labelUnit}`;
}
if (axis === "y" && moveY) {
return `${height}${labelUnit}`;
}
}
if (moveX && moveY) {
return `${width} x ${height}`;
}
if (moveX) {
return `${width}${labelUnit}`;
}
if (moveY) {
return `${height}${labelUnit}`;
}
return void 0;
}
;// ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js
function resize_tooltip_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const resize_tooltip_styles_Root = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e1wq7y4k3"
} : 0)( true ? {
name: "1cd7zoc",
styles: "bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0"
} : 0);
const TooltipWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e1wq7y4k2"
} : 0)( true ? {
name: "ajymcs",
styles: "align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear"
} : 0);
const resize_tooltip_styles_Tooltip = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e1wq7y4k1"
} : 0)("background:", COLORS.theme.foreground, ";border-radius:", config_values_default.radiusSmall, ";box-sizing:border-box;font-family:", font("default.fontFamily"), ";font-size:12px;color:", COLORS.theme.foregroundInverted, ";padding:4px 8px;position:relative;" + ( true ? "" : 0));
const LabelText = /* @__PURE__ */ emotion_styled_base_browser_esm(text_component_component_default, true ? {
target: "e1wq7y4k0"
} : 0)("&&&{color:", COLORS.theme.foregroundInverted, ";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/label.js
const CORNER_OFFSET = 4;
const CURSOR_OFFSET_TOP = CORNER_OFFSET * 2.5;
function resize_tooltip_label_Label({
label,
position = POSITIONS.corner,
zIndex = 1e3,
...props
}, ref) {
const showLabel = !!label;
const isBottom = position === POSITIONS.bottom;
const isCorner = position === POSITIONS.corner;
if (!showLabel) {
return null;
}
let style = {
opacity: showLabel ? 1 : void 0,
zIndex
};
let labelStyle = {};
if (isBottom) {
style = {
...style,
position: "absolute",
bottom: CURSOR_OFFSET_TOP * -1,
left: "50%",
transform: "translate(-50%, 0)"
};
labelStyle = {
transform: `translate(0, 100%)`
};
}
if (isCorner) {
style = {
...style,
position: "absolute",
top: CORNER_OFFSET,
right: (0,external_wp_i18n_namespaceObject.isRTL)() ? void 0 : CORNER_OFFSET,
left: (0,external_wp_i18n_namespaceObject.isRTL)() ? CORNER_OFFSET : void 0
};
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TooltipWrapper, {
"aria-hidden": "true",
className: "components-resizable-tooltip__tooltip-wrapper",
ref,
style,
...props,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(resize_tooltip_styles_Tooltip, {
className: "components-resizable-tooltip__tooltip",
style: labelStyle,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LabelText, {
as: "span",
children: label
})
})
});
}
const label_ForwardedComponent = (0,external_wp_element_namespaceObject.forwardRef)(resize_tooltip_label_Label);
var label_default = label_ForwardedComponent;
;// ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/index.js
const resize_tooltip_noop = () => {
};
function ResizeTooltip({
axis,
className,
fadeTimeout = 180,
isVisible = true,
labelRef,
onResize = resize_tooltip_noop,
position = POSITIONS.bottom,
showPx = true,
zIndex = 1e3,
...props
}, ref) {
const {
label,
resizeListener
} = useResizeLabel({
axis,
fadeTimeout,
onResize,
showPx,
position
});
if (!isVisible) {
return null;
}
const classes = dist_clsx("components-resize-tooltip", className);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(resize_tooltip_styles_Root, {
"aria-hidden": "true",
className: classes,
ref,
...props,
children: [resizeListener, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(label_default, {
"aria-hidden": props["aria-hidden"],
label,
position,
ref: labelRef,
zIndex
})]
});
}
const resize_tooltip_ForwardedComponent = (0,external_wp_element_namespaceObject.forwardRef)(ResizeTooltip);
var resize_tooltip_default = resize_tooltip_ForwardedComponent;
;// ./node_modules/@wordpress/components/build-module/resizable-box/index.js
const HANDLE_CLASS_NAME = "components-resizable-box__handle";
const SIDE_HANDLE_CLASS_NAME = "components-resizable-box__side-handle";
const CORNER_HANDLE_CLASS_NAME = "components-resizable-box__corner-handle";
const HANDLE_CLASSES = {
top: dist_clsx(HANDLE_CLASS_NAME, SIDE_HANDLE_CLASS_NAME, "components-resizable-box__handle-top"),
right: dist_clsx(HANDLE_CLASS_NAME, SIDE_HANDLE_CLASS_NAME, "components-resizable-box__handle-right"),
bottom: dist_clsx(HANDLE_CLASS_NAME, SIDE_HANDLE_CLASS_NAME, "components-resizable-box__handle-bottom"),
left: dist_clsx(HANDLE_CLASS_NAME, SIDE_HANDLE_CLASS_NAME, "components-resizable-box__handle-left"),
topLeft: dist_clsx(HANDLE_CLASS_NAME, CORNER_HANDLE_CLASS_NAME, "components-resizable-box__handle-top", "components-resizable-box__handle-left"),
topRight: dist_clsx(HANDLE_CLASS_NAME, CORNER_HANDLE_CLASS_NAME, "components-resizable-box__handle-top", "components-resizable-box__handle-right"),
bottomRight: dist_clsx(HANDLE_CLASS_NAME, CORNER_HANDLE_CLASS_NAME, "components-resizable-box__handle-bottom", "components-resizable-box__handle-right"),
bottomLeft: dist_clsx(HANDLE_CLASS_NAME, CORNER_HANDLE_CLASS_NAME, "components-resizable-box__handle-bottom", "components-resizable-box__handle-left")
};
const HANDLE_STYLES_OVERRIDES = {
width: void 0,
height: void 0,
top: void 0,
right: void 0,
bottom: void 0,
left: void 0
};
const HANDLE_STYLES = {
top: HANDLE_STYLES_OVERRIDES,
right: HANDLE_STYLES_OVERRIDES,
bottom: HANDLE_STYLES_OVERRIDES,
left: HANDLE_STYLES_OVERRIDES,
topLeft: HANDLE_STYLES_OVERRIDES,
topRight: HANDLE_STYLES_OVERRIDES,
bottomRight: HANDLE_STYLES_OVERRIDES,
bottomLeft: HANDLE_STYLES_OVERRIDES
};
function UnforwardedResizableBox({
className,
children,
showHandle = true,
__experimentalShowTooltip: showTooltip = false,
__experimentalTooltipProps: tooltipProps = {},
...props
}, ref) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Resizable, {
className: dist_clsx("components-resizable-box__container", showHandle && "has-show-handle", className),
handleComponent: Object.fromEntries(Object.keys(HANDLE_CLASSES).map((key) => [key, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
tabIndex: -1
}, key)])),
handleClasses: HANDLE_CLASSES,
handleStyles: HANDLE_STYLES,
ref,
...props,
children: [children, showTooltip && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(resize_tooltip_default, {
...tooltipProps
})]
});
}
const ResizableBox = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedResizableBox);
var resizable_box_default = ResizableBox;
;// ./node_modules/@wordpress/components/build-module/responsive-wrapper/index.js
function ResponsiveWrapper({
naturalWidth,
naturalHeight,
children,
isInline = false
}) {
if (external_wp_element_namespaceObject.Children.count(children) !== 1) {
return null;
}
const TagName = isInline ? "span" : "div";
let aspectRatio;
if (naturalWidth && naturalHeight) {
aspectRatio = `${naturalWidth} / ${naturalHeight}`;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, {
className: "components-responsive-wrapper",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
children: (0,external_wp_element_namespaceObject.cloneElement)(children, {
className: dist_clsx("components-responsive-wrapper__content", children.props.className),
style: {
...children.props.style,
aspectRatio
}
})
})
});
}
var responsive_wrapper_default = ResponsiveWrapper;
;// ./node_modules/@wordpress/components/build-module/sandbox/index.js
const observeAndResizeJS = function() {
const {
MutationObserver
} = window;
if (!MutationObserver || !document.body || !window.parent) {
return;
}
function sendResize() {
const clientBoundingRect = document.body.getBoundingClientRect();
window.parent.postMessage({
action: "resize",
width: clientBoundingRect.width,
height: clientBoundingRect.height
}, "*");
}
const observer = new MutationObserver(sendResize);
observer.observe(document.body, {
attributes: true,
attributeOldValue: false,
characterData: true,
characterDataOldValue: false,
childList: true,
subtree: true
});
window.addEventListener("load", sendResize, true);
function removeViewportStyles(ruleOrNode) {
if (ruleOrNode.style) {
["width", "height", "minHeight", "maxHeight"].forEach(function(style2) {
if (/^\\d+(vw|vh|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)$/.test(ruleOrNode.style[style2])) {
ruleOrNode.style[style2] = "";
}
});
}
}
Array.prototype.forEach.call(document.querySelectorAll("[style]"), removeViewportStyles);
Array.prototype.forEach.call(document.styleSheets, function(stylesheet) {
Array.prototype.forEach.call(stylesheet.cssRules || stylesheet.rules, removeViewportStyles);
});
document.body.style.position = "absolute";
document.body.style.width = "100%";
document.body.setAttribute("data-resizable-iframe-connected", "");
sendResize();
window.addEventListener("resize", sendResize, true);
};
const sandbox_style = `
body {
margin: 0;
}
html,
body,
body > div {
width: 100%;
}
html.wp-has-aspect-ratio,
body.wp-has-aspect-ratio,
body.wp-has-aspect-ratio > div,
body.wp-has-aspect-ratio > div iframe {
width: 100%;
height: 100%;
overflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */
}
body > div > * {
margin-top: 0 !important; /* Has to have !important to override inline styles. */
margin-bottom: 0 !important;
}
`;
function SandBox({
html = "",
title = "",
type,
styles = [],
scripts = [],
onFocus,
tabIndex
}) {
const ref = (0,external_wp_element_namespaceObject.useRef)();
const [width, setWidth] = (0,external_wp_element_namespaceObject.useState)(0);
const [height, setHeight] = (0,external_wp_element_namespaceObject.useState)(0);
function isFrameAccessible() {
try {
return !!ref.current?.contentDocument?.body;
} catch (e) {
return false;
}
}
function trySandBox(forceRerender = false) {
if (!isFrameAccessible()) {
return;
}
const {
contentDocument,
ownerDocument
} = ref.current;
if (!forceRerender && null !== contentDocument?.body.getAttribute("data-resizable-iframe-connected")) {
return;
}
const htmlDoc = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("html", {
lang: ownerDocument.documentElement.lang,
className: type,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("head", {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("title", {
children: title
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("style", {
dangerouslySetInnerHTML: {
__html: sandbox_style
}
}), styles.map((rules, i) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("style", {
dangerouslySetInnerHTML: {
__html: rules
}
}, i))]
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("body", {
"data-resizable-iframe-connected": "data-resizable-iframe-connected",
className: type,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
dangerouslySetInnerHTML: {
__html: html
}
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("script", {
type: "text/javascript",
dangerouslySetInnerHTML: {
__html: `(${observeAndResizeJS.toString()})();`
}
}), scripts.map((src) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("script", {
src
}, src))]
})]
});
contentDocument.open();
contentDocument.write("<!DOCTYPE html>" + (0,external_wp_element_namespaceObject.renderToString)(htmlDoc));
contentDocument.close();
}
(0,external_wp_element_namespaceObject.useEffect)(() => {
trySandBox();
function tryNoForceSandBox() {
trySandBox(false);
}
function checkMessageForResize(event) {
const iframe2 = ref.current;
if (!iframe2 || iframe2.contentWindow !== event.source) {
return;
}
let data = event.data || {};
if ("string" === typeof data) {
try {
data = JSON.parse(data);
} catch (e) {
}
}
if ("resize" !== data.action) {
return;
}
setWidth(data.width);
setHeight(data.height);
}
const iframe = ref.current;
const defaultView = iframe?.ownerDocument?.defaultView;
iframe?.addEventListener("load", tryNoForceSandBox, false);
defaultView?.addEventListener("message", checkMessageForResize);
return () => {
iframe?.removeEventListener("load", tryNoForceSandBox, false);
defaultView?.removeEventListener("message", checkMessageForResize);
};
}, []);
(0,external_wp_element_namespaceObject.useEffect)(() => {
trySandBox();
}, [title, styles, scripts]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
trySandBox(true);
}, [html, type]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("iframe", {
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useFocusableIframe)()]),
title,
tabIndex,
className: "components-sandbox",
sandbox: "allow-scripts allow-same-origin allow-presentation",
onFocus,
width: Math.ceil(width),
height: Math.ceil(height)
});
}
var sandbox_default = SandBox;
;// ./node_modules/@wordpress/components/build-module/snackbar/index.js
const NOTICE_TIMEOUT = 1e4;
function snackbar_useSpokenMessage(message, politeness) {
const spokenMessage = typeof message === "string" ? message : (0,external_wp_element_namespaceObject.renderToString)(message);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (spokenMessage) {
(0,external_wp_a11y_namespaceObject.speak)(spokenMessage, politeness);
}
}, [spokenMessage, politeness]);
}
function UnforwardedSnackbar({
className,
children,
spokenMessage = children,
politeness = "polite",
actions = [],
onRemove,
icon = null,
explicitDismiss = false,
// onDismiss is a callback executed when the snackbar is dismissed.
// It is distinct from onRemove, which _looks_ like a callback but is
// actually the function to call to remove the snackbar from the UI.
onDismiss,
listRef
}, ref) {
function dismissMe(event) {
if (event && event.preventDefault) {
event.preventDefault();
}
listRef?.current?.focus();
onDismiss?.();
onRemove?.();
}
function onActionClick(event, onClick) {
event.stopPropagation();
onRemove?.();
if (onClick) {
onClick(event);
}
}
snackbar_useSpokenMessage(spokenMessage, politeness);
const callbacksRef = (0,external_wp_element_namespaceObject.useRef)({
onDismiss,
onRemove
});
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
callbacksRef.current = {
onDismiss,
onRemove
};
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
const timeoutHandle = setTimeout(() => {
if (!explicitDismiss) {
callbacksRef.current.onDismiss?.();
callbacksRef.current.onRemove?.();
}
}, NOTICE_TIMEOUT);
return () => clearTimeout(timeoutHandle);
}, [explicitDismiss]);
const classes = dist_clsx(className, "components-snackbar", {
"components-snackbar-explicit-dismiss": !!explicitDismiss
});
if (actions && actions.length > 1) {
true ? external_wp_warning_default()("Snackbar can only have one action. Use Notice if your message requires many actions.") : 0;
actions = [actions[0]];
}
const snackbarContentClassnames = dist_clsx("components-snackbar__content", {
"components-snackbar__content-with-icon": !!icon
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
ref,
className: classes,
onClick: !explicitDismiss ? dismissMe : void 0,
tabIndex: 0,
role: !explicitDismiss ? "button" : void 0,
onKeyPress: !explicitDismiss ? dismissMe : void 0,
"aria-label": !explicitDismiss ? (0,external_wp_i18n_namespaceObject.__)("Dismiss this notice") : void 0,
"data-testid": "snackbar",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: snackbarContentClassnames,
children: [icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "components-snackbar__icon",
children: icon
}), children, actions.map(({
label,
onClick,
url,
openInNewTab = false
}, index) => url !== void 0 && openInNewTab ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_link_default, {
href: url,
onClick: (event) => onActionClick(event, onClick),
className: "components-snackbar__action",
children: label
}, index) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
__next40pxDefaultSize: true,
href: url,
variant: "link",
onClick: (event) => onActionClick(event, onClick),
className: "components-snackbar__action",
children: label
}, index)), explicitDismiss && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
role: "button",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Dismiss this notice"),
tabIndex: 0,
className: "components-snackbar__dismiss-button",
onClick: dismissMe,
onKeyPress: dismissMe,
children: "\u2715"
})]
})
});
}
const Snackbar = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSnackbar);
var snackbar_default = Snackbar;
;// ./node_modules/@wordpress/components/build-module/snackbar/list.js
const SNACKBAR_VARIANTS = {
init: {
height: 0,
opacity: 0
},
open: {
height: "auto",
opacity: 1,
transition: {
height: {
type: "tween",
duration: 0.3,
ease: [0, 0, 0.2, 1]
},
opacity: {
type: "tween",
duration: 0.25,
delay: 0.05,
ease: [0, 0, 0.2, 1]
}
}
},
exit: {
opacity: 0,
transition: {
type: "tween",
duration: 0.1,
ease: [0, 0, 0.2, 1]
}
}
};
function SnackbarList({
notices,
className,
children,
onRemove
}) {
const listRef = (0,external_wp_element_namespaceObject.useRef)(null);
const isReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
className = dist_clsx("components-snackbar-list", className);
const removeNotice = (notice) => () => onRemove?.(notice.id);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className,
tabIndex: -1,
ref: listRef,
"data-testid": "snackbar-list",
children: [children, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(AnimatePresence, {
children: notices.map((notice) => {
const {
content,
...restNotice
} = notice;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(motion.div, {
layout: !isReducedMotion,
initial: "init",
animate: "open",
exit: "exit",
variants: isReducedMotion ? void 0 : SNACKBAR_VARIANTS,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "components-snackbar-list__notice-container",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(snackbar_default, {
...restNotice,
onRemove: removeNotice(notice),
listRef,
children: notice.content
})
})
}, notice.id);
})
})]
});
}
var list_list_default = SnackbarList;
;// ./node_modules/@wordpress/components/build-module/surface/component.js
function UnconnectedSurface(props, forwardedRef) {
const surfaceProps = useSurface(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...surfaceProps,
ref: forwardedRef
});
}
const component_Surface = contextConnect(UnconnectedSurface, "Surface");
var surface_component_component_default = component_Surface;
;// ./node_modules/@ariakit/core/esm/tab/tab-store.js
"use client";
// src/tab/tab-store.ts
function createTabStore(_a = {}) {
var _b = _a, {
composite: parentComposite,
combobox
} = _b, props = _3YLGPPWQ_objRest(_b, [
"composite",
"combobox"
]);
const independentKeys = [
"items",
"renderedItems",
"moves",
"orientation",
"virtualFocus",
"includesBaseElement",
"baseElement",
"focusLoop",
"focusShift",
"focusWrap"
];
const store = mergeStore(
props.store,
omit2(parentComposite, independentKeys),
omit2(combobox, independentKeys)
);
const syncState = store == null ? void 0 : store.getState();
const composite = createCompositeStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
store,
// We need to explicitly set the default value of `includesBaseElement` to
// `false` since we don't want the composite store to default it to `true`
// when the activeId state is null, which could be the case when rendering
// combobox with tab.
includesBaseElement: defaultValue(
props.includesBaseElement,
syncState == null ? void 0 : syncState.includesBaseElement,
false
),
orientation: defaultValue(
props.orientation,
syncState == null ? void 0 : syncState.orientation,
"horizontal"
),
focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
}));
const panels = createCollectionStore();
const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, composite.getState()), {
selectedId: defaultValue(
props.selectedId,
syncState == null ? void 0 : syncState.selectedId,
props.defaultSelectedId
),
selectOnMove: defaultValue(
props.selectOnMove,
syncState == null ? void 0 : syncState.selectOnMove,
true
)
});
const tab = createStore(initialState, composite, store);
setup(
tab,
() => sync(tab, ["moves"], () => {
const { activeId, selectOnMove } = tab.getState();
if (!selectOnMove) return;
if (!activeId) return;
const tabItem = composite.item(activeId);
if (!tabItem) return;
if (tabItem.dimmed) return;
if (tabItem.disabled) return;
tab.setState("selectedId", tabItem.id);
})
);
let syncActiveId = true;
setup(
tab,
() => batch(tab, ["selectedId"], (state, prev) => {
if (!syncActiveId) {
syncActiveId = true;
return;
}
if (parentComposite && state.selectedId === prev.selectedId) return;
tab.setState("activeId", state.selectedId);
})
);
setup(
tab,
() => sync(tab, ["selectedId", "renderedItems"], (state) => {
if (state.selectedId !== void 0) return;
const { activeId, renderedItems } = tab.getState();
const tabItem = composite.item(activeId);
if (tabItem && !tabItem.disabled && !tabItem.dimmed) {
tab.setState("selectedId", tabItem.id);
} else {
const tabItem2 = renderedItems.find(
(item) => !item.disabled && !item.dimmed
);
tab.setState("selectedId", tabItem2 == null ? void 0 : tabItem2.id);
}
})
);
setup(
tab,
() => sync(tab, ["renderedItems"], (state) => {
const tabs = state.renderedItems;
if (!tabs.length) return;
return sync(panels, ["renderedItems"], (state2) => {
const items = state2.renderedItems;
const hasOrphanPanels = items.some((panel) => !panel.tabId);
if (!hasOrphanPanels) return;
items.forEach((panel, i) => {
if (panel.tabId) return;
const tabItem = tabs[i];
if (!tabItem) return;
panels.renderItem(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, panel), { tabId: tabItem.id }));
});
});
})
);
let selectedIdFromSelectedValue = null;
setup(tab, () => {
const backupSelectedId = () => {
selectedIdFromSelectedValue = tab.getState().selectedId;
};
const restoreSelectedId = () => {
syncActiveId = false;
tab.setState("selectedId", selectedIdFromSelectedValue);
};
if (parentComposite && "setSelectElement" in parentComposite) {
return chain(
sync(parentComposite, ["value"], backupSelectedId),
sync(parentComposite, ["mounted"], restoreSelectedId)
);
}
if (!combobox) return;
return chain(
sync(combobox, ["selectedValue"], backupSelectedId),
sync(combobox, ["mounted"], restoreSelectedId)
);
});
return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, composite), tab), {
panels,
setSelectedId: (id) => tab.setState("selectedId", id),
select: (id) => {
tab.setState("selectedId", id);
composite.move(id);
}
});
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/PY4NZ6HS.js
"use client";
// src/tab/tab-store.ts
function useTabStoreProps(store, update, props) {
useUpdateEffect(update, [props.composite, props.combobox]);
store = useCompositeStoreProps(store, update, props);
useStoreProps(store, props, "selectedId", "setSelectedId");
useStoreProps(store, props, "selectOnMove");
const [panels, updatePanels] = YV4JVR4I_useStore(() => store.panels, {});
useUpdateEffect(updatePanels, [store, updatePanels]);
return Object.assign(
(0,external_React_.useMemo)(() => _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, store), { panels }), [store, panels]),
{ composite: props.composite, combobox: props.combobox }
);
}
function useTabStore(props = {}) {
const combobox = useComboboxContext();
const composite = useSelectContext() || combobox;
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
composite: props.composite !== void 0 ? props.composite : composite,
combobox: props.combobox !== void 0 ? props.combobox : combobox
});
const [store, update] = YV4JVR4I_useStore(createTabStore, props);
return useTabStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/UYGDZTLQ.js
"use client";
// src/tab/tab-context.tsx
var UYGDZTLQ_ctx = createStoreContext(
[CompositeContextProvider],
[CompositeScopedContextProvider]
);
var useTabContext = UYGDZTLQ_ctx.useContext;
var useTabScopedContext = UYGDZTLQ_ctx.useScopedContext;
var useTabProviderContext = UYGDZTLQ_ctx.useProviderContext;
var TabContextProvider = UYGDZTLQ_ctx.ContextProvider;
var TabScopedContextProvider = UYGDZTLQ_ctx.ScopedContextProvider;
;// ./node_modules/@ariakit/react-core/esm/tab/tab-list.js
"use client";
// src/tab/tab-list.tsx
var tab_list_TagName = "div";
var useTabList = createHook(
function useTabList2(_a) {
var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
const context = useTabProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const orientation = store.useState(
(state) => state.orientation === "both" ? void 0 : state.orientation
);
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TabScopedContextProvider, { value: store, children: element }),
[store]
);
if (store.composite) {
props = _3YLGPPWQ_spreadValues({
focusable: false
}, props);
}
props = _3YLGPPWQ_spreadValues({
role: "tablist",
"aria-orientation": orientation
}, props);
props = useComposite(_3YLGPPWQ_spreadValues({ store }, props));
return props;
}
);
var TabList = forwardRef2(function TabList2(props) {
const htmlProps = useTabList(props);
return LMDWO4NN_createElement(tab_list_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/tab/tab.js
"use client";
// src/tab/tab.tsx
var tab_TagName = "button";
var useTab = createHook(function useTab2(_a) {
var _b = _a, {
store,
getItem: getItemProp
} = _b, props = __objRest(_b, [
"store",
"getItem"
]);
var _a2;
const context = useTabScopedContext();
store = store || context;
invariant(
store,
false && 0
);
const defaultId = useId();
const id = props.id || defaultId;
const dimmed = disabledFromProps(props);
const getItem = (0,external_React_.useCallback)(
(item) => {
const nextItem = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, item), { dimmed });
if (getItemProp) {
return getItemProp(nextItem);
}
return nextItem;
},
[dimmed, getItemProp]
);
const onClickProp = props.onClick;
const onClick = useEvent((event) => {
onClickProp == null ? void 0 : onClickProp(event);
if (event.defaultPrevented) return;
store == null ? void 0 : store.setSelectedId(id);
});
const panelId = store.panels.useState(
(state) => {
var _a3;
return (_a3 = state.items.find((item) => item.tabId === id)) == null ? void 0 : _a3.id;
}
);
const shouldRegisterItem = defaultId ? props.shouldRegisterItem : false;
const isActive = store.useState((state) => !!id && state.activeId === id);
const selected = store.useState((state) => !!id && state.selectedId === id);
const hasActiveItem = store.useState((state) => !!store.item(state.activeId));
const canRegisterComposedItem = isActive || selected && !hasActiveItem;
const accessibleWhenDisabled = selected || ((_a2 = props.accessibleWhenDisabled) != null ? _a2 : true);
const isWithinVirtualFocusComposite = useStoreState(
store.combobox || store.composite,
"virtualFocus"
);
if (isWithinVirtualFocusComposite) {
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
tabIndex: -1
});
}
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
id,
role: "tab",
"aria-selected": selected,
"aria-controls": panelId || void 0
}, props), {
onClick
});
if (store.composite) {
const defaultProps = {
id,
accessibleWhenDisabled,
store: store.composite,
shouldRegisterItem: canRegisterComposedItem && shouldRegisterItem,
rowId: props.rowId,
render: props.render
};
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CompositeItem,
_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, defaultProps), {
render: store.combobox && store.composite !== store.combobox ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeItem, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, defaultProps), { store: store.combobox })) : defaultProps.render
})
)
});
}
props = useCompositeItem(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
store
}, props), {
accessibleWhenDisabled,
getItem,
shouldRegisterItem
}));
return props;
});
var Tab = memo2(
forwardRef2(function Tab2(props) {
const htmlProps = useTab(props);
return LMDWO4NN_createElement(tab_TagName, htmlProps);
})
);
;// ./node_modules/@ariakit/react-core/esm/tab/tab-panel.js
"use client";
// src/tab/tab-panel.tsx
var tab_panel_TagName = "div";
var useTabPanel = createHook(
function useTabPanel2(_a) {
var _b = _a, {
store,
unmountOnHide,
tabId: tabIdProp,
getItem: getItemProp,
scrollRestoration,
scrollElement
} = _b, props = __objRest(_b, [
"store",
"unmountOnHide",
"tabId",
"getItem",
"scrollRestoration",
"scrollElement"
]);
const context = useTabProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const ref = (0,external_React_.useRef)(null);
const id = useId(props.id);
const tabId = useStoreState(
store.panels,
() => {
var _a2;
return tabIdProp || ((_a2 = store == null ? void 0 : store.panels.item(id)) == null ? void 0 : _a2.tabId);
}
);
const open = useStoreState(
store,
(state) => !!tabId && state.selectedId === tabId
);
const disclosure = useDisclosureStore({ open });
const mounted = useStoreState(disclosure, "mounted");
const scrollPositionRef = (0,external_React_.useRef)(
/* @__PURE__ */ new Map()
);
const getScrollElement = useEvent(() => {
const panelElement = ref.current;
if (!panelElement) return null;
if (!scrollElement) return panelElement;
if (typeof scrollElement === "function") {
return scrollElement(panelElement);
}
if ("current" in scrollElement) {
return scrollElement.current;
}
return scrollElement;
});
(0,external_React_.useEffect)(() => {
var _a2, _b2;
if (!scrollRestoration) return;
if (!mounted) return;
const element = getScrollElement();
if (!element) return;
if (scrollRestoration === "reset") {
element.scroll(0, 0);
return;
}
if (!tabId) return;
const position = scrollPositionRef.current.get(tabId);
element.scroll((_a2 = position == null ? void 0 : position.x) != null ? _a2 : 0, (_b2 = position == null ? void 0 : position.y) != null ? _b2 : 0);
const onScroll = () => {
scrollPositionRef.current.set(tabId, {
x: element.scrollLeft,
y: element.scrollTop
});
};
element.addEventListener("scroll", onScroll);
return () => {
element.removeEventListener("scroll", onScroll);
};
}, [scrollRestoration, mounted, tabId, getScrollElement, store]);
const [hasTabbableChildren, setHasTabbableChildren] = (0,external_React_.useState)(false);
(0,external_React_.useEffect)(() => {
const element = ref.current;
if (!element) return;
const tabbable = getAllTabbableIn(element);
setHasTabbableChildren(!!tabbable.length);
}, []);
const getItem = (0,external_React_.useCallback)(
(item) => {
const nextItem = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, item), { id: id || item.id, tabId: tabIdProp });
if (getItemProp) {
return getItemProp(nextItem);
}
return nextItem;
},
[id, tabIdProp, getItemProp]
);
const onKeyDownProp = props.onKeyDown;
const onKeyDown = useEvent((event) => {
onKeyDownProp == null ? void 0 : onKeyDownProp(event);
if (event.defaultPrevented) return;
if (!(store == null ? void 0 : store.composite)) return;
const keyMap = {
ArrowLeft: store.previous,
ArrowRight: store.next,
Home: store.first,
End: store.last
};
const action = keyMap[event.key];
if (!action) return;
const { selectedId } = store.getState();
const nextId = action({ activeId: selectedId });
if (!nextId) return;
event.preventDefault();
store.move(nextId);
});
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TabScopedContextProvider, { value: store, children: element }),
[store]
);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
id,
role: "tabpanel",
"aria-labelledby": tabId || void 0
}, props), {
children: unmountOnHide && !mounted ? null : props.children,
ref: useMergeRefs(ref, props.ref),
onKeyDown
});
props = useFocusable(_3YLGPPWQ_spreadValues({
// If the tab panel is rendered as part of another composite widget such
// as combobox, it should not be focusable.
focusable: !store.composite && !hasTabbableChildren
}, props));
props = useDisclosureContent(_3YLGPPWQ_spreadValues({ store: disclosure }, props));
props = useCollectionItem(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ store: store.panels }, props), { getItem }));
return props;
}
);
var TabPanel = forwardRef2(function TabPanel2(props) {
const htmlProps = useTabPanel(props);
return LMDWO4NN_createElement(tab_panel_TagName, htmlProps);
});
;// ./node_modules/@wordpress/components/build-module/tab-panel/index.js
const extractTabName = (id) => {
if (typeof id === "undefined" || id === null) {
return;
}
return id.match(/^tab-panel-[0-9]*-(.*)/)?.[1];
};
const UnforwardedTabPanel = ({
className,
children,
tabs,
selectOnMove = true,
initialTabName,
orientation = "horizontal",
activeClass = "is-active",
onSelect
}, ref) => {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(tab_panel_TabPanel, "tab-panel");
const prependInstanceId = (0,external_wp_element_namespaceObject.useCallback)((tabName) => {
if (typeof tabName === "undefined") {
return;
}
return `${instanceId}-${tabName}`;
}, [instanceId]);
const tabStore = useTabStore({
setSelectedId: (newTabValue) => {
if (typeof newTabValue === "undefined" || newTabValue === null) {
return;
}
const newTab = tabs.find((t) => prependInstanceId(t.name) === newTabValue);
if (newTab?.disabled || newTab === selectedTab) {
return;
}
const simplifiedTabName = extractTabName(newTabValue);
if (typeof simplifiedTabName === "undefined") {
return;
}
onSelect?.(simplifiedTabName);
},
orientation,
selectOnMove,
defaultSelectedId: prependInstanceId(initialTabName),
rtl: (0,external_wp_i18n_namespaceObject.isRTL)()
});
const selectedTabName = extractTabName(useStoreState(tabStore, "selectedId"));
const setTabStoreSelectedId = (0,external_wp_element_namespaceObject.useCallback)((tabName) => {
tabStore.setState("selectedId", prependInstanceId(tabName));
}, [prependInstanceId, tabStore]);
const selectedTab = tabs.find(({
name
}) => name === selectedTabName);
const previousSelectedTabName = (0,external_wp_compose_namespaceObject.usePrevious)(selectedTabName);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (previousSelectedTabName !== selectedTabName && selectedTabName === initialTabName && !!selectedTabName) {
onSelect?.(selectedTabName);
}
}, [selectedTabName, initialTabName, onSelect, previousSelectedTabName]);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (selectedTab) {
return;
}
const initialTab = tabs.find((tab) => tab.name === initialTabName);
if (initialTabName && !initialTab) {
return;
}
if (initialTab && !initialTab.disabled) {
setTabStoreSelectedId(initialTab.name);
} else {
const firstEnabledTab = tabs.find((tab) => !tab.disabled);
if (firstEnabledTab) {
setTabStoreSelectedId(firstEnabledTab.name);
}
}
}, [tabs, selectedTab, initialTabName, instanceId, setTabStoreSelectedId]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!selectedTab?.disabled) {
return;
}
const firstEnabledTab = tabs.find((tab) => !tab.disabled);
if (firstEnabledTab) {
setTabStoreSelectedId(firstEnabledTab.name);
}
}, [tabs, selectedTab?.disabled, setTabStoreSelectedId, instanceId]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className,
ref,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TabList, {
store: tabStore,
className: "components-tab-panel__tabs",
children: tabs.map((tab) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Tab, {
id: prependInstanceId(tab.name),
className: dist_clsx("components-tab-panel__tabs-item", tab.className, {
[activeClass]: tab.name === selectedTabName
}),
disabled: tab.disabled,
"aria-controls": `${prependInstanceId(tab.name)}-view`,
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
__next40pxDefaultSize: true,
icon: tab.icon,
label: tab.icon && tab.title,
showTooltip: !!tab.icon
}),
children: !tab.icon && tab.title
}, tab.name);
})
}), selectedTab && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TabPanel, {
id: `${prependInstanceId(selectedTab.name)}-view`,
store: tabStore,
tabId: prependInstanceId(selectedTab.name),
className: "components-tab-panel__tab-content",
children: children(selectedTab)
})]
});
};
const tab_panel_TabPanel = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTabPanel);
var tab_panel_default = tab_panel_TabPanel;
;// ./node_modules/@wordpress/components/build-module/text-control/index.js
function UnforwardedTextControl(props, ref) {
const {
__nextHasNoMarginBottom,
__next40pxDefaultSize = false,
label,
hideLabelFromVision,
value,
help,
id: idProp,
className,
onChange,
type = "text",
...additionalProps
} = props;
const id = (0,external_wp_compose_namespaceObject.useInstanceId)(TextControl, "inspector-text-control", idProp);
const onChangeValue = (event) => onChange(event.target.value);
maybeWarnDeprecated36pxSize({
componentName: "TextControl",
size: void 0,
__next40pxDefaultSize
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default, {
__nextHasNoMarginBottom,
__associatedWPComponentName: "TextControl",
label,
hideLabelFromVision,
id,
help,
className,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
className: dist_clsx("components-text-control__input", {
"is-next-40px-default-size": __next40pxDefaultSize
}),
type,
id,
value,
onChange: onChangeValue,
"aria-describedby": !!help ? id + "__help" : void 0,
ref,
...additionalProps
})
});
}
const TextControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTextControl);
var text_control_default = TextControl;
;// ./node_modules/@wordpress/components/build-module/utils/breakpoint-values.js
var breakpoint_values_default = {
huge: "1440px",
wide: "1280px",
"x-large": "1080px",
large: "960px",
// admin sidebar auto folds
medium: "782px",
// Adminbar goes big.
small: "600px",
mobile: "480px",
"zoomed-in": "280px"
};
;// ./node_modules/@wordpress/components/build-module/utils/breakpoint.js
const breakpoint = (point) => `@media (min-width: ${breakpoint_values_default[point]})`;
;// ./node_modules/@wordpress/components/build-module/textarea-control/styles/textarea-control-styles.js
const inputStyleNeutral = /* @__PURE__ */ emotion_react_browser_esm_css("box-shadow:0 0 0 transparent;border-radius:", config_values_default.radiusSmall, ";border:", config_values_default.borderWidth, " solid ", COLORS.ui.border, ";@media not ( prefers-reduced-motion ){transition:box-shadow 0.1s linear;}" + ( true ? "" : 0), true ? "" : 0);
const inputStyleFocus = /* @__PURE__ */ emotion_react_browser_esm_css("border-color:", COLORS.theme.accent, ";box-shadow:0 0 0 calc( ", config_values_default.borderWidthFocus, " - ", config_values_default.borderWidth, " ) ", COLORS.theme.accent, ";outline:2px solid transparent;" + ( true ? "" : 0), true ? "" : 0);
const StyledTextarea = /* @__PURE__ */ emotion_styled_base_browser_esm("textarea", true ? {
target: "e1w5nnrk0"
} : 0)("width:100%;display:block;font-family:", font("default.fontFamily"), ";line-height:20px;background:", COLORS.theme.background, ";color:", COLORS.theme.foreground, ";resize:vertical;padding:9px 11px;", inputStyleNeutral, ";font-size:", font("mobileTextMinFontSize"), ";", breakpoint("small"), "{font-size:", font("default.fontSize"), ";}&:focus{", inputStyleFocus, ";}&::-webkit-input-placeholder{color:", COLORS.ui.darkGrayPlaceholder, ";}&::-moz-placeholder{color:", COLORS.ui.darkGrayPlaceholder, ";}&:-ms-input-placeholder{color:", COLORS.ui.darkGrayPlaceholder, ";}.is-dark-theme &{&::-webkit-input-placeholder{color:", COLORS.ui.lightGrayPlaceholder, ";}&::-moz-placeholder{color:", COLORS.ui.lightGrayPlaceholder, ";}&:-ms-input-placeholder{color:", COLORS.ui.lightGrayPlaceholder, ";}}" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/textarea-control/index.js
function UnforwardedTextareaControl(props, ref) {
const {
__nextHasNoMarginBottom,
label,
hideLabelFromVision,
value,
help,
onChange,
rows = 4,
className,
...additionalProps
} = props;
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(TextareaControl);
const id = `inspector-textarea-control-${instanceId}`;
const onChangeValue = (event) => onChange(event.target.value);
const classes = dist_clsx("components-textarea-control", className);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default, {
__nextHasNoMarginBottom,
__associatedWPComponentName: "TextareaControl",
label,
hideLabelFromVision,
id,
help,
className: classes,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledTextarea, {
className: "components-textarea-control__input",
id,
rows,
onChange: onChangeValue,
"aria-describedby": !!help ? id + "__help" : void 0,
value,
ref,
...additionalProps
})
});
}
const TextareaControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTextareaControl);
var textarea_control_default = TextareaControl;
;// ./node_modules/@wordpress/components/build-module/text-highlight/index.js
const TextHighlight = (props) => {
const {
text = "",
highlight = ""
} = props;
const trimmedHighlightText = highlight.trim();
if (!trimmedHighlightText) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: text
});
}
const regex = new RegExp(`(${escapeRegExp(trimmedHighlightText)})`, "gi");
return (0,external_wp_element_namespaceObject.createInterpolateElement)(text.replace(regex, "<mark>$&</mark>"), {
mark: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("mark", {})
});
};
var text_highlight_default = TextHighlight;
;// ./node_modules/@wordpress/icons/build-module/library/tip.js
var tip_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 15.8c-3.7 0-6.8-3-6.8-6.8s3-6.8 6.8-6.8c3.7 0 6.8 3 6.8 6.8s-3.1 6.8-6.8 6.8zm0-12C9.1 3.8 6.8 6.1 6.8 9s2.4 5.2 5.2 5.2c2.9 0 5.2-2.4 5.2-5.2S14.9 3.8 12 3.8zM8 17.5h8V19H8zM10 20.5h4V22h-4z" }) });
;// ./node_modules/@wordpress/components/build-module/tip/index.js
function Tip(props) {
const {
children
} = props;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-tip",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
icon: tip_default
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children
})]
});
}
var tip_tip_default = Tip;
;// ./node_modules/@wordpress/components/build-module/toggle-control/index.js
function UnforwardedToggleControl({
__nextHasNoMarginBottom,
label,
checked,
help,
className,
onChange,
disabled
}, ref) {
function onChangeToggle(event) {
onChange(event.target.checked);
}
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleControl);
const id = `inspector-toggle-control-${instanceId}`;
const cx = useCx();
const classes = cx("components-toggle-control", className, !__nextHasNoMarginBottom && /* @__PURE__ */ emotion_react_browser_esm_css({
marginBottom: space(3)
}, true ? "" : 0, true ? "" : 0));
if (!__nextHasNoMarginBottom) {
external_wp_deprecated_default()("Bottom margin styles for wp.components.ToggleControl", {
since: "6.7",
version: "7.0",
hint: "Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."
});
}
let describedBy, helpLabel;
if (help) {
if (typeof help === "function") {
if (checked !== void 0) {
helpLabel = help(checked);
}
} else {
helpLabel = help;
}
if (helpLabel) {
describedBy = id + "__help";
}
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default, {
id,
help: helpLabel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "components-toggle-control__help",
children: helpLabel
}),
className: classes,
__nextHasNoMarginBottom: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
justify: "flex-start",
spacing: 2,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(form_toggle_default, {
id,
checked,
onChange: onChangeToggle,
"aria-describedby": describedBy,
disabled,
ref
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_block_component_component_default, {
as: "label",
htmlFor: id,
className: dist_clsx("components-toggle-control__label", {
"is-disabled": disabled
}),
children: label
})]
})
});
}
const ToggleControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleControl);
var toggle_control_default = ToggleControl;
;// ./node_modules/@ariakit/react-core/esm/__chunks/A3WPL2ZJ.js
"use client";
// src/toolbar/toolbar-context.tsx
var A3WPL2ZJ_ctx = createStoreContext(
[CompositeContextProvider],
[CompositeScopedContextProvider]
);
var useToolbarContext = A3WPL2ZJ_ctx.useContext;
var useToolbarScopedContext = A3WPL2ZJ_ctx.useScopedContext;
var useToolbarProviderContext = A3WPL2ZJ_ctx.useProviderContext;
var ToolbarContextProvider = A3WPL2ZJ_ctx.ContextProvider;
var ToolbarScopedContextProvider = A3WPL2ZJ_ctx.ScopedContextProvider;
;// ./node_modules/@ariakit/react-core/esm/__chunks/BOLVLGVE.js
"use client";
// src/toolbar/toolbar-item.tsx
var BOLVLGVE_TagName = "button";
var useToolbarItem = createHook(
function useToolbarItem2(_a) {
var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
const context = useToolbarContext();
store = store || context;
props = useCompositeItem(_3YLGPPWQ_spreadValues({ store }, props));
return props;
}
);
var ToolbarItem = memo2(
forwardRef2(function ToolbarItem2(props) {
const htmlProps = useToolbarItem(props);
return LMDWO4NN_createElement(BOLVLGVE_TagName, htmlProps);
})
);
;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar-context/index.js
const ToolbarContext = (0,external_wp_element_namespaceObject.createContext)(void 0);
ToolbarContext.displayName = "ToolbarContext";
var toolbar_context_default = ToolbarContext;
;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar-item/index.js
function UnforwardedToolbarItem({
children,
as: Component,
...props
}, ref) {
const accessibleToolbarStore = (0,external_wp_element_namespaceObject.useContext)(toolbar_context_default);
const isRenderProp = typeof children === "function";
if (!isRenderProp && !Component) {
true ? external_wp_warning_default()("`ToolbarItem` is a generic headless component. You must pass either a `children` prop as a function or an `as` prop as a component. See https://developer.wordpress.org/block-editor/components/toolbar-item/") : 0;
return null;
}
const allProps = {
...props,
ref,
"data-toolbar-item": true
};
if (!accessibleToolbarStore) {
if (Component) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
...allProps,
children
});
}
if (!isRenderProp) {
return null;
}
return children(allProps);
}
const render = isRenderProp ? children : Component && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
children
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ToolbarItem, {
accessibleWhenDisabled: true,
...allProps,
store: accessibleToolbarStore,
render
});
}
const toolbar_item_ToolbarItem = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToolbarItem);
var toolbar_item_default = toolbar_item_ToolbarItem;
;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar-button/toolbar-button-container.js
const ToolbarButtonContainer = ({
children,
className
}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className,
children
});
var toolbar_button_container_default = ToolbarButtonContainer;
;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar-button/index.js
function toolbar_button_useDeprecatedProps({
isDisabled,
...otherProps
}) {
return {
disabled: isDisabled,
...otherProps
};
}
function UnforwardedToolbarButton(props, ref) {
const {
children,
className,
containerClassName,
extraProps,
isActive,
title,
...restProps
} = toolbar_button_useDeprecatedProps(props);
const accessibleToolbarState = (0,external_wp_element_namespaceObject.useContext)(toolbar_context_default);
if (!accessibleToolbarState) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_button_container_default, {
className: containerClassName,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
ref,
icon: restProps.icon,
size: "compact",
label: title,
shortcut: restProps.shortcut,
"data-subscript": restProps.subscript,
onClick: (event) => {
event.stopPropagation();
if (restProps.onClick) {
restProps.onClick(event);
}
},
className: dist_clsx("components-toolbar__control", className),
isPressed: isActive,
accessibleWhenDisabled: true,
"data-toolbar-item": true,
...extraProps,
...restProps,
children
})
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_item_default, {
className: dist_clsx("components-toolbar-button", className),
...extraProps,
...restProps,
ref,
children: (toolbarItemProps) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
size: "compact",
label: title,
isPressed: isActive,
...toolbarItemProps,
children
})
});
}
const ToolbarButton = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToolbarButton);
var toolbar_button_default = ToolbarButton;
;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar-group/toolbar-group-container.js
const ToolbarGroupContainer = ({
className,
children,
...props
}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className,
...props,
children
});
var toolbar_group_container_default = ToolbarGroupContainer;
;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js
function ToolbarGroupCollapsed({
controls = [],
toggleProps,
...props
}) {
const accessibleToolbarState = (0,external_wp_element_namespaceObject.useContext)(toolbar_context_default);
const renderDropdownMenu = (internalToggleProps) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_menu_default, {
controls,
toggleProps: {
...internalToggleProps,
"data-toolbar-item": true
},
...props
});
if (accessibleToolbarState) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_item_default, {
...toggleProps,
children: renderDropdownMenu
});
}
return renderDropdownMenu(toggleProps);
}
var toolbar_group_collapsed_default = ToolbarGroupCollapsed;
;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar-group/index.js
function isNestedArray(arr) {
return Array.isArray(arr) && Array.isArray(arr[0]);
}
function ToolbarGroup({
controls = [],
children,
className,
isCollapsed,
title,
...props
}) {
const accessibleToolbarState = (0,external_wp_element_namespaceObject.useContext)(toolbar_context_default);
if ((!controls || !controls.length) && !children) {
return null;
}
const finalClassName = dist_clsx(
// Unfortunately, there's legacy code referencing to `.components-toolbar`
// So we can't get rid of it
accessibleToolbarState ? "components-toolbar-group" : "components-toolbar",
className
);
let controlSets;
if (isNestedArray(controls)) {
controlSets = controls;
} else {
controlSets = [controls];
}
if (isCollapsed) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_group_collapsed_default, {
label: title,
controls: controlSets,
className: finalClassName,
children,
...props
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(toolbar_group_container_default, {
className: finalClassName,
...props,
children: [controlSets?.flatMap((controlSet, indexOfSet) => controlSet.map((control, indexOfControl) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_button_default, {
containerClassName: indexOfSet > 0 && indexOfControl === 0 ? "has-left-divider" : void 0,
...control
}, [indexOfSet, indexOfControl].join()))), children]
});
}
var toolbar_group_default = ToolbarGroup;
;// ./node_modules/@ariakit/core/esm/toolbar/toolbar-store.js
"use client";
// src/toolbar/toolbar-store.ts
function createToolbarStore(props = {}) {
var _a;
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
return createCompositeStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
orientation: defaultValue(
props.orientation,
syncState == null ? void 0 : syncState.orientation,
"horizontal"
),
focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
}));
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/7M5THDKH.js
"use client";
// src/toolbar/toolbar-store.ts
function useToolbarStoreProps(store, update, props) {
return useCompositeStoreProps(store, update, props);
}
function useToolbarStore(props = {}) {
const [store, update] = YV4JVR4I_useStore(createToolbarStore, props);
return useToolbarStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/react-core/esm/toolbar/toolbar.js
"use client";
// src/toolbar/toolbar.tsx
var toolbar_TagName = "div";
var useToolbar = createHook(
function useToolbar2(_a) {
var _b = _a, {
store: storeProp,
orientation: orientationProp,
virtualFocus,
focusLoop,
rtl
} = _b, props = __objRest(_b, [
"store",
"orientation",
"virtualFocus",
"focusLoop",
"rtl"
]);
const context = useToolbarProviderContext();
storeProp = storeProp || context;
const store = useToolbarStore({
store: storeProp,
orientation: orientationProp,
virtualFocus,
focusLoop,
rtl
});
const orientation = store.useState(
(state) => state.orientation === "both" ? void 0 : state.orientation
);
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ToolbarScopedContextProvider, { value: store, children: element }),
[store]
);
props = _3YLGPPWQ_spreadValues({
role: "toolbar",
"aria-orientation": orientation
}, props);
props = useComposite(_3YLGPPWQ_spreadValues({ store }, props));
return props;
}
);
var Toolbar = forwardRef2(function Toolbar2(props) {
const htmlProps = useToolbar(props);
return LMDWO4NN_createElement(toolbar_TagName, htmlProps);
});
;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar/toolbar-container.js
function UnforwardedToolbarContainer({
label,
...props
}, ref) {
const toolbarStore = useToolbarStore({
focusLoop: true,
rtl: (0,external_wp_i18n_namespaceObject.isRTL)()
});
return (
// This will provide state for `ToolbarButton`'s
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_context_default.Provider, {
value: toolbarStore,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Toolbar, {
ref,
"aria-label": label,
store: toolbarStore,
...props
})
})
);
}
const ToolbarContainer = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToolbarContainer);
var toolbar_container_default = ToolbarContainer;
;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar/index.js
function UnforwardedToolbar({
className,
label,
variant,
...props
}, ref) {
const isVariantDefined = variant !== void 0;
const contextSystemValue = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (isVariantDefined) {
return {};
}
return {
DropdownMenu: {
variant: "toolbar"
},
Dropdown: {
variant: "toolbar"
},
Menu: {
variant: "toolbar"
}
};
}, [isVariantDefined]);
if (!label) {
external_wp_deprecated_default()("Using Toolbar without label prop", {
since: "5.6",
alternative: "ToolbarGroup component",
link: "https://developer.wordpress.org/block-editor/components/toolbar/"
});
const {
title: _title,
...restProps
} = props;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_group_default, {
isCollapsed: false,
...restProps,
className
});
}
const finalClassName = dist_clsx("components-accessible-toolbar", className, variant && `is-${variant}`);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextSystemProvider, {
value: contextSystemValue,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_container_default, {
className: finalClassName,
label,
ref,
...props
})
});
}
const toolbar_Toolbar = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToolbar);
var toolbar_default = toolbar_Toolbar;
;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar-dropdown-menu/index.js
function UnforwardedToolbarDropdownMenu(props, ref) {
const accessibleToolbarState = (0,external_wp_element_namespaceObject.useContext)(toolbar_context_default);
if (!accessibleToolbarState) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_menu_default, {
...props
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_item_default, {
ref,
...props.toggleProps,
children: (toolbarItemProps) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_menu_default, {
...props,
popoverProps: {
...props.popoverProps
},
toggleProps: toolbarItemProps
})
});
}
const ToolbarDropdownMenu = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToolbarDropdownMenu);
var toolbar_dropdown_menu_default = ToolbarDropdownMenu;
;// ./node_modules/@wordpress/components/build-module/tools-panel/styles.js
function tools_panel_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const toolsPanelGrid = {
columns: (columns) => /* @__PURE__ */ emotion_react_browser_esm_css("grid-template-columns:", `repeat( ${columns}, minmax(0, 1fr) )`, ";" + ( true ? "" : 0), true ? "" : 0),
spacing: /* @__PURE__ */ emotion_react_browser_esm_css("column-gap:", space(4), ";row-gap:", space(4), ";" + ( true ? "" : 0), true ? "" : 0),
item: {
fullWidth: true ? {
name: "18iuzk9",
styles: "grid-column:1/-1"
} : 0
}
};
const ToolsPanel = (columns) => /* @__PURE__ */ emotion_react_browser_esm_css(toolsPanelGrid.columns(columns), " ", toolsPanelGrid.spacing, " border-top:", config_values_default.borderWidth, " solid ", COLORS.gray[300], ";margin-top:-1px;padding:", space(4), ";" + ( true ? "" : 0), true ? "" : 0);
const ToolsPanelWithInnerWrapper = (columns) => {
return /* @__PURE__ */ emotion_react_browser_esm_css(">div:not( :first-of-type ){display:grid;", toolsPanelGrid.columns(columns), " ", toolsPanelGrid.spacing, " ", toolsPanelGrid.item.fullWidth, ";}" + ( true ? "" : 0), true ? "" : 0);
};
const ToolsPanelHiddenInnerWrapper = true ? {
name: "huufmu",
styles: ">div:not( :first-of-type ){display:none;}"
} : 0;
const ToolsPanelHeader = /* @__PURE__ */ emotion_react_browser_esm_css(toolsPanelGrid.item.fullWidth, " gap:", space(2), ";.components-dropdown-menu{margin:", space(-1), " 0;line-height:0;}&&&& .components-dropdown-menu__toggle{padding:0;min-width:", space(6), ";}" + ( true ? "" : 0), true ? "" : 0);
const ToolsPanelHeading = true ? {
name: "1pmxm02",
styles: "font-size:inherit;font-weight:500;line-height:normal;&&{margin:0;}"
} : 0;
const ToolsPanelItem = /* @__PURE__ */ emotion_react_browser_esm_css(toolsPanelGrid.item.fullWidth, "&>div,&>fieldset{padding-bottom:0;margin-bottom:0;max-width:100%;}&& ", Wrapper, "{margin-bottom:0;", StyledField, ":last-child{margin-bottom:0;}}", StyledHelp, "{margin-bottom:0;}&& ", LabelWrapper, "{label{line-height:1.4em;}}" + ( true ? "" : 0), true ? "" : 0);
const ToolsPanelItemPlaceholder = true ? {
name: "eivff4",
styles: "display:none"
} : 0;
const styles_DropdownMenu = true ? {
name: "16gsvie",
styles: "min-width:200px"
} : 0;
const ResetLabel = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "ews648u0"
} : 0)("color:", COLORS.theme.accentDarker10, ";font-size:11px;font-weight:500;line-height:1.4;", rtl({
marginLeft: space(3)
}), " text-transform:uppercase;" + ( true ? "" : 0));
const DefaultControlsItem = /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.gray[900], ";&&[aria-disabled='true']{color:", COLORS.gray[700], ";opacity:1;&:hover{color:", COLORS.gray[700], ";}", ResetLabel, "{opacity:0.3;}}" + ( true ? "" : 0), true ? "" : 0);
;// ./node_modules/@wordpress/components/build-module/tools-panel/context.js
const tools_panel_context_noop = () => void 0;
const ToolsPanelContext = (0,external_wp_element_namespaceObject.createContext)({
menuItems: {
default: {},
optional: {}
},
hasMenuItems: false,
isResetting: false,
shouldRenderPlaceholderItems: false,
registerPanelItem: tools_panel_context_noop,
deregisterPanelItem: tools_panel_context_noop,
flagItemCustomization: tools_panel_context_noop,
registerResetAllFilter: tools_panel_context_noop,
deregisterResetAllFilter: tools_panel_context_noop,
areAllOptionalControlsHidden: true
});
ToolsPanelContext.displayName = "ToolsPanelContext";
const useToolsPanelContext = () => (0,external_wp_element_namespaceObject.useContext)(ToolsPanelContext);
;// ./node_modules/@wordpress/components/build-module/tools-panel/tools-panel-header/hook.js
function useToolsPanelHeader(props) {
const {
className,
headingLevel = 2,
...otherProps
} = useContextSystem(props, "ToolsPanelHeader");
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(ToolsPanelHeader, className);
}, [className, cx]);
const dropdownMenuClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(styles_DropdownMenu);
}, [cx]);
const headingClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(ToolsPanelHeading);
}, [cx]);
const defaultControlsItemClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
return cx(DefaultControlsItem);
}, [cx]);
const {
menuItems,
hasMenuItems,
areAllOptionalControlsHidden
} = useToolsPanelContext();
return {
...otherProps,
areAllOptionalControlsHidden,
defaultControlsItemClassName,
dropdownMenuClassName,
hasMenuItems,
headingClassName,
headingLevel,
menuItems,
className: classes
};
}
;// ./node_modules/@wordpress/components/build-module/tools-panel/tools-panel-header/component.js
const DefaultControlsGroup = ({
itemClassName,
items,
toggleItem
}) => {
if (!items.length) {
return null;
}
const resetSuffix = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ResetLabel, {
"aria-hidden": true,
children: (0,external_wp_i18n_namespaceObject.__)("Reset")
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: items.map(([label, hasValue]) => {
if (hasValue) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_item_default, {
className: itemClassName,
role: "menuitem",
label: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The name of the control being reset e.g. "Padding".
(0,external_wp_i18n_namespaceObject.__)("Reset %s"),
label
),
onClick: () => {
toggleItem(label);
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The name of the control being reset e.g. "Padding".
(0,external_wp_i18n_namespaceObject.__)("%s reset to default"),
label
), "assertive");
},
suffix: resetSuffix,
children: label
}, label);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_item_default, {
icon: check_default,
className: itemClassName,
role: "menuitemcheckbox",
isSelected: true,
"aria-disabled": true,
children: label
}, label);
})
});
};
const OptionalControlsGroup = ({
items,
toggleItem
}) => {
if (!items.length) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: items.map(([label, isSelected]) => {
const itemLabel = isSelected ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The name of the control being hidden and reset e.g. "Padding".
(0,external_wp_i18n_namespaceObject.__)("Hide and reset %s"),
label
) : (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The name of the control to display e.g. "Padding".
(0,external_wp_i18n_namespaceObject._x)("Show %s", "input control"),
label
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_item_default, {
icon: isSelected ? check_default : null,
isSelected,
label: itemLabel,
onClick: () => {
if (isSelected) {
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The name of the control being reset e.g. "Padding".
(0,external_wp_i18n_namespaceObject.__)("%s hidden and reset to default"),
label
), "assertive");
} else {
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The name of the control being reset e.g. "Padding".
(0,external_wp_i18n_namespaceObject.__)("%s is now visible"),
label
), "assertive");
}
toggleItem(label);
},
role: "menuitemcheckbox",
children: label
}, label);
})
});
};
const component_ToolsPanelHeader = (props, forwardedRef) => {
const {
areAllOptionalControlsHidden,
defaultControlsItemClassName,
dropdownMenuClassName,
hasMenuItems,
headingClassName,
headingLevel = 2,
label: labelText,
menuItems,
resetAll,
toggleItem,
dropdownMenuProps,
...headerProps
} = useToolsPanelHeader(props);
if (!labelText) {
return null;
}
const defaultItems = Object.entries(menuItems?.default || {});
const optionalItems = Object.entries(menuItems?.optional || {});
const dropDownMenuIcon = areAllOptionalControlsHidden ? plus_default : more_vertical_default;
const dropDownMenuLabelText = (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The name of the tool e.g. "Color" or "Typography".
(0,external_wp_i18n_namespaceObject._x)("%s options", "Button label to reveal tool panel options"),
labelText
);
const dropdownMenuDescriptionText = areAllOptionalControlsHidden ? (0,external_wp_i18n_namespaceObject.__)("All options are currently hidden") : void 0;
const canResetAll = [...defaultItems, ...optionalItems].some(([, isSelected]) => isSelected);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
...headerProps,
ref: forwardedRef,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(heading_component_component_default, {
level: headingLevel,
className: headingClassName,
children: labelText
}), hasMenuItems && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_menu_default, {
...dropdownMenuProps,
icon: dropDownMenuIcon,
label: dropDownMenuLabelText,
menuProps: {
className: dropdownMenuClassName
},
toggleProps: {
size: "small",
description: dropdownMenuDescriptionText
},
children: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(menu_group_default, {
label: labelText,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DefaultControlsGroup, {
items: defaultItems,
toggleItem,
itemClassName: defaultControlsItemClassName
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(OptionalControlsGroup, {
items: optionalItems,
toggleItem
})]
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_group_default, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_item_default, {
"aria-disabled": !canResetAll,
variant: "tertiary",
onClick: () => {
if (canResetAll) {
resetAll();
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)("All options reset"), "assertive");
}
},
children: (0,external_wp_i18n_namespaceObject.__)("Reset all")
})
})]
})
})]
});
};
const ConnectedToolsPanelHeader = contextConnect(component_ToolsPanelHeader, "ToolsPanelHeader");
var tools_panel_header_component_component_default = ConnectedToolsPanelHeader;
;// ./node_modules/@wordpress/components/build-module/tools-panel/tools-panel/hook.js
const DEFAULT_COLUMNS = 2;
function emptyMenuItems() {
return {
default: {},
optional: {}
};
}
function emptyState() {
return {
panelItems: [],
menuItemOrder: [],
menuItems: emptyMenuItems()
};
}
const generateMenuItems = ({
panelItems,
shouldReset,
currentMenuItems,
menuItemOrder
}) => {
const newMenuItems = emptyMenuItems();
const menuItems = emptyMenuItems();
panelItems.forEach(({
hasValue,
isShownByDefault,
label
}) => {
const group = isShownByDefault ? "default" : "optional";
const existingItemValue = currentMenuItems?.[group]?.[label];
const value = existingItemValue ? existingItemValue : hasValue();
newMenuItems[group][label] = shouldReset ? false : value;
});
menuItemOrder.forEach((key) => {
if (newMenuItems.default.hasOwnProperty(key)) {
menuItems.default[key] = newMenuItems.default[key];
}
if (newMenuItems.optional.hasOwnProperty(key)) {
menuItems.optional[key] = newMenuItems.optional[key];
}
});
Object.keys(newMenuItems.default).forEach((key) => {
if (!menuItems.default.hasOwnProperty(key)) {
menuItems.default[key] = newMenuItems.default[key];
}
});
Object.keys(newMenuItems.optional).forEach((key) => {
if (!menuItems.optional.hasOwnProperty(key)) {
menuItems.optional[key] = newMenuItems.optional[key];
}
});
return menuItems;
};
function panelItemsReducer(panelItems, action) {
switch (action.type) {
case "REGISTER_PANEL": {
const newItems = [...panelItems];
const existingIndex = newItems.findIndex((oldItem) => oldItem.label === action.item.label);
if (existingIndex !== -1) {
newItems.splice(existingIndex, 1);
}
newItems.push(action.item);
return newItems;
}
case "UNREGISTER_PANEL": {
const index = panelItems.findIndex((item) => item.label === action.label);
if (index !== -1) {
const newItems = [...panelItems];
newItems.splice(index, 1);
return newItems;
}
return panelItems;
}
default:
return panelItems;
}
}
function menuItemOrderReducer(menuItemOrder, action) {
switch (action.type) {
case "REGISTER_PANEL": {
if (menuItemOrder.includes(action.item.label)) {
return menuItemOrder;
}
return [...menuItemOrder, action.item.label];
}
default:
return menuItemOrder;
}
}
function menuItemsReducer(state, action) {
switch (action.type) {
case "REGISTER_PANEL":
case "UNREGISTER_PANEL":
return generateMenuItems({
currentMenuItems: state.menuItems,
panelItems: state.panelItems,
menuItemOrder: state.menuItemOrder,
shouldReset: false
});
case "RESET_ALL":
return generateMenuItems({
panelItems: state.panelItems,
menuItemOrder: state.menuItemOrder,
shouldReset: true
});
case "UPDATE_VALUE": {
const oldValue = state.menuItems[action.group][action.label];
if (action.value === oldValue) {
return state.menuItems;
}
return {
...state.menuItems,
[action.group]: {
...state.menuItems[action.group],
[action.label]: action.value
}
};
}
case "TOGGLE_VALUE": {
const currentItem = state.panelItems.find((item) => item.label === action.label);
if (!currentItem) {
return state.menuItems;
}
const menuGroup = currentItem.isShownByDefault ? "default" : "optional";
const newMenuItems = {
...state.menuItems,
[menuGroup]: {
...state.menuItems[menuGroup],
[action.label]: !state.menuItems[menuGroup][action.label]
}
};
return newMenuItems;
}
default:
return state.menuItems;
}
}
function panelReducer(state, action) {
const panelItems = panelItemsReducer(state.panelItems, action);
const menuItemOrder = menuItemOrderReducer(state.menuItemOrder, action);
const menuItems = menuItemsReducer({
panelItems,
menuItemOrder,
menuItems: state.menuItems
}, action);
return {
panelItems,
menuItemOrder,
menuItems
};
}
function resetAllFiltersReducer(filters, action) {
switch (action.type) {
case "REGISTER":
return [...filters, action.filter];
case "UNREGISTER":
return filters.filter((f) => f !== action.filter);
default:
return filters;
}
}
const isMenuItemTypeEmpty = (obj) => Object.keys(obj).length === 0;
function useToolsPanel(props) {
const {
className,
headingLevel = 2,
resetAll,
panelId,
hasInnerWrapper = false,
shouldRenderPlaceholderItems = false,
__experimentalFirstVisibleItemClass,
__experimentalLastVisibleItemClass,
...otherProps
} = useContextSystem(props, "ToolsPanel");
const isResettingRef = (0,external_wp_element_namespaceObject.useRef)(false);
const wasResetting = isResettingRef.current;
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (wasResetting) {
isResettingRef.current = false;
}
}, [wasResetting]);
const [{
panelItems,
menuItems
}, panelDispatch] = (0,external_wp_element_namespaceObject.useReducer)(panelReducer, void 0, emptyState);
const [resetAllFilters, dispatchResetAllFilters] = (0,external_wp_element_namespaceObject.useReducer)(resetAllFiltersReducer, []);
const registerPanelItem = (0,external_wp_element_namespaceObject.useCallback)((item) => {
panelDispatch({
type: "REGISTER_PANEL",
item
});
}, []);
const deregisterPanelItem = (0,external_wp_element_namespaceObject.useCallback)((label) => {
panelDispatch({
type: "UNREGISTER_PANEL",
label
});
}, []);
const registerResetAllFilter = (0,external_wp_element_namespaceObject.useCallback)((filter) => {
dispatchResetAllFilters({
type: "REGISTER",
filter
});
}, []);
const deregisterResetAllFilter = (0,external_wp_element_namespaceObject.useCallback)((filter) => {
dispatchResetAllFilters({
type: "UNREGISTER",
filter
});
}, []);
const flagItemCustomization = (0,external_wp_element_namespaceObject.useCallback)((value, label, group = "default") => {
panelDispatch({
type: "UPDATE_VALUE",
group,
label,
value
});
}, []);
const areAllOptionalControlsHidden = (0,external_wp_element_namespaceObject.useMemo)(() => {
return isMenuItemTypeEmpty(menuItems.default) && !isMenuItemTypeEmpty(menuItems.optional) && Object.values(menuItems.optional).every((isSelected) => !isSelected);
}, [menuItems]);
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
const wrapperStyle = hasInnerWrapper && ToolsPanelWithInnerWrapper(DEFAULT_COLUMNS);
const emptyStyle = areAllOptionalControlsHidden && ToolsPanelHiddenInnerWrapper;
return cx(ToolsPanel(DEFAULT_COLUMNS), wrapperStyle, emptyStyle, className);
}, [areAllOptionalControlsHidden, className, cx, hasInnerWrapper]);
const toggleItem = (0,external_wp_element_namespaceObject.useCallback)((label) => {
panelDispatch({
type: "TOGGLE_VALUE",
label
});
}, []);
const resetAllItems = (0,external_wp_element_namespaceObject.useCallback)(() => {
if (typeof resetAll === "function") {
isResettingRef.current = true;
resetAll(resetAllFilters);
}
panelDispatch({
type: "RESET_ALL"
});
}, [resetAllFilters, resetAll]);
const getFirstVisibleItemLabel = (items) => {
const optionalItems = menuItems.optional || {};
const firstItem = items.find((item) => item.isShownByDefault || optionalItems[item.label]);
return firstItem?.label;
};
const firstDisplayedItem = getFirstVisibleItemLabel(panelItems);
const lastDisplayedItem = getFirstVisibleItemLabel([...panelItems].reverse());
const hasMenuItems = panelItems.length > 0;
const panelContext = (0,external_wp_element_namespaceObject.useMemo)(() => ({
areAllOptionalControlsHidden,
deregisterPanelItem,
deregisterResetAllFilter,
firstDisplayedItem,
flagItemCustomization,
hasMenuItems,
isResetting: isResettingRef.current,
lastDisplayedItem,
menuItems,
panelId,
registerPanelItem,
registerResetAllFilter,
shouldRenderPlaceholderItems,
__experimentalFirstVisibleItemClass,
__experimentalLastVisibleItemClass
}), [areAllOptionalControlsHidden, deregisterPanelItem, deregisterResetAllFilter, firstDisplayedItem, flagItemCustomization, lastDisplayedItem, menuItems, panelId, hasMenuItems, registerResetAllFilter, registerPanelItem, shouldRenderPlaceholderItems, __experimentalFirstVisibleItemClass, __experimentalLastVisibleItemClass]);
return {
...otherProps,
headingLevel,
panelContext,
resetAllItems,
toggleItem,
className: classes
};
}
;// ./node_modules/@wordpress/components/build-module/tools-panel/tools-panel/component.js
const UnconnectedToolsPanel = (props, forwardedRef) => {
const {
children,
label,
panelContext,
resetAllItems,
toggleItem,
headingLevel,
dropdownMenuProps,
...toolsPanelProps
} = useToolsPanel(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(grid_component_component_default, {
...toolsPanelProps,
columns: 2,
ref: forwardedRef,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ToolsPanelContext.Provider, {
value: panelContext,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tools_panel_header_component_component_default, {
label,
resetAll: resetAllItems,
toggleItem,
headingLevel,
dropdownMenuProps
}), children]
})
});
};
const component_ToolsPanel = contextConnect(UnconnectedToolsPanel, "ToolsPanel");
var tools_panel_component_component_default = component_ToolsPanel;
;// ./node_modules/@wordpress/components/build-module/tools-panel/tools-panel-item/hook.js
const hook_noop = () => {
};
function useToolsPanelItem(props) {
const {
className,
hasValue,
isShownByDefault = false,
label,
panelId,
resetAllFilter = hook_noop,
onDeselect,
onSelect,
...otherProps
} = useContextSystem(props, "ToolsPanelItem");
const {
panelId: currentPanelId,
menuItems,
registerResetAllFilter,
deregisterResetAllFilter,
registerPanelItem,
deregisterPanelItem,
flagItemCustomization,
isResetting,
shouldRenderPlaceholderItems: shouldRenderPlaceholder,
firstDisplayedItem,
lastDisplayedItem,
__experimentalFirstVisibleItemClass,
__experimentalLastVisibleItemClass
} = useToolsPanelContext();
const hasValueCallback = (0,external_wp_element_namespaceObject.useCallback)(hasValue, [panelId]);
const resetAllFilterCallback = (0,external_wp_element_namespaceObject.useCallback)(resetAllFilter, [panelId]);
const previousPanelId = (0,external_wp_compose_namespaceObject.usePrevious)(currentPanelId);
const hasMatchingPanel = currentPanelId === panelId || currentPanelId === null;
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (hasMatchingPanel && previousPanelId !== null) {
registerPanelItem({
hasValue: hasValueCallback,
isShownByDefault,
label,
panelId
});
}
return () => {
if (previousPanelId === null && !!currentPanelId || currentPanelId === panelId) {
deregisterPanelItem(label);
}
};
}, [currentPanelId, hasMatchingPanel, isShownByDefault, label, hasValueCallback, panelId, previousPanelId, registerPanelItem, deregisterPanelItem]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (hasMatchingPanel) {
registerResetAllFilter(resetAllFilterCallback);
}
return () => {
if (hasMatchingPanel) {
deregisterResetAllFilter(resetAllFilterCallback);
}
};
}, [registerResetAllFilter, deregisterResetAllFilter, resetAllFilterCallback, hasMatchingPanel]);
const menuGroup = isShownByDefault ? "default" : "optional";
const isMenuItemChecked = menuItems?.[menuGroup]?.[label];
const wasMenuItemChecked = (0,external_wp_compose_namespaceObject.usePrevious)(isMenuItemChecked);
const isRegistered = menuItems?.[menuGroup]?.[label] !== void 0;
const isValueSet = hasValue();
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isShownByDefault && !isValueSet) {
return;
}
flagItemCustomization(isValueSet, label, menuGroup);
}, [isValueSet, menuGroup, label, flagItemCustomization, isShownByDefault]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isRegistered || isResetting || !hasMatchingPanel) {
return;
}
if (isMenuItemChecked && !isValueSet && !wasMenuItemChecked) {
onSelect?.();
}
if (!isMenuItemChecked && isValueSet && wasMenuItemChecked) {
onDeselect?.();
}
}, [hasMatchingPanel, isMenuItemChecked, isRegistered, isResetting, isValueSet, wasMenuItemChecked, onSelect, onDeselect]);
const isShown = isShownByDefault ? menuItems?.[menuGroup]?.[label] !== void 0 : isMenuItemChecked;
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
const shouldApplyPlaceholderStyles = shouldRenderPlaceholder && !isShown;
const firstItemStyle = firstDisplayedItem === label && __experimentalFirstVisibleItemClass;
const lastItemStyle = lastDisplayedItem === label && __experimentalLastVisibleItemClass;
return cx(ToolsPanelItem, shouldApplyPlaceholderStyles && ToolsPanelItemPlaceholder, !shouldApplyPlaceholderStyles && className, firstItemStyle, lastItemStyle);
}, [isShown, shouldRenderPlaceholder, className, cx, firstDisplayedItem, lastDisplayedItem, __experimentalFirstVisibleItemClass, __experimentalLastVisibleItemClass, label]);
return {
...otherProps,
isShown,
shouldRenderPlaceholder,
className: classes
};
}
;// ./node_modules/@wordpress/components/build-module/tools-panel/tools-panel-item/component.js
const UnconnectedToolsPanelItem = (props, forwardedRef) => {
const {
children,
isShown,
shouldRenderPlaceholder,
...toolsPanelItemProps
} = useToolsPanelItem(props);
if (!isShown) {
return shouldRenderPlaceholder ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...toolsPanelItemProps,
ref: forwardedRef
}) : null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
...toolsPanelItemProps,
ref: forwardedRef,
children
});
};
const component_ToolsPanelItem = contextConnect(UnconnectedToolsPanelItem, "ToolsPanelItem");
var tools_panel_item_component_component_default = component_ToolsPanelItem;
;// ./node_modules/@wordpress/components/build-module/tree-grid/roving-tab-index-context.js
const RovingTabIndexContext = (0,external_wp_element_namespaceObject.createContext)(void 0);
RovingTabIndexContext.displayName = "RovingTabIndexContext";
const useRovingTabIndexContext = () => (0,external_wp_element_namespaceObject.useContext)(RovingTabIndexContext);
const RovingTabIndexProvider = RovingTabIndexContext.Provider;
;// ./node_modules/@wordpress/components/build-module/tree-grid/roving-tab-index.js
function RovingTabIndex({
children
}) {
const [lastFocusedElement, setLastFocusedElement] = (0,external_wp_element_namespaceObject.useState)();
const providerValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
lastFocusedElement,
setLastFocusedElement
}), [lastFocusedElement]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RovingTabIndexProvider, {
value: providerValue,
children
});
}
;// ./node_modules/@wordpress/components/build-module/tree-grid/index.js
function getRowFocusables(rowElement) {
const focusablesInRow = external_wp_dom_namespaceObject.focus.focusable.find(rowElement, {
sequential: true
});
return focusablesInRow.filter((focusable) => {
return focusable.closest('[role="row"]') === rowElement;
});
}
function UnforwardedTreeGrid({
children,
onExpandRow = () => {
},
onCollapseRow = () => {
},
onFocusRow = () => {
},
applicationAriaLabel,
...props
}, ref) {
const onKeyDown = (0,external_wp_element_namespaceObject.useCallback)((event) => {
const {
keyCode,
metaKey,
ctrlKey,
altKey
} = event;
const hasModifierKeyPressed = metaKey || ctrlKey || altKey;
if (hasModifierKeyPressed || ![external_wp_keycodes_namespaceObject.UP, external_wp_keycodes_namespaceObject.DOWN, external_wp_keycodes_namespaceObject.LEFT, external_wp_keycodes_namespaceObject.RIGHT, external_wp_keycodes_namespaceObject.HOME, external_wp_keycodes_namespaceObject.END].includes(keyCode)) {
return;
}
event.stopPropagation();
const {
activeElement
} = document;
const {
currentTarget: treeGridElement
} = event;
if (!activeElement || !treeGridElement.contains(activeElement)) {
return;
}
const activeRow = activeElement.closest('[role="row"]');
if (!activeRow) {
return;
}
const focusablesInRow = getRowFocusables(activeRow);
const currentColumnIndex = focusablesInRow.indexOf(activeElement);
const canExpandCollapse = 0 === currentColumnIndex;
const cannotFocusNextColumn = canExpandCollapse && (activeRow.getAttribute("data-expanded") === "false" || activeRow.getAttribute("aria-expanded") === "false") && keyCode === external_wp_keycodes_namespaceObject.RIGHT;
if ([external_wp_keycodes_namespaceObject.LEFT, external_wp_keycodes_namespaceObject.RIGHT].includes(keyCode)) {
let nextIndex;
if (keyCode === external_wp_keycodes_namespaceObject.LEFT) {
nextIndex = Math.max(0, currentColumnIndex - 1);
} else {
nextIndex = Math.min(currentColumnIndex + 1, focusablesInRow.length - 1);
}
if (canExpandCollapse) {
if (keyCode === external_wp_keycodes_namespaceObject.LEFT) {
var _activeRow$getAttribu;
if (activeRow.getAttribute("data-expanded") === "true" || activeRow.getAttribute("aria-expanded") === "true") {
onCollapseRow(activeRow);
event.preventDefault();
return;
}
const level = Math.max(parseInt((_activeRow$getAttribu = activeRow?.getAttribute("aria-level")) !== null && _activeRow$getAttribu !== void 0 ? _activeRow$getAttribu : "1", 10) - 1, 1);
const rows = Array.from(treeGridElement.querySelectorAll('[role="row"]'));
let parentRow = activeRow;
const currentRowIndex = rows.indexOf(activeRow);
for (let i = currentRowIndex; i >= 0; i--) {
const ariaLevel = rows[i].getAttribute("aria-level");
if (ariaLevel !== null && parseInt(ariaLevel, 10) === level) {
parentRow = rows[i];
break;
}
}
getRowFocusables(parentRow)?.[0]?.focus();
}
if (keyCode === external_wp_keycodes_namespaceObject.RIGHT) {
if (activeRow.getAttribute("data-expanded") === "false" || activeRow.getAttribute("aria-expanded") === "false") {
onExpandRow(activeRow);
event.preventDefault();
return;
}
const focusableItems = getRowFocusables(activeRow);
if (focusableItems.length > 0) {
focusableItems[nextIndex]?.focus();
}
}
event.preventDefault();
return;
}
if (cannotFocusNextColumn) {
return;
}
focusablesInRow[nextIndex].focus();
event.preventDefault();
} else if ([external_wp_keycodes_namespaceObject.UP, external_wp_keycodes_namespaceObject.DOWN].includes(keyCode)) {
const rows = Array.from(treeGridElement.querySelectorAll('[role="row"]'));
const currentRowIndex = rows.indexOf(activeRow);
let nextRowIndex;
if (keyCode === external_wp_keycodes_namespaceObject.UP) {
nextRowIndex = Math.max(0, currentRowIndex - 1);
} else {
nextRowIndex = Math.min(currentRowIndex + 1, rows.length - 1);
}
if (nextRowIndex === currentRowIndex) {
event.preventDefault();
return;
}
const focusablesInNextRow = getRowFocusables(rows[nextRowIndex]);
if (!focusablesInNextRow || !focusablesInNextRow.length) {
event.preventDefault();
return;
}
const nextIndex = Math.min(currentColumnIndex, focusablesInNextRow.length - 1);
focusablesInNextRow[nextIndex].focus();
onFocusRow(event, activeRow, rows[nextRowIndex]);
event.preventDefault();
} else if ([external_wp_keycodes_namespaceObject.HOME, external_wp_keycodes_namespaceObject.END].includes(keyCode)) {
const rows = Array.from(treeGridElement.querySelectorAll('[role="row"]'));
const currentRowIndex = rows.indexOf(activeRow);
let nextRowIndex;
if (keyCode === external_wp_keycodes_namespaceObject.HOME) {
nextRowIndex = 0;
} else {
nextRowIndex = rows.length - 1;
}
if (nextRowIndex === currentRowIndex) {
event.preventDefault();
return;
}
const focusablesInNextRow = getRowFocusables(rows[nextRowIndex]);
if (!focusablesInNextRow || !focusablesInNextRow.length) {
event.preventDefault();
return;
}
const nextIndex = Math.min(currentColumnIndex, focusablesInNextRow.length - 1);
focusablesInNextRow[nextIndex].focus();
onFocusRow(event, activeRow, rows[nextRowIndex]);
event.preventDefault();
}
}, [onExpandRow, onCollapseRow, onFocusRow]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RovingTabIndex, {
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
role: "application",
"aria-label": applicationAriaLabel,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("table", {
...props,
role: "treegrid",
onKeyDown,
ref,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("tbody", {
children
})
})
})
});
}
const TreeGrid = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTreeGrid);
var tree_grid_default = TreeGrid;
;// ./node_modules/@wordpress/components/build-module/tree-grid/roving-tab-index-item.js
const RovingTabIndexItem = (0,external_wp_element_namespaceObject.forwardRef)(function UnforwardedRovingTabIndexItem({
children,
as: Component,
...props
}, forwardedRef) {
const localRef = (0,external_wp_element_namespaceObject.useRef)();
const ref = forwardedRef || localRef;
const {
lastFocusedElement,
setLastFocusedElement
} = useRovingTabIndexContext();
let tabIndex;
if (lastFocusedElement) {
tabIndex = lastFocusedElement === // TODO: The original implementation simply used `ref.current` here, assuming
// that a forwarded ref would always be an object, which is not necessarily true.
// This workaround maintains the original runtime behavior in a type-safe way,
// but should be revisited.
("current" in ref ? ref.current : void 0) ? 0 : -1;
}
const onFocus = (event) => setLastFocusedElement?.(event.target);
const allProps = {
ref,
tabIndex,
onFocus,
...props
};
if (typeof children === "function") {
return children(allProps);
}
if (!Component) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
...allProps,
children
});
});
var roving_tab_index_item_default = RovingTabIndexItem;
;// ./node_modules/@wordpress/components/build-module/tree-grid/item.js
function UnforwardedTreeGridItem({
children,
...props
}, ref) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(roving_tab_index_item_default, {
ref,
...props,
children
});
}
const TreeGridItem = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTreeGridItem);
var tree_grid_item_item_default = TreeGridItem;
;// ./node_modules/@wordpress/components/build-module/tree-grid/cell.js
function UnforwardedTreeGridCell({
children,
withoutGridItem = false,
...props
}, ref) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("td", {
...props,
role: "gridcell",
children: withoutGridItem ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: typeof children === "function" ? children({
...props,
ref
}) : children
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tree_grid_item_item_default, {
ref,
children
})
});
}
const TreeGridCell = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTreeGridCell);
var cell_default = TreeGridCell;
;// ./node_modules/@wordpress/components/build-module/tree-grid/row.js
function UnforwardedTreeGridRow({
children,
level,
positionInSet,
setSize,
isExpanded,
...props
}, ref) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", {
...props,
ref,
role: "row",
"aria-level": level,
"aria-posinset": positionInSet,
"aria-setsize": setSize,
"aria-expanded": isExpanded,
children
});
}
const TreeGridRow = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTreeGridRow);
var row_row_default = TreeGridRow;
;// ./node_modules/@wordpress/components/build-module/isolated-event-container/index.js
function stopPropagation(event) {
event.stopPropagation();
}
const IsolatedEventContainer = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
external_wp_deprecated_default()("wp.components.IsolatedEventContainer", {
since: "5.7"
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...props,
ref,
onMouseDown: stopPropagation
});
});
var isolated_event_container_default = IsolatedEventContainer;
;// ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot-fills.js
function useSlotFills(name) {
const registry = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context_default);
return (0,external_wp_compose_namespaceObject.useObservableValue)(registry.fills, name);
}
;// ./node_modules/@wordpress/components/build-module/z-stack/styles.js
function z_stack_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const ZStackChildView = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "ebn2ljm1"
} : 0)("&:not( :first-of-type ){", ({
offsetAmount
}) => /* @__PURE__ */ emotion_react_browser_esm_css({
marginInlineStart: offsetAmount
}, true ? "" : 0, true ? "" : 0), ";}", ({
zIndex
}) => /* @__PURE__ */ emotion_react_browser_esm_css({
zIndex
}, true ? "" : 0, true ? "" : 0), ";" + ( true ? "" : 0));
var z_stack_styles_ref = true ? {
name: "rs0gp6",
styles: "grid-row-start:1;grid-column-start:1"
} : 0;
const ZStackView = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "ebn2ljm0"
} : 0)("display:inline-grid;grid-auto-flow:column;position:relative;&>", ZStackChildView, "{position:relative;justify-self:start;", ({
isLayered
}) => isLayered ? (
// When `isLayered` is true, all items overlap in the same grid cell
z_stack_styles_ref
) : void 0, ";}" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/z-stack/component.js
function UnconnectedZStack(props, forwardedRef) {
const {
children,
className,
isLayered = true,
isReversed = false,
offset = 0,
...otherProps
} = useContextSystem(props, "ZStack");
const validChildren = getValidChildren(children);
const childrenLastIndex = validChildren.length - 1;
const clonedChildren = validChildren.map((child, index) => {
const zIndex = isReversed ? childrenLastIndex - index : index;
const offsetAmount = isLayered ? offset * index : offset;
const key = (0,external_wp_element_namespaceObject.isValidElement)(child) ? child.key : index;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ZStackChildView, {
offsetAmount,
zIndex,
children: child
}, key);
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ZStackView, {
...otherProps,
className,
isLayered,
ref: forwardedRef,
children: clonedChildren
});
}
const ZStack = contextConnect(UnconnectedZStack, "ZStack");
var z_stack_component_component_default = ZStack;
;// ./node_modules/@wordpress/components/build-module/higher-order/navigate-regions/index.js
const defaultShortcuts = {
previous: [{
modifier: "ctrlShift",
character: "`"
}, {
modifier: "ctrlShift",
character: "~"
}, {
modifier: "access",
character: "p"
}],
next: [{
modifier: "ctrl",
character: "`"
}, {
modifier: "access",
character: "n"
}]
};
function useNavigateRegions(shortcuts = defaultShortcuts) {
const ref = (0,external_wp_element_namespaceObject.useRef)(null);
const [isFocusingRegions, setIsFocusingRegions] = (0,external_wp_element_namespaceObject.useState)(false);
function focusRegion(offset) {
var _ref$current$querySel;
const regions = Array.from((_ref$current$querySel = ref.current?.querySelectorAll('[role="region"][tabindex="-1"]')) !== null && _ref$current$querySel !== void 0 ? _ref$current$querySel : []);
if (!regions.length) {
return;
}
let nextRegion = regions[0];
const wrappingRegion = ref.current?.ownerDocument?.activeElement?.closest('[role="region"][tabindex="-1"]');
const selectedIndex = wrappingRegion ? regions.indexOf(wrappingRegion) : -1;
if (selectedIndex !== -1) {
let nextIndex = selectedIndex + offset;
nextIndex = nextIndex === -1 ? regions.length - 1 : nextIndex;
nextIndex = nextIndex === regions.length ? 0 : nextIndex;
nextRegion = regions[nextIndex];
}
nextRegion.focus();
setIsFocusingRegions(true);
}
const clickRef = (0,external_wp_compose_namespaceObject.useRefEffect)((element) => {
function onClick() {
setIsFocusingRegions(false);
}
element.addEventListener("click", onClick);
return () => {
element.removeEventListener("click", onClick);
};
}, [setIsFocusingRegions]);
return {
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, clickRef]),
className: isFocusingRegions ? "is-focusing-regions" : "",
onKeyDown(event) {
if (shortcuts.previous.some(({
modifier,
character
}) => {
return external_wp_keycodes_namespaceObject.isKeyboardEvent[modifier](event, character);
})) {
focusRegion(-1);
} else if (shortcuts.next.some(({
modifier,
character
}) => {
return external_wp_keycodes_namespaceObject.isKeyboardEvent[modifier](event, character);
})) {
focusRegion(1);
}
}
};
}
var navigate_regions_default = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((Component) => ({
shortcuts,
...props
}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...useNavigateRegions(shortcuts),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
...props
})
}), "navigateRegions");
;// ./node_modules/@wordpress/components/build-module/higher-order/with-constrained-tabbing/index.js
const withConstrainedTabbing = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((WrappedComponent) => function ComponentWithConstrainedTabbing(props) {
const ref = (0,external_wp_compose_namespaceObject.useConstrainedTabbing)();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
ref,
tabIndex: -1,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
...props
})
});
}, "withConstrainedTabbing");
var with_constrained_tabbing_default = withConstrainedTabbing;
;// ./node_modules/@wordpress/components/build-module/higher-order/with-fallback-styles/index.js
var with_fallback_styles_default = (mapNodeToProps) => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((WrappedComponent) => {
return class extends external_wp_element_namespaceObject.Component {
constructor(props) {
super(props);
this.nodeRef = this.props.node;
this.state = {
fallbackStyles: void 0,
grabStylesCompleted: false
};
this.bindRef = this.bindRef.bind(this);
}
bindRef(node) {
if (!node) {
return;
}
this.nodeRef = node;
}
componentDidMount() {
this.grabFallbackStyles();
}
componentDidUpdate() {
this.grabFallbackStyles();
}
grabFallbackStyles() {
const {
grabStylesCompleted,
fallbackStyles
} = this.state;
if (this.nodeRef && !grabStylesCompleted) {
const newFallbackStyles = mapNodeToProps(this.nodeRef, this.props);
if (!es6_default()(newFallbackStyles, fallbackStyles)) {
this.setState({
fallbackStyles: newFallbackStyles,
grabStylesCompleted: Object.values(newFallbackStyles).every(Boolean)
});
}
}
}
render() {
const wrappedComponent = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
...this.props,
...this.state.fallbackStyles
});
return this.props.node ? wrappedComponent : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
ref: this.bindRef,
children: [" ", wrappedComponent, " "]
});
}
};
}, "withFallbackStyles");
;// external ["wp","hooks"]
const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
;// ./node_modules/@wordpress/components/build-module/higher-order/with-filters/index.js
const ANIMATION_FRAME_PERIOD = 16;
function withFilters(hookName) {
return (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((OriginalComponent) => {
const namespace = "core/with-filters/" + hookName;
let FilteredComponent;
function ensureFilteredComponent() {
if (FilteredComponent === void 0) {
FilteredComponent = (0,external_wp_hooks_namespaceObject.applyFilters)(hookName, OriginalComponent);
}
}
class FilteredComponentRenderer extends external_wp_element_namespaceObject.Component {
constructor(props) {
super(props);
ensureFilteredComponent();
}
componentDidMount() {
FilteredComponentRenderer.instances.push(this);
if (FilteredComponentRenderer.instances.length === 1) {
(0,external_wp_hooks_namespaceObject.addAction)("hookRemoved", namespace, onHooksUpdated);
(0,external_wp_hooks_namespaceObject.addAction)("hookAdded", namespace, onHooksUpdated);
}
}
componentWillUnmount() {
FilteredComponentRenderer.instances = FilteredComponentRenderer.instances.filter((instance) => instance !== this);
if (FilteredComponentRenderer.instances.length === 0) {
(0,external_wp_hooks_namespaceObject.removeAction)("hookRemoved", namespace);
(0,external_wp_hooks_namespaceObject.removeAction)("hookAdded", namespace);
}
}
render() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FilteredComponent, {
...this.props
});
}
}
FilteredComponentRenderer.instances = [];
const throttledForceUpdate = (0,external_wp_compose_namespaceObject.debounce)(() => {
FilteredComponent = (0,external_wp_hooks_namespaceObject.applyFilters)(hookName, OriginalComponent);
FilteredComponentRenderer.instances.forEach((instance) => {
instance.forceUpdate();
});
}, ANIMATION_FRAME_PERIOD);
function onHooksUpdated(updatedHookName) {
if (updatedHookName === hookName) {
throttledForceUpdate();
}
}
return FilteredComponentRenderer;
}, "withFilters");
}
;// ./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/index.js
function isComponentLike(object) {
return object instanceof external_wp_element_namespaceObject.Component || typeof object === "function";
}
var with_focus_return_default = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
// @ts-expect-error TODO: Reconcile with intended `createHigherOrderComponent` types
(options) => {
const HoC = ({
onFocusReturn
} = {}) => (WrappedComponent) => {
const WithFocusReturn = (props) => {
const ref = (0,external_wp_compose_namespaceObject.useFocusReturn)(onFocusReturn);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
ref,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
...props
})
});
};
return WithFocusReturn;
};
if (isComponentLike(options)) {
const WrappedComponent = options;
return HoC()(WrappedComponent);
}
return HoC(options);
},
"withFocusReturn"
);
const with_focus_return_Provider = ({
children
}) => {
external_wp_deprecated_default()("wp.components.FocusReturnProvider component", {
since: "5.7",
hint: "This provider is not used anymore. You can just remove it from your codebase"
});
return children;
};
;// ./node_modules/@wordpress/components/build-module/higher-order/with-notices/index.js
var with_notices_default = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((OriginalComponent) => {
function Component(props, ref) {
const [noticeList, setNoticeList] = (0,external_wp_element_namespaceObject.useState)([]);
const noticeOperations = (0,external_wp_element_namespaceObject.useMemo)(() => {
const createNotice = (notice) => {
const noticeToAdd = notice.id ? notice : {
...notice,
id: esm_browser_v4()
};
setNoticeList((current) => [...current, noticeToAdd]);
};
return {
createNotice,
createErrorNotice: (msg) => {
createNotice({
status: "error",
content: msg
});
},
removeNotice: (id) => {
setNoticeList((current) => current.filter((notice) => notice.id !== id));
},
removeAllNotices: () => {
setNoticeList([]);
}
};
}, []);
const propsOut = {
...props,
noticeList,
noticeOperations,
noticeUI: noticeList.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(list_default, {
className: "components-with-notices-ui",
notices: noticeList,
onRemove: noticeOperations.removeNotice
})
};
return isForwardRef ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalComponent, {
...propsOut,
ref
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalComponent, {
...propsOut
});
}
let isForwardRef;
const {
render
} = OriginalComponent;
if (typeof render === "function") {
isForwardRef = true;
return (0,external_wp_element_namespaceObject.forwardRef)(Component);
}
return Component;
}, "withNotices");
;// ./node_modules/@ariakit/react-core/esm/__chunks/B2J376ND.js
"use client";
// src/menu/menu-context.tsx
var menu = createStoreContext(
[CompositeContextProvider, HovercardContextProvider],
[CompositeScopedContextProvider, HovercardScopedContextProvider]
);
var useMenuContext = menu.useContext;
var useMenuScopedContext = menu.useScopedContext;
var useMenuProviderContext = menu.useProviderContext;
var MenuContextProvider = menu.ContextProvider;
var MenuScopedContextProvider = menu.ScopedContextProvider;
var useMenuBarContext = (/* unused pure expression or super */ null && (useMenubarContext));
var useMenuBarScopedContext = (/* unused pure expression or super */ null && (useMenubarScopedContext));
var useMenuBarProviderContext = (/* unused pure expression or super */ null && (useMenubarProviderContext));
var MenuBarContextProvider = (/* unused pure expression or super */ null && (MenubarContextProvider));
var MenuBarScopedContextProvider = (/* unused pure expression or super */ null && (MenubarScopedContextProvider));
var MenuItemCheckedContext = (0,external_React_.createContext)(
void 0
);
;// ./node_modules/@ariakit/react-core/esm/__chunks/62UHHO2X.js
"use client";
// src/menubar/menubar-context.tsx
var menubar = createStoreContext(
[CompositeContextProvider],
[CompositeScopedContextProvider]
);
var _62UHHO2X_useMenubarContext = menubar.useContext;
var _62UHHO2X_useMenubarScopedContext = menubar.useScopedContext;
var _62UHHO2X_useMenubarProviderContext = menubar.useProviderContext;
var _62UHHO2X_MenubarContextProvider = menubar.ContextProvider;
var _62UHHO2X_MenubarScopedContextProvider = menubar.ScopedContextProvider;
var _62UHHO2X_MenuItemCheckedContext = (0,external_React_.createContext)(
void 0
);
;// ./node_modules/@ariakit/core/esm/menu/menu-store.js
"use client";
// src/menu/menu-store.ts
function createMenuStore(_a = {}) {
var _b = _a, {
combobox,
parent,
menubar
} = _b, props = _3YLGPPWQ_objRest(_b, [
"combobox",
"parent",
"menubar"
]);
const parentIsMenubar = !!menubar && !parent;
const store = mergeStore(
props.store,
pick2(parent, ["values"]),
omit2(combobox, [
"arrowElement",
"anchorElement",
"contentElement",
"popoverElement",
"disclosureElement"
])
);
throwOnConflictingProps(props, store);
const syncState = store.getState();
const composite = createCompositeStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
store,
orientation: defaultValue(
props.orientation,
syncState.orientation,
"vertical"
)
}));
const hovercard = createHovercardStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
store,
placement: defaultValue(
props.placement,
syncState.placement,
"bottom-start"
),
timeout: defaultValue(
props.timeout,
syncState.timeout,
parentIsMenubar ? 0 : 150
),
hideTimeout: defaultValue(props.hideTimeout, syncState.hideTimeout, 0)
}));
const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, composite.getState()), hovercard.getState()), {
initialFocus: defaultValue(syncState.initialFocus, "container"),
values: defaultValue(
props.values,
syncState.values,
props.defaultValues,
{}
)
});
const menu = createStore(initialState, composite, hovercard, store);
setup(
menu,
() => sync(menu, ["mounted"], (state) => {
if (state.mounted) return;
menu.setState("activeId", null);
})
);
setup(
menu,
() => sync(parent, ["orientation"], (state) => {
menu.setState(
"placement",
state.orientation === "vertical" ? "right-start" : "bottom-start"
);
})
);
return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, composite), hovercard), menu), {
combobox,
parent,
menubar,
hideAll: () => {
hovercard.hide();
parent == null ? void 0 : parent.hideAll();
},
setInitialFocus: (value) => menu.setState("initialFocus", value),
setValues: (values) => menu.setState("values", values),
setValue: (name, value) => {
if (name === "__proto__") return;
if (name === "constructor") return;
if (Array.isArray(name)) return;
menu.setState("values", (values) => {
const prevValue = values[name];
const nextValue = applyState(value, prevValue);
if (nextValue === prevValue) return values;
return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, values), {
[name]: nextValue !== void 0 && nextValue
});
});
}
});
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/MRTXKBQF.js
"use client";
// src/menu/menu-store.ts
function useMenuStoreProps(store, update, props) {
useUpdateEffect(update, [props.combobox, props.parent, props.menubar]);
useStoreProps(store, props, "values", "setValues");
return Object.assign(
useHovercardStoreProps(
useCompositeStoreProps(store, update, props),
update,
props
),
{
combobox: props.combobox,
parent: props.parent,
menubar: props.menubar
}
);
}
function useMenuStore(props = {}) {
const parent = useMenuContext();
const menubar = _62UHHO2X_useMenubarContext();
const combobox = useComboboxProviderContext();
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
parent: props.parent !== void 0 ? props.parent : parent,
menubar: props.menubar !== void 0 ? props.menubar : menubar,
combobox: props.combobox !== void 0 ? props.combobox : combobox
});
const [store, update] = YV4JVR4I_useStore(createMenuStore, props);
return useMenuStoreProps(store, update, props);
}
;// ./node_modules/@wordpress/components/build-module/menu/context.js
const context_Context = (0,external_wp_element_namespaceObject.createContext)(void 0);
context_Context.displayName = "MenuContext";
;// ./node_modules/@ariakit/react-core/esm/__chunks/MVIULMNR.js
"use client";
// src/menu/menu-item.tsx
var MVIULMNR_TagName = "div";
function menuHasFocus(baseElement, items, currentTarget) {
var _a;
if (!baseElement) return false;
if (hasFocusWithin(baseElement)) return true;
const expandedItem = items == null ? void 0 : items.find((item) => {
var _a2;
if (item.element === currentTarget) return false;
return ((_a2 = item.element) == null ? void 0 : _a2.getAttribute("aria-expanded")) === "true";
});
const expandedMenuId = (_a = expandedItem == null ? void 0 : expandedItem.element) == null ? void 0 : _a.getAttribute("aria-controls");
if (!expandedMenuId) return false;
const doc = getDocument(baseElement);
const expandedMenu = doc.getElementById(expandedMenuId);
if (!expandedMenu) return false;
if (hasFocusWithin(expandedMenu)) return true;
return !!expandedMenu.querySelector("[role=menuitem][aria-expanded=true]");
}
var useMenuItem = createHook(
function useMenuItem2(_a) {
var _b = _a, {
store,
hideOnClick = true,
preventScrollOnKeyDown = true,
focusOnHover,
blurOnHoverEnd
} = _b, props = __objRest(_b, [
"store",
"hideOnClick",
"preventScrollOnKeyDown",
"focusOnHover",
"blurOnHoverEnd"
]);
const menuContext = useMenuScopedContext(true);
const menubarContext = _62UHHO2X_useMenubarScopedContext();
store = store || menuContext || menubarContext;
invariant(
store,
false && 0
);
const onClickProp = props.onClick;
const hideOnClickProp = useBooleanEvent(hideOnClick);
const hideMenu = "hideAll" in store ? store.hideAll : void 0;
const isWithinMenu = !!hideMenu;
const onClick = useEvent((event) => {
onClickProp == null ? void 0 : onClickProp(event);
if (event.defaultPrevented) return;
if (isDownloading(event)) return;
if (isOpeningInNewTab(event)) return;
if (!hideMenu) return;
const popupType = event.currentTarget.getAttribute("aria-haspopup");
if (popupType === "menu") return;
if (!hideOnClickProp(event)) return;
hideMenu();
});
const contentElement = useStoreState(
store,
(state) => "contentElement" in state ? state.contentElement : null
);
const role = getPopupItemRole(contentElement, "menuitem");
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
role
}, props), {
onClick
});
props = useCompositeItem(_3YLGPPWQ_spreadValues({
store,
preventScrollOnKeyDown
}, props));
props = useCompositeHover(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
store
}, props), {
focusOnHover(event) {
const getFocusOnHover = () => {
if (typeof focusOnHover === "function") return focusOnHover(event);
if (focusOnHover != null) return focusOnHover;
return true;
};
if (!store) return false;
if (!getFocusOnHover()) return false;
const { baseElement, items } = store.getState();
if (isWithinMenu) {
if (event.currentTarget.hasAttribute("aria-expanded")) {
event.currentTarget.focus();
}
return true;
}
if (menuHasFocus(baseElement, items, event.currentTarget)) {
event.currentTarget.focus();
return true;
}
return false;
},
blurOnHoverEnd(event) {
if (typeof blurOnHoverEnd === "function") return blurOnHoverEnd(event);
if (blurOnHoverEnd != null) return blurOnHoverEnd;
return isWithinMenu;
}
}));
return props;
}
);
var MVIULMNR_MenuItem = memo2(
forwardRef2(function MenuItem2(props) {
const htmlProps = useMenuItem(props);
return LMDWO4NN_createElement(MVIULMNR_TagName, htmlProps);
})
);
;// ./node_modules/@ariakit/react-core/esm/__chunks/RNCDFVMF.js
"use client";
// src/checkbox/checkbox-context.tsx
var RNCDFVMF_ctx = createStoreContext();
var useCheckboxContext = RNCDFVMF_ctx.useContext;
var useCheckboxScopedContext = RNCDFVMF_ctx.useScopedContext;
var useCheckboxProviderContext = RNCDFVMF_ctx.useProviderContext;
var CheckboxContextProvider = RNCDFVMF_ctx.ContextProvider;
var CheckboxScopedContextProvider = RNCDFVMF_ctx.ScopedContextProvider;
;// ./node_modules/@ariakit/react-core/esm/__chunks/ASMQKSDT.js
"use client";
// src/checkbox/checkbox.tsx
var ASMQKSDT_TagName = "input";
function setMixed(element, mixed) {
if (mixed) {
element.indeterminate = true;
} else if (element.indeterminate) {
element.indeterminate = false;
}
}
function isNativeCheckbox(tagName, type) {
return tagName === "input" && (!type || type === "checkbox");
}
function getPrimitiveValue(value) {
if (Array.isArray(value)) {
return value.toString();
}
return value;
}
var useCheckbox = createHook(
function useCheckbox2(_a) {
var _b = _a, {
store,
name,
value: valueProp,
checked: checkedProp,
defaultChecked
} = _b, props = __objRest(_b, [
"store",
"name",
"value",
"checked",
"defaultChecked"
]);
const context = useCheckboxContext();
store = store || context;
const [_checked, setChecked] = (0,external_React_.useState)(defaultChecked != null ? defaultChecked : false);
const checked = useStoreState(store, (state) => {
if (checkedProp !== void 0) return checkedProp;
if ((state == null ? void 0 : state.value) === void 0) return _checked;
if (valueProp != null) {
if (Array.isArray(state.value)) {
const primitiveValue = getPrimitiveValue(valueProp);
return state.value.includes(primitiveValue);
}
return state.value === valueProp;
}
if (Array.isArray(state.value)) return false;
if (typeof state.value === "boolean") return state.value;
return false;
});
const ref = (0,external_React_.useRef)(null);
const tagName = useTagName(ref, ASMQKSDT_TagName);
const nativeCheckbox = isNativeCheckbox(tagName, props.type);
const mixed = checked ? checked === "mixed" : void 0;
const isChecked = checked === "mixed" ? false : checked;
const disabled = disabledFromProps(props);
const [propertyUpdated, schedulePropertyUpdate] = useForceUpdate();
(0,external_React_.useEffect)(() => {
const element = ref.current;
if (!element) return;
setMixed(element, mixed);
if (nativeCheckbox) return;
element.checked = isChecked;
if (name !== void 0) {
element.name = name;
}
if (valueProp !== void 0) {
element.value = `${valueProp}`;
}
}, [propertyUpdated, mixed, nativeCheckbox, isChecked, name, valueProp]);
const onChangeProp = props.onChange;
const onChange = useEvent((event) => {
if (disabled) {
event.stopPropagation();
event.preventDefault();
return;
}
setMixed(event.currentTarget, mixed);
if (!nativeCheckbox) {
event.currentTarget.checked = !event.currentTarget.checked;
schedulePropertyUpdate();
}
onChangeProp == null ? void 0 : onChangeProp(event);
if (event.defaultPrevented) return;
const elementChecked = event.currentTarget.checked;
setChecked(elementChecked);
store == null ? void 0 : store.setValue((prevValue) => {
if (valueProp == null) return elementChecked;
const primitiveValue = getPrimitiveValue(valueProp);
if (!Array.isArray(prevValue)) {
return prevValue === primitiveValue ? false : primitiveValue;
}
if (elementChecked) {
if (prevValue.includes(primitiveValue)) {
return prevValue;
}
return [...prevValue, primitiveValue];
}
return prevValue.filter((v) => v !== primitiveValue);
});
});
const onClickProp = props.onClick;
const onClick = useEvent((event) => {
onClickProp == null ? void 0 : onClickProp(event);
if (event.defaultPrevented) return;
if (nativeCheckbox) return;
onChange(event);
});
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CheckboxCheckedContext.Provider, { value: isChecked, children: element }),
[isChecked]
);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
role: !nativeCheckbox ? "checkbox" : void 0,
type: nativeCheckbox ? "checkbox" : void 0,
"aria-checked": checked
}, props), {
ref: useMergeRefs(ref, props.ref),
onChange,
onClick
});
props = useCommand(_3YLGPPWQ_spreadValues({ clickOnEnter: !nativeCheckbox }, props));
return removeUndefinedValues(_3YLGPPWQ_spreadValues({
name: nativeCheckbox ? name : void 0,
value: nativeCheckbox ? valueProp : void 0,
checked: isChecked
}, props));
}
);
var Checkbox = forwardRef2(function Checkbox2(props) {
const htmlProps = useCheckbox(props);
return LMDWO4NN_createElement(ASMQKSDT_TagName, htmlProps);
});
;// ./node_modules/@ariakit/core/esm/checkbox/checkbox-store.js
"use client";
// src/checkbox/checkbox-store.ts
function createCheckboxStore(props = {}) {
var _a;
throwOnConflictingProps(props, props.store);
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
const initialState = {
value: defaultValue(
props.value,
syncState == null ? void 0 : syncState.value,
props.defaultValue,
false
)
};
const checkbox = createStore(initialState, props.store);
return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, checkbox), {
setValue: (value) => checkbox.setState("value", value)
});
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/HAVBGUA3.js
"use client";
// src/checkbox/checkbox-store.ts
function useCheckboxStoreProps(store, update, props) {
useUpdateEffect(update, [props.store]);
useStoreProps(store, props, "value", "setValue");
return store;
}
function useCheckboxStore(props = {}) {
const [store, update] = YV4JVR4I_useStore(createCheckboxStore, props);
return useCheckboxStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/react-core/esm/menu/menu-item-checkbox.js
"use client";
// src/menu/menu-item-checkbox.tsx
var menu_item_checkbox_TagName = "div";
function menu_item_checkbox_getPrimitiveValue(value) {
if (Array.isArray(value)) {
return value.toString();
}
return value;
}
function getValue(storeValue, value, checked) {
if (value === void 0) {
if (Array.isArray(storeValue)) return storeValue;
return !!checked;
}
const primitiveValue = menu_item_checkbox_getPrimitiveValue(value);
if (!Array.isArray(storeValue)) {
if (checked) {
return primitiveValue;
}
return storeValue === primitiveValue ? false : storeValue;
}
if (checked) {
if (storeValue.includes(primitiveValue)) {
return storeValue;
}
return [...storeValue, primitiveValue];
}
return storeValue.filter((v) => v !== primitiveValue);
}
var useMenuItemCheckbox = createHook(
function useMenuItemCheckbox2(_a) {
var _b = _a, {
store,
name,
value,
checked,
defaultChecked: defaultCheckedProp,
hideOnClick = false
} = _b, props = __objRest(_b, [
"store",
"name",
"value",
"checked",
"defaultChecked",
"hideOnClick"
]);
const context = useMenuScopedContext();
store = store || context;
invariant(
store,
false && 0
);
const defaultChecked = useInitialValue(defaultCheckedProp);
(0,external_React_.useEffect)(() => {
store == null ? void 0 : store.setValue(name, (prevValue = []) => {
if (!defaultChecked) return prevValue;
return getValue(prevValue, value, true);
});
}, [store, name, value, defaultChecked]);
(0,external_React_.useEffect)(() => {
if (checked === void 0) return;
store == null ? void 0 : store.setValue(name, (prevValue) => {
return getValue(prevValue, value, checked);
});
}, [store, name, value, checked]);
const checkboxStore = useCheckboxStore({
value: store.useState((state) => state.values[name]),
setValue(internalValue) {
store == null ? void 0 : store.setValue(name, () => {
if (checked === void 0) return internalValue;
const nextValue = getValue(internalValue, value, checked);
if (!Array.isArray(nextValue)) return nextValue;
if (!Array.isArray(internalValue)) return nextValue;
if (shallowEqual(internalValue, nextValue)) return internalValue;
return nextValue;
});
}
});
props = _3YLGPPWQ_spreadValues({
role: "menuitemcheckbox"
}, props);
props = useCheckbox(_3YLGPPWQ_spreadValues({
store: checkboxStore,
name,
value,
checked
}, props));
props = useMenuItem(_3YLGPPWQ_spreadValues({ store, hideOnClick }, props));
return props;
}
);
var MenuItemCheckbox = memo2(
forwardRef2(function MenuItemCheckbox2(props) {
const htmlProps = useMenuItemCheckbox(props);
return LMDWO4NN_createElement(menu_item_checkbox_TagName, htmlProps);
})
);
;// ./node_modules/@ariakit/react-core/esm/menu/menu-item-radio.js
"use client";
// src/menu/menu-item-radio.tsx
var menu_item_radio_TagName = "div";
function menu_item_radio_getValue(prevValue, value, checked) {
if (checked === void 0) return prevValue;
if (checked) return value;
return prevValue;
}
var useMenuItemRadio = createHook(
function useMenuItemRadio2(_a) {
var _b = _a, {
store,
name,
value,
checked,
onChange: onChangeProp,
hideOnClick = false
} = _b, props = __objRest(_b, [
"store",
"name",
"value",
"checked",
"onChange",
"hideOnClick"
]);
const context = useMenuScopedContext();
store = store || context;
invariant(
store,
false && 0
);
const defaultChecked = useInitialValue(props.defaultChecked);
(0,external_React_.useEffect)(() => {
store == null ? void 0 : store.setValue(name, (prevValue = false) => {
return menu_item_radio_getValue(prevValue, value, defaultChecked);
});
}, [store, name, value, defaultChecked]);
(0,external_React_.useEffect)(() => {
if (checked === void 0) return;
store == null ? void 0 : store.setValue(name, (prevValue) => {
return menu_item_radio_getValue(prevValue, value, checked);
});
}, [store, name, value, checked]);
const isChecked = store.useState((state) => state.values[name] === value);
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuItemCheckedContext.Provider, { value: !!isChecked, children: element }),
[isChecked]
);
props = _3YLGPPWQ_spreadValues({
role: "menuitemradio"
}, props);
props = useRadio(_3YLGPPWQ_spreadValues({
name,
value,
checked: isChecked,
onChange(event) {
onChangeProp == null ? void 0 : onChangeProp(event);
if (event.defaultPrevented) return;
const element = event.currentTarget;
store == null ? void 0 : store.setValue(name, (prevValue) => {
return menu_item_radio_getValue(prevValue, value, checked != null ? checked : element.checked);
});
}
}, props));
props = useMenuItem(_3YLGPPWQ_spreadValues({ store, hideOnClick }, props));
return props;
}
);
var MenuItemRadio = memo2(
forwardRef2(function MenuItemRadio2(props) {
const htmlProps = useMenuItemRadio(props);
return LMDWO4NN_createElement(menu_item_radio_TagName, htmlProps);
})
);
;// ./node_modules/@ariakit/react-core/esm/menu/menu-group.js
"use client";
// src/menu/menu-group.tsx
var menu_group_TagName = "div";
var useMenuGroup = createHook(
function useMenuGroup2(props) {
props = useCompositeGroup(props);
return props;
}
);
var menu_group_MenuGroup = forwardRef2(function MenuGroup2(props) {
const htmlProps = useMenuGroup(props);
return LMDWO4NN_createElement(menu_group_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/menu/menu-group-label.js
"use client";
// src/menu/menu-group-label.tsx
var menu_group_label_TagName = "div";
var useMenuGroupLabel = createHook(
function useMenuGroupLabel2(props) {
props = useCompositeGroupLabel(props);
return props;
}
);
var MenuGroupLabel = forwardRef2(function MenuGroupLabel2(props) {
const htmlProps = useMenuGroupLabel(props);
return LMDWO4NN_createElement(menu_group_label_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/TP7N7UIH.js
"use client";
// src/composite/composite-separator.tsx
var TP7N7UIH_TagName = "hr";
var useCompositeSeparator = createHook(function useCompositeSeparator2(_a) {
var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
const context = useCompositeContext();
store = store || context;
invariant(
store,
false && 0
);
const orientation = store.useState(
(state) => state.orientation === "horizontal" ? "vertical" : "horizontal"
);
props = useSeparator(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { orientation }));
return props;
});
var CompositeSeparator = forwardRef2(function CompositeSeparator2(props) {
const htmlProps = useCompositeSeparator(props);
return LMDWO4NN_createElement(TP7N7UIH_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/menu/menu-separator.js
"use client";
// src/menu/menu-separator.tsx
var menu_separator_TagName = "hr";
var useMenuSeparator = createHook(
function useMenuSeparator2(_a) {
var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
const context = useMenuContext();
store = store || context;
props = useCompositeSeparator(_3YLGPPWQ_spreadValues({ store }, props));
return props;
}
);
var MenuSeparator = forwardRef2(function MenuSeparator2(props) {
const htmlProps = useMenuSeparator(props);
return LMDWO4NN_createElement(menu_separator_TagName, htmlProps);
});
;// ./node_modules/@wordpress/components/build-module/menu/styles.js
function menu_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const styles_ANIMATION_PARAMS = {
SCALE_AMOUNT_OUTER: 0.82,
SCALE_AMOUNT_CONTENT: 0.9,
DURATION: {
IN: "400ms",
OUT: "200ms"
},
EASING: "cubic-bezier(0.33, 0, 0, 1)"
};
const CONTENT_WRAPPER_PADDING = space(1);
const ITEM_PADDING_BLOCK = space(2);
const ITEM_PADDING_INLINE = space(3);
const DEFAULT_BORDER_COLOR = COLORS.theme.gray[300];
const DIVIDER_COLOR = COLORS.theme.gray[200];
const LIGHTER_TEXT_COLOR = COLORS.theme.gray[700];
const LIGHT_BACKGROUND_COLOR = COLORS.theme.gray[100];
const TOOLBAR_VARIANT_BORDER_COLOR = COLORS.theme.foreground;
const DEFAULT_BOX_SHADOW = `0 0 0 ${config_values_default.borderWidth} ${DEFAULT_BORDER_COLOR}, ${config_values_default.elevationMedium}`;
const TOOLBAR_VARIANT_BOX_SHADOW = `0 0 0 ${config_values_default.borderWidth} ${TOOLBAR_VARIANT_BORDER_COLOR}`;
const GRID_TEMPLATE_COLS = "minmax( 0, max-content ) 1fr";
const PopoverOuterWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e1wg7tti14"
} : 0)("position:relative;background-color:", COLORS.ui.background, ";border-radius:", config_values_default.radiusMedium, ";", (props) => /* @__PURE__ */ emotion_react_browser_esm_css("box-shadow:", props.variant === "toolbar" ? TOOLBAR_VARIANT_BOX_SHADOW : DEFAULT_BOX_SHADOW, ";" + ( true ? "" : 0), true ? "" : 0), " overflow:hidden;@media not ( prefers-reduced-motion ){transition-property:transform,opacity;transition-timing-function:", styles_ANIMATION_PARAMS.EASING, ";transition-duration:", styles_ANIMATION_PARAMS.DURATION.IN, ";will-change:transform,opacity;opacity:0;&:has( [data-enter] ){opacity:1;}&:has( [data-leave] ){transition-duration:", styles_ANIMATION_PARAMS.DURATION.OUT, ";}&:has( [data-side='bottom'] ),&:has( [data-side='top'] ){transform:scaleY( ", styles_ANIMATION_PARAMS.SCALE_AMOUNT_OUTER, " );}&:has( [data-side='bottom'] ){transform-origin:top;}&:has( [data-side='top'] ){transform-origin:bottom;}&:has( [data-enter][data-side='bottom'] ),&:has( [data-enter][data-side='top'] ),&:has( [data-leave][data-side='bottom'] ),&:has( [data-leave][data-side='top'] ){transform:scaleY( 1 );}}" + ( true ? "" : 0));
const PopoverInnerWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e1wg7tti13"
} : 0)("position:relative;z-index:1000000;display:grid;grid-template-columns:", GRID_TEMPLATE_COLS, ";grid-template-rows:auto;box-sizing:border-box;min-width:160px;max-width:320px;max-height:var( --popover-available-height );padding:", CONTENT_WRAPPER_PADDING, ";overscroll-behavior:contain;overflow:auto;outline:2px solid transparent!important;@media not ( prefers-reduced-motion ){transition:inherit;transform-origin:inherit;&[data-side='bottom'],&[data-side='top']{transform:scaleY(\n calc(\n 1 / ", styles_ANIMATION_PARAMS.SCALE_AMOUNT_OUTER, " *\n ", styles_ANIMATION_PARAMS.SCALE_AMOUNT_CONTENT, "\n )\n );}&[data-enter][data-side='bottom'],&[data-enter][data-side='top'],&[data-leave][data-side='bottom'],&[data-leave][data-side='top']{transform:scaleY( 1 );}}" + ( true ? "" : 0));
const baseItem = /* @__PURE__ */ emotion_react_browser_esm_css("all:unset;position:relative;min-height:", space(10), ";box-sizing:border-box;grid-column:1/-1;display:grid;grid-template-columns:", GRID_TEMPLATE_COLS, ";align-items:center;@supports ( grid-template-columns: subgrid ){grid-template-columns:subgrid;}font-size:", font("default.fontSize"), ";font-family:inherit;font-weight:normal;line-height:20px;color:", COLORS.theme.foreground, ";border-radius:", config_values_default.radiusSmall, ";padding-block:", ITEM_PADDING_BLOCK, ";padding-inline:", ITEM_PADDING_INLINE, ";scroll-margin:", CONTENT_WRAPPER_PADDING, ";user-select:none;outline:none;&[aria-disabled='true']{color:", COLORS.ui.textDisabled, ";cursor:not-allowed;}&[data-active-item]:not( [data-focus-visible] ):not(\n [aria-disabled='true']\n ){background-color:", COLORS.theme.accent, ";color:", COLORS.theme.accentInverted, ";}&[data-focus-visible]{box-shadow:0 0 0 1.5px ", COLORS.theme.accent, ";outline:2px solid transparent;}&:active,&[data-active]{}", PopoverInnerWrapper, ':not(:focus) &:not(:focus)[aria-expanded="true"]{background-color:', LIGHT_BACKGROUND_COLOR, ";color:", COLORS.theme.foreground, ";}svg{fill:currentColor;}" + ( true ? "" : 0), true ? "" : 0);
const styles_Item = /* @__PURE__ */ emotion_styled_base_browser_esm(MVIULMNR_MenuItem, true ? {
target: "e1wg7tti12"
} : 0)(baseItem, ";" + ( true ? "" : 0));
const CheckboxItem = /* @__PURE__ */ emotion_styled_base_browser_esm(MenuItemCheckbox, true ? {
target: "e1wg7tti11"
} : 0)(baseItem, ";" + ( true ? "" : 0));
const RadioItem = /* @__PURE__ */ emotion_styled_base_browser_esm(MenuItemRadio, true ? {
target: "e1wg7tti10"
} : 0)(baseItem, ";" + ( true ? "" : 0));
const ItemPrefixWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1wg7tti9"
} : 0)("grid-column:1;", CheckboxItem, ">&,", RadioItem, ">&{min-width:", space(6), ";}", CheckboxItem, ">&,", RadioItem, ">&,&:not( :empty ){margin-inline-end:", space(2), ";}display:flex;align-items:center;justify-content:center;color:", LIGHTER_TEXT_COLOR, ";[data-active-item]:not( [data-focus-visible] )>&,[aria-disabled='true']>&{color:inherit;}" + ( true ? "" : 0));
const ItemContentWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e1wg7tti8"
} : 0)("grid-column:2;display:flex;align-items:center;justify-content:space-between;gap:", space(3), ";pointer-events:none;" + ( true ? "" : 0));
const ItemChildrenWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e1wg7tti7"
} : 0)("flex:1;display:inline-flex;flex-direction:column;gap:", space(1), ";" + ( true ? "" : 0));
const ItemSuffixWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "e1wg7tti6"
} : 0)("flex:0 1 fit-content;min-width:0;width:fit-content;display:flex;align-items:center;justify-content:center;gap:", space(3), ";color:", LIGHTER_TEXT_COLOR, ";[data-active-item]:not( [data-focus-visible] ) *:not(", PopoverInnerWrapper, ") &,[aria-disabled='true'] *:not(", PopoverInnerWrapper, ") &{color:inherit;}" + ( true ? "" : 0));
const styles_Group = /* @__PURE__ */ emotion_styled_base_browser_esm(menu_group_MenuGroup, true ? {
target: "e1wg7tti5"
} : 0)( true ? {
name: "49aokf",
styles: "display:contents"
} : 0);
const styles_GroupLabel = /* @__PURE__ */ emotion_styled_base_browser_esm(MenuGroupLabel, true ? {
target: "e1wg7tti4"
} : 0)("grid-column:1/-1;padding-block-start:", space(3), ";padding-block-end:", space(2), ";padding-inline:", ITEM_PADDING_INLINE, ";" + ( true ? "" : 0));
const styles_Separator = /* @__PURE__ */ emotion_styled_base_browser_esm(MenuSeparator, true ? {
target: "e1wg7tti3"
} : 0)("grid-column:1/-1;border:none;height:", config_values_default.borderWidth, ";background-color:", (props) => props.variant === "toolbar" ? TOOLBAR_VARIANT_BORDER_COLOR : DIVIDER_COLOR, ";margin-block:", space(2), ";margin-inline:", ITEM_PADDING_INLINE, ";outline:2px solid transparent;" + ( true ? "" : 0));
const SubmenuChevronIcon = /* @__PURE__ */ emotion_styled_base_browser_esm(icon_icon_default, true ? {
target: "e1wg7tti2"
} : 0)("width:", space(1.5), ";", rtl({
transform: `scaleX(1)`
}, {
transform: `scaleX(-1)`
}), ";" + ( true ? "" : 0));
const ItemLabel = /* @__PURE__ */ emotion_styled_base_browser_esm(truncate_component_component_default, true ? {
target: "e1wg7tti1"
} : 0)("font-size:", font("default.fontSize"), ";line-height:20px;color:inherit;" + ( true ? "" : 0));
const ItemHelpText = /* @__PURE__ */ emotion_styled_base_browser_esm(truncate_component_component_default, true ? {
target: "e1wg7tti0"
} : 0)("font-size:", font("helpText.fontSize"), ";line-height:16px;color:", LIGHTER_TEXT_COLOR, ";overflow-wrap:anywhere;[data-active-item]:not( [data-focus-visible] ) *:not( ", PopoverInnerWrapper, " ) &,[aria-disabled='true'] *:not( ", PopoverInnerWrapper, " ) &{color:inherit;}" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/menu/item.js
const item_Item = (0,external_wp_element_namespaceObject.forwardRef)(function Item2({
prefix,
suffix,
children,
disabled = false,
hideOnClick = true,
store,
...props
}, ref) {
const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
if (!menuContext?.store) {
throw new Error("Menu.Item can only be rendered inside a Menu component");
}
const computedStore = store !== null && store !== void 0 ? store : menuContext.store;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_Item, {
ref,
...props,
accessibleWhenDisabled: true,
disabled,
hideOnClick,
store: computedStore,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemPrefixWrapper, {
children: prefix
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ItemContentWrapper, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemChildrenWrapper, {
children
}), suffix && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemSuffixWrapper, {
children: suffix
})]
})]
});
});
;// ./node_modules/@ariakit/react-core/esm/menu/menu-item-check.js
"use client";
// src/menu/menu-item-check.tsx
var menu_item_check_TagName = "span";
var useMenuItemCheck = createHook(
function useMenuItemCheck2(_a) {
var _b = _a, { store, checked } = _b, props = __objRest(_b, ["store", "checked"]);
const context = (0,external_React_.useContext)(MenuItemCheckedContext);
checked = checked != null ? checked : context;
props = useCheckboxCheck(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { checked }));
return props;
}
);
var MenuItemCheck = forwardRef2(function MenuItemCheck2(props) {
const htmlProps = useMenuItemCheck(props);
return LMDWO4NN_createElement(menu_item_check_TagName, htmlProps);
});
;// ./node_modules/@wordpress/components/build-module/menu/checkbox-item.js
const checkbox_item_CheckboxItem = (0,external_wp_element_namespaceObject.forwardRef)(function CheckboxItem2({
suffix,
children,
disabled = false,
hideOnClick = false,
...props
}, ref) {
const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
if (!menuContext?.store) {
throw new Error("Menu.CheckboxItem can only be rendered inside a Menu component");
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(CheckboxItem, {
ref,
...props,
accessibleWhenDisabled: true,
disabled,
hideOnClick,
store: menuContext.store,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuItemCheck, {
store: menuContext.store,
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemPrefixWrapper, {}),
style: {
width: "auto",
height: "auto"
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
icon: check_default,
size: 24
})
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ItemContentWrapper, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemChildrenWrapper, {
children
}), suffix && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemSuffixWrapper, {
children: suffix
})]
})]
});
});
;// ./node_modules/@wordpress/components/build-module/menu/radio-item.js
const radioCheck = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Circle, {
cx: 12,
cy: 12,
r: 3
})
});
const radio_item_RadioItem = (0,external_wp_element_namespaceObject.forwardRef)(function RadioItem2({
suffix,
children,
disabled = false,
hideOnClick = false,
...props
}, ref) {
const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
if (!menuContext?.store) {
throw new Error("Menu.RadioItem can only be rendered inside a Menu component");
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(RadioItem, {
ref,
...props,
accessibleWhenDisabled: true,
disabled,
hideOnClick,
store: menuContext.store,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuItemCheck, {
store: menuContext.store,
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemPrefixWrapper, {}),
style: {
width: "auto",
height: "auto"
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
icon: radioCheck,
size: 24
})
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ItemContentWrapper, {
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemChildrenWrapper, {
children
}), suffix && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemSuffixWrapper, {
children: suffix
})]
})]
});
});
;// ./node_modules/@wordpress/components/build-module/menu/group.js
const group_Group = (0,external_wp_element_namespaceObject.forwardRef)(function Group2(props, ref) {
const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
if (!menuContext?.store) {
throw new Error("Menu.Group can only be rendered inside a Menu component");
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_Group, {
ref,
...props,
store: menuContext.store
});
});
;// ./node_modules/@wordpress/components/build-module/menu/group-label.js
const group_label_GroupLabel = (0,external_wp_element_namespaceObject.forwardRef)(function Group(props, ref) {
const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
if (!menuContext?.store) {
throw new Error("Menu.GroupLabel can only be rendered inside a Menu component");
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_GroupLabel, {
ref,
render: (
// @ts-expect-error The `children` prop is passed
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(text_component_component_default, {
upperCase: true,
variant: "muted",
size: "11px",
weight: 500,
lineHeight: "16px"
})
),
...props,
store: menuContext.store
});
});
;// ./node_modules/@wordpress/components/build-module/menu/separator.js
const separator_Separator = (0,external_wp_element_namespaceObject.forwardRef)(function Separator2(props, ref) {
const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
if (!menuContext?.store) {
throw new Error("Menu.Separator can only be rendered inside a Menu component");
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_Separator, {
ref,
...props,
store: menuContext.store,
variant: menuContext.variant
});
});
;// ./node_modules/@wordpress/components/build-module/menu/item-label.js
const item_label_ItemLabel = (0,external_wp_element_namespaceObject.forwardRef)(function ItemLabel2(props, ref) {
const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
if (!menuContext?.store) {
throw new Error("Menu.ItemLabel can only be rendered inside a Menu component");
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemLabel, {
numberOfLines: 1,
ref,
...props
});
});
;// ./node_modules/@wordpress/components/build-module/menu/item-help-text.js
const item_help_text_ItemHelpText = (0,external_wp_element_namespaceObject.forwardRef)(function ItemHelpText2(props, ref) {
const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
if (!menuContext?.store) {
throw new Error("Menu.ItemHelpText can only be rendered inside a Menu component");
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemHelpText, {
numberOfLines: 2,
ref,
...props
});
});
;// ./node_modules/@ariakit/react-core/esm/menu/menu-button.js
"use client";
// src/menu/menu-button.tsx
var menu_button_TagName = "button";
function getInitialFocus(event, dir) {
const keyMap = {
ArrowDown: dir === "bottom" || dir === "top" ? "first" : false,
ArrowUp: dir === "bottom" || dir === "top" ? "last" : false,
ArrowRight: dir === "right" ? "first" : false,
ArrowLeft: dir === "left" ? "first" : false
};
return keyMap[event.key];
}
function hasActiveItem(items, excludeElement) {
return !!(items == null ? void 0 : items.some((item) => {
if (!item.element) return false;
if (item.element === excludeElement) return false;
return item.element.getAttribute("aria-expanded") === "true";
}));
}
var useMenuButton = createHook(
function useMenuButton2(_a) {
var _b = _a, {
store,
focusable,
accessibleWhenDisabled,
showOnHover
} = _b, props = __objRest(_b, [
"store",
"focusable",
"accessibleWhenDisabled",
"showOnHover"
]);
const context = useMenuProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const ref = (0,external_React_.useRef)(null);
const parentMenu = store.parent;
const parentMenubar = store.menubar;
const hasParentMenu = !!parentMenu;
const parentIsMenubar = !!parentMenubar && !hasParentMenu;
const disabled = disabledFromProps(props);
const showMenu = () => {
const trigger = ref.current;
if (!trigger) return;
store == null ? void 0 : store.setDisclosureElement(trigger);
store == null ? void 0 : store.setAnchorElement(trigger);
store == null ? void 0 : store.show();
};
const onFocusProp = props.onFocus;
const onFocus = useEvent((event) => {
onFocusProp == null ? void 0 : onFocusProp(event);
if (disabled) return;
if (event.defaultPrevented) return;
store == null ? void 0 : store.setAutoFocusOnShow(false);
store == null ? void 0 : store.setActiveId(null);
if (!parentMenubar) return;
if (!parentIsMenubar) return;
const { items } = parentMenubar.getState();
if (hasActiveItem(items, event.currentTarget)) {
showMenu();
}
});
const dir = useStoreState(
store,
(state) => state.placement.split("-")[0]
);
const onKeyDownProp = props.onKeyDown;
const onKeyDown = useEvent((event) => {
onKeyDownProp == null ? void 0 : onKeyDownProp(event);
if (disabled) return;
if (event.defaultPrevented) return;
const initialFocus = getInitialFocus(event, dir);
if (initialFocus) {
event.preventDefault();
showMenu();
store == null ? void 0 : store.setAutoFocusOnShow(true);
store == null ? void 0 : store.setInitialFocus(initialFocus);
}
});
const onClickProp = props.onClick;
const onClick = useEvent((event) => {
onClickProp == null ? void 0 : onClickProp(event);
if (event.defaultPrevented) return;
if (!store) return;
const isKeyboardClick = !event.detail;
const { open } = store.getState();
if (!open || isKeyboardClick) {
if (!hasParentMenu || isKeyboardClick) {
store.setAutoFocusOnShow(true);
}
store.setInitialFocus(isKeyboardClick ? "first" : "container");
}
if (hasParentMenu) {
showMenu();
}
});
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuContextProvider, { value: store, children: element }),
[store]
);
if (hasParentMenu) {
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Role.div, { render: props.render })
});
}
const id = useId(props.id);
const parentContentElement = useStoreState(
(parentMenu == null ? void 0 : parentMenu.combobox) || parentMenu,
"contentElement"
);
const role = hasParentMenu || parentIsMenubar ? getPopupItemRole(parentContentElement, "menuitem") : void 0;
const contentElement = store.useState("contentElement");
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
id,
role,
"aria-haspopup": getPopupRole(contentElement, "menu")
}, props), {
ref: useMergeRefs(ref, props.ref),
onFocus,
onKeyDown,
onClick
});
props = useHovercardAnchor(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
store,
focusable,
accessibleWhenDisabled
}, props), {
showOnHover: (event) => {
const getShowOnHover = () => {
if (typeof showOnHover === "function") return showOnHover(event);
if (showOnHover != null) return showOnHover;
if (hasParentMenu) return true;
if (!parentMenubar) return false;
const { items } = parentMenubar.getState();
return parentIsMenubar && hasActiveItem(items);
};
const canShowOnHover = getShowOnHover();
if (!canShowOnHover) return false;
const parent = parentIsMenubar ? parentMenubar : parentMenu;
if (!parent) return true;
parent.setActiveId(event.currentTarget.id);
return true;
}
}));
props = usePopoverDisclosure(_3YLGPPWQ_spreadValues({
store,
toggleOnClick: !hasParentMenu,
focusable,
accessibleWhenDisabled
}, props));
props = useCompositeTypeahead(_3YLGPPWQ_spreadValues({
store,
typeahead: parentIsMenubar
}, props));
return props;
}
);
var MenuButton = forwardRef2(function MenuButton2(props) {
const htmlProps = useMenuButton(props);
return LMDWO4NN_createElement(menu_button_TagName, htmlProps);
});
;// ./node_modules/@wordpress/components/build-module/menu/trigger-button.js
const TriggerButton = (0,external_wp_element_namespaceObject.forwardRef)(function TriggerButton2({
children,
disabled = false,
...props
}, ref) {
const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
if (!menuContext?.store) {
throw new Error("Menu.TriggerButton can only be rendered inside a Menu component");
}
if (menuContext.store.parent) {
throw new Error("Menu.TriggerButton should not be rendered inside a nested Menu component. Use Menu.SubmenuTriggerItem instead.");
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuButton, {
ref,
...props,
disabled,
store: menuContext.store,
children
});
});
;// ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js
var chevron_right_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" }) });
;// ./node_modules/@wordpress/components/build-module/menu/submenu-trigger-item.js
const SubmenuTriggerItem = (0,external_wp_element_namespaceObject.forwardRef)(function SubmenuTriggerItem2({
suffix,
...otherProps
}, ref) {
const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
if (!menuContext?.store.parent) {
throw new Error("Menu.SubmenuTriggerItem can only be rendered inside a nested Menu component");
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuButton, {
ref,
accessibleWhenDisabled: true,
store: menuContext.store,
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(item_Item, {
...otherProps,
// The menu item needs to register and be part of the parent menu.
// Without specifying the store explicitly, the `Item` component
// would otherwise read the store via context and pick up the one from
// the sub-menu `Menu` component.
store: menuContext.store.parent,
suffix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [suffix, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SubmenuChevronIcon, {
"aria-hidden": "true",
icon: chevron_right_small_default,
size: 24,
preserveAspectRatio: "xMidYMid slice"
})]
})
})
});
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/ASGALOAX.js
"use client";
// src/menu/menu-list.tsx
var ASGALOAX_TagName = "div";
function useAriaLabelledBy(_a) {
var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
const [id, setId] = (0,external_React_.useState)(void 0);
const label = props["aria-label"];
const disclosureElement = useStoreState(store, "disclosureElement");
const contentElement = useStoreState(store, "contentElement");
(0,external_React_.useEffect)(() => {
const disclosure = disclosureElement;
if (!disclosure) return;
const menu = contentElement;
if (!menu) return;
const menuLabel = label || menu.hasAttribute("aria-label");
if (menuLabel) {
setId(void 0);
} else if (disclosure.id) {
setId(disclosure.id);
}
}, [label, disclosureElement, contentElement]);
return id;
}
var useMenuList = createHook(
function useMenuList2(_a) {
var _b = _a, { store, alwaysVisible, composite } = _b, props = __objRest(_b, ["store", "alwaysVisible", "composite"]);
const context = useMenuProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const parentMenu = store.parent;
const parentMenubar = store.menubar;
const hasParentMenu = !!parentMenu;
const id = useId(props.id);
const onKeyDownProp = props.onKeyDown;
const dir = store.useState(
(state) => state.placement.split("-")[0]
);
const orientation = store.useState(
(state) => state.orientation === "both" ? void 0 : state.orientation
);
const isHorizontal = orientation !== "vertical";
const isMenubarHorizontal = useStoreState(
parentMenubar,
(state) => !!state && state.orientation !== "vertical"
);
const onKeyDown = useEvent((event) => {
onKeyDownProp == null ? void 0 : onKeyDownProp(event);
if (event.defaultPrevented) return;
if (hasParentMenu || parentMenubar && !isHorizontal) {
const hideMap = {
ArrowRight: () => dir === "left" && !isHorizontal,
ArrowLeft: () => dir === "right" && !isHorizontal,
ArrowUp: () => dir === "bottom" && isHorizontal,
ArrowDown: () => dir === "top" && isHorizontal
};
const action = hideMap[event.key];
if (action == null ? void 0 : action()) {
event.stopPropagation();
event.preventDefault();
return store == null ? void 0 : store.hide();
}
}
if (parentMenubar) {
const keyMap = {
ArrowRight: () => {
if (!isMenubarHorizontal) return;
return parentMenubar.next();
},
ArrowLeft: () => {
if (!isMenubarHorizontal) return;
return parentMenubar.previous();
},
ArrowDown: () => {
if (isMenubarHorizontal) return;
return parentMenubar.next();
},
ArrowUp: () => {
if (isMenubarHorizontal) return;
return parentMenubar.previous();
}
};
const action = keyMap[event.key];
const id2 = action == null ? void 0 : action();
if (id2 !== void 0) {
event.stopPropagation();
event.preventDefault();
parentMenubar.move(id2);
}
}
});
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuScopedContextProvider, { value: store, children: element }),
[store]
);
const ariaLabelledBy = useAriaLabelledBy(_3YLGPPWQ_spreadValues({ store }, props));
const mounted = store.useState("mounted");
const hidden = isHidden(mounted, props.hidden, alwaysVisible);
const style = hidden ? _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props.style), { display: "none" }) : props.style;
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
id,
"aria-labelledby": ariaLabelledBy,
hidden
}, props), {
ref: useMergeRefs(id ? store.setContentElement : null, props.ref),
style,
onKeyDown
});
const hasCombobox = !!store.combobox;
composite = composite != null ? composite : !hasCombobox;
if (composite) {
props = _3YLGPPWQ_spreadValues({
role: "menu",
"aria-orientation": orientation
}, props);
}
props = useComposite(_3YLGPPWQ_spreadValues({ store, composite }, props));
props = useCompositeTypeahead(_3YLGPPWQ_spreadValues({ store, typeahead: !hasCombobox }, props));
return props;
}
);
var MenuList = forwardRef2(function MenuList2(props) {
const htmlProps = useMenuList(props);
return LMDWO4NN_createElement(ASGALOAX_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/menu/menu.js
"use client";
// src/menu/menu.tsx
var menu_TagName = "div";
var useMenu = createHook(function useMenu2(_a) {
var _b = _a, {
store,
modal: modalProp = false,
portal = !!modalProp,
hideOnEscape = true,
autoFocusOnShow = true,
hideOnHoverOutside,
alwaysVisible
} = _b, props = __objRest(_b, [
"store",
"modal",
"portal",
"hideOnEscape",
"autoFocusOnShow",
"hideOnHoverOutside",
"alwaysVisible"
]);
const context = useMenuProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const ref = (0,external_React_.useRef)(null);
const parentMenu = store.parent;
const parentMenubar = store.menubar;
const hasParentMenu = !!parentMenu;
const parentIsMenubar = !!parentMenubar && !hasParentMenu;
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
ref: useMergeRefs(ref, props.ref)
});
const _a2 = useMenuList(_3YLGPPWQ_spreadValues({
store,
alwaysVisible
}, props)), { "aria-labelledby": ariaLabelledBy } = _a2, menuListProps = __objRest(_a2, ["aria-labelledby"]);
props = menuListProps;
const [initialFocusRef, setInitialFocusRef] = (0,external_React_.useState)();
const autoFocusOnShowState = store.useState("autoFocusOnShow");
const initialFocus = store.useState("initialFocus");
const baseElement = store.useState("baseElement");
const items = store.useState("renderedItems");
(0,external_React_.useEffect)(() => {
let cleaning = false;
setInitialFocusRef((prevInitialFocusRef) => {
var _a3, _b2, _c;
if (cleaning) return;
if (!autoFocusOnShowState) return;
if ((_a3 = prevInitialFocusRef == null ? void 0 : prevInitialFocusRef.current) == null ? void 0 : _a3.isConnected) return prevInitialFocusRef;
const ref2 = (0,external_React_.createRef)();
switch (initialFocus) {
case "first":
ref2.current = ((_b2 = items.find((item) => !item.disabled && item.element)) == null ? void 0 : _b2.element) || null;
break;
case "last":
ref2.current = ((_c = [...items].reverse().find((item) => !item.disabled && item.element)) == null ? void 0 : _c.element) || null;
break;
default:
ref2.current = baseElement;
}
return ref2;
});
return () => {
cleaning = true;
};
}, [store, autoFocusOnShowState, initialFocus, items, baseElement]);
const modal = hasParentMenu ? false : modalProp;
const mayAutoFocusOnShow = !!autoFocusOnShow;
const canAutoFocusOnShow = !!initialFocusRef || !!props.initialFocus || !!modal;
const contentElement = useStoreState(
store.combobox || store,
"contentElement"
);
const parentContentElement = useStoreState(
(parentMenu == null ? void 0 : parentMenu.combobox) || parentMenu,
"contentElement"
);
const preserveTabOrderAnchor = (0,external_React_.useMemo)(() => {
if (!parentContentElement) return;
if (!contentElement) return;
const role = contentElement.getAttribute("role");
const parentRole = parentContentElement.getAttribute("role");
const parentIsMenuOrMenubar = parentRole === "menu" || parentRole === "menubar";
if (parentIsMenuOrMenubar && role === "menu") return;
return parentContentElement;
}, [contentElement, parentContentElement]);
if (preserveTabOrderAnchor !== void 0) {
props = _3YLGPPWQ_spreadValues({
preserveTabOrderAnchor
}, props);
}
props = useHovercard(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
store,
alwaysVisible,
initialFocus: initialFocusRef,
autoFocusOnShow: mayAutoFocusOnShow ? canAutoFocusOnShow && autoFocusOnShow : autoFocusOnShowState || !!modal
}, props), {
hideOnEscape(event) {
if (isFalsyBooleanCallback(hideOnEscape, event)) return false;
store == null ? void 0 : store.hideAll();
return true;
},
hideOnHoverOutside(event) {
const disclosureElement = store == null ? void 0 : store.getState().disclosureElement;
const getHideOnHoverOutside = () => {
if (typeof hideOnHoverOutside === "function") {
return hideOnHoverOutside(event);
}
if (hideOnHoverOutside != null) return hideOnHoverOutside;
if (hasParentMenu) return true;
if (!parentIsMenubar) return false;
if (!disclosureElement) return true;
if (hasFocusWithin(disclosureElement)) return false;
return true;
};
if (!getHideOnHoverOutside()) return false;
if (event.defaultPrevented) return true;
if (!hasParentMenu) return true;
if (!disclosureElement) return true;
fireEvent(disclosureElement, "mouseout", event);
if (!hasFocusWithin(disclosureElement)) return true;
requestAnimationFrame(() => {
if (hasFocusWithin(disclosureElement)) return;
store == null ? void 0 : store.hide();
});
return false;
},
modal,
portal,
backdrop: hasParentMenu ? false : props.backdrop
}));
props = _3YLGPPWQ_spreadValues({
"aria-labelledby": ariaLabelledBy
}, props);
return props;
});
var Menu = createDialogComponent(
forwardRef2(function Menu2(props) {
const htmlProps = useMenu(props);
return LMDWO4NN_createElement(menu_TagName, htmlProps);
}),
useMenuProviderContext
);
;// ./node_modules/@wordpress/components/build-module/menu/popover.js
const menu_popover_Popover = (0,external_wp_element_namespaceObject.forwardRef)(function Popover2({
gutter,
children,
shift,
modal = true,
...otherProps
}, ref) {
const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
const appliedPlacementSide = useStoreState(menuContext?.store, "currentPlacement")?.split("-")[0];
const hideOnEscape = (0,external_wp_element_namespaceObject.useCallback)((event) => {
event.preventDefault();
return true;
}, []);
const computedDirection = useStoreState(menuContext?.store, "rtl") ? "rtl" : "ltr";
const wrapperProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
dir: computedDirection,
style: {
direction: computedDirection
}
}), [computedDirection]);
if (!menuContext?.store) {
throw new Error("Menu.Popover can only be rendered inside a Menu component");
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu, {
...otherProps,
ref,
modal,
store: menuContext.store,
gutter: gutter !== null && gutter !== void 0 ? gutter : menuContext.store.parent ? 0 : 8,
shift: shift !== null && shift !== void 0 ? shift : menuContext.store.parent ? -4 : 0,
hideOnHoverOutside: false,
"data-side": appliedPlacementSide,
wrapperProps,
hideOnEscape,
unmountOnHide: true,
render: (renderProps) => (
// Two wrappers are needed for the entry animation, where the menu
// container scales with a different factor than its contents.
// The {...renderProps} are passed to the inner wrapper, so that the
// menu element is the direct parent of the menu item elements.
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PopoverOuterWrapper, {
variant: menuContext.variant,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PopoverInnerWrapper, {
...renderProps
})
})
),
children
});
});
;// ./node_modules/@wordpress/components/build-module/menu/index.js
const UnconnectedMenu = (props) => {
const {
children,
defaultOpen = false,
open,
onOpenChange,
placement,
// From internal components context
variant
} = useContextSystem(props, "Menu");
const parentContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
const rtl = (0,external_wp_i18n_namespaceObject.isRTL)();
let computedPlacement = placement !== null && placement !== void 0 ? placement : parentContext?.store ? "right-start" : "bottom-start";
if (rtl) {
if (/right/.test(computedPlacement)) {
computedPlacement = computedPlacement.replace("right", "left");
} else if (/left/.test(computedPlacement)) {
computedPlacement = computedPlacement.replace("left", "right");
}
}
const menuStore = useMenuStore({
parent: parentContext?.store,
open,
defaultOpen,
placement: computedPlacement,
focusLoop: true,
setOpen(willBeOpen) {
onOpenChange?.(willBeOpen);
},
rtl
});
const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
store: menuStore,
variant
}), [menuStore, variant]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(context_Context.Provider, {
value: contextValue,
children
});
};
const menu_Menu = Object.assign(contextConnectWithoutRef(UnconnectedMenu, "Menu"), {
Context: Object.assign(context_Context, {
displayName: "Menu.Context"
}),
/**
* Renders a menu item inside the `Menu.Popover` or `Menu.Group` components.
*
* It can optionally contain one instance of the `Menu.ItemLabel` component
* and one instance of the `Menu.ItemHelpText` component.
*/
Item: Object.assign(item_Item, {
displayName: "Menu.Item"
}),
/**
* Renders a radio menu item inside the `Menu.Popover` or `Menu.Group`
* components.
*
* It can optionally contain one instance of the `Menu.ItemLabel` component
* and one instance of the `Menu.ItemHelpText` component.
*/
RadioItem: Object.assign(radio_item_RadioItem, {
displayName: "Menu.RadioItem"
}),
/**
* Renders a checkbox menu item inside the `Menu.Popover` or `Menu.Group`
* components.
*
* It can optionally contain one instance of the `Menu.ItemLabel` component
* and one instance of the `Menu.ItemHelpText` component.
*/
CheckboxItem: Object.assign(checkbox_item_CheckboxItem, {
displayName: "Menu.CheckboxItem"
}),
/**
* Renders a group for menu items.
*
* It should contain one instance of `Menu.GroupLabel` and one or more
* instances of `Menu.Item`, `Menu.RadioItem`, or `Menu.CheckboxItem`.
*/
Group: Object.assign(group_Group, {
displayName: "Menu.Group"
}),
/**
* Renders a label in a menu group.
*
* This component should be wrapped with `Menu.Group` so the
* `aria-labelledby` is correctly set on the group element.
*/
GroupLabel: Object.assign(group_label_GroupLabel, {
displayName: "Menu.GroupLabel"
}),
/**
* Renders a divider between menu items or menu groups.
*/
Separator: Object.assign(separator_Separator, {
displayName: "Menu.Separator"
}),
/**
* Renders a menu item's label text. It should be wrapped with `Menu.Item`,
* `Menu.RadioItem`, or `Menu.CheckboxItem`.
*/
ItemLabel: Object.assign(item_label_ItemLabel, {
displayName: "Menu.ItemLabel"
}),
/**
* Renders a menu item's help text. It should be wrapped with `Menu.Item`,
* `Menu.RadioItem`, or `Menu.CheckboxItem`.
*/
ItemHelpText: Object.assign(item_help_text_ItemHelpText, {
displayName: "Menu.ItemHelpText"
}),
/**
* Renders a dropdown menu element that's controlled by a sibling
* `Menu.TriggerButton` component. It renders a popover and automatically
* focuses on items when the menu is shown.
*
* The only valid children of `Menu.Popover` are `Menu.Item`,
* `Menu.RadioItem`, `Menu.CheckboxItem`, `Menu.Group`, `Menu.Separator`,
* and `Menu` (for nested dropdown menus).
*/
Popover: Object.assign(menu_popover_Popover, {
displayName: "Menu.Popover"
}),
/**
* Renders a menu button that toggles the visibility of a sibling
* `Menu.Popover` component when clicked or when using arrow keys.
*/
TriggerButton: Object.assign(TriggerButton, {
displayName: "Menu.TriggerButton"
}),
/**
* Renders a menu item that toggles the visibility of a sibling
* `Menu.Popover` component when clicked or when using arrow keys.
*
* This component is used to create a nested dropdown menu.
*/
SubmenuTriggerItem: Object.assign(SubmenuTriggerItem, {
displayName: "Menu.SubmenuTriggerItem"
})
});
var build_module_menu_menu_default = (/* unused pure expression or super */ null && (menu_Menu));
;// ./node_modules/@wordpress/components/build-module/theme/styles.js
function theme_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const colorVariables = ({
colors
}) => {
const shades = Object.entries(colors.gray || {}).map(([k, v]) => `--wp-components-color-gray-${k}: ${v};`).join("");
return [/* @__PURE__ */ emotion_react_browser_esm_css("--wp-components-color-accent:", colors.accent, ";--wp-components-color-accent-darker-10:", colors.accentDarker10, ";--wp-components-color-accent-darker-20:", colors.accentDarker20, ";--wp-components-color-accent-inverted:", colors.accentInverted, ";--wp-components-color-background:", colors.background, ";--wp-components-color-foreground:", colors.foreground, ";--wp-components-color-foreground-inverted:", colors.foregroundInverted, ";", shades, ";" + ( true ? "" : 0), true ? "" : 0)];
};
const theme_styles_Wrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
target: "e1krjpvb0"
} : 0)( true ? {
name: "1a3idx0",
styles: "color:var( --wp-components-color-foreground, currentColor )"
} : 0);
;// ./node_modules/@wordpress/components/build-module/theme/color-algorithms.js
k([names, a11y]);
function generateThemeVariables(inputs) {
validateInputs(inputs);
const generatedColors = {
...generateAccentDependentColors(inputs.accent),
...generateBackgroundDependentColors(inputs.background)
};
warnContrastIssues(checkContrasts(inputs, generatedColors));
return {
colors: generatedColors
};
}
function validateInputs(inputs) {
for (const [key, value] of Object.entries(inputs)) {
if (typeof value !== "undefined" && !w(value).isValid()) {
true ? external_wp_warning_default()(`wp.components.Theme: "${value}" is not a valid color value for the '${key}' prop.`) : 0;
}
}
}
function checkContrasts(inputs, outputs) {
const background = inputs.background || COLORS.white;
const accent = inputs.accent || "#3858e9";
const foreground = outputs.foreground || COLORS.gray[900];
const gray = outputs.gray || COLORS.gray;
return {
accent: w(background).isReadable(accent) ? void 0 : `The background color ("${background}") does not have sufficient contrast against the accent color ("${accent}").`,
foreground: w(background).isReadable(foreground) ? void 0 : `The background color provided ("${background}") does not have sufficient contrast against the standard foreground colors.`,
grays: w(background).contrast(gray[600]) >= 3 && w(background).contrast(gray[700]) >= 4.5 ? void 0 : `The background color provided ("${background}") cannot generate a set of grayscale foreground colors with sufficient contrast. Try adjusting the color to be lighter or darker.`
};
}
function warnContrastIssues(issues) {
for (const error of Object.values(issues)) {
if (error) {
true ? external_wp_warning_default()("wp.components.Theme: " + error) : 0;
}
}
}
function generateAccentDependentColors(accent) {
if (!accent) {
return {};
}
return {
accent,
accentDarker10: w(accent).darken(0.1).toHex(),
accentDarker20: w(accent).darken(0.2).toHex(),
accentInverted: getForegroundForColor(accent)
};
}
function generateBackgroundDependentColors(background) {
if (!background) {
return {};
}
const foreground = getForegroundForColor(background);
return {
background,
foreground,
foregroundInverted: getForegroundForColor(foreground),
gray: generateShades(background, foreground)
};
}
function getForegroundForColor(color) {
return w(color).isDark() ? COLORS.white : COLORS.gray[900];
}
function generateShades(background, foreground) {
const SHADES = {
100: 0.06,
200: 0.121,
300: 0.132,
400: 0.2,
600: 0.42,
700: 0.543,
800: 0.821
};
const limit = 0.884;
const direction = w(background).isDark() ? "lighten" : "darken";
const range = Math.abs(w(background).toHsl().l - w(foreground).toHsl().l) / 100;
const result = {};
Object.entries(SHADES).forEach(([key, value]) => {
result[parseInt(key)] = w(background)[direction](value / limit * range).toHex();
});
return result;
}
;// ./node_modules/@wordpress/components/build-module/theme/index.js
function Theme({
accent,
background,
className,
...props
}) {
const cx = useCx();
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(...colorVariables(generateThemeVariables({
accent,
background
})), className), [accent, background, className, cx]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(theme_styles_Wrapper, {
className: classes,
...props
});
}
var theme_default = Theme;
;// ./node_modules/@wordpress/components/build-module/tabs/context.js
const TabsContext = (0,external_wp_element_namespaceObject.createContext)(void 0);
TabsContext.displayName = "TabsContext";
const useTabsContext = () => (0,external_wp_element_namespaceObject.useContext)(TabsContext);
;// ./node_modules/@wordpress/components/build-module/tabs/styles.js
function tabs_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const StyledTabList = /* @__PURE__ */ emotion_styled_base_browser_esm(TabList, true ? {
target: "enfox0g4"
} : 0)("display:flex;align-items:stretch;overflow-x:auto;&[aria-orientation='vertical']{flex-direction:column;}:where( [aria-orientation='horizontal'] ){width:fit-content;}--direction-factor:1;--direction-start:left;--direction-end:right;--selected-start:var( --selected-left, 0 );&:dir( rtl ){--direction-factor:-1;--direction-start:right;--direction-end:left;--selected-start:var( --selected-right, 0 );}@media not ( prefers-reduced-motion ){&[data-indicator-animated]::before{transition-property:transform,border-radius,border-block;transition-duration:0.2s;transition-timing-function:ease-out;}}position:relative;&::before{content:'';position:absolute;pointer-events:none;transform-origin:var( --direction-start ) top;outline:2px solid transparent;outline-offset:-1px;}--antialiasing-factor:100;&[aria-orientation='horizontal']{--fade-width:4rem;--fade-gradient-base:transparent 0%,black var( --fade-width );--fade-gradient-composed:var( --fade-gradient-base ),black 60%,transparent 50%;&.is-overflowing-first{mask-image:linear-gradient(\n to var( --direction-end ),\n var( --fade-gradient-base )\n );}&.is-overflowing-last{mask-image:linear-gradient(\n to var( --direction-start ),\n var( --fade-gradient-base )\n );}&.is-overflowing-first.is-overflowing-last{mask-image:linear-gradient(\n to right,\n var( --fade-gradient-composed )\n ),linear-gradient( to left, var( --fade-gradient-composed ) );}&::before{bottom:0;height:0;width:calc( var( --antialiasing-factor ) * 1px );transform:translateX(\n calc(\n var( --selected-start ) * var( --direction-factor ) *\n 1px\n )\n ) scaleX(\n calc(\n var( --selected-width, 0 ) /\n var( --antialiasing-factor )\n )\n );border-bottom:var( --wp-admin-border-width-focus ) solid ", COLORS.theme.accent, ";}}&[aria-orientation='vertical']{&::before{border-radius:", config_values_default.radiusSmall, "/calc(\n ", config_values_default.radiusSmall, " /\n (\n var( --selected-height, 0 ) /\n var( --antialiasing-factor )\n )\n );top:0;left:0;width:100%;height:calc( var( --antialiasing-factor ) * 1px );transform:translateY( calc( var( --selected-top, 0 ) * 1px ) ) scaleY(\n calc(\n var( --selected-height, 0 ) /\n var( --antialiasing-factor )\n )\n );background-color:color-mix(\n in srgb,\n ", COLORS.theme.accent, ",\n transparent 96%\n );}&[data-select-on-move='true']:has(\n :is( :focus-visible, [data-focus-visible] )\n )::before{box-sizing:border-box;border:var( --wp-admin-border-width-focus ) solid ", COLORS.theme.accent, ";border-block-width:calc(\n var( --wp-admin-border-width-focus, 1px ) /\n (\n var( --selected-height, 0 ) /\n var( --antialiasing-factor )\n )\n );}}" + ( true ? "" : 0));
const styles_Tab = /* @__PURE__ */ emotion_styled_base_browser_esm(Tab, true ? {
target: "enfox0g3"
} : 0)("&{border-radius:0;background:transparent;border:none;box-shadow:none;flex:1 0 auto;white-space:nowrap;display:flex;align-items:center;cursor:pointer;line-height:1.2;font-weight:400;font-size:", font("default.fontSize"), ";color:", COLORS.theme.foreground, ";position:relative;&[aria-disabled='true']{cursor:default;color:", COLORS.ui.textDisabled, ";}&:not( [aria-disabled='true'] ):is( :hover, [data-focus-visible] ){color:", COLORS.theme.accent, ";}&:focus:not( :disabled ){box-shadow:none;outline:none;}&::after{position:absolute;pointer-events:none;outline:var( --wp-admin-border-width-focus ) solid ", COLORS.theme.accent, ";border-radius:", config_values_default.radiusSmall, ";opacity:0;@media not ( prefers-reduced-motion ){transition:opacity 0.1s linear;}}&[data-focus-visible]::after{opacity:1;}}[aria-orientation='horizontal'] &{padding-inline:", space(4), ";height:", space(12), ";scroll-margin:24px;&::after{content:'';inset:", space(3), ";}}[aria-orientation='vertical'] &{padding:", space(2), " ", space(3), ";min-height:", space(10), ";&[aria-selected='true']{color:", COLORS.theme.accent, ";fill:currentColor;}}[aria-orientation='vertical'][data-select-on-move='false'] &::after{content:'';inset:var( --wp-admin-border-width-focus );}" + ( true ? "" : 0));
const TabChildren = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
target: "enfox0g2"
} : 0)( true ? {
name: "9at4z3",
styles: "flex-grow:1;display:flex;align-items:center;[aria-orientation='horizontal'] &{justify-content:center;}[aria-orientation='vertical'] &{justify-content:start;}"
} : 0);
const TabChevron = /* @__PURE__ */ emotion_styled_base_browser_esm(icon_icon_default, true ? {
target: "enfox0g1"
} : 0)("flex-shrink:0;margin-inline-end:", space(-1), ";[aria-orientation='horizontal'] &{display:none;}opacity:0;[role='tab']:is( [aria-selected='true'], [data-focus-visible], :hover ) &{opacity:1;}@media not ( prefers-reduced-motion ){[data-select-on-move='true'] [role='tab']:is( [aria-selected='true'], ) &{transition:opacity 0.15s 0.15s linear;}}&:dir( rtl ){rotate:180deg;}" + ( true ? "" : 0));
const styles_TabPanel = /* @__PURE__ */ emotion_styled_base_browser_esm(TabPanel, true ? {
target: "enfox0g0"
} : 0)("&:focus{box-shadow:none;outline:none;}&[data-focus-visible]{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ", COLORS.theme.accent, ";outline:2px solid transparent;outline-offset:0;}" + ( true ? "" : 0));
;// ./node_modules/@wordpress/components/build-module/tabs/tab.js
const tab_Tab = (0,external_wp_element_namespaceObject.forwardRef)(function Tab2({
children,
tabId,
disabled,
render,
...otherProps
}, ref) {
var _useTabsContext;
const {
store,
instanceId
} = (_useTabsContext = useTabsContext()) !== null && _useTabsContext !== void 0 ? _useTabsContext : {};
if (!store) {
true ? external_wp_warning_default()("`Tabs.Tab` must be wrapped in a `Tabs` component.") : 0;
return null;
}
const instancedTabId = `${instanceId}-${tabId}`;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_Tab, {
ref,
store,
id: instancedTabId,
disabled,
render,
...otherProps,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TabChildren, {
children
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TabChevron, {
icon: chevron_right_default
})]
});
});
;// ./node_modules/@wordpress/components/build-module/tabs/use-track-overflow.js
function useTrackOverflow(parent, children) {
const [first, setFirst] = (0,external_wp_element_namespaceObject.useState)(false);
const [last, setLast] = (0,external_wp_element_namespaceObject.useState)(false);
const [observer, setObserver] = (0,external_wp_element_namespaceObject.useState)();
const callback = (0,external_wp_compose_namespaceObject.useEvent)((entries) => {
for (const entry of entries) {
if (entry.target === children.first) {
setFirst(!entry.isIntersecting);
}
if (entry.target === children.last) {
setLast(!entry.isIntersecting);
}
}
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!parent || !window.IntersectionObserver) {
return;
}
const newObserver = new IntersectionObserver(callback, {
root: parent,
threshold: 0.9
});
setObserver(newObserver);
return () => newObserver.disconnect();
}, [callback, parent]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!observer) {
return;
}
if (children.first) {
observer.observe(children.first);
}
if (children.last) {
observer.observe(children.last);
}
return () => {
if (children.first) {
observer.unobserve(children.first);
}
if (children.last) {
observer.unobserve(children.last);
}
};
}, [children.first, children.last, observer]);
return {
first,
last
};
}
;// ./node_modules/@wordpress/components/build-module/tabs/tablist.js
const DEFAULT_SCROLL_MARGIN = 24;
function useScrollRectIntoView(parent, rect, {
margin = DEFAULT_SCROLL_MARGIN
} = {}) {
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (!parent || !rect) {
return;
}
const {
scrollLeft: parentScroll
} = parent;
const parentWidth = parent.getBoundingClientRect().width;
const {
left: childLeft,
width: childWidth
} = rect;
const parentRightEdge = parentScroll + parentWidth;
const childRightEdge = childLeft + childWidth;
const rightOverflow = childRightEdge + margin - parentRightEdge;
const leftOverflow = parentScroll - (childLeft - margin);
let scrollLeft = null;
if (leftOverflow > 0) {
scrollLeft = parentScroll - leftOverflow;
} else if (rightOverflow > 0) {
scrollLeft = parentScroll + rightOverflow;
}
if (scrollLeft !== null) {
parent.scroll?.({
left: scrollLeft
});
}
}, [margin, parent, rect]);
}
const tablist_TabList = (0,external_wp_element_namespaceObject.forwardRef)(function TabList2({
children,
...otherProps
}, ref) {
var _useTabsContext;
const {
store
} = (_useTabsContext = useTabsContext()) !== null && _useTabsContext !== void 0 ? _useTabsContext : {};
const selectedId = useStoreState(store, "selectedId");
const activeId = useStoreState(store, "activeId");
const selectOnMove = useStoreState(store, "selectOnMove");
const items = useStoreState(store, "items");
const [parent, setParent] = (0,external_wp_element_namespaceObject.useState)();
const refs = (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, setParent]);
const selectedItem = store?.item(selectedId);
const renderedItems = useStoreState(store, "renderedItems");
const selectedItemIndex = renderedItems && selectedItem ? renderedItems.indexOf(selectedItem) : -1;
const selectedRect = useTrackElementOffsetRect(selectedItem?.element, [selectedItemIndex]);
const overflow = useTrackOverflow(parent, {
first: items?.at(0)?.element,
last: items?.at(-1)?.element
});
useAnimatedOffsetRect(parent, selectedRect, {
prefix: "selected",
dataAttribute: "indicator-animated",
transitionEndFilter: (event) => event.pseudoElement === "::before",
roundRect: true
});
useScrollRectIntoView(parent, selectedRect);
const onBlur = () => {
if (!selectOnMove) {
return;
}
if (selectedId !== activeId) {
store?.setActiveId(selectedId);
}
};
if (!store) {
true ? external_wp_warning_default()("`Tabs.TabList` must be wrapped in a `Tabs` component.") : 0;
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledTabList, {
ref: refs,
store,
render: (props) => {
var _props$tabIndex;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...props,
// Fallback to -1 to prevent browsers from making the tablist
// tabbable when it is a scrolling container.
tabIndex: (_props$tabIndex = props.tabIndex) !== null && _props$tabIndex !== void 0 ? _props$tabIndex : -1
});
},
onBlur,
"data-select-on-move": selectOnMove ? "true" : "false",
...otherProps,
className: dist_clsx(overflow.first && "is-overflowing-first", overflow.last && "is-overflowing-last", otherProps.className),
children
});
});
;// ./node_modules/@wordpress/components/build-module/tabs/tabpanel.js
const tabpanel_TabPanel = (0,external_wp_element_namespaceObject.forwardRef)(function TabPanel2({
children,
tabId,
focusable = true,
...otherProps
}, ref) {
const context = useTabsContext();
const selectedId = useStoreState(context?.store, "selectedId");
if (!context) {
true ? external_wp_warning_default()("`Tabs.TabPanel` must be wrapped in a `Tabs` component.") : 0;
return null;
}
const {
store,
instanceId
} = context;
const instancedTabId = `${instanceId}-${tabId}`;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_TabPanel, {
ref,
store,
id: `${instancedTabId}-view`,
tabId: instancedTabId,
focusable,
...otherProps,
children: selectedId === instancedTabId && children
});
});
;// ./node_modules/@wordpress/components/build-module/tabs/index.js
function externalToInternalTabId(externalId, instanceId) {
return externalId && `${instanceId}-${externalId}`;
}
function internalToExternalTabId(internalId, instanceId) {
return typeof internalId === "string" ? internalId.replace(`${instanceId}-`, "") : internalId;
}
const Tabs = Object.assign(function Tabs2({
selectOnMove = true,
defaultTabId,
orientation = "horizontal",
onSelect,
children,
selectedTabId,
activeTabId,
defaultActiveTabId,
onActiveTabIdChange
}) {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(Tabs2, "tabs");
const store = useTabStore({
selectOnMove,
orientation,
defaultSelectedId: externalToInternalTabId(defaultTabId, instanceId),
setSelectedId: (newSelectedId) => {
onSelect?.(internalToExternalTabId(newSelectedId, instanceId));
},
selectedId: externalToInternalTabId(selectedTabId, instanceId),
defaultActiveId: externalToInternalTabId(defaultActiveTabId, instanceId),
setActiveId: (newActiveId) => {
onActiveTabIdChange?.(internalToExternalTabId(newActiveId, instanceId));
},
activeId: externalToInternalTabId(activeTabId, instanceId),
rtl: (0,external_wp_i18n_namespaceObject.isRTL)()
});
const {
items,
activeId
} = useStoreState(store);
const {
setActiveId
} = store;
(0,external_wp_element_namespaceObject.useEffect)(() => {
requestAnimationFrame(() => {
const focusedElement = items?.[0]?.element?.ownerDocument.activeElement;
if (!focusedElement || !items.some((item) => focusedElement === item.element)) {
return;
}
if (activeId !== focusedElement.id) {
setActiveId(focusedElement.id);
}
});
}, [activeId, items, setActiveId]);
const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
store,
instanceId
}), [store, instanceId]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TabsContext.Provider, {
value: contextValue,
children
});
}, {
/**
* Renders a single tab.
*
* The currently active tab receives default styling that can be
* overridden with CSS targeting `[aria-selected="true"]`.
*/
Tab: Object.assign(tab_Tab, {
displayName: "Tabs.Tab"
}),
/**
* A wrapper component for the `Tab` components.
*
* It is responsible for rendering the list of tabs.
*/
TabList: Object.assign(tablist_TabList, {
displayName: "Tabs.TabList"
}),
/**
* Renders the content to display for a single tab once that tab is selected.
*/
TabPanel: Object.assign(tabpanel_TabPanel, {
displayName: "Tabs.TabPanel"
}),
Context: Object.assign(TabsContext, {
displayName: "Tabs.Context"
})
});
;// external ["wp","privateApis"]
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// ./node_modules/@wordpress/components/build-module/lock-unlock.js
const {
lock,
unlock
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", "@wordpress/components");
;// ./node_modules/@wordpress/icons/build-module/library/info.js
var info_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/published.js
var published_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/caution.js
var caution_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 12v-1.5h1.5V16h-1.5Zm0-8v5h1.5V8h-1.5Z"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/error.js
var error_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"
}
) });
;// ./node_modules/@wordpress/components/build-module/badge/index.js
function contextBasedIcon(intent = "default") {
switch (intent) {
case "info":
return info_default;
case "success":
return published_default;
case "warning":
return caution_default;
case "error":
return error_default;
default:
return null;
}
}
function Badge({
className,
intent = "default",
children,
...props
}) {
const icon = contextBasedIcon(intent);
const hasIcon = !!icon;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: dist_clsx("components-badge", className, {
[`is-${intent}`]: intent,
"has-icon": hasIcon
}),
...props,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
className: "components-badge__flex-wrapper",
children: [hasIcon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
icon,
size: 16,
fill: "currentColor",
className: "components-badge__icon"
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "components-badge__content",
children
})]
})
});
}
var badge_default = Badge;
;// ./node_modules/@date-fns/tz/constants/index.js
/**
* The symbol to access the `TZDate`'s function to construct a new instance from
* the provided value. It helps date-fns to inherit the time zone.
*/
const constructFromSymbol = Symbol.for("constructDateFrom");
;// ./node_modules/@date-fns/tz/tzName/index.js
/**
* Time zone name format.
*/
/**
* The function returns the time zone name for the given date in the specified
* time zone.
*
* It uses the `Intl.DateTimeFormat` API and by default outputs the time zone
* name in a long format, e.g. "Pacific Standard Time" or
* "Singapore Standard Time".
*
* It is possible to specify the format as the third argument using one of the following options
*
* - "short": e.g. "EDT" or "GMT+8".
* - "long": e.g. "Eastern Daylight Time".
* - "shortGeneric": e.g. "ET" or "Singapore Time".
* - "longGeneric": e.g. "Eastern Time" or "Singapore Standard Time".
*
* These options correspond to TR35 tokens `z..zzz`, `zzzz`, `v`, and `vvvv` respectively: https://www.unicode.org/reports/tr35/tr35-dates.html#dfst-zone
*
* @param timeZone - Time zone name (IANA or UTC offset)
* @param date - Date object to get the time zone name for
* @param format - Optional format of the time zone name. Defaults to "long". Can be "short", "long", "shortGeneric", or "longGeneric".
*
* @returns Time zone name (e.g. "Singapore Standard Time")
*/
function tzName(timeZone, date, format = "long") {
return new Intl.DateTimeFormat("en-US", {
// Enforces engine to render the time. Without the option JavaScriptCore omits it.
hour: "numeric",
timeZone: timeZone,
timeZoneName: format
}).format(date).split(/\s/g) // Format.JS uses non-breaking spaces
.slice(2) // Skip the hour and AM/PM parts
.join(" ");
}
;// ./node_modules/@date-fns/tz/tzOffset/index.js
const offsetFormatCache = {};
const offsetCache = {};
/**
* The function extracts UTC offset in minutes from the given date in specified
* time zone.
*
* Unlike `Date.prototype.getTimezoneOffset`, this function returns the value
* mirrored to the sign of the offset in the time zone. For Asia/Singapore
* (UTC+8), `tzOffset` returns 480, while `getTimezoneOffset` returns -480.
*
* @param timeZone - Time zone name (IANA or UTC offset)
* @param date - Date to check the offset for
*
* @returns UTC offset in minutes
*/
function tzOffset_tzOffset(timeZone, date) {
try {
const format = offsetFormatCache[timeZone] ||= new Intl.DateTimeFormat("en-US", {
timeZone,
timeZoneName: "longOffset"
}).format;
const offsetStr = format(date).split("GMT")[1];
if (offsetStr in offsetCache) return offsetCache[offsetStr];
return calcOffset(offsetStr, offsetStr.split(":"));
} catch {
// Fallback to manual parsing if the runtime doesn't support ±HH:MM/±HHMM/±HH
// See: https://github.com/nodejs/node/issues/53419
if (timeZone in offsetCache) return offsetCache[timeZone];
const captures = timeZone?.match(offsetRe);
if (captures) return calcOffset(timeZone, captures.slice(1));
return NaN;
}
}
const offsetRe = /([+-]\d\d):?(\d\d)?/;
function calcOffset(cacheStr, values) {
const hours = +(values[0] || 0);
const minutes = +(values[1] || 0);
// Convert seconds to minutes by dividing by 60 to keep the function return in minutes.
const seconds = +(values[2] || 0) / 60;
return offsetCache[cacheStr] = hours * 60 + minutes > 0 ? hours * 60 + minutes + seconds : hours * 60 - minutes - seconds;
}
;// ./node_modules/@date-fns/tz/date/mini.js
class TZDateMini extends Date {
//#region static
constructor(...args) {
super();
if (args.length > 1 && typeof args[args.length - 1] === "string") {
this.timeZone = args.pop();
}
this.internal = new Date();
if (isNaN(tzOffset_tzOffset(this.timeZone, this))) {
this.setTime(NaN);
} else {
if (!args.length) {
this.setTime(Date.now());
} else if (typeof args[0] === "number" && (args.length === 1 || args.length === 2 && typeof args[1] !== "number")) {
this.setTime(args[0]);
} else if (typeof args[0] === "string") {
this.setTime(+new Date(args[0]));
} else if (args[0] instanceof Date) {
this.setTime(+args[0]);
} else {
this.setTime(+new Date(...args));
adjustToSystemTZ(this, NaN);
syncToInternal(this);
}
}
}
static tz(tz, ...args) {
return args.length ? new TZDateMini(...args, tz) : new TZDateMini(Date.now(), tz);
}
//#endregion
//#region time zone
withTimeZone(timeZone) {
return new TZDateMini(+this, timeZone);
}
getTimezoneOffset() {
const offset = -tzOffset_tzOffset(this.timeZone, this);
// Remove the seconds offset
// use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
return offset > 0 ? Math.floor(offset) : Math.ceil(offset);
}
//#endregion
//#region time
setTime(time) {
Date.prototype.setTime.apply(this, arguments);
syncToInternal(this);
return +this;
}
//#endregion
//#region date-fns integration
[Symbol.for("constructDateFrom")](date) {
return new TZDateMini(+new Date(date), this.timeZone);
}
//#endregion
}
// Assign getters and setters
const mini_re = /^(get|set)(?!UTC)/;
Object.getOwnPropertyNames(Date.prototype).forEach(method => {
if (!mini_re.test(method)) return;
const utcMethod = method.replace(mini_re, "$1UTC");
// Filter out methods without UTC counterparts
if (!TZDateMini.prototype[utcMethod]) return;
if (method.startsWith("get")) {
// Delegate to internal date's UTC method
TZDateMini.prototype[method] = function () {
return this.internal[utcMethod]();
};
} else {
// Assign regular setter
TZDateMini.prototype[method] = function () {
Date.prototype[utcMethod].apply(this.internal, arguments);
syncFromInternal(this);
return +this;
};
// Assign UTC setter
TZDateMini.prototype[utcMethod] = function () {
Date.prototype[utcMethod].apply(this, arguments);
syncToInternal(this);
return +this;
};
}
});
/**
* Function syncs time to internal date, applying the time zone offset.
*
* @param {Date} date - Date to sync
*/
function syncToInternal(date) {
date.internal.setTime(+date);
date.internal.setUTCSeconds(date.internal.getUTCSeconds() - Math.round(-tzOffset_tzOffset(date.timeZone, date) * 60));
}
/**
* Function syncs the internal date UTC values to the date. It allows to get
* accurate timestamp value.
*
* @param {Date} date - The date to sync
*/
function syncFromInternal(date) {
// First we transpose the internal values
Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());
Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());
// Now we have to adjust the date to the system time zone
adjustToSystemTZ(date);
}
/**
* Function adjusts the date to the system time zone. It uses the time zone
* differences to calculate the offset and adjust the date.
*
* @param {Date} date - Date to adjust
*/
function adjustToSystemTZ(date) {
// Save the time zone offset before all the adjustments
const baseOffset = tzOffset_tzOffset(date.timeZone, date);
// Remove the seconds offset
// use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
const offset = baseOffset > 0 ? Math.floor(baseOffset) : Math.ceil(baseOffset);
//#region System DST adjustment
// The biggest problem with using the system time zone is that when we create
// a date from internal values stored in UTC, the system time zone might end
// up on the DST hour:
//
// $ TZ=America/New_York node
// > new Date(2020, 2, 8, 1).toString()
// 'Sun Mar 08 2020 01:00:00 GMT-0500 (Eastern Standard Time)'
// > new Date(2020, 2, 8, 2).toString()
// 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'
// > new Date(2020, 2, 8, 3).toString()
// 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'
// > new Date(2020, 2, 8, 4).toString()
// 'Sun Mar 08 2020 04:00:00 GMT-0400 (Eastern Daylight Time)'
//
// Here we get the same hour for both 2 and 3, because the system time zone
// has DST beginning at 8 March 2020, 2 a.m. and jumps to 3 a.m. So we have
// to adjust the internal date to reflect that.
//
// However we want to adjust only if that's the DST hour the change happenes,
// not the hour where DST moves to.
// We calculate the previous hour to see if the time zone offset has changed
// and we have landed on the DST hour.
const prevHour = new Date(+date);
// We use UTC methods here as we don't want to land on the same hour again
// in case of DST.
prevHour.setUTCHours(prevHour.getUTCHours() - 1);
// Calculate if we are on the system DST hour.
const systemOffset = -new Date(+date).getTimezoneOffset();
const prevHourSystemOffset = -new Date(+prevHour).getTimezoneOffset();
const systemDSTChange = systemOffset - prevHourSystemOffset;
// Detect the DST shift. System DST change will occur both on
const dstShift = Date.prototype.getHours.apply(date) !== date.internal.getUTCHours();
// Move the internal date when we are on the system DST hour.
if (systemDSTChange && dstShift) date.internal.setUTCMinutes(date.internal.getUTCMinutes() + systemDSTChange);
//#endregion
//#region System diff adjustment
// Now we need to adjust the date, since we just applied internal values.
// We need to calculate the difference between the system and date time zones
// and apply it to the date.
const offsetDiff = systemOffset - offset;
if (offsetDiff) Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);
//#endregion
//#region Seconds System diff adjustment
const systemDate = new Date(+date);
// Set the UTC seconds to 0 to isolate the timezone offset in seconds.
systemDate.setUTCSeconds(0);
// For negative systemOffset, invert the seconds.
const systemSecondsOffset = systemOffset > 0 ? systemDate.getSeconds() : (systemDate.getSeconds() - 60) % 60;
// Calculate the seconds offset based on the timezone offset.
const secondsOffset = Math.round(-(tzOffset_tzOffset(date.timeZone, date) * 60)) % 60;
if (secondsOffset || systemSecondsOffset) {
date.internal.setUTCSeconds(date.internal.getUTCSeconds() + secondsOffset);
Date.prototype.setUTCSeconds.call(date, Date.prototype.getUTCSeconds.call(date) + secondsOffset + systemSecondsOffset);
}
//#endregion
//#region Post-adjustment DST fix
const postBaseOffset = tzOffset_tzOffset(date.timeZone, date);
// Remove the seconds offset
// use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
const postOffset = postBaseOffset > 0 ? Math.floor(postBaseOffset) : Math.ceil(postBaseOffset);
const postSystemOffset = -new Date(+date).getTimezoneOffset();
const postOffsetDiff = postSystemOffset - postOffset;
const offsetChanged = postOffset !== offset;
const postDiff = postOffsetDiff - offsetDiff;
if (offsetChanged && postDiff) {
Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);
// Now we need to check if got offset change during the post-adjustment.
// If so, we also need both dates to reflect that.
const newBaseOffset = tzOffset_tzOffset(date.timeZone, date);
// Remove the seconds offset
// use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
const newOffset = newBaseOffset > 0 ? Math.floor(newBaseOffset) : Math.ceil(newBaseOffset);
const offsetChange = postOffset - newOffset;
if (offsetChange) {
date.internal.setUTCMinutes(date.internal.getUTCMinutes() + offsetChange);
Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);
}
}
//#endregion
}
;// ./node_modules/@date-fns/tz/date/index.js
class date_TZDate extends TZDateMini {
//#region static
static tz(tz, ...args) {
return args.length ? new date_TZDate(...args, tz) : new date_TZDate(Date.now(), tz);
}
//#endregion
//#region representation
toISOString() {
const [sign, hours, minutes] = this.tzComponents();
const tz = `${sign}${hours}:${minutes}`;
return this.internal.toISOString().slice(0, -1) + tz;
}
toString() {
// "Tue Aug 13 2024 07:50:19 GMT+0800 (Singapore Standard Time)";
return `${this.toDateString()} ${this.toTimeString()}`;
}
toDateString() {
// toUTCString returns RFC 7231 ("Mon, 12 Aug 2024 23:36:08 GMT")
const [day, date, month, year] = this.internal.toUTCString().split(" ");
// "Tue Aug 13 2024"
return `${day?.slice(0, -1) /* Remove "," */} ${month} ${date} ${year}`;
}
toTimeString() {
// toUTCString returns RFC 7231 ("Mon, 12 Aug 2024 23:36:08 GMT")
const time = this.internal.toUTCString().split(" ")[4];
const [sign, hours, minutes] = this.tzComponents();
// "07:42:23 GMT+0800 (Singapore Standard Time)"
return `${time} GMT${sign}${hours}${minutes} (${tzName(this.timeZone, this)})`;
}
toLocaleString(locales, options) {
return Date.prototype.toLocaleString.call(this, locales, {
...options,
timeZone: options?.timeZone || this.timeZone
});
}
toLocaleDateString(locales, options) {
return Date.prototype.toLocaleDateString.call(this, locales, {
...options,
timeZone: options?.timeZone || this.timeZone
});
}
toLocaleTimeString(locales, options) {
return Date.prototype.toLocaleTimeString.call(this, locales, {
...options,
timeZone: options?.timeZone || this.timeZone
});
}
//#endregion
//#region private
tzComponents() {
const offset = this.getTimezoneOffset();
const sign = offset > 0 ? "-" : "+";
const hours = String(Math.floor(Math.abs(offset) / 60)).padStart(2, "0");
const minutes = String(Math.abs(offset) % 60).padStart(2, "0");
return [sign, hours, minutes];
}
//#endregion
withTimeZone(timeZone) {
return new date_TZDate(+this, timeZone);
}
//#region date-fns integration
[Symbol.for("constructDateFrom")](date) {
return new date_TZDate(+new Date(date), this.timeZone);
}
//#endregion
}
;// ./node_modules/@date-fns/tz/tz/index.js
/**
* The function creates accepts a time zone and returns a function that creates
* a new `TZDate` instance in the time zone from the provided value. Use it to
* provide the context for the date-fns functions, via the `in` option.
*
* @param timeZone - Time zone name (IANA or UTC offset)
*
* @returns Function that creates a new `TZDate` instance in the time zone
*/
const tz = timeZone => value => TZDate.tz(timeZone, +new Date(value));
;// ./node_modules/@date-fns/tz/tzScan/index.js
/**
* Time interval.
*/
/**
* Time zone change record.
*/
/**
* The function scans the time zone for changes in the given interval.
*
* @param timeZone - Time zone name (IANA or UTC offset)
* @param interval - Time interval to scan for changes
*
* @returns Array of time zone changes
*/
function tzScan(timeZone, interval) {
const changes = [];
const monthDate = new Date(interval.start);
monthDate.setUTCSeconds(0, 0);
const endDate = new Date(interval.end);
endDate.setUTCSeconds(0, 0);
const endMonthTime = +endDate;
let lastOffset = tzOffset(timeZone, monthDate);
while (+monthDate < endMonthTime) {
// Month forward
monthDate.setUTCMonth(monthDate.getUTCMonth() + 1);
// Find the month where the offset changes
const offset = tzOffset(timeZone, monthDate);
if (offset != lastOffset) {
// Rewind a month back to find the day where the offset changes
const dayDate = new Date(monthDate);
dayDate.setUTCMonth(dayDate.getUTCMonth() - 1);
const endDayTime = +monthDate;
lastOffset = tzOffset(timeZone, dayDate);
while (+dayDate < endDayTime) {
// Day forward
dayDate.setUTCDate(dayDate.getUTCDate() + 1);
// Find the day where the offset changes
const offset = tzOffset(timeZone, dayDate);
if (offset != lastOffset) {
// Rewind a day back to find the time where the offset changes
const hourDate = new Date(dayDate);
hourDate.setUTCDate(hourDate.getUTCDate() - 1);
const endHourTime = +dayDate;
lastOffset = tzOffset(timeZone, hourDate);
while (+hourDate < endHourTime) {
// Hour forward
hourDate.setUTCHours(hourDate.getUTCHours() + 1);
// Find the hour where the offset changes
const hourOffset = tzOffset(timeZone, hourDate);
if (hourOffset !== lastOffset) {
changes.push({
date: new Date(hourDate),
change: hourOffset - lastOffset,
offset: hourOffset
});
}
lastOffset = hourOffset;
}
}
lastOffset = offset;
}
}
lastOffset = offset;
}
return changes;
}
;// ./node_modules/@date-fns/tz/index.js
;// ./node_modules/react-day-picker/node_modules/date-fns/locale/en-US/_lib/formatDistance.js
const formatDistance_formatDistanceLocale = {
lessThanXSeconds: {
one: "less than a second",
other: "less than {{count}} seconds",
},
xSeconds: {
one: "1 second",
other: "{{count}} seconds",
},
halfAMinute: "half a minute",
lessThanXMinutes: {
one: "less than a minute",
other: "less than {{count}} minutes",
},
xMinutes: {
one: "1 minute",
other: "{{count}} minutes",
},
aboutXHours: {
one: "about 1 hour",
other: "about {{count}} hours",
},
xHours: {
one: "1 hour",
other: "{{count}} hours",
},
xDays: {
one: "1 day",
other: "{{count}} days",
},
aboutXWeeks: {
one: "about 1 week",
other: "about {{count}} weeks",
},
xWeeks: {
one: "1 week",
other: "{{count}} weeks",
},
aboutXMonths: {
one: "about 1 month",
other: "about {{count}} months",
},
xMonths: {
one: "1 month",
other: "{{count}} months",
},
aboutXYears: {
one: "about 1 year",
other: "about {{count}} years",
},
xYears: {
one: "1 year",
other: "{{count}} years",
},
overXYears: {
one: "over 1 year",
other: "over {{count}} years",
},
almostXYears: {
one: "almost 1 year",
other: "almost {{count}} years",
},
};
const formatDistance_formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistance_formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", count.toString());
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "in " + result;
} else {
return result + " ago";
}
}
return result;
};
;// ./node_modules/react-day-picker/node_modules/date-fns/locale/_lib/buildFormatLongFn.js
function buildFormatLongFn_buildFormatLongFn(args) {
return (options = {}) => {
// TODO: Remove String()
const width = options.width ? String(options.width) : args.defaultWidth;
const format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
;// ./node_modules/react-day-picker/node_modules/date-fns/locale/en-US/_lib/formatLong.js
const formatLong_dateFormats = {
full: "EEEE, MMMM do, y",
long: "MMMM do, y",
medium: "MMM d, y",
short: "MM/dd/yyyy",
};
const formatLong_timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a",
};
const formatLong_dateTimeFormats = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
const formatLong_formatLong = {
date: buildFormatLongFn_buildFormatLongFn({
formats: formatLong_dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn_buildFormatLongFn({
formats: formatLong_timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn_buildFormatLongFn({
formats: formatLong_dateTimeFormats,
defaultWidth: "full",
}),
};
;// ./node_modules/react-day-picker/node_modules/date-fns/locale/en-US/_lib/formatRelative.js
const formatRelative_formatRelativeLocale = {
lastWeek: "'last' eeee 'at' p",
yesterday: "'yesterday at' p",
today: "'today at' p",
tomorrow: "'tomorrow at' p",
nextWeek: "eeee 'at' p",
other: "P",
};
const formatRelative_formatRelative = (token, _date, _baseDate, _options) =>
formatRelative_formatRelativeLocale[token];
;// ./node_modules/react-day-picker/node_modules/date-fns/locale/_lib/buildLocalizeFn.js
/**
* The localize function argument callback which allows to convert raw value to
* the actual type.
*
* @param value - The value to convert
*
* @returns The converted value
*/
/**
* The map of localized values for each width.
*/
/**
* The index type of the locale unit value. It types conversion of units of
* values that don't start at 0 (i.e. quarters).
*/
/**
* Converts the unit value to the tuple of values.
*/
/**
* The tuple of localized era values. The first element represents BC,
* the second element represents AD.
*/
/**
* The tuple of localized quarter values. The first element represents Q1.
*/
/**
* The tuple of localized day values. The first element represents Sunday.
*/
/**
* The tuple of localized month values. The first element represents January.
*/
function buildLocalizeFn_buildLocalizeFn(args) {
return (value, options) => {
const context = options?.context ? String(options.context) : "standalone";
let valuesArray;
if (context === "formatting" && args.formattingValues) {
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
const width = options?.width ? String(options.width) : defaultWidth;
valuesArray =
args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
const defaultWidth = args.defaultWidth;
const width = options?.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[width] || args.values[defaultWidth];
}
const index = args.argumentCallback ? args.argumentCallback(value) : value;
// @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
return valuesArray[index];
};
}
;// ./node_modules/react-day-picker/node_modules/date-fns/locale/en-US/_lib/localize.js
const localize_eraValues = {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"],
};
const localize_quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"],
};
// Note: in English, the names of days of the week and months are capitalized.
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
// Generally, formatted dates should look like they are in the middle of a sentence,
// e.g. in Spanish language the weekdays and months should be in the lowercase.
const localize_monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
],
wide: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
],
};
const localize_dayValues = {
narrow: ["S", "M", "T", "W", "T", "F", "S"],
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
wide: [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
],
};
const localize_dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
},
};
const localize_formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night",
},
};
const localize_ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
// If ordinal numbers depend on context, for example,
// if they are different for different grammatical genders,
// use `options.unit`.
//
// `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
// 'day', 'hour', 'minute', 'second'.
const rem100 = number % 100;
if (rem100 > 20 || rem100 < 10) {
switch (rem100 % 10) {
case 1:
return number + "st";
case 2:
return number + "nd";
case 3:
return number + "rd";
}
}
return number + "th";
};
const localize_localize = {
ordinalNumber: localize_ordinalNumber,
era: buildLocalizeFn_buildLocalizeFn({
values: localize_eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn_buildLocalizeFn({
values: localize_quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn_buildLocalizeFn({
values: localize_monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn_buildLocalizeFn({
values: localize_dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn_buildLocalizeFn({
values: localize_dayPeriodValues,
defaultWidth: "wide",
formattingValues: localize_formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};
;// ./node_modules/react-day-picker/node_modules/date-fns/locale/_lib/buildMatchFn.js
function buildMatchFn_buildMatchFn(args) {
return (string, options = {}) => {
const width = options.width;
const matchPattern =
(width && args.matchPatterns[width]) ||
args.matchPatterns[args.defaultMatchWidth];
const matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
const matchedString = matchResult[0];
const parsePatterns =
(width && args.parsePatterns[width]) ||
args.parsePatterns[args.defaultParseWidth];
const key = Array.isArray(parsePatterns)
? buildMatchFn_findIndex(parsePatterns, (pattern) => pattern.test(matchedString))
: // [TODO] -- I challenge you to fix the type
buildMatchFn_findKey(parsePatterns, (pattern) => pattern.test(matchedString));
let value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback
? // [TODO] -- I challenge you to fix the type
options.valueCallback(value)
: value;
const rest = string.slice(matchedString.length);
return { value, rest };
};
}
function buildMatchFn_findKey(object, predicate) {
for (const key in object) {
if (
Object.prototype.hasOwnProperty.call(object, key) &&
predicate(object[key])
) {
return key;
}
}
return undefined;
}
function buildMatchFn_findIndex(array, predicate) {
for (let key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return undefined;
}
;// ./node_modules/react-day-picker/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
function buildMatchPatternFn_buildMatchPatternFn(args) {
return (string, options = {}) => {
const matchResult = string.match(args.matchPattern);
if (!matchResult) return null;
const matchedString = matchResult[0];
const parseResult = string.match(args.parsePattern);
if (!parseResult) return null;
let value = args.valueCallback
? args.valueCallback(parseResult[0])
: parseResult[0];
// [TODO] I challenge you to fix the type
value = options.valueCallback ? options.valueCallback(value) : value;
const rest = string.slice(matchedString.length);
return { value, rest };
};
}
;// ./node_modules/react-day-picker/node_modules/date-fns/locale/en-US/_lib/match.js
const match_matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
const match_parseOrdinalNumberPattern = /\d+/i;
const match_matchEraPatterns = {
narrow: /^(b|a)/i,
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
wide: /^(before christ|before common era|anno domini|common era)/i,
};
const match_parseEraPatterns = {
any: [/^b/i, /^(a|c)/i],
};
const match_matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](th|st|nd|rd)? quarter/i,
};
const match_parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const match_matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,
};
const match_parseMonthPatterns = {
narrow: [
/^j/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^j/i,
/^j/i,
/^a/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
any: [
/^ja/i,
/^f/i,
/^mar/i,
/^ap/i,
/^may/i,
/^jun/i,
/^jul/i,
/^au/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
};
const match_matchDayPatterns = {
narrow: /^[smtwf]/i,
short: /^(su|mo|tu|we|th|fr|sa)/i,
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,
};
const match_parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
};
const match_matchDayPeriodPatterns = {
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,
};
const match_parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^mi/i,
noon: /^no/i,
morning: /morning/i,
afternoon: /afternoon/i,
evening: /evening/i,
night: /night/i,
},
};
const _lib_match_match = {
ordinalNumber: buildMatchPatternFn_buildMatchPatternFn({
matchPattern: match_matchOrdinalNumberPattern,
parsePattern: match_parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: buildMatchFn_buildMatchFn({
matchPatterns: match_matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: match_parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn_buildMatchFn({
matchPatterns: match_matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: match_parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn_buildMatchFn({
matchPatterns: match_matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: match_parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn_buildMatchFn({
matchPatterns: match_matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: match_parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn_buildMatchFn({
matchPatterns: match_matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: match_parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};
;// ./node_modules/react-day-picker/node_modules/date-fns/locale/en-US.js
/**
* @category Locales
* @summary English locale (United States).
* @language English
* @iso-639-2 eng
* @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
* @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
*/
const en_US_enUS = {
code: "en-US",
formatDistance: formatDistance_formatDistance,
formatLong: formatLong_formatLong,
formatRelative: formatRelative_formatRelative,
localize: localize_localize,
match: _lib_match_match,
options: {
weekStartsOn: 0 /* Sunday */,
firstWeekContainsDate: 1,
},
};
// Fallback for modularized imports:
/* harmony default export */ const locale_en_US = ((/* unused pure expression or super */ null && (en_US_enUS)));
;// ./node_modules/react-day-picker/node_modules/date-fns/constants.js
/**
* @module constants
* @summary Useful constants
* @description
* Collection of useful date constants.
*
* The constants could be imported from `date-fns/constants`:
*
* ```ts
* import { maxTime, minTime } from "./constants/date-fns/constants";
*
* function isAllowedTime(time) {
* return time <= maxTime && time >= minTime;
* }
* ```
*/
/**
* @constant
* @name daysInWeek
* @summary Days in 1 week.
*/
const constants_daysInWeek = 7;
/**
* @constant
* @name daysInYear
* @summary Days in 1 year.
*
* @description
* How many days in a year.
*
* One years equals 365.2425 days according to the formula:
*
* > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.
* > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
*/
const constants_daysInYear = 365.2425;
/**
* @constant
* @name maxTime
* @summary Maximum allowed time.
*
* @example
* import { maxTime } from "./constants/date-fns/constants";
*
* const isValid = 8640000000000001 <= maxTime;
* //=> false
*
* new Date(8640000000000001);
* //=> Invalid Date
*/
const constants_maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
/**
* @constant
* @name minTime
* @summary Minimum allowed time.
*
* @example
* import { minTime } from "./constants/date-fns/constants";
*
* const isValid = -8640000000000001 >= minTime;
* //=> false
*
* new Date(-8640000000000001)
* //=> Invalid Date
*/
const constants_minTime = -constants_maxTime;
/**
* @constant
* @name millisecondsInWeek
* @summary Milliseconds in 1 week.
*/
const constants_millisecondsInWeek = 604800000;
/**
* @constant
* @name millisecondsInDay
* @summary Milliseconds in 1 day.
*/
const constants_millisecondsInDay = 86400000;
/**
* @constant
* @name millisecondsInMinute
* @summary Milliseconds in 1 minute
*/
const constants_millisecondsInMinute = 60000;
/**
* @constant
* @name millisecondsInHour
* @summary Milliseconds in 1 hour
*/
const constants_millisecondsInHour = 3600000;
/**
* @constant
* @name millisecondsInSecond
* @summary Milliseconds in 1 second
*/
const constants_millisecondsInSecond = 1000;
/**
* @constant
* @name minutesInYear
* @summary Minutes in 1 year.
*/
const constants_minutesInYear = 525600;
/**
* @constant
* @name minutesInMonth
* @summary Minutes in 1 month.
*/
const constants_minutesInMonth = 43200;
/**
* @constant
* @name minutesInDay
* @summary Minutes in 1 day.
*/
const constants_minutesInDay = 1440;
/**
* @constant
* @name minutesInHour
* @summary Minutes in 1 hour.
*/
const constants_minutesInHour = 60;
/**
* @constant
* @name monthsInQuarter
* @summary Months in 1 quarter.
*/
const constants_monthsInQuarter = 3;
/**
* @constant
* @name monthsInYear
* @summary Months in 1 year.
*/
const constants_monthsInYear = 12;
/**
* @constant
* @name quartersInYear
* @summary Quarters in 1 year
*/
const constants_quartersInYear = 4;
/**
* @constant
* @name secondsInHour
* @summary Seconds in 1 hour.
*/
const constants_secondsInHour = 3600;
/**
* @constant
* @name secondsInMinute
* @summary Seconds in 1 minute.
*/
const constants_secondsInMinute = 60;
/**
* @constant
* @name secondsInDay
* @summary Seconds in 1 day.
*/
const constants_secondsInDay = constants_secondsInHour * 24;
/**
* @constant
* @name secondsInWeek
* @summary Seconds in 1 week.
*/
const constants_secondsInWeek = constants_secondsInDay * 7;
/**
* @constant
* @name secondsInYear
* @summary Seconds in 1 year.
*/
const constants_secondsInYear = constants_secondsInDay * constants_daysInYear;
/**
* @constant
* @name secondsInMonth
* @summary Seconds in 1 month
*/
const constants_secondsInMonth = constants_secondsInYear / 12;
/**
* @constant
* @name secondsInQuarter
* @summary Seconds in 1 quarter.
*/
const constants_secondsInQuarter = constants_secondsInMonth * 3;
/**
* @constant
* @name constructFromSymbol
* @summary Symbol enabling Date extensions to inherit properties from the reference date.
*
* The symbol is used to enable the `constructFrom` function to construct a date
* using a reference date and a value. It allows to transfer extra properties
* from the reference date to the new date. It's useful for extensions like
* [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
* a constructor argument.
*/
const constants_constructFromSymbol = Symbol.for("constructDateFrom");
;// ./node_modules/react-day-picker/node_modules/date-fns/constructFrom.js
/**
* @name constructFrom
* @category Generic Helpers
* @summary Constructs a date using the reference date and the value
*
* @description
* The function constructs a new date using the constructor from the reference
* date and the given value. It helps to build generic functions that accept
* date extensions.
*
* It defaults to `Date` if the passed reference date is a number or a string.
*
* Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]`
* enabling to transfer extra properties from the reference date to the new date.
* It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
* that accept a time zone as a constructor argument.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The reference date to take constructor from
* @param value - The value to create the date
*
* @returns Date initialized using the given date and value
*
* @example
* import { constructFrom } from "./constructFrom/date-fns";
*
* // A function that clones a date preserving the original type
* function cloneDate<DateType extends Date>(date: DateType): DateType {
* return constructFrom(
* date, // Use constructor from the given date
* date.getTime() // Use the date value to create a new date
* );
* }
*/
function constructFrom_constructFrom(date, value) {
if (typeof date === "function") return date(value);
if (date && typeof date === "object" && constants_constructFromSymbol in date)
return date[constants_constructFromSymbol](value);
if (date instanceof Date) return new date.constructor(value);
return new Date(value);
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_constructFrom = ((/* unused pure expression or super */ null && (constructFrom_constructFrom)));
;// ./node_modules/react-day-picker/node_modules/date-fns/toDate.js
/**
* @name toDate
* @category Common Helpers
* @summary Convert the given argument to an instance of Date.
*
* @description
* Convert the given argument to an instance of Date.
*
* If the argument is an instance of Date, the function returns its clone.
*
* If the argument is a number, it is treated as a timestamp.
*
* If the argument is none of the above, the function returns Invalid Date.
*
* Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
* enabling to transfer extra properties from the reference date to the new date.
* It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
* that accept a time zone as a constructor argument.
*
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param argument - The value to convert
*
* @returns The parsed date in the local time zone
*
* @example
* // Clone the date:
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
* //=> Tue Feb 11 2014 11:30:30
*
* @example
* // Convert the timestamp to date:
* const result = toDate(1392098430000)
* //=> Tue Feb 11 2014 11:30:30
*/
function toDate_toDate(argument, context) {
// [TODO] Get rid of `toDate` or `constructFrom`?
return constructFrom_constructFrom(context || argument, argument);
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_toDate = ((/* unused pure expression or super */ null && (toDate_toDate)));
;// ./node_modules/react-day-picker/node_modules/date-fns/addDays.js
/**
* The {@link addDays} function options.
*/
/**
* @name addDays
* @category Day Helpers
* @summary Add the specified number of days to the given date.
*
* @description
* Add the specified number of days to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param amount - The amount of days to be added.
* @param options - An object with options
*
* @returns The new date with the days added
*
* @example
* // Add 10 days to 1 September 2014:
* const result = addDays(new Date(2014, 8, 1), 10)
* //=> Thu Sep 11 2014 00:00:00
*/
function addDays_addDays(date, amount, options) {
const _date = toDate_toDate(date, options?.in);
if (isNaN(amount)) return constructFrom_constructFrom(options?.in || date, NaN);
// If 0 days, no-op to avoid changing times in the hour before end of DST
if (!amount) return _date;
_date.setDate(_date.getDate() + amount);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_addDays = ((/* unused pure expression or super */ null && (addDays_addDays)));
;// ./node_modules/react-day-picker/node_modules/date-fns/addMonths.js
/**
* The {@link addMonths} function options.
*/
/**
* @name addMonths
* @category Month Helpers
* @summary Add the specified number of months to the given date.
*
* @description
* Add the specified number of months to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param amount - The amount of months to be added.
* @param options - The options object
*
* @returns The new date with the months added
*
* @example
* // Add 5 months to 1 September 2014:
* const result = addMonths(new Date(2014, 8, 1), 5)
* //=> Sun Feb 01 2015 00:00:00
*
* // Add one month to 30 January 2023:
* const result = addMonths(new Date(2023, 0, 30), 1)
* //=> Tue Feb 28 2023 00:00:00
*/
function addMonths_addMonths(date, amount, options) {
const _date = toDate_toDate(date, options?.in);
if (isNaN(amount)) return constructFrom_constructFrom(options?.in || date, NaN);
if (!amount) {
// If 0 months, no-op to avoid changing times in the hour before end of DST
return _date;
}
const dayOfMonth = _date.getDate();
// The JS Date object supports date math by accepting out-of-bounds values for
// month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
// new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
// want except that dates will wrap around the end of a month, meaning that
// new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
// we'll default to the end of the desired month by adding 1 to the desired
// month and using a date of 0 to back up one day to the end of the desired
// month.
const endOfDesiredMonth = constructFrom_constructFrom(options?.in || date, _date.getTime());
endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
const daysInMonth = endOfDesiredMonth.getDate();
if (dayOfMonth >= daysInMonth) {
// If we're already at the end of the month, then this is the correct date
// and we're done.
return endOfDesiredMonth;
} else {
// Otherwise, we now know that setting the original day-of-month value won't
// cause an overflow, so set the desired day-of-month. Note that we can't
// just set the date of `endOfDesiredMonth` because that object may have had
// its time changed in the unusual case where where a DST transition was on
// the last day of the month and its local time was in the hour skipped or
// repeated next to a DST transition. So we use `date` instead which is
// guaranteed to still have the original time.
_date.setFullYear(
endOfDesiredMonth.getFullYear(),
endOfDesiredMonth.getMonth(),
dayOfMonth,
);
return _date;
}
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_addMonths = ((/* unused pure expression or super */ null && (addMonths_addMonths)));
;// ./node_modules/react-day-picker/node_modules/date-fns/addWeeks.js
/**
* The {@link addWeeks} function options.
*/
/**
* @name addWeeks
* @category Week Helpers
* @summary Add the specified number of weeks to the given date.
*
* @description
* Add the specified number of weeks to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param amount - The amount of weeks to be added.
* @param options - An object with options
*
* @returns The new date with the weeks added
*
* @example
* // Add 4 weeks to 1 September 2014:
* const result = addWeeks(new Date(2014, 8, 1), 4)
* //=> Mon Sep 29 2014 00:00:00
*/
function addWeeks_addWeeks(date, amount, options) {
return addDays_addDays(date, amount * 7, options);
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_addWeeks = ((/* unused pure expression or super */ null && (addWeeks_addWeeks)));
;// ./node_modules/react-day-picker/node_modules/date-fns/addYears.js
/**
* The {@link addYears} function options.
*/
/**
* @name addYears
* @category Year Helpers
* @summary Add the specified number of years to the given date.
*
* @description
* Add the specified number of years to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type.
*
* @param date - The date to be changed
* @param amount - The amount of years to be added.
* @param options - The options
*
* @returns The new date with the years added
*
* @example
* // Add 5 years to 1 September 2014:
* const result = addYears(new Date(2014, 8, 1), 5)
* //=> Sun Sep 01 2019 00:00:00
*/
function addYears_addYears(date, amount, options) {
return addMonths_addMonths(date, amount * 12, options);
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_addYears = ((/* unused pure expression or super */ null && (addYears_addYears)));
;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
/**
* Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
* They usually appear for dates that denote time before the timezones were introduced
* (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
* and GMT+01:00:00 after that date)
*
* Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
* which would lead to incorrect calculations.
*
* This function returns the timezone offset in milliseconds that takes seconds in account.
*/
function getTimezoneOffsetInMilliseconds_getTimezoneOffsetInMilliseconds(date) {
const _date = toDate_toDate(date);
const utcDate = new Date(
Date.UTC(
_date.getFullYear(),
_date.getMonth(),
_date.getDate(),
_date.getHours(),
_date.getMinutes(),
_date.getSeconds(),
_date.getMilliseconds(),
),
);
utcDate.setUTCFullYear(_date.getFullYear());
return +date - +utcDate;
}
;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/normalizeDates.js
function normalizeDates(context, ...dates) {
const normalize = constructFrom_constructFrom.bind(
null,
context || dates.find((date) => typeof date === "object"),
);
return dates.map(normalize);
}
;// ./node_modules/react-day-picker/node_modules/date-fns/startOfDay.js
/**
* The {@link startOfDay} function options.
*/
/**
* @name startOfDay
* @category Day Helpers
* @summary Return the start of a day for the given date.
*
* @description
* Return the start of a day for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - The options
*
* @returns The start of a day
*
* @example
* // The start of a day for 2 September 2014 11:55:00:
* const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
* //=> Tue Sep 02 2014 00:00:00
*/
function startOfDay_startOfDay(date, options) {
const _date = toDate_toDate(date, options?.in);
_date.setHours(0, 0, 0, 0);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_startOfDay = ((/* unused pure expression or super */ null && (startOfDay_startOfDay)));
;// ./node_modules/react-day-picker/node_modules/date-fns/differenceInCalendarDays.js
/**
* The {@link differenceInCalendarDays} function options.
*/
/**
* @name differenceInCalendarDays
* @category Day Helpers
* @summary Get the number of calendar days between the given dates.
*
* @description
* Get the number of calendar days between the given dates. This means that the times are removed
* from the dates and then the difference in days is calculated.
*
* @param laterDate - The later date
* @param earlierDate - The earlier date
* @param options - The options object
*
* @returns The number of calendar days
*
* @example
* // How many calendar days are between
* // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
* const result = differenceInCalendarDays(
* new Date(2012, 6, 2, 0, 0),
* new Date(2011, 6, 2, 23, 0)
* )
* //=> 366
* // How many calendar days are between
* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
* const result = differenceInCalendarDays(
* new Date(2011, 6, 3, 0, 1),
* new Date(2011, 6, 2, 23, 59)
* )
* //=> 1
*/
function differenceInCalendarDays_differenceInCalendarDays(laterDate, earlierDate, options) {
const [laterDate_, earlierDate_] = normalizeDates(
options?.in,
laterDate,
earlierDate,
);
const laterStartOfDay = startOfDay_startOfDay(laterDate_);
const earlierStartOfDay = startOfDay_startOfDay(earlierDate_);
const laterTimestamp =
+laterStartOfDay - getTimezoneOffsetInMilliseconds_getTimezoneOffsetInMilliseconds(laterStartOfDay);
const earlierTimestamp =
+earlierStartOfDay - getTimezoneOffsetInMilliseconds_getTimezoneOffsetInMilliseconds(earlierStartOfDay);
// Round the number of days to the nearest integer because the number of
// milliseconds in a day is not constant (e.g. it's different in the week of
// the daylight saving time clock shift).
return Math.round((laterTimestamp - earlierTimestamp) / constants_millisecondsInDay);
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_differenceInCalendarDays = ((/* unused pure expression or super */ null && (differenceInCalendarDays_differenceInCalendarDays)));
;// ./node_modules/react-day-picker/node_modules/date-fns/differenceInCalendarMonths.js
/**
* The {@link differenceInCalendarMonths} function options.
*/
/**
* @name differenceInCalendarMonths
* @category Month Helpers
* @summary Get the number of calendar months between the given dates.
*
* @description
* Get the number of calendar months between the given dates.
*
* @param laterDate - The later date
* @param earlierDate - The earlier date
* @param options - An object with options
*
* @returns The number of calendar months
*
* @example
* // How many calendar months are between 31 January 2014 and 1 September 2014?
* const result = differenceInCalendarMonths(
* new Date(2014, 8, 1),
* new Date(2014, 0, 31)
* )
* //=> 8
*/
function differenceInCalendarMonths(laterDate, earlierDate, options) {
const [laterDate_, earlierDate_] = normalizeDates(
options?.in,
laterDate,
earlierDate,
);
const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
return yearsDiff * 12 + monthsDiff;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_differenceInCalendarMonths = ((/* unused pure expression or super */ null && (differenceInCalendarMonths)));
;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/normalizeInterval.js
function normalizeInterval(context, interval) {
const [start, end] = normalizeDates(context, interval.start, interval.end);
return { start, end };
}
;// ./node_modules/react-day-picker/node_modules/date-fns/eachMonthOfInterval.js
/**
* The {@link eachMonthOfInterval} function options.
*/
/**
* The {@link eachMonthOfInterval} function result type. It resolves the proper data type.
*/
/**
* @name eachMonthOfInterval
* @category Interval Helpers
* @summary Return the array of months within the specified time interval.
*
* @description
* Return the array of months within the specified time interval.
*
* @typeParam IntervalType - Interval type.
* @typeParam Options - Options type.
*
* @param interval - The interval.
* @param options - An object with options.
*
* @returns The array with starts of months from the month of the interval start to the month of the interval end
*
* @example
* // Each month between 6 February 2014 and 10 August 2014:
* const result = eachMonthOfInterval({
* start: new Date(2014, 1, 6),
* end: new Date(2014, 7, 10)
* })
* //=> [
* // Sat Feb 01 2014 00:00:00,
* // Sat Mar 01 2014 00:00:00,
* // Tue Apr 01 2014 00:00:00,
* // Thu May 01 2014 00:00:00,
* // Sun Jun 01 2014 00:00:00,
* // Tue Jul 01 2014 00:00:00,
* // Fri Aug 01 2014 00:00:00
* // ]
*/
function eachMonthOfInterval_eachMonthOfInterval(interval, options) {
const { start, end } = normalizeInterval(options?.in, interval);
let reversed = +start > +end;
const endTime = reversed ? +start : +end;
const date = reversed ? end : start;
date.setHours(0, 0, 0, 0);
date.setDate(1);
let step = options?.step ?? 1;
if (!step) return [];
if (step < 0) {
step = -step;
reversed = !reversed;
}
const dates = [];
while (+date <= endTime) {
dates.push(constructFrom_constructFrom(start, date));
date.setMonth(date.getMonth() + step);
}
return reversed ? dates.reverse() : dates;
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_eachMonthOfInterval = ((/* unused pure expression or super */ null && (eachMonthOfInterval_eachMonthOfInterval)));
;// ./node_modules/react-day-picker/node_modules/date-fns/eachYearOfInterval.js
/**
* The {@link eachYearOfInterval} function options.
*/
/**
* The {@link eachYearOfInterval} function result type. It resolves the proper data type.
* It uses the first argument date object type, starting from the date argument,
* then the start interval date, and finally the end interval date. If
* a context function is passed, it uses the context function return type.
*/
/**
* @name eachYearOfInterval
* @category Interval Helpers
* @summary Return the array of yearly timestamps within the specified time interval.
*
* @description
* Return the array of yearly timestamps within the specified time interval.
*
* @typeParam IntervalType - Interval type.
* @typeParam Options - Options type.
*
* @param interval - The interval.
* @param options - An object with options.
*
* @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end
*
* @example
* // Each year between 6 February 2014 and 10 August 2017:
* const result = eachYearOfInterval({
* start: new Date(2014, 1, 6),
* end: new Date(2017, 7, 10)
* })
* //=> [
* // Wed Jan 01 2014 00:00:00,
* // Thu Jan 01 2015 00:00:00,
* // Fri Jan 01 2016 00:00:00,
* // Sun Jan 01 2017 00:00:00
* // ]
*/
function eachYearOfInterval(interval, options) {
const { start, end } = normalizeInterval(options?.in, interval);
let reversed = +start > +end;
const endTime = reversed ? +start : +end;
const date = reversed ? end : start;
date.setHours(0, 0, 0, 0);
date.setMonth(0, 1);
let step = options?.step ?? 1;
if (!step) return [];
if (step < 0) {
step = -step;
reversed = !reversed;
}
const dates = [];
while (+date <= endTime) {
dates.push(constructFrom_constructFrom(start, date));
date.setFullYear(date.getFullYear() + step);
}
return reversed ? dates.reverse() : dates;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_eachYearOfInterval = ((/* unused pure expression or super */ null && (eachYearOfInterval)));
;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/defaultOptions.js
let _lib_defaultOptions_defaultOptions = {};
function defaultOptions_getDefaultOptions() {
return _lib_defaultOptions_defaultOptions;
}
function defaultOptions_setDefaultOptions(newOptions) {
_lib_defaultOptions_defaultOptions = newOptions;
}
;// ./node_modules/react-day-picker/node_modules/date-fns/endOfWeek.js
/**
* The {@link endOfWeek} function options.
*/
/**
* @name endOfWeek
* @category Week Helpers
* @summary Return the end of a week for the given date.
*
* @description
* Return the end of a week for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The end of a week
*
* @example
* // The end of a week for 2 September 2014 11:55:00:
* const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))
* //=> Sat Sep 06 2014 23:59:59.999
*
* @example
* // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:
* const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
* //=> Sun Sep 07 2014 23:59:59.999
*/
function endOfWeek_endOfWeek(date, options) {
const defaultOptions = defaultOptions_getDefaultOptions();
const weekStartsOn =
options?.weekStartsOn ??
options?.locale?.options?.weekStartsOn ??
defaultOptions.weekStartsOn ??
defaultOptions.locale?.options?.weekStartsOn ??
0;
const _date = toDate_toDate(date, options?.in);
const day = _date.getDay();
const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
_date.setDate(_date.getDate() + diff);
_date.setHours(23, 59, 59, 999);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_endOfWeek = ((/* unused pure expression or super */ null && (endOfWeek_endOfWeek)));
;// ./node_modules/react-day-picker/node_modules/date-fns/endOfISOWeek.js
/**
* The {@link endOfISOWeek} function options.
*/
/**
* @name endOfISOWeek
* @category ISO Week Helpers
* @summary Return the end of an ISO week for the given date.
*
* @description
* Return the end of an ISO week for the given date.
* The result will be in the local timezone.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The end of an ISO week
*
* @example
* // The end of an ISO week for 2 September 2014 11:55:00:
* const result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
* //=> Sun Sep 07 2014 23:59:59.999
*/
function endOfISOWeek(date, options) {
return endOfWeek_endOfWeek(date, { ...options, weekStartsOn: 1 });
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_endOfISOWeek = ((/* unused pure expression or super */ null && (endOfISOWeek)));
;// ./node_modules/react-day-picker/node_modules/date-fns/endOfMonth.js
/**
* The {@link endOfMonth} function options.
*/
/**
* @name endOfMonth
* @category Month Helpers
* @summary Return the end of a month for the given date.
*
* @description
* Return the end of a month for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The end of a month
*
* @example
* // The end of a month for 2 September 2014 11:55:00:
* const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
* //=> Tue Sep 30 2014 23:59:59.999
*/
function endOfMonth_endOfMonth(date, options) {
const _date = toDate_toDate(date, options?.in);
const month = _date.getMonth();
_date.setFullYear(_date.getFullYear(), month + 1, 0);
_date.setHours(23, 59, 59, 999);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_endOfMonth = ((/* unused pure expression or super */ null && (endOfMonth_endOfMonth)));
;// ./node_modules/react-day-picker/node_modules/date-fns/endOfYear.js
/**
* The {@link endOfYear} function options.
*/
/**
* @name endOfYear
* @category Year Helpers
* @summary Return the end of a year for the given date.
*
* @description
* Return the end of a year for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - The options
*
* @returns The end of a year
*
* @example
* // The end of a year for 2 September 2014 11:55:00:
* const result = endOfYear(new Date(2014, 8, 2, 11, 55, 0))
* //=> Wed Dec 31 2014 23:59:59.999
*/
function endOfYear(date, options) {
const _date = toDate_toDate(date, options?.in);
const year = _date.getFullYear();
_date.setFullYear(year + 1, 0, 0);
_date.setHours(23, 59, 59, 999);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_endOfYear = ((/* unused pure expression or super */ null && (endOfYear)));
;// ./node_modules/react-day-picker/node_modules/date-fns/startOfYear.js
/**
* The {@link startOfYear} function options.
*/
/**
* @name startOfYear
* @category Year Helpers
* @summary Return the start of a year for the given date.
*
* @description
* Return the start of a year for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - The options
*
* @returns The start of a year
*
* @example
* // The start of a year for 2 September 2014 11:55:00:
* const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
* //=> Wed Jan 01 2014 00:00:00
*/
function startOfYear_startOfYear(date, options) {
const date_ = toDate_toDate(date, options?.in);
date_.setFullYear(date_.getFullYear(), 0, 1);
date_.setHours(0, 0, 0, 0);
return date_;
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_startOfYear = ((/* unused pure expression or super */ null && (startOfYear_startOfYear)));
;// ./node_modules/react-day-picker/node_modules/date-fns/getDayOfYear.js
/**
* The {@link getDayOfYear} function options.
*/
/**
* @name getDayOfYear
* @category Day Helpers
* @summary Get the day of the year of the given date.
*
* @description
* Get the day of the year of the given date.
*
* @param date - The given date
* @param options - The options
*
* @returns The day of year
*
* @example
* // Which day of the year is 2 July 2014?
* const result = getDayOfYear(new Date(2014, 6, 2))
* //=> 183
*/
function getDayOfYear_getDayOfYear(date, options) {
const _date = toDate_toDate(date, options?.in);
const diff = differenceInCalendarDays_differenceInCalendarDays(_date, startOfYear_startOfYear(_date));
const dayOfYear = diff + 1;
return dayOfYear;
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_getDayOfYear = ((/* unused pure expression or super */ null && (getDayOfYear_getDayOfYear)));
;// ./node_modules/react-day-picker/node_modules/date-fns/startOfWeek.js
/**
* The {@link startOfWeek} function options.
*/
/**
* @name startOfWeek
* @category Week Helpers
* @summary Return the start of a week for the given date.
*
* @description
* Return the start of a week for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The start of a week
*
* @example
* // The start of a week for 2 September 2014 11:55:00:
* const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
* //=> Sun Aug 31 2014 00:00:00
*
* @example
* // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
* const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
* //=> Mon Sep 01 2014 00:00:00
*/
function startOfWeek_startOfWeek(date, options) {
const defaultOptions = defaultOptions_getDefaultOptions();
const weekStartsOn =
options?.weekStartsOn ??
options?.locale?.options?.weekStartsOn ??
defaultOptions.weekStartsOn ??
defaultOptions.locale?.options?.weekStartsOn ??
0;
const _date = toDate_toDate(date, options?.in);
const day = _date.getDay();
const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
_date.setDate(_date.getDate() - diff);
_date.setHours(0, 0, 0, 0);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_startOfWeek = ((/* unused pure expression or super */ null && (startOfWeek_startOfWeek)));
;// ./node_modules/react-day-picker/node_modules/date-fns/startOfISOWeek.js
/**
* The {@link startOfISOWeek} function options.
*/
/**
* @name startOfISOWeek
* @category ISO Week Helpers
* @summary Return the start of an ISO week for the given date.
*
* @description
* Return the start of an ISO week for the given date.
* The result will be in the local timezone.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The start of an ISO week
*
* @example
* // The start of an ISO week for 2 September 2014 11:55:00:
* const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
* //=> Mon Sep 01 2014 00:00:00
*/
function startOfISOWeek_startOfISOWeek(date, options) {
return startOfWeek_startOfWeek(date, { ...options, weekStartsOn: 1 });
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_startOfISOWeek = ((/* unused pure expression or super */ null && (startOfISOWeek_startOfISOWeek)));
;// ./node_modules/react-day-picker/node_modules/date-fns/getISOWeekYear.js
/**
* The {@link getISOWeekYear} function options.
*/
/**
* @name getISOWeekYear
* @category ISO Week-Numbering Year Helpers
* @summary Get the ISO week-numbering year of the given date.
*
* @description
* Get the ISO week-numbering year of the given date,
* which always starts 3 days before the year's first Thursday.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @param date - The given date
*
* @returns The ISO week-numbering year
*
* @example
* // Which ISO-week numbering year is 2 January 2005?
* const result = getISOWeekYear(new Date(2005, 0, 2))
* //=> 2004
*/
function getISOWeekYear_getISOWeekYear(date, options) {
const _date = toDate_toDate(date, options?.in);
const year = _date.getFullYear();
const fourthOfJanuaryOfNextYear = constructFrom_constructFrom(_date, 0);
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
const startOfNextYear = startOfISOWeek_startOfISOWeek(fourthOfJanuaryOfNextYear);
const fourthOfJanuaryOfThisYear = constructFrom_constructFrom(_date, 0);
fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
const startOfThisYear = startOfISOWeek_startOfISOWeek(fourthOfJanuaryOfThisYear);
if (_date.getTime() >= startOfNextYear.getTime()) {
return year + 1;
} else if (_date.getTime() >= startOfThisYear.getTime()) {
return year;
} else {
return year - 1;
}
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_getISOWeekYear = ((/* unused pure expression or super */ null && (getISOWeekYear_getISOWeekYear)));
;// ./node_modules/react-day-picker/node_modules/date-fns/startOfISOWeekYear.js
/**
* The {@link startOfISOWeekYear} function options.
*/
/**
* @name startOfISOWeekYear
* @category ISO Week-Numbering Year Helpers
* @summary Return the start of an ISO week-numbering year for the given date.
*
* @description
* Return the start of an ISO week-numbering year,
* which always starts 3 days before the year's first Thursday.
* The result will be in the local timezone.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The start of an ISO week-numbering year
*
* @example
* // The start of an ISO week-numbering year for 2 July 2005:
* const result = startOfISOWeekYear(new Date(2005, 6, 2))
* //=> Mon Jan 03 2005 00:00:00
*/
function startOfISOWeekYear_startOfISOWeekYear(date, options) {
const year = getISOWeekYear_getISOWeekYear(date, options);
const fourthOfJanuary = constructFrom_constructFrom(options?.in || date, 0);
fourthOfJanuary.setFullYear(year, 0, 4);
fourthOfJanuary.setHours(0, 0, 0, 0);
return startOfISOWeek_startOfISOWeek(fourthOfJanuary);
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_startOfISOWeekYear = ((/* unused pure expression or super */ null && (startOfISOWeekYear_startOfISOWeekYear)));
;// ./node_modules/react-day-picker/node_modules/date-fns/getISOWeek.js
/**
* The {@link getISOWeek} function options.
*/
/**
* @name getISOWeek
* @category ISO Week Helpers
* @summary Get the ISO week of the given date.
*
* @description
* Get the ISO week of the given date.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @param date - The given date
* @param options - The options
*
* @returns The ISO week
*
* @example
* // Which week of the ISO-week numbering year is 2 January 2005?
* const result = getISOWeek(new Date(2005, 0, 2))
* //=> 53
*/
function getISOWeek_getISOWeek(date, options) {
const _date = toDate_toDate(date, options?.in);
const diff = +startOfISOWeek_startOfISOWeek(_date) - +startOfISOWeekYear_startOfISOWeekYear(_date);
// Round the number of weeks to the nearest integer because the number of
// milliseconds in a week is not constant (e.g. it's different in the week of
// the daylight saving time clock shift).
return Math.round(diff / constants_millisecondsInWeek) + 1;
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_getISOWeek = ((/* unused pure expression or super */ null && (getISOWeek_getISOWeek)));
;// ./node_modules/react-day-picker/node_modules/date-fns/getWeekYear.js
/**
* The {@link getWeekYear} function options.
*/
/**
* @name getWeekYear
* @category Week-Numbering Year Helpers
* @summary Get the local week-numbering year of the given date.
*
* @description
* Get the local week-numbering year of the given date.
* The exact calculation depends on the values of
* `options.weekStartsOn` (which is the index of the first day of the week)
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
* the first week of the week-numbering year)
*
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
*
* @param date - The given date
* @param options - An object with options.
*
* @returns The local week-numbering year
*
* @example
* // Which week numbering year is 26 December 2004 with the default settings?
* const result = getWeekYear(new Date(2004, 11, 26))
* //=> 2005
*
* @example
* // Which week numbering year is 26 December 2004 if week starts on Saturday?
* const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
* //=> 2004
*
* @example
* // Which week numbering year is 26 December 2004 if the first week contains 4 January?
* const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
* //=> 2004
*/
function getWeekYear_getWeekYear(date, options) {
const _date = toDate_toDate(date, options?.in);
const year = _date.getFullYear();
const defaultOptions = defaultOptions_getDefaultOptions();
const firstWeekContainsDate =
options?.firstWeekContainsDate ??
options?.locale?.options?.firstWeekContainsDate ??
defaultOptions.firstWeekContainsDate ??
defaultOptions.locale?.options?.firstWeekContainsDate ??
1;
const firstWeekOfNextYear = constructFrom_constructFrom(options?.in || date, 0);
firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
firstWeekOfNextYear.setHours(0, 0, 0, 0);
const startOfNextYear = startOfWeek_startOfWeek(firstWeekOfNextYear, options);
const firstWeekOfThisYear = constructFrom_constructFrom(options?.in || date, 0);
firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
firstWeekOfThisYear.setHours(0, 0, 0, 0);
const startOfThisYear = startOfWeek_startOfWeek(firstWeekOfThisYear, options);
if (+_date >= +startOfNextYear) {
return year + 1;
} else if (+_date >= +startOfThisYear) {
return year;
} else {
return year - 1;
}
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_getWeekYear = ((/* unused pure expression or super */ null && (getWeekYear_getWeekYear)));
;// ./node_modules/react-day-picker/node_modules/date-fns/startOfWeekYear.js
/**
* The {@link startOfWeekYear} function options.
*/
/**
* @name startOfWeekYear
* @category Week-Numbering Year Helpers
* @summary Return the start of a local week-numbering year for the given date.
*
* @description
* Return the start of a local week-numbering year.
* The exact calculation depends on the values of
* `options.weekStartsOn` (which is the index of the first day of the week)
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
* the first week of the week-numbering year)
*
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The start of a week-numbering year
*
* @example
* // The start of an a week-numbering year for 2 July 2005 with default settings:
* const result = startOfWeekYear(new Date(2005, 6, 2))
* //=> Sun Dec 26 2004 00:00:00
*
* @example
* // The start of a week-numbering year for 2 July 2005
* // if Monday is the first day of week
* // and 4 January is always in the first week of the year:
* const result = startOfWeekYear(new Date(2005, 6, 2), {
* weekStartsOn: 1,
* firstWeekContainsDate: 4
* })
* //=> Mon Jan 03 2005 00:00:00
*/
function startOfWeekYear_startOfWeekYear(date, options) {
const defaultOptions = defaultOptions_getDefaultOptions();
const firstWeekContainsDate =
options?.firstWeekContainsDate ??
options?.locale?.options?.firstWeekContainsDate ??
defaultOptions.firstWeekContainsDate ??
defaultOptions.locale?.options?.firstWeekContainsDate ??
1;
const year = getWeekYear_getWeekYear(date, options);
const firstWeek = constructFrom_constructFrom(options?.in || date, 0);
firstWeek.setFullYear(year, 0, firstWeekContainsDate);
firstWeek.setHours(0, 0, 0, 0);
const _date = startOfWeek_startOfWeek(firstWeek, options);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_startOfWeekYear = ((/* unused pure expression or super */ null && (startOfWeekYear_startOfWeekYear)));
;// ./node_modules/react-day-picker/node_modules/date-fns/getWeek.js
/**
* The {@link getWeek} function options.
*/
/**
* @name getWeek
* @category Week Helpers
* @summary Get the local week index of the given date.
*
* @description
* Get the local week index of the given date.
* The exact calculation depends on the values of
* `options.weekStartsOn` (which is the index of the first day of the week)
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
* the first week of the week-numbering year)
*
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
*
* @param date - The given date
* @param options - An object with options
*
* @returns The week
*
* @example
* // Which week of the local week numbering year is 2 January 2005 with default options?
* const result = getWeek(new Date(2005, 0, 2))
* //=> 2
*
* @example
* // Which week of the local week numbering year is 2 January 2005,
* // if Monday is the first day of the week,
* // and the first week of the year always contains 4 January?
* const result = getWeek(new Date(2005, 0, 2), {
* weekStartsOn: 1,
* firstWeekContainsDate: 4
* })
* //=> 53
*/
function getWeek_getWeek(date, options) {
const _date = toDate_toDate(date, options?.in);
const diff = +startOfWeek_startOfWeek(_date, options) - +startOfWeekYear_startOfWeekYear(_date, options);
// Round the number of weeks to the nearest integer because the number of
// milliseconds in a week is not constant (e.g. it's different in the week of
// the daylight saving time clock shift).
return Math.round(diff / constants_millisecondsInWeek) + 1;
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_getWeek = ((/* unused pure expression or super */ null && (getWeek_getWeek)));
;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/addLeadingZeros.js
function addLeadingZeros_addLeadingZeros(number, targetLength) {
const sign = number < 0 ? "-" : "";
const output = Math.abs(number).toString().padStart(targetLength, "0");
return sign + output;
}
;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/format/lightFormatters.js
/*
* | | Unit | | Unit |
* |-----|--------------------------------|-----|--------------------------------|
* | a | AM, PM | A* | |
* | d | Day of month | D | |
* | h | Hour [1-12] | H | Hour [0-23] |
* | m | Minute | M | Month |
* | s | Second | S | Fraction of second |
* | y | Year (abs) | Y | |
*
* Letters marked by * are not implemented but reserved by Unicode standard.
*/
const lightFormatters_lightFormatters = {
// Year
y(date, token) {
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
// | Year | y | yy | yyy | yyyy | yyyyy |
// |----------|-------|----|-------|-------|-------|
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
const signedYear = date.getFullYear();
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const year = signedYear > 0 ? signedYear : 1 - signedYear;
return addLeadingZeros_addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
},
// Month
M(date, token) {
const month = date.getMonth();
return token === "M" ? String(month + 1) : addLeadingZeros_addLeadingZeros(month + 1, 2);
},
// Day of the month
d(date, token) {
return addLeadingZeros_addLeadingZeros(date.getDate(), token.length);
},
// AM or PM
a(date, token) {
const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
switch (token) {
case "a":
case "aa":
return dayPeriodEnumValue.toUpperCase();
case "aaa":
return dayPeriodEnumValue;
case "aaaaa":
return dayPeriodEnumValue[0];
case "aaaa":
default:
return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
}
},
// Hour [1-12]
h(date, token) {
return addLeadingZeros_addLeadingZeros(date.getHours() % 12 || 12, token.length);
},
// Hour [0-23]
H(date, token) {
return addLeadingZeros_addLeadingZeros(date.getHours(), token.length);
},
// Minute
m(date, token) {
return addLeadingZeros_addLeadingZeros(date.getMinutes(), token.length);
},
// Second
s(date, token) {
return addLeadingZeros_addLeadingZeros(date.getSeconds(), token.length);
},
// Fraction of second
S(date, token) {
const numberOfDigits = token.length;
const milliseconds = date.getMilliseconds();
const fractionalSeconds = Math.trunc(
milliseconds * Math.pow(10, numberOfDigits - 3),
);
return addLeadingZeros_addLeadingZeros(fractionalSeconds, token.length);
},
};
;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/format/formatters.js
const formatters_dayPeriodEnum = {
am: "am",
pm: "pm",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
};
/*
* | | Unit | | Unit |
* |-----|--------------------------------|-----|--------------------------------|
* | a | AM, PM | A* | Milliseconds in day |
* | b | AM, PM, noon, midnight | B | Flexible day period |
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
* | d | Day of month | D | Day of year |
* | e | Local day of week | E | Day of week |
* | f | | F* | Day of week in month |
* | g* | Modified Julian day | G | Era |
* | h | Hour [1-12] | H | Hour [0-23] |
* | i! | ISO day of week | I! | ISO week of year |
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
* | k | Hour [1-24] | K | Hour [0-11] |
* | l* | (deprecated) | L | Stand-alone month |
* | m | Minute | M | Month |
* | n | | N | |
* | o! | Ordinal number modifier | O | Timezone (GMT) |
* | p! | Long localized time | P! | Long localized date |
* | q | Stand-alone quarter | Q | Quarter |
* | r* | Related Gregorian year | R! | ISO week-numbering year |
* | s | Second | S | Fraction of second |
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
* | u | Extended year | U* | Cyclic year |
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
* | w | Local week of year | W* | Week of month |
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
* | y | Year (abs) | Y | Local week-numbering year |
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
*
* Letters marked by * are not implemented but reserved by Unicode standard.
*
* Letters marked by ! are non-standard, but implemented by date-fns:
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
* i.e. 7 for Sunday, 1 for Monday, etc.
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
* `R` is supposed to be used in conjunction with `I` and `i`
* for universal ISO week-numbering date, whereas
* `Y` is supposed to be used in conjunction with `w` and `e`
* for week-numbering date specific to the locale.
* - `P` is long localized date format
* - `p` is long localized time format
*/
const formatters_formatters = {
// Era
G: function (date, token, localize) {
const era = date.getFullYear() > 0 ? 1 : 0;
switch (token) {
// AD, BC
case "G":
case "GG":
case "GGG":
return localize.era(era, { width: "abbreviated" });
// A, B
case "GGGGG":
return localize.era(era, { width: "narrow" });
// Anno Domini, Before Christ
case "GGGG":
default:
return localize.era(era, { width: "wide" });
}
},
// Year
y: function (date, token, localize) {
// Ordinal number
if (token === "yo") {
const signedYear = date.getFullYear();
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const year = signedYear > 0 ? signedYear : 1 - signedYear;
return localize.ordinalNumber(year, { unit: "year" });
}
return lightFormatters_lightFormatters.y(date, token);
},
// Local week-numbering year
Y: function (date, token, localize, options) {
const signedWeekYear = getWeekYear_getWeekYear(date, options);
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
// Two digit year
if (token === "YY") {
const twoDigitYear = weekYear % 100;
return addLeadingZeros_addLeadingZeros(twoDigitYear, 2);
}
// Ordinal number
if (token === "Yo") {
return localize.ordinalNumber(weekYear, { unit: "year" });
}
// Padding
return addLeadingZeros_addLeadingZeros(weekYear, token.length);
},
// ISO week-numbering year
R: function (date, token) {
const isoWeekYear = getISOWeekYear_getISOWeekYear(date);
// Padding
return addLeadingZeros_addLeadingZeros(isoWeekYear, token.length);
},
// Extended year. This is a single number designating the year of this calendar system.
// The main difference between `y` and `u` localizers are B.C. years:
// | Year | `y` | `u` |
// |------|-----|-----|
// | AC 1 | 1 | 1 |
// | BC 1 | 1 | 0 |
// | BC 2 | 2 | -1 |
// Also `yy` always returns the last two digits of a year,
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
u: function (date, token) {
const year = date.getFullYear();
return addLeadingZeros_addLeadingZeros(year, token.length);
},
// Quarter
Q: function (date, token, localize) {
const quarter = Math.ceil((date.getMonth() + 1) / 3);
switch (token) {
// 1, 2, 3, 4
case "Q":
return String(quarter);
// 01, 02, 03, 04
case "QQ":
return addLeadingZeros_addLeadingZeros(quarter, 2);
// 1st, 2nd, 3rd, 4th
case "Qo":
return localize.ordinalNumber(quarter, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "QQQ":
return localize.quarter(quarter, {
width: "abbreviated",
context: "formatting",
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "QQQQQ":
return localize.quarter(quarter, {
width: "narrow",
context: "formatting",
});
// 1st quarter, 2nd quarter, ...
case "QQQQ":
default:
return localize.quarter(quarter, {
width: "wide",
context: "formatting",
});
}
},
// Stand-alone quarter
q: function (date, token, localize) {
const quarter = Math.ceil((date.getMonth() + 1) / 3);
switch (token) {
// 1, 2, 3, 4
case "q":
return String(quarter);
// 01, 02, 03, 04
case "qq":
return addLeadingZeros_addLeadingZeros(quarter, 2);
// 1st, 2nd, 3rd, 4th
case "qo":
return localize.ordinalNumber(quarter, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "qqq":
return localize.quarter(quarter, {
width: "abbreviated",
context: "standalone",
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "qqqqq":
return localize.quarter(quarter, {
width: "narrow",
context: "standalone",
});
// 1st quarter, 2nd quarter, ...
case "qqqq":
default:
return localize.quarter(quarter, {
width: "wide",
context: "standalone",
});
}
},
// Month
M: function (date, token, localize) {
const month = date.getMonth();
switch (token) {
case "M":
case "MM":
return lightFormatters_lightFormatters.M(date, token);
// 1st, 2nd, ..., 12th
case "Mo":
return localize.ordinalNumber(month + 1, { unit: "month" });
// Jan, Feb, ..., Dec
case "MMM":
return localize.month(month, {
width: "abbreviated",
context: "formatting",
});
// J, F, ..., D
case "MMMMM":
return localize.month(month, {
width: "narrow",
context: "formatting",
});
// January, February, ..., December
case "MMMM":
default:
return localize.month(month, { width: "wide", context: "formatting" });
}
},
// Stand-alone month
L: function (date, token, localize) {
const month = date.getMonth();
switch (token) {
// 1, 2, ..., 12
case "L":
return String(month + 1);
// 01, 02, ..., 12
case "LL":
return addLeadingZeros_addLeadingZeros(month + 1, 2);
// 1st, 2nd, ..., 12th
case "Lo":
return localize.ordinalNumber(month + 1, { unit: "month" });
// Jan, Feb, ..., Dec
case "LLL":
return localize.month(month, {
width: "abbreviated",
context: "standalone",
});
// J, F, ..., D
case "LLLLL":
return localize.month(month, {
width: "narrow",
context: "standalone",
});
// January, February, ..., December
case "LLLL":
default:
return localize.month(month, { width: "wide", context: "standalone" });
}
},
// Local week of year
w: function (date, token, localize, options) {
const week = getWeek_getWeek(date, options);
if (token === "wo") {
return localize.ordinalNumber(week, { unit: "week" });
}
return addLeadingZeros_addLeadingZeros(week, token.length);
},
// ISO week of year
I: function (date, token, localize) {
const isoWeek = getISOWeek_getISOWeek(date);
if (token === "Io") {
return localize.ordinalNumber(isoWeek, { unit: "week" });
}
return addLeadingZeros_addLeadingZeros(isoWeek, token.length);
},
// Day of the month
d: function (date, token, localize) {
if (token === "do") {
return localize.ordinalNumber(date.getDate(), { unit: "date" });
}
return lightFormatters_lightFormatters.d(date, token);
},
// Day of year
D: function (date, token, localize) {
const dayOfYear = getDayOfYear_getDayOfYear(date);
if (token === "Do") {
return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
}
return addLeadingZeros_addLeadingZeros(dayOfYear, token.length);
},
// Day of week
E: function (date, token, localize) {
const dayOfWeek = date.getDay();
switch (token) {
// Tue
case "E":
case "EE":
case "EEE":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "EEEEE":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "EEEEEE":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "EEEE":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// Local day of week
e: function (date, token, localize, options) {
const dayOfWeek = date.getDay();
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
// Numerical value (Nth day of week with current locale or weekStartsOn)
case "e":
return String(localDayOfWeek);
// Padded numerical value
case "ee":
return addLeadingZeros_addLeadingZeros(localDayOfWeek, 2);
// 1st, 2nd, ..., 7th
case "eo":
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
case "eee":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "eeeee":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "eeeeee":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "eeee":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// Stand-alone local day of week
c: function (date, token, localize, options) {
const dayOfWeek = date.getDay();
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
// Numerical value (same as in `e`)
case "c":
return String(localDayOfWeek);
// Padded numerical value
case "cc":
return addLeadingZeros_addLeadingZeros(localDayOfWeek, token.length);
// 1st, 2nd, ..., 7th
case "co":
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
case "ccc":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "standalone",
});
// T
case "ccccc":
return localize.day(dayOfWeek, {
width: "narrow",
context: "standalone",
});
// Tu
case "cccccc":
return localize.day(dayOfWeek, {
width: "short",
context: "standalone",
});
// Tuesday
case "cccc":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "standalone",
});
}
},
// ISO day of week
i: function (date, token, localize) {
const dayOfWeek = date.getDay();
const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
switch (token) {
// 2
case "i":
return String(isoDayOfWeek);
// 02
case "ii":
return addLeadingZeros_addLeadingZeros(isoDayOfWeek, token.length);
// 2nd
case "io":
return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
// Tue
case "iii":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "iiiii":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "iiiiii":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "iiii":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// AM or PM
a: function (date, token, localize) {
const hours = date.getHours();
const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
switch (token) {
case "a":
case "aa":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "aaa":
return localize
.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
})
.toLowerCase();
case "aaaaa":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "aaaa":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// AM, PM, midnight, noon
b: function (date, token, localize) {
const hours = date.getHours();
let dayPeriodEnumValue;
if (hours === 12) {
dayPeriodEnumValue = formatters_dayPeriodEnum.noon;
} else if (hours === 0) {
dayPeriodEnumValue = formatters_dayPeriodEnum.midnight;
} else {
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
}
switch (token) {
case "b":
case "bb":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "bbb":
return localize
.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
})
.toLowerCase();
case "bbbbb":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "bbbb":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// in the morning, in the afternoon, in the evening, at night
B: function (date, token, localize) {
const hours = date.getHours();
let dayPeriodEnumValue;
if (hours >= 17) {
dayPeriodEnumValue = formatters_dayPeriodEnum.evening;
} else if (hours >= 12) {
dayPeriodEnumValue = formatters_dayPeriodEnum.afternoon;
} else if (hours >= 4) {
dayPeriodEnumValue = formatters_dayPeriodEnum.morning;
} else {
dayPeriodEnumValue = formatters_dayPeriodEnum.night;
}
switch (token) {
case "B":
case "BB":
case "BBB":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "BBBBB":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "BBBB":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// Hour [1-12]
h: function (date, token, localize) {
if (token === "ho") {
let hours = date.getHours() % 12;
if (hours === 0) hours = 12;
return localize.ordinalNumber(hours, { unit: "hour" });
}
return lightFormatters_lightFormatters.h(date, token);
},
// Hour [0-23]
H: function (date, token, localize) {
if (token === "Ho") {
return localize.ordinalNumber(date.getHours(), { unit: "hour" });
}
return lightFormatters_lightFormatters.H(date, token);
},
// Hour [0-11]
K: function (date, token, localize) {
const hours = date.getHours() % 12;
if (token === "Ko") {
return localize.ordinalNumber(hours, { unit: "hour" });
}
return addLeadingZeros_addLeadingZeros(hours, token.length);
},
// Hour [1-24]
k: function (date, token, localize) {
let hours = date.getHours();
if (hours === 0) hours = 24;
if (token === "ko") {
return localize.ordinalNumber(hours, { unit: "hour" });
}
return addLeadingZeros_addLeadingZeros(hours, token.length);
},
// Minute
m: function (date, token, localize) {
if (token === "mo") {
return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
}
return lightFormatters_lightFormatters.m(date, token);
},
// Second
s: function (date, token, localize) {
if (token === "so") {
return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
}
return lightFormatters_lightFormatters.s(date, token);
},
// Fraction of second
S: function (date, token) {
return lightFormatters_lightFormatters.S(date, token);
},
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
X: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
if (timezoneOffset === 0) {
return "Z";
}
switch (token) {
// Hours and optional minutes
case "X":
return formatters_formatTimezoneWithOptionalMinutes(timezoneOffset);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XX`
case "XXXX":
case "XX": // Hours and minutes without `:` delimiter
return formatters_formatTimezone(timezoneOffset);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XXX`
case "XXXXX":
case "XXX": // Hours and minutes with `:` delimiter
default:
return formatters_formatTimezone(timezoneOffset, ":");
}
},
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
x: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Hours and optional minutes
case "x":
return formatters_formatTimezoneWithOptionalMinutes(timezoneOffset);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xx`
case "xxxx":
case "xx": // Hours and minutes without `:` delimiter
return formatters_formatTimezone(timezoneOffset);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xxx`
case "xxxxx":
case "xxx": // Hours and minutes with `:` delimiter
default:
return formatters_formatTimezone(timezoneOffset, ":");
}
},
// Timezone (GMT)
O: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Short
case "O":
case "OO":
case "OOO":
return "GMT" + formatters_formatTimezoneShort(timezoneOffset, ":");
// Long
case "OOOO":
default:
return "GMT" + formatters_formatTimezone(timezoneOffset, ":");
}
},
// Timezone (specific non-location)
z: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Short
case "z":
case "zz":
case "zzz":
return "GMT" + formatters_formatTimezoneShort(timezoneOffset, ":");
// Long
case "zzzz":
default:
return "GMT" + formatters_formatTimezone(timezoneOffset, ":");
}
},
// Seconds timestamp
t: function (date, token, _localize) {
const timestamp = Math.trunc(+date / 1000);
return addLeadingZeros_addLeadingZeros(timestamp, token.length);
},
// Milliseconds timestamp
T: function (date, token, _localize) {
return addLeadingZeros_addLeadingZeros(+date, token.length);
},
};
function formatters_formatTimezoneShort(offset, delimiter = "") {
const sign = offset > 0 ? "-" : "+";
const absOffset = Math.abs(offset);
const hours = Math.trunc(absOffset / 60);
const minutes = absOffset % 60;
if (minutes === 0) {
return sign + String(hours);
}
return sign + String(hours) + delimiter + addLeadingZeros_addLeadingZeros(minutes, 2);
}
function formatters_formatTimezoneWithOptionalMinutes(offset, delimiter) {
if (offset % 60 === 0) {
const sign = offset > 0 ? "-" : "+";
return sign + addLeadingZeros_addLeadingZeros(Math.abs(offset) / 60, 2);
}
return formatters_formatTimezone(offset, delimiter);
}
function formatters_formatTimezone(offset, delimiter = "") {
const sign = offset > 0 ? "-" : "+";
const absOffset = Math.abs(offset);
const hours = addLeadingZeros_addLeadingZeros(Math.trunc(absOffset / 60), 2);
const minutes = addLeadingZeros_addLeadingZeros(absOffset % 60, 2);
return sign + hours + delimiter + minutes;
}
;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/format/longFormatters.js
const longFormatters_dateLongFormatter = (pattern, formatLong) => {
switch (pattern) {
case "P":
return formatLong.date({ width: "short" });
case "PP":
return formatLong.date({ width: "medium" });
case "PPP":
return formatLong.date({ width: "long" });
case "PPPP":
default:
return formatLong.date({ width: "full" });
}
};
const longFormatters_timeLongFormatter = (pattern, formatLong) => {
switch (pattern) {
case "p":
return formatLong.time({ width: "short" });
case "pp":
return formatLong.time({ width: "medium" });
case "ppp":
return formatLong.time({ width: "long" });
case "pppp":
default:
return formatLong.time({ width: "full" });
}
};
const longFormatters_dateTimeLongFormatter = (pattern, formatLong) => {
const matchResult = pattern.match(/(P+)(p+)?/) || [];
const datePattern = matchResult[1];
const timePattern = matchResult[2];
if (!timePattern) {
return longFormatters_dateLongFormatter(pattern, formatLong);
}
let dateTimeFormat;
switch (datePattern) {
case "P":
dateTimeFormat = formatLong.dateTime({ width: "short" });
break;
case "PP":
dateTimeFormat = formatLong.dateTime({ width: "medium" });
break;
case "PPP":
dateTimeFormat = formatLong.dateTime({ width: "long" });
break;
case "PPPP":
default:
dateTimeFormat = formatLong.dateTime({ width: "full" });
break;
}
return dateTimeFormat
.replace("{{date}}", longFormatters_dateLongFormatter(datePattern, formatLong))
.replace("{{time}}", longFormatters_timeLongFormatter(timePattern, formatLong));
};
const longFormatters_longFormatters = {
p: longFormatters_timeLongFormatter,
P: longFormatters_dateTimeLongFormatter,
};
;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/protectedTokens.js
const protectedTokens_dayOfYearTokenRE = /^D+$/;
const protectedTokens_weekYearTokenRE = /^Y+$/;
const protectedTokens_throwTokens = ["D", "DD", "YY", "YYYY"];
function protectedTokens_isProtectedDayOfYearToken(token) {
return protectedTokens_dayOfYearTokenRE.test(token);
}
function protectedTokens_isProtectedWeekYearToken(token) {
return protectedTokens_weekYearTokenRE.test(token);
}
function protectedTokens_warnOrThrowProtectedError(token, format, input) {
const _message = protectedTokens_message(token, format, input);
console.warn(_message);
if (protectedTokens_throwTokens.includes(token)) throw new RangeError(_message);
}
function protectedTokens_message(token, format, input) {
const subject = token[0] === "Y" ? "years" : "days of the month";
return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
}
;// ./node_modules/react-day-picker/node_modules/date-fns/isDate.js
/**
* @name isDate
* @category Common Helpers
* @summary Is the given value a date?
*
* @description
* Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
*
* @param value - The value to check
*
* @returns True if the given value is a date
*
* @example
* // For a valid date:
* const result = isDate(new Date())
* //=> true
*
* @example
* // For an invalid date:
* const result = isDate(new Date(NaN))
* //=> true
*
* @example
* // For some value:
* const result = isDate('2014-02-31')
* //=> false
*
* @example
* // For an object:
* const result = isDate({})
* //=> false
*/
function isDate_isDate(value) {
return (
value instanceof Date ||
(typeof value === "object" &&
Object.prototype.toString.call(value) === "[object Date]")
);
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_isDate = ((/* unused pure expression or super */ null && (isDate_isDate)));
;// ./node_modules/react-day-picker/node_modules/date-fns/isValid.js
/**
* @name isValid
* @category Common Helpers
* @summary Is the given date valid?
*
* @description
* Returns false if argument is Invalid Date and true otherwise.
* Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
* Invalid Date is a Date, whose time value is NaN.
*
* Time value of Date: http://es5.github.io/#x15.9.1.1
*
* @param date - The date to check
*
* @returns The date is valid
*
* @example
* // For the valid date:
* const result = isValid(new Date(2014, 1, 31))
* //=> true
*
* @example
* // For the value, convertible into a date:
* const result = isValid(1393804800000)
* //=> true
*
* @example
* // For the invalid date:
* const result = isValid(new Date(''))
* //=> false
*/
function isValid_isValid(date) {
return !((!isDate_isDate(date) && typeof date !== "number") || isNaN(+toDate_toDate(date)));
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_isValid = ((/* unused pure expression or super */ null && (isValid_isValid)));
;// ./node_modules/react-day-picker/node_modules/date-fns/format.js
// Rexports of internal for libraries to use.
// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874
// This RegExp consists of three parts separated by `|`:
// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
// (one of the certain letters followed by `o`)
// - (\w)\1* matches any sequences of the same letter
// - '' matches two quote characters in a row
// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
// except a single quote symbol, which ends the sequence.
// Two quote characters do not end the sequence.
// If there is no matching single quote
// then the sequence will continue until the end of the string.
// - . matches any single character unmatched by previous parts of the RegExps
const format_formattingTokensRegExp =
/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
// This RegExp catches symbols escaped by quotes, and also
// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
const format_longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
const format_escapedStringRegExp = /^'([^]*?)'?$/;
const format_doubleQuoteRegExp = /''/g;
const format_unescapedLatinCharacterRegExp = /[a-zA-Z]/;
/**
* The {@link format} function options.
*/
/**
* @name format
* @alias formatDate
* @category Common Helpers
* @summary Format the date.
*
* @description
* Return the formatted date string in the given format. The result may vary by locale.
*
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
* > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* The characters wrapped between two single quotes characters (') are escaped.
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
* (see the last example)
*
* Format of the string is based on Unicode Technical Standard #35:
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
* with a few additions (see note 7 below the table).
*
* Accepted patterns:
* | Unit | Pattern | Result examples | Notes |
* |---------------------------------|---------|-----------------------------------|-------|
* | Era | G..GGG | AD, BC | |
* | | GGGG | Anno Domini, Before Christ | 2 |
* | | GGGGG | A, B | |
* | Calendar year | y | 44, 1, 1900, 2017 | 5 |
* | | yo | 44th, 1st, 0th, 17th | 5,7 |
* | | yy | 44, 01, 00, 17 | 5 |
* | | yyy | 044, 001, 1900, 2017 | 5 |
* | | yyyy | 0044, 0001, 1900, 2017 | 5 |
* | | yyyyy | ... | 3,5 |
* | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
* | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
* | | YY | 44, 01, 00, 17 | 5,8 |
* | | YYY | 044, 001, 1900, 2017 | 5 |
* | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
* | | YYYYY | ... | 3,5 |
* | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
* | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
* | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
* | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
* | | RRRRR | ... | 3,5,7 |
* | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
* | | uu | -43, 01, 1900, 2017 | 5 |
* | | uuu | -043, 001, 1900, 2017 | 5 |
* | | uuuu | -0043, 0001, 1900, 2017 | 5 |
* | | uuuuu | ... | 3,5 |
* | Quarter (formatting) | Q | 1, 2, 3, 4 | |
* | | Qo | 1st, 2nd, 3rd, 4th | 7 |
* | | QQ | 01, 02, 03, 04 | |
* | | QQQ | Q1, Q2, Q3, Q4 | |
* | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
* | | QQQQQ | 1, 2, 3, 4 | 4 |
* | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
* | | qo | 1st, 2nd, 3rd, 4th | 7 |
* | | qq | 01, 02, 03, 04 | |
* | | qqq | Q1, Q2, Q3, Q4 | |
* | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
* | | qqqqq | 1, 2, 3, 4 | 4 |
* | Month (formatting) | M | 1, 2, ..., 12 | |
* | | Mo | 1st, 2nd, ..., 12th | 7 |
* | | MM | 01, 02, ..., 12 | |
* | | MMM | Jan, Feb, ..., Dec | |
* | | MMMM | January, February, ..., December | 2 |
* | | MMMMM | J, F, ..., D | |
* | Month (stand-alone) | L | 1, 2, ..., 12 | |
* | | Lo | 1st, 2nd, ..., 12th | 7 |
* | | LL | 01, 02, ..., 12 | |
* | | LLL | Jan, Feb, ..., Dec | |
* | | LLLL | January, February, ..., December | 2 |
* | | LLLLL | J, F, ..., D | |
* | Local week of year | w | 1, 2, ..., 53 | |
* | | wo | 1st, 2nd, ..., 53th | 7 |
* | | ww | 01, 02, ..., 53 | |
* | ISO week of year | I | 1, 2, ..., 53 | 7 |
* | | Io | 1st, 2nd, ..., 53th | 7 |
* | | II | 01, 02, ..., 53 | 7 |
* | Day of month | d | 1, 2, ..., 31 | |
* | | do | 1st, 2nd, ..., 31st | 7 |
* | | dd | 01, 02, ..., 31 | |
* | Day of year | D | 1, 2, ..., 365, 366 | 9 |
* | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
* | | DD | 01, 02, ..., 365, 366 | 9 |
* | | DDD | 001, 002, ..., 365, 366 | |
* | | DDDD | ... | 3 |
* | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
* | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
* | | EEEEE | M, T, W, T, F, S, S | |
* | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
* | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
* | | io | 1st, 2nd, ..., 7th | 7 |
* | | ii | 01, 02, ..., 07 | 7 |
* | | iii | Mon, Tue, Wed, ..., Sun | 7 |
* | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
* | | iiiii | M, T, W, T, F, S, S | 7 |
* | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
* | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
* | | eo | 2nd, 3rd, ..., 1st | 7 |
* | | ee | 02, 03, ..., 01 | |
* | | eee | Mon, Tue, Wed, ..., Sun | |
* | | eeee | Monday, Tuesday, ..., Sunday | 2 |
* | | eeeee | M, T, W, T, F, S, S | |
* | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
* | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
* | | co | 2nd, 3rd, ..., 1st | 7 |
* | | cc | 02, 03, ..., 01 | |
* | | ccc | Mon, Tue, Wed, ..., Sun | |
* | | cccc | Monday, Tuesday, ..., Sunday | 2 |
* | | ccccc | M, T, W, T, F, S, S | |
* | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
* | AM, PM | a..aa | AM, PM | |
* | | aaa | am, pm | |
* | | aaaa | a.m., p.m. | 2 |
* | | aaaaa | a, p | |
* | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
* | | bbb | am, pm, noon, midnight | |
* | | bbbb | a.m., p.m., noon, midnight | 2 |
* | | bbbbb | a, p, n, mi | |
* | Flexible day period | B..BBB | at night, in the morning, ... | |
* | | BBBB | at night, in the morning, ... | 2 |
* | | BBBBB | at night, in the morning, ... | |
* | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
* | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
* | | hh | 01, 02, ..., 11, 12 | |
* | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
* | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
* | | HH | 00, 01, 02, ..., 23 | |
* | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
* | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
* | | KK | 01, 02, ..., 11, 00 | |
* | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
* | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
* | | kk | 24, 01, 02, ..., 23 | |
* | Minute | m | 0, 1, ..., 59 | |
* | | mo | 0th, 1st, ..., 59th | 7 |
* | | mm | 00, 01, ..., 59 | |
* | Second | s | 0, 1, ..., 59 | |
* | | so | 0th, 1st, ..., 59th | 7 |
* | | ss | 00, 01, ..., 59 | |
* | Fraction of second | S | 0, 1, ..., 9 | |
* | | SS | 00, 01, ..., 99 | |
* | | SSS | 000, 001, ..., 999 | |
* | | SSSS | ... | 3 |
* | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
* | | XX | -0800, +0530, Z | |
* | | XXX | -08:00, +05:30, Z | |
* | | XXXX | -0800, +0530, Z, +123456 | 2 |
* | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
* | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
* | | xx | -0800, +0530, +0000 | |
* | | xxx | -08:00, +05:30, +00:00 | 2 |
* | | xxxx | -0800, +0530, +0000, +123456 | |
* | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
* | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
* | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
* | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
* | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
* | Seconds timestamp | t | 512969520 | 7 |
* | | tt | ... | 3,7 |
* | Milliseconds timestamp | T | 512969520900 | 7 |
* | | TT | ... | 3,7 |
* | Long localized date | P | 04/29/1453 | 7 |
* | | PP | Apr 29, 1453 | 7 |
* | | PPP | April 29th, 1453 | 7 |
* | | PPPP | Friday, April 29th, 1453 | 2,7 |
* | Long localized time | p | 12:00 AM | 7 |
* | | pp | 12:00:00 AM | 7 |
* | | ppp | 12:00:00 AM GMT+2 | 7 |
* | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
* | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
* | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
* | | PPPppp | April 29th, 1453 at ... | 7 |
* | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
* Notes:
* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
* are the same as "stand-alone" units, but are different in some languages.
* "Formatting" units are declined according to the rules of the language
* in the context of a date. "Stand-alone" units are always nominative singular:
*
* `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
*
* `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
*
* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
* the single quote characters (see below).
* If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
* the output will be the same as default pattern for this unit, usually
* the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
* are marked with "2" in the last column of the table.
*
* `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
*
* `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
*
* `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
*
* `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
*
* `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
*
* 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
* The output will be padded with zeros to match the length of the pattern.
*
* `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
*
* 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
* These tokens represent the shortest form of the quarter.
*
* 5. The main difference between `y` and `u` patterns are B.C. years:
*
* | Year | `y` | `u` |
* |------|-----|-----|
* | AC 1 | 1 | 1 |
* | BC 1 | 1 | 0 |
* | BC 2 | 2 | -1 |
*
* Also `yy` always returns the last two digits of a year,
* while `uu` pads single digit years to 2 characters and returns other years unchanged:
*
* | Year | `yy` | `uu` |
* |------|------|------|
* | 1 | 01 | 01 |
* | 14 | 14 | 14 |
* | 376 | 76 | 376 |
* | 1453 | 53 | 1453 |
*
* The same difference is true for local and ISO week-numbering years (`Y` and `R`),
* except local week-numbering years are dependent on `options.weekStartsOn`
* and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
* and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
*
* 6. Specific non-location timezones are currently unavailable in `date-fns`,
* so right now these tokens fall back to GMT timezones.
*
* 7. These patterns are not in the Unicode Technical Standard #35:
* - `i`: ISO day of week
* - `I`: ISO week of year
* - `R`: ISO week-numbering year
* - `t`: seconds timestamp
* - `T`: milliseconds timestamp
* - `o`: ordinal number modifier
* - `P`: long localized date
* - `p`: long localized time
*
* 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* @param date - The original date
* @param format - The string of tokens
* @param options - An object with options
*
* @returns The formatted date string
*
* @throws `date` must not be Invalid Date
* @throws `options.locale` must contain `localize` property
* @throws `options.locale` must contain `formatLong` property
* @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws format string contains an unescaped latin alphabet character
*
* @example
* // Represent 11 February 2014 in middle-endian format:
* const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
* //=> '02/11/2014'
*
* @example
* // Represent 2 July 2014 in Esperanto:
* import { eoLocale } from 'date-fns/locale/eo'
* const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
* locale: eoLocale
* })
* //=> '2-a de julio 2014'
*
* @example
* // Escape string by single quote characters:
* const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
* //=> "3 o'clock"
*/
function format_format(date, formatStr, options) {
const defaultOptions = defaultOptions_getDefaultOptions();
const locale = options?.locale ?? defaultOptions.locale ?? en_US_enUS;
const firstWeekContainsDate =
options?.firstWeekContainsDate ??
options?.locale?.options?.firstWeekContainsDate ??
defaultOptions.firstWeekContainsDate ??
defaultOptions.locale?.options?.firstWeekContainsDate ??
1;
const weekStartsOn =
options?.weekStartsOn ??
options?.locale?.options?.weekStartsOn ??
defaultOptions.weekStartsOn ??
defaultOptions.locale?.options?.weekStartsOn ??
0;
const originalDate = toDate_toDate(date, options?.in);
if (!isValid_isValid(originalDate)) {
throw new RangeError("Invalid time value");
}
let parts = formatStr
.match(format_longFormattingTokensRegExp)
.map((substring) => {
const firstCharacter = substring[0];
if (firstCharacter === "p" || firstCharacter === "P") {
const longFormatter = longFormatters_longFormatters[firstCharacter];
return longFormatter(substring, locale.formatLong);
}
return substring;
})
.join("")
.match(format_formattingTokensRegExp)
.map((substring) => {
// Replace two single quote characters with one single quote character
if (substring === "''") {
return { isToken: false, value: "'" };
}
const firstCharacter = substring[0];
if (firstCharacter === "'") {
return { isToken: false, value: format_cleanEscapedString(substring) };
}
if (formatters_formatters[firstCharacter]) {
return { isToken: true, value: substring };
}
if (firstCharacter.match(format_unescapedLatinCharacterRegExp)) {
throw new RangeError(
"Format string contains an unescaped latin alphabet character `" +
firstCharacter +
"`",
);
}
return { isToken: false, value: substring };
});
// invoke localize preprocessor (only for french locales at the moment)
if (locale.localize.preprocessor) {
parts = locale.localize.preprocessor(originalDate, parts);
}
const formatterOptions = {
firstWeekContainsDate,
weekStartsOn,
locale,
};
return parts
.map((part) => {
if (!part.isToken) return part.value;
const token = part.value;
if (
(!options?.useAdditionalWeekYearTokens &&
protectedTokens_isProtectedWeekYearToken(token)) ||
(!options?.useAdditionalDayOfYearTokens &&
protectedTokens_isProtectedDayOfYearToken(token))
) {
protectedTokens_warnOrThrowProtectedError(token, formatStr, String(date));
}
const formatter = formatters_formatters[token[0]];
return formatter(originalDate, token, locale.localize, formatterOptions);
})
.join("");
}
function format_cleanEscapedString(input) {
const matched = input.match(format_escapedStringRegExp);
if (!matched) {
return input;
}
return matched[1].replace(format_doubleQuoteRegExp, "'");
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_format = ((/* unused pure expression or super */ null && (format_format)));
;// ./node_modules/react-day-picker/node_modules/date-fns/getMonth.js
/**
* The {@link getMonth} function options.
*/
/**
* @name getMonth
* @category Month Helpers
* @summary Get the month of the given date.
*
* @description
* Get the month of the given date.
*
* @param date - The given date
* @param options - An object with options
*
* @returns The month index (0-11)
*
* @example
* // Which month is 29 February 2012?
* const result = getMonth(new Date(2012, 1, 29))
* //=> 1
*/
function getMonth(date, options) {
return toDate_toDate(date, options?.in).getMonth();
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_getMonth = ((/* unused pure expression or super */ null && (getMonth)));
;// ./node_modules/react-day-picker/node_modules/date-fns/getYear.js
/**
* The {@link getYear} function options.
*/
/**
* @name getYear
* @category Year Helpers
* @summary Get the year of the given date.
*
* @description
* Get the year of the given date.
*
* @param date - The given date
* @param options - An object with options
*
* @returns The year
*
* @example
* // Which year is 2 July 2014?
* const result = getYear(new Date(2014, 6, 2))
* //=> 2014
*/
function getYear(date, options) {
return toDate_toDate(date, options?.in).getFullYear();
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_getYear = ((/* unused pure expression or super */ null && (getYear)));
;// ./node_modules/react-day-picker/node_modules/date-fns/isAfter.js
/**
* @name isAfter
* @category Common Helpers
* @summary Is the first date after the second one?
*
* @description
* Is the first date after the second one?
*
* @param date - The date that should be after the other one to return true
* @param dateToCompare - The date to compare with
*
* @returns The first date is after the second date
*
* @example
* // Is 10 July 1989 after 11 February 1987?
* const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
* //=> true
*/
function isAfter_isAfter(date, dateToCompare) {
return +toDate_toDate(date) > +toDate_toDate(dateToCompare);
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_isAfter = ((/* unused pure expression or super */ null && (isAfter_isAfter)));
;// ./node_modules/react-day-picker/node_modules/date-fns/isBefore.js
/**
* @name isBefore
* @category Common Helpers
* @summary Is the first date before the second one?
*
* @description
* Is the first date before the second one?
*
* @param date - The date that should be before the other one to return true
* @param dateToCompare - The date to compare with
*
* @returns The first date is before the second date
*
* @example
* // Is 10 July 1989 before 11 February 1987?
* const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
* //=> false
*/
function isBefore_isBefore(date, dateToCompare) {
return +toDate_toDate(date) < +toDate_toDate(dateToCompare);
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_isBefore = ((/* unused pure expression or super */ null && (isBefore_isBefore)));
;// ./node_modules/react-day-picker/node_modules/date-fns/isSameDay.js
/**
* The {@link isSameDay} function options.
*/
/**
* @name isSameDay
* @category Day Helpers
* @summary Are the given dates in the same day (and year and month)?
*
* @description
* Are the given dates in the same day (and year and month)?
*
* @param laterDate - The first date to check
* @param earlierDate - The second date to check
* @param options - An object with options
*
* @returns The dates are in the same day (and year and month)
*
* @example
* // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
* const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
* //=> true
*
* @example
* // Are 4 September and 4 October in the same day?
* const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
* //=> false
*
* @example
* // Are 4 September, 2014 and 4 September, 2015 in the same day?
* const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
* //=> false
*/
function isSameDay_isSameDay(laterDate, earlierDate, options) {
const [dateLeft_, dateRight_] = normalizeDates(
options?.in,
laterDate,
earlierDate,
);
return +startOfDay_startOfDay(dateLeft_) === +startOfDay_startOfDay(dateRight_);
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_isSameDay = ((/* unused pure expression or super */ null && (isSameDay_isSameDay)));
;// ./node_modules/react-day-picker/node_modules/date-fns/isSameMonth.js
/**
* The {@link isSameMonth} function options.
*/
/**
* @name isSameMonth
* @category Month Helpers
* @summary Are the given dates in the same month (and year)?
*
* @description
* Are the given dates in the same month (and year)?
*
* @param laterDate - The first date to check
* @param earlierDate - The second date to check
* @param options - An object with options
*
* @returns The dates are in the same month (and year)
*
* @example
* // Are 2 September 2014 and 25 September 2014 in the same month?
* const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))
* //=> true
*
* @example
* // Are 2 September 2014 and 25 September 2015 in the same month?
* const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))
* //=> false
*/
function isSameMonth_isSameMonth(laterDate, earlierDate, options) {
const [laterDate_, earlierDate_] = normalizeDates(
options?.in,
laterDate,
earlierDate,
);
return (
laterDate_.getFullYear() === earlierDate_.getFullYear() &&
laterDate_.getMonth() === earlierDate_.getMonth()
);
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_isSameMonth = ((/* unused pure expression or super */ null && (isSameMonth_isSameMonth)));
;// ./node_modules/react-day-picker/node_modules/date-fns/isSameYear.js
/**
* The {@link isSameYear} function options.
*/
/**
* @name isSameYear
* @category Year Helpers
* @summary Are the given dates in the same year?
*
* @description
* Are the given dates in the same year?
*
* @param laterDate - The first date to check
* @param earlierDate - The second date to check
* @param options - An object with options
*
* @returns The dates are in the same year
*
* @example
* // Are 2 September 2014 and 25 September 2014 in the same year?
* const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))
* //=> true
*/
function isSameYear(laterDate, earlierDate, options) {
const [laterDate_, earlierDate_] = normalizeDates(
options?.in,
laterDate,
earlierDate,
);
return laterDate_.getFullYear() === earlierDate_.getFullYear();
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_isSameYear = ((/* unused pure expression or super */ null && (isSameYear)));
;// ./node_modules/react-day-picker/node_modules/date-fns/max.js
/**
* The {@link max} function options.
*/
/**
* @name max
* @category Common Helpers
* @summary Return the latest of the given dates.
*
* @description
* Return the latest of the given dates.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param dates - The dates to compare
*
* @returns The latest of the dates
*
* @example
* // Which of these dates is the latest?
* const result = max([
* new Date(1989, 6, 10),
* new Date(1987, 1, 11),
* new Date(1995, 6, 2),
* new Date(1990, 0, 1)
* ])
* //=> Sun Jul 02 1995 00:00:00
*/
function max_max(dates, options) {
let result;
let context = options?.in;
dates.forEach((date) => {
// Use the first date object as the context function
if (!context && typeof date === "object")
context = constructFrom_constructFrom.bind(null, date);
const date_ = toDate_toDate(date, context);
if (!result || result < date_ || isNaN(+date_)) result = date_;
});
return constructFrom_constructFrom(context, result || NaN);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_max = ((/* unused pure expression or super */ null && (max_max)));
;// ./node_modules/react-day-picker/node_modules/date-fns/min.js
/**
* The {@link min} function options.
*/
/**
* @name min
* @category Common Helpers
* @summary Returns the earliest of the given dates.
*
* @description
* Returns the earliest of the given dates.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param dates - The dates to compare
*
* @returns The earliest of the dates
*
* @example
* // Which of these dates is the earliest?
* const result = min([
* new Date(1989, 6, 10),
* new Date(1987, 1, 11),
* new Date(1995, 6, 2),
* new Date(1990, 0, 1)
* ])
* //=> Wed Feb 11 1987 00:00:00
*/
function min_min(dates, options) {
let result;
let context = options?.in;
dates.forEach((date) => {
// Use the first date object as the context function
if (!context && typeof date === "object")
context = constructFrom_constructFrom.bind(null, date);
const date_ = toDate_toDate(date, context);
if (!result || result > date_ || isNaN(+date_)) result = date_;
});
return constructFrom_constructFrom(context, result || NaN);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_min = ((/* unused pure expression or super */ null && (min_min)));
;// ./node_modules/react-day-picker/node_modules/date-fns/getDaysInMonth.js
/**
* The {@link getDaysInMonth} function options.
*/
/**
* @name getDaysInMonth
* @category Month Helpers
* @summary Get the number of days in a month of the given date.
*
* @description
* Get the number of days in a month of the given date, considering the context if provided.
*
* @param date - The given date
* @param options - An object with options
*
* @returns The number of days in a month
*
* @example
* // How many days are in February 2000?
* const result = getDaysInMonth(new Date(2000, 1))
* //=> 29
*/
function getDaysInMonth_getDaysInMonth(date, options) {
const _date = toDate_toDate(date, options?.in);
const year = _date.getFullYear();
const monthIndex = _date.getMonth();
const lastDayOfMonth = constructFrom_constructFrom(_date, 0);
lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);
lastDayOfMonth.setHours(0, 0, 0, 0);
return lastDayOfMonth.getDate();
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_getDaysInMonth = ((/* unused pure expression or super */ null && (getDaysInMonth_getDaysInMonth)));
;// ./node_modules/react-day-picker/node_modules/date-fns/setMonth.js
/**
* The {@link setMonth} function options.
*/
/**
* @name setMonth
* @category Month Helpers
* @summary Set the month to the given date.
*
* @description
* Set the month to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param month - The month index to set (0-11)
* @param options - The options
*
* @returns The new date with the month set
*
* @example
* // Set February to 1 September 2014:
* const result = setMonth(new Date(2014, 8, 1), 1)
* //=> Sat Feb 01 2014 00:00:00
*/
function setMonth_setMonth(date, month, options) {
const _date = toDate_toDate(date, options?.in);
const year = _date.getFullYear();
const day = _date.getDate();
const midMonth = constructFrom_constructFrom(options?.in || date, 0);
midMonth.setFullYear(year, month, 15);
midMonth.setHours(0, 0, 0, 0);
const daysInMonth = getDaysInMonth_getDaysInMonth(midMonth);
// Set the earlier date, allows to wrap Jan 31 to Feb 28
_date.setMonth(month, Math.min(day, daysInMonth));
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_setMonth = ((/* unused pure expression or super */ null && (setMonth_setMonth)));
;// ./node_modules/react-day-picker/node_modules/date-fns/setYear.js
/**
* The {@link setYear} function options.
*/
/**
* @name setYear
* @category Year Helpers
* @summary Set the year to the given date.
*
* @description
* Set the year to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param year - The year of the new date
* @param options - An object with options.
*
* @returns The new date with the year set
*
* @example
* // Set year 2013 to 1 September 2014:
* const result = setYear(new Date(2014, 8, 1), 2013)
* //=> Sun Sep 01 2013 00:00:00
*/
function setYear_setYear(date, year, options) {
const date_ = toDate_toDate(date, options?.in);
// Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
if (isNaN(+date_)) return constructFrom_constructFrom(options?.in || date, NaN);
date_.setFullYear(year);
return date_;
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_setYear = ((/* unused pure expression or super */ null && (setYear_setYear)));
;// ./node_modules/react-day-picker/node_modules/date-fns/startOfMonth.js
/**
* The {@link startOfMonth} function options.
*/
/**
* @name startOfMonth
* @category Month Helpers
* @summary Return the start of a month for the given date.
*
* @description
* Return the start of a month for the given date. The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments.
* Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed,
* or inferred from the arguments.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The start of a month
*
* @example
* // The start of a month for 2 September 2014 11:55:00:
* const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
* //=> Mon Sep 01 2014 00:00:00
*/
function startOfMonth_startOfMonth(date, options) {
const _date = toDate_toDate(date, options?.in);
_date.setDate(1);
_date.setHours(0, 0, 0, 0);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const node_modules_date_fns_startOfMonth = ((/* unused pure expression or super */ null && (startOfMonth_startOfMonth)));
;// ./node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js
const FIVE_WEEKS = 5;
const FOUR_WEEKS = 4;
/**
* Returns the number of weeks to display in the broadcast calendar for a given
* month.
*
* The broadcast calendar may have either 4 or 5 weeks in a month, depending on
* the start and end dates of the broadcast weeks.
*
* @since 9.4.0
* @param month The month for which to calculate the number of weeks.
* @param dateLib The date library to use for date manipulation.
* @returns The number of weeks in the broadcast calendar (4 or 5).
*/
function getBroadcastWeeksInMonth(month, dateLib) {
// Get the first day of the month
const firstDayOfMonth = dateLib.startOfMonth(month);
// Get the day of the week for the first day of the month (1-7, where 1 is Monday)
const firstDayOfWeek = firstDayOfMonth.getDay() > 0 ? firstDayOfMonth.getDay() : 7;
const broadcastStartDate = dateLib.addDays(month, -firstDayOfWeek + 1);
const lastDateOfLastWeek = dateLib.addDays(broadcastStartDate, FIVE_WEEKS * 7 - 1);
const numberOfWeeks = dateLib.getMonth(month) === dateLib.getMonth(lastDateOfLastWeek)
? FIVE_WEEKS
: FOUR_WEEKS;
return numberOfWeeks;
}
;// ./node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js
/**
* Returns the start date of the week in the broadcast calendar.
*
* The broadcast week starts on Monday. If the first day of the month is not a
* Monday, this function calculates the previous Monday as the start of the
* broadcast week.
*
* @since 9.4.0
* @param date The date for which to calculate the start of the broadcast week.
* @param dateLib The date library to use for date manipulation.
* @returns The start date of the broadcast week.
*/
function startOfBroadcastWeek(date, dateLib) {
const firstOfMonth = dateLib.startOfMonth(date);
const dayOfWeek = firstOfMonth.getDay();
if (dayOfWeek === 1) {
return firstOfMonth;
}
else if (dayOfWeek === 0) {
return dateLib.addDays(firstOfMonth, -1 * 6);
}
else {
return dateLib.addDays(firstOfMonth, -1 * (dayOfWeek - 1));
}
}
;// ./node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js
/**
* Returns the end date of the week in the broadcast calendar.
*
* The broadcast week ends on the last day of the last broadcast week for the
* given date.
*
* @since 9.4.0
* @param date The date for which to calculate the end of the broadcast week.
* @param dateLib The date library to use for date manipulation.
* @returns The end date of the broadcast week.
*/
function endOfBroadcastWeek(date, dateLib) {
const startDate = startOfBroadcastWeek(date, dateLib);
const numberOfWeeks = getBroadcastWeeksInMonth(date, dateLib);
const endDate = dateLib.addDays(startDate, numberOfWeeks * 7 - 1);
return endDate;
}
;// ./node_modules/react-day-picker/dist/esm/classes/DateLib.js
/**
* A wrapper class around [date-fns](http://date-fns.org) that provides utility
* methods for date manipulation and formatting.
*
* @since 9.2.0
* @example
* const dateLib = new DateLib({ locale: es });
* const newDate = dateLib.addDays(new Date(), 5);
*/
class DateLib {
/**
* Creates an instance of `DateLib`.
*
* @param options Configuration options for the date library.
* @param overrides Custom overrides for the date library functions.
*/
constructor(options, overrides) {
/**
* Reference to the built-in Date constructor.
*
* @deprecated Use `newDate()` or `today()`.
*/
this.Date = Date;
/**
* Creates a new `Date` object representing today's date.
*
* @since 9.5.0
* @returns A `Date` object for today's date.
*/
this.today = () => {
if (this.overrides?.today) {
return this.overrides.today();
}
if (this.options.timeZone) {
return date_TZDate.tz(this.options.timeZone);
}
return new this.Date();
};
/**
* Creates a new `Date` object with the specified year, month, and day.
*
* @since 9.5.0
* @param year The year.
* @param monthIndex The month (0-11).
* @param date The day of the month.
* @returns A new `Date` object.
*/
this.newDate = (year, monthIndex, date) => {
if (this.overrides?.newDate) {
return this.overrides.newDate(year, monthIndex, date);
}
if (this.options.timeZone) {
return new date_TZDate(year, monthIndex, date, this.options.timeZone);
}
return new Date(year, monthIndex, date);
};
/**
* Adds the specified number of days to the given date.
*
* @param date The date to add days to.
* @param amount The number of days to add.
* @returns The new date with the days added.
*/
this.addDays = (date, amount) => {
return this.overrides?.addDays
? this.overrides.addDays(date, amount)
: addDays_addDays(date, amount);
};
/**
* Adds the specified number of months to the given date.
*
* @param date The date to add months to.
* @param amount The number of months to add.
* @returns The new date with the months added.
*/
this.addMonths = (date, amount) => {
return this.overrides?.addMonths
? this.overrides.addMonths(date, amount)
: addMonths_addMonths(date, amount);
};
/**
* Adds the specified number of weeks to the given date.
*
* @param date The date to add weeks to.
* @param amount The number of weeks to add.
* @returns The new date with the weeks added.
*/
this.addWeeks = (date, amount) => {
return this.overrides?.addWeeks
? this.overrides.addWeeks(date, amount)
: addWeeks_addWeeks(date, amount);
};
/**
* Adds the specified number of years to the given date.
*
* @param date The date to add years to.
* @param amount The number of years to add.
* @returns The new date with the years added.
*/
this.addYears = (date, amount) => {
return this.overrides?.addYears
? this.overrides.addYears(date, amount)
: addYears_addYears(date, amount);
};
/**
* Returns the number of calendar days between the given dates.
*
* @param dateLeft The later date.
* @param dateRight The earlier date.
* @returns The number of calendar days between the dates.
*/
this.differenceInCalendarDays = (dateLeft, dateRight) => {
return this.overrides?.differenceInCalendarDays
? this.overrides.differenceInCalendarDays(dateLeft, dateRight)
: differenceInCalendarDays_differenceInCalendarDays(dateLeft, dateRight);
};
/**
* Returns the number of calendar months between the given dates.
*
* @param dateLeft The later date.
* @param dateRight The earlier date.
* @returns The number of calendar months between the dates.
*/
this.differenceInCalendarMonths = (dateLeft, dateRight) => {
return this.overrides?.differenceInCalendarMonths
? this.overrides.differenceInCalendarMonths(dateLeft, dateRight)
: differenceInCalendarMonths(dateLeft, dateRight);
};
/**
* Returns the months between the given dates.
*
* @param interval The interval to get the months for.
*/
this.eachMonthOfInterval = (interval) => {
return this.overrides?.eachMonthOfInterval
? this.overrides.eachMonthOfInterval(interval)
: eachMonthOfInterval_eachMonthOfInterval(interval);
};
/**
* Returns the years between the given dates.
*
* @since 9.11.1
* @param interval The interval to get the years for.
* @returns The array of years in the interval.
*/
this.eachYearOfInterval = (interval) => {
const years = this.overrides?.eachYearOfInterval
? this.overrides.eachYearOfInterval(interval)
: eachYearOfInterval(interval);
// Remove duplicates that may happen across DST transitions (e.g., "America/Sao_Paulo")
// See https://github.com/date-fns/tz/issues/72
const uniqueYears = new Set(years.map((d) => this.getYear(d)));
if (uniqueYears.size === years.length) {
// No duplicates, return as is
return years;
}
// Rebuild the array to ensure one date per year
const yearsArray = [];
uniqueYears.forEach((y) => {
yearsArray.push(new Date(y, 0, 1));
});
return yearsArray;
};
/**
* Returns the end of the broadcast week for the given date.
*
* @param date The original date.
* @returns The end of the broadcast week.
*/
this.endOfBroadcastWeek = (date) => {
return this.overrides?.endOfBroadcastWeek
? this.overrides.endOfBroadcastWeek(date)
: endOfBroadcastWeek(date, this);
};
/**
* Returns the end of the ISO week for the given date.
*
* @param date The original date.
* @returns The end of the ISO week.
*/
this.endOfISOWeek = (date) => {
return this.overrides?.endOfISOWeek
? this.overrides.endOfISOWeek(date)
: endOfISOWeek(date);
};
/**
* Returns the end of the month for the given date.
*
* @param date The original date.
* @returns The end of the month.
*/
this.endOfMonth = (date) => {
return this.overrides?.endOfMonth
? this.overrides.endOfMonth(date)
: endOfMonth_endOfMonth(date);
};
/**
* Returns the end of the week for the given date.
*
* @param date The original date.
* @returns The end of the week.
*/
this.endOfWeek = (date, options) => {
return this.overrides?.endOfWeek
? this.overrides.endOfWeek(date, options)
: endOfWeek_endOfWeek(date, this.options);
};
/**
* Returns the end of the year for the given date.
*
* @param date The original date.
* @returns The end of the year.
*/
this.endOfYear = (date) => {
return this.overrides?.endOfYear
? this.overrides.endOfYear(date)
: endOfYear(date);
};
/**
* Formats the given date using the specified format string.
*
* @param date The date to format.
* @param formatStr The format string.
* @returns The formatted date string.
*/
this.format = (date, formatStr, _options) => {
const formatted = this.overrides?.format
? this.overrides.format(date, formatStr, this.options)
: format_format(date, formatStr, this.options);
if (this.options.numerals && this.options.numerals !== "latn") {
return this.replaceDigits(formatted);
}
return formatted;
};
/**
* Returns the ISO week number for the given date.
*
* @param date The date to get the ISO week number for.
* @returns The ISO week number.
*/
this.getISOWeek = (date) => {
return this.overrides?.getISOWeek
? this.overrides.getISOWeek(date)
: getISOWeek_getISOWeek(date);
};
/**
* Returns the month of the given date.
*
* @param date The date to get the month for.
* @returns The month.
*/
this.getMonth = (date, _options) => {
return this.overrides?.getMonth
? this.overrides.getMonth(date, this.options)
: getMonth(date, this.options);
};
/**
* Returns the year of the given date.
*
* @param date The date to get the year for.
* @returns The year.
*/
this.getYear = (date, _options) => {
return this.overrides?.getYear
? this.overrides.getYear(date, this.options)
: getYear(date, this.options);
};
/**
* Returns the local week number for the given date.
*
* @param date The date to get the week number for.
* @returns The week number.
*/
this.getWeek = (date, _options) => {
return this.overrides?.getWeek
? this.overrides.getWeek(date, this.options)
: getWeek_getWeek(date, this.options);
};
/**
* Checks if the first date is after the second date.
*
* @param date The date to compare.
* @param dateToCompare The date to compare with.
* @returns True if the first date is after the second date.
*/
this.isAfter = (date, dateToCompare) => {
return this.overrides?.isAfter
? this.overrides.isAfter(date, dateToCompare)
: isAfter_isAfter(date, dateToCompare);
};
/**
* Checks if the first date is before the second date.
*
* @param date The date to compare.
* @param dateToCompare The date to compare with.
* @returns True if the first date is before the second date.
*/
this.isBefore = (date, dateToCompare) => {
return this.overrides?.isBefore
? this.overrides.isBefore(date, dateToCompare)
: isBefore_isBefore(date, dateToCompare);
};
/**
* Checks if the given value is a Date object.
*
* @param value The value to check.
* @returns True if the value is a Date object.
*/
this.isDate = (value) => {
return this.overrides?.isDate
? this.overrides.isDate(value)
: isDate_isDate(value);
};
/**
* Checks if the given dates are on the same day.
*
* @param dateLeft The first date to compare.
* @param dateRight The second date to compare.
* @returns True if the dates are on the same day.
*/
this.isSameDay = (dateLeft, dateRight) => {
return this.overrides?.isSameDay
? this.overrides.isSameDay(dateLeft, dateRight)
: isSameDay_isSameDay(dateLeft, dateRight);
};
/**
* Checks if the given dates are in the same month.
*
* @param dateLeft The first date to compare.
* @param dateRight The second date to compare.
* @returns True if the dates are in the same month.
*/
this.isSameMonth = (dateLeft, dateRight) => {
return this.overrides?.isSameMonth
? this.overrides.isSameMonth(dateLeft, dateRight)
: isSameMonth_isSameMonth(dateLeft, dateRight);
};
/**
* Checks if the given dates are in the same year.
*
* @param dateLeft The first date to compare.
* @param dateRight The second date to compare.
* @returns True if the dates are in the same year.
*/
this.isSameYear = (dateLeft, dateRight) => {
return this.overrides?.isSameYear
? this.overrides.isSameYear(dateLeft, dateRight)
: isSameYear(dateLeft, dateRight);
};
/**
* Returns the latest date in the given array of dates.
*
* @param dates The array of dates to compare.
* @returns The latest date.
*/
this.max = (dates) => {
return this.overrides?.max ? this.overrides.max(dates) : max_max(dates);
};
/**
* Returns the earliest date in the given array of dates.
*
* @param dates The array of dates to compare.
* @returns The earliest date.
*/
this.min = (dates) => {
return this.overrides?.min ? this.overrides.min(dates) : min_min(dates);
};
/**
* Sets the month of the given date.
*
* @param date The date to set the month on.
* @param month The month to set (0-11).
* @returns The new date with the month set.
*/
this.setMonth = (date, month) => {
return this.overrides?.setMonth
? this.overrides.setMonth(date, month)
: setMonth_setMonth(date, month);
};
/**
* Sets the year of the given date.
*
* @param date The date to set the year on.
* @param year The year to set.
* @returns The new date with the year set.
*/
this.setYear = (date, year) => {
return this.overrides?.setYear
? this.overrides.setYear(date, year)
: setYear_setYear(date, year);
};
/**
* Returns the start of the broadcast week for the given date.
*
* @param date The original date.
* @returns The start of the broadcast week.
*/
this.startOfBroadcastWeek = (date, _dateLib) => {
return this.overrides?.startOfBroadcastWeek
? this.overrides.startOfBroadcastWeek(date, this)
: startOfBroadcastWeek(date, this);
};
/**
* Returns the start of the day for the given date.
*
* @param date The original date.
* @returns The start of the day.
*/
this.startOfDay = (date) => {
return this.overrides?.startOfDay
? this.overrides.startOfDay(date)
: startOfDay_startOfDay(date);
};
/**
* Returns the start of the ISO week for the given date.
*
* @param date The original date.
* @returns The start of the ISO week.
*/
this.startOfISOWeek = (date) => {
return this.overrides?.startOfISOWeek
? this.overrides.startOfISOWeek(date)
: startOfISOWeek_startOfISOWeek(date);
};
/**
* Returns the start of the month for the given date.
*
* @param date The original date.
* @returns The start of the month.
*/
this.startOfMonth = (date) => {
return this.overrides?.startOfMonth
? this.overrides.startOfMonth(date)
: startOfMonth_startOfMonth(date);
};
/**
* Returns the start of the week for the given date.
*
* @param date The original date.
* @returns The start of the week.
*/
this.startOfWeek = (date, _options) => {
return this.overrides?.startOfWeek
? this.overrides.startOfWeek(date, this.options)
: startOfWeek_startOfWeek(date, this.options);
};
/**
* Returns the start of the year for the given date.
*
* @param date The original date.
* @returns The start of the year.
*/
this.startOfYear = (date) => {
return this.overrides?.startOfYear
? this.overrides.startOfYear(date)
: startOfYear_startOfYear(date);
};
this.options = { locale: en_US_enUS, ...options };
this.overrides = overrides;
}
/**
* Generates a mapping of Arabic digits (0-9) to the target numbering system
* digits.
*
* @since 9.5.0
* @returns A record mapping Arabic digits to the target numerals.
*/
getDigitMap() {
const { numerals = "latn" } = this.options;
// Use Intl.NumberFormat to create a formatter with the specified numbering system
const formatter = new Intl.NumberFormat("en-US", {
numberingSystem: numerals,
});
// Map Arabic digits (0-9) to the target numerals
const digitMap = {};
for (let i = 0; i < 10; i++) {
digitMap[i.toString()] = formatter.format(i);
}
return digitMap;
}
/**
* Replaces Arabic digits in a string with the target numbering system digits.
*
* @since 9.5.0
* @param input The string containing Arabic digits.
* @returns The string with digits replaced.
*/
replaceDigits(input) {
const digitMap = this.getDigitMap();
return input.replace(/\d/g, (digit) => digitMap[digit] || digit);
}
/**
* Formats a number using the configured numbering system.
*
* @since 9.5.0
* @param value The number to format.
* @returns The formatted number as a string.
*/
formatNumber(value) {
return this.replaceDigits(value.toString());
}
/**
* Returns the preferred ordering for month and year labels for the current
* locale.
*/
getMonthYearOrder() {
const code = this.options.locale?.code;
if (!code) {
return "month-first";
}
return DateLib.yearFirstLocales.has(code) ? "year-first" : "month-first";
}
/**
* Formats the month/year pair respecting locale conventions.
*
* @since 9.11.0
*/
formatMonthYear(date) {
const { locale, timeZone, numerals } = this.options;
const localeCode = locale?.code;
if (localeCode && DateLib.yearFirstLocales.has(localeCode)) {
try {
const intl = new Intl.DateTimeFormat(localeCode, {
month: "long",
year: "numeric",
timeZone,
numberingSystem: numerals,
});
const formatted = intl.format(date);
return formatted;
}
catch {
// Fallback to date-fns formatting below.
}
}
const pattern = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
return this.format(date, pattern);
}
}
DateLib.yearFirstLocales = new Set([
"eu",
"hu",
"ja",
"ja-Hira",
"ja-JP",
"ko",
"ko-KR",
"lt",
"lt-LT",
"lv",
"lv-LV",
"mn",
"mn-MN",
"zh",
"zh-CN",
"zh-HK",
"zh-TW",
]);
/** The default locale (English). */
/**
* The default date library with English locale.
*
* @since 9.2.0
*/
const DateLib_defaultDateLib = new DateLib();
/**
* @ignore
* @deprecated Use `defaultDateLib`.
*/
const dateLib = (/* unused pure expression or super */ null && (DateLib_defaultDateLib));
;// ./node_modules/react-day-picker/dist/esm/UI.js
/**
* Enum representing the UI elements composing DayPicker. These elements are
* mapped to {@link CustomComponents}, {@link ClassNames}, and {@link Styles}.
*
* Some elements are extended by flags and modifiers.
*/
var UI_UI;
(function (UI) {
/** The root component displaying the months and the navigation bar. */
UI["Root"] = "root";
/** The Chevron SVG element used by navigation buttons and dropdowns. */
UI["Chevron"] = "chevron";
/**
* The grid cell with the day's date. Extended by {@link DayFlag} and
* {@link SelectionState}.
*/
UI["Day"] = "day";
/** The button containing the formatted day's date, inside the grid cell. */
UI["DayButton"] = "day_button";
/** The caption label of the month (when not showing the dropdown navigation). */
UI["CaptionLabel"] = "caption_label";
/** The container of the dropdown navigation (when enabled). */
UI["Dropdowns"] = "dropdowns";
/** The dropdown element to select for years and months. */
UI["Dropdown"] = "dropdown";
/** The container element of the dropdown. */
UI["DropdownRoot"] = "dropdown_root";
/** The root element of the footer. */
UI["Footer"] = "footer";
/** The month grid. */
UI["MonthGrid"] = "month_grid";
/** Contains the dropdown navigation or the caption label. */
UI["MonthCaption"] = "month_caption";
/** The dropdown with the months. */
UI["MonthsDropdown"] = "months_dropdown";
/** Wrapper of the month grid. */
UI["Month"] = "month";
/** The container of the displayed months. */
UI["Months"] = "months";
/** The navigation bar with the previous and next buttons. */
UI["Nav"] = "nav";
/**
* The next month button in the navigation. *
*
* @since 9.1.0
*/
UI["NextMonthButton"] = "button_next";
/**
* The previous month button in the navigation.
*
* @since 9.1.0
*/
UI["PreviousMonthButton"] = "button_previous";
/** The row containing the week. */
UI["Week"] = "week";
/** The group of row weeks in a month (`tbody`). */
UI["Weeks"] = "weeks";
/** The column header with the weekday. */
UI["Weekday"] = "weekday";
/** The row grouping the weekdays in the column headers. */
UI["Weekdays"] = "weekdays";
/** The cell containing the week number. */
UI["WeekNumber"] = "week_number";
/** The cell header of the week numbers column. */
UI["WeekNumberHeader"] = "week_number_header";
/** The dropdown with the years. */
UI["YearsDropdown"] = "years_dropdown";
})(UI_UI || (UI_UI = {}));
/** Enum representing flags for the {@link UI.Day} element. */
var DayFlag;
(function (DayFlag) {
/** The day is disabled. */
DayFlag["disabled"] = "disabled";
/** The day is hidden. */
DayFlag["hidden"] = "hidden";
/** The day is outside the current month. */
DayFlag["outside"] = "outside";
/** The day is focused. */
DayFlag["focused"] = "focused";
/** The day is today. */
DayFlag["today"] = "today";
})(DayFlag || (DayFlag = {}));
/**
* Enum representing selection states that can be applied to the {@link UI.Day}
* element in selection mode.
*/
var SelectionState;
(function (SelectionState) {
/** The day is at the end of a selected range. */
SelectionState["range_end"] = "range_end";
/** The day is at the middle of a selected range. */
SelectionState["range_middle"] = "range_middle";
/** The day is at the start of a selected range. */
SelectionState["range_start"] = "range_start";
/** The day is selected. */
SelectionState["selected"] = "selected";
})(SelectionState || (SelectionState = {}));
/**
* Enum representing different animation states for transitioning between
* months.
*/
var Animation;
(function (Animation) {
/** The entering weeks when they appear before the exiting month. */
Animation["weeks_before_enter"] = "weeks_before_enter";
/** The exiting weeks when they disappear before the entering month. */
Animation["weeks_before_exit"] = "weeks_before_exit";
/** The entering weeks when they appear after the exiting month. */
Animation["weeks_after_enter"] = "weeks_after_enter";
/** The exiting weeks when they disappear after the entering month. */
Animation["weeks_after_exit"] = "weeks_after_exit";
/** The entering caption when it appears after the exiting month. */
Animation["caption_after_enter"] = "caption_after_enter";
/** The exiting caption when it disappears after the entering month. */
Animation["caption_after_exit"] = "caption_after_exit";
/** The entering caption when it appears before the exiting month. */
Animation["caption_before_enter"] = "caption_before_enter";
/** The exiting caption when it disappears before the entering month. */
Animation["caption_before_exit"] = "caption_before_exit";
})(Animation || (Animation = {}));
;// ./node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js
/**
* Checks if a given date is within a specified date range.
*
* @since 9.0.0
* @param range - The date range to check against.
* @param date - The date to check.
* @param excludeEnds - If `true`, the range's start and end dates are excluded.
* @param dateLib - The date utility library instance.
* @returns `true` if the date is within the range, otherwise `false`.
* @group Utilities
*/
function rangeIncludesDate(range, date, excludeEnds = false, dateLib = DateLib_defaultDateLib) {
let { from, to } = range;
const { differenceInCalendarDays, isSameDay } = dateLib;
if (from && to) {
const isRangeInverted = differenceInCalendarDays(to, from) < 0;
if (isRangeInverted) {
[from, to] = [to, from];
}
const isInRange = differenceInCalendarDays(date, from) >= (excludeEnds ? 1 : 0) &&
differenceInCalendarDays(to, date) >= (excludeEnds ? 1 : 0);
return isInRange;
}
if (!excludeEnds && to) {
return isSameDay(to, date);
}
if (!excludeEnds && from) {
return isSameDay(from, date);
}
return false;
}
/**
* @private
* @deprecated Use {@link rangeIncludesDate} instead.
*/
const isDateInRange = (range, date) => rangeIncludesDate(range, date, false, defaultDateLib);
;// ./node_modules/react-day-picker/dist/esm/utils/typeguards.js
/**
* Checks if the given value is of type {@link DateInterval}.
*
* @param matcher - The value to check.
* @returns `true` if the value is a {@link DateInterval}, otherwise `false`.
* @group Utilities
*/
function isDateInterval(matcher) {
return Boolean(matcher &&
typeof matcher === "object" &&
"before" in matcher &&
"after" in matcher);
}
/**
* Checks if the given value is of type {@link DateRange}.
*
* @param value - The value to check.
* @returns `true` if the value is a {@link DateRange}, otherwise `false`.
* @group Utilities
*/
function isDateRange(value) {
return Boolean(value && typeof value === "object" && "from" in value);
}
/**
* Checks if the given value is of type {@link DateAfter}.
*
* @param value - The value to check.
* @returns `true` if the value is a {@link DateAfter}, otherwise `false`.
* @group Utilities
*/
function isDateAfterType(value) {
return Boolean(value && typeof value === "object" && "after" in value);
}
/**
* Checks if the given value is of type {@link DateBefore}.
*
* @param value - The value to check.
* @returns `true` if the value is a {@link DateBefore}, otherwise `false`.
* @group Utilities
*/
function isDateBeforeType(value) {
return Boolean(value && typeof value === "object" && "before" in value);
}
/**
* Checks if the given value is of type {@link DayOfWeek}.
*
* @param value - The value to check.
* @returns `true` if the value is a {@link DayOfWeek}, otherwise `false`.
* @group Utilities
*/
function isDayOfWeekType(value) {
return Boolean(value && typeof value === "object" && "dayOfWeek" in value);
}
/**
* Checks if the given value is an array of valid dates.
*
* @private
* @param value - The value to check.
* @param dateLib - The date utility library instance.
* @returns `true` if the value is an array of valid dates, otherwise `false`.
*/
function isDatesArray(value, dateLib) {
return Array.isArray(value) && value.every(dateLib.isDate);
}
;// ./node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js
/**
* Checks if a given date matches at least one of the specified {@link Matcher}.
*
* @param date - The date to check.
* @param matchers - The matchers to check against.
* @param dateLib - The date utility library instance.
* @returns `true` if the date matches any of the matchers, otherwise `false`.
* @group Utilities
*/
function dateMatchModifiers(date, matchers, dateLib = DateLib_defaultDateLib) {
const matchersArr = !Array.isArray(matchers) ? [matchers] : matchers;
const { isSameDay, differenceInCalendarDays, isAfter } = dateLib;
return matchersArr.some((matcher) => {
if (typeof matcher === "boolean") {
return matcher;
}
if (dateLib.isDate(matcher)) {
return isSameDay(date, matcher);
}
if (isDatesArray(matcher, dateLib)) {
return matcher.includes(date);
}
if (isDateRange(matcher)) {
return rangeIncludesDate(matcher, date, false, dateLib);
}
if (isDayOfWeekType(matcher)) {
if (!Array.isArray(matcher.dayOfWeek)) {
return matcher.dayOfWeek === date.getDay();
}
return matcher.dayOfWeek.includes(date.getDay());
}
if (isDateInterval(matcher)) {
const diffBefore = differenceInCalendarDays(matcher.before, date);
const diffAfter = differenceInCalendarDays(matcher.after, date);
const isDayBefore = diffBefore > 0;
const isDayAfter = diffAfter < 0;
const isClosedInterval = isAfter(matcher.before, matcher.after);
if (isClosedInterval) {
return isDayAfter && isDayBefore;
}
else {
return isDayBefore || isDayAfter;
}
}
if (isDateAfterType(matcher)) {
return differenceInCalendarDays(date, matcher.after) > 0;
}
if (isDateBeforeType(matcher)) {
return differenceInCalendarDays(matcher.before, date) > 0;
}
if (typeof matcher === "function") {
return matcher(date);
}
return false;
});
}
/**
* @private
* @deprecated Use {@link dateMatchModifiers} instead.
*/
const isMatch = (/* unused pure expression or super */ null && (dateMatchModifiers));
;// ./node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js
/**
* Creates a function to retrieve the modifiers for a given day.
*
* This function calculates both internal and custom modifiers for each day
* based on the provided calendar days and DayPicker props.
*
* @private
* @param days The array of `CalendarDay` objects to process.
* @param props The DayPicker props, including modifiers and configuration
* options.
* @param dateLib The date library to use for date manipulation.
* @returns A function that retrieves the modifiers for a given `CalendarDay`.
*/
function createGetModifiers(days, props, navStart, navEnd, dateLib) {
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today, } = props;
const { isSameDay, isSameMonth, startOfMonth, isBefore, endOfMonth, isAfter, } = dateLib;
const computedNavStart = navStart && startOfMonth(navStart);
const computedNavEnd = navEnd && endOfMonth(navEnd);
const internalModifiersMap = {
[DayFlag.focused]: [],
[DayFlag.outside]: [],
[DayFlag.disabled]: [],
[DayFlag.hidden]: [],
[DayFlag.today]: [],
};
const customModifiersMap = {};
for (const day of days) {
const { date, displayMonth } = day;
const isOutside = Boolean(displayMonth && !isSameMonth(date, displayMonth));
const isBeforeNavStart = Boolean(computedNavStart && isBefore(date, computedNavStart));
const isAfterNavEnd = Boolean(computedNavEnd && isAfter(date, computedNavEnd));
const isDisabled = Boolean(disabled && dateMatchModifiers(date, disabled, dateLib));
const isHidden = Boolean(hidden && dateMatchModifiers(date, hidden, dateLib)) ||
isBeforeNavStart ||
isAfterNavEnd ||
// Broadcast calendar will show outside days as default
(!broadcastCalendar && !showOutsideDays && isOutside) ||
(broadcastCalendar && showOutsideDays === false && isOutside);
const isToday = isSameDay(date, today ?? dateLib.today());
if (isOutside)
internalModifiersMap.outside.push(day);
if (isDisabled)
internalModifiersMap.disabled.push(day);
if (isHidden)
internalModifiersMap.hidden.push(day);
if (isToday)
internalModifiersMap.today.push(day);
// Add custom modifiers
if (modifiers) {
Object.keys(modifiers).forEach((name) => {
const modifierValue = modifiers?.[name];
const isMatch = modifierValue
? dateMatchModifiers(date, modifierValue, dateLib)
: false;
if (!isMatch)
return;
if (customModifiersMap[name]) {
customModifiersMap[name].push(day);
}
else {
customModifiersMap[name] = [day];
}
});
}
}
return (day) => {
// Initialize all the modifiers to false
const dayFlags = {
[DayFlag.focused]: false,
[DayFlag.disabled]: false,
[DayFlag.hidden]: false,
[DayFlag.outside]: false,
[DayFlag.today]: false,
};
const customModifiers = {};
// Find the modifiers for the given day
for (const name in internalModifiersMap) {
const days = internalModifiersMap[name];
dayFlags[name] = days.some((d) => d === day);
}
for (const name in customModifiersMap) {
customModifiers[name] = customModifiersMap[name].some((d) => d === day);
}
return {
...dayFlags,
// custom modifiers should override all the previous ones
...customModifiers,
};
};
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js
/**
* Returns the class names for a day based on its modifiers.
*
* This function combines the base class name for the day with any class names
* associated with active modifiers.
*
* @param modifiers The modifiers applied to the day.
* @param classNames The base class names for the calendar elements.
* @param modifiersClassNames The class names associated with specific
* modifiers.
* @returns An array of class names for the day.
*/
function getClassNamesForModifiers(modifiers, classNames, modifiersClassNames = {}) {
const modifierClassNames = Object.entries(modifiers)
.filter(([, active]) => active === true)
.reduce((previousValue, [key]) => {
if (modifiersClassNames[key]) {
previousValue.push(modifiersClassNames[key]);
}
else if (classNames[DayFlag[key]]) {
previousValue.push(classNames[DayFlag[key]]);
}
else if (classNames[SelectionState[key]]) {
previousValue.push(classNames[SelectionState[key]]);
}
return previousValue;
}, [classNames[UI_UI.Day]]);
return modifierClassNames;
}
;// ./node_modules/react-day-picker/dist/esm/components/Button.js
/**
* Render the button elements in the calendar.
*
* @private
* @deprecated Use `PreviousMonthButton` or `@link NextMonthButton` instead.
*/
function Button_Button(props) {
return external_React_.createElement("button", { ...props });
}
;// ./node_modules/react-day-picker/dist/esm/components/CaptionLabel.js
/**
* Render the label in the month caption.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function CaptionLabel(props) {
return external_React_.createElement("span", { ...props });
}
;// ./node_modules/react-day-picker/dist/esm/components/Chevron.js
/**
* Render the chevron icon used in the navigation buttons and dropdowns.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function Chevron(props) {
const { size = 24, orientation = "left", className } = props;
return (
// biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
external_React_.createElement("svg", { className: className, width: size, height: size, viewBox: "0 0 24 24" },
orientation === "up" && (external_React_.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" })),
orientation === "down" && (external_React_.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" })),
orientation === "left" && (external_React_.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" })),
orientation === "right" && (external_React_.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" }))));
}
;// ./node_modules/react-day-picker/dist/esm/components/Day.js
/**
* Render a grid cell for a specific day in the calendar.
*
* Handles interaction and focus for the day. If you only need to change the
* content of the day cell, consider swapping the `DayButton` component
* instead.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function Day_Day(props) {
const { day, modifiers, ...tdProps } = props;
return external_React_.createElement("td", { ...tdProps });
}
;// ./node_modules/react-day-picker/dist/esm/components/DayButton.js
/**
* Render a button for a specific day in the calendar.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function DayButton_DayButton(props) {
const { day, modifiers, ...buttonProps } = props;
const ref = external_React_.useRef(null);
external_React_.useEffect(() => {
if (modifiers.focused)
ref.current?.focus();
}, [modifiers.focused]);
return external_React_.createElement("button", { ref: ref, ...buttonProps });
}
;// ./node_modules/react-day-picker/dist/esm/components/Dropdown.js
/**
* Render a dropdown component for navigation in the calendar.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function Dropdown_Dropdown(props) {
const { options, className, components, classNames, ...selectProps } = props;
const cssClassSelect = [classNames[UI_UI.Dropdown], className].join(" ");
const selectedOption = options?.find(({ value }) => value === selectProps.value);
return (external_React_.createElement("span", { "data-disabled": selectProps.disabled, className: classNames[UI_UI.DropdownRoot] },
external_React_.createElement(components.Select, { className: cssClassSelect, ...selectProps }, options?.map(({ value, label, disabled }) => (external_React_.createElement(components.Option, { key: value, value: value, disabled: disabled }, label)))),
external_React_.createElement("span", { className: classNames[UI_UI.CaptionLabel], "aria-hidden": true },
selectedOption?.label,
external_React_.createElement(components.Chevron, { orientation: "down", size: 18, className: classNames[UI_UI.Chevron] }))));
}
;// ./node_modules/react-day-picker/dist/esm/components/DropdownNav.js
/**
* Render the navigation dropdowns for the calendar.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function DropdownNav(props) {
return external_React_.createElement("div", { ...props });
}
;// ./node_modules/react-day-picker/dist/esm/components/Footer.js
/**
* Render the footer of the calendar.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function Footer_Footer(props) {
return external_React_.createElement("div", { ...props });
}
;// ./node_modules/react-day-picker/dist/esm/components/Month.js
/**
* Render the grid with the weekday header row and the weeks for a specific
* month.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function Month_Month(props) {
const { calendarMonth, displayIndex, ...divProps } = props;
return external_React_.createElement("div", { ...divProps }, props.children);
}
;// ./node_modules/react-day-picker/dist/esm/components/MonthCaption.js
/**
* Render the caption for a month in the calendar.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function MonthCaption(props) {
const { calendarMonth, displayIndex, ...divProps } = props;
return external_React_.createElement("div", { ...divProps });
}
;// ./node_modules/react-day-picker/dist/esm/components/MonthGrid.js
/**
* Render the grid of days for a specific month.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function MonthGrid(props) {
return external_React_.createElement("table", { ...props });
}
;// ./node_modules/react-day-picker/dist/esm/components/Months.js
/**
* Render a container wrapping the month grids.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function Months(props) {
return external_React_.createElement("div", { ...props });
}
;// ./node_modules/react-day-picker/dist/esm/useDayPicker.js
/** @ignore */
const dayPickerContext = (0,external_React_.createContext)(undefined);
/**
* Provides access to the DayPicker context, which includes properties and
* methods to interact with the DayPicker component. This hook must be used
* within a custom component.
*
* @template T - Use this type to refine the returned context type with a
* specific selection mode.
* @returns The context to work with DayPicker.
* @throws {Error} If the hook is used outside of a DayPicker provider.
* @group Hooks
* @see https://daypicker.dev/guides/custom-components
*/
function useDayPicker() {
const context = (0,external_React_.useContext)(dayPickerContext);
if (context === undefined) {
throw new Error("useDayPicker() must be used within a custom component.");
}
return context;
}
;// ./node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js
/**
* Render a dropdown to navigate between months in the calendar.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function MonthsDropdown(props) {
const { components } = useDayPicker();
return external_React_.createElement(components.Dropdown, { ...props });
}
;// ./node_modules/react-day-picker/dist/esm/components/Nav.js
/**
* Render the navigation toolbar with buttons to navigate between months.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function Nav(props) {
const { onPreviousClick, onNextClick, previousMonth, nextMonth, ...navProps } = props;
const { components, classNames, labels: { labelPrevious, labelNext }, } = useDayPicker();
const handleNextClick = (0,external_React_.useCallback)((e) => {
if (nextMonth) {
onNextClick?.(e);
}
}, [nextMonth, onNextClick]);
const handlePreviousClick = (0,external_React_.useCallback)((e) => {
if (previousMonth) {
onPreviousClick?.(e);
}
}, [previousMonth, onPreviousClick]);
return (external_React_.createElement("nav", { ...navProps },
external_React_.createElement(components.PreviousMonthButton, { type: "button", className: classNames[UI_UI.PreviousMonthButton], tabIndex: previousMonth ? undefined : -1, "aria-disabled": previousMonth ? undefined : true, "aria-label": labelPrevious(previousMonth), onClick: handlePreviousClick },
external_React_.createElement(components.Chevron, { disabled: previousMonth ? undefined : true, className: classNames[UI_UI.Chevron], orientation: "left" })),
external_React_.createElement(components.NextMonthButton, { type: "button", className: classNames[UI_UI.NextMonthButton], tabIndex: nextMonth ? undefined : -1, "aria-disabled": nextMonth ? undefined : true, "aria-label": labelNext(nextMonth), onClick: handleNextClick },
external_React_.createElement(components.Chevron, { disabled: nextMonth ? undefined : true, orientation: "right", className: classNames[UI_UI.Chevron] }))));
}
;// ./node_modules/react-day-picker/dist/esm/components/NextMonthButton.js
/**
* Render the button to navigate to the next month in the calendar.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function NextMonthButton(props) {
const { components } = useDayPicker();
return external_React_.createElement(components.Button, { ...props });
}
;// ./node_modules/react-day-picker/dist/esm/components/Option.js
/**
* Render an `option` element.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function Option_Option(props) {
return external_React_.createElement("option", { ...props });
}
;// ./node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js
/**
* Render the button to navigate to the previous month in the calendar.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function PreviousMonthButton(props) {
const { components } = useDayPicker();
return external_React_.createElement(components.Button, { ...props });
}
;// ./node_modules/react-day-picker/dist/esm/components/Root.js
/**
* Render the root element of the calendar.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function Root_Root(props) {
const { rootRef, ...rest } = props;
return external_React_.createElement("div", { ...rest, ref: rootRef });
}
;// ./node_modules/react-day-picker/dist/esm/components/Select.js
/**
* Render a `select` element.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function Select_Select(props) {
return external_React_.createElement("select", { ...props });
}
;// ./node_modules/react-day-picker/dist/esm/components/Week.js
/**
* Render a table row representing a week in the calendar.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function Week(props) {
const { week, ...trProps } = props;
return external_React_.createElement("tr", { ...trProps });
}
;// ./node_modules/react-day-picker/dist/esm/components/Weekday.js
/**
* Render a table header cell with the name of a weekday (e.g., "Mo", "Tu").
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function Weekday(props) {
return external_React_.createElement("th", { ...props });
}
;// ./node_modules/react-day-picker/dist/esm/components/Weekdays.js
/**
* Render the table row containing the weekday names.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function Weekdays(props) {
return (external_React_.createElement("thead", { "aria-hidden": true },
external_React_.createElement("tr", { ...props })));
}
;// ./node_modules/react-day-picker/dist/esm/components/WeekNumber.js
/**
* Render a table cell displaying the number of the week.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function WeekNumber(props) {
const { week, ...thProps } = props;
return external_React_.createElement("th", { ...thProps });
}
;// ./node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js
/**
* Render the header cell for the week numbers column.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function WeekNumberHeader(props) {
return external_React_.createElement("th", { ...props });
}
;// ./node_modules/react-day-picker/dist/esm/components/Weeks.js
/**
* Render the container for the weeks in the month grid.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function Weeks(props) {
return external_React_.createElement("tbody", { ...props });
}
;// ./node_modules/react-day-picker/dist/esm/components/YearsDropdown.js
/**
* Render a dropdown to navigate between years in the calendar.
*
* @group Components
* @see https://daypicker.dev/guides/custom-components
*/
function YearsDropdown(props) {
const { components } = useDayPicker();
return external_React_.createElement(components.Dropdown, { ...props });
}
;// ./node_modules/react-day-picker/dist/esm/components/custom-components.js
;// ./node_modules/react-day-picker/dist/esm/helpers/getComponents.js
/**
* Merges custom components from the props with the default components.
*
* This function ensures that any custom components provided in the props
* override the default components.
*
* @param customComponents The custom components provided in the DayPicker
* props.
* @returns An object containing the merged components.
*/
function getComponents(customComponents) {
return {
...custom_components_namespaceObject,
...customComponents,
};
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js
/**
* Extracts `data-` attributes from the DayPicker props.
*
* This function collects all `data-` attributes from the props and adds
* additional attributes based on the DayPicker configuration.
*
* @param props The DayPicker props.
* @returns An object containing the `data-` attributes.
*/
function getDataAttributes(props) {
const dataAttributes = {
"data-mode": props.mode ?? undefined,
"data-required": "required" in props ? props.required : undefined,
"data-multiple-months": (props.numberOfMonths && props.numberOfMonths > 1) || undefined,
"data-week-numbers": props.showWeekNumber || undefined,
"data-broadcast-calendar": props.broadcastCalendar || undefined,
"data-nav-layout": props.navLayout || undefined,
};
Object.entries(props).forEach(([key, val]) => {
if (key.startsWith("data-")) {
dataAttributes[key] = val;
}
});
return dataAttributes;
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js
/**
* Returns the default class names for the UI elements.
*
* This function generates a mapping of default class names for various UI
* elements, day flags, selection states, and animations.
*
* @returns An object containing the default class names.
* @group Utilities
*/
function getDefaultClassNames() {
const classNames = {};
for (const key in UI_UI) {
classNames[UI_UI[key]] =
`rdp-${UI_UI[key]}`;
}
for (const key in DayFlag) {
classNames[DayFlag[key]] =
`rdp-${DayFlag[key]}`;
}
for (const key in SelectionState) {
classNames[SelectionState[key]] =
`rdp-${SelectionState[key]}`;
}
for (const key in Animation) {
classNames[Animation[key]] =
`rdp-${Animation[key]}`;
}
return classNames;
}
;// ./node_modules/react-day-picker/dist/esm/formatters/formatCaption.js
/**
* Formats the caption of the month.
*
* @defaultValue Locale-specific month/year order (e.g., "November 2022").
* @param month The date representing the month.
* @param options Configuration options for the date library.
* @param dateLib The date library to use for formatting. If not provided, a new
* instance is created.
* @returns The formatted caption as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
function formatCaption(month, options, dateLib) {
const lib = dateLib ?? new DateLib(options);
return lib.formatMonthYear(month);
}
/**
* @private
* @deprecated Use {@link formatCaption} instead.
* @group Formatters
*/
const formatMonthCaption = formatCaption;
;// ./node_modules/react-day-picker/dist/esm/formatters/formatDay.js
/**
* Formats the day date shown in the day cell.
*
* @defaultValue `d` (e.g., "1").
* @param date The date to format.
* @param options Configuration options for the date library.
* @param dateLib The date library to use for formatting. If not provided, a new
* instance is created.
* @returns The formatted day as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
function formatDay(date, options, dateLib) {
return (dateLib ?? new DateLib(options)).format(date, "d");
}
;// ./node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js
/**
* Formats the month for the dropdown option label.
*
* @defaultValue The localized full month name.
* @param month The date representing the month.
* @param dateLib The date library to use for formatting. Defaults to
* `defaultDateLib`.
* @returns The formatted month name as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
function formatMonthDropdown(month, dateLib = DateLib_defaultDateLib) {
return dateLib.format(month, "LLLL");
}
;// ./node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js
/**
* Formats the name of a weekday to be displayed in the weekdays header.
*
* @defaultValue `cccccc` (e.g., "Mo" for Monday).
* @param weekday The date representing the weekday.
* @param options Configuration options for the date library.
* @param dateLib The date library to use for formatting. If not provided, a new
* instance is created.
* @returns The formatted weekday name as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
function formatWeekdayName(weekday, options, dateLib) {
return (dateLib ?? new DateLib(options)).format(weekday, "cccccc");
}
;// ./node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js
/**
* Formats the week number.
*
* @defaultValue The week number as a string, with a leading zero for single-digit numbers.
* @param weekNumber The week number to format.
* @param dateLib The date library to use for formatting. Defaults to
* `defaultDateLib`.
* @returns The formatted week number as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
function formatWeekNumber(weekNumber, dateLib = DateLib_defaultDateLib) {
if (weekNumber < 10) {
return dateLib.formatNumber(`0${weekNumber.toLocaleString()}`);
}
return dateLib.formatNumber(`${weekNumber.toLocaleString()}`);
}
;// ./node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js
/**
* Formats the header for the week number column.
*
* @defaultValue An empty string `""`.
* @returns The formatted week number header as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
function formatWeekNumberHeader() {
return ``;
}
;// ./node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js
/**
* Formats the year for the dropdown option label.
*
* @param year The year to format.
* @param dateLib The date library to use for formatting. Defaults to
* `defaultDateLib`.
* @returns The formatted year as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
function formatYearDropdown(year, dateLib = DateLib_defaultDateLib) {
return dateLib.format(year, "yyyy");
}
/**
* @private
* @deprecated Use `formatYearDropdown` instead.
* @group Formatters
*/
const formatYearCaption = formatYearDropdown;
;// ./node_modules/react-day-picker/dist/esm/formatters/index.js
;// ./node_modules/react-day-picker/dist/esm/helpers/getFormatters.js
/**
* Merges custom formatters from the props with the default formatters.
*
* @param customFormatters The custom formatters provided in the DayPicker
* props.
* @returns The merged formatters object.
*/
function getFormatters(customFormatters) {
if (customFormatters?.formatMonthCaption && !customFormatters.formatCaption) {
customFormatters.formatCaption = customFormatters.formatMonthCaption;
}
if (customFormatters?.formatYearCaption &&
!customFormatters.formatYearDropdown) {
customFormatters.formatYearDropdown = customFormatters.formatYearCaption;
}
return {
...esm_formatters_namespaceObject,
...customFormatters,
};
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js
/**
* Returns the months to show in the dropdown.
*
* This function generates a list of months for the current year, formatted
* using the provided formatter, and determines whether each month should be
* disabled based on the navigation range.
*
* @param displayMonth The currently displayed month.
* @param navStart The start date for navigation.
* @param navEnd The end date for navigation.
* @param formatters The formatters to use for formatting the month labels.
* @param dateLib The date library to use for date manipulation.
* @returns An array of dropdown options representing the months, or `undefined`
* if no months are available.
*/
function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
const months = eachMonthOfInterval({
start: startOfYear(displayMonth),
end: endOfYear(displayMonth),
});
const options = months.map((month) => {
const label = formatters.formatMonthDropdown(month, dateLib);
const value = getMonth(month);
const disabled = (navStart && month < startOfMonth(navStart)) ||
(navEnd && month > startOfMonth(navEnd)) ||
false;
return { value, label, disabled };
});
return options;
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js
/**
* Returns the computed style for a day based on its modifiers.
*
* This function merges the base styles for the day with any styles associated
* with active modifiers.
*
* @param dayModifiers The modifiers applied to the day.
* @param styles The base styles for the calendar elements.
* @param modifiersStyles The styles associated with specific modifiers.
* @returns The computed style for the day.
*/
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
let style = { ...styles?.[UI_UI.Day] };
Object.entries(dayModifiers)
.filter(([, active]) => active === true)
.forEach(([modifier]) => {
style = {
...style,
...modifiersStyles?.[modifier],
};
});
return style;
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js
/**
* Generates a series of 7 days, starting from the beginning of the week, to use
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
*
* @param dateLib The date library to use for date manipulation.
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
* on Monday, but may include adjustments for broadcast-specific rules).
* @returns An array of 7 dates representing the weekdays.
*/
function getWeekdays(dateLib, ISOWeek, broadcastCalendar) {
const today = dateLib.today();
const start = broadcastCalendar
? dateLib.startOfBroadcastWeek(today, dateLib)
: ISOWeek
? dateLib.startOfISOWeek(today)
: dateLib.startOfWeek(today);
const days = [];
for (let i = 0; i < 7; i++) {
const day = dateLib.addDays(start, i);
days.push(day);
}
return days;
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js
/**
* Returns the years to display in the dropdown.
*
* This function generates a list of years between the navigation start and end
* dates, formatted using the provided formatter.
*
* @param navStart The start date for navigation.
* @param navEnd The end date for navigation.
* @param formatters The formatters to use for formatting the year labels.
* @param dateLib The date library to use for date manipulation.
* @param reverse If true, reverses the order of the years (descending).
* @returns An array of dropdown options representing the years, or `undefined`
* if `navStart` or `navEnd` is not provided.
*/
function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
if (!navStart)
return undefined;
if (!navEnd)
return undefined;
const { startOfYear, endOfYear, eachYearOfInterval, getYear } = dateLib;
const firstNavYear = startOfYear(navStart);
const lastNavYear = endOfYear(navEnd);
const years = eachYearOfInterval({ start: firstNavYear, end: lastNavYear });
if (reverse)
years.reverse();
return years.map((year) => {
const label = formatters.formatYearDropdown(year, dateLib);
return {
value: getYear(year),
label,
disabled: false,
};
});
}
;// ./node_modules/react-day-picker/dist/esm/labels/labelDayButton.js
/**
* Generates the ARIA label for a day button.
*
* Use the `modifiers` argument to provide additional context for the label,
* such as indicating if the day is "today" or "selected."
*
* @defaultValue The formatted date.
* @param date - The date to format.
* @param modifiers - The modifiers providing context for the day.
* @param options - Optional configuration for the date formatting library.
* @param dateLib - An optional instance of the date formatting library.
* @returns The ARIA label for the day button.
* @group Labels
* @see https://daypicker.dev/docs/translation#aria-labels
*/
function labelDayButton(date, modifiers, options, dateLib) {
let label = (dateLib ?? new DateLib(options)).format(date, "PPPP");
if (modifiers.today)
label = `Today, ${label}`;
if (modifiers.selected)
label = `${label}, selected`;
return label;
}
/**
* @ignore
* @deprecated Use `labelDayButton` instead.
*/
const labelDay = labelDayButton;
;// ./node_modules/react-day-picker/dist/esm/labels/labelGrid.js
/**
* Generates the ARIA label for the month grid, which is announced when entering
* the grid.
*
* @defaultValue Locale-specific month/year order (e.g., "November 2022").
* @param date - The date representing the month.
* @param options - Optional configuration for the date formatting library.
* @param dateLib - An optional instance of the date formatting library.
* @returns The ARIA label for the month grid.
* @group Labels
* @see https://daypicker.dev/docs/translation#aria-labels
*/
function labelGrid(date, options, dateLib) {
const lib = dateLib ?? new DateLib(options);
return lib.formatMonthYear(date);
}
/**
* @ignore
* @deprecated Use {@link labelGrid} instead.
*/
const labelCaption = labelGrid;
;// ./node_modules/react-day-picker/dist/esm/labels/labelGridcell.js
/**
* Generates the label for a day grid cell when the calendar is not interactive.
*
* @param date - The date to format.
* @param modifiers - Optional modifiers providing context for the day.
* @param options - Optional configuration for the date formatting library.
* @param dateLib - An optional instance of the date formatting library.
* @returns The label for the day grid cell.
* @group Labels
* @see https://daypicker.dev/docs/translation#aria-labels
*/
function labelGridcell(date, modifiers, options, dateLib) {
let label = (dateLib ?? new DateLib(options)).format(date, "PPPP");
if (modifiers?.today) {
label = `Today, ${label}`;
}
return label;
}
;// ./node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js
/**
* Generates the ARIA label for the months dropdown.
*
* @defaultValue `"Choose the Month"`
* @param options - Optional configuration for the date formatting library.
* @returns The ARIA label for the months dropdown.
* @group Labels
* @see https://daypicker.dev/docs/translation#aria-labels
*/
function labelMonthDropdown(_options) {
return "Choose the Month";
}
;// ./node_modules/react-day-picker/dist/esm/labels/labelNav.js
/**
* Generates the ARIA label for the navigation toolbar.
*
* @defaultValue `""`
* @returns The ARIA label for the navigation toolbar.
* @group Labels
* @see https://daypicker.dev/docs/translation#aria-labels
*/
function labelNav() {
return "";
}
;// ./node_modules/react-day-picker/dist/esm/labels/labelNext.js
/**
* Generates the ARIA label for the "next month" button.
*
* @defaultValue `"Go to the Next Month"`
* @param month - The date representing the next month, or `undefined` if there
* is no next month.
* @returns The ARIA label for the "next month" button.
* @group Labels
* @see https://daypicker.dev/docs/translation#aria-labels
*/
function labelNext(_month) {
return "Go to the Next Month";
}
;// ./node_modules/react-day-picker/dist/esm/labels/labelPrevious.js
/**
* Generates the ARIA label for the "previous month" button.
*
* @defaultValue `"Go to the Previous Month"`
* @param month - The date representing the previous month, or `undefined` if
* there is no previous month.
* @returns The ARIA label for the "previous month" button.
* @group Labels
* @see https://daypicker.dev/docs/translation#aria-labels
*/
function labelPrevious(_month) {
return "Go to the Previous Month";
}
;// ./node_modules/react-day-picker/dist/esm/labels/labelWeekday.js
/**
* Generates the ARIA label for a weekday column header.
*
* @defaultValue `"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"`
* @param date - The date representing the weekday.
* @param options - Optional configuration for the date formatting library.
* @param dateLib - An optional instance of the date formatting library.
* @returns The ARIA label for the weekday column header.
* @group Labels
* @see https://daypicker.dev/docs/translation#aria-labels
*/
function labelWeekday(date, options, dateLib) {
return (dateLib ?? new DateLib(options)).format(date, "cccc");
}
;// ./node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js
/**
* Generates the ARIA label for the week number cell (the first cell in a row).
*
* @defaultValue `Week ${weekNumber}`
* @param weekNumber - The number of the week.
* @param options - Optional configuration for the date formatting library.
* @returns The ARIA label for the week number cell.
* @group Labels
* @see https://daypicker.dev/docs/translation#aria-labels
*/
function labelWeekNumber(weekNumber, _options) {
return `Week ${weekNumber}`;
}
;// ./node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js
/**
* Generates the ARIA label for the week number header element.
*
* @defaultValue `"Week Number"`
* @param options - Optional configuration for the date formatting library.
* @returns The ARIA label for the week number header.
* @group Labels
* @see https://daypicker.dev/docs/translation#aria-labels
*/
function labelWeekNumberHeader(_options) {
return "Week Number";
}
;// ./node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js
/**
* Generates the ARIA label for the years dropdown.
*
* @defaultValue `"Choose the Year"`
* @param options - Optional configuration for the date formatting library.
* @returns The ARIA label for the years dropdown.
* @group Labels
* @see https://daypicker.dev/docs/translation#aria-labels
*/
function labelYearDropdown(_options) {
return "Choose the Year";
}
;// ./node_modules/react-day-picker/dist/esm/labels/index.js
;// ./node_modules/react-day-picker/dist/esm/useAnimation.js
const asHtmlElement = (element) => {
if (element instanceof HTMLElement)
return element;
return null;
};
const queryMonthEls = (element) => [
...(element.querySelectorAll("[data-animated-month]") ?? []),
];
const queryMonthEl = (element) => asHtmlElement(element.querySelector("[data-animated-month]"));
const queryCaptionEl = (element) => asHtmlElement(element.querySelector("[data-animated-caption]"));
const queryWeeksEl = (element) => asHtmlElement(element.querySelector("[data-animated-weeks]"));
const queryNavEl = (element) => asHtmlElement(element.querySelector("[data-animated-nav]"));
const queryWeekdaysEl = (element) => asHtmlElement(element.querySelector("[data-animated-weekdays]"));
/**
* Handles animations for transitioning between months in the DayPicker
* component.
*
* @private
* @param rootElRef - A reference to the root element of the DayPicker
* component.
* @param enabled - Whether animations are enabled.
* @param options - Configuration options for the animation, including class
* names, months, focused day, and the date utility library.
*/
function useAnimation(rootElRef, enabled, { classNames, months, focused, dateLib, }) {
const previousRootElSnapshotRef = (0,external_React_.useRef)(null);
const previousMonthsRef = (0,external_React_.useRef)(months);
const animatingRef = (0,external_React_.useRef)(false);
(0,external_React_.useLayoutEffect)(() => {
// get previous months before updating the previous months ref
const previousMonths = previousMonthsRef.current;
// update previous months ref for next effect trigger
previousMonthsRef.current = months;
if (!enabled ||
!rootElRef.current ||
// safety check because the ref can be set to anything by consumers
!(rootElRef.current instanceof HTMLElement) ||
// validation required for the animation to work as expected
months.length === 0 ||
previousMonths.length === 0 ||
months.length !== previousMonths.length) {
return;
}
const isSameMonth = dateLib.isSameMonth(months[0].date, previousMonths[0].date);
const isAfterPreviousMonth = dateLib.isAfter(months[0].date, previousMonths[0].date);
const captionAnimationClass = isAfterPreviousMonth
? classNames[Animation.caption_after_enter]
: classNames[Animation.caption_before_enter];
const weeksAnimationClass = isAfterPreviousMonth
? classNames[Animation.weeks_after_enter]
: classNames[Animation.weeks_before_enter];
// get previous root element snapshot before updating the snapshot ref
const previousRootElSnapshot = previousRootElSnapshotRef.current;
// update snapshot for next effect trigger
const rootElSnapshot = rootElRef.current.cloneNode(true);
if (rootElSnapshot instanceof HTMLElement) {
// if this effect is triggered while animating, we need to clean up the new root snapshot
// to put it in the same state as when not animating, to correctly animate the next month change
const currentMonthElsSnapshot = queryMonthEls(rootElSnapshot);
currentMonthElsSnapshot.forEach((currentMonthElSnapshot) => {
if (!(currentMonthElSnapshot instanceof HTMLElement))
return;
// remove the old month snapshots from the new root snapshot
const previousMonthElSnapshot = queryMonthEl(currentMonthElSnapshot);
if (previousMonthElSnapshot &&
currentMonthElSnapshot.contains(previousMonthElSnapshot)) {
currentMonthElSnapshot.removeChild(previousMonthElSnapshot);
}
// remove animation classes from the new month snapshots
const captionEl = queryCaptionEl(currentMonthElSnapshot);
if (captionEl) {
captionEl.classList.remove(captionAnimationClass);
}
const weeksEl = queryWeeksEl(currentMonthElSnapshot);
if (weeksEl) {
weeksEl.classList.remove(weeksAnimationClass);
}
});
previousRootElSnapshotRef.current = rootElSnapshot;
}
else {
previousRootElSnapshotRef.current = null;
}
if (animatingRef.current ||
isSameMonth ||
// skip animation if a day is focused because it can cause issues to the animation and is better for a11y
focused) {
return;
}
const previousMonthEls = previousRootElSnapshot instanceof HTMLElement
? queryMonthEls(previousRootElSnapshot)
: [];
const currentMonthEls = queryMonthEls(rootElRef.current);
if (currentMonthEls?.every((el) => el instanceof HTMLElement) &&
previousMonthEls &&
previousMonthEls.every((el) => el instanceof HTMLElement)) {
animatingRef.current = true;
const cleanUpFunctions = [];
// set isolation to isolate to isolate the stacking context during animation
rootElRef.current.style.isolation = "isolate";
// set z-index to 1 to ensure the nav is clickable over the other elements being animated
const navEl = queryNavEl(rootElRef.current);
if (navEl) {
navEl.style.zIndex = "1";
}
currentMonthEls.forEach((currentMonthEl, index) => {
const previousMonthEl = previousMonthEls[index];
if (!previousMonthEl) {
return;
}
// animate new displayed month
currentMonthEl.style.position = "relative";
currentMonthEl.style.overflow = "hidden";
const captionEl = queryCaptionEl(currentMonthEl);
if (captionEl) {
captionEl.classList.add(captionAnimationClass);
}
const weeksEl = queryWeeksEl(currentMonthEl);
if (weeksEl) {
weeksEl.classList.add(weeksAnimationClass);
}
// animate new displayed month end
const cleanUp = () => {
animatingRef.current = false;
if (rootElRef.current) {
rootElRef.current.style.isolation = "";
}
if (navEl) {
navEl.style.zIndex = "";
}
if (captionEl) {
captionEl.classList.remove(captionAnimationClass);
}
if (weeksEl) {
weeksEl.classList.remove(weeksAnimationClass);
}
currentMonthEl.style.position = "";
currentMonthEl.style.overflow = "";
if (currentMonthEl.contains(previousMonthEl)) {
currentMonthEl.removeChild(previousMonthEl);
}
};
cleanUpFunctions.push(cleanUp);
// animate old displayed month
previousMonthEl.style.pointerEvents = "none";
previousMonthEl.style.position = "absolute";
previousMonthEl.style.overflow = "hidden";
previousMonthEl.setAttribute("aria-hidden", "true");
// hide the weekdays container of the old month and only the new one
const previousWeekdaysEl = queryWeekdaysEl(previousMonthEl);
if (previousWeekdaysEl) {
previousWeekdaysEl.style.opacity = "0";
}
const previousCaptionEl = queryCaptionEl(previousMonthEl);
if (previousCaptionEl) {
previousCaptionEl.classList.add(isAfterPreviousMonth
? classNames[Animation.caption_before_exit]
: classNames[Animation.caption_after_exit]);
previousCaptionEl.addEventListener("animationend", cleanUp);
}
const previousWeeksEl = queryWeeksEl(previousMonthEl);
if (previousWeeksEl) {
previousWeeksEl.classList.add(isAfterPreviousMonth
? classNames[Animation.weeks_before_exit]
: classNames[Animation.weeks_after_exit]);
}
currentMonthEl.insertBefore(previousMonthEl, currentMonthEl.firstChild);
});
}
});
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getDates.js
/**
* Returns all the dates to display in the calendar.
*
* This function calculates the range of dates to display based on the provided
* display months, constraints, and calendar configuration.
*
* @param displayMonths The months to display in the calendar.
* @param maxDate The maximum date to include in the range.
* @param props The DayPicker props, including calendar configuration options.
* @param dateLib The date library to use for date manipulation.
* @returns An array of dates to display in the calendar.
*/
function getDates(displayMonths, maxDate, props, dateLib) {
const firstMonth = displayMonths[0];
const lastMonth = displayMonths[displayMonths.length - 1];
const { ISOWeek, fixedWeeks, broadcastCalendar } = props ?? {};
const { addDays, differenceInCalendarDays, differenceInCalendarMonths, endOfBroadcastWeek, endOfISOWeek, endOfMonth, endOfWeek, isAfter, startOfBroadcastWeek, startOfISOWeek, startOfWeek, } = dateLib;
const startWeekFirstDate = broadcastCalendar
? startOfBroadcastWeek(firstMonth, dateLib)
: ISOWeek
? startOfISOWeek(firstMonth)
: startOfWeek(firstMonth);
const endWeekLastDate = broadcastCalendar
? endOfBroadcastWeek(lastMonth)
: ISOWeek
? endOfISOWeek(endOfMonth(lastMonth))
: endOfWeek(endOfMonth(lastMonth));
const nOfDays = differenceInCalendarDays(endWeekLastDate, startWeekFirstDate);
const nOfMonths = differenceInCalendarMonths(lastMonth, firstMonth) + 1;
const dates = [];
for (let i = 0; i <= nOfDays; i++) {
const date = addDays(startWeekFirstDate, i);
if (maxDate && isAfter(date, maxDate)) {
break;
}
dates.push(date);
}
// If fixed weeks is enabled, add the extra dates to the array
const nrOfDaysWithFixedWeeks = broadcastCalendar ? 35 : 42;
const extraDates = nrOfDaysWithFixedWeeks * nOfMonths;
if (fixedWeeks && dates.length < extraDates) {
const daysToAdd = extraDates - dates.length;
for (let i = 0; i < daysToAdd; i++) {
const date = addDays(dates[dates.length - 1], 1);
dates.push(date);
}
}
return dates;
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getDays.js
/**
* Returns all the days belonging to the calendar by merging the days in the
* weeks for each month.
*
* @param calendarMonths The array of calendar months.
* @returns An array of `CalendarDay` objects representing all the days in the
* calendar.
*/
function getDays(calendarMonths) {
const initialDays = [];
return calendarMonths.reduce((days, month) => {
const weekDays = month.weeks.reduce((weekDays, week) => {
return weekDays.concat(week.days.slice());
}, initialDays.slice());
return days.concat(weekDays.slice());
}, initialDays.slice());
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js
/**
* Returns the months to display in the calendar.
*
* @param firstDisplayedMonth The first month currently displayed in the
* calendar.
* @param calendarEndMonth The latest month the user can navigate to.
* @param props The DayPicker props, including `numberOfMonths`.
* @param dateLib The date library to use for date manipulation.
* @returns An array of dates representing the months to display.
*/
function getDisplayMonths(firstDisplayedMonth, calendarEndMonth, props, dateLib) {
const { numberOfMonths = 1 } = props;
const months = [];
for (let i = 0; i < numberOfMonths; i++) {
const month = dateLib.addMonths(firstDisplayedMonth, i);
if (calendarEndMonth && month > calendarEndMonth) {
break;
}
months.push(month);
}
return months;
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js
/**
* Determines the initial month to display in the calendar based on the provided
* props.
*
* This function calculates the starting month, considering constraints such as
* `startMonth`, `endMonth`, and the number of months to display.
*
* @param props The DayPicker props, including navigation and date constraints.
* @param dateLib The date library to use for date manipulation.
* @returns The initial month to display.
*/
function getInitialMonth(props, navStart, navEnd, dateLib) {
const { month, defaultMonth, today = dateLib.today(), numberOfMonths = 1, } = props;
let initialMonth = month || defaultMonth || today;
const { differenceInCalendarMonths, addMonths, startOfMonth } = dateLib;
if (navEnd &&
differenceInCalendarMonths(navEnd, initialMonth) < numberOfMonths - 1) {
const offset = -1 * (numberOfMonths - 1);
initialMonth = addMonths(navEnd, offset);
}
if (navStart && differenceInCalendarMonths(initialMonth, navStart) < 0) {
initialMonth = navStart;
}
return startOfMonth(initialMonth);
}
;// ./node_modules/react-day-picker/dist/esm/classes/CalendarDay.js
/**
* Represents a day displayed in the calendar.
*
* In DayPicker, a `CalendarDay` is a wrapper around a `Date` object that
* provides additional information about the day, such as whether it belongs to
* the displayed month.
*/
class CalendarDay {
constructor(date, displayMonth, dateLib = DateLib_defaultDateLib) {
this.date = date;
this.displayMonth = displayMonth;
this.outside = Boolean(displayMonth && !dateLib.isSameMonth(date, displayMonth));
this.dateLib = dateLib;
}
/**
* Checks if this day is equal to another `CalendarDay`, considering both the
* date and the displayed month.
*
* @param day The `CalendarDay` to compare with.
* @returns `true` if the days are equal, otherwise `false`.
*/
isEqualTo(day) {
return (this.dateLib.isSameDay(day.date, this.date) &&
this.dateLib.isSameMonth(day.displayMonth, this.displayMonth));
}
}
;// ./node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js
/**
* Represents a week in a calendar month.
*
* A `CalendarWeek` contains the days within the week and the week number.
*/
class CalendarWeek {
constructor(weekNumber, days) {
this.days = days;
this.weekNumber = weekNumber;
}
}
;// ./node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js
/**
* Represents a month in a calendar year.
*
* A `CalendarMonth` contains the weeks within the month and the date of the
* month.
*/
class CalendarMonth {
constructor(month, weeks) {
this.date = month;
this.weeks = weeks;
}
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getMonths.js
/**
* Returns the months to display in the calendar.
*
* This function generates `CalendarMonth` objects for each month to be
* displayed, including their weeks and days, based on the provided display
* months and dates.
*
* @param displayMonths The months (as dates) to display in the calendar.
* @param dates The dates to display in the calendar.
* @param props Options from the DayPicker props context.
* @param dateLib The date library to use for date manipulation.
* @returns An array of `CalendarMonth` objects representing the months to
* display.
*/
function getMonths(displayMonths, dates, props, dateLib) {
const { addDays, endOfBroadcastWeek, endOfISOWeek, endOfMonth, endOfWeek, getISOWeek, getWeek, startOfBroadcastWeek, startOfISOWeek, startOfWeek, } = dateLib;
const dayPickerMonths = displayMonths.reduce((months, month) => {
const firstDateOfFirstWeek = props.broadcastCalendar
? startOfBroadcastWeek(month, dateLib)
: props.ISOWeek
? startOfISOWeek(month)
: startOfWeek(month);
const lastDateOfLastWeek = props.broadcastCalendar
? endOfBroadcastWeek(month)
: props.ISOWeek
? endOfISOWeek(endOfMonth(month))
: endOfWeek(endOfMonth(month));
/** The dates to display in the month. */
const monthDates = dates.filter((date) => {
return date >= firstDateOfFirstWeek && date <= lastDateOfLastWeek;
});
const nrOfDaysWithFixedWeeks = props.broadcastCalendar ? 35 : 42;
if (props.fixedWeeks && monthDates.length < nrOfDaysWithFixedWeeks) {
const extraDates = dates.filter((date) => {
const daysToAdd = nrOfDaysWithFixedWeeks - monthDates.length;
return (date > lastDateOfLastWeek &&
date <= addDays(lastDateOfLastWeek, daysToAdd));
});
monthDates.push(...extraDates);
}
const weeks = monthDates.reduce((weeks, date) => {
const weekNumber = props.ISOWeek ? getISOWeek(date) : getWeek(date);
const week = weeks.find((week) => week.weekNumber === weekNumber);
const day = new CalendarDay(date, month, dateLib);
if (!week) {
weeks.push(new CalendarWeek(weekNumber, [day]));
}
else {
week.days.push(day);
}
return weeks;
}, []);
const dayPickerMonth = new CalendarMonth(month, weeks);
months.push(dayPickerMonth);
return months;
}, []);
if (!props.reverseMonths) {
return dayPickerMonths;
}
else {
return dayPickerMonths.reverse();
}
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js
/**
* Returns the start and end months for calendar navigation.
*
* @param props The DayPicker props, including navigation and layout options.
* @param dateLib The date library to use for date manipulation.
* @returns A tuple containing the start and end months for navigation.
*/
function getNavMonths(props, dateLib) {
let { startMonth, endMonth } = props;
const { startOfYear, startOfDay, startOfMonth, endOfMonth, addYears, endOfYear, newDate, today, } = dateLib;
// Handle deprecated code
const { fromYear, toYear, fromMonth, toMonth } = props;
if (!startMonth && fromMonth) {
startMonth = fromMonth;
}
if (!startMonth && fromYear) {
startMonth = dateLib.newDate(fromYear, 0, 1);
}
if (!endMonth && toMonth) {
endMonth = toMonth;
}
if (!endMonth && toYear) {
endMonth = newDate(toYear, 11, 31);
}
const hasYearDropdown = props.captionLayout === "dropdown" ||
props.captionLayout === "dropdown-years";
if (startMonth) {
startMonth = startOfMonth(startMonth);
}
else if (fromYear) {
startMonth = newDate(fromYear, 0, 1);
}
else if (!startMonth && hasYearDropdown) {
startMonth = startOfYear(addYears(props.today ?? today(), -100));
}
if (endMonth) {
endMonth = endOfMonth(endMonth);
}
else if (toYear) {
endMonth = newDate(toYear, 11, 31);
}
else if (!endMonth && hasYearDropdown) {
endMonth = endOfYear(props.today ?? today());
}
return [
startMonth ? startOfDay(startMonth) : startMonth,
endMonth ? startOfDay(endMonth) : endMonth,
];
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js
/**
* Returns the next month the user can navigate to, based on the given options.
*
* The next month is not always the next calendar month:
*
* - If it is after the `calendarEndMonth`, it returns `undefined`.
* - If paged navigation is enabled, it skips forward by the number of displayed
* months.
*
* @param firstDisplayedMonth The first month currently displayed in the
* calendar.
* @param calendarEndMonth The latest month the user can navigate to.
* @param options Navigation options, including `numberOfMonths` and
* `pagedNavigation`.
* @param dateLib The date library to use for date manipulation.
* @returns The next month, or `undefined` if navigation is not possible.
*/
function getNextMonth(firstDisplayedMonth, calendarEndMonth, options, dateLib) {
if (options.disableNavigation) {
return undefined;
}
const { pagedNavigation, numberOfMonths = 1 } = options;
const { startOfMonth, addMonths, differenceInCalendarMonths } = dateLib;
const offset = pagedNavigation ? numberOfMonths : 1;
const month = startOfMonth(firstDisplayedMonth);
if (!calendarEndMonth) {
return addMonths(month, offset);
}
const monthsDiff = differenceInCalendarMonths(calendarEndMonth, firstDisplayedMonth);
if (monthsDiff < numberOfMonths) {
return undefined;
}
return addMonths(month, offset);
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js
/**
* Returns the previous month the user can navigate to, based on the given
* options.
*
* The previous month is not always the previous calendar month:
*
* - If it is before the `calendarStartMonth`, it returns `undefined`.
* - If paged navigation is enabled, it skips back by the number of displayed
* months.
*
* @param firstDisplayedMonth The first month currently displayed in the
* calendar.
* @param calendarStartMonth The earliest month the user can navigate to.
* @param options Navigation options, including `numberOfMonths` and
* `pagedNavigation`.
* @param dateLib The date library to use for date manipulation.
* @returns The previous month, or `undefined` if navigation is not possible.
*/
function getPreviousMonth(firstDisplayedMonth, calendarStartMonth, options, dateLib) {
if (options.disableNavigation) {
return undefined;
}
const { pagedNavigation, numberOfMonths } = options;
const { startOfMonth, addMonths, differenceInCalendarMonths } = dateLib;
const offset = pagedNavigation ? (numberOfMonths ?? 1) : 1;
const month = startOfMonth(firstDisplayedMonth);
if (!calendarStartMonth) {
return addMonths(month, -offset);
}
const monthsDiff = differenceInCalendarMonths(month, calendarStartMonth);
if (monthsDiff <= 0) {
return undefined;
}
return addMonths(month, -offset);
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getWeeks.js
/**
* Returns an array of calendar weeks from an array of calendar months.
*
* @param months The array of calendar months.
* @returns An array of calendar weeks.
*/
function getWeeks(months) {
const initialWeeks = [];
return months.reduce((weeks, month) => {
return weeks.concat(month.weeks.slice());
}, initialWeeks.slice());
}
;// ./node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js
/**
* A custom hook for managing both controlled and uncontrolled component states.
*
* This hook allows a component to support both controlled and uncontrolled
* states by determining whether the `controlledValue` is provided. If it is
* undefined, the hook falls back to using the internal state.
*
* @example
* // Uncontrolled usage
* const [value, setValue] = useControlledValue(0, undefined);
*
* // Controlled usage
* const [value, setValue] = useControlledValue(0, props.value);
*
* @template T - The type of the value.
* @param defaultValue The initial value for the uncontrolled state.
* @param controlledValue The value for the controlled state. If undefined, the
* component will use the uncontrolled state.
* @returns A tuple where the first element is the current value (either
* controlled or uncontrolled) and the second element is a setter function to
* update the value.
*/
function useControlledValue_useControlledValue(defaultValue, controlledValue) {
const [uncontrolledValue, setValue] = (0,external_React_.useState)(defaultValue);
const value = controlledValue === undefined ? uncontrolledValue : controlledValue;
return [value, setValue];
}
;// ./node_modules/react-day-picker/dist/esm/useCalendar.js
/**
* Provides the calendar object to work with the calendar in custom components.
*
* @private
* @param props - The DayPicker props related to calendar configuration.
* @param dateLib - The date utility library instance.
* @returns The calendar object containing displayed days, weeks, months, and
* navigation methods.
*/
function useCalendar(props, dateLib) {
const [navStart, navEnd] = getNavMonths(props, dateLib);
const { startOfMonth, endOfMonth } = dateLib;
const initialMonth = getInitialMonth(props, navStart, navEnd, dateLib);
const [firstMonth, setFirstMonth] = useControlledValue_useControlledValue(initialMonth,
// initialMonth is always computed from props.month if provided
props.month ? initialMonth : undefined);
// biome-ignore lint/correctness/useExhaustiveDependencies: change the initial month when the time zone changes.
(0,external_React_.useEffect)(() => {
const newInitialMonth = getInitialMonth(props, navStart, navEnd, dateLib);
setFirstMonth(newInitialMonth);
}, [props.timeZone]);
/** The months displayed in the calendar. */
const displayMonths = getDisplayMonths(firstMonth, navEnd, props, dateLib);
/** The dates displayed in the calendar. */
const dates = getDates(displayMonths, props.endMonth ? endOfMonth(props.endMonth) : undefined, props, dateLib);
/** The Months displayed in the calendar. */
const months = getMonths(displayMonths, dates, props, dateLib);
/** The Weeks displayed in the calendar. */
const weeks = getWeeks(months);
/** The Days displayed in the calendar. */
const days = getDays(months);
const previousMonth = getPreviousMonth(firstMonth, navStart, props, dateLib);
const nextMonth = getNextMonth(firstMonth, navEnd, props, dateLib);
const { disableNavigation, onMonthChange } = props;
const isDayInCalendar = (day) => weeks.some((week) => week.days.some((d) => d.isEqualTo(day)));
const goToMonth = (date) => {
if (disableNavigation) {
return;
}
let newMonth = startOfMonth(date);
// if month is before start, use the first month instead
if (navStart && newMonth < startOfMonth(navStart)) {
newMonth = startOfMonth(navStart);
}
// if month is after endMonth, use the last month instead
if (navEnd && newMonth > startOfMonth(navEnd)) {
newMonth = startOfMonth(navEnd);
}
setFirstMonth(newMonth);
onMonthChange?.(newMonth);
};
const goToDay = (day) => {
// is this check necessary?
if (isDayInCalendar(day)) {
return;
}
goToMonth(day.date);
};
const calendar = {
months,
weeks,
days,
navStart,
navEnd,
previousMonth,
nextMonth,
goToMonth,
goToDay,
};
return calendar;
}
;// ./node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js
var FocusTargetPriority;
(function (FocusTargetPriority) {
FocusTargetPriority[FocusTargetPriority["Today"] = 0] = "Today";
FocusTargetPriority[FocusTargetPriority["Selected"] = 1] = "Selected";
FocusTargetPriority[FocusTargetPriority["LastFocused"] = 2] = "LastFocused";
FocusTargetPriority[FocusTargetPriority["FocusedModifier"] = 3] = "FocusedModifier";
})(FocusTargetPriority || (FocusTargetPriority = {}));
/**
* Determines if a day is focusable based on its modifiers.
*
* A day is considered focusable if it is not disabled, hidden, or outside the
* displayed month.
*
* @param modifiers The modifiers applied to the day.
* @returns `true` if the day is focusable, otherwise `false`.
*/
function isFocusableDay(modifiers) {
return (!modifiers[DayFlag.disabled] &&
!modifiers[DayFlag.hidden] &&
!modifiers[DayFlag.outside]);
}
/**
* Calculates the focus target day based on priority.
*
* This function determines the day that should receive focus in the calendar,
* prioritizing days with specific modifiers (e.g., "focused", "today") or
* selection states.
*
* @param days The array of `CalendarDay` objects to evaluate.
* @param getModifiers A function to retrieve the modifiers for a given day.
* @param isSelected A function to determine if a day is selected.
* @param lastFocused The last focused day, if any.
* @returns The `CalendarDay` that should receive focus, or `undefined` if no
* focusable day is found.
*/
function calculateFocusTarget(days, getModifiers, isSelected, lastFocused) {
let focusTarget;
let foundFocusTargetPriority = -1;
for (const day of days) {
const modifiers = getModifiers(day);
if (isFocusableDay(modifiers)) {
if (modifiers[DayFlag.focused] &&
foundFocusTargetPriority < FocusTargetPriority.FocusedModifier) {
focusTarget = day;
foundFocusTargetPriority = FocusTargetPriority.FocusedModifier;
}
else if (lastFocused?.isEqualTo(day) &&
foundFocusTargetPriority < FocusTargetPriority.LastFocused) {
focusTarget = day;
foundFocusTargetPriority = FocusTargetPriority.LastFocused;
}
else if (isSelected(day.date) &&
foundFocusTargetPriority < FocusTargetPriority.Selected) {
focusTarget = day;
foundFocusTargetPriority = FocusTargetPriority.Selected;
}
else if (modifiers[DayFlag.today] &&
foundFocusTargetPriority < FocusTargetPriority.Today) {
focusTarget = day;
foundFocusTargetPriority = FocusTargetPriority.Today;
}
}
}
if (!focusTarget) {
// Return the first day that is focusable
focusTarget = days.find((day) => isFocusableDay(getModifiers(day)));
}
return focusTarget;
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js
/**
* Calculates the next date that should be focused in the calendar.
*
* This function determines the next focusable date based on the movement
* direction, constraints, and calendar configuration.
*
* @param moveBy The unit of movement (e.g., "day", "week").
* @param moveDir The direction of movement ("before" or "after").
* @param refDate The reference date from which to calculate the next focusable
* date.
* @param navStart The earliest date the user can navigate to.
* @param navEnd The latest date the user can navigate to.
* @param props The DayPicker props, including calendar configuration options.
* @param dateLib The date library to use for date manipulation.
* @returns The next focusable date.
*/
function getFocusableDate(moveBy, moveDir, refDate, navStart, navEnd, props, dateLib) {
const { ISOWeek, broadcastCalendar } = props;
const { addDays, addMonths, addWeeks, addYears, endOfBroadcastWeek, endOfISOWeek, endOfWeek, max, min, startOfBroadcastWeek, startOfISOWeek, startOfWeek, } = dateLib;
const moveFns = {
day: addDays,
week: addWeeks,
month: addMonths,
year: addYears,
startOfWeek: (date) => broadcastCalendar
? startOfBroadcastWeek(date, dateLib)
: ISOWeek
? startOfISOWeek(date)
: startOfWeek(date),
endOfWeek: (date) => broadcastCalendar
? endOfBroadcastWeek(date)
: ISOWeek
? endOfISOWeek(date)
: endOfWeek(date),
};
let focusableDate = moveFns[moveBy](refDate, moveDir === "after" ? 1 : -1);
if (moveDir === "before" && navStart) {
focusableDate = max([navStart, focusableDate]);
}
else if (moveDir === "after" && navEnd) {
focusableDate = min([navEnd, focusableDate]);
}
return focusableDate;
}
;// ./node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js
/**
* Determines the next focusable day in the calendar.
*
* This function recursively calculates the next focusable day based on the
* movement direction and modifiers applied to the days.
*
* @param moveBy The unit of movement (e.g., "day", "week").
* @param moveDir The direction of movement ("before" or "after").
* @param refDay The currently focused day.
* @param calendarStartMonth The earliest month the user can navigate to.
* @param calendarEndMonth The latest month the user can navigate to.
* @param props The DayPicker props, including modifiers and configuration
* options.
* @param dateLib The date library to use for date manipulation.
* @param attempt The current recursion attempt (used to limit recursion depth).
* @returns The next focusable day, or `undefined` if no focusable day is found.
*/
function getNextFocus(moveBy, moveDir, refDay, calendarStartMonth, calendarEndMonth, props, dateLib, attempt = 0) {
if (attempt > 365) {
// Limit the recursion to 365 attempts
return undefined;
}
const focusableDate = getFocusableDate(moveBy, moveDir, refDay.date, calendarStartMonth, calendarEndMonth, props, dateLib);
const isDisabled = Boolean(props.disabled &&
dateMatchModifiers(focusableDate, props.disabled, dateLib));
const isHidden = Boolean(props.hidden && dateMatchModifiers(focusableDate, props.hidden, dateLib));
const targetMonth = focusableDate;
const focusDay = new CalendarDay(focusableDate, targetMonth, dateLib);
if (!isDisabled && !isHidden) {
return focusDay;
}
// Recursively attempt to find the next focusable date
return getNextFocus(moveBy, moveDir, focusDay, calendarStartMonth, calendarEndMonth, props, dateLib, attempt + 1);
}
;// ./node_modules/react-day-picker/dist/esm/useFocus.js
/**
* Manages focus behavior for the DayPicker component, including setting,
* moving, and blurring focus on calendar days.
*
* @template T - The type of DayPicker props.
* @param props - The DayPicker props.
* @param calendar - The calendar object containing the displayed days and
* months.
* @param getModifiers - A function to retrieve modifiers for a given day.
* @param isSelected - A function to check if a date is selected.
* @param dateLib - The date utility library instance.
* @returns An object containing focus-related methods and the currently focused
* day.
*/
function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
const { autoFocus } = props;
const [lastFocused, setLastFocused] = (0,external_React_.useState)();
const focusTarget = calculateFocusTarget(calendar.days, getModifiers, isSelected || (() => false), lastFocused);
const [focusedDay, setFocused] = (0,external_React_.useState)(autoFocus ? focusTarget : undefined);
const blur = () => {
setLastFocused(focusedDay);
setFocused(undefined);
};
const moveFocus = (moveBy, moveDir) => {
if (!focusedDay)
return;
const nextFocus = getNextFocus(moveBy, moveDir, focusedDay, calendar.navStart, calendar.navEnd, props, dateLib);
if (!nextFocus)
return;
if (props.disableNavigation) {
const isNextInCalendar = calendar.days.some((day) => day.isEqualTo(nextFocus));
if (!isNextInCalendar) {
return;
}
}
calendar.goToDay(nextFocus);
setFocused(nextFocus);
};
const isFocusTarget = (day) => {
return Boolean(focusTarget?.isEqualTo(day));
};
const useFocus = {
isFocusTarget,
setFocused,
focused: focusedDay,
blur,
moveFocus,
};
return useFocus;
}
;// ./node_modules/react-day-picker/dist/esm/selection/useMulti.js
/**
* Hook to manage multiple-date selection in the DayPicker component.
*
* @template T - The type of DayPicker props.
* @param props - The DayPicker props.
* @param dateLib - The date utility library instance.
* @returns An object containing the selected dates, a function to select dates,
* and a function to check if a date is selected.
*/
function useMulti(props, dateLib) {
const { selected: initiallySelected, required, onSelect, } = props;
const [internallySelected, setSelected] = useControlledValue_useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);
const selected = !onSelect ? internallySelected : initiallySelected;
const { isSameDay } = dateLib;
const isSelected = (date) => {
return selected?.some((d) => isSameDay(d, date)) ?? false;
};
const { min, max } = props;
const select = (triggerDate, modifiers, e) => {
let newDates = [...(selected ?? [])];
if (isSelected(triggerDate)) {
if (selected?.length === min) {
// Min value reached, do nothing
return;
}
if (required && selected?.length === 1) {
// Required value already selected do nothing
return;
}
newDates = selected?.filter((d) => !isSameDay(d, triggerDate));
}
else {
if (selected?.length === max) {
// Max value reached, reset the selection to date
newDates = [triggerDate];
}
else {
// Add the date to the selection
newDates = [...newDates, triggerDate];
}
}
if (!onSelect) {
setSelected(newDates);
}
onSelect?.(newDates, triggerDate, modifiers, e);
return newDates;
};
return {
selected,
select,
isSelected,
};
}
;// ./node_modules/react-day-picker/dist/esm/utils/addToRange.js
/**
* Adds a date to an existing range, considering constraints like minimum and
* maximum range size.
*
* @param date - The date to add to the range.
* @param initialRange - The initial range to which the date will be added.
* @param min - The minimum number of days in the range.
* @param max - The maximum number of days in the range.
* @param required - Whether the range must always include at least one date.
* @param dateLib - The date utility library instance.
* @returns The updated date range, or `undefined` if the range is cleared.
* @group Utilities
*/
function addToRange(date, initialRange, min = 0, max = 0, required = false, dateLib = DateLib_defaultDateLib) {
const { from, to } = initialRange || {};
const { isSameDay, isAfter, isBefore } = dateLib;
let range;
if (!from && !to) {
// the range is empty, add the date
range = { from: date, to: min > 0 ? undefined : date };
}
else if (from && !to) {
// adding date to an incomplete range
if (isSameDay(from, date)) {
// adding a date equal to the start of the range
if (min === 0) {
range = { from, to: date };
}
else if (required) {
range = { from, to: undefined };
}
else {
range = undefined;
}
}
else if (isBefore(date, from)) {
// adding a date before the start of the range
range = { from: date, to: from };
}
else {
// adding a date after the start of the range
range = { from, to: date };
}
}
else if (from && to) {
// adding date to a complete range
if (isSameDay(from, date) && isSameDay(to, date)) {
// adding a date that is equal to both start and end of the range
if (required) {
range = { from, to };
}
else {
range = undefined;
}
}
else if (isSameDay(from, date)) {
// adding a date equal to the the start of the range
range = { from, to: min > 0 ? undefined : date };
}
else if (isSameDay(to, date)) {
// adding a dare equal to the end of the range
range = { from: date, to: min > 0 ? undefined : date };
}
else if (isBefore(date, from)) {
// adding a date before the start of the range
range = { from: date, to: to };
}
else if (isAfter(date, from)) {
// adding a date after the start of the range
range = { from, to: date };
}
else if (isAfter(date, to)) {
// adding a date after the end of the range
range = { from, to: date };
}
else {
throw new Error("Invalid range");
}
}
// check for min / max
if (range?.from && range?.to) {
const diff = dateLib.differenceInCalendarDays(range.to, range.from);
if (max > 0 && diff > max) {
range = { from: date, to: undefined };
}
else if (min > 1 && diff < min) {
range = { from: date, to: undefined };
}
}
return range;
}
;// ./node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js
/**
* Checks if a date range contains one or more specified days of the week.
*
* @since 9.2.2
* @param range - The date range to check.
* @param dayOfWeek - The day(s) of the week to check for (`0-6`, where `0` is
* Sunday).
* @param dateLib - The date utility library instance.
* @returns `true` if the range contains the specified day(s) of the week,
* otherwise `false`.
* @group Utilities
*/
function rangeContainsDayOfWeek(range, dayOfWeek, dateLib = DateLib_defaultDateLib) {
const dayOfWeekArr = !Array.isArray(dayOfWeek) ? [dayOfWeek] : dayOfWeek;
let date = range.from;
const totalDays = dateLib.differenceInCalendarDays(range.to, range.from);
// iterate at maximum one week or the total days if the range is shorter than one week
const totalDaysLimit = Math.min(totalDays, 6);
for (let i = 0; i <= totalDaysLimit; i++) {
if (dayOfWeekArr.includes(date.getDay())) {
return true;
}
date = dateLib.addDays(date, 1);
}
return false;
}
;// ./node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js
/**
* Determines if two date ranges overlap.
*
* @since 9.2.2
* @param rangeLeft - The first date range.
* @param rangeRight - The second date range.
* @param dateLib - The date utility library instance.
* @returns `true` if the ranges overlap, otherwise `false`.
* @group Utilities
*/
function rangeOverlaps(rangeLeft, rangeRight, dateLib = DateLib_defaultDateLib) {
return (rangeIncludesDate(rangeLeft, rangeRight.from, false, dateLib) ||
rangeIncludesDate(rangeLeft, rangeRight.to, false, dateLib) ||
rangeIncludesDate(rangeRight, rangeLeft.from, false, dateLib) ||
rangeIncludesDate(rangeRight, rangeLeft.to, false, dateLib));
}
;// ./node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js
/**
* Checks if a date range contains dates that match the given modifiers.
*
* @since 9.2.2
* @param range - The date range to check.
* @param modifiers - The modifiers to match against.
* @param dateLib - The date utility library instance.
* @returns `true` if the range contains matching dates, otherwise `false`.
* @group Utilities
*/
function rangeContainsModifiers(range, modifiers, dateLib = DateLib_defaultDateLib) {
const matchers = Array.isArray(modifiers) ? modifiers : [modifiers];
// Defer function matchers evaluation as they are the least performant.
const nonFunctionMatchers = matchers.filter((matcher) => typeof matcher !== "function");
const nonFunctionMatchersResult = nonFunctionMatchers.some((matcher) => {
if (typeof matcher === "boolean")
return matcher;
if (dateLib.isDate(matcher)) {
return rangeIncludesDate(range, matcher, false, dateLib);
}
if (isDatesArray(matcher, dateLib)) {
return matcher.some((date) => rangeIncludesDate(range, date, false, dateLib));
}
if (isDateRange(matcher)) {
if (matcher.from && matcher.to) {
return rangeOverlaps(range, { from: matcher.from, to: matcher.to }, dateLib);
}
return false;
}
if (isDayOfWeekType(matcher)) {
return rangeContainsDayOfWeek(range, matcher.dayOfWeek, dateLib);
}
if (isDateInterval(matcher)) {
const isClosedInterval = dateLib.isAfter(matcher.before, matcher.after);
if (isClosedInterval) {
return rangeOverlaps(range, {
from: dateLib.addDays(matcher.after, 1),
to: dateLib.addDays(matcher.before, -1),
}, dateLib);
}
return (dateMatchModifiers(range.from, matcher, dateLib) ||
dateMatchModifiers(range.to, matcher, dateLib));
}
if (isDateAfterType(matcher) || isDateBeforeType(matcher)) {
return (dateMatchModifiers(range.from, matcher, dateLib) ||
dateMatchModifiers(range.to, matcher, dateLib));
}
return false;
});
if (nonFunctionMatchersResult) {
return true;
}
const functionMatchers = matchers.filter((matcher) => typeof matcher === "function");
if (functionMatchers.length) {
let date = range.from;
const totalDays = dateLib.differenceInCalendarDays(range.to, range.from);
for (let i = 0; i <= totalDays; i++) {
if (functionMatchers.some((matcher) => matcher(date))) {
return true;
}
date = dateLib.addDays(date, 1);
}
}
return false;
}
;// ./node_modules/react-day-picker/dist/esm/selection/useRange.js
/**
* Hook to manage range selection in the DayPicker component.
*
* @template T - The type of DayPicker props.
* @param props - The DayPicker props.
* @param dateLib - The date utility library instance.
* @returns An object containing the selected range, a function to select a
* range, and a function to check if a date is within the range.
*/
function useRange(props, dateLib) {
const { disabled, excludeDisabled, selected: initiallySelected, required, onSelect, } = props;
const [internallySelected, setSelected] = useControlledValue_useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);
const selected = !onSelect ? internallySelected : initiallySelected;
const isSelected = (date) => selected && rangeIncludesDate(selected, date, false, dateLib);
const select = (triggerDate, modifiers, e) => {
const { min, max } = props;
const newRange = triggerDate
? addToRange(triggerDate, selected, min, max, required, dateLib)
: undefined;
if (excludeDisabled && disabled && newRange?.from && newRange.to) {
if (rangeContainsModifiers({ from: newRange.from, to: newRange.to }, disabled, dateLib)) {
// if a disabled days is found, the range is reset
newRange.from = triggerDate;
newRange.to = undefined;
}
}
if (!onSelect) {
setSelected(newRange);
}
onSelect?.(newRange, triggerDate, modifiers, e);
return newRange;
};
return {
selected,
select,
isSelected,
};
}
;// ./node_modules/react-day-picker/dist/esm/selection/useSingle.js
/**
* Hook to manage single-date selection in the DayPicker component.
*
* @template T - The type of DayPicker props.
* @param props - The DayPicker props.
* @param dateLib - The date utility library instance.
* @returns An object containing the selected date, a function to select a date,
* and a function to check if a date is selected.
*/
function useSingle(props, dateLib) {
const { selected: initiallySelected, required, onSelect, } = props;
const [internallySelected, setSelected] = useControlledValue_useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);
const selected = !onSelect ? internallySelected : initiallySelected;
const { isSameDay } = dateLib;
const isSelected = (compareDate) => {
return selected ? isSameDay(selected, compareDate) : false;
};
const select = (triggerDate, modifiers, e) => {
let newDate = triggerDate;
if (!required && selected && selected && isSameDay(triggerDate, selected)) {
// If the date is the same, clear the selection.
newDate = undefined;
}
if (!onSelect) {
setSelected(newDate);
}
if (required) {
onSelect?.(newDate, triggerDate, modifiers, e);
}
else {
onSelect?.(newDate, triggerDate, modifiers, e);
}
return newDate;
};
return {
selected,
select,
isSelected,
};
}
;// ./node_modules/react-day-picker/dist/esm/useSelection.js
/**
* Determines the appropriate selection hook to use based on the selection mode
* and returns the corresponding selection object.
*
* @template T - The type of DayPicker props.
* @param props - The DayPicker props.
* @param dateLib - The date utility library instance.
* @returns The selection object for the specified mode, or `undefined` if no
* mode is set.
*/
function useSelection(props, dateLib) {
const single = useSingle(props, dateLib);
const multi = useMulti(props, dateLib);
const range = useRange(props, dateLib);
switch (props.mode) {
case "single":
return single;
case "multiple":
return multi;
case "range":
return range;
default:
return undefined;
}
}
;// ./node_modules/react-day-picker/dist/esm/DayPicker.js
/**
* Renders the DayPicker calendar component.
*
* @param initialProps - The props for the DayPicker component.
* @returns The rendered DayPicker component.
* @group DayPicker
* @see https://daypicker.dev
*/
function DayPicker(initialProps) {
let props = initialProps;
if (props.timeZone) {
props = {
...initialProps,
};
if (props.today) {
props.today = new date_TZDate(props.today, props.timeZone);
}
if (props.month) {
props.month = new date_TZDate(props.month, props.timeZone);
}
if (props.defaultMonth) {
props.defaultMonth = new date_TZDate(props.defaultMonth, props.timeZone);
}
if (props.startMonth) {
props.startMonth = new date_TZDate(props.startMonth, props.timeZone);
}
if (props.endMonth) {
props.endMonth = new date_TZDate(props.endMonth, props.timeZone);
}
if (props.mode === "single" && props.selected) {
props.selected = new date_TZDate(props.selected, props.timeZone);
}
else if (props.mode === "multiple" && props.selected) {
props.selected = props.selected?.map((date) => new date_TZDate(date, props.timeZone));
}
else if (props.mode === "range" && props.selected) {
props.selected = {
from: props.selected.from
? new date_TZDate(props.selected.from, props.timeZone)
: undefined,
to: props.selected.to
? new date_TZDate(props.selected.to, props.timeZone)
: undefined,
};
}
}
const { components, formatters, labels, dateLib, locale, classNames } = (0,external_React_.useMemo)(() => {
const locale = { ...en_US_enUS, ...props.locale };
const dateLib = new DateLib({
locale,
weekStartsOn: props.broadcastCalendar ? 1 : props.weekStartsOn,
firstWeekContainsDate: props.firstWeekContainsDate,
useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
timeZone: props.timeZone,
numerals: props.numerals,
}, props.dateLib);
return {
dateLib,
components: getComponents(props.components),
formatters: getFormatters(props.formatters),
labels: { ...labels_namespaceObject, ...props.labels },
locale,
classNames: { ...getDefaultClassNames(), ...props.classNames },
};
}, [
props.locale,
props.broadcastCalendar,
props.weekStartsOn,
props.firstWeekContainsDate,
props.useAdditionalWeekYearTokens,
props.useAdditionalDayOfYearTokens,
props.timeZone,
props.numerals,
props.dateLib,
props.components,
props.formatters,
props.labels,
props.classNames,
]);
const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles, } = props;
const { formatCaption, formatDay, formatMonthDropdown, formatWeekNumber, formatWeekNumberHeader, formatWeekdayName, formatYearDropdown, } = formatters;
const calendar = useCalendar(props, dateLib);
const { days, months, navStart, navEnd, previousMonth, nextMonth, goToMonth, } = calendar;
const getModifiers = createGetModifiers(days, props, navStart, navEnd, dateLib);
const { isSelected, select, selected: selectedValue, } = useSelection(props, dateLib) ?? {};
const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected ?? (() => false), dateLib);
const { labelDayButton, labelGridcell, labelGrid, labelMonthDropdown, labelNav, labelPrevious, labelNext, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown, } = labels;
const weekdays = (0,external_React_.useMemo)(() => getWeekdays(dateLib, props.ISOWeek), [dateLib, props.ISOWeek]);
const isInteractive = mode !== undefined || onDayClick !== undefined;
const handlePreviousClick = (0,external_React_.useCallback)(() => {
if (!previousMonth)
return;
goToMonth(previousMonth);
onPrevClick?.(previousMonth);
}, [previousMonth, goToMonth, onPrevClick]);
const handleNextClick = (0,external_React_.useCallback)(() => {
if (!nextMonth)
return;
goToMonth(nextMonth);
onNextClick?.(nextMonth);
}, [goToMonth, nextMonth, onNextClick]);
const handleDayClick = (0,external_React_.useCallback)((day, m) => (e) => {
e.preventDefault();
e.stopPropagation();
setFocused(day);
select?.(day.date, m, e);
onDayClick?.(day.date, m, e);
}, [select, onDayClick, setFocused]);
const handleDayFocus = (0,external_React_.useCallback)((day, m) => (e) => {
setFocused(day);
onDayFocus?.(day.date, m, e);
}, [onDayFocus, setFocused]);
const handleDayBlur = (0,external_React_.useCallback)((day, m) => (e) => {
blur();
onDayBlur?.(day.date, m, e);
}, [blur, onDayBlur]);
const handleDayKeyDown = (0,external_React_.useCallback)((day, modifiers) => (e) => {
const keyMap = {
ArrowLeft: [
e.shiftKey ? "month" : "day",
props.dir === "rtl" ? "after" : "before",
],
ArrowRight: [
e.shiftKey ? "month" : "day",
props.dir === "rtl" ? "before" : "after",
],
ArrowDown: [e.shiftKey ? "year" : "week", "after"],
ArrowUp: [e.shiftKey ? "year" : "week", "before"],
PageUp: [e.shiftKey ? "year" : "month", "before"],
PageDown: [e.shiftKey ? "year" : "month", "after"],
Home: ["startOfWeek", "before"],
End: ["endOfWeek", "after"],
};
if (keyMap[e.key]) {
e.preventDefault();
e.stopPropagation();
const [moveBy, moveDir] = keyMap[e.key];
moveFocus(moveBy, moveDir);
}
onDayKeyDown?.(day.date, modifiers, e);
}, [moveFocus, onDayKeyDown, props.dir]);
const handleDayMouseEnter = (0,external_React_.useCallback)((day, modifiers) => (e) => {
onDayMouseEnter?.(day.date, modifiers, e);
}, [onDayMouseEnter]);
const handleDayMouseLeave = (0,external_React_.useCallback)((day, modifiers) => (e) => {
onDayMouseLeave?.(day.date, modifiers, e);
}, [onDayMouseLeave]);
const handleMonthChange = (0,external_React_.useCallback)((date) => (e) => {
const selectedMonth = Number(e.target.value);
const month = dateLib.setMonth(dateLib.startOfMonth(date), selectedMonth);
goToMonth(month);
}, [dateLib, goToMonth]);
const handleYearChange = (0,external_React_.useCallback)((date) => (e) => {
const selectedYear = Number(e.target.value);
const month = dateLib.setYear(dateLib.startOfMonth(date), selectedYear);
goToMonth(month);
}, [dateLib, goToMonth]);
const { className, style } = (0,external_React_.useMemo)(() => ({
className: [classNames[UI_UI.Root], props.className]
.filter(Boolean)
.join(" "),
style: { ...styles?.[UI_UI.Root], ...props.style },
}), [classNames, props.className, props.style, styles]);
const dataAttributes = getDataAttributes(props);
const rootElRef = (0,external_React_.useRef)(null);
useAnimation(rootElRef, Boolean(props.animate), {
classNames,
months,
focused,
dateLib,
});
const contextValue = {
dayPickerProps: props,
selected: selectedValue,
select: select,
isSelected,
months,
nextMonth,
previousMonth,
goToMonth,
getModifiers,
components,
classNames,
styles,
labels,
formatters,
};
return (external_React_.createElement(dayPickerContext.Provider, { value: contextValue },
external_React_.createElement(components.Root, { rootRef: props.animate ? rootElRef : undefined, className: className, style: style, dir: props.dir, id: props.id, lang: props.lang, nonce: props.nonce, title: props.title, role: props.role, "aria-label": props["aria-label"], "aria-labelledby": props["aria-labelledby"], ...dataAttributes },
external_React_.createElement(components.Months, { className: classNames[UI_UI.Months], style: styles?.[UI_UI.Months] },
!props.hideNavigation && !navLayout && (external_React_.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : undefined, className: classNames[UI_UI.Nav], style: styles?.[UI_UI.Nav], "aria-label": labelNav(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth: previousMonth, nextMonth: nextMonth })),
months.map((calendarMonth, displayIndex) => {
return (external_React_.createElement(components.Month, { "data-animated-month": props.animate ? "true" : undefined, className: classNames[UI_UI.Month], style: styles?.[UI_UI.Month],
// biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
key: displayIndex, displayIndex: displayIndex, calendarMonth: calendarMonth },
navLayout === "around" &&
!props.hideNavigation &&
displayIndex === 0 && (external_React_.createElement(components.PreviousMonthButton, { type: "button", className: classNames[UI_UI.PreviousMonthButton], tabIndex: previousMonth ? undefined : -1, "aria-disabled": previousMonth ? undefined : true, "aria-label": labelPrevious(previousMonth), onClick: handlePreviousClick, "data-animated-button": props.animate ? "true" : undefined },
external_React_.createElement(components.Chevron, { disabled: previousMonth ? undefined : true, className: classNames[UI_UI.Chevron], orientation: props.dir === "rtl" ? "right" : "left" }))),
external_React_.createElement(components.MonthCaption, { "data-animated-caption": props.animate ? "true" : undefined, className: classNames[UI_UI.MonthCaption], style: styles?.[UI_UI.MonthCaption], calendarMonth: calendarMonth, displayIndex: displayIndex }, captionLayout?.startsWith("dropdown") ? (external_React_.createElement(components.DropdownNav, { className: classNames[UI_UI.Dropdowns], style: styles?.[UI_UI.Dropdowns] },
(() => {
const monthControl = captionLayout === "dropdown" ||
captionLayout === "dropdown-months" ? (external_React_.createElement(components.MonthsDropdown, { key: "month", className: classNames[UI_UI.MonthsDropdown], "aria-label": labelMonthDropdown(), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleMonthChange(calendarMonth.date), options: getMonthOptions(calendarMonth.date, navStart, navEnd, formatters, dateLib), style: styles?.[UI_UI.Dropdown], value: dateLib.getMonth(calendarMonth.date) })) : (external_React_.createElement("span", { key: "month" }, formatMonthDropdown(calendarMonth.date, dateLib)));
const yearControl = captionLayout === "dropdown" ||
captionLayout === "dropdown-years" ? (external_React_.createElement(components.YearsDropdown, { key: "year", className: classNames[UI_UI.YearsDropdown], "aria-label": labelYearDropdown(dateLib.options), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date), options: getYearOptions(navStart, navEnd, formatters, dateLib, Boolean(props.reverseYears)), style: styles?.[UI_UI.Dropdown], value: dateLib.getYear(calendarMonth.date) })) : (external_React_.createElement("span", { key: "year" }, formatYearDropdown(calendarMonth.date, dateLib)));
const controls = dateLib.getMonthYearOrder() === "year-first"
? [yearControl, monthControl]
: [monthControl, yearControl];
return controls;
})(),
external_React_.createElement("span", { role: "status", "aria-live": "polite", style: {
border: 0,
clip: "rect(0 0 0 0)",
height: "1px",
margin: "-1px",
overflow: "hidden",
padding: 0,
position: "absolute",
width: "1px",
whiteSpace: "nowrap",
wordWrap: "normal",
} }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (
// biome-ignore lint/a11y/useSemanticElements: breaking change
external_React_.createElement(components.CaptionLabel, { className: classNames[UI_UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))),
navLayout === "around" &&
!props.hideNavigation &&
displayIndex === numberOfMonths - 1 && (external_React_.createElement(components.NextMonthButton, { type: "button", className: classNames[UI_UI.NextMonthButton], tabIndex: nextMonth ? undefined : -1, "aria-disabled": nextMonth ? undefined : true, "aria-label": labelNext(nextMonth), onClick: handleNextClick, "data-animated-button": props.animate ? "true" : undefined },
external_React_.createElement(components.Chevron, { disabled: nextMonth ? undefined : true, className: classNames[UI_UI.Chevron], orientation: props.dir === "rtl" ? "left" : "right" }))),
displayIndex === numberOfMonths - 1 &&
navLayout === "after" &&
!props.hideNavigation && (external_React_.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : undefined, className: classNames[UI_UI.Nav], style: styles?.[UI_UI.Nav], "aria-label": labelNav(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth: previousMonth, nextMonth: nextMonth })),
external_React_.createElement(components.MonthGrid, { role: "grid", "aria-multiselectable": mode === "multiple" || mode === "range", "aria-label": labelGrid(calendarMonth.date, dateLib.options, dateLib) ||
undefined, className: classNames[UI_UI.MonthGrid], style: styles?.[UI_UI.MonthGrid] },
!props.hideWeekdays && (external_React_.createElement(components.Weekdays, { "data-animated-weekdays": props.animate ? "true" : undefined, className: classNames[UI_UI.Weekdays], style: styles?.[UI_UI.Weekdays] },
showWeekNumber && (external_React_.createElement(components.WeekNumberHeader, { "aria-label": labelWeekNumberHeader(dateLib.options), className: classNames[UI_UI.WeekNumberHeader], style: styles?.[UI_UI.WeekNumberHeader], scope: "col" }, formatWeekNumberHeader())),
weekdays.map((weekday) => (external_React_.createElement(components.Weekday, { "aria-label": labelWeekday(weekday, dateLib.options, dateLib), className: classNames[UI_UI.Weekday], key: String(weekday), style: styles?.[UI_UI.Weekday], scope: "col" }, formatWeekdayName(weekday, dateLib.options, dateLib)))))),
external_React_.createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : undefined, className: classNames[UI_UI.Weeks], style: styles?.[UI_UI.Weeks] }, calendarMonth.weeks.map((week) => {
return (external_React_.createElement(components.Week, { className: classNames[UI_UI.Week], key: week.weekNumber, style: styles?.[UI_UI.Week], week: week },
showWeekNumber && (
// biome-ignore lint/a11y/useSemanticElements: react component
external_React_.createElement(components.WeekNumber, { week: week, style: styles?.[UI_UI.WeekNumber], "aria-label": labelWeekNumber(week.weekNumber, {
locale,
}), className: classNames[UI_UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber(week.weekNumber, dateLib))),
week.days.map((day) => {
const { date } = day;
const modifiers = getModifiers(day);
modifiers[DayFlag.focused] =
!modifiers.hidden &&
Boolean(focused?.isEqualTo(day));
modifiers[SelectionState.selected] =
isSelected?.(date) || modifiers.selected;
if (isDateRange(selectedValue)) {
// add range modifiers
const { from, to } = selectedValue;
modifiers[SelectionState.range_start] = Boolean(from && to && dateLib.isSameDay(date, from));
modifiers[SelectionState.range_end] = Boolean(from && to && dateLib.isSameDay(date, to));
modifiers[SelectionState.range_middle] =
rangeIncludesDate(selectedValue, date, true, dateLib);
}
const style = getStyleForModifiers(modifiers, styles, props.modifiersStyles);
const className = getClassNamesForModifiers(modifiers, classNames, props.modifiersClassNames);
const ariaLabel = !isInteractive && !modifiers.hidden
? labelGridcell(date, modifiers, dateLib.options, dateLib)
: undefined;
return (
// biome-ignore lint/a11y/useSemanticElements: react component
external_React_.createElement(components.Day, { key: `${dateLib.format(date, "yyyy-MM-dd")}_${dateLib.format(day.displayMonth, "yyyy-MM")}`, day: day, modifiers: modifiers, className: className.join(" "), style: style, role: "gridcell", "aria-selected": modifiers.selected || undefined, "aria-label": ariaLabel, "data-day": dateLib.format(date, "yyyy-MM-dd"), "data-month": day.outside
? dateLib.format(date, "yyyy-MM")
: undefined, "data-selected": modifiers.selected || undefined, "data-disabled": modifiers.disabled || undefined, "data-hidden": modifiers.hidden || undefined, "data-outside": day.outside || undefined, "data-focused": modifiers.focused || undefined, "data-today": modifiers.today || undefined }, !modifiers.hidden && isInteractive ? (external_React_.createElement(components.DayButton, { className: classNames[UI_UI.DayButton], style: styles?.[UI_UI.DayButton], type: "button", day: day, modifiers: modifiers, disabled: modifiers.disabled || undefined, tabIndex: isFocusTarget(day) ? 0 : -1, "aria-label": labelDayButton(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay(date, dateLib.options, dateLib))) : (!modifiers.hidden &&
formatDay(day.date, dateLib.options, dateLib))));
})));
})))));
})),
props.footer && (
// biome-ignore lint/a11y/useSemanticElements: react component
external_React_.createElement(components.Footer, { className: classNames[UI_UI.Footer], style: styles?.[UI_UI.Footer], role: "status", "aria-live": "polite" }, props.footer)))));
}
;// ./node_modules/@wordpress/components/build-module/calendar/utils/day-cell.js
const PreviewDashStartAndEnd = () => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("svg", {
viewBox: "0 0 32 32",
xmlns: "http://www.w3.org/2000/svg",
fill: "none",
stroke: "currentColor",
strokeDasharray: "3.7677",
strokeDashoffset: "3.2",
strokeWidth: "1",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("path", {
d: "M29.5,0.5 h-27 a2,2 0 0 0 -2,2 v27 a2,2 0 0 0 2,2 h27 a2,2 0 0 0 2,-2 v-27 a2,2 0 0 0 -2,-2"
})
});
};
const PreviewDashStart = () => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("svg", {
viewBox: "0 0 32 32",
xmlns: "http://www.w3.org/2000/svg",
fill: "none",
stroke: "currentColor",
strokeDasharray: "3.84516",
strokeDashoffset: "1.9226",
strokeWidth: "1",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("path", {
d: "M32,0.5 h-29.5 a2,2 0 0 0 -2,2 v27 a2,2 0 0 0 2,2 h30"
})
});
};
const PreviewDashMiddle = () => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("svg", {
viewBox: "0 0 32 32",
xmlns: "http://www.w3.org/2000/svg",
fill: "none",
stroke: "currentColor",
strokeDasharray: "3.9 4",
strokeDashoffset: "2",
strokeWidth: "1",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("line", {
x1: "0",
y1: "0.5",
x2: "100",
y2: "0.5"
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("line", {
x1: "0",
y1: "31.5",
x2: "100",
y2: "31.5"
})]
});
};
const PreviewDashEnd = () => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("svg", {
viewBox: "0 0 32 32",
xmlns: "http://www.w3.org/2000/svg",
fill: "none",
stroke: "currentColor",
strokeDasharray: "3.84516",
strokeDashoffset: "1.9226",
strokeWidth: "1",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("path", {
d: "M0,0.5 h29.5 a2,2 0 0 1 2,2 v27 a2,2 0 0 1 -2,2 h-29.5"
})
});
};
function day_cell_Day(props) {
const {
day,
modifiers,
children,
...tdProps
} = props;
let PreviewDash;
if (modifiers.preview_start && modifiers.preview_end) {
PreviewDash = PreviewDashStartAndEnd;
} else if (modifiers.preview_start) {
PreviewDash = PreviewDashStart;
} else if (modifiers.preview_end) {
PreviewDash = PreviewDashEnd;
} else if (modifiers.preview) {
PreviewDash = PreviewDashMiddle;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("td", {
...tdProps,
children: [PreviewDash && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewDash, {}), children]
});
}
;// ./node_modules/@wordpress/components/build-module/calendar/utils/constants.js
const CLASSNAMES = {
root: "components-calendar",
day: "components-calendar__day",
day_button: "components-calendar__day-button",
caption_label: "components-calendar__caption-label",
button_next: "components-calendar__button-next",
button_previous: "components-calendar__button-previous",
chevron: "components-calendar__chevron",
nav: "components-calendar__nav",
month_caption: "components-calendar__month-caption",
months: "components-calendar__months",
month_grid: "components-calendar__month-grid",
weekday: "components-calendar__weekday",
today: "components-calendar__day--today",
selected: "components-calendar__day--selected",
disabled: "components-calendar__day--disabled",
hidden: "components-calendar__day--hidden",
range_start: "components-calendar__range-start",
range_end: "components-calendar__range-end",
range_middle: "components-calendar__range-middle",
weeks_before_enter: "components-calendar__weeks-before-enter",
weeks_before_exit: "components-calendar__weeks-before-exit",
weeks_after_enter: "components-calendar__weeks-after-enter",
weeks_after_exit: "components-calendar__weeks-after-exit",
caption_after_enter: "components-calendar__caption-after-enter",
caption_after_exit: "components-calendar__caption-after-exit",
caption_before_enter: "components-calendar__caption-before-enter",
caption_before_exit: "components-calendar__caption-before-exit"
};
const MODIFIER_CLASSNAMES = {
preview: "components-calendar__day--preview",
preview_start: "components-calendar__day--preview-start",
preview_end: "components-calendar__day--preview-end"
};
const COMMON_PROPS = {
animate: true,
// Only show days in the current month
showOutsideDays: false,
// Hide week number column
showWeekNumber: false,
// Show weekdays row
hideWeekdays: false,
// Month and year caption are not interactive
captionLayout: "label",
// Show a variable number of weeks depending on the month
fixedWeeks: false,
// Show navigation buttons
hideNavigation: false,
// Class names
classNames: CLASSNAMES,
// Default role
role: "application",
components: {
Day: day_cell_Day
}
};
;// ./node_modules/@wordpress/components/build-module/calendar/utils/misc.js
function clampNumberOfMonths(numberOfMonths) {
return Math.min(3, Math.max(1, numberOfMonths));
}
;// ./node_modules/@wordpress/components/build-module/calendar/utils/use-localization-props.js
function isLocaleRTL(localeCode) {
const localeObj = new Intl.Locale(localeCode);
if ("getTextInfo" in localeObj) {
return localeObj.getTextInfo().direction === "rtl";
}
return [
"ar",
// Arabic
"he",
// Hebrew
"fa",
// Persian (Farsi)
"ur",
// Urdu
"ps",
// Pashto
"syr",
// Syriac
"dv",
// Divehi
"ku",
// Kurdish (Sorani)
"yi"
// Yiddish
].includes(localeObj.language);
}
const useLocalizationProps = ({
locale,
timeZone,
mode
}) => {
return (0,external_wp_element_namespaceObject.useMemo)(() => {
const monthNameFormatter = new Intl.DateTimeFormat(locale.code, {
year: "numeric",
month: "long",
timeZone
});
const weekdayNarrowFormatter = new Intl.DateTimeFormat(locale.code, {
weekday: "narrow",
timeZone
});
const weekdayLongFormatter = new Intl.DateTimeFormat(locale.code, {
weekday: "long",
timeZone
});
const fullDateFormatter = new Intl.DateTimeFormat(locale.code, {
weekday: "long",
year: "numeric",
month: "long",
day: "numeric",
timeZone
});
return {
"aria-label": mode === "single" ? (0,external_wp_i18n_namespaceObject.__)("Date calendar") : (0,external_wp_i18n_namespaceObject.__)("Date range calendar"),
labels: {
/**
* The label for the month grid.
* @param date
*/
labelGrid: (date) => monthNameFormatter.format(date),
/**
* The label for the gridcell, when the calendar is not interactive.
* @param date
* @param modifiers
*/
labelGridcell: (date, modifiers) => {
const formattedDate = fullDateFormatter.format(date);
let label = formattedDate;
if (modifiers?.today) {
label = (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s is the full date (e.g. "Monday, April 29, 2025")
(0,external_wp_i18n_namespaceObject.__)("Today, %s"),
formattedDate
);
}
return label;
},
/** The label for the "next month" button. */
labelNext: () => (0,external_wp_i18n_namespaceObject.__)("Go to the Next Month"),
/** The label for the "previous month" button. */
labelPrevious: () => (0,external_wp_i18n_namespaceObject.__)("Go to the Previous Month"),
/**
* The label for the day button.
* @param date
* @param modifiers
*/
labelDayButton: (date, modifiers) => {
const formattedDate = fullDateFormatter.format(date);
let label = formattedDate;
if (modifiers?.today) {
label = (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s is the full date (e.g. "Monday, April 29, 2025")
(0,external_wp_i18n_namespaceObject.__)("Today, %s"),
formattedDate
);
}
if (modifiers?.selected) {
label = (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s is the full date (e.g. "Monday, April 29, 2025")
(0,external_wp_i18n_namespaceObject.__)("%s, selected"),
formattedDate
);
}
return label;
},
/**
* The label for the weekday.
* @param date
*/
labelWeekday: (date) => weekdayLongFormatter.format(date)
},
locale,
dir: isLocaleRTL(locale.code) ? "rtl" : "ltr",
formatters: {
formatWeekdayName: (date) => {
return weekdayNarrowFormatter.format(date);
},
formatCaption: (date) => {
return monthNameFormatter.format(date);
}
},
timeZone
};
}, [locale, timeZone, mode]);
};
;// ./node_modules/@wordpress/components/build-module/calendar/date-calendar/index.js
const DateCalendar = ({
defaultSelected,
selected: selectedProp,
onSelect,
numberOfMonths = 1,
locale = en_US_enUS,
timeZone,
...props
}) => {
const localizationProps = useLocalizationProps({
locale,
timeZone,
mode: "single"
});
const onChange = (0,external_wp_element_namespaceObject.useCallback)((selected2, triggerDate, modifiers, e) => {
onSelect?.(selected2 !== null && selected2 !== void 0 ? selected2 : void 0, triggerDate, modifiers, e);
}, [onSelect]);
const [selected, setSelected] = useControlledValue({
defaultValue: defaultSelected,
value: selectedProp,
onChange
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DayPicker, {
...COMMON_PROPS,
...localizationProps,
...props,
mode: "single",
numberOfMonths: clampNumberOfMonths(numberOfMonths),
selected: selected !== null && selected !== void 0 ? selected : void 0,
onSelect: setSelected
});
};
;// ./node_modules/@wordpress/components/build-module/calendar/date-range-calendar/index.js
function usePreviewRange({
selected,
hoveredDate,
excludeDisabled,
min,
max,
disabled
}) {
return (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!hoveredDate || !selected?.from) {
return;
}
let previewHighlight;
let potentialNewRange;
if (hoveredDate < selected.from) {
var _selected$to;
previewHighlight = {
from: hoveredDate,
to: selected.from
};
potentialNewRange = {
from: hoveredDate,
to: (_selected$to = selected.to) !== null && _selected$to !== void 0 ? _selected$to : selected.from
};
} else if (selected.to && hoveredDate > selected.from && hoveredDate < selected.to) {
previewHighlight = {
from: selected.from,
to: hoveredDate
};
potentialNewRange = {
from: selected.from,
to: hoveredDate
};
} else if (hoveredDate > selected.from) {
var _selected$to2;
previewHighlight = {
from: (_selected$to2 = selected.to) !== null && _selected$to2 !== void 0 ? _selected$to2 : selected.from,
to: hoveredDate
};
potentialNewRange = {
from: selected.from,
to: hoveredDate
};
}
if (min !== void 0 && min > 0 && potentialNewRange && differenceInCalendarDays(potentialNewRange.to, potentialNewRange.from) < min) {
previewHighlight = {
from: hoveredDate,
to: hoveredDate
};
}
if (max !== void 0 && max > 0 && potentialNewRange && differenceInCalendarDays(potentialNewRange.to, potentialNewRange.from) > max) {
previewHighlight = {
from: hoveredDate,
to: hoveredDate
};
}
if (excludeDisabled && disabled && potentialNewRange && rangeContainsModifiers(potentialNewRange, disabled)) {
previewHighlight = {
from: hoveredDate,
to: hoveredDate
};
}
return previewHighlight;
}, [selected, hoveredDate, excludeDisabled, min, max, disabled]);
}
const DateRangeCalendar = ({
defaultSelected,
selected: selectedProp,
onSelect,
numberOfMonths = 1,
excludeDisabled,
min,
max,
disabled,
locale = en_US_enUS,
timeZone,
...props
}) => {
const localizationProps = useLocalizationProps({
locale,
timeZone,
mode: "range"
});
const onChange = (0,external_wp_element_namespaceObject.useCallback)((selected2, triggerDate, modifiers2, e) => {
onSelect?.(selected2 !== null && selected2 !== void 0 ? selected2 : void 0, triggerDate, modifiers2, e);
}, [onSelect]);
const [selected, setSelected] = useControlledValue({
defaultValue: defaultSelected,
value: selectedProp,
onChange
});
const [hoveredDate, setHoveredDate] = (0,external_wp_element_namespaceObject.useState)(void 0);
const previewRange = usePreviewRange({
selected,
hoveredDate,
excludeDisabled,
min,
max,
disabled
});
const modifiers = (0,external_wp_element_namespaceObject.useMemo)(() => {
return {
preview: previewRange,
preview_start: previewRange?.from,
preview_end: previewRange?.to
};
}, [previewRange]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DayPicker, {
...COMMON_PROPS,
...localizationProps,
...props,
mode: "range",
numberOfMonths: clampNumberOfMonths(numberOfMonths),
disabled,
excludeDisabled,
min,
max,
selected: selected !== null && selected !== void 0 ? selected : void 0,
onSelect: setSelected,
onDayMouseEnter: (date) => setHoveredDate(date),
onDayMouseLeave: () => setHoveredDate(void 0),
modifiers,
modifiersClassNames: MODIFIER_CLASSNAMES
});
};
;// ./node_modules/@wordpress/components/build-module/validated-form-controls/validity-indicator.js
function ValidityIndicator({
type,
message
}) {
const ICON = {
valid: published_default,
invalid: error_default
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", {
className: dist_clsx("components-validated-control__indicator", `is-${type}`),
children: [type === "validating" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spinner_default, {
className: "components-validated-control__indicator-spinner"
}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
className: "components-validated-control__indicator-icon",
icon: ICON[type],
size: 16,
fill: "currentColor"
}), message]
});
}
;// ./node_modules/@wordpress/components/build-module/validated-form-controls/control-with-error.js
function appendRequiredIndicator(label, required, markWhenOptional) {
if (required && !markWhenOptional) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [label, " ", `(${(0,external_wp_i18n_namespaceObject.__)("Required")})`]
});
}
if (!required && markWhenOptional) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [label, " ", `(${(0,external_wp_i18n_namespaceObject.__)("Optional")})`]
});
}
return label;
}
function UnforwardedControlWithError({
required,
markWhenOptional,
onValidate,
customValidity,
getValidityTarget,
children
}, forwardedRef) {
const [errorMessage, setErrorMessage] = (0,external_wp_element_namespaceObject.useState)();
const [statusMessage, setStatusMessage] = (0,external_wp_element_namespaceObject.useState)();
const [isTouched, setIsTouched] = (0,external_wp_element_namespaceObject.useState)(false);
const previousCustomValidityType = (0,external_wp_compose_namespaceObject.usePrevious)(customValidity?.type);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const validityTarget = getValidityTarget();
const showValidationMessage = () => setErrorMessage(validityTarget?.validationMessage);
validityTarget?.addEventListener("invalid", showValidationMessage);
return () => {
validityTarget?.removeEventListener("invalid", showValidationMessage);
};
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isTouched) {
return;
}
const validityTarget = getValidityTarget();
if (!customValidity?.type) {
validityTarget?.setCustomValidity("");
setErrorMessage(validityTarget?.validationMessage);
setStatusMessage(void 0);
return;
}
switch (customValidity.type) {
case "validating": {
const timer = setTimeout(() => {
validityTarget?.setCustomValidity("");
setErrorMessage(void 0);
setStatusMessage({
type: "validating",
message: customValidity.message
});
}, 1e3);
return () => clearTimeout(timer);
}
case "valid": {
if (previousCustomValidityType === "valid") {
break;
}
validityTarget?.setCustomValidity("");
setErrorMessage(validityTarget?.validationMessage);
setStatusMessage({
type: "valid",
message: customValidity.message
});
break;
}
case "invalid": {
var _customValidity$messa;
validityTarget?.setCustomValidity((_customValidity$messa = customValidity.message) !== null && _customValidity$messa !== void 0 ? _customValidity$messa : "");
setErrorMessage(validityTarget?.validationMessage);
setStatusMessage(void 0);
break;
}
}
}, [isTouched, customValidity?.type, customValidity?.message, getValidityTarget, previousCustomValidityType]);
const onBlur = (event) => {
if (isTouched) {
return;
}
if (!event.relatedTarget || !event.currentTarget.contains(event.relatedTarget)) {
setIsTouched(true);
onValidate?.();
}
};
const onChange = (...args) => {
children.props.onChange?.(...args);
if (isTouched || errorMessage) {
onValidate?.();
}
};
const onKeyDown = (event) => {
if (event.key === "Enter") {
onValidate?.();
}
};
return (
// Disable reason: Just listening to a bubbled event, not for interaction.
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-validated-control",
ref: forwardedRef,
onBlur,
onKeyDown: withIgnoreIMEEvents(onKeyDown),
children: [(0,external_wp_element_namespaceObject.cloneElement)(children, {
label: appendRequiredIndicator(children.props.label, required, markWhenOptional),
onChange,
required
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
"aria-live": "polite",
children: [errorMessage && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ValidityIndicator, {
type: "invalid",
message: errorMessage
}), !errorMessage && statusMessage && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ValidityIndicator, {
type: statusMessage.type,
message: statusMessage.message
})]
})]
})
);
}
const ControlWithError = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedControlWithError);
;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/input-control.js
const UnforwardedValidatedInputControl = ({
required,
onValidate,
customValidity,
onChange,
markWhenOptional,
...restProps
}, forwardedRef) => {
const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, validityTargetRef]);
const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.value);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
required,
markWhenOptional,
onValidate: () => {
return onValidate?.(valueRef.current);
},
customValidity,
getValidityTarget: () => validityTargetRef.current,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(input_control_default, {
__next40pxDefaultSize: true,
ref: mergedRefs,
onChange: (value, ...args) => {
valueRef.current = value;
onChange?.(value, ...args);
},
...restProps
})
});
};
const ValidatedInputControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedInputControl);
;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/checkbox-control.js
const UnforwardedValidatedCheckboxControl = ({
required,
onValidate,
customValidity,
onChange,
markWhenOptional,
...restProps
}, forwardedRef) => {
const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, validityTargetRef]);
const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.checked);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
required,
markWhenOptional,
ref: mergedRefs,
onValidate: () => {
return onValidate?.(valueRef.current);
},
customValidity,
getValidityTarget: () => validityTargetRef.current?.querySelector('input[type="checkbox"]'),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(checkbox_control_default, {
__nextHasNoMarginBottom: true,
onChange: (value) => {
valueRef.current = value;
onChange?.(value);
},
...restProps
})
});
};
const ValidatedCheckboxControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedCheckboxControl);
;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/number-control.js
const UnforwardedValidatedNumberControl = ({
required,
onValidate,
customValidity,
onChange,
markWhenOptional,
...restProps
}, forwardedRef) => {
const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, validityTargetRef]);
const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.value);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
required,
markWhenOptional,
onValidate: () => {
return onValidate?.(valueRef.current);
},
customValidity,
getValidityTarget: () => validityTargetRef.current,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(number_control_default, {
__next40pxDefaultSize: true,
ref: mergedRefs,
onChange: (value, ...args) => {
valueRef.current = value;
onChange?.(value, ...args);
},
...restProps
})
});
};
const ValidatedNumberControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedNumberControl);
;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/select-control.js
const UnforwardedValidatedSelectControl = ({
required,
onValidate,
customValidity,
onChange,
markWhenOptional,
...restProps
}, forwardedRef) => {
const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, validityTargetRef]);
const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.value);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
required,
markWhenOptional,
onValidate: () => {
return onValidate?.(valueRef.current);
},
customValidity,
getValidityTarget: () => validityTargetRef.current,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(select_control_default, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
ref: mergedRefs,
onChange: (value) => {
valueRef.current = value;
onChange?.(value);
},
...restProps
})
});
};
const ValidatedSelectControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedSelectControl);
;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/radio-control.js
const UnforwardedValidatedRadioControl = ({
required,
onValidate,
customValidity,
onChange,
markWhenOptional,
...restProps
}, forwardedRef) => {
const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, validityTargetRef]);
const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.selected);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
required,
markWhenOptional,
ref: mergedRefs,
onValidate: () => {
return onValidate?.(valueRef.current);
},
customValidity,
getValidityTarget: () => validityTargetRef.current?.querySelector('input[type="radio"]'),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(radio_control_default, {
onChange: (value) => {
valueRef.current = value;
onChange?.(value);
},
...restProps
})
});
};
const ValidatedRadioControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedRadioControl);
;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/text-control.js
const UnforwardedValidatedTextControl = ({
required,
onValidate,
customValidity,
onChange,
markWhenOptional,
...restProps
}, forwardedRef) => {
const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, validityTargetRef]);
const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.value);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
required,
markWhenOptional,
onValidate: () => {
return onValidate?.(valueRef.current);
},
customValidity,
getValidityTarget: () => validityTargetRef.current,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(text_control_default, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
ref: mergedRefs,
onChange: (value) => {
valueRef.current = value;
onChange?.(value);
},
...restProps
})
});
};
const ValidatedTextControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedTextControl);
;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/textarea-control.js
const UnforwardedValidatedTextareaControl = ({
required,
onValidate,
customValidity,
onChange,
markWhenOptional,
...restProps
}, forwardedRef) => {
const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, validityTargetRef]);
const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.value);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
required,
markWhenOptional,
onValidate: () => {
return onValidate?.(valueRef.current);
},
customValidity,
getValidityTarget: () => validityTargetRef.current,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(textarea_control_default, {
__nextHasNoMarginBottom: true,
ref: mergedRefs,
onChange: (value) => {
valueRef.current = value;
onChange?.(value);
},
...restProps
})
});
};
const ValidatedTextareaControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedTextareaControl);
;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/toggle-control.js
const UnforwardedValidatedToggleControl = ({
required,
onValidate,
customValidity,
onChange,
markWhenOptional,
...restProps
}, forwardedRef) => {
const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, validityTargetRef]);
const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.checked);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (validityTargetRef.current) {
validityTargetRef.current.required = required !== null && required !== void 0 ? required : false;
}
}, [required]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
required,
markWhenOptional,
onValidate: () => {
return onValidate?.(valueRef.current);
},
customValidity,
getValidityTarget: () => validityTargetRef.current,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_control_default, {
__nextHasNoMarginBottom: true,
ref: mergedRefs,
onChange: (value) => {
valueRef.current = value;
onChange?.(value);
},
...restProps
})
});
};
const ValidatedToggleControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedToggleControl);
;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/toggle-group-control.js
const UnforwardedValidatedToggleGroupControl = ({
required,
onValidate,
customValidity,
onChange,
markWhenOptional,
...restProps
}, forwardedRef) => {
const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.value);
const nameAttr = (0,external_wp_element_namespaceObject.useId)();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-validated-control__wrapper-with-error-delegate",
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
required,
markWhenOptional,
onValidate: () => {
return onValidate?.(valueRef.current);
},
customValidity,
getValidityTarget: () => validityTargetRef.current,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_component_component_default, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
ref: forwardedRef,
onChange: (value) => {
valueRef.current = value;
onChange?.(value);
},
...restProps
})
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
className: "components-validated-control__error-delegate",
type: "radio",
ref: validityTargetRef,
required,
checked: restProps.value !== void 0,
tabIndex: -1,
name: nameAttr,
onChange: () => {
},
onFocus: (e) => {
e.target.previousElementSibling?.querySelector('[data-active-item="true"]')?.focus();
}
})]
});
};
const ValidatedToggleGroupControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedToggleGroupControl);
;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/form-token-field.js
const UnforwardedValidatedFormTokenField = ({
required,
onValidate,
customValidity,
onChange,
markWhenOptional,
...restProps
}, forwardedRef) => {
const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.value);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-validated-control__wrapper-with-error-delegate",
ref: forwardedRef,
children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
required,
markWhenOptional,
onValidate: () => {
return onValidate?.(valueRef.current);
},
customValidity,
getValidityTarget: () => validityTargetRef.current,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FormTokenField, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
...restProps,
onChange: (value, ...args) => {
valueRef.current = value;
onChange?.(value, ...args);
}
})
}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
className: "components-validated-control__error-delegate",
type: "text",
ref: validityTargetRef,
required,
value: valueRef.current && valueRef.current.length > 0 ? "hasvalue" : "",
tabIndex: -1,
onChange: () => {
},
onFocus: (e) => {
e.target.previousElementSibling?.querySelector('input[type="text"]')?.focus();
}
})]
});
};
const ValidatedFormTokenField = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedFormTokenField);
;// ./node_modules/@wordpress/components/build-module/private-apis.js
const privateApis = {};
lock(privateApis, {
__experimentalPopoverLegacyPositionToPlacement: positionToPlacement,
ComponentsContext: ComponentsContext,
Tabs: Tabs,
Theme: theme_default,
Menu: menu_Menu,
kebabCase: kebabCase,
withIgnoreIMEEvents: withIgnoreIMEEvents,
Badge: badge_default,
normalizeTextString: normalizeTextString,
DateCalendar: DateCalendar,
DateRangeCalendar: DateRangeCalendar,
TZDate: date_TZDate,
Picker: Picker,
ValidatedInputControl: ValidatedInputControl,
ValidatedCheckboxControl: ValidatedCheckboxControl,
ValidatedNumberControl: ValidatedNumberControl,
ValidatedSelectControl: ValidatedSelectControl,
ValidatedRadioControl: ValidatedRadioControl,
ValidatedTextControl: ValidatedTextControl,
ValidatedTextareaControl: ValidatedTextareaControl,
ValidatedToggleControl: ValidatedToggleControl,
ValidatedToggleGroupControl: ValidatedToggleGroupControl,
ValidatedFormTokenField: ValidatedFormTokenField
});
;// ./node_modules/@wordpress/components/build-module/index.js
})();
(window.wp = window.wp || {}).components = __webpack_exports__;
/******/ })()
; admin-ui.min.js 0000644 00000004155 15121363540 0007374 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={d:(a,i)=>{for(var n in i)e.o(i,n)&&!e.o(a,n)&&Object.defineProperty(a,n,{enumerable:!0,get:i[n]})},o:(e,a)=>Object.prototype.hasOwnProperty.call(e,a),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},a={};e.r(a),e.d(a,{NavigableRegion:()=>s,Page:()=>c});const i=window.ReactJSXRuntime;function n(e){var a,i,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var t=e.length;for(a=0;a<t;a++)e[a]&&(i=n(e[a]))&&(r&&(r+=" "),r+=i)}else for(i in e)e[i]&&(r&&(r+=" "),r+=i);return r}const r=function(){for(var e,a,i=0,r="",t=arguments.length;i<t;i++)(e=arguments[i])&&(a=n(e))&&(r&&(r+=" "),r+=a);return r},t=(0,window.wp.element.forwardRef)((({children:e,className:a,ariaLabel:n,as:t="div",...s},l)=>(0,i.jsx)(t,{ref:l,className:r("admin-ui-navigable-region",a),"aria-label":n,role:"region",tabIndex:"-1",...s,children:e})));t.displayName="NavigableRegion";var s=t;const l=window.wp.components;function d({breadcrumbs:e,badges:a,title:n,subTitle:r,actions:t}){return(0,i.jsxs)(l.__experimentalVStack,{className:"admin-ui-page__header",as:"header",children:[(0,i.jsxs)(l.__experimentalHStack,{className:"admin-ui-page__header-title",justify:"space-between",spacing:2,children:[(0,i.jsxs)(l.__experimentalHStack,{spacing:2,children:[n&&(0,i.jsx)(l.__experimentalHeading,{as:"h2",level:3,weight:500,truncate:!0,children:n}),e,a]}),(0,i.jsx)(l.__experimentalHStack,{style:{width:"auto",flexShrink:0},spacing:2,className:"admin-ui-page__header-actions",children:t})]}),r&&(0,i.jsx)("p",{className:"admin-ui-page__header-subtitle",children:r})]})}var c=function({breadcrumbs:e,badges:a,title:n,subTitle:t,children:l,className:c,actions:o,hasPadding:m=!1}){const u=r("admin-ui-page",c);return(0,i.jsxs)(s,{className:u,ariaLabel:n,children:[(n||e||a)&&(0,i.jsx)(d,{breadcrumbs:e,badges:a,title:n,subTitle:t,actions:o}),m?(0,i.jsx)("div",{className:"admin-ui-page__content has-padding",children:l}):l]})};(window.wp=window.wp||{}).adminUi=a})(); priority-queue.js 0000644 00000023615 15121363540 0010114 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 5033:
/***/ ((module, exports, __webpack_require__) => {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (factory) {
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {}
}(function(){
'use strict';
var scheduleStart, throttleDelay, lazytimer, lazyraf;
var root = typeof window != 'undefined' ?
window :
typeof __webpack_require__.g != undefined ?
__webpack_require__.g :
this || {};
var requestAnimationFrame = root.cancelRequestAnimationFrame && root.requestAnimationFrame || setTimeout;
var cancelRequestAnimationFrame = root.cancelRequestAnimationFrame || clearTimeout;
var tasks = [];
var runAttempts = 0;
var isRunning = false;
var remainingTime = 7;
var minThrottle = 35;
var throttle = 125;
var index = 0;
var taskStart = 0;
var tasklength = 0;
var IdleDeadline = {
get didTimeout(){
return false;
},
timeRemaining: function(){
var timeRemaining = remainingTime - (Date.now() - taskStart);
return timeRemaining < 0 ? 0 : timeRemaining;
},
};
var setInactive = debounce(function(){
remainingTime = 22;
throttle = 66;
minThrottle = 0;
});
function debounce(fn){
var id, timestamp;
var wait = 99;
var check = function(){
var last = (Date.now()) - timestamp;
if (last < wait) {
id = setTimeout(check, wait - last);
} else {
id = null;
fn();
}
};
return function(){
timestamp = Date.now();
if(!id){
id = setTimeout(check, wait);
}
};
}
function abortRunning(){
if(isRunning){
if(lazyraf){
cancelRequestAnimationFrame(lazyraf);
}
if(lazytimer){
clearTimeout(lazytimer);
}
isRunning = false;
}
}
function onInputorMutation(){
if(throttle != 125){
remainingTime = 7;
throttle = 125;
minThrottle = 35;
if(isRunning) {
abortRunning();
scheduleLazy();
}
}
setInactive();
}
function scheduleAfterRaf() {
lazyraf = null;
lazytimer = setTimeout(runTasks, 0);
}
function scheduleRaf(){
lazytimer = null;
requestAnimationFrame(scheduleAfterRaf);
}
function scheduleLazy(){
if(isRunning){return;}
throttleDelay = throttle - (Date.now() - taskStart);
scheduleStart = Date.now();
isRunning = true;
if(minThrottle && throttleDelay < minThrottle){
throttleDelay = minThrottle;
}
if(throttleDelay > 9){
lazytimer = setTimeout(scheduleRaf, throttleDelay);
} else {
throttleDelay = 0;
scheduleRaf();
}
}
function runTasks(){
var task, i, len;
var timeThreshold = remainingTime > 9 ?
9 :
1
;
taskStart = Date.now();
isRunning = false;
lazytimer = null;
if(runAttempts > 2 || taskStart - throttleDelay - 50 < scheduleStart){
for(i = 0, len = tasks.length; i < len && IdleDeadline.timeRemaining() > timeThreshold; i++){
task = tasks.shift();
tasklength++;
if(task){
task(IdleDeadline);
}
}
}
if(tasks.length){
scheduleLazy();
} else {
runAttempts = 0;
}
}
function requestIdleCallbackShim(task){
index++;
tasks.push(task);
scheduleLazy();
return index;
}
function cancelIdleCallbackShim(id){
var index = id - 1 - tasklength;
if(tasks[index]){
tasks[index] = null;
}
}
if(!root.requestIdleCallback || !root.cancelIdleCallback){
root.requestIdleCallback = requestIdleCallbackShim;
root.cancelIdleCallback = cancelIdleCallbackShim;
if(root.document && document.addEventListener){
root.addEventListener('scroll', onInputorMutation, true);
root.addEventListener('resize', onInputorMutation);
document.addEventListener('focus', onInputorMutation, true);
document.addEventListener('mouseover', onInputorMutation, true);
['click', 'keypress', 'touchstart', 'mousedown'].forEach(function(name){
document.addEventListener(name, onInputorMutation, {capture: true, passive: true});
});
if(root.MutationObserver){
new MutationObserver( onInputorMutation ).observe( document.documentElement, {childList: true, subtree: true, attributes: true} );
}
}
} else {
try{
root.requestIdleCallback(function(){}, {timeout: 0});
} catch(e){
(function(rIC){
var timeRemainingProto, timeRemaining;
root.requestIdleCallback = function(fn, timeout){
if(timeout && typeof timeout.timeout == 'number'){
return rIC(fn, timeout.timeout);
}
return rIC(fn);
};
if(root.IdleCallbackDeadline && (timeRemainingProto = IdleCallbackDeadline.prototype)){
timeRemaining = Object.getOwnPropertyDescriptor(timeRemainingProto, 'timeRemaining');
if(!timeRemaining || !timeRemaining.configurable || !timeRemaining.get){return;}
Object.defineProperty(timeRemainingProto, 'timeRemaining', {
value: function(){
return timeRemaining.get.call(this);
},
enumerable: true,
configurable: true,
});
}
})(root.requestIdleCallback)
}
}
return {
request: requestIdleCallbackShim,
cancel: cancelIdleCallbackShim,
};
}));
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/global */
/******/ (() => {
/******/ __webpack_require__.g = (function() {
/******/ if (typeof globalThis === 'object') return globalThis;
/******/ try {
/******/ return this || new Function('return this')();
/******/ } catch (e) {
/******/ if (typeof window === 'object') return window;
/******/ }
/******/ })();
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
(() => {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
createQueue: () => (/* binding */ createQueue)
});
// EXTERNAL MODULE: ./node_modules/requestidlecallback/index.js
var requestidlecallback = __webpack_require__(5033);
;// ./node_modules/@wordpress/priority-queue/build-module/request-idle-callback.js
function createRequestIdleCallback() {
if (typeof window === "undefined") {
return (callback) => {
setTimeout(() => callback(Date.now()), 0);
};
}
return window.requestIdleCallback;
}
var request_idle_callback_default = createRequestIdleCallback();
;// ./node_modules/@wordpress/priority-queue/build-module/index.js
const createQueue = () => {
const waitingList = /* @__PURE__ */ new Map();
let isRunning = false;
const runWaitingList = (deadline) => {
for (const [nextElement, callback] of waitingList) {
waitingList.delete(nextElement);
callback();
if ("number" === typeof deadline || deadline.timeRemaining() <= 0) {
break;
}
}
if (waitingList.size === 0) {
isRunning = false;
return;
}
request_idle_callback_default(runWaitingList);
};
const add = (element, item) => {
waitingList.set(element, item);
if (!isRunning) {
isRunning = true;
request_idle_callback_default(runWaitingList);
}
};
const flush = (element) => {
const callback = waitingList.get(element);
if (void 0 === callback) {
return false;
}
waitingList.delete(element);
callback();
return true;
};
const cancel = (element) => {
return waitingList.delete(element);
};
const reset = () => {
waitingList.clear();
isRunning = false;
};
return {
add,
flush,
cancel,
reset
};
};
})();
(window.wp = window.wp || {}).priorityQueue = __webpack_exports__;
/******/ })()
; escape-html.js 0000644 00000005766 15121363540 0007322 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
escapeAmpersand: () => (/* binding */ escapeAmpersand),
escapeAttribute: () => (/* binding */ escapeAttribute),
escapeEditableHTML: () => (/* binding */ escapeEditableHTML),
escapeHTML: () => (/* binding */ escapeHTML),
escapeLessThan: () => (/* binding */ escapeLessThan),
escapeQuotationMark: () => (/* binding */ escapeQuotationMark),
isValidAttributeName: () => (/* binding */ isValidAttributeName)
});
;// ./node_modules/@wordpress/escape-html/build-module/escape-greater.js
function __unstableEscapeGreaterThan(value) {
return value.replace(/>/g, ">");
}
;// ./node_modules/@wordpress/escape-html/build-module/index.js
const REGEXP_INVALID_ATTRIBUTE_NAME = /[\u007F-\u009F "'>/="\uFDD0-\uFDEF]/;
function escapeAmpersand(value) {
return value.replace(/&(?!([a-z0-9]+|#[0-9]+|#x[a-f0-9]+);)/gi, "&");
}
function escapeQuotationMark(value) {
return value.replace(/"/g, """);
}
function escapeLessThan(value) {
return value.replace(/</g, "<");
}
function escapeAttribute(value) {
return __unstableEscapeGreaterThan(
escapeQuotationMark(escapeAmpersand(value))
);
}
function escapeHTML(value) {
return escapeLessThan(escapeAmpersand(value));
}
function escapeEditableHTML(value) {
return escapeLessThan(value.replace(/&/g, "&"));
}
function isValidAttributeName(name) {
return !REGEXP_INVALID_ATTRIBUTE_NAME.test(name);
}
(window.wp = window.wp || {}).escapeHtml = __webpack_exports__;
/******/ })()
; blob.js 0000644 00000006131 15121363541 0006022 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ createBlobURL: () => (/* binding */ createBlobURL),
/* harmony export */ downloadBlob: () => (/* binding */ downloadBlob),
/* harmony export */ getBlobByURL: () => (/* binding */ getBlobByURL),
/* harmony export */ getBlobTypeByURL: () => (/* binding */ getBlobTypeByURL),
/* harmony export */ isBlobURL: () => (/* binding */ isBlobURL),
/* harmony export */ revokeBlobURL: () => (/* binding */ revokeBlobURL)
/* harmony export */ });
const cache = {};
function createBlobURL(file) {
const url = window.URL.createObjectURL(file);
cache[url] = file;
return url;
}
function getBlobByURL(url) {
return cache[url];
}
function getBlobTypeByURL(url) {
return getBlobByURL(url)?.type.split("/")[0];
}
function revokeBlobURL(url) {
if (cache[url]) {
window.URL.revokeObjectURL(url);
}
delete cache[url];
}
function isBlobURL(url) {
if (!url || !url.indexOf) {
return false;
}
return url.indexOf("blob:") === 0;
}
function downloadBlob(filename, content, contentType = "") {
if (!filename || !content) {
return;
}
const file = new window.Blob([content], { type: contentType });
const url = window.URL.createObjectURL(file);
const anchorElement = document.createElement("a");
anchorElement.href = url;
anchorElement.download = filename;
anchorElement.style.display = "none";
document.body.appendChild(anchorElement);
anchorElement.click();
document.body.removeChild(anchorElement);
window.URL.revokeObjectURL(url);
}
(window.wp = window.wp || {}).blob = __webpack_exports__;
/******/ })()
; blob.min.js 0000644 00000002124 15121363541 0006602 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={d:(o,t)=>{for(var n in t)e.o(t,n)&&!e.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:t[n]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{createBlobURL:()=>n,downloadBlob:()=>c,getBlobByURL:()=>r,getBlobTypeByURL:()=>d,isBlobURL:()=>l,revokeBlobURL:()=>i});const t={};function n(e){const o=window.URL.createObjectURL(e);return t[o]=e,o}function r(e){return t[e]}function d(e){return r(e)?.type.split("/")[0]}function i(e){t[e]&&window.URL.revokeObjectURL(e),delete t[e]}function l(e){return!(!e||!e.indexOf)&&0===e.indexOf("blob:")}function c(e,o,t=""){if(!e||!o)return;const n=new window.Blob([o],{type:t}),r=window.URL.createObjectURL(n),d=document.createElement("a");d.href=r,d.download=e,d.style.display="none",document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(r)}(window.wp=window.wp||{}).blob=o})(); compose.min.js 0000644 00000107432 15121363541 0007341 0 ustar 00 /*! This file is auto-generated */
(()=>{var e={1933:(e,t,n)=>{var r;!function(o,i){if(o){for(var u,c={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},s={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},l={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},f=1;f<20;++f)c[111+f]="f"+f;for(f=0;f<=9;++f)c[f+96]=f.toString();g.prototype.bind=function(e,t,n){var r=this;return e=e instanceof Array?e:[e],r._bindMultiple.call(r,e,t,n),r},g.prototype.unbind=function(e,t){return this.bind.call(this,e,(function(){}),t)},g.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},g.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},g.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(y(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var n=e.composedPath()[0];n!==e.target&&(t=n)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},g.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},g.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(c[t]=e[t]);u=null},g.init=function(){var e=g(i);for(var t in e)"_"!==t.charAt(0)&&(g[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},g.init(),o.Mousetrap=g,e.exports&&(e.exports=g),void 0===(r=function(){return g}.call(t,n,t,e))||(e.exports=r)}function d(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function p(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return c[e.which]?c[e.which]:s[e.which]?s[e.which]:String.fromCharCode(e.which).toLowerCase()}function h(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function v(e,t,n){return n||(n=function(){if(!u)for(var e in u={},c)e>95&&e<112||c.hasOwnProperty(e)&&(u[c[e]]=e);return u}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function m(e,t){var n,r,o,i=[];for(n=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),o=0;o<n.length;++o)r=n[o],l[r]&&(r=l[r]),t&&"keypress"!=t&&a[r]&&(r=a[r],i.push("shift")),h(r)&&i.push(r);return{key:r,modifiers:i,action:t=v(r,i,t)}}function y(e,t){return null!==e&&e!==i&&(e===t||y(e.parentNode,t))}function g(e){var t=this;if(e=e||i,!(t instanceof g))return new g(e);t.target=e,t._callbacks={},t._directMap={};var n,r={},o=!1,u=!1,c=!1;function s(e){e=e||{};var t,n=!1;for(t in r)e[t]?n=!0:r[t]=0;n||(c=!1)}function a(e,n,o,i,u,c){var s,a,l,f,d=[],p=o.type;if(!t._callbacks[e])return[];for("keyup"==p&&h(e)&&(n=[e]),s=0;s<t._callbacks[e].length;++s)if(a=t._callbacks[e][s],(i||!a.seq||r[a.seq]==a.level)&&p==a.action&&("keypress"==p&&!o.metaKey&&!o.ctrlKey||(l=n,f=a.modifiers,l.sort().join(",")===f.sort().join(",")))){var v=!i&&a.combo==u,m=i&&a.seq==i&&a.level==c;(v||m)&&t._callbacks[e].splice(s,1),d.push(a)}return d}function l(e,n,r,o){t.stopCallback(n,n.target||n.srcElement,r,o)||!1===e(n,r)&&(function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}(n),function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}(n))}function f(e){"number"!=typeof e.which&&(e.which=e.keyCode);var n=p(e);n&&("keyup"!=e.type||o!==n?t.handleKey(n,function(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}(e),e):o=!1)}function v(e,t,i,u){function a(t){return function(){c=t,++r[e],clearTimeout(n),n=setTimeout(s,1e3)}}function f(t){l(i,t,e),"keyup"!==u&&(o=p(t)),setTimeout(s,10)}r[e]=0;for(var d=0;d<t.length;++d){var h=d+1===t.length?f:a(u||m(t[d+1]).action);y(t[d],h,u,e,d)}}function y(e,n,r,o,i){t._directMap[e+":"+r]=n;var u,c=(e=e.replace(/\s+/g," ")).split(" ");c.length>1?v(e,c,n,r):(u=m(e,r),t._callbacks[u.key]=t._callbacks[u.key]||[],a(u.key,u.modifiers,{type:u.action},o,e,i),t._callbacks[u.key][o?"unshift":"push"]({callback:n,modifiers:u.modifiers,action:u.action,seq:o,level:i,combo:e}))}t._handleKey=function(e,t,n){var r,o=a(e,t,n),i={},f=0,d=!1;for(r=0;r<o.length;++r)o[r].seq&&(f=Math.max(f,o[r].level));for(r=0;r<o.length;++r)if(o[r].seq){if(o[r].level!=f)continue;d=!0,i[o[r].seq]=1,l(o[r].callback,n,o[r].combo,o[r].seq)}else d||l(o[r].callback,n,o[r].combo);var p="keypress"==n.type&&u;n.type!=c||h(e)||p||s(i),u=d&&"keydown"==n.type},t._bindMultiple=function(e,t,n){for(var r=0;r<e.length;++r)y(e[r],t,n)},d(e,"keypress",f),d(e,"keydown",f),d(e,"keyup",f)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)},3758:function(e){
/*!
* clipboard.js v2.0.11
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
*/
var t;t=function(){return function(){var e={686:function(e,t,n){"use strict";n.d(t,{default:function(){return S}});var r=n(279),o=n.n(r),i=n(370),u=n.n(i),c=n(817),s=n.n(c);function a(e){try{return document.execCommand(e)}catch(e){return!1}}var l=function(e){var t=s()(e);return a("cut"),t},f=function(e,t){var n=function(e){var t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";var r=window.pageYOffset||document.documentElement.scrollTop;return n.style.top="".concat(r,"px"),n.setAttribute("readonly",""),n.value=e,n}(e);t.container.appendChild(n);var r=s()(n);return a("copy"),n.remove(),r},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof e?n=f(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==e?void 0:e.type)?n=f(e.value,t):(n=s()(e),a("copy")),n};function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}var h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,n=void 0===t?"copy":t,r=e.container,o=e.target,i=e.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==o){if(!o||"object"!==p(o)||1!==o.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&o.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(o.hasAttribute("readonly")||o.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return i?d(i,{container:r}):o?"cut"===n?l(o):d(o,{container:r}):void 0};function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t){return y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},y(e,t)}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r,o,i=b(e);if(t){var u=b(this).constructor;n=Reflect.construct(i,arguments,u)}else n=i.apply(this,arguments);return r=this,!(o=n)||"object"!==v(o)&&"function"!=typeof o?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r):o}}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}function w(e,t){var n="data-clipboard-".concat(e);if(t.hasAttribute(n))return t.getAttribute(n)}var E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(i,e);var t,n,r,o=g(i);function i(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(n=o.call(this)).resolveOptions(t),n.listenClick(e),n}return t=i,n=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===v(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=u()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,n=this.action(t)||"copy",r=h({action:n,container:this.container,target:this.target(t),text:this.text(t)});this.emit(r?"success":"error",{action:n,text:r,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return w("action",e)}},{key:"defaultTarget",value:function(e){var t=w("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return w("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],r=[{key:"copy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return d(e,t)}},{key:"cut",value:function(e){return l(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach((function(e){n=n&&!!document.queryCommandSupported(e)})),n}}],n&&m(t.prototype,n),r&&m(t,r),i}(o()),S=E},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,n){var r=n(828);function o(e,t,n,r,o){var u=i.apply(this,arguments);return e.addEventListener(n,u,o),{destroy:function(){e.removeEventListener(n,u,o)}}}function i(e,t,n,o){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&o.call(e,n)}}e.exports=function(e,t,n,r,i){return"function"==typeof e.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return o(e,t,n,r,i)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){var r=n(879),o=n(438);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(r.string(e))return function(e,t,n){return o(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(e),r.removeAllRanges(),r.addRange(o),t=r.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,u=r.length;i<u;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},e.exports=t,e.exports.TinyEmitter=t}},t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}return n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n(686)}().default},e.exports=t()},5760:()=>{!function(e){if(e){var t={},n=e.prototype.stopCallback;e.prototype.stopCallback=function(e,r,o,i){return!!this.paused||!t[o]&&!t[i]&&n.call(this,e,r,o)},e.prototype.bindGlobal=function(e,n,r){if(this.bind(e,n,r),e instanceof Array)for(var o=0;o<e.length;o++)t[e[o]]=!0;else t[e]=!0},e.init()}}("undefined"!=typeof Mousetrap?Mousetrap:void 0)}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{__experimentalUseDialog:()=>Z,__experimentalUseDragging:()=>J,__experimentalUseDropZone:()=>Ae,__experimentalUseFixedWindowList:()=>Ie,__experimentalUseFocusOutside:()=>F,compose:()=>m,createHigherOrderComponent:()=>a,debounce:()=>f,ifCondition:()=>g,observableMap:()=>p,pipe:()=>v,pure:()=>S,throttle:()=>d,useAsyncList:()=>Ce,useConstrainedTabbing:()=>P,useCopyOnClick:()=>z,useCopyToClipboard:()=>V,useDebounce:()=>Me,useDebouncedInput:()=>Oe,useDisabled:()=>Q,useEvent:()=>X,useFocusOnMount:()=>q,useFocusReturn:()=>H,useFocusableIframe:()=>je,useInstanceId:()=>D,useIsomorphicLayoutEffect:()=>Y,useKeyboardShortcut:()=>ne,useMediaQuery:()=>oe,useMergeRefs:()=>G,useObservableValue:()=>Ne,usePrevious:()=>ie,useReducedMotion:()=>ue,useRefEffect:()=>j,useResizeObserver:()=>ke,useStateWithHistory:()=>de,useThrottle:()=>_e,useViewportMatch:()=>ge,useWarnOnChange:()=>Le,withGlobalEvents:()=>L,withInstanceId:()=>M,withSafeTimeout:()=>O,withState:()=>_});var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},e.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function t(e){return e.toLowerCase()}var o=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],i=/[^A-Z0-9]+/gi;function u(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function c(e,t){var n=e.charAt(0),r=e.substr(1).toLowerCase();return t>0&&n>="0"&&n<="9"?"_"+n+r:""+n.toUpperCase()+r}function s(n,r){return void 0===r&&(r={}),function(e,n){void 0===n&&(n={});for(var r=n.splitRegexp,c=void 0===r?o:r,s=n.stripRegexp,a=void 0===s?i:s,l=n.transform,f=void 0===l?t:l,d=n.delimiter,p=void 0===d?" ":d,h=u(u(e,c,"$1\0$2"),a,"\0"),v=0,m=h.length;"\0"===h.charAt(v);)v++;for(;"\0"===h.charAt(m-1);)m--;return h.slice(v,m).split("\0").map(f).join(p)}(n,e({delimiter:"",transform:c},r))}function a(e,t){return n=>{const r=e(n);return r.displayName=l(t,n),r}}const l=(e,t)=>{const n=t.displayName||t.name||"Component";return`${s(e??"")}(${n})`},f=(e,t,n)=>{let r,o,i,u,c,s=0,a=0,l=!1,f=!1,d=!0;function p(t){const n=r,u=o;return r=void 0,o=void 0,a=t,i=e.apply(u,n),i}function h(e,t){u=setTimeout(e,t)}function v(e){return e-(c||0)}function m(e){const n=v(e);return void 0===c||n>=t||n<0||f&&e-a>=s}function y(){const e=Date.now();if(m(e))return b(e);h(y,function(e){const n=v(e),r=e-a,o=t-n;return f?Math.min(o,s-r):o}(e))}function g(){u=void 0}function b(e){return g(),d&&r?p(e):(r=o=void 0,i)}function w(){return void 0!==u}function E(...e){const n=Date.now(),u=m(n);if(r=e,o=this,c=n,u){if(!w())return function(e){return a=e,h(y,t),l?p(e):i}(c);if(f)return h(y,t),p(c)}return w()||h(y,t),i}return n&&(l=!!n.leading,f="maxWait"in n,void 0!==n.maxWait&&(s=Math.max(n.maxWait,t)),d="trailing"in n?!!n.trailing:d),E.cancel=function(){void 0!==u&&clearTimeout(u),a=0,g(),r=c=o=void 0},E.flush=function(){return w()?b(Date.now()):i},E.pending=w,E},d=(e,t,n)=>{let r=!0,o=!0;return n&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),f(e,t,{leading:r,trailing:o,maxWait:t})};function p(){const e=new Map,t=new Map;function n(e){const n=t.get(e);if(n)for(const e of n)e()}return{get:t=>e.get(t),set(t,r){e.set(t,r),n(t)},delete(t){e.delete(t),n(t)},subscribe(e,n){let r=t.get(e);return r||(r=new Set,t.set(e,r)),r.add(n),()=>{r.delete(n),0===r.size&&t.delete(e)}}}}const h=(e=!1)=>(...t)=>(...n)=>{const r=t.flat();return e&&r.reverse(),r.reduce(((e,t)=>[t(...e)]),n)[0]};var v=h();var m=h(!0);const y=window.ReactJSXRuntime;var g=function(e){return a((t=>n=>e(n)?(0,y.jsx)(t,{...n}):null),"ifCondition")};const b=window.wp.isShallowEqual;var w=n.n(b);const E=window.wp.element;var S=a((function(e){return e.prototype instanceof E.Component?class extends e{shouldComponentUpdate(e,t){return!w()(e,this.props)||!w()(t,this.state)}}:class extends E.Component{shouldComponentUpdate(e){return!w()(e,this.props)}render(){return(0,y.jsx)(e,{...this.props})}}}),"pure");const x=window.wp.deprecated;var k=n.n(x);var T=class{constructor(){this.listeners={},this.handleEvent=this.handleEvent.bind(this)}add(e,t){this.listeners[e]||(window.addEventListener(e,this.handleEvent),this.listeners[e]=[]),this.listeners[e].push(t)}remove(e,t){this.listeners[e]&&(this.listeners[e]=this.listeners[e].filter((e=>e!==t)),this.listeners[e].length||(window.removeEventListener(e,this.handleEvent),delete this.listeners[e]))}handleEvent(e){this.listeners[e.type]?.forEach((t=>{t.handleEvent(e)}))}};const C=new T;function L(e){return k()("wp.compose.withGlobalEvents",{since:"5.7",alternative:"useEffect"}),a((t=>{class n extends E.Component{constructor(e){super(e),this.handleEvent=this.handleEvent.bind(this),this.handleRef=this.handleRef.bind(this)}componentDidMount(){Object.keys(e).forEach((e=>{C.add(e,this)}))}componentWillUnmount(){Object.keys(e).forEach((e=>{C.remove(e,this)}))}handleEvent(t){const n=e[t.type];"function"==typeof this.wrappedRef[n]&&this.wrappedRef[n](t)}handleRef(e){this.wrappedRef=e,this.props.forwardedRef&&this.props.forwardedRef(e)}render(){return(0,y.jsx)(t,{...this.props.ownProps,ref:this.handleRef})}}return(0,E.forwardRef)(((e,t)=>(0,y.jsx)(n,{ownProps:e,forwardedRef:t})))}),"withGlobalEvents")}const R=new WeakMap;var D=function(e,t,n){return(0,E.useMemo)((()=>{if(n)return n;const r=function(e){const t=R.get(e)||0;return R.set(e,t+1),t}(e);return t?`${t}-${r}`:r}),[e,n,t])};var M=a((e=>t=>{const n=D(e);return(0,y.jsx)(e,{...t,instanceId:n})}),"instanceId");var O=a((e=>class extends E.Component{timeouts;constructor(e){super(e),this.timeouts=[],this.setTimeout=this.setTimeout.bind(this),this.clearTimeout=this.clearTimeout.bind(this)}componentWillUnmount(){this.timeouts.forEach(clearTimeout)}setTimeout(e,t){const n=setTimeout((()=>{e(),this.clearTimeout(n)}),t);return this.timeouts.push(n),n}clearTimeout(e){clearTimeout(e),this.timeouts=this.timeouts.filter((t=>t!==e))}render(){return(0,y.jsx)(e,{...this.props,setTimeout:this.setTimeout,clearTimeout:this.clearTimeout})}}),"withSafeTimeout");function _(e={}){return k()("wp.compose.withState",{since:"5.8",alternative:"wp.element.useState"}),a((t=>class extends E.Component{constructor(t){super(t),this.setState=this.setState.bind(this),this.state=e}render(){return(0,y.jsx)(t,{...this.props,...this.state,setState:this.setState})}}),"withState")}const A=window.wp.dom;function j(e,t){const n=(0,E.useRef)();return(0,E.useCallback)((t=>{t?n.current=e(t):n.current&&n.current()}),t)}var P=function(){return j((e=>{function t(t){const{key:n,shiftKey:r,target:o}=t;if("Tab"!==n)return;const i=r?"findPrevious":"findNext",u=A.focus.tabbable[i](o)||null;if(o.contains(u))return t.preventDefault(),void u?.focus();if(e.contains(u))return;const c=r?"append":"prepend",{ownerDocument:s}=e,a=s.createElement("div");a.tabIndex=-1,e[c](a),a.addEventListener("blur",(()=>e.removeChild(a))),a.focus()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[])},I=n(3758),N=n.n(I);function z(e,t,n=4e3){k()("wp.compose.useCopyOnClick",{since:"5.8",alternative:"wp.compose.useCopyToClipboard"});const r=(0,E.useRef)(),[o,i]=(0,E.useState)(!1);return(0,E.useEffect)((()=>{let o;if(e.current)return r.current=new(N())(e.current,{text:()=>"function"==typeof t?t():t}),r.current.on("success",(({clearSelection:e,trigger:t})=>{e(),t&&t.focus(),n&&(i(!0),clearTimeout(o),o=setTimeout((()=>i(!1)),n))})),()=>{r.current&&r.current.destroy(),clearTimeout(o)}}),[t,n,i]),o}function U(e){const t=(0,E.useRef)(e);return(0,E.useLayoutEffect)((()=>{t.current=e}),[e]),t}function V(e,t){const n=U(e),r=U(t);return j((e=>{const t=new(N())(e,{text:()=>"function"==typeof n.current?n.current():n.current||""});return t.on("success",(({clearSelection:e})=>{e(),r.current&&r.current()})),()=>{t.destroy()}}),[])}const W=window.wp.keycodes;function q(e="firstElement"){const t=(0,E.useRef)(e),n=e=>{e.focus({preventScroll:!0})},r=(0,E.useRef)();return(0,E.useEffect)((()=>{t.current=e}),[e]),j((e=>{if(e&&!1!==t.current&&!e.contains(e.ownerDocument?.activeElement??null)){if("firstElement"===t.current)return r.current=setTimeout((()=>{const t=A.focus.tabbable.find(e)[0];t&&n(t)}),0),()=>{r.current&&clearTimeout(r.current)};n(e)}}),[])}let K=null;var H=function(e){const t=(0,E.useRef)(null),n=(0,E.useRef)(null),r=(0,E.useRef)(e);return(0,E.useEffect)((()=>{r.current=e}),[e]),(0,E.useCallback)((e=>{if(e){if(t.current=e,n.current)return;const r=e.ownerDocument.activeElement instanceof window.HTMLIFrameElement?e.ownerDocument.activeElement.contentDocument:e.ownerDocument;n.current=r?.activeElement??null}else if(n.current){const e=t.current?.contains(t.current?.ownerDocument.activeElement);if(t.current?.isConnected&&!e)return void(K??=n.current);r.current?r.current():(n.current.isConnected?n.current:K)?.focus(),K=null}}),[])};const $=["button","submit"];function F(e){const t=(0,E.useRef)(e);(0,E.useEffect)((()=>{t.current=e}),[e]);const n=(0,E.useRef)(!1),r=(0,E.useRef)(),o=(0,E.useCallback)((()=>{clearTimeout(r.current)}),[]);(0,E.useEffect)((()=>{e||o()}),[e,o]);const i=(0,E.useCallback)((e=>{const{type:t,target:r}=e;["mouseup","touchend"].includes(t)?n.current=!1:function(e){if(!(e instanceof window.HTMLElement))return!1;switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return $.includes(e.type)}return!1}(r)&&(n.current=!0)}),[]),u=(0,E.useCallback)((e=>{if(e.persist(),n.current)return;const o=e.target.getAttribute("data-unstable-ignore-focus-outside-for-relatedtarget");o&&e.relatedTarget?.closest(o)||(r.current=setTimeout((()=>{document.hasFocus()?"function"==typeof t.current&&t.current(e):e.preventDefault()}),0))}),[]);return{onFocus:o,onMouseDown:i,onMouseUp:i,onTouchStart:i,onTouchEnd:i,onBlur:u}}function B(e,t){"function"==typeof e?e(t):e&&e.hasOwnProperty("current")&&(e.current=t)}function G(e){const t=(0,E.useRef)(),n=(0,E.useRef)(!1),r=(0,E.useRef)(!1),o=(0,E.useRef)([]),i=(0,E.useRef)(e);return i.current=e,(0,E.useLayoutEffect)((()=>{!1===r.current&&!0===n.current&&e.forEach(((e,n)=>{const r=o.current[n];e!==r&&(B(r,null),B(e,t.current))})),o.current=e}),e),(0,E.useLayoutEffect)((()=>{r.current=!1})),(0,E.useCallback)((e=>{B(t,e),r.current=!0,n.current=null!==e;const u=e?i.current:o.current;for(const t of u)B(t,e)}),[])}var Z=function(e){const t=(0,E.useRef)(),{constrainTabbing:n=!1!==e.focusOnMount}=e;(0,E.useEffect)((()=>{t.current=e}),Object.values(e));const r=P(),o=q(e.focusOnMount),i=H(),u=F((e=>{t.current?.__unstableOnClose?t.current.__unstableOnClose("focus-outside",e):t.current?.onClose&&t.current.onClose()})),c=(0,E.useCallback)((e=>{e&&e.addEventListener("keydown",(e=>{e.keyCode===W.ESCAPE&&!e.defaultPrevented&&t.current?.onClose&&(e.preventDefault(),t.current.onClose())}))}),[]);return[G([n?r:null,!1!==e.focusOnMount?i:null,!1!==e.focusOnMount?o:null,c]),{...u,tabIndex:-1}]};function Q({isDisabled:e=!1}={}){return j((t=>{if(e)return;const n=t?.ownerDocument?.defaultView;if(!n)return;const r=[],o=()=>{t.childNodes.forEach((e=>{e instanceof n.HTMLElement&&(e.getAttribute("inert")||(e.setAttribute("inert","true"),r.push((()=>{e.removeAttribute("inert")}))))}))},i=f(o,0,{leading:!0});o();const u=new window.MutationObserver(i);return u.observe(t,{childList:!0}),()=>{u&&u.disconnect(),i.cancel(),r.forEach((e=>e()))}}),[e])}function X(e){const t=(0,E.useRef)((()=>{throw new Error("Callbacks created with `useEvent` cannot be called during rendering.")}));return(0,E.useInsertionEffect)((()=>{t.current=e})),(0,E.useCallback)(((...e)=>t.current?.(...e)),[])}var Y="undefined"!=typeof window?E.useLayoutEffect:E.useEffect;function J({onDragStart:e,onDragMove:t,onDragEnd:n}){const[r,o]=(0,E.useState)(!1),i=(0,E.useRef)({onDragStart:e,onDragMove:t,onDragEnd:n});Y((()=>{i.current.onDragStart=e,i.current.onDragMove=t,i.current.onDragEnd=n}),[e,t,n]);const u=(0,E.useCallback)((e=>i.current.onDragMove&&i.current.onDragMove(e)),[]),c=(0,E.useCallback)((e=>{i.current.onDragEnd&&i.current.onDragEnd(e),document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",c),o(!1)}),[]),s=(0,E.useCallback)((e=>{i.current.onDragStart&&i.current.onDragStart(e),document.addEventListener("mousemove",u),document.addEventListener("mouseup",c),o(!0)}),[]);return(0,E.useEffect)((()=>()=>{r&&(document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",c))}),[r]),{startDrag:s,endDrag:c,isDragging:r}}var ee=n(1933),te=n.n(ee);n(5760);var ne=function(e,t,{bindGlobal:n=!1,eventName:r="keydown",isDisabled:o=!1,target:i}={}){const u=(0,E.useRef)(t);(0,E.useEffect)((()=>{u.current=t}),[t]),(0,E.useEffect)((()=>{if(o)return;const t=new(te())(i&&i.current?i.current:document);return(Array.isArray(e)?e:[e]).forEach((e=>{const o=e.split("+"),i=new Set(o.filter((e=>e.length>1))),c=i.has("alt"),s=i.has("shift");if((0,W.isAppleOS)()&&(1===i.size&&c||2===i.size&&c&&s))throw new Error(`Cannot bind ${e}. Alt and Shift+Alt modifiers are reserved for character input.`);t[n?"bindGlobal":"bind"](e,((...e)=>u.current(...e)),r)})),()=>{t.reset()}}),[e,n,r,i,o])};const re=new Map;function oe(e){const t=(0,E.useMemo)((()=>{const t=function(e){if(!e)return null;let t=re.get(e);return t||("undefined"!=typeof window&&"function"==typeof window.matchMedia?(t=window.matchMedia(e),re.set(e,t),t):null)}(e);return{subscribe:e=>t?(t.addEventListener?.("change",e),()=>{t.removeEventListener?.("change",e)}):()=>{},getValue:()=>t?.matches??!1}}),[e]);return(0,E.useSyncExternalStore)(t.subscribe,t.getValue,(()=>!1))}function ie(e){const t=(0,E.useRef)();return(0,E.useEffect)((()=>{t.current=e}),[e]),t.current}var ue=()=>oe("(prefers-reduced-motion: reduce)");function ce(e,t){const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]={...n[e],to:t.to}:n[e]=t})),n}const se=(e,t)=>{const n=e?.findIndex((({id:e})=>"string"==typeof e?e===t.id:w()(e,t.id))),r=[...e];return-1!==n?r[n]={id:t.id,changes:ce(r[n].changes,t.changes)}:r.push(t),r};function ae(){let e=[],t=[],n=0;const r=()=>{e=e.slice(0,n||void 0),n=0},o=()=>{const n=0===e.length?0:e.length-1;let r=e[n]??[];t.forEach((e=>{r=se(r,e)})),t=[],e[n]=r};return{addRecord(n,i=!1){const u=!n||(e=>!e.filter((({changes:e})=>Object.values(e).some((({from:e,to:t})=>"function"!=typeof e&&"function"!=typeof t&&!w()(e,t))))).length)(n);if(i){if(u)return;n.forEach((e=>{t=se(t,e)}))}else{if(r(),t.length&&o(),u)return;e.push(n)}},undo(){t.length&&(r(),o());const i=e[e.length-1+n];if(i)return n-=1,i},redo(){const t=e[e.length+n];if(t)return n+=1,t},hasUndo:()=>!!e[e.length-1+n],hasRedo:()=>!!e[e.length+n]}}function le(e,t){switch(t.type){case"UNDO":{const t=e.manager.undo();return t?{...e,value:t[0].changes.prop.from}:e}case"REDO":{const t=e.manager.redo();return t?{...e,value:t[0].changes.prop.to}:e}case"RECORD":return e.manager.addRecord([{id:"object",changes:{prop:{from:e.value,to:t.value}}}],t.isStaged),{...e,value:t.value}}return e}function fe(e){return{manager:ae(),value:e}}function de(e){const[t,n]=(0,E.useReducer)(le,e,fe);return{value:t.value,setValue:(0,E.useCallback)(((e,t)=>{n({type:"RECORD",value:e,isStaged:t})}),[]),hasUndo:t.manager.hasUndo(),hasRedo:t.manager.hasRedo(),undo:(0,E.useCallback)((()=>{n({type:"UNDO"})}),[]),redo:(0,E.useCallback)((()=>{n({type:"REDO"})}),[])}}const pe={xhuge:1920,huge:1440,wide:1280,xlarge:1080,large:960,medium:782,small:600,mobile:480},he={">=":"min-width","<":"max-width"},ve={">=":(e,t)=>t>=e,"<":(e,t)=>t<e},me=(0,E.createContext)(null);me.displayName="ViewportMatchWidthContext";const ye=(e,t=">=")=>{const n=(0,E.useContext)(me),r=oe(!n&&`(${he[t]}: ${pe[e]}px)`||void 0);return n?ve[t](pe[e],n):r};ye.__experimentalWidthProvider=me.Provider;var ge=ye;function be(e,t={}){const n=X(e),r=(0,E.useRef)(),o=(0,E.useRef)();return X((e=>{if(e===r.current)return;o.current??=new ResizeObserver(n);const{current:i}=o;r.current&&i.unobserve(r.current),r.current=e,e&&i.observe(e,t)}))}const we=e=>{let t;if(e.contentBoxSize)if(e.contentBoxSize[0]){const n=e.contentBoxSize[0];t=[n.inlineSize,n.blockSize]}else{const n=e.contentBoxSize;t=[n.inlineSize,n.blockSize]}else t=[e.contentRect.width,e.contentRect.height];const[n,r]=t.map((e=>Math.round(e)));return{width:n,height:r}},Ee={position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",opacity:0,overflow:"hidden",zIndex:-1};function Se({onResize:e}){const t=be((t=>{const n=we(t.at(-1));e(n)}));return(0,y.jsx)("div",{ref:t,style:Ee,"aria-hidden":"true"})}const xe={width:null,height:null};function ke(e,t={}){return e?be(e,t):function(){const[e,t]=(0,E.useState)(xe),n=(0,E.useRef)(xe),r=(0,E.useCallback)((e=>{var r,o;o=e,((r=n.current).width!==o.width||r.height!==o.height)&&(n.current=e,t(e))}),[]);return[(0,y.jsx)(Se,{onResize:r}),e]}()}const Te=window.wp.priorityQueue;var Ce=function(e,t={step:1}){const{step:n=1}=t,[r,o]=(0,E.useState)([]);return(0,E.useEffect)((()=>{let t=function(e,t){const n=[];for(let r=0;r<e.length;r++){const o=e[r];if(!t.includes(o))break;n.push(o)}return n}(e,r);t.length<n&&(t=t.concat(e.slice(t.length,n))),o(t);const i=(0,Te.createQueue)();for(let r=t.length;r<e.length;r+=n)i.add({},(()=>{(0,E.flushSync)((()=>{o((t=>[...t,...e.slice(r,r+n)]))}))}));return()=>i.reset()}),[e]),r};var Le=function(e,t="Change detection"){const n=ie(e);Object.entries(n??[]).forEach((([n,r])=>{r!==e[n]&&console.warn(`${t}: ${n} key changed:`,r,e[n])}))};const Re=window.React;function De(e,t){var n=(0,Re.useState)((function(){return{inputs:t,result:e()}}))[0],r=(0,Re.useRef)(!0),o=(0,Re.useRef)(n),i=r.current||Boolean(t&&o.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,o.current.inputs))?o.current:{inputs:t,result:e()};return(0,Re.useEffect)((function(){r.current=!1,o.current=i}),[i]),i.result}function Me(e,t,n){const r=De((()=>f(e,t??0,n)),[e,t,n?.leading,n?.trailing,n?.maxWait]);return(0,E.useEffect)((()=>()=>r.cancel()),[r]),r}function Oe(e=""){const[t,n]=(0,E.useState)(e),[r,o]=(0,E.useState)(e),i=Me(o,250);return(0,E.useEffect)((()=>{i(t)}),[t,i]),[t,n,r]}function _e(e,t,n){const r=De((()=>d(e,t??0,n)),[e,t,n]);return(0,E.useEffect)((()=>()=>r.cancel()),[r]),r}function Ae({dropZoneElement:e,isDisabled:t,onDrop:n,onDragStart:r,onDragEnter:o,onDragLeave:i,onDragEnd:u,onDragOver:c}){const s=X(n),a=X(r),l=X(o),f=X(i),d=X(u),p=X(c);return j((h=>{if(t)return;const v=e??h;let m=!1;const{ownerDocument:y}=v;function g(e){m||(m=!0,y.addEventListener("dragend",x),y.addEventListener("mousemove",x),r&&a(e))}function b(e){e.preventDefault(),v.contains(e.relatedTarget)||o&&l(e)}function w(e){!e.defaultPrevented&&c&&p(e),e.preventDefault()}function E(e){(function(e){const{defaultView:t}=y;if(!(e&&t&&e instanceof t.HTMLElement&&v.contains(e)))return!1;let n=e;do{if(n.dataset.isDropZone)return n===v}while(n=n.parentElement);return!1})(e.relatedTarget)||i&&f(e)}function S(e){e.defaultPrevented||(e.preventDefault(),e.dataTransfer&&e.dataTransfer.files.length,n&&s(e),x(e))}function x(e){m&&(m=!1,y.removeEventListener("dragend",x),y.removeEventListener("mousemove",x),u&&d(e))}return v.setAttribute("data-is-drop-zone","true"),v.addEventListener("drop",S),v.addEventListener("dragenter",b),v.addEventListener("dragover",w),v.addEventListener("dragleave",E),y.addEventListener("dragenter",g),()=>{v.removeAttribute("data-is-drop-zone"),v.removeEventListener("drop",S),v.removeEventListener("dragenter",b),v.removeEventListener("dragover",w),v.removeEventListener("dragleave",E),y.removeEventListener("dragend",x),y.removeEventListener("mousemove",x),y.removeEventListener("dragenter",g)}}),[t,e])}function je(){return j((e=>{const{ownerDocument:t}=e;if(!t)return;const{defaultView:n}=t;if(n)return n.addEventListener("blur",r),()=>{n.removeEventListener("blur",r)};function r(){t&&t.activeElement===e&&e.focus()}}),[])}const Pe=30;function Ie(e,t,n,r){const o=r?.initWindowSize??Pe,i=r?.useWindowing??!0,[u,c]=(0,E.useState)({visibleItems:o,start:0,end:o,itemInView:e=>e>=0&&e<=o});return(0,E.useLayoutEffect)((()=>{if(!i)return;const o=(0,A.getScrollContainer)(e.current),u=e=>{if(!o)return;const i=Math.ceil(o.clientHeight/t),u=e?i:r?.windowOverscan??i,s=Math.floor(o.scrollTop/t),a=Math.max(0,s-u),l=Math.min(n-1,s+i+u);c((e=>{const t={visibleItems:i,start:a,end:l,itemInView:e=>a<=e&&e<=l};return e.start!==t.start||e.end!==t.end||e.visibleItems!==t.visibleItems?t:e}))};u(!0);const s=f((()=>{u()}),16);return o?.addEventListener("scroll",s),o?.ownerDocument?.defaultView?.addEventListener("resize",s),o?.ownerDocument?.defaultView?.addEventListener("resize",s),()=>{o?.removeEventListener("scroll",s),o?.ownerDocument?.defaultView?.removeEventListener("resize",s)}}),[t,e,n,r?.expandedState,r?.windowOverscan,i]),(0,E.useLayoutEffect)((()=>{if(!i)return;const r=(0,A.getScrollContainer)(e.current),o=e=>{switch(e.keyCode){case W.HOME:return r?.scrollTo({top:0});case W.END:return r?.scrollTo({top:n*t});case W.PAGEUP:return r?.scrollTo({top:r.scrollTop-u.visibleItems*t});case W.PAGEDOWN:return r?.scrollTo({top:r.scrollTop+u.visibleItems*t})}};return r?.ownerDocument?.defaultView?.addEventListener("keydown",o),()=>{r?.ownerDocument?.defaultView?.removeEventListener("keydown",o)}}),[n,t,e,u.visibleItems,i,r?.expandedState]),[u,c]}function Ne(e,t){const[n,r]=(0,E.useMemo)((()=>[n=>e.subscribe(t,n),()=>e.get(t)]),[e,t]);return(0,E.useSyncExternalStore)(n,r,r)}})(),(window.wp=window.wp||{}).compose=r})(); dom-ready.js 0000644 00000003110 15121363541 0006757 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ domReady)
/* harmony export */ });
function domReady(callback) {
if (typeof document === "undefined") {
return;
}
if (document.readyState === "complete" || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.
document.readyState === "interactive") {
return void callback();
}
document.addEventListener("DOMContentLoaded", callback);
}
(window.wp = window.wp || {}).domReady = __webpack_exports__["default"];
/******/ })()
; viewport.min.js 0000644 00000003526 15121363541 0007552 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ifViewportMatches:()=>h,store:()=>d,withViewportMatch:()=>u});var r={};e.r(r),e.d(r,{setIsMatching:()=>c});var o={};e.r(o),e.d(o,{isViewportMatch:()=>s});const i=window.wp.compose,n=window.wp.data;var a=function(e={},t){return"SET_IS_MATCHING"===t.type?t.values:e};function c(e){return{type:"SET_IS_MATCHING",values:e}}function s(e,t){return-1===t.indexOf(" ")&&(t=">= "+t),!!e[t]}const d=(0,n.createReduxStore)("core/viewport",{reducer:a,actions:r,selectors:o});(0,n.register)(d);var p=(e,t)=>{const r=(0,i.debounce)((()=>{const e=Object.fromEntries(a.map((([e,t])=>[e,t.matches])));(0,n.dispatch)(d).setIsMatching(e)}),0,{leading:!0}),o=Object.entries(t),a=Object.entries(e).flatMap((([e,t])=>o.map((([o,i])=>{const n=window.matchMedia(`(${i}: ${t}px)`);return n.addEventListener("change",r),[`${o} ${e}`,n]}))));window.addEventListener("orientationchange",r),r(),r.flush()};const w=window.ReactJSXRuntime;var u=e=>{const t=Object.entries(e);return(0,i.createHigherOrderComponent)((e=>(0,i.pure)((r=>{const o=Object.fromEntries(t.map((([e,t])=>{let[r,o]=t.split(" ");return void 0===o&&(o=r,r=">="),[e,(0,i.useViewportMatch)(o,r)]})));return(0,w.jsx)(e,{...r,...o})}))),"withViewportMatch")};var h=e=>(0,i.createHigherOrderComponent)((0,i.compose)([u({isViewportMatch:e}),(0,i.ifCondition)((e=>e.isViewportMatch))]),"ifViewportMatches");p({huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},{"<":"max-width",">=":"min-width"}),(window.wp=window.wp||{}).viewport=t})(); commands.js 0000644 00000527324 15121363541 0006721 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({});
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/create fake namespace object */
/******/ (() => {
/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
/******/ var leafPrototypes;
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 16: return value when it's Promise-like
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = this(value);
/******/ if(mode & 8) return value;
/******/ if(typeof value === 'object' && value) {
/******/ if((mode & 4) && value.__esModule) return value;
/******/ if((mode & 16) && typeof value.then === 'function') return value;
/******/ }
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ var def = {};
/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
/******/ }
/******/ def['default'] = () => (value);
/******/ __webpack_require__.d(ns, def);
/******/ return ns;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/nonce */
/******/ (() => {
/******/ __webpack_require__.nc = undefined;
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
CommandMenu: () => (/* reexport */ CommandMenu),
privateApis: () => (/* reexport */ privateApis),
store: () => (/* reexport */ store),
useCommand: () => (/* reexport */ useCommand),
useCommandLoader: () => (/* reexport */ useCommandLoader),
useCommands: () => (/* reexport */ useCommands)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/commands/build-module/store/actions.js
var actions_namespaceObject = {};
__webpack_require__.r(actions_namespaceObject);
__webpack_require__.d(actions_namespaceObject, {
close: () => (actions_close),
open: () => (actions_open),
registerCommand: () => (registerCommand),
registerCommandLoader: () => (registerCommandLoader),
unregisterCommand: () => (unregisterCommand),
unregisterCommandLoader: () => (unregisterCommandLoader)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/commands/build-module/store/selectors.js
var selectors_namespaceObject = {};
__webpack_require__.r(selectors_namespaceObject);
__webpack_require__.d(selectors_namespaceObject, {
getCommandLoaders: () => (getCommandLoaders),
getCommands: () => (getCommands),
getContext: () => (getContext),
isOpen: () => (selectors_isOpen)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/commands/build-module/store/private-actions.js
var private_actions_namespaceObject = {};
__webpack_require__.r(private_actions_namespaceObject);
__webpack_require__.d(private_actions_namespaceObject, {
setContext: () => (setContext)
});
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// ./node_modules/cmdk/dist/chunk-NZJY6EH4.mjs
var U=1,Y=.9,H=.8,J=.17,p=.1,u=.999,$=.9999;var k=.99,m=/[\\\/_+.#"@\[\(\{&]/,B=/[\\\/_+.#"@\[\(\{&]/g,K=/[\s-]/,X=/[\s-]/g;function G(_,C,h,P,A,f,O){if(f===C.length)return A===_.length?U:k;var T=`${A},${f}`;if(O[T]!==void 0)return O[T];for(var L=P.charAt(f),c=h.indexOf(L,A),S=0,E,N,R,M;c>=0;)E=G(_,C,h,P,c+1,f+1,O),E>S&&(c===A?E*=U:m.test(_.charAt(c-1))?(E*=H,R=_.slice(A,c-1).match(B),R&&A>0&&(E*=Math.pow(u,R.length))):K.test(_.charAt(c-1))?(E*=Y,M=_.slice(A,c-1).match(X),M&&A>0&&(E*=Math.pow(u,M.length))):(E*=J,A>0&&(E*=Math.pow(u,c-A))),_.charAt(c)!==C.charAt(f)&&(E*=$)),(E<p&&h.charAt(c-1)===P.charAt(f+1)||P.charAt(f+1)===P.charAt(f)&&h.charAt(c-1)!==P.charAt(f))&&(N=G(_,C,h,P,c+1,f+2,O),N*p>E&&(E=N*p)),E>S&&(S=E),c=h.indexOf(L,c+1);return O[T]=S,S}function D(_){return _.toLowerCase().replace(X," ")}function W(_,C,h){return _=h&&h.length>0?`${_+" "+h.join(" ")}`:_,G(_,C,D(_),D(C),0,0,{})}
;// ./node_modules/@babel/runtime/helpers/esm/extends.js
function _extends() {
return _extends = Object.assign ? Object.assign.bind() : function (n) {
for (var e = 1; e < arguments.length; e++) {
var t = arguments[e];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
}
return n;
}, _extends.apply(null, arguments);
}
;// external "React"
const external_React_namespaceObject = window["React"];
var external_React_namespaceObject_0 = /*#__PURE__*/__webpack_require__.t(external_React_namespaceObject, 2);
;// ./node_modules/@radix-ui/primitive/dist/index.mjs
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) {
return function handleEvent(event) {
originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
};
}
;// ./node_modules/@radix-ui/react-compose-refs/dist/index.mjs
/**
* Set a given ref to a given value
* This utility takes care of different types of refs: callback refs and RefObject(s)
*/ function $6ed0406888f73fc4$var$setRef(ref, value) {
if (typeof ref === 'function') ref(value);
else if (ref !== null && ref !== undefined) ref.current = value;
}
/**
* A utility to compose multiple refs together
* Accepts callback refs and RefObject(s)
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)
)
;
}
/**
* A custom hook that composes multiple refs
* Accepts callback refs and RefObject(s)
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
// eslint-disable-next-line react-hooks/exhaustive-deps
return (0,external_React_namespaceObject.useCallback)($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
}
;// ./node_modules/@radix-ui/react-context/dist/index.mjs
function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
const Context = /*#__PURE__*/ (0,external_React_namespaceObject.createContext)(defaultContext);
function Provider(props) {
const { children: children , ...context } = props; // Only re-memoize when prop values change
// eslint-disable-next-line react-hooks/exhaustive-deps
const value = (0,external_React_namespaceObject.useMemo)(()=>context
, Object.values(context));
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)(Context.Provider, {
value: value
}, children);
}
function useContext(consumerName) {
const context = (0,external_React_namespaceObject.useContext)(Context);
if (context) return context;
if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
}
Provider.displayName = rootComponentName + 'Provider';
return [
Provider,
useContext
];
}
/* -------------------------------------------------------------------------------------------------
* createContextScope
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
let defaultContexts = [];
/* -----------------------------------------------------------------------------------------------
* createContext
* ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
const BaseContext = /*#__PURE__*/ (0,external_React_namespaceObject.createContext)(defaultContext);
const index = defaultContexts.length;
defaultContexts = [
...defaultContexts,
defaultContext
];
function Provider(props) {
const { scope: scope , children: children , ...context } = props;
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change
// eslint-disable-next-line react-hooks/exhaustive-deps
const value = (0,external_React_namespaceObject.useMemo)(()=>context
, Object.values(context));
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)(Context.Provider, {
value: value
}, children);
}
function useContext(consumerName, scope) {
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
const context = (0,external_React_namespaceObject.useContext)(Context);
if (context) return context;
if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
}
Provider.displayName = rootComponentName + 'Provider';
return [
Provider,
useContext
];
}
/* -----------------------------------------------------------------------------------------------
* createScope
* ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{
const scopeContexts = defaultContexts.map((defaultContext)=>{
return /*#__PURE__*/ (0,external_React_namespaceObject.createContext)(defaultContext);
});
return function useScope(scope) {
const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
return (0,external_React_namespaceObject.useMemo)(()=>({
[`__scope${scopeName}`]: {
...scope,
[scopeName]: contexts
}
})
, [
scope,
contexts
]);
};
};
createScope.scopeName = scopeName;
return [
$c512c27ab02ef895$export$fd42f52fd3ae1109,
$c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
];
}
/* -------------------------------------------------------------------------------------------------
* composeContextScopes
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
const baseScope = scopes[0];
if (scopes.length === 1) return baseScope;
const createScope1 = ()=>{
const scopeHooks = scopes.map((createScope)=>({
useScope: createScope(),
scopeName: createScope.scopeName
})
);
return function useComposedScopes(overrideScopes) {
const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{
// We are calling a hook inside a callback which React warns against to avoid inconsistent
// renders, however, scoping doesn't have render side effects so we ignore the rule.
// eslint-disable-next-line react-hooks/rules-of-hooks
const scopeProps = useScope(overrideScopes);
const currentScope = scopeProps[`__scope${scopeName}`];
return {
...nextScopes,
...currentScope
};
}, {});
return (0,external_React_namespaceObject.useMemo)(()=>({
[`__scope${baseScope.scopeName}`]: nextScopes1
})
, [
nextScopes1
]);
};
};
createScope1.scopeName = baseScope.scopeName;
return createScope1;
}
;// ./node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
/**
* On the server, React emits a warning when calling `useLayoutEffect`.
* This is because neither `useLayoutEffect` nor `useEffect` run on the server.
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
*
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? external_React_namespaceObject.useLayoutEffect : ()=>{};
;// ./node_modules/@radix-ui/react-id/dist/index.mjs
const $1746a345f3d73bb7$var$useReactId = external_React_namespaceObject_0['useId'.toString()] || (()=>undefined
);
let $1746a345f3d73bb7$var$count = 0;
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
const [id, setId] = external_React_namespaceObject.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
);
}, [
deterministicId
]);
return deterministicId || (id ? `radix-${id}` : '');
}
;// ./node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
/**
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
* prop or avoid re-executing effects when passed as a dependency
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
const callbackRef = (0,external_React_namespaceObject.useRef)(callback);
(0,external_React_namespaceObject.useEffect)(()=>{
callbackRef.current = callback;
}); // https://github.com/facebook/react/issues/19240
return (0,external_React_namespaceObject.useMemo)(()=>(...args)=>{
var _callbackRef$current;
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
}
, []);
}
;// ./node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
defaultProp: defaultProp,
onChange: onChange
});
const isControlled = prop !== undefined;
const value1 = isControlled ? prop : uncontrolledProp;
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
const setValue = (0,external_React_namespaceObject.useCallback)((nextValue)=>{
if (isControlled) {
const setter = nextValue;
const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
if (value !== prop) handleChange(value);
} else setUncontrolledProp(nextValue);
}, [
isControlled,
prop,
setUncontrolledProp,
handleChange
]);
return [
value1,
setValue
];
}
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
const uncontrolledState = (0,external_React_namespaceObject.useState)(defaultProp);
const [value] = uncontrolledState;
const prevValueRef = (0,external_React_namespaceObject.useRef)(value);
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
(0,external_React_namespaceObject.useEffect)(()=>{
if (prevValueRef.current !== value) {
handleChange(value);
prevValueRef.current = value;
}
}, [
value,
prevValueRef,
handleChange
]);
return uncontrolledState;
}
;// external "ReactDOM"
const external_ReactDOM_namespaceObject = window["ReactDOM"];
;// ./node_modules/@radix-ui/react-slot/dist/index.mjs
/* -------------------------------------------------------------------------------------------------
* Slot
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{
const { children: children , ...slotProps } = props;
const childrenArray = external_React_namespaceObject.Children.toArray(children);
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
if (slottable) {
// the new element to render is the one passed as a child of `Slottable`
const newElement = slottable.props.children;
const newChildren = childrenArray.map((child)=>{
if (child === slottable) {
// because the new element will be the one rendered, we are only interested
// in grabbing its children (`newElement.props.children`)
if (external_React_namespaceObject.Children.count(newElement) > 1) return external_React_namespaceObject.Children.only(null);
return /*#__PURE__*/ (0,external_React_namespaceObject.isValidElement)(newElement) ? newElement.props.children : null;
} else return child;
});
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
ref: forwardedRef
}), /*#__PURE__*/ (0,external_React_namespaceObject.isValidElement)(newElement) ? /*#__PURE__*/ (0,external_React_namespaceObject.cloneElement)(newElement, undefined, newChildren) : null);
}
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
ref: forwardedRef
}), children);
});
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
/* -------------------------------------------------------------------------------------------------
* SlotClone
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{
const { children: children , ...slotProps } = props;
if (/*#__PURE__*/ (0,external_React_namespaceObject.isValidElement)(children)) return /*#__PURE__*/ (0,external_React_namespaceObject.cloneElement)(children, {
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
});
return external_React_namespaceObject.Children.count(children) > 1 ? external_React_namespaceObject.Children.only(null) : null;
});
$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';
/* -------------------------------------------------------------------------------------------------
* Slottable
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, children);
};
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {
return /*#__PURE__*/ (0,external_React_namespaceObject.isValidElement)(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
}
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
// all child props should override
const overrideProps = {
...childProps
};
for(const propName in childProps){
const slotPropValue = slotProps[propName];
const childPropValue = childProps[propName];
const isHandler = /^on[A-Z]/.test(propName);
if (isHandler) {
// if the handler exists on both, we compose them
if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{
childPropValue(...args);
slotPropValue(...args);
};
else if (slotPropValue) overrideProps[propName] = slotPropValue;
} else if (propName === 'style') overrideProps[propName] = {
...slotPropValue,
...childPropValue
};
else if (propName === 'className') overrideProps[propName] = [
slotPropValue,
childPropValue
].filter(Boolean).join(' ');
}
return {
...slotProps,
...overrideProps
};
}
const $5e63c961fc1ce211$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($5e63c961fc1ce211$export$8c6ed5c666ac1360));
;// ./node_modules/@radix-ui/react-primitive/dist/index.mjs
const $8927f6f2acc4f386$var$NODES = [
'a',
'button',
'div',
'form',
'h2',
'h3',
'img',
'input',
'label',
'li',
'nav',
'ol',
'p',
'span',
'svg',
'ul'
]; // Temporary while we await merge of this fix:
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396
// prettier-ignore
/* -------------------------------------------------------------------------------------------------
* Primitive
* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{
const Node = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{
const { asChild: asChild , ...primitiveProps } = props;
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
(0,external_React_namespaceObject.useEffect)(()=>{
window[Symbol.for('radix-ui')] = true;
}, []);
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)(Comp, _extends({}, primitiveProps, {
ref: forwardedRef
}));
});
Node.displayName = `Primitive.${node}`;
return {
...primitive,
[node]: Node
};
}, {});
/* -------------------------------------------------------------------------------------------------
* Utils
* -----------------------------------------------------------------------------------------------*/ /**
* Flush custom event dispatch
* https://github.com/radix-ui/primitives/pull/1378
*
* React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.
*
* Internally, React prioritises events in the following order:
* - discrete
* - continuous
* - default
*
* https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350
*
* `discrete` is an important distinction as updates within these events are applied immediately.
* React however, is not able to infer the priority of custom event types due to how they are detected internally.
* Because of this, it's possible for updates from custom events to be unexpectedly batched when
* dispatched by another `discrete` event.
*
* In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.
* This utility should be used when dispatching a custom event from within another `discrete` event, this utility
* is not nessesary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.
* For example:
*
* dispatching a known click 👎
* target.dispatchEvent(new Event(‘click’))
*
* dispatching a custom type within a non-discrete event 👎
* onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}
*
* dispatching a custom type within a `discrete` event 👍
* onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}
*
* Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
* this utility with them. This is because it's possible for those handlers to be called implicitly during render
* e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
*/ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {
if (target) (0,external_ReactDOM_namespaceObject.flushSync)(()=>target.dispatchEvent(event)
);
}
/* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($8927f6f2acc4f386$export$250ffa63cdc0d034));
;// ./node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
/**
* Listens for when the escape key is down
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
(0,external_React_namespaceObject.useEffect)(()=>{
const handleKeyDown = (event)=>{
if (event.key === 'Escape') onEscapeKeyDown(event);
};
ownerDocument.addEventListener('keydown', handleKeyDown);
return ()=>ownerDocument.removeEventListener('keydown', handleKeyDown)
;
}, [
onEscapeKeyDown,
ownerDocument
]);
}
;// ./node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
/* -------------------------------------------------------------------------------------------------
* DismissableLayer
* -----------------------------------------------------------------------------------------------*/ const $5cb92bef7577960e$var$DISMISSABLE_LAYER_NAME = 'DismissableLayer';
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
let $5cb92bef7577960e$var$originalBodyPointerEvents;
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ (0,external_React_namespaceObject.createContext)({
layers: new Set(),
layersWithOutsidePointerEventsDisabled: new Set(),
branches: new Set()
});
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{
var _node$ownerDocument;
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
const context = (0,external_React_namespaceObject.useContext)($5cb92bef7577960e$var$DismissableLayerContext);
const [node1, setNode] = (0,external_React_namespaceObject.useState)(null);
const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;
const [, force] = (0,external_React_namespaceObject.useState)({});
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
);
const layers = Array.from(context.layers);
const [highestLayerWithOutsidePointerEventsDisabled] = [
...context.layersWithOutsidePointerEventsDisabled
].slice(-1); // prettier-ignore
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore
const index = node1 ? layers.indexOf(node1) : -1;
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
const target = event.target;
const isPointerDownOnBranch = [
...context.branches
].some((branch)=>branch.contains(target)
);
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
}, ownerDocument);
const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
const target = event.target;
const isFocusInBranch = [
...context.branches
].some((branch)=>branch.contains(target)
);
if (isFocusInBranch) return;
onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
}, ownerDocument);
$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
const isHighestLayer = index === context.layers.size - 1;
if (!isHighestLayer) return;
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
if (!event.defaultPrevented && onDismiss) {
event.preventDefault();
onDismiss();
}
}, ownerDocument);
(0,external_React_namespaceObject.useEffect)(()=>{
if (!node1) return;
if (disableOutsidePointerEvents) {
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
$5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
ownerDocument.body.style.pointerEvents = 'none';
}
context.layersWithOutsidePointerEventsDisabled.add(node1);
}
context.layers.add(node1);
$5cb92bef7577960e$var$dispatchUpdate();
return ()=>{
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
};
}, [
node1,
ownerDocument,
disableOutsidePointerEvents,
context
]);
/**
* We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect
* because a change to `disableOutsidePointerEvents` would remove this layer from the stack
* and add it to the end again so the layering order wouldn't be _creation order_.
* We only want them to be removed from context stacks when unmounted.
*/ (0,external_React_namespaceObject.useEffect)(()=>{
return ()=>{
if (!node1) return;
context.layers.delete(node1);
context.layersWithOutsidePointerEventsDisabled.delete(node1);
$5cb92bef7577960e$var$dispatchUpdate();
};
}, [
node1,
context
]);
(0,external_React_namespaceObject.useEffect)(()=>{
const handleUpdate = ()=>force({})
;
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
;
}, []);
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
ref: composedRefs,
style: {
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
...props.style
},
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
}));
});
/*#__PURE__*/ Object.assign($5cb92bef7577960e$export$177fb62ff3ec1f22, {
displayName: $5cb92bef7577960e$var$DISMISSABLE_LAYER_NAME
});
/* -------------------------------------------------------------------------------------------------
* DismissableLayerBranch
* -----------------------------------------------------------------------------------------------*/ const $5cb92bef7577960e$var$BRANCH_NAME = 'DismissableLayerBranch';
const $5cb92bef7577960e$export$4d5eb2109db14228 = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{
const context = (0,external_React_namespaceObject.useContext)($5cb92bef7577960e$var$DismissableLayerContext);
const ref = (0,external_React_namespaceObject.useRef)(null);
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
(0,external_React_namespaceObject.useEffect)(()=>{
const node = ref.current;
if (node) {
context.branches.add(node);
return ()=>{
context.branches.delete(node);
};
}
}, [
context.branches
]);
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, props, {
ref: composedRefs
}));
});
/*#__PURE__*/ Object.assign($5cb92bef7577960e$export$4d5eb2109db14228, {
displayName: $5cb92bef7577960e$var$BRANCH_NAME
});
/* -----------------------------------------------------------------------------------------------*/ /**
* Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
* to mimic layer dismissing behaviour present in OS.
* Returns props to pass to the node we want to check for outside events.
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
const isPointerInsideReactTreeRef = (0,external_React_namespaceObject.useRef)(false);
const handleClickRef = (0,external_React_namespaceObject.useRef)(()=>{});
(0,external_React_namespaceObject.useEffect)(()=>{
const handlePointerDown = (event)=>{
if (event.target && !isPointerInsideReactTreeRef.current) {
const eventDetail = {
originalEvent: event
};
function handleAndDispatchPointerDownOutsideEvent() {
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
discrete: true
});
}
/**
* On touch devices, we need to wait for a click event because browsers implement
* a ~350ms delay between the time the user stops touching the display and when the
* browser executres events. We need to ensure we don't reactivate pointer-events within
* this timeframe otherwise the browser may execute events that should have been prevented.
*
* Additionally, this also lets us deal automatically with cancellations when a click event
* isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.
*
* This is why we also continuously remove the previous listener, because we cannot be
* certain that it was raised, and therefore cleaned-up.
*/ if (event.pointerType === 'touch') {
ownerDocument.removeEventListener('click', handleClickRef.current);
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
ownerDocument.addEventListener('click', handleClickRef.current, {
once: true
});
} else handleAndDispatchPointerDownOutsideEvent();
} else // We need to remove the event listener in case the outside click has been canceled.
// See: https://github.com/radix-ui/primitives/issues/2171
ownerDocument.removeEventListener('click', handleClickRef.current);
isPointerInsideReactTreeRef.current = false;
};
/**
* if this hook executes in a component that mounts via a `pointerdown` event, the event
* would bubble up to the document and trigger a `pointerDownOutside` event. We avoid
* this by delaying the event listener registration on the document.
* This is not React specific, but rather how the DOM works, ie:
* ```
* button.addEventListener('pointerdown', () => {
* console.log('I will log');
* document.addEventListener('pointerdown', () => {
* console.log('I will also log');
* })
* });
*/ const timerId = window.setTimeout(()=>{
ownerDocument.addEventListener('pointerdown', handlePointerDown);
}, 0);
return ()=>{
window.clearTimeout(timerId);
ownerDocument.removeEventListener('pointerdown', handlePointerDown);
ownerDocument.removeEventListener('click', handleClickRef.current);
};
}, [
ownerDocument,
handlePointerDownOutside
]);
return {
// ensures we check React component tree (not just DOM tree)
onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true
};
}
/**
* Listens for when focus happens outside a react subtree.
* Returns props to pass to the root (node) of the subtree we want to check.
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
const isFocusInsideReactTreeRef = (0,external_React_namespaceObject.useRef)(false);
(0,external_React_namespaceObject.useEffect)(()=>{
const handleFocus = (event)=>{
if (event.target && !isFocusInsideReactTreeRef.current) {
const eventDetail = {
originalEvent: event
};
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
discrete: false
});
}
};
ownerDocument.addEventListener('focusin', handleFocus);
return ()=>ownerDocument.removeEventListener('focusin', handleFocus)
;
}, [
ownerDocument,
handleFocusOutside
]);
return {
onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true
,
onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
};
}
function $5cb92bef7577960e$var$dispatchUpdate() {
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
document.dispatchEvent(event);
}
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
const target = detail.originalEvent.target;
const event = new CustomEvent(name, {
bubbles: false,
cancelable: true,
detail: detail
});
if (handler) target.addEventListener(name, handler, {
once: true
});
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
else target.dispatchEvent(event);
}
const $5cb92bef7577960e$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($5cb92bef7577960e$export$177fb62ff3ec1f22));
const $5cb92bef7577960e$export$aecb2ddcb55c95be = (/* unused pure expression or super */ null && ($5cb92bef7577960e$export$4d5eb2109db14228));
;// ./node_modules/@radix-ui/react-focus-scope/dist/index.mjs
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';
const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
bubbles: false,
cancelable: true
};
/* -------------------------------------------------------------------------------------------------
* FocusScope
* -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$FOCUS_SCOPE_NAME = 'FocusScope';
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{
const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
const [container1, setContainer] = (0,external_React_namespaceObject.useState)(null);
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
const lastFocusedElementRef = (0,external_React_namespaceObject.useRef)(null);
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node)
);
const focusScope = (0,external_React_namespaceObject.useRef)({
paused: false,
pause () {
this.paused = true;
},
resume () {
this.paused = false;
}
}).current; // Takes care of trapping focus if focus is moved outside programmatically for example
(0,external_React_namespaceObject.useEffect)(()=>{
if (trapped) {
function handleFocusIn(event) {
if (focusScope.paused || !container1) return;
const target = event.target;
if (container1.contains(target)) lastFocusedElementRef.current = target;
else $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
select: true
});
}
function handleFocusOut(event) {
if (focusScope.paused || !container1) return;
const relatedTarget = event.relatedTarget; // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:
//
// 1. When the user switches app/tabs/windows/the browser itself loses focus.
// 2. In Google Chrome, when the focused element is removed from the DOM.
//
// We let the browser do its thing here because:
//
// 1. The browser already keeps a memory of what's focused for when the page gets refocused.
// 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it
// throws the CPU to 100%, so we avoid doing anything for this reason here too.
if (relatedTarget === null) return; // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)
// that is outside the container, we move focus to the last valid focused element inside.
if (!container1.contains(relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
select: true
});
} // When the focused element gets removed from the DOM, browsers move focus
// back to the document.body. In this case, we move focus to the container
// to keep focus trapped correctly.
function handleMutations(mutations) {
const focusedElement = document.activeElement;
if (focusedElement !== document.body) return;
for (const mutation of mutations)if (mutation.removedNodes.length > 0) $d3863c46a17e8a28$var$focus(container1);
}
document.addEventListener('focusin', handleFocusIn);
document.addEventListener('focusout', handleFocusOut);
const mutationObserver = new MutationObserver(handleMutations);
if (container1) mutationObserver.observe(container1, {
childList: true,
subtree: true
});
return ()=>{
document.removeEventListener('focusin', handleFocusIn);
document.removeEventListener('focusout', handleFocusOut);
mutationObserver.disconnect();
};
}
}, [
trapped,
container1,
focusScope.paused
]);
(0,external_React_namespaceObject.useEffect)(()=>{
if (container1) {
$d3863c46a17e8a28$var$focusScopesStack.add(focusScope);
const previouslyFocusedElement = document.activeElement;
const hasFocusedCandidate = container1.contains(previouslyFocusedElement);
if (!hasFocusedCandidate) {
const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
container1.dispatchEvent(mountEvent);
if (!mountEvent.defaultPrevented) {
$d3863c46a17e8a28$var$focusFirst($d3863c46a17e8a28$var$removeLinks($d3863c46a17e8a28$var$getTabbableCandidates(container1)), {
select: true
});
if (document.activeElement === previouslyFocusedElement) $d3863c46a17e8a28$var$focus(container1);
}
}
return ()=>{
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); // We hit a react bug (fixed in v17) with focusing in unmount.
// We need to delay the focus a little to get around it for now.
// See: https://github.com/facebook/react/issues/17894
setTimeout(()=>{
const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
container1.dispatchEvent(unmountEvent);
if (!unmountEvent.defaultPrevented) $d3863c46a17e8a28$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, {
select: true
});
// we need to remove the listener after we `dispatchEvent`
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
$d3863c46a17e8a28$var$focusScopesStack.remove(focusScope);
}, 0);
};
}
}, [
container1,
onMountAutoFocus,
onUnmountAutoFocus,
focusScope
]); // Takes care of looping focus (when tabbing whilst at the edges)
const handleKeyDown = (0,external_React_namespaceObject.useCallback)((event)=>{
if (!loop && !trapped) return;
if (focusScope.paused) return;
const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;
const focusedElement = document.activeElement;
if (isTabKey && focusedElement) {
const container = event.currentTarget;
const [first, last] = $d3863c46a17e8a28$var$getTabbableEdges(container);
const hasTabbableElementsInside = first && last; // we can only wrap focus if we have tabbable edges
if (!hasTabbableElementsInside) {
if (focusedElement === container) event.preventDefault();
} else {
if (!event.shiftKey && focusedElement === last) {
event.preventDefault();
if (loop) $d3863c46a17e8a28$var$focus(first, {
select: true
});
} else if (event.shiftKey && focusedElement === first) {
event.preventDefault();
if (loop) $d3863c46a17e8a28$var$focus(last, {
select: true
});
}
}
}
}, [
loop,
trapped,
focusScope.paused
]);
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
tabIndex: -1
}, scopeProps, {
ref: composedRefs,
onKeyDown: handleKeyDown
}));
});
/*#__PURE__*/ Object.assign($d3863c46a17e8a28$export$20e40289641fbbb6, {
displayName: $d3863c46a17e8a28$var$FOCUS_SCOPE_NAME
});
/* -------------------------------------------------------------------------------------------------
* Utils
* -----------------------------------------------------------------------------------------------*/ /**
* Attempts focusing the first element in a list of candidates.
* Stops when focus has actually moved.
*/ function $d3863c46a17e8a28$var$focusFirst(candidates, { select: select = false } = {}) {
const previouslyFocusedElement = document.activeElement;
for (const candidate of candidates){
$d3863c46a17e8a28$var$focus(candidate, {
select: select
});
if (document.activeElement !== previouslyFocusedElement) return;
}
}
/**
* Returns the first and last tabbable elements inside a container.
*/ function $d3863c46a17e8a28$var$getTabbableEdges(container) {
const candidates = $d3863c46a17e8a28$var$getTabbableCandidates(container);
const first = $d3863c46a17e8a28$var$findVisible(candidates, container);
const last = $d3863c46a17e8a28$var$findVisible(candidates.reverse(), container);
return [
first,
last
];
}
/**
* Returns a list of potential tabbable candidates.
*
* NOTE: This is only a close approximation. For example it doesn't take into account cases like when
* elements are not visible. This cannot be worked out easily by just reading a property, but rather
* necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.
*
* See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker
* Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1
*/ function $d3863c46a17e8a28$var$getTabbableCandidates(container) {
const nodes = [];
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
acceptNode: (node)=>{
const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; // `.tabIndex` is not the same as the `tabindex` attribute. It works on the
// runtime's understanding of tabbability, so this automatically accounts
// for any kind of element that could be tabbed to.
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
}
});
while(walker.nextNode())nodes.push(walker.currentNode); // we do not take into account the order of nodes with positive `tabIndex` as it
// hinders accessibility to have tab order different from visual order.
return nodes;
}
/**
* Returns the first visible element in a list.
* NOTE: Only checks visibility up to the `container`.
*/ function $d3863c46a17e8a28$var$findVisible(elements, container) {
for (const element of elements){
// we stop checking if it's hidden at the `container` level (excluding)
if (!$d3863c46a17e8a28$var$isHidden(element, {
upTo: container
})) return element;
}
}
function $d3863c46a17e8a28$var$isHidden(node, { upTo: upTo }) {
if (getComputedStyle(node).visibility === 'hidden') return true;
while(node){
// we stop at `upTo` (excluding it)
if (upTo !== undefined && node === upTo) return false;
if (getComputedStyle(node).display === 'none') return true;
node = node.parentElement;
}
return false;
}
function $d3863c46a17e8a28$var$isSelectableInput(element) {
return element instanceof HTMLInputElement && 'select' in element;
}
function $d3863c46a17e8a28$var$focus(element, { select: select = false } = {}) {
// only focus if that element is focusable
if (element && element.focus) {
const previouslyFocusedElement = document.activeElement; // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users
element.focus({
preventScroll: true
}); // only select if its not the same element, it supports selection and we need to select
if (element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput(element) && select) element.select();
}
}
/* -------------------------------------------------------------------------------------------------
* FocusScope stack
* -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$focusScopesStack = $d3863c46a17e8a28$var$createFocusScopesStack();
function $d3863c46a17e8a28$var$createFocusScopesStack() {
/** A stack of focus scopes, with the active one at the top */ let stack = [];
return {
add (focusScope) {
// pause the currently active focus scope (at the top of the stack)
const activeFocusScope = stack[0];
if (focusScope !== activeFocusScope) activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope.pause();
// remove in case it already exists (because we'll re-add it at the top of the stack)
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
stack.unshift(focusScope);
},
remove (focusScope) {
var _stack$;
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
(_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume();
}
};
}
function $d3863c46a17e8a28$var$arrayRemove(array, item) {
const updatedArray = [
...array
];
const index = updatedArray.indexOf(item);
if (index !== -1) updatedArray.splice(index, 1);
return updatedArray;
}
function $d3863c46a17e8a28$var$removeLinks(items) {
return items.filter((item)=>item.tagName !== 'A'
);
}
const $d3863c46a17e8a28$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($d3863c46a17e8a28$export$20e40289641fbbb6));
;// ./node_modules/@radix-ui/react-portal/dist/index.mjs
/* -------------------------------------------------------------------------------------------------
* Portal
* -----------------------------------------------------------------------------------------------*/ const $f1701beae083dbae$var$PORTAL_NAME = 'Portal';
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{
var _globalThis$document;
const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props;
return container ? /*#__PURE__*/ external_ReactDOM_namespaceObject.createPortal(/*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
ref: forwardedRef
})), container) : null;
});
/*#__PURE__*/ Object.assign($f1701beae083dbae$export$602eac185826482c, {
displayName: $f1701beae083dbae$var$PORTAL_NAME
});
/* -----------------------------------------------------------------------------------------------*/ const $f1701beae083dbae$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($f1701beae083dbae$export$602eac185826482c));
;// ./node_modules/@radix-ui/react-presence/dist/index.mjs
function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
return (0,external_React_namespaceObject.useReducer)((state, event)=>{
const nextState = machine[state][event];
return nextState !== null && nextState !== void 0 ? nextState : state;
}, initialState);
}
const $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props)=>{
const { present: present , children: children } = props;
const presence = $921a889cee6df7e8$var$usePresence(present);
const child = typeof children === 'function' ? children({
present: presence.isPresent
}) : external_React_namespaceObject.Children.only(children);
const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref);
const forceMount = typeof children === 'function';
return forceMount || presence.isPresent ? /*#__PURE__*/ (0,external_React_namespaceObject.cloneElement)(child, {
ref: ref
}) : null;
};
$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence';
/* -------------------------------------------------------------------------------------------------
* usePresence
* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$usePresence(present) {
const [node1, setNode] = (0,external_React_namespaceObject.useState)();
const stylesRef = (0,external_React_namespaceObject.useRef)({});
const prevPresentRef = (0,external_React_namespaceObject.useRef)(present);
const prevAnimationNameRef = (0,external_React_namespaceObject.useRef)('none');
const initialState = present ? 'mounted' : 'unmounted';
const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, {
mounted: {
UNMOUNT: 'unmounted',
ANIMATION_OUT: 'unmountSuspended'
},
unmountSuspended: {
MOUNT: 'mounted',
ANIMATION_END: 'unmounted'
},
unmounted: {
MOUNT: 'mounted'
}
});
(0,external_React_namespaceObject.useEffect)(()=>{
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';
}, [
state
]);
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
const styles = stylesRef.current;
const wasPresent = prevPresentRef.current;
const hasPresentChanged = wasPresent !== present;
if (hasPresentChanged) {
const prevAnimationName = prevAnimationNameRef.current;
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles);
if (present) send('MOUNT');
else if (currentAnimationName === 'none' || (styles === null || styles === void 0 ? void 0 : styles.display) === 'none') // If there is no exit animation or the element is hidden, animations won't run
// so we unmount instantly
send('UNMOUNT');
else {
/**
* When `present` changes to `false`, we check changes to animation-name to
* determine whether an animation has started. We chose this approach (reading
* computed styles) because there is no `animationrun` event and `animationstart`
* fires after `animation-delay` has expired which would be too late.
*/ const isAnimating = prevAnimationName !== currentAnimationName;
if (wasPresent && isAnimating) send('ANIMATION_OUT');
else send('UNMOUNT');
}
prevPresentRef.current = present;
}
}, [
present,
send
]);
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
if (node1) {
/**
* Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`
* event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we
* make sure we only trigger ANIMATION_END for the currently active animation.
*/ const handleAnimationEnd = (event)=>{
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
if (event.target === node1 && isCurrentAnimation) // With React 18 concurrency this update is applied
// a frame after the animation ends, creating a flash of visible content.
// By manually flushing we ensure they sync within a frame, removing the flash.
(0,external_ReactDOM_namespaceObject.flushSync)(()=>send('ANIMATION_END')
);
};
const handleAnimationStart = (event)=>{
if (event.target === node1) // if animation occurred, store its name as the previous animation.
prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
};
node1.addEventListener('animationstart', handleAnimationStart);
node1.addEventListener('animationcancel', handleAnimationEnd);
node1.addEventListener('animationend', handleAnimationEnd);
return ()=>{
node1.removeEventListener('animationstart', handleAnimationStart);
node1.removeEventListener('animationcancel', handleAnimationEnd);
node1.removeEventListener('animationend', handleAnimationEnd);
};
} else // Transition to the unmounted state if the node is removed prematurely.
// We avoid doing so during cleanup as the node may change but still exist.
send('ANIMATION_END');
}, [
node1,
send
]);
return {
isPresent: [
'mounted',
'unmountSuspended'
].includes(state),
ref: (0,external_React_namespaceObject.useCallback)((node)=>{
if (node) stylesRef.current = getComputedStyle(node);
setNode(node);
}, [])
};
}
/* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$getAnimationName(styles) {
return (styles === null || styles === void 0 ? void 0 : styles.animationName) || 'none';
}
;// ./node_modules/@radix-ui/react-focus-guards/dist/index.mjs
/** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0;
function $3db38b7d1fb3fe6a$export$ac5b58043b79449b(props) {
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
return props.children;
}
/**
* Injects a pair of focus guards at the edges of the whole DOM tree
* to ensure `focusin` & `focusout` events can be caught consistently.
*/ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
(0,external_React_namespaceObject.useEffect)(()=>{
var _edgeGuards$, _edgeGuards$2;
const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
$3db38b7d1fb3fe6a$var$count++;
return ()=>{
if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove()
);
$3db38b7d1fb3fe6a$var$count--;
};
}, []);
}
function $3db38b7d1fb3fe6a$var$createFocusGuard() {
const element = document.createElement('span');
element.setAttribute('data-radix-focus-guard', '');
element.tabIndex = 0;
element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';
return element;
}
const $3db38b7d1fb3fe6a$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($3db38b7d1fb3fe6a$export$ac5b58043b79449b));
;// ./node_modules/tslib/tslib.es6.mjs
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
}
return __assign.apply(this, arguments);
}
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
}
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
var _, done = false;
for (var i = decorators.length - 1; i >= 0; i--) {
var context = {};
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
if (kind === "accessor") {
if (result === void 0) continue;
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
if (_ = accept(result.get)) descriptor.get = _;
if (_ = accept(result.set)) descriptor.set = _;
if (_ = accept(result.init)) initializers.unshift(_);
}
else if (_ = accept(result)) {
if (kind === "field") initializers.unshift(_);
else descriptor[key] = _;
}
}
if (target) Object.defineProperty(target, contextIn.name, descriptor);
done = true;
};
function __runInitializers(thisArg, initializers, value) {
var useValue = arguments.length > 2;
for (var i = 0; i < initializers.length; i++) {
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
}
return useValue ? value : void 0;
};
function __propKey(x) {
return typeof x === "symbol" ? x : "".concat(x);
};
function __setFunctionName(f, name, prefix) {
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
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;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
var __createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
});
function __exportStar(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
}
/** @deprecated */
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
/** @deprecated */
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}
function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}
function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
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);
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); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}
function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __setModuleDefault = Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
};
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
}
function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
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");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
function __classPrivateFieldSet(receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
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");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}
function __classPrivateFieldIn(state, receiver) {
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
return typeof state === "function" ? receiver === state : state.has(receiver);
}
function __addDisposableResource(env, value, async) {
if (value !== null && value !== void 0) {
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
var dispose, inner;
if (async) {
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
dispose = value[Symbol.asyncDispose];
}
if (dispose === void 0) {
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
dispose = value[Symbol.dispose];
if (async) inner = dispose;
}
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
env.stack.push({ value: value, dispose: dispose, async: async });
}
else if (async) {
env.stack.push({ async: true });
}
return value;
}
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
function __disposeResources(env) {
function fail(e) {
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
env.hasError = true;
}
var r, s = 0;
function next() {
while (r = env.stack.pop()) {
try {
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
if (r.dispose) {
var result = r.dispose.call(r.value);
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
}
else s |= 1;
}
catch (e) {
fail(e);
}
}
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
if (env.hasError) throw env.error;
}
return next();
}
function __rewriteRelativeImportExtension(path, preserveJsx) {
if (typeof path === "string" && /^\.\.?\//.test(path)) {
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
});
}
return path;
}
/* harmony default export */ const tslib_es6 = ({
__extends,
__assign,
__rest,
__decorate,
__param,
__esDecorate,
__runInitializers,
__propKey,
__setFunctionName,
__metadata,
__awaiter,
__generator,
__createBinding,
__exportStar,
__values,
__read,
__spread,
__spreadArrays,
__spreadArray,
__await,
__asyncGenerator,
__asyncDelegator,
__asyncValues,
__makeTemplateObject,
__importStar,
__importDefault,
__classPrivateFieldGet,
__classPrivateFieldSet,
__classPrivateFieldIn,
__addDisposableResource,
__disposeResources,
__rewriteRelativeImportExtension,
});
;// ./node_modules/react-remove-scroll-bar/dist/es2015/constants.js
var zeroRightClassName = 'right-scroll-bar-position';
var fullWidthClassName = 'width-before-scroll-bar';
var noScrollbarsClassName = 'with-scroll-bars-hidden';
/**
* Name of a CSS variable containing the amount of "hidden" scrollbar
* ! might be undefined ! use will fallback!
*/
var removedBarSizeVariable = '--removed-body-scroll-bar-size';
;// ./node_modules/use-callback-ref/dist/es2015/assignRef.js
/**
* Assigns a value for a given ref, no matter of the ref format
* @param {RefObject} ref - a callback function or ref object
* @param value - a new value
*
* @see https://github.com/theKashey/use-callback-ref#assignref
* @example
* const refObject = useRef();
* const refFn = (ref) => {....}
*
* assignRef(refObject, "refValue");
* assignRef(refFn, "refValue");
*/
function assignRef(ref, value) {
if (typeof ref === 'function') {
ref(value);
}
else if (ref) {
ref.current = value;
}
return ref;
}
;// ./node_modules/use-callback-ref/dist/es2015/useRef.js
/**
* creates a MutableRef with ref change callback
* @param initialValue - initial ref value
* @param {Function} callback - a callback to run when value changes
*
* @example
* const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue);
* ref.current = 1;
* // prints 0 -> 1
*
* @see https://reactjs.org/docs/hooks-reference.html#useref
* @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref
* @returns {MutableRefObject}
*/
function useCallbackRef(initialValue, callback) {
var ref = (0,external_React_namespaceObject.useState)(function () { return ({
// value
value: initialValue,
// last callback
callback: callback,
// "memoized" public interface
facade: {
get current() {
return ref.value;
},
set current(value) {
var last = ref.value;
if (last !== value) {
ref.value = value;
ref.callback(value, last);
}
},
},
}); })[0];
// update callback
ref.callback = callback;
return ref.facade;
}
;// ./node_modules/use-callback-ref/dist/es2015/useMergeRef.js
var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? external_React_namespaceObject.useLayoutEffect : external_React_namespaceObject.useEffect;
var currentValues = new WeakMap();
/**
* Merges two or more refs together providing a single interface to set their value
* @param {RefObject|Ref} refs
* @returns {MutableRefObject} - a new ref, which translates all changes to {refs}
*
* @see {@link mergeRefs} a version without buit-in memoization
* @see https://github.com/theKashey/use-callback-ref#usemergerefs
* @example
* const Component = React.forwardRef((props, ref) => {
* const ownRef = useRef();
* const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together
* return <div ref={domRef}>...</div>
* }
*/
function useMergeRefs(refs, defaultValue) {
var callbackRef = useCallbackRef(defaultValue || null, function (newValue) {
return refs.forEach(function (ref) { return assignRef(ref, newValue); });
});
// handle refs changes - added or removed
useIsomorphicLayoutEffect(function () {
var oldValue = currentValues.get(callbackRef);
if (oldValue) {
var prevRefs_1 = new Set(oldValue);
var nextRefs_1 = new Set(refs);
var current_1 = callbackRef.current;
prevRefs_1.forEach(function (ref) {
if (!nextRefs_1.has(ref)) {
assignRef(ref, null);
}
});
nextRefs_1.forEach(function (ref) {
if (!prevRefs_1.has(ref)) {
assignRef(ref, current_1);
}
});
}
currentValues.set(callbackRef, refs);
}, [refs]);
return callbackRef;
}
;// ./node_modules/use-sidecar/dist/es2015/medium.js
function ItoI(a) {
return a;
}
function innerCreateMedium(defaults, middleware) {
if (middleware === void 0) { middleware = ItoI; }
var buffer = [];
var assigned = false;
var medium = {
read: function () {
if (assigned) {
throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.');
}
if (buffer.length) {
return buffer[buffer.length - 1];
}
return defaults;
},
useMedium: function (data) {
var item = middleware(data, assigned);
buffer.push(item);
return function () {
buffer = buffer.filter(function (x) { return x !== item; });
};
},
assignSyncMedium: function (cb) {
assigned = true;
while (buffer.length) {
var cbs = buffer;
buffer = [];
cbs.forEach(cb);
}
buffer = {
push: function (x) { return cb(x); },
filter: function () { return buffer; },
};
},
assignMedium: function (cb) {
assigned = true;
var pendingQueue = [];
if (buffer.length) {
var cbs = buffer;
buffer = [];
cbs.forEach(cb);
pendingQueue = buffer;
}
var executeQueue = function () {
var cbs = pendingQueue;
pendingQueue = [];
cbs.forEach(cb);
};
var cycle = function () { return Promise.resolve().then(executeQueue); };
cycle();
buffer = {
push: function (x) {
pendingQueue.push(x);
cycle();
},
filter: function (filter) {
pendingQueue = pendingQueue.filter(filter);
return buffer;
},
};
},
};
return medium;
}
function createMedium(defaults, middleware) {
if (middleware === void 0) { middleware = ItoI; }
return innerCreateMedium(defaults, middleware);
}
// eslint-disable-next-line @typescript-eslint/ban-types
function createSidecarMedium(options) {
if (options === void 0) { options = {}; }
var medium = innerCreateMedium(null);
medium.options = __assign({ async: true, ssr: false }, options);
return medium;
}
;// ./node_modules/react-remove-scroll/dist/es2015/medium.js
var effectCar = createSidecarMedium();
;// ./node_modules/react-remove-scroll/dist/es2015/UI.js
var nothing = function () {
return;
};
/**
* Removes scrollbar from the page and contain the scroll within the Lock
*/
var RemoveScroll = external_React_namespaceObject.forwardRef(function (props, parentRef) {
var ref = external_React_namespaceObject.useRef(null);
var _a = external_React_namespaceObject.useState({
onScrollCapture: nothing,
onWheelCapture: nothing,
onTouchMoveCapture: nothing,
}), callbacks = _a[0], setCallbacks = _a[1];
var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? 'div' : _b, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]);
var SideCar = sideCar;
var containerRef = useMergeRefs([ref, parentRef]);
var containerProps = __assign(__assign({}, rest), callbacks);
return (external_React_namespaceObject.createElement(external_React_namespaceObject.Fragment, null,
enabled && (external_React_namespaceObject.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref })),
forwardProps ? (external_React_namespaceObject.cloneElement(external_React_namespaceObject.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef }))) : (external_React_namespaceObject.createElement(Container, __assign({}, containerProps, { className: className, ref: containerRef }), children))));
});
RemoveScroll.defaultProps = {
enabled: true,
removeScrollBar: true,
inert: false,
};
RemoveScroll.classNames = {
fullWidth: fullWidthClassName,
zeroRight: zeroRightClassName,
};
;// ./node_modules/use-sidecar/dist/es2015/exports.js
var SideCar = function (_a) {
var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
if (!sideCar) {
throw new Error('Sidecar: please provide `sideCar` property to import the right car');
}
var Target = sideCar.read();
if (!Target) {
throw new Error('Sidecar medium not found');
}
return external_React_namespaceObject.createElement(Target, __assign({}, rest));
};
SideCar.isSideCarExport = true;
function exportSidecar(medium, exported) {
medium.useMedium(exported);
return SideCar;
}
;// ./node_modules/get-nonce/dist/es2015/index.js
var currentNonce;
var setNonce = function (nonce) {
currentNonce = nonce;
};
var getNonce = function () {
if (currentNonce) {
return currentNonce;
}
if (true) {
return __webpack_require__.nc;
}
return undefined;
};
;// ./node_modules/react-style-singleton/dist/es2015/singleton.js
function makeStyleTag() {
if (!document)
return null;
var tag = document.createElement('style');
tag.type = 'text/css';
var nonce = getNonce();
if (nonce) {
tag.setAttribute('nonce', nonce);
}
return tag;
}
function injectStyles(tag, css) {
// @ts-ignore
if (tag.styleSheet) {
// @ts-ignore
tag.styleSheet.cssText = css;
}
else {
tag.appendChild(document.createTextNode(css));
}
}
function insertStyleTag(tag) {
var head = document.head || document.getElementsByTagName('head')[0];
head.appendChild(tag);
}
var stylesheetSingleton = function () {
var counter = 0;
var stylesheet = null;
return {
add: function (style) {
if (counter == 0) {
if ((stylesheet = makeStyleTag())) {
injectStyles(stylesheet, style);
insertStyleTag(stylesheet);
}
}
counter++;
},
remove: function () {
counter--;
if (!counter && stylesheet) {
stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
stylesheet = null;
}
},
};
};
;// ./node_modules/react-style-singleton/dist/es2015/hook.js
/**
* creates a hook to control style singleton
* @see {@link styleSingleton} for a safer component version
* @example
* ```tsx
* const useStyle = styleHookSingleton();
* ///
* useStyle('body { overflow: hidden}');
*/
var styleHookSingleton = function () {
var sheet = stylesheetSingleton();
return function (styles, isDynamic) {
external_React_namespaceObject.useEffect(function () {
sheet.add(styles);
return function () {
sheet.remove();
};
}, [styles && isDynamic]);
};
};
;// ./node_modules/react-style-singleton/dist/es2015/component.js
/**
* create a Component to add styles on demand
* - styles are added when first instance is mounted
* - styles are removed when the last instance is unmounted
* - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior
*/
var styleSingleton = function () {
var useStyle = styleHookSingleton();
var Sheet = function (_a) {
var styles = _a.styles, dynamic = _a.dynamic;
useStyle(styles, dynamic);
return null;
};
return Sheet;
};
;// ./node_modules/react-style-singleton/dist/es2015/index.js
;// ./node_modules/react-remove-scroll-bar/dist/es2015/utils.js
var zeroGap = {
left: 0,
top: 0,
right: 0,
gap: 0,
};
var parse = function (x) { return parseInt(x || '', 10) || 0; };
var getOffset = function (gapMode) {
var cs = window.getComputedStyle(document.body);
var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft'];
var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop'];
var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight'];
return [parse(left), parse(top), parse(right)];
};
var getGapWidth = function (gapMode) {
if (gapMode === void 0) { gapMode = 'margin'; }
if (typeof window === 'undefined') {
return zeroGap;
}
var offsets = getOffset(gapMode);
var documentWidth = document.documentElement.clientWidth;
var windowWidth = window.innerWidth;
return {
left: offsets[0],
top: offsets[1],
right: offsets[2],
gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]),
};
};
;// ./node_modules/react-remove-scroll-bar/dist/es2015/component.js
var Style = styleSingleton();
var lockAttribute = 'data-scroll-locked';
// important tip - once we measure scrollBar width and remove them
// we could not repeat this operation
// thus we are using style-singleton - only the first "yet correct" style will be applied.
var getStyles = function (_a, allowRelative, gapMode, important) {
var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
if (gapMode === void 0) { gapMode = 'margin'; }
return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
allowRelative && "position: relative ".concat(important, ";"),
gapMode === 'margin' &&
"\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
gapMode === 'padding' && "padding-right: ".concat(gap, "px ").concat(important, ";"),
]
.filter(Boolean)
.join(''), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
};
var getCurrentUseCounter = function () {
var counter = parseInt(document.body.getAttribute(lockAttribute) || '0', 10);
return isFinite(counter) ? counter : 0;
};
var useLockAttribute = function () {
external_React_namespaceObject.useEffect(function () {
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
return function () {
var newCounter = getCurrentUseCounter() - 1;
if (newCounter <= 0) {
document.body.removeAttribute(lockAttribute);
}
else {
document.body.setAttribute(lockAttribute, newCounter.toString());
}
};
}, []);
};
/**
* Removes page scrollbar and blocks page scroll when mounted
*/
var RemoveScrollBar = function (_a) {
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? 'margin' : _b;
useLockAttribute();
/*
gap will be measured on every component mount
however it will be used only by the "first" invocation
due to singleton nature of <Style
*/
var gap = external_React_namespaceObject.useMemo(function () { return getGapWidth(gapMode); }, [gapMode]);
return external_React_namespaceObject.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') });
};
;// ./node_modules/react-remove-scroll-bar/dist/es2015/index.js
;// ./node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
var passiveSupported = false;
if (typeof window !== 'undefined') {
try {
var options = Object.defineProperty({}, 'passive', {
get: function () {
passiveSupported = true;
return true;
},
});
// @ts-ignore
window.addEventListener('test', options, options);
// @ts-ignore
window.removeEventListener('test', options, options);
}
catch (err) {
passiveSupported = false;
}
}
var nonPassive = passiveSupported ? { passive: false } : false;
;// ./node_modules/react-remove-scroll/dist/es2015/handleScroll.js
var alwaysContainsScroll = function (node) {
// textarea will always _contain_ scroll inside self. It only can be hidden
return node.tagName === 'TEXTAREA';
};
var elementCanBeScrolled = function (node, overflow) {
var styles = window.getComputedStyle(node);
return (
// not-not-scrollable
styles[overflow] !== 'hidden' &&
// contains scroll inside self
!(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible'));
};
var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); };
var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); };
var locationCouldBeScrolled = function (axis, node) {
var current = node;
do {
// Skip over shadow root
if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) {
current = current.host;
}
var isScrollable = elementCouldBeScrolled(axis, current);
if (isScrollable) {
var _a = getScrollVariables(axis, current), s = _a[1], d = _a[2];
if (s > d) {
return true;
}
}
current = current.parentNode;
} while (current && current !== document.body);
return false;
};
var getVScrollVariables = function (_a) {
var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
return [
scrollTop,
scrollHeight,
clientHeight,
];
};
var getHScrollVariables = function (_a) {
var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
return [
scrollLeft,
scrollWidth,
clientWidth,
];
};
var elementCouldBeScrolled = function (axis, node) {
return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
};
var getScrollVariables = function (axis, node) {
return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);
};
var getDirectionFactor = function (axis, direction) {
/**
* If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,
* and then increasingly negative as you scroll towards the end of the content.
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
*/
return axis === 'h' && direction === 'rtl' ? -1 : 1;
};
var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
var delta = directionFactor * sourceDelta;
// find scrollable target
var target = event.target;
var targetInLock = endTarget.contains(target);
var shouldCancelScroll = false;
var isDeltaPositive = delta > 0;
var availableScroll = 0;
var availableScrollTop = 0;
do {
var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
var elementScroll = scroll_1 - capacity - directionFactor * position;
if (position || elementScroll) {
if (elementCouldBeScrolled(axis, target)) {
availableScroll += elementScroll;
availableScrollTop += position;
}
}
target = target.parentNode;
} while (
// portaled content
(!targetInLock && target !== document.body) ||
// self content
(targetInLock && (endTarget.contains(target) || endTarget === target)));
if (isDeltaPositive && ((noOverscroll && availableScroll === 0) || (!noOverscroll && delta > availableScroll))) {
shouldCancelScroll = true;
}
else if (!isDeltaPositive &&
((noOverscroll && availableScrollTop === 0) || (!noOverscroll && -delta > availableScrollTop))) {
shouldCancelScroll = true;
}
return shouldCancelScroll;
};
;// ./node_modules/react-remove-scroll/dist/es2015/SideEffect.js
var getTouchXY = function (event) {
return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
};
var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; };
var extractRef = function (ref) {
return ref && 'current' in ref ? ref.current : ref;
};
var deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; };
var generateStyle = function (id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); };
var idCounter = 0;
var lockStack = [];
function RemoveScrollSideCar(props) {
var shouldPreventQueue = external_React_namespaceObject.useRef([]);
var touchStartRef = external_React_namespaceObject.useRef([0, 0]);
var activeAxis = external_React_namespaceObject.useRef();
var id = external_React_namespaceObject.useState(idCounter++)[0];
var Style = external_React_namespaceObject.useState(function () { return styleSingleton(); })[0];
var lastProps = external_React_namespaceObject.useRef(props);
external_React_namespaceObject.useEffect(function () {
lastProps.current = props;
}, [props]);
external_React_namespaceObject.useEffect(function () {
if (props.inert) {
document.body.classList.add("block-interactivity-".concat(id));
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
allow_1.forEach(function (el) { return el.classList.add("allow-interactivity-".concat(id)); });
return function () {
document.body.classList.remove("block-interactivity-".concat(id));
allow_1.forEach(function (el) { return el.classList.remove("allow-interactivity-".concat(id)); });
};
}
return;
}, [props.inert, props.lockRef.current, props.shards]);
var shouldCancelEvent = external_React_namespaceObject.useCallback(function (event, parent) {
if ('touches' in event && event.touches.length === 2) {
return !lastProps.current.allowPinchZoom;
}
var touch = getTouchXY(event);
var touchStart = touchStartRef.current;
var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];
var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];
var currentAxis;
var target = event.target;
var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';
// allow horizontal touch move on Range inputs. They will not cause any scroll
if ('touches' in event && moveDirection === 'h' && target.type === 'range') {
return false;
}
var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
if (!canBeScrolledInMainDirection) {
return true;
}
if (canBeScrolledInMainDirection) {
currentAxis = moveDirection;
}
else {
currentAxis = moveDirection === 'v' ? 'h' : 'v';
canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
// other axis might be not scrollable
}
if (!canBeScrolledInMainDirection) {
return false;
}
if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) {
activeAxis.current = currentAxis;
}
if (!currentAxis) {
return true;
}
var cancelingAxis = activeAxis.current || currentAxis;
return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true);
}, []);
var shouldPrevent = external_React_namespaceObject.useCallback(function (_event) {
var event = _event;
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {
// not the last active
return;
}
var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);
var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && e.target === event.target && deltaCompare(e.delta, delta); })[0];
// self event, and should be canceled
if (sourceEvent && sourceEvent.should) {
if (event.cancelable) {
event.preventDefault();
}
return;
}
// outside or shard event
if (!sourceEvent) {
var shardNodes = (lastProps.current.shards || [])
.map(extractRef)
.filter(Boolean)
.filter(function (node) { return node.contains(event.target); });
var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
if (shouldStop) {
if (event.cancelable) {
event.preventDefault();
}
}
}
}, []);
var shouldCancel = external_React_namespaceObject.useCallback(function (name, delta, target, should) {
var event = { name: name, delta: delta, target: target, should: should };
shouldPreventQueue.current.push(event);
setTimeout(function () {
shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });
}, 1);
}, []);
var scrollTouchStart = external_React_namespaceObject.useCallback(function (event) {
touchStartRef.current = getTouchXY(event);
activeAxis.current = undefined;
}, []);
var scrollWheel = external_React_namespaceObject.useCallback(function (event) {
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
}, []);
var scrollTouchMove = external_React_namespaceObject.useCallback(function (event) {
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
}, []);
external_React_namespaceObject.useEffect(function () {
lockStack.push(Style);
props.setCallbacks({
onScrollCapture: scrollWheel,
onWheelCapture: scrollWheel,
onTouchMoveCapture: scrollTouchMove,
});
document.addEventListener('wheel', shouldPrevent, nonPassive);
document.addEventListener('touchmove', shouldPrevent, nonPassive);
document.addEventListener('touchstart', scrollTouchStart, nonPassive);
return function () {
lockStack = lockStack.filter(function (inst) { return inst !== Style; });
document.removeEventListener('wheel', shouldPrevent, nonPassive);
document.removeEventListener('touchmove', shouldPrevent, nonPassive);
document.removeEventListener('touchstart', scrollTouchStart, nonPassive);
};
}, []);
var removeScrollBar = props.removeScrollBar, inert = props.inert;
return (external_React_namespaceObject.createElement(external_React_namespaceObject.Fragment, null,
inert ? external_React_namespaceObject.createElement(Style, { styles: generateStyle(id) }) : null,
removeScrollBar ? external_React_namespaceObject.createElement(RemoveScrollBar, { gapMode: "margin" }) : null));
}
;// ./node_modules/react-remove-scroll/dist/es2015/sidecar.js
/* harmony default export */ const sidecar = (exportSidecar(effectCar, RemoveScrollSideCar));
;// ./node_modules/react-remove-scroll/dist/es2015/Combination.js
var ReactRemoveScroll = external_React_namespaceObject.forwardRef(function (props, ref) { return (external_React_namespaceObject.createElement(RemoveScroll, __assign({}, props, { ref: ref, sideCar: sidecar }))); });
ReactRemoveScroll.classNames = RemoveScroll.classNames;
/* harmony default export */ const Combination = (ReactRemoveScroll);
;// ./node_modules/aria-hidden/dist/es2015/index.js
var getDefaultParent = function (originalTarget) {
if (typeof document === 'undefined') {
return null;
}
var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
return sampleTarget.ownerDocument.body;
};
var counterMap = new WeakMap();
var uncontrolledNodes = new WeakMap();
var markerMap = {};
var lockCount = 0;
var unwrapHost = function (node) {
return node && (node.host || unwrapHost(node.parentNode));
};
var correctTargets = function (parent, targets) {
return targets
.map(function (target) {
if (parent.contains(target)) {
return target;
}
var correctedTarget = unwrapHost(target);
if (correctedTarget && parent.contains(correctedTarget)) {
return correctedTarget;
}
console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing');
return null;
})
.filter(function (x) { return Boolean(x); });
};
/**
* Marks everything except given node(or nodes) as aria-hidden
* @param {Element | Element[]} originalTarget - elements to keep on the page
* @param [parentNode] - top element, defaults to document.body
* @param {String} [markerName] - a special attribute to mark every node
* @param {String} [controlAttribute] - html Attribute to control
* @return {Undo} undo command
*/
var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) {
var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
if (!markerMap[markerName]) {
markerMap[markerName] = new WeakMap();
}
var markerCounter = markerMap[markerName];
var hiddenNodes = [];
var elementsToKeep = new Set();
var elementsToStop = new Set(targets);
var keep = function (el) {
if (!el || elementsToKeep.has(el)) {
return;
}
elementsToKeep.add(el);
keep(el.parentNode);
};
targets.forEach(keep);
var deep = function (parent) {
if (!parent || elementsToStop.has(parent)) {
return;
}
Array.prototype.forEach.call(parent.children, function (node) {
if (elementsToKeep.has(node)) {
deep(node);
}
else {
try {
var attr = node.getAttribute(controlAttribute);
var alreadyHidden = attr !== null && attr !== 'false';
var counterValue = (counterMap.get(node) || 0) + 1;
var markerValue = (markerCounter.get(node) || 0) + 1;
counterMap.set(node, counterValue);
markerCounter.set(node, markerValue);
hiddenNodes.push(node);
if (counterValue === 1 && alreadyHidden) {
uncontrolledNodes.set(node, true);
}
if (markerValue === 1) {
node.setAttribute(markerName, 'true');
}
if (!alreadyHidden) {
node.setAttribute(controlAttribute, 'true');
}
}
catch (e) {
console.error('aria-hidden: cannot operate on ', node, e);
}
}
});
};
deep(parentNode);
elementsToKeep.clear();
lockCount++;
return function () {
hiddenNodes.forEach(function (node) {
var counterValue = counterMap.get(node) - 1;
var markerValue = markerCounter.get(node) - 1;
counterMap.set(node, counterValue);
markerCounter.set(node, markerValue);
if (!counterValue) {
if (!uncontrolledNodes.has(node)) {
node.removeAttribute(controlAttribute);
}
uncontrolledNodes.delete(node);
}
if (!markerValue) {
node.removeAttribute(markerName);
}
});
lockCount--;
if (!lockCount) {
// clear
counterMap = new WeakMap();
counterMap = new WeakMap();
uncontrolledNodes = new WeakMap();
markerMap = {};
}
};
};
/**
* Marks everything except given node(or nodes) as aria-hidden
* @param {Element | Element[]} originalTarget - elements to keep on the page
* @param [parentNode] - top element, defaults to document.body
* @param {String} [markerName] - a special attribute to mark every node
* @return {Undo} undo command
*/
var hideOthers = function (originalTarget, parentNode, markerName) {
if (markerName === void 0) { markerName = 'data-aria-hidden'; }
var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
var activeParentNode = parentNode || getDefaultParent(originalTarget);
if (!activeParentNode) {
return function () { return null; };
}
// we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10
targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]')));
return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden');
};
/**
* Marks everything except given node(or nodes) as inert
* @param {Element | Element[]} originalTarget - elements to keep on the page
* @param [parentNode] - top element, defaults to document.body
* @param {String} [markerName] - a special attribute to mark every node
* @return {Undo} undo command
*/
var inertOthers = function (originalTarget, parentNode, markerName) {
if (markerName === void 0) { markerName = 'data-inert-ed'; }
var activeParentNode = parentNode || getDefaultParent(originalTarget);
if (!activeParentNode) {
return function () { return null; };
}
return applyAttributeToOthers(originalTarget, activeParentNode, markerName, 'inert');
};
/**
* @returns if current browser supports inert
*/
var supportsInert = function () {
return typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert');
};
/**
* Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way
* @param {Element | Element[]} originalTarget - elements to keep on the page
* @param [parentNode] - top element, defaults to document.body
* @param {String} [markerName] - a special attribute to mark every node
* @return {Undo} undo command
*/
var suppressOthers = function (originalTarget, parentNode, markerName) {
if (markerName === void 0) { markerName = 'data-suppressed'; }
return (supportsInert() ? inertOthers : hideOthers)(originalTarget, parentNode, markerName);
};
;// ./node_modules/@radix-ui/react-dialog/dist/index.mjs
/* -------------------------------------------------------------------------------------------------
* Dialog
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DIALOG_NAME = 'Dialog';
const [$5d3850c4d0b4e6c7$var$createDialogContext, $5d3850c4d0b4e6c7$export$cc702773b8ea3e41] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($5d3850c4d0b4e6c7$var$DIALOG_NAME);
const [$5d3850c4d0b4e6c7$var$DialogProvider, $5d3850c4d0b4e6c7$var$useDialogContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$DIALOG_NAME);
const $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 = (props)=>{
const { __scopeDialog: __scopeDialog , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true } = props;
const triggerRef = (0,external_React_namespaceObject.useRef)(null);
const contentRef = (0,external_React_namespaceObject.useRef)(null);
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
prop: openProp,
defaultProp: defaultOpen,
onChange: onOpenChange
});
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5d3850c4d0b4e6c7$var$DialogProvider, {
scope: __scopeDialog,
triggerRef: triggerRef,
contentRef: contentRef,
contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
titleId: $1746a345f3d73bb7$export$f680877a34711e37(),
descriptionId: $1746a345f3d73bb7$export$f680877a34711e37(),
open: open,
onOpenChange: setOpen,
onOpenToggle: (0,external_React_namespaceObject.useCallback)(()=>setOpen((prevOpen)=>!prevOpen
)
, [
setOpen
]),
modal: modal
}, children);
};
/*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$3ddf2d174ce01153, {
displayName: $5d3850c4d0b4e6c7$var$DIALOG_NAME
});
/* -------------------------------------------------------------------------------------------------
* DialogTrigger
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$TRIGGER_NAME = 'DialogTrigger';
const $5d3850c4d0b4e6c7$export$2e1e1122cf0cba88 = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{
const { __scopeDialog: __scopeDialog , ...triggerProps } = props;
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$TRIGGER_NAME, __scopeDialog);
const composedTriggerRef = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.triggerRef);
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
type: "button",
"aria-haspopup": "dialog",
"aria-expanded": context.open,
"aria-controls": context.contentId,
"data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
}, triggerProps, {
ref: composedTriggerRef,
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, context.onOpenToggle)
}));
});
/*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$2e1e1122cf0cba88, {
displayName: $5d3850c4d0b4e6c7$var$TRIGGER_NAME
});
/* -------------------------------------------------------------------------------------------------
* DialogPortal
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$PORTAL_NAME = 'DialogPortal';
const [$5d3850c4d0b4e6c7$var$PortalProvider, $5d3850c4d0b4e6c7$var$usePortalContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$PORTAL_NAME, {
forceMount: undefined
});
const $5d3850c4d0b4e6c7$export$dad7c95542bacce0 = (props)=>{
const { __scopeDialog: __scopeDialog , forceMount: forceMount , children: children , container: container } = props;
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$PORTAL_NAME, __scopeDialog);
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5d3850c4d0b4e6c7$var$PortalProvider, {
scope: __scopeDialog,
forceMount: forceMount
}, external_React_namespaceObject.Children.map(children, (child)=>/*#__PURE__*/ (0,external_React_namespaceObject.createElement)($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
present: forceMount || context.open
}, /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($f1701beae083dbae$export$602eac185826482c, {
asChild: true,
container: container
}, child))
));
};
/*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$dad7c95542bacce0, {
displayName: $5d3850c4d0b4e6c7$var$PORTAL_NAME
});
/* -------------------------------------------------------------------------------------------------
* DialogOverlay
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$OVERLAY_NAME = 'DialogOverlay';
const $5d3850c4d0b4e6c7$export$bd1d06c79be19e17 = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{
const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog);
const { forceMount: forceMount = portalContext.forceMount , ...overlayProps } = props;
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog);
return context.modal ? /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
present: forceMount || context.open
}, /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5d3850c4d0b4e6c7$var$DialogOverlayImpl, _extends({}, overlayProps, {
ref: forwardedRef
}))) : null;
});
/*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$bd1d06c79be19e17, {
displayName: $5d3850c4d0b4e6c7$var$OVERLAY_NAME
});
const $5d3850c4d0b4e6c7$var$DialogOverlayImpl = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{
const { __scopeDialog: __scopeDialog , ...overlayProps } = props;
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, __scopeDialog);
return(/*#__PURE__*/ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
// ie. when `Overlay` and `Content` are siblings
(0,external_React_namespaceObject.createElement)(Combination, {
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
allowPinchZoom: true,
shards: [
context.contentRef
]
}, /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
"data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
}, overlayProps, {
ref: forwardedRef // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.
,
style: {
pointerEvents: 'auto',
...overlayProps.style
}
}))));
});
/* -------------------------------------------------------------------------------------------------
* DialogContent
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$CONTENT_NAME = 'DialogContent';
const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{
const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
present: forceMount || context.open
}, context.modal ? /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5d3850c4d0b4e6c7$var$DialogContentModal, _extends({}, contentProps, {
ref: forwardedRef
})) : /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5d3850c4d0b4e6c7$var$DialogContentNonModal, _extends({}, contentProps, {
ref: forwardedRef
})));
});
/*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$b6d9565de1e068cf, {
displayName: $5d3850c4d0b4e6c7$var$CONTENT_NAME
});
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentModal = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
const contentRef = (0,external_React_namespaceObject.useRef)(null);
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.contentRef, contentRef); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
(0,external_React_namespaceObject.useEffect)(()=>{
const content = contentRef.current;
if (content) return hideOthers(content);
}, []);
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends({}, props, {
ref: composedRefs // we make sure focus isn't trapped once `DialogContent` has been closed
,
trapFocus: context.open,
disableOutsidePointerEvents: true,
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onCloseAutoFocus, (event)=>{
var _context$triggerRef$c;
event.preventDefault();
(_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
}),
onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownOutside, (event)=>{
const originalEvent = event.detail.originalEvent;
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
const isRightClick = originalEvent.button === 2 || ctrlLeftClick; // If the event is a right-click, we shouldn't close because
// it is effectively as if we right-clicked the `Overlay`.
if (isRightClick) event.preventDefault();
}) // When focus is trapped, a `focusout` event may still happen.
,
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>event.preventDefault()
)
}));
});
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentNonModal = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
const hasInteractedOutsideRef = (0,external_React_namespaceObject.useRef)(false);
const hasPointerDownOutsideRef = (0,external_React_namespaceObject.useRef)(false);
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends({}, props, {
ref: forwardedRef,
trapFocus: false,
disableOutsidePointerEvents: false,
onCloseAutoFocus: (event)=>{
var _props$onCloseAutoFoc;
(_props$onCloseAutoFoc = props.onCloseAutoFocus) === null || _props$onCloseAutoFoc === void 0 || _props$onCloseAutoFoc.call(props, event);
if (!event.defaultPrevented) {
var _context$triggerRef$c2;
if (!hasInteractedOutsideRef.current) (_context$triggerRef$c2 = context.triggerRef.current) === null || _context$triggerRef$c2 === void 0 || _context$triggerRef$c2.focus(); // Always prevent auto focus because we either focus manually or want user agent focus
event.preventDefault();
}
hasInteractedOutsideRef.current = false;
hasPointerDownOutsideRef.current = false;
},
onInteractOutside: (event)=>{
var _props$onInteractOuts, _context$triggerRef$c3;
(_props$onInteractOuts = props.onInteractOutside) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts.call(props, event);
if (!event.defaultPrevented) {
hasInteractedOutsideRef.current = true;
if (event.detail.originalEvent.type === 'pointerdown') hasPointerDownOutsideRef.current = true;
} // Prevent dismissing when clicking the trigger.
// As the trigger is already setup to close, without doing so would
// cause it to close and immediately open.
const target = event.target;
const targetIsTrigger = (_context$triggerRef$c3 = context.triggerRef.current) === null || _context$triggerRef$c3 === void 0 ? void 0 : _context$triggerRef$c3.contains(target);
if (targetIsTrigger) event.preventDefault(); // On Safari if the trigger is inside a container with tabIndex={0}, when clicked
// we will get the pointer down outside event on the trigger, but then a subsequent
// focus outside event on the container, we ignore any focus outside event when we've
// already had a pointer down outside event.
if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) event.preventDefault();
}
}));
});
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentImpl = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{
const { __scopeDialog: __scopeDialog , trapFocus: trapFocus , onOpenAutoFocus: onOpenAutoFocus , onCloseAutoFocus: onCloseAutoFocus , ...contentProps } = props;
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, __scopeDialog);
const contentRef = (0,external_React_namespaceObject.useRef)(null);
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be
// the last element in the DOM (beacuse of the `Portal`)
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($d3863c46a17e8a28$export$20e40289641fbbb6, {
asChild: true,
loop: true,
trapped: trapFocus,
onMountAutoFocus: onOpenAutoFocus,
onUnmountAutoFocus: onCloseAutoFocus
}, /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5cb92bef7577960e$export$177fb62ff3ec1f22, _extends({
role: "dialog",
id: context.contentId,
"aria-describedby": context.descriptionId,
"aria-labelledby": context.titleId,
"data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
}, contentProps, {
ref: composedRefs,
onDismiss: ()=>context.onOpenChange(false)
}))), false);
});
/* -------------------------------------------------------------------------------------------------
* DialogTitle
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$TITLE_NAME = 'DialogTitle';
const $5d3850c4d0b4e6c7$export$16f7638e4a34b909 = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{
const { __scopeDialog: __scopeDialog , ...titleProps } = props;
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$TITLE_NAME, __scopeDialog);
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.h2, _extends({
id: context.titleId
}, titleProps, {
ref: forwardedRef
}));
});
/*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$16f7638e4a34b909, {
displayName: $5d3850c4d0b4e6c7$var$TITLE_NAME
});
/* -------------------------------------------------------------------------------------------------
* DialogDescription
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DESCRIPTION_NAME = 'DialogDescription';
const $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{
const { __scopeDialog: __scopeDialog , ...descriptionProps } = props;
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$DESCRIPTION_NAME, __scopeDialog);
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.p, _extends({
id: context.descriptionId
}, descriptionProps, {
ref: forwardedRef
}));
});
/*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$94e94c2ec2c954d5, {
displayName: $5d3850c4d0b4e6c7$var$DESCRIPTION_NAME
});
/* -------------------------------------------------------------------------------------------------
* DialogClose
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$CLOSE_NAME = 'DialogClose';
const $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{
const { __scopeDialog: __scopeDialog , ...closeProps } = props;
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CLOSE_NAME, __scopeDialog);
return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
type: "button"
}, closeProps, {
ref: forwardedRef,
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, ()=>context.onOpenChange(false)
)
}));
});
/*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac, {
displayName: $5d3850c4d0b4e6c7$var$CLOSE_NAME
});
/* -----------------------------------------------------------------------------------------------*/ function $5d3850c4d0b4e6c7$var$getState(open) {
return open ? 'open' : 'closed';
}
const $5d3850c4d0b4e6c7$var$TITLE_WARNING_NAME = 'DialogTitleWarning';
const [$5d3850c4d0b4e6c7$export$69b62a49393917d6, $5d3850c4d0b4e6c7$var$useWarningContext] = $c512c27ab02ef895$export$fd42f52fd3ae1109($5d3850c4d0b4e6c7$var$TITLE_WARNING_NAME, {
contentName: $5d3850c4d0b4e6c7$var$CONTENT_NAME,
titleName: $5d3850c4d0b4e6c7$var$TITLE_NAME,
docsSlug: 'dialog'
});
const $5d3850c4d0b4e6c7$var$TitleWarning = ({ titleId: titleId })=>{
const titleWarningContext = $5d3850c4d0b4e6c7$var$useWarningContext($5d3850c4d0b4e6c7$var$TITLE_WARNING_NAME);
const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
$67UHm$useEffect(()=>{
if (titleId) {
const hasTitle = document.getElementById(titleId);
if (!hasTitle) throw new Error(MESSAGE);
}
}, [
MESSAGE,
titleId
]);
return null;
};
const $5d3850c4d0b4e6c7$var$DESCRIPTION_WARNING_NAME = 'DialogDescriptionWarning';
const $5d3850c4d0b4e6c7$var$DescriptionWarning = ({ contentRef: contentRef , descriptionId: descriptionId })=>{
const descriptionWarningContext = $5d3850c4d0b4e6c7$var$useWarningContext($5d3850c4d0b4e6c7$var$DESCRIPTION_WARNING_NAME);
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
$67UHm$useEffect(()=>{
var _contentRef$current;
const describedById = (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.getAttribute('aria-describedby'); // if we have an id and the user hasn't set aria-describedby={undefined}
if (descriptionId && describedById) {
const hasDescription = document.getElementById(descriptionId);
if (!hasDescription) console.warn(MESSAGE);
}
}, [
MESSAGE,
contentRef,
descriptionId
]);
return null;
};
const $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9 = $5d3850c4d0b4e6c7$export$3ddf2d174ce01153;
const $5d3850c4d0b4e6c7$export$41fb9f06171c75f4 = (/* unused pure expression or super */ null && ($5d3850c4d0b4e6c7$export$2e1e1122cf0cba88));
const $5d3850c4d0b4e6c7$export$602eac185826482c = $5d3850c4d0b4e6c7$export$dad7c95542bacce0;
const $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff = $5d3850c4d0b4e6c7$export$bd1d06c79be19e17;
const $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2 = $5d3850c4d0b4e6c7$export$b6d9565de1e068cf;
const $5d3850c4d0b4e6c7$export$f99233281efd08a0 = (/* unused pure expression or super */ null && ($5d3850c4d0b4e6c7$export$16f7638e4a34b909));
const $5d3850c4d0b4e6c7$export$393edc798c47379d = (/* unused pure expression or super */ null && ($5d3850c4d0b4e6c7$export$94e94c2ec2c954d5));
const $5d3850c4d0b4e6c7$export$f39c2d165cd861fe = (/* unused pure expression or super */ null && ($5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac));
;// ./node_modules/cmdk/dist/index.mjs
var V='[cmdk-group=""]',dist_X='[cmdk-group-items=""]',ge='[cmdk-group-heading=""]',dist_Y='[cmdk-item=""]',le=`${dist_Y}:not([aria-disabled="true"])`,Q="cmdk-item-select",M="data-value",Re=(r,o,n)=>W(r,o,n),ue=external_React_namespaceObject.createContext(void 0),dist_G=()=>external_React_namespaceObject.useContext(ue),de=external_React_namespaceObject.createContext(void 0),Z=()=>external_React_namespaceObject.useContext(de),fe=external_React_namespaceObject.createContext(void 0),me=external_React_namespaceObject.forwardRef((r,o)=>{let n=dist_k(()=>{var e,s;return{search:"",value:(s=(e=r.value)!=null?e:r.defaultValue)!=null?s:"",filtered:{count:0,items:new Map,groups:new Set}}}),u=dist_k(()=>new Set),c=dist_k(()=>new Map),d=dist_k(()=>new Map),f=dist_k(()=>new Set),p=pe(r),{label:v,children:b,value:l,onValueChange:y,filter:S,shouldFilter:C,loop:L,disablePointerSelection:ee=!1,vimBindings:j=!0,...H}=r,te=external_React_namespaceObject.useId(),$=external_React_namespaceObject.useId(),K=external_React_namespaceObject.useId(),x=external_React_namespaceObject.useRef(null),g=Me();T(()=>{if(l!==void 0){let e=l.trim();n.current.value=e,h.emit()}},[l]),T(()=>{g(6,re)},[]);let h=external_React_namespaceObject.useMemo(()=>({subscribe:e=>(f.current.add(e),()=>f.current.delete(e)),snapshot:()=>n.current,setState:(e,s,i)=>{var a,m,R;if(!Object.is(n.current[e],s)){if(n.current[e]=s,e==="search")z(),q(),g(1,U);else if(e==="value"&&(i||g(5,re),((a=p.current)==null?void 0:a.value)!==void 0)){let E=s!=null?s:"";(R=(m=p.current).onValueChange)==null||R.call(m,E);return}h.emit()}},emit:()=>{f.current.forEach(e=>e())}}),[]),B=external_React_namespaceObject.useMemo(()=>({value:(e,s,i)=>{var a;s!==((a=d.current.get(e))==null?void 0:a.value)&&(d.current.set(e,{value:s,keywords:i}),n.current.filtered.items.set(e,ne(s,i)),g(2,()=>{q(),h.emit()}))},item:(e,s)=>(u.current.add(e),s&&(c.current.has(s)?c.current.get(s).add(e):c.current.set(s,new Set([e]))),g(3,()=>{z(),q(),n.current.value||U(),h.emit()}),()=>{d.current.delete(e),u.current.delete(e),n.current.filtered.items.delete(e);let i=O();g(4,()=>{z(),(i==null?void 0:i.getAttribute("id"))===e&&U(),h.emit()})}),group:e=>(c.current.has(e)||c.current.set(e,new Set),()=>{d.current.delete(e),c.current.delete(e)}),filter:()=>p.current.shouldFilter,label:v||r["aria-label"],disablePointerSelection:ee,listId:te,inputId:K,labelId:$,listInnerRef:x}),[]);function ne(e,s){var a,m;let i=(m=(a=p.current)==null?void 0:a.filter)!=null?m:Re;return e?i(e,n.current.search,s):0}function q(){if(!n.current.search||p.current.shouldFilter===!1)return;let e=n.current.filtered.items,s=[];n.current.filtered.groups.forEach(a=>{let m=c.current.get(a),R=0;m.forEach(E=>{let P=e.get(E);R=Math.max(P,R)}),s.push([a,R])});let i=x.current;A().sort((a,m)=>{var P,_;let R=a.getAttribute("id"),E=m.getAttribute("id");return((P=e.get(E))!=null?P:0)-((_=e.get(R))!=null?_:0)}).forEach(a=>{let m=a.closest(dist_X);m?m.appendChild(a.parentElement===m?a:a.closest(`${dist_X} > *`)):i.appendChild(a.parentElement===i?a:a.closest(`${dist_X} > *`))}),s.sort((a,m)=>m[1]-a[1]).forEach(a=>{let m=x.current.querySelector(`${V}[${M}="${encodeURIComponent(a[0])}"]`);m==null||m.parentElement.appendChild(m)})}function U(){let e=A().find(i=>i.getAttribute("aria-disabled")!=="true"),s=e==null?void 0:e.getAttribute(M);h.setState("value",s||void 0)}function z(){var s,i,a,m;if(!n.current.search||p.current.shouldFilter===!1){n.current.filtered.count=u.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let R of u.current){let E=(i=(s=d.current.get(R))==null?void 0:s.value)!=null?i:"",P=(m=(a=d.current.get(R))==null?void 0:a.keywords)!=null?m:[],_=ne(E,P);n.current.filtered.items.set(R,_),_>0&&e++}for(let[R,E]of c.current)for(let P of E)if(n.current.filtered.items.get(P)>0){n.current.filtered.groups.add(R);break}n.current.filtered.count=e}function re(){var s,i,a;let e=O();e&&(((s=e.parentElement)==null?void 0:s.firstChild)===e&&((a=(i=e.closest(V))==null?void 0:i.querySelector(ge))==null||a.scrollIntoView({block:"nearest"})),e.scrollIntoView({block:"nearest"}))}function O(){var e;return(e=x.current)==null?void 0:e.querySelector(`${dist_Y}[aria-selected="true"]`)}function A(){var e;return Array.from((e=x.current)==null?void 0:e.querySelectorAll(le))}function W(e){let i=A()[e];i&&h.setState("value",i.getAttribute(M))}function J(e){var R;let s=O(),i=A(),a=i.findIndex(E=>E===s),m=i[a+e];(R=p.current)!=null&&R.loop&&(m=a+e<0?i[i.length-1]:a+e===i.length?i[0]:i[a+e]),m&&h.setState("value",m.getAttribute(M))}function oe(e){let s=O(),i=s==null?void 0:s.closest(V),a;for(;i&&!a;)i=e>0?we(i,V):Ie(i,V),a=i==null?void 0:i.querySelector(le);a?h.setState("value",a.getAttribute(M)):J(e)}let ie=()=>W(A().length-1),ae=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?oe(1):J(1)},se=e=>{e.preventDefault(),e.metaKey?W(0):e.altKey?oe(-1):J(-1)};return external_React_namespaceObject.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,{ref:o,tabIndex:-1,...H,"cmdk-root":"",onKeyDown:e=>{var s;if((s=H.onKeyDown)==null||s.call(H,e),!e.defaultPrevented)switch(e.key){case"n":case"j":{j&&e.ctrlKey&&ae(e);break}case"ArrowDown":{ae(e);break}case"p":case"k":{j&&e.ctrlKey&&se(e);break}case"ArrowUp":{se(e);break}case"Home":{e.preventDefault(),W(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":if(!e.nativeEvent.isComposing&&e.keyCode!==229){e.preventDefault();let i=O();if(i){let a=new Event(Q);i.dispatchEvent(a)}}}}},external_React_namespaceObject.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:De},v),F(r,e=>external_React_namespaceObject.createElement(de.Provider,{value:h},external_React_namespaceObject.createElement(ue.Provider,{value:B},e))))}),be=external_React_namespaceObject.forwardRef((r,o)=>{var K,x;let n=external_React_namespaceObject.useId(),u=external_React_namespaceObject.useRef(null),c=external_React_namespaceObject.useContext(fe),d=dist_G(),f=pe(r),p=(x=(K=f.current)==null?void 0:K.forceMount)!=null?x:c==null?void 0:c.forceMount;T(()=>{if(!p)return d.item(n,c==null?void 0:c.id)},[p]);let v=ve(n,u,[r.value,r.children,u],r.keywords),b=Z(),l=dist_D(g=>g.value&&g.value===v.current),y=dist_D(g=>p||d.filter()===!1?!0:g.search?g.filtered.items.get(n)>0:!0);external_React_namespaceObject.useEffect(()=>{let g=u.current;if(!(!g||r.disabled))return g.addEventListener(Q,S),()=>g.removeEventListener(Q,S)},[y,r.onSelect,r.disabled]);function S(){var g,h;C(),(h=(g=f.current).onSelect)==null||h.call(g,v.current)}function C(){b.setState("value",v.current,!0)}if(!y)return null;let{disabled:L,value:ee,onSelect:j,forceMount:H,keywords:te,...$}=r;return external_React_namespaceObject.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,{ref:N([u,o]),...$,id:n,"cmdk-item":"",role:"option","aria-disabled":!!L,"aria-selected":!!l,"data-disabled":!!L,"data-selected":!!l,onPointerMove:L||d.disablePointerSelection?void 0:C,onClick:L?void 0:S},r.children)}),he=external_React_namespaceObject.forwardRef((r,o)=>{let{heading:n,children:u,forceMount:c,...d}=r,f=external_React_namespaceObject.useId(),p=external_React_namespaceObject.useRef(null),v=external_React_namespaceObject.useRef(null),b=external_React_namespaceObject.useId(),l=dist_G(),y=dist_D(C=>c||l.filter()===!1?!0:C.search?C.filtered.groups.has(f):!0);T(()=>l.group(f),[]),ve(f,p,[r.value,r.heading,v]);let S=external_React_namespaceObject.useMemo(()=>({id:f,forceMount:c}),[c]);return external_React_namespaceObject.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,{ref:N([p,o]),...d,"cmdk-group":"",role:"presentation",hidden:y?void 0:!0},n&&external_React_namespaceObject.createElement("div",{ref:v,"cmdk-group-heading":"","aria-hidden":!0,id:b},n),F(r,C=>external_React_namespaceObject.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?b:void 0},external_React_namespaceObject.createElement(fe.Provider,{value:S},C))))}),ye=external_React_namespaceObject.forwardRef((r,o)=>{let{alwaysRender:n,...u}=r,c=external_React_namespaceObject.useRef(null),d=dist_D(f=>!f.search);return!n&&!d?null:external_React_namespaceObject.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,{ref:N([c,o]),...u,"cmdk-separator":"",role:"separator"})}),Ee=external_React_namespaceObject.forwardRef((r,o)=>{let{onValueChange:n,...u}=r,c=r.value!=null,d=Z(),f=dist_D(l=>l.search),p=dist_D(l=>l.value),v=dist_G(),b=external_React_namespaceObject.useMemo(()=>{var y;let l=(y=v.listInnerRef.current)==null?void 0:y.querySelector(`${dist_Y}[${M}="${encodeURIComponent(p)}"]`);return l==null?void 0:l.getAttribute("id")},[]);return external_React_namespaceObject.useEffect(()=>{r.value!=null&&d.setState("search",r.value)},[r.value]),external_React_namespaceObject.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.input,{ref:o,...u,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":v.listId,"aria-labelledby":v.labelId,"aria-activedescendant":b,id:v.inputId,type:"text",value:c?r.value:f,onChange:l=>{c||d.setState("search",l.target.value),n==null||n(l.target.value)}})}),Se=external_React_namespaceObject.forwardRef((r,o)=>{let{children:n,label:u="Suggestions",...c}=r,d=external_React_namespaceObject.useRef(null),f=external_React_namespaceObject.useRef(null),p=dist_G();return external_React_namespaceObject.useEffect(()=>{if(f.current&&d.current){let v=f.current,b=d.current,l,y=new ResizeObserver(()=>{l=requestAnimationFrame(()=>{let S=v.offsetHeight;b.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px")})});return y.observe(v),()=>{cancelAnimationFrame(l),y.unobserve(v)}}},[]),external_React_namespaceObject.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,{ref:N([d,o]),...c,"cmdk-list":"",role:"listbox","aria-label":u,id:p.listId},F(r,v=>external_React_namespaceObject.createElement("div",{ref:N([f,p.listInnerRef]),"cmdk-list-sizer":""},v)))}),Ce=external_React_namespaceObject.forwardRef((r,o)=>{let{open:n,onOpenChange:u,overlayClassName:c,contentClassName:d,container:f,...p}=r;return external_React_namespaceObject.createElement($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:n,onOpenChange:u},external_React_namespaceObject.createElement($5d3850c4d0b4e6c7$export$602eac185826482c,{container:f},external_React_namespaceObject.createElement($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{"cmdk-overlay":"",className:c}),external_React_namespaceObject.createElement($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{"aria-label":r.label,"cmdk-dialog":"",className:d},external_React_namespaceObject.createElement(me,{ref:o,...p}))))}),xe=external_React_namespaceObject.forwardRef((r,o)=>dist_D(u=>u.filtered.count===0)?external_React_namespaceObject.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,{ref:o,...r,"cmdk-empty":"",role:"presentation"}):null),Pe=external_React_namespaceObject.forwardRef((r,o)=>{let{progress:n,children:u,label:c="Loading...",...d}=r;return external_React_namespaceObject.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,{ref:o,...d,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":c},F(r,f=>external_React_namespaceObject.createElement("div",{"aria-hidden":!0},f)))}),He=Object.assign(me,{List:Se,Item:be,Input:Ee,Group:he,Separator:ye,Dialog:Ce,Empty:xe,Loading:Pe});function we(r,o){let n=r.nextElementSibling;for(;n;){if(n.matches(o))return n;n=n.nextElementSibling}}function Ie(r,o){let n=r.previousElementSibling;for(;n;){if(n.matches(o))return n;n=n.previousElementSibling}}function pe(r){let o=external_React_namespaceObject.useRef(r);return T(()=>{o.current=r}),o}var T=typeof window=="undefined"?external_React_namespaceObject.useEffect:external_React_namespaceObject.useLayoutEffect;function dist_k(r){let o=external_React_namespaceObject.useRef();return o.current===void 0&&(o.current=r()),o}function N(r){return o=>{r.forEach(n=>{typeof n=="function"?n(o):n!=null&&(n.current=o)})}}function dist_D(r){let o=Z(),n=()=>r(o.snapshot());return external_React_namespaceObject.useSyncExternalStore(o.subscribe,n,n)}function ve(r,o,n,u=[]){let c=external_React_namespaceObject.useRef(),d=dist_G();return T(()=>{var v;let f=(()=>{var b;for(let l of n){if(typeof l=="string")return l.trim();if(typeof l=="object"&&"current"in l)return l.current?(b=l.current.textContent)==null?void 0:b.trim():c.current}})(),p=u.map(b=>b.trim());d.value(r,f,p),(v=o.current)==null||v.setAttribute(M,f),c.current=f}),c}var Me=()=>{let[r,o]=external_React_namespaceObject.useState(),n=dist_k(()=>new Map);return T(()=>{n.current.forEach(u=>u()),n.current=new Map},[r]),(u,c)=>{n.current.set(u,c),o({})}};function Te(r){let o=r.type;return typeof o=="function"?o(r.props):"render"in o?o.render(r.props):r}function F({asChild:r,children:o},n){return r&&external_React_namespaceObject.isValidElement(o)?external_React_namespaceObject.cloneElement(Te(o),{ref:o.ref},n(o.props.children)):n(o)}var De={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};
;// ./node_modules/clsx/dist/clsx.mjs
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx);
;// external ["wp","data"]
const external_wp_data_namespaceObject = window["wp"]["data"];
;// external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// external ["wp","components"]
const external_wp_components_namespaceObject = window["wp"]["components"];
;// external ["wp","keyboardShortcuts"]
const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
;// ./node_modules/@wordpress/icons/build-module/icon/index.js
var icon_default = (0,external_wp_element_namespaceObject.forwardRef)(
({ icon, size = 24, ...props }, ref) => {
return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
width: size,
height: size,
...props,
ref
});
}
);
;// external ["wp","primitives"]
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
;// ./node_modules/@wordpress/icons/build-module/library/search.js
var search_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) });
;// ./node_modules/@wordpress/commands/build-module/store/reducer.js
function commands(state = {}, action) {
switch (action.type) {
case "REGISTER_COMMAND":
return {
...state,
[action.name]: {
name: action.name,
label: action.label,
searchLabel: action.searchLabel,
context: action.context,
callback: action.callback,
icon: action.icon,
keywords: action.keywords
}
};
case "UNREGISTER_COMMAND": {
const { [action.name]: _, ...remainingState } = state;
return remainingState;
}
}
return state;
}
function commandLoaders(state = {}, action) {
switch (action.type) {
case "REGISTER_COMMAND_LOADER":
return {
...state,
[action.name]: {
name: action.name,
context: action.context,
hook: action.hook
}
};
case "UNREGISTER_COMMAND_LOADER": {
const { [action.name]: _, ...remainingState } = state;
return remainingState;
}
}
return state;
}
function isOpen(state = false, action) {
switch (action.type) {
case "OPEN":
return true;
case "CLOSE":
return false;
}
return state;
}
function context(state = "root", action) {
switch (action.type) {
case "SET_CONTEXT":
return action.context;
}
return state;
}
const reducer = (0,external_wp_data_namespaceObject.combineReducers)({
commands,
commandLoaders,
isOpen,
context
});
var reducer_default = reducer;
;// ./node_modules/@wordpress/commands/build-module/store/actions.js
function registerCommand(config) {
return {
type: "REGISTER_COMMAND",
...config
};
}
function unregisterCommand(name) {
return {
type: "UNREGISTER_COMMAND",
name
};
}
function registerCommandLoader(config) {
return {
type: "REGISTER_COMMAND_LOADER",
...config
};
}
function unregisterCommandLoader(name) {
return {
type: "UNREGISTER_COMMAND_LOADER",
name
};
}
function actions_open() {
return {
type: "OPEN"
};
}
function actions_close() {
return {
type: "CLOSE"
};
}
;// ./node_modules/@wordpress/commands/build-module/store/selectors.js
const getCommands = (0,external_wp_data_namespaceObject.createSelector)(
(state, contextual = false) => Object.values(state.commands).filter((command) => {
const isContextual = command.context && command.context === state.context;
return contextual ? isContextual : !isContextual;
}),
(state) => [state.commands, state.context]
);
const getCommandLoaders = (0,external_wp_data_namespaceObject.createSelector)(
(state, contextual = false) => Object.values(state.commandLoaders).filter((loader) => {
const isContextual = loader.context && loader.context === state.context;
return contextual ? isContextual : !isContextual;
}),
(state) => [state.commandLoaders, state.context]
);
function selectors_isOpen(state) {
return state.isOpen;
}
function getContext(state) {
return state.context;
}
;// ./node_modules/@wordpress/commands/build-module/store/private-actions.js
function setContext(context) {
return {
type: "SET_CONTEXT",
context
};
}
;// external ["wp","privateApis"]
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// ./node_modules/@wordpress/commands/build-module/lock-unlock.js
const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
"@wordpress/commands"
);
;// ./node_modules/@wordpress/commands/build-module/store/index.js
const STORE_NAME = "core/commands";
const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
reducer: reducer_default,
actions: actions_namespaceObject,
selectors: selectors_namespaceObject
});
(0,external_wp_data_namespaceObject.register)(store);
unlock(store).registerPrivateActions(private_actions_namespaceObject);
;// ./node_modules/@wordpress/commands/build-module/components/command-menu.js
const inputLabel = (0,external_wp_i18n_namespaceObject.__)("Search commands and settings");
function CommandMenuLoader({ name, search, hook, setLoader, close }) {
const { isLoading, commands = [] } = hook({ search }) ?? {};
(0,external_wp_element_namespaceObject.useEffect)(() => {
setLoader(name, isLoading);
}, [setLoader, name, isLoading]);
if (!commands.length) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: commands.map((command) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
He.Item,
{
value: command.searchLabel ?? command.label,
keywords: command.keywords,
onSelect: () => command.callback({ close }),
id: command.name,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
alignment: "left",
className: dist_clsx("commands-command-menu__item", {
"has-icon": command.icon
}),
children: [
command.icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: command.icon }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextHighlight,
{
text: command.label,
highlight: search
}
) })
]
}
)
},
command.name
)) });
}
function CommandMenuLoaderWrapper({ hook, search, setLoader, close }) {
const currentLoaderRef = (0,external_wp_element_namespaceObject.useRef)(hook);
const [key, setKey] = (0,external_wp_element_namespaceObject.useState)(0);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (currentLoaderRef.current !== hook) {
currentLoaderRef.current = hook;
setKey((prevKey) => prevKey + 1);
}
}, [hook]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CommandMenuLoader,
{
hook: currentLoaderRef.current,
search,
setLoader,
close
},
key
);
}
function CommandMenuGroup({ isContextual, search, setLoader, close }) {
const { commands, loaders } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getCommands, getCommandLoaders } = select(store);
return {
commands: getCommands(isContextual),
loaders: getCommandLoaders(isContextual)
};
},
[isContextual]
);
if (!commands.length && !loaders.length) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(He.Group, { children: [
commands.map((command) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
He.Item,
{
value: command.searchLabel ?? command.label,
keywords: command.keywords,
onSelect: () => command.callback({ close }),
id: command.name,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
alignment: "left",
className: dist_clsx("commands-command-menu__item", {
"has-icon": command.icon
}),
children: [
command.icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: command.icon }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextHighlight,
{
text: command.label,
highlight: search
}
) })
]
}
)
},
command.name
)),
loaders.map((loader) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CommandMenuLoaderWrapper,
{
hook: loader.hook,
search,
setLoader,
close
},
loader.name
))
] });
}
function CommandInput({ isOpen, search, setSearch }) {
const commandMenuInput = (0,external_wp_element_namespaceObject.useRef)();
const _value = dist_D((state) => state.value);
const selectedItemId = (0,external_wp_element_namespaceObject.useMemo)(() => {
const item = document.querySelector(
`[cmdk-item=""][data-value="${_value}"]`
);
return item?.getAttribute("id");
}, [_value]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (isOpen) {
commandMenuInput.current.focus();
}
}, [isOpen]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
He.Input,
{
ref: commandMenuInput,
value: search,
onValueChange: setSearch,
placeholder: inputLabel,
"aria-activedescendant": selectedItemId,
icon: search
}
);
}
function CommandMenu() {
const { registerShortcut } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store);
const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)("");
const isOpen = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).isOpen(),
[]
);
const { open, close } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const [loaders, setLoaders] = (0,external_wp_element_namespaceObject.useState)({});
(0,external_wp_element_namespaceObject.useEffect)(() => {
registerShortcut({
name: "core/commands",
category: "global",
description: (0,external_wp_i18n_namespaceObject.__)("Open the command palette."),
keyCombination: {
modifier: "primary",
character: "k"
}
});
}, [registerShortcut]);
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)(
"core/commands",
/** @type {import('react').KeyboardEventHandler} */
(event) => {
if (event.defaultPrevented) {
return;
}
event.preventDefault();
if (isOpen) {
close();
} else {
open();
}
},
{
bindGlobal: true
}
);
const setLoader = (0,external_wp_element_namespaceObject.useCallback)(
(name, value) => setLoaders((current) => ({
...current,
[name]: value
})),
[]
);
const closeAndReset = () => {
setSearch("");
close();
};
if (!isOpen) {
return false;
}
const onKeyDown = (event) => {
if (
// Ignore keydowns from IMEs
event.nativeEvent.isComposing || // Workaround for Mac Safari where the final Enter/Backspace of an IME composition
// is `isComposing=false`, even though it's technically still part of the composition.
// These can only be detected by keyCode.
event.keyCode === 229
) {
event.preventDefault();
}
};
const isLoading = Object.values(loaders).some(Boolean);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
className: "commands-command-menu",
overlayClassName: "commands-command-menu__overlay",
onRequestClose: closeAndReset,
__experimentalHideHeader: true,
contentLabel: (0,external_wp_i18n_namespaceObject.__)("Command palette"),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "commands-command-menu__container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(He, { label: inputLabel, onKeyDown, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "commands-command-menu__header", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
icon_default,
{
className: "commands-command-menu__header-search-icon",
icon: search_default
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CommandInput,
{
search,
setSearch,
isOpen
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(He.List, { label: (0,external_wp_i18n_namespaceObject.__)("Command suggestions"), children: [
search && !isLoading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(He.Empty, { children: (0,external_wp_i18n_namespaceObject.__)("No results found.") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CommandMenuGroup,
{
search,
setLoader,
close: closeAndReset,
isContextual: true
}
),
search && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CommandMenuGroup,
{
search,
setLoader,
close: closeAndReset
}
)
] })
] }) })
}
);
}
;// ./node_modules/@wordpress/commands/build-module/hooks/use-command-context.js
function useCommandContext(context) {
const { getContext } = (0,external_wp_data_namespaceObject.useSelect)(store);
const initialContext = (0,external_wp_element_namespaceObject.useRef)(getContext());
const { setContext } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
(0,external_wp_element_namespaceObject.useEffect)(() => {
setContext(context);
}, [context, setContext]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const initialContextRef = initialContext.current;
return () => setContext(initialContextRef);
}, [setContext]);
}
;// ./node_modules/@wordpress/commands/build-module/private-apis.js
const privateApis = {};
lock(privateApis, {
useCommandContext: useCommandContext
});
;// ./node_modules/@wordpress/commands/build-module/hooks/use-command.js
function useCommand(command) {
const { registerCommand, unregisterCommand } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const currentCallbackRef = (0,external_wp_element_namespaceObject.useRef)(command.callback);
(0,external_wp_element_namespaceObject.useEffect)(() => {
currentCallbackRef.current = command.callback;
}, [command.callback]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (command.disabled) {
return;
}
registerCommand({
name: command.name,
context: command.context,
label: command.label,
searchLabel: command.searchLabel,
icon: command.icon,
keywords: command.keywords,
callback: (...args) => currentCallbackRef.current(...args)
});
return () => {
unregisterCommand(command.name);
};
}, [
command.name,
command.label,
command.searchLabel,
command.icon,
command.context,
command.keywords,
command.disabled,
registerCommand,
unregisterCommand
]);
}
function useCommands(commands) {
const { registerCommand, unregisterCommand } = (0,external_wp_data_namespaceObject.useDispatch)(store);
const currentCallbacksRef = (0,external_wp_element_namespaceObject.useRef)({});
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!commands) {
return;
}
commands.forEach((command) => {
if (command.callback) {
currentCallbacksRef.current[command.name] = command.callback;
}
});
}, [commands]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!commands) {
return;
}
commands.forEach((command) => {
if (command.disabled) {
return;
}
registerCommand({
name: command.name,
context: command.context,
label: command.label,
searchLabel: command.searchLabel,
icon: command.icon,
keywords: command.keywords,
callback: (...args) => {
const callback = currentCallbacksRef.current[command.name];
if (callback) {
callback(...args);
}
}
});
});
return () => {
commands.forEach((command) => {
unregisterCommand(command.name);
});
};
}, [commands, registerCommand, unregisterCommand]);
}
;// ./node_modules/@wordpress/commands/build-module/hooks/use-command-loader.js
function useCommandLoader(loader) {
const { registerCommandLoader, unregisterCommandLoader } = (0,external_wp_data_namespaceObject.useDispatch)(store);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (loader.disabled) {
return;
}
registerCommandLoader({
name: loader.name,
hook: loader.hook,
context: loader.context
});
return () => {
unregisterCommandLoader(loader.name);
};
}, [
loader.name,
loader.hook,
loader.context,
loader.disabled,
registerCommandLoader,
unregisterCommandLoader
]);
}
;// ./node_modules/@wordpress/commands/build-module/index.js
(window.wp = window.wp || {}).commands = __webpack_exports__;
/******/ })()
; redux-routine.min.js 0000644 00000021271 15121363541 0010502 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var r={3304:(r,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.cps=e.call=void 0;var n,u=t(6921),o=(n=u)&&n.__esModule?n:{default:n};var a=e.call=function(r,e,t,n,u){if(!o.default.call(r))return!1;try{e(r.func.apply(r.context,r.args))}catch(r){u(r)}return!0},c=e.cps=function(r,e,t,n,u){var a;return!!o.default.cps(r)&&((a=r.func).call.apply(a,[null].concat(function(r){if(Array.isArray(r)){for(var e=0,t=Array(r.length);e<r.length;e++)t[e]=r[e];return t}return Array.from(r)}(r.args),[function(r,t){r?u(r):e(t)}])),!0)};e.default=[a,c]},3524:(r,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createChannel=e.subscribe=e.cps=e.apply=e.call=e.invoke=e.delay=e.race=e.join=e.fork=e.error=e.all=void 0;var n,u=t(4137),o=(n=u)&&n.__esModule?n:{default:n};e.all=function(r){return{type:o.default.all,value:r}},e.error=function(r){return{type:o.default.error,error:r}},e.fork=function(r){for(var e=arguments.length,t=Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return{type:o.default.fork,iterator:r,args:t}},e.join=function(r){return{type:o.default.join,task:r}},e.race=function(r){return{type:o.default.race,competitors:r}},e.delay=function(r){return new Promise((function(e){setTimeout((function(){return e(!0)}),r)}))},e.invoke=function(r){for(var e=arguments.length,t=Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return{type:o.default.call,func:r,context:null,args:t}},e.call=function(r,e){for(var t=arguments.length,n=Array(t>2?t-2:0),u=2;u<t;u++)n[u-2]=arguments[u];return{type:o.default.call,func:r,context:e,args:n}},e.apply=function(r,e,t){return{type:o.default.call,func:r,context:e,args:t}},e.cps=function(r){for(var e=arguments.length,t=Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return{type:o.default.cps,func:r,args:t}},e.subscribe=function(r){return{type:o.default.subscribe,channel:r}},e.createChannel=function(r){var e=[];return r((function(r){return e.forEach((function(e){return e(r)}))})),{subscribe:function(r){return e.push(r),function(){return e.splice(e.indexOf(r),1)}}}}},4137:(r,e)=>{Object.defineProperty(e,"__esModule",{value:!0});var t={all:Symbol("all"),error:Symbol("error"),fork:Symbol("fork"),join:Symbol("join"),race:Symbol("race"),call:Symbol("call"),cps:Symbol("cps"),subscribe:Symbol("subscribe")};e.default=t},5136:(r,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){var r=[];return{subscribe:function(e){return r.push(e),function(){r=r.filter((function(r){return r!==e}))}},dispatch:function(e){r.slice().forEach((function(r){return r(e)}))}}}},5357:(r,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.iterator=e.array=e.object=e.error=e.any=void 0;var n,u=t(6921),o=(n=u)&&n.__esModule?n:{default:n};var a=e.any=function(r,e,t,n){return n(r),!0},c=e.error=function(r,e,t,n,u){return!!o.default.error(r)&&(u(r.error),!0)},f=e.object=function(r,e,t,n,u){if(!o.default.all(r)||!o.default.obj(r.value))return!1;var a={},c=Object.keys(r.value),f=0,i=!1;return c.map((function(e){t(r.value[e],(function(r){return function(r,e){i||(a[r]=e,++f===c.length&&n(a))}(e,r)}),(function(r){return function(r,e){i||(i=!0,u(e))}(0,r)}))})),!0},i=e.array=function(r,e,t,n,u){if(!o.default.all(r)||!o.default.array(r.value))return!1;var a=[],c=0,f=!1;return r.value.map((function(e,o){t(e,(function(e){return function(e,t){f||(a[e]=t,++c===r.value.length&&n(a))}(o,e)}),(function(r){return function(r,e){f||(f=!0,u(e))}(0,r)}))})),!0},l=e.iterator=function(r,e,t,n,u){return!!o.default.iterator(r)&&(t(r,e,u),!0)};e.default=[c,l,i,f,a]},6910:(r,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.race=e.join=e.fork=e.promise=void 0;var n=a(t(6921)),u=t(3524),o=a(t(5136));function a(r){return r&&r.__esModule?r:{default:r}}var c=e.promise=function(r,e,t,u,o){return!!n.default.promise(r)&&(r.then(e,o),!0)},f=new Map,i=e.fork=function(r,e,t){if(!n.default.fork(r))return!1;var a=Symbol("fork"),c=(0,o.default)();f.set(a,c),t(r.iterator.apply(null,r.args),(function(r){return c.dispatch(r)}),(function(r){return c.dispatch((0,u.error)(r))}));var i=c.subscribe((function(){i(),f.delete(a)}));return e(a),!0},l=e.join=function(r,e,t,u,o){if(!n.default.join(r))return!1;var a,c=f.get(r.task);return c?a=c.subscribe((function(r){a(),e(r)})):o("join error : task not found"),!0},s=e.race=function(r,e,t,u,o){if(!n.default.race(r))return!1;var a,c=!1,f=function(r,t,n){c||(c=!0,r[t]=n,e(r))},i=function(r){c||o(r)};return n.default.array(r.competitors)?(a=r.competitors.map((function(){return!1})),r.competitors.forEach((function(r,e){t(r,(function(r){return f(a,e,r)}),i)}))):function(){var e=Object.keys(r.competitors).reduce((function(r,e){return r[e]=!1,r}),{});Object.keys(r.competitors).forEach((function(n){t(r.competitors[n],(function(r){return f(e,n,r)}),i)}))}(),!0};e.default=[c,i,l,s,function(r,e){if(!n.default.subscribe(r))return!1;if(!n.default.channel(r.channel))throw new Error('the first argument of "subscribe" must be a valid channel');var t=r.channel.subscribe((function(r){t&&t(),e(r)}));return!0}]},6921:(r,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n,u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol?"symbol":typeof r},o=t(4137),a=(n=o)&&n.__esModule?n:{default:n};var c={obj:function(r){return"object"===(void 0===r?"undefined":u(r))&&!!r},all:function(r){return c.obj(r)&&r.type===a.default.all},error:function(r){return c.obj(r)&&r.type===a.default.error},array:Array.isArray,func:function(r){return"function"==typeof r},promise:function(r){return r&&c.func(r.then)},iterator:function(r){return r&&c.func(r.next)&&c.func(r.throw)},fork:function(r){return c.obj(r)&&r.type===a.default.fork},join:function(r){return c.obj(r)&&r.type===a.default.join},race:function(r){return c.obj(r)&&r.type===a.default.race},call:function(r){return c.obj(r)&&r.type===a.default.call},cps:function(r){return c.obj(r)&&r.type===a.default.cps},subscribe:function(r){return c.obj(r)&&r.type===a.default.subscribe},channel:function(r){return c.obj(r)&&c.func(r.subscribe)}};e.default=c},8975:(r,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.wrapControls=e.asyncControls=e.create=void 0;var n=t(3524);Object.keys(n).forEach((function(r){"default"!==r&&Object.defineProperty(e,r,{enumerable:!0,get:function(){return n[r]}})}));var u=c(t(9127)),o=c(t(6910)),a=c(t(3304));function c(r){return r&&r.__esModule?r:{default:r}}e.create=u.default,e.asyncControls=o.default,e.wrapControls=a.default},9127:(r,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=o(t(5357)),u=o(t(6921));function o(r){return r&&r.__esModule?r:{default:r}}function a(r){if(Array.isArray(r)){for(var e=0,t=Array(r.length);e<r.length;e++)t[e]=r[e];return t}return Array.from(r)}e.default=function(){var r=[].concat(a(arguments.length<=0||void 0===arguments[0]?[]:arguments[0]),a(n.default));return function e(t){var n,o,a,c=arguments.length<=1||void 0===arguments[1]?function(){}:arguments[1],f=arguments.length<=2||void 0===arguments[2]?function(){}:arguments[2],i=u.default.iterator(t)?t:regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t;case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)}))();n=i,o=function(r){return function(e){try{var t=r?n.throw(e):n.next(e),u=t.value;if(t.done)return c(u);a(u)}catch(r){return f(r)}}},a=function t(n){r.some((function(r){return r(n,t,e,o(!1),o(!0))}))},o(!1)()}}}},e={};function t(n){var u=e[n];if(void 0!==u)return u.exports;var o=e[n]={exports:{}};return r[n](o,o.exports,t),o.exports}t.d=(r,e)=>{for(var n in e)t.o(e,n)&&!t.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:e[n]})},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e);var n={};t.d(n,{default:()=>f});var u=t(8975);
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function o(r){return"[object Object]"===Object.prototype.toString.call(r)}function a(r){return!1!==o(e=r)&&(void 0===(t=e.constructor)||!1!==o(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))&&"string"==typeof r.type;var e,t,n}function c(r={},e){const t=Object.entries(r).map((([r,e])=>(t,n,u,o,c)=>{if(i=r,!a(f=t)||f.type!==i)return!1;var f,i;const l=e(t);var s;return!(s=l)||"object"!=typeof s&&"function"!=typeof s||"function"!=typeof s.then?o(l):l.then(o,c),!0}));t.push(((r,t)=>!!a(r)&&(e(r),t(),!0)));const n=(0,u.create)(t);return r=>new Promise(((t,u)=>n(r,(r=>{a(r)&&e(r),t(r)}),u)))}function f(r={}){return e=>{const t=c(r,e.dispatch);return r=>e=>{return(n=e)&&"function"==typeof n[Symbol.iterator]&&"function"==typeof n.next?t(e):r(e);var n}}}(window.wp=window.wp||{}).reduxRoutine=n.default})(); notices.min.js 0000644 00000004036 15121363542 0007335 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{store:()=>_});var n={};e.r(n),e.d(n,{createErrorNotice:()=>f,createInfoNotice:()=>d,createNotice:()=>a,createSuccessNotice:()=>l,createWarningNotice:()=>E,removeAllNotices:()=>y,removeNotice:()=>p,removeNotices:()=>O});var i={};e.r(i),e.d(i,{getNotices:()=>T});const r=window.wp.data;var o=(e=>t=>(n={},i)=>{const r=i[e];if(void 0===r)return n;const o=t(n[r],i);return o===n[r]?n:{...n,[r]:o}})("context")(((e=[],t)=>{switch(t.type){case"CREATE_NOTICE":return[...e.filter((({id:e})=>e!==t.notice.id)),t.notice];case"REMOVE_NOTICE":return e.filter((({id:e})=>e!==t.id));case"REMOVE_NOTICES":return e.filter((({id:e})=>!t.ids.includes(e)));case"REMOVE_ALL_NOTICES":return e.filter((({type:e})=>e!==t.noticeType))}return e}));const c="global",s="info";let u=0;function a(e=s,t,n={}){const{speak:i=!0,isDismissible:r=!0,context:o=c,id:a=`${o}${++u}`,actions:l=[],type:d="default",__unstableHTML:f,icon:E=null,explicitDismiss:p=!1,onDismiss:y}=n;return{type:"CREATE_NOTICE",context:o,notice:{id:a,status:e,content:t=String(t),spokenMessage:i?t:null,__unstableHTML:f,isDismissible:r,actions:l,type:d,icon:E,explicitDismiss:p,onDismiss:y}}}function l(e,t){return a("success",e,t)}function d(e,t){return a("info",e,t)}function f(e,t){return a("error",e,t)}function E(e,t){return a("warning",e,t)}function p(e,t=c){return{type:"REMOVE_NOTICE",id:e,context:t}}function y(e="default",t=c){return{type:"REMOVE_ALL_NOTICES",noticeType:e,context:t}}function O(e,t=c){return{type:"REMOVE_NOTICES",ids:e,context:t}}const N=[];function T(e,t=c){return e[t]||N}const _=(0,r.createReduxStore)("core/notices",{reducer:o,actions:n,selectors:i});(0,r.register)(_),(window.wp=window.wp||{}).notices=t})(); format-library.js 0000644 00000217555 15121363542 0010055 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ 3533:
/***/ ((module) => {
module.exports = window["wp"]["latexToMathml"];
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/create fake namespace object */
/******/ (() => {
/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
/******/ var leafPrototypes;
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 16: return value when it's Promise-like
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = this(value);
/******/ if(mode & 8) return value;
/******/ if(typeof value === 'object' && value) {
/******/ if((mode & 4) && value.__esModule) return value;
/******/ if((mode & 16) && typeof value.then === 'function') return value;
/******/ }
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ var def = {};
/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
/******/ }
/******/ def['default'] = () => (value);
/******/ __webpack_require__.d(ns, def);
/******/ return ns;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
;// external ["wp","richText"]
const external_wp_richText_namespaceObject = window["wp"]["richText"];
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// external ["wp","blockEditor"]
const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
;// external ["wp","primitives"]
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
;// ./node_modules/@wordpress/icons/build-module/library/format-bold.js
var format_bold_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z" }) });
;// external ["wp","privateApis"]
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// ./node_modules/@wordpress/format-library/build-module/lock-unlock.js
const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
"@wordpress/format-library"
);
;// ./node_modules/@wordpress/format-library/build-module/bold/index.js
const { essentialFormatKey } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const bold_name = "core/bold";
const title = (0,external_wp_i18n_namespaceObject.__)("Bold");
const bold = {
name: bold_name,
title,
tagName: "strong",
className: null,
[essentialFormatKey]: true,
edit({ isActive, value, onChange, onFocus }) {
function onToggle() {
onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: bold_name, title }));
}
function onClick() {
onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: bold_name }));
onFocus();
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextShortcut,
{
type: "primary",
character: "b",
onUse: onToggle
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextToolbarButton,
{
name: "bold",
icon: format_bold_default,
title,
onClick,
isActive,
shortcutType: "primary",
shortcutCharacter: "b"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent,
{
inputType: "formatBold",
onInput: onToggle
}
)
] });
}
};
;// ./node_modules/@wordpress/icons/build-module/library/code.js
var code_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z" }) });
;// ./node_modules/@wordpress/format-library/build-module/code/index.js
const code_name = "core/code";
const code_title = (0,external_wp_i18n_namespaceObject.__)("Inline code");
const code = {
name: code_name,
title: code_title,
tagName: "code",
className: null,
__unstableInputRule(value) {
const BACKTICK = "`";
const { start, text } = value;
const characterBefore = text[start - 1];
if (characterBefore !== BACKTICK) {
return value;
}
if (start - 2 < 0) {
return value;
}
const indexBefore = text.lastIndexOf(BACKTICK, start - 2);
if (indexBefore === -1) {
return value;
}
const startIndex = indexBefore;
const endIndex = start - 2;
if (startIndex === endIndex) {
return value;
}
value = (0,external_wp_richText_namespaceObject.remove)(value, startIndex, startIndex + 1);
value = (0,external_wp_richText_namespaceObject.remove)(value, endIndex, endIndex + 1);
value = (0,external_wp_richText_namespaceObject.applyFormat)(value, { type: code_name }, startIndex, endIndex);
return value;
},
edit({ value, onChange, onFocus, isActive }) {
function onClick() {
onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: code_name, title: code_title }));
onFocus();
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextShortcut,
{
type: "access",
character: "x",
onUse: onClick
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextToolbarButton,
{
icon: code_default,
title: code_title,
onClick,
isActive,
role: "menuitemcheckbox"
}
)
] });
}
};
;// external ["wp","components"]
const external_wp_components_namespaceObject = window["wp"]["components"];
;// external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// ./node_modules/@wordpress/format-library/build-module/image/index.js
const ALLOWED_MEDIA_TYPES = ["image"];
const image_name = "core/image";
const image_title = (0,external_wp_i18n_namespaceObject.__)("Inline image");
function getCurrentImageId(activeObjectAttributes) {
if (!activeObjectAttributes?.className) {
return void 0;
}
const [, id] = activeObjectAttributes.className.match(/wp-image-(\d+)/) ?? [];
return id ? parseInt(id, 10) : void 0;
}
const image_image = {
name: image_name,
title: image_title,
keywords: [(0,external_wp_i18n_namespaceObject.__)("photo"), (0,external_wp_i18n_namespaceObject.__)("media")],
object: true,
tagName: "img",
className: null,
attributes: {
className: "class",
style: "style",
url: "src",
alt: "alt"
},
edit: Edit
};
function InlineUI({ value, onChange, activeObjectAttributes, contentRef }) {
const { style, alt } = activeObjectAttributes;
const width = style?.replace(/\D/g, "");
const [editedWidth, setEditedWidth] = (0,external_wp_element_namespaceObject.useState)(width);
const [editedAlt, setEditedAlt] = (0,external_wp_element_namespaceObject.useState)(alt);
const hasChanged = editedWidth !== width || editedAlt !== alt;
const popoverAnchor = (0,external_wp_richText_namespaceObject.useAnchor)({
editableContentElement: contentRef.current,
settings: image_image
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Popover,
{
placement: "bottom",
focusOnMount: false,
anchor: popoverAnchor,
className: "block-editor-format-toolbar__image-popover",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"form",
{
className: "block-editor-format-toolbar__image-container-content",
onSubmit: (event) => {
const newReplacements = value.replacements.slice();
newReplacements[value.start] = {
type: image_name,
attributes: {
...activeObjectAttributes,
style: editedWidth ? `width: ${editedWidth}px;` : "",
alt: editedAlt
}
};
onChange({
...value,
replacements: newReplacements
});
event.preventDefault();
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalNumberControl,
{
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Width"),
value: editedWidth,
min: 1,
onChange: (newWidth) => {
setEditedWidth(newWidth);
}
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextareaControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Alternative text"),
__nextHasNoMarginBottom: true,
value: editedAlt,
onChange: (newAlt) => {
setEditedAlt(newAlt);
},
help: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ExternalLink,
{
href: (
// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.
(0,external_wp_i18n_namespaceObject.__)(
"https://www.w3.org/WAI/tutorials/images/decision-tree/"
)
),
children: (0,external_wp_i18n_namespaceObject.__)(
"Describe the purpose of the image."
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}),
(0,external_wp_i18n_namespaceObject.__)("Leave empty if decorative.")
] })
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
disabled: !hasChanged,
accessibleWhenDisabled: true,
variant: "primary",
type: "submit",
size: "compact",
children: (0,external_wp_i18n_namespaceObject.__)("Apply")
}
) })
] })
}
)
}
);
}
function Edit({
value,
onChange,
onFocus,
isObjectActive,
activeObjectAttributes,
contentRef
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.MediaUpload,
{
allowedTypes: ALLOWED_MEDIA_TYPES,
value: getCurrentImageId(activeObjectAttributes),
onSelect: ({ id, url, alt, width: imgWidth }) => {
onChange(
(0,external_wp_richText_namespaceObject.insertObject)(value, {
type: image_name,
attributes: {
className: `wp-image-${id}`,
style: `width: ${Math.min(
imgWidth,
150
)}px;`,
url,
alt
}
})
);
onFocus();
},
render: ({ open }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextToolbarButton,
{
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SVG,
{
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z" })
}
),
title: isObjectActive ? (0,external_wp_i18n_namespaceObject.__)("Replace image") : image_title,
onClick: open,
isActive: isObjectActive
}
)
}
),
isObjectActive && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
InlineUI,
{
value,
onChange,
activeObjectAttributes,
contentRef
}
)
] });
}
;// ./node_modules/@wordpress/icons/build-module/library/format-italic.js
var format_italic_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12.5 5L10 19h1.9l2.5-14z" }) });
;// ./node_modules/@wordpress/format-library/build-module/italic/index.js
const { essentialFormatKey: italic_essentialFormatKey } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const italic_name = "core/italic";
const italic_title = (0,external_wp_i18n_namespaceObject.__)("Italic");
const italic = {
name: italic_name,
title: italic_title,
tagName: "em",
className: null,
[italic_essentialFormatKey]: true,
edit({ isActive, value, onChange, onFocus }) {
function onToggle() {
onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: italic_name, title: italic_title }));
}
function onClick() {
onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: italic_name }));
onFocus();
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextShortcut,
{
type: "primary",
character: "i",
onUse: onToggle
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextToolbarButton,
{
name: "italic",
icon: format_italic_default,
title: italic_title,
onClick,
isActive,
shortcutType: "primary",
shortcutCharacter: "i"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent,
{
inputType: "formatItalic",
onInput: onToggle
}
)
] });
}
};
;// external ["wp","url"]
const external_wp_url_namespaceObject = window["wp"]["url"];
;// external ["wp","htmlEntities"]
const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
;// ./node_modules/@wordpress/icons/build-module/library/link.js
var link_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) });
;// external ["wp","a11y"]
const external_wp_a11y_namespaceObject = window["wp"]["a11y"];
;// external ["wp","data"]
const external_wp_data_namespaceObject = window["wp"]["data"];
;// ./node_modules/@wordpress/format-library/build-module/link/utils.js
function isValidHref(href) {
if (!href) {
return false;
}
const trimmedHref = href.trim();
if (!trimmedHref) {
return false;
}
if (/^\S+:/.test(trimmedHref)) {
const protocol = (0,external_wp_url_namespaceObject.getProtocol)(trimmedHref);
if (!(0,external_wp_url_namespaceObject.isValidProtocol)(protocol)) {
return false;
}
if (protocol.startsWith("http") && !/^https?:\/\/[^\/\s]/i.test(trimmedHref)) {
return false;
}
const authority = (0,external_wp_url_namespaceObject.getAuthority)(trimmedHref);
if (!(0,external_wp_url_namespaceObject.isValidAuthority)(authority)) {
return false;
}
const path = (0,external_wp_url_namespaceObject.getPath)(trimmedHref);
if (path && !(0,external_wp_url_namespaceObject.isValidPath)(path)) {
return false;
}
const queryString = (0,external_wp_url_namespaceObject.getQueryString)(trimmedHref);
if (queryString && !(0,external_wp_url_namespaceObject.isValidQueryString)(queryString)) {
return false;
}
const fragment = (0,external_wp_url_namespaceObject.getFragment)(trimmedHref);
if (fragment && !(0,external_wp_url_namespaceObject.isValidFragment)(fragment)) {
return false;
}
}
if (trimmedHref.startsWith("#") && !(0,external_wp_url_namespaceObject.isValidFragment)(trimmedHref)) {
return false;
}
return true;
}
function createLinkFormat({
url,
type,
id,
opensInNewWindow,
nofollow,
cssClasses
}) {
const format = {
type: "core/link",
attributes: {
url
}
};
if (type) {
format.attributes.type = type;
}
if (id) {
format.attributes.id = id;
}
if (opensInNewWindow) {
format.attributes.target = "_blank";
format.attributes.rel = format.attributes.rel ? format.attributes.rel + " noreferrer noopener" : "noreferrer noopener";
}
if (nofollow) {
format.attributes.rel = format.attributes.rel ? format.attributes.rel + " nofollow" : "nofollow";
}
const trimmedCssClasses = cssClasses?.trim();
if (trimmedCssClasses?.length) {
format.attributes.class = trimmedCssClasses;
}
return format;
}
function getFormatBoundary(value, format, startIndex = value.start, endIndex = value.end) {
const EMPTY_BOUNDARIES = {
start: null,
end: null
};
const { formats } = value;
let targetFormat;
let initialIndex;
if (!formats?.length) {
return EMPTY_BOUNDARIES;
}
const newFormats = formats.slice();
const formatAtStart = newFormats[startIndex]?.find(
({ type }) => type === format.type
);
const formatAtEnd = newFormats[endIndex]?.find(
({ type }) => type === format.type
);
const formatAtEndMinusOne = newFormats[endIndex - 1]?.find(
({ type }) => type === format.type
);
if (!!formatAtStart) {
targetFormat = formatAtStart;
initialIndex = startIndex;
} else if (!!formatAtEnd) {
targetFormat = formatAtEnd;
initialIndex = endIndex;
} else if (!!formatAtEndMinusOne) {
targetFormat = formatAtEndMinusOne;
initialIndex = endIndex - 1;
} else {
return EMPTY_BOUNDARIES;
}
const index = newFormats[initialIndex].indexOf(targetFormat);
const walkingArgs = [newFormats, initialIndex, targetFormat, index];
startIndex = walkToStart(...walkingArgs);
endIndex = walkToEnd(...walkingArgs);
startIndex = startIndex < 0 ? 0 : startIndex;
return {
start: startIndex,
end: endIndex
};
}
function walkToBoundary(formats, initialIndex, targetFormatRef, formatIndex, direction) {
let index = initialIndex;
const directions = {
forwards: 1,
backwards: -1
};
const directionIncrement = directions[direction] || 1;
const inverseDirectionIncrement = directionIncrement * -1;
while (formats[index] && formats[index][formatIndex] === targetFormatRef) {
index = index + directionIncrement;
}
index = index + inverseDirectionIncrement;
return index;
}
const partialRight = (fn, ...partialArgs) => (...args) => fn(...args, ...partialArgs);
const walkToStart = partialRight(walkToBoundary, "backwards");
const walkToEnd = partialRight(walkToBoundary, "forwards");
;// external ["wp","compose"]
const external_wp_compose_namespaceObject = window["wp"]["compose"];
;// ./node_modules/@wordpress/format-library/build-module/link/css-classes-setting.js
const CSSClassesSettingComponent = ({ setting, value, onChange }) => {
const hasValue = value ? value?.cssClasses?.length > 0 : false;
const [isSettingActive, setIsSettingActive] = (0,external_wp_element_namespaceObject.useState)(hasValue);
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(CSSClassesSettingComponent);
const controlledRegionId = `css-classes-setting-${instanceId}`;
const handleSettingChange = (newValue) => {
const sanitizedValue = typeof newValue === "string" ? newValue.replace(/,/g, " ").replace(/\s+/g, " ").trim() : newValue;
onChange({
...value,
[setting.id]: sanitizedValue
});
};
const handleCheckboxChange = () => {
if (isSettingActive) {
if (hasValue) {
handleSettingChange("");
}
setIsSettingActive(false);
} else {
setIsSettingActive(true);
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "legend", children: setting.title }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CheckboxControl,
{
__nextHasNoMarginBottom: true,
label: setting.title,
onChange: handleCheckboxChange,
checked: isSettingActive || hasValue,
"aria-expanded": isSettingActive,
"aria-controls": isSettingActive ? controlledRegionId : void 0
}
),
isSettingActive && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { id: controlledRegionId, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalInputControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("CSS classes"),
value: value?.cssClasses,
onChange: handleSettingChange,
help: (0,external_wp_i18n_namespaceObject.__)(
"Separate multiple classes with spaces."
),
__unstableInputWidth: "100%",
__next40pxDefaultSize: true
}
) })
] })
] });
};
var css_classes_setting_default = CSSClassesSettingComponent;
;// ./node_modules/@wordpress/format-library/build-module/link/inline.js
const LINK_SETTINGS = [
...external_wp_blockEditor_namespaceObject.LinkControl.DEFAULT_LINK_SETTINGS,
{
id: "nofollow",
title: (0,external_wp_i18n_namespaceObject.__)("Mark as nofollow")
},
{
id: "cssClasses",
title: (0,external_wp_i18n_namespaceObject.__)("Additional CSS class(es)"),
render: (setting, value, onChange) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
css_classes_setting_default,
{
setting,
value,
onChange
}
);
}
}
];
function InlineLinkUI({
isActive,
activeAttributes,
value,
onChange,
onFocusOutside,
stopAddingLink,
contentRef,
focusOnMount
}) {
const richLinkTextValue = getRichTextValueFromSelection(value, isActive);
const richTextText = richLinkTextValue.text;
const { selectionChange } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const { createPageEntity, userCanCreatePages, selectionStart } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getSettings, getSelectionStart } = select(external_wp_blockEditor_namespaceObject.store);
const _settings = getSettings();
return {
createPageEntity: _settings.__experimentalCreatePageEntity,
userCanCreatePages: _settings.__experimentalUserCanCreatePages,
selectionStart: getSelectionStart()
};
},
[]
);
const linkValue = (0,external_wp_element_namespaceObject.useMemo)(
() => ({
url: activeAttributes.url,
type: activeAttributes.type,
id: activeAttributes.id,
opensInNewTab: activeAttributes.target === "_blank",
nofollow: activeAttributes.rel?.includes("nofollow"),
title: richTextText,
cssClasses: activeAttributes.class
}),
[
activeAttributes.class,
activeAttributes.id,
activeAttributes.rel,
activeAttributes.target,
activeAttributes.type,
activeAttributes.url,
richTextText
]
);
function removeLink() {
const newValue = (0,external_wp_richText_namespaceObject.removeFormat)(value, "core/link");
onChange(newValue);
stopAddingLink();
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)("Link removed."), "assertive");
}
function onChangeLink(nextValue) {
const hasLink = linkValue?.url;
const isNewLink = !hasLink;
nextValue = {
...linkValue,
...nextValue
};
const newUrl = (0,external_wp_url_namespaceObject.prependHTTP)(nextValue.url);
const linkFormat = createLinkFormat({
url: newUrl,
type: nextValue.type,
id: nextValue.id !== void 0 && nextValue.id !== null ? String(nextValue.id) : void 0,
opensInNewWindow: nextValue.opensInNewTab,
nofollow: nextValue.nofollow,
cssClasses: nextValue.cssClasses
});
const newText = nextValue.title || newUrl;
let newValue;
if ((0,external_wp_richText_namespaceObject.isCollapsed)(value) && !isActive) {
const inserted = (0,external_wp_richText_namespaceObject.insert)(value, newText);
newValue = (0,external_wp_richText_namespaceObject.applyFormat)(
inserted,
linkFormat,
value.start,
value.start + newText.length
);
onChange(newValue);
stopAddingLink();
selectionChange({
clientId: selectionStart.clientId,
identifier: selectionStart.attributeKey,
start: value.start + newText.length + 1
});
return;
} else if (newText === richTextText) {
newValue = (0,external_wp_richText_namespaceObject.applyFormat)(value, linkFormat);
} else {
newValue = (0,external_wp_richText_namespaceObject.create)({ text: newText });
newValue = (0,external_wp_richText_namespaceObject.applyFormat)(newValue, linkFormat, 0, newText.length);
const boundary = getFormatBoundary(value, {
type: "core/link"
});
const [valBefore, valAfter] = (0,external_wp_richText_namespaceObject.split)(
value,
boundary.start,
boundary.start
);
const newValAfter = (0,external_wp_richText_namespaceObject.replace)(valAfter, richTextText, newValue);
newValue = (0,external_wp_richText_namespaceObject.concat)(valBefore, newValAfter);
}
onChange(newValue);
if (!isNewLink) {
stopAddingLink();
}
if (!isValidHref(newUrl)) {
(0,external_wp_a11y_namespaceObject.speak)(
(0,external_wp_i18n_namespaceObject.__)(
"Warning: the link has been inserted but may have errors. Please test it."
),
"assertive"
);
} else if (isActive) {
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)("Link edited."), "assertive");
} else {
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)("Link inserted."), "assertive");
}
}
const popoverAnchor = (0,external_wp_richText_namespaceObject.useAnchor)({
editableContentElement: contentRef.current,
settings: {
...link_link,
isActive
}
});
async function handleCreate(pageTitle) {
const page = await createPageEntity({
title: pageTitle,
status: "draft"
});
return {
id: page.id,
type: page.type,
title: page.title.rendered,
url: page.link,
kind: "post-type"
};
}
function createButtonText(searchTerm) {
return (0,external_wp_element_namespaceObject.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: search term. */
(0,external_wp_i18n_namespaceObject.__)("Create page: <mark>%s</mark>"),
searchTerm
),
{ mark: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("mark", {}) }
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Popover,
{
anchor: popoverAnchor,
animate: false,
onClose: stopAddingLink,
onFocusOutside,
placement: "bottom",
offset: 8,
shift: true,
focusOnMount,
constrainTabbing: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.LinkControl,
{
value: linkValue,
onChange: onChangeLink,
onRemove: removeLink,
hasRichPreviews: true,
createSuggestion: createPageEntity && handleCreate,
withCreateSuggestion: userCanCreatePages,
createSuggestionButtonText: createButtonText,
hasTextControl: true,
settings: LINK_SETTINGS,
showInitialSuggestions: true,
suggestionsQuery: {
// always show Pages as initial suggestions
initialSuggestionsSearchOptions: {
type: "post",
subtype: "page",
perPage: 20
}
}
}
)
}
);
}
function getRichTextValueFromSelection(value, isActive) {
let textStart = value.start;
let textEnd = value.end;
if (isActive) {
const boundary = getFormatBoundary(value, {
type: "core/link"
});
textStart = boundary.start;
textEnd = boundary.end + 1;
}
return (0,external_wp_richText_namespaceObject.slice)(value, textStart, textEnd);
}
var inline_default = InlineLinkUI;
;// ./node_modules/@wordpress/format-library/build-module/link/index.js
const { essentialFormatKey: link_essentialFormatKey } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const link_name = "core/link";
const link_title = (0,external_wp_i18n_namespaceObject.__)("Link");
function link_Edit({
isActive,
activeAttributes,
value,
onChange,
onFocus,
contentRef
}) {
const [addingLink, setAddingLink] = (0,external_wp_element_namespaceObject.useState)(false);
const [openedBy, setOpenedBy] = (0,external_wp_element_namespaceObject.useState)(null);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isActive) {
setAddingLink(false);
}
}, [isActive]);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
const editableContentElement = contentRef.current;
if (!editableContentElement) {
return;
}
function handleClick(event) {
const link2 = event.target.closest("[contenteditable] a");
if (!link2 || // other formats (e.g. bold) may be nested within the link.
!isActive) {
return;
}
setAddingLink(true);
setOpenedBy({
el: link2,
action: "click"
});
}
editableContentElement.addEventListener("click", handleClick);
return () => {
editableContentElement.removeEventListener("click", handleClick);
};
}, [contentRef, isActive]);
function addLink(target) {
const text = (0,external_wp_richText_namespaceObject.getTextContent)((0,external_wp_richText_namespaceObject.slice)(value));
if (!isActive && text && (0,external_wp_url_namespaceObject.isURL)(text) && isValidHref(text)) {
onChange(
(0,external_wp_richText_namespaceObject.applyFormat)(value, {
type: link_name,
attributes: { url: text }
})
);
} else if (!isActive && text && (0,external_wp_url_namespaceObject.isEmail)(text)) {
onChange(
(0,external_wp_richText_namespaceObject.applyFormat)(value, {
type: link_name,
attributes: { url: `mailto:${text}` }
})
);
} else if (!isActive && text && (0,external_wp_url_namespaceObject.isPhoneNumber)(text)) {
onChange(
(0,external_wp_richText_namespaceObject.applyFormat)(value, {
type: link_name,
attributes: { url: `tel:${text.replace(/\D/g, "")}` }
})
);
} else {
if (target) {
setOpenedBy({
el: target,
action: null
// We don't need to distinguish between click or keyboard here
});
}
setAddingLink(true);
}
}
function stopAddingLink() {
setAddingLink(false);
if (openedBy?.el?.tagName === "BUTTON") {
openedBy.el.focus();
} else {
onFocus();
}
setOpenedBy(null);
}
function onFocusOutside() {
setAddingLink(false);
setOpenedBy(null);
}
function onRemoveFormat() {
onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, link_name));
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)("Link removed."), "assertive");
}
const shouldAutoFocus = !(openedBy?.el?.tagName === "A" && openedBy?.action === "click");
const hasSelection = !(0,external_wp_richText_namespaceObject.isCollapsed)(value);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
hasSelection && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextShortcut,
{
type: "primary",
character: "k",
onUse: addLink
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextShortcut,
{
type: "primaryShift",
character: "k",
onUse: onRemoveFormat
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextToolbarButton,
{
name: "link",
icon: link_default,
title: isActive ? (0,external_wp_i18n_namespaceObject.__)("Link") : link_title,
onClick: (event) => {
addLink(event.currentTarget);
},
isActive: isActive || addingLink,
shortcutType: "primary",
shortcutCharacter: "k",
"aria-haspopup": "true",
"aria-expanded": addingLink
}
),
addingLink && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inline_default,
{
stopAddingLink,
onFocusOutside,
isActive,
activeAttributes,
value,
onChange,
contentRef,
focusOnMount: shouldAutoFocus ? "firstElement" : false
}
)
] });
}
const link_link = {
name: link_name,
title: link_title,
tagName: "a",
className: null,
attributes: {
url: "href",
type: "data-type",
id: "data-id",
_id: "id",
target: "target",
rel: "rel",
class: "class"
},
[link_essentialFormatKey]: true,
__unstablePasteRule(value, { html, plainText }) {
const pastedText = (html || plainText).replace(/<[^>]+>/g, "").trim();
if (!(0,external_wp_url_namespaceObject.isURL)(pastedText) || !/^https?:/.test(pastedText)) {
return value;
}
window.console.log("Created link:\n\n", pastedText);
const format = {
type: link_name,
attributes: {
url: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(pastedText)
}
};
if ((0,external_wp_richText_namespaceObject.isCollapsed)(value)) {
return (0,external_wp_richText_namespaceObject.insert)(
value,
(0,external_wp_richText_namespaceObject.applyFormat)(
(0,external_wp_richText_namespaceObject.create)({ text: plainText }),
format,
0,
plainText.length
)
);
}
return (0,external_wp_richText_namespaceObject.applyFormat)(value, format);
},
edit: link_Edit
};
;// ./node_modules/@wordpress/icons/build-module/library/format-strikethrough.js
var format_strikethrough_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z" }) });
;// ./node_modules/@wordpress/format-library/build-module/strikethrough/index.js
const strikethrough_name = "core/strikethrough";
const strikethrough_title = (0,external_wp_i18n_namespaceObject.__)("Strikethrough");
const strikethrough = {
name: strikethrough_name,
title: strikethrough_title,
tagName: "s",
className: null,
edit({ isActive, value, onChange, onFocus }) {
function onClick() {
onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: strikethrough_name, title: strikethrough_title }));
onFocus();
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextShortcut,
{
type: "access",
character: "d",
onUse: onClick
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextToolbarButton,
{
icon: format_strikethrough_default,
title: strikethrough_title,
onClick,
isActive,
role: "menuitemcheckbox"
}
)
] });
}
};
;// ./node_modules/@wordpress/format-library/build-module/underline/index.js
const underline_name = "core/underline";
const underline_title = (0,external_wp_i18n_namespaceObject.__)("Underline");
const underline = {
name: underline_name,
title: underline_title,
tagName: "span",
className: null,
attributes: {
style: "style"
},
edit({ value, onChange }) {
const onToggle = () => {
onChange(
(0,external_wp_richText_namespaceObject.toggleFormat)(value, {
type: underline_name,
attributes: {
style: "text-decoration: underline;"
},
title: underline_title
})
);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextShortcut,
{
type: "primary",
character: "u",
onUse: onToggle
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent,
{
inputType: "formatUnderline",
onInput: onToggle
}
)
] });
}
};
;// ./node_modules/@wordpress/icons/build-module/icon/index.js
var icon_default = (0,external_wp_element_namespaceObject.forwardRef)(
({ icon, size = 24, ...props }, ref) => {
return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
width: size,
height: size,
...props,
ref
});
}
);
;// ./node_modules/@wordpress/icons/build-module/library/text-color.js
var text_color_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/color.js
var color_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z" }) });
;// ./node_modules/@wordpress/format-library/build-module/text-color/inline.js
const { Tabs } = unlock(external_wp_components_namespaceObject.privateApis);
const TABS = [
{ name: "color", title: (0,external_wp_i18n_namespaceObject.__)("Text") },
{ name: "backgroundColor", title: (0,external_wp_i18n_namespaceObject.__)("Background") }
];
function parseCSS(css = "") {
return css.split(";").reduce((accumulator, rule) => {
if (rule) {
const [property, value] = rule.split(":");
if (property === "color") {
accumulator.color = value;
}
if (property === "background-color" && value !== transparentValue) {
accumulator.backgroundColor = value;
}
}
return accumulator;
}, {});
}
function parseClassName(className = "", colorSettings) {
return className.split(" ").reduce((accumulator, name) => {
if (name.startsWith("has-") && name.endsWith("-color")) {
const colorSlug = name.replace(/^has-/, "").replace(/-color$/, "");
const colorObject = (0,external_wp_blockEditor_namespaceObject.getColorObjectByAttributeValues)(
colorSettings,
colorSlug
);
accumulator.color = colorObject.color;
}
return accumulator;
}, {});
}
function getActiveColors(value, name, colorSettings) {
const activeColorFormat = (0,external_wp_richText_namespaceObject.getActiveFormat)(value, name);
if (!activeColorFormat) {
return {};
}
return {
...parseCSS(activeColorFormat.attributes.style),
...parseClassName(activeColorFormat.attributes.class, colorSettings)
};
}
function setColors(value, name, colorSettings, colors) {
const { color, backgroundColor } = {
...getActiveColors(value, name, colorSettings),
...colors
};
if (!color && !backgroundColor) {
return (0,external_wp_richText_namespaceObject.removeFormat)(value, name);
}
const styles = [];
const classNames = [];
const attributes = {};
if (backgroundColor) {
styles.push(["background-color", backgroundColor].join(":"));
} else {
styles.push(["background-color", transparentValue].join(":"));
}
if (color) {
const colorObject = (0,external_wp_blockEditor_namespaceObject.getColorObjectByColorValue)(colorSettings, color);
if (colorObject) {
classNames.push((0,external_wp_blockEditor_namespaceObject.getColorClassName)("color", colorObject.slug));
} else {
styles.push(["color", color].join(":"));
}
}
if (styles.length) {
attributes.style = styles.join(";");
}
if (classNames.length) {
attributes.class = classNames.join(" ");
}
return (0,external_wp_richText_namespaceObject.applyFormat)(value, { type: name, attributes });
}
function ColorPicker({ name, property, value, onChange }) {
const colors = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getSettings } = select(external_wp_blockEditor_namespaceObject.store);
return getSettings().colors ?? [];
}, []);
const activeColors = (0,external_wp_element_namespaceObject.useMemo)(
() => getActiveColors(value, name, colors),
[name, value, colors]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.ColorPalette,
{
value: activeColors[property],
onChange: (color) => {
onChange(
setColors(value, name, colors, { [property]: color })
);
},
enableAlpha: true,
__experimentalIsRenderedInSidebar: true
}
);
}
function InlineColorUI({
name,
value,
onChange,
onClose,
contentRef,
isActive
}) {
const popoverAnchor = (0,external_wp_richText_namespaceObject.useAnchor)({
editableContentElement: contentRef.current,
settings: { ...textColor, isActive }
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Popover,
{
onClose,
className: "format-library__inline-color-popover",
anchor: popoverAnchor,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabList, { children: TABS.map((tab) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, { tabId: tab.name, children: tab.title }, tab.name)) }),
TABS.map((tab) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Tabs.TabPanel,
{
tabId: tab.name,
focusable: false,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ColorPicker,
{
name,
property: tab.name,
value,
onChange
}
)
},
tab.name
))
] })
}
);
}
;// ./node_modules/@wordpress/format-library/build-module/text-color/index.js
const transparentValue = "rgba(0, 0, 0, 0)";
const text_color_name = "core/text-color";
const text_color_title = (0,external_wp_i18n_namespaceObject.__)("Highlight");
const EMPTY_ARRAY = [];
function getComputedStyleProperty(element, property) {
const { ownerDocument } = element;
const { defaultView } = ownerDocument;
const style = defaultView.getComputedStyle(element);
const value = style.getPropertyValue(property);
if (property === "background-color" && value === transparentValue && element.parentElement) {
return getComputedStyleProperty(element.parentElement, property);
}
return value;
}
function fillComputedColors(element, { color, backgroundColor }) {
if (!color && !backgroundColor) {
return;
}
return {
color: color || getComputedStyleProperty(element, "color"),
backgroundColor: backgroundColor === transparentValue ? getComputedStyleProperty(element, "background-color") : backgroundColor
};
}
function TextColorEdit({
value,
onChange,
isActive,
activeAttributes,
contentRef
}) {
const [allowCustomControl, colors = EMPTY_ARRAY] = (0,external_wp_blockEditor_namespaceObject.useSettings)(
"color.custom",
"color.palette"
);
const [isAddingColor, setIsAddingColor] = (0,external_wp_element_namespaceObject.useState)(false);
const colorIndicatorStyle = (0,external_wp_element_namespaceObject.useMemo)(
() => fillComputedColors(
contentRef.current,
getActiveColors(value, text_color_name, colors)
),
[contentRef, value, colors]
);
const hasColorsToChoose = !!colors.length || allowCustomControl;
if (!hasColorsToChoose && !isActive) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextToolbarButton,
{
className: "format-library-text-color-button",
isActive,
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
icon_default,
{
icon: Object.keys(activeAttributes).length ? text_color_default : color_default,
style: colorIndicatorStyle
}
),
title: text_color_title,
onClick: hasColorsToChoose ? () => setIsAddingColor(true) : () => onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, text_color_name)),
role: "menuitemcheckbox"
}
),
isAddingColor && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
InlineColorUI,
{
name: text_color_name,
onClose: () => setIsAddingColor(false),
activeAttributes,
value,
onChange,
contentRef,
isActive
}
)
] });
}
const textColor = {
name: text_color_name,
title: text_color_title,
tagName: "mark",
className: "has-inline-color",
attributes: {
style: "style",
class: "class"
},
edit: TextColorEdit
};
;// ./node_modules/@wordpress/icons/build-module/library/subscript.js
var subscript_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z" }) });
;// ./node_modules/@wordpress/format-library/build-module/subscript/index.js
const subscript_name = "core/subscript";
const subscript_title = (0,external_wp_i18n_namespaceObject.__)("Subscript");
const subscript = {
name: subscript_name,
title: subscript_title,
tagName: "sub",
className: null,
edit({ isActive, value, onChange, onFocus }) {
function onToggle() {
onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: subscript_name, title: subscript_title }));
}
function onClick() {
onToggle();
onFocus();
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextToolbarButton,
{
icon: subscript_default,
title: subscript_title,
onClick,
isActive,
role: "menuitemcheckbox"
}
);
}
};
;// ./node_modules/@wordpress/icons/build-module/library/superscript.js
var superscript_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z" }) });
;// ./node_modules/@wordpress/format-library/build-module/superscript/index.js
const superscript_name = "core/superscript";
const superscript_title = (0,external_wp_i18n_namespaceObject.__)("Superscript");
const superscript = {
name: superscript_name,
title: superscript_title,
tagName: "sup",
className: null,
edit({ isActive, value, onChange, onFocus }) {
function onToggle() {
onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: superscript_name, title: superscript_title }));
}
function onClick() {
onToggle();
onFocus();
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextToolbarButton,
{
icon: superscript_default,
title: superscript_title,
onClick,
isActive,
role: "menuitemcheckbox"
}
);
}
};
;// ./node_modules/@wordpress/icons/build-module/library/button.js
var button_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z" }) });
;// ./node_modules/@wordpress/format-library/build-module/keyboard/index.js
const keyboard_name = "core/keyboard";
const keyboard_title = (0,external_wp_i18n_namespaceObject.__)("Keyboard input");
const keyboard = {
name: keyboard_name,
title: keyboard_title,
tagName: "kbd",
className: null,
edit({ isActive, value, onChange, onFocus }) {
function onToggle() {
onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: keyboard_name, title: keyboard_title }));
}
function onClick() {
onToggle();
onFocus();
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextToolbarButton,
{
icon: button_default,
title: keyboard_title,
onClick,
isActive,
role: "menuitemcheckbox"
}
);
}
};
;// ./node_modules/@wordpress/icons/build-module/library/help.js
var help_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 4a8 8 0 1 1 .001 16.001A8 8 0 0 1 12 4Zm0 1.5a6.5 6.5 0 1 0-.001 13.001A6.5 6.5 0 0 0 12 5.5Zm.75 11h-1.5V15h1.5v1.5Zm-.445-9.234a3 3 0 0 1 .445 5.89V14h-1.5v-1.25c0-.57.452-.958.917-1.01A1.5 1.5 0 0 0 12 8.75a1.5 1.5 0 0 0-1.5 1.5H9a3 3 0 0 1 3.305-2.984Z" }) });
;// ./node_modules/@wordpress/format-library/build-module/unknown/index.js
const unknown_name = "core/unknown";
const unknown_title = (0,external_wp_i18n_namespaceObject.__)("Clear Unknown Formatting");
function selectionContainsUnknownFormats(value) {
if ((0,external_wp_richText_namespaceObject.isCollapsed)(value)) {
return false;
}
const selectedValue = (0,external_wp_richText_namespaceObject.slice)(value);
return selectedValue.formats.some((formats) => {
return formats.some((format) => format.type === unknown_name);
});
}
const unknown = {
name: unknown_name,
title: unknown_title,
tagName: "*",
className: null,
edit({ isActive, value, onChange, onFocus }) {
if (!isActive && !selectionContainsUnknownFormats(value)) {
return null;
}
function onClick() {
onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, unknown_name));
onFocus();
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextToolbarButton,
{
name: "unknown",
icon: help_default,
title: unknown_title,
onClick,
isActive: true
}
);
}
};
;// ./node_modules/@wordpress/icons/build-module/library/language.js
var language_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.5 10h-1.7l-3.7 10.5h1.7l.9-2.6h3.9l.9 2.6h1.7L17.5 10zm-2.2 6.3 1.4-4 1.4 4h-2.8zm-4.8-3.8c1.6-1.8 2.9-3.6 3.7-5.7H16V5.2h-5.8V3H8.8v2.2H3v1.5h9.6c-.7 1.6-1.8 3.1-3.1 4.6C8.6 10.2 7.8 9 7.2 8H5.6c.6 1.4 1.7 2.9 2.9 4.4l-2.4 2.4c-.3.4-.7.8-1.1 1.2l1 1 1.2-1.2c.8-.8 1.6-1.5 2.3-2.3.8.9 1.7 1.7 2.5 2.5l.6-1.5c-.7-.6-1.4-1.3-2.1-2z" }) });
;// ./node_modules/@wordpress/format-library/build-module/language/index.js
const language_name = "core/language";
const language_title = (0,external_wp_i18n_namespaceObject.__)("Language");
const language = {
name: language_name,
tagName: "bdo",
className: null,
edit: language_Edit,
title: language_title
};
function language_Edit({ isActive, value, onChange, contentRef }) {
const [isPopoverVisible, setIsPopoverVisible] = (0,external_wp_element_namespaceObject.useState)(false);
const togglePopover = () => {
setIsPopoverVisible((state) => !state);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextToolbarButton,
{
icon: language_default,
label: language_title,
title: language_title,
onClick: () => {
if (isActive) {
onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, language_name));
} else {
togglePopover();
}
},
isActive,
role: "menuitemcheckbox"
}
),
isPopoverVisible && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
InlineLanguageUI,
{
value,
onChange,
onClose: togglePopover,
contentRef
}
)
] });
}
function InlineLanguageUI({ value, contentRef, onChange, onClose }) {
const popoverAnchor = (0,external_wp_richText_namespaceObject.useAnchor)({
editableContentElement: contentRef.current,
settings: language
});
const [lang, setLang] = (0,external_wp_element_namespaceObject.useState)("");
const [dir, setDir] = (0,external_wp_element_namespaceObject.useState)("ltr");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Popover,
{
className: "block-editor-format-toolbar__language-popover",
anchor: popoverAnchor,
onClose,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
as: "form",
spacing: 4,
className: "block-editor-format-toolbar__language-container-content",
onSubmit: (event) => {
event.preventDefault();
onChange(
(0,external_wp_richText_namespaceObject.applyFormat)(value, {
type: language_name,
attributes: {
lang,
dir
}
})
);
onClose();
},
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: language_title,
value: lang,
onChange: (val) => setLang(val),
help: (0,external_wp_i18n_namespaceObject.__)(
'A valid language attribute, like "en" or "fr".'
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SelectControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Text direction"),
value: dir,
options: [
{
label: (0,external_wp_i18n_namespaceObject.__)("Left to right"),
value: "ltr"
},
{
label: (0,external_wp_i18n_namespaceObject.__)("Right to left"),
value: "rtl"
}
],
onChange: (val) => setDir(val)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "right", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "primary",
type: "submit",
text: (0,external_wp_i18n_namespaceObject.__)("Apply")
}
) })
]
}
)
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/math.js
var math_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11.2 6.8c-.7 0-1.4.5-1.6 1.1l-2.8 7.5-1.2-1.8c-.1-.2-.4-.3-.6-.3H3v1.5h1.6l1.2 1.8c.6.9 1.9.7 2.2-.3l2.9-7.9s.1-.2.2-.2h7.8V6.7h-7.8Zm5.3 3.4-1.9 1.9-1.9-1.9-1.1 1.1 1.9 1.9-1.9 1.9 1.1 1.1 1.9-1.9 1.9 1.9 1.1-1.1-1.9-1.9 1.9-1.9-1.1-1.1Z" }) });
;// ./node_modules/@wordpress/format-library/build-module/math/index.js
const { Badge } = unlock(external_wp_components_namespaceObject.privateApis);
const math_name = "core/math";
const math_title = (0,external_wp_i18n_namespaceObject.__)("Math");
function math_InlineUI({
value,
onChange,
activeAttributes,
contentRef,
latexToMathML
}) {
const [latex, setLatex] = (0,external_wp_element_namespaceObject.useState)(
activeAttributes?.["data-latex"] || ""
);
const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null);
const popoverAnchor = (0,external_wp_richText_namespaceObject.useAnchor)({
editableContentElement: contentRef.current,
settings: math
});
const handleLatexChange = (newLatex) => {
let mathML = "";
setLatex(newLatex);
if (newLatex) {
try {
mathML = latexToMathML(newLatex, { displayMode: false });
setError(null);
} catch (err) {
setError(err.message);
(0,external_wp_a11y_namespaceObject.speak)(err.message);
return;
}
}
const newReplacements = value.replacements.slice();
newReplacements[value.start] = {
type: math_name,
attributes: {
"data-latex": newLatex
},
innerHTML: mathML
};
onChange({
...value,
replacements: newReplacements
});
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Popover,
{
placement: "bottom-start",
offset: 8,
focusOnMount: false,
anchor: popoverAnchor,
className: "block-editor-format-toolbar__math-popover",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { style: { minWidth: "300px", padding: "4px" }, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 1, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
hideLabelFromVision: true,
label: (0,external_wp_i18n_namespaceObject.__)("LaTeX math syntax"),
value: latex,
onChange: handleLatexChange,
placeholder: (0,external_wp_i18n_namespaceObject.__)("e.g., x^2, \\frac{a}{b}"),
autoComplete: "off",
className: "block-editor-format-toolbar__math-input"
}
),
error && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Badge,
{
intent: "error",
className: "wp-block-math__error",
children: error
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("style", { children: ".wp-block-math__error .components-badge__content{white-space:normal}" })
] })
] }) })
}
);
}
function math_Edit({
value,
onChange,
onFocus,
isObjectActive,
activeObjectAttributes,
contentRef
}) {
const [latexToMathML, setLatexToMathML] = (0,external_wp_element_namespaceObject.useState)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 3533, 23)).then((module) => {
setLatexToMathML(() => module.default);
});
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextToolbarButton,
{
icon: math_default,
title: math_title,
onClick: () => {
const newValue = (0,external_wp_richText_namespaceObject.insertObject)(value, {
type: math_name,
attributes: {
"data-latex": ""
},
innerHTML: ""
});
newValue.start = newValue.end - 1;
onChange(newValue);
onFocus();
},
isActive: isObjectActive
}
),
isObjectActive && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
math_InlineUI,
{
value,
onChange,
activeAttributes: activeObjectAttributes,
contentRef,
latexToMathML
}
)
] });
}
const math = {
name: math_name,
title: math_title,
tagName: "math",
className: null,
attributes: {
"data-latex": "data-latex"
},
contentEditable: false,
edit: math_Edit
};
;// ./node_modules/@wordpress/format-library/build-module/non-breaking-space/index.js
const non_breaking_space_name = "core/non-breaking-space";
const non_breaking_space_title = (0,external_wp_i18n_namespaceObject.__)("Non breaking space");
const nonBreakingSpace = {
name: non_breaking_space_name,
title: non_breaking_space_title,
tagName: "nbsp",
className: null,
edit({ value, onChange }) {
function addNonBreakingSpace() {
onChange((0,external_wp_richText_namespaceObject.insert)(value, "\xA0"));
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichTextShortcut,
{
type: "primaryShift",
character: " ",
onUse: addNonBreakingSpace
}
);
}
};
;// ./node_modules/@wordpress/format-library/build-module/default-formats.js
var default_formats_default = [
bold,
code,
image_image,
italic,
link_link,
strikethrough,
underline,
textColor,
subscript,
superscript,
keyboard,
unknown,
language,
math,
nonBreakingSpace
];
;// ./node_modules/@wordpress/format-library/build-module/index.js
default_formats_default.forEach(
({ name, ...settings }) => (0,external_wp_richText_namespaceObject.registerFormatType)(name, settings)
);
(window.wp = window.wp || {}).formatLibrary = __webpack_exports__;
/******/ })()
; data-controls.js 0000644 00000010614 15121363542 0007660 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
__unstableAwaitPromise: () => (/* binding */ __unstableAwaitPromise),
apiFetch: () => (/* binding */ apiFetch),
controls: () => (/* binding */ controls),
dispatch: () => (/* binding */ dispatch),
select: () => (/* binding */ build_module_select),
syncSelect: () => (/* binding */ syncSelect)
});
;// external ["wp","apiFetch"]
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
;// external ["wp","data"]
const external_wp_data_namespaceObject = window["wp"]["data"];
;// external ["wp","deprecated"]
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
;// ./node_modules/@wordpress/data-controls/build-module/index.js
function apiFetch(request) {
return {
type: "API_FETCH",
request
};
}
function build_module_select(storeNameOrDescriptor, selectorName, ...args) {
external_wp_deprecated_default()("`select` control in `@wordpress/data-controls`", {
since: "5.7",
alternative: "built-in `resolveSelect` control in `@wordpress/data`"
});
return external_wp_data_namespaceObject.controls.resolveSelect(
storeNameOrDescriptor,
selectorName,
...args
);
}
function syncSelect(storeNameOrDescriptor, selectorName, ...args) {
external_wp_deprecated_default()("`syncSelect` control in `@wordpress/data-controls`", {
since: "5.7",
alternative: "built-in `select` control in `@wordpress/data`"
});
return external_wp_data_namespaceObject.controls.select(storeNameOrDescriptor, selectorName, ...args);
}
function dispatch(storeNameOrDescriptor, actionName, ...args) {
external_wp_deprecated_default()("`dispatch` control in `@wordpress/data-controls`", {
since: "5.7",
alternative: "built-in `dispatch` control in `@wordpress/data`"
});
return external_wp_data_namespaceObject.controls.dispatch(storeNameOrDescriptor, actionName, ...args);
}
const __unstableAwaitPromise = function(promise) {
return {
type: "AWAIT_PROMISE",
promise
};
};
const controls = {
AWAIT_PROMISE({ promise }) {
return promise;
},
API_FETCH({ request }) {
return external_wp_apiFetch_default()(request);
}
};
(window.wp = window.wp || {}).dataControls = __webpack_exports__;
/******/ })()
; nux.min.js 0000644 00000006673 15121363542 0006514 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={n:i=>{var n=i&&i.__esModule?()=>i.default:()=>i;return e.d(n,{a:n}),n},d:(i,n)=>{for(var t in n)e.o(n,t)&&!e.o(i,t)&&Object.defineProperty(i,t,{enumerable:!0,get:n[t]})},o:(e,i)=>Object.prototype.hasOwnProperty.call(e,i),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},i={};e.r(i),e.d(i,{DotTip:()=>E,store:()=>m});var n={};e.r(n),e.d(n,{disableTips:()=>a,dismissTip:()=>u,enableTips:()=>l,triggerGuide:()=>p});var t={};e.r(t),e.d(t,{areTipsEnabled:()=>T,getAssociatedGuide:()=>w,isTipVisible:()=>f});const s=window.wp.deprecated;var r=e.n(s);const o=window.wp.data;const c=(0,o.combineReducers)({areTipsEnabled:function(e=!0,i){switch(i.type){case"DISABLE_TIPS":return!1;case"ENABLE_TIPS":return!0}return e},dismissedTips:function(e={},i){switch(i.type){case"DISMISS_TIP":return{...e,[i.id]:!0};case"ENABLE_TIPS":return{}}return e}});var d=(0,o.combineReducers)({guides:function(e=[],i){return"TRIGGER_GUIDE"===i.type?[...e,i.tipIds]:e},preferences:c});function p(e){return{type:"TRIGGER_GUIDE",tipIds:e}}function u(e){return{type:"DISMISS_TIP",id:e}}function a(){return{type:"DISABLE_TIPS"}}function l(){return{type:"ENABLE_TIPS"}}const w=(0,o.createSelector)(((e,i)=>{for(const n of e.guides)if(n.includes(i)){const i=n.filter((i=>!Object.keys(e.preferences.dismissedTips).includes(i))),[t=null,s=null]=i;return{tipIds:n,currentTipId:t,nextTipId:s}}return null}),(e=>[e.guides,e.preferences.dismissedTips]));function f(e,i){if(!e.preferences.areTipsEnabled)return!1;if(e.preferences.dismissedTips?.hasOwnProperty(i))return!1;const n=w(e,i);return!n||n.currentTipId===i}function T(e){return e.preferences.areTipsEnabled}const b="core/nux",m=(0,o.createReduxStore)(b,{reducer:d,actions:n,selectors:t,persist:["preferences"]});(0,o.registerStore)(b,{reducer:d,actions:n,selectors:t,persist:["preferences"]});const I=window.ReactJSXRuntime,S=window.wp.compose,_=window.wp.components,x=window.wp.i18n,g=window.wp.element,h=window.wp.primitives;var y=(0,I.jsx)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,I.jsx)(h.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})});function v(e){e.stopPropagation()}var E=(0,S.compose)((0,o.withSelect)(((e,{tipId:i})=>{const{isTipVisible:n,getAssociatedGuide:t}=e(m),s=t(i);return{isVisible:n(i),hasNextTip:!(!s||!s.nextTipId)}})),(0,o.withDispatch)(((e,{tipId:i})=>{const{dismissTip:n,disableTips:t}=e(m);return{onDismiss(){n(i)},onDisable(){t()}}})))((function({position:e="middle right",children:i,isVisible:n,hasNextTip:t,onDismiss:s,onDisable:r}){const o=(0,g.useRef)(null),c=(0,g.useCallback)((e=>{o.current&&(o.current.contains(e.relatedTarget)||r())}),[r,o]);return n?(0,I.jsxs)(_.Popover,{className:"nux-dot-tip",position:e,focusOnMount:!0,role:"dialog","aria-label":(0,x.__)("Editor tips"),onClick:v,onFocusOutside:c,children:[(0,I.jsx)("p",{children:i}),(0,I.jsx)("p",{children:(0,I.jsx)(_.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:s,children:t?(0,x.__)("See next tip"):(0,x.__)("Got it")})}),(0,I.jsx)(_.Button,{size:"small",className:"nux-dot-tip__disable",icon:y,label:(0,x.__)("Disable tips"),onClick:r})]}):null}));r()("wp.nux",{since:"5.4",hint:"wp.components.Guide can be used to show a user guide.",version:"6.2"}),(window.wp=window.wp||{}).nux=i})(); a11y.min.js 0000644 00000004244 15121363542 0006445 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{setup:()=>s,speak:()=>d});const n=window.wp.domReady;var o=e.n(n);function i(e="polite"){const t=document.createElement("div");t.id=`a11y-speak-${e}`,t.className="a11y-speak-region",t.setAttribute("style","position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions text"),t.setAttribute("aria-atomic","true");const{body:n}=document;return n&&n.appendChild(t),t}const a=window.wp.i18n;let r="";function d(e,t){!function(){const e=document.getElementsByClassName("a11y-speak-region"),t=document.getElementById("a11y-speak-intro-text");for(let t=0;t<e.length;t++)e[t].textContent="";t&&t.setAttribute("hidden","hidden")}(),e=function(e){return e=e.replace(/<[^<>]+>/g," "),r===e&&(e+=" "),r=e,e}(e);const n=document.getElementById("a11y-speak-intro-text"),o=document.getElementById("a11y-speak-assertive"),i=document.getElementById("a11y-speak-polite");o&&"assertive"===t?o.textContent=e:i&&(i.textContent=e),n&&n.removeAttribute("hidden")}function s(){const e=document.getElementById("a11y-speak-intro-text"),t=document.getElementById("a11y-speak-assertive"),n=document.getElementById("a11y-speak-polite");null===e&&function(){const e=document.createElement("p");e.id="a11y-speak-intro-text",e.className="a11y-speak-intro-text",e.textContent=(0,a.__)("Notifications"),e.setAttribute("style","position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"),e.setAttribute("hidden","");const{body:t}=document;t&&t.appendChild(e)}(),null===t&&i("assertive"),null===n&&i("polite")}o()(s),(window.wp=window.wp||{}).a11y=t})(); list-reusable-blocks.js 0000644 00000073714 15121363542 0011146 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// ./node_modules/tslib/tslib.es6.mjs
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
}
return __assign.apply(this, arguments);
}
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
}
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
var _, done = false;
for (var i = decorators.length - 1; i >= 0; i--) {
var context = {};
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
if (kind === "accessor") {
if (result === void 0) continue;
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
if (_ = accept(result.get)) descriptor.get = _;
if (_ = accept(result.set)) descriptor.set = _;
if (_ = accept(result.init)) initializers.unshift(_);
}
else if (_ = accept(result)) {
if (kind === "field") initializers.unshift(_);
else descriptor[key] = _;
}
}
if (target) Object.defineProperty(target, contextIn.name, descriptor);
done = true;
};
function __runInitializers(thisArg, initializers, value) {
var useValue = arguments.length > 2;
for (var i = 0; i < initializers.length; i++) {
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
}
return useValue ? value : void 0;
};
function __propKey(x) {
return typeof x === "symbol" ? x : "".concat(x);
};
function __setFunctionName(f, name, prefix) {
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
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;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
var __createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
});
function __exportStar(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
}
/** @deprecated */
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
/** @deprecated */
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}
function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}
function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
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);
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); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}
function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __setModuleDefault = Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
};
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
}
function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
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");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
function __classPrivateFieldSet(receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
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");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}
function __classPrivateFieldIn(state, receiver) {
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
return typeof state === "function" ? receiver === state : state.has(receiver);
}
function __addDisposableResource(env, value, async) {
if (value !== null && value !== void 0) {
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
var dispose, inner;
if (async) {
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
dispose = value[Symbol.asyncDispose];
}
if (dispose === void 0) {
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
dispose = value[Symbol.dispose];
if (async) inner = dispose;
}
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
env.stack.push({ value: value, dispose: dispose, async: async });
}
else if (async) {
env.stack.push({ async: true });
}
return value;
}
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
function __disposeResources(env) {
function fail(e) {
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
env.hasError = true;
}
var r, s = 0;
function next() {
while (r = env.stack.pop()) {
try {
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
if (r.dispose) {
var result = r.dispose.call(r.value);
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
}
else s |= 1;
}
catch (e) {
fail(e);
}
}
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
if (env.hasError) throw env.error;
}
return next();
}
function __rewriteRelativeImportExtension(path, preserveJsx) {
if (typeof path === "string" && /^\.\.?\//.test(path)) {
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
});
}
return path;
}
/* harmony default export */ const tslib_es6 = ({
__extends,
__assign,
__rest,
__decorate,
__param,
__esDecorate,
__runInitializers,
__propKey,
__setFunctionName,
__metadata,
__awaiter,
__generator,
__createBinding,
__exportStar,
__values,
__read,
__spread,
__spreadArrays,
__spreadArray,
__await,
__asyncGenerator,
__asyncDelegator,
__asyncValues,
__makeTemplateObject,
__importStar,
__importDefault,
__classPrivateFieldGet,
__classPrivateFieldSet,
__classPrivateFieldIn,
__addDisposableResource,
__disposeResources,
__rewriteRelativeImportExtension,
});
;// ./node_modules/lower-case/dist.es2015/index.js
/**
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
*/
var SUPPORTED_LOCALE = {
tr: {
regexp: /\u0130|\u0049|\u0049\u0307/g,
map: {
İ: "\u0069",
I: "\u0131",
İ: "\u0069",
},
},
az: {
regexp: /\u0130/g,
map: {
İ: "\u0069",
I: "\u0131",
İ: "\u0069",
},
},
lt: {
regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
map: {
I: "\u0069\u0307",
J: "\u006A\u0307",
Į: "\u012F\u0307",
Ì: "\u0069\u0307\u0300",
Í: "\u0069\u0307\u0301",
Ĩ: "\u0069\u0307\u0303",
},
},
};
/**
* Localized lower case.
*/
function localeLowerCase(str, locale) {
var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
if (lang)
return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
return lowerCase(str);
}
/**
* Lower case as a function.
*/
function lowerCase(str) {
return str.toLowerCase();
}
;// ./node_modules/no-case/dist.es2015/index.js
// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
// Remove all non-word characters.
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
/**
* Normalize the string into something other libraries can manipulate easier.
*/
function noCase(input, options) {
if (options === void 0) { options = {}; }
var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
var start = 0;
var end = result.length;
// Trim the delimiter from around the output string.
while (result.charAt(start) === "\0")
start++;
while (result.charAt(end - 1) === "\0")
end--;
// Transform each token independently.
return result.slice(start, end).split("\0").map(transform).join(delimiter);
}
/**
* Replace `re` in the input string with the replacement value.
*/
function replace(input, re, value) {
if (re instanceof RegExp)
return input.replace(re, value);
return re.reduce(function (input, re) { return input.replace(re, value); }, input);
}
;// ./node_modules/dot-case/dist.es2015/index.js
function dotCase(input, options) {
if (options === void 0) { options = {}; }
return noCase(input, __assign({ delimiter: "." }, options));
}
;// ./node_modules/param-case/dist.es2015/index.js
function paramCase(input, options) {
if (options === void 0) { options = {}; }
return dotCase(input, __assign({ delimiter: "-" }, options));
}
;// external ["wp","apiFetch"]
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
;// external ["wp","blob"]
const external_wp_blob_namespaceObject = window["wp"]["blob"];
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/export.js
async function exportReusableBlock(id) {
const postType = await external_wp_apiFetch_default()({ path: `/wp/v2/types/wp_block` });
const post = await external_wp_apiFetch_default()({
path: `/wp/v2/${postType.rest_base}/${id}?context=edit`
});
const title = post.title.raw;
const content = post.content.raw;
const syncStatus = post.wp_pattern_sync_status;
const fileContent = JSON.stringify(
{
__file: "wp_block",
title,
content,
syncStatus
},
null,
2
);
const fileName = paramCase(title) + ".json";
(0,external_wp_blob_namespaceObject.downloadBlob)(fileName, fileContent, "application/json");
}
var export_default = exportReusableBlock;
;// external ["wp","compose"]
const external_wp_compose_namespaceObject = window["wp"]["compose"];
;// external ["wp","components"]
const external_wp_components_namespaceObject = window["wp"]["components"];
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/file.js
function readTextFile(file) {
const reader = new window.FileReader();
return new Promise((resolve) => {
reader.onload = () => {
resolve(reader.result);
};
reader.readAsText(file);
});
}
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/import.js
async function importReusableBlock(file) {
const fileContent = await readTextFile(file);
let parsedContent;
try {
parsedContent = JSON.parse(fileContent);
} catch (e) {
throw new Error("Invalid JSON file");
}
if (parsedContent.__file !== "wp_block" || !parsedContent.title || !parsedContent.content || typeof parsedContent.title !== "string" || typeof parsedContent.content !== "string" || parsedContent.syncStatus && typeof parsedContent.syncStatus !== "string") {
throw new Error("Invalid pattern JSON file");
}
const postType = await external_wp_apiFetch_default()({ path: `/wp/v2/types/wp_block` });
const reusableBlock = await external_wp_apiFetch_default()({
path: `/wp/v2/${postType.rest_base}`,
data: {
title: parsedContent.title,
content: parsedContent.content,
status: "publish",
meta: parsedContent.syncStatus === "unsynced" ? { wp_pattern_sync_status: parsedContent.syncStatus } : void 0
},
method: "POST"
});
return reusableBlock;
}
var import_default = importReusableBlock;
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-form/index.js
function ImportForm({ instanceId, onUpload }) {
const inputId = "list-reusable-blocks-import-form-" + instanceId;
const formRef = (0,external_wp_element_namespaceObject.useRef)();
const [isLoading, setIsLoading] = (0,external_wp_element_namespaceObject.useState)(false);
const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null);
const [file, setFile] = (0,external_wp_element_namespaceObject.useState)(null);
const onChangeFile = (event) => {
setFile(event.target.files[0]);
setError(null);
};
const onSubmit = (event) => {
event.preventDefault();
if (!file) {
return;
}
setIsLoading({ isLoading: true });
import_default(file).then((reusableBlock) => {
if (!formRef) {
return;
}
setIsLoading(false);
onUpload(reusableBlock);
}).catch((errors) => {
if (!formRef) {
return;
}
let uiMessage;
switch (errors.message) {
case "Invalid JSON file":
uiMessage = (0,external_wp_i18n_namespaceObject.__)("Invalid JSON file");
break;
case "Invalid pattern JSON file":
uiMessage = (0,external_wp_i18n_namespaceObject.__)("Invalid pattern JSON file");
break;
default:
uiMessage = (0,external_wp_i18n_namespaceObject.__)("Unknown error");
}
setIsLoading(false);
setError(uiMessage);
});
};
const onDismissError = () => {
setError(null);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"form",
{
className: "list-reusable-blocks-import-form",
onSubmit,
ref: formRef,
children: [
error && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "error", onRemove: () => onDismissError(), children: error }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"label",
{
htmlFor: inputId,
className: "list-reusable-blocks-import-form__label",
children: (0,external_wp_i18n_namespaceObject.__)("File")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { id: inputId, type: "file", onChange: onChangeFile }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
type: "submit",
isBusy: isLoading,
accessibleWhenDisabled: true,
disabled: !file || isLoading,
variant: "secondary",
className: "list-reusable-blocks-import-form__button",
children: (0,external_wp_i18n_namespaceObject._x)("Import", "button label")
}
)
]
}
);
}
var import_form_default = (0,external_wp_compose_namespaceObject.withInstanceId)(ImportForm);
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-dropdown/index.js
function ImportDropdown({ onUpload }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
popoverProps: { placement: "bottom-start" },
contentClassName: "list-reusable-blocks-import-dropdown__content",
renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "compact",
className: "list-reusable-blocks-import-dropdown__button",
"aria-expanded": isOpen,
onClick: onToggle,
variant: "primary",
children: (0,external_wp_i18n_namespaceObject.__)("Import from JSON")
}
),
renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(import_form_default, { onUpload: (0,external_wp_compose_namespaceObject.pipe)(onClose, onUpload) })
}
);
}
var import_dropdown_default = ImportDropdown;
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/index.js
document.body.addEventListener("click", (event) => {
if (!event.target.classList.contains("wp-list-reusable-blocks__export")) {
return;
}
event.preventDefault();
export_default(event.target.dataset.id);
});
document.addEventListener("DOMContentLoaded", () => {
const button = document.querySelector(".page-title-action");
if (!button) {
return;
}
const showNotice = () => {
const notice = document.createElement("div");
notice.className = "notice notice-success is-dismissible";
notice.innerHTML = `<p>${(0,external_wp_i18n_namespaceObject.__)("Pattern imported successfully!")}</p>`;
const headerEnd = document.querySelector(".wp-header-end");
if (!headerEnd) {
return;
}
headerEnd.parentNode.insertBefore(notice, headerEnd);
};
const container = document.createElement("div");
container.className = "list-reusable-blocks__container";
button.parentNode.insertBefore(container, button);
(0,external_wp_element_namespaceObject.createRoot)(container).render(
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(import_dropdown_default, { onUpload: showNotice }) })
);
});
(window.wp = window.wp || {}).listReusableBlocks = __webpack_exports__;
/******/ })()
; rich-text.min.js 0000644 00000110661 15121363543 0007603 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{RichTextData:()=>j,__experimentalRichText:()=>yt,__unstableCreateElement:()=>v,__unstableToDom:()=>xe,__unstableUseRichText:()=>bt,applyFormat:()=>g,concat:()=>Y,create:()=>V,getActiveFormat:()=>G,getActiveFormats:()=>x,getActiveObject:()=>Z,getTextContent:()=>H,insert:()=>oe,insertObject:()=>ie,isCollapsed:()=>J,isEmpty:()=>Q,join:()=>ee,registerFormatType:()=>te,remove:()=>ae,removeFormat:()=>ne,replace:()=>se,slice:()=>ce,split:()=>ue,store:()=>f,toHTMLString:()=>_,toggleFormat:()=>Ce,unregisterFormatType:()=>_e,useAnchor:()=>Me,useAnchorRef:()=>Oe});var n={};e.r(n),e.d(n,{getFormatType:()=>i,getFormatTypeForBareElement:()=>c,getFormatTypeForClassName:()=>u,getFormatTypes:()=>s});var r={};e.r(r),e.d(r,{addFormatTypes:()=>l,removeFormatTypes:()=>d});const o=window.wp.data;var a=(0,o.combineReducers)({formatTypes:function(e={},t){switch(t.type){case"ADD_FORMAT_TYPES":return{...e,...t.formatTypes.reduce(((e,t)=>({...e,[t.name]:t})),{})};case"REMOVE_FORMAT_TYPES":return Object.fromEntries(Object.entries(e).filter((([e])=>!t.names.includes(e))))}return e}});const s=(0,o.createSelector)((e=>Object.values(e.formatTypes)),(e=>[e.formatTypes]));function i(e,t){return e.formatTypes[t]}function c(e,t){const n=s(e);return n.find((({className:e,tagName:n})=>null===e&&t===n))||n.find((({className:e,tagName:t})=>null===e&&"*"===t))}function u(e,t){return s(e).find((({className:e})=>null!==e&&` ${t} `.indexOf(` ${e} `)>=0))}function l(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function d(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}const f=(0,o.createReduxStore)("core/rich-text",{reducer:a,selectors:n,actions:r});function m(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.type!==t.type)return!1;const n=e.attributes,r=t.attributes;if(n===r)return!0;if(!n||!r)return!1;const o=Object.keys(n),a=Object.keys(r);if(o.length!==a.length)return!1;const s=o.length;for(let e=0;e<s;e++){const t=o[e];if(n[t]!==r[t])return!1}return!0}function p(e){const t=e.formats.slice();return t.forEach(((e,n)=>{const r=t[n-1];if(r){const o=e.slice();o.forEach(((e,t)=>{const n=r[t];m(e,n)&&(o[t]=n)})),t[n]=o}})),{...e,formats:t}}function h(e,t,n){return(e=e.slice())[t]=n,e}function g(e,t,n=e.start,r=e.end){const{formats:o,activeFormats:a}=e,s=o.slice();if(n===r){const e=s[n]?.find((({type:e})=>e===t.type));if(e){const o=s[n].indexOf(e);for(;s[n]&&s[n][o]===e;)s[n]=h(s[n],o,t),n--;for(r++;s[r]&&s[r][o]===e;)s[r]=h(s[r],o,t),r++}}else{let e=1/0;for(let o=n;o<r;o++)if(s[o]){s[o]=s[o].filter((({type:e})=>e!==t.type));const n=s[o].length;n<e&&(e=n)}else s[o]=[],e=0;for(let o=n;o<r;o++)s[o].splice(e,0,t)}return p({...e,formats:s,activeFormats:[...a?.filter((({type:e})=>e!==t.type))||[],t]})}function v({implementation:e},t){return v.body||(v.body=e.createHTMLDocument("").body),v.body.innerHTML=t,v.body}(0,o.register)(f);const b="",y="\ufeff",E=window.wp.escapeHtml;function x(e,t=[]){const{formats:n,start:r,end:o,activeFormats:a}=e;if(void 0===r)return t;if(r===o){if(a)return a;const e=n[r-1]||t,o=n[r]||t;return e.length<o.length?e:o}if(!n[r])return t;const s=n.slice(r,o),i=[...s[0]];let c=s.length;for(;c--;){const e=s[c];if(!e)return t;let n=i.length;for(;n--;){const t=i[n];e.find((e=>m(t,e)))||i.splice(n,1)}if(0===i.length)return t}return i||t}function T(e){return(0,o.select)(f).getFormatType(e)}function w(e,t){if(t)return e;const n={};for(const t in e){let r=t;t.startsWith("data-disable-rich-text-")&&(r=t.slice(23)),n[r]=e[t]}return n}function N({type:e,tagName:t,attributes:n,unregisteredAttributes:r,object:o,boundaryClass:a,isEditableTree:s}){const i=T(e);let c={};if(a&&s&&(c["data-rich-text-format-boundary"]="true"),!i)return n&&(c={...n,...c}),{type:e,attributes:w(c,s),object:o};c={...r,...c};for(const e in n){const t=!!i.attributes&&i.attributes[e];t?c[t]=n[e]:c[e]=n[e]}return i.className&&(c.class?c.class=`${i.className} ${c.class}`:c.class=i.className),{type:t||i.tagName,object:i.object,attributes:w(c,s)}}function L(e,t,n){do{if(e[n]!==t[n])return!1}while(n--);return!0}function C({value:e,preserveWhiteSpace:t,createEmpty:n,append:r,getLastChild:o,getParent:a,isText:s,getText:i,remove:c,appendText:u,onStartIndex:l,onEndIndex:d,isEditableTree:f,placeholder:m}){const{formats:p,replacements:h,text:g,start:v,end:E}=e,w=p.length+1,C=n(),_=x(e),S=_[_.length-1];let A,F;r(C,"");for(let e=0;e<w;e++){const n=g.charAt(e),x=f&&(!F||"\n"===F),w=p[e];let _=o(C);if(w&&w.forEach(((e,t)=>{if(_&&A&&L(w,A,t))return void(_=o(_));const{type:n,tagName:u,attributes:l,unregisteredAttributes:d}=e,m=f&&e===S,p=a(_),h=r(p,N({type:n,tagName:u,attributes:l,unregisteredAttributes:d,boundaryClass:m,isEditableTree:f}));s(_)&&0===i(_).length&&c(_),_=r(h,"")})),0===e&&(l&&0===v&&l(C,_),d&&0===E&&d(C,_)),n===b){const t=h[e];if(!t)continue;const{type:n,attributes:o,innerHTML:s}=t,i=T(n);if(f&&"#comment"===n)_=r(a(_),{type:"span",attributes:{contenteditable:"false","data-rich-text-comment":o["data-rich-text-comment"]}}),r(r(_,{type:"span"}),o["data-rich-text-comment"].trim());else if(f||"script"!==n)if(!1===i?.contentEditable){if(s||f){if(_=a(_),f){const t={contenteditable:"false","data-rich-text-bogus":!0};v===e&&E===e+1&&(t["data-rich-text-format-boundary"]=!0),_=r(_,{type:"span",attributes:t}),f&&e+1===g.length&&r(a(_),y)}_=r(_,N({...t,isEditableTree:f})),s&&r(_,{html:s})}}else _=r(a(_),N({...t,object:!0,isEditableTree:f}));else _=r(a(_),N({type:"script",isEditableTree:f})),r(_,{html:decodeURIComponent(o["data-rich-text-script"])});_=r(a(_),"")}else t||"\n"!==n?s(_)?u(_,n):_=r(a(_),n):(_=r(a(_),{type:"br",attributes:f?{"data-rich-text-line-break":"true"}:void 0,object:!0}),_=r(a(_),""));l&&v===e+1&&l(C,_),d&&E===e+1&&d(C,_),x&&e===g.length&&(r(a(_),y),m&&0===g.length&&r(a(_),{type:"span",attributes:{"data-rich-text-placeholder":m,style:"pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;"}})),A=w,F=n}return C}function _({value:e,preserveWhiteSpace:t}){return k(C({value:e,preserveWhiteSpace:t,createEmpty:S,append:F,getLastChild:A,getParent:D,isText:R,getText:M,remove:$,appendText:O}).children)}function S(){return{}}function A({children:e}){return e&&e[e.length-1]}function F(e,t){return"string"==typeof t&&(t={text:t}),t.parent=e,e.children=e.children||[],e.children.push(t),t}function O(e,t){e.text+=t}function D({parent:e}){return e}function R({text:e}){return"string"==typeof e}function M({text:e}){return e}function $(e){const t=e.parent.children.indexOf(e);return-1!==t&&e.parent.children.splice(t,1),e}function k(e=[]){return e.map((e=>void 0!==e.html?e.html:void 0===e.text?function({type:e,attributes:t,object:n,children:r}){if("#comment"===e)return`\x3c!--${t["data-rich-text-comment"]}--\x3e`;let o="";for(const e in t)(0,E.isValidAttributeName)(e)&&(o+=` ${e}="${(0,E.escapeAttribute)(t[e])}"`);return n?`<${e}${o}>`:`<${e}${o}>${k(r)}</${e}>`}(e):(0,E.escapeEditableHTML)(e.text))).join("")}function H({text:e}){return e.replace(b,"")}function P({tagName:e,attributes:t}){let n;if(t&&t.class&&(n=(0,o.select)(f).getFormatTypeForClassName(t.class),n&&(t.class=` ${t.class} `.replace(` ${n.className} `," ").trim(),t.class||delete t.class)),n||(n=(0,o.select)(f).getFormatTypeForBareElement(e)),!n)return t?{type:e,attributes:t}:{type:e};if(n.__experimentalCreatePrepareEditableTree&&!n.__experimentalCreateOnChangeEditableValue)return null;if(!t)return{formatType:n,type:n.name,tagName:e};const r={},a={},s={...t};for(const e in n.attributes){const t=n.attributes[e];r[e]=s[t],delete s[t],void 0===r[e]&&delete r[e]}for(const e in s)a[e]=t[e];return!1===n.contentEditable&&delete a.contenteditable,{formatType:n,type:n.name,tagName:e,attributes:r,unregisteredAttributes:a}}class j{#e;static empty(){return new j}static fromPlainText(e){return new j(V({text:e}))}static fromHTMLString(e){return new j(V({html:e}))}static fromHTMLElement(e,t={}){const{preserveWhiteSpace:n=!1}=t,r=n?e:z(e),o=new j(V({element:r}));return Object.defineProperty(o,"originalHTML",{value:e.innerHTML}),o}constructor(e={formats:[],replacements:[],text:""}){this.#e=e}toPlainText(){return H(this.#e)}toHTMLString({preserveWhiteSpace:e}={}){return this.originalHTML||_({value:this.#e,preserveWhiteSpace:e})}valueOf(){return this.toHTMLString()}toString(){return this.toHTMLString()}toJSON(){return this.toHTMLString()}get length(){return this.text.length}get formats(){return this.#e.formats}get replacements(){return this.#e.replacements}get text(){return this.#e.text}}for(const e of Object.getOwnPropertyNames(String.prototype))j.prototype.hasOwnProperty(e)||Object.defineProperty(j.prototype,e,{value(...t){return this.toHTMLString()[e](...t)}});function V({element:e,text:t,html:n,range:r,__unstableIsEditableTree:o}={}){return n instanceof j?{text:n.text,formats:n.formats,replacements:n.replacements}:"string"==typeof t&&t.length>0?{formats:Array(t.length),replacements:Array(t.length),text:t}:("string"==typeof n&&n.length>0&&(e=v(document,n)),"object"!=typeof e?{formats:[],replacements:[],text:""}:q({element:e,range:r,isEditableTree:o}))}function I(e,t,n,r){if(!n)return;const{parentNode:o}=t,{startContainer:a,startOffset:s,endContainer:i,endOffset:c}=n,u=e.text.length;void 0!==r.start?e.start=u+r.start:t===a&&t.nodeType===t.TEXT_NODE?e.start=u+s:o===a&&t===a.childNodes[s]?e.start=u:o===a&&t===a.childNodes[s-1]?e.start=u+r.text.length:t===a&&(e.start=u),void 0!==r.end?e.end=u+r.end:t===i&&t.nodeType===t.TEXT_NODE?e.end=u+c:o===i&&t===i.childNodes[c-1]?e.end=u+r.text.length:o===i&&t===i.childNodes[c]?e.end=u:t===i&&(e.end=u+c)}function W(e,t,n){if(!t)return;const{startContainer:r,endContainer:o}=t;let{startOffset:a,endOffset:s}=t;return e===r&&(a=n(e.nodeValue.slice(0,a)).length),e===o&&(s=n(e.nodeValue.slice(0,s)).length),{startContainer:r,startOffset:a,endContainer:o,endOffset:s}}function z(e,t=!0){const n=e.cloneNode(!0);return n.normalize(),Array.from(n.childNodes).forEach(((e,n,r)=>{if(e.nodeType===e.TEXT_NODE){let o=e.nodeValue;/[\n\t\r\f]/.test(o)&&(o=o.replace(/[\n\t\r\f]+/g," ")),-1!==o.indexOf(" ")&&(o=o.replace(/ {2,}/g," ")),0===n&&o.startsWith(" ")?o=o.slice(1):t&&n===r.length-1&&o.endsWith(" ")&&(o=o.slice(0,-1)),e.nodeValue=o}else e.nodeType===e.ELEMENT_NODE&&e.replaceWith(z(e,!1))})),n}const B="\r";function X(e){return e.replace(new RegExp(`[${y}${b}${B}]`,"gu"),"")}function q({element:e,range:t,isEditableTree:n}){const r={formats:[],replacements:[],text:""};if(!e)return r;if(!e.hasChildNodes())return I(r,e,t,{formats:[],replacements:[],text:""}),r;const o=e.childNodes.length;for(let a=0;a<o;a++){const o=e.childNodes[a],s=o.nodeName.toLowerCase();if(o.nodeType===o.TEXT_NODE){const e=X(o.nodeValue);I(r,o,t=W(o,t,X),{text:e}),r.formats.length+=e.length,r.replacements.length+=e.length,r.text+=e;continue}if(o.nodeType===o.COMMENT_NODE||o.nodeType===o.ELEMENT_NODE&&"SPAN"===o.tagName&&o.hasAttribute("data-rich-text-comment")){const e={formats:[,],replacements:[{type:"#comment",attributes:{"data-rich-text-comment":o.nodeType===o.COMMENT_NODE?o.nodeValue:o.getAttribute("data-rich-text-comment")}}],text:b};I(r,o,t,e),U(r,e);continue}if(o.nodeType!==o.ELEMENT_NODE)continue;if(n&&"br"===s&&!o.getAttribute("data-rich-text-line-break")){I(r,o,t,{formats:[],replacements:[],text:""});continue}if("script"===s){const e={formats:[,],replacements:[{type:s,attributes:{"data-rich-text-script":o.getAttribute("data-rich-text-script")||encodeURIComponent(o.innerHTML)}}],text:b};I(r,o,t,e),U(r,e);continue}if("br"===s){I(r,o,t,{formats:[],replacements:[],text:""}),U(r,V({text:"\n"}));continue}const i=P({tagName:s,attributes:K({element:o})});if(!1===i?.formatType?.contentEditable){delete i.formatType,I(r,o,t,{formats:[],replacements:[],text:""}),U(r,{formats:[,],replacements:[{...i,innerHTML:o.innerHTML}],text:b});continue}i&&delete i.formatType;const c=q({element:o,range:t,isEditableTree:n});if(I(r,o,t,c),!i||o.getAttribute("data-rich-text-placeholder")||o.getAttribute("data-rich-text-bogus"))U(r,c);else if(0===c.text.length)i.attributes&&U(r,{formats:[,],replacements:[i],text:b});else{let e=function(t){if(e.formats===t)return e.newFormats;const n=t?[i,...t]:[i];return e.formats=t,e.newFormats=n,n};e.newFormats=[i],U(r,{...c,formats:Array.from(c.formats,e)})}}return r}function K({element:e}){if(!e.hasAttributes())return;const t=e.attributes.length;let n;for(let r=0;r<t;r++){const{name:t,value:o}=e.attributes[r];if(0===t.indexOf("data-rich-text-"))continue;n=n||{},n[/^on/i.test(t)?"data-disable-rich-text-"+t:t]=o}return n}function U(e,t){return e.formats=e.formats.concat(t.formats),e.replacements=e.replacements.concat(t.replacements),e.text+=t.text,e}function Y(...e){return p(e.reduce(U,V()))}function G(e,t){return x(e).find((({type:e})=>e===t))}function Z({start:e,end:t,replacements:n,text:r}){if(e+1===t&&r[e]===b)return n[e]}function J({start:e,end:t}){if(void 0!==e&&void 0!==t)return e===t}function Q({text:e}){return 0===e.length}function ee(e,t=""){return"string"==typeof t&&(t=V({text:t})),p(e.reduce(((e,{formats:n,replacements:r,text:o})=>({formats:e.formats.concat(t.formats,n),replacements:e.replacements.concat(t.replacements,r),text:e.text+t.text+o}))))}function te(e,t){if("string"==typeof(t={name:e,...t}).name)if(/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name))if((0,o.select)(f).getFormatType(t.name))window.console.error('Format "'+t.name+'" is already registered.');else if("string"==typeof t.tagName&&""!==t.tagName)if("string"==typeof t.className&&""!==t.className||null===t.className)if(/^[_a-zA-Z]+[a-zA-Z0-9_-]*$/.test(t.className)){if(null===t.className){const e=(0,o.select)(f).getFormatTypeForBareElement(t.tagName);if(e&&"core/unknown"!==e.name)return void window.console.error(`Format "${e.name}" is already registered to handle bare tag name "${t.tagName}".`)}else{const e=(0,o.select)(f).getFormatTypeForClassName(t.className);if(e)return void window.console.error(`Format "${e.name}" is already registered to handle class name "${t.className}".`)}if("title"in t&&""!==t.title)if("keywords"in t&&t.keywords.length>3)window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');else{if("string"==typeof t.title)return(0,o.dispatch)(f).addFormatTypes(t),t;window.console.error("Format titles must be strings.")}else window.console.error('The format "'+t.name+'" must have a title.')}else window.console.error("A class name must begin with a letter, followed by any number of hyphens, underscores, letters, or numbers.");else window.console.error("Format class names must be a string, or null to handle bare elements.");else window.console.error("Format tag names must be a string.");else window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");else window.console.error("Format names must be strings.")}function ne(e,t,n=e.start,r=e.end){const{formats:o,activeFormats:a}=e,s=o.slice();if(n===r){const e=s[n]?.find((({type:e})=>e===t));if(e){for(;s[n]?.find((t=>t===e));)re(s,n,t),n--;for(r++;s[r]?.find((t=>t===e));)re(s,r,t),r++}}else for(let e=n;e<r;e++)s[e]&&re(s,e,t);return p({...e,formats:s,activeFormats:a?.filter((({type:e})=>e!==t))||[]})}function re(e,t,n){const r=e[t].filter((({type:e})=>e!==n));r.length?e[t]=r:delete e[t]}function oe(e,t,n=e.start,r=e.end){const{formats:o,replacements:a,text:s}=e;"string"==typeof t&&(t=V({text:t}));const i=n+t.text.length;return p({formats:o.slice(0,n).concat(t.formats,o.slice(r)),replacements:a.slice(0,n).concat(t.replacements,a.slice(r)),text:s.slice(0,n)+t.text+s.slice(r),start:i,end:i})}function ae(e,t,n){return oe(e,V(),t,n)}function se({formats:e,replacements:t,text:n,start:r,end:o},a,s){return n=n.replace(a,((n,...a)=>{const i=a[a.length-2];let c,u,l=s;return"function"==typeof l&&(l=s(n,...a)),"object"==typeof l?(c=l.formats,u=l.replacements,l=l.text):(c=Array(l.length),u=Array(l.length),e[i]&&(c=c.fill(e[i]))),e=e.slice(0,i).concat(c,e.slice(i+n.length)),t=t.slice(0,i).concat(u,t.slice(i+n.length)),r&&(r=o=i+l.length),l})),p({formats:e,replacements:t,text:n,start:r,end:o})}function ie(e,t,n,r){return oe(e,{formats:[,],replacements:[t],text:b},n,r)}function ce(e,t=e.start,n=e.end){const{formats:r,replacements:o,text:a}=e;return void 0===t||void 0===n?{...e}:{formats:r.slice(t,n),replacements:o.slice(t,n),text:a.slice(t,n)}}function ue({formats:e,replacements:t,text:n,start:r,end:o},a){if("string"!=typeof a)return function({formats:e,replacements:t,text:n,start:r,end:o},a=r,s=o){if(void 0===r||void 0===o)return;const i={formats:e.slice(0,a),replacements:t.slice(0,a),text:n.slice(0,a)},c={formats:e.slice(s),replacements:t.slice(s),text:n.slice(s),start:0,end:0};return[i,c]}(...arguments);let s=0;return n.split(a).map((n=>{const i=s,c={formats:e.slice(i,i+n.length),replacements:t.slice(i,i+n.length),text:n};return s+=a.length+n.length,void 0!==r&&void 0!==o&&(r>=i&&r<s?c.start=r-i:r<i&&o>i&&(c.start=0),o>=i&&o<s?c.end=o-i:r<s&&o>s&&(c.end=n.length)),c}))}function le(e,t){return e===t||e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}const de="http://www.w3.org/1998/Math/MathML";function fe(e,t,n){const r=e.parentNode;let o=0;for(;e=e.previousSibling;)o++;return n=[o,...n],r!==t&&(n=fe(r,t,n)),n}function me(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function pe(e,t){if(void 0!==t.html)return e.innerHTML+=t.html;"string"==typeof t&&(t=e.ownerDocument.createTextNode(t));const{type:n,attributes:r}=t;if(n)if("#comment"===n)t=e.ownerDocument.createComment(r["data-rich-text-comment"]);else{const o=e.namespaceURI;t="math"===n?e.ownerDocument.createElementNS(de,n):o===de?"MTEXT"===e.tagName?e.ownerDocument.createElement(n):e.ownerDocument.createElementNS(de,n):e.ownerDocument.createElement(n);for(const e in r)t.setAttribute(e,r[e])}return e.appendChild(t)}function he(e,t){e.appendData(t)}function ge({lastChild:e}){return e}function ve({parentNode:e}){return e}function be(e){return e.nodeType===e.TEXT_NODE}function ye({nodeValue:e}){return e}function Ee(e){return e.parentNode.removeChild(e)}function xe({value:e,prepareEditableTree:t,isEditableTree:n=!0,placeholder:r,doc:o=document}){let a=[],s=[];t&&(e={...e,formats:t(e)});return{body:C({value:e,createEmpty:()=>v(o,""),append:pe,getLastChild:ge,getParent:ve,isText:be,getText:ye,remove:Ee,appendText:he,onStartIndex(e,t){a=fe(t,e,[t.nodeValue.length])},onEndIndex(e,t){s=fe(t,e,[t.nodeValue.length])},isEditableTree:n,placeholder:r}),selection:{startPath:a,endPath:s}}}function Te({value:e,current:t,prepareEditableTree:n,__unstableDomOnly:r,placeholder:o}){const{body:a,selection:s}=xe({value:e,prepareEditableTree:n,placeholder:o,doc:t.ownerDocument});we(a,t),void 0===e.start||r||function({startPath:e,endPath:t},n){const{node:r,offset:o}=me(n,e),{node:a,offset:s}=me(n,t),{ownerDocument:i}=n,{defaultView:c}=i,u=c.getSelection(),l=i.createRange();l.setStart(r,o),l.setEnd(a,s);const{activeElement:d}=i;if(u.rangeCount>0){if(le(l,u.getRangeAt(0)))return;u.removeAllRanges()}u.addRange(l),d!==i.activeElement&&d instanceof c.HTMLElement&&d.focus()}(s,t)}function we(e,t){let n,r=0;for(;n=e.firstChild;){const o=t.childNodes[r];if(o)if(o.isEqualNode(n))e.removeChild(n);else if(o.nodeName!==n.nodeName||o.nodeType===o.TEXT_NODE&&o.data!==n.data)t.replaceChild(n,o);else{const t=o.attributes,r=n.attributes;if(t){let e=t.length;for(;e--;){const{name:r}=t[e];n.getAttribute(r)||o.removeAttribute(r)}}if(r)for(let e=0;e<r.length;e++){const{name:t,value:n}=r[e];o.getAttribute(t)!==n&&o.setAttribute(t,n)}we(n,o),e.removeChild(n)}else t.appendChild(n);r++}for(;t.childNodes[r];)t.removeChild(t.childNodes[r])}const Ne=window.wp.a11y,Le=window.wp.i18n;function Ce(e,t){return G(e,t.type)?(t.title&&(0,Ne.speak)((0,Le.sprintf)((0,Le.__)("%s removed."),t.title),"assertive"),ne(e,t.type)):(t.title&&(0,Ne.speak)((0,Le.sprintf)((0,Le.__)("%s applied."),t.title),"assertive"),g(e,t))}function _e(e){const t=(0,o.select)(f).getFormatType(e);if(t)return(0,o.dispatch)(f).removeFormatTypes(e),t;window.console.error(`Format ${e} is not registered.`)}const Se=window.wp.element,Ae=window.wp.deprecated;var Fe=e.n(Ae);function Oe({ref:e,value:t,settings:n={}}){Fe()("`useAnchorRef` hook",{since:"6.1",alternative:"`useAnchor` hook"});const{tagName:r,className:o,name:a}=n,s=a?G(t,a):void 0;return(0,Se.useMemo)((()=>{if(!e.current)return;const{ownerDocument:{defaultView:t}}=e.current,n=t.getSelection();if(!n.rangeCount)return;const a=n.getRangeAt(0);if(!s)return a;let i=a.startContainer;for(i=i.nextElementSibling||i;i.nodeType!==i.ELEMENT_NODE;)i=i.parentNode;return i.closest(r+(o?"."+o:""))}),[s,t.start,t.end,r,o])}const De=window.wp.compose;function Re(e,t,n){if(!e)return;const{ownerDocument:r}=e,{defaultView:o}=r,a=o.getSelection();if(!a)return;if(!a.rangeCount)return;const s=a.getRangeAt(0);if(!s||!s.startContainer)return;const i=function(e,t,n,r){let o=e.startContainer;if(o.nodeType===o.TEXT_NODE&&e.startOffset===o.length&&o.nextSibling)for(o=o.nextSibling;o.firstChild;)o=o.firstChild;if(o.nodeType!==o.ELEMENT_NODE&&(o=o.parentElement),!o)return;if(o===t)return;if(!t.contains(o))return;const a=n+(r?"."+r:"");for(;o!==t;){if(o.matches(a))return o;o=o.parentElement}}(s,e,t,n);return i||function(e,t){return{contextElement:t,getBoundingClientRect:()=>t.contains(e.startContainer)?e.getBoundingClientRect():t.getBoundingClientRect()}}(s,e)}function Me({editableContentElement:e,settings:t={}}){const{tagName:n,className:r,isActive:o}=t,[a,s]=(0,Se.useState)((()=>Re(e,n,r))),i=(0,De.usePrevious)(o);return(0,Se.useLayoutEffect)((()=>{if(!e)return;function t(){s(Re(e,n,r))}function a(){u.addEventListener("selectionchange",t)}function c(){u.removeEventListener("selectionchange",t)}const{ownerDocument:u}=e;return(e===u.activeElement||!i&&o||i&&!o)&&(s(Re(e,n,r)),a()),e.addEventListener("focusin",a),e.addEventListener("focusout",c),()=>{c(),e.removeEventListener("focusin",a),e.removeEventListener("focusout",c)}}),[e,n,r,o,i]),a}const $e="pre-wrap",ke="1px";var He={grad:.9,turn:360,rad:360/(2*Math.PI)},Pe=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},je=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Ve=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Ie=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},We=function(e){return{r:Ve(e.r,0,255),g:Ve(e.g,0,255),b:Ve(e.b,0,255),a:Ve(e.a)}},ze=function(e){return{r:je(e.r),g:je(e.g),b:je(e.b),a:je(e.a,3)}},Be=/^#([0-9a-f]{3,8})$/i,Xe=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},qe=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=Math.max(t,n,r),s=a-Math.min(t,n,r),i=s?a===t?(n-r)/s:a===n?2+(r-t)/s:4+(t-n)/s:0;return{h:60*(i<0?i+6:i),s:a?s/a*100:0,v:a/255*100,a:o}},Ke=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),s=r*(1-n),i=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),u=a%6;return{r:255*[r,i,s,s,c,r][u],g:255*[c,r,r,i,s,s][u],b:255*[s,s,c,r,r,i][u],a:o}},Ue=function(e){return{h:Ie(e.h),s:Ve(e.s,0,100),l:Ve(e.l,0,100),a:Ve(e.a)}},Ye=function(e){return{h:je(e.h),s:je(e.s),l:je(e.l),a:je(e.a,3)}},Ge=function(e){return Ke((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},Ze=function(e){return{h:(t=qe(e)).h,s:(o=(200-(n=t.s))*(r=t.v)/100)>0&&o<200?n*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,n,r,o},Je=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Qe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,et=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,tt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,nt={string:[[function(e){var t=Be.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?je(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?je(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=et.exec(e)||tt.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:We({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Je.exec(e)||Qe.exec(e);if(!t)return null;var n,r,o=Ue({h:(n=t[1],r=t[2],void 0===r&&(r="deg"),Number(n)*(He[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Ge(o)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=void 0===o?1:o;return Pe(t)&&Pe(n)&&Pe(r)?We({r:Number(t),g:Number(n),b:Number(r),a:Number(a)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,o=e.a,a=void 0===o?1:o;if(!Pe(t)||!Pe(n)||!Pe(r))return null;var s=Ue({h:Number(t),s:Number(n),l:Number(r),a:Number(a)});return Ge(s)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,o=e.a,a=void 0===o?1:o;if(!Pe(t)||!Pe(n)||!Pe(r))return null;var s=function(e){return{h:Ie(e.h),s:Ve(e.s,0,100),v:Ve(e.v,0,100),a:Ve(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(a)});return Ke(s)},"hsv"]]},rt=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0](e);if(r)return[r,t[n][1]]}return[null,void 0]},ot=function(e){return"string"==typeof e?rt(e.trim(),nt.string):"object"==typeof e&&null!==e?rt(e,nt.object):[null,void 0]},at=function(e,t){var n=Ze(e);return{h:n.h,s:Ve(n.s+100*t,0,100),l:n.l,a:n.a}},st=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},it=function(e,t){var n=Ze(e);return{h:n.h,s:n.s,l:Ve(n.l+100*t,0,100),a:n.a}},ct=function(){function e(e){this.parsed=ot(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return je(st(this.rgba),2)},e.prototype.isDark=function(){return st(this.rgba)<.5},e.prototype.isLight=function(){return st(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=ze(this.rgba)).r,n=e.g,r=e.b,a=(o=e.a)<1?Xe(je(255*o)):"","#"+Xe(t)+Xe(n)+Xe(r)+a;var e,t,n,r,o,a},e.prototype.toRgb=function(){return ze(this.rgba)},e.prototype.toRgbString=function(){return t=(e=ze(this.rgba)).r,n=e.g,r=e.b,(o=e.a)<1?"rgba("+t+", "+n+", "+r+", "+o+")":"rgb("+t+", "+n+", "+r+")";var e,t,n,r,o},e.prototype.toHsl=function(){return Ye(Ze(this.rgba))},e.prototype.toHslString=function(){return t=(e=Ye(Ze(this.rgba))).h,n=e.s,r=e.l,(o=e.a)<1?"hsla("+t+", "+n+"%, "+r+"%, "+o+")":"hsl("+t+", "+n+"%, "+r+"%)";var e,t,n,r,o},e.prototype.toHsv=function(){return e=qe(this.rgba),{h:je(e.h),s:je(e.s),v:je(e.v),a:je(e.a,3)};var e},e.prototype.invert=function(){return ut({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),ut(at(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),ut(at(this.rgba,-e))},e.prototype.grayscale=function(){return ut(at(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),ut(it(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),ut(it(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?ut({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):je(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Ze(this.rgba);return"number"==typeof e?ut({h:e,s:t.s,l:t.l,a:t.a}):je(t.h)},e.prototype.isEqual=function(e){return this.toHex()===ut(e).toHex()},e}(),ut=function(e){return e instanceof ct?e:new ct(e)};function lt({record:e}){const t=(0,Se.useRef)(),{activeFormats:n=[],replacements:r,start:o}=e.current,a=r[o];return(0,Se.useEffect)((()=>{if(!(n&&n.length||a))return;const e="*[data-rich-text-format-boundary]",r=t.current.querySelector(e);if(!r)return;const{ownerDocument:o}=r,{defaultView:s}=o,i=s.getComputedStyle(r),c=`${`.rich-text:focus ${e}`} {${`background-color: ${ut(i.color).alpha(.2).toRgbString()}`}}`,u="rich-text-boundary-style";let l=o.getElementById(u);l||(l=o.createElement("style"),l.id=u,o.head.appendChild(l)),l.innerHTML!==c&&(l.innerHTML=c)}),[n,a]),t}const dt=window.wp.keycodes,ft=[];const mt=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),pt=[],ht="data-rich-text-placeholder";const gt=[e=>t=>{function n(n){const{record:r}=e.current,{ownerDocument:o}=t;if(J(r.current)||!t.contains(o.activeElement))return;const a=ce(r.current),s=H(a),i=_({value:a});n.clipboardData.setData("text/plain",s),n.clipboardData.setData("text/html",i),n.clipboardData.setData("rich-text","true"),n.preventDefault(),"cut"===n.type&&o.execCommand("delete")}const{defaultView:r}=t.ownerDocument;return r.addEventListener("copy",n),r.addEventListener("cut",n),()=>{r.removeEventListener("copy",n),r.removeEventListener("cut",n)}},()=>e=>{function t(t){const{target:n}=t;if(n===e||n.textContent&&n.isContentEditable)return;const{ownerDocument:r}=n,{defaultView:o}=r,a=o.getSelection();if(a.containsNode(n))return;const s=r.createRange(),i=n.isContentEditable?n:n.closest("[contenteditable]");s.selectNode(i),a.removeAllRanges(),a.addRange(s),t.preventDefault()}function n(n){n.relatedTarget&&!e.contains(n.relatedTarget)&&"A"===n.relatedTarget.tagName&&t(n)}return e.addEventListener("click",t),e.addEventListener("focusin",n),()=>{e.removeEventListener("click",t),e.removeEventListener("focusin",n)}},e=>t=>{function n(n){const{keyCode:r,shiftKey:o,altKey:a,metaKey:s,ctrlKey:i}=n;if(o||a||s||i||r!==dt.LEFT&&r!==dt.RIGHT)return;const{record:c,applyRecord:u,forceRender:l}=e.current,{text:d,formats:f,start:m,end:p,activeFormats:h=[]}=c.current,g=J(c.current),{ownerDocument:v}=t,{defaultView:b}=v,{direction:y}=b.getComputedStyle(t),E="rtl"===y?dt.RIGHT:dt.LEFT,x=n.keyCode===E;if(g&&0===h.length){if(0===m&&x)return;if(p===d.length&&!x)return}if(!g)return;const T=f[m-1]||ft,w=f[m]||ft,N=x?T:w,L=h.every(((e,t)=>e===N[t]));let C=h.length;if(L?C<N.length&&C++:C--,C===h.length)return void(c.current._newActiveFormats=N);n.preventDefault();const _=(L?N:x?w:T).slice(0,C),S={...c.current,activeFormats:_};c.current=S,u(S),l()}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(t){const{keyCode:n}=t,{createRecord:r,handleChange:o}=e.current;if(t.defaultPrevented)return;if(n!==dt.DELETE&&n!==dt.BACKSPACE)return;const a=r(),{start:s,end:i,text:c}=a;0===s&&0!==i&&i===c.length&&(o(ae(a)),t.preventDefault())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{const{ownerDocument:n}=t,{defaultView:r}=n;let o=!1;function a(t){if(o)return;let n;t&&(n=t.inputType);const{record:r,applyRecord:a,createRecord:s,handleChange:i}=e.current;if(n&&(0===n.indexOf("format")||mt.has(n)))return void a(r.current);const c=s(),{start:u,activeFormats:l=[]}=r.current,d=function({value:e,start:t,end:n,formats:r}){const o=Math.min(t,n),a=Math.max(t,n),s=e.formats[o-1]||[],i=e.formats[a]||[];for(e.activeFormats=r.map(((e,t)=>{if(s[t]){if(m(e,s[t]))return s[t]}else if(i[t]&&m(e,i[t]))return i[t];return e}));--n>=t;)e.activeFormats.length>0?e.formats[n]=e.activeFormats:delete e.formats[n];return e}({value:c,start:u,end:c.start,formats:l});i(d)}function s(){const{record:i,applyRecord:c,createRecord:u,onSelectionChange:l}=e.current;if("true"!==t.contentEditable)return;if(n.activeElement!==t)return void n.removeEventListener("selectionchange",s);if(o)return;const{start:d,end:f,text:m}=u(),p=i.current;if(m!==p.text)return void a();if(d===p.start&&f===p.end)return void(0===p.text.length&&0===d&&function(e){const t=e.getSelection(),{anchorNode:n,anchorOffset:r}=t;if(n.nodeType!==n.ELEMENT_NODE)return;const o=n.childNodes[r];o&&o.nodeType===o.ELEMENT_NODE&&o.hasAttribute(ht)&&t.collapseToStart()}(r));const h={...p,start:d,end:f,activeFormats:p._newActiveFormats,_newActiveFormats:void 0},g=x(h,pt);h.activeFormats=g,i.current=h,c(h,{domOnly:!0}),l(d,f)}function i(){o=!0,n.removeEventListener("selectionchange",s),t.querySelector(`[${ht}]`)?.remove()}function c(){o=!1,a({inputType:"insertText"}),n.addEventListener("selectionchange",s)}function u(){const{record:r,isSelected:o,onSelectionChange:a,applyRecord:i}=e.current;if(!t.parentElement.closest('[contenteditable="true"]')){if(o)i(r.current,{domOnly:!0});else{const e=void 0;r.current={...r.current,start:e,end:e,activeFormats:pt}}a(r.current.start,r.current.end),window.queueMicrotask(s),n.addEventListener("selectionchange",s)}}return t.addEventListener("input",a),t.addEventListener("compositionstart",i),t.addEventListener("compositionend",c),t.addEventListener("focus",u),()=>{t.removeEventListener("input",a),t.removeEventListener("compositionstart",i),t.removeEventListener("compositionend",c),t.removeEventListener("focus",u)}},()=>e=>{const{ownerDocument:t}=e,{defaultView:n}=t,r=n?.getSelection();let o;function a(){return r.rangeCount?r.getRangeAt(0):null}function s(e){const n="keydown"===e.type?"keyup":"pointerup";function r(){t.removeEventListener(n,s),t.removeEventListener("selectionchange",r),t.removeEventListener("input",r)}function s(){r(),le(o,a())||t.dispatchEvent(new Event("selectionchange"))}t.addEventListener(n,s),t.addEventListener("selectionchange",r),t.addEventListener("input",r),o=a()}return e.addEventListener("pointerdown",s),e.addEventListener("keydown",s),()=>{e.removeEventListener("pointerdown",s),e.removeEventListener("keydown",s)}},function(){return e=>{const{ownerDocument:t}=e,{defaultView:n}=t;let r=null;function o(t){t.defaultPrevented||t.target!==e&&t.target.contains(e)&&(r=e.getAttribute("contenteditable"),e.setAttribute("contenteditable","false"),n.getSelection().removeAllRanges())}function a(){null!==r&&(e.setAttribute("contenteditable",r),r=null)}return n.addEventListener("pointerdown",o),n.addEventListener("pointerup",a),()=>{n.removeEventListener("pointerdown",o),n.removeEventListener("pointerup",a)}}}];function vt(e){const t=(0,Se.useRef)(e);(0,Se.useInsertionEffect)((()=>{t.current=e}));const n=(0,Se.useMemo)((()=>gt.map((e=>e(t)))),[t]);return(0,De.useRefEffect)((e=>{const t=n.map((t=>t(e)));return()=>{t.forEach((e=>e()))}}),[n])}function bt({value:e="",selectionStart:t,selectionEnd:n,placeholder:r,onSelectionChange:a,preserveWhiteSpace:s,onChange:i,__unstableDisableFormats:c,__unstableIsSelected:u,__unstableDependencies:l=[],__unstableAfterParse:d,__unstableBeforeSerialize:f,__unstableAddInvisibleFormats:m}){const p=(0,o.useRegistry)(),[,h]=(0,Se.useReducer)((()=>({}))),g=(0,Se.useRef)();function v(e,{domOnly:t}={}){Te({value:e,current:g.current,prepareEditableTree:m,__unstableDomOnly:t,placeholder:r})}const b=(0,Se.useRef)(e),y=(0,Se.useRef)();function E(){b.current=e,y.current=e,e instanceof j||(y.current=e?j.fromHTMLString(e,{preserveWhiteSpace:s}):j.empty()),y.current={text:y.current.text,formats:y.current.formats,replacements:y.current.replacements},c&&(y.current.formats=Array(e.length),y.current.replacements=Array(e.length)),d&&(y.current.formats=d(y.current)),y.current.start=t,y.current.end=n}const x=(0,Se.useRef)(!1);function T(t){if(y.current=t,v(t),c)b.current=t.text;else{const n=f?f(t):t.formats;t={...t,formats:n},b.current="string"==typeof e?_({value:t,preserveWhiteSpace:s}):new j(t)}const{start:n,end:r,formats:o,text:u}=y.current;p.batch((()=>{a(n,r),i(b.current,{__unstableFormats:o,__unstableText:u})})),h()}function w(){const t=b.current;E();const n=t&&"string"==typeof t&&"string"==typeof e&&t.length!==e.length,r=g.current?.contains(g.current.ownerDocument.activeElement),o=n&&!r;v(y.current,{domOnly:o})}y.current?t===y.current.start&&n===y.current.end||(x.current=u,y.current={...y.current,start:t,end:n,activeFormats:void 0}):(x.current=u,E());const N=(0,Se.useRef)(!1);(0,Se.useLayoutEffect)((()=>{N.current&&e!==b.current&&(w(),h())}),[e]),(0,Se.useLayoutEffect)((()=>{x.current&&(g.current.ownerDocument.activeElement!==g.current&&g.current.focus(),v(y.current),x.current=!1)}),[x.current]);const L=(0,De.useMergeRefs)([g,(0,Se.useCallback)((e=>{e&&(e.style.whiteSpace=$e,e.style.minWidth=ke)}),[]),lt({record:y}),vt({record:y,handleChange:T,applyRecord:v,createRecord:function(){const{ownerDocument:{defaultView:e}}=g.current,t=e.getSelection(),n=t.rangeCount>0?t.getRangeAt(0):null;return V({element:g.current,range:n,__unstableIsEditableTree:!0})},isSelected:u,onSelectionChange:a,forceRender:h}),(0,De.useRefEffect)((()=>{w(),N.current=!0}),[r,...l])]);return{value:y.current,getValue:()=>y.current,onChange:T,ref:L}}function yt(){}(window.wp=window.wp||{}).richText=t})(); block-editor.min.js 0000644 00003315355 15121363544 0010265 0 ustar 00 /*! This file is auto-generated */
(()=>{var e={197:()=>{},271:(e,t,n)=>{"use strict";let o,r,i=n(683);class s extends i{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new o(new r,this,e).stringify()}}s.registerLazyResult=e=>{o=e},s.registerProcessor=e=>{r=e},e.exports=s,s.default=s},346:e=>{"use strict";const t={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class n{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,o=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:o&&(n+=" "),e.nodes)this.block(e,n+o);else{let r=(e.raws.between||"")+(t?";":"");this.builder(n+o+r,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let o=e.parent,r=0;for(;o&&"root"!==o.type;)r+=1,o=o.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<r;e++)n+=t}return n}block(e,t){let n,o=this.raw(e,"between","beforeOpen");this.builder(t+o+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let o=0;o<e.nodes.length;o++){let r=e.nodes[o],i=this.raw(r,"before");i&&this.builder(i),this.stringify(r,t!==o||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),o=e.prop+n+this.rawValue(e,"value");e.important&&(o+=e.raws.important||" !important"),t&&(o+=";"),this.builder(o,e)}document(e){this.body(e)}raw(e,n,o){let r;if(o||(o=n),n&&(r=e.raws[n],void 0!==r))return r;let i=e.parent;if("before"===o){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return t[o];let s=e.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[o])return s.rawCache[o];if("before"===o||"after"===o)return this.beforeAfter(e,o);{let t="raw"+((l=o)[0].toUpperCase()+l.slice(1));this[t]?r=this[t](s,e):s.walk((e=>{if(r=e.raws[n],void 0!==r)return!1}))}var l;return void 0===r&&(r=t[o]),s.rawCache[o]=r,r}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments((e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1})),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls((e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1})),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((n=>{let o=n.parent;if(o&&o!==e&&o.parent&&o.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let n=e[t],o=e.raws[t];return o&&o.value===n?o.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}e.exports=n,n.default=n},356:(e,t,n)=>{"use strict";let o=n(2775),r=n(9746);class i extends Error{constructor(e,t,n,o,r,s){super(e),this.name="CssSyntaxError",this.reason=e,r&&(this.file=r),o&&(this.source=o),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,i)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=o.isColorSupported);let n=e=>e,i=e=>e,s=e=>e;if(e){let{bold:e,gray:t,red:l}=o.createColors(!0);i=t=>e(l(t)),n=e=>t(e),r&&(s=e=>r(e))}let l=t.split(/\r?\n/),a=Math.max(this.line-3,0),c=Math.min(this.line+2,l.length),u=String(c).length;return l.slice(a,c).map(((e,t)=>{let o=a+1+t,r=" "+(" "+o).slice(-u)+" | ";if(o===this.line){if(e.length>160){let t=20,o=Math.max(0,this.column-t),l=Math.max(this.column+t,this.endColumn+t),a=e.slice(o,l),c=n(r.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return i(">")+n(r)+s(a)+"\n "+c+i("^")}let t=n(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+n(r)+s(e)+"\n "+t+i("^")}return" "+n(r)+s(e)})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}e.exports=i,i.default=i},448:(e,t,n)=>{"use strict";let o=n(683),r=n(271),i=n(1670),s=n(4295),l=n(9055),a=n(9434),c=n(633),{isClean:u,my:d}=n(1381);n(3122);const p={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},g={Once:!0,postcssPlugin:!0,prepare:!0};function m(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,n=p[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function b(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function k(e){return e[u]=!1,e.nodes&&e.nodes.forEach((e=>k(e))),e}let v={};class _{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(e,t,n){let r;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof _||t instanceof l)r=k(t.root),t.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=t.map);else{let e=s;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{r=e(t,n)}catch(e){this.processed=!0,this.error=e}r&&!r[d]&&o.rebuild(r)}else r=k(t);this.result=new l(e,r,n),this.helpers={...v,postcss:v,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!h[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!g[n])if("object"==typeof t[n])for(let o in t[n])e(t,"*"===o?n:n+"-"+o.toLowerCase(),t[n][o]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(m(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[u];){e[u]=!0;let t=[b(e)];for(;t.length>0;){let e=this.visitTick(t);if(m(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>n(e,this.helpers)));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return m(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=c;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new i(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(m(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[u];)e[u]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,o]of e){let e;this.result.lastPlugin=n;try{e=o(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(m(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:o}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(o.length>0&&t.visitorIndex<o.length){let[e,r]=o[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===o.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return r(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let o,r=t.iterator;for(;o=n.nodes[n.indexes[r]];)if(n.indexes[r]+=1,!o[u])return o[u]=!0,void e.push(b(o));t.iterator=0,delete n.indexes[r]}let r=t.events;for(;t.eventIndex<r.length;){let e=r[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[u]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[u]=!0;let t=f(e);for(let n of t)if(0===n)e.nodes&&e.each((e=>{e[u]||this.walkSync(e)}));else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}_.registerPostcss=e=>{v=e},e.exports=_,_.default=_,a.registerLazyResult(_),r.registerLazyResult(_)},461:(e,t,n)=>{var o=n(6109);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var i=e.nodeName,s=document.createElement(i);s.innerHTML=" ","TEXTAREA"===i.toUpperCase()&&s.setAttribute("rows","1");var l=o(e,"font-size");s.style.fontSize=l,s.style.padding="0px",s.style.border="0px";var a=document.body;a.appendChild(s),n=s.offsetHeight,a.removeChild(s)}return n}},628:(e,t,n)=>{"use strict";var o=n(4067);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,s){if(s!==o){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n,n}},633:(e,t,n)=>{"use strict";let o=n(346);function r(e,t){new o(t).stringify(e)}e.exports=r,r.default=r},683:(e,t,n)=>{"use strict";let o,r,i,s,l=n(6589),a=n(1516),c=n(7490),{isClean:u,my:d}=n(1381);function p(e){return e.map((e=>(e.nodes&&(e.nodes=p(e.nodes)),delete e.source,e)))}function h(e){if(e[u]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)h(t)}class g extends c{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,o=this.getIterator();for(;this.indexes[o]<this.proxyOf.nodes.length&&(t=this.indexes[o],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[o]+=1;return delete this.indexes[o],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map((e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e))):"every"===t||"some"===t?n=>e[t](((e,...t)=>n(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,o=this.index(e),r=this.normalize(t,this.proxyOf.nodes[o]).reverse();o=this.index(e);for(let e of r)this.proxyOf.nodes.splice(o+1,0,e);for(let e in this.indexes)n=this.indexes[e],o<n&&(this.indexes[e]=n+r.length);return this.markDirty(),this}insertBefore(e,t){let n,o=this.index(e),r=0===o&&"prepend",i=this.normalize(t,this.proxyOf.nodes[o],r).reverse();o=this.index(e);for(let e of i)this.proxyOf.nodes.splice(o,0,e);for(let e in this.indexes)n=this.indexes[e],o<=n&&(this.indexes[e]=n+i.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=p(r(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new a(e)]}else if(e.selector||e.selectors)e=[new s(e)];else if(e.name)e=[new o(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new l(e)]}return e.map((e=>(e[d]||g.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[u]&&h(e),e.raws||(e.raws={}),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls((o=>{t.props&&!t.props.includes(o.prop)||t.fast&&!o.value.includes(t.fast)||(o.value=o.value.replace(e,n))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,n)=>{let o;try{o=e(t,n)}catch(e){throw t.addToError(e)}return!1!==o&&t.walk&&(o=t.walk(e)),o}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((n,o)=>{if("atrule"===n.type&&e.test(n.name))return t(n,o)})):this.walk(((n,o)=>{if("atrule"===n.type&&n.name===e)return t(n,o)})):(t=e,this.walk(((e,n)=>{if("atrule"===e.type)return t(e,n)})))}walkComments(e){return this.walk(((t,n)=>{if("comment"===t.type)return e(t,n)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((n,o)=>{if("decl"===n.type&&e.test(n.prop))return t(n,o)})):this.walk(((n,o)=>{if("decl"===n.type&&n.prop===e)return t(n,o)})):(t=e,this.walk(((e,n)=>{if("decl"===e.type)return t(e,n)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((n,o)=>{if("rule"===n.type&&e.test(n.selector))return t(n,o)})):this.walk(((n,o)=>{if("rule"===n.type&&n.selector===e)return t(n,o)})):(t=e,this.walk(((e,n)=>{if("rule"===e.type)return t(e,n)})))}}g.registerParse=e=>{r=e},g.registerRule=e=>{s=e},g.registerAtRule=e=>{o=e},g.registerRoot=e=>{i=e},e.exports=g,g.default=g,g.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,o.prototype):"rule"===e.type?Object.setPrototypeOf(e,s.prototype):"decl"===e.type?Object.setPrototypeOf(e,a.prototype):"comment"===e.type?Object.setPrototypeOf(e,l.prototype):"root"===e.type&&Object.setPrototypeOf(e,i.prototype),e[d]=!0,e.nodes&&e.nodes.forEach((e=>{g.rebuild(e)}))}},1087:(e,t,n)=>{"use strict";var o,r=n(8202);r.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("",""))
/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/,e.exports=function(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var s=document.createElement("div");s.setAttribute(n,"return;"),i="function"==typeof s[n]}return!i&&o&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},1326:(e,t,n)=>{"use strict";let o=n(683);class r extends o{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}e.exports=r,r.default=r,o.registerAtRule(r)},1381:e=>{"use strict";e.exports.isClean=Symbol("isClean"),e.exports.my=Symbol("my")},1443:e=>{function t(e,t){return t.some((t=>t instanceof RegExp?t.test(e):e.includes(t)))}e.exports=function(e){const n=e.prefix,o=/\s+$/.test(n)?n:`${n} `,r=e.ignoreFiles?[].concat(e.ignoreFiles):[],i=e.includeFiles?[].concat(e.includeFiles):[];return function(s){r.length&&s.source.input.file&&t(s.source.input.file,r)||i.length&&s.source.input.file&&!t(s.source.input.file,i)||s.walkRules((t=>{t.parent&&["keyframes","-webkit-keyframes","-moz-keyframes","-o-keyframes","-ms-keyframes"].includes(t.parent.name)||(t.selectors=t.selectors.map((r=>e.exclude&&function(e,t){return t.some((t=>t instanceof RegExp?t.test(e):e===t))}(r,e.exclude)?r:e.transform?e.transform(n,r,o+r,s.source.input.file,t):o+r)))}))}}},1516:(e,t,n)=>{"use strict";let o=n(7490);class r extends o{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}e.exports=r,r.default=r},1524:e=>{var t="-".charCodeAt(0),n="+".charCodeAt(0),o=".".charCodeAt(0),r="e".charCodeAt(0),i="E".charCodeAt(0);e.exports=function(e){var s,l,a,c=0,u=e.length;if(0===u||!function(e){var r,i=e.charCodeAt(0);if(i===n||i===t){if((r=e.charCodeAt(1))>=48&&r<=57)return!0;var s=e.charCodeAt(2);return r===o&&s>=48&&s<=57}return i===o?(r=e.charCodeAt(1))>=48&&r<=57:i>=48&&i<=57}(e))return!1;for((s=e.charCodeAt(c))!==n&&s!==t||c++;c<u&&!((s=e.charCodeAt(c))<48||s>57);)c+=1;if(s=e.charCodeAt(c),l=e.charCodeAt(c+1),s===o&&l>=48&&l<=57)for(c+=2;c<u&&!((s=e.charCodeAt(c))<48||s>57);)c+=1;if(s=e.charCodeAt(c),l=e.charCodeAt(c+1),a=e.charCodeAt(c+2),(s===r||s===i)&&(l>=48&&l<=57||(l===n||l===t)&&a>=48&&a<=57))for(c+=l===n||l===t?3:2;c<u&&!((s=e.charCodeAt(c))<48||s>57);)c+=1;return{number:e.slice(0,c),unit:e.slice(c)}}},1544:(e,t,n)=>{var o=n(8491),r=n(3815),i=n(4725);function s(e){return this instanceof s?(this.nodes=o(e),this):new s(e)}s.prototype.toString=function(){return Array.isArray(this.nodes)?i(this.nodes):""},s.prototype.walk=function(e,t){return r(this.nodes,e,t),this},s.unit=n(1524),s.walk=r,s.stringify=i,e.exports=s},1609:e=>{"use strict";e.exports=window.React},1670:(e,t,n)=>{"use strict";let{dirname:o,relative:r,resolve:i,sep:s}=n(197),{SourceMapConsumer:l,SourceMapGenerator:a}=n(1866),{pathToFileURL:c}=n(2739),u=n(5380),d=Boolean(l&&a),p=Boolean(o&&i&&r&&s);e.exports=class{constructor(e,t,n,o){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=o,this.originalCSS=o,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||o(e.file);!1===this.mapOpts.sourcesContent?(t=new l(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),p&&d&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=a.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new a({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new a({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,o=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((s,l,a)=>{if(this.css+=s,l&&"end"!==a&&(i.generated.line=n,i.generated.column=o-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),t=s.match(/\n/g),t?(n+=t.length,e=s.lastIndexOf("\n"),o=s.length-e):o+=s.length,l&&"start"!==a){let e=l.parent||{raws:{}};("decl"===l.type||"atrule"===l.type&&!l.nodes)&&l===e.last&&!e.raws.semicolon||(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.source.end.column-1,i.generated.line=n,i.generated.column=o-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=n,i.generated.column=o-1,this.map.addMapping(i)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?o(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=o(i(n,this.mapOpts.annotation)));let s=r(n,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new u(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let o=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(o,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(c){let t=c(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===s&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}},1866:()=>{},2213:e=>{var t,n,o,r,i,s,l,a,c,u,d,p,h,g,m,f=!1;function b(){if(!f){f=!0;var e=navigator.userAgent,b=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),k=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(p=/\b(iPhone|iP[ao]d)/.exec(e),h=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),g=/FBAN\/\w+;/i.exec(e),m=/Mobile/i.exec(e),d=!!/Win64/.exec(e),b){(t=b[1]?parseFloat(b[1]):b[5]?parseFloat(b[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var v=/(?:Trident\/(\d+.\d+))/.exec(e);s=v?parseFloat(v[1])+4:t,n=b[2]?parseFloat(b[2]):NaN,o=b[3]?parseFloat(b[3]):NaN,(r=b[4]?parseFloat(b[4]):NaN)?(b=/(?:Chrome\/(\d+\.\d+))/.exec(e),i=b&&b[1]?parseFloat(b[1]):NaN):i=NaN}else t=n=o=i=r=NaN;if(k){if(k[1]){var _=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);l=!_||parseFloat(_[1].replace("_","."))}else l=!1;a=!!k[2],c=!!k[3]}else l=a=c=!1}}var k={ie:function(){return b()||t},ieCompatibilityMode:function(){return b()||s>t},ie64:function(){return k.ie()&&d},firefox:function(){return b()||n},opera:function(){return b()||o},webkit:function(){return b()||r},safari:function(){return k.webkit()},chrome:function(){return b()||i},windows:function(){return b()||a},osx:function(){return b()||l},linux:function(){return b()||c},iphone:function(){return b()||p},mobile:function(){return b()||p||h||u||m},nativeApp:function(){return b()||g},android:function(){return b()||u},ipad:function(){return b()||h}};e.exports=k},2327:e=>{"use strict";const t="'".charCodeAt(0),n='"'.charCodeAt(0),o="\\".charCodeAt(0),r="/".charCodeAt(0),i="\n".charCodeAt(0),s=" ".charCodeAt(0),l="\f".charCodeAt(0),a="\t".charCodeAt(0),c="\r".charCodeAt(0),u="[".charCodeAt(0),d="]".charCodeAt(0),p="(".charCodeAt(0),h=")".charCodeAt(0),g="{".charCodeAt(0),m="}".charCodeAt(0),f=";".charCodeAt(0),b="*".charCodeAt(0),k=":".charCodeAt(0),v="@".charCodeAt(0),_=/[\t\n\f\r "#'()/;[\\\]{}]/g,y=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,x=/.[\r\n"'(/\\]/,S=/[\da-f]/i;e.exports=function(e,w={}){let C,B,I,j,E,T,M,P,R,A,N=e.css.valueOf(),L=w.ignoreErrors,D=N.length,O=0,z=[],V=[];function F(t){throw e.error("Unclosed "+t,O)}return{back:function(e){V.push(e)},endOfFile:function(){return 0===V.length&&O>=D},nextToken:function(e){if(V.length)return V.pop();if(O>=D)return;let w=!!e&&e.ignoreUnclosed;switch(C=N.charCodeAt(O),C){case i:case s:case a:case c:case l:j=O;do{j+=1,C=N.charCodeAt(j)}while(C===s||C===i||C===a||C===c||C===l);T=["space",N.slice(O,j)],O=j-1;break;case u:case d:case g:case m:case k:case f:case h:{let e=String.fromCharCode(C);T=[e,e,O];break}case p:if(A=z.length?z.pop()[1]:"",R=N.charCodeAt(O+1),"url"===A&&R!==t&&R!==n&&R!==s&&R!==i&&R!==a&&R!==l&&R!==c){j=O;do{if(M=!1,j=N.indexOf(")",j+1),-1===j){if(L||w){j=O;break}F("bracket")}for(P=j;N.charCodeAt(P-1)===o;)P-=1,M=!M}while(M);T=["brackets",N.slice(O,j+1),O,j],O=j}else j=N.indexOf(")",O+1),B=N.slice(O,j+1),-1===j||x.test(B)?T=["(","(",O]:(T=["brackets",B,O,j],O=j);break;case t:case n:E=C===t?"'":'"',j=O;do{if(M=!1,j=N.indexOf(E,j+1),-1===j){if(L||w){j=O+1;break}F("string")}for(P=j;N.charCodeAt(P-1)===o;)P-=1,M=!M}while(M);T=["string",N.slice(O,j+1),O,j],O=j;break;case v:_.lastIndex=O+1,_.test(N),j=0===_.lastIndex?N.length-1:_.lastIndex-2,T=["at-word",N.slice(O,j+1),O,j],O=j;break;case o:for(j=O,I=!0;N.charCodeAt(j+1)===o;)j+=1,I=!I;if(C=N.charCodeAt(j+1),I&&C!==r&&C!==s&&C!==i&&C!==a&&C!==c&&C!==l&&(j+=1,S.test(N.charAt(j)))){for(;S.test(N.charAt(j+1));)j+=1;N.charCodeAt(j+1)===s&&(j+=1)}T=["word",N.slice(O,j+1),O,j],O=j;break;default:C===r&&N.charCodeAt(O+1)===b?(j=N.indexOf("*/",O+2)+1,0===j&&(L||w?j=N.length:F("comment")),T=["comment",N.slice(O,j+1),O,j],O=j):(y.lastIndex=O+1,y.test(N),j=0===y.lastIndex?N.length-1:y.lastIndex-2,T=["word",N.slice(O,j+1),O,j],z.push(T),O=j)}return O++,T},position:function(){return O}}}},2739:()=>{},2775:e=>{var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};e.exports=n(),e.exports.createColors=n},3122:e=>{"use strict";let t={};e.exports=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}},3815:e=>{e.exports=function e(t,n,o){var r,i,s,l;for(r=0,i=t.length;r<i;r+=1)s=t[r],o||(l=n(s,r,t)),!1!==l&&"function"===s.type&&Array.isArray(s.nodes)&&e(s.nodes,n,o),o&&n(s,r,t)}},3937:(e,t,n)=>{"use strict";let o=n(1326),r=n(6589),i=n(1516),s=n(9434),l=n(4092),a=n(2327);const c={empty:!0,space:!0};e.exports=class{constructor(e){this.input=e,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,n,r,i=new o;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let s=!1,l=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){l=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),s&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),l&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,o=0;for(let r=t-1;r>=0&&(n=e[r],"space"===n[0]||(o+=1,2!==o));r--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,o,r=0;for(let[i,s]of e.entries()){if(n=s,o=n[0],"("===o&&(r+=1),")"===o&&(r-=1),0===r&&":"===o){if(t){if("word"===t[0]&&"progid"===t[1])continue;return i}this.doubleColon(n)}t=n}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=a(this.input)}decl(e,t){let n=new i;this.init(n,e[0][2]);let o,r=e[e.length-1];for(";"===r[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(r[3]||r[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],o=n[3]||n[2];if(o)return o}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(o=e.shift(),":"===o[0]){n.raws.between+=o[1];break}"word"===o[0]&&/\w/.test(o[1])&&this.unknownWord([o]),n.raws.between+=o[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,l=[];for(;e.length&&(s=e[0][0],"space"===s||"comment"===s);)l.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(o=e[t],"!important"===o[1].toLowerCase()){n.important=!0;let o=this.stringFrom(e,t);o=this.spacesFromEnd(e)+o," !important"!==o&&(n.raws.important=o);break}if("important"===o[1].toLowerCase()){let o=e.slice(0),r="";for(let e=t;e>0;e--){let t=o[e][0];if(r.trim().startsWith("!")&&"space"!==t)break;r=o.pop()[1]+r}r.trim().startsWith("!")&&(n.important=!0,n.raws.important=r,e=o)}if("space"!==o[0]&&"comment"!==o[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(n.raws.between+=l.map((e=>e[1])).join(""),l=[]),this.raw(n,"value",l.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new l;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,o=!1,r=null,i=[],s=e[1].startsWith("--"),l=[],a=e;for(;a;){if(n=a[0],l.push(a),"("===n||"["===n)r||(r=a),i.push("("===n?")":"]");else if(s&&o&&"{"===n)r||(r=a),i.push("}");else if(0===i.length){if(";"===n){if(o)return void this.decl(l,s);break}if("{"===n)return void this.rule(l);if("}"===n){this.tokenizer.back(l.pop()),t=!0;break}":"===n&&(o=!0)}else n===i[i.length-1]&&(i.pop(),0===i.length&&(r=null));a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(r),t&&o){if(!s)for(;l.length&&(a=l[l.length-1][0],"space"===a||"comment"===a);)this.tokenizer.back(l.pop());this.decl(l,s)}else this.unknownWord(l)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,o){let r,i,s,l,a=n.length,u="",d=!0;for(let e=0;e<a;e+=1)r=n[e],i=r[0],"space"!==i||e!==a-1||o?"comment"===i?(l=n[e-1]?n[e-1][0]:"empty",s=n[e+1]?n[e+1][0]:"empty",c[l]||c[s]||","===u.slice(-1)?d=!1:u+=r[1]):u+=r[1]:d=!1;if(!d){let o=n.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:o,value:u}}e[t]=u}rule(e){e.pop();let t=new l;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let o=t;o<e.length;o++)n+=e[o][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}},4067:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4092:(e,t,n)=>{"use strict";let o=n(683),r=n(7374);class i extends o{get selectors(){return r.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}e.exports=i,i.default=i,o.registerRule(i)},4132:(e,t,n)=>{"use strict";var o=n(4462);t.A=o.TextareaAutosize},4295:(e,t,n)=>{"use strict";let o=n(683),r=n(5380),i=n(3937);function s(e,t){let n=new r(e,t),o=new i(n);try{o.parse()}catch(e){throw e}return o.root}e.exports=s,s.default=s,o.registerParse(s)},4306:function(e,t){var n,o,r;
/*!
autosize 4.0.4
license: MIT
http://www.jacklmoore.com/autosize
*/o=[e,t],n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),i=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){i=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function s(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,s=function(){e.clientWidth!==n&&p()},l=function(t){window.removeEventListener("resize",s,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",l,!1),e.removeEventListener("autosize:update",p,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",l,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",p,!1),window.addEventListener("resize",s,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:l,update:p}),a()}function a(){var n=window.getComputedStyle(e,null);"vertical"===n.resize?e.style.resize="none":"both"===n.resize&&(e.style.resize="horizontal"),t="content-box"===n.boxSizing?-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function d(){if(0!==e.scrollHeight){var o=u(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function p(){d();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),d(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),d(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var s=i("autosize:resized");try{e.dispatchEvent(s)}catch(e){}}}}function l(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return s(e,t)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],l),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default},void 0===(r="function"==typeof n?n.apply(t,o):n)||(e.exports=r)},4462:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},s=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var l=n(1609),a=n(5826),c=n(4306),u=n(461),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=s(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return l.createElement("textarea",i({},a,{onChange:this.onChange,style:u?i({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(l.Component);t.TextareaAutosize=l.forwardRef((function(e,t){return l.createElement(p,i({},e,{innerRef:t}))}))},4725:e=>{function t(e,t){var o,r,i=e.type,s=e.value;return t&&void 0!==(r=t(e))?r:"word"===i||"space"===i?s:"string"===i?(o=e.quote||"")+s+(e.unclosed?"":o):"comment"===i?"/*"+s+(e.unclosed?"":"*/"):"div"===i?(e.before||"")+s+(e.after||""):Array.isArray(e.nodes)?(o=n(e.nodes,t),"function"!==i?o:s+"("+(e.before||"")+o+(e.after||"")+(e.unclosed?"":")")):s}function n(e,n){var o,r;if(Array.isArray(e)){for(o="",r=e.length-1;~r;r-=1)o=t(e[r],n)+o;return o}return t(e,n)}e.exports=n},5042:e=>{e.exports={nanoid:(e=21)=>{let t="",n=0|e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let o="",r=0|n;for(;r--;)o+=e[Math.random()*e.length|0];return o}}},5215:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var o,r,i;if(Array.isArray(t)){if((o=t.length)!=n.length)return!1;for(r=o;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((o=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=o;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;0!=r--;){var s=i[r];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},5380:(e,t,n)=>{"use strict";let{nanoid:o}=n(5042),{isAbsolute:r,resolve:i}=n(197),{SourceMapConsumer:s,SourceMapGenerator:l}=n(1866),{fileURLToPath:a,pathToFileURL:c}=n(2739),u=n(356),d=n(5696),p=n(9746),h=Symbol("lineToIndexCache"),g=Boolean(s&&l),m=Boolean(i&&r);function f(e){if(e[h])return e[h];let t=e.css.split("\n"),n=new Array(t.length),o=0;for(let e=0,r=t.length;e<r;e++)n[e]=o,o+=t[e].length+1;return e[h]=n,n}class b{get from(){return this.file||this.id}constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,t.document&&(this.document=t.document.toString()),t.from&&(!m||/^\w+:\/\//.test(t.from)||r(t.from)?this.file=t.from:this.file=i(t.from)),m&&g){let e=new d(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+o(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,o={}){let r,i,s,l,a;if(t&&"object"==typeof t){let e=t,o=n;if("number"==typeof e.offset){l=e.offset;let o=this.fromOffset(l);t=o.line,n=o.col}else t=e.line,n=e.column,l=this.fromLineAndColumn(t,n);if("number"==typeof o.offset){s=o.offset;let e=this.fromOffset(s);i=e.line,r=e.col}else i=o.line,r=o.column,s=this.fromLineAndColumn(o.line,o.column)}else if(n)l=this.fromLineAndColumn(t,n);else{l=t;let e=this.fromOffset(l);t=e.line,n=e.col}let d=this.origin(t,n,i,r);return a=d?new u(e,void 0===d.endLine?d.line:{column:d.column,line:d.line},void 0===d.endLine?d.column:{column:d.endColumn,line:d.endLine},d.source,d.file,o.plugin):new u(e,void 0===i?t:{column:n,line:t},void 0===i?n:{column:r,line:i},this.css,this.file,o.plugin),a.input={column:n,endColumn:r,endLine:i,endOffset:s,line:t,offset:l,source:this.css},this.file&&(c&&(a.input.url=c(this.file).toString()),a.input.file=this.file),a}fromLineAndColumn(e,t){return f(this)[e-1]+t-1}fromOffset(e){let t=f(this),n=0;if(e>=t[t.length-1])n=t.length-1;else{let o,r=t.length-2;for(;n<r;)if(o=n+(r-n>>1),e<t[o])r=o-1;else{if(!(e>=t[o+1])){n=o;break}n=o+1}}return{col:e-t[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:i(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,o){if(!this.map)return!1;let i,s,l=this.map.consumer(),u=l.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof n&&(i=l.originalPositionFor({column:o,line:n})),s=r(u.source)?c(u.source):new URL(u.source,this.map.consumer().sourceRoot||c(this.map.mapFile));let d={column:u.column,endColumn:i&&i.column,endLine:i&&i.line,line:u.line,url:s.toString()};if("file:"===s.protocol){if(!a)throw new Error("file: protocol is not available in this PostCSS build");d.file=a(s)}let p=l.sourceContentFor(u.source);return p&&(d.source=p),d}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}e.exports=b,b.default=b,p&&p.registerInput&&p.registerInput(b)},5404:(e,t,n)=>{const o=n(1544);e.exports=e=>{const t=Object.assign({skipHostRelativeUrls:!0},e);return{postcssPlugin:"rebaseUrl",Declaration(n){const r=o(n.value);let i=!1;r.walk((n=>{if("function"!==n.type||"url"!==n.value)return;const o=n.nodes[0].value,r=new URL(o,e.rootUrl);return r.pathname===o&&t.skipHostRelativeUrls||(n.nodes[0].value=r.toString(),i=!0),!1})),i&&(n.value=o.stringify(r))}}},e.exports.postcss=!0},5417:(e,t)=>{"use strict";function n(){}function o(e,t,n,o,r){for(var i=0,s=t.length,l=0,a=0;i<s;i++){var c=t[i];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,i&&t[i-1].added){var u=t[i-1];t[i-1]=t[i],t[i]=u}}else{if(!c.added&&r){var d=n.slice(l,l+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(l,l+c.count));l+=c.count,c.added||(a+=c.count)}}var p=t[s-1];return s>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[s-2].value+=p.value,t.pop()),t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.callback;"function"==typeof n&&(r=n,n={}),this.options=n;var i=this;function s(e){return r?(setTimeout((function(){r(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var l=(t=this.removeEmpty(this.tokenize(t))).length,a=e.length,c=1,u=l+a,d=[{newPos:-1,components:[]}],p=this.extractCommon(d[0],t,e,0);if(d[0].newPos+1>=l&&p+1>=a)return s([{value:this.join(t),count:t.length}]);function h(){for(var n=-1*c;n<=c;n+=2){var r=void 0,u=d[n-1],p=d[n+1],h=(p?p.newPos:0)-n;u&&(d[n-1]=void 0);var g=u&&u.newPos+1<l,m=p&&0<=h&&h<a;if(g||m){if(!g||m&&u.newPos<p.newPos?(r={newPos:(f=p).newPos,components:f.components.slice(0)},i.pushComponent(r.components,void 0,!0)):((r=u).newPos++,i.pushComponent(r.components,!0,void 0)),h=i.extractCommon(r,t,e,n),r.newPos+1>=l&&h+1>=a)return s(o(i,r.components,t,e,i.useLongestToken));d[n]=r}else d[n]=void 0}var f;c++}if(r)!function e(){setTimeout((function(){if(c>u)return r();h()||e()}),0)}();else for(;c<=u;){var g=h();if(g)return g}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,i=n.length,s=e.newPos,l=s-o,a=0;s+1<r&&l+1<i&&this.equals(t[s+1],n[l+1]);)s++,l++,a++;return a&&e.components.push({count:a}),e.newPos=s,l},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},5696:(e,t,n)=>{"use strict";let{existsSync:o,readFileSync:r}=n(9977),{dirname:i,join:s}=n(197),{SourceMapConsumer:l,SourceMapGenerator:a}=n(1866);class c{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,o=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),o&&(this.text=o)}consumer(){return this.consumerCache||(this.consumerCache=new l(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let n=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(n)return o=e.substr(n[0].length),Buffer?Buffer.from(o,"base64").toString():window.atob(o);var o;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let n=e.lastIndexOf(t.pop()),o=e.indexOf("*/",n);n>-1&&o>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,o)))}loadFile(e){if(this.root=i(e),o(e))return this.mapFile=e,r(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof l)return a.fromSourceMap(t).toString();if(t instanceof a)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=s(i(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}e.exports=c,c.default=c},5776:e=>{"use strict";class t{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}e.exports=t,t.default=t},5826:(e,t,n)=>{e.exports=n(628)()},6109:e=>{e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},6589:(e,t,n)=>{"use strict";let o=n(7490);class r extends o{constructor(e){super(e),this.type="comment"}}e.exports=r,r.default=r},7191:(e,t,n)=>{"use strict";var o=n(2213),r=n(1087);function i(e){var t=0,n=0,o=0,r=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),o=10*t,r=10*n,"deltaY"in e&&(r=e.deltaY),"deltaX"in e&&(o=e.deltaX),(o||r)&&e.deltaMode&&(1==e.deltaMode?(o*=40,r*=40):(o*=800,r*=800)),o&&!t&&(t=o<1?-1:1),r&&!n&&(n=r<1?-1:1),{spinX:t,spinY:n,pixelX:o,pixelY:r}}i.getEventType=function(){return o.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=i},7374:e=>{"use strict";let t={comma:e=>t.split(e,[","],!0),space:e=>t.split(e,[" ","\n","\t"]),split(e,t,n){let o=[],r="",i=!1,s=0,l=!1,a="",c=!1;for(let n of e)c?c=!1:"\\"===n?c=!0:l?n===a&&(l=!1):'"'===n||"'"===n?(l=!0,a=n):"("===n?s+=1:")"===n?s>0&&(s-=1):0===s&&t.includes(n)&&(i=!0),i?(""!==r&&o.push(r.trim()),r="",i=!1):r+=n;return(n||""!==r)&&o.push(r.trim()),o}};e.exports=t,t.default=t},7490:(e,t,n)=>{"use strict";let o=n(356),r=n(346),i=n(633),{isClean:s,my:l}=n(1381);function a(e,t){let n=new e.constructor;for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;if("proxyCache"===o)continue;let r=e[o],i=typeof r;"parent"===o&&"object"===i?t&&(n[o]=t):"source"===o?n[o]=r:Array.isArray(r)?n[o]=r.map((e=>a(e,n))):("object"===i&&null!==r&&(r=a(r)),n[o]=r)}return n}function c(e,t){if(t&&void 0!==t.offset)return t.offset;let n=1,o=1,r=0;for(let i=0;i<e.length;i++){if(o===t.line&&n===t.column){r=i;break}"\n"===e[i]?(n=1,o+=1):n+=1}return r}class u{get proxyOf(){return this}constructor(e={}){this.raws={},this[s]=!1,this[l]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=a(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:o}=this.rangeBy(t);return this.source.input.error(e,{column:o.column,line:o.line},{column:n.column,line:n.line},t)}return new o(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markClean(){this[s]=!0}markDirty(){if(this[s]){this[s]=!1;let e=this;for(;e=e.parent;)e[s]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let n="document"in this.source.input?this.source.input.document:this.source.input.css,o=n.slice(c(n,this.source.start),c(n,this.source.end)).indexOf(e.word);-1!==o&&(t=this.positionInside(o))}return t}positionInside(e){let t=this.source.start.column,n=this.source.start.line,o="document"in this.source.input?this.source.input.document:this.source.input.css,r=c(o,this.source.start),i=r+e;for(let e=r;e<i;e++)"\n"===o[e]?(t=1,n+=1):t+=1;return{column:t,line:n,offset:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,n={column:this.source.start.column,line:this.source.start.line,offset:c(t,this.source.start)},o=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:c(t,this.source.end)+1}:{column:n.column+1,line:n.line,offset:n.offset+1};if(e.word){let r=t.slice(c(t,this.source.start),c(t,this.source.end)).indexOf(e.word);-1!==r&&(n=this.positionInside(r),o=this.positionInside(r+e.word.length))}else e.start?n={column:e.start.column,line:e.start.line,offset:c(t,e.start)}:e.index&&(n=this.positionInside(e.index)),e.end?o={column:e.end.column,line:e.end.line,offset:c(t,e.end)}:"number"==typeof e.endIndex?o=this.positionInside(e.endIndex):e.index&&(o=this.positionInside(e.index+1));return(o.line<n.line||o.line===n.line&&o.column<=n.column)&&(o={column:n.column+1,line:n.line,offset:n.offset+1}),{end:o,start:n}}raw(e,t){return(new r).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let o of e)o===this?n=!0:n?(this.parent.insertAfter(t,o),t=o):this.parent.insertBefore(t,o);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},o=null==t;t=t||new Map;let r=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let o=this[e];if(Array.isArray(o))n[e]=o.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof o&&o.toJSON)n[e]=o.toJSON(null,t);else if("source"===e){if(null==o)continue;let i=t.get(o.input);null==i&&(i=r,t.set(o.input,r),r++),n[e]={end:o.end,inputId:i,start:o.start}}else n[e]=o}return o&&(n.inputs=[...t.keys()].map((e=>e.toJSON()))),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,n={}){let o={node:this};for(let e in n)o[e]=n[e];return e.warn(t,o)}}e.exports=u,u.default=u},7520:(e,t,n)=>{e.exports=n(7191)},7661:(e,t,n)=>{"use strict";let o=n(1670),r=n(4295);const i=n(9055);let s=n(633);n(3122);class l{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=r;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let l=s;this.result=new i(this._processor,r,this._opts),this.result.css=t;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let c=new o(l,r,this._opts,t);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}}e.exports=l,l.default=l},7734:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var o,r,i;if(Array.isArray(t)){if((o=t.length)!=n.length)return!1;for(r=o;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;for(r of t.entries())if(!e(r[1],n.get(r[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((o=t.length)!=n.length)return!1;for(r=o;0!=r--;)if(t[r]!==n[r])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((o=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=o;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;0!=r--;){var s=i[r];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},8021:(e,t,n)=>{"use strict";var o;t.JJ=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(5417))&&o.__esModule?o:{default:o}).default)},8202:e=>{"use strict";var t=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},8491:e=>{var t="(".charCodeAt(0),n=")".charCodeAt(0),o="'".charCodeAt(0),r='"'.charCodeAt(0),i="\\".charCodeAt(0),s="/".charCodeAt(0),l=",".charCodeAt(0),a=":".charCodeAt(0),c="*".charCodeAt(0),u="u".charCodeAt(0),d="U".charCodeAt(0),p="+".charCodeAt(0),h=/^[a-f0-9?-]+$/i;e.exports=function(e){for(var g,m,f,b,k,v,_,y,x,S=[],w=e,C=0,B=w.charCodeAt(C),I=w.length,j=[{nodes:S}],E=0,T="",M="",P="";C<I;)if(B<=32){g=C;do{g+=1,B=w.charCodeAt(g)}while(B<=32);b=w.slice(C,g),f=S[S.length-1],B===n&&E?P=b:f&&"div"===f.type?(f.after=b,f.sourceEndIndex+=b.length):B===l||B===a||B===s&&w.charCodeAt(g+1)!==c&&(!x||x&&"function"===x.type&&"calc"!==x.value)?M=b:S.push({type:"space",sourceIndex:C,sourceEndIndex:g,value:b}),C=g}else if(B===o||B===r){g=C,b={type:"string",sourceIndex:C,quote:m=B===o?"'":'"'};do{if(k=!1,~(g=w.indexOf(m,g+1)))for(v=g;w.charCodeAt(v-1)===i;)v-=1,k=!k;else g=(w+=m).length-1,b.unclosed=!0}while(k);b.value=w.slice(C+1,g),b.sourceEndIndex=b.unclosed?g:g+1,S.push(b),C=g+1,B=w.charCodeAt(C)}else if(B===s&&w.charCodeAt(C+1)===c)b={type:"comment",sourceIndex:C,sourceEndIndex:(g=w.indexOf("*/",C))+2},-1===g&&(b.unclosed=!0,g=w.length,b.sourceEndIndex=g),b.value=w.slice(C+2,g),S.push(b),C=g+2,B=w.charCodeAt(C);else if(B!==s&&B!==c||!x||"function"!==x.type||"calc"!==x.value)if(B===s||B===l||B===a)b=w[C],S.push({type:"div",sourceIndex:C-M.length,sourceEndIndex:C+b.length,value:b,before:M,after:""}),M="",C+=1,B=w.charCodeAt(C);else if(t===B){g=C;do{g+=1,B=w.charCodeAt(g)}while(B<=32);if(y=C,b={type:"function",sourceIndex:C-T.length,value:T,before:w.slice(y+1,g)},C=g,"url"===T&&B!==o&&B!==r){g-=1;do{if(k=!1,~(g=w.indexOf(")",g+1)))for(v=g;w.charCodeAt(v-1)===i;)v-=1,k=!k;else g=(w+=")").length-1,b.unclosed=!0}while(k);_=g;do{_-=1,B=w.charCodeAt(_)}while(B<=32);y<_?(b.nodes=C!==_+1?[{type:"word",sourceIndex:C,sourceEndIndex:_+1,value:w.slice(C,_+1)}]:[],b.unclosed&&_+1!==g?(b.after="",b.nodes.push({type:"space",sourceIndex:_+1,sourceEndIndex:g,value:w.slice(_+1,g)})):(b.after=w.slice(_+1,g),b.sourceEndIndex=g)):(b.after="",b.nodes=[]),C=g+1,b.sourceEndIndex=b.unclosed?g:C,B=w.charCodeAt(C),S.push(b)}else E+=1,b.after="",b.sourceEndIndex=C+1,S.push(b),j.push(b),S=b.nodes=[],x=b;T=""}else if(n===B&&E)C+=1,B=w.charCodeAt(C),x.after=P,x.sourceEndIndex+=P.length,P="",E-=1,j[j.length-1].sourceEndIndex=C,j.pop(),S=(x=j[E]).nodes;else{g=C;do{B===i&&(g+=1),g+=1,B=w.charCodeAt(g)}while(g<I&&!(B<=32||B===o||B===r||B===l||B===a||B===s||B===t||B===c&&x&&"function"===x.type&&"calc"===x.value||B===s&&"function"===x.type&&"calc"===x.value||B===n&&E));b=w.slice(C,g),t===B?T=b:u!==b.charCodeAt(0)&&d!==b.charCodeAt(0)||p!==b.charCodeAt(1)||!h.test(b.slice(2))?S.push({type:"word",sourceIndex:C,sourceEndIndex:g,value:b}):S.push({type:"unicode-range",sourceIndex:C,sourceEndIndex:g,value:b}),C=g}else b=w[C],S.push({type:"word",sourceIndex:C-M.length,sourceEndIndex:C+b.length,value:b}),C+=1,B=w.charCodeAt(C);for(C=j.length-1;C;C-=1)j[C].unclosed=!0,j[C].sourceEndIndex=w.length;return j[0].nodes}},9055:(e,t,n)=>{"use strict";let o=n(5776);class r{get content(){return this.css}constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css="",this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new o(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter((e=>"warning"===e.type))}}e.exports=r,r.default=r},9434:(e,t,n)=>{"use strict";let o,r,i=n(683);class s extends i{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let o=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of o)e.raws.before=t.raws.before;return o}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new o(new r,this,e).stringify()}}s.registerLazyResult=e=>{o=e},s.registerProcessor=e=>{r=e},e.exports=s,s.default=s,i.registerRoot(s)},9656:(e,t,n)=>{"use strict";let o=n(271),r=n(448),i=n(7661),s=n(9434);class l{constructor(e=[]){this.version="8.5.6",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new r(this,e,t):new i(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}e.exports=l,l.default=l,s.registerProcessor(l),o.registerProcessor(l)},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},n=Object.keys(t).join("|"),o=new RegExp(n,"g"),r=new RegExp(n,"");function i(e){return t[e]}var s=function(e){return e.replace(o,i)};e.exports=s,e.exports.has=function(e){return!!e.match(r)},e.exports.remove=s},9746:()=>{},9977:()=>{}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{AlignmentControl:()=>Vg,AlignmentToolbar:()=>Fg,Autocomplete:()=>kj,BlockAlignmentControl:()=>pa,BlockAlignmentToolbar:()=>ha,BlockBreadcrumb:()=>Cj,BlockCanvas:()=>XT,BlockColorsStyleSelector:()=>tM,BlockContextProvider:()=>iv,BlockControls:()=>Rs,BlockEdit:()=>vv,BlockEditorKeyboardShortcuts:()=>Qk,BlockEditorProvider:()=>ov,BlockFormatControls:()=>Ps,BlockIcon:()=>Vu,BlockInspector:()=>VA,BlockList:()=>dw,BlockMover:()=>Hj,BlockNavigationDropdown:()=>DM,BlockPopover:()=>tf,BlockPreview:()=>kC,BlockSelectionClearer:()=>RS,BlockSettingsMenu:()=>gT,BlockSettingsMenuControls:()=>lT,BlockStyles:()=>VM,BlockTitle:()=>wj,BlockToolbar:()=>OT,BlockTools:()=>UT,BlockVerticalAlignmentControl:()=>vl,BlockVerticalAlignmentToolbar:()=>_l,ButtonBlockAppender:()=>uI,ButtonBlockerAppender:()=>cI,ColorPalette:()=>cP,ColorPaletteControl:()=>uP,ContrastChecker:()=>dh,CopyHandler:()=>HA,DefaultBlockAppender:()=>yS,FontSizePicker:()=>sj,HeadingLevelDropdown:()=>$M,HeightControl:()=>bm,InnerBlocks:()=>ew,Inserter:()=>lI,InspectorAdvancedControls:()=>Va,InspectorControls:()=>Fa,JustifyContentControl:()=>Sl,JustifyToolbar:()=>wl,LineHeightControl:()=>Oh,LinkControl:()=>uu,MediaPlaceholder:()=>mR,MediaReplaceFlow:()=>hu,MediaUpload:()=>Ya,MediaUploadCheck:()=>Xa,MultiSelectScrollIntoView:()=>WA,NavigableToolbar:()=>ET,ObserveTyping:()=>rw,PanelColorSettings:()=>fR,PlainText:()=>qR,RecursionProvider:()=>JA,RichText:()=>WR,RichTextShortcut:()=>QR,RichTextToolbarButton:()=>JR,SETTINGS_DEFAULTS:()=>P,SkipToSelectedBlock:()=>gA,Typewriter:()=>XA,URLInput:()=>ac,URLInputButton:()=>oA,URLPopover:()=>dR,Warning:()=>bv,WritingFlow:()=>Aw,__experimentalBlockAlignmentMatrixControl:()=>xj,__experimentalBlockFullHeightAligmentControl:()=>_j,__experimentalBlockPatternSetup:()=>oP,__experimentalBlockPatternsList:()=>$C,__experimentalBlockVariationPicker:()=>KM,__experimentalBlockVariationTransforms:()=>lP,__experimentalBorderRadiusControl:()=>rp,__experimentalColorGradientControl:()=>qp,__experimentalColorGradientSettingsDropdown:()=>kP,__experimentalDateFormatPicker:()=>hP,__experimentalDuotoneControl:()=>Ef,__experimentalFontAppearanceControl:()=>Lh,__experimentalFontFamilyControl:()=>Ah,__experimentalGetBorderClassesAndStyles:()=>UI,__experimentalGetColorClassesAndStyles:()=>WI,__experimentalGetElementClassName:()=>lN,__experimentalGetGapCSSValue:()=>ul,__experimentalGetGradientClass:()=>Op,__experimentalGetGradientObjectByGradientValue:()=>Vp,__experimentalGetShadowClassesAndStyles:()=>$I,__experimentalGetSpacingClassesAndStyles:()=>ZI,__experimentalImageEditor:()=>oR,__experimentalImageSizeControl:()=>lR,__experimentalImageURLInputUI:()=>uA,__experimentalInspectorPopoverHeader:()=>oN,__experimentalLetterSpacingControl:()=>zh,__experimentalLibrary:()=>$A,__experimentalLinkControl:()=>cu,__experimentalLinkControlSearchInput:()=>Gc,__experimentalLinkControlSearchItem:()=>Bc,__experimentalLinkControlSearchResults:()=>Nc,__experimentalListView:()=>NM,__experimentalPanelColorGradientSettings:()=>xP,__experimentalPreviewOptions:()=>dA,__experimentalPublishDateTimePicker:()=>iN,__experimentalRecursionProvider:()=>tN,__experimentalResponsiveBlockControl:()=>XR,__experimentalSpacingSizesControl:()=>mm,__experimentalTextDecorationControl:()=>tg,__experimentalTextTransformControl:()=>Xh,__experimentalUnitControl:()=>tA,__experimentalUseBlockOverlayActive:()=>Bj,__experimentalUseBlockPreview:()=>vC,__experimentalUseBorderProps:()=>GI,__experimentalUseColorProps:()=>KI,__experimentalUseCustomSides:()=>mf,__experimentalUseGradient:()=>Hp,__experimentalUseHasRecursion:()=>nN,__experimentalUseMultipleOriginColorsAndGradients:()=>Nd,__experimentalUseResizeCanvas:()=>pA,__experimentalWritingModeControl:()=>ig,__unstableBlockNameContext:()=>CT,__unstableBlockSettingsMenuFirstItem:()=>zE,__unstableBlockToolbarLastItem:()=>_E,__unstableEditorStyles:()=>cC,__unstableIframe:()=>Fw,__unstableInserterMenuExtension:()=>KB,__unstableRichTextInputEvent:()=>eA,__unstableUseBlockSelectionClearer:()=>PS,__unstableUseClipboardHandler:()=>FA,__unstableUseMouseMoveTypingReset:()=>nw,__unstableUseTypewriter:()=>YA,__unstableUseTypingObserver:()=>ow,createCustomColorsHOC:()=>rj,getColorClassName:()=>Ad,getColorObjectByAttributeValues:()=>Pd,getColorObjectByColorValue:()=>Rd,getComputedFluidTypographyValue:()=>zi,getCustomValueFromPreset:()=>il,getFontSize:()=>Tg,getFontSizeClass:()=>Pg,getFontSizeObjectByValue:()=>Mg,getGradientSlugByValue:()=>Fp,getGradientValueBySlug:()=>zp,getPxFromCssUnit:()=>aN,getSpacingPresetCssVar:()=>ll,getTypographyClassesAndStyles:()=>YI,isValueSpacingPreset:()=>rl,privateApis:()=>sD,store:()=>ji,storeConfig:()=>Ii,transformStyles:()=>lC,useBlockBindingsUtils:()=>dv,useBlockCommands:()=>ZT,useBlockDisplayInformation:()=>Xf,useBlockEditContext:()=>C,useBlockEditingMode:()=>ga,useBlockProps:()=>gS,useCachedTruthy:()=>XI,useHasRecursion:()=>eN,useInnerBlocksProps:()=>JS,useSetting:()=>Mi,useSettings:()=>Ti,useStyleOverride:()=>_s,withColorContext:()=>aP,withColors:()=>ij,withFontSizes:()=>cj});var e={};n.r(e),n.d(e,{getAllPatterns:()=>ze,getBlockRemovalRules:()=>Pe,getBlockSettings:()=>ye,getBlockStyles:()=>Ye,getBlockWithoutAttributes:()=>Ce,getClosestAllowedInsertionPoint:()=>et,getClosestAllowedInsertionPointForPattern:()=>tt,getContentLockingParent:()=>$e,getEnabledBlockParents:()=>Te,getEnabledClientIdsTree:()=>Ee,getExpandedBlock:()=>Ge,getInserterMediaCategories:()=>Le,getInsertionPoint:()=>nt,getLastFocus:()=>He,getLastInsertedBlocksClientIds:()=>we,getOpenedBlockSettingsMenu:()=>Re,getParentSectionBlock:()=>We,getPatternBySlug:()=>Oe,getRegisteredInserterMediaCategories:()=>Ne,getRemovalPromptData:()=>Me,getReusableBlocks:()=>Fe,getSectionRootClientId:()=>Xe,getStyleOverrides:()=>Ae,getTemporarilyEditingAsBlocks:()=>Ze,getTemporarilyEditingFocusModeToRevert:()=>qe,getZoomLevel:()=>Je,hasAllowedPatterns:()=>De,hasBlockSpotlight:()=>rt,isBlockHidden:()=>ot,isBlockInterfaceHidden:()=>Se,isBlockSubtreeDisabled:()=>Be,isContainerInsertableToInContentOnlyMode:()=>Ie,isDragging:()=>Ue,isSectionBlock:()=>Ke,isZoomOut:()=>Qe});var t={};n.r(t),n.d(t,{__experimentalGetActiveBlockIdByBlockNames:()=>To,__experimentalGetAllowedBlocks:()=>lo,__experimentalGetAllowedPatterns:()=>mo,__experimentalGetBlockListSettingsForBlocks:()=>xo,__experimentalGetDirectInsertBlock:()=>co,__experimentalGetGlobalBlocksByName:()=>zt,__experimentalGetLastBlockAttributeChanges:()=>Co,__experimentalGetParsedPattern:()=>uo,__experimentalGetPatternTransformItems:()=>ko,__experimentalGetPatternsByBlockTypes:()=>bo,__experimentalGetReusableBlockTitle:()=>So,__unstableGetBlockWithoutInnerBlocks:()=>Mt,__unstableGetClientIdWithClientIdsTree:()=>Rt,__unstableGetClientIdsTree:()=>At,__unstableGetContentLockingParent:()=>Vo,__unstableGetSelectedBlocksWithPartialSelection:()=>yn,__unstableGetTemporarilyEditingAsBlocks:()=>Fo,__unstableGetTemporarilyEditingFocusModeToRevert:()=>Ho,__unstableGetVisibleBlocks:()=>Ao,__unstableHasActiveBlockOverlayActive:()=>No,__unstableIsFullySelected:()=>bn,__unstableIsLastBlockChangeIgnored:()=>wo,__unstableIsSelectionCollapsed:()=>kn,__unstableIsSelectionMergeable:()=>_n,__unstableIsWithinBlockOverlay:()=>Lo,__unstableSelectionHasUnmergeableBlock:()=>vn,areInnerBlocksControlled:()=>Eo,canEditBlock:()=>Xn,canInsertBlockType:()=>$n,canInsertBlocks:()=>Wn,canLockBlockType:()=>Qn,canMoveBlock:()=>qn,canMoveBlocks:()=>Yn,canRemoveBlock:()=>Kn,canRemoveBlocks:()=>Zn,didAutomaticChange:()=>Io,getAdjacentBlockClientId:()=>nn,getAllowedBlocks:()=>so,getBlock:()=>Tt,getBlockAttributes:()=>Et,getBlockCount:()=>Ht,getBlockEditingMode:()=>Do,getBlockHierarchyRootClientId:()=>en,getBlockIndex:()=>Sn,getBlockInsertionPoint:()=>On,getBlockListSettings:()=>vo,getBlockMode:()=>Mn,getBlockName:()=>It,getBlockNamesByClientId:()=>Ft,getBlockOrder:()=>xn,getBlockParents:()=>Qt,getBlockParentsByBlockName:()=>Jt,getBlockRootClientId:()=>Xt,getBlockSelectionEnd:()=>Wt,getBlockSelectionStart:()=>$t,getBlockTransformItems:()=>ro,getBlocks:()=>Pt,getBlocksByClientId:()=>Vt,getBlocksByName:()=>Ot,getClientIdsOfDescendants:()=>Nt,getClientIdsWithDescendants:()=>Lt,getDirectInsertBlock:()=>ao,getDraggedBlockClientIds:()=>An,getFirstMultiSelectedBlockClientId:()=>un,getGlobalBlockCount:()=>Dt,getHoveredBlockClientId:()=>Ro,getInserterItems:()=>oo,getLastMultiSelectedBlockClientId:()=>dn,getLowestCommonAncestorWithSelectedBlock:()=>tn,getMultiSelectedBlockClientIds:()=>an,getMultiSelectedBlocks:()=>cn,getMultiSelectedBlocksEndClientId:()=>fn,getMultiSelectedBlocksStartClientId:()=>mn,getNextBlockClientId:()=>rn,getPatternsByBlockTypes:()=>fo,getPreviousBlockClientId:()=>on,getSelectedBlock:()=>Yt,getSelectedBlockClientId:()=>qt,getSelectedBlockClientIds:()=>ln,getSelectedBlockCount:()=>Kt,getSelectedBlocksInitialCaretPosition:()=>sn,getSelectionEnd:()=>Gt,getSelectionStart:()=>Ut,getSettings:()=>_o,getTemplate:()=>Fn,getTemplateLock:()=>Hn,hasBlockMovingClientId:()=>Bo,hasDraggedInnerBlock:()=>Bn,hasInserterItems:()=>io,hasMultiSelection:()=>jn,hasSelectedBlock:()=>Zt,hasSelectedInnerBlock:()=>Cn,isAncestorBeingDragged:()=>Ln,isAncestorMultiSelected:()=>gn,isBlockBeingDragged:()=>Nn,isBlockHighlighted:()=>jo,isBlockInsertionPointVisible:()=>zn,isBlockMultiSelected:()=>hn,isBlockSelected:()=>wn,isBlockValid:()=>jt,isBlockVisible:()=>Po,isBlockWithinSelection:()=>In,isCaretWithinFormattedText:()=>Dn,isDraggingBlocks:()=>Rn,isFirstMultiSelectedBlock:()=>pn,isGroupable:()=>zo,isLastBlockChangePersistent:()=>yo,isMultiSelecting:()=>En,isSelectionEnabled:()=>Tn,isTyping:()=>Pn,isUngroupable:()=>Oo,isValidTemplate:()=>Vn,wasBlockJustInserted:()=>Mo});var r={};n.r(r),n.d(r,{__experimentalUpdateSettings:()=>$o,clearBlockRemovalPrompt:()=>Xo,deleteStyleOverride:()=>tr,ensureDefaultBlock:()=>qo,expandBlock:()=>sr,hideBlockInterface:()=>Wo,modifyContentLockBlock:()=>ar,privateRemoveBlocks:()=>Zo,resetZoomLevel:()=>ur,setBlockRemovalRules:()=>Qo,setInsertionPoint:()=>lr,setLastFocus:()=>nr,setOpenedBlockSettingsMenu:()=>Jo,setStyleOverride:()=>er,setZoomLevel:()=>cr,showBlockInterface:()=>Ko,startDragging:()=>rr,stopDragging:()=>ir,stopEditingAsBlocks:()=>or,toggleBlockSpotlight:()=>dr});var i={};n.r(i),n.d(i,{__unstableDeleteSelection:()=>Wr,__unstableExpandSelection:()=>Zr,__unstableMarkAutomaticChange:()=>hi,__unstableMarkLastChangeAsPersistent:()=>di,__unstableMarkNextChangeAsNotPersistent:()=>pi,__unstableSaveReusableBlock:()=>ui,__unstableSetEditorMode:()=>gi,__unstableSetTemporarilyEditingAsBlocks:()=>Si,__unstableSplitSelection:()=>Kr,clearSelectedBlock:()=>Mr,duplicateBlocks:()=>fi,enterFormattedText:()=>ri,exitFormattedText:()=>ii,flashBlock:()=>_i,hideInsertionPoint:()=>Ur,hoverBlock:()=>Cr,insertAfterBlock:()=>ki,insertBeforeBlock:()=>bi,insertBlock:()=>Vr,insertBlocks:()=>Fr,insertDefaultBlock:()=>li,mergeBlocks:()=>qr,moveBlockToPosition:()=>zr,moveBlocksDown:()=>Lr,moveBlocksToPosition:()=>Or,moveBlocksUp:()=>Dr,multiSelect:()=>Tr,receiveBlocks:()=>yr,registerInserterMediaCategory:()=>wi,removeBlock:()=>Xr,removeBlocks:()=>Yr,replaceBlock:()=>Ar,replaceBlocks:()=>Rr,replaceInnerBlocks:()=>Qr,resetBlocks:()=>kr,resetSelection:()=>_r,selectBlock:()=>wr,selectNextBlock:()=>Ir,selectPreviousBlock:()=>Br,selectionChange:()=>si,setBlockEditingMode:()=>Ci,setBlockMovingClientId:()=>mi,setBlockVisibility:()=>xi,setHasControlledInnerBlocks:()=>yi,setTemplateValidity:()=>Gr,showInsertionPoint:()=>Hr,startDraggingBlocks:()=>ni,startMultiSelect:()=>jr,startTyping:()=>ei,stopDraggingBlocks:()=>oi,stopMultiSelect:()=>Er,stopTyping:()=>ti,synchronizeTemplate:()=>$r,toggleBlockHighlight:()=>vi,toggleBlockMode:()=>Jr,toggleSelection:()=>Pr,unsetBlockEditingMode:()=>Bi,updateBlock:()=>Sr,updateBlockAttributes:()=>xr,updateBlockListSettings:()=>ai,updateSettings:()=>ci,validateBlocksToTemplate:()=>vr});var s={};n.r(s),n.d(s,{getItems:()=>ok,getSettings:()=>lk,isUploading:()=>rk,isUploadingById:()=>sk,isUploadingByUrl:()=>ik});var l={};n.r(l),n.d(l,{getAllItems:()=>ak,getBlobUrls:()=>gk,getItem:()=>ck,getPausedUploadForPost:()=>pk,isBatchUploaded:()=>uk,isPaused:()=>hk,isUploadingToPost:()=>dk});var a={};n.r(a),n.d(a,{addItems:()=>Bk,cancelItem:()=>Ik});var c={};n.r(c),n.d(c,{addItem:()=>Tk,finishOperation:()=>Nk,pauseQueue:()=>Pk,prepareItem:()=>Lk,processItem:()=>Mk,removeItem:()=>Ak,resumeQueue:()=>Rk,revokeBlobUrls:()=>Ok,updateSettings:()=>zk,uploadItem:()=>Dk});var u={};n.r(u),n.d(u,{AdvancedPanel:()=>dN,BackgroundPanel:()=>Tu,BorderPanel:()=>Sp,ColorPanel:()=>uh,DimensionsPanel:()=>zm,FiltersPanel:()=>Uf,GlobalStylesContext:()=>is,ImageSettingsPanel:()=>uN,TypographyPanel:()=>yg,areGlobalStyleConfigsEqual:()=>os,getBlockCSSSelector:()=>Rf,getBlockSelectors:()=>Sb,getGlobalStylesChanges:()=>vN,getLayoutStyles:()=>mb,toStyles:()=>yb,useGlobalSetting:()=>cs,useGlobalStyle:()=>us,useGlobalStylesOutput:()=>Bb,useGlobalStylesOutputWithConfig:()=>Cb,useGlobalStylesReset:()=>as,useHasBackgroundPanel:()=>Iu,useHasBorderPanel:()=>gp,useHasBorderPanelControls:()=>mp,useHasColorPanel:()=>Yp,useHasDimensionsPanel:()=>Bm,useHasFiltersPanel:()=>Lf,useHasImageSettingsPanel:()=>cN,useHasTypographyPanel:()=>ag,useSettingsForBlockElement:()=>ds});const d=window.ReactJSXRuntime,p=window.wp.blocks,h=window.wp.element,g=window.wp.data,m=window.wp.compose,f=window.wp.hooks,b=Symbol("mayDisplayControls"),k=Symbol("mayDisplayParentControls"),v=Symbol("blockEditingMode"),_=Symbol("blockBindings"),y=Symbol("isPreviewMode"),x={name:"",isSelected:!1},S=(0,h.createContext)(x);S.displayName="BlockEditContext";const{Provider:w}=S;function C(){return(0,h.useContext)(S)}const B=window.wp.deprecated;var I=n.n(B),j=n(7734),E=n.n(j);const T=window.wp.i18n,M={insertUsage:{}},P={alignWide:!1,supportsLayout:!0,colors:[{name:(0,T.__)("Black"),slug:"black",color:"#000000"},{name:(0,T.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,T.__)("White"),slug:"white",color:"#ffffff"},{name:(0,T.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,T.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,T.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,T.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,T.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,T.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,T.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,T.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,T.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,T._x)("Small","font size name"),size:13,slug:"small"},{name:(0,T._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,T._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,T._x)("Large","font size name"),size:36,slug:"large"},{name:(0,T._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,T.__)("Thumbnail")},{slug:"medium",name:(0,T.__)("Medium")},{slug:"large",name:(0,T.__)("Large")},{slug:"full",name:(0,T.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,enableOpenverseMediaCategory:!0,clearBlockSelection:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],isPreviewMode:!1,blockInspectorAnimation:{animationParent:"core/navigation","core/navigation":{enterDirection:"leftToRight"},"core/navigation-submenu":{enterDirection:"rightToLeft"},"core/navigation-link":{enterDirection:"rightToLeft"},"core/search":{enterDirection:"rightToLeft"},"core/social-links":{enterDirection:"rightToLeft"},"core/page-list":{enterDirection:"rightToLeft"},"core/spacer":{enterDirection:"rightToLeft"},"core/home-link":{enterDirection:"rightToLeft"},"core/site-title":{enterDirection:"rightToLeft"},"core/site-logo":{enterDirection:"rightToLeft"}},generateAnchors:!1,gradients:[{name:(0,T.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,T.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,T.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,T.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,T.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,T.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,T.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,T.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,T.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,T.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,T.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,T.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function R(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function A(e,t,n,o=1){const r=[...e];return r.splice(t,o),R(r,e.slice(t,t+o),n)}const N=Symbol("globalStylesDataKey"),L=Symbol("globalStylesLinks"),D=Symbol("selectBlockPatternsKey"),O=Symbol("reusableBlocksSelect"),z=Symbol("sectionRootClientIdKey"),V=Symbol("mediaEditKey"),F=Symbol("essentialFormat"),H=window.wp.privateApis,{lock:U,unlock:G}=(0,H.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/block-editor"),{isContentBlock:$}=G(p.privateApis),W=e=>e;function K(e,t=""){const n=new Map,o=[];return n.set(t,o),e.forEach((e=>{const{clientId:t,innerBlocks:r}=e;o.push(t),K(r,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function Z(e,t=""){const n=[],o=[[t,e]];for(;o.length;){const[e,t]=o.shift();t.forEach((({innerBlocks:t,...r})=>{n.push([r.clientId,e]),t?.length&&o.push([r.clientId,t])}))}return n}function q(e,t=W){const n=[],o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n.push([r.clientId,t(r)])}return n}function Y(e){return q(e,(e=>{const{attributes:t,...n}=e;return n}))}function X(e){return q(e,(e=>e.attributes))}function Q(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&E()(e.clientIds,t.clientIds)&&function(e,t){return E()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function J(e,t){const n=e.tree,o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n.set(e.clientId,{});for(const t of r)n.set(t.clientId,Object.assign(n.get(t.clientId),{...e.byClientId.get(t.clientId),attributes:e.attributes.get(t.clientId),innerBlocks:t.innerBlocks.map((e=>n.get(e.clientId)))}))}function ee(e,t,n=!1){const o=e.tree,r=new Set([]),i=new Set;for(const o of t){let t=n?o:e.parents.get(o);do{if(e.controlledInnerBlocks[t]){i.add(t);break}r.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of r)o.set(e,{...o.get(e)});for(const t of r)o.get(t).innerBlocks=(e.order.get(t)||[]).map((e=>o.get(e)));for(const t of i)o.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>o.get(e)))})}const te=(0,m.pipe)(g.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=new Map(t.attributes),t.attributes.forEach(((n,r)=>{const{name:i}=t.byClientId.get(r);"core/block"===i&&n.ref===e&&t.attributes.set(r,{...n,ref:o})}))}return e(t,n)}),(e=>(t={},n)=>{const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":o.tree=new Map(o.tree),J(o,n.blocks),ee(o,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":o.tree=new Map(o.tree),o.tree.set(n.clientId,{...o.tree.get(n.clientId),...o.byClientId.get(n.clientId),attributes:o.attributes.get(n.clientId)}),ee(o,[n.clientId],!1);break;case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":o.tree=new Map(o.tree),n.clientIds.forEach((e=>{o.tree.set(e,{...o.tree.get(e),attributes:o.attributes.get(e)})})),ee(o,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=function(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...o}=n.shift();n.push(...e),t[o.clientId]=!0}return t}(n.blocks);o.tree=new Map(o.tree),n.replacedClientIds.forEach((t=>{o.tree.delete(t),e[t]||o.tree.delete("controlled||"+t)})),J(o,n.blocks),ee(o,n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds){const n=t.parents.get(e);void 0===n||""!==n&&!o.byClientId.get(n)||r.push(n)}ee(o,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds){const n=t.parents.get(r);void 0===n||""!==n&&!o.byClientId.get(n)||e.push(n)}o.tree=new Map(o.tree),n.removedClientIds.forEach((e=>{o.tree.delete(e),o.tree.delete("controlled||"+e)})),ee(o,e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),o.tree=new Map(o.tree),ee(o,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=new Map(o.tree),ee(o,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=[];o.attributes.forEach(((t,r)=>{"core/block"===o.byClientId.get(r).name&&t.ref===n.updatedId&&e.push(r)})),o.tree=new Map(o.tree),e.forEach((e=>{o.tree.set(e,{...o.byClientId.get(e),attributes:o.attributes.get(e),innerBlocks:o.tree.get(e).innerBlocks})})),ee(o,e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order.get(o[r])||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order.get(o[r])));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order.get(n.rootClientId)&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order.get(n.rootClientId)}));let i=r;if(n.blocks.length){i=e(i,{...n,type:"INSERT_BLOCKS",index:0});const r=new Map(i.order);Object.keys(o).forEach((e=>{t.order.get(e)&&r.set(e,t.order.get(e))})),i.order=r,i.tree=new Map(i.tree),Object.keys(o).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&i.tree.set(n,t.tree.get(n))}))}return i}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(Y(n.blocks)),attributes:new Map(X(n.blocks)),order:K(n.blocks),parents:new Map(Z(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(t?.tree),J(e,n.blocks),e.tree.set("",{innerBlocks:n.blocks.map((t=>e.tree.get(t.clientId)))}),e}return e(t,n)}),(function(e){let t,n,o=!1;return(r,i)=>{let s,l=e(r,i);if("SET_EXPLICIT_PERSISTENT"===i.type&&(n=i.isPersistentChange,s=r.isPersistentChange??!0),void 0!==n)return s=n,s===l.isPersistentChange?l:{...l,isPersistentChange:s};const a="MARK_LAST_CHANGE_AS_PERSISTENT"===i.type||o;return r!==l||a?(l={...l,isPersistentChange:a?!o:!Q(i,t)},t=i,o="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===i.type,l):(o="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===i.type,s=r?.isPersistentChange??!0,r.isPersistentChange===s?r:{...l,isPersistentChange:s})}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return Y(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...o}=t.updates;if(0===Object.values(o).length)return e;const r=new Map(e);return r.set(t.clientId,{...e.get(t.clientId),...o}),r}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),Y(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},attributes(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return X(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;const n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),n}case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e.get(t))))return e;let n=!1;const o=new Map(e);for(const r of t.clientIds){const i=Object.entries(t.options?.uniqueByBlock?t.attributes[r]:t.attributes??{});if(0===i.length)continue;let s=!1;const l=e.get(r),a={};i.forEach((([e,t])=>{l[e]!==t&&(s=!0,a[e]=t)})),n=n||s,s&&o.set(r,{...l,...a})}return n?o:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),X(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},order(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=K(t.blocks),o=new Map(e);return n.forEach(((e,t)=>{""!==t&&o.set(t,e)})),o.set("",(e.get("")??[]).concat(n[""])),o}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e.get(n)||[],r=K(t.blocks,n),{index:i=o.length}=t,s=new Map(e);return r.forEach(((e,t)=>{s.set(t,e)})),s.set(n,R(o,r.get(n),i)),s}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:i=e.get(o).length}=t;if(n===o){const t=e.get(o).indexOf(r[0]),n=new Map(e);return n.set(o,A(e.get(o),t,i,r.length)),n}const s=new Map(e);return s.set(n,e.get(n)?.filter((e=>!r.includes(e)))??[]),s.set(o,R(e.get(o),r,i)),s}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],i=e.get(o);if(!i.length||r===i[0])return e;const s=i.indexOf(r),l=new Map(e);return l.set(o,A(i,s,s-1,n.length)),l}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],i=n[n.length-1],s=e.get(o);if(!s.length||i===s[s.length-1])return e;const l=s.indexOf(r),a=new Map(e);return a.set(o,A(s,l,l+1,n.length)),a}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=K(t.blocks),r=new Map(e);return t.replacedClientIds.forEach((e=>{r.delete(e)})),o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.forEach(((e,t)=>{const i=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...o.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);r.set(t,i)})),r}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,o)=>{const r=e?.filter((e=>!t.removedClientIds.includes(e)))??[];r.length!==e.length&&n.set(o,r)})),n}}return e},parents(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return Z(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return Z(t.blocks,t.rootClientId||"").forEach((([e,t])=>{n.set(e,t)})),n}case"MOVE_BLOCKS_TO_POSITION":{const n=new Map(e);return t.clientIds.forEach((e=>{n.set(e,t.toRootClientId||"")})),n}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),Z(t.blocks,e.get(t.clientIds[0])).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},controlledInnerBlocks:(e={},{type:t,clientId:n,hasControlledInnerBlocks:o})=>"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e});function ne(e={},t){switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}const oe=(0,g.combineReducers)({blocks:te,isDragging:function(e=!1,t){switch(t.type){case"START_DRAGGING":return!0;case"STOP_DRAGGING":return!1}return e},isTyping:function(e=!1,t){switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},isBlockInterfaceHidden:function(e=!1,t){switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":return!1}return e},draggedBlocks:function(e=[],t){switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(e={},t){switch(t.type){case"SELECTION_CHANGE":return t.clientId?{selectionStart:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.startOffset},selectionEnd:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.endOffset}}:{selectionStart:t.start||e.selectionStart,selectionEnd:t.end||e.selectionEnd};case"RESET_SELECTION":const{selectionStart:n,selectionEnd:o}=t;return{selectionStart:n,selectionEnd:o};case"MULTI_SELECT":const{start:r,end:i}=t;return r===e.selectionStart?.clientId&&i===e.selectionEnd?.clientId?e:{selectionStart:{clientId:r},selectionEnd:{clientId:i}};case"RESET_BLOCKS":const s=e?.selectionStart?.clientId,l=e?.selectionEnd?.clientId;if(!s&&!l)return e;if(!t.blocks.some((e=>e.clientId===s)))return{selectionStart:{},selectionEnd:{}};if(!t.blocks.some((e=>e.clientId===l)))return{...e,selectionEnd:e.selectionStart}}const n=ne(e.selectionStart,t),o=ne(e.selectionEnd,t);return n===e.selectionStart&&o===e.selectionEnd?e:{selectionStart:n,selectionEnd:o}},isMultiSelecting:function(e=!1,t){switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(e=!0,t){return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(e=null,t){return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(e={},t){if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:(e={},t)=>{switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return Object.fromEntries(Object.entries(e).filter((([e])=>!t.clientIds.includes(e))));case"UPDATE_BLOCK_LIST_SETTINGS":{const n="string"==typeof t.clientId?{[t.clientId]:t.settings}:t.clientId;for(const t in n)n[t]?E()(e[t],n[t])&&delete n[t]:e[t]||delete n[t];if(0===Object.keys(n).length)return e;const o={...e,...n};for(const e in n)n[e]||delete o[e];return o}}return e},insertionPoint:function(e=null,t){switch(t.type){case"SET_INSERTION_POINT":return t.value;case"SELECT_BLOCK":return null}return e},insertionCue:function(e=null,t){switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:o,__unstableWithInserter:r,operation:i,nearestSide:s}=t,l={rootClientId:n,index:o,__unstableWithInserter:r,operation:i,nearestSide:s};return E()(e,l)?e:l}case"HIDE_INSERTION_POINT":return null}return e},template:function(e={isValid:!0},t){return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(e=P,t){if("UPDATE_SETTINGS"===t.type){const n=t.reset?{...P,...t.settings}:{...e,...t.settings};return Object.defineProperty(n,"__unstableIsPreviewMode",{get(){return I()("__unstableIsPreviewMode",{since:"6.8",alternative:"isPreviewMode"}),this.isPreviewMode}}),n}return e},preferences:function(e=M,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":{const n=t.blocks.reduce(((e,n)=>{const{attributes:o,name:r}=n;let i=r;const s=(0,g.select)(p.store).getActiveBlockVariation(r,o);return s?.name&&(i+="/"+s.name),"core/block"===r&&(i+="/"+o.ref),{...e,[i]:{time:t.time,count:e[i]?e[i].count+1:1}}}),e.insertUsage);return{...e,insertUsage:n}}}return e},lastBlockAttributesChange:function(e=null,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.options?.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return e},lastFocus:function(e=!1,t){return"LAST_FOCUS"===t.type?t.lastFocus:e},expandedBlock:function(e=null,t){switch(t.type){case"SET_BLOCK_EXPANDED_IN_LIST_VIEW":return t.clientId;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(e={},t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":if(!t.blocks.length)return e;const n=t.blocks.map((e=>e.clientId)),o=t.meta?.source;return{clientIds:n,source:o};case"RESET_BLOCKS":return{}}return e},temporarilyEditingAsBlocks:function(e="",t){return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},temporarilyEditingFocusModeRevert:function(e="",t){return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.focusModeToRevert:e},blockVisibility:function(e={},t){return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e},blockEditingModes:function(e=new Map,t){switch(t.type){case"SET_BLOCK_EDITING_MODE":return e.get(t.clientId)===t.mode?e:new Map(e).set(t.clientId,t.mode);case"UNSET_BLOCK_EDITING_MODE":{if(!e.has(t.clientId))return e;const n=new Map(e);return n.delete(t.clientId),n}case"RESET_BLOCKS":return e.has("")?(new Map).set("",e.get("")):e}return e},styleOverrides:function(e=new Map,t){switch(t.type){case"SET_STYLE_OVERRIDE":return new Map(e).set(t.id,t.style);case"DELETE_STYLE_OVERRIDE":{const n=new Map(e);return n.delete(t.id),n}}return e},removalPromptData:function(e=!1,t){switch(t.type){case"DISPLAY_BLOCK_REMOVAL_PROMPT":const{clientIds:e,selectPrevious:n,message:o}=t;return{clientIds:e,selectPrevious:n,message:o};case"CLEAR_BLOCK_REMOVAL_PROMPT":return!1}return e},blockRemovalRules:function(e=!1,t){return"SET_BLOCK_REMOVAL_RULES"===t.type?t.rules:e},openedBlockSettingsMenu:function(e=null,t){return"SET_OPENED_BLOCK_SETTINGS_MENU"===t.type?t?.clientId??null:e},registeredInserterMediaCategories:function(e=[],t){return"REGISTER_INSERTER_MEDIA_CATEGORY"===t.type?[...e,t.category]:e},zoomLevel:function(e=100,t){switch(t.type){case"SET_ZOOM_LEVEL":return t.zoom;case"RESET_ZOOM_LEVEL":return 100}return e},hasBlockSpotlight:function(e,t){switch(t.type){case"TOGGLE_BLOCK_SPOTLIGHT":const{clientId:n,hasBlockSpotlight:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":return t.clientId!==e?null:e;case"SELECTION_CHANGE":return t.start?.clientId!==e||t.end?.clientId!==e?null:e;case"CLEAR_SELECTED_BLOCK":return null}return e}});function re(e,t){if(""===t){const n=e.blocks.tree.get(t);if(!n)return;return{clientId:"",...n}}if(!e.blocks.controlledInnerBlocks[t])return e.blocks.tree.get(t);const n=e.blocks.tree.get(`controlled||${t}`);return{...e.blocks.tree.get(t),innerBlocks:n?.innerBlocks}}function ie(e,t,n){const o=re(e,t);if(o&&(n(o),o?.innerBlocks?.length))for(const t of o?.innerBlocks)ie(e,t.clientId,n)}function se(e,t,n){if(!n.length)return;let o=e.blocks.parents.get(t);for(;void 0!==o;){if(n.includes(o))return o;o=e.blocks.parents.get(o)}}function le(e,t=""){const n=e?.zoomLevel<100||"auto-scaled"===e?.zoomLevel,o=new Map,r=e.settings?.[z],i=e.blocks.order.get(r),s=Array.from(e.blockEditingModes).some((([,e])=>"disabled"===e)),l=[],a=[];Object.keys(e.blocks.controlledInnerBlocks).forEach((t=>{const n=e.blocks.byClientId?.get(t);"core/template-part"===n?.name&&l.push(t),"core/block"===n?.name&&a.push(t)}));const c=[...Object.keys(e.blockListSettings).filter((t=>"contentOnly"===e.blockListSettings[t]?.templateLock)),...window?.__experimentalContentOnlyPatternInsertion?Array.from(e.blocks.attributes.keys()).filter((t=>e.blocks.attributes.get(t)?.metadata?.patternName)):[],...window?.__experimentalContentOnlyPatternInsertion?l:[]];return ie(e,t,(t=>{const{clientId:l,name:u}=t;if(!e.blockEditingModes.has(l)){if(s){let t,n=e.blocks.parents.get(l);for(;void 0!==n&&(e.blockEditingModes.has(n)&&(t=e.blockEditingModes.get(n)),!t);)n=e.blocks.parents.get(n);if("disabled"===t)return void o.set(l,"disabled")}if(n)return l===r||i?.length&&i.includes(l)?void o.set(l,"contentOnly"):void o.set(l,"disabled");if(a.length){if(a.includes(l))return se(e,l,a)?void o.set(l,"disabled"):void 0;const n=se(e,l,a);if(n){if(se(e,n,a))return void o.set(l,"disabled");if(function(e){return e?.attributes?.metadata?.bindings&&Object.keys(e?.attributes?.metadata?.bindings).length}(t))return void o.set(l,"contentOnly");o.set(l,"disabled")}}if(c.length){!!se(e,l,c)&&($(u)?o.set(l,"contentOnly"):o.set(l,"disabled"))}}})),o}function ae({prevState:e,nextState:t,addedBlocks:n,removedClientIds:o}){const r=e.derivedBlockEditingModes;let i;return o?.forEach((t=>{ie(e,t,(e=>{r.has(e.clientId)&&(i||(i=new Map(r)),i.delete(e.clientId))}))})),n?.forEach((e=>{const n=le(t,e.clientId);n.size&&(i=i?new Map([...i?.size?i:[],...n]):new Map([...r?.size?r:[],...n]))})),i}var ce=(0,m.pipe)((function(e){return(t,n)=>{const o=e(t,n);if("SET_EDITOR_MODE"!==n.type&&o===t)return t;switch(n.type){case"REMOVE_BLOCKS":{const e=ae({prevState:t,nextState:o,removedClientIds:n.clientIds});if(e)return{...o,derivedBlockEditingModes:e??t.derivedBlockEditingModes};break}case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=ae({prevState:t,nextState:o,addedBlocks:n.blocks});if(e)return{...o,derivedBlockEditingModes:e??t.derivedBlockEditingModes};break}case"UPDATE_BLOCK_ATTRIBUTES":{const e=[],r=[];for(const i of n?.clientIds){const s=n.options?.uniqueByBlock?n.attributes[i]:n.attributes;if(!s)break;s.metadata?.patternName&&!t.blocks.attributes.get(i)?.metadata?.patternName?e.push(o.blocks.tree.get(i)):s.metadata&&!s.metadata?.patternName&&t.blocks.attributes.get(i)?.metadata?.patternName&&r.push(i)}if(!e?.length&&!r?.length)break;const i=ae({prevState:t,nextState:o,addedBlocks:e,removedClientIds:r});if(i)return{...o,derivedBlockEditingModes:i??t.derivedBlockEditingModes};break}case"UPDATE_BLOCK_LIST_SETTINGS":{const e=[],r=[],i="string"==typeof n.clientId?{[n.clientId]:n.settings}:n.clientId;for(const n in i){const i="contentOnly"!==t.blockListSettings[n]?.templateLock&&"contentOnly"===o.blockListSettings[n]?.templateLock,s="contentOnly"===t.blockListSettings[n]?.templateLock&&"contentOnly"!==o.blockListSettings[n]?.templateLock;i?e.push(o.blocks.tree.get(n)):s&&r.push(n)}if(!e.length&&!r.length)break;const s=ae({prevState:t,nextState:o,addedBlocks:e,removedClientIds:r});if(s)return{...o,derivedBlockEditingModes:s??t.derivedBlockEditingModes};break}case"SET_BLOCK_EDITING_MODE":case"UNSET_BLOCK_EDITING_MODE":case"SET_HAS_CONTROLLED_INNER_BLOCKS":{const e=re(o,n.clientId);if(!e)break;const r=ae({prevState:t,nextState:o,removedClientIds:[n.clientId],addedBlocks:[e]});if(r)return{...o,derivedBlockEditingModes:r??t.derivedBlockEditingModes};break}case"REPLACE_BLOCKS":{const e=ae({prevState:t,nextState:o,addedBlocks:n.blocks,removedClientIds:n.clientIds});if(e)return{...o,derivedBlockEditingModes:e??t.derivedBlockEditingModes};break}case"REPLACE_INNER_BLOCKS":{const e=t.blocks.order.get(n.rootClientId),r=ae({prevState:t,nextState:o,addedBlocks:n.blocks,removedClientIds:e});if(r)return{...o,derivedBlockEditingModes:r??t.derivedBlockEditingModes};break}case"MOVE_BLOCKS_TO_POSITION":{const e=n.clientIds.map((e=>o.blocks.byClientId.get(e))),r=ae({prevState:t,nextState:o,addedBlocks:e,removedClientIds:n.clientIds});if(r)return{...o,derivedBlockEditingModes:r??t.derivedBlockEditingModes};break}case"UPDATE_SETTINGS":if(t?.settings?.[z]!==o?.settings?.[z])return{...o,derivedBlockEditingModes:le(o)};break;case"RESET_BLOCKS":case"SET_EDITOR_MODE":case"RESET_ZOOM_LEVEL":case"SET_ZOOM_LEVEL":return{...o,derivedBlockEditingModes:le(o)}}return o.derivedBlockEditingModes=t?.derivedBlockEditingModes??new Map,o}}),(function(e){return(t,n)=>{const o=e(t,n);return t?(o.automaticChangeStatus=t.automaticChangeStatus,"MARK_AUTOMATIC_CHANGE"===n.type?{...o,automaticChangeStatus:"pending"}:"MARK_AUTOMATIC_CHANGE_FINAL"===n.type&&"pending"===t.automaticChangeStatus?{...o,automaticChangeStatus:"final"}:o.blocks===t.blocks&&o.selection===t.selection||"final"!==o.automaticChangeStatus&&o.selection!==t.selection?o:{...o,automaticChangeStatus:void 0}):o}}))(oe);const ue=window.wp.primitives;var de=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})});const pe=window.wp.richText,he=window.wp.blockSerializationDefaultParser,ge="core/block-editor";function me(e,t,n){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};const o=t.pop();let r=e;for(const e of t){const t=r[e];r=r[e]=Array.isArray(t)?[...t]:{...t}}return r[o]=n,e}const fe=(e,t,n)=>{const o=Array.isArray(t)?t:t.split(".");let r=e;return o.forEach((e=>{r=r?.[e]})),r??n};const be=["color","border","dimensions","typography","spacing"],ke={"color.palette":e=>e.colors,"color.gradients":e=>e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},ve={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"},_e=e=>ve[e]||e;function ye(e,t,...n){const o=It(e,t),r=[];if(t){let n=t;do{const t=It(e,n);(0,p.hasBlockSupport)(t,"__experimentalSettings",!1)&&r.push(n)}while(n=e.blocks.parents.get(n))}return n.map((n=>{if(be.includes(n))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let i=(0,f.applyFilters)("blockEditor.useSetting.before",void 0,n,t,o);if(void 0!==i)return i;const s=_e(n);for(const t of r){const n=Et(e,t);if(i=fe(n.settings?.blocks?.[o],s)??fe(n.settings,s),void 0!==i)break}const l=_o(e);if(void 0===i&&o&&(i=fe(l.__experimentalFeatures?.blocks?.[o],s)),void 0===i&&(i=fe(l.__experimentalFeatures,s)),void 0!==i)return p.__EXPERIMENTAL_PATHS_WITH_OVERRIDE[s]?i.custom??i.theme??i.default:i;const a=ke[s]?.(l);return void 0!==a?a:"typography.dropCap"===s||void 0}))}const{isContentBlock:xe}=G(p.privateApis);function Se(e){return e.isBlockInterfaceHidden}function we(e){return e?.lastBlockInserted?.clientIds}function Ce(e,t){return e.blocks.byClientId.get(t)}const Be=(e,t)=>{const n=t=>"disabled"===Do(e,t)&&xn(e,t).every(n);return xn(e,t).every(n)};function Ie(e,t,n){const o=xe(t),r=It(e,n),i=xe(r);return Xe(e)===n||i&&o}function je(e,t){const n=xn(e,t),o=[];for(const t of n){const n=je(e,t);"disabled"!==Do(e,t)?o.push({clientId:t,innerBlocks:n}):o.push(...n)}return o}const Ee=(0,g.createRegistrySelector)((()=>(0,g.createSelector)(je,(e=>[e.blocks.order,e.derivedBlockEditingModes,e.blockEditingModes])))),Te=(0,g.createSelector)(((e,t,n=!1)=>Qt(e,t,n).filter((t=>"disabled"!==Do(e,t)))),(e=>[e.blocks.parents,e.blockEditingModes,e.settings.templateLock,e.blockListSettings]));function Me(e){return e.removalPromptData}function Pe(e){return e.blockRemovalRules}function Re(e){return e.openedBlockSettingsMenu}const Ae=(0,g.createSelector)((e=>{const t=Lt(e).reduce(((e,t,n)=>(e[t]=n,e)),{});return[...e.styleOverrides].sort(((e,n)=>{const[,{clientId:o}]=e,[,{clientId:r}]=n;return(t[o]??-1)-(t[r]??-1)}))}),(e=>[e.blocks.order,e.styleOverrides]));function Ne(e){return e.registeredInserterMediaCategories}const Le=(0,g.createSelector)((e=>{const{settings:{inserterMediaCategories:t,allowedMimeTypes:n,enableOpenverseMediaCategory:o},registeredInserterMediaCategories:r}=e;if(!t&&!r.length||!n)return;const i=t?.map((({name:e})=>e))||[];return[...t||[],...(r||[]).filter((({name:e})=>!i.includes(e)))].filter((e=>!(!o&&"openverse"===e.name)&&Object.values(n).some((t=>t.startsWith(`${e.mediaType}/`)))))}),(e=>[e.settings.inserterMediaCategories,e.settings.allowedMimeTypes,e.settings.enableOpenverseMediaCategory,e.registeredInserterMediaCategories])),De=(0,g.createRegistrySelector)((e=>(0,g.createSelector)(((t,n=null)=>{const{getAllPatterns:o}=G(e(ge)),r=o(),{allowedBlockTypes:i}=_o(t);return r.some((e=>{const{inserter:o=!0}=e;if(!o)return!1;const r=bt(e);return vt(r,i)&&r.every((({name:e})=>$n(t,e,n)))}))}),((t,n)=>[..._t(e)(t),...yt(e)(t,n)])))),Oe=(0,g.createRegistrySelector)((e=>(0,g.createSelector)(((t,n)=>{if(n?.startsWith("core/block/")){const o=parseInt(n.slice(11),10),r=G(e(ge)).getReusableBlocks().find((({id:e})=>e===o));return r?mt(r,t.settings.__experimentalUserPatternCategories):null}return[...t.settings.__experimentalBlockPatterns??[],...t.settings[D]?.(e)??[]].find((({name:e})=>e===n))}),((t,n)=>n?.startsWith("core/block/")?[G(e(ge)).getReusableBlocks(),t.settings.__experimentalReusableBlocks]:[t.settings.__experimentalBlockPatterns,t.settings[D]?.(e)])))),ze=(0,g.createRegistrySelector)((e=>(0,g.createSelector)((t=>[...G(e(ge)).getReusableBlocks().map((e=>mt(e,t.settings.__experimentalUserPatternCategories))),...t.settings.__experimentalBlockPatterns??[],...t.settings[D]?.(e)??[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))),_t(e)))),Ve=[],Fe=(0,g.createRegistrySelector)((e=>t=>{const n=t.settings[O];return(n?n(e):t.settings.__experimentalReusableBlocks)??Ve}));function He(e){return e.lastFocus}function Ue(e){return e.isDragging}function Ge(e){return e.expandedBlock}const $e=(e,t)=>{let n,o=t;for(;!n&&(o=e.blocks.parents.get(o));)"contentOnly"===Hn(e,o)&&(n=o);return n},We=(e,t)=>{let n,o=t;for(;!n&&(o=e.blocks.parents.get(o));)Ke(e,o)&&(n=o);return n};function Ke(e,t){const n=It(e,t);if("core/block"===n||"contentOnly"===Hn(e,t))return!0;const o=Et(e,t),r="core/template-part"===n;return!(!o?.metadata?.patternName&&!r||!window?.__experimentalContentOnlyPatternInsertion)}function Ze(e){return e.temporarilyEditingAsBlocks}function qe(e){return e.temporarilyEditingFocusModeRevert}const Ye=(0,g.createSelector)(((e,t)=>t.reduce(((t,n)=>(t[n]=e.blocks.attributes.get(n)?.style,t)),{})),((e,t)=>[...t.map((t=>e.blocks.attributes.get(t)?.style))]));function Xe(e){return e.settings?.[z]}function Qe(e){return"auto-scaled"===e.zoomLevel||e.zoomLevel<100}function Je(e){return e.zoomLevel}function et(e,t,n=""){const o=Array.isArray(t)?t:[t],r=t=>o.every((n=>$n(e,n,t)));if(!n){if(r(n))return n;const t=Xe(e);return t&&r(t)?t:null}let i=n;for(;null!==i&&!r(i);){i=Xt(e,i)}return i}function tt(e,t,n){const{allowedBlockTypes:o}=_o(e);if(!vt(bt(t),o))return null;return et(e,bt(t).map((({blockName:e})=>e)),n)}function nt(e){return e.insertionPoint}const ot=(e,t)=>{const n=It(e,t);if(!(0,p.hasBlockSupport)(e,n,"visibility",!0))return!1;const o=e.blocks.attributes.get(t);return!1===o?.metadata?.blockVisibility};function rt(e){return!!e.hasBlockSpotlight}const it={user:"user",theme:"theme",directory:"directory"},st="fully",lt="unsynced",at={name:"allPatterns",label:(0,T._x)("All","patterns")},ct={name:"myPatterns",label:(0,T.__)("My patterns")},ut={name:"core/starter-content",label:(0,T.__)("Starter content")};function dt(e,t,n){const o=e.name.startsWith("core/block"),r="core"===e.source||e.source?.startsWith("pattern-directory");return!(t!==it.theme||!o&&!r)||(!(t!==it.directory||!o&&r)||(t===it.user&&e.type!==it.user||(n===st&&""!==e.syncStatus||!(n!==lt||"unsynced"===e.syncStatus||!o))))}const pt=Symbol("isFiltered"),ht=new WeakMap,gt=new WeakMap;function mt(e,t=[]){return{name:`core/block/${e.id}`,id:e.id,type:it.user,title:e.title?.raw,categories:e.wp_pattern_category?.map((e=>{const n=t.find((({id:t})=>t===e));return n?n.slug:e})),content:e.content?.raw,syncStatus:e.wp_pattern_sync_status}}function ft(e){let t=ht.get(e);return t||(t=function(e){const t=(0,p.parse)(e.content,{__unstableSkipMigrationLogs:!0});return 1===t.length&&(t[0].attributes={...t[0].attributes,metadata:{...t[0].attributes.metadata||{},categories:e.categories,patternName:e.name,name:t[0].attributes.metadata?.name||e.title}}),{...e,blocks:t}}(e),ht.set(e,t)),t}function bt(e){let t=gt.get(e);return t||(t=(0,he.parse)(e.content),t=t.filter((e=>null!==e.blockName)),gt.set(e,t)),t}const kt=(e,t,n=null)=>"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,vt=(e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){const e=n.shift();if(!kt(t,e.name||e.blockName,!0))return!1;e.innerBlocks?.forEach((e=>{n.push(e)}))}return!0},_t=e=>t=>[t.settings.__experimentalBlockPatterns,t.settings.__experimentalUserPatternCategories,t.settings.__experimentalReusableBlocks,t.settings[D]?.(e),t.blockPatterns,G(e(ge)).getReusableBlocks()],yt=()=>(e,t)=>[e.blockListSettings[t],e.blocks.byClientId.get(t),e.settings.allowedBlockTypes,e.settings.templateLock,Do(e,t),Xe(e),Ke(e,t)];function xt(e,t,n="asc"){return e.concat().sort(((e,t,n)=>(o,r)=>{let i,s;if("function"==typeof e?(i=e(o),s=e(r)):(i=o[e],s=r[e]),i>s)return"asc"===n?1:-1;if(s>i)return"asc"===n?-1:1;const l=t.findIndex((e=>e===o)),a=t.findIndex((e=>e===r));return l>a?1:a>l?-1:0})(t,e,n))}const{isContentBlock:St}=G(p.privateApis),wt=[],Ct=new Set,Bt={[pt]:!0};function It(e,t){const n=e.blocks.byClientId.get(t),o="core/social-link";if("web"!==h.Platform.OS&&n?.name===o){const n=e.blocks.attributes.get(t),{service:r}=n??{};return r?`${o}-${r}`:o}return n?n.name:null}function jt(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function Et(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function Tt(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const Mt=(0,g.createSelector)(((e,t)=>{const n=e.blocks.byClientId.get(t);return n?{...n,attributes:Et(e,t)}:null}),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function Pt(e,t){const n=t&&Eo(e,t)?"controlled||"+t:t||"";return e.blocks.tree.get(n)?.innerBlocks||wt}const Rt=(0,g.createSelector)(((e,t)=>(I()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:At(e,t)})),(e=>[e.blocks.order])),At=(0,g.createSelector)(((e,t="")=>(I()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),xn(e,t).map((t=>Rt(e,t))))),(e=>[e.blocks.order])),Nt=(0,g.createSelector)(((e,t)=>{t=Array.isArray(t)?[...t]:[t];const n=[];for(const o of t){const t=e.blocks.order.get(o);t&&n.push(...t)}let o=0;for(;o<n.length;){const t=n[o],r=e.blocks.order.get(t);r&&n.splice(o+1,0,...r),o++}return n}),(e=>[e.blocks.order])),Lt=e=>Nt(e,""),Dt=(0,g.createSelector)(((e,t)=>{const n=Lt(e);if(!t)return n.length;let o=0;for(const r of n){e.blocks.byClientId.get(r).name===t&&o++}return o}),(e=>[e.blocks.order,e.blocks.byClientId])),Ot=(0,g.createSelector)(((e,t)=>{if(!t)return wt;const n=Array.isArray(t)?t:[t],o=Lt(e).filter((t=>{const o=e.blocks.byClientId.get(t);return n.includes(o.name)}));return o.length>0?o:wt}),(e=>[e.blocks.order,e.blocks.byClientId]));function zt(e,t){return I()("wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName",{since:"6.5",alternative:"wp.data.select( 'core/block-editor' ).getBlocksByName"}),Ot(e,t)}const Vt=(0,g.createSelector)(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>Tt(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),Ft=(0,g.createSelector)(((e,t)=>Vt(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>Vt(e,t)));function Ht(e,t){return xn(e,t).length}function Ut(e){return e.selection.selectionStart}function Gt(e){return e.selection.selectionEnd}function $t(e){return e.selection.selectionStart.clientId}function Wt(e){return e.selection.selectionEnd.clientId}function Kt(e){const t=an(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function Zt(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function qt(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function Yt(e){const t=qt(e);return t?Tt(e,t):null}function Xt(e,t){return e.blocks.parents.get(t)??null}const Qt=(0,g.createSelector)(((e,t,n=!1)=>{const o=[];let r=t;for(;r=e.blocks.parents.get(r);)o.push(r);return o.length?n?o:o.reverse():wt}),(e=>[e.blocks.parents])),Jt=(0,g.createSelector)(((e,t,n,o=!1)=>{const r=Qt(e,t,o),i=Array.isArray(n)?e=>n.includes(e):e=>n===e;return r.filter((t=>i(It(e,t))))}),(e=>[e.blocks.parents]));function en(e,t){let n,o=t;do{n=o,o=e.blocks.parents.get(o)}while(o);return n}function tn(e,t){const n=qt(e),o=[...Qt(e,t),t],r=[...Qt(e,n),n];let i;const s=Math.min(o.length,r.length);for(let e=0;e<s&&o[e]===r[e];e++)i=o[e];return i}function nn(e,t,n=1){if(void 0===t&&(t=qt(e)),void 0===t&&(t=n<0?un(e):dn(e)),!t)return null;const o=Xt(e,t);if(null===o)return null;const{order:r}=e.blocks,i=r.get(o),s=i.indexOf(t)+1*n;return s<0||s===i.length?null:i[s]}function on(e,t){return nn(e,t,-1)}function rn(e,t){return nn(e,t,1)}function sn(e){return e.initialPosition}const ln=(0,g.createSelector)((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return wt;if(t.clientId===n.clientId)return[t.clientId];const o=Xt(e,t.clientId);if(null===o)return wt;const r=xn(e,o),i=r.indexOf(t.clientId),s=r.indexOf(n.clientId);return i>s?r.slice(s,i+1):r.slice(i,s+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function an(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?wt:ln(e)}const cn=(0,g.createSelector)((e=>{const t=an(e);return t.length?t.map((t=>Tt(e,t))):wt}),(e=>[...ln.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function un(e){return an(e)[0]||null}function dn(e){const t=an(e);return t[t.length-1]||null}function pn(e,t){return un(e)===t}function hn(e,t){return-1!==an(e).indexOf(t)}const gn=(0,g.createSelector)(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=Xt(e,n),o=hn(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function mn(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function fn(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function bn(e){const t=Ut(e),n=Gt(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function kn(e){const t=Ut(e),n=Gt(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function vn(e){return ln(e).some((t=>{const n=It(e,t);return!(0,p.getBlockType)(n).merge}))}function _n(e,t){const n=Ut(e),o=Gt(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const r=Xt(e,n.clientId);if(r!==Xt(e,o.clientId))return!1;const i=xn(e,r);let s,l;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(s=o,l=n):(s=n,l=o);const a=t?l.clientId:s.clientId,c=t?s.clientId:l.clientId,u=It(e,a);if(!(0,p.getBlockType)(u).merge)return!1;const d=Tt(e,c);if(d.name===u)return!0;const h=(0,p.switchToBlockType)(d,u);return h&&h.length}const yn=e=>{const t=Ut(e),n=Gt(e);if(t.clientId===n.clientId)return wt;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return wt;const o=Xt(e,t.clientId);if(o!==Xt(e,n.clientId))return wt;const r=xn(e,o),i=r.indexOf(t.clientId),s=r.indexOf(n.clientId),[l,a]=i>s?[n,t]:[t,n],c=Tt(e,l.clientId),u=Tt(e,a.clientId),d=c.attributes[l.attributeKey],p=u.attributes[a.attributeKey];let h=(0,pe.create)({html:d}),g=(0,pe.create)({html:p});return h=(0,pe.remove)(h,0,l.offset),g=(0,pe.remove)(g,a.offset,g.text.length),[{...c,attributes:{...c.attributes,[l.attributeKey]:(0,pe.toHTMLString)({value:h})}},{...u,attributes:{...u.attributes,[a.attributeKey]:(0,pe.toHTMLString)({value:g})}}]};function xn(e,t){return e.blocks.order.get(t||"")||wt}function Sn(e,t){return xn(e,Xt(e,t)).indexOf(t)}function wn(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Cn(e,t,n=!1){const o=ln(e);return!!o.length&&(n?o.some((n=>Qt(e,n,!0).includes(t))):o.some((n=>Xt(e,n)===t)))}function Bn(e,t,n=!1){return xn(e,t).some((t=>Nn(e,t)||n&&Bn(e,t,n)))}function In(e,t){if(!t)return!1;const n=an(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function jn(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function En(e){return e.isMultiSelecting}function Tn(e){return e.isSelectionEnabled}function Mn(e,t){return e.blocksMode[t]||"visual"}function Pn(e){return e.isTyping}function Rn(e){return!!e.draggedBlocks.length}function An(e){return e.draggedBlocks}function Nn(e,t){return e.draggedBlocks.includes(t)}function Ln(e,t){if(!Rn(e))return!1;return Qt(e,t).some((t=>Nn(e,t)))}function Dn(){return I()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const On=(0,g.createSelector)((e=>{let t,n;const{insertionCue:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:i}=r;return i?(t=Xt(e,i)||void 0,n=Sn(e,r.clientId)+1):n=xn(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionCue,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function zn(e){return null!==e.insertionCue}function Vn(e){return e.template.isValid}function Fn(e){return e.settings.template}function Hn(e,t){return t?vo(e,t)?.templateLock??!1:e.settings.templateLock??!1}const Un=(e,t,n=null)=>{let o,r;if(t&&"object"==typeof t?(o=t,r=t.name):(o=(0,p.getBlockType)(t),r=t),!o)return!1;const{allowedBlockTypes:i}=_o(e);if(!kt(i,r,!0))return!1;const s=(Array.isArray(o.parent)?o.parent:[]).concat(Array.isArray(o.ancestor)?o.ancestor:[]);if(s.length>0){if(s.includes("core/post-content"))return!0;let t=n,o=!1;do{if(s.includes(It(e,t))){o=!0;break}t=e.blocks.parents.get(t)}while(t);return o}return!0},Gn=(e,t,n=null)=>{if(!Un(e,t,n))return!1;let o;if(t&&"object"==typeof t?(o=t,t=o.name):o=(0,p.getBlockType)(t),Hn(e,n))return!1;const r=Do(e,n??"");if("disabled"===r)return!1;const i=vo(e,n);if(n&&void 0===i)return!1;const s=St(t),l=!!Ke(e,n),a=!!We(e,n);if((l||a)&&!s)return!1;if((l||"contentOnly"===r)&&!Ie(e,t,n))return!1;const c=It(e,n),u=(0,p.getBlockType)(c),d=u?.allowedBlocks;let h=kt(d,t);if(!1!==h){const e=i?.allowedBlocks,n=kt(e,t);null!==n&&(h=n)}const g=o.parent,m=kt(g,c);let b=!0;const k=o.ancestor;if(k){b=[n,...Qt(e,n)].some((t=>kt(k,It(e,t))))}const v=b&&(null===h&&null===m||!0===h||!0===m);return v?(0,f.applyFilters)("blockEditor.__unstableCanInsertBlockType",v,o,n,{getBlock:Tt.bind(null,e),getBlockParentsByBlockName:Jt.bind(null,e)}):v},$n=(0,g.createRegistrySelector)((e=>(0,g.createSelector)(Gn,((t,n,o)=>yt(e)(t,o)))));function Wn(e,t,n=null){return t.every((t=>$n(e,It(e,t),n)))}function Kn(e,t){const n=Et(e,t);if(null===n)return!0;if(void 0!==n.lock?.remove)return!n.lock.remove;const o=Xt(e,t);if(Hn(e,o))return!1;const r=!!We(e,t),i=St(It(e,t));if(r&&!i)return!1;const s=!!Ke(e,o),l=Do(e,o);return!((s||"contentOnly"===l)&&!Ie(e,It(e,t),o))&&"disabled"!==l}function Zn(e,t){return t.every((t=>Kn(e,t)))}function qn(e,t){const n=Et(e,t);if(null===n)return!0;if(void 0!==n.lock?.move)return!n.lock.move;const o=Xt(e,t),r=Hn(e,o);if("all"===r||"contentOnly"===r)return!1;const i=!!We(e,t),s=St(It(e,t));if(i&&!s)return!1;const l=!!Ke(e,o),a=Do(e,o);return!((l||"contentOnly"===a)&&!Ie(e,It(e,t),o))&&"disabled"!==Do(e,o)}function Yn(e,t){return t.every((t=>qn(e,t)))}function Xn(e,t){const n=Et(e,t);if(null===n)return!0;const{lock:o}=n;return!o?.edit}function Qn(e,t){return!!(0,p.hasBlockSupport)(t,"lock",!0)&&!!e.settings?.canLockBlocks}function Jn(e,t){return e.preferences.insertUsage?.[t]??null}const eo=(e,t,n)=>!!(0,p.hasBlockSupport)(t,"inserter",!0)&&Gn(e,t.name,n),to=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},no=(e,{buildScope:t="inserter"})=>n=>{const o=n.name;let r=!1;(0,p.hasBlockSupport)(n.name,"multiple",!0)||(r=Vt(e,Lt(e)).some((({name:e})=>e===n.name)));const{time:i,count:s=0}=Jn(e,o)||{},l={id:o,name:n.name,title:n.title,icon:n.icon,isDisabled:r,frecency:to(i,s)};if("transform"===t)return l;const a=(0,p.getBlockVariations)(n.name,"inserter");return{...l,initialAttributes:{},description:n.description,category:n.category,keywords:n.keywords,parent:n.parent,ancestor:n.ancestor,variations:a,example:n.example,utility:1}},oo=(0,g.createRegistrySelector)((e=>(0,g.createSelector)(((t,n=null,o=Bt)=>{const r=Gn(t,"core/block",n)?G(e(ge)).getReusableBlocks().map((e=>{const n=e.wp_pattern_sync_status?de:{src:de,foreground:"var(--wp-block-synced-color)"},o=mt(e),{time:r,count:i=0}=Jn(t,o.name)||{},s=to(r,i);return{id:o.name,name:"core/block",initialAttributes:{ref:e.id},title:o.title,icon:n,category:"reusable",keywords:["reusable"],isDisabled:!1,utility:1,frecency:s,content:o.content,get blocks(){return ft(o).blocks},syncStatus:o.syncStatus}})):[],i=no(t,{buildScope:"inserter"});let s=(0,p.getBlockTypes)().filter((e=>(0,p.hasBlockSupport)(e,"inserter",!0))).map(i);s=!1!==o[pt]?s.filter((e=>eo(t,e,n))):s.filter((e=>Un(t,e,n))).map((e=>({...e,isAllowedInCurrentRoot:eo(t,e,n)})));const l=[],a=s.reduce(((e,n)=>{const{variations:o=[]}=n;if(o.some((({isDefault:e})=>e))||e.push(n),o.length){const r=((e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:i=0}=Jn(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:to(r,i)}})(t,n);o.map(r).forEach((t=>{"core/paragraph/stretchy-paragraph"===t.id||"core/heading/stretchy-heading"===t.id?l.push(t):e.push(t)}))}return e}),[]);a.push(...l);const{core:c,noncore:u}=a.reduce(((e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e}),{core:[],noncore:[]});return[...[...c,...u],...r]}),((t,n)=>[(0,p.getBlockTypes)(),G(e(ge)).getReusableBlocks(),t.blocks.order,t.preferences.insertUsage,...yt(e)(t,n)])))),ro=(0,g.createRegistrySelector)((e=>(0,g.createSelector)(((e,t,n=null)=>{const o=Array.isArray(t)?t:[t],r=no(e,{buildScope:"transform"}),i=(0,p.getBlockTypes)().filter((t=>eo(e,t,n))).map(r),s=Object.fromEntries(Object.entries(i).map((([,e])=>[e.name,e])));return xt((0,p.getPossibleBlockTransformations)(o).reduce(((e,t)=>(s[t?.name]&&e.push(s[t.name]),e)),[]),(e=>s[e.name].frecency),"desc")}),((t,n,o)=>[(0,p.getBlockTypes)(),t.preferences.insertUsage,...yt(e)(t,o)])))),io=(e,t=null)=>{if((0,p.getBlockTypes)().some((n=>eo(e,n,t))))return!0;return Gn(e,"core/block",t)},so=(0,g.createRegistrySelector)((e=>(0,g.createSelector)(((e,t=null)=>{if(!t)return;const n=(0,p.getBlockTypes)().filter((n=>eo(e,n,t)));return Gn(e,"core/block",t)&&n.push("core/block"),n}),((t,n)=>[(0,p.getBlockTypes)(),...yt(e)(t,n)])))),lo=(0,g.createSelector)(((e,t=null)=>(I()('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),so(e,t))),((e,t)=>so.getDependants(e,t)));function ao(e,t=null){if(!t)return;const{defaultBlock:n,directInsert:o}=e.blockListSettings[t]??{};return n&&o?n:void 0}function co(e,t=null){return I()('wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock',{alternative:'wp.data.select( "core/block-editor" ).getDirectInsertBlock',since:"6.3",version:"6.4"}),ao(e,t)}const uo=(0,g.createRegistrySelector)((e=>(t,n)=>{const o=G(e(ge)).getPatternBySlug(n);return o?ft(o):null})),po=e=>(t,n)=>[..._t(e)(t),...yt(e)(t,n)],ho=new WeakMap;function go(e){let t=ho.get(e);return t||(t={...e,get blocks(){return ft(e).blocks}},ho.set(e,t)),t}const mo=(0,g.createRegistrySelector)((e=>(0,g.createSelector)(((t,n=null,o=Bt)=>{const{getAllPatterns:r}=G(e(ge)),i=r(),{allowedBlockTypes:s}=_o(t);return i.filter((({inserter:e=!0})=>!!e)).map(go).filter((e=>vt(bt(e),s))).filter((e=>bt(e).every((({blockName:e})=>!1!==o[pt]?$n(t,e,n):Un(t,e,n)))))}),po(e)))),fo=(0,g.createRegistrySelector)((e=>(0,g.createSelector)(((t,n,o=null)=>{if(!n)return wt;const r=e(ge).__experimentalGetAllowedPatterns(o),i=Array.isArray(n)?n:[n],s=r.filter((e=>e?.blockTypes?.some?.((e=>i.includes(e)))));return 0===s.length?wt:s}),((t,n,o)=>po(e)(t,o))))),bo=(0,g.createRegistrySelector)((e=>(I()('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),e(ge).getPatternsByBlockTypes))),ko=(0,g.createRegistrySelector)((e=>(0,g.createSelector)(((t,n,o=null)=>{if(!n)return wt;if(n.some((({clientId:e,innerBlocks:n})=>n.length||Eo(t,e))))return wt;const r=Array.from(new Set(n.map((({name:e})=>e))));return e(ge).getPatternsByBlockTypes(r,o)}),((t,n,o)=>po(e)(t,o)))));function vo(e,t){return e.blockListSettings[t]}function _o(e){return e.settings}function yo(e){return e.blocks.isPersistentChange}const xo=(0,g.createSelector)(((e,t=[])=>t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})),(e=>[e.blockListSettings])),So=(0,g.createRegistrySelector)((e=>(0,g.createSelector)(((t,n)=>{I()("wp.data.select( 'core/block-editor' ).__experimentalGetReusableBlockTitle",{since:"6.6",version:"6.8"});const o=G(e(ge)).getReusableBlocks().find((e=>e.id===n));return o?o.title?.raw:null}),(()=>[G(e(ge)).getReusableBlocks()]))));function wo(e){return e.blocks.isIgnoredChange}function Co(e){return e.lastBlockAttributesChange}function Bo(){return I()('wp.data.select( "core/block-editor" ).hasBlockMovingClientId',{since:"6.7",hint:"Block moving mode feature has been removed"}),!1}function Io(e){return!!e.automaticChangeStatus}function jo(e,t){return e.highlightedBlock===t}function Eo(e,t){return!!e.blocks.controlledInnerBlocks[t]}const To=(0,g.createSelector)(((e,t)=>{if(!t.length)return null;const n=qt(e);if(t.includes(It(e,n)))return n;const o=an(e),r=Jt(e,n||o[0],t);return r?r[r.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Mo(e,t,n){const{lastBlockInserted:o}=e;return o.clientIds?.includes(t)&&o.source===n}function Po(e,t){return e.blockVisibility?.[t]??!0}function Ro(){I()("wp.data.select( 'core/block-editor' ).getHoveredBlockClientId",{since:"6.9",version:"7.1"})}const Ao=(0,g.createSelector)((e=>{const t=new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])));return 0===t.size?Ct:t}),(e=>[e.blockVisibility]));function No(e,t){if("default"!==Do(e,t))return!1;if(!Xn(e,t))return!0;if(Qe(e)){const n=Xe(e);if(n){const o=xn(e,n);if(o?.includes(t))return!0}else if(t&&!Xt(e,t))return!0}return!(0,p.hasBlockSupport)(It(e,t),"__experimentalDisableBlockOverlay",!1)&&Eo(e,t)&&!wn(e,t)&&!Cn(e,t,!0)}function Lo(e,t){let n=e.blocks.parents.get(t);for(;n;){if(No(e,n))return!0;n=e.blocks.parents.get(n)}return!1}function Do(e,t=""){return null===t&&(t=""),e.derivedBlockEditingModes?.has(t)?e.derivedBlockEditingModes.get(t):e.blockEditingModes.has(t)?e.blockEditingModes.get(t):"default"}const Oo=(0,g.createRegistrySelector)((e=>(t,n="")=>{const o=n||qt(t);if(!o)return!1;const{getGroupingBlockName:r}=e(p.store),i=Tt(t,o),s=r();return i&&(i.name===s||(0,p.getBlockType)(i.name)?.transforms?.ungroup)&&!!i.innerBlocks.length&&Kn(t,o)})),zo=(0,g.createRegistrySelector)((e=>(t,n=wt)=>{const{getGroupingBlockName:o}=e(p.store),r=o(),i=n?.length?n:ln(t),s=i?.length?Xt(t,i[0]):void 0;return $n(t,r,s)&&i.length&&Zn(t,i)})),Vo=(e,t)=>(I()("wp.data.select( 'core/block-editor' ).__unstableGetContentLockingParent",{since:"6.1",version:"6.7"}),$e(e,t));function Fo(e){return I()("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingAsBlocks",{since:"6.1",version:"6.7"}),Ze(e)}function Ho(e){return I()("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingFocusModeToRevert",{since:"6.5",version:"6.7"}),qe(e)}const Uo=window.wp.a11y,Go=["inserterMediaCategories","blockInspectorAnimation","mediaSideload"];function $o(e,{stripExperimentalSettings:t=!1,reset:n=!1}={}){let o=e;Object.hasOwn(o,"__unstableIsPreviewMode")&&(I()("__unstableIsPreviewMode argument in wp.data.dispatch('core/block-editor').updateSettings",{since:"6.8",alternative:"isPreviewMode"}),o={...o},o.isPreviewMode=o.__unstableIsPreviewMode,delete o.__unstableIsPreviewMode);let r=o;if(t&&"web"===h.Platform.OS){r={};for(const e in o)Go.includes(e)||(r[e]=o[e])}return{type:"UPDATE_SETTINGS",settings:r,reset:n}}function Wo(){return{type:"HIDE_BLOCK_INTERFACE"}}function Ko(){return{type:"SHOW_BLOCK_INTERFACE"}}const Zo=(e,t=!0,n=!1)=>({select:o,dispatch:r,registry:i})=>{if(!e||!e.length)return;var s;s=e,e=Array.isArray(s)?s:[s];if(!o.canRemoveBlocks(e))return;const l=!n&&o.getBlockRemovalRules();if(l){let n=function(e){const t=[],n=[...e];for(;n.length;){const{innerBlocks:e,...o}=n.shift();n.push(...e),t.push(o)}return t};const i=n(e.map(o.getBlock));let s;for(const n of l)if(s=n.callback(i),s)return void r(Yo(e,t,s))}t&&r.selectPreviousBlock(e[0],t),i.batch((()=>{r({type:"REMOVE_BLOCKS",clientIds:e}),r(qo())}))},qo=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;const{__unstableHasCustomAppender:n}=e.getSettings();n||t.insertDefaultBlock()};function Yo(e,t,n){return{type:"DISPLAY_BLOCK_REMOVAL_PROMPT",clientIds:e,selectPrevious:t,message:n}}function Xo(){return{type:"CLEAR_BLOCK_REMOVAL_PROMPT"}}function Qo(e=!1){return{type:"SET_BLOCK_REMOVAL_RULES",rules:e}}function Jo(e){return{type:"SET_OPENED_BLOCK_SETTINGS_MENU",clientId:e}}function er(e,t){return{type:"SET_STYLE_OVERRIDE",id:e,style:t}}function tr(e){return{type:"DELETE_STYLE_OVERRIDE",id:e}}function nr(e=null){return{type:"LAST_FOCUS",lastFocus:e}}function or(e){return({select:t,dispatch:n,registry:o})=>{const r=G(o.select(ji)).getTemporarilyEditingFocusModeToRevert();n.__unstableMarkNextChangeAsNotPersistent(),n.updateBlockAttributes(e,{templateLock:"contentOnly"}),n.updateBlockListSettings(e,{...t.getBlockListSettings(e),templateLock:"contentOnly"}),n.updateSettings({focusMode:r}),n.__unstableSetTemporarilyEditingAsBlocks()}}function rr(){return{type:"START_DRAGGING"}}function ir(){return{type:"STOP_DRAGGING"}}function sr(e){return{type:"SET_BLOCK_EXPANDED_IN_LIST_VIEW",clientId:e}}function lr(e){return{type:"SET_INSERTION_POINT",value:e}}const ar=e=>({select:t,dispatch:n})=>{n.selectBlock(e),n.__unstableMarkNextChangeAsNotPersistent(),n.updateBlockAttributes(e,{templateLock:void 0}),n.updateBlockListSettings(e,{...t.getBlockListSettings(e),templateLock:!1});const o=t.getSettings().focusMode;n.updateSettings({focusMode:!0}),n.__unstableSetTemporarilyEditingAsBlocks(e,o)},cr=(e=100)=>({select:t,dispatch:n})=>{if(100!==e){const e=t.getBlockSelectionStart(),o=t.getSectionRootClientId();if(e){let r;if(o){const n=t.getBlockOrder(o);r=n?.includes(e)?e:t.getBlockParents(e).find((e=>n.includes(e)))}else r=t.getBlockHierarchyRootClientId(e);r?n.selectBlock(r):n.clearSelectedBlock(),(0,Uo.speak)((0,T.__)("You are currently in zoom-out mode."))}}n({type:"SET_ZOOM_LEVEL",zoom:e})};function ur(){return{type:"RESET_ZOOM_LEVEL"}}function dr(e,t){return{type:"TOGGLE_BLOCK_SPOTLIGHT",clientId:e,hasBlockSpotlight:t}}const pr=window.wp.notices,hr=window.wp.preferences,gr="";function mr(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return("string"==typeof n||n instanceof pe.RichTextData)&&-1!==n.toString().indexOf(gr)}))}function fr(e){for(const[t,n]of Object.entries(e.attributes))if("rich-text"===n.source||"html"===n.source)return t}const br=e=>Array.isArray(e)?e:[e],kr=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(vr(e))},vr=e=>({select:t,dispatch:n})=>{const o=t.getTemplate(),r=t.getTemplateLock(),i=!o||"all"!==r||(0,p.doBlocksMatchTemplate)(e,o);if(i!==t.isValidTemplate())return n.setTemplateValidity(i),i};function _r(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function yr(e){return I()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function xr(e,t,n={uniqueByBlock:!1}){return"boolean"==typeof n&&(n={uniqueByBlock:n}),{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:br(e),attributes:t,options:n}}function Sr(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function wr(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}function Cr(){return I()('wp.data.dispatch( "core/block-editor" ).hoverBlock',{since:"6.9",version:"7.1"}),{type:"DO_NOTHING"}}const Br=(e,t=!1)=>({select:n,dispatch:o})=>{const r=n.getPreviousBlockClientId(e);if(r)o.selectBlock(r,-1);else if(t){const t=n.getBlockRootClientId(e);t&&o.selectBlock(t,-1)}},Ir=e=>({select:t,dispatch:n})=>{const o=t.getNextBlockClientId(e);o&&n.selectBlock(o)};function jr(){return{type:"START_MULTI_SELECT"}}function Er(){return{type:"STOP_MULTI_SELECT"}}const Tr=(e,t,n=0)=>({select:o,dispatch:r})=>{if(o.getBlockRootClientId(e)!==o.getBlockRootClientId(t))return;r({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=o.getSelectedBlockCount();(0,Uo.speak)((0,T.sprintf)((0,T._n)("%s block selected.","%s blocks selected.",i),i),"assertive")};function Mr(){return{type:"CLEAR_SELECTED_BLOCK"}}function Pr(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}const Rr=(e,t,n,o=0,r)=>({select:i,dispatch:s,registry:l})=>{e=br(e),t=br(t);const a=i.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}l.batch((()=>{s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s.ensureDefaultBlock()}))};function Ar(e,t){return Rr(e,t)}const Nr=e=>(t,n)=>({select:o,dispatch:r})=>{o.canMoveBlocks(t)&&r({type:e,clientIds:br(t),rootClientId:n})},Lr=Nr("MOVE_BLOCKS_DOWN"),Dr=Nr("MOVE_BLOCKS_UP"),Or=(e,t="",n="",o)=>({select:r,dispatch:i})=>{if(r.canMoveBlocks(e)){if(t!==n){if(!r.canRemoveBlocks(e))return;if(!r.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}};function zr(e,t="",n="",o){return Or([e],t,n,o)}function Vr(e,t,n,o,r){return Fr([e],t,n,o,0,r)}const Fr=(e,t,n,o=!0,r=0,i)=>({select:s,dispatch:l})=>{null!==r&&"object"==typeof r&&(i=r,r=0,I()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=br(e);const a=[];for(const t of e){s.canInsertBlockType(t.name,n)&&a.push(t)}a.length&&l({type:"INSERT_BLOCKS",blocks:a,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:i})};function Hr(e,t,n={}){const{__unstableWithInserter:o,operation:r,nearestSide:i}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o,operation:r,nearestSide:i}}const Ur=()=>({select:e,dispatch:t})=>{e.isBlockInsertionPointVisible()&&t({type:"HIDE_INSERTION_POINT"})};function Gr(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const $r=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});const n=e.getBlocks(),o=e.getTemplate(),r=(0,p.synchronizeBlocksWithTemplate)(n,o);t.resetBlocks(r)},Wr=e=>({registry:t,select:n,dispatch:o})=>{const r=n.getSelectionStart(),i=n.getSelectionEnd();if(r.clientId===i.clientId)return;if(!r.attributeKey||!i.attributeKey||void 0===r.offset||void 0===i.offset)return!1;const s=n.getBlockRootClientId(r.clientId);if(s!==n.getBlockRootClientId(i.clientId))return;const l=n.getBlockOrder(s);let a,c;l.indexOf(r.clientId)>l.indexOf(i.clientId)?(a=i,c=r):(a=r,c=i);const u=e?c:a,d=n.getBlock(u.clientId),h=(0,p.getBlockType)(d.name);if(!h.merge)return;const g=a,m=c,f=n.getBlock(g.clientId),b=n.getBlock(m.clientId),k=f.attributes[g.attributeKey],v=b.attributes[m.attributeKey];let _=(0,pe.create)({html:k}),y=(0,pe.create)({html:v});_=(0,pe.remove)(_,g.offset,_.text.length),y=(0,pe.insert)(y,gr,0,m.offset);const x=(0,p.cloneBlock)(f,{[g.attributeKey]:(0,pe.toHTMLString)({value:_})}),S=(0,p.cloneBlock)(b,{[m.attributeKey]:(0,pe.toHTMLString)({value:y})}),w=e?x:S,C=f.name===b.name?[w]:(0,p.switchToBlockType)(w,h.name);if(!C||!C.length)return;let B;if(e){const e=C.pop();B=h.merge(e.attributes,S.attributes)}else{const e=C.shift();B=h.merge(x.attributes,e.attributes)}const I=mr(B),j=B[I],E=(0,pe.create)({html:j}),T=E.text.indexOf(gr),M=(0,pe.remove)(E,T,T+1),P=(0,pe.toHTMLString)({value:M});B[I]=P;const R=n.getSelectedBlockClientIds(),A=[...e?C:[],{...d,attributes:{...d.attributes,...B}},...e?[]:C];t.batch((()=>{o.selectionChange(d.clientId,I,T,T),o.replaceBlocks(R,A,0,n.getSelectedBlocksInitialCaretPosition())}))},Kr=(e=[])=>({registry:t,select:n,dispatch:o})=>{const r=n.getSelectionStart(),i=n.getSelectionEnd(),s=n.getBlockRootClientId(r.clientId),l=n.getBlockRootClientId(i.clientId);if(s!==l)return;const a=n.getBlockOrder(s);let c,u;a.indexOf(r.clientId)>a.indexOf(i.clientId)?(c=i,u=r):(c=r,u=i);const d=c,h=u,g=n.getBlock(d.clientId),m=n.getBlock(h.clientId),f=(0,p.getBlockType)(g.name),b=(0,p.getBlockType)(m.name),k="string"==typeof d.attributeKey?d.attributeKey:fr(f),v="string"==typeof h.attributeKey?h.attributeKey:fr(b),_=n.getBlockAttributes(d.clientId),y=_?.metadata?.bindings;if(y?.[k]){if(e.length){const{createWarningNotice:e}=t.dispatch(pr.store);return void e((0,T.__)("Blocks can't be inserted into other blocks with bindings"),{type:"snackbar"})}return void o.insertAfterBlock(d.clientId)}if(!k||!v||void 0===r.offset||void 0===i.offset)return;if(d.clientId===h.clientId&&k===v&&d.offset===h.offset)if(e.length){if((0,p.isUnmodifiedDefaultBlock)(g))return void o.replaceBlocks([d.clientId],e,e.length-1,-1)}else if(!n.getBlockOrder(d.clientId).length){let e=function(){const e=(0,p.getDefaultBlockName)();return n.canInsertBlockType(e,s)?(0,p.createBlock)(e):(0,p.createBlock)(n.getBlockName(d.clientId))};const t=_[k].length;if(0===d.offset&&t)return void o.insertBlocks([e()],n.getBlockIndex(d.clientId),s,!1);if(d.offset===t)return void o.insertBlocks([e()],n.getBlockIndex(d.clientId)+1,s)}const x=g.attributes[k],S=m.attributes[v];let w=(0,pe.create)({html:x}),C=(0,pe.create)({html:S});w=(0,pe.remove)(w,d.offset,w.text.length),C=(0,pe.remove)(C,0,h.offset);let B={...g,innerBlocks:g.clientId===m.clientId?[]:g.innerBlocks,attributes:{...g.attributes,[k]:(0,pe.toHTMLString)({value:w})}},I={...m,clientId:g.clientId===m.clientId?(0,p.createBlock)(m.name).clientId:m.clientId,attributes:{...m.attributes,[v]:(0,pe.toHTMLString)({value:C})}};const j=(0,p.getDefaultBlockName)();if(g.clientId===m.clientId&&j&&I.name!==j&&n.canInsertBlockType(j,s)){const e=(0,p.switchToBlockType)(I,j);1===e?.length&&(I=e[0])}if(!e.length)return void o.replaceBlocks(n.getSelectedBlockClientIds(),[B,I]);let E;const M=[],P=[...e],R=P.shift(),A=(0,p.getBlockType)(B.name),N=A.merge&&R.name===A.name?[R]:(0,p.switchToBlockType)(R,A.name);if(N?.length){const e=N.shift();B={...B,attributes:{...B.attributes,...A.merge(B.attributes,e.attributes)}},M.push(B),E={clientId:B.clientId,attributeKey:k,offset:(0,pe.create)({html:B.attributes[k]}).text.length},P.unshift(...N)}else(0,p.isUnmodifiedBlock)(B)||M.push(B),M.push(R);const L=P.pop(),D=(0,p.getBlockType)(I.name);if(P.length&&M.push(...P),L){const e=D.merge&&D.name===L.name?[L]:(0,p.switchToBlockType)(L,D.name);if(e?.length){const t=e.pop();M.push({...I,attributes:{...I.attributes,...D.merge(t.attributes,I.attributes)}}),M.push(...e),E={clientId:I.clientId,attributeKey:v,offset:(0,pe.create)({html:t.attributes[v]}).text.length}}else M.push(L),(0,p.isUnmodifiedBlock)(I)||M.push(I)}else(0,p.isUnmodifiedBlock)(I)||M.push(I);t.batch((()=>{o.replaceBlocks(n.getSelectedBlockClientIds(),M,M.length-1,0),E&&o.selectionChange(E.clientId,E.attributeKey,E.offset,E.offset)}))},Zr=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),o=e.getSelectionEnd();t.selectionChange({start:{clientId:n.clientId},end:{clientId:o.clientId}})},qr=(e,t)=>({registry:n,select:o,dispatch:r})=>{const i=e,s=t,l=o.getBlock(i),a=(0,p.getBlockType)(l.name);if(!a||"disabled"===o.getBlockEditingMode(i)||"disabled"===o.getBlockEditingMode(s))return;const c=o.getBlock(s);if(!a.merge&&(0,p.getBlockSupport)(l.name,"__experimentalOnMerge")){const e=(0,p.switchToBlockType)(c,a.name);if(1!==e?.length)return void r.selectBlock(l.clientId);const[t]=e;return t.innerBlocks.length<1?void r.selectBlock(l.clientId):void n.batch((()=>{r.insertBlocks(t.innerBlocks,void 0,i),r.removeBlock(s),r.selectBlock(t.innerBlocks[0].clientId);const e=o.getNextBlockClientId(i);if(e&&o.getBlockName(i)===o.getBlockName(e)){const t=o.getBlockAttributes(i),n=o.getBlockAttributes(e);Object.keys(t).every((e=>t[e]===n[e]))&&(r.moveBlocksToPosition(o.getBlockOrder(e),e,i),r.removeBlock(e,!1))}}))}if((0,p.isUnmodifiedDefaultBlock)(l))return void r.removeBlock(i,o.isBlockSelected(i));if((0,p.isUnmodifiedDefaultBlock)(c))return void r.removeBlock(s,o.isBlockSelected(s));if(!a.merge)return void((0,p.isUnmodifiedBlock)(c,"content")?r.removeBlock(s,o.isBlockSelected(s)):r.selectBlock(l.clientId));const u=(0,p.getBlockType)(c.name),{clientId:d,attributeKey:h,offset:g}=o.getSelectionStart(),m=(d===i?a:u).attributes[h],f=(d===i||d===s)&&void 0!==h&&void 0!==g&&!!m;m||("number"==typeof h?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof h):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const b=(0,p.cloneBlock)(l),k=(0,p.cloneBlock)(c);if(f){const e=d===i?b:k,t=e.attributes[h],n=(0,pe.insert)((0,pe.create)({html:t}),gr,g,g);e.attributes[h]=(0,pe.toHTMLString)({value:n})}const v=l.name===c.name?[k]:(0,p.switchToBlockType)(k,l.name);if(!v||!v.length)return;const _=a.merge(b.attributes,v[0].attributes);if(f){const e=mr(_),t=_[e],n=(0,pe.create)({html:t}),o=n.text.indexOf(gr),i=(0,pe.remove)(n,o,o+1),s=(0,pe.toHTMLString)({value:i});_[e]=s,r.selectionChange(l.clientId,e,o,o)}r.replaceBlocks([l.clientId,c.clientId],[{...l,attributes:{...l.attributes,..._}},...v.slice(1)],0)},Yr=(e,t=!0)=>Zo(e,t);function Xr(e,t){return Yr([e],t)}function Qr(e,t,n=!1,o=0){return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function Jr(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function ei(){return{type:"START_TYPING"}}function ti(){return{type:"STOP_TYPING"}}function ni(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function oi(){return{type:"STOP_DRAGGING_BLOCKS"}}function ri(){return I()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function ii(){return I()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function si(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const li=(e,t,n)=>({dispatch:o})=>{const r=(0,p.getDefaultBlockName)();if(!r)return;const i=(0,p.createBlock)(r,e);return o.insertBlock(i,n,t)};function ai(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function ci(e){return $o(e,{stripExperimentalSettings:!0})}function ui(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function di(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function pi(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const hi=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:t=e=>setTimeout(e,100)}=window;t((()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},gi=e=>({registry:t})=>{t.dispatch(hr.store).set("core","editorTool",e),"navigation"===e?(0,Uo.speak)((0,T.__)("You are currently in Write mode.")):"edit"===e&&(0,Uo.speak)((0,T.__)("You are currently in Design mode."))};function mi(){return I()('wp.data.dispatch( "core/block-editor" ).setBlockMovingClientId',{since:"6.7",hint:"Block moving mode feature has been removed"}),{type:"DO_NOTHING"}}const fi=(e,t=!0)=>({select:n,dispatch:o})=>{if(!e||!e.length)return;const r=n.getBlocksByClientId(e);if(r.some((e=>!e)))return;if(r.map((e=>e.name)).some((e=>!(0,p.hasBlockSupport)(e,"multiple",!0))))return;const i=n.getBlockRootClientId(e[0]),s=br(e),l=n.getBlockIndex(s[s.length-1]),a=r.map((e=>(0,p.__experimentalCloneSanitizedBlock)(e)));return o.insertBlocks(a,l+1,i,t),a.length>1&&t&&o.multiSelect(a[0].clientId,a[a.length-1].clientId),a.map((e=>e.clientId))},bi=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const r=t.getBlockIndex(e),i=o?t.getDirectInsertBlock(o):null;if(!i)return n.insertDefaultBlock({},o,r);const s={};if(i.attributesToCopy){const n=t.getBlockAttributes(e);i.attributesToCopy.forEach((e=>{n[e]&&(s[e]=n[e])}))}const l=(0,p.createBlock)(i.name,{...i.attributes,...s});return n.insertBlock(l,r,o)},ki=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const r=t.getBlockIndex(e),i=o?t.getDirectInsertBlock(o):null;if(!i)return n.insertDefaultBlock({},o,r+1);const s={};if(i.attributesToCopy){const n=t.getBlockAttributes(e);i.attributesToCopy.forEach((e=>{n[e]&&(s[e]=n[e])}))}const l=(0,p.createBlock)(i.name,{...i.attributes,...s});return n.insertBlock(l,r+1,o)};function vi(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const _i=(e,t=150)=>async({dispatch:n})=>{n(vi(e,!0)),await new Promise((e=>setTimeout(e,t))),n(vi(e,!1))};function yi(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function xi(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function Si(e,t){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e,focusModeToRevert:t}}const wi=e=>({select:t,dispatch:n})=>{if(!e||"object"!=typeof e)return void console.error("Category should be an `InserterMediaCategory` object.");if(!e.name)return void console.error("Category should have a `name` that should be unique among all media categories.");if(!e.labels?.name)return void console.error("Category should have a `labels.name`.");if(!["image","audio","video"].includes(e.mediaType))return void console.error("Category should have `mediaType` property that is one of `image|audio|video`.");if(!e.fetch||"function"!=typeof e.fetch)return void console.error("Category should have a `fetch` function defined with the following signature `(InserterMediaRequest) => Promise<InserterMediaItem[]>`.");const o=t.getRegisteredInserterMediaCategories();o.some((({name:t})=>t===e.name))?console.error(`A category is already registered with the same name: "${e.name}".`):o.some((({labels:{name:t}={}})=>t===e.labels?.name))?console.error(`A category is already registered with the same labels.name: "${e.labels.name}".`):n({type:"REGISTER_INSERTER_MEDIA_CATEGORY",category:{...e,isExternalResource:!0}})};function Ci(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function Bi(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}const Ii={reducer:ce,selectors:t,actions:i},ji=(0,g.createReduxStore)(ge,{...Ii,persist:["preferences"]}),Ei=(0,g.registerStore)(ge,{...Ii,persist:["preferences"]});function Ti(...e){const{clientId:t=null}=C();return(0,g.useSelect)((n=>G(n(ji)).getBlockSettings(t,...e)),[t,...e])}function Mi(e){I()("wp.blockEditor.useSetting",{since:"6.5",alternative:"wp.blockEditor.useSettings",note:"The new useSettings function can retrieve multiple settings at once, with better performance."});const[t]=Ti(e);return t}G(Ei).registerPrivateActions(r),G(Ei).registerPrivateSelectors(e),G(ji).registerPrivateActions(r),G(ji).registerPrivateSelectors(e);const Pi=window.wp.styleEngine,Ri="1600px",Ai="320px",Ni=1,Li=.25,Di=.75,Oi="14px";function zi({minimumFontSize:e,maximumFontSize:t,fontSize:n,minimumViewportWidth:o=Ai,maximumViewportWidth:r=Ri,scaleFactor:i=Ni,minimumFontSizeLimit:s}){if(s=Vi(s)?s:Oi,n){const o=Vi(n);if(!o?.unit)return null;const r=Vi(s,{coerceTo:o.unit});if(r?.value&&!e&&!t&&o?.value<=r?.value)return null;if(t||(t=`${o.value}${o.unit}`),!e){const t="px"===o.unit?o.value:16*o.value,n=Math.min(Math.max(1-.075*Math.log2(t),Li),Di),i=Fi(o.value*n,3);e=r?.value&&i<r?.value?`${r.value}${r.unit}`:`${i}${o.unit}`}}const l=Vi(e),a=l?.unit||"rem",c=Vi(t,{coerceTo:a});if(!l||!c)return null;const u=Vi(e,{coerceTo:"rem"}),d=Vi(r,{coerceTo:a}),p=Vi(o,{coerceTo:a});if(!d||!p||!u)return null;const h=d.value-p.value;if(!h)return null;const g=Fi(p.value/100,3),m=Fi(g,3)+a,f=Fi(((c.value-l.value)/h*100||1)*i,3);return`clamp(${e}, ${`${u.value}${u.unit} + ((1vw - ${m}) * ${f})`}, ${t})`}function Vi(e,t={}){if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:o,acceptableUnits:r}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},i=r?.join("|"),s=new RegExp(`^(\\d*\\.?\\d+)(${i}){1,1}$`),l=e.match(s);if(!l||l.length<3)return null;let[,a,c]=l,u=parseFloat(a);return"px"!==n||"em"!==c&&"rem"!==c||(u*=o,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=o,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:Fi(u,3),unit:c}}function Fi(e,t=3){const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}function Hi(e){if(!e)return{};if("object"==typeof e)return e;let t;switch(e){case"normal":case"400":t=(0,T._x)("Regular","font weight");break;case"bold":case"700":t=(0,T._x)("Bold","font weight");break;case"100":t=(0,T._x)("Thin","font weight");break;case"200":t=(0,T._x)("Extra Light","font weight");break;case"300":t=(0,T._x)("Light","font weight");break;case"500":t=(0,T._x)("Medium","font weight");break;case"600":t=(0,T._x)("Semi Bold","font weight");break;case"800":t=(0,T._x)("Extra Bold","font weight");break;case"900":t=(0,T._x)("Black","font weight");break;case"1000":t=(0,T._x)("Extra Black","font weight");break;default:t=e}return{name:t,value:e}}const Ui=[{name:(0,T._x)("Regular","font style"),value:"normal"},{name:(0,T._x)("Italic","font style"),value:"italic"}],Gi=[{name:(0,T._x)("Thin","font weight"),value:"100"},{name:(0,T._x)("Extra Light","font weight"),value:"200"},{name:(0,T._x)("Light","font weight"),value:"300"},{name:(0,T._x)("Regular","font weight"),value:"400"},{name:(0,T._x)("Medium","font weight"),value:"500"},{name:(0,T._x)("Semi Bold","font weight"),value:"600"},{name:(0,T._x)("Bold","font weight"),value:"700"},{name:(0,T._x)("Extra Bold","font weight"),value:"800"},{name:(0,T._x)("Black","font weight"),value:"900"},{name:(0,T._x)("Extra Black","font weight"),value:"1000"}];function $i(e){let t=[],n=[];const o=[],r=!e||0===e?.length;let i=!1;return e?.forEach((e=>{if("string"==typeof e.fontWeight&&/\s/.test(e.fontWeight.trim())){i=!0;let[t,o]=e.fontWeight.split(" ");t=parseInt(t.slice(0,1)),o="1000"===o?10:parseInt(o.slice(0,1));for(let e=t;e<=o;e++){const t=`${e.toString()}00`;n.some((e=>e.value===t))||n.push(Hi(t))}}const o=Hi("number"==typeof e.fontWeight?e.fontWeight.toString():e.fontWeight),r=function(e){if(!e)return{};if("object"==typeof e)return e;let t;switch(e){case"normal":t=(0,T._x)("Regular","font style");break;case"italic":t=(0,T._x)("Italic","font style");break;case"oblique":t=(0,T._x)("Oblique","font style");break;default:t=e}return{name:t,value:e}}(e.fontStyle);r&&Object.keys(r).length&&(t.some((e=>e.value===r.value))||t.push(r)),o&&Object.keys(o).length&&(n.some((e=>e.value===o.value))||i||n.push(o))})),n.some((e=>e.value>="600"))||n.push({name:(0,T._x)("Bold","font weight"),value:"700"}),t.some((e=>"italic"===e.value))||t.push({name:(0,T._x)("Italic","font style"),value:"italic"}),r&&(t=Ui,n=Gi),t=0===t.length?Ui:t,n=0===n.length?Gi:n,t.forEach((({name:e,value:t})=>{n.forEach((({name:n,value:r})=>{const i="normal"===t?n:(0,T.sprintf)((0,T._x)("%1$s %2$s","font"),n,e);o.push({key:`${t}-${r}`,name:i,style:{fontStyle:t,fontWeight:r}})}))})),{fontStyles:t,fontWeights:n,combinedStyleAndWeightOptions:o,isSystemFont:r,isVariableFont:i}}function Wi(e,t){const{size:n}=e;if(!n||"0"===n||!1===e?.fluid)return n;if(!Ki(t?.typography)&&!Ki(e))return n;let o=function(e){const t=e?.typography,n=e?.layout,o=Vi(n?.wideSize)?n?.wideSize:null;return Ki(t)&&o?{fluid:{maxViewportWidth:o,...t.fluid}}:{fluid:t?.fluid}}(t);o="object"==typeof o?.fluid?o?.fluid:{};const r=zi({minimumFontSize:e?.fluid?.min,maximumFontSize:e?.fluid?.max,fontSize:n,minimumFontSizeLimit:o?.minFontSize,maximumViewportWidth:o?.maxViewportWidth,minimumViewportWidth:o?.minViewportWidth});return r||n}function Ki(e){const t=e?.fluid;return!0===t||t&&"object"==typeof t&&Object.keys(t).length>0}function Zi(e,t){if(!(t="number"==typeof t?t.toString():t)||"string"!=typeof t)return"";if(!e||0===e.length)return t;const n=e?.reduce(((e,{value:n})=>Math.abs(parseInt(n)-parseInt(t))<Math.abs(parseInt(e)-parseInt(t))?n:e),e[0]?.value);return n}const qi="body",Yi=":root",Xi=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],valueKey:"colors",cssVarInfix:"duotone",valueFunc:({slug:e})=>`url( '#wp-duotone-${e}' )`,classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>Wi(e,t),valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",classes:[]},{path:["border","radiusSizes"],valueKey:"size",cssVarInfix:"border-radius",classes:[]}],Qi={"color.background":"color","color.text":"color","filter.duotone":"duotone","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.caption.color.text":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient",shadow:"shadow","typography.fontSize":"font-size","typography.fontFamily":"font-family"};function Ji(){return(0,m.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}function es(e,t,n,o,r){const i=[fe(e,["blocks",t,...n]),fe(e,n)];for(const s of i)if(s){const i=["custom","theme","default"];for(const l of i){const i=s[l];if(i){const s=i.find((e=>e[o]===r));if(s){if("slug"===o)return s;return es(e,t,n,"slug",s.slug)[o]===s[o]?s:void 0}}}}}function ts(e,t,n){if(!n||"string"!=typeof n){if("string"!=typeof n?.ref)return n;if(!(n=fe(e,n.ref))||n?.ref)return n}const o="var:",r="var(--wp--";let i;if(n.startsWith(o))i=n.slice(4).split("|");else{if(!n.startsWith(r)||!n.endsWith(")"))return n;i=n.slice(10,-1).split("--")}const[s,...l]=i;return"preset"===s?function(e,t,n,[o,r]){const i=Xi.find((e=>e.cssVarInfix===o));if(!i)return n;const s=es(e.settings,t,i.path,"slug",r);if(s){const{valueKey:n}=i;return ts(e,t,s[n])}return n}(e,t,n,l):"custom"===s?function(e,t,n,o){const r=fe(e.settings,["blocks",t,"custom",...o])??fe(e.settings,["custom",...o]);return r?ts(e,t,r):n}(e,t,n,l):n}function ns(e,t){if(!e||!t)return t;const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}function os(e,t){return"object"!=typeof e||"object"!=typeof t?e===t:E()(e?.styles,t?.styles)&&E()(e?.settings,t?.settings)}function rs(e,t){if(!e||!t)return e;const n=function(e,t){if(!e||!t)return e;if("string"!=typeof e&&e?.ref){const n=(0,Pi.getCSSValueFromRawStyle)(fe(t,e.ref));if(n?.ref)return;return void 0===n?e:n}return e}(e,t);return n?.url&&(n.url=function(e,t){if(!e||!t||!Array.isArray(t))return e;const n=t.find((t=>t?.name===e));return n?.href?n?.href:e}(n.url,t?._links?.["wp:theme-file"])),n}const is=(0,h.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}});is.displayName="GlobalStylesContext";const ss={settings:{},styles:{}},ls=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","background.backgroundPosition","border.color","border.radius","border.style","border.width","border.radiusSizes","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.aspectRatio","dimensions.minHeight","layout.contentSize","layout.definitions","layout.wideSize","lightbox.enabled","lightbox.allowEditing","position.fixed","position.sticky","spacing.customSpacingSize","spacing.defaultSpacingSizes","spacing.spacingSizes","spacing.spacingScale","spacing.blockGap","spacing.margin","spacing.padding","spacing.units","typography.fluid","typography.customFontSize","typography.defaultFontSizes","typography.dropCap","typography.fontFamilies","typography.fontSizes","typography.fontStyle","typography.fontWeight","typography.letterSpacing","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.textTransform","typography.writingMode"],as=()=>{const{user:e,setUserConfig:t}=(0,h.useContext)(is),n={settings:e.settings,styles:e.styles};return[!!n&&!E()(n,ss),(0,h.useCallback)((()=>t(ss)),[t])]};function cs(e,t,n="all"){const{setUserConfig:o,...r}=(0,h.useContext)(is),i=t?".blocks."+t:"",s=e?"."+e:"",l=`settings${i}${s}`,a=`settings${s}`,c="all"===n?"merged":n;return[(0,h.useMemo)((()=>{const t=r[c];if(!t)throw"Unsupported source";if(e)return fe(t,l)??fe(t,a);let n={};return ls.forEach((e=>{const o=fe(t,`settings${i}.${e}`)??fe(t,`settings.${e}`);void 0!==o&&(n=me(n,e.split("."),o))})),n}),[r,c,e,l,a,i]),e=>{o((t=>me(t,l.split("."),e)))}]}function us(e,t,n="all",{shouldDecodeEncode:o=!0}={}){const{merged:r,base:i,user:s,setUserConfig:l}=(0,h.useContext)(is),a=e?"."+e:"",c=t?`styles.blocks.${t}${a}`:`styles${a}`;let u,d;switch(n){case"all":u=fe(r,c),d=o?ts(r,t,u):u;break;case"user":u=fe(s,c),d=o?ts(r,t,u):u;break;case"base":u=fe(i,c),d=o?ts(i,t,u):u;break;default:throw"Unsupported source"}return[d,n=>{l((i=>me(i,c.split("."),o?function(e,t,n,o){if(!o)return o;const r=Qi[n],i=Xi.find((e=>e.cssVarInfix===r));if(!i)return o;const{valueKey:s,path:l}=i,a=es(e,t,l,s,o);return a?`var:preset|${r}|${a.slug}`:o}(r.settings,t,e,n):n)))}]}function ds(e,t,n){const{supportedStyles:o,supports:r}=(0,g.useSelect)((e=>({supportedStyles:G(e(p.store)).getSupportedStyles(t,n),supports:e(p.store).getBlockType(t)?.supports})),[t,n]);return(0,h.useMemo)((()=>{const t={...e};return o.includes("fontSize")||(t.typography={...t.typography,fontSizes:{},customFontSize:!1,defaultFontSizes:!1}),o.includes("fontFamily")||(t.typography={...t.typography,fontFamilies:{}}),t.color={...t.color,text:t.color?.text&&o.includes("color"),background:t.color?.background&&(o.includes("background")||o.includes("backgroundColor")),button:t.color?.button&&o.includes("buttonColor"),heading:t.color?.heading&&o.includes("headingColor"),link:t.color?.link&&o.includes("linkColor"),caption:t.color?.caption&&o.includes("captionColor")},o.includes("background")||(t.color.gradients=[],t.color.customGradient=!1),o.includes("filter")||(t.color.defaultDuotone=!1,t.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textAlign","textTransform","textDecoration","writingMode"].forEach((e=>{o.includes(e)||(t.typography={...t.typography,[e]:!1})})),o.includes("columnCount")||(t.typography={...t.typography,textColumns:!1}),["contentSize","wideSize"].forEach((e=>{o.includes(e)||(t.layout={...t.layout,[e]:!1})})),["padding","margin","blockGap"].forEach((e=>{o.includes(e)||(t.spacing={...t.spacing,[e]:!1});const n=Array.isArray(r?.spacing?.[e])?r?.spacing?.[e]:r?.spacing?.[e]?.sides;n?.length&&t.spacing?.[e]&&(t.spacing={...t.spacing,[e]:{...t.spacing?.[e],sides:n}})})),["aspectRatio","minHeight"].forEach((e=>{o.includes(e)||(t.dimensions={...t.dimensions,[e]:!1})})),["radius","color","style","width"].forEach((e=>{o.includes("border"+e.charAt(0).toUpperCase()+e.slice(1))||(t.border={...t.border,[e]:!1})})),["backgroundImage","backgroundSize"].forEach((e=>{o.includes(e)||(t.background={...t.background,[e]:!1})})),t.shadow=!!o.includes("shadow")&&t.shadow,n&&(t.typography.textAlign=!1),t}),[e,o,r,n])}function ps(e){const t=e?.color?.palette?.custom,n=e?.color?.palette?.theme,o=e?.color?.palette?.default,r=e?.color?.defaultPalette;return(0,h.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,T._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,T._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,T._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,o,r])}function hs(e){const t=e?.color?.gradients?.custom,n=e?.color?.gradients?.theme,o=e?.color?.gradients?.default,r=e?.color?.defaultGradients;return(0,h.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,T._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),r&&o&&o.length&&e.push({name:(0,T._x)("Default","Indicates this palette comes from WordPress."),gradients:o}),t&&t.length&&e.push({name:(0,T._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,o,r])}function gs(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=gs(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}const ms=function(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=gs(e))&&(o&&(o+=" "),o+=t);return o},fs=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.entries(e).map((([e,t])=>[e,fs(t)])).filter((([,e])=>void 0!==e));return t.length?Object.fromEntries(t):void 0};function bs(e,t,n,o,r,i){if(Object.values(e??{}).every((e=>!e)))return n;if(1===i.length&&n.innerBlocks.length===o.length)return n;let s=o[0]?.attributes;if(i.length>1&&o.length>1){if(!o[r])return n;s=o[r]?.attributes}let l=n;return Object.entries(e).forEach((([e,n])=>{n&&t[e].forEach((e=>{const t=fe(s,e);t&&(l={...l,attributes:me(l.attributes,e,t)})}))})),l}function ks(e,t,n){const o=(0,p.getBlockSupport)(e,t),r=o?.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}const vs=new WeakMap;function _s({id:e,css:t}){return ys({id:e,css:t})}function ys({id:e,css:t,assets:n,__unstableType:o,variation:r,clientId:i}={}){const{setStyleOverride:s,deleteStyleOverride:l}=G((0,g.useDispatch)(ji)),a=(0,g.useRegistry)(),c=(0,h.useId)();(0,h.useEffect)((()=>{if(!t&&!n)return;const u=e||c,d={id:e,css:t,assets:n,__unstableType:o,variation:r,clientId:i};return vs.get(a)||vs.set(a,[]),vs.get(a).push([u,d]),window.queueMicrotask((()=>{vs.get(a)?.length&&a.batch((()=>{vs.get(a).forEach((e=>{s(...e)})),vs.set(a,[])}))})),()=>{const e=vs.get(a)?.find((([e])=>e===u));e?vs.set(a,vs.get(a).filter((([e])=>e!==u))):l(u)}}),[e,t,i,n,o,c,s,l,a])}function xs(e,t){const[n,o,r,i,s,l,a,c,u,d,p,g,m,f,b,k,v,_,y,x,S,w,C,B,I,j,E,T,M,P,R,A,N,L,D,O,z,V,F,H,U,G,$,W,K,Z,q,Y,X,Q,J,ee,te,ne,oe,re,ie]=Ti("background.backgroundImage","background.backgroundSize","typography.fontFamilies.custom","typography.fontFamilies.default","typography.fontFamilies.theme","typography.defaultFontSizes","typography.fontSizes.custom","typography.fontSizes.default","typography.fontSizes.theme","typography.customFontSize","typography.fontStyle","typography.fontWeight","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.writingMode","typography.textTransform","typography.letterSpacing","spacing.padding","spacing.margin","spacing.blockGap","spacing.defaultSpacingSizes","spacing.customSpacingSize","spacing.spacingSizes.custom","spacing.spacingSizes.default","spacing.spacingSizes.theme","spacing.units","dimensions.aspectRatio","dimensions.minHeight","layout","border.color","border.radius","border.style","border.width","border.radiusSizes","color.custom","color.palette.custom","color.customDuotone","color.palette.theme","color.palette.default","color.defaultPalette","color.defaultDuotone","color.duotone.custom","color.duotone.theme","color.duotone.default","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients","color.customGradient","color.background","color.link","color.text","color.heading","color.button","shadow");return ds((0,h.useMemo)((()=>({background:{backgroundImage:n,backgroundSize:o},color:{palette:{custom:V,theme:H,default:U},gradients:{custom:q,theme:Y,default:X},duotone:{custom:W,theme:K,default:Z},defaultGradients:Q,defaultPalette:G,defaultDuotone:$,custom:z,customGradient:J,customDuotone:F,background:ee,link:te,heading:oe,button:re,text:ne},typography:{fontFamilies:{custom:r,default:i,theme:s},fontSizes:{custom:a,default:c,theme:u},customFontSize:d,defaultFontSizes:l,fontStyle:p,fontWeight:g,lineHeight:m,textAlign:f,textColumns:b,textDecoration:k,textTransform:_,letterSpacing:y,writingMode:v},spacing:{spacingSizes:{custom:I,default:j,theme:E},customSpacingSize:B,defaultSpacingSizes:C,padding:x,margin:S,blockGap:w,units:T},border:{color:A,radius:N,style:L,width:D,radiusSizes:O},dimensions:{aspectRatio:M,minHeight:P},layout:R,parentLayout:t,shadow:ie})),[n,o,r,i,s,l,a,c,u,d,p,g,m,f,b,k,_,y,v,x,S,w,C,B,I,j,E,T,M,P,R,t,A,N,L,D,O,z,V,F,H,U,G,$,W,K,Z,q,Y,X,Q,J,ee,te,ne,oe,re,ie]),e)}const Ss=(0,h.memo)((function({index:e,useBlockProps:t,setAllWrapperProps:n,...o}){const r=t(o),i=t=>n((n=>{const o=[...n];return o[e]=t,o}));return(0,h.useEffect)((()=>(i(r),()=>{i(void 0)}))),null}));(0,f.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,p.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));const ws=window.wp.components;var Cs={default:(0,ws.createSlotFill)("BlockControls"),block:(0,ws.createSlotFill)("BlockControlsBlock"),inline:(0,ws.createSlotFill)("BlockFormatControls"),other:(0,ws.createSlotFill)("BlockControlsOther"),parent:(0,ws.createSlotFill)("BlockControlsParent")};function Bs({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:o=!1}){const r=function(e,t){const n=C();return n[b]?Cs[e]?.Fill:n[k]&&t?Cs.parent.Fill:null}(e,o);if(!r)return null;const i=(0,d.jsxs)(d.Fragment,{children:["default"===e&&(0,d.jsx)(ws.ToolbarGroup,{controls:t}),n]});return(0,d.jsx)(ws.__experimentalStyleProvider,{document,children:(0,d.jsx)(r,{children:e=>{const{forwardedContext:t=[]}=e;return t.reduce(((e,[t,n])=>(0,d.jsx)(t,{...n,children:e})),i)}})})}const Is=window.wp.warning;var js=n.n(Is);const{ComponentsContext:Es}=G(ws.privateApis);function Ts({group:e="default",...t}){const n=(0,h.useContext)(ws.__experimentalToolbarContext),o=(0,h.useContext)(Es),r=(0,h.useMemo)((()=>({forwardedContext:[[ws.__experimentalToolbarContext.Provider,{value:n}],[Es.Provider,{value:o}]]})),[n,o]),i=Cs[e],s=(0,ws.__experimentalUseSlotFills)(i.name);if(!i)return js()(`Unknown BlockControls group "${e}" provided.`),null;if(!s?.length)return null;const{Slot:l}=i,a=(0,d.jsx)(l,{...t,bubblesVirtually:!0,fillProps:r});return"default"===e?a:(0,d.jsx)(ws.ToolbarGroup,{children:a})}const Ms=Bs;Ms.Slot=Ts;const Ps=e=>(0,d.jsx)(Bs,{group:"inline",...e});Ps.Slot=e=>(0,d.jsx)(Ts,{group:"inline",...e});var Rs=Ms,As=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})}),Ns=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"})}),Ls=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})}),Ds=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})}),Os=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"})}),zs=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})}),Vs=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"})});const Fs={default:{name:"default",slug:"flow",className:"is-layout-flow",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},constrained:{name:"constrained",slug:"constrained",className:"is-layout-constrained",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > :where(:not(.alignleft):not(.alignright):not(.alignfull))",rules:{"max-width":"var(--wp--style--global--content-size)","margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > .alignwide",rules:{"max-width":"var(--wp--style--global--wide-size)"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},flex:{name:"flex",slug:"flex",className:"is-layout-flex",displayMode:"flex",baseStyles:[{selector:"",rules:{"flex-wrap":"wrap","align-items":"center"}},{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]},grid:{name:"grid",slug:"grid",className:"is-layout-grid",displayMode:"grid",baseStyles:[{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]}};function Hs(e,t=""){return e.split(",").map((e=>`${e}${t?` ${t}`:""}`)).join(",")}function Us(e,t=Fs,n,o){let r="";return t?.[n]?.spacingStyles?.length&&o&&t[n].spacingStyles.forEach((t=>{r+=`${Hs(e,t.selector.trim())} { `,r+=Object.entries(t.rules).map((([e,t])=>`${e}: ${t||o}`)).join("; "),r+="; }"})),r}function Gs(e){const{contentSize:t,wideSize:n,type:o="default"}=e,r={},i=/^(?!0)\d+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i;return i.test(t)&&"constrained"===o&&(r.none=(0,T.sprintf)((0,T.__)("Max %s wide"),t)),i.test(n)&&(r.wide=(0,T.sprintf)((0,T.__)("Max %s wide"),n)),r}var $s=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z"})}),Ws=(0,d.jsxs)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ue.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,d.jsx)(ue.Path,{d:"m4.5 7.5v9h1.5v-9z"}),(0,d.jsx)(ue.Path,{d:"m18 7.5v9h1.5v-9z"})]}),Ks=(0,d.jsxs)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ue.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,d.jsx)(ue.Path,{d:"m7.5 6h9v-1.5h-9z"}),(0,d.jsx)(ue.Path,{d:"m7.5 19.5h9v-1.5h-9z"})]}),Zs=(0,d.jsxs)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ue.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,d.jsx)(ue.Path,{d:"m16.5 6h-9v-1.5h9z"})]}),qs=(0,d.jsxs)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ue.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,d.jsx)(ue.Path,{d:"m18 16.5v-9h1.5v9z"})]}),Ys=(0,d.jsxs)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ue.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,d.jsx)(ue.Path,{d:"m16.5 19.5h-9v-1.5h9z"})]}),Xs=(0,d.jsxs)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ue.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,d.jsx)(ue.Path,{d:"m4.5 16.5v-9h1.5v9z"})]});const Qs=8,Js=["top","right","bottom","left"],el={top:void 0,right:void 0,bottom:void 0,left:void 0},tl={custom:$s,axial:$s,horizontal:Ws,vertical:Ks,top:Zs,right:qs,bottom:Ys,left:Xs},nl={default:(0,T.__)("Spacing control"),top:(0,T.__)("Top"),bottom:(0,T.__)("Bottom"),left:(0,T.__)("Left"),right:(0,T.__)("Right"),mixed:(0,T.__)("Mixed"),vertical:(0,T.__)("Vertical"),horizontal:(0,T.__)("Horizontal"),axial:(0,T.__)("Horizontal & vertical"),custom:(0,T.__)("Custom")},ol={axial:"axial",top:"top",right:"right",bottom:"bottom",left:"left",custom:"custom"};function rl(e){return!!e?.includes&&("0"===e||e.includes("var:preset|spacing|"))}function il(e,t){if(!rl(e))return e;const n=al(e),o=t.find((e=>String(e.slug)===n));return o?.size}function sl(e,t){if(!e||rl(e)||"0"===e)return e;const n=t.find((t=>String(t.size)===String(e)));return n?.slug?`var:preset|spacing|${n.slug}`:e}function ll(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function al(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}function cl(e,t){if(!e||!e.length)return!1;const n=e.includes("horizontal")||e.includes("left")&&e.includes("right"),o=e.includes("vertical")||e.includes("top")&&e.includes("bottom");return"horizontal"===t?n:"vertical"===t?o:n||o}function ul(e,t="0"){const n=function(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:e?.top,left:t?e:e?.left}}(e);if(!n)return null;const o=ll(n?.top)||t,r=ll(n?.left)||t;return o===r?o:`${o} ${r}`}var dl=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})}),pl=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})}),hl=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})}),gl=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})}),ml=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})});const fl={top:{icon:dl,title:(0,T._x)("Align top","Block vertical alignment setting")},center:{icon:pl,title:(0,T._x)("Align middle","Block vertical alignment setting")},bottom:{icon:hl,title:(0,T._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:gl,title:(0,T._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:ml,title:(0,T._x)("Space between","Block vertical alignment setting")}},bl=["top","center","bottom"];var kl=function({value:e,onChange:t,controls:n=bl,isCollapsed:o=!0,isToolbar:r}){const i=fl[e],s=fl.top,l=r?ws.ToolbarGroup:ws.ToolbarDropdownMenu,a=r?{isCollapsed:o}:{};return(0,d.jsx)(l,{icon:i?i.icon:s.icon,label:(0,T._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map((n=>{return{...fl[n],isActive:e===n,role:o?"menuitemradio":void 0,onClick:(r=n,()=>t(e===r?void 0:r))};var r})),...a})};const vl=e=>(0,d.jsx)(kl,{...e,isToolbar:!1}),_l=e=>(0,d.jsx)(kl,{...e,isToolbar:!0}),yl={left:As,center:Ns,right:Ls,"space-between":Ds,stretch:Os};var xl=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:o,popoverProps:r,isToolbar:i}){const s=e=>{n(e===o?void 0:e)},l=o?yl[o]:yl.left,a=[{name:"left",icon:As,title:(0,T.__)("Justify items left"),isActive:"left"===o,onClick:()=>s("left")},{name:"center",icon:Ns,title:(0,T.__)("Justify items center"),isActive:"center"===o,onClick:()=>s("center")},{name:"right",icon:Ls,title:(0,T.__)("Justify items right"),isActive:"right"===o,onClick:()=>s("right")},{name:"space-between",icon:Ds,title:(0,T.__)("Space between items"),isActive:"space-between"===o,onClick:()=>s("space-between")},{name:"stretch",icon:Os,title:(0,T.__)("Stretch items"),isActive:"stretch"===o,onClick:()=>s("stretch")}],c=i?ws.ToolbarGroup:ws.ToolbarDropdownMenu,u=i?{isCollapsed:t}:{};return(0,d.jsx)(c,{icon:l,popoverProps:r,label:(0,T.__)("Change items justification"),controls:a.filter((t=>e.includes(t.name))),...u})};const Sl=e=>(0,d.jsx)(xl,{...e,isToolbar:!1}),wl=e=>(0,d.jsx)(xl,{...e,isToolbar:!0}),Cl={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Bl={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},Il={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},jl="center",El="top",Tl=["wrap","nowrap"];var Ml={name:"flex",label:(0,T.__)("Flex"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowOrientation:o=!0,allowJustification:r=!0}=n;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(ws.Flex,{children:[r&&(0,d.jsx)(ws.FlexItem,{children:(0,d.jsx)(Al,{layout:e,onChange:t})}),o&&(0,d.jsx)(ws.FlexItem,{children:(0,d.jsx)(Ll,{layout:e,onChange:t})})]}),(0,d.jsx)(Nl,{layout:e,onChange:t})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){const{allowVerticalAlignment:o=!0,allowJustification:r=!0}=n;return r||o?(0,d.jsxs)(Rs,{group:"block",__experimentalShareWithChildBlocks:!0,children:[r&&(0,d.jsx)(Al,{layout:e,onChange:t,isToolbar:!0}),o&&(0,d.jsx)(Pl,{layout:e,onChange:t})]}):null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:i=Fs}){const{orientation:s="horizontal"}=t,l=n?.spacing?.blockGap&&!ks(o,"spacing","blockGap")?ul(n?.spacing?.blockGap,"0.5em"):void 0,a=Cl[t.justifyContent],c=Tl.includes(t.flexWrap)?t.flexWrap:"wrap",u=Il[t.verticalAlignment],d=Bl[t.justifyContent]||Bl.left;let p="";const h=[];return c&&"wrap"!==c&&h.push(`flex-wrap: ${c}`),"horizontal"===s?(u&&h.push(`align-items: ${u}`),a&&h.push(`justify-content: ${a}`)):(u&&h.push(`justify-content: ${u}`),h.push("flex-direction: column"),h.push(`align-items: ${d}`)),h.length&&(p=`${Hs(e)} {\n\t\t\t\t${h.join("; ")};\n\t\t\t}`),r&&l&&(p+=Us(e,i,"flex",l)),p},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Pl({layout:e,onChange:t}){const{orientation:n="horizontal"}=e,o="horizontal"===n?jl:El,{verticalAlignment:r=o}=e;return(0,d.jsx)(vl,{onChange:n=>{t({...e,verticalAlignment:n})},value:r,controls:"horizontal"===n?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]})}const Rl={placement:"bottom-start"};function Al({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:o="left",orientation:r="horizontal"}=e,i=n=>{t({...e,justifyContent:n})},s=["left","center","right"];if("horizontal"===r?s.push("space-between"):s.push("stretch"),n)return(0,d.jsx)(Sl,{allowedControls:s,value:o,onChange:i,popoverProps:Rl});const l=[{value:"left",icon:As,label:(0,T.__)("Justify items left")},{value:"center",icon:Ns,label:(0,T.__)("Justify items center")},{value:"right",icon:Ls,label:(0,T.__)("Justify items right")}];return"horizontal"===r?l.push({value:"space-between",icon:Ds,label:(0,T.__)("Space between items")}):l.push({value:"stretch",icon:Os,label:(0,T.__)("Stretch items")}),(0,d.jsx)(ws.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,T.__)("Justification"),value:o,onChange:i,className:"block-editor-hooks__flex-layout-justification-controls",children:l.map((({value:e,icon:t,label:n})=>(0,d.jsx)(ws.__experimentalToggleGroupControlOptionIcon,{value:e,icon:t,label:n},e)))})}function Nl({layout:e,onChange:t}){const{flexWrap:n="wrap"}=e;return(0,d.jsx)(ws.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Allow to wrap to multiple lines"),onChange:n=>{t({...e,flexWrap:n?"wrap":"nowrap"})},checked:"wrap"===n})}function Ll({layout:e,onChange:t}){const{orientation:n="horizontal",verticalAlignment:o,justifyContent:r}=e;return(0,d.jsxs)(ws.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,T.__)("Orientation"),value:n,onChange:n=>{let i=o,s=r;return"horizontal"===n?("space-between"===o&&(i="center"),"stretch"===r&&(s="left")):("stretch"===o&&(i="top"),"space-between"===r&&(s="left")),t({...e,orientation:n,verticalAlignment:i,justifyContent:s})},children:[(0,d.jsx)(ws.__experimentalToggleGroupControlOptionIcon,{icon:zs,value:"horizontal",label:(0,T.__)("Horizontal")}),(0,d.jsx)(ws.__experimentalToggleGroupControlOptionIcon,{icon:Vs,value:"vertical",label:(0,T.__)("Vertical")})]})}var Dl={name:"default",label:(0,T.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,style:t,blockName:n,hasBlockGapSupport:o,layoutDefinitions:r=Fs}){const i=ul(t?.spacing?.blockGap);let s="";ks(n,"spacing","blockGap")||(i?.top?s=ul(i?.top):"string"==typeof i&&(s=ul(i)));let l="";return o&&s&&(l+=Us(e,r,"default",s)),l},getOrientation:()=>"vertical",getAlignments(e,t){const n=Gs(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:n[e]})));const o=[{name:"left"},{name:"center"},{name:"right"}];if(!t){const{contentSize:t,wideSize:r}=e;t&&o.unshift({name:"full"}),r&&o.unshift({name:"wide",info:n.wide})}return o.unshift({name:"none",info:n.none}),o}},Ol=(0,h.forwardRef)((({icon:e,size:t=24,...n},o)=>(0,h.cloneElement)(e,{width:t,height:t,...n,ref:o}))),zl=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z"})}),Vl=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M16 5.5H8V4h8v1.5ZM16 20H8v-1.5h8V20ZM5 9h14v6H5V9Z"})}),Fl={name:"constrained",label:(0,T.__)("Constrained"),inspectorControls:function({layout:e,onChange:t,layoutBlockSupport:n={}}){const{wideSize:o,contentSize:r,justifyContent:i="center"}=e,{allowJustification:s=!0,allowCustomContentAndWideSize:l=!0}=n,a=[{value:"left",icon:As,label:(0,T.__)("Justify items left")},{value:"center",icon:Ns,label:(0,T.__)("Justify items center")},{value:"right",icon:Ls,label:(0,T.__)("Justify items right")}],[c]=Ti("spacing.units"),u=(0,ws.__experimentalUseCustomUnits)({availableUnits:c||["%","px","em","rem","vw"]});return(0,d.jsxs)(ws.__experimentalVStack,{spacing:4,className:"block-editor-hooks__layout-constrained",children:[l&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Content width"),labelPosition:"top",value:r||o||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:n})},units:u,prefix:(0,d.jsx)(ws.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,d.jsx)(Ol,{icon:zl})})}),(0,d.jsx)(ws.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Wide width"),labelPosition:"top",value:o||r||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:n})},units:u,prefix:(0,d.jsx)(ws.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,d.jsx)(Ol,{icon:Vl})})}),(0,d.jsx)("p",{className:"block-editor-hooks__layout-constrained-helptext",children:(0,T.__)("Customize the width for all elements that are assigned to the center or wide columns.")})]}),s&&(0,d.jsx)(ws.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,T.__)("Justification"),value:i,onChange:n=>{t({...e,justifyContent:n})},children:a.map((({value:e,icon:t,label:n})=>(0,d.jsx)(ws.__experimentalToggleGroupControlOptionIcon,{value:e,icon:t,label:n},e)))})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){const{allowJustification:o=!0}=n;return o?(0,d.jsx)(Rs,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,d.jsx)(Ul,{layout:e,onChange:t})}):null},getLayoutStyle:function({selector:e,layout:t={},style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:i=Fs}){const{contentSize:s,wideSize:l,justifyContent:a}=t,c=ul(n?.spacing?.blockGap);let u="";ks(o,"spacing","blockGap")||(c?.top?u=ul(c?.top):"string"==typeof c&&(u=ul(c)));const d="left"===a?"0 !important":"auto !important",p="right"===a?"0 !important":"auto !important";let h=s||l?`\n\t\t\t\t\t${Hs(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${s??l};\n\t\t\t\t\t\tmargin-left: ${d};\n\t\t\t\t\t\tmargin-right: ${p};\n\t\t\t\t\t}\n\t\t\t\t\t${Hs(e,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${l??s};\n\t\t\t\t\t}\n\t\t\t\t\t${Hs(e,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";if("left"===a?h+=`${Hs(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${d}; }`:"right"===a&&(h+=`${Hs(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${p}; }`),n?.spacing?.padding){(0,Pi.getCSSRules)(n).forEach((t=>{if("paddingRight"===t.key){const n="0"===t.value?"0px":t.value;h+=`\n\t\t\t\t\t${Hs(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${n} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`}else if("paddingLeft"===t.key){const n="0"===t.value?"0px":t.value;h+=`\n\t\t\t\t\t${Hs(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${n} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`}}))}return r&&u&&(h+=Us(e,i,"constrained",u)),h},getOrientation:()=>"vertical",getAlignments(e){const t=Gs(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}};const Hl={placement:"bottom-start"};function Ul({layout:e,onChange:t}){const{justifyContent:n="center"}=e;return(0,d.jsx)(Sl,{allowedControls:["left","center","right"],value:n,onChange:n=>{t({...e,justifyContent:n})},popoverProps:Hl})}const Gl={px:600,"%":100,vw:100,vh:100,em:38,rem:38,svw:100,lvw:100,dvw:100,svh:100,lvh:100,dvh:100,vi:100,svi:100,lvi:100,dvi:100,vb:100,svb:100,lvb:100,dvb:100,vmin:100,svmin:100,lvmin:100,dvmin:100,vmax:100,svmax:100,lvmax:100,dvmax:100},$l=[{value:"px",label:"px",default:0},{value:"rem",label:"rem",default:0},{value:"em",label:"em",default:0}];var Wl={name:"grid",label:(0,T.__)("Grid"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowSizingOnChildren:o=!1}=n,r=window.__experimentalEnableGridInteractivity||!!e?.columnCount,i=window.__experimentalEnableGridInteractivity||!e?.columnCount;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ql,{layout:e,onChange:t}),(0,d.jsxs)(ws.__experimentalVStack,{spacing:4,children:[r&&(0,d.jsx)(Zl,{layout:e,onChange:t,allowSizingOnChildren:o}),i&&(0,d.jsx)(Kl,{layout:e,onChange:t})]})]})},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:i=Fs}){const{minimumColumnWidth:s=null,columnCount:l=null,rowCount:a=null}=t;const c=n?.spacing?.blockGap&&!ks(o,"spacing","blockGap")?ul(n?.spacing?.blockGap,"0.5em"):void 0;let u="";const d=[];if(s&&l>0){const e=`max(${s}, ( 100% - (${c||"1.2rem"}*${l-1}) ) / ${l})`;d.push(`grid-template-columns: repeat(auto-fill, minmax(${e}, 1fr))`,"container-type: inline-size"),a&&d.push(`grid-template-rows: repeat(${a}, minmax(1rem, auto))`)}else l?(d.push(`grid-template-columns: repeat(${l}, minmax(0, 1fr))`),a&&d.push(`grid-template-rows: repeat(${a}, minmax(1rem, auto))`)):d.push(`grid-template-columns: repeat(auto-fill, minmax(min(${s||"12rem"}, 100%), 1fr))`,"container-type: inline-size");return d.length&&(u=`${Hs(e)} { ${d.join("; ")}; }`),r&&c&&(u+=Us(e,i,"grid",c)),u},getOrientation:()=>"horizontal",getAlignments:()=>[]};function Kl({layout:e,onChange:t}){const{minimumColumnWidth:n,columnCount:o,isManualPlacement:r}=e,i=n||(r||o?null:"12rem"),[s,l="rem"]=(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(i);return(0,d.jsxs)("fieldset",{className:"block-editor-hooks__grid-layout-minimum-width-control",children:[(0,d.jsx)(ws.BaseControl.VisualLabel,{as:"legend",children:(0,T.__)("Minimum column width")}),(0,d.jsxs)(ws.Flex,{gap:4,children:[(0,d.jsx)(ws.FlexItem,{isBlock:!0,children:(0,d.jsx)(ws.__experimentalUnitControl,{size:"__unstable-large",onChange:n=>{t({...e,minimumColumnWidth:""===n?void 0:n})},onUnitChange:n=>{let o;["em","rem"].includes(n)&&"px"===l?o=(s/16).toFixed(2)+n:["em","rem"].includes(l)&&"px"===n&&(o=Math.round(16*s)+n),t({...e,minimumColumnWidth:o})},value:i,units:$l,min:0,label:(0,T.__)("Minimum column width"),hideLabelFromVision:!0})}),(0,d.jsx)(ws.FlexItem,{isBlock:!0,children:(0,d.jsx)(ws.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:n=>{t({...e,minimumColumnWidth:[n,l].join("")})},value:s||0,min:0,max:Gl[l]||600,withInputField:!1,label:(0,T.__)("Minimum column width"),hideLabelFromVision:!0})})]})]})}function Zl({layout:e,onChange:t,allowSizingOnChildren:n}){const o=window.__experimentalEnableGridInteractivity?void 0:3,{columnCount:r=o,rowCount:i,isManualPlacement:s}=e;return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)("fieldset",{className:"block-editor-hooks__grid-layout-columns-and-rows-controls",children:[(!window.__experimentalEnableGridInteractivity||!s)&&(0,d.jsx)(ws.BaseControl.VisualLabel,{as:"legend",children:(0,T.__)("Columns")}),(0,d.jsxs)(ws.Flex,{gap:4,children:[(0,d.jsx)(ws.FlexItem,{isBlock:!0,children:(0,d.jsx)(ws.__experimentalNumberControl,{size:"__unstable-large",onChange:n=>{if(window.__experimentalEnableGridInteractivity){const o=""===n||"0"===n?s?1:void 0:parseInt(n,10);t({...e,columnCount:o})}else{const o=""===n||"0"===n?1:parseInt(n,10);t({...e,columnCount:o})}},value:r,min:1,label:(0,T.__)("Columns"),hideLabelFromVision:!window.__experimentalEnableGridInteractivity||!s})}),(0,d.jsx)(ws.FlexItem,{isBlock:!0,children:window.__experimentalEnableGridInteractivity&&n&&s?(0,d.jsx)(ws.__experimentalNumberControl,{size:"__unstable-large",onChange:n=>{const o=""===n||"0"===n?1:parseInt(n,10);t({...e,rowCount:o})},value:i,min:1,label:(0,T.__)("Rows")}):(0,d.jsx)(ws.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:r??1,onChange:n=>t({...e,columnCount:""===n||"0"===n?1:n}),min:1,max:16,withInputField:!1,label:(0,T.__)("Columns"),hideLabelFromVision:!0})})]})]})})}function ql({layout:e,onChange:t}){const{columnCount:n,rowCount:o,minimumColumnWidth:r,isManualPlacement:i}=e,[s,l]=(0,h.useState)(n||3),[a,c]=(0,h.useState)(o),[u,p]=(0,h.useState)(r||"12rem"),g=i||n&&!window.__experimentalEnableGridInteractivity?"manual":"auto",m="manual"===g?(0,T.__)("Grid items can be manually placed in any position on the grid."):(0,T.__)("Grid items are placed automatically depending on their order.");return(0,d.jsxs)(ws.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,T.__)("Grid item position"),value:g,onChange:i=>{"manual"===i?p(r||"12rem"):(l(n||3),c(o)),t({...e,columnCount:"manual"===i?s:null,rowCount:"manual"===i&&window.__experimentalEnableGridInteractivity?a:void 0,isManualPlacement:!("manual"!==i||!window.__experimentalEnableGridInteractivity)||void 0,minimumColumnWidth:"auto"===i?u:null})},isBlock:!0,help:window.__experimentalEnableGridInteractivity?m:void 0,children:[(0,d.jsx)(ws.__experimentalToggleGroupControlOption,{value:"auto",label:(0,T.__)("Auto")},"auto"),(0,d.jsx)(ws.__experimentalToggleGroupControlOption,{value:"manual",label:(0,T.__)("Manual")},"manual")]})}const Yl=[Dl,Ml,Fl,Wl];function Xl(e="default"){return Yl.find((t=>t.name===e))}const Ql={type:"default"},Jl=(0,h.createContext)(Ql);Jl.displayName="BlockLayoutContext";const ea=Jl.Provider;function ta(){return(0,h.useContext)(Jl)}const na=[],oa=["none","left","center","right","wide","full"],ra=["wide","full"];function ia(e=oa){e.includes("none")||(e=["none",...e]);const t=1===e.length&&"none"===e[0],[n,o,r]=(0,g.useSelect)((e=>{if(t)return[!1,!1,!1];const n=e(ji).getSettings();return[n.alignWide??!1,n.supportsLayout,n.__unstableIsBlockBasedTheme]}),[t]),i=ta();if(t)return na;const s=Xl(i?.type);if(o){const t=s.getAlignments(i,r).filter((t=>e.includes(t.name)));return 1===t.length&&"none"===t[0].name?na:t}if("default"!==s.name&&"constrained"!==s.name)return na;const l=e.filter((e=>i.alignments?i.alignments.includes(e):!(!n&&ra.includes(e))&&oa.includes(e))).map((e=>({name:e})));return 1===l.length&&"none"===l[0].name?na:l}var sa=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z"})}),la=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z"})}),aa=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z"})}),ca=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M5 4h14v11H5V4Zm11 16H8v-1.5h8V20Z"})});const ua={none:{icon:zl,title:(0,T._x)("None","Alignment option")},left:{icon:sa,title:(0,T.__)("Align left")},center:{icon:la,title:(0,T.__)("Align center")},right:{icon:aa,title:(0,T.__)("Align right")},wide:{icon:Vl,title:(0,T.__)("Wide width")},full:{icon:ca,title:(0,T.__)("Full width")}};var da=function({value:e,onChange:t,controls:n,isToolbar:o,isCollapsed:r=!0}){const i=ia(n);if(!!!i.length)return null;function s(n){t([e,"none"].includes(n)?void 0:n)}const l=ua[e],a=ua.none,c=o?ws.ToolbarGroup:ws.ToolbarDropdownMenu,u={icon:l?l.icon:a.icon,label:(0,T.__)("Align")},p=o?{isCollapsed:r,controls:i.map((({name:t})=>({...ua[t],isActive:e===t||!e&&"none"===t,role:r?"menuitemradio":void 0,onClick:()=>s(t)})))}:{toggleProps:{description:(0,T.__)("Change alignment")},children:({onClose:t})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(ws.MenuGroup,{className:"block-editor-block-alignment-control__menu-group",children:i.map((({name:n,info:o})=>{const{icon:r,title:i}=ua[n],l=n===e||!e&&"none"===n;return(0,d.jsx)(ws.MenuItem,{icon:r,iconPosition:"left",className:ms("components-dropdown-menu__menu-item",{"is-active":l}),isSelected:l,onClick:()=>{s(n),t()},role:"menuitemradio",info:o,children:i},n)}))})})};return(0,d.jsx)(c,{...u,...p})};const pa=e=>(0,d.jsx)(da,{...e,isToolbar:!1}),ha=e=>(0,d.jsx)(da,{...e,isToolbar:!0});function ga(e){const t=C(),{clientId:n=""}=t,{setBlockEditingMode:o,unsetBlockEditingMode:r}=(0,g.useDispatch)(ji),i=(0,g.useSelect)((e=>n?null:e(ji).getBlockEditingMode()),[n]);return(0,h.useEffect)((()=>(e&&o(n,e),()=>{e&&r(n)})),[n,e,o,r]),n?t[v]:i}const ma=["left","center","right","wide","full"],fa=["wide","full"];function ba(e,t=!0,n=!0){let o;return o=Array.isArray(e)?ma.filter((t=>e.includes(t))):!0===e?[...ma]:[],!n||!0===e&&!t?o.filter((e=>!fa.includes(e))):o}var ka={shareWithChildBlocks:!0,edit:function({name:e,align:t,setAttributes:n}){const o=ia(ba((0,p.getBlockSupport)(e,"align"),(0,p.hasBlockSupport)(e,"alignWide",!0))).map((({name:e})=>e)),r=ga();return o.length&&"default"===r?(0,d.jsx)(Rs,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,d.jsx)(pa,{value:t,onChange:t=>{if(!t){const n=(0,p.getBlockType)(e),o=n?.attributes?.align?.default;o&&(t="")}n({align:t})},controls:o})}):null},useBlockProps:function({name:e,align:t}){const n=ba((0,p.getBlockSupport)(e,"align"),(0,p.hasBlockSupport)(e,"alignWide",!0));if(ia(n).some((e=>e.name===t)))return{"data-align":t};return{}},addSaveProps:function(e,t,n){const{align:o}=n,r=(0,p.getBlockSupport)(t,"align"),i=(0,p.hasBlockSupport)(t,"alignWide",!0);ba(r,i).includes(o)&&(e.className=ms(`align${o}`,e.className));return e},attributeKeys:["align"],hasSupport:e=>(0,p.hasBlockSupport)(e,"align",!1)};(0,f.addFilter)("blocks.registerBlockType","core/editor/align/addAttribute",(function(e){return"type"in(e.attributes?.align??{})||(0,p.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...ma,""]}}),e}));const va=(0,ws.createSlotFill)("InspectorControls"),_a=(0,ws.createSlotFill)("InspectorAdvancedControls"),ya=(0,ws.createSlotFill)("InspectorControlsBindings"),xa=(0,ws.createSlotFill)("InspectorControlsBackground"),Sa=(0,ws.createSlotFill)("InspectorControlsBorder"),wa=(0,ws.createSlotFill)("InspectorControlsColor"),Ca=(0,ws.createSlotFill)("InspectorControlsFilter"),Ba=(0,ws.createSlotFill)("InspectorControlsDimensions"),Ia=(0,ws.createSlotFill)("InspectorControlsPosition"),ja=(0,ws.createSlotFill)("InspectorControlsTypography"),Ea=(0,ws.createSlotFill)("InspectorControlsListView"),Ta=(0,ws.createSlotFill)("InspectorControlsStyles");var Ma={default:va,advanced:_a,background:xa,bindings:ya,border:Sa,color:wa,dimensions:Ba,effects:(0,ws.createSlotFill)("InspectorControlsEffects"),filter:Ca,list:Ea,position:Ia,settings:va,styles:Ta,typography:ja};const Pa=(0,ws.createSlotFill)(Symbol("PrivateInspectorControlsAllowedBlocks"));function Ra({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:o}){n&&(I()("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const r=C(),i=Ma[t]?.Fill;return i?r[b]?(0,d.jsx)(ws.__experimentalStyleProvider,{document,children:(0,d.jsx)(i,{children:t=>(0,d.jsx)(Na,{fillProps:t,children:e,resetAllFilter:o})})}):null:(js()(`Unknown InspectorControls group "${t}" provided.`),null)}function Aa({resetAllFilter:e,children:t}){const{registerResetAllFilter:n,deregisterResetAllFilter:o}=(0,h.useContext)(ws.__experimentalToolsPanelContext);return(0,h.useEffect)((()=>{if(e&&n&&o)return n(e),()=>{o(e)}}),[e,n,o]),t}function Na({children:e,resetAllFilter:t,fillProps:n}){const{forwardedContext:o=[]}=n,r=(0,d.jsx)(Aa,{resetAllFilter:t,children:e});return o.reduce(((e,[t,n])=>(0,d.jsx)(t,{...n,children:e})),r)}function La({children:e,group:t,label:n}){const{updateBlockAttributes:o}=(0,g.useDispatch)(ji),{getBlockAttributes:r,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:s,hasMultiSelection:l}=(0,g.useSelect)(ji),a=Ji(),c=s(),u=(0,h.useCallback)(((e=[])=>{const t={},n=l()?i():[c];n.forEach((n=>{const{style:o}=r(n);let i={style:o};e.forEach((e=>{i={...i,...e(i)}})),i={...i,style:fs(i.style)},t[n]=i})),o(n,t,!0)}),[r,i,l,c,o]);return(0,d.jsx)(ws.__experimentalToolsPanel,{className:`${t}-block-support-panel`,label:n,resetAll:u,panelId:c,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:a,children:e},c)}function Da({Slot:e,fillProps:t,...n}){const o=(0,h.useContext)(ws.__experimentalToolsPanelContext),r=(0,h.useMemo)((()=>({...t??{},forwardedContext:[...t?.forwardedContext??[],[ws.__experimentalToolsPanelContext.Provider,{value:o}]]})),[o,t]);return(0,d.jsx)(e,{...n,fillProps:r,bubblesVirtually:!0})}function Oa({__experimentalGroup:e,group:t="default",label:n,fillProps:o,...r}){e&&(I()("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const i=Ma[t],s=(0,ws.__experimentalUseSlotFills)(i?.name);if(!i)return js()(`Unknown InspectorControls group "${t}" provided.`),null;if(!s?.length)return null;const{Slot:l}=i;return n?(0,d.jsx)(La,{group:t,label:n,children:(0,d.jsx)(Da,{...r,fillProps:o,Slot:l})}):(0,d.jsx)(l,{...r,fillProps:o,bubblesVirtually:!0})}const za=Ra;za.Slot=Oa;const Va=e=>(0,d.jsx)(Ra,{...e,group:"advanced"});Va.Slot=e=>(0,d.jsx)(Oa,{...e,group:"advanced"}),Va.slotName="InspectorAdvancedControls";var Fa=za,Ha=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M7 11.5h10V13H7z"})});const Ua=window.wp.url,Ga=window.wp.dom,$a=window.wp.blob,Wa=window.wp.keycodes;var Ka=(0,d.jsxs)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ue.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,d.jsx)(ue.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z"})]}),Za=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})}),qa=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})});var Ya=(0,ws.withFilters)("editor.MediaUpload")((()=>null));var Xa=function({fallback:e=null,children:t}){const n=(0,g.useSelect)((e=>{const{getSettings:t}=e(ji);return!!t().mediaUpload}),[]);return n?t:e};const Qa=window.wp.isShallowEqual;var Ja=n.n(Qa),ec=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"})}),tc=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734Z"})}),nc=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})}),oc=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})});var rc=function e({children:t,settingsOpen:n,setSettingsOpen:o}){const r=(0,m.useReducedMotion)(),i=r?h.Fragment:ws.__unstableAnimatePresence,s=r?"div":ws.__unstableMotion.div,l=`link-control-settings-drawer-${(0,m.useInstanceId)(e)}`;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>o(!n),icon:(0,T.isRTL)()?nc:oc,"aria-controls":l,children:(0,T._x)("Advanced","Additional link settings")}),(0,d.jsx)(i,{children:n&&(0,d.jsx)(s,{className:"block-editor-link-control__drawer",hidden:!n,id:l,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1},children:(0,d.jsx)("div",{className:"block-editor-link-control__drawer-inner",children:t})})})]})},ic=n(1609);function sc(e){return"function"==typeof e}class lc extends h.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,h.createRef)(),this.inputRef=e.inputRef||(0,h.createRef)(),this.updateSuggestions=(0,m.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&this.suggestionNodes[n].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),e.value===o||this.props.disableSuggestions||(o?.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(e=""){const{__experimentalFetchLinkSuggestions:t,__experimentalHandleURLSuggestions:n}=this.props;if(!t)return;const o=!e?.length;if(e=e.trim(),!o&&(e.length<2||!n&&(0,Ua.isURL)(e)))return this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null,void this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:e,selectedSuggestion:null,loading:!1});this.setState({selectedSuggestion:null,loading:!0});const r=t(e,{isInitialSuggestions:o});r.then((t=>{this.suggestionsRequest===r&&(this.setState({suggestions:t,suggestionsValue:e,loading:!1,showSuggestions:!!t.length}),t.length?this.props.debouncedSpeak((0,T.sprintf)((0,T._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",t.length),t.length),"assertive"):this.props.debouncedSpeak((0,T.__)("No results."),"assertive"))})).catch((()=>{this.suggestionsRequest===r&&this.setState({loading:!1})})).finally((()=>{this.suggestionsRequest===r&&(this.suggestionsRequest=null)})),this.suggestionsRequest=r}onChange(e){this.props.onChange(e)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||e&&e.length||null!==this.suggestionsRequest||this.updateSuggestions(n)}onKeyDown(e){this.props.onKeyDown?.(e);const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case Wa.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case Wa.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case Wa.ENTER:this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e))}return}const i=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Wa.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case Wa.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Wa.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(i),this.props.speak((0,T.__)("Link selected.")));break;case Wa.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(i),this.props.onSubmit&&this.props.onSubmit(i,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps({value:e,instanceId:t,disableSuggestions:n,__experimentalShowInitialSuggestions:o=!1},{showSuggestions:r}){let i=r;const s=e&&e.length;return o||s||(i=!1),!0===n&&(i=!1),{showSuggestions:i,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,d.jsxs)(d.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){const{label:e=null,className:t,isFullWidth:n,instanceId:o,placeholder:r=(0,T.__)("Paste URL or type to search"),__experimentalRenderControl:i,value:s="",hideLabelFromVision:l=!1,help:a=null,disabled:c=!1}=this.props,{loading:u,showSuggestions:p,selectedSuggestion:h,suggestionsListboxId:g,suggestionOptionIdPrefix:m}=this.state,f=`url-input-control-${o}`,b={id:f,label:e,className:ms("block-editor-url-input",t,{"is-full-width":n}),hideLabelFromVision:l},k={id:f,value:s,required:!0,type:"text",onChange:c?()=>{}:this.onChange,onFocus:c?()=>{}:this.onFocus,placeholder:r,onKeyDown:c?()=>{}:this.onKeyDown,role:"combobox","aria-label":e?void 0:(0,T.__)("URL"),"aria-expanded":p,"aria-autocomplete":"list","aria-owns":g,"aria-activedescendant":null!==h?`${m}-${h}`:void 0,ref:this.inputRef,disabled:c,suffix:this.props.suffix,help:a};return i?i(b,k,u):(0,d.jsxs)(ws.BaseControl,{__nextHasNoMarginBottom:!0,...b,children:[(0,d.jsx)(ws.__experimentalInputControl,{...k,__next40pxDefaultSize:!0}),u&&(0,d.jsx)(ws.Spinner,{})]})}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:o,suggestionsValue:r,selectedSuggestion:i,suggestionsListboxId:s,suggestionOptionIdPrefix:l,loading:a}=this.state;if(!n||0===o.length)return null;const c={id:s,ref:this.autocompleteRef,role:"listbox"},u=(e,t)=>({role:"option",tabIndex:"-1",id:`${l}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===i||void 0});return sc(t)?t({suggestions:o,selectedSuggestion:i,suggestionsListProps:c,buildSuggestionItemProps:u,isLoading:a,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!r?.length,currentInputValue:r}):(0,d.jsx)(ws.Popover,{placement:"bottom",focusOnMount:!1,children:(0,d.jsx)("div",{...c,className:ms("block-editor-url-input__suggestions",{[`${e}__suggestions`]:e}),children:o.map(((e,t)=>(0,ic.createElement)(ws.Button,{__next40pxDefaultSize:!0,...u(0,t),key:e.id,className:ms("block-editor-url-input__suggestion",{"is-selected":t===i}),onClick:()=>this.handleOnClick(e)},e.title)))})})}}var ac=(0,m.compose)(m.withSafeTimeout,ws.withSpokenMessages,m.withInstanceId,(0,g.withSelect)(((e,t)=>{if(sc(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(ji);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(lc),cc=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})});var uc=({searchTerm:e,onClick:t,itemProps:n,buttonText:o})=>{if(!e)return null;let r;return r=o?"function"==typeof o?o(e):o:(0,h.createInterpolateElement)((0,T.sprintf)((0,T.__)("Create: <mark>%s</mark>"),e),{mark:(0,d.jsx)("mark",{})}),(0,d.jsx)(ws.MenuItem,{...n,iconPosition:"left",icon:cc,className:"block-editor-link-control__search-item",onClick:t,children:r})},dc=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{d:"M18 5.5H6a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h12a.5.5 0 0 0 .5-.5V6a.5.5 0 0 0-.5-.5ZM6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm1 5h1.5v1.5H7V9Zm1.5 4.5H7V15h1.5v-1.5ZM10 9h7v1.5h-7V9Zm7 4.5h-7V15h7v-1.5Z"})}),pc=(0,d.jsxs)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ue.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,d.jsx)(ue.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})]}),hc=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})}),gc=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"})}),mc=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z"})}),fc=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8Zm6.5 8c0 .6 0 1.2-.2 1.8h-2.7c0-.6.2-1.1.2-1.8s0-1.2-.2-1.8h2.7c.2.6.2 1.1.2 1.8Zm-.9-3.2h-2.4c-.3-.9-.7-1.8-1.1-2.4-.1-.2-.2-.4-.3-.5 1.6.5 3 1.6 3.8 3ZM12.8 17c-.3.5-.6 1-.8 1.3-.2-.3-.5-.8-.8-1.3-.3-.5-.6-1.1-.8-1.7h3.3c-.2.6-.5 1.2-.8 1.7Zm-2.9-3.2c-.1-.6-.2-1.1-.2-1.8s0-1.2.2-1.8H14c.1.6.2 1.1.2 1.8s0 1.2-.2 1.8H9.9ZM11.2 7c.3-.5.6-1 .8-1.3.2.3.5.8.8 1.3.3.5.6 1.1.8 1.7h-3.3c.2-.6.5-1.2.8-1.7Zm-1-1.2c-.1.2-.2.3-.3.5-.4.7-.8 1.5-1.1 2.4H6.4c.8-1.4 2.2-2.5 3.8-3Zm-1.8 8H5.7c-.2-.6-.2-1.1-.2-1.8s0-1.2.2-1.8h2.7c0 .6-.2 1.1-.2 1.8s0 1.2.2 1.8Zm-2 1.4h2.4c.3.9.7 1.8 1.1 2.4.1.2.2.4.3.5-1.6-.5-3-1.6-3.8-3Zm7.4 3c.1-.2.2-.3.3-.5.4-.7.8-1.5 1.1-2.4h2.4c-.8 1.4-2.2 2.5-3.8 3Z"})}),bc=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})}),kc=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"})});const vc={post:{icon:dc,label:(0,T.__)("Post")},page:{icon:pc,label:(0,T.__)("Page")},post_tag:{icon:hc,label:(0,T.__)("Tag")},category:{icon:gc,label:(0,T.__)("Category")},attachment:{icon:mc,label:(0,T.__)("Attachment")}};function _c({isURL:e,suggestion:t}){let n=null;return e?n=fc:t.type in vc&&(n=vc[t.type].icon,"page"===t.type&&(t.isFrontPage&&(n=bc),t.isBlogHome&&(n=kc))),n?(0,d.jsx)(Ol,{className:"block-editor-link-control__search-item-icon",icon:n}):null}function yc(e){const t=e?.trim();return t?.length?e?.replace(/^\/?/,"/"):e}function xc(e){const t=e?.trim();return t?.length?e?.replace(/\/$/,""):e}const Sc=({itemProps:e,suggestion:t,searchTerm:n,onClick:o,isURL:r=!1,shouldShowType:i=!1})=>{const s=r?(0,T.__)("Press ENTER to add this link"):(l=t.url)?(0,m.pipe)(Ua.safeDecodeURI,Ua.getPath,(e=>t=>null==t||t!=t?e:t)(""),((e,...t)=>(...n)=>e(...n,...t))(Ua.filterURLForDisplay,24),xc,yc)(l):l;var l;return(0,d.jsx)(ws.MenuItem,{...e,info:s,iconPosition:"left",icon:(0,d.jsx)(_c,{suggestion:t,isURL:r}),onClick:o,shortcut:i&&wc(t),className:"block-editor-link-control__search-item",children:(0,d.jsx)(ws.TextHighlight,{text:(0,Ga.__unstableStripHTML)(t.title),highlight:n})})};function wc(e){return e.isFrontPage?(0,T.__)("Front page"):e.isBlogHome?(0,T.__)("Blog home"):e.type in vc?vc[e.type].label:e.type}var Cc=Sc;const Bc=e=>(I()("wp.blockEditor.__experimentalLinkControlSearchItem",{since:"6.8"}),(0,d.jsx)(Sc,{...e})),Ic="__CREATE__",jc="link",Ec="mailto",Tc="internal",Mc=[jc,Ec,"tel",Tc],Pc=[{id:"opensInNewTab",title:(0,T.__)("Open in new tab")}];function Rc({withCreateSuggestion:e,currentInputValue:t,handleSuggestionClick:n,suggestionsListProps:o,buildSuggestionItemProps:r,suggestions:i,selectedSuggestion:s,isLoading:l,isInitialSuggestions:a,createSuggestionButtonText:c,suggestionsQuery:u}){const p=ms("block-editor-link-control__search-results",{"is-loading":l}),h=1===i.length&&Mc.includes(i[0].type),g=e&&!h&&!a,m=!u?.type,f=a?(0,T.__)("Suggestions"):(0,T.sprintf)((0,T.__)('Search results for "%s"'),t);return(0,d.jsx)("div",{className:"block-editor-link-control__search-results-wrapper",children:(0,d.jsx)("div",{...o,className:p,"aria-label":f,children:(0,d.jsx)(ws.MenuGroup,{children:i.map(((e,o)=>g&&Ic===e.type?(0,d.jsx)(uc,{searchTerm:t,buttonText:c,onClick:()=>n(e),itemProps:r(e,o),isSelected:o===s},e.type):Ic===e.type?null:(0,d.jsx)(Cc,{itemProps:r(e,o),suggestion:e,index:o,onClick:()=>{n(e)},isSelected:o===s,isURL:Mc.includes(e.type),searchTerm:t,shouldShowType:m,isFrontPage:e?.isFrontPage,isBlogHome:e?.isBlogHome},`${e.id}-${e.type}`)))})})})}var Ac=Rc;const Nc=e=>(I()("wp.blockEditor.__experimentalLinkControlSearchResults",{since:"6.8"}),(0,d.jsx)(Rc,{...e}));function Lc(e){if(e.includes(" "))return!1;const t=(0,Ua.getProtocol)(e),n=(0,Ua.isValidProtocol)(t),o=function(e,t=6){const n=e.split(/[?#]/)[0];return new RegExp(`(?<=\\S)\\.(?:[a-zA-Z_]{2,${t}})(?:\\/|$)`).test(n)}(e),r=e?.startsWith("www."),i=e?.startsWith("#")&&(0,Ua.isValidFragment)(e);return n||r||i||o}const Dc=()=>Promise.resolve([]),Oc=e=>{let t=jc;const n=(0,Ua.getProtocol)(e)||"";return n.includes("mailto")&&(t=Ec),n.includes("tel")&&(t="tel"),e?.startsWith("#")&&(t=Tc),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,Ua.prependHTTP)(e):e,type:t}])};function zc(e,t,n){const{fetchSearchSuggestions:o,pageOnFront:r,pageForPosts:i}=(0,g.useSelect)((e=>{const{getSettings:t}=e(ji);return{pageOnFront:t().pageOnFront,pageForPosts:t().pageForPosts,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),s=t?Oc:Dc;return(0,h.useCallback)(((t,{isInitialSuggestions:l})=>Lc(t)?s(t,{isInitialSuggestions:l}):(async(e,t,n,o,r,i)=>{const{isInitialSuggestions:s}=t,l=await n(e,t);return l.map((e=>Number(e.id)===r?(e.isFrontPage=!0,e):Number(e.id)===i?(e.isBlogHome=!0,e):e)),s||Lc(e)||!o?l:l.concat({title:e,url:e,type:Ic})})(t,{...e,isInitialSuggestions:l},o,n,r,i)),[s,o,r,i,e,n])}const Vc=()=>Promise.resolve([]),Fc=()=>{},Hc=(0,h.forwardRef)((({value:e,children:t,currentLink:n={},className:o=null,placeholder:r=null,withCreateSuggestion:i=!1,onCreateSuggestion:s=Fc,onChange:l=Fc,onSelect:a=Fc,showSuggestions:c=!0,renderSuggestions:u=e=>(0,d.jsx)(Ac,{...e}),fetchSuggestions:p=null,allowDirectEntry:g=!0,showInitialSuggestions:m=!1,suggestionsQuery:f={},withURLSuggestion:b=!0,createSuggestionButtonText:k,hideLabelFromVision:v=!1,suffix:_,isEntity:y=!1},x)=>{const S=zc(f,g,i),w=c?p||S:Vc,[C,B]=(0,h.useState)(),I=async e=>{let t=e;if(Ic!==e.type){if(g||t&&Object.keys(t).length>=1){const{id:e,url:o,...r}=n??{};a({...r,...t},t)}}else try{t=await s(e.title),t?.url&&a(t)}catch(e){}},j=r??(0,T.__)("Search or type URL"),E=v&&""!==r?j:(0,T.__)("Link");return(0,d.jsxs)("div",{className:"block-editor-link-control__search-input-container",children:[(0,d.jsx)(ac,{disableSuggestions:n?.url===e,label:E,hideLabelFromVision:v,className:o,value:e,onChange:(e,t)=>{l(e),B(t)},placeholder:j,__experimentalRenderSuggestions:c?e=>u({...e,withCreateSuggestion:i,createSuggestionButtonText:k,suggestionsQuery:f,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),I(t)}}):null,__experimentalFetchLinkSuggestions:w,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:m,onSubmit:(t,n)=>{const o=t||C;o||e?.trim()?.length?I(o||{url:e}):n.preventDefault()},inputRef:x,suffix:_,disabled:y}),t]})}));var Uc=Hc;const Gc=e=>(I()("wp.blockEditor.__experimentalLinkControlSearchInput",{since:"6.8"}),(0,d.jsx)(Hc,{...e}));var $c=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})}),Wc=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),Kc=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"})});const{Slot:Zc,Fill:qc}=(0,ws.createSlotFill)("BlockEditorLinkControlViewer");function Yc(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}var Xc=function(e){const[t,n]=(0,h.useReducer)(Yc,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,g.useSelect)((e=>{const{getSettings:t}=e(ji);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,h.useEffect)((()=>{if(e?.length&&o&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return o(e,{signal:r}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{r.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t};function Qc({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:o=!1,onRemove:r}){const i=(0,g.useSelect)((e=>e(hr.store).get("core","showIconLabels")),[]),s=n?e?.url:null,{richData:l,isFetching:a}=Xc(s),c=l&&Object.keys(l).length,u=e&&(0,Ua.filterURLForDisplay)((0,Ua.safeDecodeURI)(e.url),24)||"",p=!e?.url?.length,h=!p&&(0,Ga.__unstableStripHTML)(l?.title||e?.title||u),f=!e?.url||h.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i,"").replace(/^www\./i,"")===u;let b;b=l?.icon?(0,d.jsx)("img",{src:l?.icon,alt:""}):p?(0,d.jsx)(Ol,{icon:$c,size:32}):(0,d.jsx)(Ol,{icon:fc});const{createNotice:k}=(0,g.useDispatch)(pr.store),v=(0,m.useCopyToClipboard)(e.url,(()=>{k("info",(0,T.__)("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})}));return(0,d.jsx)("div",{role:"group","aria-label":(0,T.__)("Manage link"),className:ms("block-editor-link-control__search-item",{"is-current":!0,"is-rich":c,"is-fetching":!!a,"is-preview":!0,"is-error":p,"is-url-title":h===u}),children:(0,d.jsxs)("div",{className:"block-editor-link-control__search-item-top",children:[(0,d.jsxs)("span",{className:"block-editor-link-control__search-item-header",role:"figure","aria-label":(0,T.__)("Link information"),children:[(0,d.jsx)("span",{className:ms("block-editor-link-control__search-item-icon",{"is-image":l?.icon}),children:b}),(0,d.jsx)("span",{className:"block-editor-link-control__search-item-details",children:p?(0,d.jsx)("span",{className:"block-editor-link-control__search-item-error-notice",children:(0,T.__)("Link is empty")}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.ExternalLink,{className:"block-editor-link-control__search-item-title",href:e.url,children:(0,d.jsx)(ws.__experimentalTruncate,{numberOfLines:1,children:h})}),!f&&(0,d.jsx)("span",{className:"block-editor-link-control__search-item-info",children:(0,d.jsx)(ws.__experimentalTruncate,{numberOfLines:1,children:u})})]})})]}),(0,d.jsx)(ws.Button,{icon:Wc,label:(0,T.__)("Edit link"),onClick:t,size:"compact",showTooltip:!i}),o&&(0,d.jsx)(ws.Button,{icon:ec,label:(0,T.__)("Remove link"),onClick:r,size:"compact",showTooltip:!i}),(0,d.jsx)(ws.Button,{icon:Kc,label:(0,T.__)("Copy link"),ref:v,accessibleWhenDisabled:!0,disabled:p,size:"compact",showTooltip:!i}),(0,d.jsx)(Zc,{fillProps:e})]})})}const Jc=()=>{};var eu=({value:e,onChange:t=Jc,settings:n})=>{if(!n||!n.length)return null;const o=n=>o=>{t({...e,[n.id]:o})},r=n.map((n=>{if("render"in n){if("function"==typeof n.render){const o=n.render(n,e,t);return(0,d.jsx)("div",{className:"block-editor-link-control__setting",children:o},n.id)}return null}return(0,d.jsx)(ws.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-link-control__setting",label:n.title,onChange:o(n),checked:!!e&&!!e[n.id],help:n?.help},n.id)})).filter(Boolean);return(0,d.jsxs)("fieldset",{className:"block-editor-link-control__settings",children:[(0,d.jsx)(ws.VisuallyHidden,{as:"legend",children:(0,T.__)("Currently selected link settings")}),r]})};const tu=e=>{let t=!1;return{promise:new Promise(((n,o)=>{e.then((e=>t?o({isCanceled:!0}):n(e)),(e=>o(t?{isCanceled:!0}:e)))})),cancel(){t=!0}}};var nu=n(5215),ou=n.n(nu);const ru=()=>{},iu="core/block-editor",su="linkControlSettingsDrawer";function lu({searchInputPlaceholder:e,value:t,settings:n=Pc,onChange:o=ru,onRemove:r,onCancel:i,noDirectEntry:s=!1,showSuggestions:l=!0,showInitialSuggestions:a,forceIsEditingLink:c,createSuggestion:u,withCreateSuggestion:p,inputValue:f="",suggestionsQuery:b={},noURLSuggestion:k=!1,createSuggestionButtonText:v,hasRichPreviews:_=!1,hasTextControl:y=!1,renderControlBottom:x=null,handleEntities:S=!1}){void 0===p&&u&&(p=!0);const[w,C]=(0,h.useState)(!1),{advancedSettingsPreference:B}=(0,g.useSelect)((e=>({advancedSettingsPreference:e(hr.store).get(iu,su)??!1})),[]),{set:I}=(0,g.useDispatch)(hr.store),j=B||w,E=(0,h.useRef)(!0),M=(0,h.useRef)(),P=(0,h.useRef)(),R=(0,h.useRef)(),A=(0,h.useRef)(!1),N=n.map((({id:e})=>e)),[L,D,O,z,V]=function(e){const[t,n]=(0,h.useState)(e||{}),[o,r]=(0,h.useState)(e);return ou()(e,o)||(r(e),n(e)),[t,n,e=>{n({...t,url:e})},e=>{n({...t,title:e})},e=>o=>{const r=Object.keys(o).reduce(((t,n)=>(e.includes(n)&&(t[n]=o[n]),t)),{});n({...t,...r})}]}(t),F=S&&!!L?.id,H=(0,m.useInstanceId)(lu,"link-control"),U=F?`${H}__help`:null,G=t&&!(0,Qa.isShallowEqualObjects)(L,t),[$,W]=(0,h.useState)(void 0!==c?c:!t||!t.url),{createPage:K,isCreatingPage:Z,errorMessage:q}=function(e){const t=(0,h.useRef)(),[n,o]=(0,h.useState)(!1),[r,i]=(0,h.useState)(null);return(0,h.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),i(null);try{return t.current=tu(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw i(e.message||(0,T.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(u);(0,h.useEffect)((()=>{void 0!==c&&W(c)}),[c]),(0,h.useEffect)((()=>{if(E.current)return;(Ga.focus.focusable.find(M.current)[0]||M.current).focus(),A.current=!1}),[$,Z]),(0,h.useEffect)((()=>(E.current=!1,()=>{E.current=!0})),[]);const Y=t?.url?.trim()?.length>0,X=()=>{A.current=!!M.current?.contains(M.current.ownerDocument.activeElement),W(!1)},Q=()=>{G&&o({...t,...L,url:te}),X()},[J,ee]=(0,h.useState)(!1);(0,h.useEffect)((()=>{J&&(R.current?.focus(),ee(!1))}),[J]);const te=f||L?.url||"",ne=!te?.trim()?.length,oe=r&&t&&!$&&!Z,re=$&&Y,ie=Y&&y,se=($||!t)&&!Z,le=!G||ne,ae=!!n?.length&&$&&Y;return(0,d.jsxs)("div",{tabIndex:-1,ref:M,className:"block-editor-link-control",children:[Z&&(0,d.jsxs)("div",{className:"block-editor-link-control__loading",children:[(0,d.jsx)(ws.Spinner,{})," ",(0,T.__)("Creating"),"…"]}),se&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:ms({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":ie,"has-actions":re}),children:[ie&&(0,d.jsx)(ws.TextControl,{__nextHasNoMarginBottom:!0,ref:P,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,T.__)("Text"),value:L?.title,onChange:z,onKeyDown:e=>{const{keyCode:t}=e;t!==Wa.ENTER||ne||(e.preventDefault(),Q())},__next40pxDefaultSize:!0}),(0,d.jsx)(Uc,{ref:R,currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:te,withCreateSuggestion:p,onCreateSuggestion:K,onChange:O,onSelect:e=>{const t=Object.keys(e).reduce(((t,n)=>(N.includes(n)||(t[n]=e[n]),t)),{});o({...L,...t,title:L?.title||e?.title}),X()},showInitialSuggestions:a,allowDirectEntry:!s,showSuggestions:l,suggestionsQuery:b,withURLSuggestion:!k,createSuggestionButtonText:v,hideLabelFromVision:!ie,isEntity:F,suffix:(0,d.jsx)(au,{isEntity:F,showActions:re,isDisabled:le,onUnlink:()=>{const{id:e,kind:t,type:n,...o}=L;D({...o,id:void 0,kind:void 0,type:void 0,url:void 0}),ee(!0)},onSubmit:Q,helpTextId:U})}),F&&U&&(0,d.jsx)("p",{id:U,className:"block-editor-link-control__help",children:(0,T.sprintf)((0,T.__)("Synced with the selected %s."),L?.type||"item")})]}),q&&(0,d.jsx)(ws.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:q})]}),t&&!$&&!Z&&(0,d.jsx)(Qc,{value:t,onEditClick:()=>W(!0),hasRichPreviews:_,hasUnlinkControl:oe,onRemove:()=>{r(),W(!0)}},t?.url),ae&&(0,d.jsx)("div",{className:"block-editor-link-control__tools",children:!ne&&(0,d.jsx)(rc,{settingsOpen:j,setSettingsOpen:e=>{I&&I(iu,su,e),C(e)},children:(0,d.jsx)(eu,{value:L,settings:n,onChange:V(N)})})}),re&&(0,d.jsxs)(ws.__experimentalHStack,{justify:"right",className:"block-editor-link-control__search-actions",children:[(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),D(t),Y?X():r?.(),i?.()},children:(0,T.__)("Cancel")}),(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:le?ru:Q,className:"block-editor-link-control__search-submit","aria-disabled":le,children:(0,T.__)("Apply")})]}),!Z&&x&&x()]})}function au({isEntity:e,showActions:t,isDisabled:n,onUnlink:o,onSubmit:r,helpTextId:i}){return e?(0,d.jsx)(ws.Button,{icon:ec,onClick:o,"aria-describedby":i,showTooltip:!0,label:(0,T.__)("Unsync and edit"),__next40pxDefaultSize:!0}):t?void 0:(0,d.jsx)(ws.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,d.jsx)(ws.Button,{onClick:n?ru:r,label:(0,T.__)("Submit"),icon:tc,className:"block-editor-link-control__search-submit","aria-disabled":n,size:"small"})})}lu.ViewerFill=qc,lu.DEFAULT_LINK_SETTINGS=Pc;const cu=e=>(I()("wp.blockEditor.__experimentalLinkControl",{since:"6.8",alternative:"wp.blockEditor.LinkControl"}),(0,d.jsx)(lu,{...e}));cu.ViewerFill=lu.ViewerFill,cu.DEFAULT_LINK_SETTINGS=lu.DEFAULT_LINK_SETTINGS;var uu=lu;const du=()=>{};let pu=0;var hu=(0,m.compose)([(0,g.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(pr.store);return{createNotice:t,removeNotice:n}})),(0,ws.withFilters)("editor.MediaReplaceFlow")])((({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:o,accept:r,onError:i,onSelect:s,onSelectURL:l,onReset:a,onToggleFeaturedImage:c,useFeaturedImage:u,onFilesUpload:p=du,name:h=(0,T.__)("Replace"),createNotice:m,removeNotice:f,children:b,multiple:k=!1,addToGallery:v,handleUpload:_=!0,popoverProps:y,renderToggle:x})=>{const{getSettings:S}=(0,g.useSelect)(ji),w="block-editor/media-replace-flow/error-notice/"+ ++pu,C=e=>{const t=(0,Ga.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{m("error",t,{speak:!0,id:w,isDismissible:!0})}),1e3)},B=(e,t)=>{u&&c&&c(),t(),s(e),(0,Uo.speak)((0,T.__)("The media file has been replaced")),f(w)},I=e=>{e.keyCode===Wa.DOWN&&(e.preventDefault(),e.target.click())},j=k&&!(!o||0===o.length)&&o.every((e=>"image"===e||e.startsWith("image/")));return(0,d.jsx)(ws.Dropdown,{popoverProps:y,contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:e,onToggle:t})=>x?x({"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:I,children:h}):(0,d.jsx)(ws.ToolbarButton,{"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:I,children:h}),renderContent:({onClose:i})=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(ws.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu",children:[(0,d.jsxs)(Xa,{children:[(0,d.jsx)(Ya,{gallery:j,addToGallery:v,multiple:k,value:k?n:t,onSelect:e=>B(e,i),allowedTypes:o,render:({open:e})=>(0,d.jsx)(ws.MenuItem,{icon:Ka,onClick:e,children:(0,T.__)("Open Media Library")})}),(0,d.jsx)(ws.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!_)return t(),s(n);p(n),S().mediaUpload({allowedTypes:o,filesList:n,onFileChange:([e])=>{B(e,t)},onError:C})})(e,i)},accept:r,multiple:!!k,render:({openFileDialog:e})=>(0,d.jsx)(ws.MenuItem,{icon:Za,onClick:()=>{e()},children:(0,T._x)("Upload","verb")})})]}),c&&(0,d.jsx)(ws.MenuItem,{icon:qa,onClick:c,isPressed:u,children:(0,T.__)("Use featured image")}),e&&a&&(0,d.jsx)(ws.MenuItem,{onClick:()=>{a(),i()},children:(0,T.__)("Reset")}),"function"==typeof b?b({onClose:i}):b]}),l&&(0,d.jsxs)("form",{className:"block-editor-media-flow__url-input",children:[(0,d.jsx)("span",{className:"block-editor-media-replace-flow__image-url-label",children:(0,T.__)("Current media URL:")}),(0,d.jsx)(uu,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:e})=>{l(e)},searchInputPlaceholder:(0,T.__)("Paste or type URL")})]})]})})}));const gu="image",mu={placement:"left-start",offset:36,shift:!0,className:"block-editor-global-styles-background-panel__popover"},fu=()=>{},bu=e=>{window.requestAnimationFrame((()=>{const[t]=Ga.focus.tabbable.find(e?.current);t&&t.focus()}))};const ku=e=>{if(!e||isNaN(e.x)&&isNaN(e.y))return;return`${100*(isNaN(e.x)?.5:e.x)}% ${100*(isNaN(e.y)?.5:e.y)}%`},vu=e=>{if(!e)return{x:void 0,y:void 0};let[t,n]=e.split(" ").map((e=>parseFloat(e)/100));return t=isNaN(t)?void 0:t,n=isNaN(n)?t:n,{x:t,y:n}};function _u({as:e="span",imgUrl:t,toggleProps:n={},filename:o,label:r,onToggleCallback:i=fu}){const{isOpen:s,...l}=n;(0,h.useEffect)((()=>{void 0!==s&&i(s)}),[s,i]);const a=()=>(0,d.jsxs)(ws.__experimentalHStack,{justify:"flex-start",as:"span",className:"block-editor-global-styles-background-panel__inspector-preview-inner",children:[t&&(0,d.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator-wrapper","aria-hidden":!0,children:(0,d.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:`url(${t})`}})}),(0,d.jsxs)(ws.FlexItem,{as:"span",style:t?{}:{flexGrow:1},children:[(0,d.jsx)(ws.__experimentalTruncate,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:r}),(0,d.jsx)(ws.VisuallyHidden,{as:"span",children:t?(0,T.sprintf)((0,T.__)("Background image: %s"),o||r):(0,T.__)("No background image selected")})]})]});return"button"===e?(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,...l,children:a()}):a()}function yu({label:e,filename:t,url:n,children:o,onToggle:r=fu,hasImageValue:i,onReset:s,containerRef:l}){if(!i)return;const a=e||(0,Ua.getFilename)(n)||(0,T.__)("Add background image");return(0,d.jsx)(ws.Dropdown,{popoverProps:mu,renderToggle:({onToggle:e,isOpen:o})=>{const i={onClick:e,className:"block-editor-global-styles-background-panel__dropdown-toggle","aria-expanded":o,"aria-label":(0,T.__)("Background size, position and repeat options."),isOpen:o};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(_u,{imgUrl:n,filename:t,label:a,toggleProps:i,as:"button",onToggleCallback:r}),s&&(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,label:(0,T.__)("Reset"),className:"block-editor-global-styles-background-panel__reset",size:"small",icon:Ha,onClick:()=>{s(),o&&e(),bu(l)}})]})},renderContent:()=>(0,d.jsx)(ws.__experimentalDropdownContentWrapper,{className:"block-editor-global-styles-background-panel__dropdown-content-wrapper",paddingSize:"medium",children:o})})}function xu(){return(0,d.jsx)(ws.Placeholder,{className:"block-editor-global-styles-background-panel__loading",children:(0,d.jsx)(ws.Spinner,{})})}function Su({onChange:e,style:t,inheritedValue:n,onRemoveImage:o=fu,onResetImage:r=fu,displayInPanel:i,defaultValues:s,containerRef:l}){const[a,c]=(0,h.useState)(!1),{getSettings:u}=(0,g.useSelect)(ji),{id:p,title:m,url:f}=t?.background?.backgroundImage||{...n?.background?.backgroundImage},{createErrorNotice:b}=(0,g.useDispatch)(pr.store),k=e=>{b(e,{type:"snackbar"}),c(!1)},v=n=>{if(!n||!n.url)return e(me(t,["background","backgroundImage"],void 0)),void c(!1);if((0,$a.isBlobURL)(n.url))return void c(!0);if(n.media_type&&n.media_type!==gu||!n.media_type&&n.type&&n.type!==gu)return void k((0,T.__)("Only images can be used as a background image."));const o=t?.background?.backgroundSize||s?.backgroundSize,r=t?.background?.backgroundPosition;e(me(t,["background"],{...t?.background,backgroundImage:{url:n.url,id:n.id,source:"file",title:n.title||void 0},backgroundPosition:r||"auto"!==o&&o?r:"50% 0",backgroundSize:o})),c(!1),bu(l)},_=ju(t),y=!_&&ju(n),x=m||(0,Ua.getFilename)(f)||(0,T.__)("Add background image");return(0,d.jsxs)("div",{className:"block-editor-global-styles-background-panel__image-tools-panel-item",children:[a&&(0,d.jsx)(xu,{}),(0,d.jsx)(hu,{mediaId:p,mediaURL:f,allowedTypes:[gu],accept:"image/*",onSelect:v,popoverProps:{className:ms({"block-editor-global-styles-background-panel__media-replace-popover":i})},name:(0,d.jsx)(_u,{imgUrl:f,filename:m,label:x}),renderToggle:e=>(0,d.jsx)(ws.Button,{...e,__next40pxDefaultSize:!0}),onError:k,onReset:()=>{bu(l),r()},children:y&&(0,d.jsx)(ws.MenuItem,{onClick:()=>{bu(l),e(me(t,["background"],{backgroundImage:"none"})),o()},children:(0,T.__)("Remove")})}),(0,d.jsx)(ws.DropZone,{onFilesDrop:e=>{u().mediaUpload({allowedTypes:[gu],filesList:e,onFileChange([e]){v(e)},onError:k,multiple:!1})},label:(0,T.__)("Drop to upload")})]})}function wu({onChange:e,style:t,inheritedValue:n,defaultValues:o}){const r=t?.background?.backgroundSize||n?.background?.backgroundSize,i=t?.background?.backgroundRepeat||n?.background?.backgroundRepeat,s=t?.background?.backgroundImage?.url||n?.background?.backgroundImage?.url,l=t?.background?.backgroundImage?.id,a=t?.background?.backgroundPosition||n?.background?.backgroundPosition,c=t?.background?.backgroundAttachment||n?.background?.backgroundAttachment;let u=!r&&l?o?.backgroundSize:r||"auto";u=["cover","contain","auto"].includes(u)?u:"auto";const p=!("no-repeat"===i||"cover"===u&&void 0===i),h=n=>{let o=i,r=a;"contain"===n&&(o="no-repeat",r=void 0),"cover"===n&&(o=void 0,r=void 0),"cover"!==u&&"contain"!==u||"auto"!==n||(o=void 0,t?.background?.backgroundImage?.id&&(r="50% 0")),n||"auto"!==u||(n="auto"),e(me(t,["background"],{...t?.background,backgroundPosition:r,backgroundRepeat:o,backgroundSize:n}))},g=!a&&l&&"contain"===r?o?.backgroundPosition:a;return(0,d.jsxs)(ws.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,d.jsx)(ws.FocalPointPicker,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Focal point"),url:s,value:vu(g),onChange:n=>{e(me(t,["background","backgroundPosition"],ku(n)))}}),(0,d.jsx)(ws.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Fixed background"),checked:"fixed"===c,onChange:()=>e(me(t,["background","backgroundAttachment"],"fixed"===c?"scroll":"fixed"))}),(0,d.jsxs)(ws.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:(0,T.__)("Size"),value:u,onChange:h,isBlock:!0,help:(m=r||o?.backgroundSize,"cover"===m||void 0===m?(0,T.__)("Image covers the space evenly."):"contain"===m?(0,T.__)("Image is contained without distortion."):(0,T.__)("Image has a fixed width.")),children:[(0,d.jsx)(ws.__experimentalToggleGroupControlOption,{value:"cover",label:(0,T._x)("Cover","Size option for background image control")},"cover"),(0,d.jsx)(ws.__experimentalToggleGroupControlOption,{value:"contain",label:(0,T._x)("Contain","Size option for background image control")},"contain"),(0,d.jsx)(ws.__experimentalToggleGroupControlOption,{value:"auto",label:(0,T._x)("Tile","Size option for background image control")},"tile")]}),(0,d.jsxs)(ws.__experimentalHStack,{justify:"flex-start",spacing:2,as:"span",children:[(0,d.jsx)(ws.__experimentalUnitControl,{"aria-label":(0,T.__)("Background image width"),onChange:h,value:r,size:"__unstable-large",__unstableInputWidth:"100px",min:0,placeholder:(0,T.__)("Auto"),disabled:"auto"!==u||void 0===u}),(0,d.jsx)(ws.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Repeat"),checked:p,onChange:()=>e(me(t,["background","backgroundRepeat"],!0===p?"no-repeat":"repeat")),disabled:"cover"===u})]})]});var m}function Cu({value:e,onChange:t,inheritedValue:n=e,settings:o,defaultValues:r={}}){const{globalStyles:i,_links:s}=(0,g.useSelect)((e=>{const{getSettings:t}=e(ji),n=t();return{globalStyles:n[N],_links:n[L]}}),[]),l=(0,h.useMemo)((()=>{const e={background:{}};return n?.background?(Object.entries(n?.background).forEach((([t,n])=>{e.background[t]=rs(n,{styles:i,_links:s})})),e):n}),[i,s,n]),a=()=>t(me(e,["background"],{})),{title:c,url:u}=e?.background?.backgroundImage||{...l?.background?.backgroundImage},p=ju(e)||ju(l),m=p&&"none"!==(e?.background?.backgroundImage||n?.background?.backgroundImage)&&(o?.background?.backgroundSize||o?.background?.backgroundPosition||o?.background?.backgroundRepeat),[f,b]=(0,h.useState)(!1),k=(0,h.useRef)();return(0,d.jsx)("div",{ref:k,className:ms("block-editor-global-styles-background-panel__inspector-media-replace-container",{"is-open":f}),children:m?(0,d.jsx)(yu,{label:c,filename:c,url:u,onToggle:b,hasImageValue:p,onReset:a,containerRef:k,children:(0,d.jsxs)(ws.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,d.jsx)(Su,{onChange:t,style:e,inheritedValue:l,displayInPanel:!0,onResetImage:()=>{b(!1),a()},onRemoveImage:()=>b(!1),defaultValues:r,containerRef:k}),(0,d.jsx)(wu,{onChange:t,style:e,defaultValues:r,inheritedValue:l})]})}):(0,d.jsx)(Su,{onChange:t,style:e,inheritedValue:l,defaultValues:r,onResetImage:()=>{b(!1),a()},onRemoveImage:()=>b(!1),containerRef:k})})}const Bu={backgroundImage:!0};function Iu(e){return"web"===h.Platform.OS&&e?.background?.backgroundImage}function ju(e){return!!e?.background?.backgroundImage?.id||"string"==typeof e?.background?.backgroundImage||!!e?.background?.backgroundImage?.url}function Eu({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r,headerLabel:i}){const s=Ji();return(0,d.jsx)(ws.__experimentalToolsPanel,{label:i,resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:s,children:r})}function Tu({as:e=Eu,value:t,onChange:n,inheritedValue:o,settings:r,panelId:i,defaultControls:s=Bu,defaultValues:l={},headerLabel:a=(0,T.__)("Background image")}){const c=Iu(r),u=(0,h.useCallback)((e=>({...e,background:{}})),[]);return(0,d.jsx)(e,{resetAllFilter:u,value:t,onChange:n,panelId:i,headerLabel:a,children:c&&(0,d.jsx)(ws.__experimentalToolsPanelItem,{hasValue:()=>!!t?.background,label:(0,T.__)("Image"),onDeselect:()=>n(me(t,["background"],{})),isShownByDefault:s.backgroundImage,panelId:i,children:(0,d.jsx)(Cu,{value:t,onChange:n,settings:r,inheritedValue:o,defaultControls:s,defaultValues:l})})})}const Mu="background",Pu={backgroundSize:"cover",backgroundPosition:"50% 50%"};function Ru(e,t="any"){const n=(0,p.getBlockSupport)(e,Mu);return!0===n||("any"===t?!!n?.backgroundImage||!!n?.backgroundSize||!!n?.backgroundRepeat:!!n?.[t])}function Au(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:Pu.backgroundSize}),"contain"!==e?.backgroundSize||e?.backgroundPosition||(t={backgroundPosition:Pu.backgroundPosition}),t}function Nu(e){return ju(e)?"has-background":""}function Lu({children:e}){const t=(0,h.useCallback)((e=>({...e,style:{...e.style,background:void 0}})),[]);return(0,d.jsx)(Fa,{group:"background",resetAllFilter:t,children:e})}function Du({clientId:e,name:t,setAttributes:n,settings:o}){const{style:r,inheritedValue:i}=(0,g.useSelect)((n=>{const{getBlockAttributes:o,getSettings:r}=n(ji),i=r();return{style:o(e)?.style,inheritedValue:i[N]?.blocks?.[t]}}),[e,t]);if(!Iu(o)||!Ru(t,"backgroundImage"))return null;const s={...o,background:{...o.background,backgroundSize:o?.background?.backgroundSize&&Ru(t,"backgroundSize")}},l=(0,p.getBlockSupport)(t,[Mu,"defaultControls"]);return(0,d.jsx)(Tu,{inheritedValue:i,as:Lu,panelId:e,defaultValues:Pu,settings:s,onChange:e=>{n({style:fs(e)})},defaultControls:l,value:r})}var Ou={useBlockProps:function({name:e,style:t}){if(!Ru(e)||!t?.background?.backgroundImage)return;const n=Au(t?.background);return n?{style:{...n}}:void 0},attributeKeys:["style"],hasSupport:Ru};(0,f.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return"type"in(e.attributes?.lock??{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));var zu=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})});var Vu=(0,h.memo)((function({icon:e,showColors:t=!1,className:n,context:o}){"block-default"===e?.src&&(e={src:zu});const r=(0,d.jsx)(ws.Icon,{icon:e&&e.src?e.src:e,context:o}),i=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,d.jsx)("span",{style:i,className:ms("block-editor-block-icon",n,{"has-colors":t}),children:r})}));var Fu=function({blockTypes:e,value:t,onItemChange:n}){return(0,d.jsx)("ul",{className:"block-editor-block-manager__checklist",children:e.map((e=>(0,d.jsxs)("li",{className:"block-editor-block-manager__checklist-item",children:[(0,d.jsx)(ws.CheckboxControl,{__nextHasNoMarginBottom:!0,label:e.title,checked:t.includes(e.name),onChange:(...t)=>n(e,...t)}),(0,d.jsx)(Vu,{icon:e.icon})]},e.name)))})};var Hu=function e({title:t,blockTypes:n,selectedBlockTypes:o,onChange:r}){const i=(0,m.useInstanceId)(e),s=(0,h.useCallback)(((e,t)=>{r(t?[...o,e]:o.filter((({name:t})=>t!==e.name)))}),[o,r]),l=(0,h.useCallback)((e=>{r(e?[...o,...n.filter((e=>!o.find((({name:t})=>t===e.name))))]:o.filter((e=>!n.find((({name:t})=>t===e.name)))))}),[n,o,r]);if(!n.length)return null;const a=n.map((({name:e})=>e)).filter((e=>(o??[]).some((t=>t.name===e)))),c="block-editor-block-manager__category-title-"+i,u=a.length===n.length,p=!u&&a.length>0;return(0,d.jsxs)("div",{role:"group","aria-labelledby":c,className:"block-editor-block-manager__category",children:[(0,d.jsx)(ws.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:u,onChange:l,className:"block-editor-block-manager__category-title",indeterminate:p,label:(0,d.jsx)("span",{id:c,children:t})}),(0,d.jsx)(Fu,{blockTypes:n,value:a,onItemChange:s})]})};function Uu({blockTypes:e,selectedBlockTypes:t,onChange:n,showSelectAll:o=!0}){const r=(0,m.useDebounce)(Uo.speak,500),[i,s]=(0,h.useState)(""),{categories:l,isMatchingSearchTerm:a}=(0,g.useSelect)((e=>({categories:e(p.store).getCategories(),isMatchingSearchTerm:e(p.store).isMatchingSearchTerm})),[]),c=e.filter((e=>!i||a(e,i))),u=t.length>0&&t.length!==e.length,f=e.length>0&&t.length===e.length;return(0,h.useEffect)((()=>{if(!i)return;const e=c.length,t=(0,T.sprintf)((0,T._n)("%d result found.","%d results found.",e),e);r(t)}),[c?.length,i,r]),(0,d.jsxs)(ws.__experimentalVStack,{className:"block-editor-block-manager__content",spacing:4,children:[(0,d.jsx)(ws.SearchControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Search for a block"),placeholder:(0,T.__)("Search for a block"),value:i,onChange:e=>s(e),className:"block-editor-block-manager__search"}),o&&(0,d.jsx)(ws.CheckboxControl,{className:"block-editor-block-manager__select-all",label:(0,T.__)("Select all"),checked:f,onChange:()=>{n(f?[]:e)},indeterminate:u,__nextHasNoMarginBottom:!0}),(0,d.jsxs)("div",{tabIndex:"0",role:"region","aria-label":(0,T.__)("Available block types"),className:"block-editor-block-manager__results",children:[0===c.length&&(0,d.jsx)("p",{className:"block-editor-block-manager__no-results",children:(0,T.__)("No blocks found.")}),l.map((e=>(0,d.jsx)(Hu,{title:e.title,blockTypes:c.filter((t=>t.category===e.slug)),selectedBlockTypes:t,onChange:n},e.slug))),(0,d.jsx)(Hu,{title:(0,T.__)("Uncategorized"),blockTypes:c.filter((({category:e})=>!e)),selectedBlockTypes:t,onChange:n})]})]})}function Gu({clientId:e,blockTypes:t,selectedBlockTypes:n,onClose:o}){const[r,i]=(0,h.useState)(n),{updateBlockAttributes:s}=(0,g.useDispatch)(ji);return(0,d.jsx)(ws.Modal,{title:(0,T.__)("Manage allowed blocks"),onRequestClose:o,overlayClassName:"block-editor-block-allowed-blocks-modal",focusOnMount:"firstContentElement",size:"medium",children:(0,d.jsxs)(ws.__experimentalVStack,{as:"form",onSubmit:n=>{n.preventDefault(),(()=>{const n=r.length===t.length,i=r.map((({name:e})=>e));s(e,{allowedBlocks:n?void 0:i}),o()})()},spacing:"4",children:[(0,d.jsx)(ws.__experimentalText,{children:(0,T.__)("Select which blocks can be added inside this container.")}),(0,d.jsx)(Uu,{blockTypes:t,selectedBlockTypes:r,onChange:e=>{i(e)}}),(0,d.jsxs)(ws.Flex,{className:"block-editor-block-allowed-blocks-modal__actions",justify:"flex-end",expanded:!1,children:[(0,d.jsx)(ws.FlexItem,{children:(0,d.jsx)(ws.Button,{variant:"tertiary",onClick:o,__next40pxDefaultSize:!0,children:(0,T.__)("Cancel")})}),(0,d.jsx)(ws.FlexItem,{children:(0,d.jsx)(ws.Button,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:(0,T.__)("Apply")})})]})]})})}function $u({clientId:e}){const[t,n]=(0,h.useState)(!1),{blockTypes:o,selectedBlockNames:r}=(0,g.useSelect)((t=>{const{getBlockAttributes:n}=t(ji);return{blockTypes:t(p.store).getBlockTypes(),selectedBlockNames:n(e)?.allowedBlocks}}),[e]),i=o.filter((e=>(0,p.hasBlockSupport)(e,"inserter",!0)&&(!e.parent||e.parent.includes("core/post-content"))));if(!i)return null;const s=void 0===r?i:i.filter((e=>r.includes(e.name)));return(0,d.jsxs)("div",{className:"block-editor-block-allowed-blocks-control",children:[(0,d.jsxs)(ws.BaseControl,{help:(0,T.__)("Specify which blocks are allowed inside this container."),__nextHasNoMarginBottom:!0,children:[(0,d.jsx)(ws.BaseControl.VisualLabel,{children:(0,T.__)("Allowed Blocks")}),(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{n(!0)},className:"block-editor-block-allowed-blocks-control__button",children:(0,T.__)("Manage allowed blocks")})]}),t&&(0,d.jsx)(Gu,{clientId:e,blockTypes:i,selectedBlockTypes:s,onClose:()=>n(!1)})]})}var Wu={edit:function({clientId:e}){return(0,g.useSelect)((t=>"contentOnly"===t(ji).getBlockEditingMode(e)),[e])?null:(0,d.jsx)(Pa.Fill,{children:(0,d.jsx)($u,{clientId:e})})},attributeKeys:["allowedBlocks"],hasSupport:e=>(0,p.hasBlockSupport)(e,"allowedBlocks")};(0,f.addFilter)("blocks.registerBlockType","core/allowedBlocks/attribute",(function(e){return e?.attributes?.allowedBlocks?.type||(0,p.hasBlockSupport)(e,"allowedBlocks")&&(e.attributes={...e.attributes,allowedBlocks:{type:"array"}}),e})),(0,f.addFilter)("blocks.switchToBlockType.transformedBlock","core/allowedBlocks/addTransforms",(function(e,t,n,o){if(!(0,p.hasBlockSupport)(e.name,"allowedBlocks"))return e;if(1!==t.length&&1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(o.length>1&&t.length>1&&o.length!==t.length)return e;if(e.attributes.allowedBlocks)return e;const r=t[n]?.attributes?.allowedBlocks;if(!r)return e;const i=(0,p.getBlockType)(e.name),s=i?.allowedBlocks||[];if(!s.length)return{...e,attributes:{...e.attributes,allowedBlocks:r}};const l=r.filter((e=>s.includes(e)));return{...e,attributes:{...e.attributes,allowedBlocks:l}}}));const Ku=/[\s#]/g,Zu={type:"string",source:"attribute",attribute:"id",selector:"*"};var qu={addSaveProps:function(e,t,n){(0,p.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor);return e},edit:function({anchor:e,setAttributes:t}){if("default"!==ga())return null;const n="web"===h.Platform.OS;return(0,d.jsx)(Fa,{group:"advanced",children:(0,d.jsx)(ws.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"html-anchor-control",label:(0,T.__)("HTML anchor"),help:(0,d.jsxs)(d.Fragment,{children:[(0,T.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor”. Then, you’ll be able to link directly to this section of your page."),n&&(0,d.jsxs)(d.Fragment,{children:[" ",(0,d.jsx)(ws.ExternalLink,{href:(0,T.__)("https://wordpress.org/documentation/article/page-jumps/"),children:(0,T.__)("Learn more about anchors")})]})]}),value:e||"",placeholder:n?null:(0,T.__)("Add an anchor"),onChange:e=>{e=e.replace(Ku,"-"),t({anchor:e})},autoCapitalize:"none",autoComplete:"off"})})},attributeKeys:["anchor"],hasSupport:e=>(0,p.hasBlockSupport)(e,"anchor")};(0,f.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return"type"in(e.attributes?.anchor??{})||(0,p.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Zu}),e}));var Yu={addSaveProps:function(e,t,n){return(0,p.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e},attributeKeys:["ariaLabel"],hasSupport:e=>(0,p.hasBlockSupport)(e,"ariaLabel")};(0,f.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){return e?.attributes?.ariaLabel?.type||(0,p.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:{type:"string"}}),e}));var Xu={edit:function({className:e,setAttributes:t}){return"default"!==ga()?null:(0,d.jsx)(Fa,{group:"advanced",children:(0,d.jsx)(ws.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,autoComplete:"off",label:(0,T.__)("Additional CSS class(es)"),value:e||"",onChange:e=>{t({className:""!==e?e:void 0})},help:(0,T.__)("Separate multiple classes with spaces.")})})},addSaveProps:function(e,t,n){(0,p.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=ms(e.className,n.className));return e},attributeKeys:["className"],hasSupport:e=>(0,p.hasBlockSupport)(e,"customClassName",!0)};(0,f.addFilter)("blocks.registerBlockType","core/editor/custom-class-name/attribute",(function(e){return(0,p.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,f.addFilter)("blocks.switchToBlockType.transformedBlock","core/customClassName/addTransforms",(function(e,t,n,o){if(!(0,p.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){const o=t[n]?.attributes.className;if(o&&void 0===e.attributes.className)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,f.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,p.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,p.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,p.getBlockDefaultClassName)(t.name)),e}));var Qu={grad:.9,turn:360,rad:360/(2*Math.PI)},Ju=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},ed=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},td=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},nd=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},od=function(e){return{r:td(e.r,0,255),g:td(e.g,0,255),b:td(e.b,0,255),a:td(e.a)}},rd=function(e){return{r:ed(e.r),g:ed(e.g),b:ed(e.b),a:ed(e.a,3)}},id=/^#([0-9a-f]{3,8})$/i,sd=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},ld=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,i=Math.max(t,n,o),s=i-Math.min(t,n,o),l=s?i===t?(n-o)/s:i===n?2+(o-t)/s:4+(t-n)/s:0;return{h:60*(l<0?l+6:l),s:i?s/i*100:0,v:i/255*100,a:r}},ad=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var i=Math.floor(t),s=o*(1-n),l=o*(1-(t-i)*n),a=o*(1-(1-t+i)*n),c=i%6;return{r:255*[o,l,s,s,a,o][c],g:255*[a,o,o,l,s,s][c],b:255*[s,s,a,o,o,l][c],a:r}},cd=function(e){return{h:nd(e.h),s:td(e.s,0,100),l:td(e.l,0,100),a:td(e.a)}},ud=function(e){return{h:ed(e.h),s:ed(e.s),l:ed(e.l),a:ed(e.a,3)}},dd=function(e){return ad((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},pd=function(e){return{h:(t=ld(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},hd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,md=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,fd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bd={string:[[function(e){var t=id.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?ed(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?ed(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=md.exec(e)||fd.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:od({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=hd.exec(e)||gd.exec(e);if(!t)return null;var n,o,r=cd({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Qu[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return dd(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,i=void 0===r?1:r;return Ju(t)&&Ju(n)&&Ju(o)?od({r:Number(t),g:Number(n),b:Number(o),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,i=void 0===r?1:r;if(!Ju(t)||!Ju(n)||!Ju(o))return null;var s=cd({h:Number(t),s:Number(n),l:Number(o),a:Number(i)});return dd(s)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,i=void 0===r?1:r;if(!Ju(t)||!Ju(n)||!Ju(o))return null;var s=function(e){return{h:nd(e.h),s:td(e.s,0,100),v:td(e.v,0,100),a:td(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(i)});return ad(s)},"hsv"]]},kd=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},vd=function(e){return"string"==typeof e?kd(e.trim(),bd.string):"object"==typeof e&&null!==e?kd(e,bd.object):[null,void 0]},_d=function(e,t){var n=pd(e);return{h:n.h,s:td(n.s+100*t,0,100),l:n.l,a:n.a}},yd=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},xd=function(e,t){var n=pd(e);return{h:n.h,s:n.s,l:td(n.l+100*t,0,100),a:n.a}},Sd=function(){function e(e){this.parsed=vd(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return ed(yd(this.rgba),2)},e.prototype.isDark=function(){return yd(this.rgba)<.5},e.prototype.isLight=function(){return yd(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=rd(this.rgba)).r,n=e.g,o=e.b,i=(r=e.a)<1?sd(ed(255*r)):"","#"+sd(t)+sd(n)+sd(o)+i;var e,t,n,o,r,i},e.prototype.toRgb=function(){return rd(this.rgba)},e.prototype.toRgbString=function(){return t=(e=rd(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return ud(pd(this.rgba))},e.prototype.toHslString=function(){return t=(e=ud(pd(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=ld(this.rgba),{h:ed(e.h),s:ed(e.s),v:ed(e.v),a:ed(e.a,3)};var e},e.prototype.invert=function(){return wd({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),wd(_d(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),wd(_d(this.rgba,-e))},e.prototype.grayscale=function(){return wd(_d(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),wd(xd(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),wd(xd(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?wd({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):ed(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=pd(this.rgba);return"number"==typeof e?wd({h:e,s:t.s,l:t.l,a:t.a}):ed(t.h)},e.prototype.isEqual=function(e){return this.toHex()===wd(e).toHex()},e}(),wd=function(e){return e instanceof Sd?e:new Sd(e)},Cd=[],Bd=function(e){e.forEach((function(e){Cd.indexOf(e)<0&&(e(Sd,bd),Cd.push(e))}))};function Id(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var i={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,s,l=o[this.toHex()];if(l)return l;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!i.length)for(var d in n)i[d]=new e(n[d]).toRgb();for(var p in n){var h=(r=a,s=i[p],Math.pow(r.r-s.r,2)+Math.pow(r.g-s.g,2)+Math.pow(r.b-s.b,2));h<c&&(c=h,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var jd=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Ed=function(e){return.2126*jd(e.r)+.7152*jd(e.g)+.0722*jd(e.b)};function Td(e){e.prototype.luminance=function(){return e=Ed(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,o,r,i,s,l,a,c=t instanceof e?t:new e(t);return i=this.rgba,s=c.toRgb(),n=(l=Ed(i))>(a=Ed(s))?(l+.05)/(a+.05):(a+.05)/(l+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(s=void 0===(i=(n=t).size)?"normal":i,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===s?7:"AA"===r&&"large"===s?3:4.5);var n,o,r,i,s}}Bd([Id,Td]);const{kebabCase:Md}=G(ws.privateApis),Pd=(e,t,n)=>{if(t){const n=e?.find((e=>e.slug===t));if(n)return n}return{color:n}},Rd=(e,t)=>e?.find((e=>e.color===t));function Ad(e,t){if(e&&t)return`has-${Md(t)}-${e}`}function Nd(){const[e,t,n,o,r,i,s,l,a,c]=Ti("color.custom","color.palette.custom","color.palette.theme","color.palette.default","color.defaultPalette","color.customGradient","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients"),u={disableCustomColors:!e,disableCustomGradients:!i};return u.colors=(0,h.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,T._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",colors:n}),r&&o&&o.length&&e.push({name:(0,T._x)("Default","Indicates this palette comes from WordPress."),slug:"default",colors:o}),t&&t.length&&e.push({name:(0,T._x)("Custom","Indicates this palette is created by the user."),slug:"custom",colors:t}),e}),[t,n,o,r]),u.gradients=(0,h.useMemo)((()=>{const e=[];return l&&l.length&&e.push({name:(0,T._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",gradients:l}),c&&a&&a.length&&e.push({name:(0,T._x)("Default","Indicates this palette comes from WordPress."),slug:"default",gradients:a}),s&&s.length&&e.push({name:(0,T._x)("Custom","Indicates this palette is created by the user."),slug:"custom",gradients:s}),e}),[s,l,a,c]),u.hasColorsOrGradients=!!u.colors.length||!!u.gradients.length,u}var Ld=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})});function Dd({isLinked:e,...t}){const n=e?(0,T.__)("Unlink radii"):(0,T.__)("Link radii");return(0,d.jsx)(ws.Button,{...t,className:"components-border-radius-control__linked-button",size:"small",icon:e?Ld:ec,iconSize:24,label:n})}function Od(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function zd(e){return!!e?.includes&&("0"===e||e.includes("var:preset|border-radius|"))}function Vd(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|border-radius\|(.+)/);return t?t[1]:void 0}function Fd(e,t){if(!zd(e))return e;const n=0===parseFloat(e,10)?"0":Vd(e),o=t.find((e=>String(e.slug)===n));return o?.size}function Hd(e,t,n){const o=parseInt(e,10);if("selectList"===t){if(0===o)return}else if(0===o)return"0";return`var:preset|border-radius|${n[e]?.slug}`}function Ud(e,t){if(!e||zd(e)||"0"===e)return e;const n=t.find((t=>String(t.size)===String(e)));return n?.slug?`var:preset|border-radius|${n.slug}`:e}var Gd=(0,d.jsxs)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ue.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,d.jsx)(ue.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]}),$d=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5Zm-12.5 9v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z"})}),Wd=(0,d.jsxs)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ue.G,{opacity:".25",children:(0,d.jsx)(ue.Path,{d:"M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z"})}),(0,d.jsx)(ue.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6 5.75a.25.25 0 0 0-.25.25v3h-1.5V6c0-.966.784-1.75 1.75-1.75h3v1.5H6Z"})]}),Kd=(0,d.jsxs)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ue.G,{opacity:".25",children:(0,d.jsx)(ue.Path,{d:"M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z"})}),(0,d.jsx)(ue.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5Z"})]}),Zd=(0,d.jsxs)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ue.G,{opacity:".25",children:(0,d.jsx)(ue.Path,{d:"M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z"})}),(0,d.jsx)(ue.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.75 15v3c0 .138.112.25.25.25h3v1.5H6A1.75 1.75 0 0 1 4.25 18v-3h1.5Z"})]}),qd=(0,d.jsxs)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,d.jsx)(ue.G,{opacity:".25",children:(0,d.jsx)(ue.Path,{d:"M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z"})}),(0,d.jsx)(ue.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 18.25h3a.25.25 0 0 0 .25-.25v-3h1.5v3A1.75 1.75 0 0 1 18 19.75h-3v-1.5Z"})]});const Yd={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},Xd=8,Qd=[],Jd={all:(0,T.__)("Border radius"),topLeft:(0,T.__)("Top left"),topRight:(0,T.__)("Top right"),bottomLeft:(0,T.__)("Bottom left"),bottomRight:(0,T.__)("Bottom right")},ep={all:$d,topLeft:Wd,topRight:Kd,bottomLeft:Zd,bottomRight:qd},tp=0,np={px:100,em:20,rem:20};function op({corner:e,onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,units:i,presets:s}){const l=n=>{t("all"===e?{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n}:{...a,[e]:n})},a="string"!=typeof r?r:{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r};let c;if("all"===e){const e=function(e,t){if(!e||"object"!=typeof e)return e;const n={};return Object.keys(e).forEach((o=>{const r=e[o];if(zd(r)){const e=Fd(r,t);n[o]=void 0!==e?e:r}else n[o]=r})),n}(a,s),t=function(e={}){if("string"==typeof e)return e;const t=Object.values(e).map((e=>{const t=(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(e);return"string"==typeof e&&void 0===t[0]?[e,""]:t})),n=t.map((e=>e[0]??"")),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",i=Od(o);return 0===r||r?`${r}${i||""}`:void 0}(e);c=Ud(t,s)}else c=Ud(a[e],s);const u=zd(c)?Fd(c,s):c,[p,g]=(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(u),m=c?g:n[e]||n.flat||"px",f=i&&i.find((e=>e.value===m)),b=f?.step||1,[k,v]=(0,h.useState)(void 0!==c&&!zd(c)),_=s.length<=Xd,y=function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":Vd(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(c,s),x=s.slice(1,s.length-1).map(((e,t)=>({value:t+1,label:void 0}))),S=x.length>0;let w=[];_||(w=[...s,{name:(0,T.__)("Custom"),slug:"custom",size:u}].map(((e,t)=>({key:t,name:e.name}))));const C=ep[e];return(0,d.jsxs)(ws.__experimentalHStack,{children:[C&&(0,d.jsx)(ws.Icon,{className:"components-border-radius-control__icon",icon:C,size:24}),(!S||k)&&(0,d.jsxs)("div",{className:"components-border-radius-control__input-controls-wrapper",children:[(0,d.jsx)(ws.Tooltip,{text:Jd[e],placement:"top",children:(0,d.jsx)("div",{className:"components-border-radius-control__tooltip-wrapper",children:(0,d.jsx)(ws.__experimentalUnitControl,{className:"components-border-radius-control__unit-control","aria-label":Jd[e],value:[p,m].join(""),onChange:e=>{if(!t)return;const n=!isNaN(parseFloat(e));l(n?e:void 0)},onUnitChange:t=>{const r={...n};"all"===e?(r.flat=t,r.topLeft=t,r.topRight=t,r.bottomLeft=t,r.bottomRight=t):r[e]=t,o(r)},size:"__unstable-large",min:tp,units:i})})}),(0,d.jsx)(ws.RangeControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:p??"",min:tp,max:np[m],initialPosition:0,withInputField:!1,onChange:e=>{l(void 0!==e?`${e}${m}`:void 0)},step:b,__nextHasNoMarginBottom:!0})]}),S&&_&&!k&&(0,d.jsx)(ws.RangeControl,{__next40pxDefaultSize:!0,className:"components-border-radius-control__range-control",value:y,onChange:e=>{l(Hd(e,"range",s))},withInputField:!1,"aria-valuenow":y,"aria-valuetext":s[y]?.name,renderTooltipContent:e=>void 0===c?void 0:s[e]?.name,min:0,max:s.length-1,marks:x,label:Jd[e],hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),!_&&!k&&(0,d.jsx)(ws.CustomSelectControl,{className:"components-border-radius-control__custom-select-control",value:w.find((e=>e.key===y))||w[w.length-1],onChange:e=>{e.selectedItem.key===w.length-1?v(!0):l(Hd(e.selectedItem.key,"selectList",s))},options:w,label:Jd[e],hideLabelFromVision:!0,size:"__unstable-large"}),S&&(0,d.jsx)(ws.Button,{label:k?(0,T.__)("Use border radius preset"):(0,T.__)("Set custom border radius"),icon:Gd,onClick:()=>{v(!k)},isPressed:k,size:"small",className:"components-border-radius-control__custom-toggle",iconSize:24})]})}function rp({onChange:e,values:t,presets:n}){const[o,r]=(0,h.useState)(!function(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}(t)||!function(e={}){if("string"==typeof e)return!1;if(!e||"object"!=typeof e)return!1;const t=Object.values(e);if(0===t.length)return!1;const n=t[0];return!t.every((e=>e===n))}(t)),i=function(e){const t=e?.default??Qd,n=e?.custom??Qd,o=e?.theme??Qd;return(0,h.useMemo)((()=>{const e=[{name:(0,T.__)("None"),slug:"0",size:0},...n,...o,...t];return e.length>Xd?[{name:(0,T.__)("Default"),slug:"default",size:void 0},...e]:e}),[n,o,t])}(n),[s,l]=(0,h.useState)({flat:"string"==typeof t?(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(t)[1]:void 0,topLeft:(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(t?.topLeft)[1],topRight:(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(t?.topRight)[1],bottomLeft:(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomLeft)[1],bottomRight:(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomRight)[1]}),[a]=Ti("spacing.units"),c=(0,ws.__experimentalUseCustomUnits)({availableUnits:a||["px","em","rem"]});return(0,d.jsxs)("fieldset",{className:"components-border-radius-control",children:[(0,d.jsxs)(ws.__experimentalHStack,{className:"components-border-radius-control__header",children:[(0,d.jsx)(ws.BaseControl.VisualLabel,{as:"legend",children:(0,T.__)("Radius")}),(0,d.jsx)(Dd,{onClick:()=>r(!o),isLinked:o})]}),o?(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(op,{onChange:e,selectedUnits:s,setSelectedUnits:l,values:t,units:c,corner:"all",presets:i})}):(0,d.jsx)(ws.__experimentalVStack,{children:["topLeft","topRight","bottomLeft","bottomRight"].map((n=>(0,d.jsx)(op,{onChange:e,selectedUnits:s,setSelectedUnits:l,values:t||Yd,units:c,corner:n,presets:i},n)))})]})}var ip=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})}),sp=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{d:"M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z"})});const lp=[];function ap({shadow:e,onShadowChange:t,settings:n}){const o=hp(n);return(0,d.jsx)("div",{className:"block-editor-global-styles__shadow-popover-container",children:(0,d.jsxs)(ws.__experimentalVStack,{spacing:4,children:[(0,d.jsx)(ws.__experimentalHeading,{level:5,children:(0,T.__)("Drop shadow")}),(0,d.jsx)(cp,{presets:o,activeShadow:e,onSelect:t}),(0,d.jsx)("div",{className:"block-editor-global-styles__clear-shadow",children:(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t(void 0),disabled:!e,accessibleWhenDisabled:!0,children:(0,T.__)("Clear")})})]})})}function cp({presets:e,activeShadow:t,onSelect:n}){return e?(0,d.jsx)(ws.Composite,{role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":(0,T.__)("Drop shadows"),children:e.map((({name:e,slug:o,shadow:r})=>(0,d.jsx)(up,{label:e,isActive:r===t,type:"unset"===o?"unset":"preset",onSelect:()=>n(r===t?void 0:r),shadow:r},o)))}):null}function up({type:e,label:t,isActive:n,onSelect:o,shadow:r}){return(0,d.jsx)(ws.Tooltip,{text:t,children:(0,d.jsx)(ws.Composite.Item,{role:"option","aria-label":t,"aria-selected":n,className:ms("block-editor-global-styles__shadow__item",{"is-active":n}),render:(0,d.jsx)("button",{className:ms("block-editor-global-styles__shadow-indicator",{unset:"unset"===e}),onClick:o,style:{boxShadow:r},"aria-label":t,children:n&&(0,d.jsx)(Ol,{icon:ip})})})})}function dp({shadow:e,onShadowChange:t,settings:n}){return(0,d.jsx)(ws.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles__shadow-dropdown",renderToggle:pp(e,t),renderContent:()=>(0,d.jsx)(ws.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,d.jsx)(ap,{shadow:e,onShadowChange:t,settings:n})})})}function pp(e,t){return({onToggle:n,isOpen:o})=>{const r=(0,h.useRef)(void 0),i={onClick:n,className:ms("block-editor-global-styles__shadow-dropdown-toggle",{"is-open":o}),"aria-expanded":o,ref:r},s={onClick:()=>{o&&n(),t(void 0),r.current?.focus()},className:ms("block-editor-global-styles__shadow-editor__remove-button",{"is-open":o}),label:(0,T.__)("Remove")};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,...i,children:(0,d.jsxs)(ws.__experimentalHStack,{justify:"flex-start",children:[(0,d.jsx)(Ol,{className:"block-editor-global-styles__toggle-icon",icon:sp,size:24}),(0,d.jsx)(ws.FlexItem,{children:(0,T.__)("Drop shadow")})]})}),!!e&&(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,size:"small",icon:Ha,...s})]})}}function hp(e){return(0,h.useMemo)((()=>{if(!e?.shadow)return lp;const t=e?.shadow?.defaultPresets,{default:n,theme:o,custom:r}=e?.shadow?.presets??{},i={name:(0,T.__)("Unset"),slug:"unset",shadow:"none"},s=[...t&&n||lp,...o||lp,...r||lp];return s.length&&s.unshift(i),s}),[e])}function gp(e){return Object.values(mp(e)).some(Boolean)}function mp(e){return{hasBorderColor:fp(e),hasBorderRadius:bp(e),hasBorderStyle:kp(e),hasBorderWidth:vp(e),hasShadow:_p(e)}}function fp(e){return e?.border?.color}function bp(e){return e?.border?.radius}function kp(e){return e?.border?.style}function vp(e){return e?.border?.width}function _p(e){const t=hp(e);return!!e?.shadow&&t.length>0}function yp({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r,label:i}){const s=Ji();return(0,d.jsx)(ws.__experimentalToolsPanel,{label:i,resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:s,children:r})}const xp={radius:!0,color:!0,width:!0,shadow:!0};function Sp({as:e=yp,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,name:s,defaultControls:l=xp}){const a=ps(r),c=(0,h.useCallback)((e=>ts({settings:r},"",e)),[r]),u=e=>{const t=a.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},p=(0,h.useMemo)((()=>{if((0,ws.__experimentalHasSplitBorders)(o?.border)){const e={...o?.border};return["top","right","bottom","left"].forEach((t=>{e[t]={...e[t],color:c(e[t]?.color)}})),e}return{...o?.border,color:o?.border?.color?c(o?.border?.color):void 0}}),[o?.border,c]),g=e=>n({...t,border:e}),m=fp(r),f=kp(r),b=vp(r),k=bp(r),v=(0,h.useMemo)((()=>"object"!=typeof o?.border?.radius?c(o?.border?.radius):{topLeft:c(o?.border?.radius?.topLeft),topRight:c(o?.border?.radius?.topRight),bottomLeft:c(o?.border?.radius?.bottomLeft),bottomRight:c(o?.border?.radius?.bottomRight)}),[o?.border?.radius,c]),_=e=>g({...p,radius:e}),y=()=>{const e=t?.border?.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},x=_p(r),S=c(o?.shadow),w=r?.shadow?.presets??{},C=w.custom??w.theme??w.default??[],B=e=>{const o=C?.find((({shadow:t})=>t===e))?.slug;n(me(t,["shadow"],o?`var:preset|shadow|${o}`:e||void 0))},I=(0,h.useCallback)((e=>({...e,border:void 0,shadow:void 0})),[]),j=l?.color||l?.width,E=m||f||b||k,M=Ap({blockName:s,hasShadowControl:x,hasBorderControl:E});return(0,d.jsxs)(e,{resetAllFilter:I,value:t,onChange:n,panelId:i,label:M,children:[(b||m)&&(0,d.jsx)(ws.__experimentalToolsPanelItem,{hasValue:()=>(0,ws.__experimentalIsDefinedBorder)(t?.border),label:(0,T.__)("Border"),onDeselect:()=>(()=>{if(y())return g({radius:t?.border?.radius});g(void 0)})(),isShownByDefault:j,panelId:i,children:(0,d.jsx)(ws.BorderBoxControl,{colors:a,enableAlpha:!0,enableStyle:f,onChange:e=>{const t={...e};(0,ws.__experimentalHasSplitBorders)(t)?["top","right","bottom","left"].forEach((e=>{t[e]&&(t[e]={...t[e],color:u(t[e]?.color)})})):t&&(t.color=u(t.color)),g({radius:p?.radius,...t})},popoverOffset:40,popoverPlacement:"left-start",value:p,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large",hideLabelFromVision:!x,label:(0,T.__)("Border")})}),k&&(0,d.jsx)(ws.__experimentalToolsPanelItem,{hasValue:y,label:(0,T.__)("Radius"),onDeselect:()=>_(void 0),isShownByDefault:l.radius,panelId:i,children:(0,d.jsx)(rp,{presets:r?.border?.radiusSizes,values:v,onChange:e=>{_(e||void 0)}})}),x&&(0,d.jsxs)(ws.__experimentalToolsPanelItem,{label:(0,T.__)("Shadow"),hasValue:()=>!!t?.shadow,onDeselect:()=>B(void 0),isShownByDefault:l.shadow,panelId:i,children:[E?(0,d.jsx)(ws.BaseControl.VisualLabel,{as:"legend",children:(0,T.__)("Shadow")}):null,(0,d.jsx)(dp,{shadow:S,onShadowChange:B,settings:r})]})]})}const wp="__experimentalBorder",Cp="shadow",Bp=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},Ip=({colors:e,namedColor:t,customColor:n})=>{if(t){const n=Bp(e,"slug",t);if(n)return n}if(!n)return{color:void 0};const o=Bp(e,"color",n);return o||{color:n}};function jp(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function Ep(e){if((0,ws.__experimentalHasSplitBorders)(e?.border))return{style:e,borderColor:void 0};const t=e?.border?.color,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,o={...e};return o.border={...o.border,color:n?void 0:t},{style:fs(o),borderColor:n}}function Tp(e){return(0,ws.__experimentalHasSplitBorders)(e.style?.border)?e.style:{...e.style,border:{...e.style?.border,color:e.borderColor?"var:preset|color|"+e.borderColor:e.style?.border?.color}}}function Mp({label:e,children:t,resetAllFilter:n}){const o=(0,h.useCallback)((e=>{const t=Tp(e),o=n(t);return{...e,...Ep(o)}}),[n]);return(0,d.jsx)(Fa,{group:"border",resetAllFilter:o,label:e,children:t})}function Pp({clientId:e,name:t,setAttributes:n,settings:o}){const r=gp(o);const{style:i,borderColor:s}=(0,g.useSelect)((function(t){const{style:n,borderColor:o}=t(ji).getBlockAttributes(e)||{};return{style:n,borderColor:o}}),[e]),l=(0,h.useMemo)((()=>Tp({style:i,borderColor:s})),[i,s]);if(!r)return null;const a={...(0,p.getBlockSupport)(t,[wp,"__experimentalDefaultControls"]),...(0,p.getBlockSupport)(t,[Cp,"__experimentalDefaultControls"])};return(0,d.jsx)(Sp,{as:Mp,panelId:e,settings:o,value:l,onChange:e=>{n(Ep(e))},defaultControls:a})}function Rp(e,t="any"){if("web"!==h.Platform.OS)return!1;const n=(0,p.getBlockSupport)(e,wp);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}function Ap({blockName:e,hasBorderControl:t,hasShadowControl:n}={}){const o=mp(xs(e));return t||n||!e||(t=o?.hasBorderColor||o?.hasBorderStyle||o?.hasBorderWidth||o?.hasBorderRadius,n=o?.hasShadow),t&&n?(0,T.__)("Border & Shadow"):n?(0,T.__)("Shadow"):(0,T.__)("Border")}function Np(e,t,n){if(!Rp(t,"color")||ks(t,wp,"color"))return e;const o=Lp(n),r=ms(e.className,o);return e.className=r||void 0,e}function Lp(e){const{borderColor:t,style:n}=e,o=Ad("border-color",t);return ms({"has-border-color":t||n?.border?.color,[o]:!!o})}var Dp={useBlockProps:function({name:e,borderColor:t,style:n}){const{colors:o}=Nd();if(!Rp(e,"color")||ks(e,wp,"color"))return{};const{color:r}=Ip({colors:o,namedColor:t}),{color:i}=Ip({colors:o,namedColor:jp(n?.border?.top?.color)}),{color:s}=Ip({colors:o,namedColor:jp(n?.border?.right?.color)}),{color:l}=Ip({colors:o,namedColor:jp(n?.border?.bottom?.color)}),{color:a}=Ip({colors:o,namedColor:jp(n?.border?.left?.color)});return Np({style:fs({borderTopColor:i||r,borderRightColor:s||r,borderBottomColor:l||r,borderLeftColor:a||r})||{}},e,{borderColor:t,style:n})},addSaveProps:Np,attributeKeys:["borderColor","style"],hasSupport:e=>Rp(e,"color")};function Op(e){if(e)return`has-${e}-gradient-background`}function zp(e,t){const n=e?.find((e=>e.slug===t));return n&&n.gradient}function Vp(e,t){const n=e?.find((e=>e.gradient===t));return n}function Fp(e,t){const n=Vp(e,t);return n&&n.slug}function Hp({gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}={}){const{clientId:n}=C(),[o,r,i]=Ti("color.gradients.custom","color.gradients.theme","color.gradients.default"),s=(0,h.useMemo)((()=>[...o||[],...r||[],...i||[]]),[o,r,i]),{gradient:l,customGradient:a}=(0,g.useSelect)((o=>{const{getBlockAttributes:r}=o(ji),i=r(n)||{};return{customGradient:i[t],gradient:i[e]}}),[n,e,t]),{updateBlockAttributes:c}=(0,g.useDispatch)(ji),u=(0,h.useCallback)((o=>{const r=Fp(s,o);c(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[s,n,c]),d=Op(l);let p;return p=l?zp(s,l):a,{gradientClass:d,gradientValue:p,setGradient:u}}(0,f.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Rp(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e}));const{Tabs:Up}=G(ws.privateApis),Gp=["colors","disableCustomColors","gradients","disableCustomGradients"],$p="color",Wp="gradient";function Kp({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,className:i,label:s,onColorChange:l,onGradientChange:a,colorValue:c,gradientValue:u,clearable:p,showTitle:h=!0,enableAlpha:g,headingLevel:m}){const f=l&&(e&&e.length>0||!n),b=a&&(t&&t.length>0||!o);if(!f&&!b)return null;const k={[$p]:(0,d.jsx)(ws.ColorPalette,{value:c,onChange:b?e=>{l(e),a()}:l,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:r,clearable:p,enableAlpha:g,headingLevel:m}),[Wp]:(0,d.jsx)(ws.GradientPicker,{value:u,onChange:f?e=>{a(e),l()}:a,gradients:t,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,clearable:p,headingLevel:m})},v=e=>(0,d.jsx)("div",{className:"block-editor-color-gradient-control__panel",children:k[e]});return(0,d.jsx)(ws.BaseControl,{__nextHasNoMarginBottom:!0,className:ms("block-editor-color-gradient-control",i),children:(0,d.jsx)("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:(0,d.jsxs)(ws.__experimentalVStack,{spacing:1,children:[h&&(0,d.jsx)("legend",{children:(0,d.jsx)("div",{className:"block-editor-color-gradient-control__color-indicator",children:(0,d.jsx)(ws.BaseControl.VisualLabel,{children:s})})}),f&&b&&(0,d.jsx)("div",{children:(0,d.jsxs)(Up,{defaultTabId:u?Wp:!!f&&$p,children:[(0,d.jsxs)(Up.TabList,{children:[(0,d.jsx)(Up.Tab,{tabId:$p,children:(0,T.__)("Color")}),(0,d.jsx)(Up.Tab,{tabId:Wp,children:(0,T.__)("Gradient")})]}),(0,d.jsx)(Up.TabPanel,{tabId:$p,className:"block-editor-color-gradient-control__panel",focusable:!1,children:k.color}),(0,d.jsx)(Up.TabPanel,{tabId:Wp,className:"block-editor-color-gradient-control__panel",focusable:!1,children:k.gradient})]})}),!b&&v($p),!f&&v(Wp)]})})})}function Zp(e){const[t,n,o,r]=Ti("color.palette","color.gradients","color.custom","color.customGradient");return(0,d.jsx)(Kp,{colors:t,gradients:n,disableCustomColors:!o,disableCustomGradients:!r,...e})}var qp=function(e){return Gp.every((t=>e.hasOwnProperty(t)))?(0,d.jsx)(Kp,{...e}):(0,d.jsx)(Zp,{...e})};function Yp(e){const t=Xp(e),n=nh(e),o=Qp(e),r=eh(e),i=th(e),s=Jp(e);return t||n||o||r||i||s}function Xp(e){const t=ps(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function Qp(e){const t=ps(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function Jp(e){const t=ps(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function eh(e){const t=ps(e),n=hs(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function th(e){const t=ps(e),n=hs(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function nh(e){const t=ps(e),n=hs(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function oh({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const i=Ji();return(0,d.jsx)(ws.__experimentalToolsPanel,{label:(0,T.__)("Elements"),resetAll:()=>{const o=e(n);t(o)},panelId:o,hasInnerWrapper:!0,headingLevel:3,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:i,children:(0,d.jsx)("div",{className:"color-block-support-panel__inner-wrapper",children:r})})}const rh={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},ih={placement:"left-start",offset:36,shift:!0,flip:!0,resize:!1},{Tabs:sh}=G(ws.privateApis),lh=({indicators:e,label:t})=>(0,d.jsxs)(ws.__experimentalHStack,{justify:"flex-start",children:[(0,d.jsx)(ws.__experimentalZStack,{isLayered:!1,offset:-8,children:e.map(((e,t)=>(0,d.jsx)(ws.Flex,{expanded:!1,children:(0,d.jsx)(ws.ColorIndicator,{colorValue:e})},t)))}),(0,d.jsx)(ws.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",children:t})]});function ah({isGradient:e,inheritedValue:t,userValue:n,setValue:o,colorGradientControlSettings:r}){return(0,d.jsx)(qp,{...r,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:e?void 0:t,gradientValue:e?t:void 0,onColorChange:e?void 0:o,onGradientChange:e?o:void 0,clearable:t===n,headingLevel:3})}function ch({label:e,hasValue:t,resetValue:n,isShownByDefault:o,indicators:r,tabs:i,colorGradientControlSettings:s,panelId:l}){const a=i.find((e=>void 0!==e.userValue)),{key:c,...u}=i[0]??{},p=(0,h.useRef)(void 0);return(0,d.jsx)(ws.__experimentalToolsPanelItem,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:n,isShownByDefault:o,panelId:l,children:(0,d.jsx)(ws.Dropdown,{popoverProps:ih,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:o,isOpen:i})=>{const s={onClick:o,className:ms("block-editor-panel-color-gradient-settings__dropdown",{"is-open":i}),"aria-expanded":i,ref:p};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.Button,{...s,__next40pxDefaultSize:!0,children:(0,d.jsx)(lh,{indicators:r,label:e})}),t()&&(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,label:(0,T.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:Ha,onClick:()=>{n(),i&&o(),p.current?.focus()}})]})},renderContent:()=>(0,d.jsx)(ws.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,d.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[1===i.length&&(0,d.jsx)(ah,{...u,colorGradientControlSettings:s},c),i.length>1&&(0,d.jsxs)(sh,{defaultTabId:a?.key,children:[(0,d.jsx)(sh.TabList,{children:i.map((e=>(0,d.jsx)(sh.Tab,{tabId:e.key,children:e.label},e.key)))}),i.map((e=>{const{key:t,...n}=e;return(0,d.jsx)(sh.TabPanel,{tabId:t,focusable:!1,children:(0,d.jsx)(ah,{...n,colorGradientControlSettings:s},t)},t)}))]})]})})})})}function uh({as:e=oh,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:s=rh,children:l}){const a=ps(r),c=hs(r),u=r?.color?.custom,p=r?.color?.customGradient,g=a.length>0||u,m=c.length>0||p,f=e=>ts({settings:r},"",e),b=e=>{const t=a.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},k=e=>{const t=c.flatMap((({gradients:e})=>e)).find((({gradient:t})=>t===e));return t?"var:preset|gradient|"+t.slug:e},v=nh(r),_=f(o?.color?.background),y=f(t?.color?.background),x=f(o?.color?.gradient),S=f(t?.color?.gradient),w=Qp(r),C=f(o?.elements?.link?.color?.text),B=f(t?.elements?.link?.color?.text),I=f(o?.elements?.link?.[":hover"]?.color?.text),j=f(t?.elements?.link?.[":hover"]?.color?.text),E=Xp(r),M=f(o?.color?.text),P=f(t?.color?.text),R=e=>{let o=me(t,["color","text"],b(e));M===C&&(o=me(o,["elements","link","color","text"],b(e))),n(o)},A=[{name:"caption",label:(0,T.__)("Captions"),showPanel:Jp(r)},{name:"button",label:(0,T.__)("Button"),showPanel:th(r)},{name:"heading",label:(0,T.__)("Heading"),showPanel:eh(r)},{name:"h1",label:(0,T.__)("H1"),showPanel:eh(r)},{name:"h2",label:(0,T.__)("H2"),showPanel:eh(r)},{name:"h3",label:(0,T.__)("H3"),showPanel:eh(r)},{name:"h4",label:(0,T.__)("H4"),showPanel:eh(r)},{name:"h5",label:(0,T.__)("H5"),showPanel:eh(r)},{name:"h6",label:(0,T.__)("H6"),showPanel:eh(r)}],N=(0,h.useCallback)((e=>({...e,color:void 0,elements:{...e?.elements,link:{...e?.elements?.link,color:void 0,":hover":{color:void 0}},...A.reduce(((t,n)=>({...t,[n.name]:{...e?.elements?.[n.name],color:void 0}})),{})}})),[]),L=[E&&{key:"text",label:(0,T.__)("Text"),hasValue:()=>!!P,resetValue:()=>R(void 0),isShownByDefault:s.text,indicators:[M],tabs:[{key:"text",label:(0,T.__)("Text"),inheritedValue:M,setValue:R,userValue:P}]},v&&{key:"background",label:(0,T.__)("Background"),hasValue:()=>!!y||!!S,resetValue:()=>{const e=me(t,["color","background"],void 0);e.color.gradient=void 0,n(e)},isShownByDefault:s.background,indicators:[x??_],tabs:[g&&{key:"background",label:(0,T.__)("Color"),inheritedValue:_,setValue:e=>{const o=me(t,["color","background"],b(e));o.color.gradient=void 0,n(o)},userValue:y},m&&{key:"gradient",label:(0,T.__)("Gradient"),inheritedValue:x,setValue:e=>{const o=me(t,["color","gradient"],k(e));o.color.background=void 0,n(o)},userValue:S,isGradient:!0}].filter(Boolean)},w&&{key:"link",label:(0,T.__)("Link"),hasValue:()=>!!B||!!j,resetValue:()=>{let e=me(t,["elements","link",":hover","color","text"],void 0);e=me(e,["elements","link","color","text"],void 0),n(e)},isShownByDefault:s.link,indicators:[C,I],tabs:[{key:"link",label:(0,T.__)("Default"),inheritedValue:C,setValue:e=>{n(me(t,["elements","link","color","text"],b(e)))},userValue:B},{key:"hover",label:(0,T.__)("Hover"),inheritedValue:I,setValue:e=>{n(me(t,["elements","link",":hover","color","text"],b(e)))},userValue:j}]}].filter(Boolean);return A.forEach((({name:e,label:r,showPanel:i})=>{if(!i)return;const l=f(o?.elements?.[e]?.color?.background),a=f(o?.elements?.[e]?.color?.gradient),c=f(o?.elements?.[e]?.color?.text),u=f(t?.elements?.[e]?.color?.background),d=f(t?.elements?.[e]?.color?.gradient),p=f(t?.elements?.[e]?.color?.text),h="caption"!==e;L.push({key:e,label:r,hasValue:()=>!!(p||u||d),resetValue:()=>{const o=me(t,["elements",e,"color","background"],void 0);o.elements[e].color.gradient=void 0,o.elements[e].color.text=void 0,n(o)},isShownByDefault:s[e],indicators:h?[c,a??l]:[c],tabs:[g&&{key:"text",label:(0,T.__)("Text"),inheritedValue:c,setValue:o=>{n(me(t,["elements",e,"color","text"],b(o)))},userValue:p},g&&h&&{key:"background",label:(0,T.__)("Background"),inheritedValue:l,setValue:o=>{const r=me(t,["elements",e,"color","background"],b(o));r.elements[e].color.gradient=void 0,n(r)},userValue:u},m&&h&&{key:"gradient",label:(0,T.__)("Gradient"),inheritedValue:a,setValue:o=>{const r=me(t,["elements",e,"color","gradient"],k(o));r.elements[e].color.background=void 0,n(r)},userValue:d,isGradient:!0}].filter(Boolean)})})),(0,d.jsxs)(e,{resetAllFilter:N,value:t,onChange:n,panelId:i,children:[L.map((e=>{const{key:t,...n}=e;return(0,d.jsx)(ch,{...n,colorGradientControlSettings:{colors:a,disableCustomColors:!u,gradients:c,disableCustomGradients:!p},panelId:i},t)})),l]})}Bd([Id,Td]);var dh=function({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:n,fallbackLinkColor:o,fontSize:r,isLargeText:i,textColor:s,linkColor:l,enableAlphaChecker:a=!1}){const c=e||t;if(!c)return null;const u=s||n,p=l||o;if(!u&&!p)return null;const h=[{color:u,description:(0,T.__)("text color")},{color:p,description:(0,T.__)("link color")}],g=wd(c),m=g.alpha()<1,f=g.brightness(),b={level:"AA",size:i||!1!==i&&r>=24?"large":"small"};let k="",v="";for(const e of h){if(!e.color)continue;const t=wd(e.color),n=t.isReadable(g,b),o=t.alpha()<1;if(!n){if(m||o)continue;k=f<t.brightness()?(0,T.sprintf)((0,T.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,T.sprintf)((0,T.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),v=(0,T.__)("This color combination may be hard for people to read.");break}o&&a&&(k=(0,T.__)("Transparent text may be hard for people to read."),v=(0,T.__)("Transparent text may be hard for people to read."))}return k?((0,Uo.speak)(v),(0,d.jsx)("div",{className:"block-editor-contrast-checker",children:(0,d.jsx)(ws.Notice,{spokenMessage:null,status:"warning",isDismissible:!1,children:k})})):null};const ph=(0,h.createContext)({refsMap:(0,m.observableMap)()});function hh({children:e}){const t=(0,h.useMemo)((()=>({refsMap:(0,m.observableMap)()})),[]);return(0,d.jsx)(ph.Provider,{value:t,children:e})}function gh(e){const{refsMap:t}=(0,h.useContext)(ph);return(0,m.useRefEffect)((n=>(t.set(e,n),()=>t.delete(e))),[e])}function mh(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function fh(e,t){const{refsMap:n}=(0,h.useContext)(ph);(0,h.useLayoutEffect)((()=>{mh(t,n.get(e));const o=n.subscribe(e,(()=>mh(t,n.get(e))));return()=>{o(),mh(t,null)}}),[n,e,t])}function bh(e){const[t,n]=(0,h.useState)(null);return fh(e,n),t}function kh(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function vh(e,t){return Object.keys(t).some((n=>e[n]!==t[n]))?t:e}function _h({clientId:e}){const t=bh(e),[n,o]=(0,h.useReducer)(vh,{});return(0,h.useLayoutEffect)((()=>{function e(){o(function(e){if(!e)return{};const t=e.querySelector("a"),n=t?.innerText?kh(t,"color"):void 0,o=kh(e,"color");let r=e,i=kh(r,"background-color");for(;"rgba(0, 0, 0, 0)"===i&&r.parentNode&&r.parentNode.nodeType===r.parentNode.ELEMENT_NODE;)r=r.parentNode,i=kh(r,"background-color");return{textColor:o,backgroundColor:i,linkColor:n}}(t))}t&&window.requestAnimationFrame((()=>window.requestAnimationFrame(e)))})),(0,d.jsx)(dh,{backgroundColor:n.backgroundColor,textColor:n.textColor,linkColor:n.linkColor,enableAlphaChecker:!0})}ph.displayName="BlockRefsContext";const yh="color",xh=e=>{const t=(0,p.getBlockSupport)(e,yh);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Sh=e=>{if("web"!==h.Platform.OS)return!1;const t=(0,p.getBlockSupport)(e,yh);return null!==t&&"object"==typeof t&&!!t.link},wh=e=>{const t=(0,p.getBlockSupport)(e,yh);return null!==t&&"object"==typeof t&&!!t.gradients},Ch=e=>{const t=(0,p.getBlockSupport)(e,yh);return t&&!1!==t.background},Bh=e=>{const t=(0,p.getBlockSupport)(e,yh);return t&&!1!==t.text};function Ih(e,t,n){if(!xh(t)||ks(t,yh))return e;const o=wh(t),{backgroundColor:r,textColor:i,gradient:s,style:l}=n,a=e=>!ks(t,yh,e),c=a("text")?Ad("color",i):void 0,u=a("gradients")?Op(s):void 0,d=a("background")?Ad("background-color",r):void 0,p=a("background")||a("gradients"),h=r||l?.color?.background||o&&(s||l?.color?.gradient),g=ms(e.className,c,u,{[d]:!(o&&l?.color?.gradient||!d),"has-text-color":a("text")&&(i||l?.color?.text),"has-background":p&&h,"has-link-color":a("link")&&l?.elements?.link?.color});return e.className=g||void 0,e}function jh(e){const t=e?.color?.text,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,o=e?.color?.background,r=o?.startsWith("var:preset|color|")?o.substring(17):void 0,i=e?.color?.gradient,s=i?.startsWith("var:preset|gradient|")?i.substring(20):void 0,l={...e};return l.color={...l.color,text:n?void 0:t,background:r?void 0:o,gradient:s?void 0:i},{style:fs(l),textColor:n,backgroundColor:r,gradient:s}}function Eh(e){return{...e.style,color:{...e.style?.color,text:e.textColor?"var:preset|color|"+e.textColor:e.style?.color?.text,background:e.backgroundColor?"var:preset|color|"+e.backgroundColor:e.style?.color?.background,gradient:e.gradient?"var:preset|gradient|"+e.gradient:e.style?.color?.gradient}}}function Th({children:e,resetAllFilter:t}){const n=(0,h.useCallback)((e=>{const n=Eh(e),o=t(n);return{...e,...jh(o)}}),[t]);return(0,d.jsx)(Fa,{group:"color",resetAllFilter:n,children:e})}function Mh({clientId:e,name:t,setAttributes:n,settings:o}){const r=Yp(o);const{style:i,textColor:s,backgroundColor:l,gradient:a}=(0,g.useSelect)((function(t){const{style:n,textColor:o,backgroundColor:r,gradient:i}=t(ji).getBlockAttributes(e)||{};return{style:n,textColor:o,backgroundColor:r,gradient:i}}),[e]),c=(0,h.useMemo)((()=>Eh({style:i,textColor:s,backgroundColor:l,gradient:a})),[i,s,l,a]);if(!r)return null;const u=(0,p.getBlockSupport)(t,[yh,"__experimentalDefaultControls"]),m="web"===h.Platform.OS&&!c?.color?.gradient&&(o?.color?.text||o?.color?.link)&&!1!==(0,p.getBlockSupport)(t,[yh,"enableContrastChecker"]);return(0,d.jsx)(uh,{as:Th,panelId:e,settings:o,value:c,onChange:e=>{n(jh(e))},defaultControls:u,enableContrastChecker:!1!==(0,p.getBlockSupport)(t,[yh,"enableContrastChecker"]),children:m&&(0,d.jsx)(_h,{clientId:e})})}var Ph={useBlockProps:function({name:e,backgroundColor:t,textColor:n,gradient:o,style:r}){const[i,s,l]=Ti("color.palette.custom","color.palette.theme","color.palette.default"),a=(0,h.useMemo)((()=>[...i||[],...s||[],...l||[]]),[i,s,l]);if(!xh(e)||ks(e,yh))return{};const c={};n&&!ks(e,yh,"text")&&(c.color=Pd(a,n)?.color),t&&!ks(e,yh,"background")&&(c.backgroundColor=Pd(a,t)?.color);const u=Ih({style:c},e,{textColor:n,backgroundColor:t,gradient:o,style:r}),d=t||r?.color?.background||o||r?.color?.gradient;return{...u,className:ms(u.className,!d&&Nu(r))}},addSaveProps:Ih,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:xh};const Rh={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};function Ah({__next40pxDefaultSize:e=!1,__nextHasNoMarginBottom:t=!1,value:n="",onChange:o,fontFamilies:r,className:i,...s}){const[l]=Ti("typography.fontFamilies");if(r||(r=l),!r||0===r.length)return null;const a=[{key:"",name:(0,T.__)("Default")},...r.map((({fontFamily:e,name:t})=>({key:e,name:t||e,style:{fontFamily:e}})))];t||I()("Bottom margin styles for wp.blockEditor.FontFamilyControl",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),e||void 0!==s.size&&"default"!==s.size||I()("36px default size for wp.blockEditor.__experimentalFontFamilyControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."});const c=a.find((e=>e.key===n))??"";return(0,d.jsx)(ws.CustomSelectControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,T.__)("Font"),value:c,onChange:({selectedItem:e})=>o(e.key),options:a,className:ms("block-editor-font-family-control",i,{"is-next-has-no-margin-bottom":t}),...s})}(0,f.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return xh(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),wh(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,f.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return bs({linkColor:Sh(r),textColor:Bh(r),backgroundColor:Ch(r),gradient:wh(r)},Rh,e,t,n,o)}));const Nh=(e,t)=>e?t?(0,T.__)("Appearance"):(0,T.__)("Font style"):(0,T.__)("Font weight");function Lh(e){const{__next40pxDefaultSize:t=!1,onChange:n,hasFontStyles:o=!0,hasFontWeights:r=!0,fontFamilyFaces:i,value:{fontStyle:s,fontWeight:l},...a}=e,c=o||r,u=Nh(o,r),p={key:"default",name:(0,T.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},{fontStyles:g,fontWeights:m,combinedStyleAndWeightOptions:f}=$i(i),b=(0,h.useMemo)((()=>o&&r?(()=>{const e=[p];return f&&e.push(...f),e})():o?(()=>{const e=[p];return g.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})})),e})():(()=>{const e=[p];return m.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:void 0,fontWeight:n}})})),e})()),[e.options,g,m,f]),k=b.find((e=>e.style.fontStyle===s&&e.style.fontWeight===l))||b[0];return t||void 0!==a.size&&"default"!==a.size||I()("36px default size for wp.blockEditor.__experimentalFontAppearanceControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),c&&(0,d.jsx)(ws.CustomSelectControl,{...a,className:"components-font-appearance-control",__next40pxDefaultSize:t,__shouldNotWarnDeprecated36pxSize:!0,label:u,describedBy:k?o?r?(0,T.sprintf)((0,T.__)("Currently selected font appearance: %s"),k.name):(0,T.sprintf)((0,T.__)("Currently selected font style: %s"),k.name):(0,T.sprintf)((0,T.__)("Currently selected font weight: %s"),k.name):(0,T.__)("No selected font appearance"),options:b,value:k,onChange:({selectedItem:e})=>n(e.style)})}const Dh=1.5;var Oh=({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:o="60px",...r})=>{const i=function(e){return void 0!==e&&""!==e}(t),s=(e,t)=>{if(i)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return Dh;default:return e}},l=i?t:"";return e||void 0!==r.size&&"default"!==r.size||I()("36px default size for wp.blockEditor.LineHeightControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),(0,d.jsx)("div",{className:"block-editor-line-height-control",children:(0,d.jsx)(ws.__experimentalNumberControl,{...r,__shouldNotWarnDeprecated36pxSize:!0,__next40pxDefaultSize:e,__unstableInputWidth:o,__unstableStateReducer:(e,t)=>{const n=["insertText","insertFromPaste"].includes(t.payload.event.nativeEvent?.inputType),o=s(e.value,n);return{...e,value:o}},onChange:(e,{event:t})=>{""!==e?"click"!==t.type?n(`${e}`):n(s(`${e}`,!1)):n()},label:(0,T.__)("Line height"),placeholder:Dh,step:.01,spinFactor:10,value:l,min:0,spinControls:"custom"})})};function zh({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:o="60px",...r}){const[i]=Ti("spacing.units"),s=(0,ws.__experimentalUseCustomUnits)({availableUnits:i||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return e||void 0!==r.size&&"default"!==r.size||I()("36px default size for wp.blockEditor.__experimentalLetterSpacingControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),(0,d.jsx)(ws.__experimentalUnitControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,...r,label:(0,T.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:s,onChange:n})}var Vh=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"})}),Fh=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"})}),Hh=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"})}),Uh=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M4 12.8h16v-1.5H4v1.5zm0 7h12.4v-1.5H4v1.5zM4 4.3v1.5h16V4.3H4z"})});const Gh=[{label:(0,T.__)("Align text left"),value:"left",icon:Vh},{label:(0,T.__)("Align text center"),value:"center",icon:Fh},{label:(0,T.__)("Align text right"),value:"right",icon:Hh},{label:(0,T.__)("Justify text"),value:"justify",icon:Uh}],$h=["left","center","right"];function Wh({className:e,value:t,onChange:n,options:o=$h}){const r=(0,h.useMemo)((()=>Gh.filter((e=>o.includes(e.value)))),[o]);return r.length?(0,d.jsx)(ws.__experimentalToggleGroupControl,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,T.__)("Text alignment"),className:ms("block-editor-text-alignment-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:r.map((e=>(0,d.jsx)(ws.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value)))}):null}var Kh=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})}),Zh=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})}),qh=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"})});const Yh=[{label:(0,T.__)("None"),value:"none",icon:Ha},{label:(0,T.__)("Uppercase"),value:"uppercase",icon:Kh},{label:(0,T.__)("Lowercase"),value:"lowercase",icon:Zh},{label:(0,T.__)("Capitalize"),value:"capitalize",icon:qh}];function Xh({className:e,value:t,onChange:n}){return(0,d.jsx)(ws.__experimentalToggleGroupControl,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,T.__)("Letter case"),className:ms("block-editor-text-transform-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:Yh.map((e=>(0,d.jsx)(ws.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value)))})}var Qh=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})}),Jh=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})});const eg=[{label:(0,T.__)("None"),value:"none",icon:Ha},{label:(0,T.__)("Underline"),value:"underline",icon:Qh},{label:(0,T.__)("Strikethrough"),value:"line-through",icon:Jh}];function tg({value:e,onChange:t,className:n}){return(0,d.jsx)(ws.__experimentalToggleGroupControl,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,T.__)("Decoration"),className:ms("block-editor-text-decoration-control",n),value:e,onChange:n=>{t(n===e?void 0:n)},children:eg.map((e=>(0,d.jsx)(ws.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value)))})}var ng=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M8.2 14.4h3.9L13 17h1.7L11 6.5H9.3L5.6 17h1.7l.9-2.6zm2-5.5 1.4 4H8.8l1.4-4zm7.4 7.5-1.3.8.8 1.4H5.5V20h14.3l-2.2-3.6z"})}),og=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M7 5.6v1.7l2.6.9v3.9L7 13v1.7L17.5 11V9.3L7 5.6zm4.2 6V8.8l4 1.4-4 1.4zm-5.7 5.6V5.5H4v14.3l3.6-2.2-.8-1.3-1.3.9z"})});const rg=[{label:(0,T.__)("Horizontal"),value:"horizontal-tb",icon:ng},{label:(0,T.__)("Vertical"),value:(0,T.isRTL)()?"vertical-lr":"vertical-rl",icon:og}];function ig({className:e,value:t,onChange:n}){return(0,d.jsx)(ws.__experimentalToggleGroupControl,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,T.__)("Orientation"),className:ms("block-editor-writing-mode-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:rg.map((e=>(0,d.jsx)(ws.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value)))})}const sg=1,lg=6;function ag(e){const t=ug(e),n=dg(e),o=pg(e),r=hg(e),i=mg(e),s=gg(e),l=fg(e),a=bg(e),c=kg(e),u=cg(e);return t||n||o||r||i||s||u||l||a||c}function cg(e){return!1!==e?.typography?.defaultFontSizes&&e?.typography?.fontSizes?.default?.length||e?.typography?.fontSizes?.theme?.length||e?.typography?.fontSizes?.custom?.length||e?.typography?.customFontSize}function ug(e){return["default","theme","custom"].some((t=>e?.typography?.fontFamilies?.[t]?.length))}function dg(e){return e?.typography?.lineHeight}function pg(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function hg(e){return e?.typography?.letterSpacing}function gg(e){return e?.typography?.textTransform}function mg(e){return e?.typography?.textAlign}function fg(e){return e?.typography?.textDecoration}function bg(e){return e?.typography?.writingMode}function kg(e){return e?.typography?.textColumns}function vg({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const i=Ji();return(0,d.jsx)(ws.__experimentalToolsPanel,{label:(0,T.__)("Typography"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:i,children:r})}const _g={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,writingMode:!0,textColumns:!0};function yg({as:e=vg,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:s=_g,fitText:l=!1}){const a=e=>ts({settings:r},"",e),c=ug(r),u=a(o?.typography?.fontFamily),{fontFamilies:p,fontFamilyFaces:g}=(0,h.useMemo)((()=>function(e,t){const n=e?.typography?.fontFamilies,o=["default","theme","custom"].flatMap((e=>n?.[e]??[])),r=o.find((e=>e.fontFamily===t))?.fontFace??[];return{fontFamilies:o,fontFamilyFaces:r}}(r,u)),[r,u]),m=e=>{const o=p?.find((({fontFamily:t})=>t===e))?.slug;n(me(t,["typography","fontFamily"],o?`var:preset|font-family|${o}`:e||void 0))},f=cg(r),b=!r?.typography?.customFontSize,k=function(e){const t=e?.typography?.fontSizes,n=!!e?.typography?.defaultFontSizes;return[...t?.custom??[],...t?.theme??[],...n?t?.default??[]:[]]}(r),v=a(o?.typography?.fontSize),_=(()=>{const e=o?.typography?.fontSize;if(!e||"string"!=typeof e)return;if(e.startsWith("var:preset|font-size|"))return e.replace("var:preset|font-size|","");const t=e.match(/^var\(--wp--preset--font-size--([^)]+)\)$/);return t?t[1]:void 0})(),y=(e,o)=>{n(me(t,["typography","fontSize"],(o?.slug?`var:preset|font-size|${o?.slug}`:e)||void 0))},x=pg(r),S=function(e){return e?.typography?.fontStyle?e?.typography?.fontWeight?(0,T.__)("Appearance"):(0,T.__)("Font style"):(0,T.__)("Font weight")}(r),w=r?.typography?.fontStyle,C=r?.typography?.fontWeight,B=a(o?.typography?.fontStyle),I=a(o?.typography?.fontWeight),{nearestFontStyle:j,nearestFontWeight:E}=function(e,t,n){let o=t,r=n;const{fontStyles:i,fontWeights:s,combinedStyleAndWeightOptions:l}=$i(e),a=i?.some((({value:e})=>e===t)),c=s?.some((({value:e})=>e?.toString()===n?.toString()));var u,d;return a||(o=t?(u=i,"string"==typeof(d=t)&&d&&["normal","italic","oblique"].includes(d)?!u||0===u.length||u.find((e=>e.value===d))?d:"oblique"!==d||u.find((e=>"oblique"===e.value))?"":"italic":""):l?.find((e=>e.style.fontWeight===Zi(s,n)))?.style?.fontStyle),c||(r=n?Zi(s,n):l?.find((e=>e.style.fontStyle===(o||t)))?.style?.fontWeight),{nearestFontStyle:o,nearestFontWeight:r}}(g,B,I),M=(0,h.useCallback)((({fontStyle:e,fontWeight:o})=>{e===B&&o===I||n({...t,typography:{...t?.typography,fontStyle:e||void 0,fontWeight:o||void 0}})}),[B,I,n,t]),P=(0,h.useCallback)((()=>{M({})}),[M]);(0,h.useEffect)((()=>{j&&E?M({fontStyle:j,fontWeight:E}):P()}),[j,E,P,M]);const R=dg(r),A=a(o?.typography?.lineHeight),N=e=>{n(me(t,["typography","lineHeight"],e||void 0))},L=hg(r),D=a(o?.typography?.letterSpacing),O=e=>{n(me(t,["typography","letterSpacing"],e||void 0))},z=kg(r),V=a(o?.typography?.textColumns),F=e=>{n(me(t,["typography","textColumns"],e||void 0))},H=gg(r),U=a(o?.typography?.textTransform),G=e=>{n(me(t,["typography","textTransform"],e||void 0))},$=fg(r),W=a(o?.typography?.textDecoration),K=e=>{n(me(t,["typography","textDecoration"],e||void 0))},Z=bg(r),q=a(o?.typography?.writingMode),Y=e=>{n(me(t,["typography","writingMode"],e||void 0))},X=mg(r),Q=a(o?.typography?.textAlign),J=e=>{n(me(t,["typography","textAlign"],e||void 0))},ee=(0,h.useCallback)((e=>({...e,typography:{}})),[]);return(0,d.jsxs)(e,{resetAllFilter:ee,value:t,onChange:n,panelId:i,children:[c&&(0,d.jsx)(ws.__experimentalToolsPanelItem,{label:(0,T.__)("Font"),hasValue:()=>!!t?.typography?.fontFamily,onDeselect:()=>m(void 0),isShownByDefault:s.fontFamily,panelId:i,children:(0,d.jsx)(Ah,{fontFamilies:p,value:u,onChange:m,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),f&&!l&&(0,d.jsx)(ws.__experimentalToolsPanelItem,{label:(0,T.__)("Size"),hasValue:()=>!!t?.typography?.fontSize,onDeselect:()=>y(void 0),isShownByDefault:s.fontSize,panelId:i,children:(0,d.jsx)(ws.FontSizePicker,{value:_||v,valueMode:_?"slug":"literal",onChange:y,fontSizes:k,disableCustomFontSizes:b,withReset:!1,withSlider:!0,size:"__unstable-large"})}),x&&(0,d.jsx)(ws.__experimentalToolsPanelItem,{className:"single-column",label:S,hasValue:()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,onDeselect:P,isShownByDefault:s.fontAppearance,panelId:i,children:(0,d.jsx)(Lh,{value:{fontStyle:B,fontWeight:I},onChange:M,hasFontStyles:w,hasFontWeights:C,fontFamilyFaces:g,size:"__unstable-large"})}),R&&(0,d.jsx)(ws.__experimentalToolsPanelItem,{className:"single-column",label:(0,T.__)("Line height"),hasValue:()=>void 0!==t?.typography?.lineHeight,onDeselect:()=>N(void 0),isShownByDefault:s.lineHeight,panelId:i,children:(0,d.jsx)(Oh,{__unstableInputWidth:"auto",value:A,onChange:N,size:"__unstable-large"})}),L&&(0,d.jsx)(ws.__experimentalToolsPanelItem,{className:"single-column",label:(0,T.__)("Letter spacing"),hasValue:()=>!!t?.typography?.letterSpacing,onDeselect:()=>O(void 0),isShownByDefault:s.letterSpacing,panelId:i,children:(0,d.jsx)(zh,{value:D,onChange:O,size:"__unstable-large",__unstableInputWidth:"auto"})}),z&&(0,d.jsx)(ws.__experimentalToolsPanelItem,{className:"single-column",label:(0,T.__)("Columns"),hasValue:()=>!!t?.typography?.textColumns,onDeselect:()=>F(void 0),isShownByDefault:s.textColumns,panelId:i,children:(0,d.jsx)(ws.__experimentalNumberControl,{label:(0,T.__)("Columns"),max:lg,min:sg,onChange:F,size:"__unstable-large",spinControls:"custom",value:V,initialPosition:1})}),$&&(0,d.jsx)(ws.__experimentalToolsPanelItem,{className:"single-column",label:(0,T.__)("Decoration"),hasValue:()=>!!t?.typography?.textDecoration,onDeselect:()=>K(void 0),isShownByDefault:s.textDecoration,panelId:i,children:(0,d.jsx)(tg,{value:W,onChange:K,size:"__unstable-large",__unstableInputWidth:"auto"})}),Z&&(0,d.jsx)(ws.__experimentalToolsPanelItem,{className:"single-column",label:(0,T.__)("Orientation"),hasValue:()=>!!t?.typography?.writingMode,onDeselect:()=>Y(void 0),isShownByDefault:s.writingMode,panelId:i,children:(0,d.jsx)(ig,{value:q,onChange:Y,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),H&&(0,d.jsx)(ws.__experimentalToolsPanelItem,{label:(0,T.__)("Letter case"),hasValue:()=>!!t?.typography?.textTransform,onDeselect:()=>G(void 0),isShownByDefault:s.textTransform,panelId:i,children:(0,d.jsx)(Xh,{value:U,onChange:G,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),X&&(0,d.jsx)(ws.__experimentalToolsPanelItem,{label:(0,T.__)("Text alignment"),hasValue:()=>!!t?.typography?.textAlign,onDeselect:()=>J(void 0),isShownByDefault:s.textAlign,panelId:i,children:(0,d.jsx)(Wh,{value:Q,onChange:J,size:"__unstable-large",__nextHasNoMarginBottom:!0})})]})}const xg="typography.lineHeight";const Sg=window.wp.tokenList;var wg=n.n(Sg);const Cg="typography.__experimentalFontFamily",{kebabCase:Bg}=G(ws.privateApis);function Ig(e,t,n){if(!(0,p.hasBlockSupport)(t,Cg))return e;if(ks(t,Jg,"fontFamily"))return e;if(!n?.fontFamily)return e;const o=new(wg())(e.className);o.add(`has-${Bg(n?.fontFamily)}-font-family`);const r=o.value;return e.className=r||void 0,e}var jg={useBlockProps:function({name:e,fontFamily:t}){return Ig({},e,{fontFamily:t})},addSaveProps:Ig,attributeKeys:["fontFamily"],hasSupport:e=>(0,p.hasBlockSupport)(e,Cg)};(0,f.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,p.hasBlockSupport)(e,Cg)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e}));const{kebabCase:Eg}=G(ws.privateApis),Tg=(e,t,n)=>{if(t){const n=e?.find((({slug:e})=>e===t));if(n)return n}return{size:n}};function Mg(e,t){const n=e?.find((({size:e})=>e===t));return n||{size:t}}function Pg(e){if(e)return`has-${Eg(e)}-font-size`}const Rg="typography.fontSize";function Ag(e,t,n){if(!(0,p.hasBlockSupport)(t,Rg))return e;if(ks(t,Jg,"fontSize"))return e;const o=new(wg())(e.className);o.add(Pg(n.fontSize));const r=o.value;return e.className=r||void 0,e}var Ng={useBlockProps:function({name:e,fontSize:t,style:n}){const[o,r,i]=Ti("typography.fontSizes","typography.fluid","layout");if(!(0,p.hasBlockSupport)(e,Rg)||ks(e,Jg,"fontSize")||!t&&!n?.typography?.fontSize)return;let s;return n?.typography?.fontSize&&(s={style:{fontSize:Wi({size:n.typography.fontSize},{typography:{fluid:r},layout:i})}}),t&&(s={style:{fontSize:Tg(o,t,n?.typography?.fontSize).size}}),s?Ag(s,e,{fontSize:t}):void 0},addSaveProps:Ag,attributeKeys:["fontSize","style","fitText"],hasSupport:e=>(0,p.hasBlockSupport)(e,Rg)};const Lg={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,f.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,p.hasBlockSupport)(e,Rg)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,f.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const r=e.name;return bs({fontSize:(0,p.hasBlockSupport)(r,Rg)},Lg,e,t,n,o)}));const Dg=[{icon:Vh,title:(0,T.__)("Align text left"),align:"left"},{icon:Fh,title:(0,T.__)("Align text center"),align:"center"},{icon:Hh,title:(0,T.__)("Align text right"),align:"right"}],Og={placement:"bottom-start"};var zg=function({value:e,onChange:t,alignmentControls:n=Dg,label:o=(0,T.__)("Align text"),description:r=(0,T.__)("Change text alignment"),isCollapsed:i=!0,isToolbar:s}){function l(n){return()=>t(e===n?void 0:n)}const a=n.find((t=>t.align===e)),c=s?ws.ToolbarGroup:ws.ToolbarDropdownMenu,u=s?{isCollapsed:i}:{toggleProps:{description:r},popoverProps:Og};return(0,d.jsx)(c,{icon:a?a.icon:(0,T.isRTL)()?Hh:Vh,label:o,controls:n.map((t=>{const{align:n}=t,o=e===n;return{...t,isActive:o,role:i?"menuitemradio":void 0,onClick:l(n)}})),...u})};const Vg=e=>(0,d.jsx)(zg,{...e,isToolbar:!1}),Fg=e=>(0,d.jsx)(zg,{...e,isToolbar:!0}),Hg="typography.textAlign",Ug=[{icon:Vh,title:(0,T.__)("Align text left"),align:"left"},{icon:Fh,title:(0,T.__)("Align text center"),align:"center"},{icon:Hh,title:(0,T.__)("Align text right"),align:"right"}],Gg=["left","center","right"],$g=[];function Wg(e){return Array.isArray(e)?Gg.filter((t=>e.includes(t))):!0===e?Gg:$g}var Kg={edit:function({style:e,name:t,setAttributes:n}){const o=xs(t),r=o?.typography?.textAlign,i=ga();if(!r||"default"!==i)return null;const s=Wg((0,p.getBlockSupport)(t,Hg));if(!s.length)return null;const l=Ug.filter((e=>s.includes(e.align)));return(0,d.jsx)(Rs,{group:"block",children:(0,d.jsx)(Vg,{value:e?.typography?.textAlign,onChange:t=>{const o={...e,typography:{...e?.typography,textAlign:t}};n({style:fs(o)})},alignmentControls:l})})},useBlockProps:function({name:e,style:t}){if(!t?.typography?.textAlign)return null;if(!Wg((0,p.getBlockSupport)(e,Hg)).length)return null;if(ks(e,Jg,"textAlign"))return null;const n=t.typography.textAlign;return{className:ms({[`has-text-align-${n}`]:n})}},addSaveProps:function(e,t,n){if(!n?.style?.typography?.textAlign)return e;const{textAlign:o}=n.style.typography,r=(0,p.getBlockSupport)(t,Hg);Wg(r).includes(o)&&!ks(t,Jg,"textAlign")&&(e.className=ms(`has-text-align-${o}`,e.className));return e},attributeKeys:["style"],hasSupport:e=>(0,p.hasBlockSupport)(e,Hg,!1)};function Zg(e,t){if(!e)return;t(0);const n=function(e,t){const n=e.scrollHeight>e.clientHeight;let o=5,r=2400,i=o;const s=window.getComputedStyle(e),l=parseFloat(s.paddingLeft)||0,a=parseFloat(s.paddingRight)||0,c=document.createRange();for(c.selectNodeContents(e);o<=r;){const s=Math.floor((o+r)/2);t(s);const u=c.getBoundingClientRect().width,d=e.scrollWidth<=e.clientWidth&&u<=e.clientWidth-l-a,p=n||e.scrollHeight<=e.clientHeight;d&&p?(i=s,o=s+1):r=s-1}return c.detach(),i}(e,t);return t(n),n}const qg={},Yg="typography.fitText";(0,f.addFilter)("blocks.registerBlockType","core/fit-text/addAttribute",(function(e){return(0,p.hasBlockSupport)(e,Yg)?e.attributes?.fitText?e:{...e,attributes:{...e.attributes,fitText:{type:"boolean"}}}:e}));var Xg={useBlockProps:function({name:e,fitText:t,clientId:n}){return function({fitText:e,name:t,clientId:n}){const o=(0,p.hasBlockSupport)(t,Yg),r=bh(n),{blockAttributes:i,parentId:s}=(0,g.useSelect)((t=>n&&o&&e?{blockAttributes:t(ji).getBlockAttributes(n),parentId:t(ji).getBlockRootClientId(n)}:qg),[n,o,e]),l=(0,h.useCallback)((()=>{if(!r||!o||!e)return;const t=`fit-text-${n}`;let i=r.ownerDocument.getElementById(t);i||(i=r.ownerDocument.createElement("style"),i.id=t,r.ownerDocument.head.appendChild(i));const s=`#block-${n}`;Zg(r,(e=>{i.textContent=0===e?"":`${s} { font-size: ${e}px !important; }`}))}),[r,n,o,e]);(0,h.useEffect)((()=>{if(!(e&&r&&n&&o))return;const t=r,i=t.style.visibility;let s,a=null,c=null,u=null;return a=window.requestAnimationFrame((()=>{t.style.visibility="hidden",c=window.requestAnimationFrame((()=>{l(),u=setTimeout((()=>{t.style.visibility=i}),10)}))})),window.ResizeObserver&&t.parentElement&&(s=new window.ResizeObserver(l),s.observe(t.parentElement),s.observe(t)),()=>{null!==a&&window.cancelAnimationFrame(a),null!==c&&window.cancelAnimationFrame(c),null!==u&&clearTimeout(u),s&&s.disconnect();const e=`fit-text-${n}`,o=t.ownerDocument.getElementById(e);o&&o.remove()}}),[e,n,s,l,r,o]),(0,h.useEffect)((()=>{if(e&&r&&o){const e=window.requestAnimationFrame((()=>{r&&l()}));return()=>window.cancelAnimationFrame(e)}}),[i,e,l,r,o])}({fitText:t,name:e,clientId:n}),t&&(0,p.hasBlockSupport)(e,Yg)?{className:"has-fit-text"}:{}},addSaveProps:function(e,t,n){if(!(0,p.hasBlockSupport)(t,Yg))return e;const{fitText:o}=n;if(!o)return e;const r=e.className?`${e.className} has-fit-text`:"has-fit-text";return{...e,className:r}},attributeKeys:["fitText"],hasSupport:e=>(0,p.hasBlockSupport)(e,Yg),edit:()=>null};function Qg(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}const Jg="typography",em=[xg,Rg,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",Cg,Hg,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalWritingMode","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing",Yg];function tm(e){const t={...Qg(e,["fontFamily"])},n=e?.typography?.fontSize,o=e?.typography?.fontFamily,r="string"==typeof n&&n?.startsWith("var:preset|font-size|")?n.substring(21):void 0,i=o?.startsWith("var:preset|font-family|")?o.substring(23):void 0;return t.typography={...Qg(t.typography,["fontFamily"]),fontSize:r?void 0:n},{style:fs(t),fontFamily:i,fontSize:r}}function nm(e){return{...e.style,typography:{...e.style?.typography,fontFamily:e.fontFamily?"var:preset|font-family|"+e.fontFamily:void 0,fontSize:e.fontSize?"var:preset|font-size|"+e.fontSize:e.style?.typography?.fontSize}}}function om({children:e,resetAllFilter:t}){const n=(0,h.useCallback)((e=>{const n=nm(e),o=t(n);return{...e,...tm(o)}}),[t]);return(0,d.jsx)(Fa,{group:"typography",resetAllFilter:n,children:e})}function rm({clientId:e,name:t,setAttributes:n,settings:o}){const{style:r,fontFamily:i,fontSize:s,fitText:l}=(0,g.useSelect)((function(t){const{style:n,fontFamily:o,fontSize:r,fitText:i}=t(ji).getBlockAttributes(e)||{};return{style:n,fontFamily:o,fontSize:r,fitText:i}}),[e]),a=ag(o),c=(0,h.useMemo)((()=>nm({style:r,fontFamily:i,fontSize:s})),[r,s,i]);if(!a)return null;const u=(0,p.getBlockSupport)(t,[Jg,"__experimentalDefaultControls"]);return(0,d.jsx)(yg,{as:om,panelId:e,settings:o,value:c,onChange:e=>{n(tm(e))},defaultControls:u,fitText:l})}const im=[],sm=new Intl.Collator("und",{numeric:!0}).compare;function lm(){const[e,t,n,o]=Ti("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),r=e??im,i=t??im,s=n&&!1!==o?n:im;return(0,h.useMemo)((()=>{const e=[{name:(0,T.__)("None"),slug:"0",size:0},...r,...i,...s];return e.every((({slug:e})=>/^[0-9]/.test(e)))&&e.sort(((e,t)=>sm(e.slug,t.slug))),e.length>Qs?[{name:(0,T.__)("Default"),slug:"default",size:void 0},...e]:e}),[r,i,s])}const am={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1},svw:{max:100,steps:1},lvw:{max:100,steps:1},dvw:{max:100,steps:1},svh:{max:100,steps:1},lvh:{max:100,steps:1},dvh:{max:100,steps:1},vi:{max:100,steps:1},svi:{max:100,steps:1},lvi:{max:100,steps:1},dvi:{max:100,steps:1},vb:{max:100,steps:1},svb:{max:100,steps:1},lvb:{max:100,steps:1},dvb:{max:100,steps:1},vmin:{max:100,steps:1},svmin:{max:100,steps:1},lvmin:{max:100,steps:1},dvmin:{max:100,steps:1},vmax:{max:100,steps:1},svmax:{max:100,steps:1},lvmax:{max:100,steps:1},dvmax:{max:100,steps:1}};function cm({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:o,onMouseOut:r,onMouseOver:i,showSideInLabel:s=!0,side:l,spacingSizes:a,type:c,value:u}){u=sl(u,a);let p=a;const f=a.length<=Qs,b=(0,g.useSelect)((e=>{const t=e(ji).getSettings();return t?.disableCustomSpacingSizes})),[k,v]=(0,h.useState)(!b&&void 0!==u&&!rl(u)),[_,y]=(0,h.useState)(n),x=(0,m.usePrevious)(u);u&&x!==u&&!rl(u)&&!0!==k&&v(!0);const[S]=Ti("spacing.units"),w=(0,ws.__experimentalUseCustomUnits)({availableUnits:S||["px","em","rem"]});let C=null;!f&&!k&&void 0!==u&&(!rl(u)||rl(u)&&t)?(p=[...a,{name:t?(0,T.__)("Mixed"):(0,T.sprintf)((0,T.__)("Custom (%s)"),u),slug:"custom",size:u}],C=p.length-1):t||(C=k?il(u,a):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":al(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(u,a));const B=(0,h.useMemo)((()=>(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(C)),[C])[1]||w[0]?.value,I=parseFloat(C,10),j=(e,t)=>{const n=parseInt(e,10);if("selectList"===t){if(0===n)return;if(1===n)return"0"}else if(0===n)return"0";return`var:preset|spacing|${a[e]?.slug}`},E=t?(0,T.__)("Mixed"):null,M=p.map(((e,t)=>({key:t,name:e.name}))),P=a.slice(1,a.length-1).map(((e,t)=>({value:t+1,label:void 0}))),R=Js.includes(l)&&s?nl[l]:"",A=s?c?.toLowerCase():c,N=(0,T.sprintf)((0,T._x)("%1$s %2$s","spacing"),R,A).trim();return(0,d.jsxs)(ws.__experimentalHStack,{className:"spacing-sizes-control__wrapper",children:[e&&(0,d.jsx)(ws.Icon,{className:"spacing-sizes-control__icon",icon:e,size:24}),k&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.__experimentalUnitControl,{onMouseOver:i,onMouseOut:r,onFocus:i,onBlur:r,onChange:e=>o((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:C,units:w,min:_,placeholder:E,disableUnits:t,label:N,hideLabelFromVision:!0,className:"spacing-sizes-control__custom-value-input",size:"__unstable-large",onDragStart:()=>{"-"===u?.charAt(0)&&y(0)},onDrag:()=>{"-"===u?.charAt(0)&&y(0)},onDragEnd:()=>{y(n)}}),(0,d.jsx)(ws.RangeControl,{__next40pxDefaultSize:!0,onMouseOver:i,onMouseOut:r,onFocus:i,onBlur:r,value:I,min:0,max:am[B]?.max??10,step:am[B]?.steps??.1,withInputField:!1,onChange:e=>{o([e,B].join(""))},className:"spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0,label:N,hideLabelFromVision:!0})]}),f&&!k&&(0,d.jsx)(ws.RangeControl,{__next40pxDefaultSize:!0,onMouseOver:i,onMouseOut:r,className:"spacing-sizes-control__range-control",value:C,onChange:e=>o(j(e)),onMouseDown:e=>{e?.nativeEvent?.offsetX<35&&void 0===u&&o("0")},withInputField:!1,"aria-valuenow":C,"aria-valuetext":a[C]?.name,renderTooltipContent:e=>void 0===u?void 0:a[e]?.name,min:0,max:a.length-1,marks:P,label:N,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:i,onBlur:r}),!f&&!k&&(0,d.jsx)(ws.CustomSelectControl,{className:"spacing-sizes-control__custom-select-control",value:M.find((e=>e.key===C))||"",onChange:e=>{o(j(e.selectedItem.key,"selectList"))},options:M,label:N,hideLabelFromVision:!0,size:"__unstable-large",onMouseOver:i,onMouseOut:r,onFocus:i,onBlur:r}),!b&&(0,d.jsx)(ws.Button,{label:k?(0,T.__)("Use size preset"):(0,T.__)("Set custom size"),icon:Gd,onClick:()=>{v(!k)},isPressed:k,size:"small",className:"spacing-sizes-control__custom-toggle",iconSize:24})]})}const um=["vertical","horizontal"];function dm({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:i,type:s,values:l}){const a=e=>n=>{if(!t)return;const o={...Object.keys(l).reduce(((e,t)=>(e[t]=sl(l[t],i),e)),{})};"vertical"===e&&(o.top=n,o.bottom=n),"horizontal"===e&&(o.left=n,o.right=n),t(o)},c=r?.length?um.filter((e=>cl(r,e))):um;return(0,d.jsx)(d.Fragment,{children:c.map((t=>{const r="vertical"===t?l.top:l.left;return(0,d.jsx)(cm,{icon:tl[t],label:nl[t],minimumCustomValue:e,onChange:a(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:i,type:s,value:r,withInputField:!1},`spacing-sizes-control-${t}`)}))})}function pm({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:i,type:s,values:l}){const a=r?.length?Js.filter((e=>r.includes(e))):Js,c=e=>n=>{const o={...Object.keys(l).reduce(((e,t)=>(e[t]=sl(l[t],i),e)),{})};o[e]=n,t(o)};return(0,d.jsx)(d.Fragment,{children:a.map((t=>(0,d.jsx)(cm,{icon:tl[t],label:nl[t],minimumCustomValue:e,onChange:c(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:i,type:s,value:l[t],withInputField:!1},`spacing-sizes-control-${t}`)))})}function hm({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:i,spacingSizes:s,type:l,values:a}){return(0,d.jsx)(cm,{label:nl[i],minimumCustomValue:e,onChange:(c=i,e=>{const n={...Object.keys(a).reduce(((e,t)=>(e[t]=sl(a[t],s),e)),{})};n[c]=e,t(n)}),onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:i,spacingSizes:s,type:l,value:a[i],withInputField:!1});var c}function gm({isLinked:e,...t}){const n=e?(0,T.__)("Unlink sides"):(0,T.__)("Link sides");return(0,d.jsx)(ws.Button,{...t,size:"small",icon:e?Ld:ec,iconSize:24,label:n})}function mm({inputProps:e,label:t,minimumCustomValue:n=0,onChange:o,onMouseOut:r,onMouseOver:i,showSideInLabel:s=!0,sides:l=Js,useSelect:a,values:c}){const u=lm(),p=c||el,g=1===l?.length,m=l?.includes("horizontal")&&l?.includes("vertical")&&2===l?.length,[f,b]=(0,h.useState)(function(e={},t){const{top:n,right:o,bottom:r,left:i}=e,s=[n,o,r,i].filter(Boolean),l=!(n!==r||i!==o||!n&&!i),a=!s.length&&function(e=[]){const t={top:0,right:0,bottom:0,left:0};return e.forEach((e=>t[e]+=1)),(t.top+t.bottom)%2==0&&(t.left+t.right)%2==0}(t),c=t?.includes("horizontal")&&t?.includes("vertical")&&2===t?.length;if(cl(t)&&(l||a))return ol.axial;if(c&&1===s.length){let t;return Object.entries(e).some((([e,n])=>(t=e,void 0!==n))),t}return 1!==t?.length||s.length?ol.custom:t[0]}(p,l)),k={...e,minimumCustomValue:n,onChange:e=>{const t={...c,...e};o(t)},onMouseOut:r,onMouseOver:i,sides:l,spacingSizes:u,type:t,useSelect:a,values:p},v=Js.includes(f)&&s?nl[f]:"",_=(0,T.sprintf)((0,T._x)("%1$s %2$s","spacing"),t,v).trim();return(0,d.jsxs)("fieldset",{className:"spacing-sizes-control",children:[(0,d.jsxs)(ws.__experimentalHStack,{className:"spacing-sizes-control__header",children:[(0,d.jsx)(ws.BaseControl.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:_}),!g&&!m&&(0,d.jsx)(gm,{label:t,onClick:()=>{b(f===ol.axial?ol.custom:ol.axial)},isLinked:f===ol.axial})]}),(0,d.jsx)(ws.__experimentalVStack,{spacing:.5,children:f===ol.axial?(0,d.jsx)(dm,{...k}):f===ol.custom?(0,d.jsx)(pm,{...k}):(0,d.jsx)(hm,{side:f,...k,showSideInLabel:s})})]})}const fm={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1},svw:{max:100,step:1},lvw:{max:100,step:1},dvw:{max:100,step:1},svh:{max:100,step:1},lvh:{max:100,step:1},dvh:{max:100,step:1},vi:{max:100,step:1},svi:{max:100,step:1},lvi:{max:100,step:1},dvi:{max:100,step:1},vb:{max:100,step:1},svb:{max:100,step:1},lvb:{max:100,step:1},dvb:{max:100,step:1},vmin:{max:100,step:1},svmin:{max:100,step:1},lvmin:{max:100,step:1},dvmin:{max:100,step:1},vmax:{max:100,step:1},svmax:{max:100,step:1},lvmax:{max:100,step:1},dvmax:{max:100,step:1}};function bm({label:e=(0,T.__)("Height"),onChange:t,value:n}){const o=parseFloat(n),[r]=Ti("spacing.units"),i=(0,ws.__experimentalUseCustomUnits)({availableUnits:r||["%","px","em","rem","vh","vw"]}),s=(0,h.useMemo)((()=>(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(n)),[n])[1]||i[0]?.value||"px";return(0,d.jsxs)("fieldset",{className:"block-editor-height-control",children:[(0,d.jsx)(ws.BaseControl.VisualLabel,{as:"legend",children:e}),(0,d.jsxs)(ws.Flex,{children:[(0,d.jsx)(ws.FlexItem,{isBlock:!0,children:(0,d.jsx)(ws.__experimentalUnitControl,{value:n,units:i,onChange:t,onUnitChange:e=>{const[o,r]=(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(n);["em","rem"].includes(e)&&"px"===r?t((o/16).toFixed(2)+e):["em","rem"].includes(r)&&"px"===e?t(Math.round(16*o)+e):["%","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax"].includes(e)&&o>100&&t(100+e)},min:0,size:"__unstable-large",label:e,hideLabelFromVision:!0})}),(0,d.jsx)(ws.FlexItem,{isBlock:!0,children:(0,d.jsx)(ws.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,d.jsx)(ws.RangeControl,{__next40pxDefaultSize:!0,value:o,min:0,max:fm[s]?.max??100,step:fm[s]?.step??.1,withInputField:!1,onChange:e=>{t([e,s].join(""))},__nextHasNoMarginBottom:!0,label:e,hideLabelFromVision:!0})})})]})]})}function km(e,t){const{getBlockOrder:n,getBlockAttributes:o}=(0,g.useSelect)(ji);return(r,i)=>{const s=(i-1)*t+r-1;let l=0;for(const r of n(e)){const{columnStart:e,rowStart:n}=o(r).style?.layout??{};(n-1)*t+e-1<s&&l++}return l}}function vm(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,T.__)("Stretch to fill available space."):"fixed"===e&&"horizontal"===n?(0,T.__)("Specify a fixed width."):"fixed"===e?(0,T.__)("Specify a fixed height."):(0,T.__)("Fit contents.")}function _m({value:e={},onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}){const{type:i,default:{type:s="default"}={}}=n??{},l=i||s;return"flex"===l?(0,d.jsx)(ym,{childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}):"grid"===l?(0,d.jsx)(Sm,{childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}):null}function ym({childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}){const{selfStretch:i,flexSize:s}=e,{orientation:l="horizontal"}=n??{},a="horizontal"===l?(0,T.__)("Width"):(0,T.__)("Height"),[c]=Ti("spacing.units"),u=(0,ws.__experimentalUseCustomUnits)({availableUnits:c||["%","px","em","rem","vh","vw"]});return(0,h.useEffect)((()=>{"fixed"!==i||s||t({...e,selfStretch:"fit"})}),[]),(0,d.jsxs)(ws.__experimentalVStack,{as:ws.__experimentalToolsPanelItem,spacing:2,hasValue:()=>!!i,label:a,onDeselect:()=>{t({selfStretch:void 0,flexSize:void 0})},isShownByDefault:o,panelId:r,children:[(0,d.jsxs)(ws.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:xm(n),value:i||"fit",help:vm(i,n),onChange:e=>{t({selfStretch:e,flexSize:"fixed"!==e?null:s})},isBlock:!0,children:[(0,d.jsx)(ws.__experimentalToggleGroupControlOption,{value:"fit",label:(0,T._x)("Fit","Intrinsic block width in flex layout")},"fit"),(0,d.jsx)(ws.__experimentalToggleGroupControlOption,{value:"fill",label:(0,T._x)("Grow","Block with expanding width in flex layout")},"fill"),(0,d.jsx)(ws.__experimentalToggleGroupControlOption,{value:"fixed",label:(0,T._x)("Fixed","Block with fixed width in flex layout")},"fixed")]}),"fixed"===i&&(0,d.jsx)(ws.__experimentalUnitControl,{size:"__unstable-large",units:u,onChange:e=>{t({selfStretch:i,flexSize:e})},value:s,min:0,label:a,hideLabelFromVision:!0})]})}function xm(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,T.__)("Width"):(0,T.__)("Height")}function Sm({childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:r}){const{columnStart:i,rowStart:s,columnSpan:l,rowSpan:a}=e,{columnCount:c,rowCount:u}=n??{},p=(0,g.useSelect)((e=>e(ji).getBlockRootClientId(r))),{moveBlocksToPosition:h,__unstableMarkNextChangeAsNotPersistent:m}=(0,g.useDispatch)(ji),f=km(p,c||3),b=c?c-(i??1)+1:void 0,k=window.__experimentalEnableGridInteractivity&&u?u-(s??1)+1:void 0;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(ws.Flex,{as:ws.__experimentalToolsPanelItem,hasValue:()=>!!l||!!a,label:(0,T.__)("Grid span"),onDeselect:()=>{t({columnSpan:void 0,rowSpan:void 0})},isShownByDefault:o,panelId:r,children:[(0,d.jsx)(ws.FlexItem,{style:{width:"50%"},children:(0,d.jsx)(ws.__experimentalInputControl,{size:"__unstable-large",label:(0,T.__)("Column span"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10),o=b?Math.min(n,b):n;t({columnStart:i,rowStart:s,rowSpan:a,columnSpan:o})},value:l??1,min:1,max:b})}),(0,d.jsx)(ws.FlexItem,{style:{width:"50%"},children:(0,d.jsx)(ws.__experimentalInputControl,{size:"__unstable-large",label:(0,T.__)("Row span"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10),o=k?Math.min(n,k):n;t({columnStart:i,rowStart:s,columnSpan:l,rowSpan:o})},value:a??1,min:1,max:k})})]}),window.__experimentalEnableGridInteractivity&&(0,d.jsxs)(ws.Flex,{as:ws.__experimentalToolsPanelItem,hasValue:()=>!!i||!!s,label:(0,T.__)("Grid placement"),onDeselect:()=>{t({columnStart:void 0,rowStart:void 0})},isShownByDefault:!1,panelId:r,children:[(0,d.jsx)(ws.FlexItem,{style:{width:"50%"},children:(0,d.jsx)(ws.__experimentalInputControl,{size:"__unstable-large",label:(0,T.__)("Column"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:n,rowStart:s,columnSpan:l,rowSpan:a}),m(),h([r],p,p,f(n,s))},value:i??1,min:1,max:c?c-(l??1)+1:void 0})}),(0,d.jsx)(ws.FlexItem,{style:{width:"50%"},children:(0,d.jsx)(ws.__experimentalInputControl,{size:"__unstable-large",label:(0,T.__)("Row"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:i,rowStart:n,columnSpan:l,rowSpan:a}),m(),h([r],p,p,f(i,n))},value:s??1,min:1,max:u?u-(a??1)+1:void 0})})]})]})}function wm({panelId:e,value:t,onChange:n=()=>{},options:o,defaultValue:r="auto",hasValue:i,isShownByDefault:s=!0}){const l=t??"auto",[a,c,u]=Ti("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),p=c?.map((({name:e,ratio:t})=>({label:e,value:t}))),h=a?.map((({name:e,ratio:t})=>({label:e,value:t}))),g=[{label:(0,T._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...u?h:[],...p||[],{label:(0,T._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];return(0,d.jsx)(ws.__experimentalToolsPanelItem,{hasValue:i||(()=>l!==r),label:(0,T.__)("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:s,panelId:e,children:(0,d.jsx)(ws.SelectControl,{label:(0,T.__)("Aspect ratio"),value:l,options:o??g,onChange:n,size:"__unstable-large",__nextHasNoMarginBottom:!0})})}const Cm=["horizontal","vertical"];function Bm(e){const t=Im(e),n=jm(e),o=Em(e),r=Tm(e),i=Mm(e),s=Pm(e),l=Rm(e),a=Am(e);return"web"===h.Platform.OS&&(t||n||o||r||i||s||l||a)}function Im(e){return e?.layout?.contentSize}function jm(e){return e?.layout?.wideSize}function Em(e){return e?.spacing?.padding}function Tm(e){return e?.spacing?.margin}function Mm(e){return e?.spacing?.blockGap}function Pm(e){return e?.dimensions?.minHeight}function Rm(e){return e?.dimensions?.aspectRatio}function Am(e){const{type:t="default",default:{type:n="default"}={},allowSizingOnChildren:o=!1}=e?.parentLayout??{},r=("flex"===n||"flex"===t||"grid"===n||"grid"===t)&&o;return!!e?.layout&&r}function Nm(e,t){if(!t||!e)return e;const n={};return t.forEach((t=>{"vertical"===t&&(n.top=e.top,n.bottom=e.bottom),"horizontal"===t&&(n.left=e.left,n.right=e.right),n[t]=e?.[t]})),n}function Lm(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function Dm({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const i=Ji();return(0,d.jsx)(ws.__experimentalToolsPanel,{label:(0,T.__)("Dimensions"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:i,children:r})}const Om={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0,aspectRatio:!0,childLayout:!0};function zm({as:e=Dm,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:s=Om,onVisualize:l=()=>{},includeLayoutControls:a=!1}){const{dimensions:c,spacing:u}=r,p=e=>e&&"object"==typeof e?Object.keys(e).reduce(((t,n)=>(t[n]=ts({settings:{dimensions:c,spacing:u}},"",e[n]),t)),{}):ts({settings:{dimensions:c,spacing:u}},"",e),g=function(e){const{defaultSpacingSizes:t,spacingSizes:n}=e?.spacing||{};return!1!==t&&n?.default?.length>0||n?.theme?.length>0||n?.custom?.length>0}(r),m=(0,ws.__experimentalUseCustomUnits)({availableUnits:r?.spacing?.units||["%","px","em","rem","vw"]}),f=-1/0,[b,k]=(0,h.useState)(f),v=Im(r)&&a,_=p(o?.layout?.contentSize),y=e=>{n(me(t,["layout","contentSize"],e||void 0))},x=jm(r)&&a,S=p(o?.layout?.wideSize),w=e=>{n(me(t,["layout","wideSize"],e||void 0))},C=Em(r),B=Lm(p(o?.spacing?.padding)),I=Array.isArray(r?.spacing?.padding)?r?.spacing?.padding:r?.spacing?.padding?.sides,j=I&&I.some((e=>Cm.includes(e))),E=e=>{const o=Nm(e,I);n(me(t,["spacing","padding"],o))},M=()=>l("padding"),P=Tm(r),R=Lm(p(o?.spacing?.margin)),A=Array.isArray(r?.spacing?.margin)?r?.spacing?.margin:r?.spacing?.margin?.sides,N=A&&A.some((e=>Cm.includes(e))),L=e=>{const o=Nm(e,A);n(me(t,["spacing","margin"],o))},D=()=>l("margin"),O=Mm(r),z=Array.isArray(r?.spacing?.blockGap)?r?.spacing?.blockGap:r?.spacing?.blockGap?.sides,V=z&&z.some((e=>Cm.includes(e))),F=p(o?.spacing?.blockGap),H=function(e,t){return e?"string"==typeof e?t?{top:e,right:e,bottom:e,left:e}:{top:e}:{...e,right:e?.left,bottom:e?.top}:e}(F,V),U=e=>{n(me(t,["spacing","blockGap"],e))},G=e=>{e||U(null),!V&&e?.hasOwnProperty("top")?U(e.top):U({top:e?.top,left:e?.left})},$=Pm(r),W=p(o?.dimensions?.minHeight),K=e=>{const o=me(t,["dimensions","minHeight"],e);n(me(o,["dimensions","aspectRatio"],void 0))},Z=Rm(r),q=p(o?.dimensions?.aspectRatio),Y=Am(r),X=o?.layout,Q=(0,h.useCallback)((e=>({...e,layout:fs({...e?.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0,columnStart:void 0,rowStart:void 0,columnSpan:void 0,rowSpan:void 0}),spacing:{...e?.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...e?.dimensions,minHeight:void 0,aspectRatio:void 0}})),[]),J=()=>l(!1);return(0,d.jsxs)(e,{resetAllFilter:Q,value:t,onChange:n,panelId:i,children:[(v||x)&&(0,d.jsx)("span",{className:"span-columns",children:(0,T.__)("Set the width of the main content area.")}),v&&(0,d.jsx)(ws.__experimentalToolsPanelItem,{label:(0,T.__)("Content width"),hasValue:()=>!!t?.layout?.contentSize,onDeselect:()=>y(void 0),isShownByDefault:s.contentSize??Om.contentSize,panelId:i,children:(0,d.jsx)(ws.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Content width"),labelPosition:"top",value:_||"",onChange:e=>{y(e)},units:m,prefix:(0,d.jsx)(ws.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,d.jsx)(Ol,{icon:zl})})})}),x&&(0,d.jsx)(ws.__experimentalToolsPanelItem,{label:(0,T.__)("Wide width"),hasValue:()=>!!t?.layout?.wideSize,onDeselect:()=>w(void 0),isShownByDefault:s.wideSize??Om.wideSize,panelId:i,children:(0,d.jsx)(ws.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Wide width"),labelPosition:"top",value:S||"",onChange:e=>{w(e)},units:m,prefix:(0,d.jsx)(ws.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,d.jsx)(Ol,{icon:Vl})})})}),C&&(0,d.jsxs)(ws.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,label:(0,T.__)("Padding"),onDeselect:()=>E(void 0),isShownByDefault:s.padding??Om.padding,className:ms({"tools-panel-item-spacing":g}),panelId:i,children:[!g&&(0,d.jsx)(ws.BoxControl,{__next40pxDefaultSize:!0,values:B,onChange:E,label:(0,T.__)("Padding"),sides:I,units:m,allowReset:!1,splitOnAxis:j,inputProps:{onMouseOver:M,onMouseOut:J}}),g&&(0,d.jsx)(mm,{values:B,onChange:E,label:(0,T.__)("Padding"),sides:I,units:m,allowReset:!1,onMouseOver:M,onMouseOut:J})]}),P&&(0,d.jsxs)(ws.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,label:(0,T.__)("Margin"),onDeselect:()=>L(void 0),isShownByDefault:s.margin??Om.margin,className:ms({"tools-panel-item-spacing":g}),panelId:i,children:[!g&&(0,d.jsx)(ws.BoxControl,{__next40pxDefaultSize:!0,values:R,onChange:L,inputProps:{min:b,onDragStart:()=>{k(0)},onDragEnd:()=>{k(f)},onMouseOver:D,onMouseOut:J},label:(0,T.__)("Margin"),sides:A,units:m,allowReset:!1,splitOnAxis:N}),g&&(0,d.jsx)(mm,{values:R,onChange:L,minimumCustomValue:-1/0,label:(0,T.__)("Margin"),sides:A,units:m,allowReset:!1,onMouseOver:D,onMouseOut:J})]}),O&&(0,d.jsxs)(ws.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.blockGap,label:(0,T.__)("Block spacing"),onDeselect:()=>U(void 0),isShownByDefault:s.blockGap??Om.blockGap,className:ms({"tools-panel-item-spacing":g,"single-column":!g&&!V}),panelId:i,children:[!g&&(V?(0,d.jsx)(ws.BoxControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Block spacing"),min:0,onChange:G,units:m,sides:z,values:H,allowReset:!1,splitOnAxis:V}):(0,d.jsx)(ws.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Block spacing"),min:0,onChange:U,units:m,value:F})),g&&(0,d.jsx)(mm,{label:(0,T.__)("Block spacing"),min:0,onChange:G,showSideInLabel:!1,sides:V?z:["top"],values:H,allowReset:!1})]}),Y&&(0,d.jsx)(_m,{value:X,onChange:e=>{n({...t,layout:{...e}})},parentLayout:r?.parentLayout,panelId:i,isShownByDefault:s.childLayout??Om.childLayout}),$&&(0,d.jsx)(ws.__experimentalToolsPanelItem,{hasValue:()=>!!t?.dimensions?.minHeight,label:(0,T.__)("Minimum height"),onDeselect:()=>{K(void 0)},isShownByDefault:s.minHeight??Om.minHeight,panelId:i,children:(0,d.jsx)(bm,{label:(0,T.__)("Minimum height"),value:W,onChange:K})}),Z&&(0,d.jsx)(wm,{hasValue:()=>!!t?.dimensions?.aspectRatio,value:q,onChange:e=>{const o=me(t,["dimensions","aspectRatio"],e);n(me(o,["dimensions","minHeight"],void 0))},panelId:i,isShownByDefault:s.aspectRatio??Om.aspectRatio})]})}const Vm=new WeakMap;var Fm=function(e){const t=(0,m.useRefEffect)((t=>{function n(n){const{deltaX:o,deltaY:r,target:i}=n,s=e.current;let l=Vm.get(s);l||(l=(0,Ga.getScrollContainer)(s),Vm.set(s,l));const a=(0,Ga.getScrollContainer)(i);t.contains(a)||l.scrollBy(o,r)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e]);return e?t:null};const Hm=".block-editor-block-list__block",Um=".block-list-appender",Gm=".block-editor-button-block-appender";function $m(e,t){return e.closest(Hm)===t.closest(Hm)}function Wm(e,t){return t.closest([Hm,Um,Gm].join(","))===e}function Km(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(Hm);return t?t.id.slice(6):void 0}function Zm(e,t){const n=Math.min(e.left,t.left),o=Math.max(e.right,t.right),r=Math.max(e.bottom,t.bottom),i=Math.min(e.top,t.top);return new window.DOMRectReadOnly(n,i,o-n,r-i)}function qm(e){const t=e.ownerDocument.defaultView;if(!t)return!1;if(e.classList.contains("components-visually-hidden"))return!1;const n=e.getBoundingClientRect();if(0===n.width||0===n.height)return!1;if(e.checkVisibility)return e.checkVisibility?.({opacityProperty:!0,contentVisibilityAuto:!0,visibilityProperty:!0});const o=t.getComputedStyle(e);return"none"!==o.display&&"hidden"!==o.visibility&&"0"!==o.opacity}function Ym(e){const t=window.getComputedStyle(e);return"auto"===t.overflowX||"scroll"===t.overflowX||"auto"===t.overflowY||"scroll"===t.overflowY}const Xm=["core/navigation"];function Qm(e){const t=e.ownerDocument.defaultView;if(!t)return new window.DOMRectReadOnly;let n=e.getBoundingClientRect();const o=e.getAttribute("data-type");if(o&&Xm.includes(o)){const t=[e];let o;for(;o=t.pop();)if(!Ym(o))for(const e of o.children)if(qm(e)){n=Zm(n,e.getBoundingClientRect()),t.push(e)}}const r=Math.max(n.left,0),i=Math.min(n.right,t.innerWidth);return n=new window.DOMRectReadOnly(r,n.top,i-r,n.height),n}const Jm=Number.MAX_SAFE_INTEGER;const ef=(0,h.forwardRef)((function({clientId:e,bottomClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:r,shift:i=!0,...s},l){const a=bh(e),c=bh(t??e),u=(0,m.useMergeRefs)([l,Fm(r)]),[p,g]=(0,h.useReducer)((e=>(e+1)%Jm),0);(0,h.useLayoutEffect)((()=>{if(!a)return;const e=new window.MutationObserver(g);return e.observe(a,{attributes:!0}),()=>{e.disconnect()}}),[a]);const f=(0,h.useMemo)((()=>{if(!(p<0||!a||t&&!c))return{getBoundingClientRect:()=>c?Zm(Qm(a),Qm(c)):Qm(a),contextElement:a}}),[p,a,t,c]);return!a||t&&!c?null:(0,d.jsx)(ws.Popover,{ref:u,animate:!1,focusOnMount:!1,anchor:f,__unstableSlotName:o,inline:!o,placement:"top-start",resize:!1,flip:!1,shift:i,...s,className:ms("block-editor-block-popover",s.className),variant:"unstyled",children:n})}));var tf=(0,h.forwardRef)((({clientId:e,bottomClientId:t,children:n,...o},r)=>(0,d.jsx)(ef,{...o,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:r,children:n})));function nf({selectedElement:e,additionalStyles:t={},children:n}){const[o,r]=(0,h.useState)(e.offsetWidth),[i,s]=(0,h.useState)(e.offsetHeight);(0,h.useEffect)((()=>{const t=new window.ResizeObserver((()=>{r(e.offsetWidth),s(e.offsetHeight)}));return t.observe(e,{box:"border-box"}),()=>t.disconnect()}),[e]);const l=(0,h.useMemo)((()=>({position:"absolute",width:o,height:i,...t})),[o,i,t]);return(0,d.jsx)("div",{style:l,children:n})}var of=(0,h.forwardRef)((function({clientId:e,bottomClientId:t,children:n,shift:o=!1,additionalStyles:r,...i},s){t??=e;const l=bh(e);return(0,d.jsx)(ef,{ref:s,clientId:e,bottomClientId:t,shift:o,...i,children:l&&e===t?(0,d.jsx)(nf,{selectedElement:l,additionalStyles:r,children:n}):n})}));function rf({clientId:e,value:t,computeStyle:n,forceShow:o}){const r=bh(e),[i,s]=(0,h.useReducer)((()=>n(r)));(0,h.useEffect)((()=>{if(!r)return;const e=new window.MutationObserver(s);return e.observe(r,{attributes:!0,attributeFilter:["style","class"]}),()=>{e.disconnect()}}),[r]);const l=(0,h.useRef)(t),[a,c]=(0,h.useState)(!1);return(0,h.useEffect)((()=>{if(Ja()(t,l.current)||o)return;c(!0),l.current=t;const e=setTimeout((()=>{c(!1)}),400);return()=>{c(!1),clearTimeout(e)}}),[t,o]),a||o?(0,d.jsx)(of,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,d.jsx)("div",{className:"block-editor__spacing-visualizer",style:i})}):null}function sf(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function lf({clientId:e,value:t,forceShow:n}){return(0,d.jsx)(rf,{clientId:e,value:t?.spacing?.margin,computeStyle:e=>{const t=sf(e,"margin-top"),n=sf(e,"margin-right"),o=sf(e,"margin-bottom"),r=sf(e,"margin-left");return{borderTopWidth:t,borderRightWidth:n,borderBottomWidth:o,borderLeftWidth:r,top:t?`-${t}`:0,right:n?`-${n}`:0,bottom:o?`-${o}`:0,left:r?`-${r}`:0}},forceShow:n})}function af({clientId:e,value:t,forceShow:n}){return(0,d.jsx)(rf,{clientId:e,value:t?.spacing?.padding,computeStyle:e=>({borderTopWidth:sf(e,"padding-top"),borderRightWidth:sf(e,"padding-right"),borderBottomWidth:sf(e,"padding-bottom"),borderLeftWidth:sf(e,"padding-left")}),forceShow:n})}const cf="dimensions",uf="spacing";function df({children:e,resetAllFilter:t}){const n=(0,h.useCallback)((e=>{const n=e.style,o=t(n);return{...e,style:o}}),[t]);return(0,d.jsx)(Fa,{group:"dimensions",resetAllFilter:n,children:e})}function pf({clientId:e,name:t,setAttributes:n,settings:o}){const r=Bm(o),i=(0,g.useSelect)((t=>t(ji).getBlockAttributes(e)?.style),[e]),[s,l]=function(){const[e,t]=(0,h.useState)(!1),{hideBlockInterface:n,showBlockInterface:o}=G((0,g.useDispatch)(ji));return(0,h.useEffect)((()=>{e?n():o()}),[e,o,n]),[e,t]}();if(!r)return null;const a={...(0,p.getBlockSupport)(t,[cf,"__experimentalDefaultControls"]),...(0,p.getBlockSupport)(t,[uf,"__experimentalDefaultControls"])};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(zm,{as:df,panelId:e,settings:o,value:i,onChange:e=>{n({style:fs(e)})},defaultControls:a,onVisualize:l}),!!o?.spacing?.padding&&(0,d.jsx)(af,{forceShow:"padding"===s,clientId:e,value:i}),!!o?.spacing?.margin&&(0,d.jsx)(lf,{forceShow:"margin"===s,clientId:e,value:i})]})}function hf(e,t="any"){if("web"!==h.Platform.OS)return!1;const n=(0,p.getBlockSupport)(e,cf);return!0===n||("any"===t?!(!n?.aspectRatio&&!n?.minHeight):!!n?.[t])}var gf={useBlockProps:function({name:e,minHeight:t,style:n}){if(!hf(e,"aspectRatio")||ks(e,cf,"aspectRatio"))return{};const o=ms({"has-aspect-ratio":!!n?.dimensions?.aspectRatio}),r={};n?.dimensions?.aspectRatio?r.minHeight="unset":(t||n?.dimensions?.minHeight)&&(r.aspectRatio="unset");return{className:o,style:r}},attributeKeys:["minHeight","style"],hasSupport:e=>hf(e,"aspectRatio")};function mf(){I()("wp.blockEditor.__experimentalUseCustomSides",{since:"6.3",version:"6.4"})}const ff=[...em,wp,yh,cf,Mu,uf,Cp],bf=e=>ff.some((t=>(0,p.hasBlockSupport)(e,t)));function kf(e={}){const t={};return(0,Pi.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const vf={[`${wp}.__experimentalSkipSerialization`]:["border"],[`${yh}.__experimentalSkipSerialization`]:[yh],[`${Jg}.__experimentalSkipSerialization`]:[Jg],[`${cf}.__experimentalSkipSerialization`]:[cf],[`${uf}.__experimentalSkipSerialization`]:[uf],[`${Cp}.__experimentalSkipSerialization`]:[Cp]},_f={...vf,[`${cf}.aspectRatio`]:[`${cf}.aspectRatio`],[`${Mu}`]:[Mu]},yf={[`${cf}.aspectRatio`]:!0,[`${Mu}`]:!0},xf={gradients:"gradient"};function Sf(e,t,n=!1){if(!e)return e;let o=e;return n||(o=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach((e=>{if(Array.isArray(e)||(e=e.split(".")),e.length>1){const[t,...n]=e;Sf(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]})),o}function wf(e,t,n,o=_f){if(!bf(t))return e;let{style:r}=n;return Object.entries(o).forEach((([e,n])=>{const o=yf[e]||(0,p.getBlockSupport)(t,e);!0===o&&(r=Sf(r,n)),Array.isArray(o)&&o.forEach((e=>{const t=xf[e]||e;r=Sf(r,[[...n,t]])}))})),e.style={...kf(r),...e.style},e}var Cf={edit:function({clientId:e,name:t,setAttributes:n,__unstableParentLayout:o}){const r=xs(t,o),i=ga(),s={clientId:e,name:t,setAttributes:n,settings:{...r,typography:{...r.typography,textAlign:!1}}};return"default"!==i?null:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Mh,{...s}),(0,d.jsx)(Du,{...s}),(0,d.jsx)(rm,{...s}),(0,d.jsx)(Pp,{...s}),(0,d.jsx)(pf,{...s})]})},hasSupport:bf,addSaveProps:wf,attributeKeys:["style"],useBlockProps:function({name:e,style:t}){const n=(0,m.useInstanceId)(If,"wp-elements"),o=`.${n}`,r=t?.elements,i=(0,h.useMemo)((()=>{if(!r)return;const t=[];return Bf.forEach((({elementType:n,pseudo:i,elements:s})=>{if(ks(e,yh,n))return;const l=r?.[n];if(l){const e=ns(o,p.__EXPERIMENTAL_ELEMENTS[n]);t.push((0,Pi.compileCSS)(l,{selector:e})),i&&i.forEach((e=>{l[e]&&t.push((0,Pi.compileCSS)(l[e],{selector:ns(o,`${p.__EXPERIMENTAL_ELEMENTS[n]}${e}`)}))}))}s&&s.forEach((e=>{r[e]&&t.push((0,Pi.compileCSS)(r[e],{selector:ns(o,p.__EXPERIMENTAL_ELEMENTS[e])}))}))})),t.length>0?t.join(""):void 0}),[o,r,e]);return _s({css:i}),wf({className:n},e,{style:t},vf)}};const Bf=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}],If={};(0,f.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return bf(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e}));(0,f.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){return t=e,(0,p.hasBlockSupport)(t,"__experimentalSettings",!1)?(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e;var t}));var jf=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})});var Ef=function e({id:t,colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:i,value:s,onChange:l}){let a;a="unset"===s?(0,d.jsx)(ws.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):s?(0,d.jsx)(ws.DuotoneSwatch,{values:s}):(0,d.jsx)(Ol,{icon:jf});const c=(0,T.__)("Apply duotone filter"),u=`${(0,m.useInstanceId)(e,"duotone-control",t)}__description`;return(0,d.jsx)(ws.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,T.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,d.jsx)(ws.ToolbarButton,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==Wa.DOWN||(n.preventDefault(),t())},label:c,icon:a}),renderContent:()=>(0,d.jsxs)(ws.MenuGroup,{label:(0,T.__)("Duotone"),children:[(0,d.jsx)("p",{children:(0,T.__)("Create a two-tone color effect without losing your original image.")}),(0,d.jsx)(ws.DuotonePicker,{"aria-label":c,"aria-describedby":u,colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:i,value:s,onChange:l})]})})};function Tf(e){return`${e}{filter:none}`}function Mf(e,t){return`${e}{filter:url(#${t})}`}function Pf(e,t){const n=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=wd(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}(t);return`\n<svg\n\txmlns:xlink="http://www.w3.org/1999/xlink"\n\tviewBox="0 0 0 0"\n\twidth="0"\n\theight="0"\n\tfocusable="false"\n\trole="none"\n\taria-hidden="true"\n\tstyle="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"\n>\n\t<defs>\n\t\t<filter id="${e}">\n\t\t\t\x3c!--\n\t\t\t\tUse sRGB instead of linearRGB so transparency looks correct.\n\t\t\t\tUse perceptual brightness to convert to grayscale.\n\t\t\t--\x3e\n\t\t\t<feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "></feColorMatrix>\n\t\t\t\x3c!-- Use sRGB instead of linearRGB to be consistent with how CSS gradients work. --\x3e\n\t\t\t<feComponentTransfer color-interpolation-filters="sRGB">\n\t\t\t\t<feFuncR type="table" tableValues="${n.r.join(" ")}"></feFuncR>\n\t\t\t\t<feFuncG type="table" tableValues="${n.g.join(" ")}"></feFuncG>\n\t\t\t\t<feFuncB type="table" tableValues="${n.b.join(" ")}"></feFuncB>\n\t\t\t\t<feFuncA type="table" tableValues="${n.a.join(" ")}"></feFuncA>\n\t\t\t</feComponentTransfer>\n\t\t\t\x3c!-- Re-mask the image with the original transparency since the feColorMatrix above loses that information. --\x3e\n\t\t\t<feComposite in2="SourceGraphic" operator="in"></feComposite>\n\t\t</filter>\n\t</defs>\n</svg>`}function Rf(e,t="root",n={}){if(!t)return null;const{fallback:o=!1}=n,{name:r,selectors:i,supports:s}=e,l=i&&Object.keys(i).length>0,a=Array.isArray(t)?t.join("."):t;let c=null;if(c=l&&i.root?i?.root:s?.__experimentalSelector?s.__experimentalSelector:".wp-block-"+r.replace("core/","").replace("/","-"),"root"===a)return c;const u=Array.isArray(t)?t:t.split(".");if(1===u.length){const e=o?c:null;if(l){return fe(i,`${a}.root`,null)||fe(i,a,null)||e}const t=fe(s,`${a}.__experimentalSelector`,null);return t?ns(c,t):e}let d;return l&&(d=fe(i,a,null)),d||(o?Rf(e,u[0],n):null)}const Af=[];function Nf(e,{presetSetting:t,defaultSetting:n}){const o=!e?.color?.[n],r=e?.color?.[t]?.custom||Af,i=e?.color?.[t]?.theme||Af,s=e?.color?.[t]?.default||Af;return(0,h.useMemo)((()=>[...r,...i,...o?Af:s]),[o,r,i,s])}function Lf(e){return Df(e)}function Df(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function Of({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){const i=Ji();return(0,d.jsx)(ws.__experimentalToolsPanel,{label:(0,T._x)("Filters","Name for applying graphical effects"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:i,children:r})}const zf={duotone:!0},Vf={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,T.__)("Duotone")},Ff=({indicator:e,label:t})=>(0,d.jsxs)(ws.__experimentalHStack,{justify:"flex-start",children:[(0,d.jsx)(ws.__experimentalZStack,{isLayered:!1,offset:-8,children:(0,d.jsx)(ws.Flex,{expanded:!1,children:"unset"!==e&&e?(0,d.jsx)(ws.DuotoneSwatch,{values:e}):(0,d.jsx)(ws.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"})})}),(0,d.jsx)(ws.FlexItem,{title:t,children:t})]}),Hf=(e,t)=>({onToggle:n,isOpen:o})=>{const r=(0,h.useRef)(void 0),i={onClick:n,className:ms("block-editor-global-styles-filters-panel__dropdown-toggle",{"is-open":o}),"aria-expanded":o,ref:r},s={onClick:()=>{o&&n(),t(),r.current?.focus()},className:"block-editor-panel-duotone-settings__reset",label:(0,T.__)("Reset")};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,...i,children:(0,d.jsx)(Ff,{indicator:e,label:(0,T.__)("Duotone")})}),e&&(0,d.jsx)(ws.Button,{size:"small",icon:Ha,...s})]})};function Uf({as:e=Of,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:s=zf}){const l=Df(r),a=Nf(r,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),c=Nf(r,{presetSetting:"palette",defaultSetting:"defaultPalette"}),u=(p=o?.filter?.duotone,ts({settings:r},"",p));var p;const g=e=>{const o=a.find((({colors:t})=>t===e)),r=o?`var:preset|duotone|${o.slug}`:e;n(me(t,["filter","duotone"],r))},m=()=>g(void 0),f=(0,h.useCallback)((e=>({...e,filter:{...e.filter,duotone:void 0}})),[]);return(0,d.jsx)(e,{resetAllFilter:f,value:t,onChange:n,panelId:i,children:l&&(0,d.jsx)(ws.__experimentalToolsPanelItem,{label:(0,T.__)("Duotone"),hasValue:()=>!!t?.filter?.duotone,onDeselect:m,isShownByDefault:s.duotone,panelId:i,children:(0,d.jsx)(ws.Dropdown,{popoverProps:Vf,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:Hf(u,m),renderContent:()=>(0,d.jsx)(ws.__experimentalDropdownContentWrapper,{paddingSize:"small",children:(0,d.jsxs)(ws.MenuGroup,{label:(0,T.__)("Duotone"),children:[(0,d.jsx)("p",{children:(0,T.__)("Create a two-tone color effect without losing your original image.")}),(0,d.jsx)(ws.DuotonePicker,{colorPalette:c,duotonePalette:a,disableCustomColors:!0,disableCustomDuotone:!0,value:u,onChange:g})]})})})})})}const Gf=[],$f=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");function Wf({presetSetting:e,defaultSetting:t}){const[n,o,r,i]=Ti(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,h.useMemo)((()=>[...o||Gf,...r||Gf,...n&&i||Gf]),[n,o,r,i])}function Kf(e,t){if(!e)return;const n=t?.find((({slug:t})=>e===`var:preset|duotone|${t}`));return n?n.colors:void 0}Bd([Id]);var Zf={shareWithChildBlocks:!0,edit:function({style:e,setAttributes:t,name:n}){const o=e?.color?.duotone,r=xs(n),i=ga(),s=Wf({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),l=Wf({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[a,c]=Ti("color.custom","color.customDuotone"),u=!a,p=!c||0===l?.length&&u;if(0===s?.length&&p)return null;if("default"!==i)return null;const h="unset"===o||Array.isArray(o)?o:Kf(o,s);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Fa,{group:"filter",children:(0,d.jsx)(Uf,{value:{filter:{duotone:h}},onChange:n=>{const o={...e,color:{...n?.filter}};t({style:fs(o)})},settings:r})}),(0,d.jsx)(Rs,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,d.jsx)(Ef,{duotonePalette:s,colorPalette:l,disableCustomDuotone:p,disableCustomColors:u,value:h,onChange:n=>{const o=function(e,t){if(!e||!Array.isArray(e))return;const n=t?.find((t=>t?.colors?.every(((t,n)=>t===e[n]))));return n?`var:preset|duotone|${n.slug}`:void 0}(n,s),r={...e,color:{...e?.color,duotone:o??n}};t({style:fs(r)})},settings:r})})]})},useBlockProps:function({clientId:e,name:t,style:n}){const o=(0,m.useInstanceId)(Yf),r=(0,h.useMemo)((()=>{const e=(0,p.getBlockType)(t);if(e){if(!(0,p.getBlockSupport)(e,"filter.duotone",!1))return null;const t=(0,p.getBlockSupport)(e,"color.__experimentalDuotone",!1);if(t){const n=Rf(e);return"string"==typeof t?ns(n,t):n}return Rf(e,"filter.duotone",{fallback:!0})}}),[t]),i=n?.color?.duotone,s=`wp-duotone-${o}`,l=r&&i;return qf({clientId:e,id:s,selector:r,attribute:i}),{className:l?s:""}},attributeKeys:["style"],hasSupport:e=>(0,p.hasBlockSupport)(e,"filter.duotone")};function qf({clientId:e,id:t,selector:n,attribute:o}){const r=Wf({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),i=Array.isArray(o),s=i?void 0:Kf(o,r),l="string"==typeof o&&s;let a=null;l?a=s:("string"==typeof o&&!l||i)&&(a=o);const c=n.split(",").map((e=>`.${t}${e.trim()}`)).join(", "),u=Array.isArray(a)||"unset"===a;ys(u?{css:"unset"!==a?Mf(c,t):Tf(c),__unstableType:"presets"}:void 0),ys(u?{assets:"unset"!==a?Pf(t,a):"",__unstableType:"svgs"}:void 0);const d=bh(e);(0,h.useEffect)((()=>{if(u&&d&&$f){const e=d.style.display;d.style.setProperty("display","inline-block"),d.offsetHeight,d.style.setProperty("display",e)}}),[u,d,a])}const Yf={};function Xf(e){return(0,g.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(ji),{getBlockType:r,getActiveBlockVariation:i}=t(p.store),s=n(e),l=r(s);if(!l)return null;const a=o(e),c=i(s,a),u=(0,p.isReusableBlock)(l)||(0,p.isTemplatePart)(l),d=(u?(0,p.__experimentalGetBlockLabel)(l,a):void 0)||l.title,h=function(e){const t=e?.style?.position?.type;return"sticky"===t?(0,T.__)("Sticky"):"fixed"===t?(0,T.__)("Fixed"):null}(a),g={isSynced:u,title:d,icon:l.icon,description:l.description,anchor:a?.anchor,positionLabel:h,positionType:a?.style?.position?.type,name:a?.metadata?.name};return c?{isSynced:u,title:c.title||l.title,icon:c.icon||l.icon,description:c.description||l.description,anchor:a?.anchor,positionLabel:h,positionType:a?.style?.position?.type,name:a?.metadata?.name}:g}),[e])}(0,f.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,p.hasBlockSupport)(e,"filter.duotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e}));const Qf="position",Jf={key:"default",value:"",name:(0,T.__)("Default")},eb={key:"sticky",value:"sticky",name:(0,T._x)("Sticky","Name for the value of the CSS position property"),hint:(0,T.__)("The block will stick to the top of the window instead of scrolling.")},tb={key:"fixed",value:"fixed",name:(0,T._x)("Fixed","Name for the value of the CSS position property"),hint:(0,T.__)("The block will not move when the page is scrolled.")},nb=["top","right","bottom","left"],ob=["sticky","fixed"];function rb(e){const t=e?.style?.position?.type;return"sticky"===t||"fixed"===t}function ib({name:e}={}){const[t,n]=Ti("position.fixed","position.sticky"),o=!t&&!n;return r=e,!(0,p.getBlockSupport)(r,Qf)||o;var r}function sb({style:e={},clientId:t,name:n,setAttributes:o}){const r=function(e){const t=(0,p.getBlockSupport)(e,Qf);return!(!0!==t&&!t?.fixed)}(n),i=function(e){const t=(0,p.getBlockSupport)(e,Qf);return!(!0!==t&&!t?.sticky)}(n),s=e?.position?.type,{firstParentClientId:l}=(0,g.useSelect)((e=>{const{getBlockParents:n}=e(ji),o=n(t);return{firstParentClientId:o[o.length-1]}}),[t]),a=Xf(l),c=i&&s===eb.value&&a?(0,T.sprintf)((0,T.__)("The block will stick to the scrollable area of the parent %s block."),a.title):null,u=(0,h.useMemo)((()=>{const e=[Jf];return(i||s===eb.value)&&e.push(eb),(r||s===tb.value)&&e.push(tb),e}),[r,i,s]),m=s&&u.find((e=>e.value===s))||Jf;return h.Platform.select({web:u.length>1?(0,d.jsx)(Fa,{group:"position",children:(0,d.jsx)(ws.BaseControl,{__nextHasNoMarginBottom:!0,help:c,children:(0,d.jsx)(ws.CustomSelectControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Position"),hideLabelFromVision:!0,describedBy:(0,T.sprintf)((0,T.__)("Currently selected position: %s"),m.name),options:u,value:m,onChange:({selectedItem:t})=>{(t=>{const n={...e,position:{...e?.position,type:t,top:"sticky"===t||"fixed"===t?"0px":void 0}};o({style:fs(n)})})(t.value)},size:"__unstable-large"})})}):null,native:null})}var lb={edit:function(e){return ib(e)?null:(0,d.jsx)(sb,{...e})},useBlockProps:function({name:e,style:t}){const n=(0,p.hasBlockSupport)(e,Qf),o=ib({name:e}),r=n&&!o,i=(0,m.useInstanceId)(ab),s=`.wp-container-${i}.wp-container-${i}`;let l;r&&(l=function({selector:e,style:t}){let n="";const{type:o}=t?.position||{};return ob.includes(o)?(n+=`${e} {`,n+=`position: ${o};`,nb.forEach((e=>{void 0!==t?.position?.[e]&&(n+=`${e}: ${t.position[e]};`)})),"sticky"!==o&&"fixed"!==o||(n+="z-index: 10"),n+="}",n):n}({selector:s,style:t})||"");const a=ms({[`wp-container-${i}`]:r&&!!l,[`is-position-${t?.position?.type}`]:r&&!!l&&!!t?.position?.type});return _s({css:l}),{className:a}},attributeKeys:["style"],hasSupport:e=>(0,p.hasBlockSupport)(e,Qf)};const ab={};const cb={button:"wp-element-button",caption:"wp-element-caption"},ub={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"},{kebabCase:db}=G(ws.privateApis);function pb(e={},t,n){let o=[];return Object.keys(e).forEach((r=>{const i=t+db(r.replace("/","-")),s=e[r];if(s instanceof Object){const e=i+n;o=[...o,...pb(s,e,n)]}else o.push(`${i}: ${s}`)})),o}const hb=(e,t)=>{const n={};return Object.entries(e).forEach((([e,o])=>{if("root"===e||!t?.[e])return;const r="string"==typeof o;if(r||Object.entries(o).forEach((([o,r])=>{if("root"===o||!t?.[e][o])return;const i=gb({[e]:{[o]:t[e][o]}});n[r]=[...n[r]||[],...i],delete t[e][o]})),r||o.root){const i=r?o:o.root,s=gb({[e]:t[e]});n[i]=[...n[i]||[],...s],delete t[e]}})),n};function gb(e={},t="",n,o={},r=!1){const i=qi===t,s=Object.entries(p.__EXPERIMENTAL_STYLE_PROPERTY).reduce(((t,[o,{value:r,properties:s,useEngine:l,rootOnly:a}])=>{if(a&&!i)return t;const c=r;if("elements"===c[0]||l)return t;const u=fe(e,c);if("--wp--style--root--padding"===o&&("string"==typeof u||!n))return t;if(s&&"string"!=typeof u)Object.entries(s).forEach((e=>{const[n,o]=e;if(!fe(u,[o],!1))return;const r=n.startsWith("--")?n:db(n);t.push(`${r}: ${(0,Pi.getCSSValueFromRawStyle)(fe(u,[o]))}`)}));else if(fe(e,c,!1)){const n=o.startsWith("--")?o:db(o);t.push(`${n}: ${(0,Pi.getCSSValueFromRawStyle)(fe(e,c))}`)}return t}),[]);e.background&&(e.background?.backgroundImage&&(e.background.backgroundImage=rs(e.background.backgroundImage,o)),!i&&e.background?.backgroundImage?.id&&(e={...e,background:{...e.background,...Au(e.background)}}));return(0,Pi.getCSSRules)(e).forEach((e=>{if(i&&(n||r)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:db(e.key);let l=rs(e.value,o);"font-size"===t&&(l=Wi({size:l},o?.settings)),"aspect-ratio"===t&&s.push("min-height: unset"),s.push(`${t}: ${l}`)})),s}function mb({layoutDefinitions:e=Fs,style:t,selector:n,hasBlockGapSupport:o,hasFallbackGapSupport:r,fallbackGapValue:i}){let s="",l=o?ul(t?.spacing?.blockGap):"";if(r&&(n===qi?l=l||"0.5em":!o&&i&&(l=i)),l&&e&&(Object.values(e).forEach((({className:e,name:t,spacingStyles:r})=>{(o||"flex"===t||"grid"===t)&&r?.length&&r.forEach((t=>{const r=[];if(t.rules&&Object.entries(t.rules).forEach((([e,t])=>{r.push(`${e}: ${t||l}`)})),r.length){let i="";i=o?n===qi?`:root :where(.${e})${t?.selector||""}`:`:root :where(${n}-${e})${t?.selector||""}`:n===qi?`:where(.${e}${t?.selector||""})`:`:where(${n}.${e}${t?.selector||""})`,s+=`${i} { ${r.join("; ")}; }`}}))})),n===qi&&o&&(s+=`${Yi} { --wp--style--block-gap: ${l}; }`)),n===qi&&e){const t=["block","flex","grid"];Object.values(e).forEach((({className:e,displayMode:o,baseStyles:r})=>{o&&t.includes(o)&&(s+=`${n} .${e} { display:${o}; }`),r?.length&&r.forEach((t=>{const n=[];if(t.rules&&Object.entries(t.rules).forEach((([e,t])=>{n.push(`${e}: ${t}`)})),n.length){s+=`${`.${e}${t?.selector||""}`} { ${n.join("; ")}; }`}}))}))}return s}const fb=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function bb(e){if(!e)return{};const t=Object.entries(e).filter((([e])=>fb.includes(e))).map((([e,t])=>[e,JSON.parse(JSON.stringify(t))]));return Object.fromEntries(t)}const kb=(e,t)=>{const n=[];if(!e?.styles)return n;const o=bb(e.styles);return o&&n.push({styles:o,selector:qi,skipSelectorWrapper:!0}),Object.entries(p.__EXPERIMENTAL_ELEMENTS).forEach((([t,o])=>{e.styles?.elements?.[t]&&n.push({styles:e.styles?.elements?.[t],selector:o,skipSelectorWrapper:!cb[t]})})),Object.entries(e.styles?.blocks??{}).forEach((([e,o])=>{const r=bb(o);if(o?.variations){const i={};Object.entries(o.variations).forEach((([o,r])=>{i[o]=bb(r),r?.css&&(i[o].css=r.css);const s=t[e]?.styleVariationSelectors?.[o];Object.entries(r?.elements??{}).forEach((([e,t])=>{t&&p.__EXPERIMENTAL_ELEMENTS[e]&&n.push({styles:t,selector:ns(s,p.__EXPERIMENTAL_ELEMENTS[e])})})),Object.entries(r?.blocks??{}).forEach((([e,o])=>{const r=ns(s,t[e]?.selector),i=ns(s,t[e]?.duotoneSelector),l=function(e,t){if(!e||!t)return;const n={};return Object.entries(t).forEach((([t,o])=>{"string"==typeof o&&(n[t]=ns(e,o)),"object"==typeof o&&(n[t]={},Object.entries(o).forEach((([o,r])=>{n[t][o]=ns(e,r)})))})),n}(s,t[e]?.featureSelectors),a=bb(o);o?.css&&(a.css=o.css),n.push({selector:r,duotoneSelector:i,featureSelectors:l,fallbackGapValue:t[e]?.fallbackGapValue,hasLayoutSupport:t[e]?.hasLayoutSupport,styles:a}),Object.entries(o.elements??{}).forEach((([e,t])=>{t&&p.__EXPERIMENTAL_ELEMENTS[e]&&n.push({styles:t,selector:ns(r,p.__EXPERIMENTAL_ELEMENTS[e])})}))}))})),r.variations=i}t?.[e]?.selector&&n.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:r,featureSelectors:t[e].featureSelectors,styleVariationSelectors:t[e].styleVariationSelectors}),Object.entries(o?.elements??{}).forEach((([o,r])=>{r&&t?.[e]&&p.__EXPERIMENTAL_ELEMENTS[o]&&n.push({styles:r,selector:t[e]?.selector.split(",").map((e=>p.__EXPERIMENTAL_ELEMENTS[o].split(",").map((t=>e+" "+t)))).join(",")})}))})),n},vb=(e,t)=>{const n=[];if(!e?.settings)return n;const o=e=>{let t={};return Xi.forEach((({path:n})=>{const o=fe(e,n,!1);!1!==o&&(t=me(t,n,o))})),t},r=o(e.settings),i=e.settings?.custom;return(Object.keys(r).length>0||i)&&n.push({presets:r,custom:i,selector:Yi}),Object.entries(e.settings?.blocks??{}).forEach((([e,r])=>{const i=o(r),s=r.custom;(Object.keys(i).length>0||s)&&n.push({presets:i,custom:s,selector:t[e]?.selector})})),n},_b=(e,t)=>{const n=vb(e,t);let o="";return n.forEach((({presets:t,custom:n,selector:r})=>{const i=function(e={},t){return Xi.reduce(((n,{path:o,valueKey:r,valueFunc:i,cssVarInfix:s})=>{const l=fe(e,o,[]);return["default","theme","custom"].forEach((e=>{l[e]&&l[e].forEach((e=>{r&&!i?n.push(`--wp--preset--${s}--${db(e.slug)}: ${e[r]}`):i&&"function"==typeof i&&n.push(`--wp--preset--${s}--${db(e.slug)}: ${i(e,t)}`)}))})),n}),[])}(t,e?.settings),s=pb(n,"--wp--custom--","--");s.length>0&&i.push(...s),i.length>0&&(o+=`${r}{${i.join(";")};}`)})),o},yb=(e,t,n,o,r=!1,i=!1,s=void 0)=>{const l={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,variationStyles:!1,...s},a=kb(e,t),c=vb(e,t),u=e?.settings?.useRootPaddingAwareAlignments,{contentSize:d,wideSize:p}=e?.settings?.layout||{},h=l.marginReset||l.rootPadding||l.layoutStyles;let g="";if(l.presets&&(d||p)&&(g+=`${Yi} {`,g=d?g+` --wp--style--global--content-size: ${d};`:g,g=p?g+` --wp--style--global--wide-size: ${p};`:g,g+="}"),h&&(g+=":where(body) {margin: 0;",l.rootPadding&&u&&(g+="padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t\t.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; }\n\t\t\t\t.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0;\n\t\t\t\t"),g+="}"),l.blockStyles&&a.forEach((({selector:t,duotoneSelector:s,styles:a,fallbackGapValue:c,hasLayoutSupport:d,featureSelectors:p,styleVariationSelectors:h,skipSelectorWrapper:m})=>{if(p){const e=hb(p,a);Object.entries(e).forEach((([e,t])=>{if(t.length){const n=t.join(";");g+=`:root :where(${e}){${n};}`}}))}if(s){const e={};a?.filter&&(e.filter=a.filter,delete a.filter);const t=gb(e);t.length&&(g+=`${s}{${t.join(";")};}`)}r||qi!==t&&!d||(g+=mb({style:a,selector:t,hasBlockGapSupport:n,hasFallbackGapSupport:o,fallbackGapValue:c}));const f=gb(a,t,u,e,i);if(f?.length){g+=`${m?t:`:root :where(${t})`}{${f.join(";")};}`}a?.css&&(g+=wb(a.css,`:root :where(${t})`)),l.variationStyles&&h&&Object.entries(h).forEach((([t,n])=>{const o=a?.variations?.[t];if(o){if(p){const e=hb(p,o);Object.entries(e).forEach((([e,t])=>{if(t.length){const o=function(e,t){const n=e.split(","),o=[];return n.forEach((e=>{o.push(`${t.trim()}${e.trim()}`)})),o.join(", ")}(e,n),r=t.join(";");g+=`:root :where(${o}){${r};}`}}))}const t=gb(o,n,u,e);t.length&&(g+=`:root :where(${n}){${t.join(";")};}`),o?.css&&(g+=wb(o.css,`:root :where(${n})`))}}));const b=Object.entries(a).filter((([e])=>e.startsWith(":")));b?.length&&b.forEach((([e,n])=>{const o=gb(n);if(!o?.length)return;const r=`:root :where(${t.split(",").map((t=>t+e)).join(",")}){${o.join(";")};}`;g+=r}))})),l.layoutStyles&&(g+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",g+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",g+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),l.blockGap&&n){const t=ul(e?.styles?.spacing?.blockGap)||"0.5em";g+=`:root :where(.wp-site-blocks) > * { margin-block-start: ${t}; margin-block-end: 0; }`,g+=":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }",g+=":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"}return l.presets&&c.forEach((({selector:e,presets:t})=>{qi!==e&&Yi!==e||(e="");const n=function(e="*",t={}){return Xi.reduce(((n,{path:o,cssVarInfix:r,classes:i})=>{if(!i)return n;const s=fe(t,o,[]);return["default","theme","custom"].forEach((t=>{s[t]&&s[t].forEach((({slug:t})=>{i.forEach((({classSuffix:o,propertyName:i})=>{const s=`.has-${db(t)}-${o}`,l=e.split(",").map((e=>`${e}${s}`)).join(","),a=`var(--wp--preset--${r}--${db(t)})`;n+=`${l}{${i}: ${a} !important;}`}))}))})),n}),"")}(e,t);n.length>0&&(g+=n)})),g};function xb(e,t){return vb(e,t).flatMap((({presets:e})=>function(e={}){return Xi.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=fe(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>Pf(`wp-duotone-${e.slug}`,e.colors))))).join("")}))}(e)))}const Sb=(e,t,n)=>{const o={};return e.forEach((e=>{const r=e.name,i=Rf(e);let s=Rf(e,"filter.duotone");if(!s){const t=Rf(e),n=(0,p.getBlockSupport)(e,"color.__experimentalDuotone",!1);s=n&&ns(t,n)}const l=!!e?.supports?.layout||!!e?.supports?.__experimentalLayout,a=e?.supports?.spacing?.blockGap?.__experimentalDefault,c=t(r),u={};c?.forEach((e=>{const t=n?`-${n}`:"",o=`${e.name}${t}`,r=function(e,t){const n=`.is-style-${e}`;if(!t)return n;const o=/((?::\([^)]+\))?\s*)([^\s:]+)/,r=(e,t,o)=>t+o+n;return t.split(",").map((e=>e.replace(o,r))).join(",")}(o,i);u[o]=r}));const d=((e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const n={root:t};return Object.entries(ub).forEach((([t,o])=>{const r=Rf(e,t);r&&(n[o]=r)})),n})(e,i);o[r]={duotoneSelector:s,fallbackGapValue:a,featureSelectors:Object.keys(d).length?d:void 0,hasLayoutSupport:l,name:r,selector:i,styleVariationSelectors:c?.length?u:void 0}})),o};function wb(e,t){let n="";if(!e||""===e.trim())return n;return e.split("&").forEach((e=>{if(!e||""===e.trim())return;if(!e.includes("{"))n+=`:root :where(${t}){${e.trim()}}`;else{const o=e.replace("}","").split("{");if(2!==o.length)return;const[r,i]=o,s=r.match(/([>+~\s]*::[a-zA-Z-]+)/),l=s?s[1]:"",a=s?r.replace(l,"").trim():r.trim();let c;c=""===a?t:r.startsWith(" ")?ns(t,a):function(e,t){return e.includes(",")?e.split(",").map((e=>e+t)).join(","):e+t}(t,a),n+=`:root :where(${c})${l}{${i.trim()}}`}})),n}function Cb(e={},t){const[n]=cs("spacing.blockGap"),o=null!==n,r=!o,i=(0,g.useSelect)((e=>{const{getSettings:t}=e(ji);return!!t().disableLayoutStyles})),{getBlockStyles:s}=(0,g.useSelect)(p.store);return(0,h.useMemo)((()=>{if(!e?.styles||!e?.settings)return[];const n=(l=e,l.styles?.blocks?.["core/separator"]&&l.styles?.blocks?.["core/separator"].color?.background&&!l.styles?.blocks?.["core/separator"].color?.text&&!l.styles?.blocks?.["core/separator"].border?.color?{...l,styles:{...l.styles,blocks:{...l.styles.blocks,"core/separator":{...l.styles.blocks["core/separator"],color:{...l.styles.blocks["core/separator"].color,text:l.styles?.blocks["core/separator"].color.background}}}}}:l);var l;const a=Sb((0,p.getBlockTypes)(),s),c=_b(n,a),u=yb(n,a,o,r,i,t),d=xb(n,a),h=[{css:c,isGlobalStyles:!0},{css:u,isGlobalStyles:!0},{css:n.styles.css??"",isGlobalStyles:!0},{assets:d,__unstableType:"svg",isGlobalStyles:!0}];return(0,p.getBlockTypes)().forEach((e=>{if(n.styles.blocks[e.name]?.css){const t=a[e.name].selector;h.push({css:wb(n.styles.blocks[e.name]?.css,t),isGlobalStyles:!0})}})),[h,n.settings]}),[o,r,e,i,t,s])}function Bb(e=!1){const{merged:t}=(0,h.useContext)(is);return Cb(t,e)}const Ib="is-style-";function jb(e){return e?e.split(/\s+/).reduce(((e,t)=>{if(t.startsWith(Ib)){const n=t.slice(9);"default"!==n&&e.push(n)}return e}),[]):[]}function Eb({override:e}){ys(e)}function Tb(e,t,n){if(!e?.styles?.blocks?.[t]?.variations?.[n])return;const o=t=>{Object.keys(t).forEach((n=>{const r=t[n];if("object"==typeof r&&null!==r)if(void 0!==r.ref)if("string"!=typeof r.ref||""===r.ref.trim())delete t[n];else{const o=fe(e,r.ref);o?t[n]=o:delete t[n]}else o(r),0===Object.keys(r).length&&delete t[n]}))},r=JSON.parse(JSON.stringify(e.styles.blocks[t].variations[n]));return o(r),r}var Mb={hasSupport:()=>!0,attributeKeys:["className"],isMatch:({className:e})=>jb(e).length>0,useBlockProps:function({name:e,className:t,clientId:n}){const{getBlockStyles:o}=(0,g.useSelect)(p.store),r=function(e,t=[]){const n=jb(e);if(!n)return null;for(const e of n)if(t.some((t=>t.name===e)))return e;return null}(t,o(e)),i=`${Ib}${r}-${n}`,{settings:s,styles:l}=function(e,t,n){const{merged:o}=(0,h.useContext)(is),{globalSettings:r,globalStyles:i}=(0,g.useSelect)((e=>{const t=e(ji).getSettings();return{globalSettings:t.__experimentalFeatures,globalStyles:t[N]}}),[]);return(0,h.useMemo)((()=>{const s=Tb({settings:o?.settings??r,styles:o?.styles??i},e,t);return{settings:o?.settings??r,styles:{blocks:{[e]:{variations:{[`${t}-${n}`]:s}}}}}}),[o,r,i,t,n,e])}(e,r,n),a=(0,h.useMemo)((()=>{if(!r)return;const e={settings:s,styles:l},t=Sb((0,p.getBlockTypes)(),o,n);return yb(e,t,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0})}),[r,s,l,o,n]);return ys({id:`variation-${n}`,css:a,__unstableType:"variation",variation:r,clientId:n}),r?{className:i}:{}}};const Pb="layout",{kebabCase:Rb}=G(ws.privateApis);function Ab(e){return(0,p.hasBlockSupport)(e,"layout")||(0,p.hasBlockSupport)(e,"__experimentalLayout")}function Nb(e={},t=""){const{layout:n}=e,{default:o}=(0,p.getBlockSupport)(t,Pb)||{},r=n?.inherit||n?.contentSize||n?.wideSize?{...n,type:"constrained"}:n||o||{},i=[];if(Fs[r?.type||"default"]?.className){const e=Fs[r?.type||"default"]?.className,n=t.split("/"),o=`wp-block-${"core"===n[0]?n.pop():n.join("-")}-${e}`;i.push(e,o)}return(0,g.useSelect)((e=>(r?.inherit||r?.contentSize||"constrained"===r?.type)&&e(ji).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments),[r?.contentSize,r?.inherit,r?.type])&&i.push("has-global-padding"),r?.orientation&&i.push(`is-${Rb(r.orientation)}`),r?.justifyContent&&i.push(`is-content-justification-${Rb(r.justifyContent)}`),r?.flexWrap&&"nowrap"===r.flexWrap&&i.push("is-nowrap"),i}var Lb={shareWithChildBlocks:!0,edit:function({layout:e,setAttributes:t,name:n,clientId:o}){const r=xs(n),{layout:i}=r,{themeSupportsLayout:s}=(0,g.useSelect)((e=>{const{getSettings:t}=e(ji);return{themeSupportsLayout:t().supportsLayout}}),[]);if("default"!==ga())return null;const l=(0,p.getBlockSupport)(n,Pb,{}),a={...i,...l},{allowSwitching:c,allowEditing:u=!0,allowInheriting:h=!0,default:m}=a;if(!u)return null;const f={...l,...e},{type:b,default:{type:k="default"}={}}=f,v=b||k,_=!(!h||v&&"default"!==v&&"constrained"!==v&&!f.inherit),y=e||m||{},{inherit:x=!1,contentSize:S=null}=y;if(("default"===v||"constrained"===v)&&!s)return null;const w=Xl(v),C=Xl("constrained"),B=!y.type&&(S||x),I=!!x||!!S,j=e=>t({layout:e});return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Fa,{children:(0,d.jsxs)(ws.PanelBody,{title:(0,T.__)("Layout"),children:[_&&(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(ws.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Inner blocks use content width"),checked:"constrained"===w?.name||I,onChange:()=>t({layout:{type:"constrained"===w?.name||I?"default":"constrained"}}),help:"constrained"===w?.name||I?(0,T.__)("Nested blocks use content width with options for full and wide widths."):(0,T.__)("Nested blocks will fill the width of this container.")})}),!x&&c&&(0,d.jsx)(Db,{type:v,onChange:e=>t({layout:{type:e}})}),w&&"default"!==w.name&&(0,d.jsx)(w.inspectorControls,{layout:y,onChange:j,layoutBlockSupport:a,name:n,clientId:o}),C&&B&&(0,d.jsx)(C.inspectorControls,{layout:y,onChange:j,layoutBlockSupport:a,name:n,clientId:o})]})}),!x&&w&&(0,d.jsx)(w.toolBarControls,{layout:y,onChange:j,layoutBlockSupport:l,name:n,clientId:o})]})},attributeKeys:["layout"],hasSupport:e=>Ab(e)};function Db({type:e,onChange:t}){return(0,d.jsx)(ws.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,isBlock:!0,label:(0,T.__)("Layout type"),__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,isAdaptiveWidth:!0,value:e,onChange:t,children:Yl.map((({name:e,label:t})=>(0,d.jsx)(ws.__experimentalToggleGroupControlOption,{value:e,label:t},e)))})}function Ob({block:e,props:t,blockGapSupport:n,layoutClasses:o}){const{name:r,attributes:i}=t,s=(0,m.useInstanceId)(e),{layout:l}=i,{default:a}=(0,p.getBlockSupport)(r,Pb)||{},c=l?.inherit||l?.contentSize||l?.wideSize?{...l,type:"constrained"}:l||a||{},u=`wp-container-${Rb(r)}-is-layout-`,h=`.${u}${s}`,g=null!==n,f=Xl(c?.type||"default"),b=f?.getLayoutStyle?.({blockName:r,selector:h,layout:c,style:i?.style,hasBlockGapSupport:g}),k=ms({[`${u}${s}`]:!!b},o);return _s({css:b}),(0,d.jsx)(e,{...t,__unstableLayoutClassNames:k})}const zb=(0,m.createHigherOrderComponent)((e=>t=>{const{clientId:n,name:o,attributes:r}=t,i=Ab(o),s=Nb(r,o),l=(0,g.useSelect)((e=>{if(!i)return;const{getSettings:t,getBlockSettings:o}=G(e(ji)),{disableLayoutStyles:r}=t();if(r)return;const[s]=o(n,"spacing.blockGap");return{blockGapSupport:s}}),[i,n]);return l?(0,d.jsx)(Ob,{block:e,props:t,layoutClasses:s,...l}):(0,d.jsx)(e,{...t,__unstableLayoutClassNames:i?s:void 0})}),"withLayoutStyles");function Vb(e,t){return Array.from({length:t},((t,n)=>e+n))}(0,f.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return"type"in(e.attributes?.layout??{})||Ab(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,f.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",zb);class Fb{constructor({columnStart:e,rowStart:t,columnEnd:n,rowEnd:o,columnSpan:r,rowSpan:i}={}){this.columnStart=e??1,this.rowStart=t??1,this.columnEnd=void 0!==r?this.columnStart+r-1:n??this.columnStart,this.rowEnd=void 0!==i?this.rowStart+i-1:o??this.rowStart}get columnSpan(){return this.columnEnd-this.columnStart+1}get rowSpan(){return this.rowEnd-this.rowStart+1}contains(e,t){return e>=this.columnStart&&e<=this.columnEnd&&t>=this.rowStart&&t<=this.rowEnd}containsRect(e){return this.contains(e.columnStart,e.rowStart)&&this.contains(e.columnEnd,e.rowEnd)}intersectsRect(e){return this.columnStart<=e.columnEnd&&this.columnEnd>=e.columnStart&&this.rowStart<=e.rowEnd&&this.rowEnd>=e.rowStart}}function Hb(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function Ub(e,t){const n=[];for(const o of e.split(" ")){const e=n[n.length-1],r=e?e.end+t:0,i=r+parseFloat(o);n.push({start:r,end:i})}return n}function Gb(e,t,n="start"){return e.reduce(((o,r,i)=>Math.abs(r[n]-t)<Math.abs(e[o][n]-t)?i:o),0)}function $b(e){const t=Hb(e,"grid-template-columns"),n=Hb(e,"grid-template-rows"),o=Hb(e,"border-top-width"),r=Hb(e,"border-right-width"),i=Hb(e,"border-bottom-width"),s=Hb(e,"border-left-width"),l=Hb(e,"padding-top"),a=Hb(e,"padding-right"),c=Hb(e,"padding-bottom"),u=Hb(e,"padding-left"),d=t.split(" ").length,p=n.split(" ").length;return{numColumns:d,numRows:p,numItems:d*p,currentColor:Hb(e,"color"),style:{gridTemplateColumns:t,gridTemplateRows:n,gap:Hb(e,"gap"),inset:`\n\t\t\t\tcalc(${l} + ${o})\n\t\t\t\tcalc(${a} + ${r})\n\t\t\t\tcalc(${c} + ${i})\n\t\t\t\tcalc(${u} + ${s})\n\t\t\t`}}}const Wb=[(0,h.createInterpolateElement)((0,T.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,d.jsx)("kbd",{})}),(0,h.createInterpolateElement)((0,T.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,d.jsx)("kbd",{})}),(0,h.createInterpolateElement)((0,T.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,d.jsx)("kbd",{})}),(0,T.__)("Drag files into the editor to automatically insert media blocks."),(0,T.__)("Change a block's type by pressing the block icon on the toolbar.")];var Kb=function(){const[e]=(0,h.useState)(Math.floor(Math.random()*Wb.length));return(0,d.jsx)(ws.Tip,{children:Wb[e]})},Zb=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),qb=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})});const{Badge:Yb}=G(ws.privateApis);var Xb=function({title:e,icon:t,description:n,blockType:o,className:r,name:i,allowParentNavigation:s,children:l}){o&&(I()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:e,icon:t,description:n}=o));const a=(0,g.useSelect)((e=>{if(!s)return;const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(ji);return n(t(),"core/navigation",!0)[0]}),[s]),{selectBlock:c}=(0,g.useDispatch)(ji);return(0,d.jsxs)("div",{className:ms("block-editor-block-card",r),children:[s&&a&&(0,d.jsx)(ws.Button,{onClick:()=>c(a),label:(0,T.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,T.isRTL)()?Zb:qb,size:"small"}),(0,d.jsx)(Vu,{icon:t,showColors:!0}),(0,d.jsxs)(ws.__experimentalVStack,{spacing:1,children:[(0,d.jsxs)("h2",{className:"block-editor-block-card__title",children:[(0,d.jsx)("span",{className:"block-editor-block-card__name",children:i?.length?i:e}),!!i?.length&&(0,d.jsx)(Yb,{children:e})]}),n&&(0,d.jsx)(ws.__experimentalText,{className:"block-editor-block-card__description",children:n}),l]})]})},Qb=(e=>(e.Unknown="REDUX_UNKNOWN",e.Add="ADD_ITEM",e.Prepare="PREPARE_ITEM",e.Cancel="CANCEL_ITEM",e.Remove="REMOVE_ITEM",e.PauseItem="PAUSE_ITEM",e.ResumeItem="RESUME_ITEM",e.PauseQueue="PAUSE_QUEUE",e.ResumeQueue="RESUME_QUEUE",e.OperationStart="OPERATION_START",e.OperationFinish="OPERATION_FINISH",e.AddOperations="ADD_OPERATIONS",e.CacheBlobUrl="CACHE_BLOB_URL",e.RevokeBlobUrls="REVOKE_BLOB_URLS",e.UpdateSettings="UPDATE_SETTINGS",e))(Qb||{}),Jb=(e=>(e.Processing="PROCESSING",e.Paused="PAUSED",e))(Jb||{}),ek=(e=>(e.Prepare="PREPARE",e.Upload="UPLOAD",e))(ek||{});const tk={queue:[],queueStatus:"active",blobUrls:{},settings:{mediaUpload:()=>{}}};var nk=function(e=tk,t={type:Qb.Unknown}){switch(t.type){case Qb.PauseQueue:return{...e,queueStatus:"paused"};case Qb.ResumeQueue:return{...e,queueStatus:"active"};case Qb.Add:return{...e,queue:[...e.queue,t.item]};case Qb.Cancel:return{...e,queue:e.queue.map((e=>e.id===t.id?{...e,error:t.error}:e))};case Qb.Remove:return{...e,queue:e.queue.filter((e=>e.id!==t.id))};case Qb.OperationStart:return{...e,queue:e.queue.map((e=>e.id===t.id?{...e,currentOperation:t.operation}:e))};case Qb.AddOperations:return{...e,queue:e.queue.map((e=>e.id!==t.id?e:{...e,operations:[...e.operations||[],...t.operations]}))};case Qb.OperationFinish:return{...e,queue:e.queue.map((e=>{if(e.id!==t.id)return e;const n=e.operations?e.operations.slice(1):[],o=e.attachment||t.item.attachment?{...e.attachment,...t.item.attachment}:void 0;return{...e,currentOperation:void 0,operations:n,...t.item,attachment:o,additionalData:{...e.additionalData,...t.item.additionalData}}}))};case Qb.CacheBlobUrl:{const n=e.blobUrls[t.id]||[];return{...e,blobUrls:{...e.blobUrls,[t.id]:[...n,t.blobUrl]}}}case Qb.RevokeBlobUrls:{const n={...e.blobUrls};return delete n[t.id],{...e,blobUrls:n}}case Qb.UpdateSettings:return{...e,settings:{...e.settings,...t.settings}}}return e};function ok(e){return e.queue}function rk(e){return e.queue.length>=1}function ik(e,t){return e.queue.some((e=>e.attachment?.url===t||e.sourceUrl===t))}function sk(e,t){return e.queue.some((e=>e.attachment?.id===t||e.sourceAttachmentId===t))}function lk(e){return e.settings}function ak(e){return e.queue}function ck(e,t){return e.queue.find((e=>e.id===t))}function uk(e,t){return 0===e.queue.filter((e=>t===e.batchId)).length}function dk(e,t){return e.queue.some((e=>e.currentOperation===ek.Upload&&e.additionalData.post===t))}function pk(e,t){return e.queue.find((e=>e.status===Jb.Paused&&e.additionalData.post===t))}function hk(e){return"paused"===e.queueStatus}function gk(e,t){return e.blobUrls[t]||[]}const mk={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let fk;const bk=new Uint8Array(16);function kk(){if(!fk&&(fk="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!fk))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return fk(bk)}const vk=[];for(let e=0;e<256;++e)vk.push((e+256).toString(16).slice(1));function _k(e,t=0){return vk[e[t+0]]+vk[e[t+1]]+vk[e[t+2]]+vk[e[t+3]]+"-"+vk[e[t+4]]+vk[e[t+5]]+"-"+vk[e[t+6]]+vk[e[t+7]]+"-"+vk[e[t+8]]+vk[e[t+9]]+"-"+vk[e[t+10]]+vk[e[t+11]]+vk[e[t+12]]+vk[e[t+13]]+vk[e[t+14]]+vk[e[t+15]]}const yk=function(e,t,n){if(mk.randomUUID&&!t&&!e)return mk.randomUUID();const o=(e=e||{}).random||(e.rng||kk)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=o[e];return t}return _k(o)};class xk extends Error{code;file;constructor({code:e,message:t,file:n,cause:o}){super(t,{cause:o}),Object.setPrototypeOf(this,new.target.prototype),this.code=e,this.file=n}}function Sk(e,t){if(!t)return;const n=t.some((t=>t.includes("/")?t===e.type:e.type.startsWith(`${t}/`)));if(e.type&&!n)throw new xk({code:"MIME_TYPE_NOT_SUPPORTED",message:(0,T.sprintf)((0,T.__)("%s: Sorry, this file type is not supported here."),e.name),file:e})}function wk(e,t){const n=(o=t)?Object.entries(o).flatMap((([e,t])=>{const[n]=t.split("/");return[t,...e.split("|").map((e=>`${n}/${e}`))]})):null;var o;if(!n)return;const r=n.includes(e.type);if(e.type&&!r)throw new xk({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:(0,T.sprintf)((0,T.__)("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e})}function Ck(e,t){if(e.size<=0)throw new xk({code:"EMPTY_FILE",message:(0,T.sprintf)((0,T.__)("%s: This file is empty."),e.name),file:e});if(t&&e.size>t)throw new xk({code:"SIZE_ABOVE_LIMIT",message:(0,T.sprintf)((0,T.__)("%s: This file exceeds the maximum upload size for this site."),e.name),file:e})}function Bk({files:e,onChange:t,onSuccess:n,onError:o,onBatchSuccess:r,additionalData:i,allowedTypes:s}){return async({select:l,dispatch:a})=>{const c=yk();for(const u of e){try{Sk(u,s),wk(u,l.getSettings().allowedMimeTypes)}catch(e){o?.(e);continue}try{Ck(u,l.getSettings().maxUploadFileSize)}catch(e){o?.(e);continue}a.addItem({file:u,batchId:c,onChange:t,onSuccess:n,onBatchSuccess:r,onError:o,additionalData:i})}}}function Ik(e,t,n=!1){return async({select:o,dispatch:r})=>{const i=o.getItem(e);if(i){if(i.abortController?.abort(),!n){const{onError:e}=i;e?.(t??new Error("Upload cancelled")),!e&&t&&console.error("Upload cancelled",t)}r({type:Qb.Cancel,id:e,error:t}),r.removeItem(e),r.revokeBlobUrls(e),i.batchId&&o.isBatchUploaded(i.batchId)&&i.onBatchSuccess?.()}}}function jk(e){return function(e,t){return new File([e],t,{type:e.type,lastModified:e.lastModified})}(e,e.name)}class Ek extends File{constructor(e="stub-file"){super([],e)}}function Tk({file:e,batchId:t,onChange:n,onSuccess:o,onBatchSuccess:r,onError:i,additionalData:s={},sourceUrl:l,sourceAttachmentId:a,abortController:c,operations:u}){return async({dispatch:d})=>{const p=yk(),h=function(e){if(e instanceof File)return e;const t=e.type.split("/")[1],n="application/pdf"===e.type?"document":e.type.split("/")[0];return new File([e],`${n}.${t}`,{type:e.type})}(e);let g;h instanceof Ek||(g=(0,$a.createBlobURL)(h),d({type:Qb.CacheBlobUrl,id:p,blobUrl:g})),d({type:Qb.Add,item:{id:p,batchId:t,status:Jb.Processing,sourceFile:jk(h),file:h,attachment:{url:g},additionalData:{convert_format:!1,...s},onChange:n,onSuccess:o,onBatchSuccess:r,onError:i,sourceUrl:l,sourceAttachmentId:a,abortController:c||new AbortController,operations:Array.isArray(u)?u:[ek.Prepare]}}),d.processItem(p)}}function Mk(e){return async({select:t,dispatch:n})=>{if(t.isPaused())return;const o=t.getItem(e),{attachment:r,onChange:i,onSuccess:s,onBatchSuccess:l,batchId:a}=o,c=Array.isArray(o.operations?.[0])?o.operations[0][0]:o.operations?.[0];if(r&&i?.([r]),!c)return r&&s?.([r]),n.revokeBlobUrls(e),void(a&&t.isBatchUploaded(a)&&l?.());if(c)switch(n({type:Qb.OperationStart,id:e,operation:c}),c){case ek.Prepare:n.prepareItem(o.id);break;case ek.Upload:n.uploadItem(e)}}}function Pk(){return{type:Qb.PauseQueue}}function Rk(){return async({select:e,dispatch:t})=>{t({type:Qb.ResumeQueue});for(const n of e.getAllItems())t.processItem(n.id)}}function Ak(e){return async({select:t,dispatch:n})=>{t.getItem(e)&&n({type:Qb.Remove,id:e})}}function Nk(e,t){return async({dispatch:n})=>{n({type:Qb.OperationFinish,id:e,item:t}),n.processItem(e)}}function Lk(e){return async({dispatch:t})=>{const n=[ek.Upload];t({type:Qb.AddOperations,id:e,operations:n}),t.finishOperation(e,{})}}function Dk(e){return async({select:t,dispatch:n})=>{const o=t.getItem(e);t.getSettings().mediaUpload({filesList:[o.file],additionalData:o.additionalData,signal:o.abortController?.signal,onFileChange:([t])=>{(0,$a.isBlobURL)(t.url)||n.finishOperation(e,{attachment:t})},onSuccess:([t])=>{n.finishOperation(e,{attachment:t})},onError:t=>{n.cancelItem(e,t)}})}}function Ok(e){return async({select:t,dispatch:n})=>{const o=t.getBlobUrls(e);for(const e of o)(0,$a.revokeBlobURL)(e);n({type:Qb.RevokeBlobUrls,id:e})}}function zk(e){return{type:Qb.UpdateSettings,settings:e}}const{lock:Vk,unlock:Fk}=(0,H.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/upload-media"),Hk="core/upload-media",Uk={reducer:nk,selectors:s,actions:a},Gk=(0,g.createReduxStore)(Hk,{reducer:nk,selectors:s,actions:a});(0,g.register)(Gk),Fk(Gk).registerPrivateActions(c),Fk(Gk).registerPrivateSelectors(l);const $k=(0,m.createHigherOrderComponent)((e=>({useSubRegistry:t=!0,...n})=>{const o=(0,g.useRegistry)(),[r]=(0,h.useState)((()=>new WeakMap)),i=function(e,t,n){if(!n)return t;let o=e.get(t);return o||(o=(0,g.createRegistry)({},t),o.registerStore(Hk,Uk),e.set(t,o)),o}(r,o,t);return i===o?(0,d.jsx)(e,{registry:o,...n}):(0,d.jsx)(g.RegistryProvider,{value:i,children:(0,d.jsx)(e,{registry:i,...n})})}),"withRegistryProvider")((e=>{const{children:t,settings:n}=e,{updateSettings:o}=Fk((0,g.useDispatch)(Gk));return(0,h.useEffect)((()=>{o(n)}),[n,o]),(0,d.jsx)(d.Fragment,{children:t})}));var Wk=$k;var Kk=(0,m.createHigherOrderComponent)((e=>({useSubRegistry:t=!0,...n})=>{const o=(0,g.useRegistry)(),[r]=(0,h.useState)((()=>new WeakMap)),i=function(e,t,n){if(!n)return t;let o=e.get(t);return o||(o=(0,g.createRegistry)({},t),o.registerStore(ge,Ii),e.set(t,o)),o}(r,o,t);return i===o?(0,d.jsx)(e,{registry:o,...n}):(0,d.jsx)(g.RegistryProvider,{value:i,children:(0,d.jsx)(e,{registry:i,...n})})}),"withRegistryProvider");const Zk=()=>{};function qk({clientId:e=null,value:t,selection:n,onChange:o=Zk,onInput:r=Zk}){const i=(0,g.useRegistry)(),{resetBlocks:s,resetSelection:l,replaceInnerBlocks:a,setHasControlledInnerBlocks:c,__unstableMarkNextChangeAsNotPersistent:u}=i.dispatch(ji),{getBlockName:d,getBlocks:m,getSelectionStart:f,getSelectionEnd:b}=i.select(ji),k=(0,g.useSelect)((t=>!e||t(ji).areInnerBlocksControlled(e)),[e]),v=(0,h.useRef)({incoming:null,outgoing:[]}),_=(0,h.useRef)(!1),y=()=>{t&&(u(),e?i.batch((()=>{c(e,!0);const n=t.map((e=>(0,p.cloneBlock)(e)));_.current&&(v.current.incoming=n),u(),a(e,n)})):(_.current&&(v.current.incoming=t),s(t)))},x=(0,h.useRef)(r),S=(0,h.useRef)(o);(0,h.useEffect)((()=>{x.current=r,S.current=o}),[r,o]),(0,h.useEffect)((()=>{v.current.outgoing.includes(t)?v.current.outgoing[v.current.outgoing.length-1]===t&&(v.current.outgoing=[]):m(e)!==t&&(v.current.outgoing=[],y(),n&&l(n.selectionStart,n.selectionEnd,n.initialPosition))}),[t,e]);const w=(0,h.useRef)(!1);(0,h.useEffect)((()=>{w.current?k||(v.current.outgoing=[],y()):w.current=!0}),[k]),(0,h.useEffect)((()=>{const{getSelectedBlocksInitialCaretPosition:t,isLastBlockChangePersistent:n,__unstableIsLastBlockChangeIgnored:o,areInnerBlocksControlled:r}=i.select(ji);let s=m(e),l=n(),a=!1;_.current=!0;const c=i.subscribe((()=>{if(null!==e&&null===d(e))return;if(!(!e||r(e)))return;const i=n(),c=m(e),u=c!==s;if(s=c,u&&(v.current.incoming||o()))return v.current.incoming=null,void(l=i);if(u||a&&!u&&i&&!l){l=i,v.current.outgoing.push(s);(l?S.current:x.current)(s,{selection:{selectionStart:f(),selectionEnd:b(),initialPosition:t()}})}a=u}),ji);return()=>{_.current=!1,c()}}),[i,e]),(0,h.useEffect)((()=>()=>{u(),e?(c(e,!1),u(),a(e,[])):s([])}),[])}const Yk=window.wp.keyboardShortcuts;function Xk(){return null}Xk.Register=function(){const{registerShortcut:e}=(0,g.useDispatch)(Yk.store);return(0,h.useEffect)((()=>{e({name:"core/block-editor/copy",category:"block",description:(0,T.__)("Copy the selected block(s)."),keyCombination:{modifier:"primary",character:"c"}}),e({name:"core/block-editor/cut",category:"block",description:(0,T.__)("Cut the selected block(s)."),keyCombination:{modifier:"primary",character:"x"}}),e({name:"core/block-editor/paste",category:"block",description:(0,T.__)("Paste the selected block(s)."),keyCombination:{modifier:"primary",character:"v"}}),e({name:"core/block-editor/duplicate",category:"block",description:(0,T.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,T.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/paste-styles",category:"block",description:(0,T.__)("Paste the copied style to the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"v"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,T.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,T.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,T.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,T.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,T.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/multi-text-selection",category:"selection",description:(0,T.__)("Select text across multiple blocks."),keyCombination:{modifier:"shift",character:"arrow"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,T.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,T.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,T.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}}),e({name:"core/block-editor/collapse-list-view",category:"list-view",description:(0,T.__)("Collapse all other items."),keyCombination:{modifier:"alt",character:"l"}}),e({name:"core/block-editor/group",category:"block",description:(0,T.__)("Create a group block from the selected multiple blocks."),keyCombination:{modifier:"primary",character:"g"}}),e({name:"core/block-editor/toggle-block-visibility",category:"block",description:(0,T.__)("Show or hide the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"h"}})}),[e]),null};var Qk=Xk;var Jk=function(e={}){return(0,h.useMemo)((()=>({mediaUpload:e.mediaUpload,mediaSideload:e.mediaSideload,maxUploadFileSize:e.maxUploadFileSize,allowedMimeTypes:e.allowedMimeTypes})),[e])};const ev=()=>{};function tv(e,{allowedTypes:t,additionalData:n={},filesList:o,onError:r=ev,onFileChange:i,onSuccess:s,onBatchSuccess:l}){e.dispatch(Gk).addItems({files:o,onChange:i,onSuccess:s,onBatchSuccess:l,onError:({message:e})=>r(e),additionalData:n,allowedTypes:t})}const nv=Kk((e=>{const{settings:t,registry:n,stripExperimentalSettings:o=!1}=e,r=Jk(t);let i=t;window.__experimentalMediaProcessing&&t.mediaUpload&&(i=(0,h.useMemo)((()=>({...t,mediaUpload:tv.bind(null,n)})),[t,n]));const{__experimentalUpdateSettings:s}=G((0,g.useDispatch)(ji));(0,h.useEffect)((()=>{s({...i,__internalIsInitialized:!0},{stripExperimentalSettings:o,reset:!0})}),[i,o,s]),qk(e);const l=(0,d.jsxs)(ws.SlotFillProvider,{passthrough:!0,children:[!i?.isPreviewMode&&(0,d.jsx)(Qk.Register,{}),(0,d.jsx)(hh,{children:e.children})]});return window.__experimentalMediaProcessing?(0,d.jsx)(Wk,{settings:r,useSubRegistry:!1,children:l}):l}));var ov=e=>(0,d.jsx)(nv,{...e,stripExperimentalSettings:!0,children:e.children});const rv=(0,h.createContext)({});function iv({value:e,children:t}){const n=(0,h.useContext)(rv),o=(0,h.useMemo)((()=>({...n,...e})),[n,e]);return(0,d.jsx)(rv.Provider,{value:o,children:t})}rv.displayName="BlockContext";var sv=rv;const lv="core/pattern-overrides";function av(e){return!e||0===Object.keys(e).length}function cv(e){return e?.__default?.source===lv}function uv(e,t){if(cv(e)){const n={};for(const o of t){const t=e[o]?e[o]:{source:lv};n[o]=t}return n}return e}function dv(e){const{clientId:t}=C(),n=e||t,{updateBlockAttributes:o}=(0,g.useDispatch)(ji),{getBlockAttributes:r}=(0,g.useRegistry)().select(ji);return{updateBlockBindings:e=>{const{metadata:{bindings:t,...i}={}}=r(n),s={...t};Object.entries(e).forEach((([e,t])=>{t||!s[e]?s[e]=t:delete s[e]}));const l={...i,bindings:s};av(l.bindings)&&delete l.bindings,o(n,{metadata:av(l)?void 0:l})},removeAllBlockBindings:()=>{const{metadata:{bindings:e,...t}={}}=r(n);o(n,{metadata:av(t)?void 0:t})}}}const pv=(0,h.createContext)({});pv.displayName="PrivateBlockContext";const hv={},gv=(0,ws.withFilters)("editor.BlockEdit")((e=>{const{name:t}=e,n=(0,p.getBlockType)(t);if(!n)return null;const o=n.edit||n.save;return(0,d.jsx)(o,{...e})}));var mv=e=>{const{name:t,clientId:n,attributes:o,setAttributes:r}=e,i=(0,g.useRegistry)(),s=(0,p.getBlockType)(t),l=(0,h.useContext)(sv),a=(0,g.useSelect)((e=>G(e(p.store)).getAllBlockBindingsSources()),[]),{bindableAttributes:c}=(0,h.useContext)(pv),{blockBindings:u,context:m,hasPatternOverrides:f}=(0,h.useMemo)((()=>{const e=s?.usesContext?Object.fromEntries(Object.entries(l).filter((([e])=>s.usesContext.includes(e)))):hv;return o?.metadata?.bindings&&Object.values(o?.metadata?.bindings||{}).forEach((t=>{a[t?.source]?.usesContext?.forEach((t=>{e[t]=l[t]}))})),{blockBindings:uv(o?.metadata?.bindings,c),context:e,hasPatternOverrides:cv(o?.metadata?.bindings)}}),[t,s?.usesContext,l,o?.metadata?.bindings,a]),b=(0,g.useSelect)((e=>{if(!u)return o;const t={},r=new Map;for(const[e,t]of Object.entries(u)){const{source:n,args:o}=t,i=a[n];i&&c?.includes(e)&&r.set(i,{...r.get(i),[e]:{args:o}})}if(r.size)for(const[o,i]of r){let r={};o.getValues?r=o.getValues({select:e,context:m,clientId:n,bindings:i}):Object.keys(i).forEach((e=>{r[e]=o.label}));for(const[e,n]of Object.entries(r))"url"!==e||n&&Lc(n)?t[e]=n:t[e]=null}return{...o,...t}}),[o,c,u,n,m,t,a]),k=(0,h.useCallback)((e=>{u?i.batch((()=>{const t={...e},o=new Map;for(const[e,n]of Object.entries(t)){if(!u[e]||!c?.includes(e))continue;const r=u[e],i=a[r?.source];i?.setValues&&(o.set(i,{...o.get(i),[e]:{args:r.args,newValue:n}}),delete t[e])}if(o.size)for(const[e,t]of o)e.setValues({select:i.select,dispatch:i.dispatch,context:m,clientId:n,bindings:t});const s=!!m["pattern/overrides"];f&&s||!Object.keys(t).length||(f&&(delete t.caption,delete t.href),r(t))})):r(e)}),[c,u,n,m,f,r,a,t,i]);if(!s)return null;if(s.apiVersion>1)return(0,d.jsx)(gv,{...e,attributes:b,context:m,setAttributes:k});const v=(0,p.hasBlockSupport)(s,"className",!0)?(0,p.getBlockDefaultClassName)(t):null,_=ms(v,o?.className,e.className);return(0,d.jsx)(gv,{...e,attributes:b,className:_,context:m,setAttributes:k})},fv=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});var bv=function({className:e,actions:t,children:n,secondaryActions:o}){return(0,d.jsx)("div",{style:{display:"contents",all:"initial"},children:(0,d.jsx)("div",{className:ms(e,"block-editor-warning"),children:(0,d.jsxs)("div",{className:"block-editor-warning__contents",children:[(0,d.jsx)("p",{className:"block-editor-warning__message",children:n}),(t?.length>0||o)&&(0,d.jsxs)("div",{className:"block-editor-warning__actions",children:[t?.length>0&&t.map(((e,t)=>(0,d.jsx)("span",{className:"block-editor-warning__action",children:e},t))),o&&(0,d.jsx)(ws.DropdownMenu,{className:"block-editor-warning__secondary",icon:fv,label:(0,T.__)("More options"),popoverProps:{placement:"bottom-end",className:"block-editor-warning__dropdown"},noIcons:!0,children:()=>(0,d.jsx)(ws.MenuGroup,{children:o.map(((e,t)=>(0,d.jsx)(ws.MenuItem,{onClick:e.onClick,children:e.title},t)))})})]})]})})})};function kv({originalBlockClientId:e,name:t,onReplace:n}){const{selectBlock:o}=(0,g.useDispatch)(ji),r=(0,p.getBlockType)(t);return(0,d.jsxs)(bv,{actions:[(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>o(e),children:(0,T.__)("Find original")},"find-original"),(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>n([]),children:(0,T.__)("Remove")},"remove")],children:[(0,d.jsxs)("strong",{children:[r?.title,": "]}),(0,T.__)("This block can only be used once.")]})}function vv({mayDisplayControls:e,mayDisplayParentControls:t,blockEditingMode:n,isPreviewMode:o,...r}){const{name:i,isSelected:s,clientId:l,attributes:a={},__unstableLayoutClassNames:c}=r,{layout:u=null,metadata:g={}}=a,{bindings:m}=g,f=(0,p.hasBlockSupport)(i,"layout",!1)||(0,p.hasBlockSupport)(i,"__experimentalLayout",!1),{originalBlockClientId:x}=(0,h.useContext)(pv);return(0,d.jsxs)(w,{value:(0,h.useMemo)((()=>({name:i,isSelected:s,clientId:l,layout:f?u:null,__unstableLayoutClassNames:c,[b]:e,[k]:t,[v]:n,[_]:m,[y]:o})),[i,s,l,f,u,c,e,t,n,m,o]),children:[(0,d.jsx)(mv,{...r}),x&&(0,d.jsx)(kv,{originalBlockClientId:x,name:i,onReplace:r.onReplace})]})}var _v=n(8021);function yv({title:e,rawContent:t,renderedContent:n,action:o,actionText:r,className:i}){return(0,d.jsxs)("div",{className:i,children:[(0,d.jsxs)("div",{className:"block-editor-block-compare__content",children:[(0,d.jsx)("h2",{className:"block-editor-block-compare__heading",children:e}),(0,d.jsx)("div",{className:"block-editor-block-compare__html",children:t}),(0,d.jsx)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor",children:(0,d.jsx)(h.RawHTML,{children:(0,Ga.safeHTML)(n)})})]}),(0,d.jsx)("div",{className:"block-editor-block-compare__action",children:(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,variant:"secondary",tabIndex:"0",onClick:o,children:r})})]})}var xv=function({block:e,onKeep:t,onConvert:n,convertor:o,convertButtonText:r}){const i=(s=o(e),(Array.isArray(s)?s:[s]).map((e=>(0,p.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var s;const l=(a=e.originalContent,c=i,(0,_v.JJ)(a,c).map(((e,t)=>{const n=ms({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,d.jsx)("span",{className:n,children:e.value},t)})));var a,c;return(0,d.jsxs)("div",{className:"block-editor-block-compare__wrapper",children:[(0,d.jsx)(yv,{title:(0,T.__)("Current"),className:"block-editor-block-compare__current",action:t,actionText:(0,T.__)("Convert to HTML"),rawContent:e.originalContent,renderedContent:e.originalContent}),(0,d.jsx)(yv,{title:(0,T.__)("After Conversion"),className:"block-editor-block-compare__converted",action:n,actionText:r,rawContent:l,renderedContent:i})]})};const Sv=e=>(0,p.rawHandler)({HTML:e.originalContent});function wv({clientId:e}){const{block:t,canInsertHTMLBlock:n,canInsertClassicBlock:o}=(0,g.useSelect)((t=>{const{canInsertBlockType:n,getBlock:o,getBlockRootClientId:r}=t(ji),i=r(e);return{block:o(e),canInsertHTMLBlock:n("core/html",i),canInsertClassicBlock:n("core/freeform",i)}}),[e]),{replaceBlock:r}=(0,g.useDispatch)(ji),[i,s]=(0,h.useState)(!1),l=(0,h.useCallback)((()=>s(!1)),[]),a=(0,h.useMemo)((()=>({toClassic(){const e=(0,p.createBlock)("core/freeform",{content:t.originalContent});return r(t.clientId,e)},toHTML(){const e=(0,p.createBlock)("core/html",{content:t.originalContent});return r(t.clientId,e)},toBlocks(){const e=Sv(t);return r(t.clientId,e)},toRecoveredBlock(){const e=(0,p.createBlock)(t.name,t.attributes,t.innerBlocks);return r(t.clientId,e)}})),[t,r]),c=(0,h.useMemo)((()=>[{title:(0,T._x)("Resolve","imperative verb"),onClick:()=>s(!0)},n&&{title:(0,T.__)("Convert to HTML"),onClick:a.toHTML},o&&{title:(0,T.__)("Convert to Classic Block"),onClick:a.toClassic}].filter(Boolean)),[n,o,a]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(bv,{actions:[(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,onClick:a.toRecoveredBlock,variant:"primary",children:(0,T.__)("Attempt recovery")},"recover")],secondaryActions:c,children:(0,T.__)("Block contains unexpected or invalid content.")}),i&&(0,d.jsx)(ws.Modal,{title:(0,T.__)("Resolve Block"),onRequestClose:l,className:"block-editor-block-compare",children:(0,d.jsx)(xv,{block:t,onKeep:a.toHTML,onConvert:a.toBlocks,convertor:Sv,convertButtonText:(0,T.__)("Convert to Blocks")})})]})}const Cv=(0,d.jsx)(bv,{className:"block-editor-block-list__block-crash-warning",children:(0,T.__)("This block has encountered an error and cannot be previewed.")});var Bv=()=>Cv;class Iv extends h.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var jv=Iv,Ev=n(4132);var Tv=function({clientId:e}){const[t,n]=(0,h.useState)(""),o=(0,g.useSelect)((t=>t(ji).getBlock(e)),[e]),{updateBlock:r}=(0,g.useDispatch)(ji);return(0,h.useEffect)((()=>{n((0,p.getBlockContent)(o))}),[o]),(0,d.jsx)(Ev.A,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:()=>{const i=(0,p.getBlockType)(o.name);if(!i)return;const s=(0,p.getBlockAttributes)(i,t,o.attributes),l=t||(0,p.getSaveContent)(i,s),[a]=t?(0,p.validateBlock)({...o,attributes:s,originalContent:l}):[!0];r(e,{attributes:s,originalContent:l,isValid:a}),t||n(l)},onChange:e=>n(e.target.value)})},Mv=Kv(),Pv=e=>Uv(e,Mv),Rv=Kv();Pv.write=e=>Uv(e,Rv);var Av=Kv();Pv.onStart=e=>Uv(e,Av);var Nv=Kv();Pv.onFrame=e=>Uv(e,Nv);var Lv=Kv();Pv.onFinish=e=>Uv(e,Lv);var Dv=[];Pv.setTimeout=(e,t)=>{let n=Pv.now()+t,o=()=>{let e=Dv.findIndex((e=>e.cancel==o));~e&&Dv.splice(e,1),Fv-=~e?1:0},r={time:n,handler:e,cancel:o};return Dv.splice(Ov(n),0,r),Fv+=1,Gv(),r};var Ov=e=>~(~Dv.findIndex((t=>t.time>e))||~Dv.length);Pv.cancel=e=>{Av.delete(e),Nv.delete(e),Lv.delete(e),Mv.delete(e),Rv.delete(e)},Pv.sync=e=>{Hv=!0,Pv.batchedUpdates(e),Hv=!1},Pv.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,Pv.onStart(n)}return o.handler=e,o.cancel=()=>{Av.delete(n),t=null},o};var zv=typeof window<"u"?window.requestAnimationFrame:()=>{};Pv.use=e=>zv=e,Pv.now=typeof performance<"u"?()=>performance.now():Date.now,Pv.batchedUpdates=e=>e(),Pv.catch=console.error,Pv.frameLoop="always",Pv.advance=()=>{"demand"!==Pv.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Wv()};var Vv=-1,Fv=0,Hv=!1;function Uv(e,t){Hv?(t.delete(e),e(0)):(t.add(e),Gv())}function Gv(){Vv<0&&(Vv=0,"demand"!==Pv.frameLoop&&zv($v))}function $v(){~Vv&&(zv($v),Pv.batchedUpdates(Wv))}function Wv(){let e=Vv;Vv=Pv.now();let t=Ov(Vv);t&&(Zv(Dv.splice(0,t),(e=>e.handler())),Fv-=t),Fv?(Av.flush(),Mv.flush(e?Math.min(64,Vv-e):16.667),Nv.flush(),Rv.flush(),Lv.flush()):Vv=-1}function Kv(){let e=new Set,t=e;return{add(n){Fv+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Fv-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Fv-=t.size,Zv(t,(t=>t(n)&&e.add(t))),Fv+=e.size,t=e)}}}function Zv(e,t){e.forEach((e=>{try{t(e)}catch(e){Pv.catch(e)}}))}var qv=Object.defineProperty,Yv={};function Xv(){}((e,t)=>{for(var n in t)qv(e,n,{get:t[n],enumerable:!0})})(Yv,{assign:()=>d_,colors:()=>a_,createStringInterpolator:()=>r_,skipAnimation:()=>c_,to:()=>i_,willAdvance:()=>u_});var Qv={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function Jv(e,t){if(Qv.arr(e)){if(!Qv.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var e_=(e,t)=>e.forEach(t);function t_(e,t,n){if(Qv.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(let o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}var n_=e=>Qv.und(e)?[]:Qv.arr(e)?e:[e];function o_(e,t){if(e.size){let n=Array.from(e);e.clear(),e_(n,t)}}var r_,i_,s_=(e,...t)=>o_(e,(e=>e(...t))),l_=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),a_=null,c_=!1,u_=Xv,d_=e=>{e.to&&(i_=e.to),e.now&&(Pv.now=e.now),void 0!==e.colors&&(a_=e.colors),null!=e.skipAnimation&&(c_=e.skipAnimation),e.createStringInterpolator&&(r_=e.createStringInterpolator),e.requestAnimationFrame&&Pv.use(e.requestAnimationFrame),e.batchedUpdates&&(Pv.batchedUpdates=e.batchedUpdates),e.willAdvance&&(u_=e.willAdvance),e.frameLoop&&(Pv.frameLoop=e.frameLoop)},p_=new Set,h_=[],g_=[],m_=0,f_={get idle(){return!p_.size&&!h_.length},start(e){m_>e.priority?(p_.add(e),Pv.onStart(b_)):(k_(e),Pv(__))},advance:__,sort(e){if(m_)Pv.onFrame((()=>f_.sort(e)));else{let t=h_.indexOf(e);~t&&(h_.splice(t,1),v_(e))}},clear(){h_=[],p_.clear()}};function b_(){p_.forEach(k_),p_.clear(),Pv(__)}function k_(e){h_.includes(e)||v_(e)}function v_(e){h_.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(h_,(t=>t.priority>e.priority)),0,e)}function __(e){let t=g_;for(let n=0;n<h_.length;n++){let o=h_[n];m_=o.priority,o.idle||(u_(o),o.advance(e),o.idle||t.push(o))}return m_=0,(g_=h_).length=0,(h_=t).length>0}var y_="[-+]?\\d*\\.?\\d+",x_=y_+"%";function S_(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var w_=new RegExp("rgb"+S_(y_,y_,y_)),C_=new RegExp("rgba"+S_(y_,y_,y_,y_)),B_=new RegExp("hsl"+S_(y_,x_,x_)),I_=new RegExp("hsla"+S_(y_,x_,x_,y_)),j_=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,E_=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,T_=/^#([0-9a-fA-F]{6})$/,M_=/^#([0-9a-fA-F]{8})$/;function P_(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function R_(e,t,n){let o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,i=P_(r,o,e+1/3),s=P_(r,o,e),l=P_(r,o,e-1/3);return Math.round(255*i)<<24|Math.round(255*s)<<16|Math.round(255*l)<<8}function A_(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function N_(e){return(parseFloat(e)%360+360)%360/360}function L_(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function D_(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function O_(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=T_.exec(e))?parseInt(t[1]+"ff",16)>>>0:a_&&void 0!==a_[e]?a_[e]:(t=w_.exec(e))?(A_(t[1])<<24|A_(t[2])<<16|A_(t[3])<<8|255)>>>0:(t=C_.exec(e))?(A_(t[1])<<24|A_(t[2])<<16|A_(t[3])<<8|L_(t[4]))>>>0:(t=j_.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=M_.exec(e))?parseInt(t[1],16)>>>0:(t=E_.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=B_.exec(e))?(255|R_(N_(t[1]),D_(t[2]),D_(t[3])))>>>0:(t=I_.exec(e))?(R_(N_(t[1]),D_(t[2]),D_(t[3]))|L_(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}var z_=(e,t,n)=>{if(Qv.fun(e))return e;if(Qv.arr(e))return z_({range:e,output:t,extrapolate:n});if(Qv.str(e.output[0]))return r_(e);let o=e,r=o.output,i=o.range||[0,1],s=o.extrapolateLeft||o.extrapolate||"extend",l=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{let t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,i);return function(e,t,n,o,r,i,s,l,a){let c=a?a(e):e;if(c<t){if("identity"===s)return c;"clamp"===s&&(c=t)}if(c>n){if("identity"===l)return c;"clamp"===l&&(c=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=i(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,i[t],i[t+1],r[t],r[t+1],a,s,l,o.map)}};var V_=1.70158,F_=1.525*V_,H_=V_+1,U_=2*Math.PI/3,G_=2*Math.PI/4.5,$_=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,W_={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>H_*e*e*e-V_*e*e,easeOutBack:e=>1+H_*Math.pow(e-1,3)+V_*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*(F_+1)*e-F_)/2:(Math.pow(2*e-2,2)*((F_+1)*(2*e-2)+F_)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*U_),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*U_)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*G_)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*G_)/2+1,easeInBounce:e=>1-$_(1-e),easeOutBounce:$_,easeInOutBounce:e=>e<.5?(1-$_(1-2*e))/2:(1+$_(2*e-1))/2,steps:(e,t="end")=>n=>{let o=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,e),t))(0,1,("end"===t?Math.floor(o):Math.ceil(o))/e)}},K_=Symbol.for("FluidValue.get"),Z_=Symbol.for("FluidValue.observers"),q_=e=>Boolean(e&&e[K_]),Y_=e=>e&&e[K_]?e[K_]():e,X_=e=>e[Z_]||null;function Q_(e,t){let n=e[Z_];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var J_=class{[K_];[Z_];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");ey(this,e)}},ey=(e,t)=>ry(e,K_,t);function ty(e,t){if(e[K_]){let n=e[Z_];n||ry(e,Z_,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function ny(e,t){let n=e[Z_];if(n&&n.has(t)){let o=n.size-1;o?n.delete(t):e[Z_]=null,e.observerRemoved&&e.observerRemoved(o,t)}}var oy,ry=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),iy=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,sy=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ly=new RegExp(`(${iy.source})(%|[a-z]+)`,"i"),ay=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,cy=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,uy=e=>{let[t,n]=dy(e);if(!t||l_())return e;let o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&cy.test(n)?uy(n):n||e},dy=e=>{let t=cy.exec(e);if(!t)return[,];let[,n,o]=t;return[n,o]},py=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,hy=e=>{oy||(oy=a_?new RegExp(`(${Object.keys(a_).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>Y_(e).replace(cy,uy).replace(sy,O_).replace(oy,O_))),n=t.map((e=>e.match(iy).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>z_({...e,output:t})));return e=>{let n=!ly.test(t[0])&&t.find((e=>ly.test(e)))?.replace(iy,""),r=0;return t[0].replace(iy,(()=>`${o[r++](e)}${n||""}`)).replace(ay,py)}},gy="react-spring: ",my=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${gy}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},fy=my(console.warn);my(console.warn);function by(e){return Qv.str(e)&&("#"==e[0]||/\d/.test(e)||!l_()&&cy.test(e)||e in(a_||{}))}new WeakMap;new Set,new WeakMap,new WeakMap,new WeakMap;var ky=l_()?ic.useEffect:ic.useLayoutEffect;function vy(){let e=(0,ic.useState)()[1],t=(()=>{let e=(0,ic.useRef)(!1);return ky((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}var _y=[];var yy=Symbol.for("Animated:node"),xy=e=>e&&e[yy],Sy=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,yy,t),wy=e=>e&&e[yy]&&e[yy].getPayload(),Cy=class{payload;constructor(){Sy(this,this)}getPayload(){return this.payload||[]}},By=class extends Cy{constructor(e){super(),this._value=e,Qv.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new By(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Qv.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,Qv.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Iy=class extends By{_string=null;_toString;constructor(e){super(0),this._toString=z_({output:[e,e]})}static create(e){return new Iy(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(Qv.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=z_({output:[this.getValue(),e]})),this._value=0,super.reset()}},jy={dependencies:null},Ey=class extends Cy{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return t_(this.source,((n,o)=>{(e=>!!e&&e[yy]===e)(n)?t[o]=n.getValue(e):q_(n)?t[o]=Y_(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&e_(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return t_(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){jy.dependencies&&q_(e)&&jy.dependencies.add(e);let t=wy(e);t&&e_(t,(e=>this.add(e)))}},Ty=class extends Ey{constructor(e){super(e)}static create(e){return new Ty(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(My)),!0)}};function My(e){return(by(e)?Iy:By).create(e)}function Py(e){let t=xy(e);return t?t.constructor:Qv.arr(e)?Ty:by(e)?Iy:By}var Ry=(e,t)=>{let n=!Qv.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,ic.forwardRef)(((o,r)=>{let i=(0,ic.useRef)(null),s=n&&(0,ic.useCallback)((e=>{i.current=function(e,t){return e&&(Qv.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[l,a]=function(e,t){let n=new Set;return jy.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Ey(e),jy.dependencies=null,[e,n]}(o,t),c=vy(),u=()=>{let e=i.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,l.getValue(!0)))&&c()},d=new Ay(u,a),p=(0,ic.useRef)();ky((()=>(p.current=d,e_(a,(e=>ty(e,d))),()=>{p.current&&(e_(p.current.deps,(e=>ny(e,p.current))),Pv.cancel(p.current.update))}))),(0,ic.useEffect)(u,[]),(e=>{(0,ic.useEffect)(e,_y)})((()=>()=>{let e=p.current;e_(e.deps,(t=>ny(t,e)))}));let h=t.getComponentProps(l.getValue());return ic.createElement(e,{...h,ref:s})}))},Ay=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Pv.write(this.update)}};var Ny=Symbol.for("AnimatedComponent"),Ly=e=>Qv.str(e)?e:e&&Qv.str(e.displayName)?e.displayName:Qv.fun(e)&&e.name||null;function Dy(e,...t){return Qv.fun(e)?e(...t):e}var Oy=(e,t)=>!0===e||!!(t&&e&&(Qv.fun(e)?e(t):n_(e).includes(t))),zy=(e,t)=>Qv.obj(e)?t&&e[t]:e,Vy=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Fy=e=>e,Hy=(e,t=Fy)=>{let n=Uy;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let o={};for(let r of n){let n=t(e[r],r);Qv.und(n)||(o[r]=n)}return o},Uy=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Gy={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function $y(e){let t=function(e){let t={},n=0;if(t_(e,((e,o)=>{Gy[o]||(t[o]=e,n++)})),n)return t}(e);if(t){let n={to:t};return t_(e,((e,o)=>o in t||(n[o]=e))),n}return{...e}}function Wy(e){return e=Y_(e),Qv.arr(e)?e.map(Wy):by(e)?Yv.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Ky(e){return Qv.fun(e)||Qv.arr(e)&&Qv.obj(e[0])}var Zy={tension:170,friction:26,mass:1,damping:1,easing:W_.linear,clamp:!1},qy=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,Zy)}};function Yy(e,t){if(Qv.und(t.decay)){let n=!Qv.und(t.tension)||!Qv.und(t.friction);(n||!Qv.und(t.frequency)||!Qv.und(t.damping)||!Qv.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var Xy=[],Qy=class{changed=!1;values=Xy;toValues=null;fromValues=Xy;to;from;config=new qy;immediate=!1};function Jy(e,{key:t,props:n,defaultProps:o,state:r,actions:i}){return new Promise(((s,l)=>{let a,c,u=Oy(n.cancel??o?.cancel,t);if(u)h();else{Qv.und(n.pause)||(r.paused=Oy(n.pause,t));let e=o?.pause;!0!==e&&(e=r.paused||Oy(e,t)),a=Dy(n.delay||0,t),e?(r.resumeQueue.add(p),i.pause()):(i.resume(),p())}function d(){r.resumeQueue.add(p),r.timeouts.delete(c),c.cancel(),a=c.time-Pv.now()}function p(){a>0&&!Yv.skipAnimation?(r.delayed=!0,c=Pv.setTimeout(h,a),r.pauseQueue.add(d),r.timeouts.add(c)):h()}function h(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(d),r.timeouts.delete(c),e<=(r.cancelId||0)&&(u=!0);try{i.start({...n,callId:e,cancel:u},s)}catch(e){l(e)}}}))}var ex=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?ox(e.get()):t.every((e=>e.noop))?tx(e.get()):nx(e.get(),t.every((e=>e.finished))),tx=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),nx=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),ox=e=>({value:e,cancelled:!0,finished:!1});function rx(e,t,n,o){let{callId:r,parentId:i,onRest:s}=t,{asyncTo:l,promise:a}=n;return i||e!==l||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;let c,u,d,p=Hy(t,((e,t)=>"onRest"===t?void 0:e)),h=new Promise(((e,t)=>(c=e,u=t))),g=e=>{let t=r<=(n.cancelId||0)&&ox(o)||r!==n.asyncId&&nx(o,!1);if(t)throw e.result=t,u(e),e},m=(e,t)=>{let i=new sx,s=new lx;return(async()=>{if(Yv.skipAnimation)throw ix(n),s.result=nx(o,!1),u(s),s;g(i);let l=Qv.obj(e)?{...e}:{...t,to:e};l.parentId=r,t_(p,((e,t)=>{Qv.und(l[t])&&(l[t]=e)}));let a=await o.start(l);return g(i),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};if(Yv.skipAnimation)return ix(n),nx(o,!1);try{let t;t=Qv.arr(e)?(async e=>{for(let t of e)await m(t)})(e):Promise.resolve(e(m,o.stop.bind(o))),await Promise.all([t.then(c),h]),d=nx(o.get(),!0,!1)}catch(e){if(e instanceof sx)d=e.result;else{if(!(e instanceof lx))throw e;d=e.result}}finally{r==n.asyncId&&(n.asyncId=i,n.asyncTo=i?l:void 0,n.promise=i?a:void 0)}return Qv.fun(s)&&Pv.batchedUpdates((()=>{s(d,o,o.item)})),d})():a}function ix(e,t){o_(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var sx=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},lx=class extends Error{result;constructor(){super("SkipAnimationSignal")}},ax=e=>e instanceof ux,cx=1,ux=class extends J_{id=cx++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=xy(this);return e&&e.getValue()}to(...e){return Yv.to(this,e)}interpolate(...e){return fy(`${gy}The "interpolate" function is deprecated in v9 (use "to" instead)`),Yv.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Q_(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||f_.sort(this),Q_(this,{type:"priority",parent:this,priority:e})}},dx=Symbol.for("SpringPhase"),px=e=>(1&e[dx])>0,hx=e=>(2&e[dx])>0,gx=e=>(4&e[dx])>0,mx=(e,t)=>t?e[dx]|=3:e[dx]&=-3,fx=(e,t)=>t?e[dx]|=4:e[dx]&=-5,bx=class extends ux{key;animation=new Qy;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,t){if(super(),!Qv.und(e)||!Qv.und(t)){let n=Qv.obj(e)?{...e}:{...t,from:e};Qv.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(hx(this)||this._state.asyncTo)||gx(this)}get goal(){return Y_(this.animation.to)}get velocity(){let e=xy(this);return e instanceof By?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return px(this)}get isAnimating(){return hx(this)}get isPaused(){return gx(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,o=this.animation,{config:r,toValues:i}=o,s=wy(o.to);!s&&q_(o.to)&&(i=n_(Y_(o.to))),o.values.forEach(((l,a)=>{if(l.done)return;let c=l.constructor==Iy?1:s?s[a].lastPosition:i[a],u=o.immediate,d=c;if(!u){if(d=l.lastPosition,r.tension<=0)return void(l.done=!0);let t,n=l.elapsedTime+=e,i=o.fromValues[a],s=null!=l.v0?l.v0:l.v0=Qv.arr(r.velocity)?r.velocity[a]:r.velocity,p=r.precision||(i==c?.005:Math.min(1,.001*Math.abs(c-i)));if(Qv.und(r.duration))if(r.decay){let e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*n);d=i+s/(1-e)*(1-o),u=Math.abs(l.lastPosition-d)<=p,t=s*o}else{t=null==l.lastVelocity?s:l.lastVelocity;let n,o=r.restVelocity||p/10,a=r.clamp?0:r.bounce,h=!Qv.und(a),g=i==c?l.v0>0:i<c,m=!1,f=1,b=Math.ceil(e/f);for(let e=0;e<b&&(n=Math.abs(t)>o,n||(u=Math.abs(c-d)<=p,!u));++e){h&&(m=d==c||d>c==g,m&&(t=-t*a,d=c)),t+=(1e-6*-r.tension*(d-c)+.001*-r.friction*t)/r.mass*f,d+=t*f}}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,l.durationProgress>0&&(l.elapsedTime=r.duration*l.durationProgress,n=l.elapsedTime+=e)),o=(r.progress||0)+n/this._memoizedDuration,o=o>1?1:o<0?0:o,l.durationProgress=o),d=i+r.easing(o)*(c-i),t=(d-l.lastPosition)/e,u=1==o}l.lastVelocity=t,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}s&&!s[a].done&&(u=!1),u?l.done=!0:t=!1,l.setValue(d,r.round)&&(n=!0)}));let l=xy(this),a=l.getValue();if(t){let e=Y_(o.to);a===e&&!n||r.decay?n&&r.decay&&this._onChange(a):(l.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return Pv.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(hx(this)){let{to:e,config:t}=this.animation;Pv.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Qv.und(e)?(n=this.queue||[],this.queue=[]):n=[Qv.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>ex(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),ix(this._state,e&&this._lastCallId),Pv.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||"",{to:n,from:o}=e;n=Qv.obj(n)?n[t]:n,(null==n||Ky(n))&&(n=void 0),o=Qv.obj(o)?o[t]:o,null==o&&(o=void 0);let r={to:n,from:o};return px(this)||(e.reverse&&([n,o]=[o,n]),o=Y_(o),Qv.und(o)?xy(this)||this._set(n):this._set(o)),r}_update({...e},t){let{key:n,defaultProps:o}=this;e.default&&Object.assign(o,Hy(e,((e,t)=>/^on/.test(t)?zy(e,n):e))),Sx(this,e,"onProps"),wx(this,"onProps",e,this);let r=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let i=this._state;return Jy(++this._lastCallId,{key:n,props:e,defaultProps:o,state:i,actions:{pause:()=>{gx(this)||(fx(this,!0),s_(i.pauseQueue),wx(this,"onPause",nx(this,kx(this,this.animation.to)),this))},resume:()=>{gx(this)&&(fx(this,!1),hx(this)&&this._resume(),s_(i.resumeQueue),wx(this,"onResume",nx(this,kx(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=vx(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(ox(this));let o=!Qv.und(e.to),r=!Qv.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(ox(this));this._lastToId=t.callId}let{key:i,defaultProps:s,animation:l}=this,{to:a,from:c}=l,{to:u=a,from:d=c}=e;r&&!o&&(!t.default||Qv.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let p=!Jv(d,c);p&&(l.from=d),d=Y_(d);let h=!Jv(u,a);h&&this._focus(u);let g=Ky(t.to),{config:m}=l,{decay:f,velocity:b}=m;(o||r)&&(m.velocity=0),t.config&&!g&&function(e,t,n){n&&(Yy(n={...n},t),t={...n,...t}),Yy(e,t),Object.assign(e,t);for(let t in Zy)null==e[t]&&(e[t]=Zy[t]);let{mass:o,frequency:r,damping:i}=e;Qv.und(r)||(r<.01&&(r=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*i*o/r)}(m,Dy(t.config,i),t.config!==s.config?Dy(s.config,i):void 0);let k=xy(this);if(!k||Qv.und(u))return n(nx(this,!0));let v=Qv.und(t.reset)?r&&!t.default:!Qv.und(d)&&Oy(t.reset,i),_=v?d:this.get(),y=Wy(u),x=Qv.num(y)||Qv.arr(y)||by(y),S=!g&&(!x||Oy(s.immediate||t.immediate,i));if(h){let e=Py(u);if(e!==k.constructor){if(!S)throw Error(`Cannot animate between ${k.constructor.name} and ${e.name}, as the "to" prop suggests`);k=this._set(y)}}let w=k.constructor,C=q_(u),B=!1;if(!C){let e=v||!px(this)&&p;(h||e)&&(B=Jv(Wy(_),y),C=!B),(!Jv(l.immediate,S)&&!S||!Jv(m.decay,f)||!Jv(m.velocity,b))&&(C=!0)}if(B&&hx(this)&&(l.changed&&!v?C=!0:C||this._stop(a)),!g&&((C||q_(a))&&(l.values=k.getPayload(),l.toValues=q_(u)?null:w==Iy?[1]:n_(y)),l.immediate!=S&&(l.immediate=S,!S&&!v&&this._set(a)),C)){let{onRest:e}=l;e_(xx,(e=>Sx(this,t,e)));let o=nx(this,kx(this,a));s_(this._pendingCalls,o),this._pendingCalls.add(n),l.changed&&Pv.batchedUpdates((()=>{l.changed=!v,e?.(o,this),v?Dy(s.onRest,o):l.onStart?.(o,this)}))}v&&this._set(_),g?n(rx(t.to,t,this._state,this)):C?this._start():hx(this)&&!h?this._pendingCalls.add(n):n(tx(_))}_focus(e){let t=this.animation;e!==t.to&&(X_(this)&&this._detach(),t.to=e,X_(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;q_(t)&&(ty(t,this),ax(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;q_(e)&&ny(e,this)}_set(e,t=!0){let n=Y_(e);if(!Qv.und(n)){let e=xy(this);if(!e||!Jv(n,e.getValue())){let o=Py(n);e&&e.constructor==o?e.setValue(n):Sy(this,o.create(n)),e&&Pv.batchedUpdates((()=>{this._onChange(n,t)}))}}return xy(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,wx(this,"onStart",nx(this,kx(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Dy(this.animation.onChange,e,this)),Dy(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;xy(this).reset(Y_(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),hx(this)||(mx(this,!0),gx(this)||this._resume())}_resume(){Yv.skipAnimation?this.finish():f_.start(this)}_stop(e,t){if(hx(this)){mx(this,!1);let n=this.animation;e_(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Q_(this,{type:"idle",parent:this});let o=t?ox(this.get()):nx(this.get(),kx(this,e??n.to));s_(this._pendingCalls,o),n.changed&&(n.changed=!1,wx(this,"onRest",o,this))}}};function kx(e,t){let n=Wy(t);return Jv(Wy(e.get()),n)}function vx(e,t=e.loop,n=e.to){let o=Dy(t);if(o){let r=!0!==o&&$y(o),i=(r||e).reverse,s=!r||r.reset;return _x({...e,loop:t,default:!1,pause:void 0,to:!i||Ky(n)?n:void 0,from:s?e.from:void 0,reset:s,...r})}}function _x(e){let{to:t,from:n}=e=$y(e),o=new Set;return Qv.obj(t)&&yx(t,o),Qv.obj(n)&&yx(n,o),e.keys=o.size?Array.from(o):null,e}function yx(e,t){t_(e,((e,n)=>null!=e&&t.add(n)))}var xx=["onStart","onRest","onChange","onPause","onResume"];function Sx(e,t,n){e.animation[n]=t[n]!==Vy(t,n)?zy(t[n],e.key):void 0}function wx(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var Cx=["onStart","onChange","onRest"],Bx=1,Ix=class{id=Bx++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,t){this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(let t in e){let n=e[t];Qv.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(_x(e)),this}start(e){let{queue:t}=this;return e?t=n_(e).map(_x):this.queue=[],this._flush?this._flush(this,t):(Px(this,t),jx(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;e_(n_(t),(t=>n[t].stop(!!e)))}else ix(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Qv.und(e))this.start({pause:!0});else{let t=this.springs;e_(n_(e),(e=>t[e].pause()))}return this}resume(e){if(Qv.und(e))this.start({pause:!1});else{let t=this.springs;e_(n_(e),(e=>t[e].resume()))}return this}each(e){t_(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,o_(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let i=!o&&this._started,s=r||i&&n.size?this.get():null;r&&t.size&&o_(t,(([e,t])=>{t.value=s,e(t,this,this._item)})),i&&(this._started=!1,o_(n,(([e,t])=>{t.value=s,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}Pv.onFrame(this._onFrame)}};function jx(e,t){return Promise.all(t.map((t=>Ex(e,t)))).then((t=>ex(e,t)))}async function Ex(e,t,n){let{keys:o,to:r,from:i,loop:s,onRest:l,onResolve:a}=t,c=Qv.obj(t.default)&&t.default;s&&(t.loop=!1),!1===r&&(t.to=null),!1===i&&(t.from=null);let u=Qv.arr(r)||Qv.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):e_(Cx,(n=>{let o=t[n];if(Qv.fun(o)){let r=e._events[n];t[n]=({finished:e,cancelled:t})=>{let n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));let d=e._state;t.pause===!d.paused?(d.paused=t.pause,s_(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),h=!0===t.cancel||!0===Vy(t,"cancel");(u||h&&d.asyncId)&&p.push(Jy(++e._lastAsyncId,{props:t,state:d,actions:{pause:Xv,resume:Xv,start(t,n){h?(ix(d,e._lastAsyncId),n(ox(e))):(t.onRest=l,n(rx(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let g=ex(e,await Promise.all(p));if(s&&g.finished&&(!n||!g.noop)){let n=vx(t,s,r);if(n)return Px(e,[n]),Ex(e,n,!0)}return a&&Pv.batchedUpdates((()=>a(g,e,e.item))),g}function Tx(e,t){let n=new bx;return n.key=e,t&&ty(n,t),n}function Mx(e,t,n){t.keys&&e_(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Px(e,t){e_(t,(t=>{Mx(e.springs,t,(t=>Tx(t,e)))}))}var Rx=({children:e,...t})=>{let n=(0,ic.useContext)(Ax),o=t.pause||!!n.pause,r=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,ic.useState)((()=>({inputs:t,result:e()}))),o=(0,ic.useRef)(),r=o.current,i=r;return i?Boolean(t&&i.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,i.inputs))||(i={inputs:t,result:e()}):i=n,(0,ic.useEffect)((()=>{o.current=i,r==n&&(n.inputs=n.result=void 0)}),[i]),i.result}((()=>({pause:o,immediate:r})),[o,r]);let{Provider:i}=Ax;return ic.createElement(i,{value:t},e)},Ax=function(e,t){return Object.assign(e,ic.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}(Rx,{});Rx.Provider=Ax.Provider,Rx.Consumer=Ax.Consumer;var Nx=class extends ux{constructor(e,t){super(),this.source=e,this.calc=z_(...t);let n=this._get(),o=Py(n);Sy(this,o.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();Jv(t,this.get())||(xy(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Dx(this._active)&&Ox(this)}_get(){let e=Qv.arr(this.source)?this.source.map(Y_):n_(Y_(this.source));return this.calc(...e)}_start(){this.idle&&!Dx(this._active)&&(this.idle=!1,e_(wy(this),(e=>{e.done=!1})),Yv.skipAnimation?(Pv.batchedUpdates((()=>this.advance())),Ox(this)):f_.start(this))}_attach(){let e=1;e_(n_(this.source),(t=>{q_(t)&&ty(t,this),ax(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){e_(n_(this.source),(e=>{q_(e)&&ny(e,this)})),this._active.clear(),Ox(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=n_(this.source).reduce(((e,t)=>Math.max(e,(ax(t)?t.priority:0)+1)),0))}};function Lx(e){return!1!==e.idle}function Dx(e){return!e.size||Array.from(e).every(Lx)}function Ox(e){e.idle||(e.idle=!0,e_(wy(e),(e=>{e.done=!0})),Q_(e,{type:"idle",parent:e}))}Yv.assign({createStringInterpolator:hy,to:(e,t)=>new Nx(e,t)});f_.advance;const zx=window.ReactDOM;var Vx=/^--/;function Fx(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Vx.test(e)||Ux.hasOwnProperty(e)&&Ux[e]?(""+t).trim():t+"px"}var Hx={};var Ux={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Gx=["Webkit","Ms","Moz","O"];Ux=Object.keys(Ux).reduce(((e,t)=>(Gx.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Ux);var $x=/^(matrix|translate|scale|rotate|skew)/,Wx=/^(translate)/,Kx=/^(rotate|skew)/,Zx=(e,t)=>Qv.num(e)&&0!==e?e+t:e,qx=(e,t)=>Qv.arr(e)?e.every((e=>qx(e,t))):Qv.num(e)?e===t:parseFloat(e)===t,Yx=class extends Ey{constructor({x:e,y:t,z:n,...o}){let r=[],i=[];(e||t||n)&&(r.push([e||0,t||0,n||0]),i.push((e=>[`translate3d(${e.map((e=>Zx(e,"px"))).join(",")})`,qx(e,0)]))),t_(o,((e,t)=>{if("transform"===t)r.push([e||""]),i.push((e=>[e,""===e]));else if($x.test(t)){if(delete o[t],Qv.und(e))return;let n=Wx.test(t)?"px":Kx.test(t)?"deg":"";r.push(n_(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Zx(r,n)})`,qx(r,0)]:e=>[`${t}(${e.map((e=>Zx(e,n))).join(",")})`,qx(e,t.startsWith("scale")?1:0)])}})),r.length&&(o.transform=new Xx(r,i)),super(o)}},Xx=class extends J_{constructor(e,t){super(),this.inputs=e,this.transforms=t}_value=null;get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return e_(this.inputs,((n,o)=>{let r=Y_(n[0]),[i,s]=this.transforms[o](Qv.arr(r)?r:n.map(Y_));e+=" "+i,t=t&&s})),t?"none":e}observerAdded(e){1==e&&e_(this.inputs,(e=>e_(e,(e=>q_(e)&&ty(e,this)))))}observerRemoved(e){0==e&&e_(this.inputs,(e=>e_(e,(e=>q_(e)&&ny(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Q_(this,e)}};Yv.assign({batchedUpdates:zx.unstable_batchedUpdates,createStringInterpolator:hy,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});var Qx=((e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=e=>new Ey(e),getComponentProps:o=e=>e}={})=>{let r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},i=e=>{let t=Ly(e)||"Anonymous";return(e=Qv.str(e)?i[e]||(i[e]=Ry(e,r)):e[Ny]||(e[Ny]=Ry(e,r))).displayName=`Animated(${t})`,e};return t_(e,((t,n)=>{Qv.arr(e)&&(n=Ly(t)),i[n]=i(t)})),{animated:i}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;let n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:o,children:r,scrollTop:i,scrollLeft:s,viewBox:l,...a}=t,c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:Hx[t]||(Hx[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==r&&(e.textContent=r);for(let t in o)if(o.hasOwnProperty(t)){let n=Fx(t,o[t]);Vx.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s),void 0!==l&&e.setAttribute("viewBox",l)},createAnimatedStyle:e=>new Yx(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),Jx=Qx.animated;function eS(e){return{top:e.offsetTop,left:e.offsetLeft}}var tS=function({triggerAnimationOnChange:e,clientId:t}){const n=(0,h.useRef)(),{isTyping:o,getGlobalBlockCount:r,isBlockSelected:i,isFirstMultiSelectedBlock:s,isBlockMultiSelected:l,isAncestorMultiSelected:a,isDraggingBlocks:c}=(0,g.useSelect)(ji),{previous:u,prevRect:d}=(0,h.useMemo)((()=>({previous:n.current&&eS(n.current),prevRect:n.current&&n.current.getBoundingClientRect()})),[e]);return(0,h.useLayoutEffect)((()=>{if(!u||!n.current)return;const e=(0,Ga.getScrollContainer)(n.current),p=i(t),h=p||s(t),g=c();function m(){if(!g&&h&&d){const t=n.current.getBoundingClientRect().top-d.top;t&&(e.scrollTop+=t)}}if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||o()||r()>200)return void m();const f=p||l(t)||a(t);if(f&&g)return;const b=f?"1":"",k=new Ix({x:0,y:0,config:{mass:5,tension:2e3,friction:200},onChange({value:e}){if(!n.current)return;let{x:t,y:o}=e;t=Math.round(t),o=Math.round(o);const r=0===t&&0===o;n.current.style.transformOrigin="center center",n.current.style.transform=r?null:`translate3d(${t}px,${o}px,0)`,n.current.style.zIndex=b,m()}});n.current.style.transform=void 0;const v=eS(n.current),_=Math.round(u.left-v.left),y=Math.round(u.top-v.top);return k.start({x:0,y:0,from:{x:_,y}}),()=>{k.stop(),k.set({x:0,y:0})}}),[u,d,t,o,r,i,s,l,a,c]),n};function nS({clientId:e,initialPosition:t}){const n=(0,h.useRef)(),{isBlockSelected:o,isMultiSelecting:r,isZoomOut:i}=G((0,g.useSelect)(ji));return(0,h.useEffect)((()=>{if(!o(e)||r()||i())return;if(null==t)return;if(!n.current)return;const{ownerDocument:s}=n.current;if(Wm(n.current,s.activeElement))return;const l=Ga.focus.tabbable.find(n.current).filter((e=>(0,Ga.isTextField)(e))),a=-1===t,c=l[a?l.length-1:0]||n.current;if(Wm(n.current,c)){if(!n.current.getAttribute("contenteditable")){const e=Ga.focus.tabbable.findNext(n.current);if(e&&Wm(n.current,e)&&(0,Ga.isFormElement)(e))return void e.focus()}(0,Ga.placeCaretAtHorizontalEdge)(c,a)}else n.current.focus()}),[t,e]),n}function oS(e){e.defaultPrevented||(e.preventDefault(),e.currentTarget.classList.toggle("is-hovered","mouseover"===e.type))}function rS(e){const{isBlockSelected:t}=(0,g.useSelect)(ji),{selectBlock:n,selectionChange:o}=(0,g.useDispatch)(ji);return(0,m.useRefEffect)((r=>{function i(i){r.parentElement.closest('[contenteditable="true"]')||(t(e)?i.target.isContentEditable||o(e):Wm(r,i.target)&&n(e))}return r.addEventListener("focusin",i),()=>{r.removeEventListener("focusin",i)}}),[t,n])}function iS(e){return!e||"transparent"===e||"rgba(0, 0, 0, 0)"===e}function sS({clientId:e,isSelected:t}){const{getBlockRootClientId:n,isZoomOut:o,hasMultiSelection:r}=G((0,g.useSelect)(ji)),{insertAfterBlock:i,removeBlock:s,resetZoomLevel:l,startDraggingBlocks:a,stopDraggingBlocks:c}=G((0,g.useDispatch)(ji));return(0,m.useRefEffect)((u=>{if(t)return u.addEventListener("keydown",d),u.addEventListener("dragstart",p),()=>{u.removeEventListener("keydown",d),u.removeEventListener("dragstart",p)};function d(t){const{keyCode:n,target:r}=t;n!==Wa.ENTER&&n!==Wa.BACKSPACE&&n!==Wa.DELETE||r!==u||(0,Ga.isTextField)(r)||(t.preventDefault(),n===Wa.ENTER&&o()?l():n===Wa.ENTER?i(e):s(e))}function p(t){if(u!==t.target||u.isContentEditable||u.ownerDocument.activeElement!==u||r())return void t.preventDefault();const o=JSON.stringify({type:"block",srcClientIds:[e],srcRootClientId:n(e)});t.dataTransfer.effectAllowed="move",t.dataTransfer.clearData(),t.dataTransfer.setData("wp-blocks",o);const{ownerDocument:i}=u,{defaultView:s}=i;s.getSelection().removeAllRanges();const l=i.createElement("div");l.style.width="1px",l.style.height="1px",l.style.position="fixed",l.style.visibility="hidden",i.body.appendChild(l),t.dataTransfer.setDragImage(l,0,0);const d=u.getBoundingClientRect(),p=u.cloneNode(!0);p.style.visibility="hidden",p.style.display="none";const h=u.id;u.id=null;let g=1;{let e=u;for(;e=e.parentElement;){const{scale:t}=s.getComputedStyle(e);if(t&&"none"!==t){g=parseFloat(t);break}}}const m=1/g;u.after(p);const f={};for(const e of["transform","transformOrigin","transition","zIndex","position","top","left","pointerEvents","opacity","backgroundColor"])f[e]=u.style[e];const b=s.scrollY,k=s.scrollX,v=t.clientX,_=t.clientY;u.style.position="relative",u.style.top="0px",u.style.left="0px";const y=t.clientX-d.left,x=t.clientY-d.top,S=d.height>200?200/d.height:1;if(u.style.zIndex="1000",u.style.transformOrigin=`${y*m}px ${x*m}px`,u.style.transition="transform 0.2s ease-out",u.style.transform=`scale(${S})`,u.style.opacity="0.9",iS(s.getComputedStyle(u).backgroundColor)){let e="transparent",t=u;for(;t=t.parentElement;){const{backgroundColor:n}=s.getComputedStyle(t);if(!iS(n)){e=n;break}}u.style.backgroundColor=e}let w=!1;function C(e){w||(w=!0,u.style.pointerEvents="none");const t=s.scrollY,n=s.scrollX;u.style.top=(e.clientY-_+t-b)*m+"px",u.style.left=(e.clientX-v+n-k)*m+"px"}function B(){i.removeEventListener("dragover",C),i.removeEventListener("dragend",B),i.removeEventListener("drop",B),i.removeEventListener("scroll",C);for(const[e,t]of Object.entries(f))u.style[e]=t;p.remove(),u.id=h,l.remove(),c(),document.body.classList.remove("is-dragging-components-draggable"),i.documentElement.classList.remove("is-dragging")}i.addEventListener("dragover",C),i.addEventListener("dragend",B),i.addEventListener("drop",B),i.addEventListener("scroll",C),a([e]),document.body.classList.add("is-dragging-components-draggable"),i.documentElement.classList.add("is-dragging")}}),[e,t,n,i,s,o,l,r,a,c])}function lS(){const e=(0,h.useContext)(sw);return(0,m.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function aS({isSelected:e}){const t=(0,m.useReducedMotion)();return(0,m.useRefEffect)((n=>{if(e){const{ownerDocument:e}=n,{defaultView:o}=e;if(!o.IntersectionObserver)return;const r=new o.IntersectionObserver((e=>{e[0].isIntersecting||n.scrollIntoView({behavior:t?"instant":"smooth"}),r.disconnect()}));return r.observe(n),()=>{r.disconnect()}}}),[e])}function cS({clientId:e="",isEnabled:t=!0}={}){const{getEnabledClientIdsTree:n}=G((0,g.useSelect)(ji));return(0,m.useRefEffect)((o=>{if(!t)return;const r=t=>{(t.target===o||t.target.classList.contains("is-root-container"))&&(t.defaultPrevented||(t.preventDefault(),n(e).forEach((({clientId:e})=>{const t=o.querySelector(`[data-block="${e}"]`);t&&(t.classList.remove("has-editable-outline"),t.offsetWidth,t.classList.add("has-editable-outline"))}))))};return o.addEventListener("click",r),()=>o.removeEventListener("click",r)}),[t])}const uS=new Map;function dS(e){const t=e.getAttribute("data-draggable");t&&(e.removeAttribute("data-draggable"),"true"!==t||e.getAttribute("draggable")||e.setAttribute("draggable","true"))}function pS(e){const{target:t}=e,{ownerDocument:n,isContentEditable:o,tagName:r}=t,i=["INPUT","TEXTAREA"].includes(r),s=uS.get(n);if(o||i)for(const e of s)"true"===e.getAttribute("draggable")&&e.contains(t)&&(e.removeAttribute("draggable"),e.setAttribute("data-draggable","true"));else for(const e of s)dS(e)}function hS(){return(0,m.useRefEffect)((e=>(function(e,t){let n=uS.get(e);n||(n=new Set,uS.set(e,n),e.addEventListener("pointerdown",pS)),n.add(t)}(e.ownerDocument,e),()=>{!function(e,t){const n=uS.get(e);n&&(n.delete(t),dS(t),0===n.size&&(uS.delete(e),e.removeEventListener("pointerdown",pS)))}(e.ownerDocument,e)})),[])}function gS(e={},{__unstableIsHtml:t}={}){const{clientId:n,className:o,wrapperProps:r={},isAligned:i,index:s,mode:l,name:a,blockApiVersion:c,blockTitle:u,isSelected:d,isSubtreeDisabled:p,hasOverlay:g,initialPosition:f,blockEditingMode:b,isHighlighted:k,isMultiSelected:v,isPartiallySelected:y,isReusable:x,isDragging:S,hasChildSelected:w,isEditingDisabled:B,hasEditableOutline:I,isTemporarilyEditingAsBlocks:j,defaultClassName:E,isSectionBlock:M,canMove:P,isBlockHidden:R}=(0,h.useContext)(pv),A=(0,T.sprintf)((0,T.__)("Block: %s"),u),N="html"!==l||t?"":"-visual",L=hS(),D=(0,m.useMergeRefs)([e.ref,nS({clientId:n,initialPosition:f}),gh(n),rS(n),sS({clientId:n,isSelected:d}),(0,m.useRefEffect)((e=>(e.addEventListener("mouseout",oS),e.addEventListener("mouseover",oS),()=>{e.removeEventListener("mouseout",oS),e.removeEventListener("mouseover",oS),e.classList.remove("is-hovered")})),[]),lS(),tS({triggerAnimationOnChange:s,clientId:n}),(0,m.useDisabled)({isDisabled:!g}),cS({clientId:n,isEnabled:M}),aS({isSelected:d}),P?L:void 0]),O=C(),z=!!O[_]?{"--wp-admin-theme-color":"var(--wp-block-synced-color)","--wp-admin-theme-color--rgb":"var(--wp-block-synced-color--rgb)"}:{};c<2&&n===O.clientId&&js()(`Block type "${a}" must support API version 2 or higher to work correctly with "useBlockProps" method.`);let V=!1;return"-"!==r?.style?.marginTop?.charAt(0)&&"-"!==r?.style?.marginBottom?.charAt(0)&&"-"!==r?.style?.marginLeft?.charAt(0)&&"-"!==r?.style?.marginRight?.charAt(0)||(V=!0),{tabIndex:"disabled"===b?-1:0,draggable:!(!P||w)||void 0,...r,...e,ref:D,id:`block-${n}${N}`,role:"document","aria-label":A,"data-block":n,"data-type":a,"data-title":u,inert:p?"true":void 0,className:ms("block-editor-block-list__block",{"wp-block":!i,"has-block-overlay":g,"is-selected":d,"is-highlighted":k,"is-multi-selected":v,"is-partially-selected":y,"is-reusable":x,"is-dragging":S,"has-child-selected":w,"is-editing-disabled":B,"has-editable-outline":I,"has-negative-margin":V,"is-content-locked-temporarily-editing-as-blocks":j,"is-block-hidden":R},o,e.className,r.className,E),style:{...r.style,...e.style,...z}}}function mS({children:e,isHtml:t,...n}){return(0,d.jsx)("div",{...gS(n,{__unstableIsHtml:t}),children:e})}function fS({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:o,clientId:r,isSelected:i,isSelectionEnabled:s,className:l,__unstableLayoutClassNames:a,name:c,isValid:u,attributes:g,wrapperProps:m,setAttributes:f,onReplace:b,onRemove:k,onInsertBlocksAfter:v,onMerge:_,toggleSelection:y}){const{mayDisplayControls:x,mayDisplayParentControls:S,themeSupportsLayout:w,...C}=(0,h.useContext)(pv),B=ta()||{};let I=(0,d.jsx)(vv,{name:c,isSelected:i,attributes:g,setAttributes:f,insertBlocksAfter:n?void 0:v,onReplace:o?b:void 0,onRemove:o?k:void 0,mergeBlocks:o?_:void 0,clientId:r,isSelectionEnabled:s,toggleSelection:y,__unstableLayoutClassNames:a,__unstableParentLayout:Object.keys(B).length?B:void 0,mayDisplayControls:x,mayDisplayParentControls:S,blockEditingMode:C.blockEditingMode,isPreviewMode:C.isPreviewMode});const j=(0,p.getBlockType)(c);j?.getEditWrapperProps&&(m=function(e,t){const n={...e,...t};return e?.hasOwnProperty("className")&&t?.hasOwnProperty("className")&&(n.className=ms(e.className,t.className)),e?.hasOwnProperty("style")&&t?.hasOwnProperty("style")&&(n.style={...e.style,...t.style}),n}(m,j.getEditWrapperProps(g)));const E=m&&!!m["data-align"]&&!w,T=l?.includes("is-position-sticky");let M;if(E&&(I=(0,d.jsx)("div",{className:ms("wp-block",T&&l),"data-align":m["data-align"],children:I})),u)M="html"===t?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{style:{display:"none"},children:I}),(0,d.jsx)(mS,{isHtml:!0,children:(0,d.jsx)(Tv,{clientId:r})})]}):j?.apiVersion>1?I:(0,d.jsx)(mS,{children:I});else{const t=e?(0,p.serializeRawBlock)(e):(0,p.getSaveContent)(j,g);M=(0,d.jsxs)(mS,{className:"has-warning",children:[(0,d.jsx)(wv,{clientId:r}),(0,d.jsx)(h.RawHTML,{children:(0,Ga.safeHTML)(t)})]})}const{"data-align":P,...R}=m??{},A={...R,className:ms(R.className,P&&w&&`align${P}`,!(P&&T)&&l)};return(0,d.jsx)(pv.Provider,{value:{wrapperProps:A,isAligned:E,...C},children:(0,d.jsx)(jv,{fallback:(0,d.jsx)(mS,{className:"has-warning",children:(0,d.jsx)(Bv,{})}),children:M})})}gS.save=p.__unstableGetBlockProps;const bS=(0,g.withDispatch)(((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:r,mergeBlocks:i,replaceBlocks:s,toggleSelection:l,__unstableMarkLastChangeAsPersistent:a,moveBlocksToPosition:c,removeBlock:u,selectBlock:d}=e(ji);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select(ji),i=r(),{clientId:s,attributes:l}=t,a=i.length?i:[s],c="function"==typeof e?e(l):e;o(a,c)},onInsertBlocks(e,n){const{rootClientId:o}=t;r(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:i}=t,{getBlockIndex:s}=n.select(ji),l=s(o);r(e,l+1,i)},onMerge(e){const{clientId:o,rootClientId:l}=t,{getPreviousBlockClientId:a,getNextBlockClientId:h,getBlock:g,getBlockAttributes:m,getBlockName:f,getBlockOrder:b,getBlockIndex:k,getBlockRootClientId:v,canInsertBlockType:_}=n.select(ji);function y(){const e=g(o),t=(0,p.getDefaultBlockName)(),r=(0,p.getBlockType)(t);if(f(o)!==t){const n=(0,p.switchToBlockType)(e,t);n&&n.length&&s(o,n)}else if((0,p.isUnmodifiedDefaultBlock)(e)){const e=h(o);e&&n.batch((()=>{u(o),d(e)}))}else if(r.merge){const n=r.merge({},e.attributes);s([o],[(0,p.createBlock)(t,n)])}}function x(e,t=!0){const o=f(e),i="text"===(0,p.getBlockType)(o).category,s=v(e),l=b(e),[a]=l;1===l.length&&(0,p.isUnmodifiedBlock)(g(a))?u(e):i?n.batch((()=>{if(_(f(a),s))c([a],e,s,k(e));else{const n=(0,p.switchToBlockType)(g(a),(0,p.getDefaultBlockName)());n&&n.length&&n.every((e=>_(e.name,s)))?(r(n,k(e),s,t),u(a,!1)):y()}!b(e).length&&(0,p.isUnmodifiedBlock)(g(e))&&u(e,!1)})):y()}if(e){if(l){const e=h(l);if(e){if(f(l)!==f(e))return void i(l,e);{const t=m(l),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{c(b(e),e,l),u(e,!1)}))}}}const e=h(o);if(!e)return;b(e).length?x(e,!1):i(o,e)}else{const e=a(o);if(e)i(e,o);else if(l){const e=a(l);if(e&&f(l)===f(e)){const t=m(l),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{c(b(l),l,e),u(l,!1)}))}x(l)}else y()}},onReplace(e,n,o){e.length&&!(0,p.isUnmodifiedDefaultBlock)(e[e.length-1])&&a();const r=1===e?.length&&Array.isArray(e[0])?e[0]:e;s([t.clientId],r,n,o)},onRemove(){u(t.clientId)},toggleSelection(e){l(e)}}}));fS=(0,m.compose)(bS,(0,ws.withFilters)("editor.BlockListBlock"))(fS);var kS=(0,h.memo)((function(e){const{clientId:t,rootClientId:n}=e,o=(0,g.useSelect)((e=>{const{isBlockSelected:o,getBlockMode:r,isSelectionEnabled:i,getTemplateLock:s,isSectionBlock:l,getBlockWithoutAttributes:a,getBlockAttributes:c,canRemoveBlock:u,canMoveBlock:d,getSettings:h,getTemporarilyEditingAsBlocks:g,getBlockEditingMode:m,getBlockName:f,isFirstMultiSelectedBlock:b,getMultiSelectedBlockClientIds:k,hasSelectedInnerBlock:v,getBlocksByName:_,getBlockIndex:y,isBlockMultiSelected:x,isBlockSubtreeDisabled:S,isBlockHighlighted:w,__unstableIsFullySelected:C,__unstableSelectionHasUnmergeableBlock:B,isBlockBeingDragged:I,isDragging:j,__unstableHasActiveBlockOverlayActive:E,getSelectedBlocksInitialCaretPosition:T}=G(e(ji)),M=a(t);if(!M)return;const{hasBlockSupport:P,getActiveBlockVariation:R}=e(p.store),A=c(t),{name:N,isValid:L}=M,D=(0,p.getBlockType)(N),{supportsLayout:O,isPreviewMode:z,__experimentalBlockBindingsSupportedAttributes:V}=h(),F=V?.[N],H=D?.apiVersion>1,U={isPreviewMode:z,blockWithoutAttributes:M,name:N,attributes:A,isValid:L,themeSupportsLayout:O,index:y(t),isReusable:(0,p.isReusableBlock)(D),className:H?A.className:void 0,defaultClassName:H?(0,p.getBlockDefaultClassName)(N):void 0,blockTitle:D?.title,isBlockHidden:!1===A?.metadata?.blockVisibility,bindableAttributes:F};if(z)return U;const{isBlockHidden:$}=G(e(ji)),W=o(t),K=u(t),Z=d(t),q=R(N,A),Y=x(t),X=v(t,!0),Q=m(t),J=(0,p.hasBlockSupport)(N,"multiple",!0)?[]:_(N),ee=J.length&&J[0]!==t;return{...U,mode:r(t),isSelectionEnabled:i(),isLocked:!!s(n),isSectionBlock:l(t),canRemove:K,canMove:Z,isSelected:W,isTemporarilyEditingAsBlocks:g()===t,blockEditingMode:Q,mayDisplayControls:W||b(t)&&k().every((e=>f(e)===N)),mayDisplayParentControls:P(f(t),"__experimentalExposeControlsToChildren",!1)&&v(t),blockApiVersion:D?.apiVersion||1,blockTitle:q?.title||D?.title,isSubtreeDisabled:"disabled"===Q&&S(t),hasOverlay:E(t)&&!j(),initialPosition:W?T():void 0,isHighlighted:w(t),isMultiSelected:Y,isPartiallySelected:Y&&!C()&&!B(),isDragging:I(t),hasChildSelected:X,isEditingDisabled:"disabled"===Q,hasEditableOutline:"disabled"!==Q&&"disabled"===m(n),originalBlockClientId:!!ee&&J[0],isBlockHidden:$(t)}}),[t,n]),{isPreviewMode:r,mode:i="visual",isSelectionEnabled:s=!1,isLocked:l=!1,canRemove:a=!1,canMove:c=!1,blockWithoutAttributes:u,name:m,attributes:f,isValid:b,isSelected:k=!1,themeSupportsLayout:v,isTemporarilyEditingAsBlocks:_,blockEditingMode:y,mayDisplayControls:x,mayDisplayParentControls:S,index:w,blockApiVersion:C,blockTitle:B,isSubtreeDisabled:I,hasOverlay:j,initialPosition:E,isHighlighted:T,isMultiSelected:M,isPartiallySelected:P,isReusable:R,isDragging:A,hasChildSelected:N,isSectionBlock:L,isEditingDisabled:D,hasEditableOutline:O,className:z,defaultClassName:V,originalBlockClientId:F,isBlockHidden:H,bindableAttributes:U}=o,$=(0,h.useMemo)((()=>({...u,attributes:f})),[u,f]);if(!o)return null;const W={isPreviewMode:r,clientId:t,className:z,index:w,mode:i,name:m,blockApiVersion:C,blockTitle:B,isSelected:k,isSubtreeDisabled:I,hasOverlay:j,initialPosition:E,blockEditingMode:y,isHighlighted:T,isMultiSelected:M,isPartiallySelected:P,isReusable:R,isDragging:A,hasChildSelected:N,isSectionBlock:L,isEditingDisabled:D,hasEditableOutline:O,isTemporarilyEditingAsBlocks:_,defaultClassName:V,mayDisplayControls:x,mayDisplayParentControls:S,originalBlockClientId:F,themeSupportsLayout:v,canMove:c,isBlockHidden:H,bindableAttributes:U};return!H||k||M||N?(0,d.jsx)(pv.Provider,{value:W,children:(0,d.jsx)(fS,{...e,mode:i,isSelectionEnabled:s,isLocked:l,canRemove:a,canMove:c,block:$,name:m,attributes:f,isValid:b,isSelected:k})}):null}));const vS=window.wp.htmlEntities,_S="\ufeff";function yS({rootClientId:e}){const{showPrompt:t,isLocked:n,placeholder:o,isManualGrid:r}=(0,g.useSelect)((t=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r,getBlockAttributes:i}=t(ji),s=!n(e),{bodyPlaceholder:l}=o();return{showPrompt:s,isLocked:!!r(e),placeholder:l,isManualGrid:i(e)?.layout?.isManualPlacement}}),[e]),{insertDefaultBlock:i,startTyping:s}=(0,g.useDispatch)(ji);if(n||r)return null;const l=(0,vS.decodeEntities)(o)||(0,T.__)("Type / to choose a block"),a=()=>{i(void 0,e),s()};return(0,d.jsxs)("div",{"data-root-client-id":e||"",className:ms("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[(0,d.jsx)("p",{tabIndex:"0",role:"button","aria-label":(0,T.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{Wa.ENTER!==e.keyCode&&Wa.SPACE!==e.keyCode||a()},onClick:()=>a(),onFocus:()=>{t&&a()},children:t?l:_S}),(0,d.jsx)(lI,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}function xS({rootClientId:e}){return(0,g.useSelect)((t=>t(ji).canInsertBlockType((0,p.getDefaultBlockName)(),e)))?(0,d.jsx)(yS,{rootClientId:e}):(0,d.jsx)(uI,{rootClientId:e,className:"block-list-appender__toggle"})}function SS({rootClientId:e,CustomAppender:t,className:n,tagName:o="div"}){const r=(0,g.useSelect)((t=>{const{getBlockInsertionPoint:n,isBlockInsertionPointVisible:o,getBlockCount:r}=t(ji),i=n();return o()&&e===i?.rootClientId&&0===r(e)}),[e]);return(0,d.jsx)(o,{tabIndex:-1,className:ms("block-list-appender wp-block",n,{"is-drag-over":r}),contentEditable:!1,"data-block":!0,children:t?(0,d.jsx)(t,{}):(0,d.jsx)(xS,{rootClientId:e})})}const wS=Number.MAX_SAFE_INTEGER;var CS=function({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:r,operation:i="insert",nearestSide:s="right",...l}){const[a,c]=(0,h.useReducer)((e=>(e+1)%wS),0),{orientation:u,rootClientId:p,isVisible:m}=(0,g.useSelect)((n=>{const{getBlockListSettings:o,getBlockRootClientId:r,isBlockVisible:i}=n(ji),s=r(e??t);return{orientation:o(s)?.orientation||"vertical",rootClientId:s,isVisible:i(e)&&i(t)}}),[e,t]),f=bh(e),b=bh(t),k="vertical"===u,v=(0,h.useMemo)((()=>{if(a<0||!f&&!b||!m)return;return{contextElement:"group"===i?b||f:f||b,getBoundingClientRect(){const e=f?f.getBoundingClientRect():null,t=b?b.getBoundingClientRect():null;let n=0,o=0,r=0,l=0;if("group"===i){const i=t||e;o=i.top,r=0,l=i.bottom-i.top,n="left"===s?i.left-2:i.right-2}else k?(o=e?e.bottom:t.top,r=e?e.width:t.width,l=t&&e?t.top-e.bottom:0,n=e?e.left:t.left):(o=e?e.top:t.top,l=e?e.height:t.height,(0,T.isRTL)()?(n=t?t.right:e.left,r=e&&t?e.left-t.right:0):(n=e?e.right:t.left,r=e&&t?t.left-e.right:0),r=Math.max(r,0));return new window.DOMRect(n,o,r,l)}}}),[f,b,a,k,m,i,s]),_=Fm(r);return(0,h.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(c);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]),(0,h.useLayoutEffect)((()=>{if(!b)return;const e=new window.MutationObserver(c);return e.observe(b,{attributes:!0}),()=>{e.disconnect()}}),[b]),(0,h.useLayoutEffect)((()=>{if(f)return f.ownerDocument.defaultView.addEventListener("resize",c),()=>{f.ownerDocument.defaultView?.removeEventListener("resize",c)}}),[f]),(f||b)&&m?(0,d.jsx)(ws.Popover,{ref:_,animate:!1,anchor:v,focusOnMount:!1,__unstableSlotName:o,inline:!o,...l,className:ms("block-editor-block-popover","block-editor-block-popover__inbetween",l.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled",children:(0,d.jsx)("div",{className:"block-editor-block-popover__inbetween-container",children:n})},t+"--"+p):null};const BS={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};var IS=function({__unstablePopoverSlot:e,__unstableContentRef:t}){const{clientId:n}=(0,g.useSelect)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(ji),o=n(),r=t(o.rootClientId);return r.length?{clientId:r[o.index]}:{}}),[]),o=(0,m.useReducedMotion)();return(0,d.jsx)(of,{clientId:n,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone",children:(0,d.jsx)(ws.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:o?BS.show:BS.hide,animate:BS.show,exit:o?BS.show:BS.exit,className:"block-editor-block-popover__drop-zone-foreground"})})};const jS=(0,h.createContext)();function ES({__unstablePopoverSlot:e,__unstableContentRef:t,operation:n="insert",nearestSide:o="right"}){const{selectBlock:r,hideInsertionPoint:i}=(0,g.useDispatch)(ji),s=(0,h.useContext)(jS),l=(0,h.useRef)(),{orientation:a,previousClientId:c,nextClientId:u,rootClientId:p,isInserterShown:f,isDistractionFree:b,isZoomOutMode:k}=(0,g.useSelect)((e=>{const{getBlockOrder:t,getBlockListSettings:n,getBlockInsertionPoint:o,isBlockBeingDragged:r,getPreviousBlockClientId:i,getNextBlockClientId:s,getSettings:l,isZoomOut:a}=G(e(ji)),c=o(),u=t(c.rootClientId);if(!u.length)return{};let d=u[c.index-1],p=u[c.index];for(;r(d);)d=i(d);for(;r(p);)p=s(p);const h=l();return{previousClientId:d,nextClientId:p,orientation:n(c.rootClientId)?.orientation||"vertical",rootClientId:c.rootClientId,isDistractionFree:h.isDistractionFree,isInserterShown:c?.__unstableWithInserter,isZoomOutMode:a()}}),[]),{getBlockEditingMode:v}=(0,g.useSelect)(ji),_=(0,m.useReducedMotion)();const y=(0,h.useCallback)((e=>{!e&&s.current&&(s.current=!1)}),[s]),x={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:f?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},S={start:{scale:_?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(b)return null;if(k&&"insert"!==n)return null;const w=ms("block-editor-block-list__insertion-point","horizontal"===a||"group"===n?"is-horizontal":"is-vertical");return(0,d.jsx)(CS,{previousClientId:c,nextClientId:u,__unstablePopoverSlot:e,__unstableContentRef:t,operation:n,nearestSide:o,children:(0,d.jsxs)(ws.__unstableMotion.div,{layout:!_,initial:_?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:l,tabIndex:-1,onClick:function(e){e.target===l.current&&u&&"disabled"!==v(u)&&r(u,-1)},onFocus:function(e){e.target!==l.current&&(s.current=!0)},className:ms(w,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==l.current||s.current||i()},children:[(0,d.jsx)(ws.__unstableMotion.div,{variants:x,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),f&&(0,d.jsx)(ws.__unstableMotion.div,{variants:S,className:ms("block-editor-block-list__insertion-point-inserter"),children:(0,d.jsx)(lI,{ref:y,position:"bottom center",clientId:u,rootClientId:p,__experimentalIsQuick:!0,onToggle:e=>{s.current=e},onSelectOrClose:()=>{s.current=!1}})})]})})}function TS(e){const{insertionPoint:t,isVisible:n,isBlockListEmpty:o}=(0,g.useSelect)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n,getBlockCount:o}=e(ji),r=t();return{insertionPoint:r,isVisible:n(),isBlockListEmpty:0===o(r?.rootClientId)}}),[]);return!n||o?null:"replace"===t.operation?(0,d.jsx)(IS,{...e},`${t.rootClientId}-${t.index}`):(0,d.jsx)(ES,{operation:t.operation,nearestSide:t.nearestSide,...e})}function MS(){const e=(0,h.useContext)(jS),t=(0,g.useSelect)((e=>e(ji).getSettings().isDistractionFree||G(e(ji)).isZoomOut()),[]),{getBlockListSettings:n,getBlockIndex:o,isMultiSelecting:r,getSelectedBlockClientIds:i,getSettings:s,getTemplateLock:l,__unstableIsWithinBlockOverlay:a,getBlockEditingMode:c,getBlockName:u,getBlockAttributes:d,getParentSectionBlock:p}=G((0,g.useSelect)(ji)),{showInsertionPoint:f,hideInsertionPoint:b}=(0,g.useDispatch)(ji);return(0,m.useRefEffect)((h=>{if(!t)return h.addEventListener("mousemove",g),()=>{h.removeEventListener("mousemove",g)};function g(t){if(void 0===e||e.current)return;if(t.target.nodeType===t.target.TEXT_NODE)return;if(r())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void b();let h;if(!t.target.classList.contains("is-root-container")){h=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")}if(l(h)||"disabled"===c(h)||"core/block"===u(h)||h&&d(h).layout?.isManualPlacement)return;const g=n(h),m=g?.orientation||"vertical",k=!!g?.__experimentalCaptureToolbars,v=t.clientY,_=t.clientX;let y=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===m&&t.top>v||e.classList.contains("wp-block")&&"horizontal"===m&&((0,T.isRTL)()?t.right<_:t.left>_)}));if(!y)return void b();if(!y.id&&(y=y.firstElementChild,!y))return void b();const x=y.id.slice(6);if(!x||a(x)||p(x))return;if(i().includes(x)&&"vertical"===m&&!k&&!s().hasFixedToolbar)return;const S=y.getBoundingClientRect();if("horizontal"===m&&(t.clientY>S.bottom||t.clientY<S.top)||"vertical"===m&&(t.clientX>S.right||t.clientX<S.left))return void b();const w=o(x);0!==w?f(h,w,{__unstableWithInserter:!0}):b()}}),[e,n,o,r,f,b,i,t])}function PS(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,g.useSelect)(ji),{clearSelectedBlock:o}=(0,g.useDispatch)(ji),{clearBlockSelection:r}=e();return(0,m.useRefEffect)((e=>{if(r)return e.addEventListener("mousedown",i),()=>{e.removeEventListener("mousedown",i)};function i(r){(t()||n())&&r.target===e&&o()}}),[t,n,o,r])}function RS(e){return(0,d.jsx)("div",{ref:PS(),...e})}jS.displayName="InsertionPointOpenRefContext";const AS=new WeakMap;function NS(){let e;return t=>(void 0!==e&&Ja()(e,t)||(e=t),e)}function LS(e){const[t]=(0,h.useState)(NS);return t(e)}function DS(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}function OS(e,t,n={}){const{operation:o="insert",nearestSide:r="right"}=n,{canInsertBlockType:i,getBlockIndex:s,getClientIdsOfDescendants:l,getBlockOrder:a,getBlocksByClientId:c,getSettings:u,getBlock:d}=(0,g.useSelect)(ji),{getGroupingBlockName:m}=(0,g.useSelect)(p.store),{insertBlocks:f,moveBlocksToPosition:b,updateBlockAttributes:k,clearSelectedBlock:v,replaceBlocks:_,removeBlocks:y}=(0,g.useDispatch)(ji),x=(0,g.useRegistry)(),S=(0,h.useCallback)(((n,s=!0,l=0,c=[])=>{Array.isArray(n)||(n=[n]);const u=a(e)[t];if("replace"===o)_(u,n,void 0,l);else if("group"===o){const t=d(u);"left"===r?n.push(t):n.unshift(t);const o=n.map((e=>(0,p.createBlock)(e.name,e.attributes,e.innerBlocks))),s=n.every((e=>"core/image"===e.name)),a=i("core/gallery",e),h=(0,p.createBlock)(s&&a?"core/gallery":m(),{layout:{type:"flex",flexWrap:s&&a?null:"nowrap"}},o);_([u,...c],h,void 0,l)}else f(n,t,e,s,l)}),[a,e,t,o,_,d,r,i,m,f]),w=(0,h.useCallback)(((n,r,i)=>{if("replace"===o){const o=c(n),r=a(e)[t];x.batch((()=>{y(n,!1),_(r,o,void 0,0)}))}else b(n,r,e,i)}),[o,a,c,b,x,y,_,t,e]),C=function(e,t,n,o,r,i,s,l,a){return c=>{const{srcRootClientId:u,srcClientIds:d,type:h,blocks:g}=DS(c);if("inserter"===h){s();const e=g.map((e=>(0,p.cloneBlock)(e)));i(e,!0,null)}if("block"===h){const s=n(d[0]);if(u===e&&s===t)return;if(d.includes(e)||o(d).some((t=>t===e)))return;if("group"===l){const e=d.map((e=>a(e)));return void i(e,!0,null,d)}const c=u===e,p=d.length;r(d,u,c&&s<t?t-p:t)}}}(e,t,s,l,w,S,v,o,d),B=function(e,t,n,o,r){return i=>{if(!t().mediaUpload)return;const s=(0,p.findTransform)((0,p.getBlockTransforms)("from"),(t=>"files"===t.type&&o(t.blockName,e)&&t.isMatch(i)));if(s){const e=s.transform(i,n);r(e)}}}(e,u,k,i,S),I=function(e){return t=>{const n=(0,p.pasteHandler)({HTML:t,mode:"BLOCKS"});n.length&&e(n)}}(S);return e=>{const t=(0,Ga.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?I(n):t.length?B(t):C(e)}}function zS(e,t,n=["top","bottom","left","right"]){let o,r;return n.forEach((n=>{const i=function(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:i}=e,s=o?r:i,l=o?i:r,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=s>=a&&s<=c?s:s<c?a:c,Math.sqrt((s-d)**2+(l-u)**2)}(e,t,n);(void 0===o||i<o)&&(o=i,r=n)})),[o,r]}function VS(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const FS=30,HS=120,US=120;function GS(e,t,n,o){let r=!0;if(t){const e=t?.map((({name:e})=>e));r=n.every((t=>e?.includes(t)))}const i=n.map((t=>e(t))).every((e=>{const[t]=e?.parent||[];return!t||t===o}));return r&&i}function $S(e,t){const{defaultView:n}=t;return!!(n&&e instanceof n.HTMLElement&&e.closest("[data-is-insertion-point]"))}function WS({dropZoneElement:e,rootClientId:t="",parentClientId:n="",isDisabled:o=!1}={}){const r=(0,g.useRegistry)(),[i,s]=(0,h.useState)({index:null,operation:"insert"}),{getBlockType:l,getBlockVariations:a,getGroupingBlockName:c}=(0,g.useSelect)(p.store),{canInsertBlockType:u,getBlockListSettings:d,getBlocks:f,getBlockIndex:b,getDraggedBlockClientIds:k,getBlockNamesByClientId:v,getAllowedBlocks:_,isDragging:y,isGroupable:x,isZoomOut:S,getSectionRootClientId:w,getBlockParents:C}=G((0,g.useSelect)(ji)),{showInsertionPoint:B,hideInsertionPoint:I,startDragging:j,stopDragging:E}=G((0,g.useDispatch)(ji)),M=OS("before"===i.operation||"after"===i.operation?n:t,i.index,{operation:i.operation,nearestSide:i.nearestSide}),P=(0,m.useThrottle)((0,h.useCallback)(((o,i)=>{y()||j();const h=k(),g=[t,...C(t,!0)];if(h.some((e=>g.includes(e))))return;const m=_(t),I=v([t])[0],E=v(h);if(!GS(l,m,E,I))return;const M=w();if(S()&&M!==t)return;const P=f(t).filter((e=>!((0,p.hasBlockSupport)(e.name,"visibility",!0)&&!1===e.attributes?.metadata?.blockVisibility)));if(0===P.length)return void r.batch((()=>{s({index:0,operation:"insert"}),B(t,0,{operation:"insert"})}));const R=P.map((e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:(0,p.isUnmodifiedDefaultBlock)(e),getBoundingClientRect:()=>{const e=i.getElementById(`block-${t}`);return e?e.getBoundingClientRect():null},blockIndex:b(t),blockOrientation:d(t)?.orientation}})),A=function(e,t,n="vertical",o={}){const r="horizontal"===n?["left","right"]:["top","bottom"];let i=0,s="before",l=1/0,a=null,c="right";const{dropZoneElement:u,parentBlockOrientation:d,rootBlockIndex:p=0}=o;if(u&&"horizontal"!==d){const e=u.getBoundingClientRect(),[n,o]=zS(t,e,["top","bottom"]);if(e.height>HS&&n<FS){if("top"===o)return[p,"before"];if("bottom"===o)return[p+1,"after"]}}const h=(0,T.isRTL)();if(u&&"horizontal"===d){const e=u.getBoundingClientRect(),[n,o]=zS(t,e,["left","right"]);if(e.width>US&&n<FS){if(h&&"right"===o||!h&&"left"===o)return[p,"before"];if(h&&"left"===o||!h&&"right"===o)return[p+1,"after"]}}e.forEach((({isUnmodifiedDefaultBlock:e,getBoundingClientRect:o,blockIndex:u,blockOrientation:d})=>{const p=o();if(!p)return;let[g,m]=zS(t,p,r);const[f,b]=zS(t,p,["left","right"]),k=VS(t,p);e&&k?g=0:"vertical"===n&&"horizontal"!==d&&(k&&f<FS||!k&&function(e,t){return t.top<=e.y&&t.bottom>=e.y}(t,p))&&(a=u,c=b),g<l&&(s="bottom"===m||!h&&"right"===m||h&&"left"===m?"after":"before",l=g,i=u)}));const g=i+("after"===s?1:-1),m=!!e[i]?.isUnmodifiedDefaultBlock,f=!!e[g]?.isUnmodifiedDefaultBlock;if(null!==a)return[a,"group",c];if(!m&&!f)return["after"===s?i+1:i,"insert"];return[m?i:g,"replace"]}(R,{x:o.clientX,y:o.clientY},d(t)?.orientation,{dropZoneElement:e,parentBlockClientId:n,parentBlockOrientation:n?d(n)?.orientation:void 0,rootBlockIndex:b(t)}),[N,L,D]=A,O=R[N]?.isUnmodifiedDefaultBlock;if(!S()||O||"insert"===L){if("group"===L){const e=P[N],n=[e.name,...E].every((e=>"core/image"===e)),o=u("core/gallery",t),r=x([e.clientId,k()]),i=a(c(),"block"),s=i&&i.find((({name:e})=>"group-row"===e));if(n&&!o&&(!r||!s))return;if(!(n||r&&s))return}r.batch((()=>{s({index:N,operation:L,nearestSide:D});const e=["before","after"].includes(L)?n:t;B(e,N,{operation:L,nearestSide:D})}))}}),[y,_,t,v,k,l,w,S,f,d,e,n,b,r,j,B,u,x,a,c]),200);return(0,m.__experimentalUseDropZone)({dropZoneElement:e,isDisabled:o,onDrop:M,onDragOver(e){P(e,e.currentTarget.ownerDocument)},onDragLeave(e){const{ownerDocument:t}=e.currentTarget;$S(e.relatedTarget,t)||$S(e.target,t)||(P.cancel(),I())},onDragEnd(){P.cancel(),E(),I()}})}const KS={};function ZS({children:e,clientId:t}){const n=function(e){return(0,g.useSelect)((t=>{const n=t(ji).getBlock(e);if(!n)return;const o=t(p.store).getBlockType(n.name);return o&&0!==Object.keys(o.providesContext).length?Object.fromEntries(Object.entries(o.providesContext).map((([e,t])=>[e,n.attributes[t]]))):void 0}),[e])}(t);return(0,d.jsx)(iv,{value:n,children:e})}const qS=(0,h.memo)(mw);function YS(e){const{clientId:t,allowedBlocks:n,prioritizedInserterBlocks:o,defaultBlock:r,directInsert:i,__experimentalDefaultBlock:s,__experimentalDirectInsert:l,template:a,templateLock:c,wrapperRef:u,templateInsertUpdatesSelection:m,__experimentalCaptureToolbars:f,__experimentalAppenderTagName:b,renderAppender:k,orientation:v,placeholder:_,layout:y,name:x,blockType:S,parentLock:w,defaultLayout:C}=e;!function(e,t,n,o,r,i,s,l,a,c,u,d){const p=(0,g.useRegistry)(),m=LS(n),f=LS(o),b=void 0===a||"contentOnly"===t?t:a;(0,h.useLayoutEffect)((()=>{const t={allowedBlocks:m,prioritizedInserterBlocks:f,templateLock:b};if(void 0!==c&&(t.__experimentalCaptureToolbars=c),void 0!==u)t.orientation=u;else{const e=Xl(d?.type);t.orientation=e.getOrientation(d)}void 0!==s&&(I()("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),t.defaultBlock=s),void 0!==r&&(t.defaultBlock=r),void 0!==l&&(I()("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),t.directInsert=l),void 0!==i&&(t.directInsert=i),void 0!==t.directInsert&&"boolean"!=typeof t.directInsert&&I()("Using `Function` as a `directInsert` argument",{alternative:"`boolean` values",since:"6.5"}),AS.get(p)||AS.set(p,{}),AS.get(p)[e]=t,window.queueMicrotask((()=>{const e=AS.get(p);if(Object.keys(e).length){const{updateBlockListSettings:t}=p.dispatch(ji);t(e),AS.set(p,{})}}))}),[e,m,f,b,r,i,s,l,c,u,d,p])}(t,w,n,o,r,i,s,l,c,f,v,y),function(e,t,n,o){const r=(0,g.useRegistry)(),i=(0,h.useRef)(null);(0,h.useLayoutEffect)((()=>{let s=!1;const{getBlocks:l,getSelectedBlocksInitialCaretPosition:a,isBlockSelected:c}=r.select(ji),{replaceInnerBlocks:u,__unstableMarkNextChangeAsNotPersistent:d}=r.dispatch(ji);return window.queueMicrotask((()=>{if(s)return;const r=l(e),h=0===r.length||"all"===n||"contentOnly"===n,g=!E()(t,i.current);if(!h||!g)return;i.current=t;const m=(0,p.synchronizeBlocksWithTemplate)(r,t);E()(m,r)||(d(),u(e,m,0===r.length&&o&&0!==m.length&&c(e),a()))})),()=>{s=!0}}),[t,n,e,r,o])}(t,a,c,m);const B=(0,p.getBlockSupport)(x,"layout")||(0,p.getBlockSupport)(x,"__experimentalLayout")||KS,{allowSizingOnChildren:j=!1}=B,T=y||B,M=(0,h.useMemo)((()=>({...C,...T,...j&&{allowSizingOnChildren:!0}})),[C,T,j]),P=(0,d.jsx)(qS,{rootClientId:t,renderAppender:k,__experimentalAppenderTagName:b,layout:M,wrapperRef:u,placeholder:_});return S?.providesContext&&0!==Object.keys(S.providesContext).length?(0,d.jsx)(ZS,{clientId:t,children:P}):P}function XS(e){return qk(e),(0,d.jsx)(YS,{...e})}const QS=(0,h.forwardRef)(((e,t)=>{const n=JS({ref:t},e);return(0,d.jsx)("div",{className:"block-editor-inner-blocks",children:(0,d.jsx)("div",{...n})})}));function JS(e={},t={}){const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o,dropZoneElement:r}=t,{clientId:i,layout:s=null,__unstableLayoutClassNames:l=""}=C(),a=(0,g.useSelect)((e=>{const{getBlockName:t,isZoomOut:n,getTemplateLock:o,getBlockRootClientId:r,getBlockEditingMode:s,getBlockSettings:l,getSectionRootClientId:a}=G(e(ji));if(!i){const e=a();return{isDropZoneDisabled:n()&&""!==e}}const{hasBlockSupport:c,getBlockType:u}=e(p.store),d=t(i),h=s(i),g=r(i),[m]=l(i,"layout");let f="disabled"===h;if(n()){const e=a();f=i!==e}return{__experimentalCaptureToolbars:c(d,"__experimentalExposeControlsToChildren",!1),name:d,blockType:u(d),parentLock:o(g),parentClientId:g,isDropZoneDisabled:f,defaultLayout:m}}),[i]),{__experimentalCaptureToolbars:c,name:u,blockType:h,parentLock:f,parentClientId:b,isDropZoneDisabled:k,defaultLayout:v}=a,_=WS({dropZoneElement:r,rootClientId:i,parentClientId:b}),y=(0,m.useMergeRefs)([e.ref,o||k||s?.isManualPlacement&&window.__experimentalEnableGridInteractivity?null:_]),x={__experimentalCaptureToolbars:c,layout:s,name:u,blockType:h,parentLock:f,defaultLayout:v,...t},S=x.value&&x.onChange?XS:YS;return{...e,ref:y,className:ms(e.className,"block-editor-block-list__layout",n?"":l),children:i?(0,d.jsx)(S,{...x,clientId:i}):(0,d.jsx)(mw,{...t})}}JS.save=p.__unstableGetInnerBlocksProps,QS.DefaultBlockAppender=function(){const{clientId:e}=C();return(0,d.jsx)(yS,{rootClientId:e})},QS.ButtonBlockAppender=function({showSeparator:e,isFloating:t,onAddBlock:n,isToggle:o}){const{clientId:r}=C();return(0,d.jsx)(uI,{className:ms({"block-list-appender__toggle":o}),rootClientId:r,showSeparator:e,isFloating:t,onAddBlock:n})},QS.Content=()=>JS.save().children;var ew=QS;const tw=new Set([Wa.UP,Wa.RIGHT,Wa.DOWN,Wa.LEFT,Wa.ENTER,Wa.BACKSPACE]);function nw(){const e=(0,g.useSelect)((e=>e(ji).isTyping()),[]),{stopTyping:t}=(0,g.useDispatch)(ji);return(0,m.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,i;function s(e){const{clientX:n,clientY:o}=e;r&&i&&(r!==n||i!==o)&&t(),r=n,i=o}return o.addEventListener("mousemove",s),()=>{o.removeEventListener("mousemove",s)}}),[e,t])}function ow(){const{isTyping:e}=(0,g.useSelect)((e=>{const{isTyping:t}=e(ji);return{isTyping:t()}}),[]),{startTyping:t,stopTyping:n}=(0,g.useDispatch)(ji),o=nw(),r=(0,m.useRefEffect)((o=>{const{ownerDocument:r}=o,{defaultView:i}=r,s=i.getSelection();if(e){let e=function(e){const{target:t}=e;a=i.setTimeout((()=>{(0,Ga.isTextField)(t)||n()}))},t=function(e){const{keyCode:t}=e;t!==Wa.ESCAPE&&t!==Wa.TAB||n()},l=function(){s.isCollapsed||n()};let a;return o.addEventListener("focus",e),o.addEventListener("keydown",t),r.addEventListener("selectionchange",l),()=>{i.clearTimeout(a),o.removeEventListener("focus",e),o.removeEventListener("keydown",t),r.removeEventListener("selectionchange",l)}}function l(e){const{type:n,target:r}=e;(0,Ga.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&tw.has(t)}(e))&&t()}return o.addEventListener("keypress",l),o.addEventListener("keydown",l),()=>{o.removeEventListener("keypress",l),o.removeEventListener("keydown",l)}}),[e,t,n]);return(0,m.useMergeRefs)([o,r])}var rw=function({children:e}){return(0,d.jsx)("div",{ref:ow(),children:e})};function iw({clientId:e,rootClientId:t="",position:n="top"}){const[o,r]=(0,h.useState)(!1),{sectionRootClientId:i,sectionClientIds:s,insertionPoint:l,blockInsertionPointVisible:a,blockInsertionPoint:c,blocksBeingDragged:u}=(0,g.useSelect)((e=>{const{getInsertionPoint:t,getBlockOrder:n,getSectionRootClientId:o,isBlockInsertionPointVisible:r,getBlockInsertionPoint:i,getDraggedBlockClientIds:s}=G(e(ji)),l=o();return{sectionRootClientId:l,sectionClientIds:n(l),insertionPoint:t(),blockInsertionPoint:i(),blockInsertionPointVisible:r(),blocksBeingDragged:s()}}),[]),p=(0,m.useReducedMotion)();if(!e)return;let f=!1;if(!(t===i&&s&&s.includes(e)))return null;const b=0===l?.index&&e===s[l.index],k=l&&l.hasOwnProperty("index")&&e===s[l.index-1];"top"===n&&(f=b||a&&0===c.index&&e===s[c.index]),"bottom"===n&&(f=k||a&&e===s[c.index-1]);const v=u[0],_=u.includes(e),y=s.indexOf(v),x=y>0?s[y-1]:null;return(_||x===e)&&(f=!1),(0,d.jsx)(ws.__unstableAnimatePresence,{children:f&&(0,d.jsx)(ws.__unstableMotion.div,{initial:{height:0},animate:{height:"calc(1 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)"},exit:{height:0},transition:{type:"tween",duration:p?0:.2,ease:[.6,0,.4,1]},className:ms("block-editor-block-list__zoom-out-separator",{"is-dragged-over":o}),"data-is-insertion-point":"true",onDragOver:()=>r(!0),onDragLeave:()=>r(!1),children:(0,d.jsx)(ws.__unstableMotion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{delay:-.125}},transition:{ease:"linear",duration:.1,delay:.125},children:(0,T.__)("Drop pattern.")})})})}const sw=(0,h.createContext)();sw.displayName="IntersectionObserverContext";const lw=new WeakMap,aw={trailing:!0};function cw({className:e,...t}){const{isOutlineMode:n,isFocusMode:o,temporarilyEditingAsBlocks:r}=(0,g.useSelect)((e=>{const{getSettings:t,getTemporarilyEditingAsBlocks:n,isTyping:o,hasBlockSpotlight:r}=G(e(ji)),{outlineMode:i,focusMode:s}=t();return{isOutlineMode:i&&!o(),isFocusMode:s||r(),temporarilyEditingAsBlocks:n()}}),[]),i=(0,g.useRegistry)(),{setBlockVisibility:s}=(0,g.useDispatch)(ji),l=(0,m.useDebounce)((0,h.useCallback)((()=>{const e={};lw.get(i).forEach((([t,n])=>{e[t]=n})),s(e)}),[i]),300,aw),a=(0,h.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{lw.get(i)||lw.set(i,[]);for(const t of e){const e=t.target.getAttribute("data-block");lw.get(i).push([e,t.isIntersecting])}l()}))}),[]),c=JS({ref:(0,m.useMergeRefs)([PS(),MS(),ow()]),className:ms("is-root-container",e,{"is-outline-mode":n,"is-focus-mode":o})},t);return(0,d.jsxs)(sw.Provider,{value:a,children:[(0,d.jsx)("div",{...c}),!!r&&(0,d.jsx)(uw,{clientId:r})]})}function uw({clientId:e}){const{stopEditingAsBlocks:t}=G((0,g.useDispatch)(ji)),n=(0,g.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=t(ji);return n(e)||o(e,!0)}),[e]);return(0,h.useEffect)((()=>{n||t(e)}),[n,e,t]),null}function dw(e){return(0,d.jsx)(w,{value:x,children:(0,d.jsx)(cw,{...e})})}const pw=[],hw=new Set;function gw({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:o,layout:r=Ql}){const i=!1!==n,s=!!n,{order:l,isZoomOut:a,selectedBlocks:c,visibleBlocks:u,shouldRenderAppender:h}=(0,g.useSelect)((e=>{const{getSettings:n,getBlockOrder:o,getSelectedBlockClientIds:r,__unstableGetVisibleBlocks:l,getTemplateLock:a,getBlockEditingMode:c,isSectionBlock:u,isContainerInsertableToInContentOnlyMode:d,getBlockName:h,isZoomOut:g,canInsertBlockType:m}=G(e(ji)),f=o(t);if(n().isPreviewMode)return{order:f,selectedBlocks:pw,visibleBlocks:hw};const b=r(),k=b[0],v=!(t||k||f.length&&m((0,p.getDefaultBlockName)(),t)),_=!(!t||!k||t!==k);return{order:f,selectedBlocks:b,visibleBlocks:l(),isZoomOut:g(),shouldRenderAppender:(!u(t)||d(h(k),t))&&"disabled"!==c(t)&&!a(t)&&i&&!g()&&(s||_||v)}}),[t,i,s]);return(0,d.jsxs)(ea,{value:r,children:[l.map((e=>(0,d.jsxs)(g.AsyncModeProvider,{value:!u.has(e)&&!c.includes(e),children:[a&&(0,d.jsx)(iw,{clientId:e,rootClientId:t,position:"top"}),(0,d.jsx)(kS,{rootClientId:t,clientId:e}),a&&(0,d.jsx)(iw,{clientId:e,rootClientId:t,position:"bottom"})]},e))),l.length<1&&e,h&&(0,d.jsx)(SS,{tagName:o,rootClientId:t,CustomAppender:n})]})}function mw(e){return(0,d.jsx)(g.AsyncModeProvider,{value:!1,children:(0,d.jsx)(gw,{...e})})}function fw(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:i,__unstableIsFullySelected:s}=e(ji);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:i(),isFullSelection:s()}}function bw(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:i}=(0,g.useSelect)(fw,[]);return(0,m.useRefEffect)((r=>{const{ownerDocument:s}=r,{defaultView:l}=s;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||i&&(r.contentEditable=!0,r.focus(),l.getSelection().removeAllRanges())}),[o,t,n,r,e,i])}function kw(e,t,n,o){let r,i=Ga.focus.focusable.find(n);return t&&i.reverse(),i=i.slice(i.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),i.find((function(e){if(!(e.closest("[inert]")||1===e.children.length&&$m(e,e.firstElementChild)&&"true"===e.firstElementChild.getAttribute("contenteditable"))){if(!Ga.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}}))}function vw(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,g.useSelect)(ji),{selectBlock:i}=(0,g.useDispatch)(ji);return(0,m.useRefEffect)((s=>{let l;function a(){l=null}function c(a){if(a.defaultPrevented)return;const{keyCode:c,target:u,shiftKey:d,ctrlKey:p,altKey:h,metaKey:g}=a,m=c===Wa.UP,f=c===Wa.DOWN,b=c===Wa.LEFT,k=c===Wa.RIGHT,v=m||b,_=b||k,y=m||f,x=_||y,S=d||p||h||g,w=y?Ga.isVerticalEdge:Ga.isHorizontalEdge,{ownerDocument:C}=s,{defaultView:B}=C;if(!x)return;if(o()){if(d)return;if(!r())return;return a.preventDefault(),void(v?i(e()):i(t(),-1))}if(!function(e,t,n){const o=t===Wa.UP||t===Wa.DOWN,{tagName:r}=e,i=e.getAttribute("type");if(o&&!n)return"INPUT"!==r||!["date","datetime-local","month","number","range","time","week"].includes(i);if("INPUT"===r)return["button","checkbox","number","color","file","image","radio","reset","submit"].includes(i);return"TEXTAREA"!==r}(u,c,S))return;y?l||(l=(0,Ga.computeCaretRect)(B)):l=null;const I=(0,Ga.isRTL)(u)?!v:v,{keepCaretInsideBlock:j}=n();if(d)(function(e,t){const n=kw(e,t,s);return n&&Km(n)})(u,v)&&w(u,v)&&(s.contentEditable=!0,s.focus());else if(!y||!(0,Ga.isVerticalEdge)(u,v)||h&&!(0,Ga.isHorizontalEdge)(u,I)||j){if(_&&B.getSelection().isCollapsed&&(0,Ga.isHorizontalEdge)(u,I)&&!j){const e=kw(u,I,s);(0,Ga.placeCaretAtHorizontalEdge)(e,v),a.preventDefault()}}else{const e=kw(u,v,s,!0);e&&((0,Ga.placeCaretAtVerticalEdge)(e,h?!v:v,h?void 0:l),a.preventDefault())}}return s.addEventListener("mousedown",a),s.addEventListener("keydown",c),()=>{s.removeEventListener("mousedown",a),s.removeEventListener("keydown",c)}}),[])}function _w(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,g.useSelect)(ji),{multiSelect:o,selectBlock:r}=(0,g.useDispatch)(ji),i=(0,Yk.__unstableUseShortcutEventMatch)();return(0,m.useRefEffect)((s=>{function l(l){if(!i("core/block-editor/select-all",l))return;const a=t();if(a.length<2&&!(0,Ga.isEntirelySelected)(l.target))return;l.preventDefault();const[c]=a,u=n(c),d=e(u);a.length!==d.length?o(d[0],d[d.length-1]):u&&(s.ownerDocument.defaultView.getSelection().removeAllRanges(),r(u))}return s.addEventListener("keydown",l),()=>{s.removeEventListener("keydown",l)}}),[])}function yw(e,t){e.contentEditable=t,t&&e.focus()}function xw(){const{startMultiSelect:e,stopMultiSelect:t}=(0,g.useDispatch)(ji),{isSelectionEnabled:n,hasSelectedBlock:o,isDraggingBlocks:r,isMultiSelecting:i}=(0,g.useSelect)(ji);return(0,m.useRefEffect)((s=>{const{ownerDocument:l}=s,{defaultView:a}=l;let c,u,d;function p(){t(),a.removeEventListener("mouseup",p),u=a.requestAnimationFrame((()=>{if(!o())return;yw(s,!1);const e=a.getSelection();if(e.rangeCount){const t=e.getRangeAt(0),{commonAncestorContainer:n}=t,o=t.cloneRange();c.contains(n)&&(c.focus(),e.removeAllRanges(),e.addRange(o))}}))}function h({buttons:t,target:o,relatedTarget:l}){o.contains(d)&&(o.contains(l)||r()||1===t&&(i()||s!==o&&"true"===o.getAttribute("contenteditable")&&n()&&(c=o,e(),a.addEventListener("mouseup",p),yw(s,!0))))}return s.addEventListener("mouseout",h),s.addEventListener("mousedown",(function({target:e}){d=e})),()=>{s.removeEventListener("mouseout",h),a.removeEventListener("mouseup",p),a.cancelAnimationFrame(u)}}),[e,t,n,o])}function Sw(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t,t&&e.focus())}function ww(e){const t=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;return t?.closest("[data-wp-block-attribute-key]")}function Cw(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,g.useDispatch)(ji),{getBlockParents:o,getBlockSelectionStart:r,isMultiSelecting:i}=(0,g.useSelect)(ji);return(0,m.useRefEffect)((s=>{const{ownerDocument:l}=s,{defaultView:a}=l;function c(l){const c=a.getSelection();if(!c.rangeCount)return;const u=function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(c),d=function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:0===n&&(0,Ga.isSelectionForward)(e)?t.previousSibling??t.parentElement:t.childNodes[n]}(c);if(!s.contains(u)||!s.contains(d))return;const p=l.shiftKey&&"mouseup"===l.type;if(c.isCollapsed&&!p){if("true"===s.contentEditable&&!i()){Sw(s,!1);let e=u.nodeType===u.ELEMENT_NODE?u:u.parentElement;e=e?.closest("[contenteditable]"),e?.focus()}return}let h=Km(u),g=Km(d);if(p){const e=r(),t=Km(l.target),n=t!==g;(h===g&&c.isCollapsed||!g||n)&&(g=t),h!==e&&(h=e)}if(void 0===h&&void 0===g)return void Sw(s,!1);if(h===g)i()?e(h,h):t(h);else{const t=[...o(h),h],r=[...o(g),g],i=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,r);if(t[i]!==h||r[i]!==g)return void e(t[i],r[i]);const s=ww(u),l=ww(d);if(s&&l){const e=c.getRangeAt(0),t=(0,pe.create)({element:s,range:e,__unstableIsEditableTree:!0}),o=(0,pe.create)({element:l,range:e,__unstableIsEditableTree:!0}),r=t.start??t.end,i=o.start??o.end;n({start:{clientId:h,attributeKey:s.dataset.wpBlockAttributeKey,offset:r},end:{clientId:g,attributeKey:l.dataset.wpBlockAttributeKey,offset:i}})}else e(h,g)}}return l.addEventListener("selectionchange",c),a.addEventListener("mouseup",c),()=>{l.removeEventListener("selectionchange",c),a.removeEventListener("mouseup",c)}}),[e,t,n,o])}function Bw(){const{selectBlock:e}=(0,g.useDispatch)(ji),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,g.useSelect)(ji);return(0,m.useRefEffect)((r=>{function i(i){if(!t()||0!==i.button)return;const s=n(),l=Km(i.target);i.shiftKey?s&&s!==l&&(r.contentEditable=!0,r.focus()):o()&&e(l)}return r.addEventListener("mousedown",i),()=>{r.removeEventListener("mousedown",i)}}),[e,t,n,o])}function Iw(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,getSelectedBlockClientId:n,__unstableIsSelectionMergeable:o,hasMultiSelection:r,getBlockName:i,canInsertBlockType:s,getBlockRootClientId:l,getSelectionStart:a,getSelectionEnd:c,getBlockAttributes:u}=(0,g.useSelect)(ji),{replaceBlocks:d,__unstableSplitSelection:h,removeBlocks:f,__unstableDeleteSelection:b,__unstableExpandSelection:k,__unstableMarkAutomaticChange:v}=(0,g.useDispatch)(ji);return(0,m.useRefEffect)((g=>{function m(e){"true"===g.contentEditable&&e.preventDefault()}function _(m){if(!m.defaultPrevented)if(r())m.keyCode===Wa.ENTER?(g.contentEditable=!1,m.preventDefault(),e()?d(t(),(0,p.createBlock)((0,p.getDefaultBlockName)())):h()):m.keyCode===Wa.BACKSPACE||m.keyCode===Wa.DELETE?(g.contentEditable=!1,m.preventDefault(),e()?f(t()):o()?b(m.keyCode===Wa.DELETE):k()):1!==m.key.length||m.metaKey||m.ctrlKey||(g.contentEditable=!1,o()?b(m.keyCode===Wa.DELETE):(m.preventDefault(),g.ownerDocument.defaultView.getSelection().removeAllRanges()));else if(m.keyCode===Wa.ENTER){if(m.shiftKey||e())return;const t=n(),o=i(t),r=a(),g=c();if(r.attributeKey===g.attributeKey){const e=u(t)[r.attributeKey],n=(0,p.getBlockTransforms)("from").filter((({type:e})=>"enter"===e)),o=(0,p.findTransform)(n,(t=>t.regExp.test(e)));if(o)return d(t,o.transform({content:e})),void v()}if(!(0,p.hasBlockSupport)(o,"splitting",!1)&&!m.__deprecatedOnSplit)return;s(o,l(t))&&(h(),m.preventDefault())}}function y(e){r()&&(g.contentEditable=!1,o()?b():(e.preventDefault(),g.ownerDocument.defaultView.getSelection().removeAllRanges()))}return g.addEventListener("beforeinput",m),g.addEventListener("keydown",_),g.addEventListener("compositionstart",y),()=>{g.removeEventListener("beforeinput",m),g.removeEventListener("keydown",_),g.removeEventListener("compositionstart",y)}}),[])}function jw(){const{getBlockName:e}=(0,g.useSelect)(ji),{getBlockType:t}=(0,g.useSelect)(p.store),{createSuccessNotice:n}=(0,g.useDispatch)(pr.store);return(0,h.useCallback)(((o,r)=>{let i="";if("copyStyles"===o)i=(0,T.__)("Styles copied to clipboard.");else if(1===r.length){const n=r[0],s=t(e(n))?.title;i="copy"===o?(0,T.sprintf)((0,T.__)('Copied "%s" to clipboard.'),s):(0,T.sprintf)((0,T.__)('Moved "%s" to clipboard.'),s)}else i="copy"===o?(0,T.sprintf)((0,T._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,T.sprintf)((0,T._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(i,{type:"snackbar"})}),[n,e,t])}function Ew({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}catch(e){return}n=function(e){const t="\x3c!--StartFragment--\x3e",n=e.indexOf(t);if(!(n>-1))return e;const o=(e=e.substring(n+20)).indexOf("\x3c!--EndFragment--\x3e");return o>-1&&(e=e.substring(0,o)),e}(n),n=function(e){const t="<meta charset='utf-8'>";return e.startsWith(t)?e.slice(22):e}(n);const o=(0,Ga.getFilesFromDataTransfer)(e);return o.length&&!function(e,t){if(t&&1===e?.length&&0===e[0].type.indexOf("image/")){const e=/<\s*img\b/gi;if(1!==t.match(e)?.length)return!0;const n=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(n))return!0}return!1}(o,n)?{files:o}:{html:n,plainText:t,files:[]}}const Tw=Symbol("requiresWrapperOnCopy");function Mw(e,t,n){let o=t;const[r]=t;if(r){if(n.select(p.store).getBlockType(r.name)[Tw]){const{getBlockRootClientId:e,getBlockName:t,getBlockAttributes:i}=n.select(ji),s=e(r.clientId),l=t(s);l&&(o=(0,p.createBlock)(l,i(s),o))}}const i=(0,p.serialize)(o);e.clipboardData.setData("text/plain",function(e){e=e.replace(/<br>/g,"\n");return(0,Ga.__unstableStripHTML)(e).trim().replace(/\n\n+/g,"\n\n")}(i)),e.clipboardData.setData("text/html",i)}function Pw(){const e=(0,g.useRegistry)(),{getBlocksByClientId:t,getSelectedBlockClientIds:n,hasMultiSelection:o,getSettings:r,getBlockName:i,__unstableIsFullySelected:s,__unstableIsSelectionCollapsed:l,__unstableIsSelectionMergeable:a,__unstableGetSelectedBlocksWithPartialSelection:c,canInsertBlockType:u,getBlockRootClientId:d}=(0,g.useSelect)(ji),{flashBlock:h,removeBlocks:f,replaceBlocks:b,__unstableDeleteSelection:k,__unstableExpandSelection:v,__unstableSplitSelection:_}=(0,g.useDispatch)(ji),y=jw();return(0,m.useRefEffect)((g=>{function m(m){if(m.defaultPrevented)return;const x=n();if(0===x.length)return;if(!o()){const{target:e}=m,{ownerDocument:t}=e;if("copy"===m.type||"cut"===m.type?(0,Ga.documentHasUncollapsedSelection)(t):(0,Ga.documentHasSelection)(t)&&!t.activeElement.isContentEditable)return}const{activeElement:S}=m.target.ownerDocument;if(!g.contains(S))return;const w=a(),C=l()||s(),B=!C&&!w;if("copy"===m.type||"cut"===m.type)if(m.preventDefault(),1===x.length&&h(x[0]),B)v();else{let n;if(y(m.type,x),C)n=t(x);else{const[e,o]=c();n=[e,...t(x.slice(1,x.length-1)),o]}Mw(m,n,e)}if("cut"===m.type)C&&!B?f(x):(m.target.ownerDocument.activeElement.contentEditable=!1,k());else if("paste"===m.type){const{__experimentalCanUserUseUnfilteredHTML:e,mediaUpload:t}=r();if("true"===m.clipboardData.getData("rich-text"))return;const{plainText:n,html:l,files:a}=Ew(m),c=s();let h=[];if(a.length){if(!t)return void m.preventDefault();const e=(0,p.getBlockTransforms)("from");h=a.reduce(((t,n)=>{const o=(0,p.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat()}else h=(0,p.pasteHandler)({HTML:l,plainText:n,mode:c?"BLOCKS":"AUTO",canUserUseUnfilteredHTML:e});if("string"==typeof h)return;if(c)return b(x,h,h.length-1,-1),void m.preventDefault();if(!o()&&!(0,p.hasBlockSupport)(i(x[0]),"splitting",!1)&&!m.__deprecatedOnSplit)return;const[g]=x,f=d(g),k=[];for(const e of h)if(u(e.name,f))k.push(e);else{const t=i(f),n=e.name!==t?(0,p.switchToBlockType)(e,t):[e];if(!n)return;for(const e of n)for(const t of e.innerBlocks)k.push(t)}_(k),m.preventDefault()}}return g.ownerDocument.addEventListener("copy",m),g.ownerDocument.addEventListener("cut",m),g.ownerDocument.addEventListener("paste",m),()=>{g.ownerDocument.removeEventListener("copy",m),g.ownerDocument.removeEventListener("cut",m),g.ownerDocument.removeEventListener("paste",m)}}),[])}function Rw(){const[e,t,n]=function(){const e=(0,h.useRef)(),t=(0,h.useRef)(),n=(0,h.useRef)(),{hasMultiSelection:o,getSelectedBlockClientId:r,getBlockCount:i,getBlockOrder:s,getLastFocus:l,getSectionRootClientId:a,isZoomOut:c}=G((0,g.useSelect)(ji)),{setLastFocus:u}=G((0,g.useDispatch)(ji)),p=(0,h.useRef)();function f(t){const n=e.current.ownerDocument===t.target.ownerDocument?e.current:e.current.ownerDocument.defaultView.frameElement;if(p.current)p.current=null;else if(o())e.current.focus();else if(r())l()?.current?l().current.focus():e.current.querySelector(`[data-block="${r()}"]`).focus();else if(c()){const t=a(),o=s(t);o.length?e.current.querySelector(`[data-block="${o[0]}"]`).focus():t?e.current.querySelector(`[data-block="${t}"]`).focus():n.focus()}else{const o=t.target.compareDocumentPosition(n)&t.target.DOCUMENT_POSITION_FOLLOWING,r=Ga.focus.tabbable.find(e.current);r.length&&(o?r[0]:r[r.length-1]).focus()}}const b=(0,d.jsx)("div",{ref:t,tabIndex:"0",onFocus:f}),k=(0,d.jsx)("div",{ref:n,tabIndex:"0",onFocus:f}),v=(0,m.useRefEffect)((o=>{function r(e){if(e.defaultPrevented)return;if(e.keyCode!==Wa.TAB)return;if(!n.current||!t.current)return;const{target:o,shiftKey:r}=e,i=r?"findPrevious":"findNext",s=Ga.focus.tabbable[i](o),l=o.closest("[data-block]"),a=l&&s&&($m(l,s)||Wm(l,s));if((0,Ga.isFormElement)(s)&&a)return;const c=r?t:n;p.current=!0,c.current.focus({preventScroll:!0})}function s(e){u({...l(),current:e.target});const{ownerDocument:t}=o;!e.relatedTarget&&e.target.hasAttribute("data-block")&&t.activeElement===t.body&&0===i()&&o.focus()}function a(o){if(o.keyCode!==Wa.TAB)return;if("region"===o.target?.getAttribute("role"))return;if(e.current===o.target)return;const r=o.shiftKey?"findPrevious":"findNext",i=Ga.focus.tabbable[r](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:c}=o,{defaultView:d}=c;return d.addEventListener("keydown",a),o.addEventListener("keydown",r),o.addEventListener("focusout",s),()=>{d.removeEventListener("keydown",a),o.removeEventListener("keydown",r),o.removeEventListener("focusout",s)}}),[]);return[b,(0,m.useMergeRefs)([e,v]),k]}(),o=(0,g.useSelect)((e=>e(ji).hasMultiSelection()),[]);return[e,(0,m.useMergeRefs)([t,Pw(),Iw(),xw(),Cw(),Bw(),bw(),_w(),vw(),(0,m.useRefEffect)((e=>(e.tabIndex=0,e.dataset.hasMultiSelection=o,o?(e.setAttribute("aria-label",(0,T.__)("Multiple selected blocks")),()=>{delete e.dataset.hasMultiSelection,e.removeAttribute("aria-label")}):()=>{delete e.dataset.hasMultiSelection})),[o])]),n]}var Aw=(0,h.forwardRef)((function({children:e,...t},n){const[o,r,i]=Rw();return(0,d.jsxs)(d.Fragment,{children:[o,(0,d.jsx)("div",{...t,ref:(0,m.useMergeRefs)([r,n]),className:ms(t.className,"block-editor-writing-flow"),children:e}),i]})}));let Nw=null;function Lw({frameSize:e,containerWidth:t,maxContainerWidth:n,scaleContainerWidth:o}){return(Math.min(t,n)-2*e)/o}function Dw({frameSize:e,iframeDocument:t,maxContainerWidth:n=750,scale:o}){const[r,{height:i}]=(0,m.useResizeObserver)(),[s,{width:l,height:a}]=(0,m.useResizeObserver)(),c=(0,h.useRef)(0),u=1!==o,d=(0,m.useReducedMotion)(),p="auto-scaled"===o,g=(0,h.useRef)(!1),f=(0,h.useRef)(null);(0,h.useEffect)((()=>{u||(c.current=l)}),[l,u]);const b=Math.max(c.current,l),k=p?Lw({frameSize:e,containerWidth:l,maxContainerWidth:n,scaleContainerWidth:b}):o,v=(0,h.useRef)({scaleValue:k,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),_=(0,h.useRef)({scaleValue:k,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),y=(0,h.useCallback)((()=>{const{scrollTop:e}=v.current,{scrollTop:n}=_.current;return t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top",`${e}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next",`${n}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior",v.current.scrollHeight===v.current.containerHeight?"auto":"scroll"),t.documentElement.classList.add("zoom-out-animation"),t.documentElement.animate(function(e,t){const{scaleValue:n,frameSize:o,scrollTop:r}=e,{scaleValue:i,frameSize:s,scrollTop:l}=t;return[{translate:"0 0",scale:n,paddingTop:o/n+"px",paddingBottom:o/n+"px"},{translate:`0 ${r-l}px`,scale:i,paddingTop:s/i+"px",paddingBottom:s/i+"px"}]}(v.current,_.current),{easing:"cubic-bezier(0.46, 0.03, 0.52, 0.96)",duration:400})}),[t]),x=(0,h.useCallback)((()=>{g.current=!1,f.current=null,t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",_.current.scaleValue),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${_.current.frameSize}px`),t.documentElement.classList.remove("zoom-out-animation"),t.documentElement.scrollTop=_.current.scrollTop,t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior"),v.current=_.current}),[t]),S=(0,h.useRef)(!1);return(0,h.useEffect)((()=>{const e=t&&S.current!==u;if(S.current=u,e&&(g.current=!0,u))return t.documentElement.classList.add("is-zoomed-out"),()=>{t.documentElement.classList.remove("is-zoomed-out")}}),[t,u]),(0,h.useEffect)((()=>{if(t&&(p&&1!==v.current.scaleValue&&(v.current.scaleValue=Lw({frameSize:v.current.frameSize,containerWidth:l,maxContainerWidth:n,scaleContainerWidth:l})),k<1&&(g.current||(t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",k),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${e}px`)),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-content-height",`${i}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-inner-height",`${a}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-container-width",`${l}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale-container-width",`${b}px`)),g.current))if(g.current=!1,f.current){f.current.reverse();const e=v.current,t=_.current;v.current=t,_.current=e}else v.current.scrollTop=t.documentElement.scrollTop,v.current.scrollHeight=t.documentElement.scrollHeight,v.current.containerHeight=a,_.current={scaleValue:k,frameSize:e,containerHeight:t.documentElement.clientHeight},_.current.scrollHeight=function(e,t){const{scaleValue:n,scrollHeight:o}=e,{frameSize:r,scaleValue:i}=t;return o*(i/n)+2*r}(v.current,_.current),_.current.scrollTop=function(e,t){const{containerHeight:n,frameSize:o,scaleValue:r,scrollTop:i}=e,{containerHeight:s,frameSize:l,scaleValue:a,scrollHeight:c}=t;let u=i;u=(u+n/2-o)/r-n/2,u=(u+s/2)*a+l-s/2,u=i<=o?0:u;const d=c-s;return Math.round(Math.min(Math.max(0,u),Math.max(0,d)))}(v.current,_.current),f.current=y(),d?x():f.current.onfinish=x}),[y,x,d,p,k,e,t,i,l,a,n,b]),{isZoomedOut:u,scaleContainerWidth:b,contentResizeListener:r,containerResizeListener:s}}function Ow(e,t,n){const o={};for(const t in e)o[t]=e[t];if(e instanceof n.contentDocument.defaultView.MouseEvent){const e=n.getBoundingClientRect();o.clientX+=e.left,o.clientY+=e.top}const r=new t(e.type,o);o.defaultPrevented&&r.preventDefault();!n.dispatchEvent(r)&&e.preventDefault()}function zw(e){return(0,m.useRefEffect)((()=>{const{defaultView:t}=e;if(!t)return;const{frameElement:n}=t,o=e.documentElement,r=["dragover","mousemove"],i={};for(const e of r)i[e]=e=>{const t=Object.getPrototypeOf(e).constructor.name;Ow(e,window[t],n)},o.addEventListener(e,i[e]);return()=>{for(const e of r)o.removeEventListener(e,i[e])}}))}function Vw({contentRef:e,children:t,tabIndex:n=0,scale:o=1,frameSize:r=0,readonly:i,forwardedRef:s,title:l=(0,T.__)("Editor canvas"),...a}){const{resolvedAssets:c,isPreviewMode:u}=(0,g.useSelect)((e=>{const{getSettings:t}=e(ji),n=t();return{resolvedAssets:n.__unstableResolvedAssets,isPreviewMode:n.isPreviewMode}}),[]),{styles:p="",scripts:f=""}=c,[b,k]=(0,h.useState)(),[v,_]=(0,h.useState)([]),y=PS(),[x,S,w]=Rw(),C=(0,m.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(e){"A"===e.target.tagName&&e.target.getAttribute("href")?.startsWith("#")&&(e.preventDefault(),t.defaultView.location.hash=e.target.getAttribute("href").slice(1))}e._load=()=>{k(e.contentDocument)};const{ownerDocument:r}=e;function i(){const{contentDocument:i}=e,{documentElement:s}=i;t=i,s.classList.add("block-editor-iframe__html"),y(s),i.dir=r.dir;for(const e of Nw||(Nw=Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:o}=t;if(null===n)return e;if(!o)return e;if(n.id.startsWith("wp-"))return e;if(!n.id)return e;if(function e(t){return Array.from(t).find((({selectorText:t,conditionText:n,cssRules:o})=>n?e(o):t&&(t.includes(".editor-styles-wrapper")||t.includes(".wp-block"))))}(o)){const t="STYLE"===n.tagName;if(t){const t=n.id.replace("-inline-css","-css"),o=document.getElementById(t);o&&e.push(o.cloneNode(!0))}if(e.push(n.cloneNode(!0)),!t){const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.push(o.cloneNode(!0))}}return e}),[]),Nw))i.getElementById(e.id)||(i.head.appendChild(e.cloneNode(!0)),u||console.warn(`${e.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,e));t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1),t.addEventListener("click",o)}return _(Array.from(r.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),e.addEventListener("load",i),()=>{delete e._load,e.removeEventListener("load",i),t?.removeEventListener("dragover",n),t?.removeEventListener("drop",n),t?.removeEventListener("click",o)}}),[]),{contentResizeListener:B,containerResizeListener:I,isZoomedOut:j,scaleContainerWidth:E}=Dw({scale:o,frameSize:parseInt(r),iframeDocument:b}),M=(0,m.useDisabled)({isDisabled:!i}),P=(0,m.useMergeRefs)([zw(b),e,y,S,M]),R=`<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset="utf-8">\n\t\t<base href="${window.location.origin}">\n\t\t<script>window.frameElement._load()<\/script>\n\t\t<style>\n\t\t\thtml{\n\t\t\t\theight: auto !important;\n\t\t\t\tmin-height: 100%;\n\t\t\t}\n\t\t\t/* Lowest specificity to not override global styles */\n\t\t\t:where(body) {\n\t\t\t\tmargin: 0;\n\t\t\t\t/* Default background color in case zoom out mode background\n\t\t\t\tcolors the html element */\n\t\t\t\tbackground-color: white;\n\t\t\t}\n\t\t</style>\n\t\t${p}\n\t\t${f}\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()<\/script>\n\t</body>\n</html>`,[A,N]=(0,h.useMemo)((()=>{const e=URL.createObjectURL(new window.Blob([R],{type:"text/html"}));return[e,()=>URL.revokeObjectURL(e)]}),[R]);(0,h.useEffect)((()=>N),[N]);const L=n>=0&&!u,D=(0,d.jsxs)(d.Fragment,{children:[L&&x,(0,d.jsx)("iframe",{...a,style:{...a.style,height:a.style?.height,border:0},ref:(0,m.useMergeRefs)([s,C]),tabIndex:n,src:A,title:l,onKeyDown:e=>{if(a.onKeyDown&&a.onKeyDown(e),e.currentTarget.ownerDocument!==e.target.ownerDocument){const{stopPropagation:t}=e.nativeEvent;e.nativeEvent.stopPropagation=()=>{},e.stopPropagation(),e.nativeEvent.stopPropagation=t,Ow(e,window.KeyboardEvent,e.currentTarget)}},children:b&&(0,h.createPortal)((0,d.jsxs)("body",{ref:P,className:ms("block-editor-iframe__body","editor-styles-wrapper",...v),children:[B,(0,d.jsx)(ws.__experimentalStyleProvider,{document:b,children:t})]}),b.documentElement)}),L&&w]});return(0,d.jsxs)("div",{className:"block-editor-iframe__container",children:[I,(0,d.jsx)("div",{className:ms("block-editor-iframe__scale-container",j&&"is-zoomed-out"),style:{"--wp-block-editor-iframe-zoom-out-scale-container-width":j&&`${E}px`},children:D})]})}var Fw=(0,h.forwardRef)((function(e,t){return(0,g.useSelect)((e=>e(ji).getSettings().__internalIsInitialized),[])?(0,d.jsx)(Vw,{...e,forwardedRef:t}):null}));const Hw={attribute:/\[\s*(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?(?<name>[-\w\P{ASCII}]+)\s*(?:(?<operator>\W?=)\s*(?<value>.+?)\s*(\s(?<caseSensitive>[iIsS]))?\s*)?\]/gu,id:/#(?<name>[-\w\P{ASCII}]+)/gu,class:/\.(?<name>[-\w\P{ASCII}]+)/gu,comma:/\s*,\s*/g,combinator:/\s*[\s>+~]\s*/g,"pseudo-element":/::(?<name>[-\w\P{ASCII}]+)(?:\((?<argument>¶*)\))?/gu,"pseudo-class":/:(?<name>[-\w\P{ASCII}]+)(?:\((?<argument>¶*)\))?/gu,universal:/(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?\*/gu,type:/(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?(?<name>[-\w\P{ASCII}]+)/gu},Uw=new Set(["combinator","comma"]),Gw=(new Set(["not","is","where","has","matches","-moz-any","-webkit-any","nth-child","nth-last-child"]),e=>{switch(e){case"pseudo-element":case"pseudo-class":return new RegExp(Hw[e].source.replace("(?<argument>¶*)","(?<argument>.*)"),"gu");default:return Hw[e]}});function $w(e,t){let n=0,o="";for(;t<e.length;t++){const r=e[t];switch(r){case"(":++n;break;case")":--n}if(o+=r,0===n)return o}return o}const Ww=/(['"])([^\\\n]+?)\1/g,Kw=/\\./g;function Zw(e,t=Hw){if(""===(e=e.trim()))return[];const n=[];e=(e=e.replace(Kw,((e,t)=>(n.push({value:e,offset:t}),"".repeat(e.length))))).replace(Ww,((e,t,o,r)=>(n.push({value:e,offset:r}),`${t}${"".repeat(o.length)}${t}`)));{let t,o=0;for(;(t=e.indexOf("(",o))>-1;){const r=$w(e,t);n.push({value:r,offset:t}),e=`${e.substring(0,t)}(${"¶".repeat(r.length-2)})${e.substring(t+r.length)}`,o=t+r.length}}const o=function(e,t=Hw){if(!e)return[];const n=[e];for(const[e,o]of Object.entries(t))for(let t=0;t<n.length;t++){const r=n[t];if("string"!=typeof r)continue;o.lastIndex=0;const i=o.exec(r);if(!i)continue;const s=i.index-1,l=[],a=i[0],c=r.slice(0,s+1);c&&l.push(c),l.push({...i.groups,type:e,content:a});const u=r.slice(s+a.length+1);u&&l.push(u),n.splice(t,1,...l)}let o=0;for(const e of n)switch(typeof e){case"string":throw new Error(`Unexpected sequence ${e} found at index ${o}`);case"object":o+=e.content.length,e.pos=[o-e.content.length,o],Uw.has(e.type)&&(e.content=e.content.trim()||" ")}return n}(e,t),r=new Set;for(const e of n.reverse())for(const t of o){const{offset:n,value:o}=e;if(!(t.pos[0]<=n&&n+o.length<=t.pos[1]))continue;const{content:i}=t,s=n-t.pos[0];t.content=i.slice(0,s)+o+i.slice(s+o.length),t.content!==i&&r.add(t)}for(const e of r){const t=Gw(e.type);if(!t)throw new Error(`Unknown token type: ${e.type}`);t.lastIndex=0;const n=t.exec(e.content);if(!n)throw new Error(`Unable to parse content for ${e.type}: ${e.content}`);Object.assign(e,n.groups)}return o}function*qw(e,t){switch(e.type){case"list":for(let t of e.list)yield*qw(t,e);break;case"complex":yield*qw(e.left,e),yield*qw(e.right,e);break;case"compound":yield*e.list.map((t=>[t,e]));break;default:yield[e,t]}}var Yw=n(9656),Xw=n.n(Yw),Qw=n(356),Jw=n.n(Qw),eC=n(1443),tC=n.n(eC),nC=n(5404),oC=n.n(nC);const rC=new Map,iC=[{type:"type",content:"body"},{type:"type",content:"html"},{type:"pseudo-class",content:":root"},{type:"pseudo-class",content:":where(body)"},{type:"pseudo-class",content:":where(:root)"},{type:"pseudo-class",content:":where(html)"}];function sC(e,t){const n=Zw(t);let o=-1;for(let e=n.findLastIndex((({content:e,type:t})=>iC.some((n=>e===n.content&&t===n.type))))+1;e<n.length;e++)if("combinator"===n[e].type){o=e;break}const r=Zw(e);return n.splice(-1===o?n.length:o,0,{type:"combinator",content:" "},...r),function(e){let t;return t=Array.isArray(e)?e:[...qw(e)].map((([e])=>e)),t.map((e=>e.content)).join("")}(n)}var lC=(e,t="",n)=>{let o=rC.get(t);return o||(o=new WeakMap,rC.set(t,o)),e.map((e=>{let r=o.get(e);return r||(r=function({css:e,ignoredSelectors:t=[],baseURL:n},o="",r){if(!o&&!n)return e;try{const i=[...t,...r?.ignoredSelectors??[],o];return new(Xw())([o&&tC()({prefix:o,transform:(e,t,n)=>i.some((e=>e instanceof RegExp?t.match(e):t.includes(e)))?t:iC.some((e=>t.startsWith(e.content)))?sC(e,t):n}),n&&oC()({rootUrl:n})].filter(Boolean)).process(e,{}).css}catch(e){return e instanceof Jw()?console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",e.message+"\n"+e.showSourceCode(!1)):console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",e),null}}(e,t,n),o.set(e,r)),r}))};function aC(e,t){return(0,h.useCallback)((e=>{if(!e)return;const{ownerDocument:n}=e,{defaultView:o,body:r}=n,i=t?n.querySelector(t):r;let s;if(i)s=o?.getComputedStyle(i,null).getPropertyValue("background-color");else{const e=n.createElement("div");e.classList.add("editor-styles-wrapper"),r.appendChild(e),s=o?.getComputedStyle(e,null).getPropertyValue("background-color"),r.removeChild(e)}const l=wd(s);l.luminance()>.5||0===l.alpha()?r.classList.remove("is-dark-theme"):r.classList.add("is-dark-theme")}),[e,t])}Bd([Id,Td]);var cC=(0,h.memo)((function({styles:e,scope:t,transformOptions:n}){const o=(0,g.useSelect)((e=>G(e(ji)).getStyleOverrides()),[]),[r,i]=(0,h.useMemo)((()=>{const r=Object.values(e??[]);for(const[e,t]of o){const n=r.findIndex((({id:t})=>e===t)),o={...t,id:e};-1===n?r.push(o):r[n]=o}return[lC(r.filter((e=>e?.css)),t,n),r.filter((e=>"svgs"===e.__unstableType)).map((e=>e.assets)).join("")]}),[e,o,t,n]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("style",{ref:aC(r,t)}),r.map(((e,t)=>(0,d.jsx)("style",{children:e},t))),(0,d.jsx)(ws.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 0 0",width:"0",height:"0",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"},dangerouslySetInnerHTML:{__html:i}})]})}));const uC=(0,h.memo)(dw),dC=2e3,pC=[];function hC({viewportWidth:e,containerWidth:t,minHeight:n,additionalStyles:o=pC}){e||(e=t);const[r,{height:i}]=(0,m.useResizeObserver)(),{styles:s}=(0,g.useSelect)((e=>({styles:e(ji).getSettings().styles})),[]),l=(0,h.useMemo)((()=>s?[...s,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...o]:s),[s,o]),a=t/e,c=i?t/(i*a):0;return(0,d.jsx)(ws.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${a})`,aspectRatio:c,maxHeight:i>dC?dC*a:void 0,minHeight:n},children:(0,d.jsxs)(Fw,{contentRef:(0,m.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:e,height:i,pointerEvents:"none",maxHeight:dC,minHeight:0!==a&&a<1&&n?n/a:n},children:[(0,d.jsx)(cC,{styles:l}),r,(0,d.jsx)(uC,{renderAppender:!1})]})})}function gC(e){const[t,{width:n}]=(0,m.useResizeObserver)();return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{style:{position:"relative",width:"100%",height:0},children:t}),(0,d.jsx)("div",{className:"block-editor-block-preview__container",children:!!n&&(0,d.jsx)(hC,{...e,containerWidth:n})})]})}const mC=(0,window.wp.priorityQueue.createQueue)();const fC=[];const bC=(0,h.memo)((function({blocks:e,viewportWidth:t=1200,minHeight:n,additionalStyles:o=fC,__experimentalMinHeight:r,__experimentalPadding:i}){r&&(n=r,I()("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),i&&(o=[...o,{css:`body { padding: ${i}px; }`}],I()("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const s=(0,g.useSelect)((e=>e(ji).getSettings()),[]),l=(0,h.useMemo)((()=>({...s,focusMode:!1,isPreviewMode:!0})),[s]),a=(0,h.useMemo)((()=>Array.isArray(e)?e:[e]),[e]);return e&&0!==e.length?(0,d.jsx)(nv,{value:a,settings:l,children:(0,d.jsx)(gC,{viewportWidth:t,minHeight:n,additionalStyles:o})}):null}));bC.Async=function({children:e,placeholder:t}){const[n,o]=(0,h.useState)(!1);return(0,h.useEffect)((()=>{const e={};return mC.add(e,(()=>{(0,h.flushSync)((()=>{o(!0)}))})),()=>{mC.cancel(e)}}),[]),n?e:t};var kC=bC;function vC({blocks:e,props:t={},layout:n}){const o=(0,g.useSelect)((e=>e(ji).getSettings()),[]),r=(0,h.useMemo)((()=>({...o,styles:void 0,focusMode:!1,isPreviewMode:!0})),[o]),i=(0,m.useDisabled)(),s=(0,m.useMergeRefs)([t.ref,i]),l=(0,h.useMemo)((()=>Array.isArray(e)?e:[e]),[e]),a=(0,d.jsxs)(nv,{value:l,settings:r,children:[(0,d.jsx)(cC,{}),(0,d.jsx)(mw,{renderAppender:!1,layout:n})]});return{...t,ref:s,className:ms(t.className,"block-editor-block-preview__live-content","components-disabled"),children:e?.length?a:null}}var _C=function({item:e}){const{name:t,title:n,icon:o,description:r,initialAttributes:i,example:s}=e,l=(0,p.isReusableBlock)(e),a=(0,h.useMemo)((()=>s?(0,p.getBlockFromExample)(t,{attributes:{...s.attributes,...i},innerBlocks:s.innerBlocks}):(0,p.createBlock)(t,i)),[t,s,i]),c=144,u=s?.viewportWidth??500,g=280/u,m=0!==g&&g<1?c/g:c;return(0,d.jsxs)("div",{className:"block-editor-inserter__preview-container",children:[(0,d.jsx)("div",{className:"block-editor-inserter__preview",children:l||s?(0,d.jsx)("div",{className:"block-editor-inserter__preview-content",children:(0,d.jsx)(kC,{blocks:a,viewportWidth:u,minHeight:c,additionalStyles:[{css:`\n\t\t\t\t\t\t\t\t\t\tbody { \n\t\t\t\t\t\t\t\t\t\t\tpadding: 24px;\n\t\t\t\t\t\t\t\t\t\t\tmin-height:${Math.round(m)}px;\n\t\t\t\t\t\t\t\t\t\t\tdisplay:flex;\n\t\t\t\t\t\t\t\t\t\t\talign-items:center;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t.is-root-container { width: 100%; }\n\t\t\t\t\t\t\t\t\t`}]})}):(0,d.jsx)("div",{className:"block-editor-inserter__preview-content-missing",children:(0,T.__)("No preview available.")})}),!l&&(0,d.jsx)(Xb,{title:n,icon:o,description:r})]})};var yC=(0,h.forwardRef)((function({isFirst:e,as:t,children:n,...o},r){return(0,d.jsx)(ws.Composite.Item,{ref:r,role:"option",accessibleWhenDisabled:!0,...o,render:o=>{const r={...o,tabIndex:e?0:o.tabIndex};return t?(0,d.jsx)(t,{...r,children:n}):"function"==typeof n?n(r):(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,...r,children:n})}})})),xC=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"})});function SC({count:e,icon:t,isPattern:n,fadeWhenDisabled:o}){const r=n&&(0,T.__)("Pattern");return(0,d.jsx)("div",{className:"block-editor-block-draggable-chip-wrapper",children:(0,d.jsx)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip",children:(0,d.jsxs)(ws.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content",children:[(0,d.jsx)(ws.FlexItem,{children:t?(0,d.jsx)(Vu,{icon:t}):r||(0,T.sprintf)((0,T._n)("%d block","%d blocks",e),e)}),(0,d.jsx)(ws.FlexItem,{children:(0,d.jsx)(Vu,{icon:xC})}),o&&(0,d.jsx)(ws.FlexItem,{className:"block-editor-block-draggable-chip__disabled",children:(0,d.jsx)("span",{className:"block-editor-block-draggable-chip__disabled-icon"})})]})})})}var wC=({isEnabled:e,blocks:t,icon:n,children:o,pattern:r})=>{const i=(0,g.useSelect)((e=>{const{getBlockType:n}=e(p.store);return 1===t.length&&n(t[0].name)?.icon}),[t]),{startDragging:s,stopDragging:l}=G((0,g.useDispatch)(ji)),a=(0,h.useMemo)((()=>r?.type===it.user&&"unsynced"!==r?.syncStatus?[(0,p.createBlock)("core/block",{ref:r.id})]:void 0),[r?.type,r?.syncStatus,r?.id]);if(!e)return o({draggable:!1,onDragStart:void 0,onDragEnd:void 0});const c=a??t;return(0,d.jsx)(ws.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:{type:"inserter",blocks:c},onDragStart:e=>{s();for(const t of c){const n=`wp-block:${t.name}`;e.dataTransfer.items.add("",n)}},onDragEnd:()=>{l()},__experimentalDragComponent:(0,d.jsx)(SC,{count:t.length,icon:n||!r&&i,isPattern:!!r}),children:({onDraggableStart:e,onDraggableEnd:t})=>o({draggable:!0,onDragStart:e,onDragEnd:t})})};var CC=(0,h.memo)((function({className:e,isFirst:t,item:n,onSelect:o,onHover:r,isDraggable:i,...s}){const l=(0,h.useRef)(!1),a=n.icon?{backgroundColor:n.icon.background,color:n.icon.foreground}:{},c=(0,h.useMemo)((()=>[(0,p.createBlock)(n.name,n.initialAttributes,(0,p.createBlocksFromInnerBlocksTemplate)(n.innerBlocks))]),[n.name,n.initialAttributes,n.innerBlocks]),u=(0,p.isReusableBlock)(n)&&"unsynced"!==n.syncStatus||(0,p.isTemplatePart)(n);return(0,d.jsx)(wC,{isEnabled:i&&!n.isDisabled,blocks:c,icon:n.icon,children:({draggable:i,onDragStart:c,onDragEnd:p})=>(0,d.jsx)("div",{className:ms("block-editor-block-types-list__list-item",{"is-synced":u}),draggable:i,onDragStart:e=>{l.current=!0,c&&(r(null),c(e))},onDragEnd:e=>{l.current=!1,p&&p(e)},children:(0,d.jsxs)(yC,{isFirst:t,className:ms("block-editor-block-types-list__item",e),disabled:n.isDisabled,onClick:e=>{e.preventDefault(),o(n,(0,Wa.isAppleOS)()?e.metaKey:e.ctrlKey),r(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Wa.ENTER&&(e.preventDefault(),o(n,(0,Wa.isAppleOS)()?e.metaKey:e.ctrlKey),r(null))},onMouseEnter:()=>{l.current||r(n)},onMouseLeave:()=>r(null),...s,children:[(0,d.jsx)("span",{className:"block-editor-block-types-list__item-icon",style:a,children:(0,d.jsx)(Vu,{icon:n.icon,showColors:!0})}),(0,d.jsx)("span",{className:"block-editor-block-types-list__item-title",children:(0,d.jsx)(ws.__experimentalTruncate,{numberOfLines:3,children:n.title})})]})})})}));var BC=(0,h.forwardRef)((function(e,t){const[n,o]=(0,h.useState)(!1);return(0,h.useEffect)((()=>{n&&(0,Uo.speak)((0,T.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,d.jsx)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)},...e})}));var IC=(0,h.forwardRef)((function(e,t){return(0,d.jsx)(ws.Composite.Group,{role:"presentation",ref:t,...e})}));function jC(e,t){const n=[];for(let o=0,r=e.length;o<r;o+=t)n.push(e.slice(o,o+t));return n}var EC=function e({items:t=[],onSelect:n,onHover:o=()=>{},children:r,label:i,isDraggable:s=!0}){const l="block-editor-block-types-list",a=(0,m.useInstanceId)(e,l);return(0,d.jsxs)(BC,{className:l,"aria-label":i,children:[jC(t,3).map(((e,t)=>(0,d.jsx)(IC,{children:e.map(((e,r)=>(0,d.jsx)(CC,{item:e,className:(0,p.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:s&&!e.isDisabled,isFirst:0===t&&0===r,rowId:`${a}-${t}`},e.id)))},t))),r]})};var TC=function({title:e,icon:t,children:n}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"block-editor-inserter__panel-header",children:[(0,d.jsx)("h2",{className:"block-editor-inserter__panel-title",children:e}),(0,d.jsx)(ws.Icon,{icon:t})]}),(0,d.jsx)("div",{className:"block-editor-inserter__panel-content",children:n})]})};var MC=(e,t,n)=>{const o=(0,h.useMemo)((()=>({[pt]:!!n})),[n]),[r]=(0,g.useSelect)((t=>[t(ji).getInserterItems(e,o)]),[e,o]),{getClosestAllowedInsertionPoint:i}=G((0,g.useSelect)(ji)),{createErrorNotice:s}=(0,g.useDispatch)(pr.store),[l,a]=(0,g.useSelect)((e=>{const{getCategories:t,getCollections:n}=e(p.store);return[t(),n()]}),[]);return[r,l,a,(0,h.useCallback)((({name:n,initialAttributes:o,innerBlocks:r,syncStatus:l,content:a},c)=>{const u=i(n,e);if(null===u){const e=(0,p.getBlockType)(n)?.title??n;return void s((0,T.sprintf)((0,T.__)('Block "%s" can\'t be inserted.'),e),{type:"snackbar",id:"inserter-notice"})}const d="unsynced"===l?(0,p.parse)(a,{__unstableSkipMigrationLogs:!0}):(0,p.createBlock)(n,o,(0,p.createBlocksFromInnerBlocksTemplate)(r));t(d,void 0,c,u)}),[i,e,t,s])]};function PC({key:e,children:t}){return(0,d.jsx)(h.Fragment,{children:t},e)}var RC=function({children:e}){return(0,d.jsx)(ws.Composite,{focusShift:!0,focusWrap:"horizontal",render:PC,children:e})};var AC=function(){return(0,d.jsx)("div",{className:"block-editor-inserter__no-results",children:(0,d.jsx)("p",{children:(0,T.__)("No results found.")})})};const NC=[];function LC({items:e,collections:t,categories:n,onSelectItem:o,onHover:r,showMostUsedBlocks:i,className:s}){const l=(0,h.useMemo)((()=>xt(e,"frecency","desc").slice(0,6)),[e]),a=(0,h.useMemo)((()=>e.filter((e=>!e.category))),[e]),c=(0,h.useMemo)((()=>{const n={...t};return Object.keys(t).forEach((t=>{n[t]=e.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===n[t].length&&delete n[t]})),n}),[e,t]);(0,h.useEffect)((()=>()=>r(null)),[]);const u=(0,m.useAsyncList)(n),p=n.length===u.length,g=(0,h.useMemo)((()=>Object.entries(t)),[t]),f=(0,m.useAsyncList)(p?g:NC);return(0,d.jsxs)("div",{className:s,children:[i&&e.length>3&&!!l.length&&(0,d.jsx)(TC,{title:(0,T._x)("Most used","blocks"),children:(0,d.jsx)(EC,{items:l,onSelect:o,onHover:r,label:(0,T._x)("Most used","blocks")})}),u.map((t=>{const n=e.filter((e=>e.category===t.slug));return n&&n.length?(0,d.jsx)(TC,{title:t.title,icon:t.icon,children:(0,d.jsx)(EC,{items:n,onSelect:o,onHover:r,label:t.title})},t.slug):null})),p&&a.length>0&&(0,d.jsx)(TC,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,T.__)("Uncategorized"),children:(0,d.jsx)(EC,{items:a,onSelect:o,onHover:r,label:(0,T.__)("Uncategorized")})}),f.map((([e,t])=>{const n=c[e];return n&&n.length?(0,d.jsx)(TC,{title:t.title,icon:t.icon,children:(0,d.jsx)(EC,{items:n,onSelect:o,onHover:r,label:t.title})},e):null}))]})}var DC=(0,h.forwardRef)((function({rootClientId:e,onInsert:t,onHover:n,showMostUsedBlocks:o},r){const[i,s,l,a]=MC(e,t);if(!i.length)return(0,d.jsx)(AC,{});const c=[],u=[];for(const e of i)"reusable"!==e.category&&(e.isAllowedInCurrentRoot?c.push(e):u.push(e));return(0,d.jsx)(RC,{children:(0,d.jsxs)("div",{ref:r,children:[!!c.length&&(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(LC,{items:c,categories:s,collections:l,onSelectItem:a,onHover:n,showMostUsedBlocks:o,className:"block-editor-inserter__insertable-blocks-at-selection"})}),(0,d.jsx)(LC,{items:u,categories:s,collections:l,onSelectItem:a,onHover:n,showMostUsedBlocks:o,className:"block-editor-inserter__all-blocks"})]})})}));function OC({selectedCategory:e,patternCategories:t,onClickCategory:n}){const o="block-editor-block-patterns-explorer__sidebar";return(0,d.jsx)("div",{className:`${o}__categories-list`,children:t.map((({name:t,label:r})=>(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,label:r,className:`${o}__categories-list__item`,isPressed:e===t,onClick:()=>{n(t)},children:r},t)))})}function zC({searchValue:e,setSearchValue:t}){return(0,d.jsx)("div",{className:"block-editor-block-patterns-explorer__search",children:(0,d.jsx)(ws.SearchControl,{__nextHasNoMarginBottom:!0,onChange:t,value:e,label:(0,T.__)("Search"),placeholder:(0,T.__)("Search")})})}var VC=function({selectedCategory:e,patternCategories:t,onClickCategory:n,searchValue:o,setSearchValue:r}){return(0,d.jsxs)("div",{className:"block-editor-block-patterns-explorer__sidebar",children:[(0,d.jsx)(zC,{searchValue:o,setSearchValue:r}),!o&&(0,d.jsx)(OC,{selectedCategory:e,patternCategories:t,onClickCategory:n})]})};function FC({currentPage:e,numPages:t,changePage:n,totalItems:o}){return(0,d.jsxs)(ws.__experimentalVStack,{className:"block-editor-patterns__grid-pagination-wrapper",children:[(0,d.jsx)(ws.__experimentalText,{variant:"muted",children:(0,T.sprintf)((0,T._n)("%s item","%s items",o),o)}),t>1&&(0,d.jsxs)(ws.__experimentalHStack,{expanded:!1,spacing:3,justify:"flex-start",className:"block-editor-patterns__grid-pagination",children:[(0,d.jsxs)(ws.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-previous",children:[(0,d.jsx)(ws.Button,{variant:"tertiary",onClick:()=>n(1),disabled:1===e,"aria-label":(0,T.__)("First page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,d.jsx)("span",{children:"«"})}),(0,d.jsx)(ws.Button,{variant:"tertiary",onClick:()=>n(e-1),disabled:1===e,"aria-label":(0,T.__)("Previous page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,d.jsx)("span",{children:"‹"})})]}),(0,d.jsx)(ws.__experimentalText,{variant:"muted",children:(0,T.sprintf)((0,T._x)("%1$s of %2$s","paging"),e,t)}),(0,d.jsxs)(ws.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-next",children:[(0,d.jsx)(ws.Button,{variant:"tertiary",onClick:()=>n(e+1),disabled:e===t,"aria-label":(0,T.__)("Next page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,d.jsx)("span",{children:"›"})}),(0,d.jsx)(ws.Button,{variant:"tertiary",onClick:()=>n(t),disabled:e===t,"aria-label":(0,T.__)("Last page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,d.jsx)("span",{children:"»"})})]})]})]})}const HC=({showTooltip:e,title:t,children:n})=>e?(0,d.jsx)(ws.Tooltip,{text:t,children:n}):(0,d.jsx)(d.Fragment,{children:n});function UC({id:e,isDraggable:t,pattern:n,onClick:o,onHover:r,showTitlesAsTooltip:i,category:s,isSelected:l}){const[a,c]=(0,h.useState)(!1),{blocks:u,viewportWidth:g}=n,f=`block-editor-block-patterns-list__item-description-${(0,m.useInstanceId)(UC)}`,b=n.type===it.user,k=(0,h.useMemo)((()=>s&&t?(u??[]).map((e=>{const t=(0,p.cloneBlock)(e);return t.attributes.metadata?.categories?.includes(s)&&(t.attributes.metadata.categories=[s]),t})):u),[u,t,s]);return(0,d.jsx)(wC,{isEnabled:t,blocks:k,pattern:n,children:({draggable:t,onDragStart:s,onDragEnd:p})=>(0,d.jsx)("div",{className:"block-editor-block-patterns-list__list-item",draggable:t,onDragStart:e=>{c(!0),s&&(r?.(null),s(e))},onDragEnd:e=>{c(!1),p&&p(e)},children:(0,d.jsx)(HC,{showTooltip:i&&!b,title:n.title,children:(0,d.jsxs)(ws.Composite.Item,{render:(0,d.jsx)("div",{role:"option","aria-label":n.title,"aria-describedby":n.description?f:void 0,className:ms("block-editor-block-patterns-list__item",{"block-editor-block-patterns-list__list-item-synced":n.type===it.user&&!n.syncStatus,"is-selected":l})}),id:e,onClick:()=>{o(n,u),r?.(null)},onMouseEnter:()=>{a||r?.(n)},onMouseLeave:()=>r?.(null),children:[(0,d.jsx)(kC.Async,{placeholder:(0,d.jsx)(GC,{}),children:(0,d.jsx)(kC,{blocks:u,viewportWidth:g})}),(!i||b)&&(0,d.jsxs)(ws.__experimentalHStack,{className:"block-editor-patterns__pattern-details",spacing:2,children:[b&&!n.syncStatus&&(0,d.jsx)("div",{className:"block-editor-patterns__pattern-icon-wrapper",children:(0,d.jsx)(Ol,{className:"block-editor-patterns__pattern-icon",icon:de})}),(0,d.jsx)("div",{className:"block-editor-block-patterns-list__item-title",children:n.title})]}),!!n.description&&(0,d.jsx)(ws.VisuallyHidden,{id:f,children:n.description})]})})})})}function GC(){return(0,d.jsx)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var $C=(0,h.forwardRef)((function({isDraggable:e,blockPatterns:t,onHover:n,onClickPattern:o,orientation:r,label:i=(0,T.__)("Block patterns"),category:s,showTitlesAsTooltip:l,pagingProps:a},c){const[u,p]=(0,h.useState)(void 0),[g,m]=(0,h.useState)(null);(0,h.useEffect)((()=>{const e=t[0]?.name;p(e)}),[t]);const f=(e,t)=>{m(e.name),o(e,t)};return(0,d.jsxs)(ws.Composite,{orientation:r,activeId:u,setActiveId:p,role:"listbox",className:"block-editor-block-patterns-list","aria-label":i,ref:c,children:[t.map((t=>(0,d.jsx)(UC,{id:t.name,pattern:t,onClick:f,onHover:n,isDraggable:e,showTitlesAsTooltip:l,category:s,isSelected:!!g&&g===t.name},t.name))),a&&(0,d.jsx)(FC,{...a})]})}));function WC({destinationRootClientId:e,destinationIndex:t,rootClientId:n,registry:o}){if(n===e)return t;const r=["",...o.select(ji).getBlockParents(e),e],i=r.indexOf(n);return-1!==i?o.select(ji).getBlockIndex(r[i+1])+1:o.select(ji).getBlockOrder(n).length}var KC=function({rootClientId:e="",insertionIndex:t,clientId:n,isAppender:o,onSelect:r,shouldFocusBlock:i=!0,selectBlockOnInsert:s=!0}){const l=(0,g.useRegistry)(),{getSelectedBlock:a,getClosestAllowedInsertionPoint:c,isBlockInsertionPointVisible:u}=G((0,g.useSelect)(ji)),{destinationRootClientId:d,destinationIndex:m}=(0,g.useSelect)((r=>{const{getSelectedBlockClientId:i,getBlockRootClientId:s,getBlockIndex:l,getBlockOrder:a,getInsertionPoint:c}=G(r(ji)),u=i();let d,p=e;const h=c();return void 0!==t?d=t:h&&h.hasOwnProperty("index")?(p=h?.rootClientId?h.rootClientId:e,d=h.index):n?d=l(n):!o&&u?(p=s(u),d=l(u)+1):d=a(p).length,{destinationRootClientId:p,destinationIndex:d}}),[e,t,n,o]),{replaceBlocks:f,insertBlocks:b,showInsertionPoint:k,hideInsertionPoint:v,setLastFocus:_}=G((0,g.useDispatch)(ji)),y=(0,h.useCallback)(((e,t,n=!1,c)=>{(n||i||s)&&_(null);const u=a();!o&&u&&(0,p.isUnmodifiedDefaultBlock)(u,"content")?f(u.clientId,e,null,i||n?0:null,t):b(e,o||void 0===c?m:WC({destinationRootClientId:d,destinationIndex:m,rootClientId:c,registry:l}),o||void 0===c?d:c,s,i||n?0:null,t);const h=Array.isArray(e)?e.length:1,g=(0,T.sprintf)((0,T._n)("%d block added.","%d blocks added.",h),h);(0,Uo.speak)(g),r&&r(e)}),[o,a,f,b,d,m,r,i,s]),x=(0,h.useCallback)((e=>{if(e&&!u()){const t=c(e.name,d);null!==t&&k(t,WC({destinationRootClientId:d,destinationIndex:m,rootClientId:t,registry:l}))}else v()}),[c,u,k,v,d,m]);return[d,y,x]};var ZC=(e,t,n,o)=>{const r=(0,h.useMemo)((()=>({[pt]:!!o})),[o]),{patternCategories:i,patterns:s,userPatternCategories:l}=(0,g.useSelect)((e=>{const{getSettings:n,__experimentalGetAllowedPatterns:o}=G(e(ji)),{__experimentalUserPatternCategories:i,__experimentalBlockPatternCategories:s}=n();return{patterns:o(t,r),userPatternCategories:i,patternCategories:s}}),[t,r]),{getClosestAllowedInsertionPointForPattern:a}=G((0,g.useSelect)(ji)),c=(0,h.useMemo)((()=>{const e=[...i];return l?.forEach((t=>{e.find((e=>e.name===t.name))||e.push(t)})),e}),[i,l]),{createSuccessNotice:u}=(0,g.useDispatch)(pr.store),d=(0,h.useCallback)(((r,i)=>{const s=o?t:a(r,t);if(null===s)return;const l=r.type===it.user&&"unsynced"!==r.syncStatus?[(0,p.createBlock)("core/block",{ref:r.id})]:i;e((l??[]).map((e=>{const t=(0,p.cloneBlock)(e);return t.attributes.metadata?.categories?.includes(n)&&(t.attributes.metadata.categories=[n]),t})),r.name,!1,s),u((0,T.sprintf)((0,T.__)('Block pattern "%s" inserted.'),r.title),{type:"snackbar",id:"inserter-notice"})}),[u,e,n,t,a,o]);return[s,c,d]},qC=n(9681),YC=n.n(qC);function XC(e){return e.toLowerCase()}var QC=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],JC=/[^A-Z0-9]+/gi;function eB(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}const tB=e=>e.name||"",nB=e=>e.title,oB=e=>e.description||"",rB=e=>e.keywords||[],iB=e=>e.category,sB=()=>null,lB=[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],aB=new RegExp("(\\p{C}|\\p{P}|\\p{S})+","giu"),cB=new Map,uB=new Map;function dB(e=""){if(cB.has(e))return cB.get(e);const t=function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?QC:n,r=t.stripRegexp,i=void 0===r?JC:r,s=t.transform,l=void 0===s?XC:s,a=t.delimiter,c=void 0===a?" ":a,u=eB(eB(e,o,"$1\0$2"),i,"\0"),d=0,p=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(p-1);)p--;return u.slice(d,p).split("\0").map(l).join(c)}(e,{splitRegexp:lB,stripRegexp:aB}).split(" ").filter(Boolean);return cB.set(e,t),t}function pB(e=""){if(uB.has(e))return uB.get(e);let t=YC()(e);return t=t.replace(/^\//,""),t=t.toLowerCase(),uB.set(e,t),t}const hB=(e="")=>dB(pB(e)),gB=(e,t,n,o)=>{if(0===hB(o).length)return e;return mB(e,o,{getCategory:e=>t.find((({slug:t})=>t===e.category))?.title,getCollection:e=>n[e.name.split("/")[0]]?.title})},mB=(e=[],t="",n={})=>{if(0===hB(t).length)return e;const o=e.map((e=>[e,fB(e,t,n)])).filter((([,e])=>e>0));return o.sort((([,e],[,t])=>t-e)),o.map((([e])=>e))};function fB(e,t,n={}){const{getName:o=tB,getTitle:r=nB,getDescription:i=oB,getKeywords:s=rB,getCategory:l=iB,getCollection:a=sB}=n,c=o(e),u=r(e),d=i(e),p=s(e),h=l(e),g=a(e),m=pB(t),f=pB(u);let b=0;if(m===f)b+=30;else if(f.startsWith(m))b+=20;else{const e=[c,u,d,...p,h,g].join(" ");0===((e,t)=>e.filter((e=>!hB(t).some((t=>t.includes(e))))))(dB(m),e).length&&(b+=10)}if(0!==b&&c.startsWith("core/")){b+=c!==e.id?1:2}return b}function bB(e,t,n,o=""){const[r,i]=(0,h.useState)(1),s=(0,m.usePrevious)(t),l=(0,m.usePrevious)(o);s===t&&l===o||1===r||i(1);const a=e.length,c=r-1,u=(0,h.useMemo)((()=>e.slice(20*c,20*c+20)),[c,e]),d=Math.ceil(e.length/20);return(0,h.useEffect)((function(){const e=(0,Ga.getScrollContainer)(n?.current);e?.scrollTo(0,0)}),[t,n]),{totalItems:a,categoryPatterns:u,numPages:d,changePage:e=>{const t=(0,Ga.getScrollContainer)(n?.current);t?.scrollTo(0,0),i(e)},currentPage:r}}function kB({filterValue:e,filteredBlockPatternsLength:t}){return e?(0,d.jsx)(ws.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count",children:(0,T.sprintf)((0,T._n)("%d pattern found","%d patterns found",t),t)}):null}var vB=function({searchValue:e,selectedCategory:t,patternCategories:n,rootClientId:o,onModalClose:r}){const i=(0,h.useRef)(),s=(0,m.useDebounce)(Uo.speak,500),[l,a]=KC({rootClientId:o,shouldFocusBlock:!0}),[c,,u]=ZC(a,l,t),p=(0,h.useMemo)((()=>n.map((e=>e.name))),[n]),g=(0,h.useMemo)((()=>{const n=c.filter((e=>{if(t===at.name)return!0;if(t===ct.name&&e.type===it.user)return!0;if(t===ut.name&&e.blockTypes?.includes("core/post-content"))return!0;if("uncategorized"===t){const t=e.categories?.some((e=>p.includes(e)))??!1;return!e.categories?.length||!t}return e.categories?.includes(t)}));return e?mB(n,e):n}),[e,c,t,p]);(0,h.useEffect)((()=>{if(!e)return;const t=g.length,n=(0,T.sprintf)((0,T._n)("%d result found.","%d results found.",t),t);s(n)}),[e,s,g.length]);const f=bB(g,t,i),[b,k]=(0,h.useState)(e);e!==b&&(k(e),f.changePage(1));const v=!!g?.length;return(0,d.jsxs)("div",{className:"block-editor-block-patterns-explorer__list",ref:i,children:[(0,d.jsx)(kB,{filterValue:e,filteredBlockPatternsLength:g.length}),(0,d.jsx)(RC,{children:v&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)($C,{blockPatterns:f.categoryPatterns,onClickPattern:(e,t)=>{u(e,t),r()},isDraggable:!1}),(0,d.jsx)(FC,{...f})]})})]})};function _B(e,t="all"){const[n,o]=ZC(void 0,e),r=(0,h.useMemo)((()=>"all"===t?n:n.filter((e=>!dt(e,t)))),[t,n]),i=(0,h.useMemo)((()=>{const e=o.filter((e=>r.some((t=>t.categories?.includes(e.name))))).sort(((e,t)=>e.label.localeCompare(t.label)));return r.some((e=>!function(e,t){return!(!e.categories||!e.categories.length)&&e.categories.some((e=>t.some((t=>t.name===e))))}(e,o)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,T._x)("Uncategorized")}),r.some((e=>e.blockTypes?.includes("core/post-content")))&&e.unshift(ut),r.some((e=>e.type===it.user))&&e.unshift(ct),r.length>0&&e.unshift({name:at.name,label:at.label}),(0,Uo.speak)((0,T.sprintf)((0,T._n)("%d category button displayed.","%d category buttons displayed.",e.length),e.length)),e}),[o,r]);return i}function yB({initialCategory:e,rootClientId:t,onModalClose:n}){const[o,r]=(0,h.useState)(""),[i,s]=(0,h.useState)(e?.name),l=_B(t);return(0,d.jsxs)("div",{className:"block-editor-block-patterns-explorer",children:[(0,d.jsx)(VC,{selectedCategory:i,patternCategories:l,onClickCategory:s,searchValue:o,setSearchValue:r}),(0,d.jsx)(vB,{searchValue:o,selectedCategory:i,patternCategories:l,rootClientId:t,onModalClose:n})]})}var xB=function({onModalClose:e,...t}){return(0,d.jsx)(ws.Modal,{title:(0,T.__)("Patterns"),onRequestClose:e,isFullScreen:!0,children:(0,d.jsx)(yB,{onModalClose:e,...t})})};function SB({title:e}){return(0,d.jsx)(ws.__experimentalVStack,{spacing:0,children:(0,d.jsx)(ws.__experimentalView,{children:(0,d.jsx)(ws.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3,children:(0,d.jsxs)(ws.__experimentalHStack,{spacing:2,children:[(0,d.jsx)(ws.Navigator.BackButton,{style:{minWidth:24,padding:0},icon:(0,T.isRTL)()?Zb:qb,size:"small",label:(0,T.__)("Back")}),(0,d.jsx)(ws.__experimentalSpacer,{children:(0,d.jsx)(ws.__experimentalHeading,{level:5,children:e})})]})})})})}function wB({categories:e,children:t}){return(0,d.jsxs)(ws.Navigator,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation",children:[(0,d.jsx)(ws.Navigator.Screen,{path:"/",children:(0,d.jsx)(ws.__experimentalItemGroup,{children:e.map((e=>(0,d.jsx)(ws.Navigator.Button,{path:`/category/${e.name}`,as:ws.__experimentalItem,isAction:!0,children:(0,d.jsxs)(ws.__experimentalHStack,{children:[(0,d.jsx)(ws.FlexBlock,{children:e.label}),(0,d.jsx)(Ol,{icon:(0,T.isRTL)()?qb:Zb})]})},e.name)))})}),e.map((e=>(0,d.jsxs)(ws.Navigator.Screen,{path:`/category/${e.name}`,children:[(0,d.jsx)(SB,{title:(0,T.__)("Back")}),t(e)]},e.name)))]})}const CB=e=>"all"!==e&&"user"!==e,BB=[{value:"all",label:(0,T._x)("All","patterns")},{value:it.directory,label:(0,T.__)("Pattern Directory")},{value:it.theme,label:(0,T.__)("Theme & Plugins")},{value:it.user,label:(0,T.__)("User")}];function IB({setPatternSyncFilter:e,setPatternSourceFilter:t,patternSyncFilter:n,patternSourceFilter:o,scrollContainerRef:r,category:i}){const s=i.name===ct.name?it.user:o,l=CB(s),a=(e=>e.name===ct.name)(i),c=(0,h.useMemo)((()=>[{value:"all",label:(0,T._x)("All","patterns")},{value:st,label:(0,T._x)("Synced","patterns"),disabled:l},{value:lt,label:(0,T._x)("Not synced","patterns"),disabled:l}]),[l]);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(ws.DropdownMenu,{popoverProps:{placement:"right-end"},label:(0,T.__)("Filter patterns"),toggleProps:{size:"compact"},icon:(0,d.jsx)(Ol,{icon:(0,d.jsx)(ws.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ws.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"currentColor"})})}),children:()=>(0,d.jsxs)(d.Fragment,{children:[!a&&(0,d.jsx)(ws.MenuGroup,{label:(0,T.__)("Source"),children:(0,d.jsx)(ws.MenuItemsChoice,{choices:BB,onSelect:n=>{var o;t(o=n),CB(o)&&e("all"),r.current?.scrollTo(0,0)},value:s})}),(0,d.jsx)(ws.MenuGroup,{label:(0,T.__)("Type"),children:(0,d.jsx)(ws.MenuItemsChoice,{choices:c,onSelect:t=>{e(t),r.current?.scrollTo(0,0)},value:n})}),(0,d.jsx)("div",{className:"block-editor-inserter__patterns-filter-help",children:(0,h.createInterpolateElement)((0,T.__)("Patterns are available from the <Link>WordPress.org Pattern Directory</Link>, bundled in the active theme, or created by users on this site. Only patterns created on this site can be synced."),{Link:(0,d.jsx)(ws.ExternalLink,{href:(0,T.__)("https://wordpress.org/patterns/")})})})]})})})}const jB=()=>{};function EB({rootClientId:e,onInsert:t,onHover:n=jB,category:o,showTitlesAsTooltip:r}){const[i,,s]=ZC(t,e,o?.name),[l,a]=(0,h.useState)("all"),[c,u]=(0,h.useState)("all"),p=_B(e,c),g=(0,h.useRef)(),m=(0,h.useMemo)((()=>i.filter((e=>!dt(e,c,l)&&(o.name===at.name||(o.name===ct.name&&e.type===it.user||(!(o.name!==ut.name||!e.blockTypes?.includes("core/post-content"))||("uncategorized"===o.name?!e.categories||!e.categories.some((e=>p.some((t=>t.name===e)))):e.categories?.includes(o.name)))))))),[i,p,o.name,c,l]),f=bB(m,o,g),{changePage:b}=f;(0,h.useEffect)((()=>()=>n(null)),[]);const k=(0,h.useCallback)((e=>{a(e),b(1)}),[a,b]),v=(0,h.useCallback)((e=>{u(e),b(1)}),[u,b]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(ws.__experimentalVStack,{spacing:2,className:"block-editor-inserter__patterns-category-panel-header",children:[(0,d.jsxs)(ws.__experimentalHStack,{children:[(0,d.jsx)(ws.FlexBlock,{children:(0,d.jsx)(ws.__experimentalHeading,{className:"block-editor-inserter__patterns-category-panel-title",size:13,level:4,as:"div",children:o.label})}),(0,d.jsx)(IB,{patternSyncFilter:l,patternSourceFilter:c,setPatternSyncFilter:k,setPatternSourceFilter:v,scrollContainerRef:g,category:o})]}),!m.length&&(0,d.jsx)(ws.__experimentalText,{variant:"muted",className:"block-editor-inserter__patterns-category-no-results",children:(0,T.__)("No results found")})]}),m.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.__experimentalText,{size:"12",as:"p",className:"block-editor-inserter__help-text",children:(0,T.__)("Drag and drop patterns into the canvas.")}),(0,d.jsx)($C,{ref:g,blockPatterns:f.categoryPatterns,onClickPattern:s,onHover:n,label:o.label,orientation:"vertical",category:o.name,isDraggable:!0,showTitlesAsTooltip:r,patternFilter:c,pagingProps:f})]})]})}const{Tabs:TB}=G(ws.privateApis);var MB=function({categories:e,selectedCategory:t,onSelectCategory:n,children:o}){const r={type:"tween",duration:(0,m.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]},i=(0,m.usePrevious)(t),s=t?t.name:null,[l,a]=(0,h.useState)(),c=e?.[0]?.name;return null===s&&!l&&c&&a(c),(0,d.jsxs)(TB,{selectOnMove:!1,selectedTabId:s,orientation:"vertical",onSelect:t=>{n(e.find((e=>e.name===t)))},activeTabId:l,onActiveTabIdChange:a,children:[(0,d.jsx)(TB.TabList,{className:"block-editor-inserter__category-tablist",children:e.map((e=>(0,d.jsx)(TB.Tab,{tabId:e.name,"aria-current":e===t?"true":void 0,children:e.label},e.name)))}),e.map((e=>(0,d.jsx)(TB.TabPanel,{tabId:e.name,focusable:!1,children:(0,d.jsx)(ws.__unstableMotion.div,{className:"block-editor-inserter__category-panel",initial:i?"open":"closed",animate:"open",variants:{open:{transform:"translateX( 0 )",transitionEnd:{zIndex:"1"}},closed:{transform:"translateX( -100% )",zIndex:"-1"}},transition:r,children:o})},e.name)))]})};var PB=function({onSelectCategory:e,selectedCategory:t,onInsert:n,rootClientId:o,children:r}){const[i,s]=(0,h.useState)(!1),l=_B(o),a=(0,m.useViewportMatch)("medium","<");return l.length?(0,d.jsxs)(d.Fragment,{children:[!a&&(0,d.jsxs)("div",{className:"block-editor-inserter__block-patterns-tabs-container",children:[(0,d.jsx)(MB,{categories:l,selectedCategory:t,onSelectCategory:e,children:r}),(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__patterns-explore-button",onClick:()=>s(!0),variant:"secondary",children:(0,T.__)("Explore all patterns")})]}),a&&(0,d.jsx)(wB,{categories:l,children:e=>(0,d.jsx)("div",{className:"block-editor-inserter__category-panel",children:(0,d.jsx)(EB,{onInsert:n,rootClientId:o,category:e},e.name)})}),i&&(0,d.jsx)(xB,{initialCategory:t||l[0],patternCategories:l,onModalClose:()=>s(!1),rootClientId:o})]}):(0,d.jsx)(AC,{})},RB=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})});const AB={image:"img",video:"video",audio:"audio"};function NB(e,t){const n={id:e.id||void 0,caption:e.caption||void 0},o=e.url,r=e.alt||void 0;"image"===t?(n.url=o,n.alt=r):["video","audio"].includes(t)&&(n.src=o);const i=AB[t],s=(0,d.jsx)(i,{src:e.previewUrl||o,alt:r,controls:"audio"===t||void 0,inert:"true",onError:({currentTarget:t})=>{t.src===e.previewUrl&&(t.src=o)}});return[(0,p.createBlock)(`core/${t}`,n),s]}const LB=["image"],DB={placement:"bottom-end",className:"block-editor-inserter__media-list__item-preview-options__popover"};function OB({category:e,media:t}){if(!e.getReportUrl)return null;const n=e.getReportUrl(t);return(0,d.jsx)(ws.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,T.__)("Options"),popoverProps:DB,icon:fv,children:()=>(0,d.jsx)(ws.MenuGroup,{children:(0,d.jsx)(ws.MenuItem,{onClick:()=>window.open(n,"_blank").focus(),icon:RB,children:(0,T.sprintf)((0,T.__)("Report %s"),e.mediaType)})})})}function zB({onClose:e,onSubmit:t}){return(0,d.jsxs)(ws.Modal,{title:(0,T.__)("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal",children:[(0,d.jsxs)(ws.__experimentalVStack,{spacing:3,children:[(0,d.jsx)("p",{children:(0,T.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")}),(0,d.jsx)("p",{children:(0,T.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation.")})]}),(0,d.jsxs)(ws.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,d.jsx)(ws.FlexItem,{children:(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e,children:(0,T.__)("Cancel")})}),(0,d.jsx)(ws.FlexItem,{children:(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:t,children:(0,T.__)("Insert")})})]})]})}function VB({media:e,onClick:t,category:n}){const[o,r]=(0,h.useState)(!1),[i,s]=(0,h.useState)(!1),[l,a]=(0,h.useState)(!1),[c,u]=(0,h.useMemo)((()=>NB(e,n.mediaType)),[e,n.mediaType]),{createErrorNotice:m,createSuccessNotice:f}=(0,g.useDispatch)(pr.store),{getSettings:b,getBlock:k}=(0,g.useSelect)(ji),{updateBlockAttributes:v}=(0,g.useDispatch)(ji),_=(0,h.useCallback)((e=>{if(l)return;const n=b(),o=(0,p.cloneBlock)(e),{id:i,url:s,caption:c}=o.attributes;i||n.mediaUpload?i?t(o):(a(!0),window.fetch(s).then((e=>e.blob())).then((e=>{const r=(0,Ua.getFilename)(s)||"image.jpg",i=new File([e],r,{type:e.type});n.mediaUpload({filesList:[i],additionalData:{caption:c},onFileChange([e]){(0,$a.isBlobURL)(e.url)||(k(o.clientId)?v(o.clientId,{...o.attributes,id:e.id,url:e.url}):(t({...o,attributes:{...o.attributes,id:e.id,url:e.url}}),f((0,T.__)("Image uploaded and inserted."),{type:"snackbar",id:"inserter-notice"})),a(!1))},allowedTypes:LB,onError(e){m(e,{type:"snackbar",id:"inserter-notice"}),a(!1)}})})).catch((()=>{r(!0),a(!1)}))):r(!0)}),[l,b,t,f,v,m,k]),y="string"==typeof e.title?e.title:e.title?.rendered||(0,T.__)("no title"),x=(0,h.useCallback)((()=>s(!0)),[]),S=(0,h.useCallback)((()=>s(!1)),[]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(wC,{isEnabled:!0,blocks:[c],children:({draggable:t,onDragStart:o,onDragEnd:r})=>(0,d.jsx)("div",{className:ms("block-editor-inserter__media-list__list-item",{"is-hovered":i}),draggable:t,onDragStart:o,onDragEnd:r,children:(0,d.jsxs)("div",{onMouseEnter:x,onMouseLeave:S,children:[(0,d.jsx)(ws.Tooltip,{text:y,children:(0,d.jsx)(ws.Composite.Item,{render:(0,d.jsx)("div",{"aria-label":y,role:"option",className:"block-editor-inserter__media-list__item"}),onClick:()=>_(c),children:(0,d.jsxs)("div",{className:"block-editor-inserter__media-list__item-preview",children:[u,l&&(0,d.jsx)("div",{className:"block-editor-inserter__media-list__item-preview-spinner",children:(0,d.jsx)(ws.Spinner,{})})]})})}),!l&&(0,d.jsx)(OB,{category:n,media:e})]})})}),o&&(0,d.jsx)(zB,{onClose:()=>r(!1),onSubmit:()=>{t((0,p.cloneBlock)(c)),f((0,T.__)("Image inserted."),{type:"snackbar",id:"inserter-notice"}),r(!1)}})]})}var FB=function({mediaList:e,category:t,onClick:n,label:o=(0,T.__)("Media List")}){return(0,d.jsx)(ws.Composite,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":o,children:e.map(((e,o)=>(0,d.jsx)(VB,{media:e,category:t,onClick:n},e.id||e.sourceId||o)))})};function HB({rootClientId:e,onInsert:t,category:n}){const[o,r,i]=(0,m.useDebouncedInput)(),{mediaList:s,isLoading:l}=function(e,t={}){const[n,o]=(0,h.useState)(),[r,i]=(0,h.useState)(!1),s=(0,h.useRef)();return(0,h.useEffect)((()=>{(async()=>{const n=JSON.stringify({category:e.name,...t});s.current=n,i(!0),o([]);const r=await(e.fetch?.(t));n===s.current&&(o(r),i(!1))})()}),[e.name,...Object.values(t)]),{mediaList:n,isLoading:r}}(n,{per_page:i?20:10,search:i}),a="block-editor-inserter__media-panel",c=n.labels.search_items||(0,T.__)("Search");return(0,d.jsxs)("div",{className:a,children:[(0,d.jsx)(ws.SearchControl,{__nextHasNoMarginBottom:!0,className:`${a}-search`,onChange:r,value:o,label:c,placeholder:c}),l&&(0,d.jsx)("div",{className:`${a}-spinner`,children:(0,d.jsx)(ws.Spinner,{})}),!l&&!s?.length&&(0,d.jsx)(AC,{}),!l&&!!s?.length&&(0,d.jsx)(FB,{rootClientId:e,onClick:t,mediaList:s,category:n})]})}const UB=["image","video","audio"];var GB=function({rootClientId:e,selectedCategory:t,onSelectCategory:n,onInsert:o,children:r}){const i=function(e){const[t,n]=(0,h.useState)([]),o=(0,g.useSelect)((e=>G(e(ji)).getInserterMediaCategories()),[]),{canInsertImage:r,canInsertVideo:i,canInsertAudio:s}=(0,g.useSelect)((t=>{const{canInsertBlockType:n}=t(ji);return{canInsertImage:n("core/image",e),canInsertVideo:n("core/video",e),canInsertAudio:n("core/audio",e)}}),[e]);return(0,h.useEffect)((()=>{(async()=>{const e=[];if(!o)return;const t=new Map(await Promise.all(o.map((async e=>{if(e.isExternalResource)return[e.name,!0];let t=[];try{t=await e.fetch({per_page:1})}catch(e){}return[e.name,!!t.length]})))),l={image:r,video:i,audio:s};o.forEach((n=>{l[n.mediaType]&&t.get(n.name)&&e.push(n)})),e.length&&n(e)})()}),[r,i,s,o]),t}(e),s=(0,m.useViewportMatch)("medium","<"),l=(0,h.useCallback)((e=>{if(!e?.url)return;const[t]=NB(e,e.type);o(t)}),[o]),a=(0,h.useMemo)((()=>i.map((e=>({...e,label:e.labels.name})))),[i]);return a.length?(0,d.jsxs)(d.Fragment,{children:[!s&&(0,d.jsxs)("div",{className:"block-editor-inserter__media-tabs-container",children:[(0,d.jsx)(MB,{categories:a,selectedCategory:t,onSelectCategory:n,children:r}),(0,d.jsx)(Xa,{children:(0,d.jsx)(Ya,{multiple:!1,onSelect:l,allowedTypes:UB,render:({open:e})=>(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,onClick:t=>{t.target.focus(),e()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal",children:(0,T.__)("Open Media Library")})})})]}),s&&(0,d.jsx)(wB,{categories:a,children:t=>(0,d.jsx)(HB,{onInsert:o,rootClientId:e,category:t})})]}):(0,d.jsx)(AC,{})};const{Fill:$B,Slot:WB}=(0,ws.createSlotFill)("__unstableInserterMenuExtension");$B.Slot=WB;var KB=$B;const ZB=(e,t)=>t?(e.sort((({id:e},{id:n})=>{let o=t.indexOf(e),r=t.indexOf(n);return o<0&&(o=t.length),r<0&&(r=t.length),o-r})),e):e,qB=[];var YB=function({filterValue:e,onSelect:t,onHover:n,onHoverPattern:o,rootClientId:r,clientId:i,isAppender:s,__experimentalInsertionIndex:l,maxBlockPatterns:a,maxBlockTypes:c,showBlockDirectory:u=!1,isDraggable:p=!0,shouldFocusBlock:f=!0,prioritizePatterns:b,selectBlockOnInsert:k,isQuick:v}){const _=(0,m.useDebounce)(Uo.speak,500),{prioritizedBlocks:y}=(0,g.useSelect)((e=>{const t=e(ji).getBlockListSettings(r);return{prioritizedBlocks:t?.prioritizedInserterBlocks||qB}}),[r]),[x,S]=KC({onSelect:t,rootClientId:r,clientId:i,isAppender:s,insertionIndex:l,shouldFocusBlock:f,selectBlockOnInsert:k}),[w,C,B,I]=MC(x,S,v),[j,,E]=ZC(S,x,void 0,v),M=(0,h.useMemo)((()=>{if(0===a)return[];const t=mB(j,e);return void 0!==a?t.slice(0,a):t}),[e,j,a]);let P=c;b&&M.length>2&&(P=0);const R=(0,h.useMemo)((()=>{if(0===P)return[];let t=xt(w.filter((e=>"core/block"!==e.name)),"frecency","desc");!e&&y.length&&(t=ZB(t,y));const n=gB(t,C,B,e);return void 0!==P?n.slice(0,P):n}),[e,w,C,B,P,y]);(0,h.useEffect)((()=>{if(!e)return;const t=R.length+M.length,n=(0,T.sprintf)((0,T._n)("%d result found.","%d results found.",t),t);_(n)}),[e,_,R,M]);const A=(0,m.useAsyncList)(R,{step:9}),N=R.length>0||M.length>0,L=!!R.length&&(0,d.jsx)(TC,{title:(0,d.jsx)(ws.VisuallyHidden,{children:(0,T.__)("Blocks")}),children:(0,d.jsx)(EC,{items:A,onSelect:I,onHover:n,label:(0,T.__)("Blocks"),isDraggable:p})}),D=!!M.length&&(0,d.jsx)(TC,{title:(0,d.jsx)(ws.VisuallyHidden,{children:(0,T.__)("Block patterns")}),children:(0,d.jsx)("div",{className:"block-editor-inserter__quick-inserter-patterns",children:(0,d.jsx)($C,{blockPatterns:M,onClickPattern:E,onHover:o,isDraggable:p})})});return(0,d.jsxs)(RC,{children:[!u&&!N&&(0,d.jsx)(AC,{}),b?D:L,!!R.length&&!!M.length&&(0,d.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?L:D,u&&(0,d.jsx)(KB.Slot,{fillProps:{onSelect:I,onHover:n,filterValue:e,hasItems:N,rootClientId:x},children:e=>e.length?e:N?null:(0,d.jsx)(AC,{})})]})},XB=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{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"})});const{Tabs:QB}=G(ws.privateApis);var JB=(0,h.forwardRef)((function({defaultTabId:e,onClose:t,onSelect:n,selectedTab:o,tabs:r,closeButtonLabel:i},s){return(0,d.jsx)("div",{className:"block-editor-tabbed-sidebar",children:(0,d.jsxs)(QB,{selectOnMove:!1,defaultTabId:e,onSelect:n,selectedTabId:o,children:[(0,d.jsxs)("div",{className:"block-editor-tabbed-sidebar__tablist-and-close-button",children:[(0,d.jsx)(ws.Button,{className:"block-editor-tabbed-sidebar__close-button",icon:XB,label:i,onClick:()=>t(),size:"compact"}),(0,d.jsx)(QB.TabList,{className:"block-editor-tabbed-sidebar__tablist",ref:s,children:r.map((e=>(0,d.jsx)(QB.Tab,{tabId:e.name,className:"block-editor-tabbed-sidebar__tab",children:e.title},e.name)))})]}),r.map((e=>(0,d.jsx)(QB.TabPanel,{tabId:e.name,focusable:!1,className:"block-editor-tabbed-sidebar__tabpanel",ref:e.panelRef,children:e.panel},e.name)))]})})}));function eI(e=!0){const{setZoomLevel:t,resetZoomLevel:n}=G((0,g.useDispatch)(ji)),{isZoomedOut:o,isZoomOut:r}=(0,g.useSelect)((e=>{const{isZoomOut:t}=G(e(ji));return{isZoomedOut:t(),isZoomOut:t}}),[]),i=(0,h.useRef)(!1),s=(0,h.useRef)(e);(0,h.useEffect)((()=>{o!==s.current&&(i.current=!1)}),[o]),(0,h.useEffect)((()=>(s.current=e,e!==r()&&(i.current=!0,e?t("auto-scaled"):n()),()=>{i.current&&r()&&n()})),[e,r,n,t])}const tI=()=>{};const nI=(0,h.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,onSelect:r,showInserterHelpPanel:i,showMostUsedBlocks:s,__experimentalFilterValue:l="",shouldFocusBlock:a=!0,onPatternCategorySelection:c,onClose:u,__experimentalInitialTab:p,__experimentalInitialCategory:f},b){const{isZoomOutMode:k,hasSectionRootClientId:v}=(0,g.useSelect)((e=>{const{isZoomOut:t,getSectionRootClientId:n}=G(e(ji));return{isZoomOutMode:t(),hasSectionRootClientId:!!n()}}),[]),[_,y,x]=(0,m.useDebouncedInput)(l),[S,w]=(0,h.useState)(null),[C,B]=(0,h.useState)(f),[I,j]=(0,h.useState)("all"),[E,M]=(0,h.useState)(null),P=(0,m.useViewportMatch)("large"),[R,A]=(0,h.useState)(p||(k?"patterns":"blocks"));eI(v&&("patterns"===R||"media"===R)&&P);const[N,L,D]=KC({rootClientId:e,clientId:t,isAppender:n,insertionIndex:o,shouldFocusBlock:a}),O=(0,h.useRef)(),z=(0,h.useCallback)(((e,t,n,o)=>{L(e,t,n,o),r(e),window.requestAnimationFrame((()=>{a||O.current?.contains(b.current.ownerDocument.activeElement)||O.current?.querySelector("button").focus()}))}),[L,r,a]),V=(0,h.useCallback)(((e,t,...n)=>{D(!1),L(e,{patternName:t},...n),r()}),[L,r]),F=(0,h.useCallback)((e=>{D(e),w(e)}),[D,w]),H=(0,h.useCallback)(((e,t)=>{B(e),j(t),c?.()}),[B,c]),U="patterns"===R&&!x&&!!C,$="media"===R&&!!E,W=(0,h.useMemo)((()=>"media"===R?null:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:e=>{S&&w(null),y(e)},value:_,label:(0,T.__)("Search"),placeholder:(0,T.__)("Search")}),!!x&&(0,d.jsx)(YB,{filterValue:x,onSelect:r,onHover:F,rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,showBlockDirectory:!0,shouldFocusBlock:a,prioritizePatterns:"patterns"===R})]})),[R,S,w,y,_,x,r,F,a,t,e,o,n]),K=(0,h.useMemo)((()=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"block-editor-inserter__block-list",children:(0,d.jsx)(DC,{ref:O,rootClientId:N,onInsert:z,onHover:F,showMostUsedBlocks:s})}),i&&(0,d.jsxs)("div",{className:"block-editor-inserter__tips",children:[(0,d.jsx)(ws.VisuallyHidden,{as:"h2",children:(0,T.__)("A tip for using the block editor")}),(0,d.jsx)(Kb,{})]})]})),[N,z,F,s,i]),Z=(0,h.useMemo)((()=>(0,d.jsx)(PB,{rootClientId:N,onInsert:V,onSelectCategory:H,selectedCategory:C,children:U&&(0,d.jsx)(EB,{rootClientId:N,onInsert:V,category:C,patternFilter:I,showTitlesAsTooltip:!0})})),[N,V,H,I,C,U]),q=(0,h.useMemo)((()=>(0,d.jsx)(GB,{rootClientId:N,selectedCategory:E,onSelectCategory:M,onInsert:z,children:$&&(0,d.jsx)(HB,{rootClientId:N,onInsert:z,category:E})})),[N,z,E,M,$]),Y=(0,h.useRef)();return(0,h.useLayoutEffect)((()=>{Y.current&&window.requestAnimationFrame((()=>{Y.current.querySelector('[role="tab"][aria-selected="true"]')?.focus()}))}),[]),(0,d.jsxs)("div",{className:ms("block-editor-inserter__menu",{"show-panel":U||$,"is-zoom-out":k}),ref:b,children:[(0,d.jsx)("div",{className:"block-editor-inserter__main-area",children:(0,d.jsx)(JB,{ref:Y,onSelect:e=>{"patterns"!==e&&B(null),A(e)},onClose:u,selectedTab:R,closeButtonLabel:(0,T.__)("Close Block Inserter"),tabs:[{name:"blocks",title:(0,T.__)("Blocks"),panel:(0,d.jsxs)(d.Fragment,{children:[W,"blocks"===R&&!x&&K]})},{name:"patterns",title:(0,T.__)("Patterns"),panel:(0,d.jsxs)(d.Fragment,{children:[W,"patterns"===R&&!x&&Z]})},{name:"media",title:(0,T.__)("Media"),panel:(0,d.jsxs)(d.Fragment,{children:[W,q]})}]})}),i&&S&&(0,d.jsx)(ws.Popover,{className:"block-editor-inserter__preview-container__popover",placement:"right-start",offset:16,focusOnMount:!1,animate:!1,children:(0,d.jsx)(_C,{item:S})})]})}));var oI=(0,h.forwardRef)((function(e,t){return(0,d.jsx)(nI,{...e,onPatternCategorySelection:tI,ref:t})}));function rI({onSelect:e,rootClientId:t,clientId:n,isAppender:o,selectBlockOnInsert:r,hasSearch:i=!0}){const[s,l]=(0,h.useState)(""),[a,c]=KC({onSelect:e,rootClientId:t,clientId:n,isAppender:o,selectBlockOnInsert:r}),[u]=MC(a,c,!0),{setInserterIsOpened:p,insertionIndex:m}=(0,g.useSelect)((e=>{const{getSettings:t,getBlockIndex:o,getBlockCount:r}=e(ji),i=t(),s=o(n),l=r();return{setInserterIsOpened:i.__experimentalSetIsInserterOpened,insertionIndex:-1===s?l:s}}),[n]),f=i&&u.length>6;(0,h.useEffect)((()=>{p&&p(!1)}),[p]);return(0,d.jsxs)("div",{className:ms("block-editor-inserter__quick-inserter",{"has-search":f,"has-expand":p}),children:[f&&(0,d.jsx)(ws.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:s,onChange:e=>{l(e)},label:(0,T.__)("Search"),placeholder:(0,T.__)("Search")}),(0,d.jsx)("div",{className:"block-editor-inserter__quick-inserter-results",children:(0,d.jsx)(YB,{filterValue:s,onSelect:e,rootClientId:t,clientId:n,isAppender:o,maxBlockPatterns:s?2:0,maxBlockTypes:6,isDraggable:!1,selectBlockOnInsert:r,isQuick:!0})}),p&&(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{p({filterValue:s,onSelect:e,rootClientId:t,insertionIndex:m})},"aria-label":(0,T.__)("Browse all. This will open the main inserter panel in the editor toolbar."),children:(0,T.__)("Browse all")})]})}const iI=({onToggle:e,disabled:t,isOpen:n,blockTitle:o,hasSingleBlockType:r,toggleProps:i={}})=>{const{as:s=ws.Button,label:l,onClick:a,...c}=i;let u=l;return!u&&r?u=(0,T.sprintf)((0,T._x)("Add %s","directly add the only allowed block"),o):u||(u=(0,T._x)("Add block","Generic label for block inserter button")),(0,d.jsx)(s,{__next40pxDefaultSize:!i.as||void 0,icon:cc,label:u,tooltipPosition:"bottom",onClick:function(t){e&&e(t),a&&a(t)},className:"block-editor-inserter__toggle","aria-haspopup":!r&&"true","aria-expanded":!r&&n,disabled:t,...c})};class sI extends h.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle({onToggle:e,isOpen:t}){const{disabled:n,blockTitle:o,hasSingleBlockType:r,directInsertBlock:i,toggleProps:s,hasItems:l,renderToggle:a=iI}=this.props;return a({onToggle:e,isOpen:t,disabled:n||!l,blockTitle:o,hasSingleBlockType:r,directInsertBlock:i,toggleProps:s})}renderContent({onClose:e}){const{rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r,__experimentalIsQuick:i,onSelectOrClose:s,selectBlockOnInsert:l}=this.props;return i?(0,d.jsx)(rI,{onSelect:t=>{const n=Array.isArray(t)&&t?.length?t[0]:t;s&&"function"==typeof s&&s(n),e()},rootClientId:t,clientId:n,isAppender:o,selectBlockOnInsert:l}):(0,d.jsx)(oI,{onSelect:()=>{e()},rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:i}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,d.jsx)(ws.Dropdown,{className:"block-editor-inserter",contentClassName:ms("block-editor-inserter__popover",{"is-quick":r}),popoverProps:{position:e,shift:!0},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,T.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:i})}}var lI=(0,m.compose)([(0,g.withSelect)(((e,{clientId:t,rootClientId:n,shouldDirectInsert:o=!0})=>{const{getBlockRootClientId:r,hasInserterItems:i,getAllowedBlocks:s,getDirectInsertBlock:l}=e(ji),{getBlockVariations:a}=e(p.store),c=s(n=n||r(t)||void 0),u=o&&l(n),d=1===c?.length&&0===a(c[0].name,"inserter")?.length;let h=!1;return d&&(h=c[0]),{hasItems:i(n),hasSingleBlockType:d,blockTitle:h?h.title:"",allowedBlockType:h,directInsertBlock:u,rootClientId:n}})),(0,g.withDispatch)(((e,t,{select:n})=>({insertOnlyAllowedBlock(){const{rootClientId:o,clientId:r,isAppender:i,hasSingleBlockType:s,allowedBlockType:l,directInsertBlock:a,onSelectOrClose:c,selectBlockOnInsert:u}=t;if(!s&&!a)return;const{insertBlock:d}=e(ji);let h;if(a){const e=function(e){const{getBlock:t,getPreviousBlockClientId:i}=n(ji);if(!e||!r&&!o)return{};const s={};let l={};if(r){const e=t(r),n=t(i(r));e?.name===n?.name&&(l=n?.attributes||{})}else{const e=t(o);if(e?.innerBlocks?.length){const t=e.innerBlocks[e.innerBlocks.length-1];a&&a?.name===t.name&&(l=t.attributes)}}return e.forEach((e=>{l.hasOwnProperty(e)&&(s[e]=l[e])})),s}(a.attributesToCopy);h=(0,p.createBlock)(a.name,{...a.attributes||{},...e})}else h=(0,p.createBlock)(l.name);d(h,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:s,getBlockRootClientId:l}=n(ji);if(r)return e(r);const a=t();return!i&&a&&l(a)===o?e(a)+1:s(o).length}(),o,u),c&&c(h);const g=(0,T.sprintf)((0,T.__)("%s block added"),l.title);(0,Uo.speak)(g)}}))),(0,m.ifCondition)((({hasItems:e,isAppender:t,rootClientId:n,clientId:o})=>e||!t&&!n&&!o))])(sI);function aI({rootClientId:e,className:t,onFocus:n,tabIndex:o,onSelect:r},i){return(0,d.jsx)(lI,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,onSelectOrClose:(...e)=>{r&&"function"==typeof r&&r(...e)},renderToggle:({onToggle:e,disabled:r,isOpen:s,blockTitle:l,hasSingleBlockType:a})=>{const c=!a,u=a?(0,T.sprintf)((0,T._x)("Add %s","directly add the only allowed block"),l):(0,T._x)("Add block","Generic label for block inserter button");return(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,ref:i,onFocus:n,tabIndex:o,className:ms(t,"block-editor-button-block-appender"),onClick:e,"aria-haspopup":c?"true":void 0,"aria-expanded":c?s:void 0,disabled:r,label:u,showTooltip:!0,children:(0,d.jsx)(Ol,{icon:cc})})},isAppender:!0})}const cI=(0,h.forwardRef)(((e,t)=>(I()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),aI(e,t))));var uI=(0,h.forwardRef)(aI);function dI({clientId:e,contentRef:t,parentLayout:n}){const o=(0,g.useSelect)((e=>e(ji).getSettings().isDistractionFree),[]),r=bh(e);if(o||!r)return null;const i=n?.isManualPlacement&&window.__experimentalEnableGridInteractivity;return(0,d.jsx)(pI,{gridClientId:e,gridElement:r,isManualGrid:i,ref:t})}const pI=(0,h.forwardRef)((({gridClientId:e,gridElement:t,isManualGrid:n},o)=>{const[r,i]=(0,h.useState)((()=>$b(t))),[s,l]=(0,h.useState)(!1);return(0,h.useEffect)((()=>{const e=()=>i($b(t)),n=new window.ResizeObserver(e);n.observe(t,{box:"border-box"});const o=new window.ResizeObserver(e);return o.observe(t),()=>{n.disconnect(),o.disconnect()}}),[t]),(0,h.useEffect)((()=>{function e(){l(!0)}function t(){l(!1)}return document.addEventListener("drag",e),document.addEventListener("dragend",t),()=>{document.removeEventListener("drag",e),document.removeEventListener("dragend",t)}}),[]),(0,d.jsx)(of,{className:ms("block-editor-grid-visualizer",{"is-dropping-allowed":s}),clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",children:(0,d.jsx)("div",{ref:o,className:"block-editor-grid-visualizer__grid",style:r.style,children:n?(0,d.jsx)(hI,{gridClientId:e,gridInfo:r}):Array.from({length:r.numItems},((e,t)=>(0,d.jsx)(gI,{color:r.currentColor},t)))})})}));function hI({gridClientId:e,gridInfo:t}){const[n,o]=(0,h.useState)(null),r=(0,g.useSelect)((t=>{const{getBlockOrder:n,getBlockStyles:o}=G(t(ji));return o(n(e))}),[e]),i=(0,h.useMemo)((()=>{const e=[];for(const t of Object.values(r)){const{columnStart:n,rowStart:o,columnSpan:r=1,rowSpan:i=1}=t?.layout??{};n&&o&&e.push(new Fb({columnStart:n,rowStart:o,columnSpan:r,rowSpan:i}))}return e}),[r]);return Vb(1,t.numRows).map((r=>Vb(1,t.numColumns).map((s=>{const l=i.some((e=>e.contains(s,r))),a=n?.contains(s,r)??!1;return(0,d.jsx)(gI,{color:t.currentColor,className:a&&"is-highlighted",children:l?(0,d.jsx)(fI,{column:s,row:r,gridClientId:e,gridInfo:t,setHighlightedRect:o}):(0,d.jsx)(bI,{column:s,row:r,gridClientId:e,gridInfo:t,setHighlightedRect:o})},`${r}-${s}`)}))))}function gI({color:e,children:t,className:n}){return(0,d.jsx)("div",{className:ms("block-editor-grid-visualizer__cell",n),style:{boxShadow:`inset 0 0 0 1px color-mix(in srgb, ${e} 20%, #0000)`,color:e},children:t})}function mI(e,t,n,o,r){const{getBlockAttributes:i,getBlockRootClientId:s,canInsertBlockType:l,getBlockName:a}=(0,g.useSelect)(ji),{updateBlockAttributes:c,moveBlocksToPosition:u,__unstableMarkNextChangeAsNotPersistent:d}=(0,g.useDispatch)(ji),p=km(n,o.numColumns);return function({validateDrag:e,onDragEnter:t,onDragLeave:n,onDrop:o}){const{getDraggedBlockClientIds:r}=(0,g.useSelect)(ji);return(0,m.__experimentalUseDropZone)({onDragEnter(){const[n]=r();n&&e(n)&&t(n)},onDragLeave(){n()},onDrop(){const[t]=r();t&&e(t)&&o(t)}})}({validateDrag(r){const s=a(r);if(!l(s,n))return!1;const c=i(r),u=new Fb({columnStart:e,rowStart:t,columnSpan:c.style?.layout?.columnSpan,rowSpan:c.style?.layout?.rowSpan});return new Fb({columnSpan:o.numColumns,rowSpan:o.numRows}).containsRect(u)},onDragEnter(n){const o=i(n);r(new Fb({columnStart:e,rowStart:t,columnSpan:o.style?.layout?.columnSpan,rowSpan:o.style?.layout?.rowSpan}))},onDragLeave(){r((n=>n?.columnStart===e&&n?.rowStart===t?null:n))},onDrop(o){r(null);const l=i(o);c(o,{style:{...l.style,layout:{...l.style?.layout,columnStart:e,rowStart:t}}}),d(),u([o],s(o),n,p(e,t))}})}function fI({column:e,row:t,gridClientId:n,gridInfo:o,setHighlightedRect:r}){return(0,d.jsx)("div",{className:"block-editor-grid-visualizer__drop-zone",ref:mI(e,t,n,o,r)})}function bI({column:e,row:t,gridClientId:n,gridInfo:o,setHighlightedRect:r}){const{updateBlockAttributes:i,moveBlocksToPosition:s,__unstableMarkNextChangeAsNotPersistent:l}=(0,g.useDispatch)(ji),a=km(n,o.numColumns);return(0,d.jsx)(uI,{rootClientId:n,className:"block-editor-grid-visualizer__appender",ref:mI(e,t,n,o,r),style:{color:o.currentColor},onSelect:o=>{o&&(i(o.clientId,{style:{layout:{columnStart:e,rowStart:t}}}),l(),s([o.clientId],n,n,a(e,t)))}})}function kI({clientId:e,bounds:t,onChange:n,parentLayout:o}){const r=bh(e),i=r?.parentElement,{isManualPlacement:s}=o;return r&&i?(0,d.jsx)(vI,{clientId:e,bounds:t,blockElement:r,rootBlockElement:i,onChange:n,isManualGrid:s&&window.__experimentalEnableGridInteractivity}):null}function vI({clientId:e,bounds:t,blockElement:n,rootBlockElement:o,onChange:r,isManualGrid:i}){const[s,l]=(0,h.useState)(null),[a,c]=(0,h.useState)({top:!1,bottom:!1,left:!1,right:!1});(0,h.useEffect)((()=>{const e=new window.ResizeObserver((()=>{const e=n.getBoundingClientRect(),t=o.getBoundingClientRect();c({top:e.top>t.top,bottom:e.bottom<t.bottom,left:e.left>t.left,right:e.right<t.right})}));return e.observe(n),()=>e.disconnect()}),[n,o]);const u={right:"left",left:"right"},p={top:"flex-end",bottom:"flex-start"},g={display:"flex",justifyContent:"center",alignItems:"center",...u[s]&&{justifyContent:u[s]},...p[s]&&{alignItems:p[s]}};return(0,d.jsx)(of,{className:"block-editor-grid-item-resizer",clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",additionalStyles:g,children:(0,d.jsx)(ws.ResizableBox,{className:"block-editor-grid-item-resizer__box",size:{width:"100%",height:"100%"},enable:{bottom:a.bottom,bottomLeft:!1,bottomRight:!1,left:a.left,right:a.right,top:a.top,topLeft:!1,topRight:!1},bounds:t,boundsByDirection:!0,onPointerDown:({target:e,pointerId:t})=>{e.setPointerCapture(t)},onResizeStart:(e,t)=>{l(t)},onResizeStop:(e,t,s)=>{const l=parseFloat(Hb(o,"column-gap")),a=parseFloat(Hb(o,"row-gap")),c=Ub(Hb(o,"grid-template-columns"),l),u=Ub(Hb(o,"grid-template-rows"),a),d=new window.DOMRect(n.offsetLeft+s.offsetLeft,n.offsetTop+s.offsetTop,s.offsetWidth,s.offsetHeight),p=Gb(c,d.left)+1,h=Gb(u,d.top)+1,g=Gb(c,d.right,"end")+1,m=Gb(u,d.bottom,"end")+1;r({columnSpan:g-p+1,rowSpan:m-h+1,columnStart:i?p:void 0,rowStart:i?h:void 0})}})})}var _I=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})}),yI=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})});function xI({layout:e,parentLayout:t,onChange:n,gridClientId:o,blockClientId:r}){const{moveBlocksToPosition:i,__unstableMarkNextChangeAsNotPersistent:s}=(0,g.useDispatch)(ji),l=e?.columnStart??1,a=e?.rowStart??1,c=l+(e?.columnSpan??1)-1,u=a+(e?.rowSpan??1)-1,p=t?.columnCount,h=t?.rowCount,m=km(o,p);return(0,d.jsx)(Rs,{group:"parent",children:(0,d.jsxs)(ws.ToolbarGroup,{className:"block-editor-grid-item-mover__move-button-container",children:[(0,d.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-left",children:(0,d.jsx)(SI,{icon:(0,T.isRTL)()?Zb:qb,label:(0,T.__)("Move left"),description:(0,T.__)("Move left"),isDisabled:l<=1,onClick:()=>{n({columnStart:l-1}),s(),i([r],o,o,m(l-1,a))}})}),(0,d.jsxs)("div",{className:"block-editor-grid-item-mover__move-vertical-button-container",children:[(0,d.jsx)(SI,{className:"is-up-button",icon:_I,label:(0,T.__)("Move up"),description:(0,T.__)("Move up"),isDisabled:a<=1,onClick:()=>{n({rowStart:a-1}),s(),i([r],o,o,m(l,a-1))}}),(0,d.jsx)(SI,{className:"is-down-button",icon:yI,label:(0,T.__)("Move down"),description:(0,T.__)("Move down"),isDisabled:h&&u>=h,onClick:()=>{n({rowStart:a+1}),s(),i([r],o,o,m(l,a+1))}})]}),(0,d.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-right",children:(0,d.jsx)(SI,{icon:(0,T.isRTL)()?qb:Zb,label:(0,T.__)("Move right"),description:(0,T.__)("Move right"),isDisabled:p&&c>=p,onClick:()=>{n({columnStart:l+1}),s(),i([r],o,o,m(l+1,a))}})})]})})}function SI({className:e,icon:t,label:n,isDisabled:o,onClick:r,description:i}){const s=`block-editor-grid-item-mover-button__description-${(0,m.useInstanceId)(SI)}`;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.ToolbarButton,{className:ms("block-editor-grid-item-mover-button",e),icon:t,label:n,"aria-describedby":s,onClick:o?null:r,disabled:o,accessibleWhenDisabled:!0}),(0,d.jsx)(ws.VisuallyHidden,{id:s,children:i})]})}const wI={};function CI({clientId:e,style:t,setAttributes:n,allowSizingOnChildren:o,isManualPlacement:r,parentLayout:i}){const{rootClientId:s,isVisible:l}=(0,g.useSelect)((t=>{const{getBlockRootClientId:n,getBlockEditingMode:o,getTemplateLock:r}=t(ji),i=n(e);return r(i)||"default"!==o(i)?{rootClientId:i,isVisible:!1}:{rootClientId:i,isVisible:!0}}),[e]),[a,c]=(0,h.useState)();if(!l)return null;function u(e){n({style:{...t,layout:{...t?.layout,...e}}})}return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(dI,{clientId:s,contentRef:c,parentLayout:i}),o&&(0,d.jsx)(kI,{clientId:e,bounds:a,onChange:u,parentLayout:i}),r&&window.__experimentalEnableGridInteractivity&&(0,d.jsx)(xI,{layout:t?.layout,parentLayout:i,onChange:u,gridClientId:s,blockClientId:e})]})}var BI={useBlockProps:function({style:e}){const t=(0,g.useSelect)((e=>!e(ji).getSettings().disableLayoutStyles)),n=e?.layout??{},{selfStretch:o,flexSize:r,columnStart:i,rowStart:s,columnSpan:l,rowSpan:a}=n,c=ta()||{},{columnCount:u,minimumColumnWidth:d}=c,p=(0,m.useInstanceId)(wI),h=`.wp-container-content-${p}`;let f="";if(t&&("fixed"===o&&r?f=`${h} {\n\t\t\t\tflex-basis: ${r};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===o?f=`${h} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`:i&&l?f=`${h} {\n\t\t\t\tgrid-column: ${i} / span ${l};\n\t\t\t}`:i?f=`${h} {\n\t\t\t\tgrid-column: ${i};\n\t\t\t}`:l&&(f=`${h} {\n\t\t\t\tgrid-column: span ${l};\n\t\t\t}`),s&&a?f+=`${h} {\n\t\t\t\tgrid-row: ${s} / span ${a};\n\t\t\t}`:s?f+=`${h} {\n\t\t\t\tgrid-row: ${s};\n\t\t\t}`:a&&(f+=`${h} {\n\t\t\t\tgrid-row: span ${a};\n\t\t\t}`),(l||i)&&(d||!u))){let e=parseFloat(d);isNaN(e)&&(e=12);let t=d?.replace(e,"");["px","rem","em"].includes(t)||(t="rem");let n=2;n=l&&i?l+i-1:l||i;const o="px"===t?24:1.5,r=n*e+(n-1)*o,s=2*e+o-1,a=l&&l>1?"1/-1":"auto";f+=`@container (max-width: ${Math.max(r,s)}${t}) {\n\t\t\t\t${h} {\n\t\t\t\t\tgrid-column: ${a};\n\t\t\t\t\tgrid-row: auto;\n\t\t\t\t}\n\t\t\t}`}if(_s({css:f}),f)return{className:`wp-container-content-${p}`}},edit:function({clientId:e,style:t,setAttributes:n}){const o=ta()||{},{type:r="default",allowSizingOnChildren:i=!1,isManualPlacement:s}=o;return"grid"!==r?null:(0,d.jsx)(CI,{clientId:e,style:t,setAttributes:n,allowSizingOnChildren:i,isManualPlacement:s,parentLayout:o})},attributeKeys:["style"],hasSupport:()=>!0};var II={edit:function({clientId:e}){const{templateLock:t,isLockedByParent:n,isEditingAsBlocks:o}=(0,g.useSelect)((t=>{const{getContentLockingParent:n,getTemplateLock:o,getTemporarilyEditingAsBlocks:r}=G(t(ji));return{templateLock:o(e),isLockedByParent:!!n(e),isEditingAsBlocks:r()===e}}),[e]),{stopEditingAsBlocks:r}=G((0,g.useDispatch)(ji)),i=!n&&"contentOnly"===t,s=(0,h.useCallback)((()=>{r(e)}),[e,r]);return i||o?o&&!i&&(0,d.jsx)(Rs,{group:"other",children:(0,d.jsx)(ws.ToolbarButton,{onClick:s,children:(0,T.__)("Done")})}):null},hasSupport:()=>!0};const jI="metadata";(0,f.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){return e?.attributes?.[jI]?.type||(e.attributes={...e.attributes,[jI]:{type:"object"}}),e})),(0,f.addFilter)("blocks.switchToBlockType.transformedBlock","core/metadata/addTransforms",(function(e,t,n,o){if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(o.length>1&&t.length>1&&o.length!==t.length)return e;const r=t[n]?.attributes?.metadata;if(!r)return e;const i={};return r.noteId&&!e.attributes?.metadata?.noteId&&(i.noteId=r.noteId),r.name&&!e.attributes?.metadata?.name&&(0,p.hasBlockSupport)(e.name,"renaming",!0)&&(i.name=r.name),void 0!==r.blockVisibility&&!e.attributes?.metadata?.blockVisibility&&(0,p.hasBlockSupport)(e.name,"visibility",!0)&&(i.blockVisibility=r.blockVisibility),Object.keys(i).length>0?{...e,attributes:{...e.attributes,metadata:{...e.attributes.metadata,...i}}}:e}));const EI={};var TI={edit:function({name:e,clientId:t,metadata:{ignoredHookedBlocks:n=[]}={}}){const o=(0,g.useSelect)((e=>e(p.store).getBlockTypes()),[]),r=(0,h.useMemo)((()=>o?.filter((({name:t,blockHooks:o})=>o&&e in o||n.includes(t)))),[o,e,n]),i=(0,g.useSelect)((n=>{const{getBlocks:o,getBlockRootClientId:i,getGlobalBlockCount:s}=n(ji),l=i(t),a=r.reduce(((n,r)=>{if(0===s(r.name))return n;const i=r?.blockHooks?.[e];let a;switch(i){case"before":case"after":a=o(l);break;case"first_child":case"last_child":a=o(t);break;case void 0:a=[...o(l),...o(t)]}const c=a?.find((e=>e.name===r.name));return c?{...n,[r.name]:c.clientId}:n}),{});return Object.values(a).length>0?a:EI}),[r,e,t]),{getBlockIndex:s,getBlockCount:l,getBlockRootClientId:a}=(0,g.useSelect)(ji),{insertBlock:c,removeBlock:u}=(0,g.useDispatch)(ji);if(!r.length)return null;const m=r.reduce(((e,t)=>{const[n]=t.name.split("/");return e[n]||(e[n]=[]),e[n].push(t),e}),{});return(0,d.jsx)(Fa,{children:(0,d.jsxs)(ws.PanelBody,{className:"block-editor-hooks__block-hooks",title:(0,T.__)("Plugins"),initialOpen:!0,children:[(0,d.jsx)("p",{className:"block-editor-hooks__block-hooks-helptext",children:(0,T.__)("Manage the inclusion of blocks added automatically by plugins.")}),Object.keys(m).map((n=>(0,d.jsxs)(h.Fragment,{children:[(0,d.jsx)("h3",{children:n}),m[n].map((n=>{const o=n.name in i;return(0,d.jsx)(ws.ToggleControl,{__nextHasNoMarginBottom:!0,checked:o,label:n.title,onChange:()=>{if(o)u(i[n.name],!1);else{const o=n.blockHooks[e];((e,n)=>{const o=s(t),r=l(t),i=a(t);switch(n){case"before":case"after":c(e,"after"===n?o+1:o,i,!1);break;case"first_child":case"last_child":c(e,"first_child"===n?0:r,t,!1);break;case void 0:c(e,o+1,i,!1)}})((0,p.createBlock)(n.name),o)}}},n.title)}))]},n)))]})})},attributeKeys:["metadata"],hasSupport:()=>!0};const{Menu:MI}=G(ws.privateApis),PI={},RI=(e,t)=>{const n=(0,p.getBlockType)(e).attributes?.[t]?.type;return"rich-text"===n?"string":n};function AI({attribute:e,binding:t,sources:n}){const{clientId:o}=C(),{updateBlockBindings:r}=dv(),i=(0,m.useViewportMatch)("medium","<"),s=(0,h.useContext)(sv),{attributeType:l,select:a}=(0,g.useSelect)((t=>{const{name:n}=t(ji).getBlock(o);return{attributeType:RI(n,e),select:t}}),[o,e]);return(0,d.jsx)(MI,{placement:i?"bottom-start":"left-start",children:Object.entries(n).map((([n,o])=>{const c=o.data?.filter((e=>e?.type===l));return!c||0===c.length?null:(0,d.jsxs)(MI,{placement:i?"bottom-start":"left-start",children:[(0,d.jsx)(MI.SubmenuTriggerItem,{children:(0,d.jsx)(MI.ItemLabel,{children:o.label})}),(0,d.jsx)(MI.Popover,{gutter:8,children:(0,d.jsx)(MI.Group,{children:c.map((i=>{const l={source:n,args:i?.args||{key:i.key}};let c={};try{c=o.getValues({select:a,context:s,bindings:{[e]:l}})}catch(e){}return(0,d.jsxs)(MI.CheckboxItem,{onChange:()=>{const n=E()(t?.args,i.args)??i.key===t?.args?.key;r(n?{[e]:void 0}:{[e]:l})},name:e+"-binding",value:c[e],checked:E()(t?.args,i.args)??i.key===t?.args?.key,children:[(0,d.jsx)(MI.ItemLabel,{children:i?.label}),(0,d.jsx)(MI.ItemHelpText,{children:c[e]})]},n+JSON.stringify(i.args)||i.key)}))})})]},n)}))})}function NI({attribute:e,binding:t,sources:n,blockName:o}){const{source:r,args:i}=t||{},s=n?.[r];let l,a=!0;if(void 0===t){const t=RI(o,e);l=Object.values(n).some((e=>e.data?.some((e=>e?.type===t))))?(0,T.__)("Not connected"):(0,T.__)("No sources available"),a=!0}else s?l=s.data?.find((e=>E()(e.args,i)))?.label||s.label||r:(a=!1,l=(0,T.__)("Source not registered"),0===Object.keys(n).length&&(l=(0,T.__)("No sources available")));return(0,d.jsxs)(ws.__experimentalVStack,{className:"block-editor-bindings__item",spacing:0,children:[(0,d.jsx)(ws.__experimentalText,{truncate:!0,children:e}),(0,d.jsx)(ws.__experimentalText,{truncate:!0,variant:a?"muted":void 0,isDestructive:!a,children:l})]})}function LI({attribute:e,binding:t,sources:n,blockName:o}){const r=(0,m.useViewportMatch)("medium","<");return(0,d.jsx)(ws.__experimentalToolsPanelItem,{hasValue:()=>!!t,label:e,children:(0,d.jsx)(MI,{placement:r?"bottom-start":"left-start",children:(0,d.jsx)(MI.TriggerButton,{render:(0,d.jsx)(ws.__experimentalItem,{}),disabled:!0,children:(0,d.jsx)(NI,{attribute:e,binding:t,sources:n,blockName:o})})})})}function DI({attribute:e,binding:t,sources:n,blockName:o}){const{updateBlockBindings:r}=dv(),i=(0,m.useViewportMatch)("medium","<");return(0,d.jsx)(ws.__experimentalToolsPanelItem,{hasValue:()=>!!t,label:e,onDeselect:()=>{r({[e]:void 0})},children:(0,d.jsxs)(MI,{placement:i?"bottom-start":"left-start",children:[(0,d.jsx)(MI.TriggerButton,{render:(0,d.jsx)(ws.__experimentalItem,{}),children:(0,d.jsx)(NI,{attribute:e,binding:t,sources:n,blockName:o})}),(0,d.jsx)(MI.Popover,{gutter:i?8:36,children:(0,d.jsx)(AI,{attribute:e,binding:t,sources:n})})]})})}var OI={edit:({name:e,metadata:t})=>{const n=(0,h.useContext)(sv),{removeAllBlockBindings:o}=dv(),r=(0,m.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}},i={},{sources:s,canUpdateBlockBindings:l,bindableAttributes:a}=(0,g.useSelect)((t=>{const{__experimentalBlockBindingsSupportedAttributes:o}=t(ji).getSettings(),r=o?.[e];if(!r||0===r.length)return PI;const s=(0,p.getBlockBindingsSources)();return Object.entries(s).forEach((([e,{getFieldsList:o,usesContext:r,label:s,getValues:l}])=>{const a={};if(r?.length)for(const e of r)a[e]=n[e];if(o){const n=o({select:t,context:a});i[e]={data:n||[],label:s,getValues:l}}else i[e]={data:[],label:s,getValues:l}})),{sources:Object.values(i).length>0?i:PI,canUpdateBlockBindings:t(ji).getSettings().canUpdateBlockBindings,bindableAttributes:r}}),[n,e]);if(!a||0===a.length)return null;const{bindings:c}=t||{},u=Object.values(s).some((e=>e.data&&e.data.length>0)),f=!l||!u;return void 0!==c||u?(0,d.jsx)(Fa,{group:"bindings",children:(0,d.jsxs)(ws.__experimentalToolsPanel,{label:(0,T.__)("Attributes"),resetAll:()=>{o()},dropdownMenuProps:r,className:"block-editor-bindings__panel",children:[(0,d.jsx)(ws.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:a.map((t=>{const n=c?.[t],o=RI(e,t),r=Object.values(s).some((e=>e.data?.some((e=>e?.type===o))));return f||!r?(0,d.jsx)(LI,{attribute:t,binding:n,sources:s,blockName:e},t):(0,d.jsx)(DI,{attribute:t,binding:n,sources:s,blockName:e},t)}))}),(0,d.jsx)(ws.__experimentalText,{as:"div",variant:"muted",children:(0,d.jsx)("p",{children:(0,T.__)("Attributes connected to custom fields or other dynamic data.")})})]})}):null},attributeKeys:["metadata"],hasSupport:e=>!["core/post-date","core/navigation-link","core/navigation-submenu"].includes(e)};function zI(e,t,n,o,r=1,i=1){for(let s=i;;s++)for(let l=s===i?r:1;l<=t;l++){const t=new Fb({columnStart:l,rowStart:s,columnSpan:n,rowSpan:o});if(!e.some((e=>e.intersectsRect(t))))return[l,s]}}function VI(e){!function({clientId:e}){const{gridLayout:t,blockOrder:n,selectedBlockLayout:o}=(0,g.useSelect)((t=>{const{getBlockAttributes:n,getBlockOrder:o}=t(ji),r=t(ji).getSelectedBlock();return{gridLayout:n(e).layout??{},blockOrder:o(e),selectedBlockLayout:r?.attributes.style?.layout}}),[e]),{getBlockAttributes:r,getBlockRootClientId:i}=(0,g.useSelect)(ji),{updateBlockAttributes:s,__unstableMarkNextChangeAsNotPersistent:l}=(0,g.useDispatch)(ji),a=(0,h.useMemo)((()=>o?new Fb(o):null),[o]),c=(0,m.usePrevious)(a),u=(0,m.usePrevious)(t.isManualPlacement),d=(0,m.usePrevious)(n);(0,h.useEffect)((()=>{const o={};if(t.isManualPlacement){const s=[];for(const e of n){const{columnStart:t,rowStart:n,columnSpan:o=1,rowSpan:i=1}=r(e).style?.layout??{};t&&n&&s.push(new Fb({columnStart:t,rowStart:n,columnSpan:o,rowSpan:i}))}for(const e of n){const n=r(e),{columnStart:i,rowStart:l,columnSpan:a=1,rowSpan:u=1}=n.style?.layout??{};if(i&&l)continue;const[d,p]=zI(s,t.columnCount,a,u,c?.columnEnd,c?.rowEnd);s.push(new Fb({columnStart:d,rowStart:p,columnSpan:a,rowSpan:u})),o[e]={style:{...n.style,layout:{...n.style?.layout,columnStart:d,rowStart:p}}}}const l=Math.max(...s.map((e=>e.rowEnd)));(!t.rowCount||t.rowCount<l)&&(o[e]={layout:{...t,rowCount:l}});for(const e of d??[])if(!n.includes(e)){const t=i(e);if(null===t)continue;const n=r(t);if("grid"===n?.layout?.type)continue;const s=r(e),{columnStart:l,rowStart:a,columnSpan:c,rowSpan:u,...d}=s.style?.layout??{};if(l||a||c||u){const t=0===Object.keys(d).length;o[e]=me(s,["style","layout"],t?void 0:d)}}}else{if(!0===u)for(const e of n){const t=r(e),{columnStart:n,rowStart:i,...s}=t.style?.layout??{};if(n||i){const n=0===Object.keys(s).length;o[e]=me(t,["style","layout"],n?void 0:s)}}t.rowCount&&(o[e]={layout:{...t,rowCount:void 0}})}Object.keys(o).length&&(l(),s(Object.keys(o),o,!0))}),[e,t,d,n,c,u,l,r,i,s])}(e)}function FI({clientId:e,layout:t}){const n=(0,g.useSelect)((t=>{const{isBlockSelected:n,isDraggingBlocks:o,getTemplateLock:r,getBlockEditingMode:i}=t(ji);return!(!o()&&!n(e)||r(e)||"default"!==i(e))}),[e]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(VI,{clientId:e}),n&&(0,d.jsx)(dI,{clientId:e,parentLayout:t})]})}(0,f.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||(0,p.hasBlockSupport)(e,"renaming",!0)&&(e.__experimentalLabel=(e,{context:t})=>{const{metadata:n}=e;if("list-view"===t&&n?.name)return n.name}),e}));const HI=(0,m.createHigherOrderComponent)((e=>t=>"grid"!==t.attributes.layout?.type?(0,d.jsx)(e,{...t},"edit"):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(FI,{clientId:t.clientId,layout:t.attributes.layout}),(0,d.jsx)(e,{...t},"edit")]})),"addGridVisualizerToBlockEdit");function UI(e){const t=e.style?.border||{};return{className:Lp(e)||void 0,style:kf({border:t})}}function GI(e){const{colors:t}=Nd(),n=UI(e),{borderColor:o}=e;if(o){const e=Ip({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function $I(e){return{style:kf({shadow:e.style?.shadow||""})}}function WI(e){const{backgroundColor:t,textColor:n,gradient:o,style:r}=e,i=Ad("background-color",t),s=Ad("color",n),l=Op(o),a=l||r?.color?.gradient;return{className:ms(s,l,{[i]:!a&&!!i,"has-text-color":n||r?.color?.text,"has-background":t||r?.color?.background||o||r?.color?.gradient,"has-link-color":r?.elements?.link?.color})||void 0,style:kf({color:r?.color||{}})}}function KI(e){const{backgroundColor:t,textColor:n,gradient:o}=e,[r,i,s,l,a,c]=Ti("color.palette.custom","color.palette.theme","color.palette.default","color.gradients.custom","color.gradients.theme","color.gradients.default"),u=(0,h.useMemo)((()=>[...r||[],...i||[],...s||[]]),[r,i,s]),d=(0,h.useMemo)((()=>[...l||[],...a||[],...c||[]]),[l,a,c]),p=WI(e);if(t){const e=Pd(u,t);p.style.backgroundColor=e.color}if(o&&(p.style.background=zp(d,o)),n){const e=Pd(u,n);p.style.color=e.color}return p}function ZI(e){const{style:t}=e;return{style:kf({spacing:t?.spacing||{}})}}(0,f.addFilter)("editor.BlockEdit","core/editor/grid-visualizer",HI);const{kebabCase:qI}=G(ws.privateApis);function YI(e,t){let n=e?.style?.typography||{};n={...n,fontSize:Wi({size:e?.style?.typography?.fontSize},t)};const o=kf({typography:n}),r=e?.fontFamily?`has-${qI(e.fontFamily)}-font-family`:"";return{className:ms(r,e?.style?.typography?.textAlign?`has-text-align-${e?.style?.typography?.textAlign}`:"",Pg(e?.fontSize)),style:o}}function XI(e){const[t,n]=(0,h.useState)(e);return(0,h.useEffect)((()=>{e&&n(e)}),[e]),t}var QI;!function(e){e=e.map((e=>({...e,Edit:(0,h.memo)(e.edit)})));const t=(0,m.createHigherOrderComponent)((t=>n=>{const o=C();return[...e.map(((e,t)=>{const{Edit:r,hasSupport:i,attributeKeys:s=[],shareWithChildBlocks:l}=e;if(!(o[b]||o[k]&&l)||!i(n.name))return null;const a={};for(const e of s)n.attributes[e]&&(a[e]=n.attributes[e]);return(0,d.jsx)(r,{name:n.name,isSelected:n.isSelected,clientId:n.clientId,setAttributes:n.setAttributes,__unstableParentLayout:n.__unstableParentLayout,...a},t)})),(0,d.jsx)(t,{...n},"edit")]}),"withBlockEditHooks");(0,f.addFilter)("editor.BlockEdit","core/editor/hooks",t)}([ka,Kg,qu,Xu,Cf,Zf,Xg,lb,Lb,II,TI,OI,BI,Wu].filter(Boolean)),function(e){const t=(0,m.createHigherOrderComponent)((t=>n=>{const[o,r]=(0,h.useState)(Array(e.length).fill(void 0));return[...e.map(((e,t)=>{const{hasSupport:o,attributeKeys:i=[],useBlockProps:s,isMatch:l}=e,a={};for(const e of i)n.attributes[e]&&(a[e]=n.attributes[e]);return!Object.keys(a).length||!o(n.name)||l&&!l(a)?null:(0,d.jsx)(Ss,{index:t,useBlockProps:s,setAllWrapperProps:r,name:n.name,clientId:n.clientId,...a},t)})),(0,d.jsx)(t,{...n,wrapperProps:o.filter(Boolean).reduce(((e,t)=>({...e,...t,className:ms(e.className,t.className),style:{...e.style,...t.style}})),n.wrapperProps||{})},"edit")]}),"withBlockListBlockHooks");(0,f.addFilter)("editor.BlockListBlock","core/editor/hooks",t)}([ka,Kg,Ou,Cf,Ph,gf,Zf,jg,Ng,Xg,Dp,lb,Mb,BI]),QI=[ka,Kg,qu,Yu,Xu,Dp,Xg,Ph,Cf,jg,Ng],(0,f.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(function(e,t,n){return QI.reduce(((e,o)=>{const{hasSupport:r,attributeKeys:i=[],addSaveProps:s}=o,l={};for(const e of i)n[e]&&(l[e]=n[e]);return Object.keys(l).length&&r(t)?s(e,t,l):e}),e)}),0),(0,f.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(e=>(e.hasOwnProperty("className")&&!e.className&&delete e.className,e)));const{kebabCase:JI}=G(ws.privateApis),ej=([e,...t])=>e.toUpperCase()+t.join(""),tj=e=>(0,m.createHigherOrderComponent)((t=>n=>(0,d.jsx)(t,{...n,colors:e})),"withCustomColorPalette"),nj=()=>(0,m.createHigherOrderComponent)((e=>t=>{const[n,o,r]=Ti("color.palette.custom","color.palette.theme","color.palette.default"),i=(0,h.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,d.jsx)(e,{...t,colors:i})}),"withEditorColorPalette");function oj(e,t){const n=e.reduce(((e,t)=>({...e,..."string"==typeof t?{[t]:JI(t)}:t})),{});return(0,m.compose)([t,e=>class extends h.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=wd(t),o=({color:e})=>n.contrast(e),r=Math.max(...e.map(o));return e.find((e=>o(e)===r)).color}(t,e)}createSetters(){return Object.keys(n).reduce(((e,t)=>{const n=ej(t),o=`custom${n}`;return e[`set${n}`]=this.createSetColor(t,o),e}),{})}createSetColor(e,t){return n=>{const o=Rd(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps({attributes:e,colors:t},o){return Object.entries(n).reduce(((n,[r,i])=>{const s=Pd(t,e[r],e[`custom${ej(r)}`]),l=o[r],a=l?.color;return a===s.color&&l?n[r]=l:n[r]={...s,class:Ad(i,s.slug)},n}),{})}render(){return(0,d.jsx)(e,{...{...this.props,colors:void 0,...this.state,...this.setters,colorUtils:this.colorUtils}})}}])}function rj(e){return(...t)=>{const n=tj(e);return(0,m.createHigherOrderComponent)(oj(t,n),"withCustomColors")}}function ij(...e){const t=nj();return(0,m.createHigherOrderComponent)(oj(e,t),"withColors")}var sj=function(e){const[t,n]=Ti("typography.fontSizes","typography.customFontSize");return(0,d.jsx)(ws.FontSizePicker,{...e,fontSizes:t,disableCustomFontSizes:!n})};const lj=[],aj=([e,...t])=>e.toUpperCase()+t.join("");var cj=(...e)=>{const t=e.reduce(((e,t)=>(e[t]=`custom${aj(t)}`,e)),{});return(0,m.createHigherOrderComponent)((0,m.compose)([(0,m.createHigherOrderComponent)((e=>t=>{const[n]=Ti("typography.fontSizes");return(0,d.jsx)(e,{...t,fontSizes:n||lj})}),"withFontSizes"),e=>class extends h.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return Object.entries(t).reduce(((e,[t,n])=>(e[`set${aj(t)}`]=this.createSetFontSize(t,n),e)),{})}createSetFontSize(e,t){return n=>{const o=this.props.fontSizes?.find((({size:e})=>e===Number(n)));this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps({attributes:e,fontSizes:n},o){const r=(t,n)=>!o[n]||(e[n]?e[n]!==o[n].slug:o[n].size!==e[t]);if(!Object.values(t).some(r))return null;const i=Object.entries(t).filter((([e,t])=>r(t,e))).reduce(((t,[o,r])=>{const i=e[o],s=Tg(n,i,e[r]);return t[o]={...s,class:Pg(i)},t}),{});return{...o,...i}}render(){return(0,d.jsx)(e,{...{...this.props,fontSizes:void 0,...this.state,...this.setters}})}}]),"withFontSizes")};const uj=()=>{};var dj={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockId:n,prioritizedBlocks:o}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlock:n,getBlockListSettings:o,getBlockRootClientId:r}=e(ji),{getActiveBlockVariation:i}=e(p.store),s=t(),{name:l,attributes:a}=n(s),c=i(l,a),u=r(s);return{selectedBlockId:c?`${l}/${c.name}`:l,rootClientId:u,prioritizedBlocks:o(u)?.prioritizedInserterBlocks}}),[]),[r,i,s]=MC(t,uj,!0),l=(0,h.useMemo)((()=>(e.trim()?gB(r,i,s,e):ZB(xt(r,"frecency","desc"),o)).filter((e=>e.id!==n)).slice(0,9)),[e,n,r,i,s,o]);return[(0,h.useMemo)((()=>l.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Vu,{icon:n,showColors:!0},"icon"),t]}),isDisabled:o}}))),[l])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o,syncStatus:r,blocks:i}=e;return{action:"replace",value:"unsynced"===r?(i??[]).map((e=>(0,p.cloneBlock)(e))):(0,p.createBlock)(t,n,(0,p.createBlocksFromInnerBlocksTemplate)(o))}}};const pj=window.wp.apiFetch;var hj=n.n(pj),gj=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})});var mj={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await hj()({path:(0,Ua.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ol,{icon:"page"===e.subtype?pc:gj},"icon"),(0,vS.decodeEntities)(e.title)]}),getOptionCompletion:e=>(0,d.jsx)("a",{href:e.url,children:e.title})};const fj=[];function bj({completers:e=fj}){const{name:t}=C();return(0,h.useMemo)((()=>{let n=[...e,mj];return(t===(0,p.getDefaultBlockName)()||(0,p.getBlockSupport)(t,"__experimentalSlashInserter",!1))&&(n=[...n,dj]),(0,f.hasFilter)("editor.Autocomplete.completers")&&(n===e&&(n=n.map((e=>({...e})))),n=(0,f.applyFilters)("editor.Autocomplete.completers",n,t)),n}),[e,t])}var kj=function(e){return(0,d.jsx)(ws.Autocomplete,{...e,completers:bj(e)})},vj=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"})});var _j=function({isActive:e,label:t=(0,T.__)("Full height"),onToggle:n,isDisabled:o}){return(0,d.jsx)(ws.ToolbarButton,{isActive:e,icon:vj,label:t,onClick:()=>n(!e),disabled:o})};const yj=()=>{};var xj=function(e){const{label:t=(0,T.__)("Change matrix alignment"),onChange:n=yj,value:o="center",isDisabled:r}=e,i=(0,d.jsx)(ws.AlignmentMatrixControl.Icon,{value:o});return(0,d.jsx)(ws.Dropdown,{popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e,isOpen:n})=>(0,d.jsx)(ws.ToolbarButton,{onClick:e,"aria-haspopup":"true","aria-expanded":n,onKeyDown:t=>{n||t.keyCode!==Wa.DOWN||(t.preventDefault(),e())},label:t,icon:i,showTooltip:!0,disabled:r}),renderContent:()=>(0,d.jsx)(ws.AlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})};function Sj({clientId:e,maximumLength:t,context:n}){const o=(0,g.useSelect)((t=>{if(!e)return null;const{getBlockName:o,getBlockAttributes:r}=t(ji),{getBlockType:i,getActiveBlockVariation:s}=t(p.store),l=o(e),a=i(l);if(!a)return null;const c=r(e),u=(0,p.__experimentalGetBlockLabel)(a,c,n);if(u!==a.title)return u;const d=s(l,c);return d?.title||a.title}),[e,n]);if(!o)return null;if(t&&t>0&&o.length>t){const e="...";return o.slice(0,t-e.length)+e}return o}function wj({clientId:e,maximumLength:t,context:n}){return Sj({clientId:e,maximumLength:t,context:n})}var Cj=function({rootLabelText:e}){const{selectBlock:t,clearSelectedBlock:n}=(0,g.useDispatch)(ji),{clientId:o,parents:r,hasSelection:i}=(0,g.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getEnabledBlockParents:o}=G(e(ji)),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),s=e||(0,T.__)("Document"),l=(0,h.useRef)();return fh(o,l),(0,d.jsxs)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,T.__)("Block breadcrumb"),children:[(0,d.jsxs)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true",children:[i&&(0,d.jsx)(ws.Button,{size:"small",className:"block-editor-block-breadcrumb__button",onClick:()=>{const e=l.current?.closest(".editor-styles-wrapper");n(),function(e){if(!e)return null;const t=Array.from(document.querySelectorAll('iframe[name="editor-canvas"]').values()).find((t=>(t.contentDocument||t.contentWindow.document)===e.ownerDocument))??e;return t?.closest('[role="region"]')??t}(e)?.focus()},children:s}),!i&&(0,d.jsx)("span",{children:s}),!!o&&(0,d.jsx)(Ol,{icon:oc,className:"block-editor-block-breadcrumb__separator"})]}),r.map((e=>(0,d.jsxs)("li",{children:[(0,d.jsx)(ws.Button,{size:"small",className:"block-editor-block-breadcrumb__button",onClick:()=>t(e),children:(0,d.jsx)(wj,{clientId:e,maximumLength:35})}),(0,d.jsx)(Ol,{icon:oc,className:"block-editor-block-breadcrumb__separator"})]},e))),!!o&&(0,d.jsx)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true",children:(0,d.jsx)(wj,{clientId:o,maximumLength:35})})]})};function Bj(e){return(0,g.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(ji);return n(e)}),[e])}const Ij={placement:"top-start"},jj={...Ij,flip:!1,shift:!0},Ej={...Ij,flip:!0,shift:!1};function Tj(e,t,n,o,r){if(!e||!t)return jj;const i=n?.scrollTop||0,s=Qm(t),l=i+e.getBoundingClientRect().top,a=e.ownerDocument.documentElement.clientHeight,c=l+o,u=s.top>c,d=s.height>a-o;return r||!u&&!d?Ej:jj}function Mj({contentElement:e,clientId:t}){const n=bh(t),[o,r]=(0,h.useState)(0),{blockIndex:i,isSticky:s}=(0,g.useSelect)((e=>{const{getBlockIndex:n,getBlockAttributes:o}=e(ji);return{blockIndex:n(t),isSticky:rb(o(t))}}),[t]),l=(0,h.useMemo)((()=>{if(e)return(0,Ga.getScrollContainer)(e)}),[e]),[a,c]=(0,h.useState)((()=>Tj(e,n,l,o,s))),u=(0,m.useRefEffect)((e=>{r(e.offsetHeight)}),[]),d=(0,h.useCallback)((()=>c(Tj(e,n,l,o,s))),[e,n,l,o]);return(0,h.useLayoutEffect)(d,[i,d]),(0,h.useLayoutEffect)((()=>{if(!e||!n)return;const t=e?.ownerDocument?.defaultView;let o;t?.addEventHandler?.("resize",d);const r=n?.ownerDocument?.defaultView;return r.ResizeObserver&&(o=new r.ResizeObserver(d),o.observe(n)),()=>{t?.removeEventHandler?.("resize",d),o&&o.disconnect()}}),[d,e,n]),{...a,ref:u}}function Pj(e){const t=(0,g.useSelect)((t=>{const{getBlockRootClientId:n,getBlockParents:o,__experimentalGetBlockListSettingsForBlocks:r,isBlockInsertionPointVisible:i,getBlockInsertionPoint:s,getBlockOrder:l,hasMultiSelection:a,getLastMultiSelectedBlockClientId:c}=t(ji),u=o(e),d=r(u),p=u.find((e=>d[e]?.__experimentalCaptureToolbars));let h=!1;if(i()){const t=s();h=l(t.rootClientId)[t.index]===e}return{capturingClientId:p,isInsertionPointVisible:h,lastClientId:a()?c():null,rootClientId:n(e)}}),[e]);return t}function Rj({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:o,lastClientId:r,rootClientId:i}=Pj(e),s=Mj({contentElement:t?.current,clientId:e});return(0,d.jsx)(of,{clientId:n||e,bottomClientId:r,className:ms("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":o}),__unstableContentRef:t,...s,children:(0,d.jsx)("div",{className:"block-editor-block-list__empty-block-inserter",children:(0,d.jsx)(lI,{position:"bottom right",rootClientId:i,clientId:e,__experimentalIsQuick:!0})})})}var Aj=({appendToOwnerDocument:e,children:t,clientIds:n,cloneClassname:o,elementId:r,onDragStart:i,onDragEnd:s,fadeWhenDisabled:l=!1,dragComponent:a})=>{const{srcRootClientId:c,isDraggable:u,icon:f,visibleInserter:b,getBlockType:k}=(0,g.useSelect)((e=>{const{canMoveBlocks:t,getBlockRootClientId:o,getBlockName:r,getBlockAttributes:i,isBlockInsertionPointVisible:s}=e(ji),{getBlockType:l,getActiveBlockVariation:a}=e(p.store),c=o(n[0]),u=r(n[0]),d=a(u,i(n[0]));return{srcRootClientId:c,isDraggable:t(n),icon:d?.icon||l(u)?.icon,visibleInserter:s(),getBlockType:l}}),[n]),v=(0,h.useRef)(!1),[_,y,x]=function(){const e=(0,h.useRef)(null),t=(0,h.useRef)(null),n=(0,h.useRef)(null),o=(0,h.useRef)(null);return(0,h.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,h.useCallback)((r=>{e.current=r.clientY,n.current=(0,Ga.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,h.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,i=e.current-n.current.offsetTop,s=o.clientY-n.current.offsetTop;if(o.clientY>i){const e=Math.max(r-i-50,0),n=Math.max(s-i-50,0),o=0===e||0===n?0:n/e;t.current=25*o}else if(o.clientY<i){const e=Math.max(i-50,0),n=Math.max(i-s-50,0),o=0===e||0===n?0:n/e;t.current=-25*o}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{getAllowedBlocks:S,getBlockNamesByClientId:w,getBlockRootClientId:C}=(0,g.useSelect)(ji),{startDraggingBlocks:B,stopDraggingBlocks:I}=(0,g.useDispatch)(ji);(0,h.useEffect)((()=>()=>{v.current&&I()}),[]);const j=bh(n[0]),E=j?.closest("body");if((0,h.useEffect)((()=>{if(!E||!l)return;const e=(0,m.throttle)((e=>{if(!e.target.closest("[data-block]"))return;const t=w(n),o=e.target.closest("[data-block]").getAttribute("data-block"),r=S(o),i=w([o])[0];let s;if(0===r?.length){const e=C(o),n=w([e])[0],r=S(e);s=GS(k,r,t,n)}else s=GS(k,r,t,i);s||b?window?.document?.body?.classList?.remove("block-draggable-invalid-drag-token"):window?.document?.body?.classList?.add("block-draggable-invalid-drag-token")}),200);return E.addEventListener("dragover",e),()=>{E.removeEventListener("dragover",e)}}),[n,E,l,S,w,C,k,b]),!u)return t({draggable:!1});const T={type:"block",srcClientIds:n,srcRootClientId:c};return(0,d.jsx)(ws.Draggable,{appendToOwnerDocument:e,cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:T,onDragStart:e=>{window.requestAnimationFrame((()=>{B(n),v.current=!0,_(e),i&&i()}))},onDragOver:y,onDragEnd:()=>{I(),v.current=!1,x(),s&&s()},__experimentalDragComponent:void 0!==a?a:(0,d.jsx)(SC,{count:n.length,icon:f,fadeWhenDisabled:!0}),elementId:r,children:({onDraggableStart:e,onDraggableEnd:n})=>t({draggable:!0,onDragStart:e,onDragEnd:n})})};const Nj=(e,t)=>"up"===e?"horizontal"===t?(0,T.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,T.isRTL)()?"left":"right":"down":null;function Lj(e,t,n,o,r,i,s){const l=n+1;if(e>1)return function(e,t,n,o,r,i){const s=t+1;if(n&&o)return(0,T.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=Nj("down",i);if("down"===t)return(0,T.sprintf)((0,T.__)("Move %1$d blocks from position %2$d down by one place"),e,s);if("left"===t)return(0,T.sprintf)((0,T.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if("right"===t)return(0,T.sprintf)((0,T.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(r>0&&o){const e=Nj("down",i);if("down"===e)return(0,T.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,T.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,T.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=Nj("up",i);if("up"===t)return(0,T.sprintf)((0,T.__)("Move %1$d blocks from position %2$d up by one place"),e,s);if("left"===t)return(0,T.sprintf)((0,T.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if("right"===t)return(0,T.sprintf)((0,T.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(r<0&&n){const e=Nj("up",i);if("up"===e)return(0,T.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,T.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,T.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,o,r,i,s);if(o&&r)return(0,T.sprintf)((0,T.__)("Block %s is the only block, and cannot be moved"),t);if(i>0&&!r){const e=Nj("down",s);if("down"===e)return(0,T.sprintf)((0,T.__)("Move %1$s block from position %2$d down to position %3$d"),t,l,l+1);if("left"===e)return(0,T.sprintf)((0,T.__)("Move %1$s block from position %2$d left to position %3$d"),t,l,l+1);if("right"===e)return(0,T.sprintf)((0,T.__)("Move %1$s block from position %2$d right to position %3$d"),t,l,l+1)}if(i>0&&r){const e=Nj("down",s);if("down"===e)return(0,T.sprintf)((0,T.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,T.sprintf)((0,T.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,T.sprintf)((0,T.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(i<0&&!o){const e=Nj("up",s);if("up"===e)return(0,T.sprintf)((0,T.__)("Move %1$s block from position %2$d up to position %3$d"),t,l,l-1);if("left"===e)return(0,T.sprintf)((0,T.__)("Move %1$s block from position %2$d left to position %3$d"),t,l,l-1);if("right"===e)return(0,T.sprintf)((0,T.__)("Move %1$s block from position %2$d right to position %3$d"),t,l,l-1)}if(i<0&&o){const e=Nj("up",s);if("up"===e)return(0,T.sprintf)((0,T.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,T.sprintf)((0,T.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,T.sprintf)((0,T.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}const Dj=(e,t)=>"up"===e?"horizontal"===t?(0,T.isRTL)()?Zb:qb:_I:"down"===e?"horizontal"===t?(0,T.isRTL)()?qb:Zb:yI:null,Oj=(e,t)=>"up"===e?"horizontal"===t?(0,T.isRTL)()?(0,T.__)("Move right"):(0,T.__)("Move left"):(0,T.__)("Move up"):"down"===e?"horizontal"===t?(0,T.isRTL)()?(0,T.__)("Move left"):(0,T.__)("Move right"):(0,T.__)("Move down"):null,zj=(0,h.forwardRef)((({clientIds:e,direction:t,orientation:n,...o},r)=>{const i=(0,m.useInstanceId)(zj),s=Array.isArray(e)?e:[e],l=s.length,{disabled:a}=o,{blockType:c,isDisabled:u,rootClientId:h,isFirst:f,isLast:b,firstIndex:k,orientation:v="vertical"}=(0,g.useSelect)((e=>{const{getBlockIndex:o,getBlockRootClientId:r,getBlockOrder:i,getBlock:l,getBlockListSettings:c}=e(ji),u=s[0],d=r(u),h=o(u),g=o(s[s.length-1]),m=i(d),f=l(u),b=0===h,k=g===m.length-1,{orientation:v}=c(d)||{};return{blockType:f?(0,p.getBlockType)(f.name):null,isDisabled:a||("up"===t?b:k),rootClientId:d,firstIndex:h,isFirst:b,isLast:k,orientation:n||v}}),[e,t]),{moveBlocksDown:_,moveBlocksUp:y}=(0,g.useDispatch)(ji),x="up"===t?y:_,S=`block-editor-block-mover-button__description-${i}`;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,ref:r,className:ms("block-editor-block-mover-button",`is-${t}-button`),icon:Dj(t,v),label:Oj(t,v),"aria-describedby":S,...o,onClick:u?null:t=>{x(e,h),o.onClick&&o.onClick(t)},disabled:u,accessibleWhenDisabled:!0}),(0,d.jsx)(ws.VisuallyHidden,{id:S,children:Lj(l,c&&c.title,k,f,b,"up"===t?-1:1,v)})]})})),Vj=(0,h.forwardRef)(((e,t)=>(0,d.jsx)(zj,{direction:"up",ref:t,...e}))),Fj=(0,h.forwardRef)(((e,t)=>(0,d.jsx)(zj,{direction:"down",ref:t,...e})));var Hj=function({clientIds:e,hideDragHandle:t,isBlockMoverUpButtonDisabled:n,isBlockMoverDownButtonDisabled:o}){const{canMove:r,rootClientId:i,isFirst:s,isLast:l,orientation:a,isManualGrid:c}=(0,g.useSelect)((t=>{const{getBlockIndex:n,getBlockListSettings:o,canMoveBlocks:r,getBlockOrder:i,getBlockRootClientId:s,getBlockAttributes:l}=t(ji),a=Array.isArray(e)?e:[e],c=a[0],u=s(c),d=n(c),p=n(a[a.length-1]),h=i(u),{layout:g={}}=l(u)??{};return{canMove:r(e),rootClientId:u,isFirst:0===d,isLast:p===h.length-1,orientation:o(u)?.orientation,isManualGrid:"grid"===g.type&&g.isManualPlacement&&window.__experimentalEnableGridInteractivity}}),[e]);return!r||s&&l&&!i||t&&c?null:(0,d.jsxs)(ws.ToolbarGroup,{className:ms("block-editor-block-mover",{"is-horizontal":"horizontal"===a}),children:[!t&&(0,d.jsx)(Aj,{clientIds:e,fadeWhenDisabled:!0,children:e=>(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,icon:xC,className:"block-editor-block-mover__drag-handle",label:(0,T.__)("Drag"),tabIndex:"-1",...e})}),!c&&(0,d.jsxs)("div",{className:"block-editor-block-mover__move-button-container",children:[(0,d.jsx)(ws.ToolbarItem,{children:t=>(0,d.jsx)(Vj,{disabled:n,clientIds:e,...t})}),(0,d.jsx)(ws.ToolbarItem,{children:t=>(0,d.jsx)(Fj,{disabled:o,clientIds:e,...t})})]})]})};const{clearTimeout:Uj,setTimeout:Gj}=window,$j=200;function Wj({ref:e,isFocused:t,highlightParent:n,debounceTimeout:o=$j}){const{getSelectedBlockClientId:r,getBlockRootClientId:i}=(0,g.useSelect)(ji),{toggleBlockHighlight:s}=(0,g.useDispatch)(ji),l=(0,h.useRef)(),a=(0,g.useSelect)((e=>e(ji).getSettings().isDistractionFree),[]),c=e=>{if(e&&a)return;const t=r(),o=n?i(t):t;s(o,e)},u=()=>{const n=e?.current&&e.current.matches(":hover");return!t&&!n},d=()=>{const e=l.current;e&&Uj&&Uj(e)};return(0,h.useEffect)((()=>()=>{c(!1),d()}),[]),{debouncedShowGestures:e=>{e&&e.stopPropagation(),d(),c(!0)},debouncedHideGestures:e=>{e&&e.stopPropagation(),d(),l.current=Gj((()=>{u()&&c(!1)}),o)}}}function Kj({ref:e,highlightParent:t=!1,debounceTimeout:n=$j}){const[o,r]=(0,h.useState)(!1),{debouncedShowGestures:i,debouncedHideGestures:s}=Wj({ref:e,debounceTimeout:n,isFocused:o,highlightParent:t}),l=(0,h.useRef)(!1),a=()=>e?.current&&e.current.contains(e.current.ownerDocument.activeElement);return(0,h.useEffect)((()=>{const t=e.current,n=()=>{a()&&(r(!0),i())},o=()=>{a()||(r(!1),s())};return t&&!l.current&&(t.addEventListener("focus",n,!0),t.addEventListener("blur",o,!0),l.current=!0),()=>{t&&(t.removeEventListener("focus",n),t.removeEventListener("blur",o))}}),[e,l,r,i,s]),{onMouseMove:i,onMouseLeave:s}}function Zj(){const{selectBlock:e}=(0,g.useDispatch)(ji),{parentClientId:t}=(0,g.useSelect)((e=>{const{getBlockParents:t,getSelectedBlockClientId:n,getParentSectionBlock:o}=G(e(ji)),r=n(),i=o(r),s=t(r);return{parentClientId:i??s[s.length-1]}}),[]),n=Xf(t),o=(0,h.useRef)(),r=Kj({ref:o,highlightParent:!0});return(0,d.jsx)("div",{className:"block-editor-block-parent-selector",ref:o,...r,children:(0,d.jsx)(ws.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:(0,T.sprintf)((0,T.__)("Select parent block: %s"),n?.title),showTooltip:!0,icon:(0,d.jsx)(Vu,{icon:n?.icon})})},t)}var qj=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})});function Yj({blocks:e}){return(0,m.useViewportMatch)("medium","<")?null:(0,d.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,d.jsx)(ws.Popover,{className:"block-editor-block-switcher__popover-preview",placement:"right-start",focusOnMount:!1,offset:16,children:(0,d.jsxs)("div",{className:"block-editor-block-switcher__preview",children:[(0,d.jsx)("div",{className:"block-editor-block-switcher__preview-title",children:(0,T.__)("Preview")}),(0,d.jsx)(kC,{viewportWidth:601,blocks:e})]})})})}const Xj={};function Qj({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:i}=e;return(0,d.jsxs)(ws.MenuItem,{className:(0,p.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},onMouseLeave:()=>n(null),onMouseEnter:()=>n(o),children:[(0,d.jsx)(Vu,{icon:r,showColors:!0}),i]})}var Jj=({transformations:e,onSelect:t,blocks:n})=>{const[o,r]=(0,h.useState)();return(0,d.jsxs)(d.Fragment,{children:[o&&(0,d.jsx)(Yj,{blocks:(0,p.cloneBlock)(n[0],e.find((({name:e})=>e===o)).attributes)}),e?.map((e=>(0,d.jsx)(Qj,{item:e,onSelect:t,setHoveredTransformItemName:r},e.name)))]})};function eE({restTransformations:e,onSelect:t,setHoveredTransformItemName:n}){return e.map((e=>(0,d.jsx)(tE,{item:e,onSelect:t,setHoveredTransformItemName:n},e.name)))}function tE({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:i,isDisabled:s}=e;return(0,d.jsxs)(ws.MenuItem,{className:(0,p.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},disabled:s,onMouseLeave:()=>n(null),onMouseEnter:()=>n(o),children:[(0,d.jsx)(Vu,{icon:r,showColors:!0}),i]})}var nE=({className:e,possibleBlockTransformations:t,possibleBlockVariationTransformations:n,onSelect:o,onSelectVariation:r,blocks:i})=>{const[s,l]=(0,h.useState)(),{priorityTextTransformations:a,restTransformations:c}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,h.useMemo)((()=>{const n=Object.keys(t),o=e.reduce(((e,t)=>{const{name:o}=t;return n.includes(o)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e}),{priorityTextTransformations:[],restTransformations:[]});if(1===o.priorityTextTransformations.length&&"core/quote"===o.priorityTextTransformations[0].name){const e=o.priorityTextTransformations.pop();o.restTransformations.push(e)}return o}),[e]);return n.priorityTextTransformations.sort((({name:e},{name:n})=>t[e]<t[n]?-1:1)),n}(t),u=a.length&&c.length,g=!!c.length&&(0,d.jsx)(eE,{restTransformations:c,onSelect:o,setHoveredTransformItemName:l});return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(ws.MenuGroup,{label:(0,T.__)("Transform to"),className:e,children:[s&&(0,d.jsx)(Yj,{blocks:(0,p.switchToBlockType)(i,s)}),!!n?.length&&(0,d.jsx)(Jj,{transformations:n,blocks:i,onSelect:r}),a.map((e=>(0,d.jsx)(tE,{item:e,onSelect:o,setHoveredTransformItemName:l},e.name))),!u&&g]}),!!u&&(0,d.jsx)(ws.MenuGroup,{className:e,children:g})]})};function oE(e,t,n){const o=new(wg())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function rE(e){return e?.find((e=>e.isDefault))}function iE({clientId:e,onSwitch:t}){const{styles:n,block:o,blockType:r,className:i}=(0,g.useSelect)((t=>{const{getBlock:n}=t(ji),o=n(e);if(!o)return{};const r=(0,p.getBlockType)(o.name),{getBlockStyles:i}=t(p.store);return{block:o,blockType:r,styles:i(o.name),className:o.attributes.className||""}}),[e]),{updateBlockAttributes:s}=(0,g.useDispatch)(ji),l=function(e){return e&&0!==e.length?rE(e)?e:[{name:"default",label:(0,T._x)("Default","block style"),isDefault:!0},...e]:[]}(n),a=function(e,t){for(const n of new(wg())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=e?.find((({name:e})=>e===t));if(o)return o}return rE(e)}(l,i),c=function(e,t){return(0,h.useMemo)((()=>{const n=t?.example,o=t?.name;return n&&o?(0,p.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,p.cloneBlock)(e):void 0}),[t?.example?e?.name:e,t])}(o,r);return{onSelect:n=>{const o=oE(i,a,n);s(e,{className:o}),t()},stylesToRender:l,activeStyle:a,genericPreviewBlock:c,className:i}}const sE=()=>{};function lE({clientId:e,onSwitch:t=sE}){const{onSelect:n,stylesToRender:o,activeStyle:r}=iE({clientId:e,onSwitch:t});return o&&0!==o.length?(0,d.jsx)(d.Fragment,{children:o.map((e=>{const t=e.label||e.name;return(0,d.jsx)(ws.MenuItem,{icon:r.name===e.name?ip:null,onClick:()=>n(e),children:(0,d.jsx)(ws.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0,children:t})},e.name)}))}):null}function aE({hoveredBlock:e,onSwitch:t}){const{clientId:n}=e;return(0,d.jsx)(ws.MenuGroup,{label:(0,T.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup",children:(0,d.jsx)(lE,{clientId:n,onSwitch:t})})}const cE=(e,t,n=new Set)=>{const{clientId:o,name:r,innerBlocks:i=[]}=e;if(!n.has(o)){if(r===t)return e;for(const e of i){const o=cE(e,t,n);if(o)return o}}},uE=(e,t)=>{const n=((e,t)=>{const n=(0,p.getBlockAttributesNamesByRole)(e,"content");return n?.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};var dE=(e,t)=>(0,h.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,p.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=cE(r,t.name,o);if(n){e=!0,o.add(n.clientId),uE(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]);function pE({patterns:e,onSelect:t}){const n=(0,m.useViewportMatch)("medium","<");return(0,d.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,d.jsx)(ws.Popover,{className:"block-editor-block-switcher__popover-preview",placement:n?"bottom":"right-start",offset:16,children:(0,d.jsx)("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview",children:(0,d.jsx)(hE,{patterns:e,onSelect:t})})})})}function hE({patterns:e,onSelect:t}){return(0,d.jsx)(ws.Composite,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,T.__)("Patterns list"),children:e.map((e=>(0,d.jsx)(gE,{pattern:e,onSelect:t},e.name)))})}function gE({pattern:e,onSelect:t}){const n="block-editor-block-switcher__preview-patterns-container",o=(0,m.useInstanceId)(gE,`${n}-list__item-description`);return(0,d.jsxs)("div",{className:`${n}-list__list-item`,children:[(0,d.jsxs)(ws.Composite.Item,{render:(0,d.jsx)("div",{role:"option","aria-label":e.title,"aria-describedby":e.description?o:void 0,className:`${n}-list__item`}),onClick:()=>t(e.transformedBlocks),children:[(0,d.jsx)(kC,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,d.jsx)("div",{className:`${n}-list__item-title`,children:e.title})]}),!!e.description&&(0,d.jsx)(ws.VisuallyHidden,{id:o,children:e.description})]})}var mE=function({blocks:e,patterns:t,onSelect:n}){const[o,r]=(0,h.useState)(!1),i=dE(t,e);return i.length?(0,d.jsxs)(ws.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup",children:[o&&(0,d.jsx)(pE,{patterns:i,onSelect:n}),(0,d.jsx)(ws.MenuItem,{onClick:e=>{e.preventDefault(),r(!o)},icon:Zb,children:(0,T.__)("Patterns")})]}):null};function fE({onClose:e,clientIds:t,hasBlockStyles:n,canRemove:o}){const{replaceBlocks:r,multiSelect:i,updateBlockAttributes:s}=(0,g.useDispatch)(ji),{possibleBlockTransformations:l,patterns:a,blocks:c,isUsingBindings:u}=(0,g.useSelect)((e=>{const{getBlockAttributes:n,getBlocksByClientId:o,getBlockRootClientId:r,getBlockTransformItems:i,__experimentalGetPatternTransformItems:s}=e(ji),l=r(t[0]),a=o(t);return{blocks:a,possibleBlockTransformations:i(a,l),patterns:s(a,l),isUsingBindings:t.every((e=>!!n(e)?.metadata?.bindings))}}),[t]),m=function({clientIds:e,blocks:t}){const{activeBlockVariation:n,blockVariationTransformations:o}=(0,g.useSelect)((n=>{const{getBlockAttributes:o,canRemoveBlocks:r}=n(ji),{getActiveBlockVariation:i,getBlockVariations:s}=n(p.store),l=r(e);if(1!==t.length||!l)return Xj;const[a]=t;return{blockVariationTransformations:s(a.name,"transform"),activeBlockVariation:i(a.name,o(a.clientId))}}),[e,t]);return(0,h.useMemo)((()=>o?.filter((({name:e})=>e!==n?.name))),[o,n])}({clientIds:t,blocks:c});function f(e){e.length>1&&i(e[0].clientId,e[e.length-1].clientId)}const b=1===c.length,k=b&&((0,p.isTemplatePart)(c[0])||(0,p.isReusableBlock)(c[0])),v=!!l?.length&&o&&!k,_=!!m?.length,y=!!a?.length&&o,x=v||_;if(!(n||x||y))return(0,d.jsx)("p",{className:"block-editor-block-switcher__no-transforms",children:(0,T.__)("No transforms.")});const S=b?(0,T._x)("This block is connected.","block toolbar button label and description"):(0,T._x)("These blocks are connected.","block toolbar button label and description");return(0,d.jsxs)("div",{className:"block-editor-block-switcher__container",children:[y&&(0,d.jsx)(mE,{blocks:c,patterns:a,onSelect:n=>{!function(e){r(t,e),f(e)}(n),e()}}),x&&(0,d.jsx)(nE,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:l,possibleBlockVariationTransformations:m,blocks:c,onSelect:n=>{!function(e){const n=(0,p.switchToBlockType)(c,e);r(t,n),f(n)}(n),e()},onSelectVariation:t=>{!function(e){s(c[0].clientId,{...m.find((({name:t})=>t===e)).attributes})}(t),e()}}),n&&(0,d.jsx)(aE,{hoveredBlock:c[0],onSwitch:e}),u&&(0,d.jsx)(ws.MenuGroup,{children:(0,d.jsx)(ws.__experimentalText,{className:"block-editor-block-switcher__binding-indicator",children:S})})]})}var bE=({clientIds:e})=>{const{hasContentOnlyLocking:t,canRemove:n,hasBlockStyles:o,icon:r,invalidBlocks:i,isReusable:s,isTemplate:l,isDisabled:a,isSectionInSelection:c}=(0,g.useSelect)((t=>{const{getTemplateLock:n,getBlocksByClientId:o,getBlockAttributes:r,canRemoveBlocks:i,getBlockEditingMode:s,isSectionBlock:l}=G(t(ji)),{getBlockStyles:a,getBlockType:c,getActiveBlockVariation:u}=t(p.store),d=o(e);if(!d.length||d.some((e=>!e)))return{invalidBlocks:!0};const[{name:h}]=d,g=1===d.length,m=c(h),f=s(e[0]);let b,k;if(g){const t=u(h,r(e[0]));b=t?.icon||m.icon,k="contentOnly"===n(e[0])}else{const t=1===new Set(d.map((({name:e})=>e))).size;k=e.some((e=>"contentOnly"===n(e))),b=t?m.icon:qj}const v=e.some((e=>l(e)));return{canRemove:i(e),hasBlockStyles:g&&!!a(h)?.length,icon:b,isReusable:g&&(0,p.isReusableBlock)(d[0]),isTemplate:g&&(0,p.isTemplatePart)(d[0]),hasContentOnlyLocking:k,isDisabled:"default"!==f,isSectionInSelection:v}}),[e]),u=Sj({clientId:e?.[0],maximumLength:35}),h=(0,g.useSelect)((e=>e(hr.store).get("core","showIconLabels")),[]);if(i)return null;const m=1===e.length,f=m?u:(0,T.__)("Multiple blocks selected"),b=(s||l)&&!h&&u?u:void 0;if(window?.__experimentalContentOnlyPatternInsertion&&c||a||!o&&!n||t)return(0,d.jsx)(ws.ToolbarGroup,{children:(0,d.jsx)(ws.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:f,icon:(0,d.jsx)(Vu,{className:"block-editor-block-switcher__toggle",icon:r,showColors:!0}),text:b})});const k=m?(0,T.__)("Change block type or style"):(0,T.sprintf)((0,T._n)("Change type of %d block","Change type of %d blocks",e.length),e.length);return(0,d.jsx)(ws.ToolbarGroup,{children:(0,d.jsx)(ws.ToolbarItem,{children:t=>(0,d.jsx)(ws.DropdownMenu,{className:"block-editor-block-switcher",label:f,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:(0,d.jsx)(Vu,{className:"block-editor-block-switcher__toggle",icon:r,showColors:!0}),text:b,toggleProps:{description:k,...t},menuProps:{orientation:"both"},children:({onClose:t})=>(0,d.jsx)(fE,{onClose:t,clientIds:e,hasBlockStyles:o,canRemove:n})})})})};const{Fill:kE,Slot:vE}=(0,ws.createSlotFill)("__unstableBlockToolbarLastItem");kE.Slot=vE;var _E=kE;const yE="align",xE="__experimentalBorder",SE="color",wE="customClassName",CE="typography.__experimentalFontFamily",BE="typography.fontSize",IE="typography.textAlign",jE="layout",EE=["shadow",...["typography.lineHeight",BE,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",CE,IE,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalWritingMode","typography.__experimentalLetterSpacing"],xE,SE,"spacing"];const TE={align:e=>(0,p.hasBlockSupport)(e,yE),borderColor:e=>function(e,t="any"){if("web"!==h.Platform.OS)return!1;const n=(0,p.getBlockSupport)(e,xE);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}(e,"color"),backgroundColor:e=>{const t=(0,p.getBlockSupport)(e,SE);return t&&!1!==t.background},textAlign:e=>(0,p.hasBlockSupport)(e,IE),textColor:e=>{const t=(0,p.getBlockSupport)(e,SE);return t&&!1!==t.text},gradient:e=>{const t=(0,p.getBlockSupport)(e,SE);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>(0,p.hasBlockSupport)(e,wE,!0),fontFamily:e=>(0,p.hasBlockSupport)(e,CE),fontSize:e=>(0,p.hasBlockSupport)(e,BE),layout:e=>(0,p.hasBlockSupport)(e,jE),style:e=>EE.some((t=>(0,p.hasBlockSupport)(e,t)))};function ME(e,t){return Object.entries(TE).reduce(((n,[o,r])=>(r(e.name)&&r(t.name)&&(n[o]=e.attributes[o]),n)),{})}function PE(e,t,n){for(let o=0;o<Math.min(t.length,e.length);o+=1)n(e[o].clientId,ME(t[o],e[o])),PE(e[o].innerBlocks,t[o].innerBlocks,n)}function RE(){const e=(0,g.useRegistry)(),{updateBlockAttributes:t}=(0,g.useDispatch)(ji),{createSuccessNotice:n,createWarningNotice:o,createErrorNotice:r}=(0,g.useDispatch)(pr.store);return(0,h.useCallback)((async i=>{let s="";try{if(!window.navigator.clipboard)return void r((0,T.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});s=await window.navigator.clipboard.readText()}catch(e){return void r((0,T.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"})}if(!s||!function(e){try{const t=(0,p.parse)(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return 1!==t.length||"core/freeform"!==t[0].name}catch(e){return!1}}(s))return void o((0,T.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});const l=(0,p.parse)(s);if(1===l.length?e.batch((()=>{PE(i,i.map((()=>l[0])),t)})):e.batch((()=>{PE(i,l,t)})),1===i.length){const e=(0,p.getBlockType)(i[0].name)?.title;n((0,T.sprintf)((0,T.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,T.sprintf)((0,T.__)("Pasted styles to %d blocks."),i.length),{type:"snackbar"})}),[e.batch,t,n,o,r])}function AE({clientIds:e,children:t,__experimentalUpdateSelection:n}){const{getDefaultBlockName:o,getGroupingBlockName:r}=(0,g.useSelect)(p.store),i=(0,g.useSelect)((t=>{const{canInsertBlockType:n,getBlockRootClientId:r,getBlocksByClientId:i,getDirectInsertBlock:s,canRemoveBlocks:l}=t(ji),a=i(e),c=r(e[0]),u=n(o(),c),d=c?s(c):null;return{canRemove:l(e),canInsertBlock:a.every((e=>(u||!!d)&&n(e.name,c))),canCopyStyles:a.every((e=>!!e&&((0,p.hasBlockSupport)(e.name,"color")||(0,p.hasBlockSupport)(e.name,"typography")))),canDuplicate:a.every((e=>!!e&&(0,p.hasBlockSupport)(e.name,"multiple",!0)&&n(e.name,c)))}}),[e,o]),{getBlocksByClientId:s,getBlocks:l}=(0,g.useSelect)(ji),{canRemove:a,canInsertBlock:c,canCopyStyles:u,canDuplicate:d}=i,{removeBlocks:h,replaceBlocks:m,duplicateBlocks:f,insertAfterBlock:b,insertBeforeBlock:k,flashBlock:v}=(0,g.useDispatch)(ji),_=RE();return t({canCopyStyles:u,canDuplicate:d,canInsertBlock:c,canRemove:a,onDuplicate:()=>f(e,n),onRemove:()=>h(e,n),onInsertBefore(){k(e[0])},onInsertAfter(){b(e[e.length-1])},onGroup(){if(!e.length)return;const t=r(),n=(0,p.switchToBlockType)(s(e),t);n&&m(e,n)},onUngroup(){if(!e.length)return;const t=l(e[0]);t.length&&m(e,t)},onCopy(){1===e.length&&v(e[0])},async onPasteStyles(){await _(s(e))}})}var NE=(0,ws.createSlotFill)(Symbol("CommentIconSlotFill"));var LE=function({clientId:e}){const t=(0,g.useSelect)((t=>t(ji).getBlock(e)),[e]),{replaceBlocks:n}=(0,g.useDispatch)(ji);return t&&"core/html"===t.name?(0,d.jsx)(ws.MenuItem,{onClick:()=>n(e,(0,p.rawHandler)({HTML:(0,p.getBlockContent)(t)})),children:(0,T.__)("Convert to Blocks")}):null};const{Fill:DE,Slot:OE}=(0,ws.createSlotFill)("__unstableBlockSettingsMenuFirstItem");DE.Slot=OE;var zE=DE;function VE(e){return(0,g.useSelect)((t=>{const{getBlocksByClientId:n,getSelectedBlockClientIds:o,isUngroupable:r,isGroupable:i}=t(ji),{getGroupingBlockName:s,getBlockType:l}=t(p.store),a=e?.length?e:o(),c=n(a),[u]=c,d=1===a.length&&r(a[0]);return{clientIds:a,isGroupable:i(a),isUngroupable:d,blocksSelection:c,groupingBlockName:s(),onUngroup:d&&l(u.name)?.transforms?.ungroup}}),[e])}function FE({clientIds:e,isGroupable:t,isUngroupable:n,onUngroup:o,blocksSelection:r,groupingBlockName:i,onClose:s=()=>{}}){const{getSelectedBlockClientIds:l}=(0,g.useSelect)(ji),{replaceBlocks:a}=(0,g.useDispatch)(ji);if(!t&&!n)return null;const c=l();return(0,d.jsxs)(d.Fragment,{children:[t&&(0,d.jsx)(ws.MenuItem,{shortcut:c.length>1?Wa.displayShortcut.primary("g"):void 0,onClick:()=>{(()=>{const t=(0,p.switchToBlockType)(r,i);t&&a(e,t)})(),s()},children:(0,T._x)("Group","verb")}),n&&(0,d.jsx)(ws.MenuItem,{onClick:()=>{(()=>{let t=r[0].innerBlocks;t.length&&(o&&(t=o(r[0].attributes,r[0].innerBlocks)),a(e,t))})(),s()},children:(0,T._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor")})]})}function HE(e){return(0,g.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:i,getBlockName:s,getTemplateLock:l}=t(ji),a=n(e),c=o(e),u=r(e);return{canEdit:a,canMove:c,canRemove:u,canLock:i(s(e)),isContentLocked:"contentOnly"===l(e),isLocked:!a||!c||!u}}),[e])}var UE=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"})}),GE=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z"})}),$E=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"})});const WE=["core/navigation"];function KE(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function ZE({clientId:e,onClose:t}){const[n,o]=(0,h.useState)({move:!1,remove:!1}),{canEdit:r,canMove:i,canRemove:s}=HE(e),{allowsEditLocking:l,templateLock:a,hasTemplateLock:c}=(0,g.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(ji),r=n(e),i=(0,p.getBlockType)(r);return{allowsEditLocking:WE.includes(r),templateLock:o(e)?.templateLock,hasTemplateLock:!!i?.attributes?.templateLock}}),[e]),[u,m]=(0,h.useState)(!!a),{updateBlockAttributes:f}=(0,g.useDispatch)(ji),b=Xf(e);(0,h.useEffect)((()=>{o({move:!i,remove:!s,...l?{edit:!r}:{}})}),[r,i,s,l]);const k=Object.values(n).every(Boolean),v=Object.values(n).some(Boolean)&&!k;return(0,d.jsx)(ws.Modal,{title:(0,T.sprintf)((0,T.__)("Lock %s"),b.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t,size:"small",children:(0,d.jsxs)("form",{onSubmit:o=>{o.preventDefault(),f([e],{lock:n,templateLock:u?KE(n):void 0}),t()},children:[(0,d.jsxs)("fieldset",{className:"block-editor-block-lock-modal__options",children:[(0,d.jsx)("legend",{children:(0,T.__)("Select the features you want to lock")}),(0,d.jsx)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:(0,d.jsxs)("li",{children:[(0,d.jsx)(ws.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-all",label:(0,T.__)("Lock all"),checked:k,indeterminate:v,onChange:e=>o({move:e,remove:e,...l?{edit:e}:{}})}),(0,d.jsxs)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:[l&&(0,d.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,d.jsx)(ws.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Lock editing"),checked:!!n.edit,onChange:e=>o((t=>({...t,edit:e})))}),(0,d.jsx)(ws.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.edit?$E:UE})]}),(0,d.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,d.jsx)(ws.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Lock movement"),checked:n.move,onChange:e=>o((t=>({...t,move:e})))}),(0,d.jsx)(ws.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.move?$E:UE})]}),(0,d.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,d.jsx)(ws.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Lock removal"),checked:n.remove,onChange:e=>o((t=>({...t,remove:e})))}),(0,d.jsx)(ws.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.remove?$E:UE})]})]})]})}),c&&(0,d.jsx)(ws.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:(0,T.__)("Apply to all blocks inside"),checked:u,disabled:n.move&&!n.remove,onChange:()=>m(!u)})]}),(0,d.jsxs)(ws.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,d.jsx)(ws.FlexItem,{children:(0,d.jsx)(ws.Button,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:(0,T.__)("Cancel")})}),(0,d.jsx)(ws.FlexItem,{children:(0,d.jsx)(ws.Button,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:(0,T.__)("Apply")})})]})]})})}function qE({clientId:e}){const{canLock:t,isLocked:n}=HE(e),[o,r]=(0,h.useReducer)((e=>!e),!1);if(!t)return null;const i=n?(0,T.__)("Unlock"):(0,T.__)("Lock");return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.MenuItem,{icon:n?UE:GE,onClick:r,"aria-expanded":o,"aria-haspopup":"dialog",children:i}),o&&(0,d.jsx)(ZE,{clientId:e,onClose:r})]})}const YE=()=>{};function XE({clientId:e,onToggle:t=YE}){const{blockType:n,mode:o,enabled:r}=(0,g.useSelect)((t=>{const{getBlock:n,getBlockMode:o,getSettings:r}=t(ji),i=n(e);return{mode:o(e),blockType:i?(0,p.getBlockType)(i.name):null,enabled:r().codeEditingEnabled&&!!i?.isValid}}),[e]),{toggleBlockMode:i}=(0,g.useDispatch)(ji);if(!n||!(0,p.hasBlockSupport)(n,"html",!0)||!r)return null;const s="visual"===o?(0,T.__)("Edit as HTML"):(0,T.__)("Edit visually");return(0,d.jsx)(ws.MenuItem,{onClick:()=>{i(e),t()},children:s})}function QE({clientId:e,onClose:t}){const{templateLock:n,isLockedByParent:o,isEditingAsBlocks:r}=(0,g.useSelect)((t=>{const{getContentLockingParent:n,getTemplateLock:o,getTemporarilyEditingAsBlocks:r}=G(t(ji));return{templateLock:o(e),isLockedByParent:!!n(e),isEditingAsBlocks:r()===e}}),[e]),i=(0,g.useDispatch)(ji),s=!o&&"contentOnly"===n;if(!s&&!r)return null;const{modifyContentLockBlock:l}=G(i);return!r&&s&&(0,d.jsx)(ws.MenuItem,{onClick:()=>{l(e),t()},children:(0,T._x)("Modify","Unlock content locked blocks")})}function JE({clientId:e,onClose:t}){const[n,o]=(0,h.useState)(),r=Xf(e),{metadata:i}=(0,g.useSelect)((t=>{const{getBlockAttributes:n}=t(ji);return{metadata:n(e)?.metadata}}),[e]),{updateBlockAttributes:s}=(0,g.useDispatch)(ji),l=i?.name||"",a=r?.title,c=!!l&&!!i?.bindings&&Object.values(i.bindings).some((e=>"core/pattern-overrides"===e.source)),u=void 0!==n&&n!==l,p=n===a,m=(f=n,0===f?.trim()?.length);var f;const b=u||p;return(0,d.jsx)(ws.Modal,{title:(0,T.__)("Rename"),onRequestClose:t,overlayClassName:"block-editor-block-rename-modal",focusOnMount:"firstContentElement",size:"small",children:(0,d.jsx)("form",{onSubmit:o=>{o.preventDefault(),b&&(()=>{const o=p||m?void 0:n,r=p||m?(0,T.sprintf)((0,T.__)('Block name reset to: "%s".'),n):(0,T.sprintf)((0,T.__)('Block name changed to: "%s".'),n);(0,Uo.speak)(r,"assertive"),s([e],{metadata:fs({...i,name:o})}),t()})()},children:(0,d.jsxs)(ws.__experimentalVStack,{spacing:"3",children:[(0,d.jsx)(ws.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:n??l,label:(0,T.__)("Name"),help:c?(0,T.__)("This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern."):void 0,placeholder:a,onChange:o,onFocus:e=>e.target.select()}),(0,d.jsxs)(ws.__experimentalHStack,{justify:"right",children:[(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:(0,T.__)("Cancel")}),(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,disabled:!b,variant:"primary",type:"submit",children:(0,T.__)("Save")})]})]})})})}function eT({clientId:e}){const[t,n]=(0,h.useState)(!1);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.MenuItem,{onClick:()=>{n(!0)},"aria-expanded":t,"aria-haspopup":"dialog",children:(0,T.__)("Rename")}),t&&(0,d.jsx)(JE,{clientId:e,onClose:()=>n(!1)})]})}var tT=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{d:"M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z"})}),nT=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{d:"M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z"})});function oT({clientIds:e}){const{updateBlockAttributes:t}=(0,g.useDispatch)(ji),{createSuccessNotice:n}=(0,g.useDispatch)(pr.store),o=(0,g.useSelect)((t=>t(ji).getBlocksByClientId(e)),[e]),r=(0,g.useSelect)((e=>e(Yk.store).getShortcutRepresentation("core/editor/toggle-list-view")),[]),i=o.some((e=>!1===e.attributes.metadata?.blockVisibility));return(0,d.jsx)(ws.MenuItem,{icon:i?tT:nT,onClick:()=>{const s=!i,l=Object.fromEntries(o?.map((({clientId:e,attributes:t})=>[e,{metadata:fs({...t?.metadata,blockVisibility:!s&&void 0})}])));t(e,l,{uniqueByBlock:!0}),s&&(o.length>1?n((0,T.sprintf)((0,T.__)("Blocks hidden. You can access them via the List View (%s)."),r),{id:"block-visibility-hidden",type:"snackbar"}):n((0,T.sprintf)((0,T.__)("Block hidden. You can access it via the List View (%s)."),r),{id:"block-visibility-hidden",type:"snackbar"}))},children:i?(0,T.__)("Show"):(0,T.__)("Hide")})}const{Fill:rT,Slot:iT}=(0,ws.createSlotFill)("BlockSettingsMenuControls");function sT({...e}){return(0,d.jsx)(ws.__experimentalStyleProvider,{document,children:(0,d.jsx)(rT,{...e})})}sT.Slot=({fillProps:e,clientIds:t=null})=>{const{selectedBlocks:n,selectedClientIds:o,isContentOnly:r,canToggleSelectedBlocksVisibility:i}=(0,g.useSelect)((e=>{const{getBlocksByClientId:n,getBlockNamesByClientId:o,getSelectedBlockClientIds:r,getBlockEditingMode:i}=e(ji),s=null!==t?t:r();return{selectedBlocks:o(s),selectedClientIds:s,isContentOnly:"contentOnly"===i(s[0]),canToggleSelectedBlocksVisibility:n(s).every((e=>(0,p.hasBlockSupport)(e.name,"visibility",!0)))}}),[t]),{canLock:s}=HE(o[0]),{canRename:l}=(a=n[0],{canRename:(0,p.getBlockSupport)(a,"renaming",!0)});var a;const c=1===o.length&&s&&!r,u=1===o.length&&l&&!r,h=i&&!r,m=VE(o),{isGroupable:f,isUngroupable:b}=m,k=(f||b)&&!r;return(0,d.jsx)(iT,{fillProps:{...e,selectedBlocks:n,selectedClientIds:o},children:t=>!t?.length>0&&!k&&!c?null:(0,d.jsxs)(ws.MenuGroup,{children:[k&&(0,d.jsx)(FE,{...m,onClose:e?.onClose}),c&&(0,d.jsx)(qE,{clientId:o[0]}),u&&(0,d.jsx)(eT,{clientId:o[0]}),h&&(0,d.jsx)(oT,{clientIds:o}),t,1===o.length&&(0,d.jsx)(QE,{clientId:o[0],onClose:e?.onClose}),1===e?.count&&!r&&(0,d.jsx)(XE,{clientId:e?.firstBlockClientId,onToggle:e?.onClose})]})})};var lT=sT;function aT({parentClientId:e,parentBlockType:t}){const n=(0,m.useViewportMatch)("medium","<"),{selectBlock:o}=(0,g.useDispatch)(ji),r=(0,h.useRef)(),i=Kj({ref:r,highlightParent:!0});return n?(0,d.jsx)(ws.MenuItem,{...i,ref:r,icon:(0,d.jsx)(Vu,{icon:t.icon}),onClick:()=>o(e),children:(0,T.sprintf)((0,T.__)("Select parent block (%s)"),t.title)}):null}const cT={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function uT({clientIds:e,onCopy:t,label:n,shortcut:o,eventType:r="copy",__experimentalUpdateSelection:i=!1}){const{getBlocksByClientId:s}=(0,g.useSelect)(ji),{removeBlocks:l}=(0,g.useDispatch)(ji),a=jw(),c=(0,m.useCopyToClipboard)((()=>(0,p.serialize)(s(e))),(()=>{switch(r){case"copy":case"copyStyles":t(),a(r,e);break;case"cut":a(r,e),l(e,i)}})),u=n||(0,T.__)("Copy");return(0,d.jsx)(ws.MenuItem,{ref:c,shortcut:o,children:u})}function dT({block:e,clientIds:t,children:n,__experimentalSelectBlock:o,...r}){const i=e?.clientId,s=t.length,l=t[0],{firstParentClientId:a,parentBlockType:c,previousBlockClientId:u,selectedBlockClientIds:f,openedBlockSettingsMenu:b,isContentOnly:k,isZoomOut:v}=(0,g.useSelect)((e=>{const{getBlockName:t,getBlockRootClientId:n,getPreviousBlockClientId:o,getSelectedBlockClientIds:r,getBlockAttributes:i,getOpenedBlockSettingsMenu:s,getBlockEditingMode:a,isZoomOut:c}=G(e(ji)),{getActiveBlockVariation:u}=e(p.store),d=n(l),h=d&&t(d);return{firstParentClientId:d,parentBlockType:d&&(u(h,i(d))||(0,p.getBlockType)(h)),previousBlockClientId:o(l),selectedBlockClientIds:r(),openedBlockSettingsMenu:s(),isContentOnly:"contentOnly"===a(l),isZoomOut:c()}}),[l]),{getBlockOrder:_,getSelectedBlockClientIds:y}=(0,g.useSelect)(ji),{setOpenedBlockSettingsMenu:x}=G((0,g.useDispatch)(ji)),S=(0,g.useSelect)((e=>{const{getShortcutRepresentation:t}=e(Yk.store);return{copy:t("core/block-editor/copy"),cut:t("core/block-editor/cut"),duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),w=f.length>0;async function C(e){if(!o)return;const t=await e;t&&t[0]&&o(t[0],!1)}function B(){if(!o)return;let e=u||a;e||(e=_()[0]);const t=w&&0===y().length;o(e,t)}const I=f?.includes(a),j=i?b===i||!1:void 0;function E(e){e&&b!==i?x(i):!e&&b&&b===i&&x(void 0)}const M=!I&&!!a;return(0,d.jsx)(AE,{clientIds:t,__experimentalUpdateSelection:!o,children:({canCopyStyles:e,canDuplicate:i,canInsertBlock:u,canRemove:p,onDuplicate:g,onInsertAfter:f,onInsertBefore:b,onRemove:_,onCopy:y,onPasteStyles:x})=>!p&&!i&&!u&&k?null:(0,d.jsx)(ws.DropdownMenu,{icon:fv,label:(0,T.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:cT,open:j,onToggle:E,noIcons:!0,...r,children:({onClose:r})=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(ws.MenuGroup,{children:[(0,d.jsx)(zE.Slot,{fillProps:{onClose:r}}),M&&(0,d.jsx)(aT,{parentClientId:a,parentBlockType:c}),1===s&&(0,d.jsx)(LE,{clientId:l}),!k&&(0,d.jsx)(uT,{clientIds:t,onCopy:y,shortcut:S.copy}),!k&&(0,d.jsx)(uT,{clientIds:t,label:(0,T.__)("Cut"),eventType:"cut",shortcut:S.cut,__experimentalUpdateSelection:!o}),i&&(0,d.jsx)(ws.MenuItem,{onClick:(0,m.pipe)(r,g,C),shortcut:S.duplicate,children:(0,T.__)("Duplicate")}),u&&!v&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.MenuItem,{onClick:(0,m.pipe)(r,b),shortcut:S.insertBefore,children:(0,T.__)("Add before")}),(0,d.jsx)(ws.MenuItem,{onClick:(0,m.pipe)(r,f),shortcut:S.insertAfter,children:(0,T.__)("Add after")})]}),1===s&&(0,d.jsx)(NE.Slot,{fillProps:{clientId:l,onClose:r}})]}),e&&!k&&(0,d.jsxs)(ws.MenuGroup,{children:[(0,d.jsx)(uT,{clientIds:t,onCopy:y,label:(0,T.__)("Copy styles"),eventType:"copyStyles"}),(0,d.jsx)(ws.MenuItem,{onClick:x,children:(0,T.__)("Paste styles")})]}),!k&&(0,d.jsx)(lT.Slot,{fillProps:{onClose:r,count:s,firstBlockClientId:l},clientIds:t}),"function"==typeof n?n({onClose:r}):h.Children.map((e=>(0,h.cloneElement)(e,{onClose:r}))),p&&(0,d.jsx)(ws.MenuGroup,{children:(0,d.jsx)(ws.MenuItem,{onClick:(0,m.pipe)(r,_,B),shortcut:S.remove,children:(0,T.__)("Delete")})})]})})})}var pT=dT;var hT=(0,ws.createSlotFill)(Symbol("CommentIconToolbarSlotFill"));var gT=function({clientIds:e,...t}){return(0,d.jsxs)(ws.ToolbarGroup,{children:[(0,d.jsx)(hT.Slot,{}),(0,d.jsx)(ws.ToolbarItem,{children:n=>(0,d.jsx)(pT,{clientIds:e,toggleProps:n,...t})})]})};function mT({clientId:e}){const{canLock:t,isLocked:n}=HE(e),[o,r]=(0,h.useReducer)((e=>!e),!1),i=(0,h.useRef)(!1);if((0,h.useEffect)((()=>{n&&(i.current=!0)}),[n]),!n&&!i.current)return null;let s=n?(0,T.__)("Unlock"):(0,T.__)("Lock");return!t&&n&&(s=(0,T.__)("Locked")),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.ToolbarGroup,{className:"block-editor-block-lock-toolbar",children:(0,d.jsx)(ws.ToolbarButton,{disabled:!t,icon:n?$E:UE,label:s,onClick:r,"aria-expanded":o,"aria-haspopup":"dialog"})}),o&&(0,d.jsx)(ZE,{clientId:e,onClose:r})]})}function fT({clientIds:e}){const{blocks:t,canToggleBlockVisibility:n}=(0,g.useSelect)((t=>{const{getBlockName:n,getBlocksByClientId:o}=t(ji),r=o(e);return{blocks:r,canToggleBlockVisibility:r.every((({clientId:e})=>(0,p.hasBlockSupport)(n(e),"visibility",!0)))}}),[e]),o=t.some((e=>!1===e.attributes.metadata?.blockVisibility)),r=(0,h.useRef)(!1),{updateBlockAttributes:i}=(0,g.useDispatch)(ji);if((0,h.useEffect)((()=>{o&&(r.current=!0)}),[o]),!o&&!r.current)return null;return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(ws.ToolbarGroup,{className:"block-editor-block-lock-toolbar",children:(0,d.jsx)(ws.ToolbarButton,{disabled:!n,icon:o?nT:tT,label:o?(0,T.__)("Hidden"):(0,T.__)("Visible"),onClick:()=>{const n=Object.fromEntries(t?.map((({clientId:e,attributes:t})=>[e,{metadata:fs({...t?.metadata,blockVisibility:!!o&&void 0})}])));i(e,n,{uniqueByBlock:!0})}})})})}var bT=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})}),kT=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M4 6.5h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4V16h5a.5.5 0 0 0 .5-.5v-7A.5.5 0 0 0 9 8H4V6.5Zm16 0h-5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h5V16h-5a.5.5 0 0 1-.5-.5v-7A.5.5 0 0 1 15 8h5V6.5Z"})}),vT=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M17.5 4v5a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V4H8v5a.5.5 0 0 0 .5.5h7A.5.5 0 0 0 16 9V4h1.5Zm0 16v-5a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v5H8v-5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v5h1.5Z"})}),_T=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z",fillRule:"evenodd",clipRule:"evenodd"})});const yT={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"},grid:{type:"grid"}};var xT=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=VE(),{replaceBlocks:r}=(0,g.useDispatch)(ji),{canRemove:i,variations:s}=(0,g.useSelect)((e=>{const{canRemoveBlocks:o}=e(ji),{getBlockVariations:r}=e(p.store);return{canRemove:o(t),variations:r(n,"transform")}}),[t,n]),l=o=>{const i=(0,p.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),i&&i.length>0&&(i[0].attributes.layout=yT[o],r(t,i))};if(!o||!i)return null;const a=!!s.find((({name:e})=>"group-row"===e)),c=!!s.find((({name:e})=>"group-stack"===e)),u=!!s.find((({name:e})=>"group-grid"===e));return(0,d.jsxs)(ws.ToolbarGroup,{children:[(0,d.jsx)(ws.ToolbarButton,{icon:bT,label:(0,T._x)("Group","action: convert blocks to group"),onClick:l}),a&&(0,d.jsx)(ws.ToolbarButton,{icon:kT,label:(0,T._x)("Row","action: convert blocks to row"),onClick:()=>l("row")}),c&&(0,d.jsx)(ws.ToolbarButton,{icon:vT,label:(0,T._x)("Stack","action: convert blocks to stack"),onClick:()=>l("stack")}),u&&(0,d.jsx)(ws.ToolbarButton,{icon:_T,label:(0,T._x)("Grid","action: convert blocks to grid"),onClick:()=>l("grid")})]})};function ST({clientIds:e}){const t=1===e.length?e[0]:void 0,n=(0,g.useSelect)((e=>!!t&&"html"===e(ji).getBlockMode(t)),[t]),{toggleBlockMode:o}=(0,g.useDispatch)(ji);return n?(0,d.jsx)(ws.ToolbarGroup,{children:(0,d.jsx)(ws.ToolbarButton,{onClick:()=>{o(t)},children:(0,T.__)("Edit visually")})}):null}const wT=(0,h.createContext)("");wT.displayName="__unstableBlockNameContext";var CT=wT;function BT(e){return Array.from(e.querySelectorAll("[data-toolbar-item]:not([disabled])"))}function IT(e){return e.contains(e.ownerDocument.activeElement)}function jT({toolbarRef:e,focusOnMount:t,isAccessibleToolbar:n,defaultIndex:o,onIndexChange:r,shouldUseKeyboardFocusShortcut:i,focusEditorOnEscape:s}){const[l]=(0,h.useState)(t),[a]=(0,h.useState)(o),c=(0,h.useCallback)((()=>{!function(e){const[t]=Ga.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[e]);(0,Yk.useShortcut)("core/block-editor/focus-toolbar",(()=>{i&&c()})),(0,h.useEffect)((()=>{l&&c()}),[n,l,c]),(0,h.useEffect)((()=>{const t=e.current;let n=0;return l||IT(t)||(n=window.requestAnimationFrame((()=>{const e=BT(t),n=a||0;e[n]&&IT(t)&&e[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(n),!r||!t)return;const e=BT(t).findIndex((e=>0===e.tabIndex));r(e)}}),[a,l,r,e]);const{getLastFocus:u}=G((0,g.useSelect)(ji));(0,h.useEffect)((()=>{const t=e.current;if(s){const e=e=>{const t=u();e.keyCode===Wa.ESCAPE&&t?.current&&(e.preventDefault(),t.current.focus())};return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}}),[s,u,e])}function ET({children:e,focusOnMount:t,focusEditorOnEscape:n=!1,shouldUseKeyboardFocusShortcut:o=!0,__experimentalInitialIndex:r,__experimentalOnIndexChange:i,orientation:s="horizontal",...l}){const a=(0,h.useRef)(),c=function(e){const[t,n]=(0,h.useState)(!0),o=(0,h.useCallback)((()=>{const t=!Ga.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||I()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[e]);return(0,h.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[o,t,e]),t}(a);return jT({toolbarRef:a,focusOnMount:t,defaultIndex:r,onIndexChange:i,isAccessibleToolbar:c,shouldUseKeyboardFocusShortcut:o,focusEditorOnEscape:n}),c?(0,d.jsx)(ws.Toolbar,{label:l["aria-label"],ref:a,orientation:s,...l,children:e}):(0,d.jsx)(ws.NavigableMenu,{orientation:s,role:"toolbar",ref:a,...l,children:e})}function TT(){const e=(0,g.useSelect)((e=>{const{getBlockEditingMode:t,getBlockName:n,getBlockSelectionStart:o}=e(ji),r=o(),i=r&&(0,p.getBlockType)(n(r));return i&&(0,p.hasBlockSupport)(i,"__experimentalToolbar",!0)&&"disabled"!==t(r)}),[]);return e}const MT=[],PT=6,RT={placement:"bottom-start"};function AT({clientId:e}){const{categories:t,currentPatternName:n,patterns:o}=(0,g.useSelect)((t=>{const{getBlockAttributes:n,getBlockRootClientId:o,__experimentalGetAllowedPatterns:r}=t(ji),i=n(e),s=i?.metadata?.categories||MT,l=o(e),a=s.length>0?r(l):MT;return{categories:s,currentPatternName:i?.metadata?.patternName,patterns:a}}),[e]),{replaceBlocks:r}=(0,g.useDispatch)(ji),i=(0,h.useMemo)((()=>0!==t.length&&o&&0!==o.length?o.filter((e=>{const o="core"===e.source||e.source?.startsWith("pattern-directory")&&"pattern-directory/theme"!==e.source;return 1===e.blocks.length&&!o&&n!==e.name&&e.categories?.some((e=>t.includes(e)))&&("unsynced"===e.syncStatus||!e.id)})).slice(0,PT):MT),[t,n,o]);if(i.length<2)return null;const s=n=>{const o=(n.blocks??[]).map((e=>(0,p.cloneBlock)(e)));o[0].attributes.metadata={...o[0].attributes.metadata,categories:t},r(e,o)};return(0,d.jsx)(ws.Dropdown,{popoverProps:RT,renderToggle:({onToggle:e,isOpen:t})=>(0,d.jsx)(ws.ToolbarGroup,{children:(0,d.jsx)(ws.ToolbarButton,{onClick:()=>e(!t),"aria-expanded":t,children:(0,T.__)("Change design")})}),renderContent:()=>(0,d.jsx)(ws.__experimentalDropdownContentWrapper,{className:"block-editor-block-toolbar-change-design-content-wrapper",paddingSize:"none",children:(0,d.jsx)($C,{blockPatterns:i,onClickPattern:s,showTitlesAsTooltip:!0})})})}const NT=(0,d.jsxs)(ws.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)(ws.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"}),(0,d.jsx)(ws.Path,{stroke:"currentColor",strokeWidth:"1.5",d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"})]});var LT=function({clientId:e}){const{stylesToRender:t,activeStyle:n,className:o}=iE({clientId:e}),{updateBlockAttributes:r}=(0,g.useDispatch)(ji),{merged:i}=(0,h.useContext)(is),{globalSettings:s,globalStyles:l,blockName:a}=(0,g.useSelect)((t=>{const n=t(ji).getSettings();return{globalSettings:n.__experimentalFeatures,globalStyles:n[N],blockName:t(ji).getBlockName(e)}}),[e]),c=n?.name?Tb({settings:i?.settings??s,styles:i?.styles??l},a,n.name)?.color?.background:void 0;return t&&0!==t.length?(0,d.jsx)(ws.ToolbarGroup,{children:(0,d.jsx)(ws.ToolbarButton,{onClick:()=>{const i=(t.findIndex((e=>e.name===n.name))+1)%t.length,s=t[i],l=oE(o,n,s);r(e,{className:l})},label:(0,T.__)("Shuffle styles"),children:(0,d.jsx)(ws.Icon,{icon:NT,style:{fill:c||"transparent"}})})}):null};function DT({hideDragHandle:e,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,variant:r="unstyled"}){const{blockClientId:i,blockClientIds:s,isDefaultEditingMode:l,blockType:a,toolbarKey:c,shouldShowVisualToolbar:u,showParentSelector:f,isUsingBindings:b,hasParentPattern:k,hasContentOnlyLocking:v,showShuffleButton:_,showSlots:y,showGroupButtons:x,showLockButtons:S,showBlockVisibilityButton:w,showSwitchSectionStyleButton:C}=(0,g.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getBlockParents:o,getSelectedBlockClientIds:r,isBlockValid:i,getBlockEditingMode:s,getBlockAttributes:l,getBlockParentsByBlockName:a,getTemplateLock:c,getParentSectionBlock:u,isZoomOut:d,isSectionBlock:h}=G(e(ji)),g=r(),m=g[0],f=o(m),b=u(m)??f[f.length-1],k=t(b),v=(0,p.getBlockType)(k),_=s(m),y="default"===_,x=t(m),S=g.every((e=>i(e))),w=g.every((e=>"visual"===n(e))),C=g.every((e=>!!l(e)?.metadata?.bindings)),B=g.every((e=>a(e,"core/block",!0).length>0)),I=g.some((e=>"contentOnly"===c(e))),j=d(),E=window?.__experimentalContentOnlyPatternInsertion&&(j||h(m));return{blockClientId:m,blockClientIds:g,isDefaultEditingMode:y,blockType:m&&(0,p.getBlockType)(x),shouldShowVisualToolbar:S&&w,toolbarKey:`${m}${b}`,showParentSelector:!j&&v&&"contentOnly"!==_&&"disabled"!==s(b)&&(0,p.hasBlockSupport)(v,"__experimentalParentSelector",!0)&&1===g.length,isUsingBindings:C,hasParentPattern:B,hasContentOnlyLocking:I,showShuffleButton:j,showSlots:!j,showGroupButtons:!j,showLockButtons:!j,showBlockVisibilityButton:!j,showSwitchSectionStyleButton:E}}),[]),B=(0,h.useRef)(null),I=(0,h.useRef)(),j=Kj({ref:I}),E=!(0,m.useViewportMatch)("medium","<");if(!TT())return null;const M=s.length>1,P=(0,p.isReusableBlock)(a)||(0,p.isTemplatePart)(a),R=ms("block-editor-block-contextual-toolbar",{"has-parent":f}),A=ms("block-editor-block-toolbar",{"is-synced":P,"is-connected":b});return(0,d.jsx)(ET,{focusEditorOnEscape:!0,className:R,"aria-label":(0,T.__)("Block tools"),variant:"toolbar"===r?void 0:r,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,children:(0,d.jsxs)("div",{ref:B,className:A,children:[f&&!M&&E&&(0,d.jsx)(Zj,{}),(u||M)&&!k&&(0,d.jsx)("div",{ref:I,...j,children:(0,d.jsxs)(ws.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls",children:[(0,d.jsx)(bE,{clientIds:s}),l&&w&&(0,d.jsx)(fT,{clientIds:s}),!M&&l&&S&&(0,d.jsx)(mT,{clientId:i}),(0,d.jsx)(Hj,{clientIds:s,hideDragHandle:e})]})}),!v&&u&&M&&x&&(0,d.jsx)(xT,{}),_&&(0,d.jsx)(AT,{clientId:s[0]}),C&&(0,d.jsx)(LT,{clientId:s[0]}),u&&y&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Rs.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,d.jsx)(Rs.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,d.jsx)(Rs.Slot,{className:"block-editor-block-toolbar__slot"}),(0,d.jsx)(Rs.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,d.jsx)(Rs.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,d.jsx)(CT.Provider,{value:a?.name,children:(0,d.jsx)(_E.Slot,{})})]}),(0,d.jsx)(ST,{clientIds:s}),(0,d.jsx)(gT,{clientIds:s})]})},c)}function OT({hideDragHandle:e,variant:t}){return(0,d.jsx)(DT,{hideDragHandle:e,variant:t,focusOnMount:void 0,__experimentalInitialIndex:void 0,__experimentalOnIndexChange:void 0})}function zT({clientId:e,isTyping:t,__unstableContentRef:n}){const{capturingClientId:o,isInsertionPointVisible:r,lastClientId:i}=Pj(e),s=(0,h.useRef)();(0,h.useEffect)((()=>{s.current=void 0}),[e]);const{stopTyping:l}=(0,g.useDispatch)(ji),a=(0,h.useRef)(!1);(0,Yk.useShortcut)("core/block-editor/focus-toolbar",(()=>{a.current=!0,l(!0)})),(0,h.useEffect)((()=>{a.current=!1}));const c=o||e,u=Mj({contentElement:n?.current,clientId:c});return!t&&(0,d.jsx)(ef,{clientId:c,bottomClientId:i,className:ms("block-editor-block-list__block-popover",{"is-insertion-point-visible":r}),resize:!1,...u,__unstableContentRef:n,children:(0,d.jsx)(DT,{focusOnMount:a.current,__experimentalInitialIndex:s.current,__experimentalOnIndexChange:e=>{s.current=e},variant:"toolbar"})})}var VT=function({onClick:e}){return(0,d.jsx)(ws.Button,{variant:"primary",icon:cc,size:"compact",className:ms("block-editor-button-pattern-inserter__button","block-editor-block-tools__zoom-out-mode-inserter-button"),onClick:e,label:(0,T._x)("Add pattern","Generic label for pattern inserter button")})};var FT=function(){const[e,t]=(0,h.useState)(!1),{hasSelection:n,blockOrder:o,setInserterIsOpened:r,sectionRootClientId:i,selectedBlockClientId:s,blockInsertionPoint:l,insertionPointVisible:a}=(0,g.useSelect)((e=>{const{getSettings:t,getBlockOrder:n,getSelectionStart:o,getSelectedBlockClientId:r,getSectionRootClientId:i,getBlockInsertionPoint:s,isBlockInsertionPointVisible:l}=G(e(ji)),a=i();return{hasSelection:!!o().clientId,blockOrder:n(a),sectionRootClientId:a,setInserterIsOpened:t().__experimentalSetIsInserterOpened,selectedBlockClientId:r(),blockInsertionPoint:s(),insertionPointVisible:l()}}),[]),{showInsertionPoint:c}=G((0,g.useDispatch)(ji));if((0,h.useEffect)((()=>{const e=setTimeout((()=>{t(!0)}),500);return()=>{clearTimeout(e)}}),[]),!e||!n)return null;const u=s,p=o.findIndex((e=>s===e))+1,m=o[p];return a&&l?.index===p?null:(0,d.jsx)(CS,{previousClientId:u,nextClientId:m,children:(0,d.jsx)(VT,{onClick:()=>{r({rootClientId:i,insertionIndex:p,tab:"patterns",category:"all"}),c(i,p,{operation:"insert"})}})})};function HT(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getSettings:o,isTyping:r,isDragging:i,isZoomOut:s}=G(e(ji));return{clientId:t()||n(),hasFixedToolbar:o().hasFixedToolbar,isTyping:r(),isZoomOutMode:s(),isDragging:i()}}function UT({children:e,__unstableContentRef:t,...n}){const{clientId:o,hasFixedToolbar:r,isTyping:i,isZoomOutMode:s,isDragging:l}=(0,g.useSelect)(HT,[]),a=(0,Yk.__unstableUseShortcutEventMatch)(),{getBlocksByClientId:c,getSelectedBlockClientIds:u,getBlockRootClientId:m,isGroupable:f,getBlockName:b}=(0,g.useSelect)(ji),{getGroupingBlockName:k}=(0,g.useSelect)(p.store),{showEmptyBlockSideInserter:v,showBlockToolbarPopover:_}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlock:o,getBlockMode:r,getSettings:i,isTyping:s,isBlockInterfaceHidden:l}=G(e(ji)),a=t()||n(),c=o(a),u=!!a&&!!c,d=u&&(0,p.isUnmodifiedDefaultBlock)(c,"content")&&"html"!==r(a),h=a&&!s()&&d;return{showEmptyBlockSideInserter:h,showBlockToolbarPopover:!l()&&!i().hasFixedToolbar&&!h&&u&&!d}}),[]),y=RE(),{duplicateBlocks:x,removeBlocks:S,replaceBlocks:w,insertAfterBlock:C,insertBeforeBlock:B,selectBlock:I,moveBlocksUp:j,moveBlocksDown:E,expandBlock:M,updateBlockAttributes:P}=G((0,g.useDispatch)(ji));const R=Fm(t),A=Fm(t);return(0,d.jsx)("div",{...n,onKeyDown:function(e){if(!e.defaultPrevented)if(a("core/block-editor/move-up",e)||a("core/block-editor/move-down",e)){const t=u();if(t.length){e.preventDefault();const n=m(t[0]);"up"===(a("core/block-editor/move-up",e)?"up":"down")?j(t,n):E(t,n);const o=Array.isArray(t)?t.length:1,r=(0,T.sprintf)((0,T._n)("%d block moved.","%d blocks moved.",t.length),o);(0,Uo.speak)(r)}}else if(a("core/block-editor/duplicate",e)){const t=u();t.length&&(e.preventDefault(),x(t))}else if(a("core/block-editor/remove",e)){const t=u();t.length&&(e.preventDefault(),S(t))}else if(a("core/block-editor/paste-styles",e)){const t=u();if(t.length){e.preventDefault();const n=c(t);y(n)}}else if(a("core/block-editor/insert-after",e)){const t=u();t.length&&(e.preventDefault(),C(t[t.length-1]))}else if(a("core/block-editor/insert-before",e)){const t=u();t.length&&(e.preventDefault(),B(t[0]))}else if(a("core/block-editor/unselect",e)){if(e.target.closest("[role=toolbar]"))return;const t=u();t.length>1&&(e.preventDefault(),I(t[0]))}else if(a("core/block-editor/collapse-list-view",e)){if((0,Ga.isTextField)(e.target)||(0,Ga.isTextField)(e.target?.contentWindow?.document?.activeElement))return;e.preventDefault(),M(o)}else if(a("core/block-editor/group",e)){const t=u();if(t.length>1&&f(t)){e.preventDefault();const n=c(t),o=k(),r=(0,p.switchToBlockType)(n,o);w(t,r),(0,Uo.speak)((0,T.__)("Selected blocks are grouped."))}}else if(a("core/block-editor/toggle-block-visibility",e)){const t=u();if(t.length){e.preventDefault();const n=c(t);if(!n.every((e=>(0,p.hasBlockSupport)(b(e.clientId),"visibility",!0))))return;const o=n.some((e=>!1===e.attributes.metadata?.blockVisibility)),r=Object.fromEntries(n.map((({clientId:e,attributes:t})=>[e,{metadata:fs({...t?.metadata,blockVisibility:!!o&&void 0})}])));P(t,r,{uniqueByBlock:!0})}}},className:ms(n.className,{"block-editor-block-tools--is-dragging":l}),children:(0,d.jsxs)(jS.Provider,{value:(0,h.useRef)(!1),children:[!i&&!s&&(0,d.jsx)(TS,{__unstableContentRef:t}),v&&(0,d.jsx)(Rj,{__unstableContentRef:t,clientId:o}),_&&(0,d.jsx)(zT,{__unstableContentRef:t,clientId:o,isTyping:i}),!s&&!r&&(0,d.jsx)(ws.Popover.Slot,{name:"block-toolbar",ref:R}),e,(0,d.jsx)(ws.Popover.Slot,{name:"__unstable-block-tools-after",ref:A}),s&&!l&&(0,d.jsx)(FT,{__unstableContentRef:t})]})})}const GT=window.wp.commands;var $T=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z"})}),WT=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})});const KT=()=>function(){const{replaceBlocks:e,multiSelect:t}=(0,g.useDispatch)(ji),{blocks:n,clientIds:o,canRemove:r,possibleBlockTransformations:i,invalidSelection:s}=(0,g.useSelect)((e=>{const{getBlockRootClientId:t,getBlockTransformItems:n,getSelectedBlockClientIds:o,getBlocksByClientId:r,canRemoveBlocks:i}=e(ji),s=o(),l=r(s);if(l.filter((e=>!e)).length>0)return{invalidSelection:!0};return{blocks:l,clientIds:s,possibleBlockTransformations:n(l,t(s[0])),canRemove:i(s),invalidSelection:!1}}),[]);if(s)return{isLoading:!1,commands:[]};const l=1===n.length&&(0,p.isTemplatePart)(n[0]);function a(r){const i=(0,p.switchToBlockType)(n,r);var s;e(o,i),(s=i).length>1&&t(s[0].clientId,s[s.length-1].clientId)}const c=!!i.length&&r&&!l;if(!o||o.length<1||!c)return{isLoading:!1,commands:[]};return{isLoading:!1,commands:i.map((e=>{const{name:t,title:n,icon:o}=e;return{name:"core/block-editor/transform-to-"+t.replace("/","-"),label:(0,T.sprintf)((0,T.__)("Transform to %s"),n),icon:(0,d.jsx)(Vu,{icon:o}),callback:({close:e})=>{a(t),e()}}}))}},ZT=()=>{(0,GT.useCommandLoader)({name:"core/block-editor/blockTransforms",hook:KT()}),(0,GT.useCommandLoader)({name:"core/block-editor/blockQuickActions",hook:function(){const{clientIds:e,isUngroupable:t,isGroupable:n}=(0,g.useSelect)((e=>{const{getSelectedBlockClientIds:t,isUngroupable:n,isGroupable:o}=e(ji);return{clientIds:t(),isUngroupable:n(),isGroupable:o()}}),[]),{canInsertBlockType:o,getBlockRootClientId:r,getBlocksByClientId:i,canRemoveBlocks:s,getBlockName:l}=(0,g.useSelect)(ji),{getDefaultBlockName:a,getGroupingBlockName:c}=(0,g.useSelect)(p.store),u=i(e),{removeBlocks:d,replaceBlocks:h,duplicateBlocks:m,insertAfterBlock:f,insertBeforeBlock:b,updateBlockAttributes:k}=(0,g.useDispatch)(ji),v=()=>{if(!u.length)return;const t=c(),n=(0,p.switchToBlockType)(u,t);n&&h(e,n)},_=()=>{if(!u.length)return;const t=u[0].innerBlocks;t.length&&h(e,t)};if(!e||e.length<1)return{isLoading:!1,commands:[]};const y=r(e[0]),x=o(a(),y),S=u.every((e=>!!e&&(0,p.hasBlockSupport)(e.name,"multiple",!0)&&o(e.name,y))),w=s(e),C=u.every((({clientId:e})=>(0,p.hasBlockSupport)(l(e),"visibility",!0))),B=[];if(S&&B.push({name:"duplicate",label:(0,T.__)("Duplicate"),callback:()=>m(e,!0),icon:qj}),x&&B.push({name:"add-before",label:(0,T.__)("Add before"),callback:()=>{const t=Array.isArray(e)?e[0]:t;b(t)},icon:cc},{name:"add-after",label:(0,T.__)("Add after"),callback:()=>{const t=Array.isArray(e)?e[e.length-1]:t;f(t)},icon:cc}),n&&B.push({name:"Group",label:(0,T.__)("Group"),callback:v,icon:bT}),t&&B.push({name:"ungroup",label:(0,T.__)("Ungroup"),callback:_,icon:$T}),w&&B.push({name:"remove",label:(0,T.__)("Delete"),callback:()=>d(e,!0),icon:WT}),C){const t=u.some((e=>!1===e.attributes.metadata?.blockVisibility));B.push({name:"core/toggle-block-visibility",label:t?(0,T.__)("Show"):(0,T.__)("Hide"),callback:()=>{const n=Object.fromEntries(u?.map((({clientId:e,attributes:n})=>[e,{metadata:fs({...n?.metadata,blockVisibility:!!t&&void 0})}])));k(e,n,{uniqueByBlock:!0})},icon:t?tT:nT})}return{isLoading:!1,commands:B.map((e=>({...e,name:"core/block-editor/action-"+e.name,callback:({close:t})=>{e.callback(),t()}})))}},context:"block-selection-edit"})},qT={ignoredSelectors:[/\.editor-styles-wrapper/gi]};function YT({shouldIframe:e=!0,height:t="300px",children:n=(0,d.jsx)(dw,{}),styles:o,contentRef:r,iframeProps:i}){ZT();const s=(0,m.useViewportMatch)("medium","<"),l=nw(),a=PS(),c=(0,h.useRef)(),u=(0,m.useMergeRefs)([r,a,c]),p=(0,g.useSelect)((e=>G(e(ji)).getZoomLevel()),[]),f=100===p||s?{}:{scale:p,frameSize:"40px"};return e?(0,d.jsx)(UT,{__unstableContentRef:c,style:{height:t,display:"flex"},children:(0,d.jsxs)(Fw,{...i,...f,ref:l,contentRef:u,style:{...i?.style},name:"editor-canvas",children:[(0,d.jsx)(cC,{styles:o}),n]})}):(0,d.jsxs)(UT,{__unstableContentRef:c,style:{height:t,display:"flex"},children:[(0,d.jsx)(cC,{styles:o,scope:":where(.editor-styles-wrapper)",transformOptions:qT}),(0,d.jsx)(Aw,{ref:u,className:"editor-styles-wrapper",tabIndex:-1,style:{height:"100%",width:"100%"},children:n})]})}var XT=function({children:e,height:t,styles:n}){return(0,d.jsx)(YT,{height:t,styles:n,children:e})};const QT=()=>(0,d.jsx)(ws.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:(0,d.jsx)(ws.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})}),JT=({style:e,className:t})=>(0,d.jsx)("div",{className:"block-library-colors-selector__icon-container",children:(0,d.jsx)("div",{className:`${t} block-library-colors-selector__state-selection`,style:e,children:(0,d.jsx)(QT,{})})}),eM=({TextColor:e,BackgroundColor:t})=>({onToggle:n,isOpen:o})=>(0,d.jsx)(ws.ToolbarGroup,{children:(0,d.jsx)(ws.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,T.__)("Open Colors Selector"),onClick:n,onKeyDown:e=>{o||e.keyCode!==Wa.DOWN||(e.preventDefault(),n())},icon:(0,d.jsx)(t,{children:(0,d.jsx)(e,{children:(0,d.jsx)(JT,{})})})})});var tM=({children:e,...t})=>(I()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,d.jsx)(ws.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:eM(t),renderContent:()=>e})),nM=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})});const oM=(0,h.createContext)({});oM.displayName="ListViewContext";const rM=()=>(0,h.useContext)(oM);function iM({children:e,...t}){const n=(0,h.useRef)();return(0,h.useEffect)((()=>{n.current&&(n.current.textContent=n.current.textContent)}),[e]),(0,d.jsx)("div",{hidden:!0,...t,ref:n,children:e})}const sM=(0,h.forwardRef)((({nestingLevel:e,blockCount:t,clientId:n,...o},r)=>{const{insertedBlock:i,setInsertedBlock:s}=rM(),l=(0,m.useInstanceId)(sM),{directInsert:a,hideInserter:c}=(0,g.useSelect)((e=>{const{getBlockListSettings:t,getTemplateLock:o,isZoomOut:r}=G(e(ji)),i=t(n);return{directInsert:i?.directInsert||!1,hideInserter:!!o(n)||r()}}),[n]),u=Sj({clientId:n,context:"list-view"}),p=Sj({clientId:i?.clientId,context:"list-view"});if((0,h.useEffect)((()=>{p?.length&&(0,Uo.speak)((0,T.sprintf)((0,T.__)("%s block inserted"),p),"assertive")}),[p]),c)return null;const f=`list-view-appender__${l}`,b=(0,T.sprintf)((0,T.__)("Append to %1$s block at position %2$d, Level %3$d"),u,t+1,e);return(0,d.jsxs)("div",{className:"list-view-appender",children:[(0,d.jsx)(lI,{ref:r,rootClientId:n,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:a,__experimentalIsQuick:!0,...o,toggleProps:{"aria-describedby":f},onSelectOrClose:e=>{e?.clientId&&s(e)}}),(0,d.jsx)(iM,{id:f,children:b})]})})),lM=Jx(ws.__experimentalTreeGridRow),aM=(0,h.forwardRef)((({isDragged:e,isSelected:t,position:n,level:o,rowCount:r,children:i,className:s,path:l,...a},c)=>{const u=tS({clientId:a["data-block"],enableAnimation:!0,triggerAnimationOnChange:l}),p=(0,m.useMergeRefs)([c,u]);return(0,d.jsx)(lM,{ref:p,className:ms("block-editor-list-view-leaf",s),level:o,positionInSet:n,setSize:r,isExpanded:void 0,...a,children:i})}));var cM=aM;var uM=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{d:"M10.97 10.159a3.382 3.382 0 0 0-2.857.955l1.724 1.723-2.836 2.913L7 17h1.25l2.913-2.837 1.723 1.723a3.38 3.38 0 0 0 .606-.825c.33-.63.446-1.343.35-2.032L17 10.695 13.305 7l-2.334 3.159Z"})}),dM=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"})});function pM({onClick:e}){return(0,d.jsx)("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true","data-testid":"list-view-expander",children:(0,d.jsx)(Ol,{icon:(0,T.isRTL)()?nc:oc})})}const hM={"core/image":({clientId:e,attributes:t})=>{if(t.url)return{url:t.url,alt:t.alt||"",clientId:e}},"core/cover":({clientId:e,attributes:t})=>{if("image"===t.backgroundType&&t.url)return{url:t.url,alt:t.alt||"",clientId:e}},"core/media-text":({clientId:e,attributes:t})=>{if("image"===t.mediaType&&t.mediaUrl)return{url:t.mediaUrl,alt:t.mediaAlt||"",clientId:e}},"core/gallery":({innerBlocks:e})=>{const t=[],n=e?.length?hM[e[0].name]:void 0;if(!n)return t;for(const o of e){const e=n(o);if(e&&t.push(e),t.length>=3)return t}return t}};function gM({clientId:e,isExpanded:t}){const{block:n}=(0,g.useSelect)((t=>({block:t(ji).getBlock(e)})),[e]);return(0,h.useMemo)((()=>function(e,t){const n=hM[e.name],o=n?n(e):void 0;return o?Array.isArray(o)?t?[]:o:[o]:[]}(n,t)),[n,t])}const{Badge:mM}=G(ws.privateApis);var fM=(0,h.forwardRef)((function({className:e,block:{clientId:t},onClick:n,onContextMenu:o,onMouseDown:r,onToggleExpanded:i,tabIndex:s,onFocus:l,onDragStart:a,onDragEnd:c,draggable:u,isExpanded:h,ariaDescribedBy:m},f){const b=Xf(t),k=Sj({clientId:t,context:"list-view"}),{isLocked:v}=HE(t),{canToggleBlockVisibility:_,isBlockHidden:y,isContentOnly:x}=(0,g.useSelect)((e=>{const{getBlockName:n}=e(ji),{isBlockHidden:o}=G(e(ji));return{canToggleBlockVisibility:(0,p.hasBlockSupport)(n(t),"visibility",!0),isBlockHidden:o(t),isContentOnly:"contentOnly"===e(ji).getBlockEditingMode(t)}}),[t]),S=v&&!x,w=_&&y,C="sticky"===b?.positionType,B=gM({clientId:t,isExpanded:h});return(0,d.jsxs)("a",{className:ms("block-editor-list-view-block-select-button",e),onClick:n,onContextMenu:o,onKeyDown:function(e){e.keyCode!==Wa.ENTER&&e.keyCode!==Wa.SPACE||n(e)},onMouseDown:r,ref:f,tabIndex:s,onFocus:l,onDragStart:e=>{e.dataTransfer.clearData(),a?.(e)},onDragEnd:c,draggable:u,href:`#block-${t}`,"aria-describedby":m,"aria-expanded":h,children:[(0,d.jsx)(pM,{onClick:i}),(0,d.jsx)(Vu,{icon:b?.icon,showColors:!0,context:"list-view"}),(0,d.jsxs)(ws.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:[(0,d.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,d.jsx)(ws.__experimentalTruncate,{ellipsizeMode:"auto",children:k})}),b?.anchor&&(0,d.jsx)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper",children:(0,d.jsx)(mM,{className:"block-editor-list-view-block-select-button__anchor",children:b.anchor})}),C&&(0,d.jsx)("span",{className:"block-editor-list-view-block-select-button__sticky",children:(0,d.jsx)(Ol,{icon:uM})}),B.length?(0,d.jsx)("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0,children:B.map(((e,t)=>(0,d.jsx)("span",{className:"block-editor-list-view-block-select-button__image",style:{backgroundImage:`url(${e.url})`,zIndex:B.length-t}},e.clientId)))}):null,w&&(0,d.jsx)("span",{className:"block-editor-list-view-block-select-button__block-visibility",children:(0,d.jsx)(Ol,{icon:nT})}),S&&(0,d.jsx)("span",{className:"block-editor-list-view-block-select-button__lock",children:(0,d.jsx)(Ol,{icon:dM})})]})]})}));const bM=(0,h.forwardRef)((({onClick:e,onToggleExpanded:t,block:n,isSelected:o,position:r,siblingBlockCount:i,level:s,isExpanded:l,selectedClientIds:a,...c},u)=>{const{clientId:p}=n,{AdditionalBlockContent:h,insertedBlock:g,setInsertedBlock:m}=rM(),f=a.includes(p)?a:[p];return(0,d.jsxs)(d.Fragment,{children:[h&&(0,d.jsx)(h,{block:n,insertedBlock:g,setInsertedBlock:m}),(0,d.jsx)(Aj,{appendToOwnerDocument:!0,clientIds:f,cloneClassname:"block-editor-list-view-draggable-chip",children:({draggable:a,onDragStart:p,onDragEnd:h})=>(0,d.jsx)(fM,{ref:u,className:"block-editor-list-view-block-contents",block:n,onClick:e,onToggleExpanded:t,isSelected:o,position:r,siblingBlockCount:i,level:s,draggable:a,onDragStart:p,onDragEnd:h,isExpanded:l,...c})})]})}));var kM=bM;function vM(e,t){const n=()=>{const n=t?.querySelector(`[role=row][data-block="${e}"]`);return n?Ga.focus.focusable.find(n)[0]:null};let o=n();o?o.focus():window.requestAnimationFrame((()=>{o=n(),o&&o.focus()}))}var _M=(0,h.memo)((function e({block:{clientId:t},displacement:n,isAfterDraggedBlocks:o,isDragged:r,isNesting:i,isSelected:s,isBranchSelected:l,selectBlock:a,position:c,level:u,rowCount:f,siblingBlockCount:b,showBlockMovers:k,path:v,isExpanded:_,selectedClientIds:y,isSyncedBranch:x}){const S=(0,h.useRef)(null),w=(0,h.useRef)(null),C=(0,h.useRef)(null),[B,I]=(0,h.useState)(!1),[j,E]=(0,h.useState)(),{isLocked:M,canEdit:P,canMove:R}=HE(t),A=s&&y[0]===t,N=s&&y[y.length-1]===t,{toggleBlockHighlight:L,duplicateBlocks:D,multiSelect:O,replaceBlocks:z,removeBlocks:V,insertAfterBlock:F,insertBeforeBlock:H,setOpenedBlockSettingsMenu:U,updateBlockAttributes:$}=G((0,g.useDispatch)(ji)),W=(0,m.useDebounce)(L,50),{canInsertBlockType:K,getSelectedBlockClientIds:Z,getPreviousBlockClientId:q,getBlockRootClientId:Y,getBlockOrder:X,getBlockParents:Q,getBlocksByClientId:J,canRemoveBlocks:ee,isGroupable:te}=(0,g.useSelect)(ji),{getGroupingBlockName:ne}=(0,g.useSelect)(p.store),oe=Xf(t),re=RE(),{block:ie,blockName:se,allowRightClickOverrides:le,isBlockHidden:ae}=(0,g.useSelect)((e=>{const{getBlock:n,getBlockName:o,getSettings:r}=e(ji),{isBlockHidden:i}=G(e(ji));return{block:n(t),blockName:o(t),allowRightClickOverrides:r().allowRightClickOverrides,isBlockHidden:i(t)}}),[t]),ce=(0,p.hasBlockSupport)(se,"__experimentalToolbar",!0),ue=`list-view-block-select-button__description-${(0,m.useInstanceId)(e)}`,{expand:de,collapse:pe,collapseAll:he,BlockSettingsMenu:ge,listViewInstanceId:me,expandedState:fe,setInsertedBlock:be,treeGridElementRef:ke,rootClientId:ve}=rM(),_e=(0,Yk.__unstableUseShortcutEventMatch)();function ye(){const e=Z(),n=e.includes(t),o=n?e[0]:t,r=Y(o);return{blocksToUpdate:n?e:[t],firstBlockClientId:o,firstBlockRootClientId:r,selectedBlockClientIds:e}}const xe=(0,h.useCallback)((()=>{I(!0),W(t,!0)}),[t,I,W]),Se=(0,h.useCallback)((()=>{I(!1),W(t,!1)}),[t,I,W]),we=(0,h.useCallback)((e=>{a(e,t),e.preventDefault()}),[t,a]),Ce=(0,h.useCallback)(((e,t)=>{t&&a(void 0,e,null,null),vM(e,ke?.current)}),[a,ke]),Be=(0,h.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===_?pe(t):!1===_&&de(t)}),[t,de,pe,_]),Ie=(0,h.useCallback)((e=>{ce&&le&&(C.current?.click(),E(new window.DOMRect(e.clientX,e.clientY,0,0)),e.preventDefault())}),[le,C,ce]),je=(0,h.useCallback)((e=>{le&&2===e.button&&e.preventDefault()}),[le]),Ee=(0,h.useMemo)((()=>{const{ownerDocument:e}=w?.current||{};if(j&&e)return{ownerDocument:e,getBoundingClientRect:()=>j}}),[j]),Te=(0,h.useCallback)((()=>{E(void 0)}),[E]);if(function({isSelected:e,selectedClientIds:t,rowItemRef:n}){const o=1===t.length;(0,h.useLayoutEffect)((()=>{if(!e||!o||!n.current)return;const t=(0,Ga.getScrollContainer)(n.current),{ownerDocument:r}=n.current;if(t===r.body||t===r.documentElement||!t)return;const i=n.current.getBoundingClientRect(),s=t.getBoundingClientRect();(i.top<s.top||i.bottom>s.bottom)&&n.current.scrollIntoView()}),[e,o,n])}({isSelected:s,rowItemRef:w,selectedClientIds:y}),!ie)return null;const Me=((e,t,n)=>(0,T.sprintf)((0,T.__)("Block %1$d of %2$d, Level %3$d."),e,t,n))(c,b,u),Pe=((e,t)=>[e?.positionLabel?`${(0,T.sprintf)((0,T.__)("Position: %s"),e.positionLabel)}.`:void 0,t?(0,T.__)("This block is locked."):void 0].filter(Boolean).join(" "))(oe,M),Re=ae?(0,T.__)("Block is hidden."):null,Ae=k&&b>0,Ne=ms("block-editor-list-view-block__mover-cell",{"is-visible":B||s}),Le=ms("block-editor-list-view-block__menu-cell",{"is-visible":B||A});let De;Ae?De=2:ce||(De=3);const Oe=ms({"is-selected":s,"is-first-selected":A,"is-last-selected":N,"is-branch-selected":l,"is-synced-branch":x,"is-dragging":r,"has-single-cell":!ce,"is-synced":oe?.isSynced,"is-draggable":R,"is-displacement-normal":"normal"===n,"is-displacement-up":"up"===n,"is-displacement-down":"down"===n,"is-after-dragged-blocks":o,"is-nesting":i}),ze=y.includes(t)?y:[t],Ve=s&&1===y.length;return(0,d.jsxs)(cM,{className:Oe,isDragged:r,onKeyDown:async function(e){if(e.defaultPrevented)return;if(e.target.closest("[role=dialog]"))return;const t=[Wa.BACKSPACE,Wa.DELETE].includes(e.keyCode);if(_e("core/block-editor/unselect",e)&&y.length>0)e.stopPropagation(),e.preventDefault(),a(e,void 0);else if(t||_e("core/block-editor/remove",e)){const{blocksToUpdate:e,firstBlockClientId:t,firstBlockRootClientId:n,selectedBlockClientIds:o}=ye();if(!ee(e))return;let r=q(t)??n;V(e,!1);const i=o.length>0&&0===Z().length;r||(r=X()[0]),Ce(r,i)}else if(_e("core/block-editor/paste-styles",e)){e.preventDefault();const{blocksToUpdate:t}=ye(),n=J(t);re(n)}else if(_e("core/block-editor/duplicate",e)){e.preventDefault();const{blocksToUpdate:t,firstBlockRootClientId:n}=ye();if(J(t).every((e=>!!e&&(0,p.hasBlockSupport)(e.name,"multiple",!0)&&K(e.name,n)))){const e=await D(t,!1);e?.length&&Ce(e[0],!1)}}else if(_e("core/block-editor/insert-before",e)){e.preventDefault();const{blocksToUpdate:t}=ye();await H(t[0]);const n=Z();U(void 0),Ce(n[0],!1)}else if(_e("core/block-editor/insert-after",e)){e.preventDefault();const{blocksToUpdate:t}=ye();await F(t.at(-1));const n=Z();U(void 0),Ce(n[0],!1)}else if(_e("core/block-editor/select-all",e)){e.preventDefault();const{firstBlockRootClientId:t,selectedBlockClientIds:n}=ye(),o=X(t);if(!o.length)return;if(Ja()(n,o)&&t&&t!==ve)return void Ce(t,!0);O(o[0],o[o.length-1],null)}else if(_e("core/block-editor/collapse-list-view",e)){e.preventDefault();const{firstBlockClientId:t}=ye(),n=Q(t,!1);he(),de(n)}else if(_e("core/block-editor/group",e)){const{blocksToUpdate:t}=ye();if(t.length>1&&te(t)){e.preventDefault();const n=J(t),o=ne(),r=(0,p.switchToBlockType)(n,o);z(t,r),(0,Uo.speak)((0,T.__)("Selected blocks are grouped."));const i=Z();U(void 0),Ce(i[0],!1)}}else if(_e("core/block-editor/toggle-block-visibility",e)){e.preventDefault();const{blocksToUpdate:t}=ye(),n=J(t);if(!n.every((e=>(0,p.hasBlockSupport)(e.name,"visibility",!0))))return;const o=n.some((e=>!1===e.attributes.metadata?.blockVisibility)),r=Object.fromEntries(n.map((({clientId:e,attributes:t})=>[e,{metadata:fs({...t?.metadata,blockVisibility:!!o&&void 0})}])));$(t,r,{uniqueByBlock:!0})}},onMouseEnter:xe,onMouseLeave:Se,onFocus:xe,onBlur:Se,level:u,position:c,rowCount:f,path:v,id:`list-view-${me}-block-${t}`,"data-block":t,"data-expanded":P?_:void 0,ref:w,children:[(0,d.jsx)(ws.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:De,ref:S,"aria-selected":!!s,children:({ref:e,tabIndex:t,onFocus:n})=>(0,d.jsxs)("div",{className:"block-editor-list-view-block__contents-container",children:[(0,d.jsx)(kM,{block:ie,onClick:we,onContextMenu:Ie,onMouseDown:je,onToggleExpanded:Be,isSelected:s,position:c,siblingBlockCount:b,level:u,ref:e,tabIndex:Ve?0:t,onFocus:n,isExpanded:P?_:void 0,selectedClientIds:y,ariaDescribedBy:ue}),(0,d.jsx)(iM,{id:ue,children:[Me,Pe,Re].filter(Boolean).join(" ")})]})}),Ae&&(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(ws.__experimentalTreeGridCell,{className:Ne,withoutGridItem:!0,children:[(0,d.jsx)(ws.__experimentalTreeGridItem,{children:({ref:e,tabIndex:n,onFocus:o})=>(0,d.jsx)(Vj,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o})}),(0,d.jsx)(ws.__experimentalTreeGridItem,{children:({ref:e,tabIndex:n,onFocus:o})=>(0,d.jsx)(Fj,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o})})]})}),ce&&ge&&(0,d.jsx)(ws.__experimentalTreeGridCell,{className:Le,"aria-selected":!!s,ref:C,children:({ref:e,tabIndex:t,onFocus:n})=>(0,d.jsx)(ge,{clientIds:ze,block:ie,icon:fv,label:(0,T.__)("Options"),popoverProps:{anchor:Ee},toggleProps:{ref:e,className:"block-editor-list-view-block__menu",tabIndex:t,onClick:Te,onFocus:n,size:"small"},disableOpenOnArrowDown:!0,expand:de,expandedState:fe,setInsertedBlock:be,__experimentalSelectBlock:Ce})})]})}));function yM(e,t,n,o){const r=n?.includes(e.clientId);if(r)return 0;return t[e.clientId]??o?1+e.innerBlocks.reduce(xM(t,n,o),0):1}const xM=(e,t,n)=>(o,r)=>{const i=t?.includes(r.clientId);if(i)return o;return(e[r.clientId]??n)&&r.innerBlocks.length>0?o+yM(r,e,t,n):o+1},SM=()=>{};var wM=(0,h.memo)((function e(t){const{blocks:n,selectBlock:o=SM,showBlockMovers:r,selectedClientIds:i,level:s=1,path:l="",isBranchSelected:a=!1,listPosition:c=0,fixedListWindow:u,isExpanded:p,parentId:m,shouldShowInnerBlocks:f=!0,isSyncedBranch:b=!1,showAppender:k=!0}=t,v=Xf(m),_=b||!!v?.isSynced,y=(0,g.useSelect)((e=>!m||e(ji).canEditBlock(m)),[m]),{blockDropPosition:x,blockDropTargetIndex:S,firstDraggedBlockIndex:w,blockIndexes:C,expandedState:B,draggedClientIds:I}=rM(),j=(0,h.useRef)();if(!y)return null;const E=k&&1===s,T=n.filter(Boolean),M=T.length,P=E?M+1:M;return j.current=c,(0,d.jsxs)(d.Fragment,{children:[T.map(((t,n)=>{const{clientId:c,innerBlocks:h}=t;n>0&&(j.current+=yM(T[n-1],B,I,p));const m=!!I?.includes(c),{displacement:b,isAfterDraggedBlocks:k,isNesting:v}=function({blockIndexes:e,blockDropTargetIndex:t,blockDropPosition:n,clientId:o,firstDraggedBlockIndex:r,isDragged:i}){let s,l,a;if(!i){l=!1;const i=e[o];a=i>r,null!=t&&void 0!==r?void 0!==i&&(s=i>=r&&i<t?"up":i<r&&i>=t?"down":"normal",l="number"==typeof t&&t-1===i&&"inside"===n):null===t&&void 0!==r?s=void 0!==i&&i>=r?"up":"normal":null!=t&&void 0===r?void 0!==i&&(s=i<t?"normal":"down"):null===t&&(s="normal")}return{displacement:s,isNesting:l,isAfterDraggedBlocks:a}}({blockIndexes:C,blockDropTargetIndex:S,blockDropPosition:x,clientId:c,firstDraggedBlockIndex:w,isDragged:m}),{itemInView:y}=u,E=y(j.current),R=n+1,A=l.length>0?`${l}_${R}`:`${R}`,N=!!h?.length,L=N&&f?B[c]??p:void 0,D=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(c,i),O=a||D&&N,z=m||E||D&&c===i[0]||0===n||n===M-1;return(0,d.jsxs)(g.AsyncModeProvider,{value:!D,children:[z&&(0,d.jsx)(_M,{block:t,selectBlock:o,isSelected:D,isBranchSelected:O,isDragged:m,level:s,position:R,rowCount:P,siblingBlockCount:M,showBlockMovers:r,path:A,isExpanded:!m&&L,listPosition:j.current,selectedClientIds:i,isSyncedBranch:_,displacement:b,isAfterDraggedBlocks:k,isNesting:v}),!z&&(0,d.jsx)("tr",{children:(0,d.jsx)("td",{className:"block-editor-list-view-placeholder"})}),N&&L&&!m&&(0,d.jsx)(e,{parentId:c,blocks:h,selectBlock:o,showBlockMovers:r,level:s+1,path:A,listPosition:j.current+1,fixedListWindow:u,isBranchSelected:O,selectedClientIds:i,isExpanded:p,isSyncedBranch:_})]},c)})),E&&(0,d.jsx)(ws.__experimentalTreeGridRow,{level:s,setSize:P,positionInSet:P,isExpanded:!0,children:(0,d.jsx)(ws.__experimentalTreeGridCell,{children:e=>(0,d.jsx)(sM,{clientId:m,nestingLevel:s,blockCount:M,...e})})})]})}));function CM({draggedBlockClientId:e,listViewRef:t,blockDropTarget:n}){const o=Xf(e),r=Sj({clientId:e,context:"list-view"}),{rootClientId:i,clientId:s,dropPosition:l}=n||{},[a,c]=(0,h.useMemo)((()=>{if(!t.current)return[];return[i?t.current.querySelector(`[data-block="${i}"]`):void 0,s?t.current.querySelector(`[data-block="${s}"]`):void 0]}),[t,i,s]),u=c||a,p=(0,T.isRTL)(),g=(0,h.useCallback)(((e,t)=>{if(!u)return 0;let n=u.offsetWidth;const o=(0,Ga.getScrollContainer)(u,"horizontal"),r=u.ownerDocument,i=o===r.body||o===r.documentElement;if(o&&!i){const r=o.getBoundingClientRect(),i=(0,T.isRTL)()?r.right-e.right:e.left-r.left,s=o.clientWidth;if(s<n+i&&(n=s-i),!p&&e.left+t<r.left)return n-=r.left-e.left,n;if(p&&e.right-t>r.right)return n-=e.right-r.right,n}return n-t}),[p,u]),m=(0,h.useMemo)((()=>{if(!u)return{};const e=u.getBoundingClientRect();return{width:g(e,0)}}),[g,u]),f=(0,h.useMemo)((()=>{if(!u)return{};const e=(0,Ga.getScrollContainer)(u),t=u.ownerDocument,n=e===t.body||e===t.documentElement;if(e&&!n){const t=e.getBoundingClientRect(),n=u.getBoundingClientRect(),o=p?t.right-n.right:n.left-t.left;if(!p&&t.left>n.left)return{transform:`translateX( ${o}px )`};if(p&&t.right<n.right)return{transform:`translateX( ${-1*o}px )`}}return{}}),[p,u]),b=(0,h.useMemo)((()=>{if(!a)return 1;const e=parseInt(a.getAttribute("aria-level"),10);return e?e+1:1}),[a]),k=(0,h.useMemo)((()=>!!u&&u.classList.contains("is-branch-selected")),[u]),v=(0,h.useMemo)((()=>{if(u&&("top"===l||"bottom"===l||"inside"===l))return{contextElement:u,getBoundingClientRect(){const e=u.getBoundingClientRect();let t=e.left,n=0;const o=(0,Ga.getScrollContainer)(u,"horizontal"),r=u.ownerDocument,i=o===r.body||o===r.documentElement;if(o&&!i){const e=o.getBoundingClientRect(),n=p?o.offsetWidth-o.clientWidth:0;t<e.left+n&&(t=e.left+n)}n="top"===l?e.top-2*e.height:e.top;const s=g(e,0),a=e.height;return new window.DOMRect(t,n,s,a)}}}),[u,l,g,p]);return u?(0,d.jsx)(ws.Popover,{animate:!1,anchor:v,focusOnMount:!1,className:"block-editor-list-view-drop-indicator--preview",variant:"unstyled",flip:!1,resize:!0,children:(0,d.jsx)("div",{style:m,className:ms("block-editor-list-view-drop-indicator__line",{"block-editor-list-view-drop-indicator__line--darker":k}),children:(0,d.jsxs)("div",{className:"block-editor-list-view-leaf","aria-level":b,children:[(0,d.jsxs)("div",{className:ms("block-editor-list-view-block-select-button","block-editor-list-view-block-contents"),style:f,children:[(0,d.jsx)(pM,{onClick:()=>{}}),(0,d.jsx)(Vu,{icon:o?.icon,showColors:!0,context:"list-view"}),(0,d.jsx)(ws.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:(0,d.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,d.jsx)(ws.__experimentalTruncate,{ellipsizeMode:"auto",children:r})})})]}),(0,d.jsx)("div",{className:"block-editor-list-view-block__menu-cell"})]})})}):null}function BM(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,g.useDispatch)(ji),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:i,getSelectedBlockClientIds:s,hasMultiSelection:l,hasSelectedBlock:a}=(0,g.useSelect)(ji),{getBlockType:c}=(0,g.useSelect)(p.store);return{updateBlockSelection:(0,h.useCallback)((async(u,d,p,h)=>{if(!u?.shiftKey&&u?.keyCode!==Wa.ESCAPE)return void n(d,h);u.preventDefault();const g="keydown"===u.type&&u.keyCode===Wa.ESCAPE,m="keydown"===u.type&&(u.keyCode===Wa.UP||u.keyCode===Wa.DOWN||u.keyCode===Wa.HOME||u.keyCode===Wa.END);if(!m&&!a()&&!l())return void n(d,null);const f=s(),b=[...r(d),d];if((g||m&&!f.some((e=>b.includes(e))))&&await e(),!g){let e=i(),n=d;m&&(a()||l()||(e=d),p&&(n=p));const o=r(e),s=r(n),{start:c,end:u}=function(e,t,n,o){const r=[...n,e],i=[...o,t],s=Math.min(r.length,i.length)-1;return{start:r[s],end:i[s]}}(e,n,o,s);await t(c,u,null)}const k=s();if((u.keyCode===Wa.HOME||u.keyCode===Wa.END)&&k.length>1)return;const v=f.filter((e=>!k.includes(e)));let _;if(1===v.length){const e=c(o(v[0]))?.title;e&&(_=(0,T.sprintf)((0,T.__)("%s deselected."),e))}else v.length>1&&(_=(0,T.sprintf)((0,T.__)("%s blocks deselected."),v.length));_&&(0,Uo.speak)(_,"assertive")}),[e,o,c,r,i,s,l,a,t,n])}}const IM=24;function jM(e,t){const n=e[t+1];return n&&n.isDraggedBlock?jM(e,t+1):n}const EM=["top","bottom"];function TM(e,t,n=!1){let o,r,i,s,l;for(let n=0;n<e.length;n++){const a=e[n];if(a.isDraggedBlock)continue;const c=a.element.getBoundingClientRect(),[u,d]=zS(t,c,EM),p=VS(t,c);if(void 0===i||u<i||p){i=u;const t=e.indexOf(a),n=e[t-1];if("top"===d&&n&&n.rootClientId===a.rootClientId&&!n.isDraggedBlock?(r=n,o="bottom",s=n.element.getBoundingClientRect(),l=t-1):(r=a,o=d,s=c,l=t),p)break}}if(!r)return;const a=function(e,t){const n=[];let o=e;for(;o;)n.push({...o}),o=t.find((e=>e.clientId===o.rootClientId));return n}(r,e),c="bottom"===o;if(c&&r.canInsertDraggedBlocksAsChild&&(r.innerBlockCount>0&&r.isExpanded||function(e,t,n=1,o=!1){const r=o?t.right-n*IM:t.left+n*IM;return(o?e.x<r-IM:e.x>r+IM)&&e.y<t.bottom}(t,s,a.length,n))){const e=r.isExpanded?0:r.innerBlockCount||0;return{rootClientId:r.clientId,clientId:r.clientId,blockIndex:e,dropPosition:"inside"}}if(c&&r.rootClientId&&function(e,t,n=1,o=!1){const r=o?t.right-n*IM:t.left+n*IM;return o?e.x>r:e.x<r}(t,s,a.length,n)){const i=jM(e,l),c=r.nestingLevel,u=i?i.nestingLevel:1;if(c&&u){const d=function(e,t,n=1,o=!1){const r=o?t.right-n*IM:t.left+n*IM,i=o?r-e.x:e.x-r,s=Math.round(i/IM);return Math.abs(s)}(t,s,a.length,n),p=Math.max(Math.min(d,c-u),0);if(a[p]){let t=r.blockIndex;if(a[p].nestingLevel===i?.nestingLevel)t=i?.blockIndex;else for(let n=l;n>=0;n--){const o=e[n];if(o.rootClientId===a[p].rootClientId){t=o.blockIndex+1;break}}return{rootClientId:a[p].rootClientId,clientId:r.clientId,blockIndex:t,dropPosition:o}}}}if(!r.canInsertDraggedBlocksAsSibling)return;const u=c?1:0;return{rootClientId:r.rootClientId,clientId:r.clientId,blockIndex:r.blockIndex+u,dropPosition:o}}const MM={leading:!1,trailing:!0};function PM({selectBlock:e}){const t=(0,g.useRegistry)(),{getBlockOrder:n,getBlockRootClientId:o,getBlocksByClientId:r,getPreviousBlockClientId:i,getSelectedBlockClientIds:s,getSettings:l,canInsertBlockType:a,canRemoveBlocks:c}=(0,g.useSelect)(ji),{flashBlock:u,removeBlocks:d,replaceBlocks:h,insertBlocks:f}=(0,g.useDispatch)(ji),b=jw();return(0,m.useRefEffect)((g=>{function m(t,n){n&&e(void 0,t,null,null),vM(t,g)}function k(e){if(e.defaultPrevented)return;if(!g.contains(e.target.ownerDocument.activeElement))return;const k=e.target.ownerDocument.activeElement?.closest("[role=row]"),v=k?.dataset?.block;if(!v)return;const{blocksToUpdate:_,firstBlockClientId:y,firstBlockRootClientId:x,originallySelectedBlockClientIds:S}=function(e){const t=s(),n=t.includes(e),r=n?t[0]:e;return{blocksToUpdate:n?t:[e],firstBlockClientId:r,firstBlockRootClientId:o(r),originallySelectedBlockClientIds:t}}(v);if(0!==_.length){if(e.preventDefault(),"copy"===e.type||"cut"===e.type){1===_.length&&u(_[0]),b(e.type,_);Mw(e,r(_),t)}if("cut"===e.type){if(!c(_))return;let e=i(y)??x;d(_,!1);const t=S.length>0&&0===s().length;e||(e=n()[0]),m(e,t)}else if("paste"===e.type){const{__experimentalCanUserUseUnfilteredHTML:t}=l(),n=function(e,t){const{plainText:n,html:o,files:r}=Ew(e);let i=[];if(r.length){const e=(0,p.getBlockTransforms)("from");i=r.reduce(((t,n)=>{const o=(0,p.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat()}else i=(0,p.pasteHandler)({HTML:o,plainText:n,mode:"BLOCKS",canUserUseUnfilteredHTML:t});return i}(e,t);if(1===_.length){const[e]=_;if(n.every((t=>a(t.name,e))))return f(n,void 0,e),void m(n[0]?.clientId,!1)}h(_,n,n.length-1,-1),m(n[0]?.clientId,!1)}}}return g.ownerDocument.addEventListener("copy",k),g.ownerDocument.addEventListener("cut",k),g.ownerDocument.addEventListener("paste",k),()=>{g.ownerDocument.removeEventListener("copy",k),g.ownerDocument.removeEventListener("cut",k),g.ownerDocument.removeEventListener("paste",k)}}),[])}const RM=(e,t)=>"clear"===t.type?{}:Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;const AM=(0,h.forwardRef)((function e({id:t,blocks:n,dropZoneElement:o,showBlockMovers:r=!1,isExpanded:i=!1,showAppender:s=!1,blockSettingsMenu:l=dT,rootClientId:a,description:c,onSelect:u,additionalBlockContent:p},f){n&&I()("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});const b=(0,m.useInstanceId)(e),{clientIdsTree:k,draggedClientIds:v,selectedClientIds:_}=function({blocks:e,rootClientId:t}){return(0,g.useSelect)((n=>{const{getDraggedBlockClientIds:o,getSelectedBlockClientIds:r,getEnabledClientIdsTree:i}=G(n(ji));return{selectedClientIds:r(),draggedClientIds:o(),clientIdsTree:e??i(t)}}),[e,t])}({blocks:n,rootClientId:a}),y=function(e){return(0,h.useMemo)((()=>{const t={};let n=0;const o=e=>{e.forEach((e=>{t[e.clientId]=n,n++,e.innerBlocks.length>0&&o(e.innerBlocks)}))};return o(e),t}),[e])}(k),{getBlock:x}=(0,g.useSelect)(ji),{visibleBlockCount:S}=(0,g.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(ji),o=v?.length>0?n(v).length+1:0;return{visibleBlockCount:t()-o}}),[v]),{updateBlockSelection:w}=BM(),[C,B]=(0,h.useReducer)(RM,{}),[j,E]=(0,h.useState)(null),{setSelectedTreeId:M}=function({firstSelectedBlockClientId:e,setExpandedState:t}){const[n,o]=(0,h.useState)(null),{selectedBlockParentClientIds:r}=(0,g.useSelect)((t=>{const{getBlockParents:n}=t(ji);return{selectedBlockParentClientIds:n(e,!1)}}),[e]);return(0,h.useEffect)((()=>{n!==e&&r?.length&&t({type:"expand",clientIds:r})}),[e,r,n,t]),{setSelectedTreeId:o}}({firstSelectedBlockClientId:_[0],setExpandedState:B}),P=(0,h.useCallback)(((e,t,n)=>{w(e,t,null,n),M(t),u&&u(x(t))}),[M,w,u,x]),{ref:R,target:A}=function({dropZoneElement:e,expandedState:t,setExpandedState:n}){const{getBlockRootClientId:o,getBlockIndex:r,getBlockCount:i,getDraggedBlockClientIds:s,canInsertBlocks:l}=(0,g.useSelect)(ji),[a,c]=(0,h.useState)(),{rootClientId:u,blockIndex:d}=a||{},p=OS(u,d),f=(0,T.isRTL)(),b=(0,m.usePrevious)(u),k=(0,h.useCallback)(((e,t)=>{const{rootClientId:o}=t||{};o&&("inside"!==t?.dropPosition||e[o]||n({type:"expand",clientIds:[o]}))}),[n]),v=(0,m.useThrottle)(k,500,MM);(0,h.useEffect)((()=>{"inside"===a?.dropPosition&&b===a?.rootClientId?v(t,a):v.cancel()}),[t,b,a,v]);const _=s(),y=(0,m.useThrottle)((0,h.useCallback)(((e,t)=>{const n={x:e.clientX,y:e.clientY},s=!!_?.length,a=TM(Array.from(t.querySelectorAll("[data-block]")).map((e=>{const t=e.dataset.block,n="true"===e.dataset.expanded,a=e.classList.contains("is-dragging"),c=parseInt(e.getAttribute("aria-level"),10),u=o(t);return{clientId:t,isExpanded:n,rootClientId:u,blockIndex:r(t),element:e,nestingLevel:c||void 0,isDraggedBlock:!!s&&a,innerBlockCount:i(t),canInsertDraggedBlocksAsSibling:!s||l(_,u),canInsertDraggedBlocksAsChild:!s||l(_,t)}})),n,f);a&&c(a)}),[l,_,i,r,o,f]),50);return{ref:(0,m.__experimentalUseDropZone)({dropZoneElement:e,onDrop(e){y.cancel(),a&&p(e),c(void 0)},onDragLeave(){y.cancel(),c(null)},onDragOver(e){y(e,e.currentTarget)},onDragEnd(){y.cancel(),c(void 0)}}),target:a}}({dropZoneElement:o,expandedState:C,setExpandedState:B}),N=(0,h.useRef)(),L=PM({selectBlock:P}),D=(0,m.useMergeRefs)([L,N,R,f]);(0,h.useEffect)((()=>{_?.length&&vM(_[0],N?.current)}),[]);const O=(0,h.useCallback)((e=>{if(!e)return;const t=Array.isArray(e)?e:[e];B({type:"expand",clientIds:t})}),[B]),z=(0,h.useCallback)((e=>{e&&B({type:"collapse",clientIds:[e]})}),[B]),V=(0,h.useCallback)((()=>{B({type:"clear"})}),[B]),F=(0,h.useCallback)((e=>{O(e?.dataset?.block)}),[O]),H=(0,h.useCallback)((e=>{z(e?.dataset?.block)}),[z]),U=(0,h.useCallback)(((e,t,n)=>{e.shiftKey&&w(e,t?.dataset?.block,n?.dataset?.block)}),[w]);!function({collapseAll:e,expand:t}){const{expandedBlock:n,getBlockParents:o}=(0,g.useSelect)((e=>{const{getBlockParents:t,getExpandedBlock:n}=G(e(ji));return{expandedBlock:n(),getBlockParents:t}}),[]);(0,h.useEffect)((()=>{if(n){const r=o(n,!1);e(),t(r)}}),[e,t,n,o])}({collapseAll:V,expand:O});const $=v?.[0],{blockDropTargetIndex:W,blockDropPosition:K,firstDraggedBlockIndex:Z}=(0,h.useMemo)((()=>{let e,t;if(A?.clientId){const t=y[A.clientId];e=void 0===t||"top"===A?.dropPosition?t:t+1}else null===A&&(e=null);if($){const e=y[$];t=void 0===e||"top"===A?.dropPosition?e:e+1}return{blockDropTargetIndex:e,blockDropPosition:A?.dropPosition,firstDraggedBlockIndex:t}}),[A,y,$]),q=(0,h.useMemo)((()=>({blockDropPosition:K,blockDropTargetIndex:W,blockIndexes:y,draggedClientIds:v,expandedState:C,expand:O,firstDraggedBlockIndex:Z,collapse:z,collapseAll:V,BlockSettingsMenu:l,listViewInstanceId:b,AdditionalBlockContent:p,insertedBlock:j,setInsertedBlock:E,treeGridElementRef:N,rootClientId:a})),[K,W,y,v,C,O,Z,z,V,l,b,p,j,E,a]),[Y]=(0,m.__experimentalUseFixedWindowList)(N,32,S,{expandedState:C,useWindowing:!0,windowOverscan:40});if(!k.length&&!s)return null;const X=c&&`block-editor-list-view-description-${b}`;return(0,d.jsxs)(g.AsyncModeProvider,{value:!0,children:[(0,d.jsx)(CM,{draggedBlockClientId:$,listViewRef:N,blockDropTarget:A}),c&&(0,d.jsx)(ws.VisuallyHidden,{id:X,children:c}),(0,d.jsx)(ws.__experimentalTreeGrid,{id:t,className:ms("block-editor-list-view-tree",{"is-dragging":v?.length>0&&void 0!==W}),"aria-label":(0,T.__)("Block navigation structure"),ref:D,onCollapseRow:H,onExpandRow:F,onFocusRow:U,applicationAriaLabel:(0,T.__)("Block navigation structure"),"aria-describedby":X,style:{"--wp-admin--list-view-dragged-items-height":v?.length?32*(v.length-1)+"px":null},children:(0,d.jsx)(oM.Provider,{value:q,children:(0,d.jsx)(wM,{blocks:k,parentId:a,selectBlock:P,showBlockMovers:r,fixedListWindow:Y,selectedClientIds:_,isExpanded:i,showAppender:s})})})]})}));var NM=(0,h.forwardRef)(((e,t)=>(0,d.jsx)(AM,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0})));function LM({isEnabled:e,onToggle:t,isOpen:n,innerRef:o,...r}){return(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,...r,ref:o,icon:nM,"aria-expanded":n,"aria-haspopup":"true",onClick:e?t:void 0,label:(0,T.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!e})}var DM=(0,h.forwardRef)((function({isDisabled:e,...t},n){I()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const o=(0,g.useSelect)((e=>!!e(ji).getBlockCount()),[])&&!e;return(0,d.jsx)(ws.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:({isOpen:e,onToggle:r})=>(0,d.jsx)(LM,{...t,innerRef:n,isOpen:e,onToggle:r,isEnabled:o}),renderContent:()=>(0,d.jsxs)("div",{className:"block-editor-block-navigation__container",children:[(0,d.jsx)("p",{className:"block-editor-block-navigation__label",children:(0,T.__)("List view")}),(0,d.jsx)(NM,{})]})})}));function OM({genericPreviewBlock:e,style:t,className:n,activeStyle:o}){const r=(0,p.getBlockType)(e.name)?.example,i=oE(n,o,t),s=(0,h.useMemo)((()=>({...e,title:t.label||t.name,description:t.description,initialAttributes:{...e.attributes,className:i+" block-editor-block-styles__block-preview-container"},example:r})),[e,i]);return(0,d.jsx)(_C,{item:s})}const zM=()=>{};var VM=function({clientId:e,onSwitch:t=zM,onHoverClassName:n=zM}){const{onSelect:o,stylesToRender:r,activeStyle:i,genericPreviewBlock:s,className:l}=iE({clientId:e,onSwitch:t}),[a,c]=(0,h.useState)(null),u=(0,m.useViewportMatch)("medium","<");if(!r||0===r.length)return null;const p=(0,m.debounce)(c,250),g=e=>{a!==e?(p(e),n(e?.name??null)):p.cancel()};return(0,d.jsxs)("div",{className:"block-editor-block-styles",children:[(0,d.jsx)("div",{className:"block-editor-block-styles__variants",children:r.map((e=>{const t=e.label||e.name;return(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,className:ms("block-editor-block-styles__item",{"is-active":i.name===e.name}),variant:"secondary",label:t,onMouseEnter:()=>g(e),onFocus:()=>g(e),onMouseLeave:()=>g(null),onBlur:()=>g(null),onClick:()=>(e=>{o(e),n(null),c(null),p.cancel()})(e),"aria-current":i.name===e.name,children:(0,d.jsx)(ws.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text",children:t})},e.name)}))}),a&&!u&&(0,d.jsx)(ws.Popover,{placement:"left-start",offset:34,focusOnMount:!1,children:(0,d.jsx)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>g(null),children:(0,d.jsx)(OM,{activeStyle:i,className:l,genericPreviewBlock:s,style:a})})})]})};const FM={0:(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z"})}),1:(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z"})}),2:(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M9 11.1H5v-4H3v10h2v-4h4v4h2v-10H9v4zm8 4c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6v1.5h8v-2H17z"})}),3:(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.3 1.7c-.4-.4-1-.7-1.6-.8v-.1c.6-.2 1.1-.5 1.5-.9.3-.4.5-.8.5-1.3 0-.4-.1-.8-.3-1.1-.2-.3-.5-.6-.8-.8-.4-.2-.8-.4-1.2-.5-.6-.1-1.1-.2-1.6-.2-.6 0-1.3.1-1.8.3s-1.1.5-1.6.9l1.2 1.4c.4-.2.7-.4 1.1-.6.3-.2.7-.3 1.1-.3.4 0 .8.1 1.1.3.3.2.4.5.4.8 0 .4-.2.7-.6.9-.7.3-1.5.5-2.2.4v1.6c.5 0 1 0 1.5.1.3.1.7.2 1 .3.2.1.4.2.5.4s.1.4.1.6c0 .3-.2.7-.5.8-.4.2-.9.3-1.4.3s-1-.1-1.4-.3c-.4-.2-.8-.4-1.2-.7L13 15.6c.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.6 0 1.1-.1 1.6-.2.4-.1.9-.2 1.3-.5.4-.2.7-.5.9-.9.2-.4.3-.8.3-1.2 0-.6-.3-1.1-.7-1.5z"})}),4:(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z"})}),5:(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.7 1.2c-.2-.3-.5-.7-.8-.9-.3-.3-.7-.5-1.1-.6-.5-.1-.9-.2-1.4-.2-.2 0-.5.1-.7.1-.2.1-.5.1-.7.2l.1-1.9h4.3V7H14l-.3 5 1 .6.5-.2.4-.1c.1-.1.3-.1.4-.1h.5c.5 0 1 .1 1.4.4.4.2.6.7.6 1.1 0 .4-.2.8-.6 1.1-.4.3-.9.4-1.4.4-.4 0-.9-.1-1.3-.3-.4-.2-.7-.4-1.1-.7 0 0-1.1 1.4-1 1.5.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.5 0 1-.1 1.5-.3s.9-.4 1.3-.7c.4-.3.7-.7.9-1.1s.3-.9.3-1.4-.1-1-.3-1.4z"})}),6:(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M20.7 12.4c-.2-.3-.4-.6-.7-.9s-.6-.5-1-.6c-.4-.2-.8-.2-1.2-.2-.5 0-.9.1-1.3.3s-.8.5-1.2.8c0-.5 0-.9.2-1.4l.6-.9c.2-.2.5-.4.8-.5.6-.2 1.3-.2 1.9 0 .3.1.6.3.8.5 0 0 1.3-1.3 1.3-1.4-.4-.3-.9-.6-1.4-.8-.6-.2-1.3-.3-2-.3-.6 0-1.1.1-1.7.4-.5.2-1 .5-1.4.9-.4.4-.8 1-1 1.6-.3.7-.4 1.5-.4 2.3s.1 1.5.3 2.1c.2.6.6 1.1 1 1.5.4.4.9.7 1.4.9 1 .3 2 .3 3 0 .4-.1.8-.3 1.2-.6.3-.3.6-.6.8-1 .2-.5.3-.9.3-1.4s-.1-.9-.3-1.3zm-2 2.1c-.1.2-.3.4-.4.5-.1.1-.3.2-.5.2-.2.1-.4.1-.6.1-.2.1-.5 0-.7-.1-.2 0-.3-.2-.5-.3-.1-.2-.3-.4-.4-.6-.2-.3-.3-.7-.3-1 .3-.3.6-.5 1-.7.3-.1.7-.2 1-.2.4 0 .8.1 1.1.3.3.3.4.7.4 1.1 0 .2 0 .5-.1.7zM9 11H5V7H3v10h2v-4h4v4h2V7H9v4z"})})};function HM({level:e}){return FM[e]?(0,d.jsx)(ws.Icon,{icon:FM[e]}):null}const UM=[1,2,3,4,5,6],GM={className:"block-library-heading-level-dropdown"};function $M({options:e=UM,value:t,onChange:n}){const o=e.filter((e=>0===e||UM.includes(e))).sort(((e,t)=>e-t));return(0,d.jsx)(ws.ToolbarDropdownMenu,{popoverProps:GM,icon:(0,d.jsx)(HM,{level:t}),label:(0,T.__)("Change level"),controls:o.map((e=>{const o=e===t;return{icon:(0,d.jsx)(HM,{level:e}),title:0===e?(0,T.__)("Paragraph"):(0,T.sprintf)((0,T.__)("Heading %d"),e),isActive:o,onClick(){n(e)},role:"menuitemradio"}}))})}var WM=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{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"})});var KM=function({icon:e=WM,label:t=(0,T.__)("Choose variation"),instructions:n=(0,T.__)("Select a variation to start with:"),variations:o,onSelect:r,allowSkip:i}){const s=ms("block-editor-block-variation-picker",{"has-many-variations":o.length>4});return(0,d.jsxs)(ws.Placeholder,{icon:e,label:t,instructions:n,className:s,children:[(0,d.jsx)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,T.__)("Block variations"),children:o.map((e=>(0,d.jsxs)("li",{children:[(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,variant:"tertiary",icon:e.icon&&e.icon.src?e.icon.src:e.icon,iconSize:48,onClick:()=>r(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,d.jsx)("span",{className:"block-editor-block-variation-picker__variation-label",children:e.title})]},e.name)))}),i&&(0,d.jsx)("div",{className:"block-editor-block-variation-picker__skip",children:(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>r(),children:(0,T.__)("Skip")})})]})};const ZM="carousel",qM="grid",YM=({onBlockPatternSelect:e})=>(0,d.jsx)("div",{className:"block-editor-block-pattern-setup__actions",children:(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:e,children:(0,T.__)("Choose")})}),XM=({handlePrevious:e,handleNext:t,activeSlide:n,totalSlides:o})=>(0,d.jsxs)("div",{className:"block-editor-block-pattern-setup__navigation",children:[(0,d.jsx)(ws.Button,{size:"compact",icon:(0,T.isRTL)()?Zb:qb,label:(0,T.__)("Previous pattern"),onClick:e,disabled:0===n,accessibleWhenDisabled:!0}),(0,d.jsx)(ws.Button,{size:"compact",icon:(0,T.isRTL)()?qb:Zb,label:(0,T.__)("Next pattern"),onClick:t,disabled:n===o-1,accessibleWhenDisabled:!0})]});var QM=({viewMode:e,setViewMode:t,handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:i,onBlockPatternSelect:s})=>{const l=e===ZM,a=(0,d.jsxs)("div",{className:"block-editor-block-pattern-setup__display-controls",children:[(0,d.jsx)(ws.Button,{size:"compact",icon:ca,label:(0,T.__)("Carousel view"),onClick:()=>t(ZM),isPressed:l}),(0,d.jsx)(ws.Button,{size:"compact",icon:_T,label:(0,T.__)("Grid view"),onClick:()=>t(qM),isPressed:e===qM})]});return(0,d.jsxs)("div",{className:"block-editor-block-pattern-setup__toolbar",children:[l&&(0,d.jsx)(XM,{handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:i}),a,l&&(0,d.jsx)(YM,{onBlockPatternSelect:s})]})};var JM=function(e,t,n){return(0,g.useSelect)((o=>{const{getBlockRootClientId:r,getPatternsByBlockTypes:i,__experimentalGetAllowedPatterns:s}=o(ji),l=r(e);return n?s(l).filter(n):i(t,l)}),[e,t,n])};const eP=({viewMode:e,activeSlide:t,patterns:n,onBlockPatternSelect:o,showTitles:r})=>{const i="block-editor-block-pattern-setup__container";if(e===ZM){const e=new Map([[t,"active-slide"],[t-1,"previous-slide"],[t+1,"next-slide"]]);return(0,d.jsx)("div",{className:"block-editor-block-pattern-setup__carousel",children:(0,d.jsx)("div",{className:i,children:(0,d.jsx)("div",{className:"carousel-container",children:n.map(((n,o)=>(0,d.jsx)(nP,{active:o===t,className:e.get(o)||"",pattern:n},n.name)))})})})}return(0,d.jsx)("div",{className:"block-editor-block-pattern-setup__grid",children:(0,d.jsx)(ws.Composite,{role:"listbox",className:i,"aria-label":(0,T.__)("Patterns list"),children:n.map((e=>(0,d.jsx)(tP,{pattern:e,onSelect:o,showTitles:r},e.name)))})})};function tP({pattern:e,onSelect:t,showTitles:n}){const o="block-editor-block-pattern-setup-list",{blocks:r,description:i,viewportWidth:s=700}=e,l=(0,m.useInstanceId)(tP,`${o}__item-description`);return(0,d.jsx)("div",{className:`${o}__list-item`,children:(0,d.jsxs)(ws.Composite.Item,{render:(0,d.jsx)("div",{"aria-describedby":i?l:void 0,"aria-label":e.title,className:`${o}__item`}),id:`${o}__pattern__${e.name}`,role:"option",onClick:()=>t(r),children:[(0,d.jsx)(kC,{blocks:r,viewportWidth:s}),n&&(0,d.jsx)("div",{className:`${o}__item-title`,children:e.title}),!!i&&(0,d.jsx)(ws.VisuallyHidden,{id:l,children:i})]})})}function nP({active:e,className:t,pattern:n,minHeight:o}){const{blocks:r,title:i,description:s}=n,l=(0,m.useInstanceId)(nP,"block-editor-block-pattern-setup-list__item-description");return(0,d.jsxs)("div",{"aria-hidden":!e,role:"img",className:`pattern-slide ${t}`,"aria-label":i,"aria-describedby":s?l:void 0,children:[(0,d.jsx)(kC,{blocks:r,minHeight:o}),!!s&&(0,d.jsx)(ws.VisuallyHidden,{id:l,children:s})]})}var oP=({clientId:e,blockName:t,filterPatternsFn:n,onBlockPatternSelect:o,initialViewMode:r=ZM,showTitles:i=!1})=>{const[s,l]=(0,h.useState)(r),[a,c]=(0,h.useState)(0),{replaceBlock:u}=(0,g.useDispatch)(ji),m=JM(e,t,n);if(!m?.length)return null;const f=o||(t=>{const n=t.map((e=>(0,p.cloneBlock)(e)));u(e,n)});return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)("div",{className:`block-editor-block-pattern-setup view-mode-${s}`,children:[(0,d.jsx)(eP,{viewMode:s,activeSlide:a,patterns:m,onBlockPatternSelect:f,showTitles:i}),(0,d.jsx)(QM,{viewMode:s,setViewMode:l,activeSlide:a,totalSlides:m.length,handleNext:()=>{c((e=>Math.min(e+1,m.length-1)))},handlePrevious:()=>{c((e=>Math.max(e-1,0)))},onBlockPatternSelect:()=>{f(m[a].blocks)}})]})})};function rP({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,d.jsxs)("fieldset",{className:e,children:[(0,d.jsx)(ws.VisuallyHidden,{as:"legend",children:(0,T.__)("Transform to variation")}),o.map((e=>(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,size:"compact",icon:(0,d.jsx)(Vu,{icon:e.icon,showColors:!0}),isPressed:n===e.name,label:n===e.name?e.title:(0,T.sprintf)((0,T.__)("Transform to %s"),e.title),onClick:()=>t(e.name),"aria-label":e.title,showTooltip:!0},e.name)))]})}function iP({className:e,onSelectVariation:t,selectedValue:n,variations:o}){const r=o.map((({name:e,title:t,description:n})=>({value:e,label:t,info:n})));return(0,d.jsx)(ws.DropdownMenu,{className:e,label:(0,T.__)("Transform to variation"),text:(0,T.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${e}__popover`},icon:yI,toggleProps:{iconPosition:"right"},children:()=>(0,d.jsx)(ws.MenuGroup,{children:(0,d.jsx)(ws.MenuItemsChoice,{choices:r,value:n,onSelect:t})})})}function sP({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,d.jsx)("div",{className:e,children:(0,d.jsx)(ws.__experimentalToggleGroupControl,{label:(0,T.__)("Transform to variation"),value:n,hideLabelFromVision:!0,onChange:t,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:o.map((e=>(0,d.jsx)(ws.__experimentalToggleGroupControlOptionIcon,{icon:(0,d.jsx)(Vu,{icon:e.icon,showColors:!0}),value:e.name,label:n===e.name?e.title:(0,T.sprintf)((0,T.__)("Transform to %s"),e.title)},e.name)))})})}var lP=function({blockClientId:e}){const{updateBlockAttributes:t}=(0,g.useDispatch)(ji),{activeBlockVariation:n,unfilteredVariations:o,blockName:r,isContentOnly:i,isSection:s}=(0,g.useSelect)((t=>{const{getActiveBlockVariation:n,getBlockVariations:o}=t(p.store),{getBlockName:r,getBlockAttributes:i,getBlockEditingMode:s,isSectionBlock:l}=G(t(ji)),a=e&&r(e),{hasContentRoleAttribute:c}=G(t(p.store)),u=c(a);return{activeBlockVariation:n(a,i(e),"transform"),unfilteredVariations:a&&o(a,"transform"),blockName:a,isContentOnly:"contentOnly"===s(e)&&!u,isSection:l(e)}}),[e]),l=(0,h.useMemo)((()=>"core/paragraph"===r?"stretchy-paragraph"===n?.name||o.every((e=>["paragraph","stretchy-paragraph"].includes(e.name)))?[]:o.filter((e=>"stretchy-paragraph"!==e.name)):"core/heading"===r?"stretchy-heading"===n?.name||o.every((e=>["heading","stretchy-heading"].includes(e.name)))?[]:o.filter((e=>"stretchy-heading"!==e.name)):o),[n?.name,r,o]),a=n?.name,c=(0,h.useMemo)((()=>{const e=new Set;return!!l&&(l.forEach((t=>{t.icon&&e.add(t.icon?.src||t.icon)})),e.size===l.length)}),[l]),u=window?.__experimentalContentOnlyPatternInsertion&&s;if(!l?.length||i||u)return null;const m=l.length>5,f=c?m?rP:sP:iP;return(0,d.jsx)(f,{className:"block-editor-block-variation-transforms",onSelectVariation:n=>{t(e,{...l.find((({name:e})=>e===n)).attributes})},selectedValue:a,variations:l})},aP=(0,m.createHigherOrderComponent)((e=>t=>{const[n,o,r,i,s]=Ti("color.palette.default","color.palette.theme","color.palette.custom","color.custom","color.defaultPalette"),l=s?[...o||[],...n||[],...r||[]]:[...o||[],...r||[]],{colors:a=l,disableCustomColors:c=!i}=t,u=a&&a.length>0||!c;return(0,d.jsx)(e,{...{...t,colors:a,disableCustomColors:c,hasColorsToChoose:u}})}),"withColorContext"),cP=aP(ws.ColorPalette);function uP({onChange:e,value:t,...n}){return(0,d.jsx)(qp,{...n,onColorChange:e,colorValue:t,gradients:[],disableCustomGradients:!0})}const dP=window.wp.date,pP=new Date;function hP({format:e,defaultFormat:t,onChange:n}){return(0,d.jsxs)(ws.__experimentalVStack,{as:"fieldset",spacing:4,className:"block-editor-date-format-picker",children:[(0,d.jsx)(ws.VisuallyHidden,{as:"legend",children:(0,T.__)("Date format")}),(0,d.jsx)(ws.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Default format"),help:`${(0,T.__)("Example:")} ${(0,dP.dateI18n)(t,pP)}`,checked:!e,onChange:e=>n(e?null:t)}),e&&(0,d.jsx)(gP,{format:e,onChange:n})]})}function gP({format:e,onChange:t}){const n=[...[...new Set(["Y-m-d",(0,T._x)("n/j/Y","short date format"),(0,T._x)("n/j/Y g:i A","short date format with time"),(0,T._x)("M j, Y","medium date format"),(0,T._x)("M j, Y g:i A","medium date format with time"),(0,T._x)("F j, Y","long date format"),(0,T._x)("M j","short date format without the year")])].map(((e,t)=>({key:`suggested-${t}`,name:(0,dP.dateI18n)(e,pP),format:e}))),{key:"human-diff",name:(0,dP.humanTimeDiff)(pP),format:"human-diff"}],o={key:"custom",name:(0,T.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",hint:(0,T.__)("Enter your own date format")},[r,i]=(0,h.useState)((()=>!!e&&!n.some((t=>t.format===e))));return(0,d.jsxs)(ws.__experimentalVStack,{children:[(0,d.jsx)(ws.CustomSelectControl,{__next40pxDefaultSize:!0,label:(0,T.__)("Choose a format"),options:[...n,o],value:r?o:n.find((t=>t.format===e))??o,onChange:({selectedItem:e})=>{e===o?i(!0):(i(!1),t(e.format))}}),r&&(0,d.jsx)(ws.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,T.__)("Custom format"),hideLabelFromVision:!0,help:(0,h.createInterpolateElement)((0,T.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,d.jsx)(ws.ExternalLink,{href:(0,T.__)("https://wordpress.org/documentation/article/customize-date-and-time-format/")})}),value:e,onChange:e=>t(e)})]})}pP.setDate(20),pP.setMonth(pP.getMonth()-3),4===pP.getMonth()&&pP.setMonth(3);const mP=({setting:e,children:t,panelId:n,...o})=>(0,d.jsx)(ws.__experimentalToolsPanelItem,{hasValue:()=>!!e.colorValue||!!e.gradientValue,label:e.label,onDeselect:()=>{e.colorValue?e.onColorChange():e.gradientValue&&e.onGradientChange()},isShownByDefault:void 0===e.isShownByDefault||e.isShownByDefault,...o,className:"block-editor-tools-panel-color-gradient-settings__item",panelId:n,resetAllFilter:e.resetAllFilter,children:t}),fP=({colorValue:e,label:t})=>(0,d.jsxs)(ws.__experimentalHStack,{justify:"flex-start",children:[(0,d.jsx)(ws.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,d.jsx)(ws.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]}),bP=e=>({onToggle:t,isOpen:n})=>{const{clearable:o,colorValue:r,gradientValue:i,onColorChange:s,onGradientChange:l,label:a}=e,c=(0,h.useRef)(void 0),u={onClick:t,className:ms("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n,ref:c},p=r??i;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,...u,children:(0,d.jsx)(fP,{colorValue:p,label:a})}),o&&p&&(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,label:(0,T.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:Ha,onClick:()=>{r?s():i&&l(),n&&t(),c.current?.focus()}})]})};function kP({colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradients:r,settings:i,__experimentalIsRenderedInSidebar:s,...l}){let a;return s&&(a={placement:"left-start",offset:36,shift:!0}),(0,d.jsx)(d.Fragment,{children:i.map(((i,c)=>{const u={clearable:!1,colorValue:i.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradientValue:i.gradientValue,gradients:r,label:i.label,onColorChange:i.onColorChange,onGradientChange:i.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:s,...i},p={clearable:i.clearable,label:i.label,colorValue:i.colorValue,gradientValue:i.gradientValue,onColorChange:i.onColorChange,onGradientChange:i.onGradientChange};return i&&(0,d.jsx)(mP,{setting:i,...l,children:(0,d.jsx)(ws.Dropdown,{popoverProps:a,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:bP(p),renderContent:()=>(0,d.jsx)(ws.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,d.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,d.jsx)(qp,{...u})})})})},c)}))})}const vP=["colors","disableCustomColors","gradients","disableCustomGradients"],_P=({className:e,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,children:i,settings:s,title:l,showTitle:a=!0,__experimentalIsRenderedInSidebar:c,enableAlpha:u})=>{const p=(0,m.useInstanceId)(_P),{batch:h}=(0,g.useRegistry)();return t&&0!==t.length||n&&0!==n.length||!o||!r||!s?.every((e=>(!e.colors||0===e.colors.length)&&(!e.gradients||0===e.gradients.length)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?(0,d.jsxs)(ws.__experimentalToolsPanel,{className:ms("block-editor-panel-color-gradient-settings",e),label:a?l:void 0,resetAll:()=>{h((()=>{s.forEach((({colorValue:e,gradientValue:t,onColorChange:n,onGradientChange:o})=>{e?n():t&&o()}))}))},panelId:p,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:[(0,d.jsx)(kP,{settings:s,panelId:p,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:c,enableAlpha:u}),!!i&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.__experimentalSpacer,{marginY:4})," ",i]})]}):null},yP=e=>{const t=Nd();return(0,d.jsx)(_P,{...{...t,...e}})};var xP=e=>vP.every((t=>e.hasOwnProperty(t)))?(0,d.jsx)(_P,{...e}):(0,d.jsx)(yP,{...e}),SP=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"})});const wP=100,CP=300,BP={placement:"bottom-start"},IP={crop:(0,T.__)("Image cropped."),rotate:(0,T.__)("Image rotated."),cropAndRotate:(0,T.__)("Image cropped and rotated.")};const jP=(0,h.createContext)({});jP.displayName="ImageEditingContext";const EP=()=>(0,h.useContext)(jP);function TP({id:e,url:t,naturalWidth:n,naturalHeight:o,onFinishEditing:r,onSaveImage:i,children:s}){const l=function({url:e,naturalWidth:t,naturalHeight:n}){const[o,r]=(0,h.useState)(),[i,s]=(0,h.useState)(),[l,a]=(0,h.useState)({x:0,y:0}),[c,u]=(0,h.useState)(100),[d,p]=(0,h.useState)(0),g=t/n,[m,b]=(0,h.useState)(g),k=(0,h.useCallback)((()=>{const t=(d+90)%360;let n=g;if(d%180==90&&(n=1/g),0===t)return r(),p(t),b(g),void a((e=>({x:-e.y*n,y:e.x*n})));const o=new window.Image;o.src=e,o.onload=function(e){const o=document.createElement("canvas");let i=0,s=0;t%180?(o.width=e.target.height,o.height=e.target.width):(o.width=e.target.width,o.height=e.target.height),90!==t&&180!==t||(i=o.width),270!==t&&180!==t||(s=o.height);const l=o.getContext("2d");l.translate(i,s),l.rotate(t*Math.PI/180),l.drawImage(e.target,0,0),o.toBlob((e=>{r(URL.createObjectURL(e)),p(t),b(o.width/o.height),a((e=>({x:-e.y*n,y:e.x*n})))}))};const i=(0,f.applyFilters)("media.crossOrigin",void 0,e);"string"==typeof i&&(o.crossOrigin=i)}),[d,g,e]);return(0,h.useMemo)((()=>({editedUrl:o,setEditedUrl:r,crop:i,setCrop:s,position:l,setPosition:a,zoom:c,setZoom:u,rotation:d,setRotation:p,rotateClockwise:k,aspect:m,setAspect:b,defaultAspect:g})),[o,i,l,c,d,k,m,g])}({url:t,naturalWidth:n,naturalHeight:o}),a=function({crop:e,rotation:t,url:n,id:o,onSaveImage:r,onFinishEditing:i}){const{createErrorNotice:s,createSuccessNotice:l}=(0,g.useDispatch)(pr.store),[a,c]=(0,h.useState)(!1),{editMediaEntity:u}=(0,g.useSelect)((e=>{const t=e(ji).getSettings();return{editMediaEntity:t?.[V]}}),[]),d=(0,h.useCallback)((()=>{c(!1),i()}),[i]),p=(0,h.useCallback)((async()=>{if(!u)return i(),void s((0,T.__)("Sorry, you are not allowed to edit images on this site."),{id:"image-editing-error",type:"snackbar"});c(!0);const a=[];if(t>0&&a.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&a.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),0===a.length)return c(!1),void i();const d=1===a.length?a[0].type:"cropAndRotate";try{const e=await u(o,{src:n,modifiers:a},{throwOnError:!0});e&&(r({id:e.id,url:e.source_url}),l(IP[d],{type:"snackbar",actions:[{label:(0,T.__)("Undo"),onClick:()=>{r({id:o,url:n})}}]}))}catch(e){s((0,T.sprintf)((0,T.__)("Could not edit image. %s"),(0,Ga.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})}finally{c(!1),i()}}),[e,t,o,n,r,s,l,i,u]);return(0,h.useMemo)((()=>({isInProgress:a,apply:p,cancel:d})),[a,p,d])}({id:e,url:t,onSaveImage:i,onFinishEditing:r,...l}),c=(0,h.useMemo)((()=>({...l,...a})),[l,a]);return(0,d.jsx)(jP.Provider,{value:c,children:s})}function MP({aspectRatios:e,isDisabled:t,label:n,onClick:o,value:r}){return(0,d.jsx)(ws.MenuGroup,{label:n,children:e.map((({name:e,slug:n,ratio:i})=>(0,d.jsx)(ws.MenuItem,{disabled:t,onClick:()=>{o(i)},role:"menuitemradio",isSelected:i===r,icon:i===r?ip:void 0,children:e},n)))})}function PP(e){const[t,n,...o]=e.split("/").map(Number);return t<=0||n<=0||Number.isNaN(t)||Number.isNaN(n)||o.length?NaN:n?t/n:t}function RP({ratio:e,...t}){return{ratio:PP(e),...t}}function AP({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:o,defaultAspect:r}=EP(),[i,s,l]=Ti("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios");return(0,d.jsx)(ws.DropdownMenu,{icon:SP,label:(0,T.__)("Aspect Ratio"),popoverProps:BP,toggleProps:e,children:({onClose:e})=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(MP,{isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{slug:"original",name:(0,T.__)("Original"),ratio:r},...l?i.map(RP).filter((({ratio:e})=>1===e)):[]]}),s?.length>0&&(0,d.jsx)(MP,{label:(0,T.__)("Theme"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:s}),l&&(0,d.jsx)(MP,{label:(0,T.__)("Landscape"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:i.map(RP).filter((({ratio:e})=>e>1))}),l&&(0,d.jsx)(MP,{label:(0,T.__)("Portrait"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:i.map(RP).filter((({ratio:e})=>e<1))})]})})}var NP=function(e,t){return NP=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},NP(e,t)};function LP(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}NP(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var DP=function(){return DP=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},DP.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var OP=n(7520),zP=n.n(OP);function VP(e,t,n,o,r){void 0===r&&(r=0);var i=KP(t.width,t.height,r),s=i.width,l=i.height;return{x:FP(e.x,s,n.width,o),y:FP(e.y,l,n.height,o)}}function FP(e,t,n,o){var r=t*o/2-n/2;return ZP(e,-r,r)}function HP(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function UP(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function GP(e,t){return Math.min(e,Math.max(0,t))}function $P(e,t){return t}function WP(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function KP(e,t,n){var o=n*Math.PI/180;return{width:Math.abs(Math.cos(o)*e)+Math.abs(Math.sin(o)*t),height:Math.abs(Math.sin(o)*e)+Math.abs(Math.cos(o)*t)}}function ZP(e,t,n){return Math.min(Math.max(e,t),n)}function qP(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var YP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=ic.createRef(),n.videoRef=ic.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc="undefined"!=typeof document?document:null,n.currentWindow="undefined"!=typeof window?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&n.containerRef){var e=!0;n.resizeObserver=new window.ResizeObserver((function(t){e?e=!1:n.computeSizes()})),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=function(e,t,n,o,r,i){var s=KP(t.width,t.height,n),l=ZP(o.width/s.width*(100/e.width),r,i);return{crop:{x:l*s.width/2-o.width/2-s.width*l*(e.x/100),y:l*s.height/2-o.height/2-s.height*l*(e.y/100)},zoom:l}}(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),o=t.crop,r=t.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}else if(n.props.initialCroppedAreaPixels){var i=function(e,t,n,o,r,i){void 0===n&&(n=0);var s=KP(t.naturalWidth,t.naturalHeight,n),l=ZP(function(e,t,n){var o=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*o):n.width/(e.width*o)}(e,t,o),r,i),a=o.height>o.width?o.height/e.height:o.width/e.width;return{crop:{x:((s.width-e.width)/2-e.x)*a,y:((s.height-e.height)/2-e.y)*a},zoom:l}}(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);o=i.crop,r=i.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}},n.computeSizes=function(){var e,t,o,r,i,s,l=n.imageRef.current||n.videoRef.current;if(l&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var a=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(o=n.imageRef.current)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef.current)||void 0===r?void 0:r.videoHeight)||0,d=c/u,p=void 0;if(l.offsetWidth<c||l.offsetHeight<u)switch(n.state.mediaObjectFit){default:case"contain":p=a>d?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":p={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":p={width:n.containerRect.height*d,height:n.containerRect.height}}else p={width:l.offsetWidth,height:l.offsetHeight};n.mediaSize=DP(DP({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var h=n.props.cropSize?n.props.cropSize:function(e,t,n,o,r,i){void 0===i&&(i=0);var s=KP(e,t,i),l=s.width,a=s.height,c=Math.min(l,n),u=Math.min(a,o);return c>u*r?{width:u*r,height:u}:{width:c,height:c/r}}(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(i=n.state.cropSize)||void 0===i?void 0:i.height)===h.height&&(null===(s=n.state.cropSize)||void 0===s?void 0:s.width)===h.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(h),n.setState({cropSize:h},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(h),h}},n.saveContainerPosition=function(){if(n.containerRef){var e=n.containerRef.getBoundingClientRect();n.containerPosition={x:e.left,y:e.top}}},n.onMouseDown=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(e)))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onScroll=function(e){n.currentDoc&&(e.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(e){n.currentDoc&&(n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var o=t.getMousePoint(e),r=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(r,o,{shouldUpdatePosition:!0}),n.props.onRotationChange){var i=n.gestureRotationStart+e.rotation;n.props.onRotationChange(i)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,o,r=e.x,i=e.y;n.dragStartPosition={x:r,y:i},n.dragStartCrop=DP({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,i={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},s=n.props.restrictPosition?VP(i,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):i;n.props.onCropChange(s)}})))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(n.currentWindow&&(!n.props.onWheelRequest||n.props.onWheelRequest(e))){e.preventDefault();var o=t.getMousePoint(e),r=zP()(e).pixelY,i=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(i,o,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e,t){var o=e.x,r=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(o-t.x),y:n.containerRect.height/2-(r-t.y)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,i=r.crop,s=r.zoom;return{x:(t+i.x)/s,y:(o+i.y)/s}},n.setNewZoom=function(e,t,o){var r=(void 0===o?{}:o).shouldUpdatePosition,i=void 0===r||r;if(n.state.cropSize&&n.props.onZoomChange){var s=ZP(e,n.props.minZoom,n.props.maxZoom);if(i){var l=n.getPointOnContainer(t,n.containerPosition),a=n.getPointOnMedia(l),c={x:a.x*s-l.x,y:a.y*s-l.y},u=n.props.restrictPosition?VP(c,n.mediaSize,n.state.cropSize,s,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(s)}},n.getCropData=function(){return n.state.cropSize?function(e,t,n,o,r,i,s){void 0===i&&(i=0),void 0===s&&(s=!0);var l=s?GP:$P,a=KP(t.width,t.height,i),c=KP(t.naturalWidth,t.naturalHeight,i),u={x:l(100,((a.width-n.width/r)/2-e.x/r)/a.width*100),y:l(100,((a.height-n.height/r)/2-e.y/r)/a.height*100),width:l(100,n.width/a.width*100/r),height:l(100,n.height/a.height*100/r)},d=Math.round(l(c.width,u.width*c.width/100)),p=Math.round(l(c.height,u.height*c.height/100)),h=c.width>=c.height*o?{width:Math.round(p*o),height:p}:{width:d,height:Math.round(d/o)};return{croppedAreaPercentages:u,croppedAreaPixels:DP(DP({},h),{x:Math.round(l(c.width-h.width,u.x*c.width/100)),y:Math.round(l(c.height-h.height,u.y*c.height/100))})}}(n.props.restrictPosition?VP(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?VP(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return LP(t,e),t.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(e){var t,n,o,r,i,s,l,a,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect||e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(o=e.cropSize)||void 0===o?void 0:o.width)!==(null===(r=this.props.cropSize)||void 0===r?void 0:r.width)?this.computeSizes():(null===(i=e.crop)||void 0===i?void 0:i.x)===(null===(s=this.props.crop)||void 0===s?void 0:s.x)&&(null===(l=e.crop)||void 0===l?void 0:l.y)===(null===(a=this.props.crop)||void 0===a?void 0:a.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef.current)||void 0===c||c.load());var u=this.getObjectFit();u!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:u},this.computeSizes)},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.getObjectFit=function(){var e,t,n,o;if("cover"===this.props.objectFit){if((this.imageRef.current||this.videoRef.current)&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var r=this.containerRect.width/this.containerRect.height;return((null===(e=this.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=this.videoRef.current)||void 0===t?void 0:t.videoWidth)||0)/((null===(n=this.imageRef.current)||void 0===n?void 0:n.naturalHeight)||(null===(o=this.videoRef.current)||void 0===o?void 0:o.videoHeight)||0)<r?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=HP(n,o),this.lastPinchRotation=UP(n,o),this.onDragStart(WP(n,o))},t.prototype.onPinchMove=function(e){var n=this;if(this.currentDoc&&this.currentWindow){var o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),i=WP(o,r);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=HP(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,i,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var s=UP(o,r),l=n.props.rotation+(s-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(l),n.lastPinchRotation=s}))}},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,i=t.transform,s=t.crop,l=s.x,a=s.y,c=t.rotation,u=t.zoom,d=t.cropShape,p=t.showGrid,h=t.style,g=h.containerStyle,m=h.cropAreaStyle,f=h.mediaStyle,b=t.classes,k=b.containerClassName,v=b.cropAreaClassName,_=b.mediaClassName,y=this.state.mediaObjectFit;return ic.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:g,className:qP("reactEasyCrop_Container",k)},n?ic.createElement("img",DP({alt:"",className:qP("reactEasyCrop_Image","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical",_)},r,{src:n,ref:this.imageRef,style:DP(DP({},f),{transform:i||"translate(".concat(l,"px, ").concat(a,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),onLoad:this.onMediaLoad})):o&&ic.createElement("video",DP({autoPlay:!0,loop:!0,muted:!0,className:qP("reactEasyCrop_Video","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical",_)},r,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:DP(DP({},f),{transform:i||"translate(".concat(l,"px, ").concat(a,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return ic.createElement("source",DP({key:e.src},e))}))),this.state.cropSize&&ic.createElement("div",{style:DP(DP({},m),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:qP("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",v)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(ic.Component);function XP({url:e,width:t,height:n,naturalHeight:o,naturalWidth:r,borderProps:i}){const{isInProgress:s,editedUrl:l,position:a,zoom:c,aspect:u,setPosition:p,setCrop:h,setZoom:g,rotation:f}=EP(),[b,{width:k}]=(0,m.useResizeObserver)();let v=n||k*o/r;f%180==90&&(v=k*r/o);const _=(0,d.jsxs)("div",{className:ms("wp-block-image__crop-area",i?.className,{"is-applying":s}),style:{...i?.style,width:t||k,height:v},children:[(0,d.jsx)(YP,{image:l||e,disabled:s,minZoom:wP/100,maxZoom:CP/100,crop:a,zoom:c/100,aspect:u,onCropChange:e=>{p(e)},onCropComplete:e=>{h(e)},onZoomChange:e=>{g(100*e)}}),s&&(0,d.jsx)(ws.Spinner,{})]});return(0,d.jsxs)(d.Fragment,{children:[b,_]})}var QP=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"})});function JP(){const{isInProgress:e,zoom:t,setZoom:n}=EP();return(0,d.jsx)(ws.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:BP,renderToggle:({isOpen:t,onToggle:n})=>(0,d.jsx)(ws.ToolbarButton,{icon:QP,label:(0,T.__)("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,d.jsx)(ws.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,d.jsx)(ws.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,T.__)("Zoom"),min:wP,max:CP,value:Math.round(t),onChange:n})})})}var eR=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"})});function tR(){const{isInProgress:e,rotateClockwise:t}=EP();return(0,d.jsx)(ws.ToolbarButton,{icon:eR,label:(0,T.__)("Rotate"),onClick:t,disabled:e})}function nR(){const{isInProgress:e,apply:t,cancel:n}=EP();return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.ToolbarButton,{onClick:t,disabled:e,children:(0,T.__)("Apply")}),(0,d.jsx)(ws.ToolbarButton,{onClick:n,children:(0,T.__)("Cancel")})]})}function oR({id:e,url:t,width:n,height:o,naturalHeight:r,naturalWidth:i,onSaveImage:s,onFinishEditing:l,borderProps:a}){return(0,d.jsxs)(TP,{id:e,url:t,naturalWidth:i,naturalHeight:r,onSaveImage:s,onFinishEditing:l,children:[(0,d.jsx)(XP,{borderProps:a,url:t,width:n,height:o,naturalHeight:r,naturalWidth:i}),(0,d.jsxs)(Rs,{children:[(0,d.jsxs)(ws.ToolbarGroup,{children:[(0,d.jsx)(JP,{}),(0,d.jsx)(ws.ToolbarItem,{children:e=>(0,d.jsx)(AP,{toggleProps:e})}),(0,d.jsx)(tR,{})]}),(0,d.jsx)(ws.ToolbarGroup,{children:(0,d.jsx)(nR,{})})]})]})}const rR=[25,50,75,100],iR=()=>{};function sR(e,t,n){return{scaledWidth:Math.round(t*(e/100)),scaledHeight:Math.round(n*(e/100))}}function lR({imageSizeHelp:e,imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:i,width:s,height:l,onChange:a,onChangeImage:c=iR}){const{currentHeight:u,currentWidth:p,updateDimension:g,updateDimensions:m}=function(e,t,n,o,r){const[i,s]=(0,h.useState)(t??o??""),[l,a]=(0,h.useState)(e??n??"");return(0,h.useEffect)((()=>{void 0===t&&void 0!==o&&s(o),void 0===e&&void 0!==n&&a(n)}),[o,n]),(0,h.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(i)&&s(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(l)&&a(e)}),[t,e]),{currentHeight:l,currentWidth:i,updateDimension:(e,t)=>{const n=""===t?void 0:parseInt(t,10);"width"===e?s(n):a(n),r({[e]:n})},updateDimensions:(e,t)=>{a(e??n),s(t??o),r({height:e,width:t})}}}(l,s,n,t,a),f=rR.find((e=>{const{scaledWidth:o,scaledHeight:r}=sR(e,t,n);return p===o&&u===r}));return(0,d.jsxs)(ws.__experimentalVStack,{className:"block-editor-image-size-control",spacing:"4",children:[o&&o.length>0&&(0,d.jsx)(ws.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Resolution"),value:i,options:o,onChange:c,help:e,size:"__unstable-large"}),r&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(ws.__experimentalHStack,{align:"baseline",spacing:"4",children:[(0,d.jsx)(ws.__experimentalNumberControl,{label:(0,T.__)("Width"),value:p,min:1,onChange:e=>g("width",e),size:"__unstable-large"}),(0,d.jsx)(ws.__experimentalNumberControl,{label:(0,T.__)("Height"),value:u,min:1,onChange:e=>g("height",e),size:"__unstable-large"})]}),(0,d.jsx)(ws.__experimentalToggleGroupControl,{label:(0,T.__)("Image size presets"),hideLabelFromVision:!0,onChange:e=>{if(void 0===e)return void m();const{scaledWidth:o,scaledHeight:r}=sR(e,t,n);m(r,o)},value:f,isBlock:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:rR.map((e=>(0,d.jsx)(ws.__experimentalToggleGroupControlOption,{value:e,label:(0,T.sprintf)((0,T.__)("%d%%"),e)},e)))})]})]})}function aR({url:e,urlLabel:t,className:n}){const o=ms(n,"block-editor-url-popover__link-viewer-url");return e?(0,d.jsx)(ws.ExternalLink,{className:o,href:e,children:t||(0,Ua.filterURLForDisplay)((0,Ua.safeDecodeURI)(e))}):(0,d.jsx)("span",{className:o})}const{__experimentalPopoverLegacyPositionToPlacement:cR}=G(ws.privateApis),uR=(0,h.forwardRef)((({additionalControls:e,children:t,renderSettings:n,placement:o,focusOnMount:r="firstElement",position:i,...s},l)=>{let a;void 0!==i&&I()("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==o?a=o:void 0!==i&&(a=cR(i)),a=a||"bottom";const[c,u]=(0,h.useState)(!1),p=!!n&&c;return(0,d.jsxs)(ws.Popover,{ref:l,role:"dialog","aria-modal":"true","aria-label":(0,T.__)("Edit URL"),className:"block-editor-url-popover",focusOnMount:r,placement:a,shift:!0,variant:"toolbar",...s,children:[(0,d.jsx)("div",{className:"block-editor-url-popover__input-container",children:(0,d.jsxs)("div",{className:"block-editor-url-popover__row",children:[t,!!n&&(0,d.jsx)(ws.Button,{className:"block-editor-url-popover__settings-toggle",icon:yI,label:(0,T.__)("Link settings"),onClick:()=>{u(!c)},"aria-expanded":c,size:"compact"})]})}),p&&(0,d.jsx)("div",{className:"block-editor-url-popover__settings",children:n()}),e&&!p&&(0,d.jsx)("div",{className:"block-editor-url-popover__additional-controls",children:e})]})}));uR.LinkEditor=function({autocompleteRef:e,className:t,onChangeInputValue:n,value:o,...r}){return(0,d.jsxs)("form",{className:ms("block-editor-url-popover__link-editor",t),...r,children:[(0,d.jsx)(ac,{value:o,onChange:n,autocompleteRef:e}),(0,d.jsx)(ws.Button,{icon:tc,label:(0,T.__)("Apply"),type:"submit",size:"compact"})]})},uR.LinkViewer=function({className:e,linkClassName:t,onEditLinkClick:n,url:o,urlLabel:r,...i}){return(0,d.jsxs)("div",{className:ms("block-editor-url-popover__link-viewer",e),...i,children:[(0,d.jsx)(aR,{url:o,urlLabel:r,className:t}),n&&(0,d.jsx)(ws.Button,{icon:Wc,label:(0,T.__)("Edit"),onClick:n,size:"compact"})]})};var dR=uR;const pR=()=>{},hR=({src:e,onChange:t,onSubmit:n,onClose:o,popoverAnchor:r})=>(0,d.jsx)(dR,{anchor:r,onClose:o,children:(0,d.jsx)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n,children:(0,d.jsx)(ws.__experimentalInputControl,{__next40pxDefaultSize:!0,label:(0,T.__)("URL"),type:"text",hideLabelFromVision:!0,placeholder:(0,T.__)("Paste or type URL"),onChange:t,value:e,suffix:(0,d.jsx)(ws.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,d.jsx)(ws.Button,{size:"small",icon:tc,label:(0,T.__)("Apply"),type:"submit"})})})})}),gR=({src:e,onChangeSrc:t,onSelectURL:n})=>{const[o,r]=(0,h.useState)(null),[i,s]=(0,h.useState)(!1),l=()=>{s(!1),o?.focus()};return(0,d.jsxs)("div",{className:"block-editor-media-placeholder__url-input-container",children:[(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:()=>{s(!0)},isPressed:i,variant:"secondary","aria-haspopup":"dialog",ref:r,children:(0,T.__)("Insert from URL")}),i&&(0,d.jsx)(hR,{src:e,onChange:t,onSubmit:t=>{t.preventDefault(),e&&n&&(n(e),l())},onClose:l,popoverAnchor:o})]})};var mR=(0,ws.withFilters)("editor.MediaPlaceholder")((function({value:e={},allowedTypes:t,className:n,icon:o,labels:r={},mediaPreview:i,notices:s,isAppender:l,accept:a,addToGallery:c,multiple:u=!1,handleUpload:p=!0,disableDropZone:m,disableMediaButtons:f,onError:b,onSelect:k,onCancel:v,onSelectURL:_,onToggleFeaturedImage:y,onDoubleClick:x,onFilesPreUpload:S=pR,onHTMLDrop:w,children:C,mediaLibraryButton:B,placeholder:j,style:E}){w&&I()("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});const M=(0,g.useSelect)((e=>{const{getSettings:t}=e(ji);return t().mediaUpload}),[]),[P,R]=(0,h.useState)("");(0,h.useEffect)((()=>{R(e?.src??"")}),[e?.src]);const A=n=>{if(!p||"function"==typeof p&&!p(n))return k(n);let o;if(S(n),u)if(c){let t=[];o=n=>{const o=(e??[]).filter((e=>e.id?!t.some((({id:t})=>Number(t)===Number(e.id))):!t.some((({urlSlug:t})=>e.url.includes(t)))));k(o.concat(n)),t=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=k;else o=([e])=>k(e);M({allowedTypes:t,filesList:n,onFileChange:o,onError:b,multiple:u})};async function N(e){const{blocks:n}=DS(e);if(!n?.length)return;const o=await Promise.all(n.map((e=>{const n=e.name.split("/")[1];return e.attributes.id?(e.attributes.type=n,e.attributes):new Promise(((o,r)=>{window.fetch(e.attributes.url).then((e=>e.blob())).then((i=>M({filesList:[i],additionalData:{title:e.attributes.title,alt_text:e.attributes.alt,caption:e.attributes.caption,type:n},onFileChange:([e])=>{e.id&&o(e)},allowedTypes:t,onError:r}))).catch((()=>o(e.attributes.url)))}))}))).catch((e=>b(e)));o?.length&&k(u?o:o[0])}const L=e=>{A(e.target.files)},D=j??(e=>{let{instructions:a,title:c}=r;if(M||_||(a=(0,T.__)("To edit this block, you need permission to upload media.")),void 0===a||void 0===c){const e=t??[],[n]=e,o=1===e.length,r=o&&"audio"===n,i=o&&"image"===n,s=o&&"video"===n;void 0===a&&M&&(a=(0,T.__)("Drag and drop an image or video, upload, or choose from your library."),r?a=(0,T.__)("Drag and drop an audio file, upload, or choose from your library."):i?a=(0,T.__)("Drag and drop an image, upload, or choose from your library."):s&&(a=(0,T.__)("Drag and drop a video, upload, or choose from your library."))),void 0===c&&(c=(0,T.__)("Media"),r?c=(0,T.__)("Audio"):i?c=(0,T.__)("Image"):s&&(c=(0,T.__)("Video")))}const u=ms("block-editor-media-placeholder",n,{"is-appender":l});return(0,d.jsxs)(ws.Placeholder,{icon:o,label:c,instructions:a,className:u,notices:s,onDoubleClick:x,preview:i,style:E,children:[e,C]})}),O=()=>m?null:(0,d.jsx)(ws.DropZone,{onFilesDrop:A,onDrop:N,isEligible:e=>{const n="wp-block:core/",o=[];for(const t of e.types)t.startsWith(n)&&o.push(t.slice(14));return o.every((e=>t.includes(e)))&&(!!u||1===o.length)}}),z=()=>v&&(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__cancel-button",title:(0,T.__)("Cancel"),variant:"link",onClick:v,children:(0,T.__)("Cancel")}),V=()=>_&&(0,d.jsx)(gR,{src:P,onChangeSrc:R,onSelectURL:_}),F=()=>y&&(0,d.jsx)("div",{className:"block-editor-media-placeholder__url-input-container",children:(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:y,variant:"secondary",children:(0,T.__)("Use featured image")})});return f?(0,d.jsx)(Xa,{children:O()}):(0,d.jsx)(Xa,{fallback:D(V()),children:(()=>{const n=B??(({open:e})=>(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{e()},children:(0,T.__)("Media Library")})),o=(0,d.jsx)(Ya,{addToGallery:c,gallery:u&&!(!t||0===t.length)&&t.every((e=>"image"===e||e.startsWith("image/"))),multiple:u,onSelect:k,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map((({id:e})=>e)):e.id,render:n});if(M&&l)return(0,d.jsxs)(d.Fragment,{children:[O(),(0,d.jsx)(ws.FormFileUpload,{onChange:L,accept:a,multiple:!!u,render:({openFileDialog:e})=>{const t=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,variant:"primary",className:ms("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:e,children:(0,T._x)("Upload","verb")}),o,V(),F(),z()]});return D(t)}})]});if(M){const e=(0,d.jsxs)(d.Fragment,{children:[O(),(0,d.jsx)(ws.FormFileUpload,{render:({openFileDialog:e})=>(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,onClick:e,variant:"primary",className:ms("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),children:(0,T._x)("Upload","verb")}),onChange:L,accept:a,multiple:!!u}),o,V(),F(),z()]});return D(e)}return D(o)})()})}));var fR=({colorSettings:e,...t})=>{const n=e.map((e=>{if(!e)return e;const{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}}));return(0,d.jsx)(xP,{settings:n,gradients:[],disableCustomGradients:!0,...t})};const bR={placement:"bottom-start"};var kR=()=>(0,d.jsxs)(d.Fragment,{children:[["bold","italic","link","unknown"].map((e=>(0,d.jsx)(ws.Slot,{name:`RichText.ToolbarControls.${e}`},e))),(0,d.jsx)(ws.Slot,{name:"RichText.ToolbarControls",children:e=>{if(!e.length)return null;const t=e.map((([{props:e}])=>e)).some((({isActive:e})=>e));return(0,d.jsx)(ws.ToolbarItem,{children:n=>(0,d.jsx)(ws.DropdownMenu,{icon:yI,label:(0,T.__)("More"),toggleProps:{...n,className:ms(n.className,{"is-pressed":t}),description:(0,T.__)("Displays more block tools")},controls:xt(e.map((([{props:e}])=>e)),"title"),popoverProps:bR})})}})]});function vR({popoverAnchor:e}){return(0,d.jsx)(ws.Popover,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar",children:(0,d.jsx)(ET,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,T.__)("Format tools"),children:(0,d.jsx)(ws.ToolbarGroup,{children:(0,d.jsx)(kR,{})})})})}var _R=({inline:e,editableContentElement:t})=>e?(0,d.jsx)(vR,{popoverAnchor:t}):(0,d.jsx)(Rs,{group:"inline",children:(0,d.jsx)(kR,{})});function yR(e){return e(pe.store).getFormatTypes()}const xR=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function SR(e,t){return"object"!=typeof e?{[t]:e}:Object.fromEntries(Object.entries(e).map((([e,n])=>[`${t}.${e}`,n])))}function wR(e,t){return e[t]?e[t]:Object.keys(e).filter((e=>e.startsWith(t+"."))).reduce(((n,o)=>(n[o.slice(t.length+1)]=e[o],n)),{})}const CR=["`",'"',"'","“”","‘’"];function BR(e){let t=e.length;for(;t--;){const n=mr(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].toString().replace(gr,""),[e[t].clientId,n,0,0];const o=BR(e[t].innerBlocks);if(o)return o}return[]}function IR(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function jR({allowedFormats:e,disableFormats:t}){return t?jR.EMPTY_ARRAY:e}jR.EMPTY_ARRAY=[];const ER=[e=>t=>{function n(n){const{inputType:o,data:r}=n,{value:i,onChange:s,registry:l}=e.current;if("insertText"!==o)return;if((0,pe.isCollapsed)(i))return;const a=(0,f.applyFilters)("blockEditor.wrapSelectionSettings",CR).find((([e,t])=>e===r||t===r));if(!a)return;const[c,u=c]=a,d=i.start,p=i.end+c.length;let h=(0,pe.insert)(i,c,d,d);h=(0,pe.insert)(h,u,p,p);const{__unstableMarkLastChangeAsPersistent:g,__unstableMarkAutomaticChange:m}=l.dispatch(ji);g(),s(h),m();const b={};for(const e in n)b[e]=n[e];b.data=u;const{ownerDocument:k}=t,{defaultView:v}=k,_=new v.InputEvent("input",b);window.queueMicrotask((()=>{n.target.dispatchEvent(_)})),n.preventDefault()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}},e=>t=>{function n(){const{getValue:t,onReplace:n,selectionChange:o,registry:r}=e.current;if(!n)return;const i=t(),{start:s,text:l}=i;if(" "!==l.slice(s-1,s))return;const a=l.slice(0,s).trim(),c=(0,p.getBlockTransforms)("from").filter((({type:e})=>"prefix"===e)),u=(0,p.findTransform)(c,(({prefix:e})=>a===e));if(!u)return;const d=(0,pe.toHTMLString)({value:(0,pe.insert)(i,gr,0,s)}),h=u.transform(d);return o(...BR([h])),n([h]),r.dispatch(ji).__unstableMarkAutomaticChange(),!0}function o(t){const{inputType:o,type:r}=t,{getValue:i,onChange:s,__unstableAllowPrefixTransformations:l,formatTypes:a,registry:c}=e.current;if("insertText"!==o&&"compositionend"!==r)return;if(l&&n())return;const u=i(),d=a.reduce(((e,{__unstableInputRule:t})=>(t&&(e=t(e)),e)),function(e){const t="tales of gutenberg",{start:n,text:o}=e;return n<18||o.slice(n-18,n).toLowerCase()!==t?e:(0,pe.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(u)),{__unstableMarkLastChangeAsPersistent:p,__unstableMarkAutomaticChange:h}=c.dispatch(ji);d!==u&&(p(),s({...d,activeFormats:u.activeFormats}),h())}return t.addEventListener("input",o),t.addEventListener("compositionend",o),()=>{t.removeEventListener("input",o),t.removeEventListener("compositionend",o)}},e=>t=>{function n(t){if("insertReplacementText"!==t.inputType)return;const{registry:n}=e.current;n.dispatch(ji).__unstableMarkLastChangeAsPersistent()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}},()=>e=>{function t(e){(Wa.isKeyboardEvent.primary(e,"z")||Wa.isKeyboardEvent.primary(e,"y")||Wa.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},e=>t=>{const{keyboardShortcuts:n}=e.current;function o(e){for(const t of n.current)t(e)}return t.addEventListener("keydown",o),()=>{t.removeEventListener("keydown",o)}},e=>t=>{const{inputEvents:n}=e.current;function o(e){for(const t of n.current)t(e)}return t.addEventListener("input",o),()=>{t.removeEventListener("input",o)}},e=>t=>{function n(t){const{keyCode:n}=t;if(t.defaultPrevented)return;if(n!==Wa.BACKSPACE&&n!==Wa.ESCAPE)return;const{registry:o}=e.current,{didAutomaticChange:r,getSettings:i}=o.select(ji),{__experimentalUndo:s}=i();s&&r()&&(t.preventDefault(),s())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(n){const{disableFormats:o,onChange:r,value:i,formatTypes:s,tagName:l,onReplace:a,__unstableEmbedURLOnPaste:c,preserveWhiteSpace:u,pastePlainText:d}=e.current;if(!t.contains(n.target))return;if(n.defaultPrevented)return;const{plainText:h,html:g}=Ew(n);if(n.preventDefault(),window.console.log("Received HTML:\n\n",g),window.console.log("Received plain text:\n\n",h),o)return void r((0,pe.insert)(i,h));function m(e){const t=s.reduce(((e,{__unstablePasteRule:t})=>(t&&e===i&&(e=t(i,{html:g,plainText:h})),e)),i);if(t!==i)r(t);else{const t=(0,pe.create)({html:e});!function(e,t){if(t?.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}(t,i.activeFormats),r((0,pe.insert)(i,t))}}if("true"===n.clipboardData.getData("rich-text"))return void m(g);if(d)return void r((0,pe.insert)(i,(0,pe.create)({text:h})));let f="INLINE";const b=h.trim();c&&(0,pe.isEmpty)(i)&&(0,Ua.isURL)(b)&&/^https?:/.test(b)&&(f="BLOCKS");const k=(0,p.pasteHandler)({HTML:g,plainText:h,mode:f,tagName:l,preserveWhiteSpace:u});"string"==typeof k?m(k):k.length>0&&a&&(0,pe.isEmpty)(i)&&a(k,k.length-1,-1)}const{defaultView:o}=t.ownerDocument;return o.addEventListener("paste",n),()=>{o.removeEventListener("paste",n)}},e=>t=>{function n(t){const{keyCode:n}=t;if(t.defaultPrevented)return;const{value:o,onMerge:r,onRemove:i}=e.current;if(n===Wa.DELETE||n===Wa.BACKSPACE){const{start:e,end:s,text:l}=o,a=n===Wa.BACKSPACE,c=o.activeFormats&&!!o.activeFormats.length;if(!(0,pe.isCollapsed)(o)||c||a&&0!==e||!a&&s!==l.length)return;r?r(!a):i&&(0,pe.isEmpty)(o)&&a&&i(!a),t.preventDefault()}}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(t){if(t.keyCode!==Wa.ENTER)return;const{onReplace:n,onSplit:o}=e.current;n&&o&&(t.__deprecatedOnSplit=!0)}function o(n){if(n.defaultPrevented)return;if(n.target!==t)return;if(n.keyCode!==Wa.ENTER)return;const{value:o,onChange:r,disableLineBreaks:i,onSplitAtEnd:s,onSplitAtDoubleLineEnd:l,registry:a}=e.current;n.preventDefault();const{text:c,start:u,end:d}=o;n.shiftKey?i||r((0,pe.insert)(o,"\n")):s&&u===d&&d===c.length?s():l&&u===d&&d===c.length&&"\n\n"===c.slice(-2)?a.batch((()=>{const e={...o};e.start=e.end-2,r((0,pe.remove)(e)),l()})):i||r((0,pe.insert)(o,"\n"))}const{defaultView:r}=t.ownerDocument;return r.addEventListener("keydown",o),t.addEventListener("keydown",n),()=>{r.removeEventListener("keydown",o),t.removeEventListener("keydown",n)}},e=>t=>{function n(){const{registry:n}=e.current;if(!n.select(ji).isMultiSelecting())return;const o=t.parentElement.closest('[contenteditable="true"]');o&&o.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}];function TR(e){const t=(0,h.useRef)(e);(0,h.useInsertionEffect)((()=>{t.current=e}));const n=(0,h.useMemo)((()=>ER.map((e=>e(t)))),[t]);return(0,m.useRefEffect)((t=>{if(!e.isSelected)return;const o=n.map((e=>e(t)));return()=>{o.forEach((e=>e()))}}),[n,e.isSelected])}const MR={},PR=Symbol("usesContext");function RR({onChange:e,onFocus:t,value:n,forwardedRef:o,settings:r}){const{name:i,edit:s,[PR]:l}=r,a=(0,h.useContext)(sv),c=(0,h.useMemo)((()=>l?Object.fromEntries(Object.entries(a).filter((([e])=>l.includes(e)))):MR),[l,a]);if(!s)return null;const u=(0,pe.getActiveFormat)(n,i),p=void 0!==u,g=(0,pe.getActiveObject)(n),m=void 0!==g&&g.type===i;return(0,d.jsx)(s,{isActive:p,activeAttributes:p&&u.attributes||{},isObjectActive:m,activeObjectAttributes:m&&g.attributes||{},value:n,onChange:e,onFocus:t,contentRef:o,context:c},i)}function AR({formatTypes:e,...t}){return e.map((e=>(0,ic.createElement)(RR,{settings:e,...t,key:e.name})))}function NR(e,t){if(WR.isEmpty(e)){const e=IR(t);return e?`<${e}></${e}>`:""}return Array.isArray(e)?(I()("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),p.children.toHTML(e)):"string"==typeof e?e:e.toHTMLString()}function LR({value:e,tagName:t,multiline:n,format:o,...r}){return e=(0,d.jsx)(h.RawHTML,{children:NR(e,n)}),t?(0,d.jsx)(t,{...r,children:e}):e}var DR=(0,h.forwardRef)((function({children:e,identifier:t,tagName:n="div",value:o="",onChange:r,multiline:i,...s},l){I()("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});const{clientId:a}=C(),{getSelectionStart:c,getSelectionEnd:u}=(0,g.useSelect)(ji),{selectionChange:p}=(0,g.useDispatch)(ji),h=IR(i),m=`</${h}>${o=o||`<${h}></${h}>`}<${h}>`.split(`</${h}><${h}>`);function f(e){r(`<${h}>${e.join(`</${h}><${h}>`)}</${h}>`)}return m.shift(),m.pop(),(0,d.jsx)(n,{ref:l,children:m.map(((e,n)=>(0,d.jsx)(HR,{identifier:`${t}-${n}`,tagName:h,value:e,onChange:e=>{const t=m.slice();t[n]=e,f(t)},isSelected:void 0,onKeyDown:o=>{if(o.keyCode!==Wa.ENTER)return;o.preventDefault();const{offset:r}=c(),{offset:i}=u();if("number"!=typeof r||"number"!=typeof i)return;const s=(0,pe.create)({html:e});s.start=r,s.end=i;const l=(0,pe.split)(s).map((e=>(0,pe.toHTMLString)({value:e}))),d=m.slice();d.splice(n,1,...l),f(d),p(a,`${t}-${n+1}`,0,0)},onMerge:e=>{const o=m.slice();let r=0;if(e){if(!o[n+1])return;o.splice(n,2,o[n]+o[n+1]),r=o[n].length-1}else{if(!o[n-1])return;o.splice(n-1,2,o[n-1]+o[n]),r=o[n-1].length-1}f(o),p(a,`${t}-${n-(e?0:1)}`,r,r)},...s},n)))})}));const OR=(0,h.createContext)();OR.displayName="keyboardShortcutContext";const zR=(0,h.createContext)();zR.displayName="inputEventContext";const VR=Symbol("instanceId");function FR(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:o,textAlign:r,selectionColor:i,tagsToEliminate:s,disableEditingMenu:l,fontSize:a,fontFamily:c,fontWeight:u,fontStyle:d,minWidth:p,maxWidth:h,disableSuggestions:g,disableAutocorrection:m,...f}=e;return f}function HR({children:e,tagName:t="div",value:n="",onChange:o,isSelected:r,multiline:i,inlineToolbar:s,wrapperClassName:l,autocompleters:a,onReplace:c,placeholder:u,allowedFormats:f,withoutInteractiveFormatting:b,onRemove:k,onMerge:v,onSplit:y,__unstableOnSplitAtEnd:x,__unstableOnSplitAtDoubleLineEnd:S,identifier:w,preserveWhiteSpace:B,__unstablePastePlainText:j,__unstableEmbedURLOnPaste:M,__unstableDisableFormats:P,disableLineBreaks:R,__unstableAllowPrefixTransformations:A,readOnly:N,...L},D){L=FR(L),y&&I()("wp.blockEditor.RichText onSplit prop",{since:"6.4",alternative:'block.json support key: "splitting"'});const O=(0,m.useInstanceId)(HR),z=(0,h.useRef)(),V=C(),{clientId:H,isSelected:U}=V,G=V[_],$=(0,h.useContext)(sv),{bindableAttributes:W}=(0,h.useContext)(pv),K=(0,g.useRegistry)(),{selectionStart:Z,selectionEnd:q,isSelected:Y,isContentOnly:X}=(0,g.useSelect)((e=>{if(!U)return{isSelected:!1};const{getSelectionStart:t,getSelectionEnd:n,getBlockEditingMode:o}=e(ji),i=t(),s=n();let l;return void 0===r?l=i.clientId===H&&s.clientId===H&&(w?i.attributeKey===w:i[VR]===O):r&&(l=i.clientId===H),{selectionStart:l?i.offset:void 0,selectionEnd:l?s.offset:void 0,isSelected:l,isContentOnly:"contentOnly"===o(H)}}),[H,w,O,r,U]),{disableBoundBlock:Q,bindingsPlaceholder:J,bindingsLabel:ee}=(0,g.useSelect)((e=>{if(!G?.[w]||!W)return{};const t=G[w],o=(0,p.getBlockBindingsSource)(t.source),r={};if(o?.usesContext?.length)for(const e of o.usesContext)r[e]=$[e];const i=!o?.canUserEditValue?.({select:e,context:r,args:t.args});if(n.length>0)return{disableBoundBlock:i,bindingsPlaceholder:null,bindingsLabel:null};const{getBlockAttributes:s}=e(ji),l=s(H);let a=null;if(o?.getFieldsList){const n=o.getFieldsList({select:e,context:r});a=n?.find((e=>E()(e.args,t?.args)))?.label}const c=a??o?.label,u=i?c:(0,T.sprintf)((0,T.__)("Add %s"),c),d=i?t?.args?.key||o?.label:(0,T.sprintf)((0,T.__)("Empty %s; start writing to edit its value"),t?.args?.key||o?.label);return{disableBoundBlock:i,bindingsPlaceholder:l?.placeholder||u,bindingsLabel:d}}),[G,w,W,n,H,$]),te=N||Q||!!$?.["pattern/overrides"]&&!("core/pattern-overrides"===G?.__default?.source),{getSelectionStart:ne,getSelectionEnd:oe,getBlockRootClientId:re}=(0,g.useSelect)(ji),{selectionChange:ie}=(0,g.useDispatch)(ji),se=jR({allowedFormats:f,disableFormats:P}),le=!se||se.length>0,ae=(0,h.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t,r={clientId:H,[w?"attributeKey":VR]:w||O};if("number"==typeof e||o){if(void 0===t&&re(H)!==re(oe().clientId))return;n.start={...r,offset:e}}if("number"==typeof t||o){if(void 0===e&&re(H)!==re(ne().clientId))return;n.end={...r,offset:t}}ie(n)}),[H,re,oe,ne,w,O,ie]),{formatTypes:ce,prepareHandlers:ue,valueHandlers:de,changeHandlers:he,dependencies:ge}=function({clientId:e,identifier:t,allowedFormats:n,withoutInteractiveFormatting:o,disableNoneEssentialFormatting:r=!1}){const i=(0,g.useSelect)(yR,[]),s=(0,h.useMemo)((()=>i.filter((({name:e,interactive:t,tagName:i,[F]:s})=>!(n&&!n.includes(e)||r&&!s||o&&(t||xR.has(i)))))),[i,n,r,o]),l=(0,g.useSelect)((n=>s.reduce(((o,r)=>r.__experimentalGetPropsForEditableTreePreparation?{...o,...SR(r.__experimentalGetPropsForEditableTreePreparation(n,{richTextIdentifier:t,blockClientId:e}),r.name)}:o),{})),[s,e,t]),a=(0,g.useDispatch)(),c=[],u=[],d=[],p=[];for(const e in l)p.push(l[e]);return s.forEach((n=>{if(n.__experimentalCreatePrepareEditableTree){const o=n.__experimentalCreatePrepareEditableTree(wR(l,n.name),{richTextIdentifier:t,blockClientId:e});n.__experimentalCreateOnChangeEditableValue?u.push(o):c.push(o)}if(n.__experimentalCreateOnChangeEditableValue){let o={};n.__experimentalGetPropsForEditableTreeChangeHandler&&(o=n.__experimentalGetPropsForEditableTreeChangeHandler(a,{richTextIdentifier:t,blockClientId:e}));const r=wR(l,n.name);d.push(n.__experimentalCreateOnChangeEditableValue({..."object"==typeof r?r:{},...o},{richTextIdentifier:t,blockClientId:e}))}})),{formatTypes:s,prepareHandlers:c,valueHandlers:u,changeHandlers:d,dependencies:p}}({clientId:H,identifier:w,allowedFormats:se,withoutInteractiveFormatting:b,disableNoneEssentialFormatting:X});function me(e){return ce.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,pe.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:fe,getValue:be,onChange:ke,ref:ve}=(0,pe.__unstableUseRichText)({value:n,onChange(e,{__unstableFormats:t,__unstableText:n}){o(e),Object.values(he).forEach((e=>{e(t,n)}))},selectionStart:Z,selectionEnd:q,onSelectionChange:ae,placeholder:J||u,__unstableIsSelected:Y,__unstableDisableFormats:P,preserveWhiteSpace:B,__unstableDependencies:[...ge,t],__unstableAfterParse:function(e){return de.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:me,__unstableAddInvisibleFormats:function(e){return ue.reduce(((t,n)=>n(t,e.text)),e.formats)}}),_e=function(e){return(0,ws.__unstableUseAutocompleteProps)({...e,completers:bj(e)})}({onReplace:c,completers:a,record:fe,onChange:ke});!function({html:e,value:t}){const n=(0,h.useRef)(),o=!!t.activeFormats?.length,{__unstableMarkLastChangeAsPersistent:r}=(0,g.useDispatch)(ji);(0,h.useLayoutEffect)((()=>{if(n.current){if(n.current!==t.text){const e=window.setTimeout((()=>{r()}),1e3);return n.current=t.text,()=>{window.clearTimeout(e)}}r()}else n.current=t.text}),[e,o])}({html:n,value:fe});const ye=(0,h.useRef)(new Set),xe=(0,h.useRef)(new Set);function Se(){z.current?.focus()}const we=t;return(0,d.jsxs)(d.Fragment,{children:[Y&&(0,d.jsx)(OR.Provider,{value:ye,children:(0,d.jsx)(zR.Provider,{value:xe,children:(0,d.jsxs)(ws.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after",children:[e&&e({value:fe,onChange:ke,onFocus:Se}),(0,d.jsx)(AR,{value:fe,onChange:ke,onFocus:Se,formatTypes:ce,forwardedRef:z})]})})}),Y&&le&&(0,d.jsx)(_R,{inline:s,editableContentElement:z.current}),(0,d.jsx)(we,{role:"textbox","aria-multiline":!R,"aria-readonly":te,...L,draggable:void 0,"aria-label":ee||L["aria-label"]||u,..._e,ref:(0,m.useMergeRefs)([ve,D,_e.ref,L.ref,TR({registry:K,getValue:be,onChange:ke,__unstableAllowPrefixTransformations:A,formatTypes:ce,onReplace:c,selectionChange:ie,isSelected:Y,disableFormats:P,value:fe,tagName:t,onSplit:y,__unstableEmbedURLOnPaste:M,pastePlainText:j,onMerge:v,onRemove:k,removeEditorOnlyFormats:me,disableLineBreaks:R,onSplitAtEnd:x,onSplitAtDoubleLineEnd:S,keyboardShortcuts:ye,inputEvents:xe}),z]),contentEditable:!te,suppressContentEditableWarning:!0,className:ms("block-editor-rich-text__editable",L.className,"rich-text"),tabIndex:0!==L.tabIndex||te?L.tabIndex:null,"data-wp-block-attribute-key":w})]})}const UR=(GR=(0,h.forwardRef)(HR),(0,h.forwardRef)(((e,t)=>{let n=e.value,o=e.onChange;Array.isArray(n)&&(I()("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),n=p.children.toHTML(e.value),o=t=>e.onChange(p.children.fromDOM((0,pe.__unstableCreateElement)(document,t).childNodes)));const r=e.multiline?DR:GR;return(0,d.jsx)(r,{...e,value:n,onChange:o,ref:t})})));var GR;UR.Content=LR,UR.isEmpty=e=>!e||0===e.length;const $R=(0,h.forwardRef)(((e,t)=>{if(C()[y]){const{children:n,tagName:o="div",value:r,onChange:i,isSelected:s,multiline:l,inlineToolbar:a,wrapperClassName:c,autocompleters:u,onReplace:p,placeholder:h,allowedFormats:g,withoutInteractiveFormatting:m,onRemove:f,onMerge:b,onSplit:k,__unstableOnSplitAtEnd:v,__unstableOnSplitAtDoubleLineEnd:_,identifier:y,preserveWhiteSpace:x,__unstablePastePlainText:S,__unstableEmbedURLOnPaste:w,__unstableDisableFormats:C,disableLineBreaks:B,__unstableAllowPrefixTransformations:I,readOnly:j,...E}=FR(e);return(0,d.jsx)(o,{ref:t,...E,dangerouslySetInnerHTML:{__html:NR(r,l)}})}return(0,d.jsx)(UR,{ref:t,...e,readOnly:!1})}));$R.Content=LR,$R.isEmpty=e=>!e||0===e.length;var WR=$R;const KR=(0,h.forwardRef)(((e,t)=>(0,d.jsx)(WR,{ref:t,...e,__unstableDisableFormats:!0})));KR.Content=({value:e="",tagName:t="div",...n})=>(0,d.jsx)(t,{...n,children:e});var ZR=KR;var qR=(0,h.forwardRef)((({__experimentalVersion:e,...t},n)=>{if(2===e)return(0,d.jsx)(ZR,{ref:n,...t});const{className:o,onChange:r,...i}=t;return(0,d.jsx)(Ev.A,{ref:n,className:ms("block-editor-plain-text",o),onChange:e=>r(e.target.value),...i})}));function YR({property:e,viewport:t,desc:n}){const o=(0,m.useInstanceId)(YR),r=n||(0,T.sprintf)((0,T._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),e,t.label);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{"aria-describedby":`rbc-desc-${o}`,children:t.label}),(0,d.jsx)(ws.VisuallyHidden,{as:"span",id:`rbc-desc-${o}`,children:r})]})}var XR=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:i,renderResponsiveControls:s,isResponsive:l=!1,defaultLabel:a={id:"all",label:(0,T._x)("All","screen sizes")},viewports:c=[{id:"small",label:(0,T.__)("Small screens")},{id:"medium",label:(0,T.__)("Medium screens")},{id:"large",label:(0,T.__)("Large screens")}]}=e;if(!t||!n||!i)return null;const u=o||(0,T.sprintf)((0,T.__)("Use the same %s on all screen sizes."),n),p=(0,T.__)("Choose whether to use the same value for all screen sizes or a unique value for each screen size."),g=i((0,d.jsx)(YR,{property:n,viewport:a}),a);return(0,d.jsxs)("fieldset",{className:"block-editor-responsive-block-control",children:[(0,d.jsx)("legend",{className:"block-editor-responsive-block-control__title",children:t}),(0,d.jsxs)("div",{className:"block-editor-responsive-block-control__inner",children:[(0,d.jsx)(ws.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-responsive-block-control__toggle",label:u,checked:!l,onChange:r,help:p}),(0,d.jsxs)("div",{className:ms("block-editor-responsive-block-control__group",{"is-responsive":l}),children:[!l&&g,l&&(s?s(c):c.map((e=>(0,d.jsx)(h.Fragment,{children:i((0,d.jsx)(YR,{property:n,viewport:e}),e)},e.id))))]})]})]})};function QR({character:e,type:t,onUse:n}){const o=(0,h.useContext)(OR),r=(0,h.useRef)();return r.current=n,(0,h.useEffect)((()=>{function n(n){Wa.isKeyboardEvent[t](n,e)&&(r.current(),n.preventDefault())}return o.current.add(n),()=>{o.current.delete(n)}}),[e,t]),null}function JR({name:e,shortcutType:t,shortcutCharacter:n,...o}){let r,i="RichText.ToolbarControls";return e&&(i+=`.${e}`),t&&n&&(r=Wa.displayShortcut[t](n)),(0,d.jsx)(ws.Fill,{name:i,children:(0,d.jsx)(ws.ToolbarButton,{...o,shortcut:r})})}function eA({inputType:e,onInput:t}){const n=(0,h.useContext)(zR),o=(0,h.useRef)();return o.current=t,(0,h.useEffect)((()=>{function t(t){t.inputType===e&&(o.current(),t.preventDefault())}return n.current.add(t),()=>{n.current.delete(t)}}),[e]),null}function tA({units:e,...t}){const[n]=Ti("spacing.units"),o=(0,ws.__experimentalUseCustomUnits)({availableUnits:n||["%","px","em","rem","vw"],units:e});return(0,d.jsx)(ws.__experimentalUnitControl,{units:o,...t})}var nA=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})});var oA=function({url:e,onChange:t}){const[n,o]=(0,h.useReducer)((e=>!e),!1);return(0,d.jsxs)("div",{className:"block-editor-url-input__button",children:[(0,d.jsx)(ws.Button,{size:"compact",icon:Ld,label:e?(0,T.__)("Edit link"):(0,T.__)("Insert link"),onClick:o,className:"components-toolbar__control",isPressed:!!e}),n&&(0,d.jsx)("form",{className:"block-editor-url-input__button-modal",onSubmit:e=>{e.preventDefault(),o()},children:(0,d.jsxs)("div",{className:"block-editor-url-input__button-modal-line",children:[(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,className:"block-editor-url-input__back",icon:nA,label:(0,T.__)("Close"),onClick:o}),(0,d.jsx)(ac,{value:e||"",onChange:t,suffix:(0,d.jsx)(ws.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,d.jsx)(ws.Button,{size:"small",icon:tc,label:(0,T.__)("Submit"),type:"submit"})})})]})})]})},rA=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})});const iA="none",sA="custom",lA="media",aA="attachment",cA=["noreferrer","noopener"],uA=({linkDestination:e,onChangeUrl:t,url:n,mediaType:o="image",mediaUrl:r,mediaLink:i,linkTarget:s,linkClass:l,rel:a,showLightboxSetting:c,lightboxEnabled:u,onSetLightbox:p,resetLightbox:g})=>{const[m,f]=(0,h.useState)(!1),[b,k]=(0,h.useState)(null),[v,_]=(0,h.useState)(!1),[y,x]=(0,h.useState)(null),S=(0,h.useRef)(null),w=(0,h.useRef)();(0,h.useEffect)((()=>{if(!w.current)return;(Ga.focus.focusable.find(w.current)[0]||w.current).focus()}),[v,n,u]);const C=()=>{e!==lA&&e!==aA||x(""),_(!0)},B=()=>{_(!1)},I=()=>{const e=[{linkDestination:lA,title:(0,T.__)("Link to image file"),url:"image"===o?r:void 0,icon:rA}];return"image"===o&&i&&e.push({linkDestination:aA,title:(0,T.__)("Link to attachment page"),url:"image"===o?i:void 0,icon:pc}),e},j=(0,d.jsxs)(ws.__experimentalVStack,{spacing:"3",children:[(0,d.jsx)(ws.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Open in new tab"),onChange:e=>{const n=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(a??"").split(" ");cA.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(a??"").split(" ").filter((e=>!1===cA.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);t(n)},checked:"_blank"===s}),(0,d.jsx)(ws.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,T.__)("Link relation"),value:a??"",onChange:e=>{t({rel:e})},help:(0,h.createInterpolateElement)((0,T.__)("The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document."),{a:(0,d.jsx)(ws.ExternalLink,{href:"https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"})})}),(0,d.jsx)(ws.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,T.__)("Link CSS class"),value:l||"",onChange:e=>{t({linkClass:e})}})]}),E=null!==y?y:n,M=!u||u&&!c,P=!E&&M,R=(I().find((t=>t.linkDestination===e))||{}).title;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ws.ToolbarButton,{icon:Ld,className:"components-toolbar__control",label:(0,T.__)("Link"),"aria-expanded":m,onClick:()=>{f(!0)},ref:k,isActive:!!n||u&&c}),m&&(0,d.jsx)(dR,{ref:w,anchor:b,onFocusOutside:e=>{const t=S.current;t&&t.contains(e.target)||(f(!1),x(null),B())},onClose:()=>{x(null),B(),f(!1)},renderSettings:M?()=>j:null,additionalControls:P&&(0,d.jsxs)(ws.NavigableMenu,{children:[I().map((e=>(0,d.jsx)(ws.MenuItem,{icon:e.icon,iconPosition:"left",onClick:()=>{x(null),(e=>{const n=I();let o;o=e?(n.find((t=>t.url===e))||{linkDestination:sA}).linkDestination:iA,t({linkDestination:o,href:e})})(e.url),B()},children:e.title},e.linkDestination))),c&&(0,d.jsx)(ws.MenuItem,{className:"block-editor-url-popover__expand-on-click",icon:vj,info:(0,T.__)("Scale the image with a lightbox effect."),iconPosition:"left",onClick:()=>{x(null),t({linkDestination:iA,href:""}),p?.(!0),B()},children:(0,T.__)("Enlarge on click")},"expand-on-click")]}),offset:13,children:u&&c&&!n&&!v?(0,d.jsxs)("div",{className:"block-editor-url-popover__expand-on-click",children:[(0,d.jsx)(Ol,{icon:vj}),(0,d.jsxs)("div",{className:"text",children:[(0,d.jsx)("p",{children:(0,T.__)("Enlarge on click")}),(0,d.jsx)("p",{className:"description",children:(0,T.__)("Scales the image with a lightbox effect")})]}),(0,d.jsx)(ws.Button,{icon:ec,label:(0,T.__)("Disable enlarge on click"),onClick:()=>{p?.(!1)},size:"compact"})]}):!n||v?(0,d.jsx)(dR.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:E,onChangeInputValue:x,onSubmit:e=>{if(y){const e=I().find((e=>e.url===y))?.linkDestination||sA;t({href:(0,Ua.prependHTTP)(y),linkDestination:e,lightbox:{enabled:!1}})}B(),x(null),e.preventDefault()},autocompleteRef:S}):n&&!v?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(dR.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:C,urlLabel:R}),(0,d.jsx)(ws.Button,{icon:ec,label:(0,T.__)("Remove link"),onClick:()=>{t({linkDestination:iA,href:""}),g?.()},size:"compact"})]}):void 0})]})};function dA(){return I()("wp.blockEditor.PreviewOptions",{version:"6.5"}),null}function pA(e){const[t,n]=(0,h.useState)(window.innerWidth);(0,h.useEffect)((()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e]);const o=e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=360;break;default:return null}return n<t?n:t};return(e=>{const t="Mobile"===e?"768px":"1024px",n="40px",r="auto";switch(e){case"Tablet":case"Mobile":return{width:o(e),marginTop:n,marginBottom:n,marginLeft:r,marginRight:r,height:t,overflowY:"auto"};default:return{marginLeft:r,marginRight:r}}})(e)}function hA({clientId:e}){const{updateBlockAttributes:t}=(0,g.useDispatch)(ji),{attributes:n}=(0,g.useSelect)((t=>({attributes:t(ji).getBlockAttributes(e)})),[e]);return n?.metadata?.patternName?(0,d.jsx)(ws.Button,{className:"block-editor-block-inspector-edit-contents-button",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{const{patternName:o,...r}=n?.metadata??{};t(e,{...n,metadata:r})},children:(0,T.__)("Edit contents")}):null}function gA(){const e=(0,g.useSelect)((e=>e(ji).getBlockSelectionStart()),[]),t=(0,h.useRef)();fh(e,t);return e?(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current?.focus()},children:(0,T.__)("Skip to the selected block")}):null}function mA(){const e=(0,g.useSelect)((e=>e(ji).getSelectedBlockCount()),[]);return(0,d.jsxs)(ws.__experimentalHStack,{justify:"flex-start",spacing:2,className:"block-editor-multi-selection-inspector__card",children:[(0,d.jsx)(Vu,{icon:qj,showColors:!0}),(0,d.jsx)("div",{className:"block-editor-multi-selection-inspector__card-title",children:(0,T.sprintf)((0,T._n)("%d Block","%d Blocks",e),e)})]})}var fA=(0,d.jsx)(ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(ue.Path,{fillRule:"evenodd",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",clipRule:"evenodd"})}),bA=(0,d.jsx)(ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)(ue.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z"})});const kA={name:"settings",title:(0,T.__)("Settings"),value:"settings",icon:fA},vA={name:"styles",title:(0,T.__)("Styles"),value:"styles",icon:bA},_A={name:"content",title:(0,T.__)("Content"),value:"content",icon:pc},yA={name:"list",title:(0,T.__)("List View"),value:"list-view",icon:nM};var xA=()=>{const e=(0,ws.__experimentalUseSlotFills)(Va.slotName),t=(0,ws.__experimentalUseSlotFills)(Pa.name),n=Boolean(e&&e.length),o=Boolean(t&&t.length);return n||o?(0,d.jsxs)(ws.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,T.__)("Advanced"),initialOpen:!1,children:[(0,d.jsx)(Fa.Slot,{group:"advanced"}),(0,d.jsx)(Pa.Slot,{})]}):null};const SA=()=>{const{selectedClientIds:e,selectedBlocks:t,hasPositionAttribute:n}=(0,g.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:n}=e(ji),o=n(),r=t(o);return{selectedClientIds:o,selectedBlocks:r,hasPositionAttribute:r?.some((({attributes:e})=>!!e?.style?.position?.type))}}),[]),{updateBlockAttributes:o}=(0,g.useDispatch)(ji),r=Ji();function i(){if(!e?.length||!t?.length)return;const n=Object.fromEntries(t?.map((({clientId:e,attributes:t})=>[e,{style:fs({...t?.style,position:{...t?.style?.position,type:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0}})}])));o(e,n,!0)}return(0,d.jsx)(ws.__experimentalToolsPanel,{className:"block-editor-block-inspector__position",label:(0,T.__)("Position"),resetAll:i,dropdownMenuProps:r,children:(0,d.jsx)(ws.__experimentalToolsPanelItem,{isShownByDefault:n,label:(0,T.__)("Position"),hasValue:()=>n,onDeselect:i,children:(0,d.jsx)(Fa.Slot,{group:"position"})})})};var wA=()=>{const e=(0,ws.__experimentalUseSlotFills)(Ma.position.name);return Boolean(e&&e.length)?(0,d.jsx)(SA,{}):null};var CA=({showAdvancedControls:e=!1})=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Fa.Slot,{}),(0,d.jsx)(wA,{}),(0,d.jsx)(Fa.Slot,{group:"bindings"}),e&&(0,d.jsx)("div",{children:(0,d.jsx)(xA,{})})]});var BA=({blockName:e,clientId:t,hasBlockStyles:n,isSectionBlock:o})=>{const r=Ap({blockName:e});return(0,d.jsxs)(d.Fragment,{children:[n&&(0,d.jsx)("div",{children:(0,d.jsx)(ws.PanelBody,{title:(0,T.__)("Styles"),children:(0,d.jsx)(VM,{clientId:t})})}),!o&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Fa.Slot,{group:"color",label:(0,T.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,d.jsx)(Fa.Slot,{group:"background",label:(0,T.__)("Background image")}),(0,d.jsx)(Fa.Slot,{group:"filter"}),(0,d.jsx)(Fa.Slot,{group:"typography",label:(0,T.__)("Typography")}),(0,d.jsx)(Fa.Slot,{group:"dimensions",label:(0,T.__)("Dimensions")}),(0,d.jsx)(Fa.Slot,{group:"border",label:r}),(0,d.jsx)(Fa.Slot,{group:"styles"})]})]})};function IA({clientIds:e,onSelect:t}){return e.length?(0,d.jsx)(ws.__experimentalVStack,{spacing:1,children:e.map((e=>(0,d.jsx)(jA,{onSelect:t,clientId:e},e)))}):null}function jA({clientId:e,onSelect:t}){const n=Xf(e),o=Sj({clientId:e,context:"list-view"}),{isSelected:r}=(0,g.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=t(ji);return{isSelected:n(e)||o(e,!0)}}),[e]),{selectBlock:i}=(0,g.useDispatch)(ji);return(0,d.jsx)(ws.Button,{__next40pxDefaultSize:!0,isPressed:r,onClick:async()=>{await i(e),t&&t(e)},children:(0,d.jsxs)(ws.Flex,{children:[(0,d.jsx)(ws.FlexItem,{children:(0,d.jsx)(Vu,{icon:n?.icon})}),(0,d.jsx)(ws.FlexBlock,{style:{textAlign:"left"},children:(0,d.jsx)(ws.__experimentalTruncate,{children:o})})]})})}var EA=({contentClientIds:e})=>e&&0!==e.length?(0,d.jsx)(ws.PanelBody,{title:(0,T.__)("Content"),children:(0,d.jsx)(IA,{clientIds:e})}):null;const TA=["core/navigation"];var MA=e=>!TA.includes(e);const{Tabs:PA}=G(ws.privateApis);function RA({blockName:e,clientId:t,hasBlockStyles:n,tabs:o,isSectionBlock:r,contentClientIds:i}){const s=(0,g.useSelect)((e=>e(hr.store).get("core","showIconLabels")),[]),l=MA(e)?void 0:yA.name,[a,c]=(0,h.useState)(l??o[0]?.name);return(0,h.useEffect)((()=>{if(!l&&o?.length&&a){o.find((e=>e.name===a))||c(o[0].name)}}),[o,a,l]),(0,d.jsx)("div",{className:"block-editor-block-inspector__tabs",children:(0,d.jsxs)(PA,{defaultTabId:l,selectedTabId:a,onSelect:c,children:[(0,d.jsx)(PA.TabList,{children:o.map((e=>s?(0,d.jsx)(PA.Tab,{tabId:e.name,children:e.title},e.name):(0,d.jsx)(ws.Tooltip,{text:e.title,children:(0,d.jsx)(PA.Tab,{tabId:e.name,"aria-label":e.title,children:(0,d.jsx)(ws.Icon,{icon:e.icon})})},e.name)))}),(0,d.jsx)(PA.TabPanel,{tabId:kA.name,focusable:!1,children:(0,d.jsx)(CA,{showAdvancedControls:!!e})}),(0,d.jsx)(PA.TabPanel,{tabId:vA.name,focusable:!1,children:(0,d.jsx)(BA,{blockName:e,clientId:t,hasBlockStyles:n,isSectionBlock:r})}),(0,d.jsx)(PA.TabPanel,{tabId:_A.name,focusable:!1,children:(0,d.jsx)(EA,{contentClientIds:i})}),(0,d.jsx)(PA.TabPanel,{tabId:yA.name,focusable:!1,children:(0,d.jsx)(Fa.Slot,{group:"list"})})]},t)})}const AA=[];function NA({clientId:e}){return(0,d.jsx)(ws.PanelBody,{title:(0,T.__)("Styles"),children:(0,d.jsx)(VM,{clientId:e})})}function LA({blockName:e,showAdvancedControls:t=!0,showPositionControls:n=!0,showListControls:o=!1,showBindingsControls:r=!0}){const i=Ap({blockName:e});return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Fa.Slot,{}),o&&(0,d.jsx)(Fa.Slot,{group:"list"}),(0,d.jsx)(Fa.Slot,{group:"color",label:(0,T.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,d.jsx)(Fa.Slot,{group:"background",label:(0,T.__)("Background image")}),(0,d.jsx)(Fa.Slot,{group:"typography",label:(0,T.__)("Typography")}),(0,d.jsx)(Fa.Slot,{group:"dimensions",label:(0,T.__)("Dimensions")}),(0,d.jsx)(Fa.Slot,{group:"border",label:i}),(0,d.jsx)(Fa.Slot,{group:"styles"}),n&&(0,d.jsx)(wA,{}),r&&(0,d.jsx)(Fa.Slot,{group:"bindings"}),t&&(0,d.jsx)("div",{children:(0,d.jsx)(xA,{})})]})}const DA=({animate:e,wrapper:t,children:n})=>e?t(n):n,OA=({blockInspectorAnimationSettings:e,selectedBlockClientId:t,children:n})=>{const o=e&&"leftToRight"===e.enterDirection?-50:50;return(0,d.jsx)(ws.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:o,opacity:0},children:n},t)},zA=({clientId:e,blockName:t,isSectionBlock:n,availableTabs:o,contentClientIds:r,hasBlockStyles:i})=>{const s=o?.length>1,l=Xf(e),a=l.isSynced,c=!a&&s;return(0,d.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,d.jsx)(Xb,{...l,className:a&&"is-synced",allowParentNavigation:!0,children:window?.__experimentalContentOnlyPatternInsertion&&(0,d.jsx)(hA,{clientId:e})}),(0,d.jsx)(lP,{blockClientId:e}),c&&(0,d.jsx)(RA,{hasBlockStyles:i,clientId:e,blockName:t,tabs:o,isSectionBlock:n,contentClientIds:r}),!c&&(0,d.jsxs)(d.Fragment,{children:[i&&(0,d.jsx)(NA,{clientId:e}),(0,d.jsx)(EA,{contentClientIds:r}),!n&&(0,d.jsx)(LA,{blockName:t,showListControls:!0})]}),(0,d.jsx)(gA,{},"back")]})};var VA=function(){const{selectedBlockCount:e,selectedBlockName:t,selectedBlockClientId:n,blockType:o,isSectionBlock:r,isSectionBlockInSelection:i,hasBlockStyles:s}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockClientIds:n,getSelectedBlockCount:o,getBlockName:r,getParentSectionBlock:i,isSectionBlock:s}=G(e(ji)),{getBlockStyles:l}=e(p.store),a=t(),c=i(a)||a,u=c&&r(c),d=u&&(0,p.getBlockType)(u),h=n().some((e=>s(e))),g=u&&l(u),m=g&&g.length>0;return{selectedBlockCount:o(),selectedBlockClientId:c,selectedBlockName:u,blockType:d,isSectionBlockInSelection:h,isSectionBlock:s(c),hasBlockStyles:m}}),[]),l=(0,g.useSelect)((e=>{if(!r||!n)return[];const{getClientIdsOfDescendants:t,getBlockName:o,getBlockEditingMode:i}=G(e(ji)),s=t(n),l=new Set;return s.forEach((e=>{if("core/navigation"===o(e)){t(e).forEach((e=>l.add(e)))}})),s.filter((e=>!l.has(e)&&("core/list-item"!==o(e)&&"contentOnly"===i(e))))}),[r,n]),a=function(e,t,n,o){const r=[],{bindings:i,border:s,color:l,default:a,dimensions:c,list:u,position:d,styles:p,typography:h,effects:m}=Ma,f=MA(e),b=(0,ws.__experimentalUseSlotFills)(u.name),k=!f&&!!b&&b.length,v=[...(0,ws.__experimentalUseSlotFills)(s.name)||[],...(0,ws.__experimentalUseSlotFills)(l.name)||[],...(0,ws.__experimentalUseSlotFills)(c.name)||[],...(0,ws.__experimentalUseSlotFills)(p.name)||[],...(0,ws.__experimentalUseSlotFills)(h.name)||[],...(0,ws.__experimentalUseSlotFills)(m.name)||[]].length,_=[...(0,ws.__experimentalUseSlotFills)(Va.slotName)||[],...(0,ws.__experimentalUseSlotFills)(i.name)||[]],y=[...(0,ws.__experimentalUseSlotFills)(a.name)||[],...(0,ws.__experimentalUseSlotFills)(d.name)||[],...k&&v>1?_:[]],x=!!(t&&t.length>0);k&&!n&&r.push(yA),x&&r.push(_A),y.length&&!n&&r.push(kA),(n?o:v)&&r.push(vA);return function(e,t={}){return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,g.useSelect)((e=>e(ji).getSettings().blockInspectorTabs),[]))?r:AA}(o?.name,l,r,s),c=a?.length>1,u=function(e){return(0,g.useSelect)((t=>{if(e){const n=t(ji).getSettings().blockInspectorAnimation,o=n?.animationParent,{getSelectedBlockClientId:r,getBlockParentsByBlockName:i}=t(ji);return i(r(),o,!0)[0]||e.name===o?n?.[e.name]:null}return null}),[e])}(o),h=e>1;if(h&&!i)return(0,d.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,d.jsx)(mA,{}),c?(0,d.jsx)(RA,{tabs:a}):(0,d.jsx)(LA,{blockName:t,showAdvancedControls:!1,showPositionControls:!1,showBindingsControls:!1})]});if(h&&i)return(0,d.jsx)("div",{className:"block-editor-block-inspector",children:(0,d.jsx)(mA,{})});const m=t===(0,p.getUnregisteredTypeHandlerName)();return!o||!n||m?(0,d.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,T.__)("No block selected.")}):(0,d.jsx)(DA,{animate:u,wrapper:e=>(0,d.jsx)(OA,{blockInspectorAnimationSettings:u,selectedBlockClientId:n,children:e}),children:(0,d.jsx)(zA,{clientId:n,blockName:o.name,isSectionBlock:r,availableTabs:a,contentClientIds:l,hasBlockStyles:s})})};const FA=()=>(I()("__unstableUseClipboardHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),Pw());function HA(e){return I()("CopyHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),(0,d.jsx)("div",{...e,ref:Pw()})}const UA=()=>{};const GA=(0,h.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r=!1,__experimentalInsertionIndex:i,__experimentalInitialTab:s,__experimentalInitialCategory:l,__experimentalFilterValue:a,onPatternCategorySelection:c,onSelect:u=UA,shouldFocusBlock:p=!1,onClose:h},m){const{destinationRootClientId:f}=(0,g.useSelect)((n=>{const{getBlockRootClientId:o}=n(ji);return{destinationRootClientId:e||o(t)||void 0}}),[t,e]);return(0,d.jsx)(nI,{onSelect:u,rootClientId:f,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r,__experimentalInsertionIndex:i,__experimentalFilterValue:a,onPatternCategorySelection:c,__experimentalInitialTab:s,__experimentalInitialCategory:l,shouldFocusBlock:p,ref:m,onClose:h})}));var $A=(0,h.forwardRef)((function(e,t){return(0,d.jsx)(GA,{...e,onPatternCategorySelection:void 0,ref:t})}));function WA(){return I()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const KA=-1!==window.navigator.userAgent.indexOf("Trident"),ZA=new Set([Wa.UP,Wa.DOWN,Wa.LEFT,Wa.RIGHT]),qA=.75;function YA(){const e=(0,g.useSelect)((e=>e(ji).hasSelectedBlock()),[]);return(0,m.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,i,s;function l(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function a(e){i&&o.cancelAnimationFrame(i),i=o.requestAnimationFrame((()=>{c(e),i=null}))}function c({keyCode:e}){if(!h())return;const r=(0,Ga.computeCaretRect)(o);if(!r)return;if(!s)return void(s=r);if(ZA.has(e))return void(s=r);const i=r.top-s.top;if(0===i)return;const l=(0,Ga.getScrollContainer)(t);if(!l)return;const a=l===n.body||l===n.documentElement,c=a?o.scrollY:l.scrollTop,u=a?0:l.getBoundingClientRect().top,d=a?s.top/o.innerHeight:(s.top-u)/(o.innerHeight-u);if(0===c&&d<qA&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(s=r);const p=a?o.innerHeight:l.clientHeight;s.top+s.height>u+p||s.top<u?s=r:a?o.scrollBy(0,i):l.scrollTop+=i}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){h()&&(s=(0,Ga.computeCaretRect)(o))}function h(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",l,!0),o.addEventListener("resize",l,!0),t.addEventListener("keydown",a),t.addEventListener("keyup",c),t.addEventListener("mousedown",u),t.addEventListener("touchstart",u),()=>{o.removeEventListener("scroll",l,!0),o.removeEventListener("resize",l,!0),t.removeEventListener("keydown",a),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(i)}}),[e])}var XA=KA?e=>e.children:function({children:e}){return(0,d.jsx)("div",{ref:YA(),className:"block-editor__typewriter",children:e})};const QA=(0,h.createContext)({});function JA({children:e,uniqueId:t,blockName:n=""}){const o=(0,h.useContext)(QA),{name:r}=C();n=n||r;const i=(0,h.useMemo)((()=>function(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}(o,n,t)),[o,n,t]);return(0,d.jsx)(QA.Provider,{value:i,children:e})}function eN(e,t=""){const n=(0,h.useContext)(QA),{name:o}=C();return t=t||o,Boolean(n[t]?.has(e))}QA.displayName="RenderedRefsContext";const tN=e=>(I()("wp.blockEditor.__experimentalRecursionProvider",{since:"6.5",alternative:"wp.blockEditor.RecursionProvider"}),(0,d.jsx)(JA,{...e})),nN=(...e)=>(I()("wp.blockEditor.__experimentalUseHasRecursion",{since:"6.5",alternative:"wp.blockEditor.useHasRecursion"}),eN(...e));function oN({title:e,help:t,actions:n=[],onClose:o}){return(0,d.jsxs)(ws.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4,children:[(0,d.jsxs)(ws.__experimentalHStack,{alignment:"center",children:[(0,d.jsx)(ws.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13,children:e}),(0,d.jsx)(ws.__experimentalSpacer,{}),n.map((({label:e,icon:t,onClick:n})=>(0,d.jsx)(ws.Button,{size:"small",className:"block-editor-inspector-popover-header__action",label:e,icon:t,variant:!t&&"tertiary",onClick:n,children:!t&&e},e))),o&&(0,d.jsx)(ws.Button,{size:"small",className:"block-editor-inspector-popover-header__action",label:(0,T.__)("Close"),icon:XB,onClick:o})]}),t&&(0,d.jsx)(ws.__experimentalText,{children:t})]})}const rN=(0,h.forwardRef)((function({onClose:e,onChange:t,showPopoverHeaderActions:n,isCompact:o,currentDate:r,title:i,...s},l){const a={startOfWeek:(0,dP.getSettings)().l10n.startOfWeek,onChange:t,currentDate:o?void 0:r,currentTime:o?r:void 0,...s},c=o?ws.TimePicker:ws.DateTimePicker;return(0,d.jsxs)("div",{ref:l,className:"block-editor-publish-date-time-picker",children:[(0,d.jsx)(oN,{title:i||(0,T.__)("Publish"),actions:n?[{label:(0,T.__)("Now"),onClick:()=>t?.(null)}]:void 0,onClose:e}),(0,d.jsx)(c,{...a})]})}));var iN=(0,h.forwardRef)((function(e,t){return(0,d.jsx)(rN,{...e,showPopoverHeaderActions:!0,isCompact:!1,ref:t})}));const sN={button:"wp-element-button",caption:"wp-element-caption"},lN=e=>sN[e]?sN[e]:"";var aN=()=>"";function cN(e,t,n){return"core/image"===e&&n?.lightbox?.allowEditing||!!t?.lightbox}function uN({onChange:e,value:t,inheritedValue:n,panelId:o}){const r=Ji(),i=()=>{e(void 0)};let s=!1;return n?.lightbox?.enabled&&(s=n.lightbox.enabled),(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(ws.__experimentalToolsPanel,{label:(0,T._x)("Settings","Image settings"),resetAll:i,panelId:o,dropdownMenuProps:r,children:(0,d.jsx)(ws.__experimentalToolsPanelItem,{hasValue:()=>!!t?.lightbox,label:(0,T.__)("Enlarge on click"),onDeselect:i,isShownByDefault:!0,panelId:o,children:(0,d.jsx)(ws.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Enlarge on click"),checked:s,onChange:t=>{e({enabled:t})}})})})})}function dN({value:e,onChange:t,inheritedValue:n=e}){const[o,r]=(0,h.useState)(null),i=n?.css;return(0,d.jsxs)(ws.__experimentalVStack,{spacing:3,children:[o&&(0,d.jsx)(ws.Notice,{status:"error",onRemove:()=>r(null),children:o}),(0,d.jsx)(ws.TextareaControl,{label:(0,T.__)("Additional CSS"),__nextHasNoMarginBottom:!0,value:i,onChange:n=>function(n){if(t({...e,css:n}),o){const[e]=lC([{css:n}],".for-validation-only");e&&r(null)}}(n),onBlur:function(e){if(!e?.target?.value)return void r(null);const[t]=lC([{css:e.target.value}],".for-validation-only");r(null===t?(0,T.__)("There is an error with your CSS structure."):null)},className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1})]})}const pN=new Map,hN=[],gN={caption:(0,T.__)("Caption"),link:(0,T.__)("Link"),button:(0,T.__)("Button"),heading:(0,T.__)("Heading"),h1:(0,T.__)("H1"),h2:(0,T.__)("H2"),h3:(0,T.__)("H3"),h4:(0,T.__)("H4"),h5:(0,T.__)("H5"),h6:(0,T.__)("H6"),"settings.color":(0,T.__)("Color"),"settings.typography":(0,T.__)("Typography"),"settings.shadow":(0,T.__)("Shadow"),"settings.layout":(0,T.__)("Layout"),"styles.color":(0,T.__)("Colors"),"styles.spacing":(0,T.__)("Spacing"),"styles.background":(0,T.__)("Background"),"styles.typography":(0,T.__)("Typography")},mN=function(e,t){var n,o,r=0;function i(){var i,s,l=n,a=arguments.length;e:for(;l;){if(l.args.length===arguments.length){for(s=0;s<a;s++)if(l.args[s]!==arguments[s]){l=l.next;continue e}return l!==n&&(l===o&&(o=l.prev),l.prev.next=l.next,l.next&&(l.next.prev=l.prev),l.next=n,l.prev=null,n.prev=l,n=l),l.val}l=l.next}for(i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return l={args:i,val:e.apply(null,i)},n?(n.prev=l,l.next=n):o=l,r===t.maxSize?(o=o.prev).next=null:r++,n=l,l.val}return t=t||{},i.clear=function(){n=null,o=null,r=0},i}((()=>(0,p.getBlockTypes)().reduce(((e,{name:t,title:n})=>(e[t]=n,e)),{}))),fN=e=>null!==e&&"object"==typeof e;function bN(e,t,n=""){if(!fN(e)&&!fN(t))return e!==t?n.split(".").slice(0,2).join("."):void 0;e=fN(e)?e:{},t=fN(t)?t:{};const o=new Set([...Object.keys(e),...Object.keys(t)]);let r=[];for(const i of o){const o=n?n+"."+i:i,s=bN(e[i],t[i],o);s&&(r=r.concat(s))}return r}function kN(e,t){const n=JSON.stringify({next:e,previous:t});if(pN.has(n))return pN.get(n);const o=bN({styles:{background:e?.styles?.background,color:e?.styles?.color,typography:e?.styles?.typography,spacing:e?.styles?.spacing},blocks:e?.styles?.blocks,elements:e?.styles?.elements,settings:e?.settings},{styles:{background:t?.styles?.background,color:t?.styles?.color,typography:t?.styles?.typography,spacing:t?.styles?.spacing},blocks:t?.styles?.blocks,elements:t?.styles?.elements,settings:t?.settings});if(!o.length)return pN.set(n,hN),hN;const r=[...new Set(o)].reduce(((e,t)=>{const n=function(e){if(gN[e])return gN[e];const t=e.split(".");if("blocks"===t?.[0]){const e=mN()?.[t[1]];return e||t[1]}return"elements"===t?.[0]?gN[t[1]]||t[1]:void 0}(t);return n&&e.push([t.split(".")[0],n]),e}),[]);return pN.set(n,r),r}function vN(e,t,n={}){let o=kN(e,t);const r=o.length,{maxResults:i}=n;return r?(i&&r>i&&(o=o.slice(0,i)),Object.entries(o.reduce(((e,t)=>{const n=e[t[0]]||[];return n.includes(t[1])||(e[t[0]]=[...n,t[1]]),e}),{})).map((([e,t])=>{const n=t.length,o=t.join((0,T.__)(", "));switch(e){case"blocks":return(0,T.sprintf)((0,T._n)("%s block.","%s blocks.",n),o);case"elements":return(0,T.sprintf)((0,T._n)("%s element.","%s elements.",n),o);case"settings":return(0,T.sprintf)((0,T.__)("%s settings."),o);case"styles":return(0,T.sprintf)((0,T.__)("%s styles."),o);default:return(0,T.sprintf)((0,T.__)("%s."),o)}}))):hN}function _N(e,t,n){if(null==e||!1===e)return;if(Array.isArray(e))return yN(e,t,n);switch(typeof e){case"string":case"number":return}const{type:o,props:r}=e;switch(o){case h.StrictMode:case h.Fragment:return yN(r.children,t,n);case h.RawHTML:return;case ew.Content:return xN(t,n);case LR:return void t.push(r.value)}switch(typeof o){case"string":return void 0!==r.children?yN(r.children,t,n):void 0;case"function":return _N(o.prototype&&"function"==typeof o.prototype.render?new o(r).render():o(r),t,n)}}function yN(e,...t){e=Array.isArray(e)?e:[e];for(let n=0;n<e.length;n++)_N(e[n],...t)}function xN(e,t){for(let n=0;n<t.length;n++){const{name:o,attributes:r,innerBlocks:i}=t[n];_N((0,p.getSaveElement)(o,r,(0,d.jsx)(ew.Content,{})),e,i)}}const SN=[{value:"fill",label:(0,T._x)("Fill","Scale option for dimensions control"),help:(0,T.__)("Fill the space by stretching the content.")},{value:"contain",label:(0,T._x)("Contain","Scale option for dimensions control"),help:(0,T.__)("Fit the content to the space without clipping.")},{value:"cover",label:(0,T._x)("Cover","Scale option for dimensions control"),help:(0,T.__)("Fill the space by clipping what doesn't fit.")},{value:"none",label:(0,T._x)("None","Scale option for dimensions control"),help:(0,T.__)("Do not adjust the sizing of the content. Content that is too large will be clipped, and content that is too small will have additional padding.")},{value:"scale-down",label:(0,T._x)("Scale down","Scale option for dimensions control"),help:(0,T.__)("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function wN({panelId:e,value:t,onChange:n,options:o=SN,defaultValue:r=SN[0].value,isShownByDefault:i=!0}){const s=t??"fill",l=(0,h.useMemo)((()=>o.reduce(((e,t)=>(e[t.value]=t.help,e)),{})),[o]);return(0,d.jsx)(ws.__experimentalToolsPanelItem,{label:(0,T.__)("Scale"),isShownByDefault:i,hasValue:()=>s!==r,onDeselect:()=>n(r),panelId:e,children:(0,d.jsx)(ws.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Scale"),isBlock:!0,help:l[s],value:s,onChange:n,size:"__unstable-large",children:o.map((e=>(0,d.jsx)(ws.__experimentalToggleGroupControlOption,{...e},e.value)))})})}function CN(){return CN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},CN.apply(null,arguments)}function BN(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var IN=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|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|enterKeyHint|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|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|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)-.*))$/,jN=BN((function(e){return IN.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));var EN=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){0}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),TN=Math.abs,MN=String.fromCharCode,PN=Object.assign;function RN(e){return e.trim()}function AN(e,t,n){return e.replace(t,n)}function NN(e,t){return e.indexOf(t)}function LN(e,t){return 0|e.charCodeAt(t)}function DN(e,t,n){return e.slice(t,n)}function ON(e){return e.length}function zN(e){return e.length}function VN(e,t){return t.push(e),e}var FN=1,HN=1,UN=0,GN=0,$N=0,WN="";function KN(e,t,n,o,r,i,s){return{value:e,root:t,parent:n,type:o,props:r,children:i,line:FN,column:HN,length:s,return:""}}function ZN(e,t){return PN(KN("",null,null,"",null,null,0),e,{length:-e.length},t)}function qN(){return $N=GN>0?LN(WN,--GN):0,HN--,10===$N&&(HN=1,FN--),$N}function YN(){return $N=GN<UN?LN(WN,GN++):0,HN++,10===$N&&(HN=1,FN++),$N}function XN(){return LN(WN,GN)}function QN(){return GN}function JN(e,t){return DN(WN,e,t)}function eL(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function tL(e){return FN=HN=1,UN=ON(WN=e),GN=0,[]}function nL(e){return WN="",e}function oL(e){return RN(JN(GN-1,sL(91===e?e+2:40===e?e+1:e)))}function rL(e){for(;($N=XN())&&$N<33;)YN();return eL(e)>2||eL($N)>3?"":" "}function iL(e,t){for(;--t&&YN()&&!($N<48||$N>102||$N>57&&$N<65||$N>70&&$N<97););return JN(e,QN()+(t<6&&32==XN()&&32==YN()))}function sL(e){for(;YN();)switch($N){case e:return GN;case 34:case 39:34!==e&&39!==e&&sL($N);break;case 40:41===e&&sL(e);break;case 92:YN()}return GN}function lL(e,t){for(;YN()&&e+$N!==57&&(e+$N!==84||47!==XN()););return"/*"+JN(t,GN-1)+"*"+MN(47===e?e:YN())}function aL(e){for(;!eL(XN());)YN();return JN(e,GN)}var cL="-ms-",uL="-moz-",dL="-webkit-",pL="comm",hL="rule",gL="decl",mL="@keyframes";function fL(e,t){for(var n="",o=zN(e),r=0;r<o;r++)n+=t(e[r],r,e,t)||"";return n}function bL(e,t,n,o){switch(e.type){case"@import":case gL:return e.return=e.return||e.value;case pL:return"";case mL:return e.return=e.value+"{"+fL(e.children,o)+"}";case hL:e.value=e.props.join(",")}return ON(n=fL(e.children,o))?e.return=e.value+"{"+n+"}":""}function kL(e){return nL(vL("",null,null,null,[""],e=tL(e),0,[0],e))}function vL(e,t,n,o,r,i,s,l,a){for(var c=0,u=0,d=s,p=0,h=0,g=0,m=1,f=1,b=1,k=0,v="",_=r,y=i,x=o,S=v;f;)switch(g=k,k=YN()){case 40:if(108!=g&&58==LN(S,d-1)){-1!=NN(S+=AN(oL(k),"&","&\f"),"&\f")&&(b=-1);break}case 34:case 39:case 91:S+=oL(k);break;case 9:case 10:case 13:case 32:S+=rL(g);break;case 92:S+=iL(QN()-1,7);continue;case 47:switch(XN()){case 42:case 47:VN(yL(lL(YN(),QN()),t,n),a);break;default:S+="/"}break;case 123*m:l[c++]=ON(S)*b;case 125*m:case 59:case 0:switch(k){case 0:case 125:f=0;case 59+u:h>0&&ON(S)-d&&VN(h>32?xL(S+";",o,n,d-1):xL(AN(S," ","")+";",o,n,d-2),a);break;case 59:S+=";";default:if(VN(x=_L(S,t,n,c,u,r,l,v,_=[],y=[],d),i),123===k)if(0===u)vL(S,t,x,x,_,i,d,l,y);else switch(99===p&&110===LN(S,3)?100:p){case 100:case 109:case 115:vL(e,x,x,o&&VN(_L(e,x,x,0,0,r,l,v,r,_=[],d),y),r,y,d,l,o?_:y);break;default:vL(S,x,x,x,[""],y,0,l,y)}}c=u=h=0,m=b=1,v=S="",d=s;break;case 58:d=1+ON(S),h=g;default:if(m<1)if(123==k)--m;else if(125==k&&0==m++&&125==qN())continue;switch(S+=MN(k),k*m){case 38:b=u>0?1:(S+="\f",-1);break;case 44:l[c++]=(ON(S)-1)*b,b=1;break;case 64:45===XN()&&(S+=oL(YN())),p=XN(),u=d=ON(v=S+=aL(QN())),k++;break;case 45:45===g&&2==ON(S)&&(m=0)}}return i}function _L(e,t,n,o,r,i,s,l,a,c,u){for(var d=r-1,p=0===r?i:[""],h=zN(p),g=0,m=0,f=0;g<o;++g)for(var b=0,k=DN(e,d+1,d=TN(m=s[g])),v=e;b<h;++b)(v=RN(m>0?p[b]+" "+k:AN(k,/&\f/g,p[b])))&&(a[f++]=v);return KN(e,t,n,0===r?hL:l,a,c,u)}function yL(e,t,n){return KN(e,t,n,pL,MN($N),DN(e,2,-2),0)}function xL(e,t,n,o){return KN(e,t,n,gL,DN(e,0,o),DN(e,o+1,-1),o)}var SL=function(e,t,n){for(var o=0,r=0;o=r,r=XN(),38===o&&12===r&&(t[n]=1),!eL(r);)YN();return JN(e,GN)},wL=function(e,t){return nL(function(e,t){var n=-1,o=44;do{switch(eL(o)){case 0:38===o&&12===XN()&&(t[n]=1),e[n]+=SL(GN-1,t,n);break;case 2:e[n]+=oL(o);break;case 4:if(44===o){e[++n]=58===XN()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=MN(o)}}while(o=YN());return e}(tL(e),t))},CL=new WeakMap,BL=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,o=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||CL.get(n))&&!o){CL.set(e,!0);for(var r=[],i=wL(t,r),s=n.props,l=0,a=0;l<i.length;l++)for(var c=0;c<s.length;c++,a++)e.props[a]=r[l]?i[l].replace(/&\f/g,s[c]):s[c]+" "+i[l]}}},IL=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function jL(e,t){switch(function(e,t){return 45^LN(e,0)?(((t<<2^LN(e,0))<<2^LN(e,1))<<2^LN(e,2))<<2^LN(e,3):0}(e,t)){case 5103:return dL+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return dL+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return dL+e+uL+e+cL+e+e;case 6828:case 4268:return dL+e+cL+e+e;case 6165:return dL+e+cL+"flex-"+e+e;case 5187:return dL+e+AN(e,/(\w+).+(:[^]+)/,dL+"box-$1$2"+cL+"flex-$1$2")+e;case 5443:return dL+e+cL+"flex-item-"+AN(e,/flex-|-self/,"")+e;case 4675:return dL+e+cL+"flex-line-pack"+AN(e,/align-content|flex-|-self/,"")+e;case 5548:return dL+e+cL+AN(e,"shrink","negative")+e;case 5292:return dL+e+cL+AN(e,"basis","preferred-size")+e;case 6060:return dL+"box-"+AN(e,"-grow","")+dL+e+cL+AN(e,"grow","positive")+e;case 4554:return dL+AN(e,/([^-])(transform)/g,"$1"+dL+"$2")+e;case 6187:return AN(AN(AN(e,/(zoom-|grab)/,dL+"$1"),/(image-set)/,dL+"$1"),e,"")+e;case 5495:case 3959:return AN(e,/(image-set\([^]*)/,dL+"$1$`$1");case 4968:return AN(AN(e,/(.+:)(flex-)?(.*)/,dL+"box-pack:$3"+cL+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+dL+e+e;case 4095:case 3583:case 4068:case 2532:return AN(e,/(.+)-inline(.+)/,dL+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ON(e)-1-t>6)switch(LN(e,t+1)){case 109:if(45!==LN(e,t+4))break;case 102:return AN(e,/(.+:)(.+)-([^]+)/,"$1"+dL+"$2-$3$1"+uL+(108==LN(e,t+3)?"$3":"$2-$3"))+e;case 115:return~NN(e,"stretch")?jL(AN(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==LN(e,t+1))break;case 6444:switch(LN(e,ON(e)-3-(~NN(e,"!important")&&10))){case 107:return AN(e,":",":"+dL)+e;case 101:return AN(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+dL+(45===LN(e,14)?"inline-":"")+"box$3$1"+dL+"$2$3$1"+cL+"$2box$3")+e}break;case 5936:switch(LN(e,t+11)){case 114:return dL+e+cL+AN(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return dL+e+cL+AN(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return dL+e+cL+AN(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return dL+e+cL+e+e}return e}var EL=[function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case gL:e.return=jL(e.value,e.length);break;case mL:return fL([ZN(e,{value:AN(e.value,"@","@"+dL)})],o);case hL:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return fL([ZN(e,{props:[AN(t,/:(read-\w+)/,":-moz-$1")]})],o);case"::placeholder":return fL([ZN(e,{props:[AN(t,/:(plac\w+)/,":"+dL+"input-$1")]}),ZN(e,{props:[AN(t,/:(plac\w+)/,":-moz-$1")]}),ZN(e,{props:[AN(t,/:(plac\w+)/,cL+"input-$1")]})],o)}return""}))}}];const TL=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var o=e.stylisPlugins||EL;var r,i,s={},l=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)s[t[n]]=!0;l.push(e)}));var a,c,u,d,p=[bL,(d=function(e){a.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],h=(c=[BL,IL].concat(o,p),u=zN(c),function(e,t,n,o){for(var r="",i=0;i<u;i++)r+=c[i](e,t,n,o)||"";return r});i=function(e,t,n,o){a=n,fL(kL(e?e+"{"+t.styles+"}":t.styles),h),o&&(g.inserted[t.name]=!0)};var g={key:t,sheet:new EN({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:i};return g.sheet.hydrate(l),g};const ML=function(e){for(var t,n=0,o=0,r=e.length;r>=4;++o,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)};const PL={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var RL=/[A-Z]|^ms/g,AL=/_EMO_([^_]+?)_([^]*?)_EMO_/g,NL=function(e){return 45===e.charCodeAt(1)},LL=function(e){return null!=e&&"boolean"!=typeof e},DL=BN((function(e){return NL(e)?e:e.replace(RL,"-$&").toLowerCase()})),OL=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(AL,(function(e,t,n){return VL={name:t,styles:n,next:VL},t}))}return 1===PL[e]||NL(e)||"number"!=typeof t||0===t?t:t+"px"};function zL(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return VL={name:n.name,styles:n.styles,next:VL},n.name;if(void 0!==n.styles){var o=n.next;if(void 0!==o)for(;void 0!==o;)VL={name:o.name,styles:o.styles,next:VL},o=o.next;return n.styles+";"}return function(e,t,n){var o="";if(Array.isArray(n))for(var r=0;r<n.length;r++)o+=zL(e,t,n[r])+";";else for(var i in n){var s=n[i];if("object"!=typeof s)null!=t&&void 0!==t[s]?o+=i+"{"+t[s]+"}":LL(s)&&(o+=DL(i)+":"+OL(i,s)+";");else if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var l=zL(e,t,s);switch(i){case"animation":case"animationName":o+=DL(i)+":"+l+";";break;default:o+=i+"{"+l+"}"}}else for(var a=0;a<s.length;a++)LL(s[a])&&(o+=DL(i)+":"+OL(i,s[a])+";")}return o}(e,t,n);case"function":if(void 0!==e){var r=VL,i=n(e);return VL=r,zL(e,t,i)}}if(null==t)return n;var s=t[n];return void 0!==s?s:n}var VL,FL=/label:\s*([^\s;\n{]+)\s*(;|$)/g;var HL=!!ic.useInsertionEffect&&ic.useInsertionEffect,UL=HL||function(e){return e()},GL=(0,ic.createContext)("undefined"!=typeof HTMLElement?TL({key:"css"}):null);GL.Provider;var $L=function(e){return(0,ic.forwardRef)((function(t,n){var o=(0,ic.useContext)(GL);return e(t,o,n)}))},WL=(0,ic.createContext)({});var KL=function(e,t,n){var o=e.key+"-"+t.name;!1===n&&void 0===e.registered[o]&&(e.registered[o]=t.styles)},ZL=jN,qL=function(e){return"theme"!==e},YL=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?ZL:qL},XL=function(e,t,n){var o;if(t){var r=t.shouldForwardProp;o=e.__emotion_forwardProp&&r?function(t){return e.__emotion_forwardProp(t)&&r(t)}:r}return"function"!=typeof o&&n&&(o=e.__emotion_forwardProp),o},QL=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;KL(t,n,o);UL((function(){return function(e,t,n){KL(e,t,n);var o=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+o:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,o)}));return null};const JL=function e(t,n){var o,r,i=t.__emotion_real===t,s=i&&t.__emotion_base||t;void 0!==n&&(o=n.label,r=n.target);var l=XL(t,n,i),a=l||YL(s),c=!a("as");return function(){var u=arguments,d=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==o&&d.push("label:"+o+";"),null==u[0]||void 0===u[0].raw)d.push.apply(d,u);else{0,d.push(u[0][0]);for(var p=u.length,h=1;h<p;h++)d.push(u[h],u[0][h])}var g=$L((function(e,t,n){var o=c&&e.as||s,i="",u=[],p=e;if(null==e.theme){for(var h in p={},e)p[h]=e[h];p.theme=(0,ic.useContext)(WL)}"string"==typeof e.className?i=function(e,t,n){var o="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):o+=n+" "})),o}(t.registered,u,e.className):null!=e.className&&(i=e.className+" ");var g=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,r="";VL=void 0;var i=e[0];null==i||void 0===i.raw?(o=!1,r+=zL(n,t,i)):r+=i[0];for(var s=1;s<e.length;s++)r+=zL(n,t,e[s]),o&&(r+=i[s]);FL.lastIndex=0;for(var l,a="";null!==(l=FL.exec(r));)a+="-"+l[1];return{name:ML(r)+a,styles:r,next:VL}}(d.concat(u),t.registered,p);i+=t.key+"-"+g.name,void 0!==r&&(i+=" "+r);var m=c&&void 0===l?YL(o):a,f={};for(var b in e)c&&"as"===b||m(b)&&(f[b]=e[b]);return f.className=i,f.ref=n,(0,ic.createElement)(ic.Fragment,null,(0,ic.createElement)(QL,{cache:t,serialized:g,isStringTag:"string"==typeof o}),(0,ic.createElement)(o,f))}));return g.displayName=void 0!==o?o:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",g.defaultProps=t.defaultProps,g.__emotion_real=g,g.__emotion_base=s,g.__emotion_styles=d,g.__emotion_forwardProp=l,Object.defineProperty(g,"toString",{value:function(){return"."+r}}),g.withComponent=function(t,o){return e(t,CN({},n,o,{shouldForwardProp:XL(g,o,!0)})).apply(void 0,d)},g}};var eD=JL.bind();["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){eD[e]=eD(e)}));const tD=eD(ws.__experimentalToolsPanelItem)`
grid-column: span 1;
`;function nD({panelId:e,value:t={},onChange:n=()=>{},units:o,isShownByDefault:r=!0}){const i="auto"===t.width?"":t.width??"",s="auto"===t.height?"":t.height??"",l=e=>o=>{const r={...t};o?r[e]=o:delete r[e],n(r)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(tD,{label:(0,T.__)("Width"),isShownByDefault:r,hasValue:()=>""!==i,onDeselect:l("width"),panelId:e,children:(0,d.jsx)(ws.__experimentalUnitControl,{label:(0,T.__)("Width"),placeholder:(0,T.__)("Auto"),labelPosition:"top",units:o,min:0,value:i,onChange:l("width"),size:"__unstable-large"})}),(0,d.jsx)(tD,{label:(0,T.__)("Height"),isShownByDefault:r,hasValue:()=>""!==s,onDeselect:l("height"),panelId:e,children:(0,d.jsx)(ws.__experimentalUnitControl,{label:(0,T.__)("Height"),placeholder:(0,T.__)("Auto"),labelPosition:"top",units:o,min:0,value:s,onChange:l("height"),size:"__unstable-large"})})]})}var oD=function({panelId:e,value:t={},onChange:n=()=>{},aspectRatioOptions:o,defaultAspectRatio:r="auto",scaleOptions:i,defaultScale:s="fill",unitsOptions:l,tools:a=["aspectRatio","widthHeight","scale"]}){const c=void 0===t.width||"auto"===t.width?null:t.width,u=void 0===t.height||"auto"===t.height?null:t.height,p=void 0===t.aspectRatio||"auto"===t.aspectRatio?null:t.aspectRatio,g=void 0===t.scale||"fill"===t.scale?null:t.scale,[m,f]=(0,h.useState)(g),[b,k]=(0,h.useState)(p),v=c&&u?"custom":b,_=p||c&&u;return(0,d.jsxs)(d.Fragment,{children:[a.includes("aspectRatio")&&(0,d.jsx)(wm,{panelId:e,options:o,defaultValue:r,value:v,onChange:e=>{const o={...t};k(e="auto"===e?null:e),e?o.aspectRatio=e:delete o.aspectRatio,e?m?o.scale=m:(o.scale=s,f(s)):delete o.scale,"custom"!==e&&c&&u&&delete o.height,n(o)}}),a.includes("widthHeight")&&(0,d.jsx)(nD,{panelId:e,units:l,value:{width:c,height:u},onChange:({width:e,height:o})=>{const r={...t};o="auto"===o?null:o,(e="auto"===e?null:e)?r.width=e:delete r.width,o?r.height=o:delete r.height,e&&o?delete r.aspectRatio:b&&(r.aspectRatio=b),b||!!e==!!o?m?r.scale=m:(r.scale=s,f(s)):delete r.scale,n(r)}}),a.includes("scale")&&_&&(0,d.jsx)(wN,{panelId:e,options:i,defaultValue:s,value:m,onChange:e=>{const o={...t};f(e="fill"===e?null:e),e?o.scale=e:delete o.scale,n(o)}})]})};const rD=[{label:(0,T._x)("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:(0,T._x)("Medium","Image size option for resolution control"),value:"medium"},{label:(0,T._x)("Large","Image size option for resolution control"),value:"large"},{label:(0,T._x)("Full Size","Image size option for resolution control"),value:"full"}];const iD={a:(0,T.__)("The <a> element should be used for links that navigate to a different page or to a different section within the same page."),article:(0,T.__)("The <article> element should represent a self-contained, syndicatable portion of the document."),aside:(0,T.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),button:(0,T.__)("The <button> element should be used for interactive controls that perform an action on the current page, such as opening a modal or toggling content visibility."),div:(0,T.__)("The <div> element should only be used if the block is a design element with no semantic meaning."),footer:(0,T.__)("The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.)."),header:(0,T.__)("The <header> element should represent introductory content, typically a group of introductory or navigational aids."),main:(0,T.__)("The <main> element should be used for the primary content of your document only."),nav:(0,T.__)("The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation."),section:(0,T.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element.")};const sD={};U(sD,{...u,ExperimentalBlockCanvas:YT,ExperimentalBlockEditorProvider:nv,getDuotoneFilter:Pf,getRichTextValues:function(e=[]){p.__unstableGetBlockProps.skipFilters=!0;const t=[];return xN(t,e),p.__unstableGetBlockProps.skipFilters=!1,t.map((e=>e instanceof pe.RichTextData?e:pe.RichTextData.fromHTMLString(e)))},PrivateQuickInserter:rI,extractWords:dB,getNormalizedSearchTerms:hB,normalizeString:pB,PrivateListView:AM,ResizableBoxPopover:function({clientId:e,resizableBoxProps:t,...n}){return(0,d.jsx)(of,{clientId:e,__unstablePopoverSlot:"block-toolbar",...n,children:(0,d.jsx)(ws.ResizableBox,{...t})})},useHasBlockToolbar:TT,cleanEmptyObject:fs,BlockQuickNavigation:IA,LayoutStyle:function({layout:e={},css:t,...n}){const o=Xl(e.type),[r]=Ti("spacing.blockGap"),i=null!==r;if(o){if(t)return(0,d.jsx)("style",{children:t});const r=o.getLayoutStyle?.({hasBlockGapSupport:i,layout:e,...n});if(r)return(0,d.jsx)("style",{children:r})}return null},BlockManager:Uu,BlockRemovalWarningModal:function({rules:e}){const{clientIds:t,selectPrevious:n,message:o}=(0,g.useSelect)((e=>G(e(ji)).getRemovalPromptData())),{clearBlockRemovalPrompt:r,setBlockRemovalRules:i,privateRemoveBlocks:s}=G((0,g.useDispatch)(ji));if((0,h.useEffect)((()=>(i(e),()=>{i()})),[e,i]),!o)return;return(0,d.jsxs)(ws.Modal,{title:(0,T.__)("Be careful!"),onRequestClose:r,size:"medium",children:[(0,d.jsx)("p",{children:o}),(0,d.jsxs)(ws.__experimentalHStack,{justify:"right",children:[(0,d.jsx)(ws.Button,{variant:"tertiary",onClick:r,__next40pxDefaultSize:!0,children:(0,T.__)("Cancel")}),(0,d.jsx)(ws.Button,{variant:"primary",onClick:()=>{s(t,n,!0),r()},__next40pxDefaultSize:!0,children:(0,T.__)("Delete")})]})]})},useLayoutClasses:Nb,useLayoutStyles:function(e={},t,n){const{layout:o={},style:r={}}=e,i=o?.inherit||o?.contentSize||o?.wideSize?{...o,type:"constrained"}:o||{},s=Xl(i?.type||"default"),[l]=Ti("spacing.blockGap"),a=null!==l;return s?.getLayoutStyle?.({blockName:t,selector:n,layout:o,style:r,hasBlockGapSupport:a})},DimensionsTool:oD,ResolutionTool:function({panelId:e,value:t,onChange:n,options:o=rD,defaultValue:r=rD[0].value,isShownByDefault:i=!0,resetAllFilter:s}){const l=t??r;return(0,d.jsx)(ws.__experimentalToolsPanelItem,{hasValue:()=>l!==r,label:(0,T.__)("Resolution"),onDeselect:()=>n(r),isShownByDefault:i,panelId:e,resetAllFilter:s,children:(0,d.jsx)(ws.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,T.__)("Resolution"),value:l,options:o,onChange:n,help:(0,T.__)("Select the size of the source image."),size:"__unstable-large"})})},TabbedSidebar:JB,TextAlignmentControl:Wh,usesContextKey:PR,useFlashEditableBlocks:cS,HTMLElementControl:function({tagName:e,onChange:t,clientId:n,options:o=[{label:(0,T.__)("Default (<div>)"),value:"div"},{label:"<header>",value:"header"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<article>",value:"article"},{label:"<aside>",value:"aside"},{label:"<footer>",value:"footer"}]}){const r=!!n&&o.some((e=>"main"===e.value)),i=(0,g.useSelect)((e=>{if(!r)return!1;const{getClientIdsWithDescendants:t,getBlockAttributes:o}=e(ji);return t().some((e=>e!==n&&"main"===o(e)?.tagName))}),[n,r]),s=o.map((t=>"main"===t.value&&i&&"main"!==e?{...t,disabled:!0,label:(0,T.sprintf)((0,T.__)("%s (Already in use)"),t.label)}:t));return(0,d.jsxs)(ws.__experimentalVStack,{spacing:2,className:"block-editor-html-element-control",children:[(0,d.jsx)(ws.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,T.__)("HTML element"),options:s,value:e,onChange:t,help:iD[e]}),"main"===e&&i&&(0,d.jsx)(ws.Notice,{status:"warning",isDismissible:!1,children:(0,T.__)("Multiple <main> elements detected. The duplicate may be in your content or template. This is not valid HTML and may cause accessibility issues. Please change this HTML element.")})]})},useZoomOut:eI,globalStylesDataKey:N,globalStylesLinksDataKey:L,selectBlockPatternsKey:D,requiresWrapperOnCopy:Tw,PrivateRichText:UR,PrivateInserterLibrary:GA,reusableBlocksSelectKey:O,PrivateBlockPopover:ef,PrivatePublishDateTimePicker:rN,useSpacingSizes:lm,useBlockDisplayTitle:Sj,__unstableBlockStyleVariationOverridesWithConfig:function({config:e}){const{getBlockStyles:t,overrides:n}=(0,g.useSelect)((e=>({getBlockStyles:e(p.store).getBlockStyles,overrides:G(e(ji)).getStyleOverrides()})),[]),{getBlockName:o}=(0,g.useSelect)(ji),r=(0,h.useMemo)((()=>{if(!n?.length)return;const r=[],i=[];for(const[,s]of n)if(s?.variation&&s?.clientId&&!i.includes(s.clientId)){const n=o(s.clientId),l=e?.styles?.blocks?.[n]?.variations?.[s.variation];if(l){const o={settings:e?.settings,styles:{blocks:{[n]:{variations:{[`${s.variation}-${s.clientId}`]:l}}}}},a=Sb((0,p.getBlockTypes)(),t,s.clientId),c=yb(o,a,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0});r.push({id:`${s.variation}-${s.clientId}`,css:c,__unstableType:"variation",variation:s.variation,clientId:s.clientId}),i.push(s.clientId)}}return r}),[e,n,t,o]);if(r&&r.length)return(0,d.jsx)(d.Fragment,{children:r.map((e=>(0,d.jsx)(Eb,{override:e},e.id)))})},setBackgroundStyleDefaults:Au,sectionRootClientIdKey:z,CommentIconSlotFill:NE,CommentIconToolbarSlotFill:hT,mediaEditKey:V,essentialFormatKey:F,useBlockElement:bh,useBlockElementRef:fh})})(),(window.wp=window.wp||{}).blockEditor=o})(); editor.min.js 0000644 00001463234 15121363546 0007175 0 ustar 00 /*! This file is auto-generated */
(()=>{var e={66:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===s}(e)}(e)};var s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((s=e,Array.isArray(s)?[]:{}),e,t):e;var s}function o(e,t,s){return e.concat(t).map((function(e){return n(e,s)}))}function r(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function i(e,t){try{return t in e}catch(e){return!1}}function a(e,t,s){var o={};return s.isMergeableObject(e)&&r(e).forEach((function(t){o[t]=n(e[t],s)})),r(t).forEach((function(r){(function(e,t){return i(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,r)||(i(e,r)&&s.isMergeableObject(t[r])?o[r]=function(e,t){if(!t.customMerge)return l;var s=t.customMerge(e);return"function"==typeof s?s:l}(r,s)(e[r],t[r],s):o[r]=n(t[r],s))})),o}function l(e,s,r){(r=r||{}).arrayMerge=r.arrayMerge||o,r.isMergeableObject=r.isMergeableObject||t,r.cloneUnlessOtherwiseSpecified=n;var i=Array.isArray(s);return i===Array.isArray(e)?i?r.arrayMerge(e,s,r):a(e,s,r):n(s,r)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,s){return l(e,s,t)}),{})};var c=l;e.exports=c},461:(e,t,s)=>{var n=s(6109);e.exports=function(e){var t=n(e,"line-height"),s=parseFloat(t,10);if(t===s+""){var o=e.style.lineHeight;e.style.lineHeight=t+"em",t=n(e,"line-height"),s=parseFloat(t,10),o?e.style.lineHeight=o:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(s*=4,s/=3):-1!==t.indexOf("mm")?(s*=96,s/=25.4):-1!==t.indexOf("cm")?(s*=96,s/=2.54):-1!==t.indexOf("in")?s*=96:-1!==t.indexOf("pc")&&(s*=16),s=Math.round(s),"normal"===t){var r=e.nodeName,i=document.createElement(r);i.innerHTML=" ","TEXTAREA"===r.toUpperCase()&&i.setAttribute("rows","1");var a=n(e,"font-size");i.style.fontSize=a,i.style.padding="0px",i.style.border="0px";var l=document.body;l.appendChild(i),s=i.offsetHeight,l.removeChild(i)}return s}},628:(e,t,s)=>{"use strict";var n=s(4067);function o(){}function r(){}r.resetWarningCache=o,e.exports=function(){function e(e,t,s,o,r,i){if(i!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var s={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:o};return s.PropTypes=s,s}},1609:e=>{"use strict";e.exports=window.React},4067:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4132:(e,t,s)=>{"use strict";var n=s(4462);t.A=n.TextareaAutosize},4306:function(e,t){var s,n,o;
/*!
autosize 4.0.4
license: MIT
http://www.jacklmoore.com/autosize
*/n=[e,t],s=function(e,t){"use strict";var s,n,o="function"==typeof Map?new Map:(s=[],n=[],{has:function(e){return s.indexOf(e)>-1},get:function(e){return n[s.indexOf(e)]},set:function(e,t){-1===s.indexOf(e)&&(s.push(e),n.push(t))},delete:function(e){var t=s.indexOf(e);t>-1&&(s.splice(t,1),n.splice(t,1))}}),r=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){r=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var t=null,s=null,n=null,i=function(){e.clientWidth!==s&&p()},a=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",p,!1),Object.keys(t).forEach((function(s){e.style[s]=t[s]})),o.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",p,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:a,update:p}),l()}function l(){var s=window.getComputedStyle(e,null);"vertical"===s.resize?e.style.resize="none":"both"===s.resize&&(e.style.resize="horizontal"),t="content-box"===s.boxSizing?-(parseFloat(s.paddingTop)+parseFloat(s.paddingBottom)):parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var s=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=s,e.style.overflowY=t}function d(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function u(){if(0!==e.scrollHeight){var n=d(e),o=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",s=e.clientWidth,n.forEach((function(e){e.node.scrollTop=e.scrollTop})),o&&(document.documentElement.scrollTop=o)}}function p(){u();var t=Math.round(parseFloat(e.style.height)),s=window.getComputedStyle(e,null),o="content-box"===s.boxSizing?Math.round(parseFloat(s.height)):e.offsetHeight;if(o<t?"hidden"===s.overflowY&&(c("scroll"),u(),o="content-box"===s.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==s.overflowY&&(c("hidden"),u(),o="content-box"===s.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),n!==o){n=o;var i=r("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function a(e){var t=o.get(e);t&&t.destroy()}function l(e){var t=o.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e,t)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],l),e}),t.default=c,e.exports=t.default},void 0===(o="function"==typeof s?s.apply(t,n):s)||(e.exports=o)},4462:function(e,t,s){"use strict";var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])},function(e,t){function s(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)}),r=this&&this.__assign||Object.assign||function(e){for(var t,s=1,n=arguments.length;s<n;s++)for(var o in t=arguments[s])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i=this&&this.__rest||function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&(s[n[o]]=e[n[o]])}return s};t.__esModule=!0;var a=s(1609),l=s(5826),c=s(4306),d=s(461),u="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:d(t.textarea)})},t.onChange=function(e){var s=t.props.onChange;t.currentValue=e.currentTarget.value,s&&s(e)},t}return o(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,s=t.maxRows,n=t.async;"number"==typeof s&&this.updateLineHeight(),"number"==typeof s||n?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(u,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(u,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,s=(t.onResize,t.maxRows),n=(t.onChange,t.style),o=(t.innerRef,t.children),l=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,d=s&&c?c*s:null;return a.createElement("textarea",r({},l,{onChange:this.onChange,style:d?r({},n,{maxHeight:d}):n,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),o)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:l.number,maxRows:l.number,onResize:l.func,innerRef:l.any,async:l.bool},t}(a.Component);t.TextareaAutosize=a.forwardRef((function(e,t){return a.createElement(p,r({},e,{innerRef:t}))}))},5215:e=>{"use strict";e.exports=function e(t,s){if(t===s)return!0;if(t&&s&&"object"==typeof t&&"object"==typeof s){if(t.constructor!==s.constructor)return!1;var n,o,r;if(Array.isArray(t)){if((n=t.length)!=s.length)return!1;for(o=n;0!=o--;)if(!e(t[o],s[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if((n=(r=Object.keys(t)).length)!==Object.keys(s).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(s,r[o]))return!1;for(o=n;0!=o--;){var i=r[o];if(!e(t[i],s[i]))return!1}return!0}return t!=t&&s!=s}},5826:(e,t,s)=>{e.exports=s(628)()},6109:e=>{e.exports=function(e,t,s){return((s=window.getComputedStyle)?s(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},s=Object.keys(t).join("|"),n=new RegExp(s,"g"),o=new RegExp(s,"");function r(e){return t[e]}var i=function(e){return e.replace(n,r)};e.exports=i,e.exports.has=function(e){return!!e.match(o)},e.exports.remove=i}},t={};function s(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,s),r.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";s.r(n),s.d(n,{AlignmentToolbar:()=>Yh,Autocomplete:()=>Zh,AutosaveMonitor:()=>Oc,BlockAlignmentToolbar:()=>qh,BlockControls:()=>Kh,BlockEdit:()=>Qh,BlockEditorKeyboardShortcuts:()=>Xh,BlockFormatControls:()=>Jh,BlockIcon:()=>eg,BlockInspector:()=>tg,BlockList:()=>sg,BlockMover:()=>ng,BlockNavigationDropdown:()=>og,BlockSelectionClearer:()=>rg,BlockSettingsMenu:()=>ig,BlockTitle:()=>ag,BlockToolbar:()=>lg,CharacterCount:()=>Oh,ColorPalette:()=>cg,ContrastChecker:()=>dg,CopyHandler:()=>ug,DefaultBlockAppender:()=>pg,DocumentBar:()=>Gc,DocumentOutline:()=>ed,DocumentOutlineCheck:()=>td,EditorHistoryRedo:()=>rd,EditorHistoryUndo:()=>id,EditorKeyboardShortcuts:()=>kl,EditorKeyboardShortcutsRegister:()=>sd,EditorNotices:()=>ld,EditorProvider:()=>Al,EditorSnackbars:()=>dd,EntitiesSavedStates:()=>yd,ErrorBoundary:()=>kd,FontSizePicker:()=>mg,InnerBlocks:()=>gg,Inserter:()=>hg,InspectorAdvancedControls:()=>_g,InspectorControls:()=>fg,LocalAutosaveMonitor:()=>Ed,MediaPlaceholder:()=>Sg,MediaUpload:()=>kg,MediaUploadCheck:()=>Cg,MultiSelectScrollIntoView:()=>Pg,NavigableToolbar:()=>jg,ObserveTyping:()=>Eg,PageAttributesCheck:()=>Td,PageAttributesOrder:()=>Nd,PageAttributesPanel:()=>Wd,PageAttributesParent:()=>zd,PageTemplate:()=>nu,PanelColorSettings:()=>bg,PlainText:()=>yg,PluginBlockSettingsMenuItem:()=>_u,PluginDocumentSettingPanel:()=>gu,PluginMoreMenuItem:()=>fu,PluginPostPublishPanel:()=>vu,PluginPostStatusInfo:()=>Cu,PluginPrePublishPanel:()=>Tu,PluginPreviewMenuItem:()=>Bu,PluginSidebar:()=>Iu,PluginSidebarMoreMenuItem:()=>Nu,PostAuthor:()=>Wu,PostAuthorCheck:()=>Zu,PostAuthorPanel:()=>qu,PostComments:()=>Qu,PostDiscussionPanel:()=>sp,PostExcerpt:()=>np,PostExcerptCheck:()=>op,PostExcerptPanel:()=>up,PostFeaturedImage:()=>wp,PostFeaturedImageCheck:()=>gp,PostFeaturedImagePanel:()=>kp,PostFormat:()=>jp,PostFormatCheck:()=>Cp,PostLastRevision:()=>Ip,PostLastRevisionCheck:()=>Ep,PostLastRevisionPanel:()=>Np,PostLockedModal:()=>Rp,PostPendingStatus:()=>Ap,PostPendingStatusCheck:()=>Dp,PostPingbacks:()=>Xu,PostPreviewButton:()=>Mp,PostPublishButton:()=>Vp,PostPublishButtonLabel:()=>Lp,PostPublishPanel:()=>Ym,PostSavedState:()=>nh,PostSchedule:()=>am,PostScheduleCheck:()=>oh,PostScheduleLabel:()=>cm,PostSchedulePanel:()=>ih,PostSticky:()=>Xm,PostStickyCheck:()=>Qm,PostSwitchToDraftButton:()=>ah,PostSyncStatus:()=>lh,PostTaxonomies:()=>dh,PostTaxonomiesCheck:()=>uh,PostTaxonomiesFlatTermSelector:()=>wm,PostTaxonomiesHierarchicalTermSelector:()=>Dm,PostTaxonomiesPanel:()=>mh,PostTemplatePanel:()=>Vu,PostTextEditor:()=>gh,PostTitle:()=>vh,PostTitleRaw:()=>wh,PostTrash:()=>kh,PostTrashCheck:()=>Sh,PostTypeSupportCheck:()=>Bd,PostURL:()=>Ch,PostURLCheck:()=>Ph,PostURLLabel:()=>jh,PostURLPanel:()=>Th,PostVisibility:()=>zp,PostVisibilityCheck:()=>Nh,PostVisibilityLabel:()=>Gp,RichText:()=>Wh,RichTextShortcut:()=>xg,RichTextToolbarButton:()=>vg,ServerSideRender:()=>zh(),SkipToSelectedBlock:()=>Tg,TableOfContents:()=>Vh,TextEditorGlobalKeyboardShortcuts:()=>$g,ThemeSupportCheck:()=>hp,TimeToRead:()=>Lh,URLInput:()=>Bg,URLInputButton:()=>Ig,URLPopover:()=>Ng,UnsavedChangesWarning:()=>Uh,VisualEditorGlobalKeyboardShortcuts:()=>Gg,Warning:()=>Rg,WordCount:()=>Ah,WritingFlow:()=>Dg,__unstableRichTextInputEvent:()=>wg,cleanForSlug:()=>Wg,createCustomColorsHOC:()=>Ag,getColorClassName:()=>Mg,getColorObjectByAttributeValues:()=>Lg,getColorObjectByColorValue:()=>Og,getFontSize:()=>Fg,getFontSizeClass:()=>Vg,getTemplatePartIcon:()=>H,mediaUpload:()=>yi,privateApis:()=>Xy,registerEntityAction:()=>Jy,registerEntityField:()=>tx,store:()=>vc,storeConfig:()=>xc,transformStyles:()=>g.transformStyles,unregisterEntityAction:()=>ex,unregisterEntityField:()=>sx,useEntitiesSavedStatesIsDirty:()=>fd,usePostScheduleLabel:()=>dm,usePostURLLabel:()=>Eh,usePostVisibilityLabel:()=>$p,userAutocompleter:()=>Sc,withColorContext:()=>Ug,withColors:()=>Hg,withFontSizes:()=>zg});var e={};s.r(e),s.d(e,{__experimentalGetDefaultTemplatePartAreas:()=>ls,__experimentalGetDefaultTemplateType:()=>cs,__experimentalGetDefaultTemplateTypes:()=>as,__experimentalGetTemplateInfo:()=>ds,__unstableIsEditorReady:()=>et,canInsertBlockType:()=>ns,canUserUseUnfilteredHTML:()=>$e,didPostSaveRequestFail:()=>Ee,didPostSaveRequestSucceed:()=>je,getActivePostLock:()=>Ge,getAdjacentBlockClientId:()=>Et,getAutosaveAttribute:()=>me,getBlock:()=>mt,getBlockAttributes:()=>pt,getBlockCount:()=>yt,getBlockHierarchyRootClientId:()=>jt,getBlockIndex:()=>Ht,getBlockInsertionPoint:()=>Xt,getBlockListSettings:()=>is,getBlockMode:()=>qt,getBlockName:()=>dt,getBlockOrder:()=>Ut,getBlockRootClientId:()=>Pt,getBlockSelectionEnd:()=>vt,getBlockSelectionStart:()=>xt,getBlocks:()=>ht,getBlocksByClientId:()=>bt,getClientIdsOfDescendants:()=>gt,getClientIdsWithDescendants:()=>_t,getCurrentPost:()=>ne,getCurrentPostAttribute:()=>de,getCurrentPostId:()=>re,getCurrentPostLastRevisionId:()=>le,getCurrentPostRevisionsCount:()=>ae,getCurrentPostType:()=>oe,getCurrentTemplateId:()=>ie,getDeviceType:()=>nt,getEditedPostAttribute:()=>pe,getEditedPostContent:()=>Re,getEditedPostPreviewLink:()=>Ie,getEditedPostSlug:()=>Le,getEditedPostVisibility:()=>he,getEditorBlocks:()=>Ze,getEditorMode:()=>it,getEditorSelection:()=>Je,getEditorSelectionEnd:()=>Xe,getEditorSelectionStart:()=>Qe,getEditorSettings:()=>tt,getFirstMultiSelectedBlockClientId:()=>Dt,getGlobalBlockCount:()=>ft,getInserterItems:()=>os,getLastMultiSelectedBlockClientId:()=>At,getMultiSelectedBlockClientIds:()=>Nt,getMultiSelectedBlocks:()=>Rt,getMultiSelectedBlocksEndClientId:()=>Vt,getMultiSelectedBlocksStartClientId:()=>Ft,getNextBlockClientId:()=>Bt,getPermalink:()=>Me,getPermalinkParts:()=>Oe,getPostEdits:()=>ce,getPostLockUser:()=>ze,getPostTypeLabel:()=>us,getPreviousBlockClientId:()=>Tt,getRenderingMode:()=>st,getSelectedBlock:()=>Ct,getSelectedBlockClientId:()=>kt,getSelectedBlockCount:()=>wt,getSelectedBlocksInitialCaretPosition:()=>It,getStateBeforeOptimisticTransaction:()=>at,getSuggestedPostFormat:()=>Ne,getTemplate:()=>ts,getTemplateLock:()=>ss,hasChangedContent:()=>J,hasEditorRedo:()=>Q,hasEditorUndo:()=>K,hasInserterItems:()=>rs,hasMultiSelection:()=>Wt,hasNonPostEntityChanges:()=>te,hasSelectedBlock:()=>St,hasSelectedInnerBlock:()=>Gt,inSomeHistory:()=>lt,isAncestorMultiSelected:()=>Ot,isAutosavingPost:()=>Te,isBlockInsertionPointVisible:()=>Jt,isBlockMultiSelected:()=>Lt,isBlockSelected:()=>zt,isBlockValid:()=>ut,isBlockWithinSelection:()=>$t,isCaretWithinFormattedText:()=>Qt,isCleanNewPost:()=>se,isCurrentPostPending:()=>ge,isCurrentPostPublished:()=>_e,isCurrentPostScheduled:()=>fe,isDeletingPost:()=>ke,isEditedPostAutosaveable:()=>ve,isEditedPostBeingScheduled:()=>we,isEditedPostDateFloating:()=>Se,isEditedPostDirty:()=>ee,isEditedPostEmpty:()=>xe,isEditedPostNew:()=>X,isEditedPostPublishable:()=>be,isEditedPostSaveable:()=>ye,isEditorPanelEnabled:()=>qe,isEditorPanelOpened:()=>Ke,isEditorPanelRemoved:()=>Ye,isFirstMultiSelectedBlock:()=>Mt,isInserterOpened:()=>rt,isListViewOpened:()=>ot,isMultiSelecting:()=>Zt,isPermalinkEditable:()=>Ae,isPostAutosavingLocked:()=>Ue,isPostLockTakeover:()=>He,isPostLocked:()=>Fe,isPostSavingLocked:()=>Ve,isPreviewingPost:()=>Be,isPublishSidebarEnabled:()=>We,isPublishSidebarOpened:()=>ps,isPublishingPost:()=>De,isSavingNonPostEntityChanges:()=>Pe,isSavingPost:()=>Ce,isSelectionEnabled:()=>Yt,isTyping:()=>Kt,isValidTemplate:()=>es});var t={};s.r(t),s.d(t,{__experimentalTearDownEditor:()=>vs,__unstableSaveForPreview:()=>Is,autosave:()=>Bs,clearSelectedBlock:()=>hn,closePublishSidebar:()=>sn,createUndoLevel:()=>Ds,disablePublishSidebar:()=>Ls,editPost:()=>Ps,enablePublishSidebar:()=>Ms,enterFormattedText:()=>Rn,exitFormattedText:()=>Dn,hideInsertionPoint:()=>kn,insertBlock:()=>vn,insertBlocks:()=>wn,insertDefaultBlock:()=>An,lockPostAutosaving:()=>Vs,lockPostSaving:()=>Os,mergeBlocks:()=>jn,moveBlockToPosition:()=>xn,moveBlocksDown:()=>bn,moveBlocksUp:()=>yn,multiSelect:()=>mn,openPublishSidebar:()=>tn,receiveBlocks:()=>an,redo:()=>Ns,refreshPost:()=>Es,removeBlock:()=>Tn,removeBlocks:()=>En,removeEditorPanel:()=>Ys,replaceBlock:()=>fn,replaceBlocks:()=>_n,resetBlocks:()=>rn,resetEditorBlocks:()=>Hs,resetPost:()=>ws,savePost:()=>js,selectBlock:()=>dn,setDeviceType:()=>$s,setEditedPost:()=>Cs,setIsInserterOpened:()=>qs,setIsListViewOpened:()=>Ks,setRenderingMode:()=>Gs,setTemplateValidity:()=>Cn,setupEditor:()=>xs,setupEditorState:()=>ks,showInsertionPoint:()=>Sn,startMultiSelect:()=>un,startTyping:()=>In,stopMultiSelect:()=>pn,stopTyping:()=>Nn,switchEditorMode:()=>en,synchronizeTemplate:()=>Pn,toggleBlockMode:()=>Bn,toggleDistractionFree:()=>Qs,toggleEditorPanelEnabled:()=>Ws,toggleEditorPanelOpened:()=>Zs,togglePublishSidebar:()=>nn,toggleSelection:()=>gn,toggleSpotlightMode:()=>Xs,toggleTopToolbar:()=>Js,trashPost:()=>Ts,undo:()=>Rs,unlockPostAutosaving:()=>Us,unlockPostSaving:()=>Fs,updateBlock:()=>ln,updateBlockAttributes:()=>cn,updateBlockListSettings:()=>Mn,updateEditorSettings:()=>zs,updatePost:()=>Ss,updatePostLock:()=>As});var o={};s.r(o),s.d(o,{closeModal:()=>xa,disableComplementaryArea:()=>ma,enableComplementaryArea:()=>pa,openModal:()=>ya,pinItem:()=>ha,setDefaultComplementaryArea:()=>ua,setFeatureDefaults:()=>ba,setFeatureValue:()=>fa,toggleFeature:()=>_a,unpinItem:()=>ga});var r={};s.r(r),s.d(r,{getActiveComplementaryArea:()=>va,isComplementaryAreaLoading:()=>wa,isFeatureActive:()=>ka,isItemPinned:()=>Sa,isModalActive:()=>Ca});var i={};s.r(i),s.d(i,{ActionItem:()=>Na,ComplementaryArea:()=>Va,ComplementaryAreaMoreMenuItem:()=>Da,FullscreenMode:()=>Ua,InterfaceSkeleton:()=>Wa,PinnedItems:()=>Ma,store:()=>ja});var a={};s.r(a),s.d(a,{createTemplate:()=>Zl,hideBlockTypes:()=>ql,registerEntityAction:()=>Vl,registerEntityField:()=>Hl,registerPostTypeSchema:()=>$l,removeTemplates:()=>Xl,revertTemplate:()=>Ql,saveDirtyEntities:()=>Kl,setCanvasMinHeight:()=>ec,setCurrentTemplateId:()=>Wl,setDefaultRenderingMode:()=>Jl,setIsReady:()=>Gl,showBlockTypes:()=>Yl,unregisterEntityAction:()=>Ul,unregisterEntityField:()=>zl});var l={};s.r(l),s.d(l,{getCanvasMinHeight:()=>yc,getDefaultRenderingMode:()=>bc,getEntityActions:()=>hc,getEntityFields:()=>_c,getInserter:()=>lc,getInserterSidebarToggleRef:()=>dc,getListViewToggleRef:()=>cc,getPostBlocksByName:()=>fc,getPostIcon:()=>pc,hasPostMetaChanges:()=>mc,isEntityReady:()=>gc});const c=window.ReactJSXRuntime,d=window.wp.data,u=window.wp.coreData,p=window.wp.element,m=window.wp.compose,h=window.wp.hooks,g=window.wp.blockEditor,_={...g.SETTINGS_DEFAULTS,richEditingEnabled:!0,codeEditingEnabled:!0,fontLibraryEnabled:!0,enableCustomFields:void 0,defaultRenderingMode:"post-only"};var f=(0,d.combineReducers)({actions:function(e={},t){switch(t.type){case"REGISTER_ENTITY_ACTION":return{...e,[t.kind]:{...e[t.kind],[t.name]:[...(e[t.kind]?.[t.name]??[]).filter((e=>e.id!==t.config.id)),t.config]}};case"UNREGISTER_ENTITY_ACTION":return{...e,[t.kind]:{...e[t.kind],[t.name]:(e[t.kind]?.[t.name]??[]).filter((e=>e.id!==t.actionId))}}}return e},fields:function(e={},t){switch(t.type){case"REGISTER_ENTITY_FIELD":return{...e,[t.kind]:{...e[t.kind],[t.name]:[...(e[t.kind]?.[t.name]??[]).filter((e=>e.id!==t.config.id)),t.config]}};case"UNREGISTER_ENTITY_FIELD":return{...e,[t.kind]:{...e[t.kind],[t.name]:(e[t.kind]?.[t.name]??[]).filter((e=>e.id!==t.fieldId))}}}return e},isReady:function(e={},t){return"SET_IS_READY"===t.type?{...e,[t.kind]:{...e[t.kind],[t.name]:!0}}:e}});function b(e){return e&&"object"==typeof e&&"raw"in e?e.raw:e}var y=(0,d.combineReducers)({postId:function(e=null,t){return"SET_EDITED_POST"===t.type?t.postId:e},postType:function(e=null,t){return"SET_EDITED_POST"===t.type?t.postType:e},templateId:function(e=null,t){return"SET_CURRENT_TEMPLATE_ID"===t.type?t.id:e},saving:function(e={},t){switch(t.type){case"REQUEST_POST_UPDATE_START":case"REQUEST_POST_UPDATE_FINISH":return{pending:"REQUEST_POST_UPDATE_START"===t.type,options:t.options||{}}}return e},deleting:function(e={},t){switch(t.type){case"REQUEST_POST_DELETE_START":case"REQUEST_POST_DELETE_FINISH":return{pending:"REQUEST_POST_DELETE_START"===t.type}}return e},postLock:function(e={isLocked:!1},t){return"UPDATE_POST_LOCK"===t.type?t.lock:e},template:function(e={isValid:!0},t){return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},postSavingLock:function(e={},t){switch(t.type){case"LOCK_POST_SAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_SAVING":{const{[t.lockName]:s,...n}=e;return n}}return e},editorSettings:function(e=_,t){return"UPDATE_EDITOR_SETTINGS"===t.type?{...e,...t.settings}:e},postAutosavingLock:function(e={},t){switch(t.type){case"LOCK_POST_AUTOSAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_AUTOSAVING":{const{[t.lockName]:s,...n}=e;return n}}return e},renderingMode:function(e="post-only",t){return"SET_RENDERING_MODE"===t.type?t.mode:e},deviceType:function(e="Desktop",t){return"SET_DEVICE_TYPE"===t.type?t.deviceType:e},removedPanels:function(e=[],t){if("REMOVE_PANEL"===t.type)if(!e.includes(t.panelName))return[...e,t.panelName];return e},blockInserterPanel:function(e=!1,t){switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},inserterSidebarToggleRef:function(e={current:null}){return e},listViewPanel:function(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e},listViewToggleRef:function(e={current:null}){return e},publishSidebarActive:function(e=!1,t){switch(t.type){case"OPEN_PUBLISH_SIDEBAR":return!0;case"CLOSE_PUBLISH_SIDEBAR":return!1;case"TOGGLE_PUBLISH_SIDEBAR":return!e}return e},canvasMinHeight:function(e=0,t){return"SET_CANVAS_MIN_HEIGHT"===t.type?t.minHeight:e},dataviews:f});const x=window.wp.blocks,v=window.wp.date,w=window.wp.url,S=window.wp.deprecated;var k=s.n(S);const C=window.wp.preferences,P=new Set(["meta"]),j=/%(?:postname|pagename)%/,E=6e4,T=["title","excerpt","content"],B="wp_template",I="wp_template_part",N="wp_block",R="wp_navigation",D="custom",A=["wp_template","wp_template_part"],M=[...A,"wp_block","wp_navigation"],L=window.wp.primitives;var O=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M18.5 10.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"})}),F=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",d:"M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),V=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{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.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),U=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})});function H(e){return"header"===e?O:"footer"===e?F:"sidebar"===e?V:U}const z=window.wp.privateApis,{lock:G,unlock:$}=(0,z.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/editor");var W=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{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"})});const Z={},Y=e=>{if(!e)return Z;const{templateTypes:t,templateAreas:s,template:n}=e,{description:o,slug:r,title:i,area:a}=n,{title:l,description:c}=Object.values(t).find((e=>e.slug===r))??Z,d="string"==typeof i?i:i?.rendered,u="string"==typeof o?o:o?.raw,p=s?.map((e=>({...e,icon:H(e.icon)}))),m=p?.find((e=>a===e.area))?.icon||W;return{title:d&&d!==r?d:l||r,description:u||c,icon:m}},q={},K=(0,d.createRegistrySelector)((e=>()=>e(u.store).hasUndo())),Q=(0,d.createRegistrySelector)((e=>()=>e(u.store).hasRedo()));function X(e){return"auto-draft"===ne(e).status}function J(e){return"content"in ce(e)}const ee=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=re(t);return e(u.store).hasEditsForEntityRecord("postType",s,n)})),te=(0,d.createRegistrySelector)((e=>t=>{const s=e(u.store).__experimentalGetDirtyEntityRecords(),{type:n,id:o}=ne(t);return s.some((e=>"postType"!==e.kind||e.name!==n||e.key!==o))}));function se(e){return!ee(e)&&X(e)}const ne=(0,d.createRegistrySelector)((e=>t=>{const s=re(t),n=oe(t),o=e(u.store).getRawEntityRecord("postType",n,s);return o||q}));function oe(e){return e.postType}function re(e){return e.postId}function ie(e){return e.templateId}function ae(e){return ne(e)._links?.["version-history"]?.[0]?.count??0}function le(e){return ne(e)._links?.["predecessor-version"]?.[0]?.id??null}const ce=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=re(t);return e(u.store).getEntityRecordEdits("postType",s,n)||q}));function de(e,t){switch(t){case"type":return oe(e);case"id":return re(e);default:const s=ne(e);if(!s.hasOwnProperty(t))break;return b(s[t])}}const ue=(0,d.createSelector)(((e,t)=>{const s=ce(e);return s.hasOwnProperty(t)?{...de(e,t),...s[t]}:de(e,t)}),((e,t)=>[de(e,t),ce(e)[t]]));function pe(e,t){if("content"===t)return Re(e);const s=ce(e);return s.hasOwnProperty(t)?P.has(t)?ue(e,t):s[t]:de(e,t)}const me=(0,d.createRegistrySelector)((e=>(t,s)=>{if(!T.includes(s)&&"preview_link"!==s)return;const n=oe(t);if("wp_template"===n)return!1;const o=re(t),r=e(u.store).getCurrentUser()?.id,i=e(u.store).getAutosave(n,o,r);return i?b(i[s]):void 0}));function he(e){if("private"===pe(e,"status"))return"private";return pe(e,"password")?"password":"public"}function ge(e){return"pending"===ne(e).status}function _e(e,t){const s=t||ne(e);return-1!==["publish","private"].indexOf(s.status)||"future"===s.status&&!(0,v.isInTheFuture)(new Date(Number((0,v.getDate)(s.date))-E))}function fe(e){return"future"===ne(e).status&&!_e(e)}function be(e){const t=ne(e);return ee(e)||-1===["publish","private","future"].indexOf(t.status)}function ye(e){return!Ce(e)&&(!!pe(e,"title")||!!pe(e,"excerpt")||!xe(e)||"native"===p.Platform.OS)}const xe=(0,d.createRegistrySelector)((e=>t=>{const s=re(t),n=oe(t),o=e(u.store).getEditedEntityRecord("postType",n,s);if("function"!=typeof o.content)return!o.content;const r=pe(t,"blocks");if(0===r.length)return!0;if(r.length>1)return!1;const i=r[0].name;return(i===(0,x.getDefaultBlockName)()||i===(0,x.getFreeformContentHandlerName)())&&!Re(t)})),ve=(0,d.createRegistrySelector)((e=>t=>{if(!ye(t))return!1;if(Ue(t))return!1;const s=oe(t),n=e(u.store).getPostType(s);if("wp_template"===s||!n?.supports?.autosave)return!1;const o=re(t),r=e(u.store).hasFetchedAutosaves(s,o),i=e(u.store).getCurrentUser()?.id,a=e(u.store).getAutosave(s,o,i);return!!r&&(!a||(!!J(t)||["title","excerpt","meta"].some((e=>b(a[e])!==pe(t,e)))))}));function we(e){const t=pe(e,"date"),s=new Date(Number((0,v.getDate)(t))-E);return(0,v.isInTheFuture)(s)}function Se(e){const t=pe(e,"date"),s=pe(e,"modified"),n=ne(e).status;return("draft"===n||"auto-draft"===n||"pending"===n)&&(t===s||null===t)}function ke(e){return!!e.deleting.pending}function Ce(e){return!!e.saving.pending}const Pe=(0,d.createRegistrySelector)((e=>t=>{const s=e(u.store).__experimentalGetEntitiesBeingSaved(),{type:n,id:o}=ne(t);return s.some((e=>"postType"!==e.kind||e.name!==n||e.key!==o))})),je=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=re(t);return!e(u.store).getLastEntitySaveError("postType",s,n)})),Ee=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=re(t);return!!e(u.store).getLastEntitySaveError("postType",s,n)}));function Te(e){return Ce(e)&&Boolean(e.saving.options?.isAutosave)}function Be(e){return Ce(e)&&Boolean(e.saving.options?.isPreview)}function Ie(e){if(e.saving.pending||Ce(e))return;let t=me(e,"preview_link");t&&"draft"!==ne(e).status||(t=pe(e,"link"),t&&(t=(0,w.addQueryArgs)(t,{preview:!0})));const s=pe(e,"featured_media");return t&&s?(0,w.addQueryArgs)(t,{_thumbnail_id:s}):t}const Ne=(0,d.createRegistrySelector)((e=>()=>{const t=e(g.store).getBlocks();if(t.length>2)return null;let s;if(1===t.length&&(s=t[0].name,"core/embed"===s)){const e=t[0].attributes?.providerNameSlug;["youtube","vimeo"].includes(e)?s="core/video":["spotify","soundcloud"].includes(e)&&(s="core/audio")}switch(2===t.length&&"core/paragraph"===t[1].name&&(s=t[0].name),s){case"core/image":return"image";case"core/quote":case"core/pullquote":return"quote";case"core/gallery":return"gallery";case"core/video":return"video";case"core/audio":return"audio";default:return null}})),Re=(0,d.createRegistrySelector)((e=>t=>{const s=re(t),n=oe(t),o=e(u.store).getEditedEntityRecord("postType",n,s);if(o){if("function"==typeof o.content)return o.content(o);if(o.blocks)return(0,x.__unstableSerializeAndClean)(o.blocks);if(o.content)return o.content}return""}));function De(e){return Ce(e)&&!_e(e)&&"publish"===pe(e,"status")}function Ae(e){const t=pe(e,"permalink_template");return j.test(t)}function Me(e){const t=Oe(e);if(!t)return null;const{prefix:s,postName:n,suffix:o}=t;return Ae(e)?s+n+o:s}function Le(e){return pe(e,"slug")||(0,w.cleanForSlug)(pe(e,"title"))||re(e)}function Oe(e){const t=pe(e,"permalink_template");if(!t)return null;const s=pe(e,"slug")||pe(e,"generated_slug"),[n,o]=t.split(j);return{prefix:n,postName:s,suffix:o}}function Fe(e){return e.postLock.isLocked}function Ve(e){return Object.keys(e.postSavingLock).length>0}function Ue(e){return Object.keys(e.postAutosavingLock).length>0}function He(e){return e.postLock.isTakeover}function ze(e){return e.postLock.user}function Ge(e){return e.postLock.activePostLock}function $e(e){return Boolean(ne(e)._links?.hasOwnProperty("wp:action-unfiltered-html"))}const We=(0,d.createRegistrySelector)((e=>()=>!!e(C.store).get("core","isPublishSidebarEnabled"))),Ze=(0,d.createSelector)((e=>pe(e,"blocks")||(0,x.parse)(Re(e))),(e=>[pe(e,"blocks"),Re(e)]));function Ye(e,t){return e.removedPanels.includes(t)}const qe=(0,d.createRegistrySelector)((e=>(t,s)=>{const n=e(C.store).get("core","inactivePanels");return!Ye(t,s)&&!n?.includes(s)})),Ke=(0,d.createRegistrySelector)((e=>(t,s)=>{const n=e(C.store).get("core","openPanels");return!!n?.includes(s)}));function Qe(e){return k()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),pe(e,"selection")?.selectionStart}function Xe(e){return k()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),pe(e,"selection")?.selectionEnd}function Je(e){return pe(e,"selection")}function et(e){return!!e.postId}function tt(e){return e.editorSettings}function st(e){return e.renderingMode}const nt=(0,d.createRegistrySelector)((e=>t=>$(e(g.store)).isZoomOut()?"Desktop":t.deviceType));function ot(e){return e.listViewPanel}function rt(e){return!!e.blockInserterPanel}const it=(0,d.createRegistrySelector)((e=>()=>e(C.store).get("core","editorMode")??"visual"));function at(){return k()("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function lt(){return k()("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function ct(e){return(0,d.createRegistrySelector)((t=>(s,...n)=>(k()("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`",version:"6.2"}),t(g.store)[e](...n))))}const dt=ct("getBlockName"),ut=ct("isBlockValid"),pt=ct("getBlockAttributes"),mt=ct("getBlock"),ht=ct("getBlocks"),gt=ct("getClientIdsOfDescendants"),_t=ct("getClientIdsWithDescendants"),ft=ct("getGlobalBlockCount"),bt=ct("getBlocksByClientId"),yt=ct("getBlockCount"),xt=ct("getBlockSelectionStart"),vt=ct("getBlockSelectionEnd"),wt=ct("getSelectedBlockCount"),St=ct("hasSelectedBlock"),kt=ct("getSelectedBlockClientId"),Ct=ct("getSelectedBlock"),Pt=ct("getBlockRootClientId"),jt=ct("getBlockHierarchyRootClientId"),Et=ct("getAdjacentBlockClientId"),Tt=ct("getPreviousBlockClientId"),Bt=ct("getNextBlockClientId"),It=ct("getSelectedBlocksInitialCaretPosition"),Nt=ct("getMultiSelectedBlockClientIds"),Rt=ct("getMultiSelectedBlocks"),Dt=ct("getFirstMultiSelectedBlockClientId"),At=ct("getLastMultiSelectedBlockClientId"),Mt=ct("isFirstMultiSelectedBlock"),Lt=ct("isBlockMultiSelected"),Ot=ct("isAncestorMultiSelected"),Ft=ct("getMultiSelectedBlocksStartClientId"),Vt=ct("getMultiSelectedBlocksEndClientId"),Ut=ct("getBlockOrder"),Ht=ct("getBlockIndex"),zt=ct("isBlockSelected"),Gt=ct("hasSelectedInnerBlock"),$t=ct("isBlockWithinSelection"),Wt=ct("hasMultiSelection"),Zt=ct("isMultiSelecting"),Yt=ct("isSelectionEnabled"),qt=ct("getBlockMode"),Kt=ct("isTyping"),Qt=ct("isCaretWithinFormattedText"),Xt=ct("getBlockInsertionPoint"),Jt=ct("isBlockInsertionPointVisible"),es=ct("isValidTemplate"),ts=ct("getTemplate"),ss=ct("getTemplateLock"),ns=ct("canInsertBlockType"),os=ct("getInserterItems"),rs=ct("hasInserterItems"),is=ct("getBlockListSettings"),as=(0,d.createRegistrySelector)((e=>()=>(k()("select('core/editor').__experimentalGetDefaultTemplateTypes",{since:"6.8",alternative:"select('core/core-data').getCurrentTheme()?.default_template_types"}),e(u.store).getCurrentTheme()?.default_template_types))),ls=(0,d.createRegistrySelector)((e=>(0,d.createSelector)((()=>{k()("select('core/editor').__experimentalGetDefaultTemplatePartAreas",{since:"6.8",alternative:"select('core/core-data').getCurrentTheme()?.default_template_part_areas"});return(e(u.store).getCurrentTheme()?.default_template_part_areas||[]).map((e=>({...e,icon:H(e.icon)})))})))),cs=(0,d.createRegistrySelector)((e=>(0,d.createSelector)(((t,s)=>{k()("select('core/editor').__experimentalGetDefaultTemplateType",{since:"6.8"});const n=e(u.store).getCurrentTheme()?.default_template_types;return n?Object.values(n).find((e=>e.slug===s))??q:q})))),ds=(0,d.createRegistrySelector)((e=>(0,d.createSelector)(((t,s)=>{if(k()("select('core/editor').__experimentalGetTemplateInfo",{since:"6.8"}),!s)return q;const n=e(u.store).getCurrentTheme(),o=n?.default_template_types||[];return Y({template:s,templateAreas:n?.default_template_part_areas||[],templateTypes:o})})))),us=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=e(u.store).getPostType(s);return n?.labels?.singular_name}));function ps(e){return e.publishSidebarActive}const ms=window.wp.a11y,hs=window.wp.apiFetch;var gs=s.n(hs);const _s=window.wp.notices,fs=window.wp.i18n;function bs(e,t){return`wp-autosave-block-editor-post-${t?"auto-draft":e}`}function ys(e,t){window.sessionStorage.removeItem(bs(e,t))}const xs=(e,t,s)=>({dispatch:n})=>{n.setEditedPost(e.type,e.id);if("auto-draft"===e.status&&s){let o;o="content"in t?t.content:e.content.raw;let r=(0,x.parse)(o);r=(0,x.synchronizeBlocksWithTemplate)(r,s),n.resetEditorBlocks(r,{__unstableShouldCreateUndoLevel:!1})}t&&Object.values(t).some((([t,s])=>s!==(e[t]?.raw??e[t])))&&n.editPost(t)};function vs(){return k()("wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor",{since:"6.5"}),{type:"DO_NOTHING"}}function ws(){return k()("wp.data.dispatch( 'core/editor' ).resetPost",{since:"6.0",version:"6.3",alternative:"Initialize the editor with the setupEditorState action"}),{type:"DO_NOTHING"}}function Ss(){return k()("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function ks(e){return k()("wp.data.dispatch( 'core/editor' ).setupEditorState",{since:"6.5",alternative:"wp.data.dispatch( 'core/editor' ).setEditedPost"}),Cs(e.type,e.id)}function Cs(e,t){return{type:"SET_EDITED_POST",postType:e,postId:t}}const Ps=(e,t)=>({select:s,registry:n})=>{const{id:o,type:r}=s.getCurrentPost();n.dispatch(u.store).editEntityRecord("postType",r,o,e,t)},js=(e={})=>async({select:t,dispatch:s,registry:n})=>{if(!t.isEditedPostSaveable())return;const o=t.getEditedPostContent();e.isAutosave||s.editPost({content:o},{undoIgnore:!0});const r=t.getCurrentPost();let i={id:r.id,...n.select(u.store).getEntityRecordNonTransientEdits("postType",r.type,r.id),content:o};s({type:"REQUEST_POST_UPDATE_START",options:e});let a=!1;try{i=await(0,h.applyFiltersAsync)("editor.preSavePost",i,e)}catch(e){a=e}if(!a)try{await n.dispatch(u.store).saveEntityRecord("postType",r.type,i,e)}catch(e){a=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while updating.")}if(a||(a=n.select(u.store).getLastEntitySaveError("postType",r.type,r.id)),!a)try{await(0,h.applyFilters)("editor.__unstableSavePost",Promise.resolve(),e)}catch(e){a=e}if(!a)try{await(0,h.doActionAsync)("editor.savePost",{id:r.id},e)}catch(e){a=e}if(s({type:"REQUEST_POST_UPDATE_FINISH",options:e}),a){const e=function(e){const{post:t,edits:s,error:n}=e;if(n&&"rest_autosave_no_changes"===n.code)return[];const o=-1!==["publish","private","future"].indexOf(t.status);if("offline_error"===n.code){const e={publish:(0,fs.__)("Publishing failed because you were offline."),private:(0,fs.__)("Publishing failed because you were offline."),future:(0,fs.__)("Scheduling failed because you were offline."),default:(0,fs.__)("Updating failed because you were offline.")};return[!o&&s.status in e?e[s.status]:e.default,{id:"editor-save"}]}const r={publish:(0,fs.__)("Publishing failed."),private:(0,fs.__)("Publishing failed."),future:(0,fs.__)("Scheduling failed."),default:(0,fs.__)("Updating failed.")};let i=!o&&s.status in r?r[s.status]:r.default;return n.message&&!/<\/?[^>]*>/.test(n.message)&&(i=[i,n.message].join(" ")),[i,{id:"editor-save"}]}({post:r,edits:i,error:a});e.length&&n.dispatch(_s.store).createErrorNotice(...e)}else{const s=t.getCurrentPost(),o=function(e){const{previousPost:t,post:s,postType:n}=e;if(e.options?.isAutosave)return[];const o=["publish","private","future"],r=o.includes(t.status),i=o.includes(s.status),a="trash"===s.status&&"trash"!==t.status;let l,c,d=n?.viewable??!1;a?(l=n.labels.item_trashed,d=!1):r||i?r&&!i?(l=n.labels.item_reverted_to_draft,d=!1):l=!r&&i?{publish:n.labels.item_published,private:n.labels.item_published_privately,future:n.labels.item_scheduled}[s.status]:n.labels.item_updated:(l=(0,fs.__)("Draft saved."),c=!0);const u=[];return d&&u.push({label:c?(0,fs.__)("View Preview"):n.labels.view_item,url:s.link,openInNewTab:!0}),[l,{id:"editor-save",type:"snackbar",actions:u}]}({previousPost:r,post:s,postType:await n.resolveSelect(u.store).getPostType(s.type),options:e});o.length&&n.dispatch(_s.store).createSuccessNotice(...o),e.isAutosave||n.dispatch(g.store).__unstableMarkLastChangeAsPersistent()}};function Es(){return k()("wp.data.dispatch( 'core/editor' ).refreshPost",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}const Ts=()=>async({select:e,dispatch:t,registry:s})=>{const n=e.getCurrentPostType(),o=await s.resolveSelect(u.store).getPostType(n),{rest_base:r,rest_namespace:i="wp/v2"}=o;t({type:"REQUEST_POST_DELETE_START"});try{const s=e.getCurrentPost();await gs()({path:`/${i}/${r}/${s.id}`,method:"DELETE"}),await t.savePost()}catch(e){s.dispatch(_s.store).createErrorNotice(...(a={error:e},[a.error.message&&"unknown_error"!==a.error.code?a.error.message:(0,fs.__)("Trashing failed"),{id:"editor-trash-fail"}]))}var a;t({type:"REQUEST_POST_DELETE_FINISH"})},Bs=({local:e=!1,...t}={})=>async({select:s,dispatch:n})=>{const o=s.getCurrentPost();if("wp_template"!==o.type)if(e){const e=s.isEditedPostNew(),t=s.getEditedPostAttribute("title"),n=s.getEditedPostAttribute("content"),r=s.getEditedPostAttribute("excerpt");!function(e,t,s,n,o){window.sessionStorage.setItem(bs(e,t),JSON.stringify({post_title:s,content:n,excerpt:o}))}(o.id,e,t,n,r)}else await n.savePost({isAutosave:!0,...t})},Is=({forceIsAutosaveable:e}={})=>async({select:t,dispatch:s})=>{if((e||t.isEditedPostAutosaveable())&&!t.isPostLocked()){["draft","auto-draft"].includes(t.getEditedPostAttribute("status"))?await s.savePost({isPreview:!0}):await s.autosave({isPreview:!0})}return t.getEditedPostPreviewLink()},Ns=()=>({registry:e})=>{e.dispatch(u.store).redo()},Rs=()=>({registry:e})=>{e.dispatch(u.store).undo()};function Ds(){return k()("wp.data.dispatch( 'core/editor' ).createUndoLevel",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function As(e){return{type:"UPDATE_POST_LOCK",lock:e}}const Ms=()=>({registry:e})=>{e.dispatch(C.store).set("core","isPublishSidebarEnabled",!0)},Ls=()=>({registry:e})=>{e.dispatch(C.store).set("core","isPublishSidebarEnabled",!1)};function Os(e){return{type:"LOCK_POST_SAVING",lockName:e}}function Fs(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function Vs(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function Us(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}const Hs=(e,t={})=>({select:s,dispatch:n,registry:o})=>{const{__unstableShouldCreateUndoLevel:r,selection:i}=t,a={blocks:e,selection:i};if(!1!==r){const{id:e,type:t}=s.getCurrentPost();if(o.select(u.store).getEditedEntityRecord("postType",t,e).blocks===a.blocks)return void o.dispatch(u.store).__unstableCreateUndoLevel("postType",t,e);a.content=({blocks:e=[]})=>(0,x.__unstableSerializeAndClean)(e)}n.editPost(a)};function zs(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const Gs=e=>({dispatch:t,registry:s,select:n})=>{n.__unstableIsEditorReady()&&(s.dispatch(g.store).clearSelectedBlock(),t.editPost({selection:void 0},{undoIgnore:!0})),t({type:"SET_RENDERING_MODE",mode:e})};function $s(e){return{type:"SET_DEVICE_TYPE",deviceType:e}}const Ws=e=>({registry:t})=>{const s=t.select(C.store).get("core","inactivePanels")??[];let n;n=!!s?.includes(e)?s.filter((t=>t!==e)):[...s,e],t.dispatch(C.store).set("core","inactivePanels",n)},Zs=e=>({registry:t})=>{const s=t.select(C.store).get("core","openPanels")??[];let n;n=!!s?.includes(e)?s.filter((t=>t!==e)):[...s,e],t.dispatch(C.store).set("core","openPanels",n)};function Ys(e){return{type:"REMOVE_PANEL",panelName:e}}const qs=e=>({dispatch:t,registry:s})=>{"object"==typeof e&&e.hasOwnProperty("rootClientId")&&e.hasOwnProperty("insertionIndex")&&$(s.dispatch(g.store)).setInsertionPoint({rootClientId:e.rootClientId,index:e.insertionIndex}),t({type:"SET_IS_INSERTER_OPENED",value:e})};function Ks(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const Qs=({createNotice:e=!0}={})=>({dispatch:t,registry:s})=>{const n=s.select(C.store).get("core","distractionFree");n&&s.dispatch(C.store).set("core","fixedToolbar",!1),n||s.batch((()=>{s.dispatch(C.store).set("core","fixedToolbar",!0),t.setIsInserterOpened(!1),t.setIsListViewOpened(!1),$(s.dispatch(g.store)).resetZoomLevel()})),s.batch((()=>{s.dispatch(C.store).set("core","distractionFree",!n),e&&s.dispatch(_s.store).createInfoNotice(n?(0,fs.__)("Distraction free mode deactivated."):(0,fs.__)("Distraction free mode activated."),{id:"core/editor/distraction-free-mode/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{s.batch((()=>{s.dispatch(C.store).set("core","fixedToolbar",n),s.dispatch(C.store).toggle("core","distractionFree")}))}}]})}))},Xs=()=>({registry:e})=>{e.dispatch(C.store).toggle("core","focusMode");const t=e.select(C.store).get("core","focusMode");e.dispatch(_s.store).createInfoNotice(t?(0,fs.__)("Spotlight mode activated."):(0,fs.__)("Spotlight mode deactivated."),{id:"core/editor/toggle-spotlight-mode/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{e.dispatch(C.store).toggle("core","focusMode")}}]})},Js=()=>({registry:e})=>{e.dispatch(C.store).toggle("core","fixedToolbar");const t=e.select(C.store).get("core","fixedToolbar");e.dispatch(_s.store).createInfoNotice(t?(0,fs.__)("Top toolbar activated."):(0,fs.__)("Top toolbar deactivated."),{id:"core/editor/toggle-top-toolbar/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{e.dispatch(C.store).toggle("core","fixedToolbar")}}]})},en=e=>({dispatch:t,registry:s})=>{if(s.dispatch(C.store).set("core","editorMode",e),"visual"!==e&&(s.dispatch(g.store).clearSelectedBlock(),$(s.dispatch(g.store)).resetZoomLevel()),"visual"===e)(0,ms.speak)((0,fs.__)("Visual editor selected"),"assertive");else if("text"===e){s.select(C.store).get("core","distractionFree")&&t.toggleDistractionFree(),(0,ms.speak)((0,fs.__)("Code editor selected"),"assertive")}};function tn(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function sn(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function nn(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const on=e=>(...t)=>({registry:s})=>{k()("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`",version:"6.2"}),s.dispatch(g.store)[e](...t)},rn=on("resetBlocks"),an=on("receiveBlocks"),ln=on("updateBlock"),cn=on("updateBlockAttributes"),dn=on("selectBlock"),un=on("startMultiSelect"),pn=on("stopMultiSelect"),mn=on("multiSelect"),hn=on("clearSelectedBlock"),gn=on("toggleSelection"),_n=on("replaceBlocks"),fn=on("replaceBlock"),bn=on("moveBlocksDown"),yn=on("moveBlocksUp"),xn=on("moveBlockToPosition"),vn=on("insertBlock"),wn=on("insertBlocks"),Sn=on("showInsertionPoint"),kn=on("hideInsertionPoint"),Cn=on("setTemplateValidity"),Pn=on("synchronizeTemplate"),jn=on("mergeBlocks"),En=on("removeBlocks"),Tn=on("removeBlock"),Bn=on("toggleBlockMode"),In=on("startTyping"),Nn=on("stopTyping"),Rn=on("enterFormattedText"),Dn=on("exitFormattedText"),An=on("insertDefaultBlock"),Mn=on("updateBlockListSettings"),Ln=window.wp.htmlEntities;function On(e){return!!e&&(e.source===D&&(Boolean(e?.plugin)||e?.has_theme_file))}var Fn=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})});var Vn={id:"view-post",label:(0,fs._x)("View","verb"),isPrimary:!0,icon:Fn,isEligible:e=>"trash"!==e.status,callback(e,{onActionPerformed:t}){const s=e[0];window.open(s?.link,"_blank"),t&&t(e)}};var Un={id:"view-post-revisions",context:"list",label(e){const t=e[0]._links?.["version-history"]?.[0]?.count??0;return(0,fs.sprintf)((0,fs.__)("View revisions (%d)"),t)},isEligible(e){if("trash"===e.status)return!1;return!!(e?._links?.["predecessor-version"]?.[0]?.id??null)&&(e?._links?.["version-history"]?.[0]?.count??0)>1},callback(e,{onActionPerformed:t}){const s=e[0],n=(0,w.addQueryArgs)("revision.php",{revision:s?._links?.["predecessor-version"]?.[0]?.id});document.location.href=n,t&&t(e)}};const Hn=window.wp.components;var zn=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})});var Gn=function(){return Gn=Object.assign||function(e){for(var t,s=1,n=arguments.length;s<n;s++)for(var o in t=arguments[s])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Gn.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function $n(e){return e.toLowerCase()}var Wn=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Zn=/[^A-Z0-9]+/gi;function Yn(e,t,s){return t instanceof RegExp?e.replace(t,s):t.reduce((function(e,t){return e.replace(t,s)}),e)}function qn(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var s=t.splitRegexp,n=void 0===s?Wn:s,o=t.stripRegexp,r=void 0===o?Zn:o,i=t.transform,a=void 0===i?$n:i,l=t.delimiter,c=void 0===l?" ":l,d=Yn(Yn(e,n,"$1\0$2"),r,"\0"),u=0,p=d.length;"\0"===d.charAt(u);)u++;for(;"\0"===d.charAt(p-1);)p--;return d.slice(u,p).split("\0").map(a).join(c)}(e,Gn({delimiter:"."},t))}function Kn(e,t){return void 0===t&&(t={}),qn(e,Gn({delimiter:"-"},t))}function Qn(e,t){return`fields-create-template-part-modal__area-option-${e}-${t}`}function Xn(e,t){return`fields-create-template-part-modal__area-option-description-${e}-${t}`}function Jn({modalTitle:e,...t}){const s=(0,d.useSelect)((e=>e(u.store).getPostType("wp_template_part")?.labels?.add_new_item),[]);return(0,c.jsx)(Hn.Modal,{title:e||s,onRequestClose:t.closeModal,overlayClassName:"fields-create-template-part-modal",focusOnMount:"firstContentElement",size:"medium",children:(0,c.jsx)(to,{...t})})}const eo=e=>"header"===e?O:"footer"===e?F:"sidebar"===e?V:U;function to({defaultArea:e="uncategorized",blocks:t=[],confirmLabel:s=(0,fs.__)("Add"),closeModal:n,onCreate:o,onError:r,defaultTitle:i=""}){const{createErrorNotice:a}=(0,d.useDispatch)(_s.store),{saveEntityRecord:l}=(0,d.useDispatch)(u.store),h=(0,d.useSelect)((e=>e(u.store).getEntityRecords("postType","wp_template_part",{per_page:-1})),[])??[],[g,_]=(0,p.useState)(i),[f,b]=(0,p.useState)(e),[y,v]=(0,p.useState)(!1),w=(0,m.useInstanceId)(Jn),S=(0,d.useSelect)((e=>e(u.store).getCurrentTheme()?.default_template_part_areas),[]);async function k(){if(g&&!y)try{v(!0);const e=((e,t)=>{const s=e.toLowerCase(),n=t.map((e=>e.title.rendered.toLowerCase()));if(!n.includes(s))return e;let o=2;for(;n.includes(`${s} ${o}`);)o++;return`${e} ${o}`})(g,h),s=(e=>Kn(e).replace(/[^\w-]+/g,"")||"wp-custom-part")(e),n=await l("postType","wp_template_part",{slug:s,title:e,content:(0,x.serialize)(t),area:f},{throwOnError:!0});await o(n)}catch(e){const t=e instanceof Error&&"code"in e&&e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while creating the template part.");a(t,{type:"snackbar"}),r?.()}finally{v(!1)}}return(0,c.jsx)("form",{onSubmit:async e=>{e.preventDefault(),await k()},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"4",children:[(0,c.jsx)(Hn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,fs.__)("Name"),value:g,onChange:_,required:!0}),(0,c.jsxs)("fieldset",{className:"fields-create-template-part-modal__area-fieldset",children:[(0,c.jsx)(Hn.BaseControl.VisualLabel,{as:"legend",children:(0,fs.__)("Area")}),(0,c.jsx)("div",{className:"fields-create-template-part-modal__area-radio-group",children:(S??[]).map((e=>{const t=eo(e.icon);return(0,c.jsxs)("div",{className:"fields-create-template-part-modal__area-radio-wrapper",children:[(0,c.jsx)("input",{type:"radio",id:Qn(e.area,w),name:`fields-create-template-part-modal__area-${w}`,value:e.area,checked:f===e.area,onChange:()=>{b(e.area)},"aria-describedby":Xn(e.area,w)}),(0,c.jsx)(Hn.Icon,{icon:t,className:"fields-create-template-part-modal__area-radio-icon"}),(0,c.jsx)("label",{htmlFor:Qn(e.area,w),className:"fields-create-template-part-modal__area-radio-label",children:e.label}),(0,c.jsx)(Hn.Icon,{icon:zn,className:"fields-create-template-part-modal__area-radio-checkmark"}),(0,c.jsx)("p",{className:"fields-create-template-part-modal__area-radio-description",id:Xn(e.area,w),children:e.description})]},e.area)}))})]}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{n()},children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!g||y,isBusy:y,children:s})]})]})})}function so(e){return"wp_template"===e.type||"wp_template_part"===e.type}function no(e,t=(0,fs.__)("(no title)")){let s="";return"string"==typeof e.title?s=(0,Ln.decodeEntities)(e.title):e.title&&"rendered"in e.title?s=(0,Ln.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title&&(s=(0,Ln.decodeEntities)(e.title.raw)),s||t}function oo(e){return!!e&&([e.source,e.source].includes("custom")&&!Boolean("wp_template"===e.type&&e?.plugin)&&!e.has_theme_file)}const ro={id:"duplicate-template-part",label:(0,fs._x)("Duplicate","action label"),isEligible:e=>"wp_template_part"===e.type,modalHeader:(0,fs._x)("Duplicate template part","action label"),modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t})=>{const[s]=e,n=(0,p.useMemo)((()=>s.blocks??(0,x.parse)("string"==typeof s.content?s.content:s.content.raw,{__unstableSkipMigrationLogs:!0})),[s.content,s.blocks]),{createSuccessNotice:o}=(0,d.useDispatch)(_s.store);return(0,c.jsx)(to,{blocks:n,defaultArea:s.area,defaultTitle:(0,fs.sprintf)((0,fs._x)("%s (Copy)","template part"),no(s)),onCreate:function(e){o((0,fs.sprintf)((0,fs._x)('"%s" duplicated.',"template part"),no(e)),{type:"snackbar",id:"edit-site-patterns-success"}),t?.()},onError:t,confirmLabel:(0,fs._x)("Duplicate","action label"),closeModal:t??(()=>{})})}};var io=ro;const ao=window.wp.patterns,{lock:lo,unlock:co}=(0,z.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/fields"),{CreatePatternModalContents:uo,useDuplicatePatternProps:po}=co(ao.privateApis),mo={id:"duplicate-pattern",label:(0,fs._x)("Duplicate","action label"),isEligible:e=>"wp_template_part"!==e.type,modalHeader:(0,fs._x)("Duplicate pattern","action label"),modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t})=>{const[s]=e,n=po({pattern:s,onSuccess:()=>t?.()});return(0,c.jsx)(uo,{onClose:t,confirmLabel:(0,fs._x)("Duplicate","action label"),...n})}};var ho=mo;const{PATTERN_TYPES:go}=co(ao.privateApis),_o={id:"rename-post",label:(0,fs.__)("Rename"),modalFocusOnMount:"firstContentElement",isEligible:e=>"trash"!==e.status&&(["wp_template","wp_template_part",...Object.values(go)].includes(e.type)?function(e){return"wp_template"===e.type}(e)?oo(e)&&e.is_custom&&e.permissions?.update:function(e){return"wp_template_part"===e.type}(e)?"custom"===e.source&&!e?.has_theme_file&&e.permissions?.update:e.type===go.user&&e.permissions?.update:e.permissions?.update),RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n]=e,[o,r]=(0,p.useState)((()=>no(n,""))),{editEntityRecord:i,saveEditedEntityRecord:a}=(0,d.useDispatch)(u.store),{createSuccessNotice:l,createErrorNotice:m}=(0,d.useDispatch)(_s.store);return(0,c.jsx)("form",{onSubmit:async function(c){c.preventDefault();try{await i("postType",n.type,n.id,{title:o}),r(""),t?.(),await a("postType",n.type,n.id,{throwOnError:!0}),l((0,fs.__)("Name updated"),{type:"snackbar"}),s?.(e)}catch(e){const t=e,s=t.message&&"unknown_error"!==t.code?t.message:(0,fs.__)("An error occurred while updating the name");m(s,{type:"snackbar"})}},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Name"),value:o,onChange:r,required:!0}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,fs.__)("Save")})]})]})})}};var fo=_o;const bo={id:"order-pages",label:(0,fs.__)("Order"),isEligible:({status:e})=>"trash"!==e,modalFocusOnMount:"firstContentElement",RenderModal:function({items:e,closeModal:t,onActionPerformed:s}){const[n,o]=(0,p.useState)(e[0]),{editEntityRecord:r,saveEditedEntityRecord:i}=(0,d.useDispatch)(u.store),{createSuccessNotice:a,createErrorNotice:l}=(0,d.useDispatch)(_s.store),m=function(e){return"number"==typeof e.menu_order&&Number.isInteger(e.menu_order)&&e.menu_order>0}(n);return(0,c.jsx)("form",{onSubmit:async function(o){if(o.preventDefault(),m)try{await r("postType",n.type,n.id,{menu_order:n.menu_order}),t?.(),await i("postType",n.type,n.id,{throwOnError:!0}),a((0,fs.__)("Order updated."),{type:"snackbar"}),s?.(e)}catch(e){const t=e,s=t.message&&"unknown_error"!==t.code?t.message:(0,fs.__)("An error occurred while updating the order");l(s,{type:"snackbar"})}},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)("div",{children:(0,fs.__)("Determines the order of pages. Pages with the same order value are sorted alphabetically. Negative order values are supported.")}),(0,c.jsx)(Hn.__experimentalInputControl,{__next40pxDefaultSize:!0,label:(0,fs.__)("Order"),type:"number",value:"number"==typeof n.menu_order&&Number.isInteger(n.menu_order)?String(n.menu_order):"",onChange:e=>{const t=parseInt(e,10);o({...n,menu_order:isNaN(t)?void 0:t})}}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",accessibleWhenDisabled:!0,disabled:!m,children:(0,fs.__)("Save")})]})]})})}};var yo=bo;"stream"in Blob.prototype||Object.defineProperty(Blob.prototype,"stream",{value(){return new Response(this).body}}),"setBigUint64"in DataView.prototype||Object.defineProperty(DataView.prototype,"setBigUint64",{value(e,t,s){const n=Number(0xffffffffn&t),o=Number(t>>32n);this.setUint32(e+(s?0:4),n,s),this.setUint32(e+(s?4:0),o,s)}});var xo=e=>new DataView(new ArrayBuffer(e)),vo=e=>new Uint8Array(e.buffer||e),wo=e=>(new TextEncoder).encode(String(e)),So=e=>Math.min(4294967295,Number(e)),ko=e=>Math.min(65535,Number(e));function Co(e,t,s){void 0===t||t instanceof Date||(t=new Date(t));const n=void 0!==e;if(s||(s=n?436:509),e instanceof File)return{isFile:n,t:t||new Date(e.lastModified),bytes:e.stream(),mode:s};if(e instanceof Response)return{isFile:n,t:t||new Date(e.headers.get("Last-Modified")||Date.now()),bytes:e.body,mode:s};if(void 0===t)t=new Date;else if(isNaN(t))throw new Error("Invalid modification date.");if(!n)return{isFile:n,t,mode:s};if("string"==typeof e)return{isFile:n,t,bytes:wo(e),mode:s};if(e instanceof Blob)return{isFile:n,t,bytes:e.stream(),mode:s};if(e instanceof Uint8Array||e instanceof ReadableStream)return{isFile:n,t,bytes:e,mode:s};if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{isFile:n,t,bytes:vo(e),mode:s};if(Symbol.asyncIterator in e)return{isFile:n,t,bytes:Po(e[Symbol.asyncIterator]()),mode:s};throw new TypeError("Unsupported input format.")}function Po(e,t=e){return new ReadableStream({async pull(t){let s=0;for(;t.desiredSize>s;){const n=await e.next();if(!n.value){t.close();break}{const e=jo(n.value);t.enqueue(e),s+=e.byteLength}}},cancel(e){t.throw?.(e)}})}function jo(e){return"string"==typeof e?wo(e):e instanceof Uint8Array?e:vo(e)}function Eo(e,t,s){let[n,o]=function(e){return e?e instanceof Uint8Array?[e,1]:ArrayBuffer.isView(e)||e instanceof ArrayBuffer?[vo(e),1]:[wo(e),0]:[void 0,0]}(t);if(e instanceof File)return{i:Bo(n||wo(e.name)),o:BigInt(e.size),u:o};if(e instanceof Response){const t=e.headers.get("content-disposition"),r=t&&t.match(/;\s*filename\*?\s*=\s*(?:UTF-\d+''|)["']?([^;"'\r\n]*)["']?(?:;|$)/i),i=r&&r[1]||e.url&&new URL(e.url).pathname.split("/").findLast(Boolean),a=i&&decodeURIComponent(i),l=s||+e.headers.get("content-length");return{i:Bo(n||wo(a)),o:BigInt(l),u:o}}return n=Bo(n,void 0!==e||void 0!==s),"string"==typeof e?{i:n,o:BigInt(wo(e).length),u:o}:e instanceof Blob?{i:n,o:BigInt(e.size),u:o}:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?{i:n,o:BigInt(e.byteLength),u:o}:{i:n,o:To(e,s),u:o}}function To(e,t){return t>-1?BigInt(t):e?void 0:0n}function Bo(e,t=1){if(!e||e.every((e=>47===e)))throw new Error("The file must have a name.");if(t)for(;47===e[e.length-1];)e=e.subarray(0,-1);else 47!==e[e.length-1]&&(e=new Uint8Array([...e,47]));return e}var Io=new Uint32Array(256);for(let e=0;e<256;++e){let t=e;for(let e=0;e<8;++e)t=t>>>1^(1&t&&3988292384);Io[e]=t}function No(e,t=0){t=~t;for(var s=0,n=e.length;s<n;s++)t=t>>>8^Io[255&t^e[s]];return~t>>>0}function Ro(e,t,s=0){const n=e.getSeconds()>>1|e.getMinutes()<<5|e.getHours()<<11,o=e.getDate()|e.getMonth()+1<<5|e.getFullYear()-1980<<9;t.setUint16(s,n,1),t.setUint16(s+2,o,1)}function Do({i:e,u:t},s){return 8*(!t||(s??function(e){try{Ao.decode(e)}catch{return 0}return 1}(e)))}var Ao=new TextDecoder("utf8",{fatal:1});function Mo(e,t=0){const s=xo(30);return s.setUint32(0,1347093252),s.setUint32(4,754976768|t),Ro(e.t,s,10),s.setUint16(26,e.i.length,1),vo(s)}async function*Lo(e){let{bytes:t}=e;if("then"in t&&(t=await t),t instanceof Uint8Array)yield t,e.l=No(t,0),e.o=BigInt(t.length);else{e.o=0n;const s=t.getReader();for(;;){const{value:t,done:n}=await s.read();if(n)break;e.l=No(t,e.l),e.o+=BigInt(t.length),yield t}}}function Oo(e,t){const s=xo(16+(t?8:0));return s.setUint32(0,1347094280),s.setUint32(4,e.isFile?e.l:0,1),t?(s.setBigUint64(8,e.o,1),s.setBigUint64(16,e.o,1)):(s.setUint32(8,So(e.o),1),s.setUint32(12,So(e.o),1)),vo(s)}function Fo(e,t,s=0,n=0){const o=xo(46);return o.setUint32(0,1347092738),o.setUint32(4,755182848),o.setUint16(8,2048|s),Ro(e.t,o,12),o.setUint32(16,e.isFile?e.l:0,1),o.setUint32(20,So(e.o),1),o.setUint32(24,So(e.o),1),o.setUint16(28,e.i.length,1),o.setUint16(30,n,1),o.setUint16(40,e.mode|(e.isFile?32768:16384),1),o.setUint32(42,So(t),1),vo(o)}function Vo(e,t,s){const n=xo(s);return n.setUint16(0,1,1),n.setUint16(2,s-4,1),16&s&&(n.setBigUint64(4,e.o,1),n.setBigUint64(12,e.o,1)),n.setBigUint64(s-8,t,1),vo(n)}function Uo(e){return e instanceof File||e instanceof Response?[[e],[e]]:[[e.input,e.name,e.size],[e.input,e.lastModified,e.mode]]}function Ho(e,t={}){const s={"Content-Type":"application/zip","Content-Disposition":"attachment"};return("bigint"==typeof t.length||Number.isInteger(t.length))&&t.length>0&&(s["Content-Length"]=String(t.length)),t.metadata&&(s["Content-Length"]=String((e=>function(e){let t=BigInt(22),s=0n,n=0;for(const o of e){if(!o.i)throw new Error("Every file must have a non-empty name.");if(void 0===o.o)throw new Error(`Missing size for file "${(new TextDecoder).decode(o.i)}".`);const e=o.o>=0xffffffffn,r=s>=0xffffffffn;s+=BigInt(46+o.i.length+(e&&8))+o.o,t+=BigInt(o.i.length+46+(12*r|28*e)),n||(n=e)}return(n||s>=0xffffffffn)&&(t+=BigInt(76)),t+s}(function*(e){for(const t of e)yield Eo(...Uo(t)[0])}(e)))(t.metadata))),new Response(zo(e,t),{headers:s})}function zo(e,t={}){const s=function(e){const t=e[Symbol.iterator in e?Symbol.iterator:Symbol.asyncIterator]();return{async next(){const e=await t.next();if(e.done)return e;const[s,n]=Uo(e.value);return{done:0,value:Object.assign(Co(...n),Eo(...s))}},throw:t.throw?.bind(t),[Symbol.asyncIterator](){return this}}}(e);return Po(async function*(e,t){const s=[];let n=0n,o=0n,r=0;for await(const i of e){const e=Do(i,t.buffersAreUTF8);yield Mo(i,e),yield new Uint8Array(i.i),i.isFile&&(yield*Lo(i));const a=i.o>=0xffffffffn,l=12*(n>=0xffffffffn)|28*a;yield Oo(i,a),s.push(Fo(i,n,e,l)),s.push(i.i),l&&s.push(Vo(i,n,l)),a&&(n+=8n),o++,n+=BigInt(46+i.i.length)+i.o,r||(r=a)}let i=0n;for(const e of s)yield e,i+=BigInt(e.length);if(r||n>=0xffffffffn){const e=xo(76);e.setUint32(0,1347094022),e.setBigUint64(4,BigInt(44),1),e.setUint32(12,755182848),e.setBigUint64(24,o,1),e.setBigUint64(32,o,1),e.setBigUint64(40,i,1),e.setBigUint64(48,n,1),e.setUint32(56,1347094023),e.setBigUint64(64,n+i,1),e.setUint32(72,1,1),yield vo(e)}const a=xo(22);a.setUint32(0,1347093766),a.setUint16(8,ko(o),1),a.setUint16(10,ko(o),1),a.setUint32(12,So(i),1),a.setUint32(16,So(n),1),yield vo(a)}(s,t),s)}const Go=window.wp.blob;var $o=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"})});function Wo(e){return JSON.stringify({__file:e.type,title:no(e),content:"string"==typeof e.content?e.content:e.content?.raw,syncStatus:e.wp_pattern_sync_status},null,2)}var Zo={id:"export-pattern",label:(0,fs.__)("Export as JSON"),icon:$o,supportsBulk:!0,isEligible:e=>"wp_block"===e.type,callback:async e=>{if(1===e.length)return(0,Go.downloadBlob)(`${Kn(no(e[0])||e[0].slug)}.json`,Wo(e[0]),"application/json");const t={},s=e.map((e=>{const s=Kn(no(e)||e.slug);return t[s]=(t[s]||0)+1,{name:s+(t[s]>1?"-"+(t[s]-1):"")+".json",lastModified:new Date,input:Wo(e)}}));return(0,Go.downloadBlob)((0,fs.__)("patterns-export")+".zip",await Ho(s).blob(),"application/zip")}},Yo=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"})});var qo={id:"restore",label:(0,fs.__)("Restore"),isPrimary:!0,icon:Yo,supportsBulk:!0,isEligible:e=>!so(e)&&"wp_block"!==e.type&&"trash"===e.status&&e.permissions?.update,async callback(e,{registry:t,onActionPerformed:s}){const{createSuccessNotice:n,createErrorNotice:o}=t.dispatch(_s.store),{editEntityRecord:r,saveEditedEntityRecord:i}=t.dispatch(u.store);await Promise.allSettled(e.map((e=>r("postType",e.type,e.id,{status:"draft"}))));const a=await Promise.allSettled(e.map((e=>i("postType",e.type,e.id,{throwOnError:!0}))));if(a.every((({status:e})=>"fulfilled"===e))){let t;t=1===e.length?(0,fs.sprintf)((0,fs.__)('"%s" has been restored.'),no(e[0])):"page"===e[0].type?(0,fs.sprintf)((0,fs.__)("%d pages have been restored."),e.length):(0,fs.sprintf)((0,fs.__)("%d posts have been restored."),e.length),n(t,{type:"snackbar",id:"restore-post-action"}),s&&s(e)}else{let e;if(1===a.length){const t=a[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while restoring the post.")}else{const t=new Set,s=a.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while restoring the posts."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while restoring the posts: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while restoring the posts: %s"),[...t].join(","))}o(e,{type:"snackbar"})}}};const Ko=async(e,{allowUndo:t=!0}={})=>{const s="edit-site-template-reverted";var n;if((0,d.dispatch)(_s.store).removeNotice(s),(n=e)&&"custom"===n.source&&(Boolean(n?.plugin)||n?.has_theme_file))try{const n=(0,d.select)(u.store).getEntityConfig("postType",e.type);if(!n)return void(0,d.dispatch)(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const o=(0,w.addQueryArgs)(`${n.baseURL}/${e.id}`,{context:"edit",source:e.origin}),r=await gs()({path:o});if(!r)return void(0,d.dispatch)(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const i=({blocks:e=[]})=>(0,x.__unstableSerializeAndClean)(e),a=(0,d.select)(u.store).getEditedEntityRecord("postType",e.type,e.id);(0,d.dispatch)(u.store).editEntityRecord("postType",e.type,e.id,{content:i,blocks:a.blocks,source:"custom"},{undoIgnore:!0});const l=(0,x.parse)(r?.content?.raw);if((0,d.dispatch)(u.store).editEntityRecord("postType",e.type,r.id,{content:i,blocks:l,source:"theme"}),t){const t=()=>{(0,d.dispatch)(u.store).editEntityRecord("postType",e.type,a.id,{content:i,blocks:a.blocks,source:"custom"})};(0,d.dispatch)(_s.store).createSuccessNotice((0,fs.__)("Template reset."),{type:"snackbar",id:s,actions:[{label:(0,fs.__)("Undo"),onClick:t}]})}}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("Template revert failed. Please reload.");(0,d.dispatch)(_s.store).createErrorNotice(t,{type:"snackbar"})}else(0,d.dispatch)(_s.store).createErrorNotice((0,fs.__)("This template is not revertable."),{type:"snackbar"})},Qo={id:"reset-post",label:(0,fs.__)("Reset"),isEligible:e=>so(e)&&"custom"===e?.source&&(Boolean("wp_template"===e.type&&e?.plugin)||e?.has_theme_file),icon:Yo,supportsBulk:!0,hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n,o]=(0,p.useState)(!1),{saveEditedEntityRecord:r}=(0,d.useDispatch)(u.store),{createSuccessNotice:i,createErrorNotice:a}=(0,d.useDispatch)(_s.store);return(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Reset to default and clear all customizations?")}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:n,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{o(!0),await(async()=>{try{for(const t of e)await Ko(t,{allowUndo:!1}),await r("postType",t.type,t.id);i(e.length>1?(0,fs.sprintf)((0,fs.__)("%d items reset."),e.length):(0,fs.sprintf)((0,fs.__)('"%s" reset.'),no(e[0])),{type:"snackbar",id:"revert-template-action"})}catch(t){let s;s="wp_template"===e[0].type?1===e.length?(0,fs.__)("An error occurred while reverting the template."):(0,fs.__)("An error occurred while reverting the templates."):1===e.length?(0,fs.__)("An error occurred while reverting the template part."):(0,fs.__)("An error occurred while reverting the template parts.");const n=t,o=n.message&&"unknown_error"!==n.code?n.message:s;a(o,{type:"snackbar"})}})(),s?.(e),o(!1),t?.()},isBusy:n,disabled:n,accessibleWhenDisabled:!0,children:(0,fs.__)("Reset")})]})]})}};var Xo=Qo,Jo=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})});function er(e){const t=new Set;if(1===e.length){const s=e[0];s.reason?.message&&t.add(s.reason.message)}else{const s=e.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}}return t}const{PATTERN_TYPES:tr}=co(ao.privateApis),sr={id:"delete-post",label:(0,fs.__)("Delete"),isPrimary:!0,icon:Jo,isEligible:e=>so(e)?oo(e):e.type===tr.user,supportsBulk:!0,hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n,o]=(0,p.useState)(!1),r=e.every((e=>so(e)&&e?.has_theme_file));return(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:e.length>1?(0,fs.sprintf)((0,fs._n)("Delete %d item?","Delete %d items?",e.length),e.length):(0,fs.sprintf)((0,fs._x)('Delete "%s"?',"template part"),no(e[0]))}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{variant:"tertiary",onClick:t,disabled:n,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{variant:"primary",onClick:async()=>{o(!0);const n={success:{messages:{getMessage:e=>r?(0,fs.sprintf)((0,fs.__)('"%s" reset.'),(0,Ln.decodeEntities)(no(e))):(0,fs.sprintf)((0,fs._x)('"%s" deleted.',"template part"),(0,Ln.decodeEntities)(no(e))),getBatchMessage:()=>r?(0,fs.__)("Items reset."):(0,fs.__)("Items deleted.")}},error:{messages:{getMessage:e=>1===e.size?[...e][0]:r?(0,fs.__)("An error occurred while reverting the item."):(0,fs.__)("An error occurred while deleting the item."),getBatchMessage:e=>0===e.size?r?(0,fs.__)("An error occurred while reverting the items."):(0,fs.__)("An error occurred while deleting the items."):1===e.size?r?(0,fs.sprintf)((0,fs.__)("An error occurred while reverting the items: %s"),[...e][0]):(0,fs.sprintf)((0,fs.__)("An error occurred while deleting the items: %s"),[...e][0]):r?(0,fs.sprintf)((0,fs.__)("Some errors occurred while reverting the items: %s"),[...e].join(",")):(0,fs.sprintf)((0,fs.__)("Some errors occurred while deleting the items: %s"),[...e].join(","))}}};await(async(e,t,s)=>{const{createSuccessNotice:n,createErrorNotice:o}=(0,d.dispatch)(_s.store),{deleteEntityRecord:r}=(0,d.dispatch)(u.store),i=await Promise.allSettled(e.map((e=>r("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(i.every((({status:e})=>"fulfilled"===e))){let o;o=1===i.length?t.success.messages.getMessage(e[0]):t.success.messages.getBatchMessage(e),n(o,{type:t.success.type??"snackbar",id:t.success.id}),s.onActionPerformed?.(e)}else{const e=er(i);let n="";n=1===i.length?t.error.messages.getMessage(e):t.error.messages.getBatchMessage(e),o(n,{type:t.error.type??"snackbar",id:t.error.id}),s.onActionError?.()}})(e,n,{onActionPerformed:s}),o(!1),t?.()},isBusy:n,disabled:n,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Delete")})]})]})}};var nr=sr;const or={id:"move-to-trash",label:(0,fs.__)("Trash"),isPrimary:!0,icon:Jo,isEligible:e=>!so(e)&&"wp_block"!==e.type&&(!!e.status&&!["auto-draft","trash"].includes(e.status)&&e.permissions?.delete),supportsBulk:!0,hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n,o]=(0,p.useState)(!1),{createSuccessNotice:r,createErrorNotice:i}=(0,d.useDispatch)(_s.store),{deleteEntityRecord:a}=(0,d.useDispatch)(u.store);return(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:1===e.length?(0,fs.sprintf)((0,fs.__)('Are you sure you want to move "%s" to the trash?'),no(e[0])):(0,fs.sprintf)((0,fs._n)("Are you sure you want to move %d item to the trash ?","Are you sure you want to move %d items to the trash ?",e.length),e.length)}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:n,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{o(!0);const n=await Promise.allSettled(e.map((e=>a("postType",e.type,e.id.toString(),{},{throwOnError:!0}))));if(n.every((({status:e})=>"fulfilled"===e))){let t;t=1===n.length?(0,fs.sprintf)((0,fs.__)('"%s" moved to the trash.'),no(e[0])):(0,fs.sprintf)((0,fs._n)("%d item moved to the trash.","%d items moved to the trash.",e.length),e.length),r(t,{type:"snackbar",id:"move-to-trash-action"})}else{let e;if(1===n.length){const t=n[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while moving the item to the trash.")}else{const t=new Set,s=n.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while moving the items to the trash."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while moving the item to the trash: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while moving the items to the trash: %s"),[...t].join(","))}i(e,{type:"snackbar"})}s&&s(e),o(!1),t?.()},isBusy:n,disabled:n,accessibleWhenDisabled:!0,children:(0,fs._x)("Trash","verb")})]})]})}};var rr=or;const ir={id:"permanently-delete",label:(0,fs.__)("Permanently delete"),supportsBulk:!0,icon:Jo,isEligible(e){if(so(e)||"wp_block"===e.type)return!1;const{status:t,permissions:s}=e;return"trash"===t&&s?.delete},hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n,o]=(0,p.useState)(!1),{createSuccessNotice:r,createErrorNotice:i}=(0,d.useDispatch)(_s.store),{deleteEntityRecord:a}=(0,d.useDispatch)(u.store);return(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:e.length>1?(0,fs.sprintf)((0,fs._n)("Are you sure you want to permanently delete %d item?","Are you sure you want to permanently delete %d items?",e.length),e.length):(0,fs.sprintf)((0,fs.__)('Are you sure you want to permanently delete "%s"?'),(0,Ln.decodeEntities)(no(e[0])))}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{variant:"tertiary",onClick:t,disabled:n,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{variant:"primary",onClick:async()=>{o(!0);const n=await Promise.allSettled(e.map((e=>a("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(n.every((({status:e})=>"fulfilled"===e))){let t;t=1===n.length?(0,fs.sprintf)((0,fs.__)('"%s" permanently deleted.'),no(e[0])):(0,fs.__)("The items were permanently deleted."),r(t,{type:"snackbar",id:"permanently-delete-post-action"}),s?.(e)}else{let e;if(1===n.length){const t=n[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while permanently deleting the item.")}else{const t=new Set,s=n.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while permanently deleting the items."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while permanently deleting the items: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while permanently deleting the items: %s"),[...t].join(","))}i(e,{type:"snackbar"})}o(!1),t?.()},isBusy:n,disabled:n,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Delete permanently")})]})]})}};var ar=ir;const lr=window.wp.mediaUtils;var cr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M5 11.25h14v1.5H5z"})});const dr={id:"featured_media",type:"media",label:(0,fs.__)("Featured Image"),Edit:({data:e,field:t,onChange:s})=>{const{id:n}=t,o=t.getValue({item:e}),r=(0,d.useSelect)((e=>{const{getEntityRecord:t}=e(u.store);return t("postType","attachment",o)}),[o]),i=(0,p.useCallback)((e=>s({[n]:e})),[n,s]),a=r?.source_url,l=r?.title?.rendered,m=(0,p.useRef)(null);return(0,c.jsx)("fieldset",{className:"fields-controls__featured-image",children:(0,c.jsx)("div",{className:"fields-controls__featured-image-container",children:(0,c.jsx)(lr.MediaUpload,{onSelect:e=>{i(e.id)},allowedTypes:["image"],render:({open:e})=>(0,c.jsx)("div",{ref:m,role:"button",tabIndex:-1,onClick:()=>{e()},onKeyDown:e,children:(0,c.jsxs)(Hn.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"24px 1fr 24px",children:[a&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("img",{className:"fields-controls__featured-image-image",alt:"",width:24,height:24,src:a}),(0,c.jsx)("span",{className:"fields-controls__featured-image-title",children:l})]}),!a&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"fields-controls__featured-image-placeholder",style:{width:"24px",height:"24px"}}),(0,c.jsx)("span",{className:"fields-controls__featured-image-title",children:(0,fs.__)("Choose an image…")})]}),a&&(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(Hn.Button,{size:"small",className:"fields-controls__featured-image-remove-button",icon:cr,onClick:e=>{e.stopPropagation(),i(0)}})})]})})})})})},render:({item:e,config:t})=>{const s=e?._embedded?.["wp:featuredmedia"]?.[0],n=s?.source_url;return n?(0,c.jsx)("img",{className:"fields-controls__featured-image-image",src:n,alt:"",srcSet:s?.media_details?.sizes?Object.values(s.media_details.sizes).map((e=>`${e.source_url} ${e.width}w`)).join(", "):void 0,sizes:t?.sizes||"100vw"}):(0,c.jsx)("span",{className:"fields-controls__featured-image-placeholder"})},enableSorting:!1,filterBy:!1};var ur=dr;function pr(e){var t,s,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(s=pr(e[t]))&&(n&&(n+=" "),n+=s)}else for(s in e)e[s]&&(n&&(n+=" "),n+=s);return n}const mr=function(){for(var e,t,s=0,n="",o=arguments.length;s<o;s++)(e=arguments[s])&&(t=pr(e))&&(n&&(n+=" "),n+=t);return n};var hr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"})});var gr=function({item:e}){const t=e?._embedded?.author?.[0]?.name,s=e?._embedded?.author?.[0]?.avatar_urls?.[48],[n,o]=(0,p.useState)(!1);return(0,c.jsxs)(Hn.__experimentalHStack,{alignment:"left",spacing:0,children:[!!s&&(0,c.jsx)("div",{className:mr("page-templates-author-field__avatar",{"is-loaded":n}),children:(0,c.jsx)("img",{onLoad:()=>o(!0),alt:(0,fs.__)("Author avatar"),src:s})}),!s&&(0,c.jsx)("div",{className:"page-templates-author-field__icon",children:(0,c.jsx)(Hn.Icon,{icon:hr})}),(0,c.jsx)("span",{className:"page-templates-author-field__name",children:t})]})};const _r={label:(0,fs.__)("Author"),id:"author",type:"integer",getElements:async()=>(await(0,d.resolveSelect)(u.store).getEntityRecords("root","user",{per_page:-1})??[]).map((({id:e,name:t})=>({value:e,label:t}))),render:gr,sort:(e,t,s)=>{const n=e._embedded?.author?.[0]?.name||"",o=t._embedded?.author?.[0]?.name||"";return"asc"===s?n.localeCompare(o):o.localeCompare(n)},filterBy:{operators:["isAny","isNone"]}};var fr=_r,br=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z"})}),yr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z"})}),xr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z"})}),vr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z"})}),wr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"})});var Sr=[{value:"draft",label:(0,fs.__)("Draft"),icon:br,description:(0,fs.__)("Not ready to publish.")},{value:"future",label:(0,fs.__)("Scheduled"),icon:yr,description:(0,fs.__)("Publish automatically on a chosen date.")},{value:"pending",label:(0,fs.__)("Pending Review"),icon:xr,description:(0,fs.__)("Waiting for review before publishing.")},{value:"private",label:(0,fs.__)("Private"),icon:vr,description:(0,fs.__)("Only visible to site admins and editors.")},{value:"publish",label:(0,fs.__)("Published"),icon:wr,description:(0,fs.__)("Visible to everyone.")},{value:"trash",label:(0,fs.__)("Trash"),icon:Jo}];var kr=function({item:e}){const t=Sr.find((({value:t})=>t===e.status)),s=t?.label||e.status,n=t?.icon;return(0,c.jsxs)(Hn.__experimentalHStack,{alignment:"left",spacing:0,children:[n&&(0,c.jsx)("div",{className:"edit-site-post-list__status-icon",children:(0,c.jsx)(Hn.Icon,{icon:n})}),(0,c.jsx)("span",{children:s})]})};var Cr={label:(0,fs.__)("Status"),id:"status",type:"text",elements:Sr,render:kr,Edit:"radio",enableSorting:!1,filterBy:{operators:["isAny"]}};const Pr=e=>(0,v.dateI18n)((0,v.getSettings)().formats.datetimeAbbreviated,(0,v.getDate)(e));var jr=({item:e})=>{if(["draft","private"].includes(e.status??""))return(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Modified: <time>%s</time></span>"),Pr(e.date??null)),{span:(0,c.jsx)("span",{}),time:(0,c.jsx)("time",{})});if("future"===e.status)return(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Scheduled: <time>%s</time></span>"),Pr(e.date??null)),{span:(0,c.jsx)("span",{}),time:(0,c.jsx)("time",{})});if("publish"===e.status)return(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Published: <time>%s</time></span>"),Pr(e.date??null)),{span:(0,c.jsx)("span",{}),time:(0,c.jsx)("time",{})});const t=(0,v.getDate)(e.modified??null)>(0,v.getDate)(e.date??null)?e.modified:e.date;return"pending"===e.status?(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Modified: <time>%s</time></span>"),Pr(t??null)),{span:(0,c.jsx)("span",{}),time:(0,c.jsx)("time",{})}):(0,c.jsx)("time",{children:Pr(e.date??null)})};var Er={id:"date",type:"datetime",label:(0,fs.__)("Date"),render:jr,filterBy:!1},Tr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"})});const Br=e=>"object"!=typeof e?"":e.slug||(0,w.cleanForSlug)(no(e))||e.id.toString(),Ir=({field:e,onChange:t,data:s})=>{const{id:n}=e,o=e.getValue({item:s})||Br(s),r=s.permalink_template||"",i=/%(?:postname|pagename)%/,[a,l]=r.split(i),u=a,h=l,g=i.test(r),_=(0,p.useRef)(o),f=o||_.current,b=g?`${u}${f}${h}`:(0,w.safeDecodeURIComponent)(s.link||"");(0,p.useEffect)((()=>{o&&void 0===_.current&&(_.current=o)}),[o]);const y=(0,p.useCallback)((e=>t({[n]:e})),[n,t]),{createNotice:x}=(0,d.useDispatch)(_s.store),v=(0,m.useCopyToClipboard)(b,(()=>{x("info",(0,fs.__)("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})})),S="editor-post-url__slug-description-"+(0,m.useInstanceId)(Ir);return(0,c.jsxs)("fieldset",{className:"fields-controls__slug",children:[g&&(0,c.jsxs)(Hn.__experimentalVStack,{children:[(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"0px",children:[(0,c.jsx)("span",{children:(0,fs.__)("Customize the last part of the Permalink.")}),(0,c.jsx)(Hn.ExternalLink,{href:"https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink",children:(0,fs.__)("Learn more")})]}),(0,c.jsx)(Hn.__experimentalInputControl,{__next40pxDefaultSize:!0,prefix:(0,c.jsx)(Hn.__experimentalInputControlPrefixWrapper,{children:"/"}),suffix:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,icon:Tr,ref:v,label:(0,fs.__)("Copy")}),label:(0,fs.__)("Link"),hideLabelFromVision:!0,value:o,autoComplete:"off",spellCheck:"false",type:"text",className:"fields-controls__slug-input",onChange:e=>{y(e)},onBlur:()=>{""===o&&y(_.current)},"aria-describedby":S}),(0,c.jsxs)("div",{className:"fields-controls__slug-help",children:[(0,c.jsx)("span",{className:"fields-controls__slug-help-visual-label",children:(0,fs.__)("Permalink:")}),(0,c.jsxs)(Hn.ExternalLink,{className:"fields-controls__slug-help-link",href:b,children:[(0,c.jsx)("span",{className:"fields-controls__slug-help-prefix",children:u}),(0,c.jsx)("span",{className:"fields-controls__slug-help-slug",children:f}),(0,c.jsx)("span",{className:"fields-controls__slug-help-suffix",children:h})]})]})]}),!g&&(0,c.jsx)(Hn.ExternalLink,{className:"fields-controls__slug-help",href:b,children:b})]})};var Nr=Ir;var Rr=({item:e})=>{const t=Br(e),s=(0,p.useRef)(t);(0,p.useEffect)((()=>{t&&void 0===s.current&&(s.current=t)}),[t]);return`${t||s.current}`};var Dr={id:"slug",type:"text",label:(0,fs.__)("Slug"),Edit:Nr,render:Rr,filterBy:!1},Ar=s(9681),Mr=s.n(Ar);function Lr(e){return"object"==typeof e.title&&"rendered"in e.title&&e.title.rendered?(0,Ln.decodeEntities)(e.title.rendered):`#${e?.id} (${(0,fs.__)("no title")})`}const Or=(e,t)=>{const s=Mr()(e||"").toLowerCase(),n=Mr()(t||"").toLowerCase();return s===n?0:s.startsWith(n)?s.length:1/0};function Fr({data:e,onChangeControl:t}){const[s,n]=(0,p.useState)(null),o=e.parent,r=e.id,i=e.type,{parentPostTitle:a,pageItems:l,isHierarchical:h}=(0,d.useSelect)((e=>{const{getEntityRecord:t,getEntityRecords:n,getPostType:a}=e(u.store),l=a(i),c=l?.hierarchical&&l.viewable,d=o?t("postType",i,o):null,p={per_page:100,exclude:r,parent_exclude:r,orderby:"menu_order",order:"asc",_fields:"id,title,parent",...null!==s&&{search:s}};return{isHierarchical:c,parentPostTitle:d?Lr(d):"",pageItems:c?n("postType",i,p):null}}),[s,o,r,i]),g=(0,p.useMemo)((()=>{const e=(t,n=0)=>{const o=t.map((t=>[{value:t.id,label:"— ".repeat(n)+(0,Ln.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],n+1)])).sort((([e],[t])=>Or(e.rawName,s??"")>=Or(t.rawName,s??"")?1:-1));return o.flat()};if(!l)return[];let t=l.map((e=>({id:e.id,parent:e.parent??null,name:Lr(e)})));s||(t=function(e){const t=e.map((e=>({children:[],...e})));if(t.some((({parent:e})=>null==e)))return t;const s=t.reduce(((e,t)=>{const{parent:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),n=e=>e.map((e=>{const t=s[e.id];return{...e,children:t&&t.length?n(t):[]}}));return n(s[0]||[])}(t));const n=e(t),r=n.find((e=>e.value===o));return o&&a&&!r&&n.unshift({value:o,label:a,rawName:""}),n.map((e=>({...e,value:e.value.toString()})))}),[l,s,a,o]);if(!h)return null;return(0,c.jsx)(Hn.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Parent"),help:(0,fs.__)("Choose a parent page."),value:o?.toString(),options:g,onFilterValueChange:(0,m.debounce)((e=>{n(e)}),300),onChange:e=>{if(e)return t(parseInt(e,10)??0);t(0)},hideLabelFromVision:!0})}var Vr={id:"parent",type:"text",label:(0,fs.__)("Parent"),Edit:({data:e,field:t,onChange:s})=>{const{id:n}=t,o=(0,d.useSelect)((e=>e(u.store).getEntityRecord("root","__unstableBase")?.home),[]),r=(0,p.useCallback)((e=>s({[n]:e})),[n,s]);return(0,c.jsx)("fieldset",{className:"fields-controls__parent",children:(0,c.jsxs)("div",{children:[(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %1$s<wbr />/services<wbr />/pricing.'),(0,w.filterURLForDisplay)(o).replace(/([/.])/g,"<wbr />$1")),{wbr:(0,c.jsx)("wbr",{})}),(0,c.jsx)("p",{children:(0,p.createInterpolateElement)((0,fs.__)("They also show up as sub-items in the default navigation menu. <a>Learn more.</a>"),{a:(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes"),children:void 0})})}),(0,c.jsx)(Fr,{data:e,onChangeControl:r})]})})},render:({item:e})=>{const t=(0,d.useSelect)((t=>{const{getEntityRecord:s}=t(u.store);return e?.parent?s("postType",e.type,e.parent):null}),[e.parent,e.type]);return t?(0,c.jsx)(c.Fragment,{children:Lr(t)}):(0,c.jsx)(c.Fragment,{children:(0,fs.__)("None")})},enableSorting:!0,filterBy:!1};var Ur={id:"comment_status",label:(0,fs.__)("Comments"),type:"text",Edit:"radio",enableSorting:!1,enableHiding:!1,filterBy:!1,elements:[{value:"open",label:(0,fs.__)("Open"),description:(0,fs.__)("Visitors can add new comments and replies.")},{value:"closed",label:(0,fs.__)("Closed"),description:(0,fs.__)("Visitors cannot add new comments or replies. Existing comments remain visible.")}]};var Hr={id:"ping_status",label:(0,fs.__)("Trackbacks & Pingbacks"),type:"text",Edit:function({data:e,onChange:t}){const s=e?.ping_status??"open";return(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Enable pingbacks & trackbacks"),checked:"open"===s,onChange:s=>{t({...e,ping_status:s?"open":"closed"})},help:(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"),children:(0,fs.__)("Learn more about pingbacks & trackbacks")})})},enableSorting:!1,enableHiding:!1,filterBy:!1,elements:[{value:"open",label:(0,fs.__)("Allow"),description:(0,fs.__)("Allow link notifications from other blogs (pingbacks and trackbacks) on new articles.")},{value:"closed",label:(0,fs.__)("Don't allow"),description:(0,fs.__)("Don't allow link notifications from other blogs (pingbacks and trackbacks) on new articles.")}]};var zr={id:"discussion",label:(0,fs.__)("Discussion"),type:"text",render:({item:e})=>{const t="open"===e.comment_status,s="open"===e.ping_status;return t&&s?(0,fs.__)("Open"):t&&!s?(0,fs.__)("Comments only"):!t&&s?(0,fs.__)("Pings only"):(0,fs.__)("Closed")},filterBy:!1};const Gr=[],$r={id:"template",type:"text",label:(0,fs.__)("Template"),Edit:({data:e,field:t,onChange:s})=>{const{id:n}=t,o=e.type,r="number"==typeof e.id?e.id:parseInt(e.id,10),i=e.slug,{canSwitchTemplate:a,templates:l}=(0,d.useSelect)((e=>{const t=e(u.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:o})??Gr,{getHomePage:s,getPostsPageId:n}=co(e(u.store)),i=n()===+r,a="page"===o&&s()?.postId===+r;return{templates:t,canSwitchTemplate:!i&&!a}}),[r,o]),h=(0,p.useMemo)((()=>a?l.filter((t=>t.is_custom&&t.slug!==e.template&&!!t.content.raw)).map((e=>({name:e.slug,blocks:(0,x.parse)(e.content.raw),title:(0,Ln.decodeEntities)(e.title.rendered),id:e.id}))):[]),[a,e.template,l]),_=(0,m.useAsyncList)(h),f=t.getValue({item:e}),b=l.find((e=>e.slug===f)),y=(0,d.useSelect)((e=>{if(b)return b;let t;if(t=i?"page"===o?`${o}-${i}`:`single-${o}-${i}`:"page"===o?"page":`single-${o}`,o){const s=e(u.store).getDefaultTemplateId({slug:t});return e(u.store).getEntityRecord("postType","wp_template",s)}}),[b,o,i]),[v,w]=(0,p.useState)(!1),S=(0,p.useCallback)((e=>s({[n]:e})),[n,s]);return(0,c.jsxs)("fieldset",{className:"fields-controls__template",children:[(0,c.jsx)(Hn.Dropdown,{popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e})=>(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",size:"compact",onClick:e,children:y?no(y):""}),renderContent:({onToggle:e})=>(0,c.jsxs)(Hn.MenuGroup,{children:[(0,c.jsx)(Hn.MenuItem,{onClick:()=>{w(!0),e()},children:(0,fs.__)("Change template")}),""!==f&&(0,c.jsx)(Hn.MenuItem,{onClick:()=>{S(""),e()},children:(0,fs.__)("Use default template")})]})}),v&&(0,c.jsx)(Hn.Modal,{title:(0,fs.__)("Choose a template"),onRequestClose:()=>w(!1),overlayClassName:"fields-controls__template-modal",isFullScreen:!0,children:(0,c.jsx)("div",{className:"fields-controls__template-content",children:(0,c.jsx)(g.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:h,shownPatterns:_,onClickPattern:e=>{S(e.name),w(!1)}})})})]})},enableSorting:!1,filterBy:!1};var Wr=$r;var Zr=function({data:e,onChange:t,field:s}){const[n,o]=(0,p.useState)(!!s.getValue({item:e}));return(0,c.jsxs)(Hn.__experimentalVStack,{as:"fieldset",spacing:4,className:"fields-controls__password",children:[(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Password protected"),help:(0,fs.__)("Only visible to those who know the password"),checked:n,onChange:e=>{o(e),e||t({password:""})}}),n&&(0,c.jsx)("div",{className:"fields-controls__password-input",children:(0,c.jsx)(Hn.TextControl,{label:(0,fs.__)("Password"),onChange:e=>t({password:e}),value:s.getValue({item:e})||"",placeholder:(0,fs.__)("Use a secure password"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]})};var Yr={id:"password",type:"text",label:(0,fs.__)("Password"),Edit:Zr,enableSorting:!1,enableHiding:!1,isVisible:e=>"private"!==e.status,filterBy:!1};function qr({item:e,className:t,children:s}){const n=no(e);return(0,c.jsxs)(Hn.__experimentalHStack,{className:mr("fields-field__title",t),alignment:"center",justify:"flex-start",children:[(0,c.jsx)("span",{children:n||(0,fs.__)("(no title)")}),s]})}function Kr({item:e}){return(0,c.jsx)(qr,{item:e})}const{Badge:Qr}=co(Hn.privateApis);var Xr={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>no(e),render:function({item:e}){const{frontPageId:t,postsPageId:s}=(0,d.useSelect)((e=>{const{getEntityRecord:t}=e(u.store),s=t("root","site");return{frontPageId:s?.page_on_front,postsPageId:s?.page_for_posts}}),[]);return(0,c.jsx)(qr,{item:e,className:"fields-field__page-title",children:[t,s].includes(e.id)&&(0,c.jsx)(Qr,{children:e.id===t?(0,fs.__)("Homepage"):(0,fs.__)("Posts Page")})})},enableHiding:!1,enableGlobalSearch:!0,filterBy:!1};var Jr={type:"text",label:(0,fs.__)("Template"),placeholder:(0,fs.__)("No title"),id:"title",getValue:({item:e})=>no(e),render:Kr,enableHiding:!1,enableGlobalSearch:!0,filterBy:!1},ei=(0,p.forwardRef)((({icon:e,size:t=24,...s},n)=>(0,p.cloneElement)(e,{width:t,height:t,...s,ref:n}))),ti=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"})});const{PATTERN_TYPES:si}=co(ao.privateApis);var ni={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>no(e),render:function({item:e}){return(0,c.jsx)(qr,{item:e,className:"fields-field__pattern-title",children:e.type===si.theme&&(0,c.jsx)(Hn.Tooltip,{placement:"top",text:(0,fs.__)("This pattern cannot be edited."),children:(0,c.jsx)(ei,{icon:ti,size:24})})})},enableHiding:!1,enableGlobalSearch:!0,filterBy:!1};var oi={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>no(e),render:Kr,enableHiding:!0,enableGlobalSearch:!0,filterBy:!1};var ri=(0,m.createHigherOrderComponent)((e=>({useSubRegistry:t=!0,...s})=>{const n=(0,d.useRegistry)(),[o]=(0,p.useState)((()=>new WeakMap)),r=function(e,t,s){if(!s)return t;let n=e.get(t);return n||(n=(0,d.createRegistry)({"core/block-editor":g.storeConfig},t),n.registerStore("core/editor",xc),e.set(t,n)),n}(o,n,t);return r===n?(0,c.jsx)(e,{registry:n,...s}):(0,c.jsx)(d.RegistryProvider,{value:r,children:(0,c.jsx)(e,{registry:r,...s})})}),"withRegistryProvider");const ii=(e,t)=>`<a ${ai(e)}>${t}</a>`,ai=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,li=e=>{const{title:t,foreign_landing_url:s,creator:n,creator_url:o,license:r,license_version:i,license_url:a}=e,l=((e,t)=>{let s=e.trim();return"pdm"!==e&&(s=e.toUpperCase().replace("SAMPLING","Sampling")),t&&(s+=` ${t}`),["pdm","cc0"].includes(e)||(s=`CC ${s}`),s})(r,i),c=(0,Ln.decodeEntities)(n);let d;return d=c?t?(0,fs.sprintf)((0,fs._x)('"%1$s" by %2$s/ %3$s',"caption"),ii(s,(0,Ln.decodeEntities)(t)),o?ii(o,c):c,a?ii(`${a}?ref=openverse`,l):l):(0,fs.sprintf)((0,fs._x)("<a %1$s>Work</a> by %2$s/ %3$s","caption"),ai(s),o?ii(o,c):c,a?ii(`${a}?ref=openverse`,l):l):t?(0,fs.sprintf)((0,fs._x)('"%1$s"/ %2$s',"caption"),ii(s,(0,Ln.decodeEntities)(t)),a?ii(`${a}?ref=openverse`,l):l):(0,fs.sprintf)((0,fs._x)("<a %1$s>Work</a>/ %2$s","caption"),ai(s),a?ii(`${a}?ref=openverse`,l):l),d.replace(/\s{2}/g," ")},ci=async(e={})=>(await(0,d.resolveSelect)(u.store).getEntityRecords("postType","attachment",{...e,orderBy:e?.search?"relevance":"date"})).map((e=>({...e,alt:e.alt_text,url:e.source_url,previewUrl:e.media_details?.sizes?.medium?.source_url,caption:e.caption?.raw})));var di=[{name:"images",labels:{name:(0,fs.__)("Images"),search_items:(0,fs.__)("Search images")},mediaType:"image",fetch:async(e={})=>ci({...e,media_type:"image"})},{name:"videos",labels:{name:(0,fs.__)("Videos"),search_items:(0,fs.__)("Search videos")},mediaType:"video",fetch:async(e={})=>ci({...e,media_type:"video"})},{name:"audio",labels:{name:(0,fs.__)("Audio"),search_items:(0,fs.__)("Search audio")},mediaType:"audio",fetch:async(e={})=>ci({...e,media_type:"audio"})},{name:"openverse",labels:{name:(0,fs.__)("Openverse"),search_items:(0,fs.__)("Search Openverse")},mediaType:"image",async fetch(e={}){const t={...e,mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"},s={per_page:"page_size",search:"q"},n=new URL("https://api.openverse.org/v1/images/");Object.entries(t).forEach((([e,t])=>{const o=s[e]||e;n.searchParams.set(o,t)}));const o=await window.fetch(n,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}});return(await o.json()).results.map((e=>({...e,title:e.title?.toLowerCase().startsWith("file:")?e.title.slice(5):e.title,sourceId:e.id,id:void 0,caption:li(e),previewUrl:e.thumbnail})))},getReportUrl:({sourceId:e})=>`https://wordpress.org/openverse/image/${e}/report/`,isExternalResource:!0}];const ui={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let pi;const mi=new Uint8Array(16);function hi(){if(!pi&&(pi="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pi(mi)}const gi=[];for(let e=0;e<256;++e)gi.push((e+256).toString(16).slice(1));function _i(e,t=0){return gi[e[t+0]]+gi[e[t+1]]+gi[e[t+2]]+gi[e[t+3]]+"-"+gi[e[t+4]]+gi[e[t+5]]+"-"+gi[e[t+6]]+gi[e[t+7]]+"-"+gi[e[t+8]]+gi[e[t+9]]+"-"+gi[e[t+10]]+gi[e[t+11]]+gi[e[t+12]]+gi[e[t+13]]+gi[e[t+14]]+gi[e[t+15]]}const fi=function(e,t,s){if(ui.randomUUID&&!t&&!e)return ui.randomUUID();const n=(e=e||{}).random||(e.rng||hi)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){s=s||0;for(let e=0;e<16;++e)t[s+e]=n[e];return t}return _i(n)},bi=()=>{};function yi({additionalData:e={},allowedTypes:t,filesList:s,maxUploadFileSize:n,onError:o=bi,onFileChange:r,onSuccess:i,multiple:a=!0}){const{receiveEntityRecords:l}=(0,d.dispatch)(u.store),{getCurrentPost:c,getEditorSettings:p}=(0,d.select)(vc),{lockPostAutosaving:m,unlockPostAutosaving:h,lockPostSaving:g,unlockPostSaving:_}=(0,d.dispatch)(vc),f=p().allowedMimeTypes,b=`image-upload-${fi()}`;let y=!1;n=n||p().maxUploadFileSize;const x=c(),v="number"==typeof x?.id?x.id:x?.wp_id,w=v?{post:v}:{},S=()=>{_(b),h(b),y=!1};(0,lr.uploadMedia)({allowedTypes:t,filesList:s,onFileChange:e=>{y?S():(g(b),m(b),y=!0),r?.(e);const t=e.filter((e=>e?.id));if(t?.length){l("postType","attachment",t,void 0,!0)}},onSuccess:i,additionalData:{...w,...e},maxUploadFileSize:n,onError:({message:e})=>{S(),o(e)},wpAllowedMimeTypes:f,multiple:a})}const{sideloadMedia:xi}=$(lr.privateApis);var vi=xi,wi=s(66),Si=s.n(wi);
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function ki(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ci(e){var t,s;return!1!==ki(e)&&(void 0===(t=e.constructor)||!1!==ki(s=t.prototype)&&!1!==s.hasOwnProperty("isPrototypeOf"))}const{GlobalStylesContext:Pi,cleanEmptyObject:ji}=$(g.privateApis);function Ei(e,t){return Si()(e,t,{isMergeableObject:Ci,customMerge:e=>{if("backgroundImage"===e)return(e,t)=>t}})}function Ti(){const[e,t,s]=function(){const{globalStylesId:e,isReady:t,settings:s,styles:n,_links:o}=(0,d.useSelect)((e=>{const{getEntityRecord:t,getEditedEntityRecord:s,hasFinishedResolution:n,canUser:o}=e(u.store),r=e(u.store).__experimentalGetCurrentGlobalStylesId();let i;const a=r?o("update",{kind:"root",name:"globalStyles",id:r}):null;r&&"boolean"==typeof a&&(i=a?s("root","globalStyles",r):t("root","globalStyles",r,{context:"view"}));let l=!1;return n("__experimentalGetCurrentGlobalStylesId")&&(l=!r||(a?n("getEditedEntityRecord",["root","globalStyles",r]):n("getEntityRecord",["root","globalStyles",r,{context:"view"}]))),{globalStylesId:r,isReady:l,settings:i?.settings,styles:i?.styles,_links:i?._links}}),[]),{getEditedEntityRecord:r}=(0,d.useSelect)(u.store),{editEntityRecord:i}=(0,d.useDispatch)(u.store);return[t,(0,p.useMemo)((()=>({settings:s??{},styles:n??{},_links:o??{}})),[s,n,o]),(0,p.useCallback)(((t,s={})=>{const n=r("root","globalStyles",e),o="function"==typeof t?t({styles:n?.styles??{},settings:n?.settings??{},_links:n?._links??{}}):t;i("root","globalStyles",e,{styles:ji(o.styles)||{},settings:ji(o.settings)||{},_links:ji(o._links)||{}},s)}),[e,i,r])]}(),[n,o]=function(){const e=(0,d.useSelect)((e=>e(u.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),r=(0,p.useMemo)((()=>o&&t?Ei(o,t):{}),[t,o]);return(0,p.useMemo)((()=>({isReady:e&&n,user:t,base:o,merged:r,setUserConfig:s})),[r,t,o,s,e,n])}const Bi={};function Ii(e){const{RECEIVE_INTERMEDIATE_RESULTS:t}=$(u.privateApis),{getEntityRecords:s}=e(u.store);return s("postType","wp_block",{per_page:-1,[t]:!0})}const Ni=["__experimentalBlockBindingsSupportedAttributes","__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","alignWide","blockInspectorTabs","maxUploadFileSize","allowedMimeTypes","bodyPlaceholder","canLockBlocks","canUpdateBlockBindings","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","fontSizes","gradients","generateAnchors","onNavigateToEntityRecord","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isPreviewMode","isRTL","locale","maxWidth","postContentAttributes","postsPerPage","readOnly","styles","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableResolvedAssets","__unstableIsBlockBasedTheme"],{globalStylesDataKey:Ri,globalStylesLinksDataKey:Di,selectBlockPatternsKey:Ai,reusableBlocksSelectKey:Mi,sectionRootClientIdKey:Li,mediaEditKey:Oi}=$(g.privateApis);var Fi=function(e,t,s,n){const o=(0,m.useViewportMatch)("medium"),{allowRightClickOverrides:r,blockTypes:i,focusMode:a,hasFixedToolbar:l,isDistractionFree:c,keepCaretInsideBlock:h,hasUploadPermissions:_,hiddenBlockTypes:f,canUseUnfilteredHTML:b,userCanCreatePages:y,pageOnFront:v,pageForPosts:w,userPatternCategories:S,restBlockPatternCategories:k,sectionRootClientId:P}=(0,d.useSelect)((e=>{const{canUser:r,getRawEntityRecord:i,getEntityRecord:a,getUserPatternCategories:l,getBlockPatternCategories:c}=e(u.store),{get:d}=e(C.store),{getBlockTypes:p}=e(x.store),{getBlocksByName:m,getBlockAttributes:h}=e(g.store),_=r("read",{kind:"root",name:"site"})?a("root","site"):void 0;return{allowRightClickOverrides:d("core","allowRightClickOverrides"),blockTypes:p(),canUseUnfilteredHTML:i("postType",t,s)?._links?.hasOwnProperty("wp:action-unfiltered-html"),focusMode:d("core","focusMode"),hasFixedToolbar:d("core","fixedToolbar")||!o,hiddenBlockTypes:d("core","hiddenBlockTypes"),isDistractionFree:d("core","distractionFree"),keepCaretInsideBlock:d("core","keepCaretInsideBlock"),hasUploadPermissions:r("create",{kind:"postType",name:"attachment"})??!0,userCanCreatePages:r("create",{kind:"postType",name:"page"}),pageOnFront:_?.page_on_front,pageForPosts:_?.page_for_posts,userPatternCategories:l(),restBlockPatternCategories:c(),sectionRootClientId:"template-locked"===n?m("core/post-content")?.[0]??"":m("core/group").find((e=>"main"===h(e)?.tagName))??""}}),[t,s,o,n]),{merged:j}=Ti(),E=j.styles??Bi,T=j._links??Bi,B=e.__experimentalAdditionalBlockPatterns??e.__experimentalBlockPatterns,I=e.__experimentalAdditionalBlockPatternCategories??e.__experimentalBlockPatternCategories,N=(0,p.useMemo)((()=>[...B||[]].filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(t)))),[B,t]),R=(0,p.useMemo)((()=>[...I||[],...k||[]].filter(((e,t,s)=>t===s.findIndex((t=>e.name===t.name))))),[I,k]),{undo:D,setIsInserterOpened:A}=(0,d.useDispatch)(vc),{editMediaEntity:M}=$((0,d.useDispatch)(u.store)),{saveEntityRecord:L}=(0,d.useDispatch)(u.store),O=(0,p.useCallback)((e=>y?L("postType","page",e):Promise.reject({message:(0,fs.__)("You do not have permission to create Pages.")})),[L,y]),F=(0,p.useMemo)((()=>{if(f&&f.length>0){return(!0===e.allowedBlockTypes?i.map((({name:e})=>e)):e.allowedBlockTypes||[]).filter((e=>!f.includes(e)))}return e.allowedBlockTypes}),[e.allowedBlockTypes,f,i]),V=!1===e.focusMode;return(0,p.useMemo)((()=>{const s={...Object.fromEntries(Object.entries(e).filter((([e])=>Ni.includes(e)))),[Ri]:E,[Di]:T,allowedBlockTypes:F,allowRightClickOverrides:r,focusMode:a&&!V,hasFixedToolbar:l,isDistractionFree:c,keepCaretInsideBlock:h,[Oi]:_?M:void 0,mediaUpload:_?yi:void 0,mediaSideload:_?vi:void 0,__experimentalBlockPatterns:N,[Ai]:e=>{const{hasFinishedResolution:s,getBlockPatternsForPostType:n}=$(e(u.store)),o=n(t);return s("getBlockPatterns")?o:void 0},[Mi]:Ii,__experimentalBlockPatternCategories:R,__experimentalUserPatternCategories:S,__experimentalFetchLinkSuggestions:(t,s)=>(0,u.__experimentalFetchLinkSuggestions)(t,s,e),inserterMediaCategories:di,__experimentalFetchRichUrlData:u.__experimentalFetchUrlData,__experimentalCanUserUseUnfilteredHTML:b,__experimentalUndo:D,outlineMode:!c&&"wp_template"===t,__experimentalCreatePageEntity:O,__experimentalUserCanCreatePages:y,pageOnFront:v,pageForPosts:w,__experimentalPreferPatternsOnRoot:"wp_template"===t,templateLock:"wp_navigation"===t?"insert":e.templateLock,template:"wp_navigation"===t?[["core/navigation",{},[]]]:e.template,__experimentalSetIsInserterOpened:A,[Li]:P,editorTool:"post-only"===n&&"wp_template"!==t?"edit":void 0};return s}),[F,r,a,V,l,c,h,e,_,S,N,R,b,D,O,y,v,w,t,A,P,E,T,n,M])};const Vi=["core/post-title","core/post-featured-image","core/post-content"];function Ui(){const e=(0,p.useMemo)((()=>[...(0,h.applyFilters)("editor.postContentBlockTypes",Vi)]),[]),t=(0,d.useSelect)((t=>{const{getPostBlocksByName:s}=$(t(vc));return s(e)}),[e]);return t}function Hi(){const e=Ui(),{templateParts:t}=(0,d.useSelect)((e=>{const{getBlocksByName:t}=e(g.store);return{templateParts:t("core/template-part")}}),[]),s=(0,d.useSelect)((e=>{const{getBlockOrder:s}=e(g.store);return t.flatMap((e=>s(e)))}),[t]),n=(0,d.useRegistry)();return(0,p.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:t}=n.dispatch(g.store);return e("","disabled"),()=>{t("")}}),[n]),(0,p.useEffect)((()=>{const{setBlockEditingMode:t,unsetBlockEditingMode:s}=n.dispatch(g.store);return n.batch((()=>{for(const s of e)t(s,"contentOnly")})),()=>{n.batch((()=>{for(const t of e)s(t)}))}}),[e,n]),(0,p.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:s}=n.dispatch(g.store);return n.batch((()=>{for(const s of t)e(s,"contentOnly")})),()=>{n.batch((()=>{for(const e of t)s(e)}))}}),[t,n]),(0,p.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:t}=n.dispatch(g.store);return n.batch((()=>{for(const t of s)e(t,"disabled")})),()=>{n.batch((()=>{for(const e of s)t(e)}))}}),[s,n]),null}function zi(){const e=(0,d.useSelect)((e=>e(g.store).getBlockOrder()?.[0]),[]),{setBlockEditingMode:t,unsetBlockEditingMode:s}=(0,d.useDispatch)(g.store);(0,p.useEffect)((()=>{if(e)return t(e,"contentOnly"),()=>{s(e)}}),[e,s,t])}const Gi=["wp_block","wp_template","wp_template_part"];var $i=(0,c.jsxs)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,c.jsx)(L.Path,{d:"m16 15.5h-8v-1.5h8zm-7.5-2.5h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm-9-3h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2z"}),(0,c.jsx)(L.Path,{d:"m18.5 6.5h-13a.5.5 0 0 0 -.5.5v9.5a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9.5a.5.5 0 0 0 -.5-.5zm-13-1.5h13a2 2 0 0 1 2 2v9.5a2 2 0 0 1 -2 2h-13a2 2 0 0 1 -2-2v-9.5a2 2 0 0 1 2-2z"})]}),Wi=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})}),Zi=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"})}),Yi=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"})}),qi=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"})}),Ki=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})}),Qi=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),Xi=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),Ji=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})}),ea=(0,c.jsxs)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,c.jsx)(L.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,c.jsx)(L.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})]}),ta=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"})}),sa=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z"})});const na=window.wp.commands;var oa=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{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"})}),ra=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",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",clipRule:"evenodd"})});const ia=window.wp.viewport,aa=window.wp.plugins;var la=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{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"})});function ca(e){return["core/edit-post","core/edit-site"].includes(e)?(k()(`${e} interface scope`,{alternative:"core interface scope",hint:"core/edit-post and core/edit-site are merging.",version:"6.6"}),"core"):e}function da(e,t){return"core"===e&&"edit-site/template"===t?(k()("edit-site/template sidebar",{alternative:"edit-post/document",version:"6.6"}),"edit-post/document"):"core"===e&&"edit-site/block-inspector"===t?(k()("edit-site/block-inspector sidebar",{alternative:"edit-post/block",version:"6.6"}),"edit-post/block"):t}const ua=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e=ca(e),area:t=da(e,t)}),pa=(e,t)=>({registry:s,dispatch:n})=>{if(!t)return;e=ca(e),t=da(e,t);s.select(C.store).get(e,"isComplementaryAreaVisible")||s.dispatch(C.store).set(e,"isComplementaryAreaVisible",!0),n({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},ma=e=>({registry:t})=>{e=ca(e);t.select(C.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(C.store).set(e,"isComplementaryAreaVisible",!1)},ha=(e,t)=>({registry:s})=>{if(!t)return;e=ca(e),t=da(e,t);const n=s.select(C.store).get(e,"pinnedItems");!0!==n?.[t]&&s.dispatch(C.store).set(e,"pinnedItems",{...n,[t]:!0})},ga=(e,t)=>({registry:s})=>{if(!t)return;e=ca(e),t=da(e,t);const n=s.select(C.store).get(e,"pinnedItems");s.dispatch(C.store).set(e,"pinnedItems",{...n,[t]:!1})};function _a(e,t){return function({registry:s}){k()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),s.dispatch(C.store).toggle(e,t)}}function fa(e,t,s){return function({registry:n}){k()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),n.dispatch(C.store).set(e,t,!!s)}}function ba(e,t){return function({registry:s}){k()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),s.dispatch(C.store).setDefaults(e,t)}}function ya(e){return{type:"OPEN_MODAL",name:e}}function xa(){return{type:"CLOSE_MODAL"}}const va=(0,d.createRegistrySelector)((e=>(t,s)=>{s=ca(s);const n=e(C.store).get(s,"isComplementaryAreaVisible");if(void 0!==n)return!1===n?null:t?.complementaryAreas?.[s]})),wa=(0,d.createRegistrySelector)((e=>(t,s)=>{s=ca(s);const n=e(C.store).get(s,"isComplementaryAreaVisible"),o=t?.complementaryAreas?.[s];return n&&void 0===o})),Sa=(0,d.createRegistrySelector)((e=>(t,s,n)=>{n=da(s=ca(s),n);const o=e(C.store).get(s,"pinnedItems");return o?.[n]??!0})),ka=(0,d.createRegistrySelector)((e=>(t,s,n)=>(k()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(C.store).get(s,n))));function Ca(e,t){return e.activeModal===t}var Pa=(0,d.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:s,area:n}=t;return e[s]?e:{...e,[s]:n}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:s,area:n}=t;return{...e,[s]:n}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}});const ja=(0,d.createReduxStore)("core/interface",{reducer:Pa,actions:o,selectors:r});function Ea({as:e=Hn.Button,scope:t,identifier:s,icon:n,selectedIcon:o,name:r,shortcut:i,...a}){const l=e,u=(0,aa.usePluginContext)(),p=n||u.icon,m=s||`${u.name}/${r}`,h=(0,d.useSelect)((e=>e(ja).getActiveComplementaryArea(t)===m),[m,t]),{enableComplementaryArea:g,disableComplementaryArea:_}=(0,d.useDispatch)(ja);return(0,c.jsx)(l,{icon:o&&h?o:p,"aria-controls":m.replace("/",":"),"aria-checked":(f=a.role,["checkbox","option","radio","switch","menuitemcheckbox","menuitemradio","treeitem"].includes(f)?h:void 0),onClick:()=>{h?_(t):g(t,m)},shortcut:i,...a});var f}(0,d.register)(ja);var Ta=({children:e,className:t,toggleButtonProps:s})=>{const n=(0,c.jsx)(Ea,{icon:la,...s});return(0,c.jsxs)("div",{className:mr("components-panel__header","interface-complementary-area-header",t),tabIndex:-1,children:[e,n]})};const Ba=()=>{};function Ia({name:e,as:t=Hn.Button,onClick:s,...n}){return(0,c.jsx)(Hn.Fill,{name:e,children:({onClick:e})=>(0,c.jsx)(t,{onClick:s||e?(...t)=>{(s||Ba)(...t),(e||Ba)(...t)}:void 0,...n})})}Ia.Slot=function({name:e,as:t=Hn.MenuGroup,fillProps:s={},bubblesVirtually:n,...o}){return(0,c.jsx)(Hn.Slot,{name:e,bubblesVirtually:n,fillProps:s,children:e=>{if(!p.Children.toArray(e).length)return null;const s=[];p.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&s.push(t)}));const n=p.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&s.includes(e.props.__unstableTarget)?null:e));return(0,c.jsx)(t,{...o,children:n})}})};var Na=Ia;const Ra=({__unstableExplicitMenuItem:e,__unstableTarget:t,...s})=>(0,c.jsx)(Hn.MenuItem,{...s});function Da({scope:e,target:t,__unstableExplicitMenuItem:s,...n}){return(0,c.jsx)(Ea,{as:n=>(0,c.jsx)(Na,{__unstableExplicitMenuItem:s,__unstableTarget:`${e}/${t}`,as:Ra,name:`${e}/plugin-more-menu`,...n}),role:"menuitemcheckbox",selectedIcon:zn,name:t,scope:e,...n})}function Aa({scope:e,...t}){return(0,c.jsx)(Hn.Fill,{name:`PinnedItems/${e}`,...t})}Aa.Slot=function({scope:e,className:t,...s}){return(0,c.jsx)(Hn.Slot,{name:`PinnedItems/${e}`,...s,children:e=>e?.length>0&&(0,c.jsx)("div",{className:mr(t,"interface-pinned-items"),children:e})})};var Ma=Aa;const La={open:{width:280},closed:{width:0},mobileOpen:{width:"100vw"}};function Oa({activeArea:e,isActive:t,scope:s,children:n,className:o,id:r}){const i=(0,m.useReducedMotion)(),a=(0,m.useViewportMatch)("medium","<"),l=(0,m.usePrevious)(e),d=(0,m.usePrevious)(t),[,u]=(0,p.useState)({});(0,p.useEffect)((()=>{u({})}),[t]);const h={type:"tween",duration:i||a||l&&e&&e!==l?0:.3,ease:[.6,0,.4,1]};return(0,c.jsx)(Hn.Fill,{name:`ComplementaryArea/${s}`,children:(0,c.jsx)(Hn.__unstableAnimatePresence,{initial:!1,children:(d||t)&&(0,c.jsx)(Hn.__unstableMotion.div,{variants:La,initial:"closed",animate:a?"mobileOpen":"open",exit:"closed",transition:h,className:"interface-complementary-area__fill",children:(0,c.jsx)("div",{id:r,className:o,style:{width:a?"100vw":280},children:n})})})})}function Fa({children:e,className:t,closeLabel:s=(0,fs.__)("Close plugin"),identifier:n,header:o,headerClassName:r,icon:i,isPinnable:a=!0,panelClassName:l,scope:u,name:h,title:g,toggleShortcut:_,isActiveByDefault:f}){const b=(0,aa.usePluginContext)(),y=i||b.icon,x=n||`${b.name}/${h}`,[v,w]=(0,p.useState)(!1),{isLoading:S,isActive:k,isPinned:P,activeArea:j,isSmall:E,isLarge:T,showIconLabels:B}=(0,d.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:s,isItemPinned:n}=e(ja),{get:o}=e(C.store),r=t(u);return{isLoading:s(u),isActive:r===x,isPinned:n(u,x),activeArea:r,isSmall:e(ia.store).isViewportMatch("< medium"),isLarge:e(ia.store).isViewportMatch("large"),showIconLabels:o("core","showIconLabels")}}),[x,u]),I=(0,m.useViewportMatch)("medium","<");!function(e,t,s,n,o){const r=(0,p.useRef)(!1),i=(0,p.useRef)(!1),{enableComplementaryArea:a,disableComplementaryArea:l}=(0,d.useDispatch)(ja);(0,p.useEffect)((()=>{n&&o&&!r.current?(l(e),i.current=!0):i.current&&!o&&r.current?(i.current=!1,a(e,t)):i.current&&s&&s!==t&&(i.current=!1),o!==r.current&&(r.current=o)}),[n,o,e,t,s,l,a])}(u,x,j,k,E);const{enableComplementaryArea:N,disableComplementaryArea:R,pinItem:D,unpinItem:A}=(0,d.useDispatch)(ja);if((0,p.useEffect)((()=>{f&&void 0===j&&!E?N(u,x):void 0===j&&E&&R(u,x),w(!0)}),[j,f,u,x,E,N,R]),v)return(0,c.jsxs)(c.Fragment,{children:[a&&(0,c.jsx)(Ma,{scope:u,children:P&&(0,c.jsx)(Ea,{scope:u,identifier:x,isPressed:k&&(!B||T),"aria-expanded":k,"aria-disabled":S,label:g,icon:B?zn:y,showTooltip:!B,variant:B?"tertiary":void 0,size:"compact",shortcut:_})}),h&&a&&(0,c.jsx)(Da,{target:h,scope:u,icon:y,identifier:x,children:g}),(0,c.jsxs)(Oa,{activeArea:j,isActive:k,className:mr("interface-complementary-area",t),scope:u,id:x.replace("/",":"),children:[(0,c.jsx)(Ta,{className:r,closeLabel:s,onClose:()=>R(u),toggleButtonProps:{label:s,size:"compact",shortcut:_,scope:u,identifier:x},children:o||(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("h2",{className:"interface-complementary-area-header__title",children:g}),a&&!I&&(0,c.jsx)(Hn.Button,{className:"interface-complementary-area__pin-unpin-item",icon:P?oa:ra,label:P?(0,fs.__)("Unpin from toolbar"):(0,fs.__)("Pin to toolbar"),onClick:()=>(P?A:D)(u,x),isPressed:P,"aria-expanded":P,size:"compact"})]})}),(0,c.jsx)(Hn.Panel,{className:l,children:e})]})]})}Fa.Slot=function({scope:e,...t}){return(0,c.jsx)(Hn.Slot,{name:`ComplementaryArea/${e}`,...t})};var Va=Fa;var Ua=({isActive:e})=>((0,p.useEffect)((()=>{let e=!1;return document.body.classList.contains("sticky-menu")&&(e=!0,document.body.classList.remove("sticky-menu")),()=>{e&&document.body.classList.add("sticky-menu")}}),[]),(0,p.useEffect)((()=>(e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{e&&document.body.classList.remove("is-fullscreen-mode")})),[e]),null);const Ha=(0,p.forwardRef)((({children:e,className:t,ariaLabel:s,as:n="div",...o},r)=>(0,c.jsx)(n,{ref:r,className:mr("admin-ui-navigable-region",t),"aria-label":s,role:"region",tabIndex:"-1",...o,children:e})));Ha.displayName="NavigableRegion";var za=Ha;const Ga={type:"tween",duration:.25,ease:[.6,0,.4,1]};const $a={hidden:{opacity:1,marginTop:-60},visible:{opacity:1,marginTop:0},distractionFreeHover:{opacity:1,marginTop:0,transition:{...Ga,delay:.2,delayChildren:.2}},distractionFreeHidden:{opacity:0,marginTop:-60},distractionFreeDisabled:{opacity:0,marginTop:0,transition:{...Ga,delay:.8,delayChildren:.8}}};var Wa=(0,p.forwardRef)((function({isDistractionFree:e,footer:t,header:s,editorNotices:n,sidebar:o,secondarySidebar:r,content:i,actions:a,labels:l,className:d},u){const[h,g]=(0,m.useResizeObserver)(),_=(0,m.useViewportMatch)("medium","<"),f={type:"tween",duration:(0,m.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]};!function(e){(0,p.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const b={...{header:(0,fs._x)("Header","header landmark area"),body:(0,fs.__)("Content"),secondarySidebar:(0,fs.__)("Block Library"),sidebar:(0,fs._x)("Settings","settings landmark area"),actions:(0,fs.__)("Publish"),footer:(0,fs.__)("Footer")},...l};return(0,c.jsxs)("div",{ref:u,className:mr(d,"interface-interface-skeleton",!!t&&"has-footer"),children:[(0,c.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,c.jsx)(Hn.__unstableAnimatePresence,{initial:!1,children:!!s&&(0,c.jsx)(za,{as:Hn.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":b.header,initial:e&&!_?"distractionFreeHidden":"hidden",whileHover:e&&!_?"distractionFreeHover":"visible",animate:e&&!_?"distractionFreeDisabled":"visible",exit:e&&!_?"distractionFreeHidden":"hidden",variants:$a,transition:f,children:s})}),e&&(0,c.jsx)("div",{className:"interface-interface-skeleton__header",children:n}),(0,c.jsxs)("div",{className:"interface-interface-skeleton__body",children:[(0,c.jsx)(Hn.__unstableAnimatePresence,{initial:!1,children:!!r&&(0,c.jsx)(za,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:b.secondarySidebar,as:Hn.__unstableMotion.div,initial:"closed",animate:"open",exit:"closed",variants:{open:{width:g.width},closed:{width:0}},transition:f,children:(0,c.jsxs)(Hn.__unstableMotion.div,{style:{position:"absolute",width:_?"100vw":"fit-content",height:"100%",left:0},variants:{open:{x:0},closed:{x:"-100%"}},transition:f,children:[h,r]})})}),(0,c.jsx)(za,{className:"interface-interface-skeleton__content",ariaLabel:b.body,children:i}),!!o&&(0,c.jsx)(za,{className:"interface-interface-skeleton__sidebar",ariaLabel:b.sidebar,children:o}),!!a&&(0,c.jsx)(za,{className:"interface-interface-skeleton__actions",ariaLabel:b.actions,children:a})]})]}),!!t&&(0,c.jsx)(za,{className:"interface-interface-skeleton__footer",ariaLabel:b.footer,children:t})]})}));const{RenamePatternModal:Za}=$(ao.privateApis),Ya="editor/pattern-rename";function qa(){const{record:e,postType:t}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc),{getEditedEntityRecord:n}=e(u.store),o=t();return{record:n("postType",o,s()),postType:o}}),[]),{closeModal:s}=(0,d.useDispatch)(ja);return(0,d.useSelect)((e=>e(ja).isModalActive(Ya)))&&t===N?(0,c.jsx)(Za,{onClose:s,pattern:e}):null}const{DuplicatePatternModal:Ka}=$(ao.privateApis),Qa="editor/pattern-duplicate";function Xa(){const{record:e,postType:t}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc),{getEditedEntityRecord:n}=e(u.store),o=t();return{record:n("postType",o,s()),postType:o}}),[]),{closeModal:s}=(0,d.useDispatch)(ja);return(0,d.useSelect)((e=>e(ja).isModalActive(Qa)))&&t===N?(0,c.jsx)(Ka,{onClose:s,onSuccess:()=>s(),pattern:e}):null}const{BlockRemovalWarningModal:Ja}=$(g.privateApis),el=["core/post-content","core/post-template","core/query"],tl=[{postTypes:["wp_template","wp_template_part"],callback(e){if(e.filter((({name:e})=>el.includes(e))).length)return(0,fs._n)("Deleting this block will stop your post or page content from displaying on this template. It is not recommended.","Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.",e.length)}},{postTypes:["wp_block"],callback(e){if(e.filter((({attributes:e})=>e?.metadata?.bindings&&Object.values(e.metadata.bindings).some((e=>"core/pattern-overrides"===e.source)))).length)return(0,fs._n)("The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?","Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?",e.length)}}];function sl(){const e=(0,d.useSelect)((e=>e(vc).getCurrentPostType()),[]),t=(0,p.useMemo)((()=>tl.filter((t=>t.postTypes.includes(e)))),[e]);return Ja&&t?(0,c.jsx)(Ja,{rules:t}):null}function nl({blockPatterns:e,onChoosePattern:t}){const{editEntityRecord:s}=(0,d.useDispatch)(u.store),{postType:n,postId:o}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc);return{postType:t(),postId:s()}}),[]);return(0,c.jsx)(g.__experimentalBlockPatternsList,{blockPatterns:e,onClickPattern:(e,r)=>{s("postType",n,o,{blocks:r,content:({blocks:e=[]})=>(0,x.__unstableSerializeAndClean)(e)}),t()}})}function ol({onClose:e}){const[t,s]=(0,p.useState)(!0),{set:n}=(0,d.useDispatch)(C.store),o=function(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,d.useSelect)((e=>{const{getPatternsByBlockTypes:t,getBlocksByName:s}=e(g.store),{getCurrentPostType:n,getRenderingMode:o}=e(vc);return{blockPatternsWithPostContentBlockType:t("core/post-content","post-only"===o()?"":s("core/post-content")?.[0]),postType:n()}}),[]);return(0,p.useMemo)((()=>e?.length?e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t))):[]),[t,e])}();if(!(o.length>0))return null;function r(){e(),n("core","enableChoosePatternModal",t)}return(0,c.jsxs)(Hn.Modal,{className:"editor-start-page-options__modal",title:(0,fs.__)("Choose a pattern"),isFullScreen:!0,onRequestClose:r,children:[(0,c.jsx)("div",{className:"editor-start-page-options__modal-content",children:(0,c.jsx)(nl,{blockPatterns:o,onChoosePattern:r})}),(0,c.jsx)(Hn.Flex,{className:"editor-start-page-options__modal__actions",justify:"flex-start",expanded:!1,children:(0,c.jsx)(Hn.FlexItem,{children:(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:t,label:(0,fs.__)("Always show starter patterns for new pages"),onChange:e=>{s(e)}})})})]})}function rl(){const[e,t]=(0,p.useState)(!1),{isEditedPostDirty:s,isEditedPostEmpty:n}=(0,d.useSelect)(vc),{isModalActive:o}=(0,d.useSelect)(ja),{enabled:r,postId:i}=(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(vc),n=e(C.store).get("core","enableChoosePatternModal");return{postId:t(),enabled:n&&B!==s()}}),[]);return(0,p.useEffect)((()=>{const e=!s()&&n(),i=o("editor/preferences");r&&e&&!i&&t(!0)}),[r,i,s,n,o]),e?(0,c.jsx)(ol,{onClose:()=>t(!1)}):null}const il=window.wp.keyboardShortcuts,al=[{keyCombination:{modifier:"primary",character:"b"},description:(0,fs.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,fs.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,fs.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,fs.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,fs.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,fs.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,fs.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,fs.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,fs.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,fs.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,fs.__)("Add non breaking space.")}],ll=window.wp.keycodes;function cl({keyCombination:e,forceAriaLabel:t}){const s=e.modifier?ll.displayShortcutList[e.modifier](e.character):e.character,n=e.modifier?ll.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,c.jsx)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||n,children:(Array.isArray(s)?s:[s]).map(((e,t)=>"+"===e?(0,c.jsx)(p.Fragment,{children:e},t):(0,c.jsx)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key",children:e},t)))})}var dl=function({description:e,keyCombination:t,aliases:s=[],ariaLabel:n}){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,c.jsxs)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-term",children:[(0,c.jsx)(cl,{keyCombination:t,forceAriaLabel:n}),s.map(((e,t)=>(0,c.jsx)(cl,{keyCombination:e,forceAriaLabel:n},t)))]})]})};var ul=function({name:e}){const{keyCombination:t,description:s,aliases:n}=(0,d.useSelect)((t=>{const{getShortcutKeyCombination:s,getShortcutDescription:n,getShortcutAliases:o}=t(il.store);return{keyCombination:s(e),aliases:o(e),description:n(e)}}),[e]);return t?(0,c.jsx)(dl,{keyCombination:t,description:s,aliases:n}):null};const pl="editor/keyboard-shortcut-help",ml=({shortcuts:e})=>(0,c.jsx)("ul",{className:"editor-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map(((e,t)=>(0,c.jsx)("li",{className:"editor-keyboard-shortcut-help-modal__shortcut",children:"string"==typeof e?(0,c.jsx)(ul,{name:e}):(0,c.jsx)(dl,{...e})},t)))}),hl=({title:e,shortcuts:t,className:s})=>(0,c.jsxs)("section",{className:mr("editor-keyboard-shortcut-help-modal__section",s),children:[!!e&&(0,c.jsx)("h2",{className:"editor-keyboard-shortcut-help-modal__section-title",children:e}),(0,c.jsx)(ml,{shortcuts:t})]}),gl=({title:e,categoryName:t,additionalShortcuts:s=[]})=>{const n=(0,d.useSelect)((e=>e(il.store).getCategoryShortcuts(t)),[t]);return(0,c.jsx)(hl,{title:e,shortcuts:n.concat(s)})};var _l=function(){const e=(0,d.useSelect)((e=>e(ja).isModalActive(pl)),[]),{openModal:t,closeModal:s}=(0,d.useDispatch)(ja),n=()=>{e?s():t(pl)};return(0,il.useShortcut)("core/editor/keyboard-shortcuts",n),e?(0,c.jsxs)(Hn.Modal,{className:"editor-keyboard-shortcut-help-modal",title:(0,fs.__)("Keyboard shortcuts"),closeButtonLabel:(0,fs.__)("Close"),onRequestClose:n,children:[(0,c.jsx)(hl,{className:"editor-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/editor/keyboard-shortcuts"]}),(0,c.jsx)(gl,{title:(0,fs.__)("Global shortcuts"),categoryName:"global"}),(0,c.jsx)(gl,{title:(0,fs.__)("Selection shortcuts"),categoryName:"selection"}),(0,c.jsx)(gl,{title:(0,fs.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,fs.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,fs.__)("Forward-slash")}]}),(0,c.jsx)(hl,{title:(0,fs.__)("Text formatting"),shortcuts:al}),(0,c.jsx)(gl,{title:(0,fs.__)("List View shortcuts"),categoryName:"list-view"})]}):null};function fl({clientId:e,onClose:t}){const s=Ui(),{entity:n,onNavigateToEntityRecord:o,canEditTemplates:r}=(0,d.useSelect)((t=>{const{getBlockParentsByBlockName:n,getSettings:o,getBlockAttributes:r,getBlockParents:i}=t(g.store),{getCurrentTemplateId:a,getRenderingMode:l}=t(vc),c=n(e,"core/block",!0)[0];let d;if(c?d=t(u.store).getEntityRecord("postType","wp_block",r(c).ref):"template-locked"!==l()||i(e).some((e=>s.includes(e)))||(d=t(u.store).getEntityRecord("postType","wp_template",a())),!d)return{};return{canEditTemplates:t(u.store).canUser("create",{kind:"postType",name:"wp_template"}),entity:d,onNavigateToEntityRecord:o().onNavigateToEntityRecord}}),[e,s]);if(!n)return(0,c.jsx)(bl,{clientId:e,onClose:t});const i="wp_block"===n.type;let a=i?(0,fs.__)("Edit the pattern to move, delete, or make further changes to this block."):(0,fs.__)("Edit the template to move, delete, or make further changes to this block.");return r||(a=(0,fs.__)("Only users with permissions to edit the template can move or delete this block")),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__unstableBlockSettingsMenuFirstItem,{children:(0,c.jsx)(Hn.MenuItem,{onClick:()=>{o({postId:n.id,postType:n.type})},disabled:!r,children:i?(0,fs.__)("Edit pattern"):(0,fs.__)("Edit template")})}),(0,c.jsx)(Hn.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:a})]})}function bl({clientId:e,onClose:t}){const{contentLockingParent:s}=(0,d.useSelect)((t=>{const{getContentLockingParent:s}=$(t(g.store));return{contentLockingParent:s(e)}}),[e]),n=(0,g.useBlockDisplayInformation)(s),o=(0,d.useDispatch)(g.store);if(!n?.title)return null;const{modifyContentLockBlock:r}=$(o);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__unstableBlockSettingsMenuFirstItem,{children:(0,c.jsx)(Hn.MenuItem,{onClick:()=>{r(s),t()},children:(0,fs._x)("Unlock","Unlock content locked blocks")})}),(0,c.jsx)(Hn.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:(0,fs.__)("Temporarily unlock the parent block to edit, delete or make further changes to this block.")})]})}function yl(){return(0,c.jsx)(g.BlockSettingsMenuControls,{children:({selectedClientIds:e,onClose:t})=>1===e.length&&(0,c.jsx)(fl,{clientId:e[0],onClose:t})})}function xl(e){const{slug:t,patterns:s}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc),{getEntityRecord:n,getBlockPatterns:o}=e(u.store),r=s();return{slug:n("postType",t(),r).slug,patterns:o()}}),[]),n=(0,d.useSelect)((e=>e(u.store).getCurrentTheme().stylesheet));return(0,p.useMemo)((()=>[{name:"fallback",blocks:(0,x.parse)(e),title:(0,fs.__)("Fallback content")},...s.filter((e=>Array.isArray(e.templateTypes)&&e.templateTypes.some((e=>t.startsWith(e))))).map((e=>({...e,blocks:(0,x.parse)(e.content).map((e=>function(e){return e.innerBlocks.find((e=>"core/template-part"===e.name))&&(e.innerBlocks=e.innerBlocks.map((e=>("core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=n),e)))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=n),e}(e)))})))]),[e,t,s])}function vl({fallbackContent:e,onChoosePattern:t,postType:s}){const[,,n]=(0,u.useEntityBlockEditor)("postType",s),o=xl(e);return(0,c.jsx)(g.__experimentalBlockPatternsList,{blockPatterns:o,onClickPattern:(e,s)=>{n(s,{selection:void 0}),t()}})}function wl({slug:e,isCustom:t,onClose:s,postType:n}){const o=function(e,t=!1){return(0,d.useSelect)((s=>{const{getEntityRecord:n,getDefaultTemplateId:o}=s(u.store),r=o({slug:e,is_custom:t,ignore_empty:!0});return r?n("postType",B,r)?.content?.raw:void 0}),[e,t])}(e,t);return o?(0,c.jsxs)(Hn.Modal,{className:"editor-start-template-options__modal",title:(0,fs.__)("Choose a pattern"),closeLabel:(0,fs.__)("Cancel"),focusOnMount:"firstElement",onRequestClose:s,isFullScreen:!0,children:[(0,c.jsx)("div",{className:"editor-start-template-options__modal-content",children:(0,c.jsx)(vl,{fallbackContent:o,slug:e,isCustom:t,postType:n,onChoosePattern:()=>{s()}})}),(0,c.jsx)(Hn.Flex,{className:"editor-start-template-options__modal__actions",justify:"flex-end",expanded:!1,children:(0,c.jsx)(Hn.FlexItem,{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:s,children:(0,fs.__)("Skip")})})})]}):null}function Sl(){const[e,t]=(0,p.useState)(!1),{shouldOpenModal:s,slug:n,isCustom:o,postType:r,postId:i}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc),n=t(),o=s(),{getEditedEntityRecord:r,hasEditsForEntityRecord:i}=e(u.store),a=r("postType",n,o);return{shouldOpenModal:!i("postType",n,o)&&""===a.content&&B===n,slug:a.slug,isCustom:a.is_custom,postType:n,postId:o}}),[]);return(0,p.useEffect)((()=>{t(!1)}),[r,i]),!s||e?null:(0,c.jsx)(wl,{slug:n,isCustom:o,postType:r,onClose:()=>t(!0)})}function kl(){const e=(0,d.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:s}=e(vc).getEditorSettings();return!t||!s}),[]),{getBlockSelectionStart:t}=(0,d.useSelect)(g.store),{getActiveComplementaryArea:s}=(0,d.useSelect)(ja),{enableComplementaryArea:n,disableComplementaryArea:o}=(0,d.useDispatch)(ja),{redo:r,undo:i,savePost:a,setIsListViewOpened:l,switchEditorMode:c,toggleDistractionFree:u}=(0,d.useDispatch)(vc),{isEditedPostDirty:p,isPostSavingLocked:m,isListViewOpened:h,getEditorMode:_}=(0,d.useSelect)(vc);return(0,il.useShortcut)("core/editor/toggle-mode",(()=>{c("visual"===_()?"text":"visual")}),{isDisabled:e}),(0,il.useShortcut)("core/editor/toggle-distraction-free",(()=>{u()})),(0,il.useShortcut)("core/editor/undo",(e=>{i(),e.preventDefault()})),(0,il.useShortcut)("core/editor/redo",(e=>{r(),e.preventDefault()})),(0,il.useShortcut)("core/editor/save",(e=>{e.preventDefault(),m()||p()&&a()})),(0,il.useShortcut)("core/editor/toggle-list-view",(e=>{h()||(e.preventDefault(),l(!0))})),(0,il.useShortcut)("core/editor/toggle-sidebar",(e=>{e.preventDefault();if(["edit-post/document","edit-post/block"].includes(s("core")))o("core");else{const e=t()?"edit-post/block":"edit-post/document";n("core",e)}})),null}function Cl({clientId:e,onClose:t}){const{getBlocks:s}=(0,d.useSelect)(g.store),{replaceBlocks:n}=(0,d.useDispatch)(g.store);return(0,d.useSelect)((t=>t(g.store).canRemoveBlock(e)),[e])?(0,c.jsx)(Hn.MenuItem,{onClick:()=>{n(e,s(e)),t()},children:(0,fs.__)("Detach")}):null}function Pl({clientIds:e,blocks:t}){const[s,n]=(0,p.useState)(!1),{replaceBlocks:o}=(0,d.useDispatch)(g.store),{createSuccessNotice:r}=(0,d.useDispatch)(_s.store),{isBlockBasedTheme:i,canCreate:a}=(0,d.useSelect)((e=>({isBlockBasedTheme:e(u.store).getCurrentTheme()?.is_block_theme,canCreate:e(g.store).canInsertBlockType("core/template-part")})),[]);if(!i||!a)return null;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.MenuItem,{icon:U,onClick:()=>{n(!0)},"aria-expanded":s,"aria-haspopup":"dialog",children:(0,fs.__)("Create template part")}),s&&(0,c.jsx)(Jn,{closeModal:()=>{n(!1)},blocks:t,onCreate:async t=>{o(e,(0,x.createBlock)("core/template-part",{slug:t.slug,theme:t.theme})),r((0,fs.__)("Template part created."),{type:"snackbar"})}})]})}function jl(){return(0,c.jsx)(g.BlockSettingsMenuControls,{children:({selectedClientIds:e,onClose:t})=>(0,c.jsx)(El,{clientIds:e,onClose:t})})}function El({clientIds:e,onClose:t}){const{blocks:s}=(0,d.useSelect)((t=>{const{getBlocksByClientId:s}=t(g.store);return{blocks:s(e)}}),[e]);return 1===s.length&&"core/template-part"===s[0]?.name?(0,c.jsx)(Cl,{clientId:e[0],onClose:t}):(0,c.jsx)(Pl,{clientIds:e,blocks:s})}const{ExperimentalBlockEditorProvider:Tl}=$(g.privateApis),{PatternsMenuItems:Bl}=$(ao.privateApis),Il=()=>{},Nl=["wp_block","wp_navigation","wp_template_part"];const Rl=ri((({post:e,settings:t,recovery:s,initialEdits:n,children:o,BlockEditorProviderComponent:r=Tl,__unstableTemplate:i})=>{const a=!!i,{editorSettings:l,selection:m,isReady:_,mode:f,defaultMode:b,postTypeEntities:y}=(0,d.useSelect)((t=>{const{getEditorSettings:s,getEditorSelection:n,getRenderingMode:o,__unstableIsEditorReady:r,getDefaultRenderingMode:i}=$(t(vc)),{getEntitiesConfig:l}=t(u.store),c=o(),d=i(e.type),p="template-locked"===d?a:void 0!==d,m=void 0!==d;return{editorSettings:s(),isReady:r(),mode:m?c:void 0,defaultMode:p?d:void 0,selection:n(),postTypeEntities:"wp_template"===e.type?l("postType"):null}}),[e.type,a]),v=a&&"post-only"!==f,w=v?i:e,S=(0,p.useMemo)((()=>{const t={};if("wp_template"===e.type){if("page"===e.slug)t.postType="page";else if("single"===e.slug)t.postType="post";else if("single"===e.slug.split("-")[0]){const s=y?.map((e=>e.name))||[],n=e.slug.match(`^single-(${s.join("|")})(?:-.+)?$`);n&&(t.postType=n[1])}}else Nl.includes(w.type)&&!v||(t.postId=e.id,t.postType=e.type);return{...t,templateSlug:"wp_template"===w.type?w.slug:void 0}}),[v,e.id,e.type,e.slug,w.type,w.slug,y]),{id:k,type:P}=w,j=Fi(l,P,k,f),[E,T,R]=function(e,t,s){const n="template-locked"===s?"template":"post",[o,r,i]=(0,u.useEntityBlockEditor)("postType",e.type,{id:e.id}),[a,l,c]=(0,u.useEntityBlockEditor)("postType",t?.type,{id:t?.id}),d=(0,p.useMemo)((()=>{if("wp_navigation"===e.type)return[(0,x.createBlock)("core/navigation",{ref:e.id,templateLock:!1})]}),[e.type,e.id]),m=(0,p.useMemo)((()=>d||("template"===n?a:o)),[d,n,a,o]);return t&&"template-locked"===s||"wp_navigation"===e.type?[m,Il,Il]:[m,"post"===n?r:l,"post"===n?i:c]}(e,i,f),{updatePostLock:D,setupEditor:A,updateEditorSettings:M,setCurrentTemplateId:L,setEditedPost:O,setRenderingMode:F}=$((0,d.useDispatch)(vc)),{createWarningNotice:V}=(0,d.useDispatch)(_s.store);return(0,p.useLayoutEffect)((()=>{s||(D(t.postLock),A(e,n,t.template),t.autosave&&V((0,fs.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:(0,fs.__)("View the autosave"),url:t.autosave.editLink}]}))}),[]),(0,p.useEffect)((()=>{O(e.type,e.id)}),[e.type,e.id,O]),(0,p.useEffect)((()=>{M(t)}),[t,M]),(0,p.useEffect)((()=>{L(i?.id)}),[i?.id,L]),(0,p.useEffect)((()=>{b&&F(b)}),[b,F]),function(e,t){(0,p.useEffect)((()=>((0,h.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((s,n)=>!(!Gi.includes(e)&&"core/template-part"===n.name&&"post-only"===t)&&s)),(0,h.addFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",((t,s,n,{getBlockParentsByBlockName:o})=>Gi.includes(e)||"core/post-content"!==s.name?t:o(n,"core/query").length>0)),()=>{(0,h.removeFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter"),(0,h.removeFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter")})),[e,t])}(e.type,f),(0,na.useCommandLoader)({name:"core/editor/edit-ui",hook:function(){const{editorMode:e,isListViewOpen:t,showBlockBreadcrumbs:s,isDistractionFree:n,isFocusMode:o,isPreviewMode:r,isViewable:i,isCodeEditingEnabled:a,isRichEditingEnabled:l,isPublishSidebarEnabled:c}=(0,d.useSelect)((e=>{const{get:t}=e(C.store),{isListViewOpened:s,getCurrentPostType:n,getEditorSettings:o}=e(vc),{getSettings:r}=e(g.store),{getPostType:i}=e(u.store);return{editorMode:t("core","editorMode")??"visual",isListViewOpen:s(),showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),isDistractionFree:t("core","distractionFree"),isFocusMode:t("core","focusMode"),isPreviewMode:r().isPreviewMode,isViewable:i(n())?.viewable??!1,isCodeEditingEnabled:o().codeEditingEnabled,isRichEditingEnabled:o().richEditingEnabled,isPublishSidebarEnabled:e(vc).isPublishSidebarEnabled()}}),[]),{getActiveComplementaryArea:p}=(0,d.useSelect)(ja),{toggle:m}=(0,d.useDispatch)(C.store),{createInfoNotice:h}=(0,d.useDispatch)(_s.store),{__unstableSaveForPreview:_,setIsListViewOpened:f,switchEditorMode:b,toggleDistractionFree:y,toggleSpotlightMode:x,toggleTopToolbar:v}=(0,d.useDispatch)(vc),{openModal:w,enableComplementaryArea:S,disableComplementaryArea:k}=(0,d.useDispatch)(ja),{getCurrentPostId:P}=(0,d.useSelect)(vc),j=a&&l;if(r)return{commands:[],isLoading:!1};const E=[];return E.push({name:"core/open-shortcut-help",label:(0,fs.__)("Keyboard shortcuts"),icon:$i,callback:({close:e})=>{e(),w("editor/keyboard-shortcut-help")}}),E.push({name:"core/toggle-distraction-free",label:n?(0,fs.__)("Exit Distraction free"):(0,fs.__)("Enter Distraction free"),callback:({close:e})=>{y(),e()}}),E.push({name:"core/open-preferences",label:(0,fs.__)("Editor preferences"),callback:({close:e})=>{e(),w("editor/preferences")}}),E.push({name:"core/toggle-spotlight-mode",label:o?(0,fs.__)("Exit Spotlight mode"):(0,fs.__)("Enter Spotlight mode"),callback:({close:e})=>{x(),e()}}),E.push({name:"core/toggle-list-view",label:t?(0,fs.__)("Close List View"):(0,fs.__)("Open List View"),icon:Wi,callback:({close:e})=>{f(!t),e(),h(t?(0,fs.__)("List View off."):(0,fs.__)("List View on."),{id:"core/editor/toggle-list-view/notice",type:"snackbar"})}}),E.push({name:"core/toggle-top-toolbar",label:(0,fs.__)("Top toolbar"),callback:({close:e})=>{v(),e()}}),j&&E.push({name:"core/toggle-code-editor",label:"visual"===e?(0,fs.__)("Open code editor"):(0,fs.__)("Exit code editor"),icon:Zi,callback:({close:t})=>{b("visual"===e?"text":"visual"),t()}}),E.push({name:"core/toggle-breadcrumbs",label:s?(0,fs.__)("Hide block breadcrumbs"):(0,fs.__)("Show block breadcrumbs"),callback:({close:e})=>{m("core","showBlockBreadcrumbs"),e(),h(s?(0,fs.__)("Breadcrumbs hidden."):(0,fs.__)("Breadcrumbs visible."),{id:"core/editor/toggle-breadcrumbs/notice",type:"snackbar"})}}),E.push({name:"core/open-settings-sidebar",label:(0,fs.__)("Show or hide the Settings panel"),icon:(0,fs.isRTL)()?Yi:qi,callback:({close:e})=>{const t=p("core");e(),"edit-post/document"===t?k("core"):S("core","edit-post/document")}}),E.push({name:"core/open-block-inspector",label:(0,fs.__)("Show or hide the Block settings panel"),icon:Ki,callback:({close:e})=>{const t=p("core");e(),"edit-post/block"===t?k("core"):S("core","edit-post/block")}}),E.push({name:"core/toggle-publish-sidebar",label:c?(0,fs.__)("Disable pre-publish checks"):(0,fs.__)("Enable pre-publish checks"),icon:Qi,callback:({close:e})=>{e(),m("core","isPublishSidebarEnabled"),h(c?(0,fs.__)("Pre-publish checks disabled."):(0,fs.__)("Pre-publish checks enabled."),{id:"core/editor/publish-sidebar/notice",type:"snackbar"})}}),i&&E.push({name:"core/preview-link",label:(0,fs.__)("Preview in a new tab"),icon:Fn,callback:async({close:e})=>{e();const t=P(),s=await _();window.open(s,`wp-preview-${t}`)}}),{commands:E,isLoading:!1}}}),(0,na.useCommandLoader)({name:"core/editor/contextual-commands",hook:function(){const{postType:e}=(0,d.useSelect)((e=>{const{getCurrentPostType:t}=e(vc);return{postType:t()}}),[]),{openModal:t}=(0,d.useDispatch)(ja),s=[];return e===N&&(s.push({name:"core/rename-pattern",label:(0,fs.__)("Rename pattern"),icon:Xi,callback:({close:e})=>{t(Ya),e()}}),s.push({name:"core/duplicate-pattern",label:(0,fs.__)("Duplicate pattern"),icon:Ji,callback:({close:e})=>{t(Qa),e()}})),{isLoading:!1,commands:s}},context:"entity-edit"}),(0,na.useCommandLoader)({name:"core/editor/page-content-focus",hook:function(){const{onNavigateToEntityRecord:e,goBack:t,templateId:s,isPreviewMode:n}=(0,d.useSelect)((e=>{const{getRenderingMode:t,getEditorSettings:s,getCurrentTemplateId:n}=$(e(vc)),o=s();return{isTemplateHidden:"post-only"===t(),onNavigateToEntityRecord:o.onNavigateToEntityRecord,getEditorSettings:s,goBack:o.onNavigateToPreviousEntityRecord,templateId:n(),isPreviewMode:o.isPreviewMode}}),[]),{editedRecord:o,hasResolved:r}=(0,u.useEntityRecord)("postType","wp_template",s);if(n)return{isLoading:!1,commands:[]};const i=[];return s&&r&&i.push({name:"core/switch-to-template-focus",label:(0,fs.sprintf)((0,fs.__)("Edit template: %s"),(0,Ln.decodeEntities)(o.title)),icon:W,callback:({close:t})=>{e({postId:s,postType:"wp_template"}),t()}}),t&&i.push({name:"core/switch-to-previous-entity",label:(0,fs.__)("Go back"),icon:ea,callback:({close:e})=>{t(),e()}}),{isLoading:!1,commands:i}},context:"entity-edit"}),(0,na.useCommandLoader)({name:"core/edit-site/manipulate-document",hook:function(){const{postType:e,postId:t}=(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(vc);return{postType:s(),postId:t()}}),[]),{editedRecord:s,hasResolved:n}=(0,u.useEntityRecord)("postType",e,t),{revertTemplate:o}=$((0,d.useDispatch)(vc));if(!n||![I,B].includes(e))return{isLoading:!0,commands:[]};const r=[];if(On(s)){const e=s.type===B?(0,fs.sprintf)((0,fs.__)("Reset template: %s"),(0,Ln.decodeEntities)(s.title)):(0,fs.sprintf)((0,fs.__)("Reset template part: %s"),(0,Ln.decodeEntities)(s.title));r.push({name:"core/reset-template",label:e,icon:(0,fs.isRTL)()?ta:sa,callback:({close:e})=>{o(s),e()}})}return{isLoading:!n,commands:r}}}),_&&f?(0,c.jsx)(u.EntityProvider,{kind:"root",type:"site",children:(0,c.jsx)(u.EntityProvider,{kind:"postType",type:e.type,id:e.id,children:(0,c.jsx)(g.BlockContextProvider,{value:S,children:(0,c.jsxs)(r,{value:E,onChange:R,onInput:T,selection:m,settings:j,useSubRegistry:!1,children:[o,!t.isPreviewMode&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Bl,{}),(0,c.jsx)(jl,{}),(0,c.jsx)(yl,{}),"template-locked"===f&&(0,c.jsx)(Hi,{}),"wp_navigation"===P&&(0,c.jsx)(zi,{}),(0,c.jsx)(kl,{}),(0,c.jsx)(_l,{}),(0,c.jsx)(sl,{}),(0,c.jsx)(rl,{}),(0,c.jsx)(Sl,{}),(0,c.jsx)(qa,{}),(0,c.jsx)(Xa,{})]})]})})})}):null}));function Dl(e){return(0,c.jsx)(Rl,{...e,BlockEditorProviderComponent:g.BlockEditorProvider,children:e.children})}var Al=Dl;const{useGlobalStyle:Ml}=$(g.privateApis);function Ll({template:e,post:t}){const[s="white"]=Ml("color.background"),[n]=(0,u.useEntityBlockEditor)("postType",t.type,{id:t.id}),[o]=(0,u.useEntityBlockEditor)("postType",e?.type,{id:e?.id}),r=e&&o?o:n,i=!r?.length;return(0,c.jsxs)("div",{className:"editor-fields-content-preview",style:{backgroundColor:s},children:[i&&(0,c.jsx)("span",{className:"editor-fields-content-preview__empty",children:(0,fs.__)("Empty content")}),!i&&(0,c.jsx)(g.BlockPreview.Async,{children:(0,c.jsx)(g.BlockPreview,{blocks:r})})]})}const Ol={type:"media",id:"content-preview",label:(0,fs.__)("Content preview"),render:function({item:e}){const{settings:t,template:s}=(0,d.useSelect)((t=>{const{canUser:s,getPostType:n,getTemplateId:o,getEntityRecord:r}=$(t(u.store)),i=s("read",{kind:"postType",name:"wp_template"}),a=t(vc).getEditorSettings(),l=a.supportsTemplateMode,c=n(e.type)?.viewable??!1,d=l&&c&&i?o(e.type,e.id):null;return{settings:a,template:d?r("postType","wp_template",d):void 0}}),[e.type,e.id]);return(0,c.jsx)(Dl,{post:e,settings:t,__unstableTemplate:s,children:(0,c.jsx)(Ll,{template:s,post:e})})},enableSorting:!1};var Fl=Ol;function Vl(e,t,s){return{type:"REGISTER_ENTITY_ACTION",kind:e,name:t,config:s}}function Ul(e,t,s){return{type:"UNREGISTER_ENTITY_ACTION",kind:e,name:t,actionId:s}}function Hl(e,t,s){return{type:"REGISTER_ENTITY_FIELD",kind:e,name:t,config:s}}function zl(e,t,s){return{type:"UNREGISTER_ENTITY_FIELD",kind:e,name:t,fieldId:s}}function Gl(e,t){return{type:"SET_IS_READY",kind:e,name:t}}const $l=e=>async({registry:t})=>{if($(t.select(vc)).isEntityReady("postType",e))return;$(t.dispatch(vc)).setIsReady("postType",e);const s=await t.resolveSelect(u.store).getPostType(e),n=await t.resolveSelect(u.store).canUser("create",{kind:"postType",name:e}),o=await t.resolveSelect(u.store).getCurrentTheme(),r=[s.viewable?Vn:void 0,s.supports?.revisions?Un:void 0,void 0,"wp_template_part"===s.slug&&n&&o?.is_block_theme?io:void 0,n&&"wp_block"===s.slug?ho:void 0,s.supports?.title?fo:void 0,s.supports?.["page-attributes"]?yo:void 0,"wp_block"===s.slug?Zo:void 0,qo,Xo,nr,rr,ar].filter(Boolean),i=[s.supports?.thumbnail&&o?.theme_supports?.["post-thumbnails"]&&ur,s.supports?.author&&fr,Cr,Er,Dr,s.supports?.["page-attributes"]&&Vr,s.supports?.comments&&Ur,s.supports?.trackbacks&&Hr,(s.supports?.comments||s.supports?.trackbacks)&&zr,Wr,Yr,s.supports?.editor&&s.viewable&&Fl].filter(Boolean);if(s.supports?.title){let t;t="page"===e?Xr:"wp_template"===e?Jr:"wp_block"===e?ni:oi,i.push(t)}t.batch((()=>{r.forEach((s=>{$(t.dispatch(vc)).registerEntityAction("postType",e,s)})),i.forEach((s=>{$(t.dispatch(vc)).registerEntityField("postType",e,s)}))})),(0,h.doAction)("core.registerPostTypeSchema",e)};function Wl(e){return{type:"SET_CURRENT_TEMPLATE_ID",id:e}}const Zl=e=>async({select:t,dispatch:s,registry:n})=>{const o=await n.dispatch(u.store).saveEntityRecord("postType","wp_template",e);return n.dispatch(u.store).editEntityRecord("postType",t.getCurrentPostType(),t.getCurrentPostId(),{template:o.slug}),n.dispatch(_s.store).createSuccessNotice((0,fs.__)("Custom template created. You're in template mode now."),{type:"snackbar",actions:[{label:(0,fs.__)("Go back"),onClick:()=>s.setRenderingMode(t.getEditorSettings().defaultRenderingMode)}]}),o},Yl=e=>({registry:t})=>{const s=(t.select(C.store).get("core","hiddenBlockTypes")??[]).filter((t=>!(Array.isArray(e)?e:[e]).includes(t)));t.dispatch(C.store).set("core","hiddenBlockTypes",s)},ql=e=>({registry:t})=>{const s=t.select(C.store).get("core","hiddenBlockTypes")??[],n=new Set([...s,...Array.isArray(e)?e:[e]]);t.dispatch(C.store).set("core","hiddenBlockTypes",[...n])},Kl=({onSave:e,dirtyEntityRecords:t=[],entitiesToSkip:s=[],close:n}={})=>({registry:o})=>{const r=[{kind:"postType",name:"wp_navigation"}],i="site-editor-save-success",a=o.select(u.store).getEntityRecord("root","__unstableBase")?.home;o.dispatch(_s.store).removeNotice(i);const l=t.filter((({kind:e,name:t,key:n,property:o})=>!s.some((s=>s.kind===e&&s.name===t&&s.key===n&&s.property===o))));n?.(l);const c=[],d=[];l.forEach((({kind:e,name:t,key:s,property:n})=>{"root"===e&&"site"===t?c.push(n):(r.some((s=>s.kind===e&&s.name===t))&&o.dispatch(u.store).editEntityRecord(e,t,s,{status:"publish"}),d.push(o.dispatch(u.store).saveEditedEntityRecord(e,t,s)))})),c.length&&d.push(o.dispatch(u.store).__experimentalSaveSpecifiedEntityEdits("root","site",void 0,c)),o.dispatch(g.store).__unstableMarkLastChangeAsPersistent(),Promise.all(d).then((t=>e?e(t):t)).then((e=>{e.some((e=>void 0===e))?o.dispatch(_s.store).createErrorNotice((0,fs.__)("Saving failed.")):o.dispatch(_s.store).createSuccessNotice((0,fs.__)("Site updated."),{type:"snackbar",id:i,actions:[{label:(0,fs.__)("View site"),url:a,openInNewTab:!0}]})})).catch((e=>o.dispatch(_s.store).createErrorNotice(`${(0,fs.__)("Saving failed.")} ${e}`)))},Ql=(e,{allowUndo:t=!0}={})=>async({registry:s})=>{const n="edit-site-template-reverted";if(s.dispatch(_s.store).removeNotice(n),On(e))try{const o=s.select(u.store).getEntityConfig("postType",e.type);if(!o)return void s.dispatch(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const r=(0,w.addQueryArgs)(`${o.baseURL}/${e.id}`,{context:"edit",source:e.origin}),i=await gs()({path:r});if(!i)return void s.dispatch(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const a=({blocks:e=[]})=>(0,x.__unstableSerializeAndClean)(e),l=s.select(u.store).getEditedEntityRecord("postType",e.type,e.id);s.dispatch(u.store).editEntityRecord("postType",e.type,e.id,{content:a,blocks:l.blocks,source:"custom"},{undoIgnore:!0});const c=(0,x.parse)(i?.content?.raw);if(s.dispatch(u.store).editEntityRecord("postType",e.type,i.id,{content:a,blocks:c,source:"theme"}),t){const t=()=>{s.dispatch(u.store).editEntityRecord("postType",e.type,l.id,{content:a,blocks:l.blocks,source:"custom"})};s.dispatch(_s.store).createSuccessNotice((0,fs.__)("Template reset."),{type:"snackbar",id:n,actions:[{label:(0,fs.__)("Undo"),onClick:t}]})}}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("Template revert failed. Please reload.");s.dispatch(_s.store).createErrorNotice(t,{type:"snackbar"})}else s.dispatch(_s.store).createErrorNotice((0,fs.__)("This template is not revertable."),{type:"snackbar"})},Xl=e=>async({registry:t})=>{const s=e.every((e=>e?.has_theme_file)),n=await Promise.allSettled(e.map((e=>t.dispatch(u.store).deleteEntityRecord("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(n.every((({status:e})=>"fulfilled"===e))){let n;if(1===e.length){let t;"string"==typeof e[0].title?t=e[0].title:"string"==typeof e[0].title?.rendered?t=e[0].title?.rendered:"string"==typeof e[0].title?.raw&&(t=e[0].title?.raw),n=s?(0,fs.sprintf)((0,fs.__)('"%s" reset.'),(0,Ln.decodeEntities)(t)):(0,fs.sprintf)((0,fs._x)('"%s" deleted.',"template part"),(0,Ln.decodeEntities)(t))}else n=s?(0,fs.__)("Items reset."):(0,fs.__)("Items deleted.");t.dispatch(_s.store).createSuccessNotice(n,{type:"snackbar",id:"editor-template-deleted-success"})}else{let e;if(1===n.length)e=n[0].reason?.message?n[0].reason.message:s?(0,fs.__)("An error occurred while reverting the item."):(0,fs.__)("An error occurred while deleting the item.");else{const t=new Set,o=n.filter((({status:e})=>"rejected"===e));for(const e of o)e.reason?.message&&t.add(e.reason.message);e=0===t.size?(0,fs.__)("An error occurred while deleting the items."):1===t.size?s?(0,fs.sprintf)((0,fs.__)("An error occurred while reverting the items: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("An error occurred while deleting the items: %s"),[...t][0]):s?(0,fs.sprintf)((0,fs.__)("Some errors occurred while reverting the items: %s"),[...t].join(",")):(0,fs.sprintf)((0,fs.__)("Some errors occurred while deleting the items: %s"),[...t].join(","))}t.dispatch(_s.store).createErrorNotice(e,{type:"snackbar"})}},Jl=e=>({select:t,registry:s})=>{const n=t.getCurrentPostType(),o=s.select(u.store).getCurrentTheme()?.stylesheet,r=s.select(C.store).get("core","renderingModes")?.[o]??{};if(r[n]===e)return;const i={[o]:{...r,[n]:e}};s.dispatch(C.store).set("core","renderingModes",i)};function ec(e){return{type:"SET_CANVAS_MIN_HEIGHT",minHeight:e}}var tc=s(5215),sc=s.n(tc),nc=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"})}),oc=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"})});const rc=[];const ic={rootClientId:void 0,insertionIndex:void 0,filterValue:void 0},ac=["post-only","template-locked"],lc=(0,d.createRegistrySelector)((e=>(0,d.createSelector)((t=>{if("object"==typeof t.blockInserterPanel)return t.blockInserterPanel;if("template-locked"===st(t)){const[t]=e(g.store).getBlocksByName("core/post-content");if(t)return{rootClientId:t,insertionIndex:void 0,filterValue:void 0}}return ic}),(t=>{const[s]=e(g.store).getBlocksByName("core/post-content");return[t.blockInserterPanel,st(t),s]}))));function cc(e){return e.listViewToggleRef}function dc(e){return e.inserterSidebarToggleRef}const uc={wp_block:Ji,wp_navigation:nc,page:ea,post:oc},pc=(0,d.createRegistrySelector)((e=>(t,s,n)=>{{if("wp_template_part"===s||"wp_template"===s){const t=(e(u.store).getCurrentTheme()?.default_template_part_areas||[]).find((e=>n.area===e.area));return t?.icon?H(t.icon):W}if(uc[s])return uc[s];const t=e(u.store).getPostType(s);return"string"==typeof t?.icon&&t.icon.startsWith("dashicons-")?t.icon.slice(10):ea}})),mc=(0,d.createRegistrySelector)((e=>(t,s,n)=>{const{type:o,id:r}=ne(t),i=e(u.store).getEntityRecordNonTransientEdits("postType",s||o,n||r);if(!i?.meta)return!1;const a=e(u.store).getEntityRecord("postType",s||o,n||r)?.meta;return!sc()({...a,footnotes:void 0},{...i.meta,footnotes:void 0})}));function hc(e,...t){return function(e,t,s){return e.actions[t]?.[s]??rc}(e.dataviews,...t)}function gc(e,...t){return function(e,t,s){return e.isReady[t]?.[s]}(e.dataviews,...t)}function _c(e,...t){return function(e,t,s){return e.fields[t]?.[s]??rc}(e.dataviews,...t)}const fc=(0,d.createRegistrySelector)((e=>(0,d.createSelector)(((t,s)=>{s=Array.isArray(s)?s:[s];const{getBlocksByName:n,getBlockParents:o,getBlockName:r}=e(g.store);return n(s).filter((e=>o(e).every((e=>{const t=r(e);return"core/query"!==t&&!s.includes(t)}))))}),(()=>[e(g.store).getBlocks()])))),bc=(0,d.createRegistrySelector)((e=>(t,s)=>{const{getPostType:n,getCurrentTheme:o,hasFinishedResolution:r}=e(u.store),i=o(),a=n(s);if(!r("getPostType",[s])||!r("getCurrentTheme"))return;const l=i?.stylesheet,c=e(C.store).get("core","renderingModes")?.[l]?.[s],d=Array.isArray(a?.supports?.editor)?a.supports.editor.find((e=>"default-mode"in e))?.["default-mode"]:void 0,p=c||d;return ac.includes(p)?p:"post-only"}));function yc(e){return e.canvasMinHeight}const xc={reducer:y,selectors:e,actions:t},vc=(0,d.createReduxStore)("core/editor",{...xc});(0,d.register)(vc),$(vc).registerPrivateActions(a),$(vc).registerPrivateSelectors(l);function wc(e){const t=e.avatar_urls&&e.avatar_urls[24]?(0,c.jsx)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):(0,c.jsx)("span",{className:"editor-autocompleters__no-avatar"});return(0,c.jsxs)(c.Fragment,{children:[t,(0,c.jsx)("span",{className:"editor-autocompleters__user-name",children:e.name}),(0,c.jsx)("span",{className:"editor-autocompleters__user-slug",children:e.slug})]})}(0,h.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",(function(e){const t=Object.fromEntries(Object.entries(e.attributes??{}).filter((([,{source:e}])=>"meta"===e)).map((([e,{meta:t}])=>[e,t])));return Object.entries(t).length&&(e.edit=(e=>(0,m.createHigherOrderComponent)((t=>({attributes:s,setAttributes:n,...o})=>{const r=(0,d.useSelect)((e=>e(vc).getCurrentPostType()),[]),[i,a]=(0,u.useEntityProp)("postType",r,"meta"),l=(0,p.useMemo)((()=>({...s,...Object.fromEntries(Object.entries(e).map((([e,t])=>[e,i[t]])))})),[s,i]);return(0,c.jsx)(t,{attributes:l,setAttributes:t=>{const s=Object.fromEntries(Object.entries(t??{}).filter((([t])=>t in e)).map((([t,s])=>[e[t],s])));Object.entries(s).length&&a(s),n(t)},...o})}),"withMetaAttributeSource"))(t)(e.edit)),e}));var Sc={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=(0,d.useSelect)((t=>{const{getUsers:s}=t(u.store);return s({context:"view",search:encodeURIComponent(e)})}),[e]);return[(0,p.useMemo)((()=>t?t.map((e=>({key:`user-${e.slug}`,value:e,label:wc(e)}))):[]),[t])]},getOptionCompletion:e=>`@${e.slug}`};(0,h.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(e=[]){return e.push({...Sc}),e})),(0,h.addFilter)("editor.MediaUpload","core/editor/components/media-upload",(()=>lr.MediaUpload));const{PatternOverridesControls:kc,ResetOverridesControl:Cc,PatternOverridesBlockControls:Pc,PATTERN_TYPES:jc,PARTIAL_SYNCING_SUPPORTED_BLOCKS:Ec,PATTERN_SYNC_TYPES:Tc}=$(ao.privateApis),Bc=(0,m.createHigherOrderComponent)((e=>t=>{const s=!!Ec[t.name];return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(e,{...t},"edit"),t.isSelected&&s&&(0,c.jsx)(Ic,{...t}),s&&(0,c.jsx)(Pc,{})]})}),"withPatternOverrideControls");function Ic(e){const t=(0,g.useBlockEditingMode)(),{hasPatternOverridesSource:s,isEditingSyncedPattern:n}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:s}=e(vc);return{hasPatternOverridesSource:!!(0,x.getBlockBindingsSource)("core/pattern-overrides"),isEditingSyncedPattern:t()===jc.user&&s("meta")?.wp_pattern_sync_status!==Tc.unsynced&&s("wp_pattern_sync_status")!==Tc.unsynced}}),[]),o=e.attributes.metadata?.bindings,r=!!o&&Object.values(o).some((e=>"core/pattern-overrides"===e.source)),i=n&&"default"===t,a=!n&&!!e.attributes.metadata?.name&&"disabled"!==t&&r;return s?(0,c.jsxs)(c.Fragment,{children:[i&&(0,c.jsx)(kc,{...e}),a&&(0,c.jsx)(Cc,{...e})]}):null}(0,h.addFilter)("editor.BlockEdit","core/editor/with-pattern-override-controls",Bc);const Nc=["core/navigation-link","core/navigation-submenu"];function Rc({attributes:e}){const{kind:t,id:s,type:n}=e,o=(0,g.useBlockEditingMode)(),r=(0,d.useSelect)((e=>e(g.store).getSettings().onNavigateToEntityRecord),[]),i=(0,p.useCallback)((()=>{"post-type"===t&&"page"===n&&s&&r&&r({postId:s,postType:n})}),[t,s,n,r]);return"post-type"===t&&"page"===n&&s&&r&&"contentOnly"===o?(0,c.jsx)(g.__unstableBlockToolbarLastItem,{children:(0,c.jsx)(Hn.ToolbarGroup,{children:(0,c.jsx)(Hn.ToolbarButton,{name:"view",title:(0,fs.__)("View"),onClick:i,children:(0,fs.__)("View")})})}):null}const Dc=(0,m.createHigherOrderComponent)((e=>t=>{const s=Nc.includes(t.name);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(e,{...t},"edit"),t.isSelected&&s&&(0,c.jsx)(Rc,{...t})]})}),"withNavigationViewButton");(0,h.addFilter)("editor.BlockEdit","core/editor/with-navigation-view-button",Dc);function Ac({clientId:e}){const{selectBlock:t,flashBlock:s}=(0,d.useDispatch)(g.store),{enableComplementaryArea:n}=(0,d.useDispatch)(ja),{hasNavigationBlocks:o,firstNavigationBlockId:r,isNavigationEditable:i}=(0,d.useSelect)((t=>{const{getClientIdsOfDescendants:s,getBlockName:n,getBlockEditingMode:o}=t(g.store),r=s(e).filter((e=>"core/navigation"===n(e))),i=r.length>0,a=i?r[0]:null;return{hasNavigationBlocks:i,firstNavigationBlockId:a,isNavigationEditable:"disabled"!==o(a)}}),[e]),a=(0,p.useCallback)((()=>{r&&(t(r),s(r,500),n("core","edit-post/block"))}),[r,t,s,n]);return o&&i?(0,c.jsx)(g.__unstableBlockToolbarLastItem,{children:(0,c.jsx)(Hn.ToolbarGroup,{children:(0,c.jsx)(Hn.ToolbarButton,{label:(0,fs.__)("Edit navigation"),onClick:a,children:(0,fs.__)("Edit navigation")})})}):null}const Mc=(0,m.createHigherOrderComponent)((e=>t=>{const s="core/template-part"===t.name;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(e,{...t},"edit"),t.isSelected&&s&&(0,c.jsx)(Ac,{clientId:t.clientId})]})}),"withTemplatePartNavigationEditButton");(0,h.addFilter)("editor.BlockEdit","core/editor/with-template-part-navigation-edit-button",Mc);class Lc extends p.Component{constructor(e){super(e),this.needsAutosave=!(!e.isDirty||!e.isAutosaveable)}componentDidMount(){this.props.disableIntervalChecks||this.setAutosaveTimer()}componentDidUpdate(e){this.props.disableIntervalChecks?this.props.editsReference!==e.editsReference&&this.props.autosave():(this.props.interval!==e.interval&&(clearTimeout(this.timerId),this.setAutosaveTimer()),this.props.isDirty&&(!this.props.isAutosaving||e.isAutosaving)?this.props.editsReference!==e.editsReference&&(this.needsAutosave=!0):this.needsAutosave=!1)}componentWillUnmount(){clearTimeout(this.timerId)}setAutosaveTimer(e=1e3*this.props.interval){this.timerId=setTimeout((()=>{this.autosaveTimerHandler()}),e)}autosaveTimerHandler(){this.props.isAutosaveable?(this.needsAutosave&&(this.needsAutosave=!1,this.props.autosave()),this.setAutosaveTimer()):this.setAutosaveTimer(1e3)}render(){return null}}var Oc=(0,m.compose)([(0,d.withSelect)(((e,t)=>{const{getReferenceByDistinctEdits:s}=e(u.store),{isEditedPostDirty:n,isEditedPostAutosaveable:o,isAutosavingPost:r,getEditorSettings:i}=e(vc),{interval:a=i().autosaveInterval}=t;return{editsReference:s(),isDirty:n(),isAutosaveable:o(),isAutosaving:r(),interval:a}})),(0,d.withDispatch)(((e,t)=>({autosave(){const{autosave:s=e(vc).autosave}=t;s()}})))])(Lc),Fc=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})}),Vc=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})});const Uc=window.wp.dom;function Hc(e){const{isFrontPage:t,isPostsPage:s}=(0,d.useSelect)((t=>{const{canUser:s,getEditedEntityRecord:n}=t(u.store),o=s("read",{kind:"root",name:"site"})?n("root","site"):void 0,r=parseInt(e,10);return{isFrontPage:o?.page_on_front===r,isPostsPage:o?.page_for_posts===r}}));return t?(0,fs.__)("Homepage"):!!s&&(0,fs.__)("Posts Page")}const zc=Hn.__unstableMotion.create(Hn.Button);function Gc(e){const{postId:t,postType:s,postTypeLabel:n,documentTitle:o,isNotFound:r,templateTitle:i,onNavigateToPreviousEntityRecord:a,isTemplatePreview:l}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s,getEditorSettings:n,getRenderingMode:o}=e(vc),{getEditedEntityRecord:r,getPostType:i,getCurrentTheme:a,isResolving:l}=e(u.store),c=t(),d=s(),p=r("postType",c,d),{default_template_types:m=[]}=a()??{},h=Y({templateTypes:m,template:p}),g=i(c)?.labels?.singular_name;return{postId:d,postType:c,postTypeLabel:g,documentTitle:p.title,isNotFound:!p&&!l("getEditedEntityRecord","postType",c,d),templateTitle:h.title,onNavigateToPreviousEntityRecord:n().onNavigateToPreviousEntityRecord,isTemplatePreview:"template-locked"===o()}}),[]),{open:h}=(0,d.useDispatch)(na.store),_=(0,m.useReducedMotion)(),f=A.includes(s),b=!!a,y=f?i:o,x=e.title||y,v=e.icon,w=Hc(t),S=(0,p.useRef)(!1);return(0,p.useEffect)((()=>{S.current=!0}),[]),(0,c.jsxs)("div",{className:mr("editor-document-bar",{"has-back-button":b}),children:[(0,c.jsx)(Hn.__unstableAnimatePresence,{children:b&&(0,c.jsx)(zc,{className:"editor-document-bar__back",icon:(0,fs.isRTL)()?Fc:Vc,onClick:e=>{e.stopPropagation(),a()},size:"compact",initial:!!S.current&&{opacity:0,transform:"translateX(15%)"},animate:{opacity:1,transform:"translateX(0%)"},exit:{opacity:0,transform:"translateX(15%)"},transition:_?{duration:0}:void 0,children:(0,fs.__)("Back")})}),!f&&l&&!b&&(0,c.jsx)(g.BlockIcon,{icon:W,className:"editor-document-bar__icon-layout"}),r?(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Document not found")}):(0,c.jsxs)(Hn.Button,{className:"editor-document-bar__command",onClick:()=>h(),size:"compact",children:[(0,c.jsxs)(Hn.__unstableMotion.div,{className:"editor-document-bar__title",initial:!!S.current&&{opacity:0,transform:b?"translateX(15%)":"translateX(-15%)"},animate:{opacity:1,transform:"translateX(0%)"},transition:_?{duration:0}:void 0,children:[v&&(0,c.jsx)(g.BlockIcon,{icon:v}),(0,c.jsxs)(Hn.__experimentalText,{size:"body",as:"h1",children:[(0,c.jsx)("span",{className:"editor-document-bar__post-title",children:x?(0,Uc.__unstableStripHTML)(x):(0,fs.__)("No title")}),w&&(0,c.jsx)("span",{className:"editor-document-bar__post-type-label",children:`· ${w}`}),n&&!e.title&&!w&&(0,c.jsx)("span",{className:"editor-document-bar__post-type-label",children:`· ${(0,Ln.decodeEntities)(n)}`})]})]},b),(0,c.jsx)("span",{className:"editor-document-bar__shortcut",children:ll.displayShortcut.primary("k")})]})]})}const $c=window.wp.richText;var Wc=({children:e,isValid:t,isDisabled:s,level:n,href:o,onSelect:r})=>(0,c.jsx)("li",{className:mr("document-outline__item",`is-${n.toLowerCase()}`,{"is-invalid":!t,"is-disabled":s}),children:(0,c.jsxs)("a",{href:o,className:"document-outline__button","aria-disabled":s,onClick:function(e){s?e.preventDefault():r()},children:[(0,c.jsx)("span",{className:"document-outline__emdash","aria-hidden":"true"}),(0,c.jsx)("strong",{className:"document-outline__level",children:n}),(0,c.jsx)("span",{className:"document-outline__item-content",children:e})]})});const Zc=(0,c.jsx)("em",{children:(0,fs.__)("(Empty heading)")}),Yc=[(0,c.jsx)("br",{},"incorrect-break"),(0,c.jsx)("em",{children:(0,fs.__)("(Incorrect heading level)")},"incorrect-message")],qc=[(0,c.jsx)("br",{},"incorrect-break-h1"),(0,c.jsx)("em",{children:(0,fs.__)("(Your theme may already use a H1 for the post title)")},"incorrect-message-h1")],Kc=[(0,c.jsx)("br",{},"incorrect-break-multiple-h1"),(0,c.jsx)("em",{children:(0,fs.__)("(Multiple H1 headings are not recommended)")},"incorrect-message-multiple-h1")];function Qc(){return(0,c.jsxs)(Hn.SVG,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,c.jsx)(Hn.Rect,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),(0,c.jsx)(Hn.Line,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),(0,c.jsx)(Hn.Rect,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),(0,c.jsx)(Hn.Path,{d:"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z",fill:"black"}),(0,c.jsx)(Hn.Line,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),(0,c.jsx)(Hn.Rect,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,c.jsx)(Hn.Path,{d:"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z",fill:"black"}),(0,c.jsx)(Hn.Line,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),(0,c.jsx)(Hn.Rect,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),(0,c.jsx)(Hn.Path,{d:"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z",fill:"black"}),(0,c.jsx)(Hn.Line,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),(0,c.jsx)(Hn.Rect,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,c.jsx)(Hn.Path,{d:"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z",fill:"black"})]})}const Xc=(e=[])=>e.filter((e=>"core/heading"===e.name)).map((e=>({...e,level:e.attributes.level,isEmpty:Jc(e)}))),Jc=e=>!e.attributes.content||0===e.attributes.content.trim().length;function ed({onSelect:e,hasOutlineItemsDisabled:t}){const{selectBlock:s}=(0,d.useDispatch)(g.store),{title:n,isTitleSupported:o}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),{getPostType:s}=e(u.store),n=s(t("type"));return{title:t("title"),isTitleSupported:n?.supports?.title??!1}})),r=(0,d.useSelect)((e=>{const{getClientIdsWithDescendants:t,getBlock:s}=e(g.store);return t().map((e=>s(e)))})),i=(0,d.useSelect)((e=>{if("post-only"===e(vc).getRenderingMode())return;const{getBlocksByName:t,getClientIdsOfDescendants:s}=e(g.store),[n]=t("core/post-content");return n?s(n):void 0}),[]),a=(0,p.useRef)(1),l=(0,p.useMemo)((()=>Xc(r)),[r]);if(l.length<1)return(0,c.jsxs)("div",{className:"editor-document-outline has-no-headings",children:[(0,c.jsx)(Qc,{}),(0,c.jsx)("p",{children:(0,fs.__)("Navigate the structure of your document and address issues like empty or incorrect heading levels.")})]});const m=document.querySelector(".editor-post-title__input"),h=o&&n&&m,_=l.reduce(((e,t)=>({...e,[t.level]:(e[t.level]||0)+1})),{})[1]>1;return(0,c.jsx)("div",{className:"document-outline",children:(0,c.jsxs)("ul",{children:[h&&(0,c.jsx)(Wc,{level:(0,fs.__)("Title"),isValid:!0,onSelect:e,href:`#${m.id}`,isDisabled:t,children:n}),l.map((n=>{const o=n.level>a.current+1,r=!(n.isEmpty||o||!n.level||1===n.level&&(_||h));return a.current=n.level,(0,c.jsxs)(Wc,{level:`H${n.level}`,isValid:r,isDisabled:t||(l=n.clientId,!(!Array.isArray(i)||i.includes(l))),href:`#block-${n.clientId}`,onSelect:()=>{s(n.clientId),e?.()},children:[n.isEmpty?Zc:(0,$c.getTextContent)((0,$c.create)({html:n.attributes.content})),o&&Yc,1===n.level&&_&&Kc,h&&1===n.level&&!_&&qc]},n.clientId);var l}))]})})}function td({children:e}){const t=(0,d.useSelect)((e=>{const{getGlobalBlockCount:t}=e(g.store);return t("core/heading")>0}));return t?e:null}var sd=function(){const{registerShortcut:e}=(0,d.useDispatch)(il.store);return(0,p.useEffect)((()=>{e({name:"core/editor/toggle-mode",category:"global",description:(0,fs.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),e({name:"core/editor/save",category:"global",description:(0,fs.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/editor/undo",category:"global",description:(0,fs.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/editor/redo",category:"global",description:(0,fs.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,ll.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/editor/toggle-list-view",category:"global",description:(0,fs.__)("Show or hide the List View."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/editor/toggle-distraction-free",category:"global",description:(0,fs.__)("Enter or exit distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),e({name:"core/editor/toggle-sidebar",category:"global",description:(0,fs.__)("Show or hide the Settings panel."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/editor/keyboard-shortcuts",category:"main",description:(0,fs.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/editor/next-region",category:"global",description:(0,fs.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/editor/previous-region",category:"global",description:(0,fs.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})}),[e]),(0,c.jsx)(g.BlockEditorKeyboardShortcuts.Register,{})},nd=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"})}),od=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})});var rd=(0,p.forwardRef)((function(e,t){const s=(0,ll.isAppleOS)()?ll.displayShortcut.primaryShift("z"):ll.displayShortcut.primary("y"),n=(0,d.useSelect)((e=>e(vc).hasEditorRedo()),[]),{redo:o}=(0,d.useDispatch)(vc);return(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,...e,ref:t,icon:(0,fs.isRTL)()?od:nd,label:(0,fs.__)("Redo"),shortcut:s,"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__redo"})}));var id=(0,p.forwardRef)((function(e,t){const s=(0,d.useSelect)((e=>e(vc).hasEditorUndo()),[]),{undo:n}=(0,d.useDispatch)(vc);return(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,...e,ref:t,icon:(0,fs.isRTL)()?nd:od,label:(0,fs.__)("Undo"),shortcut:ll.displayShortcut.primary("z"),"aria-disabled":!s,onClick:s?n:void 0,className:"editor-history__undo"})}));function ad(){const[e,t]=(0,p.useState)(!1),s=(0,d.useSelect)((e=>e(g.store).isValidTemplate()),[]),{setTemplateValidity:n,synchronizeTemplate:o}=(0,d.useDispatch)(g.store);return s?null:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:(0,fs.__)("Keep it as is"),onClick:()=>n(!0)},{label:(0,fs.__)("Reset the template"),onClick:()=>t(!0)}],children:(0,fs.__)("The content of your post doesn’t match the template assigned to your post type.")}),(0,c.jsx)(Hn.__experimentalConfirmDialog,{isOpen:e,confirmButtonText:(0,fs.__)("Reset"),onConfirm:()=>{t(!1),o()},onCancel:()=>t(!1),size:"medium",children:(0,fs.__)("Resetting the template may result in loss of content, do you want to continue?")})]})}var ld=function(){const{notices:e}=(0,d.useSelect)((e=>({notices:e(_s.store).getNotices()})),[]),{removeNotice:t}=(0,d.useDispatch)(_s.store),s=e.filter((({isDismissible:e,type:t})=>e&&"default"===t)),n=e.filter((({isDismissible:e,type:t})=>!e&&"default"===t));return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.NoticeList,{notices:n,className:"components-editor-notices__pinned"}),(0,c.jsx)(Hn.NoticeList,{notices:s,className:"components-editor-notices__dismissible",onRemove:t,children:(0,c.jsx)(ad,{})})]})};const cd=-3;function dd(){const e=(0,d.useSelect)((e=>e(_s.store).getNotices()),[]),{removeNotice:t}=(0,d.useDispatch)(_s.store),s=e.filter((({type:e})=>"snackbar"===e)).slice(cd);return(0,c.jsx)(Hn.SnackbarList,{notices:s,className:"components-editor-notices__snackbar",onRemove:t})}function ud({record:e,checked:t,onChange:s}){const{name:n,kind:o,title:r,key:i}=e,{entityRecordTitle:a,hasPostMetaChanges:l}=(0,d.useSelect)((e=>{if("postType"!==o||"wp_template"!==n)return{entityRecordTitle:r,hasPostMetaChanges:$(e(vc)).hasPostMetaChanges(n,i)};const t=e(u.store).getEditedEntityRecord(o,n,i),{default_template_types:s=[]}=e(u.store).getCurrentTheme()??{};return{entityRecordTitle:Y({template:t,templateTypes:s}).title,hasPostMetaChanges:$(e(vc)).hasPostMetaChanges(n,i)}}),[n,o,r,i]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.PanelRow,{children:(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Ln.decodeEntities)(a)||(0,fs.__)("Untitled"),checked:t,onChange:s,className:"entities-saved-states__change-control"})}),l&&(0,c.jsx)("ul",{className:"entities-saved-states__changes",children:(0,c.jsx)("li",{children:(0,fs.__)("Post Meta.")})})]})}const{getGlobalStylesChanges:pd,GlobalStylesContext:md}=$(g.privateApis);function hd({record:e}){const{user:t}=(0,p.useContext)(md),s=(0,d.useSelect)((t=>t(u.store).getEntityRecord(e.kind,e.name,e.key)),[e.kind,e.name,e.key]),n=pd(t,s,{maxResults:10});return n.length?(0,c.jsx)("ul",{className:"entities-saved-states__changes",children:n.map((e=>(0,c.jsx)("li",{children:e},e)))}):null}function gd({record:e,count:t}){if("globalStyles"===e?.name)return null;const s=function(e,t){switch(e){case"site":return 1===t?(0,fs.__)("This change will affect your whole site."):(0,fs.__)("These changes will affect your whole site.");case"wp_template":return(0,fs.__)("This change will affect other parts of your site that use this template.");case"page":case"post":return(0,fs.__)("The following has been modified.")}}(e?.name,t);return s?(0,c.jsx)(Hn.PanelRow,{children:s}):null}function _d({list:e,unselectedEntities:t,setUnselectedEntities:s}){const n=e.length,o=e[0];let r=(0,d.useSelect)((e=>e(u.store).getEntityConfig(o.kind,o.name)),[o.kind,o.name]).label;return"wp_template_part"===o?.name&&(r=1===n?(0,fs.__)("Template Part"):(0,fs.__)("Template Parts")),(0,c.jsxs)(Hn.PanelBody,{title:r,initialOpen:!0,className:"entities-saved-states__panel-body",children:[(0,c.jsx)(gd,{record:o,count:n}),e.map((e=>(0,c.jsx)(ud,{record:e,checked:!t.some((t=>t.kind===e.kind&&t.name===e.name&&t.key===e.key&&t.property===e.property)),onChange:t=>s(e,t)},e.key||e.property))),"globalStyles"===o?.name&&(0,c.jsx)(hd,{record:o})]})}const fd=()=>{const{editedEntities:e,siteEdits:t,siteEntityConfig:s}=(0,d.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,getEntityRecordEdits:s,getEntityConfig:n}=e(u.store);return{editedEntities:t(),siteEdits:s("root","site"),siteEntityConfig:n("root","site")}}),[]),n=(0,p.useMemo)((()=>{const n=e.filter((e=>!("root"===e.kind&&"site"===e.name))),o=s?.meta?.labels??{},r=[];for(const e in t)r.push({kind:"root",name:"site",title:o[e]||e,property:e});return[...n,...r]}),[e,t,s]),[o,r]=(0,p.useState)([]);return{dirtyEntityRecords:n,isDirty:n.length-o.length>0,setUnselectedEntities:({kind:e,name:t,key:s,property:n},i)=>{r(i?o.filter((o=>o.kind!==e||o.name!==t||o.key!==s||o.property!==n)):[...o,{kind:e,name:t,key:s,property:n}])},unselectedEntities:o}};function bd(e){return e}function yd({close:e,renderDialog:t,variant:s}){const n=fd();return(0,c.jsx)(xd,{close:e,renderDialog:t,variant:s,...n})}function xd({additionalPrompt:e,close:t,onSave:s=bd,saveEnabled:n,saveLabel:o=(0,fs.__)("Save"),renderDialog:r,dirtyEntityRecords:i,isDirty:a,setUnselectedEntities:l,unselectedEntities:u,variant:h="default"}){const g=(0,p.useRef)(),{saveDirtyEntities:_}=$((0,d.useDispatch)(vc)),f=i.reduce(((e,t)=>{const{name:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),{site:b,wp_template:y,wp_template_part:x,...v}=f,w=[b,y,x,...Object.values(v)].filter(Array.isArray),S=n??a,k=(0,p.useCallback)((()=>t()),[t]),[C,P]=(0,m.__experimentalUseDialog)({onClose:()=>k()}),j=(0,m.useInstanceId)(xd,"entities-saved-states__panel-label"),E=(0,m.useInstanceId)(xd,"entities-saved-states__panel-description"),T=i.length?(0,fs.__)("Select the items you want to save."):void 0,B="inline"===h,I=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.FlexItem,{isBlock:!B,as:Hn.Button,variant:B?"tertiary":"secondary",size:B?void 0:"compact",onClick:k,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.FlexItem,{isBlock:!B,as:Hn.Button,ref:g,variant:"primary",size:B?void 0:"compact",disabled:!S,accessibleWhenDisabled:!0,onClick:()=>_({onSave:s,dirtyEntityRecords:i,entitiesToSkip:u,close:t}),className:"editor-entities-saved-states__save-button",children:o})]});return(0,c.jsxs)("div",{ref:r?C:void 0,...r&&P,className:mr("entities-saved-states__panel",{"is-inline":B}),role:r?"dialog":void 0,"aria-labelledby":r?j:void 0,"aria-describedby":r?E:void 0,children:[!B&&(0,c.jsx)(Hn.Flex,{className:"entities-saved-states__panel-header",gap:2,children:I}),(0,c.jsxs)("div",{className:"entities-saved-states__text-prompt",children:[(0,c.jsx)("div",{className:"entities-saved-states__text-prompt--header-wrapper",children:(0,c.jsx)("strong",{id:r?j:void 0,className:"entities-saved-states__text-prompt--header",children:(0,fs.__)("Are you ready to save?")})}),(0,c.jsxs)("div",{id:r?E:void 0,children:[e,(0,c.jsx)("p",{className:"entities-saved-states__text-prompt--changes-count",children:a?(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs._n)("There is <strong>%d site change</strong> waiting to be saved.","There are <strong>%d site changes</strong> waiting to be saved.",i.length),i.length),{strong:(0,c.jsx)("strong",{})}):T})]})]}),w.map((e=>(0,c.jsx)(_d,{list:e,unselectedEntities:u,setUnselectedEntities:l},e[0].name))),B&&(0,c.jsx)(Hn.Flex,{direction:"row",justify:"flex-end",className:"entities-saved-states__panel-footer",children:I})]})}function vd(){try{return(0,d.select)(vc).getEditedPostContent()}catch(e){}}function wd({text:e,children:t,variant:s="secondary"}){const n=(0,m.useCopyToClipboard)(e);return(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:s,ref:n,children:t})}class Sd extends p.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,h.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){const{error:e}=this.state,{canCopyContent:t=!1}=this.props;return e?(0,c.jsxs)(Hn.__experimentalHStack,{className:"editor-error-boundary",alignment:"baseline",spacing:4,justify:"space-between",expanded:!1,wrap:!0,children:[(0,c.jsx)(Hn.__experimentalText,{as:"p",children:(0,fs.__)("The editor has encountered an unexpected error.")}),(0,c.jsxs)(Hn.__experimentalHStack,{expanded:!1,children:[t&&(0,c.jsx)(wd,{text:vd,children:(0,fs.__)("Copy contents")}),(0,c.jsx)(wd,{variant:"primary",text:e?.stack,children:(0,fs.__)("Copy error")})]})]}):this.props.children}}var kd=Sd;const Cd=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame;let Pd;function jd(){const{postId:e,isEditedPostNew:t,hasRemoteAutosave:s}=(0,d.useSelect)((e=>({postId:e(vc).getCurrentPostId(),isEditedPostNew:e(vc).isEditedPostNew(),hasRemoteAutosave:!!e(vc).getEditorSettings().autosave})),[]),{getEditedPostAttribute:n}=(0,d.useSelect)(vc),{createWarningNotice:o,removeNotice:r}=(0,d.useDispatch)(_s.store),{editPost:i,resetEditorBlocks:a}=(0,d.useDispatch)(vc);(0,p.useEffect)((()=>{let l=function(e,t){return window.sessionStorage.getItem(bs(e,t))}(e,t);if(!l)return;try{l=JSON.parse(l)}catch{return}const{post_title:c,content:d,excerpt:u}=l,p={title:c,content:d,excerpt:u};if(!Object.keys(p).some((e=>p[e]!==n(e))))return void ys(e,t);if(s)return;const m="wpEditorAutosaveRestore";o((0,fs.__)("The backup of this post in your browser is different from the version below."),{id:m,actions:[{label:(0,fs.__)("Restore the backup"),onClick(){const{content:e,...t}=p;i(t),a((0,x.parse)(p.content)),r(m)}}]})}),[t,e])}var Ed=(0,m.ifCondition)((()=>{if(void 0!==Pd)return Pd;try{window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),Pd=!0}catch{Pd=!1}return Pd}))((function(){const{autosave:e}=(0,d.useDispatch)(vc),t=(0,p.useCallback)((()=>{Cd((()=>e({local:!0})))}),[]);jd(),function(){const{postId:e,isEditedPostNew:t,isDirty:s,isAutosaving:n,didError:o}=(0,d.useSelect)((e=>({postId:e(vc).getCurrentPostId(),isEditedPostNew:e(vc).isEditedPostNew(),isDirty:e(vc).isEditedPostDirty(),isAutosaving:e(vc).isAutosavingPost(),didError:e(vc).didPostSaveRequestFail()})),[]),r=(0,p.useRef)(s),i=(0,p.useRef)(n);(0,p.useEffect)((()=>{!o&&(i.current&&!n||r.current&&!s)&&ys(e,t),r.current=s,i.current=n}),[s,n,o]);const a=(0,m.usePrevious)(t),l=(0,m.usePrevious)(e);(0,p.useEffect)((()=>{l===e&&a&&!t&&ys(e,!0)}),[t,e])}();const s=(0,d.useSelect)((e=>e(vc).getEditorSettings().localAutosaveInterval),[]);return(0,c.jsx)(Oc,{interval:s,autosave:t})}));var Td=function({children:e}){const t=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),{getPostType:s}=e(u.store),n=s(t("type"));return!!n?.supports?.["page-attributes"]}),[]);return t?e:null};var Bd=function({children:e,supportKeys:t}){const s=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),{getPostType:s}=e(u.store);return s(t("type"))}),[]);let n=!!s;return s&&(n=(Array.isArray(t)?t:[t]).some((e=>function(e={},t){if(void 0!==e[t])return!!e[t];const[s,n]=t.split("."),[o]=Array.isArray(e[s])?e[s]:[];return Array.isArray(o)?o.includes(n):!!o?.[n]}(s.supports,e)))),n?e:null};function Id(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("menu_order")??0),[]),{editPost:t}=(0,d.useDispatch)(vc),[s,n]=(0,p.useState)(null),o=s??e;return(0,c.jsx)(Hn.Flex,{children:(0,c.jsx)(Hn.FlexBlock,{children:(0,c.jsx)(Hn.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,fs.__)("Order"),help:(0,fs.__)("Set the page order."),value:o,onChange:e=>{n(e);const s=Number(e);Number.isInteger(s)&&""!==e.trim?.()&&t({menu_order:s})},hideLabelFromVision:!0,onBlur:()=>{n(null)}})})})}function Nd(){return(0,c.jsx)(Bd,{supportKeys:"page-attributes",children:(0,c.jsx)(Id,{})})}var Rd=(0,p.forwardRef)((({className:e,label:t,children:s},n)=>(0,c.jsxs)(Hn.__experimentalHStack,{className:mr("editor-post-panel__row",e),ref:n,children:[t&&(0,c.jsx)("div",{className:"editor-post-panel__row-label",children:t}),(0,c.jsx)("div",{className:"editor-post-panel__row-control",children:s})]})));function Dd(e){const t=e.map((e=>({children:[],parent:void 0,...e})));if(t.some((({parent:e})=>void 0===e)))return t;const s=t.reduce(((e,t)=>{const{parent:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),n=e=>e.map((e=>{const t=s[e.id];return{...e,children:t&&t.length?n(t):[]}}));return n(s[0]||[])}const Ad=e=>(0,Ln.decodeEntities)(e),Md=e=>({...e,name:Ad(e.name)}),Ld=e=>(e??[]).map(Md);function Od(e){return e?.title?.rendered?(0,Ln.decodeEntities)(e.title.rendered):`#${e.id} (${(0,fs.__)("no title")})`}const Fd=(e,t)=>{const s=Mr()(e||"").toLowerCase(),n=Mr()(t||"").toLowerCase();return s===n?0:s.startsWith(n)?s.length:1/0};function Vd(){const{editPost:e}=(0,d.useDispatch)(vc),[t,s]=(0,p.useState)(!1),{isHierarchical:n,parentPostId:o,parentPostTitle:r,pageItems:i,isLoading:a}=(0,d.useSelect)((e=>{const{getPostType:s,getEntityRecords:n,getEntityRecord:o,isResolving:r}=e(u.store),{getCurrentPostId:i,getEditedPostAttribute:a}=e(vc),l=a("type"),c=a("parent"),d=s(l),p=i(),m=d?.hierarchical??!1,h={per_page:100,exclude:p,parent_exclude:p,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};t&&(h.search=t);const g=c?o("postType",l,c):null;return{isHierarchical:m,parentPostId:c,parentPostTitle:g?Od(g):"",pageItems:m?n("postType",l,h):null,isLoading:!!m&&r("getEntityRecords",["postType",l,h])}}),[t]),l=(0,p.useMemo)((()=>{const e=(s,n=0)=>{const o=s.map((t=>[{value:t.id,label:"— ".repeat(n)+(0,Ln.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],n+1)])).sort((([e],[s])=>Fd(e.rawName,t)>=Fd(s.rawName,t)?1:-1));return o.flat()};if(!i)return[];let s=i.map((e=>({id:e.id,parent:e.parent,name:Od(e)})));t||(s=Dd(s));const n=e(s),a=n.find((e=>e.value===o));return r&&!a&&n.unshift({value:o,label:r}),n}),[i,t,r,o]);if(!n)return null;return(0,c.jsx)(Hn.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:(0,fs.__)("Parent"),help:(0,fs.__)("Choose a parent page."),value:o,options:l,onFilterValueChange:(0,m.debounce)((e=>{s(e)}),300),onChange:t=>{e({parent:t})},hideLabelFromVision:!0,isLoading:a})}function Ud({isOpen:e,onClick:t}){const s=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),s=t("parent");if(!s)return null;const{getEntityRecord:n}=e(u.store);return n("postType",t("type"),s)}),[]),n=(0,p.useMemo)((()=>s?Od(s):(0,fs.__)("None")),[s]);return(0,c.jsx)(Hn.Button,{size:"compact",className:"editor-post-parent__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change parent: %s"),n),onClick:t,children:n})}function Hd(){const e=(0,d.useSelect)((e=>e(u.store).getEntityRecord("root","__unstableBase")?.home),[]),[t,s]=(0,p.useState)(null),n=(0,p.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return(0,c.jsx)(Rd,{label:(0,fs.__)("Parent"),ref:s,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:n,className:"editor-post-parent__panel-dropdown",contentClassName:"editor-post-parent__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Ud,{isOpen:e,onClick:t}),renderContent:({onClose:t})=>(0,c.jsxs)("div",{className:"editor-post-parent",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Parent"),onClose:t}),(0,c.jsxs)("div",{children:[(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s<wbr />/services<wbr />/pricing.'),(0,w.filterURLForDisplay)(e).replace(/([/.])/g,"<wbr />$1")),{wbr:(0,c.jsx)("wbr",{})}),(0,c.jsx)("p",{children:(0,p.createInterpolateElement)((0,fs.__)("They also show up as sub-items in the default navigation menu. <a>Learn more.</a>"),{a:(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes")})})})]}),(0,c.jsx)(Vd,{})]})})})}var zd=Vd;const Gd="page-attributes";function $d(){const{isEnabled:e,postType:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:s}=e(vc),{getPostType:n}=e(u.store);return{isEnabled:s(Gd),postType:n(t("type"))}}),[]);return e&&t?(0,c.jsx)(Hd,{}):null}function Wd(){return(0,c.jsx)(Td,{children:(0,c.jsx)($d,{})})}var Zd=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5 5.5V8H20V5.5H22.5V4H20V1.5H18.5V4H16V5.5H18.5ZM13.9624 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V10.0391H18.5V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 10.4917L16.4589 10.5139L16.4641 9.01389L5.5 8.97618V6C5.5 5.72386 5.72386 5.5 6 5.5H13.9624V4ZM5.5 10.4762V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 10.4865L5.5 10.4762Z"})});const Yd=(0,fs.__)("Custom Template");function qd({onClose:e}){const{defaultBlockTemplate:t,onNavigateToEntityRecord:s}=(0,d.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:s}=e(vc);return{defaultBlockTemplate:t().defaultBlockTemplate,onNavigateToEntityRecord:t().onNavigateToEntityRecord,getTemplateId:s}})),{createTemplate:n}=$((0,d.useDispatch)(vc)),[o,r]=(0,p.useState)(""),[i,a]=(0,p.useState)(!1),l=()=>{r(""),e()};return(0,c.jsx)(Hn.Modal,{title:(0,fs.__)("Create custom template"),onRequestClose:l,focusOnMount:"firstContentElement",size:"small",overlayClassName:"editor-post-template__create-template-modal",children:(0,c.jsx)("form",{className:"editor-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),i)return;a(!0);const r=t??(0,x.serialize)([(0,x.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,x.createBlock)("core/site-title"),(0,x.createBlock)("core/site-tagline")]),(0,x.createBlock)("core/separator"),(0,x.createBlock)("core/group",{tagName:"main"},[(0,x.createBlock)("core/group",{layout:{inherit:!0}},[(0,x.createBlock)("core/post-title")]),(0,x.createBlock)("core/post-content",{layout:{inherit:!0}})])]),c=await n({slug:Kn(o||Yd)||"wp-custom-template",content:r,title:o||Yd});a(!1),s({postId:c.id,postType:"wp_template"}),l()},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"3",children:[(0,c.jsx)(Hn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,fs.__)("Name"),value:o,onChange:r,placeholder:Yd,disabled:i,help:(0,fs.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:l,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:i,"aria-disabled":i,children:(0,fs.__)("Create")})]})]})})})}function Kd(){return(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(vc);return{postId:t(),postType:s()}}),[])}function Qd(){const{postType:e,postId:t}=Kd();return(0,d.useSelect)((s=>{const{canUser:n,getEntityRecord:o,getEntityRecords:r}=s(u.store),i=n("read",{kind:"root",name:"site"})?o("root","site"):void 0,a=+t===i?.page_for_posts,l="page"===e&&+t===i?.page_on_front,c=l?r("postType","wp_template",{per_page:-1}):[],d=l&&!!c?.some((({slug:e})=>"front-page"===e));return!a&&!d}),[t,e])}function Xd(e){return(0,d.useSelect)((t=>t(u.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:e})),[e])}function Jd(e){const t=eu(),s=Qd(),n=Xd(e);return(0,p.useMemo)((()=>s&&n?.filter((e=>e.is_custom&&e.slug!==t&&!!e.content.raw))),[n,t,s])}function eu(){const{postType:e,postId:t}=Kd(),s=Xd(e),n=(0,d.useSelect)((s=>{const n=s(u.store).getEditedEntityRecord("postType",e,t);return n?.template}),[e,t]);if(n)return s?.find((e=>e.slug===n))?.slug}function tu({isOpen:e,onClick:t}){const s=(0,d.useSelect)((e=>{const t=e(vc).getEditedPostAttribute("template"),{supportsTemplateMode:s,availableTemplates:n}=e(vc).getEditorSettings();if(!s&&n[t])return n[t];const o=e(u.store).canUser("create",{kind:"postType",name:"wp_template"})&&e(vc).getCurrentTemplateId();return o?.title||o?.slug||n?.[t]}),[]);return(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Template options"),onClick:t,children:s??(0,fs.__)("Default template")})}function su({onClose:e}){const t=Qd(),{availableTemplates:s,fetchedTemplates:n,selectedTemplateSlug:o,canCreate:r,canEdit:i,currentTemplateId:a,onNavigateToEntityRecord:l,getEditorSettings:m}=(0,d.useSelect)((e=>{const{canUser:s,getEntityRecords:n}=e(u.store),o=e(vc).getEditorSettings(),r=s("create",{kind:"postType",name:"wp_template"}),i=e(vc).getCurrentTemplateId();return{availableTemplates:o.availableTemplates,fetchedTemplates:r?n("postType","wp_template",{post_type:e(vc).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(vc).getEditedPostAttribute("template"),canCreate:t&&r&&o.supportsTemplateMode,canEdit:t&&r&&o.supportsTemplateMode&&!!i,currentTemplateId:i,onNavigateToEntityRecord:o.onNavigateToEntityRecord,getEditorSettings:e(vc).getEditorSettings}}),[t]),h=(0,p.useMemo)((()=>Object.entries({...s,...Object.fromEntries((n??[]).map((({slug:e,title:t})=>[e,t.rendered])))}).map((([e,t])=>({value:e,label:t})))),[s,n]),_=h.find((e=>e.value===o))??h.find((e=>!e.value)),{editPost:f}=(0,d.useDispatch)(vc),{createSuccessNotice:b}=(0,d.useDispatch)(_s.store),[y,x]=(0,p.useState)(!1);return(0,c.jsxs)("div",{className:"editor-post-template__classic-theme-dropdown",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Template"),help:(0,fs.__)("Templates define the way content is displayed when viewing your site."),actions:r?[{icon:Zd,label:(0,fs.__)("Add template"),onClick:()=>x(!0)}]:[],onClose:e}),t?(0,c.jsx)(Hn.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:(0,fs.__)("Template"),value:_?.value??"",options:h,onChange:e=>f({template:e||""})}):(0,c.jsx)(Hn.Notice,{status:"warning",isDismissible:!1,children:(0,fs.__)("The posts page template cannot be changed.")}),i&&l&&(0,c.jsx)("p",{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>{l({postId:a,postType:"wp_template"}),e(),b((0,fs.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:[{label:(0,fs.__)("Go back"),onClick:()=>m().onNavigateToPreviousEntityRecord()}]})},children:(0,fs.__)("Edit template")})}),y&&(0,c.jsx)(qd,{onClose:()=>x(!1)})]})}var nu=function(){const[e,t]=(0,p.useState)(null),s=(0,p.useMemo)((()=>({anchor:e,className:"editor-post-template__dropdown",placement:"left-start",offset:36,shift:!0})),[e]);return(0,c.jsx)(Rd,{label:(0,fs.__)("Template"),ref:t,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:s,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(tu,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,c.jsx)(su,{onClose:e})})})};const ou=window.wp.warning;var ru=s.n(ou);const{PreferenceBaseOption:iu}=$(C.privateApis);function au(e){const{toggleEditorPanelEnabled:t}=(0,d.useDispatch)(vc),{isChecked:s,isRemoved:n}=(0,d.useSelect)((t=>{const{isEditorPanelEnabled:s,isEditorPanelRemoved:n}=t(vc);return{isChecked:s(e.panelName),isRemoved:n(e.panelName)}}),[e.panelName]);return n?null:(0,c.jsx)(iu,{isChecked:s,onChange:()=>t(e.panelName),...e})}const{Fill:lu,Slot:cu}=(0,Hn.createSlotFill)("EnablePluginDocumentSettingPanelOption"),du=({label:e,panelName:t})=>(0,c.jsx)(lu,{children:(0,c.jsx)(au,{label:e,panelName:t})});du.Slot=cu;var uu=du;const{Fill:pu,Slot:mu}=(0,Hn.createSlotFill)("PluginDocumentSettingPanel"),hu=({name:e,className:t,title:s,icon:n,children:o})=>{const{name:r}=(0,aa.usePluginContext)(),i=`${r}/${e}`,{opened:a,isEnabled:l}=(0,d.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:s}=e(vc);return{opened:t(i),isEnabled:s(i)}}),[i]),{toggleEditorPanelOpened:u}=(0,d.useDispatch)(vc);return void 0===e&&ru()("PluginDocumentSettingPanel requires a name property."),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(uu,{label:s,panelName:i}),(0,c.jsx)(pu,{children:l&&(0,c.jsx)(Hn.PanelBody,{className:t,title:s,icon:n,opened:a,onToggle:()=>u(i),children:o})})]})};hu.Slot=mu;var gu=hu;var _u=({allowedBlocks:e,icon:t,label:s,onClick:n,small:o,role:r})=>(0,c.jsx)(g.BlockSettingsMenuControls,{children:({selectedBlocks:i,onClose:a})=>((e,t)=>{return!Array.isArray(t)||(s=t,0===e.filter((e=>!s.includes(e))).length);var s})(i,e)?(0,c.jsx)(Hn.MenuItem,{onClick:(0,m.compose)(n,a),icon:t,label:o?s:void 0,role:r,children:!o&&s}):null});function fu(e){const t=(0,aa.usePluginContext)();return(0,c.jsx)(Na,{name:"core/plugin-more-menu",as:e.as??Hn.MenuItem,icon:e.icon||t.icon,...e})}const{Fill:bu,Slot:yu}=(0,Hn.createSlotFill)("PluginPostPublishPanel"),xu=({children:e,className:t,title:s,initialOpen:n=!1,icon:o})=>{const{icon:r}=(0,aa.usePluginContext)();return(0,c.jsx)(bu,{children:(0,c.jsx)(Hn.PanelBody,{className:t,initialOpen:n||!s,title:s,icon:o??r,children:e})})};xu.Slot=yu;var vu=xu;const{Fill:wu,Slot:Su}=(0,Hn.createSlotFill)("PluginPostStatusInfo"),ku=({children:e,className:t})=>(0,c.jsx)(wu,{children:(0,c.jsx)(Hn.PanelRow,{className:t,children:e})});ku.Slot=Su;var Cu=ku;const{Fill:Pu,Slot:ju}=(0,Hn.createSlotFill)("PluginPrePublishPanel"),Eu=({children:e,className:t,title:s,initialOpen:n=!1,icon:o})=>{const{icon:r}=(0,aa.usePluginContext)();return(0,c.jsx)(Pu,{children:(0,c.jsx)(Hn.PanelBody,{className:t,initialOpen:n||!s,title:s,icon:o??r,children:e})})};Eu.Slot=ju;var Tu=Eu;function Bu(e){const t=(0,aa.usePluginContext)();return(0,c.jsx)(Na,{name:"core/plugin-preview-menu",as:e.as??Hn.MenuItem,icon:e.icon||t.icon,...e})}function Iu({className:e,...t}){return(0,c.jsx)(Va,{panelClassName:e,className:"editor-sidebar",scope:"core",...t})}function Nu(e){return(0,c.jsx)(Da,{__unstableExplicitMenuItem:!0,scope:"core",...e})}function Ru(e=""){return e=(e=Mr()(e)).trim().toLowerCase()}function Du(e,t){const s=Ru(t),n=Ru(e.title);let o=0;if(s===n)o+=30;else if(n.startsWith(s))o+=20;else{s.split(" ").every((e=>n.includes(e)))&&(o+=10)}return o}function Au({onClick:e}){const[t,s]=(0,p.useState)(!1),{postType:n,postId:o}=Kd(),r=Jd(n),{editEntityRecord:i}=(0,d.useDispatch)(u.store);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.MenuItem,{disabled:!r?.length,accessibleWhenDisabled:!0,onClick:()=>s(!0),children:(0,fs.__)("Change template")}),t&&(0,c.jsx)(Hn.Modal,{title:(0,fs.__)("Choose a template"),onRequestClose:()=>s(!1),overlayClassName:"editor-post-template__swap-template-modal",isFullScreen:!0,children:(0,c.jsx)("div",{className:"editor-post-template__swap-template-modal-content",children:(0,c.jsx)(Mu,{postType:n,onSelect:async t=>{i("postType",n,o,{template:t.name},{undoIgnore:!0}),s(!1),e()}})})})]})}function Mu({postType:e,onSelect:t}){const[s,n]=(0,p.useState)(""),o=Jd(e),r=(0,p.useMemo)((()=>o.map((e=>({name:e.slug,blocks:(0,x.parse)(e.content.raw),title:(0,Ln.decodeEntities)(e.title.rendered),id:e.id})))),[o]),i=(0,p.useMemo)((()=>function(e=[],t=""){if(!t)return e;const s=e.map((e=>[e,Du(e,t)])).filter((([,e])=>e>0));return s.sort((([,e],[,t])=>t-e)),s.map((([e])=>e))}(r,s)),[r,s]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.SearchControl,{__nextHasNoMarginBottom:!0,onChange:n,value:s,label:(0,fs.__)("Search"),placeholder:(0,fs.__)("Search"),className:"editor-post-template__swap-template-search"}),(0,c.jsx)(g.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:i,onClickPattern:t})]})}function Lu({onClick:e}){const t=eu(),s=Qd(),{postType:n,postId:o}=Kd(),{editEntityRecord:r}=(0,d.useDispatch)(u.store);return t&&s?(0,c.jsx)(Hn.MenuItem,{onClick:()=>{r("postType",n,o,{template:""},{undoIgnore:!0}),e()},children:(0,fs.__)("Use default template")}):null}function Ou(){const{canCreateTemplates:e}=(0,d.useSelect)((e=>{const{canUser:t}=e(u.store);return{canCreateTemplates:t("create",{kind:"postType",name:"wp_template"})}}),[]),[t,s]=(0,p.useState)(!1),n=Qd();return e&&n?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.MenuItem,{onClick:()=>{s(!0)},children:(0,fs.__)("Create new template")}),t&&(0,c.jsx)(qd,{onClose:()=>{s(!1)}})]}):null}function Fu({id:e}){const{isTemplateHidden:t,onNavigateToEntityRecord:s,getEditorSettings:n,hasGoBack:o}=(0,d.useSelect)((e=>{const{getRenderingMode:t,getEditorSettings:s}=$(e(vc)),n=s();return{isTemplateHidden:"post-only"===t(),onNavigateToEntityRecord:n.onNavigateToEntityRecord,getEditorSettings:s,hasGoBack:n.hasOwnProperty("onNavigateToPreviousEntityRecord")}}),[]),{get:r}=(0,d.useSelect)(C.store),{editedRecord:i,hasResolved:a}=(0,u.useEntityRecord)("postType","wp_template",e),{createSuccessNotice:l}=(0,d.useDispatch)(_s.store),{setRenderingMode:m,setDefaultRenderingMode:h}=$((0,d.useDispatch)(vc)),g=(0,d.useSelect)((e=>!!e(u.store).canUser("create",{kind:"postType",name:"wp_template"})),[]),[_,f]=(0,p.useState)(null),b=(0,p.useMemo)((()=>({anchor:_,className:"editor-post-template__dropdown",placement:"left-start",offset:36,shift:!0})),[_]);if(!a)return null;const y=o?[{label:(0,fs.__)("Go back"),onClick:()=>n().onNavigateToPreviousEntityRecord()}]:void 0;return(0,c.jsx)(Rd,{label:(0,fs.__)("Template"),ref:f,children:(0,c.jsx)(Hn.DropdownMenu,{popoverProps:b,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},label:(0,fs.__)("Template options"),text:(0,Ln.decodeEntities)(i.title),icon:null,children:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(Hn.MenuGroup,{children:[g&&(0,c.jsx)(Hn.MenuItem,{onClick:()=>{s({postId:i.id,postType:"wp_template"}),e(),r("core/edit-site","welcomeGuideTemplate")||l((0,fs.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:y})},children:(0,fs.__)("Edit template")}),(0,c.jsx)(Au,{onClick:e}),(0,c.jsx)(Lu,{onClick:e}),g&&(0,c.jsx)(Ou,{})]}),(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsx)(Hn.MenuItem,{icon:t?void 0:zn,isSelected:!t,role:"menuitemcheckbox",onClick:()=>{const e=t?"template-locked":"post-only";m(e),h(e)},children:(0,fs.__)("Show template")})})]})})})}function Vu(){const{templateId:e,isBlockTheme:t}=(0,d.useSelect)((e=>{const{getCurrentTemplateId:t,getEditorSettings:s}=e(vc);return{templateId:t(),isBlockTheme:s().__unstableIsBlockBasedTheme}}),[]),s=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),s=e(u.store).getPostType(t);if(!s?.viewable)return!1;const n=e(vc).getEditorSettings();if(!!n.availableTemplates&&Object.keys(n.availableTemplates).length>0)return!0;if(!n.supportsTemplateMode)return!1;return e(u.store).canUser("create",{kind:"postType",name:"wp_template"})??!1}),[]),n=(0,d.useSelect)((e=>!!s&&e(u.store).canUser("read",{kind:"postType",name:"wp_template"})),[s]);return t&&n||!s?t&&e?(0,c.jsx)(Fu,{id:e}):null:(0,c.jsx)(nu,{})}const Uu={_fields:"id,name",context:"view"},Hu={who:"authors",per_page:100,...Uu};function zu(e){const{authorId:t,authors:s,postAuthor:n,isLoading:o}=(0,d.useSelect)((t=>{const{getUser:s,getUsers:n,isResolving:o}=t(u.store),{getEditedPostAttribute:r}=t(vc),i=r("author"),a={...Hu};return e&&(a.search=e,a.search_columns=["name"]),{authorId:i,authors:n(a),postAuthor:s(i,Uu),isLoading:o("getUsers",[a])}}),[e]);return{authorId:t,authorOptions:(0,p.useMemo)((()=>{const e=(s??[]).map((e=>({value:e.id,label:(0,Ln.decodeEntities)(e.name)}))),t=e.findIndex((({value:e})=>n?.id===e));let o=[];return t<0&&n?o=[{value:n.id,label:(0,Ln.decodeEntities)(n.name)}]:t<0&&!n&&(o=[{value:0,label:(0,fs.__)("(No author)")}]),[...o,...e]}),[s,n]),postAuthor:n,isLoading:o}}function Gu(){const[e,t]=(0,p.useState)(),{editPost:s}=(0,d.useDispatch)(vc),{authorId:n,authorOptions:o,isLoading:r}=zu(e);return(0,c.jsx)(Hn.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Author"),options:o,value:n,onFilterValueChange:(0,m.debounce)(t,300),onChange:e=>{e&&s({author:e})},allowReset:!1,hideLabelFromVision:!0,isLoading:r})}function $u(){const{editPost:e}=(0,d.useDispatch)(vc),{authorId:t,authorOptions:s}=zu();return(0,c.jsx)(Hn.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-author-selector",label:(0,fs.__)("Author"),options:s,onChange:t=>{const s=Number(t);e({author:s})},value:t,hideLabelFromVision:!0})}var Wu=function(){return(0,d.useSelect)((e=>{const t=e(u.store).getUsers(Hu);return t?.length>=25}),[])?(0,c.jsx)(Gu,{}):(0,c.jsx)($u,{})};function Zu({children:e}){const{hasAssignAuthorAction:t}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPost();return{hasAssignAuthorAction:!!t?._links?.["wp:action-assign-author"]}}),[]);return t?(0,c.jsx)(Bd,{supportKeys:"author",children:e}):null}function Yu({isOpen:e,onClick:t}){const{postAuthor:s}=(0,d.useSelect)((e=>{const t=e(vc).getEditedPostAttribute("author");return{postAuthor:e(u.store).getUser(t,Uu)}}),[]),n=(0,Ln.decodeEntities)(s?.name)||(0,fs.__)("(No author)");return(0,c.jsx)(Hn.Button,{size:"compact",className:"editor-post-author__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change author: %s"),n),onClick:t,children:n})}var qu=function(){const[e,t]=(0,p.useState)(null),s=(0,p.useMemo)((()=>({anchor:e,placement:"left-start",offset:36,shift:!0})),[e]);return(0,c.jsx)(Zu,{children:(0,c.jsx)(Rd,{label:(0,fs.__)("Author"),ref:t,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:s,contentClassName:"editor-post-author__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Yu,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,c.jsxs)("div",{className:"editor-post-author",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Author"),onClose:e}),(0,c.jsx)(Wu,{onClose:e})]})})})})};const Ku=[{label:(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:(0,fs.__)("Visitors can add new comments and replies.")},{label:(0,fs.__)("Closed"),value:"closed",description:[(0,fs.__)("Visitors cannot add new comments or replies."),(0,fs.__)("Existing comments remain visible.")].join(" ")}];var Qu=function(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("comment_status")??"open"),[]),{editPost:t}=(0,d.useDispatch)(vc);return(0,c.jsx)("form",{children:(0,c.jsx)(Hn.__experimentalVStack,{spacing:4,children:(0,c.jsx)(Hn.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,fs.__)("Comment status"),options:Ku,onChange:e=>t({comment_status:e}),selected:e})})})};var Xu=function(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("ping_status")??"open"),[]),{editPost:t}=(0,d.useDispatch)(vc);return(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Enable pingbacks & trackbacks"),checked:"open"===e,onChange:()=>t({ping_status:"open"===e?"closed":"open"}),help:(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"),children:(0,fs.__)("Learn more about pingbacks & trackbacks")})})};const Ju="discussion-panel";function ep({onClose:e}){return(0,c.jsxs)("div",{className:"editor-post-discussion",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Discussion"),onClose:e}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:4,children:[(0,c.jsx)(Bd,{supportKeys:"comments",children:(0,c.jsx)(Qu,{})}),(0,c.jsx)(Bd,{supportKeys:"trackbacks",children:(0,c.jsx)(Xu,{})})]})]})}function tp({isOpen:e,onClick:t}){const{commentStatus:s,pingStatus:n,commentsSupported:o,trackbacksSupported:r}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),{getPostType:s}=e(u.store),n=s(t("type"));return{commentStatus:t("comment_status")??"open",pingStatus:t("ping_status")??"open",commentsSupported:!!n.supports.comments,trackbacksSupported:!!n.supports.trackbacks}}),[]);let i;return i="open"===s?"open"===n?(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'):r?(0,fs.__)("Comments only"):(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'):"open"===n?o?(0,fs.__)("Pings only"):(0,fs.__)("Pings enabled"):(0,fs.__)("Closed"),(0,c.jsx)(Hn.Button,{size:"compact",className:"editor-post-discussion__panel-toggle",variant:"tertiary","aria-label":(0,fs.__)("Change discussion options"),"aria-expanded":e,onClick:t,children:i})}function sp(){const{isEnabled:e}=(0,d.useSelect)((e=>{const{isEditorPanelEnabled:t}=e(vc);return{isEnabled:t(Ju)}}),[]),[t,s]=(0,p.useState)(null),n=(0,p.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return e?(0,c.jsx)(Bd,{supportKeys:["comments","trackbacks"],children:(0,c.jsx)(Rd,{label:(0,fs.__)("Discussion"),ref:s,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:n,className:"editor-post-discussion__panel-dropdown",contentClassName:"editor-post-discussion__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(tp,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,c.jsx)(ep,{onClose:e})})})}):null}function np({hideLabelFromVision:e=!1,updateOnBlur:t=!1}){const{excerpt:s,shouldUseDescriptionLabel:n,usedAttribute:o}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:s}=e(vc),n=t(),o=["wp_template","wp_template_part"].includes(n)?"description":"excerpt";return{excerpt:s(o),shouldUseDescriptionLabel:["wp_template","wp_template_part","wp_block"].includes(n),usedAttribute:o}}),[]),{editPost:r}=(0,d.useDispatch)(vc),[i,a]=(0,p.useState)((0,Ln.decodeEntities)(s)),l=e=>{r({[o]:e})},u=n?(0,fs.__)("Write a description (optional)"):(0,fs.__)("Write an excerpt (optional)");return(0,c.jsx)("div",{className:"editor-post-excerpt",children:(0,c.jsx)(Hn.TextareaControl,{__nextHasNoMarginBottom:!0,label:u,hideLabelFromVision:e,className:"editor-post-excerpt__textarea",onChange:t?a:l,onBlur:t?()=>l(i):void 0,value:t?i:s,help:n?(0,fs.__)("Write a description"):(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt"),children:(0,fs.__)("Learn more about manual excerpts")})})})}var op=function({children:e}){return(0,c.jsx)(Bd,{supportKeys:"excerpt",children:e})};const{Fill:rp,Slot:ip}=(0,Hn.createSlotFill)("PluginPostExcerpt"),ap=({children:e,className:t})=>(0,c.jsx)(rp,{children:(0,c.jsx)(Hn.PanelRow,{className:t,children:e})});ap.Slot=ip;var lp=ap;const cp="post-excerpt";function dp(){const{isOpened:e,isEnabled:t,postType:s}=(0,d.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:s,getCurrentPostType:n}=e(vc);return{isOpened:t(cp),isEnabled:s(cp),postType:n()}}),[]),{toggleEditorPanelOpened:n}=(0,d.useDispatch)(vc);if(!t)return null;const o=["wp_template","wp_template_part","wp_block"].includes(s);return(0,c.jsx)(Hn.PanelBody,{title:o?(0,fs.__)("Description"):(0,fs.__)("Excerpt"),opened:e,onToggle:()=>n(cp),children:(0,c.jsx)(lp.Slot,{children:e=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(np,{}),e]})})})}function up(){return(0,c.jsx)(op,{children:(0,c.jsx)(dp,{})})}function pp(){return(0,c.jsx)(op,{children:(0,c.jsx)(mp,{})})}function mp(){const{shouldRender:e,excerpt:t,shouldBeUsedAsDescription:s,allowEditing:n}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s,getEditedPostAttribute:n,isEditorPanelEnabled:o}=e(vc),r=t(),i=["wp_template","wp_template_part"].includes(r),a="wp_block"===r,l=i||a,c=n(i?"description":"excerpt"),d=i&&e(u.store).getEntityRecord("postType",r,s()),p=o(cp)||l;return{excerpt:c,shouldRender:p,shouldBeUsedAsDescription:l,allowEditing:p&&(!l||a||d&&d.source===D&&!d.has_theme_file&&d.is_custom)}}),[]),[o,r]=(0,p.useState)(null),i=s?(0,fs.__)("Description"):(0,fs.__)("Excerpt"),a=(0,p.useMemo)((()=>({anchor:o,"aria-label":i,headerTitle:i,placement:"left-start",offset:36,shift:!0})),[o,i]);if(!e)return!1;const l=!!t&&(0,c.jsx)(Hn.__experimentalText,{align:"left",numberOfLines:4,truncate:n,children:(0,Ln.decodeEntities)(t)});if(!n)return l;const m=s?(0,fs.__)("Add a description…"):(0,fs.__)("Add an excerpt…"),h=s?(0,fs.__)("Edit description"):(0,fs.__)("Edit excerpt");return(0,c.jsxs)(Hn.__experimentalVStack,{children:[l,(0,c.jsx)(Hn.Dropdown,{className:"editor-post-excerpt__dropdown",contentClassName:"editor-post-excerpt__dropdown__content",popoverProps:a,focusOnMount:!0,ref:r,renderToggle:({onToggle:e})=>(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,onClick:e,variant:"link",children:l?h:m}),renderContent:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:i,onClose:e}),(0,c.jsx)(Hn.__experimentalVStack,{spacing:4,children:(0,c.jsx)(lp.Slot,{children:e=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(np,{hideLabelFromVision:!0,updateOnBlur:!0}),e]})})})]})})]})}function hp({children:e,supportKeys:t}){const{postType:s,themeSupports:n}=(0,d.useSelect)((e=>({postType:e(vc).getEditedPostAttribute("type"),themeSupports:e(u.store).getThemeSupports()})),[]);return(Array.isArray(t)?t:[t]).some((e=>{const t=n?.[e]??!1;return"post-thumbnails"===e&&Array.isArray(t)?t.includes(s):t}))?e:null}var gp=function({children:e}){return(0,c.jsx)(hp,{supportKeys:"post-thumbnails",children:(0,c.jsx)(Bd,{supportKeys:"thumbnail",children:e})})};const _p=["image"],fp=(0,fs.__)("Featured image"),bp=(0,fs.__)("Add a featured image"),yp=(0,c.jsx)("p",{children:(0,fs.__)("To edit the featured image, you need permission to upload media.")});const xp=(0,d.withSelect)((e=>{const{getEntityRecord:t,getPostType:s,hasFinishedResolution:n}=e(u.store),{getCurrentPostId:o,getEditedPostAttribute:r}=e(vc),i=r("featured_media");return{media:i?t("postType","attachment",i,{context:"view"}):null,currentPostId:o(),postType:s(r("type")),featuredImageId:i,isRequestingFeaturedImageMedia:!!i&&!n("getEntityRecord",["postType","attachment",i,{context:"view"}])}})),vp=(0,d.withDispatch)(((e,{noticeOperations:t},{select:s})=>{const{editPost:n}=e(vc);return{onUpdateImage(e){n({featured_media:e.id})},onDropImage(e){s(g.store).getSettings().mediaUpload({allowedTypes:["image"],filesList:e,onFileChange([e]){n({featured_media:e.id})},onError(e){t.removeAllNotices(),t.createErrorNotice(e)},multiple:!1})},onRemoveImage(){n({featured_media:0})}}}));var wp=(0,m.compose)(Hn.withNotices,xp,vp,(0,Hn.withFilters)("editor.PostFeaturedImage"))((function({currentPostId:e,featuredImageId:t,onUpdateImage:s,onRemoveImage:n,media:o,postType:r,noticeUI:i,noticeOperations:a,isRequestingFeaturedImageMedia:l}){const u=(0,p.useRef)(!1),[m,_]=(0,p.useState)(!1),{getSettings:f}=(0,d.useSelect)(g.store),{mediaSourceUrl:b}=function(e,t){if(!e)return{};const s=(0,h.applyFilters)("editor.PostFeaturedImage.imageSize","large",e.id,t);if(s in(e?.media_details?.sizes??{}))return{mediaWidth:e.media_details.sizes[s].width,mediaHeight:e.media_details.sizes[s].height,mediaSourceUrl:e.media_details.sizes[s].source_url};const n=(0,h.applyFilters)("editor.PostFeaturedImage.imageSize","thumbnail",e.id,t);return n in(e?.media_details?.sizes??{})?{mediaWidth:e.media_details.sizes[n].width,mediaHeight:e.media_details.sizes[n].height,mediaSourceUrl:e.media_details.sizes[n].source_url}:{mediaWidth:e.media_details.width,mediaHeight:e.media_details.height,mediaSourceUrl:e.source_url}}(o,e);function y(e){f().mediaUpload({allowedTypes:_p,filesList:e,onFileChange([e]){(0,Go.isBlobURL)(e?.url)?_(!0):(e&&s(e),_(!1))},onError(e){a.removeAllNotices(),a.createErrorNotice(e)},multiple:!1})}function x(e){return e.alt_text?(0,fs.sprintf)((0,fs.__)("Current image: %s"),e.alt_text):(0,fs.sprintf)((0,fs.__)("The current image has no alternative text. The file name is: %s"),e.media_details.sizes?.full?.file||e.slug)}function v(e){u.current&&e&&(e.focus(),u.current=!1)}const w=!l&&!!t&&!o;return(0,c.jsxs)(gp,{children:[i,(0,c.jsxs)("div",{className:"editor-post-featured-image",children:[o&&(0,c.jsx)("div",{id:`editor-post-featured-image-${t}-describedby`,className:"hidden",children:x(o)}),(0,c.jsx)(g.MediaUploadCheck,{fallback:yp,children:(0,c.jsx)(g.MediaUpload,{title:r?.labels?.featured_image||fp,onSelect:s,unstableFeaturedImageFlow:!0,allowedTypes:_p,modalClass:"editor-post-featured-image__media-modal",render:({open:e})=>(0,c.jsxs)("div",{className:"editor-post-featured-image__container",children:[w?(0,c.jsx)(Hn.Notice,{status:"warning",isDismissible:!1,children:(0,fs.__)("Could not retrieve the featured image data.")}):(0,c.jsxs)(Hn.Button,{__next40pxDefaultSize:!0,ref:v,className:t?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:e,"aria-label":t?(0,fs.__)("Edit or replace the featured image"):null,"aria-describedby":t?`editor-post-featured-image-${t}-describedby`:null,"aria-haspopup":"dialog",disabled:m,accessibleWhenDisabled:!0,children:[!!t&&o&&(0,c.jsx)("img",{className:"editor-post-featured-image__preview-image",src:b,alt:x(o)}),(m||l)&&(0,c.jsx)(Hn.Spinner,{}),!t&&!m&&(r?.labels?.set_featured_image||bp)]}),!!t&&(0,c.jsxs)(Hn.__experimentalHStack,{className:mr("editor-post-featured-image__actions",{"editor-post-featured-image__actions-missing-image":w,"editor-post-featured-image__actions-is-requesting-image":l}),children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:e,"aria-haspopup":"dialog",variant:w?"secondary":void 0,children:(0,fs.__)("Replace")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:()=>{n(),u.current=!0},variant:w?"secondary":void 0,isDestructive:w,children:(0,fs.__)("Remove")})]}),(0,c.jsx)(Hn.DropZone,{onFilesDrop:y})]}),value:t})})]})]})}));const Sp="featured-image";function kp({withPanelBody:e=!0}){const{postType:t,isEnabled:s,isOpened:n}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:s,isEditorPanelOpened:n}=e(vc),{getPostType:o}=e(u.store);return{postType:o(t("type")),isEnabled:s(Sp),isOpened:n(Sp)}}),[]),{toggleEditorPanelOpened:o}=(0,d.useDispatch)(vc);return s?e?(0,c.jsx)(gp,{children:(0,c.jsx)(Hn.PanelBody,{title:t?.labels?.featured_image??(0,fs.__)("Featured image"),opened:n,onToggle:()=>o(Sp),children:(0,c.jsx)(wp,{})})}):(0,c.jsx)(gp,{children:(0,c.jsx)(wp,{})}):null}function Cp({children:e}){return(0,d.useSelect)((e=>e(vc).getEditorSettings().disablePostFormats),[])?null:(0,c.jsx)(Bd,{supportKeys:"post-formats",children:e})}const Pp=[{id:"aside",caption:(0,fs.__)("Aside")},{id:"audio",caption:(0,fs.__)("Audio")},{id:"chat",caption:(0,fs.__)("Chat")},{id:"gallery",caption:(0,fs.__)("Gallery")},{id:"image",caption:(0,fs.__)("Image")},{id:"link",caption:(0,fs.__)("Link")},{id:"quote",caption:(0,fs.__)("Quote")},{id:"standard",caption:(0,fs.__)("Standard")},{id:"status",caption:(0,fs.__)("Status")},{id:"video",caption:(0,fs.__)("Video")}].sort(((e,t)=>{const s=e.caption.toUpperCase(),n=t.caption.toUpperCase();return s<n?-1:s>n?1:0}));function jp(){const e=`post-format-selector-${(0,m.useInstanceId)(jp)}`,{postFormat:t,suggestedFormat:s,supportedFormats:n}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:s}=e(vc),n=t("format"),o=e(u.store).getThemeSupports();return{postFormat:n??"standard",suggestedFormat:s(),supportedFormats:o.formats}}),[]),o=Pp.filter((e=>n?.includes(e.id)||t===e.id)),r=o.find((e=>e.id===s)),{editPost:i}=(0,d.useDispatch)(vc),a=e=>i({format:e});return(0,c.jsx)(Cp,{children:(0,c.jsxs)("div",{className:"editor-post-format",children:[(0,c.jsx)(Hn.RadioControl,{className:"editor-post-format__options",label:(0,fs.__)("Post Format"),selected:t,onChange:e=>a(e),id:e,options:o.map((e=>({label:e.caption,value:e.id}))),hideLabelFromVision:!0}),r&&r.id!==t&&(0,c.jsx)("p",{className:"editor-post-format__suggestion",children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>a(r.id),children:(0,fs.sprintf)((0,fs.__)("Apply suggested format: %s"),r.caption)})})]})})}var Ep=function({children:e}){const{lastRevisionId:t,revisionsCount:s}=(0,d.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:s}=e(vc);return{lastRevisionId:t(),revisionsCount:s()}}),[]);return!t||s<2?null:(0,c.jsx)(Bd,{supportKeys:"revisions",children:e})};function Tp(){return(0,d.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:s}=e(vc);return{lastRevisionId:t(),revisionsCount:s()}}),[])}function Bp(){const{lastRevisionId:e,revisionsCount:t}=Tp();return(0,c.jsx)(Ep,{children:(0,c.jsx)(Rd,{label:(0,fs.__)("Revisions"),children:(0,c.jsx)(Hn.Button,{href:(0,w.addQueryArgs)("revision.php",{revision:e}),className:"editor-private-post-last-revision__button",text:t,variant:"tertiary",size:"compact"})})})}var Ip=function(){const{lastRevisionId:e,revisionsCount:t}=Tp();return(0,c.jsx)(Ep,{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,href:(0,w.addQueryArgs)("revision.php",{revision:e}),className:"editor-post-last-revision__title",icon:Yo,iconPosition:"right",text:(0,fs.sprintf)((0,fs.__)("Revisions (%s)"),t)})})};var Np=function(){return(0,c.jsx)(Ep,{children:(0,c.jsx)(Hn.PanelBody,{className:"editor-post-last-revision__panel",children:(0,c.jsx)(Ip,{})})})};var Rp=function e(){const t="core/editor/post-locked-modal-"+(0,m.useInstanceId)(e),{autosave:s,updatePostLock:n}=(0,d.useDispatch)(vc),{isLocked:o,isTakeover:r,user:i,postId:a,postLockUtils:l,activePostLock:g,postType:_,previewLink:f}=(0,d.useSelect)((e=>{const{isPostLocked:t,isPostLockTakeover:s,getPostLockUser:n,getCurrentPostId:o,getActivePostLock:r,getEditedPostAttribute:i,getEditedPostPreviewLink:a,getEditorSettings:l}=e(vc),{getPostType:c}=e(u.store);return{isLocked:t(),isTakeover:s(),user:n(),postId:o(),postLockUtils:l().postLockUtils,activePostLock:r(),postType:c(i("type")),previewLink:a()}}),[]);if((0,p.useEffect)((()=>{function e(){if(o||!g)return;const e=new window.FormData;if(e.append("action","wp-remove-post-lock"),e.append("_wpnonce",l.unlockNonce),e.append("post_ID",a),e.append("active_post_lock",g),window.navigator.sendBeacon)window.navigator.sendBeacon(l.ajaxUrl,e);else{const t=new window.XMLHttpRequest;t.open("POST",l.ajaxUrl,!1),t.send(e)}}return(0,h.addAction)("heartbeat.send",t,(function(e){o||(e["wp-refresh-post-lock"]={lock:g,post_id:a})})),(0,h.addAction)("heartbeat.tick",t,(function(e){if(!e["wp-refresh-post-lock"])return;const t=e["wp-refresh-post-lock"];t.lock_error?(s(),n({isLocked:!0,isTakeover:!0,user:{name:t.lock_error.name,avatar:t.lock_error.avatar_src_2x}})):t.new_lock&&n({isLocked:!1,activePostLock:t.new_lock})})),window.addEventListener("beforeunload",e),()=>{(0,h.removeAction)("heartbeat.send",t),(0,h.removeAction)("heartbeat.tick",t),window.removeEventListener("beforeunload",e)}}),[]),!o)return null;const b=i.name,y=i.avatar,x=(0,w.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:a,action:"edit",_wpnonce:l.nonce}),v=(0,w.addQueryArgs)("edit.php",{post_type:_?.slug}),S=(0,fs.__)("Exit editor");return(0,c.jsx)(Hn.Modal,{title:r?(0,fs.__)("Someone else has taken over this post"):(0,fs.__)("This post is already being edited"),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,className:"editor-post-locked-modal",size:"medium",children:(0,c.jsxs)(Hn.__experimentalHStack,{alignment:"top",spacing:6,children:[!!y&&(0,c.jsx)("img",{src:y,alt:(0,fs.__)("Avatar"),className:"editor-post-locked-modal__avatar",width:64,height:64}),(0,c.jsxs)("div",{children:[!!r&&(0,c.jsx)("p",{children:(0,p.createInterpolateElement)(b?(0,fs.sprintf)((0,fs.__)("<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved."),b):(0,fs.__)("Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved."),{strong:(0,c.jsx)("strong",{}),PreviewLink:(0,c.jsx)(Hn.ExternalLink,{href:f,children:(0,fs.__)("preview")})})}),!r&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:(0,p.createInterpolateElement)(b?(0,fs.sprintf)((0,fs.__)("<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),b):(0,fs.__)("Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),{strong:(0,c.jsx)("strong",{}),PreviewLink:(0,c.jsx)(Hn.ExternalLink,{href:f,children:(0,fs.__)("preview")})})}),(0,c.jsx)("p",{children:(0,fs.__)("If you take over, the other user will lose editing control to the post, but their changes will be saved.")})]}),(0,c.jsxs)(Hn.__experimentalHStack,{className:"editor-post-locked-modal__buttons",justify:"flex-end",children:[!r&&(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",href:x,children:(0,fs.__)("Take over")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",href:v,children:S})]})]})]})})};var Dp=function({children:e}){const{hasPublishAction:t,isPublished:s}=(0,d.useSelect)((e=>{const{isCurrentPostPublished:t,getCurrentPost:s}=e(vc);return{hasPublishAction:s()._links?.["wp:action-publish"]??!1,isPublished:t()}}),[]);return s||!t?null:e};var Ap=function(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("status")),[]),{editPost:t}=(0,d.useDispatch)(vc);return(0,c.jsx)(Dp,{children:(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Pending review"),checked:"pending"===e,onChange:()=>{t({status:"pending"===e?"draft":"pending"})}})})};function Mp({className:e,textContent:t,forceIsAutosaveable:s,role:n,onPreview:o}){const{postId:r,currentPostLink:i,previewLink:a,isSaveable:l,isViewable:m}=(0,d.useSelect)((e=>{const t=e(vc),s=e(u.store).getPostType(t.getCurrentPostType("type")),n=s?.viewable??!1;return n?{postId:t.getCurrentPostId(),currentPostLink:t.getCurrentPostAttribute("link"),previewLink:t.getEditedPostPreviewLink(),isSaveable:t.isEditedPostSaveable(),isViewable:n}:{isViewable:n}}),[]),{__unstableSaveForPreview:g}=(0,d.useDispatch)(vc);if(!m)return null;const _=`wp-preview-${r}`,f=a||i;return(0,c.jsx)(Hn.Button,{variant:e?void 0:"tertiary",className:e||"editor-post-preview",href:f,target:_,accessibleWhenDisabled:!0,disabled:!l,onClick:async e=>{e.preventDefault();const t=window.open("",_);t.focus(),function(e){let t=(0,p.renderToString)((0,c.jsxs)("div",{className:"editor-post-preview-button__interstitial-message",children:[(0,c.jsxs)(Hn.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96",children:[(0,c.jsx)(Hn.Path,{className:"outer",d:"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",fill:"none"}),(0,c.jsx)(Hn.Path,{className:"inner",d:"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",fill:"none"})]}),(0,c.jsx)("p",{children:(0,fs.__)("Generating preview…")})]}));t+='\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t',t=(0,h.applyFilters)("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=(0,fs.__)("Generating preview…"),e.close()}(t.document);const n=await g({forceIsAutosaveable:s});t.location=n,o?.()},role:n,size:"compact",children:t||(0,c.jsxs)(c.Fragment,{children:[(0,fs._x)("Preview","imperative verb"),(0,c.jsx)(Hn.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]})})}function Lp(){const e=(0,m.useViewportMatch)("medium","<"),{isPublished:t,isBeingScheduled:s,isSaving:n,isPublishing:o,hasPublishAction:r,isAutosaving:i,hasNonPostEntityChanges:a,postStatusHasChanged:l,postStatus:c}=(0,d.useSelect)((e=>{const{isCurrentPostPublished:t,isEditedPostBeingScheduled:s,isSavingPost:n,isPublishingPost:o,getCurrentPost:r,getCurrentPostType:i,isAutosavingPost:a,getPostEdits:l,getEditedPostAttribute:c}=e(vc);return{isPublished:t(),isBeingScheduled:s(),isSaving:n(),isPublishing:o(),hasPublishAction:r()._links?.["wp:action-publish"]??!1,postType:i(),isAutosaving:a(),hasNonPostEntityChanges:e(vc).hasNonPostEntityChanges(),postStatusHasChanged:!!l()?.status,postStatus:c("status")}}),[]);return o?(0,fs.__)("Publishing…"):(t||s)&&n&&!i?(0,fs.__)("Saving…"):r?a||t||l&&!["future","publish"].includes(c)||!l&&"future"===c?(0,fs.__)("Save"):s?(0,fs.__)("Schedule"):(0,fs.__)("Publish"):e?(0,fs.__)("Publish"):(0,fs.__)("Submit for Review")}const Op=()=>{};class Fp extends p.Component{constructor(e){super(e),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}createOnClick(e){return(...t)=>{const{hasNonPostEntityChanges:s,setEntitiesSavedStatesCallback:n}=this.props;return s&&n?(this.setState({entitiesSavedStatesCallback:()=>e(...t)}),n((()=>this.closeEntitiesSavedStates)),Op):e(...t)}}closeEntitiesSavedStates(e){const{postType:t,postId:s}=this.props,{entitiesSavedStatesCallback:n}=this.state;this.setState({entitiesSavedStatesCallback:!1},(()=>{e&&e.some((e=>"postType"===e.kind&&e.name===t&&e.key===s))&&n()}))}render(){const{forceIsDirty:e,hasPublishAction:t,isBeingScheduled:s,isOpen:n,isPostSavingLocked:o,isPublishable:r,isPublished:i,isSaveable:a,isSaving:l,isAutoSaving:d,isToggle:u,savePostStatus:p,onSubmit:m=Op,onToggle:h,visibility:g,hasNonPostEntityChanges:_,isSavingNonPostEntityChanges:f,postStatus:b,postStatusHasChanged:y}=this.props,x=(l||!a||o||!r&&!e)&&(!_||f),v=(i||l||!a||!r&&!e)&&(!_||f);let w="publish";y?w=b:t?"private"===g?w="private":s&&(w="future"):w="pending";const S={"aria-disabled":x,className:"editor-post-publish-button",isBusy:!d&&l,variant:"primary",onClick:this.createOnClick((()=>{x||(m(),p(w))})),"aria-haspopup":_?"dialog":void 0},k={"aria-disabled":v,"aria-expanded":n,className:"editor-post-publish-panel__toggle",isBusy:l&&i,variant:"primary",size:"compact",onClick:this.createOnClick((()=>{v||h()})),"aria-haspopup":_?"dialog":void 0},C=u?k:S;return(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(Hn.Button,{...C,className:`${C.className} editor-post-publish-button__button`,size:"compact",children:(0,c.jsx)(Lp,{})})})}}var Vp=(0,m.compose)([(0,d.withSelect)((e=>{const{isSavingPost:t,isAutosavingPost:s,isEditedPostBeingScheduled:n,getEditedPostVisibility:o,isCurrentPostPublished:r,isEditedPostSaveable:i,isEditedPostPublishable:a,isPostSavingLocked:l,getCurrentPost:c,getCurrentPostType:d,getCurrentPostId:u,hasNonPostEntityChanges:p,isSavingNonPostEntityChanges:m,getEditedPostAttribute:h,getPostEdits:g}=e(vc);return{isSaving:t(),isAutoSaving:s(),isBeingScheduled:n(),visibility:o(),isSaveable:i(),isPostSavingLocked:l(),isPublishable:a(),isPublished:r(),hasPublishAction:c()._links?.["wp:action-publish"]??!1,postType:d(),postId:u(),postStatus:h("status"),postStatusHasChanged:g()?.status,hasNonPostEntityChanges:p(),isSavingNonPostEntityChanges:m()}})),(0,d.withDispatch)((e=>{const{editPost:t,savePost:s}=e(vc);return{savePostStatus:e=>{t({status:e},{undoIgnore:!0}),s()}}}))])(Fp),Up=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,c.jsx)(L.Path,{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"})});const Hp=[{label:(0,fs.__)("Public"),value:"public",description:(0,fs.__)("Visible to everyone.")},{label:(0,fs.__)("Private"),value:"private",description:(0,fs.__)("Only visible to site admins and editors.")},{label:(0,fs.__)("Password protected"),value:"password",description:(0,fs.__)("Only visible to those who know the password.")}];function zp({onClose:e}){const t=(0,m.useInstanceId)(zp),{status:s,visibility:n,password:o}=(0,d.useSelect)((e=>({status:e(vc).getEditedPostAttribute("status"),visibility:e(vc).getEditedPostVisibility(),password:e(vc).getEditedPostAttribute("password")}))),{editPost:r}=(0,d.useDispatch)(vc),[i,a]=(0,p.useState)(!!o);return(0,c.jsxs)("div",{className:"editor-post-visibility",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Visibility"),help:(0,fs.__)("Control how this post is viewed."),onClose:e}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:4,children:[(0,c.jsx)(Hn.RadioControl,{label:(0,fs.__)("Visibility"),hideLabelFromVision:!0,options:Hp,selected:i?"password":n,onChange:function(e){r({public:{status:"private"===n?"draft":s,password:""},private:{status:"private",password:""},password:{status:"private"===n?"draft":s,password:o||""}}[e]),a("password"===e)}}),i&&(0,c.jsx)(Hn.TextControl,{label:(0,fs.__)("Password"),onChange:e=>{r({password:e})},value:o,placeholder:(0,fs.__)("Use a secure password"),type:"text",id:`editor-post-visibility__password-input-${t}`,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})]})]})}function Gp(){return $p()}function $p(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostVisibility()),[]);return Hp.find((t=>t.value===e))?.label}function Wp(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function Zp(e){const t=Wp(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Yp(e){const t=Wp(e),s=t.getMonth();return t.setFullYear(t.getFullYear(),s+1,0),t.setHours(23,59,59,999),t}Math.pow(10,8);const qp=6e4,Kp=36e5;function Qp(e,t){const s=t?.additionalDigits??2,n=function(e){const t={},s=e.split(Xp.dateTimeDelimiter);let n;if(s.length>2)return t;/:/.test(s[0])?n=s[0]:(t.date=s[0],n=s[1],Xp.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Xp.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length)));if(n){const e=Xp.timezone.exec(n);e?(t.time=n.replace(e[1],""),t.timezone=e[1]):t.time=n}return t}(e);let o;if(n.date){const e=function(e,t){const s=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(s);if(!n)return{year:NaN,restDateString:""};const o=n[1]?parseInt(n[1]):null,r=n[2]?parseInt(n[2]):null;return{year:null===r?o:100*r,restDateString:e.slice((n[1]||n[2]).length)}}(n.date,s);o=function(e,t){if(null===t)return new Date(NaN);const s=e.match(Jp);if(!s)return new Date(NaN);const n=!!s[4],o=sm(s[1]),r=sm(s[2])-1,i=sm(s[3]),a=sm(s[4]),l=sm(s[5])-1;if(n)return function(e,t,s){return t>=1&&t<=53&&s>=0&&s<=6}(0,a,l)?function(e,t,s){const n=new Date(0);n.setUTCFullYear(e,0,4);const o=n.getUTCDay()||7,r=7*(t-1)+s+1-o;return n.setUTCDate(n.getUTCDate()+r),n}(t,a,l):new Date(NaN);{const e=new Date(0);return function(e,t,s){return t>=0&&t<=11&&s>=1&&s<=(om[t]||(rm(e)?29:28))}(t,r,i)&&function(e,t){return t>=1&&t<=(rm(e)?366:365)}(t,o)?(e.setUTCFullYear(t,r,Math.max(o,i)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);const r=o.getTime();let i,a=0;if(n.time&&(a=function(e){const t=e.match(em);if(!t)return NaN;const s=nm(t[1]),n=nm(t[2]),o=nm(t[3]);if(!function(e,t,s){if(24===e)return 0===t&&0===s;return s>=0&&s<60&&t>=0&&t<60&&e>=0&&e<25}(s,n,o))return NaN;return s*Kp+n*qp+1e3*o}(n.time),isNaN(a)))return new Date(NaN);if(!n.timezone){const e=new Date(r+a),t=new Date(0);return t.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),t.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),t}return i=function(e){if("Z"===e)return 0;const t=e.match(tm);if(!t)return 0;const s="+"===t[1]?-1:1,n=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,o))return NaN;return s*(n*Kp+o*qp)}(n.timezone),isNaN(i)?new Date(NaN):new Date(r+a+i)}const Xp={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Jp=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,em=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,tm=/^([+-])(\d{2})(?::?(\d{2}))?$/;function sm(e){return e?parseInt(e):1}function nm(e){return e&&parseFloat(e.replace(",","."))||0}const om=[31,null,31,30,31,30,31,31,30,31,30,31];function rm(e){return e%400==0||e%4==0&&e%100!=0}const{PrivatePublishDateTimePicker:im}=$(g.privateApis);function am(e){return(0,c.jsx)(lm,{...e,showPopoverHeaderActions:!0,isCompact:!1})}function lm({onClose:e,showPopoverHeaderActions:t,isCompact:s}){const{postDate:n,postType:o}=(0,d.useSelect)((e=>({postDate:e(vc).getEditedPostAttribute("date"),postType:e(vc).getCurrentPostType()})),[]),{editPost:r}=(0,d.useDispatch)(vc),[i,a]=(0,p.useState)(Zp(new Date(n))),l=(0,d.useSelect)((e=>e(u.store).getEntityRecords("postType",o,{status:"publish,future",after:Zp(i).toISOString(),before:Yp(i).toISOString(),exclude:[e(vc).getCurrentPostId()],per_page:100,_fields:"id,date"})),[i,o]),m=(0,p.useMemo)((()=>(l||[]).map((({date:e})=>({date:new Date(e)})))),[l]),h=(0,v.getSettings)(),g=/a(?!\\)/i.test(h.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,c.jsx)(im,{currentDate:n,onChange:e=>r({date:e}),is12Hour:g,dateOrder:(0,fs._x)("dmy","date order"),events:m,onMonthPreviewed:e=>a(Qp(e)),onClose:e,isCompact:s,showPopoverHeaderActions:t})}function cm(e){return dm(e)}function dm({full:e=!1}={}){const{date:t,isFloating:s}=(0,d.useSelect)((e=>({date:e(vc).getEditedPostAttribute("date"),isFloating:e(vc).isEditedPostDateFloating()})),[]);return e?um(t):function(e,{isFloating:t=!1,now:s=new Date}={}){if(!e||t)return(0,fs.__)("Immediately");if(!function(e){const{timezone:t}=(0,v.getSettings)(),s=Number(t.offset),n=e.getTimezoneOffset()/60*-1;return s===n}(s))return um(e);const n=(0,v.getDate)(e);if(pm(n,s))return(0,fs.sprintf)((0,fs.__)("Today at %s"),(0,v.dateI18n)((0,fs._x)("g:i a","post schedule time format"),n));const o=new Date(s);if(o.setDate(o.getDate()+1),pm(n,o))return(0,fs.sprintf)((0,fs.__)("Tomorrow at %s"),(0,v.dateI18n)((0,fs._x)("g:i a","post schedule time format"),n));if(n.getFullYear()===s.getFullYear())return(0,v.dateI18n)((0,fs._x)("F j g:i a","post schedule date format without year"),n);return(0,v.dateI18n)((0,fs._x)("F j, Y g:i a","post schedule full date format"),n)}(t,{isFloating:s})}function um(e){const t=(0,v.getDate)(e),s=function(){const{timezone:e}=(0,v.getSettings)();if(e.abbr&&isNaN(Number(e.abbr)))return e.abbr;return`UTC${e.offset<0?"":"+"}${e.offsetFormatted}`}(),n=(0,v.dateI18n)((0,fs._x)("F j, Y g:i a","post schedule full date format"),t);return(0,fs.isRTL)()?`${s} ${n}`:`${n} ${s}`}function pm(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}const mm=3,hm={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function gm({onSelect:e,taxonomy:t}){const{_terms:s,showTerms:n}=(0,d.useSelect)((e=>{const s=e(u.store).getEntityRecords("taxonomy",t.slug,hm);return{_terms:s,showTerms:s?.length>=mm}}),[t.slug]);if(!n)return null;const o=Ld(s);return(0,c.jsxs)("div",{className:"editor-post-taxonomies__flat-term-most-used",children:[(0,c.jsx)(Hn.BaseControl.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label",children:t.labels.most_used}),(0,c.jsx)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list",children:o.map((t=>(0,c.jsx)("li",{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>e(t),children:t.name})},t.id)))})]})}const _m=[],fm=100,bm={per_page:fm,_fields:"id,name",context:"view"},ym=(e,t)=>Ad(e).toLowerCase()===Ad(t).toLowerCase(),xm=(e,t)=>e.map((e=>t.find((t=>ym(t.name,e)))?.id)).filter((e=>void 0!==e)),vm=({children:e,__nextHasNoMarginBottom:t})=>t?(0,c.jsx)(Hn.__experimentalVStack,{spacing:4,children:e}):(0,c.jsx)(p.Fragment,{children:e});function wm({slug:e,__nextHasNoMarginBottom:t}){const[s,n]=(0,p.useState)([]),[o,r]=(0,p.useState)(""),i=(0,m.useDebounce)(r,500);t||k()("Bottom margin styles for wp.editor.PostTaxonomiesFlatTermSelector",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const{terms:a,termIds:l,taxonomy:h,hasAssignAction:g,hasCreateAction:_,hasResolvedTerms:f}=(0,d.useSelect)((t=>{const{getCurrentPost:s,getEditedPostAttribute:n}=t(vc),{getEntityRecords:o,getEntityRecord:r,hasFinishedResolution:i}=t(u.store),a=s(),l=r("root","taxonomy",e),c=l?n(l.rest_base):_m,d={...bm,include:c?.join(","),per_page:-1};return{hasCreateAction:!!l&&(a._links?.["wp:action-create-"+l.rest_base]??!1),hasAssignAction:!!l&&(a._links?.["wp:action-assign-"+l.rest_base]??!1),taxonomy:l,termIds:c,terms:c?.length?o("taxonomy",e,d):_m,hasResolvedTerms:i("getEntityRecords",["taxonomy",e,d])}}),[e]),{searchResults:b}=(0,d.useSelect)((t=>{const{getEntityRecords:s}=t(u.store);return{searchResults:o?s("taxonomy",e,{...bm,search:o}):_m}}),[o,e]);(0,p.useEffect)((()=>{if(f){const e=(a??[]).map((e=>Ad(e.name)));n(e)}}),[a,f]);const y=(0,p.useMemo)((()=>(b??[]).map((e=>Ad(e.name)))),[b]),{editPost:x}=(0,d.useDispatch)(vc),{saveEntityRecord:v}=(0,d.useDispatch)(u.store),{createErrorNotice:w}=(0,d.useDispatch)(_s.store);if(!g)return null;function S(e){x({[h.rest_base]:e})}const C=h?.labels?.add_new_item??("post_tag"===e?(0,fs.__)("Add Tag"):(0,fs.__)("Add Term")),P=h?.labels?.singular_name??("post_tag"===e?(0,fs.__)("Tag"):(0,fs.__)("Term")),j=(0,fs.sprintf)((0,fs._x)("%s added","term"),P),E=(0,fs.sprintf)((0,fs._x)("%s removed","term"),P),T=(0,fs.sprintf)((0,fs._x)("Remove %s","term"),P);return(0,c.jsxs)(vm,{__nextHasNoMarginBottom:t,children:[(0,c.jsx)(Hn.FormTokenField,{__next40pxDefaultSize:!0,value:s,suggestions:y,onChange:function(t){const s=[...a??[],...b??[]],o=t.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]),r=o.filter((e=>!s.find((t=>ym(t.name,e)))));n(o),0!==r.length?_&&Promise.all(r.map((t=>async function(t){try{const s=await v("taxonomy",e,t,{throwOnError:!0});return Md(s)}catch(e){if("term_exists"!==e.code)throw e;return{id:e.data.term_id,name:t.name}}}({name:t})))).then((e=>{const t=s.concat(e);S(xm(o,t))})).catch((e=>{w(e.message,{type:"snackbar"}),S(xm(o,s))})):S(xm(o,s))},onInputChange:i,maxSuggestions:fm,label:C,messages:{added:j,removed:E,remove:T},__nextHasNoMarginBottom:t}),(0,c.jsx)(gm,{taxonomy:h,onSelect:function(t){if(l.includes(t.id))return;const s=[...l,t.id],n="post_tag"===e?(0,fs.__)("Tag"):(0,fs.__)("Term"),o=(0,fs.sprintf)((0,fs._x)("%s added","term"),h?.labels?.singular_name??n);(0,ms.speak)(o,"assertive"),S(s)}})]})}var Sm=(0,Hn.withFilters)("editor.PostTaxonomyType")(wm);const km=()=>{const e=(0,d.useSelect)((e=>{const t=e(u.store).getTaxonomy("post_tag");return t?.labels}),[]),t=e?.add_new_item??(0,fs.__)("Add tag"),s=e?.name??(0,fs.__)("Tags"),n=[(0,fs.__)("Suggestion:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:t},"label")];return(0,c.jsxs)(Hn.PanelBody,{initialOpen:!1,title:n,children:[(0,c.jsx)("p",{children:(0,fs.sprintf)((0,fs.__)("%s help users and search engines navigate your site and find your content. Add a few keywords to describe your post."),s)}),(0,c.jsx)(Sm,{slug:"post_tag",__nextHasNoMarginBottom:!0})]})};var Cm=()=>{const{postHasTags:e,siteHasTags:t,isPostTypeSupported:s}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),s=e(u.store).getEntityRecord("root","taxonomy","post_tag"),n=s?.types?.includes(t),o=void 0!==s,r=s&&e(vc).getEditedPostAttribute(s.rest_base),i=!!n&&!!e(u.store).getEntityRecords("taxonomy","post_tag",{per_page:1})?.length;return{postHasTags:!!r?.length,siteHasTags:i,isPostTypeSupported:o&&n}}),[]),[n]=(0,p.useState)(e);return s&&t?n?null:(0,c.jsx)(km,{}):null};const Pm=(e,t)=>Pp.filter((t=>e?.includes(t.id))).find((e=>e.id===t)),jm=({suggestedPostFormat:e,suggestionText:t,onUpdatePostFormat:s})=>(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>s(e),children:t});function Em(){const{currentPostFormat:e,suggestion:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:s}=e(vc),n=e(u.store).getThemeSupports().formats??[];return{currentPostFormat:t("format"),suggestion:Pm(n,s())}}),[]),{editPost:s}=(0,d.useDispatch)(vc),n=[(0,fs.__)("Suggestion:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("Use a post format")},"label")];return t&&t.id!==e?(0,c.jsxs)(Hn.PanelBody,{initialOpen:!1,title:n,children:[(0,c.jsx)("p",{children:(0,fs.__)("Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.")}),(0,c.jsx)("p",{children:(0,c.jsx)(jm,{onUpdatePostFormat:e=>s({format:e}),suggestedPostFormat:t.id,suggestionText:(0,fs.sprintf)((0,fs.__)('Apply the "%1$s" format.'),t.caption)})})]}):null}const{normalizeTextString:Tm}=$(Hn.privateApis),{RECEIVE_INTERMEDIATE_RESULTS:Bm}=$(u.privateApis),Im={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view",[Bm]:!0},Nm=8,Rm=[];function Dm({slug:e}){const[t,s]=(0,p.useState)(!1),[n,o]=(0,p.useState)(""),[r,i]=(0,p.useState)(""),[a,l]=(0,p.useState)(!1),[h,g]=(0,p.useState)(""),[_,f]=(0,p.useState)([]),b=(0,m.useDebounce)(ms.speak,500),{hasCreateAction:y,hasAssignAction:x,terms:v,loading:w,availableTerms:S,taxonomy:k}=(0,d.useSelect)((t=>{const{getCurrentPost:s,getEditedPostAttribute:n}=t(vc),{getEntityRecord:o,getEntityRecords:r,isResolving:i}=t(u.store),a=o("root","taxonomy",e),l=s();return{hasCreateAction:!!a&&!!l._links?.["wp:action-create-"+a.rest_base],hasAssignAction:!!a&&!!l._links?.["wp:action-assign-"+a.rest_base],terms:a?n(a.rest_base):Rm,loading:i("getEntityRecords",["taxonomy",e,Im]),availableTerms:r("taxonomy",e,Im)||Rm,taxonomy:a}}),[e]),{editPost:C}=(0,d.useDispatch)(vc),{saveEntityRecord:P}=(0,d.useDispatch)(u.store),j=(0,p.useMemo)((()=>function(e,t){const s=e=>-1!==t.indexOf(e.id)||void 0!==e.children&&e.children.map(s).filter((e=>e)).length>0,n=[...e];return n.sort(((e,t)=>{const n=s(e),o=s(t);return n===o?0:n&&!o?-1:!n&&o?1:0})),n}(Dd(S),v)),[S]),{createErrorNotice:E}=(0,d.useDispatch)(_s.store);if(!x)return null;const T=e=>{C({[k.rest_base]:e})},B=e=>e.map((e=>(0,c.jsxs)("div",{className:"editor-post-taxonomies__hierarchical-terms-choice",children:[(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:-1!==v.indexOf(e.id),onChange:()=>{(e=>{const t=v.includes(e)?v.filter((t=>t!==e)):[...v,e];T(t)})(parseInt(e.id,10))},label:(0,Ln.decodeEntities)(e.name)}),!!e.children.length&&(0,c.jsx)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices",children:B(e.children)})]},e.id))),I=(t,s,n)=>k?.labels?.[t]??("category"===e?s:n),N=I("add_new_item",(0,fs.__)("Add Category"),(0,fs.__)("Add Term")),R=I("new_item_name",(0,fs.__)("Add Category"),(0,fs.__)("Add Term")),D=I("parent_item",(0,fs.__)("Parent Category"),(0,fs.__)("Parent Term")),A=`— ${D} —`,M=N,L=k?.labels?.search_items??(0,fs.__)("Search Terms"),O=k?.name??(0,fs.__)("Terms"),F=S.length>=Nm;return(0,c.jsxs)(Hn.Flex,{direction:"column",gap:"4",children:[F&&!w&&(0,c.jsx)(Hn.SearchControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:L,placeholder:L,value:h,onChange:e=>{const t=j.map(function(e){const t=s=>{if(""===e)return s;const n={...s};return n.children.length>0&&(n.children=n.children.map(t).filter((e=>e))),(-1!==Tm(n.name).indexOf(Tm(e))||n.children.length>0)&&n};return t}(e)).filter((e=>e)),s=e=>{let t=0;for(let n=0;n<e.length;n++)t++,void 0!==e[n].children&&(t+=s(e[n].children));return t};g(e),f(t);const n=s(t),o=(0,fs.sprintf)((0,fs._n)("%d result found.","%d results found.",n),n);b(o,"assertive")}}),w&&(0,c.jsx)(Hn.Flex,{justify:"center",style:{height:"40px"},children:(0,c.jsx)(Hn.Spinner,{})}),(0,c.jsx)("div",{className:"editor-post-taxonomies__hierarchical-terms-list",tabIndex:"0",role:"group","aria-label":O,children:B(""!==h?_:j)}),!w&&y&&(0,c.jsx)(Hn.FlexItem,{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,onClick:()=>{l(!a)},className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":a,variant:"link",children:N})}),a&&(0,c.jsx)("form",{onSubmit:async a=>{if(a.preventDefault(),""===n||t)return;const l=function(e,t,s){return e.find((e=>(!e.parent&&!t||parseInt(e.parent)===parseInt(t))&&e.name.toLowerCase()===s.toLowerCase()))}(S,r,n);if(l)return v.some((e=>e===l.id))||T([...v,l.id]),o(""),void i("");let c;s(!0);try{c=await(d={name:n,parent:r||void 0},P("taxonomy",e,d,{throwOnError:!0}))}catch(e){return void E(e.message,{type:"snackbar"})}var d;const u="category"===e?(0,fs.__)("Category"):(0,fs.__)("Term"),p=(0,fs.sprintf)((0,fs._x)("%s added","term"),k?.labels?.singular_name??u);(0,ms.speak)(p,"assertive"),s(!1),o(""),i(""),T([...v,c.id])},children:(0,c.jsxs)(Hn.Flex,{direction:"column",gap:"4",children:[(0,c.jsx)(Hn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-input",label:R,value:n,onChange:e=>{o(e)},required:!0}),!!S.length&&(0,c.jsx)(Hn.TreeSelect,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:D,noOptionLabel:A,onChange:e=>{i(e)},selectedId:r,tree:j}),(0,c.jsx)(Hn.FlexItem,{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit",children:M})})]})})]})}var Am=(0,Hn.withFilters)("editor.PostTaxonomyType")(Dm);var Mm=function(){const{hasNoCategory:e,hasSiteCategories:t}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),{canUser:s,getEntityRecord:n}=e(u.store),o=n("root","taxonomy","category"),r=s("read",{kind:"root",name:"site"})?n("root","site")?.default_category:void 0,i=r?n("taxonomy","category",r):void 0,a=o&&o.types.some((e=>e===t)),l=o&&e(vc).getEditedPostAttribute(o.rest_base),c=!!a&&!!e(u.store).getEntityRecords("taxonomy","category",{exclude:[r],per_page:1})?.length;return{hasNoCategory:!!o&&!!i&&a&&(0===l?.length||1===l?.length&&i?.id===l[0]),hasSiteCategories:c}}),[]),[s,n]=(0,p.useState)(!1);if((0,p.useEffect)((()=>{e&&n(!0)}),[e]),!s||!t)return null;const o=[(0,fs.__)("Suggestion:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("Assign a category")},"label")];return(0,c.jsxs)(Hn.PanelBody,{initialOpen:!1,title:o,children:[(0,c.jsx)("p",{children:(0,fs.__)("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")}),(0,c.jsx)(Am,{slug:"category"})]})};function Lm(e){return Object.fromEntries(Object.entries(function(e){const t=new Set;return Object.fromEntries(e.map((e=>{const s=(0,w.getFilename)(e);let n="";if(s){const e=s.split(".");e.length>1&&e.pop(),n=e.join(".")}return n||(n=fi()),t.has(n)&&(n=`${n}-${fi()}`),t.add(n),[e,n]})))}(e)).map((([e,t])=>{const s=window.fetch(e.includes("?")?e:e+"?").then((e=>e.blob())).then((e=>new File([e],`${t}.png`,{type:e.type})));return[e,s]})))}function Om(e){const t=[];return e.forEach((e=>{t.push(e),t.push(...Om(e.innerBlocks))})),t}function Fm(e){if("core/image"===e.name||"core/cover"===e.name){const{url:t,alt:s,id:n}=e.attributes;return{url:t,alt:s,id:n}}if("core/media-text"===e.name){const{mediaUrl:t,mediaAlt:s,mediaId:n}=e.attributes;return{url:t,alt:s,id:n}}return{}}function Vm({clientId:e,alt:t,url:s}){const{selectBlock:n}=(0,d.useDispatch)(g.store);return(0,c.jsx)(Hn.__unstableMotion.img,{tabIndex:0,role:"button","aria-label":(0,fs.__)("Select image block."),onClick:()=>{n(e)},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(n(e),t.preventDefault())},alt:t,src:s,animate:{opacity:1},exit:{opacity:0,scale:0},style:{width:"32px",height:"32px",objectFit:"cover",borderRadius:"2px",cursor:"pointer"},whileHover:{scale:1.08}},e)}function Um(){const[e,t]=(0,p.useState)(!1),[s,n]=(0,p.useState)(!1),[o,r]=(0,p.useState)(!1),{editorBlocks:i,mediaUpload:a}=(0,d.useSelect)((e=>({editorBlocks:e(g.store).getBlocks(),mediaUpload:e(g.store).getSettings().mediaUpload})),[]),l=Om(i).filter((e=>function(e){return"core/image"===e.name||"core/cover"===e.name?e.attributes.url&&!e.attributes.id:"core/media-text"===e.name?e.attributes.mediaUrl&&!e.attributes.mediaId:void 0}(e))),{updateBlockAttributes:u}=(0,d.useDispatch)(g.store);if(!a||!l.length)return null;const m=[(0,fs.__)("Suggestion:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("External media")},"label")];return(0,c.jsxs)(Hn.PanelBody,{initialOpen:!0,title:m,children:[(0,c.jsx)("p",{children:(0,fs.__)("Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.")}),(0,c.jsxs)("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:"8px"},children:[(0,c.jsx)(Hn.__unstableAnimatePresence,{onExitComplete:()=>n(!1),children:l.map((e=>{const{url:t,alt:s}=Fm(e);return(0,c.jsx)(Vm,{clientId:e.clientId,url:t,alt:s},e.clientId)}))}),e||s?(0,c.jsx)(Hn.Spinner,{}):(0,c.jsx)(Hn.Button,{size:"compact",variant:"primary",onClick:function(){t(!0),r(!1);const e=new Set(l.map((e=>{const{url:t}=Fm(e);return t}))),s=Object.fromEntries(Object.entries(Lm([...e])).map((([e,t])=>[e,t.then((e=>new Promise(((t,s)=>{a({filesList:[e],onFileChange:([e])=>{(0,Go.isBlobURL)(e.url)||t(e)},onError(){s()}})}))))])));Promise.allSettled(l.map((e=>{const{url:t}=Fm(e);return s[t].then((t=>function(e,t){"core/image"!==e.name&&"core/cover"!==e.name||u(e.clientId,{id:t.id,url:t.url}),"core/media-text"===e.name&&u(e.clientId,{mediaId:t.id,mediaUrl:t.url})}(e,t))).then((()=>n(!0))).catch((()=>r(!0)))}))).finally((()=>{t(!1)}))},children:(0,fs._x)("Upload","verb")})]}),o&&(0,c.jsx)("p",{children:(0,fs.__)("Upload failed, try again.")})]})}var Hm=function({children:e}){const{isBeingScheduled:t,isRequestingSiteIcon:s,hasPublishAction:n,siteIconUrl:o,siteTitle:r,siteHome:i}=(0,d.useSelect)((e=>{const{getCurrentPost:t,isEditedPostBeingScheduled:s}=e(vc),{getEntityRecord:n,isResolving:o}=e(u.store),r=n("root","__unstableBase",void 0)||{};return{hasPublishAction:t()._links?.["wp:action-publish"]??!1,isBeingScheduled:s(),isRequestingSiteIcon:o("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:r.site_icon_url,siteTitle:r.name,siteHome:r.home&&(0,w.filterURLForDisplay)(r.home)}}),[]);let a,l,p=(0,c.jsx)(Hn.Icon,{className:"components-site-icon",size:"36px",icon:Up});return o&&(p=(0,c.jsx)("img",{alt:(0,fs.__)("Site Icon"),className:"components-site-icon",src:o})),s&&(p=null),n?t?(a=(0,fs.__)("Are you ready to schedule?"),l=(0,fs.__)("Your work will be published at the specified date and time.")):(a=(0,fs.__)("Are you ready to publish?"),l=(0,fs.__)("Double-check your settings before publishing.")):(a=(0,fs.__)("Are you ready to submit for review?"),l=(0,fs.__)("Your work will be reviewed and then approved.")),(0,c.jsxs)("div",{className:"editor-post-publish-panel__prepublish",children:[(0,c.jsx)("div",{children:(0,c.jsx)("strong",{children:a})}),(0,c.jsx)("p",{children:l}),(0,c.jsxs)("div",{className:"components-site-card",children:[p,(0,c.jsxs)("div",{className:"components-site-info",children:[(0,c.jsx)("span",{className:"components-site-name",children:(0,Ln.decodeEntities)(r)||(0,fs.__)("(Untitled)")}),(0,c.jsx)("span",{className:"components-site-home",children:i})]})]}),(0,c.jsx)(Um,{}),n&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.PanelBody,{initialOpen:!1,title:[(0,fs.__)("Visibility:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,c.jsx)(Gp,{})},"label")],children:(0,c.jsx)(zp,{})}),(0,c.jsx)(Hn.PanelBody,{initialOpen:!1,title:[(0,fs.__)("Publish:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,c.jsx)(cm,{})},"label")],children:(0,c.jsx)(am,{})})]}),(0,c.jsx)(Em,{}),(0,c.jsx)(Cm,{}),(0,c.jsx)(Mm,{}),e]})};const zm="%postname%",Gm="%pagename%";function $m({text:e}){const[t,s]=(0,p.useState)(!1),n=(0,p.useRef)(),o=(0,m.useCopyToClipboard)(e,(()=>{s(!0),n.current&&clearTimeout(n.current),n.current=setTimeout((()=>{s(!1)}),4e3)}));return(0,p.useEffect)((()=>()=>{n.current&&clearTimeout(n.current)}),[]),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"secondary",ref:o,children:t?(0,fs.__)("Copied!"):(0,fs.__)("Copy")})}function Wm({focusOnMount:e,children:t}){const{post:s,postType:n,isScheduled:o}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPost:s,isCurrentPostScheduled:n}=e(vc),{getPostType:o}=e(u.store);return{post:s(),postType:o(t("type")),isScheduled:n()}}),[]),r=n?.labels?.singular_name,i=n?.labels?.view_item,a=n?.labels?.add_new_item,l="future"===s.status?(e=>{const{slug:t}=e;return e.permalink_template.includes(zm)?e.permalink_template.replace(zm,t):e.permalink_template.includes(Gm)?e.permalink_template.replace(Gm,t):e.permalink_template})(s):s.link,m=(0,w.addQueryArgs)("post-new.php",{post_type:s.type}),h=(0,p.useCallback)((t=>{e&&t&&t.focus()}),[e]),g=o?(0,c.jsxs)(c.Fragment,{children:[(0,fs.__)("is now scheduled. It will go live on")," ",(0,c.jsx)(cm,{}),"."]}):(0,fs.__)("is now live.");return(0,c.jsxs)("div",{className:"post-publish-panel__postpublish",children:[(0,c.jsxs)(Hn.PanelBody,{className:"post-publish-panel__postpublish-header",children:[(0,c.jsx)(Hn.ExternalLink,{ref:h,href:l,children:(0,Ln.decodeEntities)(s.title)||(0,fs.__)("(no title)")})," ",g]}),(0,c.jsxs)(Hn.PanelBody,{children:[(0,c.jsx)("p",{className:"post-publish-panel__postpublish-subheader",children:(0,c.jsx)("strong",{children:(0,fs.__)("What’s next?")})}),(0,c.jsxs)("div",{className:"post-publish-panel__postpublish-post-address-container",children:[(0,c.jsx)(Hn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:(0,fs.sprintf)((0,fs.__)("%s address"),r),value:(0,w.safeDecodeURIComponent)(l),onFocus:e=>e.target.select()}),(0,c.jsx)("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap",children:(0,c.jsx)($m,{text:l})})]}),(0,c.jsxs)("div",{className:"post-publish-panel__postpublish-buttons",children:[!o&&(0,c.jsxs)(Hn.Button,{variant:"primary",href:l,__next40pxDefaultSize:!0,icon:Fn,iconPosition:"right",target:"_blank",children:[i,(0,c.jsx)(Hn.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]}),(0,c.jsx)(Hn.Button,{variant:o?"primary":"secondary",__next40pxDefaultSize:!0,href:m,children:a})]})]}),t]})}class Zm extends p.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this),this.cancelButtonNode=(0,p.createRef)()}componentDidMount(){this.timeoutID=setTimeout((()=>{this.cancelButtonNode.current.focus()}),0)}componentWillUnmount(){clearTimeout(this.timeoutID)}componentDidUpdate(e){(e.isPublished&&!this.props.isSaving&&this.props.isDirty||this.props.currentPostId!==e.currentPostId)&&this.props.onClose()}onSubmit(){const{onClose:e,hasPublishAction:t,isPostTypeViewable:s}=this.props;t&&s||e()}render(){const{forceIsDirty:e,isBeingScheduled:t,isPublished:s,isPublishSidebarEnabled:n,isScheduled:o,isSaving:r,isSavingNonPostEntityChanges:i,onClose:a,onTogglePublishSidebar:l,PostPublishExtension:d,PrePublishExtension:u,currentPostId:p,...m}=this.props,{hasPublishAction:h,isDirty:g,isPostTypeViewable:_,...f}=m,b=s||o&&t,y=!b&&!r,x=b&&!r;return(0,c.jsxs)("div",{className:"editor-post-publish-panel",...f,children:[(0,c.jsx)("div",{className:"editor-post-publish-panel__header",children:x?(0,c.jsx)(Hn.Button,{size:"compact",onClick:a,icon:la,label:(0,fs.__)("Close panel")}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"editor-post-publish-panel__header-cancel-button",children:(0,c.jsx)(Hn.Button,{ref:this.cancelButtonNode,accessibleWhenDisabled:!0,disabled:i,onClick:a,variant:"secondary",size:"compact",children:(0,fs.__)("Cancel")})}),(0,c.jsx)("div",{className:"editor-post-publish-panel__header-publish-button",children:(0,c.jsx)(Vp,{onSubmit:this.onSubmit,forceIsDirty:e})})]})}),(0,c.jsxs)("div",{className:"editor-post-publish-panel__content",children:[y&&(0,c.jsx)(Hm,{children:u&&(0,c.jsx)(u,{})}),x&&(0,c.jsx)(Wm,{focusOnMount:!0,children:d&&(0,c.jsx)(d,{})}),r&&(0,c.jsx)(Hn.Spinner,{})]}),(0,c.jsx)("div",{className:"editor-post-publish-panel__footer",children:(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Always show pre-publish checks."),checked:n,onChange:l})})]})}}var Ym=(0,m.compose)([(0,d.withSelect)((e=>{const{getPostType:t}=e(u.store),{getCurrentPost:s,getCurrentPostId:n,getEditedPostAttribute:o,isCurrentPostPublished:r,isCurrentPostScheduled:i,isEditedPostBeingScheduled:a,isEditedPostDirty:l,isAutosavingPost:c,isSavingPost:d,isSavingNonPostEntityChanges:p}=e(vc),{isPublishSidebarEnabled:m}=e(vc),h=t(o("type"));return{hasPublishAction:s()._links?.["wp:action-publish"]??!1,isPostTypeViewable:h?.viewable,isBeingScheduled:a(),isDirty:l(),isPublished:r(),isPublishSidebarEnabled:m(),isSaving:d()&&!c(),isSavingNonPostEntityChanges:p(),isScheduled:i(),currentPostId:n()}})),(0,d.withDispatch)(((e,{isPublishSidebarEnabled:t})=>{const{disablePublishSidebar:s,enablePublishSidebar:n}=e(vc);return{onTogglePublishSidebar:()=>{t?s():n()}}})),Hn.withFocusReturn,Hn.withConstrainedTabbing])(Zm),qm=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M17.3 10.1C17.3 7.60001 15.2 5.70001 12.5 5.70001C10.3 5.70001 8.4 7.10001 7.9 9.00001H7.7C5.7 9.00001 4 10.7 4 12.8C4 14.9 5.7 16.6 7.7 16.6H9.5V15.2H7.7C6.5 15.2 5.5 14.1 5.5 12.9C5.5 11.7 6.5 10.5 7.7 10.5H9L9.3 9.40001C9.7 8.10001 11 7.20001 12.5 7.20001C14.3 7.20001 15.8 8.50001 15.8 10.1V11.4L17.1 11.6C17.9 11.7 18.5 12.5 18.5 13.4C18.5 14.4 17.7 15.2 16.8 15.2H14.5V16.6H16.7C18.5 16.6 19.9 15.1 19.9 13.3C20 11.7 18.8 10.4 17.3 10.1Z M14.1245 14.2426L15.1852 13.182L12.0032 10L8.82007 13.1831L9.88072 14.2438L11.25 12.8745V18H12.75V12.8681L14.1245 14.2426Z"})}),Km=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"})});function Qm({children:e}){const{hasStickyAction:t,postType:s}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPost();return{hasStickyAction:t._links?.["wp:action-sticky"]??!1,postType:e(vc).getCurrentPostType()}}),[]);return"post"===s&&t?e:null}function Xm(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("sticky")??!1),[]),{editPost:t}=(0,d.useDispatch)(vc);return(0,c.jsx)(Qm,{children:(0,c.jsx)(Hn.CheckboxControl,{className:"editor-post-sticky__checkbox-control",label:(0,fs.__)("Sticky"),help:(0,fs.__)("Pin this post to the top of the blog."),checked:e,onChange:()=>t({sticky:!e}),__nextHasNoMarginBottom:!0})})}const Jm={"auto-draft":{label:(0,fs.__)("Draft"),icon:br},draft:{label:(0,fs.__)("Draft"),icon:br},pending:{label:(0,fs.__)("Pending"),icon:xr},private:{label:(0,fs.__)("Private"),icon:vr},future:{label:(0,fs.__)("Scheduled"),icon:yr},publish:{label:(0,fs.__)("Published"),icon:wr}},eh=[{label:(0,fs.__)("Draft"),value:"draft",description:(0,fs.__)("Not ready to publish.")},{label:(0,fs.__)("Pending"),value:"pending",description:(0,fs.__)("Waiting for review before publishing.")},{label:(0,fs.__)("Private"),value:"private",description:(0,fs.__)("Only visible to site admins and editors.")},{label:(0,fs.__)("Scheduled"),value:"future",description:(0,fs.__)("Publish automatically on a chosen date.")},{label:(0,fs.__)("Published"),value:"publish",description:(0,fs.__)("Visible to everyone.")}],th=[B,I,N,R];function sh(){const{status:e,date:t,password:s,postId:n,postType:o,canEdit:r}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostId:s,getCurrentPostType:n,getCurrentPost:o}=e(vc);return{status:t("status"),date:t("date"),password:t("password"),postId:s(),postType:n(),canEdit:o()._links?.["wp:action-publish"]??!1}}),[]),[i,a]=(0,p.useState)(!!s),l=(0,m.useInstanceId)(sh,"editor-change-status__password-input"),{editEntityRecord:h}=(0,d.useDispatch)(u.store),[_,f]=(0,p.useState)(null),b=(0,p.useMemo)((()=>({anchor:_,"aria-label":(0,fs.__)("Status & visibility"),headerTitle:(0,fs.__)("Status & visibility"),placement:"left-start",offset:36,shift:!0})),[_]);if(th.includes(o))return null;const y=({status:r=e,password:i=s,date:a=t})=>{h("postType",o,n,{status:r,date:a,password:i})},x=e=>{a(e),e||y({password:""})},v=n=>{let o=t,r=s;"future"===e&&new Date(t)>new Date&&(o=null),"private"===n&&s&&(r=""),y({status:n,date:o,password:r})};return(0,c.jsx)(Rd,{label:(0,fs.__)("Status"),ref:f,children:r?(0,c.jsx)(Hn.Dropdown,{className:"editor-post-status",contentClassName:"editor-change-status__content",popoverProps:b,focusOnMount:!0,renderToggle:({onToggle:t,isOpen:s})=>(0,c.jsx)(Hn.Button,{className:"editor-post-status__toggle",variant:"tertiary",size:"compact",onClick:t,icon:Jm[e]?.icon,"aria-label":(0,fs.sprintf)((0,fs.__)("Change status: %s"),Jm[e]?.label),"aria-expanded":s,children:Jm[e]?.label}),renderContent:({onClose:t})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Status & visibility"),onClose:t}),(0,c.jsx)("form",{onSubmit:e=>{e.preventDefault(),t()},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:4,children:[(0,c.jsx)(Hn.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,fs.__)("Status"),options:eh,onChange:v,selected:"auto-draft"===e?"draft":e}),"future"===e&&(0,c.jsx)("div",{className:"editor-change-status__publish-date-wrapper",children:(0,c.jsx)(lm,{showPopoverHeaderActions:!1,isCompact:!0})}),"private"!==e&&(0,c.jsxs)(Hn.__experimentalVStack,{as:"fieldset",spacing:4,className:"editor-change-status__password-fieldset",children:[(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Password protected"),help:(0,fs.__)("Only visible to those who know the password."),checked:i,onChange:x}),i&&(0,c.jsx)("div",{className:"editor-change-status__password-input",children:(0,c.jsx)(Hn.TextControl,{label:(0,fs.__)("Password"),onChange:e=>y({password:e}),value:s,placeholder:(0,fs.__)("Use a secure password"),type:"text",id:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]}),(0,c.jsx)(Xm,{})]})})]})}):(0,c.jsx)("div",{className:"editor-post-status is-read-only",children:Jm[e]?.label})})}function nh({forceIsDirty:e}){const[t,s]=(0,p.useState)(!1),n=(0,m.useViewportMatch)("small"),{isAutosaving:o,isDirty:r,isNew:i,isPublished:a,isSaveable:l,isSaving:u,isScheduled:h,hasPublishAction:g,showIconLabels:_,postStatus:f,postStatusHasChanged:b}=(0,d.useSelect)((t=>{const{isEditedPostNew:s,isCurrentPostPublished:n,isCurrentPostScheduled:o,isEditedPostDirty:r,isSavingPost:i,isEditedPostSaveable:a,getCurrentPost:l,isAutosavingPost:c,getEditedPostAttribute:d,getPostEdits:u}=t(vc),{get:p}=t(C.store);return{isAutosaving:c(),isDirty:e||r(),isNew:s(),isPublished:n(),isSaving:i(),isSaveable:a(),isScheduled:o(),hasPublishAction:l()?._links?.["wp:action-publish"]??!1,showIconLabels:p("core","showIconLabels"),postStatus:d("status"),postStatusHasChanged:!!u()?.status}}),[e]),y="pending"===f,{savePost:x}=(0,d.useDispatch)(vc),v=(0,m.usePrevious)(u);if((0,p.useEffect)((()=>{let e;return v&&!u&&(s(!0),e=setTimeout((()=>{s(!1)}),1e3)),()=>clearTimeout(e)}),[u]),!g&&y)return null;const w=!["pending","draft","auto-draft"].includes(f)&&eh.map((({value:e})=>e)).includes(f);if(a||h||w||b&&["pending","draft"].includes(f))return null;const S=y?(0,fs.__)("Save as pending"):(0,fs.__)("Save draft"),k=(0,fs.__)("Save"),P=t||!i&&!r,j=u||P,E=u||P||!l;let T;return u?T=o?(0,fs.__)("Autosaving"):(0,fs.__)("Saving"):P?T=(0,fs.__)("Saved"):n?T=S:_&&(T=k),(0,c.jsxs)(Hn.Button,{className:l||u?mr({"editor-post-save-draft":!j,"editor-post-saved-state":j,"is-saving":u,"is-autosaving":o,"is-saved":P,[(0,Hn.__unstableGetAnimateClassName)({type:"loading"})]:u}):void 0,onClick:E?void 0:()=>x(),shortcut:E?void 0:ll.displayShortcut.primary("s"),variant:"tertiary",size:"compact",icon:n?void 0:qm,label:T||S,"aria-disabled":E,children:[j&&(0,c.jsx)(ei,{icon:P?zn:Km}),T]})}function oh({children:e}){return(0,d.useSelect)((e=>e(vc).getCurrentPost()._links?.["wp:action-publish"]??!1),[])?e:null}const rh=[B,I,N,R];function ih(){const[e,t]=(0,p.useState)(null),s=(0,d.useSelect)((e=>e(vc).getCurrentPostType()),[]),n=(0,p.useMemo)((()=>({anchor:e,"aria-label":(0,fs.__)("Change publish date"),placement:"left-start",offset:36,shift:!0})),[e]),o=dm(),r=dm({full:!0});return rh.includes(s)?null:(0,c.jsx)(oh,{children:(0,c.jsx)(Rd,{label:(0,fs.__)("Publish"),ref:t,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:n,focusOnMount:!0,className:"editor-post-schedule__panel-dropdown",contentClassName:"editor-post-schedule__dialog",renderToggle:({onToggle:e,isOpen:t})=>(0,c.jsx)(Hn.Button,{size:"compact",className:"editor-post-schedule__dialog-toggle",variant:"tertiary",tooltipPosition:"middle left",onClick:e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change date: %s"),o),label:r,showTooltip:o!==r,"aria-expanded":t,children:o}),renderContent:({onClose:e})=>(0,c.jsx)(am,{onClose:e})})})})}function ah(){k()("wp.editor.PostSwitchToDraftButton",{since:"6.7",version:"6.9"});const[e,t]=(0,p.useState)(!1),{editPost:s,savePost:n}=(0,d.useDispatch)(vc),{isSaving:o,isPublished:r,isScheduled:i}=(0,d.useSelect)((e=>{const{isSavingPost:t,isCurrentPostPublished:s,isCurrentPostScheduled:n}=e(vc);return{isSaving:t(),isPublished:s(),isScheduled:n()}}),[]),a=o||!r&&!i;let l,u;r?(l=(0,fs.__)("Are you sure you want to unpublish this post?"),u=(0,fs.__)("Unpublish")):i&&(l=(0,fs.__)("Are you sure you want to unschedule this post?"),u=(0,fs.__)("Unschedule"));return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,className:"editor-post-switch-to-draft",onClick:()=>{a||t(!0)},"aria-disabled":a,variant:"secondary",style:{flexGrow:"1",justifyContent:"center"},children:(0,fs.__)("Switch to draft")}),(0,c.jsx)(Hn.__experimentalConfirmDialog,{isOpen:e,onConfirm:()=>{t(!1),s({status:"draft"}),n()},onCancel:()=>t(!1),confirmButtonText:u,children:l})]})}function lh(){const{syncStatus:e,postType:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),s=t("meta");return{syncStatus:"unsynced"===s?.wp_pattern_sync_status?"unsynced":t("wp_pattern_sync_status"),postType:t("type")}}));return"wp_block"!==t?null:(0,c.jsx)(Rd,{label:(0,fs.__)("Sync status"),children:(0,c.jsx)("div",{className:"editor-post-sync-status__value",children:"unsynced"===e?(0,fs._x)("Not synced","pattern (singular)"):(0,fs._x)("Synced","pattern (singular)")})})}const ch=e=>e;var dh=function({taxonomyWrapper:e=ch}){const{postType:t,taxonomies:s}=(0,d.useSelect)((e=>({postType:e(vc).getCurrentPostType(),taxonomies:e(u.store).getEntityRecords("root","taxonomy",{per_page:-1})})),[]);return(s??[]).filter((e=>e.types.includes(t)&&e.visibility?.show_ui)).map((t=>{const s=t.hierarchical?Am:Sm,n={slug:t.slug,...t.hierarchical?{}:{__nextHasNoMarginBottom:!0}};return(0,c.jsx)(p.Fragment,{children:e((0,c.jsx)(s,{...n}),t)},`taxonomy-${t.slug}`)}))};function uh({children:e}){const t=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),s=e(u.store).getEntityRecords("root","taxonomy",{per_page:-1});return s?.some((e=>e.types.includes(t)))}),[]);return t?e:null}function ph({taxonomy:e,children:t}){const s=e?.slug,n=s?`taxonomy-panel-${s}`:"",{isEnabled:o,isOpened:r}=(0,d.useSelect)((e=>{const{isEditorPanelEnabled:t,isEditorPanelOpened:o}=e(vc);return{isEnabled:!!s&&t(n),isOpened:!!s&&o(n)}}),[n,s]),{toggleEditorPanelOpened:i}=(0,d.useDispatch)(vc);if(!o)return null;const a=e?.labels?.menu_name;return a?(0,c.jsx)(Hn.PanelBody,{title:a,opened:r,onToggle:()=>i(n),children:t}):null}function mh(){return(0,c.jsx)(uh,{children:(0,c.jsx)(dh,{taxonomyWrapper:(e,t)=>(0,c.jsx)(ph,{taxonomy:t,children:e})})})}var hh=s(4132);function gh(){const e=(0,m.useInstanceId)(gh),{content:t,blocks:s,type:n,id:o}=(0,d.useSelect)((e=>{const{getEditedEntityRecord:t}=e(u.store),{getCurrentPostType:s,getCurrentPostId:n}=e(vc),o=s(),r=n(),i=t("postType",o,r);return{content:i?.content,blocks:i?.blocks,type:o,id:r}}),[]),{editEntityRecord:r}=(0,d.useDispatch)(u.store),i=(0,p.useMemo)((()=>t instanceof Function?t({blocks:s}):s?(0,x.__unstableSerializeAndClean)(s):t),[t,s]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.VisuallyHidden,{as:"label",htmlFor:`post-content-${e}`,children:(0,fs.__)("Type text or HTML")}),(0,c.jsx)(hh.A,{autoComplete:"off",dir:"auto",value:i,onChange:e=>{r("postType",n,o,{content:e.target.value,blocks:void 0,selection:void 0})},className:"editor-post-text-editor",id:`post-content-${e}`,placeholder:(0,fs.__)("Start writing with text or HTML")})]})}const _h="wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",fh=/[\r\n]+/g;function bh(e){const t=(0,p.useRef)(),{isCleanNewPost:s}=(0,d.useSelect)((e=>{const{isCleanNewPost:t}=e(vc);return{isCleanNewPost:t()}}),[]);return(0,p.useImperativeHandle)(e,(()=>({focus:()=>{t?.current?.focus()}}))),(0,p.useEffect)((()=>{if(!t.current)return;const{defaultView:e}=t.current.ownerDocument,{name:n,parent:o}=e,r="editor-canvas"===n?o.document:e.document,{activeElement:i,body:a}=r;!s||i&&a!==i||t.current.focus()}),[s]),{ref:t}}function yh(){const{editPost:e}=(0,d.useDispatch)(vc),{title:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc);return{title:t("title")}}),[]);return{title:t,setTitle:function(t){e({title:t})}}}const xh=(0,p.forwardRef)(((e,t)=>{const{placeholder:s}=(0,d.useSelect)((e=>{const{getSettings:t}=e(g.store),{titlePlaceholder:s}=t();return{placeholder:s}}),[]),[n,o]=(0,p.useState)(!1),{ref:r}=bh(t),{title:i,setTitle:a}=yh(),[l,u]=(0,p.useState)({}),{clearSelectedBlock:h,insertBlocks:_,insertDefaultBlock:f}=(0,d.useDispatch)(g.store),b=(0,Ln.decodeEntities)(s)||(0,fs.__)("Add title"),{value:y,onChange:v,ref:w}=(0,$c.__unstableUseRichText)({value:i,onChange(e){a(e.replace(fh," "))},placeholder:b,selectionStart:l.start,selectionEnd:l.end,onSelectionChange(e,t){u((s=>{const{start:n,end:o}=s;return n===e&&o===t?s:{start:e,end:t}}))},__unstableDisableFormats:!1});function S(e){_(e,0)}const k=mr(_h,{"is-selected":n});return(0,c.jsx)("h1",{ref:(0,m.useMergeRefs)([w,r]),contentEditable:!0,className:k,"aria-label":b,role:"textbox","aria-multiline":"true",onFocus:function(){o(!0),h()},onBlur:function(){o(!1),u({})},onKeyDown:function(e){e.keyCode===ll.ENTER&&(e.preventDefault(),f(void 0,void 0,0))},onPaste:function(e){const t=e.clipboardData;let s="",n="";try{s=t.getData("text/plain"),n=t.getData("text/html")}catch(e){return}window.console.log("Received HTML:\n\n",n),window.console.log("Received plain text:\n\n",s);const o=(0,x.pasteHandler)({HTML:n,plainText:s});if(e.preventDefault(),o.length)if("string"!=typeof o){const[e]=o;if(i||"core/heading"!==e.name&&"core/paragraph"!==e.name)S(o);else{const t=(0,Uc.__unstableStripHTML)(e.attributes.content);a(t),S(o.slice(1))}}else{const e=(0,Uc.__unstableStripHTML)(o);v((0,$c.insert)(y,(0,$c.create)({html:e})))}}})}));var vh=(0,p.forwardRef)(((e,t)=>(0,c.jsx)(Bd,{supportKeys:"title",children:(0,c.jsx)(xh,{ref:t})})));var wh=(0,p.forwardRef)((function(e,t){const{placeholder:s}=(0,d.useSelect)((e=>{const{getSettings:t}=e(g.store),{titlePlaceholder:s}=t();return{placeholder:s}}),[]),[n,o]=(0,p.useState)(!1),{title:r,setTitle:i}=yh(),{ref:a}=bh(t),l=mr(_h,{"is-selected":n,"is-raw-text":!0}),u=(0,Ln.decodeEntities)(s)||(0,fs.__)("Add title");return(0,c.jsx)(Hn.TextareaControl,{ref:a,value:r,onChange:function(e){i(e.replace(fh," "))},onFocus:function(){o(!0)},onBlur:function(){o(!1)},label:s,className:l,placeholder:u,hideLabelFromVision:!0,autoComplete:"off",dir:"auto",rows:1,__nextHasNoMarginBottom:!0})}));function Sh({children:e}){const{canTrashPost:t}=(0,d.useSelect)((e=>{const{isEditedPostNew:t,getCurrentPostId:s,getCurrentPostType:n}=e(vc),{canUser:o}=e(u.store),r=n(),i=s(),a=t(),l=!!i&&o("delete",{kind:"postType",name:r,id:i});return{canTrashPost:(!a||i)&&l&&!M.includes(r)}}),[]);return t?e:null}function kh({onActionPerformed:e}){const t=(0,d.useRegistry)(),{isNew:s,isDeleting:n,postId:o,title:r}=(0,d.useSelect)((e=>{const t=e(vc);return{isNew:t.isEditedPostNew(),isDeleting:t.isDeletingPost(),postId:t.getCurrentPostId(),title:t.getCurrentPostAttribute("title")}}),[]),{trashPost:i}=(0,d.useDispatch)(vc),[a,l]=(0,p.useState)(!1);if(s||!o)return null;return(0,c.jsxs)(Sh,{children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:n,"aria-disabled":n,onClick:n?void 0:()=>l(!0),children:(0,fs.__)("Move to trash")}),(0,c.jsx)(Hn.__experimentalConfirmDialog,{isOpen:a,onConfirm:async()=>{l(!1),await i();const s=await t.resolveSelect(vc).getCurrentPost();e?.("move-to-trash",[s])},onCancel:()=>l(!1),confirmButtonText:(0,fs.__)("Move to trash"),size:"small",children:(0,fs.sprintf)((0,fs.__)('Are you sure you want to move "%s" to the trash?'),r)})]})}function Ch({onClose:e}){const{isEditable:t,postSlug:s,postLink:n,permalinkPrefix:o,permalinkSuffix:r,permalink:i}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPost(),s=e(vc).getCurrentPostType(),n=e(u.store).getPostType(s),o=e(vc).getPermalinkParts(),r=t?._links?.["wp:action-publish"]??!1;return{isEditable:e(vc).isPermalinkEditable()&&r,postSlug:(0,w.safeDecodeURIComponent)(e(vc).getEditedPostSlug()),viewPostLabel:n?.labels.view_item,postLink:t.link,permalinkPrefix:o?.prefix,permalinkSuffix:o?.suffix,permalink:(0,w.safeDecodeURIComponent)(e(vc).getPermalink())}}),[]),{editPost:a}=(0,d.useDispatch)(vc),{createNotice:l}=(0,d.useDispatch)(_s.store),[h,_]=(0,p.useState)(!1),f=(0,m.useCopyToClipboard)(i,(()=>{l("info",(0,fs.__)("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})})),b="editor-post-url__slug-description-"+(0,m.useInstanceId)(Ch);return(0,c.jsxs)("div",{className:"editor-post-url",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Slug"),onClose:e}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:3,children:[t&&(0,c.jsx)("p",{className:"editor-post-url__intro",children:(0,p.createInterpolateElement)((0,fs.__)("<span>Customize the last part of the Permalink.</span> <a>Learn more.</a>"),{span:(0,c.jsx)("span",{id:b}),a:(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink")})})}),(0,c.jsxs)("div",{children:[t&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.__experimentalInputControl,{__next40pxDefaultSize:!0,prefix:(0,c.jsx)(Hn.__experimentalInputControlPrefixWrapper,{children:"/"}),suffix:(0,c.jsx)(Hn.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,c.jsx)(Hn.Button,{icon:Tr,ref:f,size:"small",label:"Copy"})}),label:(0,fs.__)("Slug"),hideLabelFromVision:!0,value:h?"":s,autoComplete:"off",spellCheck:"false",type:"text",className:"editor-post-url__input",onChange:e=>{a({slug:e}),e?h&&_(!1):h||_(!0)},onBlur:e=>{a({slug:(0,w.cleanForSlug)(e.target.value)}),h&&_(!1)},"aria-describedby":b}),(0,c.jsxs)("p",{className:"editor-post-url__permalink",children:[(0,c.jsx)("span",{className:"editor-post-url__permalink-visual-label",children:(0,fs.__)("Permalink:")}),(0,c.jsxs)(Hn.ExternalLink,{className:"editor-post-url__link",href:n,target:"_blank",children:[(0,c.jsx)("span",{className:"editor-post-url__link-prefix",children:o}),(0,c.jsx)("span",{className:"editor-post-url__link-slug",children:s}),(0,c.jsx)("span",{className:"editor-post-url__link-suffix",children:r})]})]})]}),!t&&(0,c.jsx)(Hn.ExternalLink,{className:"editor-post-url__link",href:n,target:"_blank",children:n})]})]})]})}function Ph({children:e}){const t=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),s=e(u.store).getPostType(t);if(!s?.viewable)return!1;if(!e(vc).getCurrentPost().link)return!1;return!!e(vc).getPermalinkParts()}),[]);return t?e:null}function jh(){return Eh()}function Eh(){const e=(0,d.useSelect)((e=>e(vc).getPermalink()),[]);return(0,w.filterURLForDisplay)((0,w.safeDecodeURIComponent)(e))}function Th(){const{isFrontPage:e}=(0,d.useSelect)((e=>{const{getCurrentPostId:t}=e(vc),{getEditedEntityRecord:s,canUser:n}=e(u.store),o=n("read",{kind:"root",name:"site"})?s("root","site"):void 0,r=t();return{isFrontPage:o?.page_on_front===r}}),[]),[t,s]=(0,p.useState)(null),n=(0,p.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]),o=e?(0,fs.__)("Link"):(0,fs.__)("Slug");return(0,c.jsx)(Ph,{children:(0,c.jsxs)(Rd,{label:o,ref:s,children:[!e&&(0,c.jsx)(Hn.Dropdown,{popoverProps:n,className:"editor-post-url__panel-dropdown",contentClassName:"editor-post-url__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Bh,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,c.jsx)(Ch,{onClose:e})}),e&&(0,c.jsx)(Ih,{})]})})}function Bh({isOpen:e,onClick:t}){const{slug:s}=(0,d.useSelect)((e=>({slug:e(vc).getEditedPostSlug()})),[]),n=(0,w.safeDecodeURIComponent)(s);return(0,c.jsx)(Hn.Button,{size:"compact",className:"editor-post-url__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change link: %s"),n),onClick:t,children:(0,c.jsx)(c.Fragment,{children:n})})}function Ih(){const{postLink:e}=(0,d.useSelect)((e=>{const{getCurrentPost:t}=e(vc);return{postLink:t()?.link}}),[]);return(0,c.jsx)(Hn.ExternalLink,{className:"editor-post-url__front-page-link",href:e,target:"_blank",children:e})}function Nh({render:e}){return e({canEdit:(0,d.useSelect)((e=>e(vc).getCurrentPost()._links?.["wp:action-publish"]??!1))})}var Rh=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})});const Dh=window.wp.wordcount;function Ah(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("content")),[]),t=(0,fs._x)("words","Word count type. Do not translate!");return(0,c.jsx)("span",{className:"word-count",children:(0,Dh.count)(e,t)})}const Mh=189;function Lh(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("content")),[]),t=(0,fs._x)("words","Word count type. Do not translate!"),s=Math.round((0,Dh.count)(e,t)/Mh),n=0===s?(0,p.createInterpolateElement)((0,fs.__)("<span>< 1</span> minute"),{span:(0,c.jsx)("span",{})}):(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs._n)("<span>%s</span> minute","<span>%s</span> minutes",s),s),{span:(0,c.jsx)("span",{})});return(0,c.jsx)("span",{className:"time-to-read",children:n})}function Oh(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("content")),[]);return(0,Dh.count)(e,"characters_including_spaces")}var Fh=function({hasOutlineItemsDisabled:e,onRequestClose:t}){const{headingCount:s,paragraphCount:n,numberOfBlocks:o}=(0,d.useSelect)((e=>{const{getGlobalBlockCount:t}=e(g.store);return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}}),[]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":(0,fs.__)("Document Statistics"),tabIndex:"0",children:(0,c.jsxs)("ul",{role:"list",className:"table-of-contents__counts",children:[(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Words"),(0,c.jsx)(Ah,{})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Characters"),(0,c.jsx)("span",{className:"table-of-contents__number",children:(0,c.jsx)(Oh,{})})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Time to read"),(0,c.jsx)(Lh,{})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Headings"),(0,c.jsx)("span",{className:"table-of-contents__number",children:s})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Paragraphs"),(0,c.jsx)("span",{className:"table-of-contents__number",children:n})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Blocks"),(0,c.jsx)("span",{className:"table-of-contents__number",children:o})]})]})}),s>0&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("hr",{}),(0,c.jsx)("h2",{className:"table-of-contents__title",children:(0,fs.__)("Document Outline")}),(0,c.jsx)(ed,{onSelect:t,hasOutlineItemsDisabled:e})]})]})};var Vh=(0,p.forwardRef)((function({hasOutlineItemsDisabled:e,repositionDropdown:t,...s},n){const o=(0,d.useSelect)((e=>!!e(g.store).getBlockCount()),[]);return(0,c.jsx)(Hn.Dropdown,{popoverProps:{placement:t?"right":"bottom"},className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,...s,ref:n,onClick:o?t:void 0,icon:Rh,"aria-expanded":e,"aria-haspopup":"true",label:(0,fs.__)("Details"),tooltipPosition:"bottom","aria-disabled":!o}),renderContent:({onClose:t})=>(0,c.jsx)(Fh,{onRequestClose:t,hasOutlineItemsDisabled:e})})}));function Uh(){const{__experimentalGetDirtyEntityRecords:e}=(0,d.useSelect)(u.store);return(0,p.useEffect)((()=>{const t=t=>{if(e().length>0)return t.returnValue=(0,fs.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}}),[e]),null}const Hh=window.wp.serverSideRender;var zh=s.n(Hh);function Gh(e,t,s=[]){const n=(0,p.forwardRef)(((s,n)=>(k()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),(0,c.jsx)(t,{ref:n,...s}))));return s.forEach((s=>{n[s]=Gh(e+"."+s,t[s])})),n}function $h(e,t){return(...s)=>(k()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),t(...s))}const Wh=Gh("RichText",g.RichText,["Content"]);Wh.isEmpty=$h("RichText.isEmpty",g.RichText.isEmpty);const Zh=Gh("Autocomplete",g.Autocomplete),Yh=Gh("AlignmentToolbar",g.AlignmentToolbar),qh=Gh("BlockAlignmentToolbar",g.BlockAlignmentToolbar),Kh=Gh("BlockControls",g.BlockControls,["Slot"]),Qh=Gh("BlockEdit",g.BlockEdit),Xh=Gh("BlockEditorKeyboardShortcuts",g.BlockEditorKeyboardShortcuts),Jh=Gh("BlockFormatControls",g.BlockFormatControls,["Slot"]),eg=Gh("BlockIcon",g.BlockIcon),tg=Gh("BlockInspector",g.BlockInspector),sg=Gh("BlockList",g.BlockList),ng=Gh("BlockMover",g.BlockMover),og=Gh("BlockNavigationDropdown",g.BlockNavigationDropdown),rg=Gh("BlockSelectionClearer",g.BlockSelectionClearer),ig=Gh("BlockSettingsMenu",g.BlockSettingsMenu),ag=Gh("BlockTitle",g.BlockTitle),lg=Gh("BlockToolbar",g.BlockToolbar),cg=Gh("ColorPalette",g.ColorPalette),dg=Gh("ContrastChecker",g.ContrastChecker),ug=Gh("CopyHandler",g.CopyHandler),pg=Gh("DefaultBlockAppender",g.DefaultBlockAppender),mg=Gh("FontSizePicker",g.FontSizePicker),hg=Gh("Inserter",g.Inserter),gg=Gh("InnerBlocks",g.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),_g=Gh("InspectorAdvancedControls",g.InspectorAdvancedControls,["Slot"]),fg=Gh("InspectorControls",g.InspectorControls,["Slot"]),bg=Gh("PanelColorSettings",g.PanelColorSettings),yg=Gh("PlainText",g.PlainText),xg=Gh("RichTextShortcut",g.RichTextShortcut),vg=Gh("RichTextToolbarButton",g.RichTextToolbarButton),wg=Gh("__unstableRichTextInputEvent",g.__unstableRichTextInputEvent),Sg=Gh("MediaPlaceholder",g.MediaPlaceholder),kg=Gh("MediaUpload",g.MediaUpload),Cg=Gh("MediaUploadCheck",g.MediaUploadCheck),Pg=Gh("MultiSelectScrollIntoView",g.MultiSelectScrollIntoView),jg=Gh("NavigableToolbar",g.NavigableToolbar),Eg=Gh("ObserveTyping",g.ObserveTyping),Tg=Gh("SkipToSelectedBlock",g.SkipToSelectedBlock),Bg=Gh("URLInput",g.URLInput),Ig=Gh("URLInputButton",g.URLInputButton),Ng=Gh("URLPopover",g.URLPopover),Rg=Gh("Warning",g.Warning),Dg=Gh("WritingFlow",g.WritingFlow),Ag=$h("createCustomColorsHOC",g.createCustomColorsHOC),Mg=$h("getColorClassName",g.getColorClassName),Lg=$h("getColorObjectByAttributeValues",g.getColorObjectByAttributeValues),Og=$h("getColorObjectByColorValue",g.getColorObjectByColorValue),Fg=$h("getFontSize",g.getFontSize),Vg=$h("getFontSizeClass",g.getFontSizeClass),Ug=$h("withColorContext",g.withColorContext),Hg=$h("withColors",g.withColors),zg=$h("withFontSizes",g.withFontSizes),Gg=kl,$g=kl;function Wg(e){return k()("wp.editor.cleanForSlug",{since:"12.7",plugin:"Gutenberg",alternative:"wp.url.cleanForSlug"}),(0,w.cleanForSlug)(e)}var Zg=(0,Hn.createSlotFill)(Symbol("EditCanvasContainerSlot"));const Yg="__experimentalMainDashboardButton",{Fill:qg,Slot:Kg}=(0,Hn.createSlotFill)(Yg),Qg=qg;Qg.Slot=()=>{const e=(0,Hn.__experimentalUseSlotFills)(Yg);return(0,c.jsx)(Kg,{bubblesVirtually:!0,fillProps:{length:e?e.length:0}})};var Xg=Qg,Jg=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})}),e_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})});const{useHasBlockToolbar:t_}=$(g.privateApis);function s_({isCollapsed:e,onToggle:t}){const{blockSelectionStart:s}=(0,d.useSelect)((e=>({blockSelectionStart:e(g.store).getBlockSelectionStart()})),[]),n=t_(),o=!!s;return(0,p.useEffect)((()=>{s&&t(!1)}),[s,t]),n?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:mr("editor-collapsible-block-toolbar",{"is-collapsed":e||!o}),children:(0,c.jsx)(g.BlockToolbar,{hideDragHandle:!0})}),(0,c.jsx)(Hn.Popover.Slot,{name:"block-toolbar"}),(0,c.jsx)(Hn.Button,{className:"editor-collapsible-block-toolbar__toggle",icon:e?Jg:e_,onClick:()=>{t(!e)},label:e?(0,fs.__)("Show block tools"):(0,fs.__)("Hide block tools"),size:"compact"})]}):null}var n_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})});var o_=function({className:e,disableBlockTools:t=!1}){const{setIsInserterOpened:s,setIsListViewOpened:n}=(0,d.useDispatch)(vc),{isDistractionFree:o,isInserterOpened:r,isListViewOpen:i,listViewShortcut:a,inserterSidebarToggleRef:l,listViewToggleRef:u,showIconLabels:h}=(0,d.useSelect)((e=>{const{get:t}=e(C.store),{isListViewOpened:s,getEditorMode:n,getInserterSidebarToggleRef:o,getListViewToggleRef:r}=$(e(vc)),{getShortcutRepresentation:i}=e(il.store);return{isInserterOpened:e(vc).isInserterOpened(),isListViewOpen:s(),listViewShortcut:i("core/editor/toggle-list-view"),inserterSidebarToggleRef:o(),listViewToggleRef:r(),showIconLabels:t("core","showIconLabels"),isDistractionFree:t("core","distractionFree"),isVisualMode:"visual"===n()}}),[]),_=(0,m.useViewportMatch)("wide"),f=(0,fs.__)("Document tools"),b=(0,p.useCallback)((()=>n(!i)),[n,i]),y=(0,p.useCallback)((()=>s(!r)),[r,s]),x=(0,fs._x)("Block Inserter","Generic label for block inserter button"),v=r?(0,fs.__)("Close"):(0,fs.__)("Add");return(0,c.jsx)(g.NavigableToolbar,{className:mr("editor-document-tools","edit-post-header-toolbar",e),"aria-label":f,variant:"unstyled",children:(0,c.jsxs)("div",{className:"editor-document-tools__left",children:[!o&&(0,c.jsx)(Hn.ToolbarButton,{ref:l,className:"editor-document-tools__inserter-toggle",variant:"primary",isPressed:r,onMouseDown:e=>{r&&e.preventDefault()},onClick:y,disabled:t,icon:n_,label:h?v:x,showTooltip:!h,"aria-expanded":r}),(_||!h)&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.ToolbarItem,{as:id,showTooltip:!h,variant:h?"tertiary":void 0,size:"compact"}),(0,c.jsx)(Hn.ToolbarItem,{as:rd,showTooltip:!h,variant:h?"tertiary":void 0,size:"compact"}),!o&&(0,c.jsx)(Hn.ToolbarButton,{className:"editor-document-tools__document-overview-toggle",icon:Wi,disabled:t,isPressed:i,label:(0,fs.__)("Document Overview"),onClick:b,shortcut:a,showTooltip:!h,variant:h?"tertiary":void 0,"aria-expanded":i,ref:u})]})]})})},r_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});function i_(){const{createNotice:e}=(0,d.useDispatch)(_s.store),{getCurrentPostId:t,getCurrentPostType:s}=(0,d.useSelect)(vc),{getEditedEntityRecord:n}=(0,d.useSelect)(u.store);const o=(0,m.useCopyToClipboard)((function(){const e=n("postType",s(),t());return e?"function"==typeof e.content?e.content(e):e.blocks?(0,x.__unstableSerializeAndClean)(e.blocks):e.content?e.content:void 0:""}),(function(){e("info",(0,fs.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,c.jsx)(Hn.MenuItem,{ref:o,children:(0,fs.__)("Copy all blocks")})}const a_=[{value:"visual",label:(0,fs.__)("Visual editor")},{value:"text",label:(0,fs.__)("Code editor")}];var l_=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:s,mode:n}=(0,d.useSelect)((e=>({shortcut:e(il.store).getShortcutRepresentation("core/editor/toggle-mode"),isRichEditingEnabled:e(vc).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(vc).getEditorSettings().codeEditingEnabled,mode:e(vc).getEditorMode()})),[]),{switchEditorMode:o}=(0,d.useDispatch)(vc);let r=n;t||"visual"!==n||(r="text"),s||"text"!==n||(r="visual");const i=a_.map((n=>(s||"text"!==n.value||(n={...n,disabled:!0}),t||"visual"!==n.value||(n={...n,disabled:!0,info:(0,fs.__)("You can enable the visual editor in your profile settings.")}),n.value===r||n.disabled?n:{...n,shortcut:e})));return(0,c.jsx)(Hn.MenuGroup,{label:(0,fs.__)("Editor"),children:(0,c.jsx)(Hn.MenuItemsChoice,{choices:i,value:r,onSelect:o})})};const{Fill:c_,Slot:d_}=(0,Hn.createSlotFill)("ToolsMoreMenuGroup");c_.Slot=({fillProps:e})=>(0,c.jsx)(d_,{fillProps:e});var u_=c_;const{Fill:p_,Slot:m_}=(0,Hn.createSlotFill)("web"===p.Platform.OS?Symbol("ViewMoreMenuGroup"):"ViewMoreMenuGroup");p_.Slot=({fillProps:e})=>(0,c.jsx)(m_,{fillProps:e});var h_=p_;function g_(){const{openModal:e}=(0,d.useDispatch)(ja),{set:t}=(0,d.useDispatch)(C.store),{toggleDistractionFree:s}=(0,d.useDispatch)(vc),n=(0,d.useSelect)((e=>e(C.store).get("core","showIconLabels")),[]),o=()=>{t("core","distractionFree",!1)};return(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(Hn.DropdownMenu,{icon:r_,label:(0,fs.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{showTooltip:!n,...n&&{variant:"tertiary"},tooltipPosition:"bottom",size:"compact"},children:({onClose:t})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(Hn.MenuGroup,{label:(0,fs._x)("View","noun"),children:[(0,c.jsx)(C.PreferenceToggleMenuItem,{scope:"core",name:"fixedToolbar",onToggle:o,label:(0,fs.__)("Top toolbar"),info:(0,fs.__)("Access all block and document tools in a single place"),messageActivated:(0,fs.__)("Top toolbar activated."),messageDeactivated:(0,fs.__)("Top toolbar deactivated.")}),(0,c.jsx)(C.PreferenceToggleMenuItem,{scope:"core",name:"distractionFree",label:(0,fs.__)("Distraction free"),info:(0,fs.__)("Write with calmness"),handleToggling:!1,onToggle:()=>s({createNotice:!1}),messageActivated:(0,fs.__)("Distraction free mode activated."),messageDeactivated:(0,fs.__)("Distraction free mode deactivated."),shortcut:ll.displayShortcut.primaryShift("\\")}),(0,c.jsx)(C.PreferenceToggleMenuItem,{scope:"core",name:"focusMode",label:(0,fs.__)("Spotlight mode"),info:(0,fs.__)("Focus on one block at a time"),messageActivated:(0,fs.__)("Spotlight mode activated."),messageDeactivated:(0,fs.__)("Spotlight mode deactivated.")}),(0,c.jsx)(h_.Slot,{fillProps:{onClose:t}})]}),(0,c.jsx)(l_,{}),(0,c.jsx)(Na.Slot,{name:"core/plugin-more-menu",label:(0,fs.__)("Panels"),fillProps:{onClick:t}}),(0,c.jsxs)(Hn.MenuGroup,{label:(0,fs.__)("Tools"),children:[(0,c.jsx)(Hn.MenuItem,{onClick:()=>e("editor/keyboard-shortcut-help"),shortcut:ll.displayShortcut.access("h"),children:(0,fs.__)("Keyboard shortcuts")}),(0,c.jsx)(i_,{}),(0,c.jsxs)(Hn.MenuItem,{icon:Fn,href:(0,fs.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer",children:[(0,fs.__)("Help"),(0,c.jsx)(Hn.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]}),(0,c.jsx)(u_.Slot,{fillProps:{onClose:t}})]}),(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsx)(Hn.MenuItem,{onClick:()=>e("editor/preferences"),children:(0,fs.__)("Preferences")})})]})})})}const __="toggle",f_="button";function b_({forceIsDirty:e,setEntitiesSavedStatesCallback:t}){let s;const n=(0,m.useViewportMatch)("medium","<"),{togglePublishSidebar:o}=(0,d.useDispatch)(vc),{hasPublishAction:r,isBeingScheduled:i,isPending:a,isPublished:l,isPublishSidebarEnabled:u,isPublishSidebarOpened:p,isScheduled:h,postStatus:g,postStatusHasChanged:_}=(0,d.useSelect)((e=>({hasPublishAction:!!e(vc).getCurrentPost()?._links?.["wp:action-publish"],isBeingScheduled:e(vc).isEditedPostBeingScheduled(),isPending:e(vc).isCurrentPostPending(),isPublished:e(vc).isCurrentPostPublished(),isPublishSidebarEnabled:e(vc).isPublishSidebarEnabled(),isPublishSidebarOpened:e(vc).isPublishSidebarOpened(),isScheduled:e(vc).isCurrentPostScheduled(),postStatus:e(vc).getEditedPostAttribute("status"),postStatusHasChanged:e(vc).getPostEdits()?.status})),[]);return s=l||_&&!["future","publish"].includes(g)||h&&i||a&&!r&&!n?f_:n||u?__:f_,(0,c.jsx)(Vp,{forceIsDirty:e,isOpen:p,isToggle:s===__,onToggle:o,setEntitiesSavedStatesCallback:t})}function y_(){const{hasLoaded:e,permalink:t,isPublished:s,label:n,showIconLabels:o}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),s=e(u.store).getPostType(t),{get:n}=e(C.store);return{permalink:e(vc).getPermalink(),isPublished:e(vc).isCurrentPostPublished(),label:s?.labels.view_item,hasLoaded:!!s,showIconLabels:n("core","showIconLabels")}}),[]);return s&&t&&e?(0,c.jsx)(Hn.Button,{icon:Fn,label:n||(0,fs.__)("View post"),href:t,target:"_blank",showTooltip:!o,size:"compact"}):null}var x_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"})}),v_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"})}),w_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M17 4H7c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12zm-7.5-.5h4V16h-4v1.5z"})});function S_({forceIsAutosaveable:e,disabled:t}){const{deviceType:s,homeUrl:n,isTemplate:o,isViewable:r,showIconLabels:i,isTemplateHidden:a,templateId:l}=(0,d.useSelect)((e=>{const{getDeviceType:t,getCurrentPostType:s,getCurrentTemplateId:n,getRenderingMode:o}=e(vc),{getEntityRecord:r,getPostType:i}=e(u.store),{get:a}=e(C.store),l=s();return{deviceType:t(),homeUrl:r("root","__unstableBase")?.home,isTemplate:"wp_template"===l,isViewable:i(l)?.viewable??!1,showIconLabels:a("core","showIconLabels"),isTemplateHidden:"post-only"===o(),templateId:n()}}),[]),{setDeviceType:p,setRenderingMode:h,setDefaultRenderingMode:_}=$((0,d.useDispatch)(vc)),{resetZoomLevel:f}=$((0,d.useDispatch)(g.store)),b=e=>{p(e),f()};if((0,m.useViewportMatch)("medium","<"))return null;const y={className:"editor-preview-dropdown__toggle",iconPosition:"right",size:"compact",showTooltip:!i,disabled:t,accessibleWhenDisabled:t},x={"aria-label":(0,fs.__)("View options")},v={desktop:x_,mobile:v_,tablet:w_},w=[{value:"Desktop",label:(0,fs.__)("Desktop"),icon:x_},{value:"Tablet",label:(0,fs.__)("Tablet"),icon:w_},{value:"Mobile",label:(0,fs.__)("Mobile"),icon:v_}];return(0,c.jsx)(Hn.DropdownMenu,{className:mr("editor-preview-dropdown",`editor-preview-dropdown--${s.toLowerCase()}`),popoverProps:{placement:"bottom-end"},toggleProps:y,menuProps:x,icon:v[s.toLowerCase()],label:(0,fs.__)("View"),disableOpenOnArrowDown:t,children:({onClose:t})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsx)(Hn.MenuItemsChoice,{choices:w,value:s,onSelect:b})}),o&&(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsxs)(Hn.MenuItem,{href:n,target:"_blank",icon:Fn,onClick:t,children:[(0,fs.__)("View site"),(0,c.jsx)(Hn.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]})}),!o&&!!l&&(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsx)(Hn.MenuItem,{icon:a?void 0:zn,isSelected:!a,role:"menuitemcheckbox",onClick:()=>{const e=a?"template-locked":"post-only";h(e),_(e),f()},children:(0,fs.__)("Show template")})}),r&&(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsx)(Mp,{className:"editor-preview-dropdown__button-external",role:"menuitem",forceIsAutosaveable:e,"aria-label":(0,fs.__)("Preview in new tab"),textContent:(0,c.jsxs)(c.Fragment,{children:[(0,fs.__)("Preview in new tab"),(0,c.jsx)(Hn.Icon,{icon:Fn})]}),onPreview:t})}),(0,c.jsx)(Na.Slot,{name:"core/plugin-preview-menu",fillProps:{onClick:t}})]})})}var k_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fill:"none",d:"M5.75 12.75V18.25H11.25M12.75 5.75H18.25V11.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"square"})});var C_=({disabled:e})=>{const{isZoomOut:t,showIconLabels:s,isDistractionFree:n}=(0,d.useSelect)((e=>({isZoomOut:$(e(g.store)).isZoomOut(),showIconLabels:e(C.store).get("core","showIconLabels"),isDistractionFree:e(C.store).get("core","distractionFree")}))),{resetZoomLevel:o,setZoomLevel:r}=$((0,d.useDispatch)(g.store)),{registerShortcut:i,unregisterShortcut:a}=(0,d.useDispatch)(il.store);(0,p.useEffect)((()=>(i({name:"core/editor/zoom",category:"global",description:(0,fs.__)("Enter or exit zoom out."),keyCombination:{modifier:(0,ll.isAppleOS)()?"primaryShift":"secondary",character:"0"}}),()=>{a("core/editor/zoom")})),[i,a]),(0,il.useShortcut)("core/editor/zoom",(()=>{t?o():r("auto-scaled")}),{isDisabled:n});return(0,c.jsx)(Hn.Button,{accessibleWhenDisabled:!0,disabled:e,onClick:()=>{t?o():r("auto-scaled")},icon:k_,label:(0,fs.__)("Zoom Out"),isPressed:t,size:"compact",showTooltip:!s,className:"editor-zoom-out-toggle"})};const P_={distractionFreeDisabled:{y:"-50px"},distractionFreeHover:{y:0},distractionFreeHidden:{y:"-50px"},visible:{y:0},hidden:{y:0}},j_={distractionFreeDisabled:{x:"-100%"},distractionFreeHover:{x:0},distractionFreeHidden:{x:"-100%"},visible:{x:0},hidden:{x:0}};var E_=function({customSaveButton:e,forceIsDirty:t,forceDisableBlockTools:s,setEntitiesSavedStatesCallback:n,title:o}){const r=(0,m.useViewportMatch)("large"),i=(0,m.useViewportMatch)("medium"),a=(0,m.useMediaQuery)("(max-width: 403px)"),{postType:l,isTextEditor:u,isPublishSidebarOpened:h,showIconLabels:_,hasFixedToolbar:f,hasBlockSelection:b,hasSectionRootClientId:y}=(0,d.useSelect)((e=>{const{get:t}=e(C.store),{getEditorMode:s,getCurrentPostType:n,isPublishSidebarOpened:o}=e(vc),{getBlockSelectionStart:r,getSectionRootClientId:i}=$(e(g.store));return{postType:n(),isTextEditor:"text"===s(),isPublishSidebarOpened:o(),showIconLabels:t("core","showIconLabels"),hasFixedToolbar:t("core","fixedToolbar"),hasBlockSelection:!!r(),hasSectionRootClientId:!!i()}}),[]),x=["post","page","wp_template"].includes(l)&&y,v=[R,I,N].includes(l)||s,[w,S]=(0,p.useState)(!0),k=!a&&(!f||f&&(!b||w)),P=(()=>{const e=(0,Hn.__experimentalUseSlotFills)(Yg);return Boolean(e&&e.length)})();return(0,c.jsxs)("div",{className:"editor-header edit-post-header",children:[P&&(0,c.jsx)(Hn.__unstableMotion.div,{className:"editor-header__back-button",variants:j_,transition:{type:"tween"},children:(0,c.jsx)(Xg.Slot,{})}),(0,c.jsxs)(Hn.__unstableMotion.div,{variants:P_,className:"editor-header__toolbar",transition:{type:"tween"},children:[(0,c.jsx)(o_,{disableBlockTools:s||u}),f&&i&&(0,c.jsx)(s_,{isCollapsed:w,onToggle:S})]}),k&&(0,c.jsx)(Hn.__unstableMotion.div,{className:"editor-header__center",variants:P_,transition:{type:"tween"},children:(0,c.jsx)(Gc,{title:o})}),(0,c.jsxs)(Hn.__unstableMotion.div,{variants:P_,transition:{type:"tween"},className:"editor-header__settings",children:[!e&&!h&&(0,c.jsx)(nh,{forceIsDirty:t}),(0,c.jsx)(y_,{}),(0,c.jsx)(S_,{forceIsAutosaveable:t,disabled:v}),(0,c.jsx)(Mp,{className:"editor-header__post-preview-button",forceIsAutosaveable:t}),r&&x&&(0,c.jsx)(C_,{disabled:s}),(r||!_)&&(0,c.jsx)(Ma.Slot,{scope:"core"}),!e&&(0,c.jsx)(b_,{forceIsDirty:t,setEntitiesSavedStatesCallback:n}),e,(0,c.jsx)(g_,{})]})]})};const{PrivateInserterLibrary:T_}=$(g.privateApis);function B_(){const{blockSectionRootClientId:e,inserterSidebarToggleRef:t,inserter:s,showMostUsedBlocks:n,sidebarIsOpened:o}=(0,d.useSelect)((e=>{const{getInserterSidebarToggleRef:t,getInserter:s,isPublishSidebarOpened:n}=$(e(vc)),{getBlockRootClientId:o,isZoomOut:r,getSectionRootClientId:i}=$(e(g.store)),{get:a}=e(C.store),{getActiveComplementaryArea:l}=e(ja);return{inserterSidebarToggleRef:t(),inserter:s(),showMostUsedBlocks:a("core","mostUsedBlocks"),blockSectionRootClientId:(()=>{if(r()){const e=i();if(e)return e}return o()})(),sidebarIsOpened:!(!l("core")&&!n())}}),[]),{setIsInserterOpened:r}=(0,d.useDispatch)(vc),{disableComplementaryArea:i}=(0,d.useDispatch)(ja),a=(0,m.useViewportMatch)("medium","<"),l=(0,p.useRef)(),u=(0,p.useCallback)((()=>{r(!1),t.current?.focus()}),[t,r]),h=(0,p.useCallback)((e=>{e.keyCode!==ll.ESCAPE||e.defaultPrevented||(e.preventDefault(),u())}),[u]),_=(0,c.jsx)("div",{className:"editor-inserter-sidebar__content",children:(0,c.jsx)(T_,{showMostUsedBlocks:n,showInserterHelpPanel:!0,shouldFocusBlock:a,rootClientId:e,onSelect:s.onSelect,__experimentalInitialTab:s.tab,__experimentalInitialCategory:s.category,__experimentalFilterValue:s.filterValue,onPatternCategorySelection:o?()=>i("core"):void 0,ref:l,onClose:u})});return(0,c.jsx)("div",{onKeyDown:h,className:"editor-inserter-sidebar",children:_})}function I_(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:"editor-list-view-sidebar__outline",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Characters:")}),(0,c.jsx)(Hn.__experimentalText,{children:(0,c.jsx)(Oh,{})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Words:")}),(0,c.jsx)(Ah,{})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Time to read:")}),(0,c.jsx)(Lh,{})]})]}),(0,c.jsx)(ed,{})]})}const{TabbedSidebar:N_}=$(g.privateApis);function R_(){const{setIsListViewOpened:e}=(0,d.useDispatch)(vc),{getListViewToggleRef:t}=$((0,d.useSelect)(vc)),s=(0,m.useFocusOnMount)("firstElement"),n=(0,p.useCallback)((()=>{e(!1),t().current?.focus()}),[t,e]),o=(0,p.useCallback)((e=>{e.keyCode!==ll.ESCAPE||e.defaultPrevented||(e.preventDefault(),n())}),[n]),[r,i]=(0,p.useState)(null),[a,l]=(0,p.useState)("list-view"),u=(0,p.useRef)(),h=(0,p.useRef)(),_=(0,p.useRef)(),f=(0,m.useMergeRefs)([s,_,i]);const b=(0,p.useCallback)((()=>{u.current.contains(u.current.ownerDocument.activeElement)?n():function(e){const t=Uc.focus.tabbable.find(h.current)[0];if("list-view"===e){const e=Uc.focus.tabbable.find(_.current)[0];(u.current.contains(e)?e:t).focus()}else t.focus()}(a)}),[n,a]);return(0,il.useShortcut)("core/editor/toggle-list-view",b),(0,c.jsx)("div",{className:"editor-list-view-sidebar",onKeyDown:o,ref:u,children:(0,c.jsx)(N_,{tabs:[{name:"list-view",title:(0,fs._x)("List View","Post overview"),panel:(0,c.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,c.jsx)("div",{className:"editor-list-view-sidebar__list-view-panel-content",children:(0,c.jsx)(g.__experimentalListView,{dropZoneElement:r})})}),panelRef:f},{name:"outline",title:(0,fs._x)("Outline","Post overview"),panel:(0,c.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,c.jsx)(I_,{})})}],onClose:n,onSelect:e=>l(e),defaultTabId:"list-view",ref:h,closeButtonLabel:(0,fs.__)("Close")})})}const{Fill:D_,Slot:A_}=(0,Hn.createSlotFill)("ActionsPanel");function M_({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:s,forceIsDirtyPublishPanel:n}){const{closePublishSidebar:o,togglePublishSidebar:r}=(0,d.useDispatch)(vc),{publishSidebarOpened:i,isPublishable:a,isDirty:l,hasOtherEntitiesChanges:u}=(0,d.useSelect)((e=>{const{isPublishSidebarOpened:t,isEditedPostPublishable:s,isCurrentPostPublished:n,isEditedPostDirty:o,hasNonPostEntityChanges:r}=e(vc),i=r();return{publishSidebarOpened:t(),isPublishable:!n()&&s(),isDirty:i||o(),hasOtherEntitiesChanges:i}}),[]),m=(0,p.useCallback)((()=>e(!0)),[]);let h;return h=i?(0,c.jsx)(Ym,{onClose:o,forceIsDirty:n,PrePublishExtension:Tu.Slot,PostPublishExtension:vu.Slot}):a&&!u?(0,c.jsx)("div",{className:"editor-layout__toggle-publish-panel",children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:r,"aria-expanded":!1,children:(0,fs.__)("Open publish panel")})}):(0,c.jsx)("div",{className:"editor-layout__toggle-entities-saved-states-panel",children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:m,"aria-expanded":!1,"aria-haspopup":"dialog",disabled:!l,accessibleWhenDisabled:!0,children:(0,fs.__)("Open save panel")})}),(0,c.jsxs)(c.Fragment,{children:[s&&(0,c.jsx)(yd,{close:t,renderDialog:!0}),(0,c.jsx)(A_,{bubblesVirtually:!0}),!s&&h]})}function L_({autoFocus:e=!1}){const{switchEditorMode:t}=(0,d.useDispatch)(vc),{shortcut:s,isRichEditingEnabled:n}=(0,d.useSelect)((e=>{const{getEditorSettings:t}=e(vc),{getShortcutRepresentation:s}=e(il.store);return{shortcut:s("core/editor/toggle-mode"),isRichEditingEnabled:t().richEditingEnabled}}),[]),o=(0,p.useRef)();return(0,p.useEffect)((()=>{e||o?.current?.focus()}),[e]),(0,c.jsxs)("div",{className:"editor-text-editor",children:[n&&(0,c.jsxs)("div",{className:"editor-text-editor__toolbar",children:[(0,c.jsx)("h2",{children:(0,fs.__)("Editing code")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t("visual"),shortcut:s,children:(0,fs.__)("Exit code editor")})]}),(0,c.jsxs)("div",{className:"editor-text-editor__body",children:[(0,c.jsx)(wh,{ref:o}),(0,c.jsx)(gh,{})]})]})}function O_({contentRef:e}){const{onNavigateToEntityRecord:t,templateId:s}=(0,d.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:s}=e(vc);return{onNavigateToEntityRecord:t().onNavigateToEntityRecord,templateId:s()}}),[]),n=(0,d.useSelect)((e=>!!e(u.store).canUser("create",{kind:"postType",name:"wp_template"})),[]),[o,r]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{const t=e=>{n&&e.target.classList.contains("is-root-container")&&"core/template-part"!==e.target.dataset?.type&&(e.defaultPrevented||(e.preventDefault(),r(!0)))},s=e.current;return s?.addEventListener("dblclick",t),()=>{s?.removeEventListener("dblclick",t)}}),[e,n]),n?(0,c.jsx)(Hn.__experimentalConfirmDialog,{isOpen:o,confirmButtonText:(0,fs.__)("Edit template"),onConfirm:()=>{r(!1),t({postId:s,postType:"wp_template"})},onCancel:()=>r(!1),size:"medium",children:(0,fs.__)("You’ve tried to select a block that is part of a template that may be used elsewhere on your site. Would you like to edit the template?")}):null}function F_({direction:e,resizeWidthBy:t}){const s=`resizable-editor__resize-help-${e}`;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.Tooltip,{text:(0,fs.__)("Drag to resize"),children:(0,c.jsx)(Hn.__unstableMotion.button,{className:`editor-resizable-editor__resize-handle is-${e}`,"aria-label":(0,fs.__)("Drag to resize"),"aria-describedby":s,onKeyDown:function(s){const{keyCode:n}=s;n!==ll.LEFT&&n!==ll.RIGHT||(s.preventDefault(),"left"===e&&n===ll.LEFT||"right"===e&&n===ll.RIGHT?t(20):("left"===e&&n===ll.RIGHT||"right"===e&&n===ll.LEFT)&&t(-20))},variants:{active:{opacity:1,scaleY:1.3}},whileFocus:"active",whileHover:"active",whileTap:"active",role:"separator","aria-orientation":"vertical"},"handle")}),(0,c.jsx)(Hn.VisuallyHidden,{id:s,children:(0,fs.__)("Use left and right arrow keys to resize the canvas.")})]})}const V_={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};var U_=function({className:e,enableResizing:t,height:s,children:n}){const[o,r]=(0,p.useState)("100%"),i=(0,p.useRef)(),a=(0,p.useCallback)((e=>{i.current&&r(i.current.offsetWidth+e)}),[]);return(0,c.jsx)(Hn.ResizableBox,{className:mr("editor-resizable-editor",e,{"is-resizable":t}),ref:e=>{i.current=e?.resizable},size:{width:t?o:"100%",height:t&&s?s:"100%"},onResizeStop:(e,t,s)=>{r(s.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{left:t,right:t},showHandle:t,resizeRatio:2,handleComponent:{left:(0,c.jsx)(F_,{direction:"left",resizeWidthBy:a}),right:(0,c.jsx)(F_,{direction:"right",resizeWidthBy:a})},handleClasses:void 0,handleStyles:{left:V_,right:V_},children:n})};function H_(e,t,s){return Math.min(Math.max(e,t),s)}function z_(e,t,s){const n=e-H_(e,s.left,s.right),o=t-H_(t,s.top,s.bottom);return Math.sqrt(n*n+o*o)}function G_({isEnabled:e=!0}={}){const{getEnabledClientIdsTree:t,getBlockName:s,getBlockOrder:n}=$((0,d.useSelect)(g.store)),{selectBlock:o}=(0,d.useDispatch)(g.store);return(0,m.useRefEffect)((r=>{if(!e)return;const i=e=>{(e.target===r||e.target.classList.contains("is-root-container"))&&((e,i)=>{const a=t().flatMap((({clientId:e})=>{const t=s(e);if("core/template-part"===t)return[];if("core/post-content"===t){const t=n(e);if(t.length)return t}return[e]}));let l=1/0,c=null;for(const t of a){const s=r.querySelector(`[data-block="${t}"]`);if(!s)continue;const n=z_(e,i,s.getBoundingClientRect());n<l&&n<500&&(l=n,c=t)}c&&o(c)})(e.clientX,e.clientY)};return r.addEventListener("click",i),()=>r.removeEventListener("click",i)}),[e])}function $_(){const{getSettings:e,isZoomOut:t}=$((0,d.useSelect)(g.store)),{resetZoomLevel:s}=$((0,d.useDispatch)(g.store));return(0,m.useRefEffect)((n=>{function o(n){if(t()&&!n.defaultPrevented){n.preventDefault();const{__experimentalSetIsInserterOpened:t}=e();"function"==typeof t&&t(!1),s()}}return n.addEventListener("dblclick",o),()=>{n.removeEventListener("dblclick",o)}}),[e,t,s])}const{LayoutStyle:W_,useLayoutClasses:Z_,useLayoutStyles:Y_,ExperimentalBlockCanvas:q_,useFlashEditableBlocks:K_}=$(g.privateApis),Q_=[N,B,R,I];function X_(e){for(let t=0;t<e.length;t++){if("core/post-content"===e[t].name)return e[t].attributes;if(e[t].innerBlocks.length){const s=X_(e[t].innerBlocks);if(s)return s}}}function J_(e){for(let t=0;t<e.length;t++)if("core/post-content"===e[t].name)return!0;return!1}var ef=function({autoFocus:e,styles:t,disableIframe:s=!1,iframeProps:n,contentRef:o,className:r}){const i=(0,m.useViewportMatch)("small","<"),{renderingMode:a,postContentAttributes:l,editedPostTemplate:h={},wrapperBlockName:_,wrapperUniqueId:f,deviceType:b,isFocusedEntity:y,isDesignPostType:v,postType:w,isPreview:S,canvasMinHeight:k}=(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s,getCurrentTemplateId:n,getEditorSettings:o,getRenderingMode:r,getDeviceType:i,getCanvasMinHeight:a}=$(e(vc)),{getPostType:l,getEditedEntityRecord:c}=e(u.store),d=s(),p=r();let m;d===N?m="core/block":"post-only"===p&&(m="core/post-content");const h=o(),g=h.supportsTemplateMode,_=l(d),f=n(),b=f?c("postType",B,f):void 0;return{renderingMode:p,postContentAttributes:h.postContentAttributes,isDesignPostType:Q_.includes(d),editedPostTemplate:_?.viewable&&g?b:void 0,wrapperBlockName:m,wrapperUniqueId:t(),deviceType:i(),isFocusedEntity:!!h.onNavigateToPreviousEntityRecord,postType:d,isPreview:h.isPreviewMode,canvasMinHeight:a()}}),[]),{isCleanNewPost:C}=(0,d.useSelect)(vc),{hasRootPaddingAwareAlignments:P,themeHasDisabledLayoutStyles:j,themeSupportsLayout:E,isZoomedOut:T}=(0,d.useSelect)((e=>{const{getSettings:t,isZoomOut:s}=$(e(g.store)),n=t();return{themeHasDisabledLayoutStyles:n.disableLayoutStyles,themeSupportsLayout:n.supportsLayout,hasRootPaddingAwareAlignments:n.__experimentalFeatures?.useRootPaddingAwareAlignments,isZoomedOut:s()}}),[]),D=(0,p.useRef)(),A=(0,g.__experimentalUseResizeCanvas)(b),[M]=(0,g.useSettings)("layout"),L=(0,p.useMemo)((()=>"post-only"!==a||v?{type:"default"}:E?{...M,type:"constrained"}:{type:"default"}),[a,E,M,v]),O=(0,p.useMemo)((()=>{if(!h?.content&&!h?.blocks&&l)return l;if(h?.blocks)return X_(h?.blocks);const e="string"==typeof h?.content?h?.content:"";return X_((0,x.parse)(e))||{}}),[h?.content,h?.blocks,l]),F=(0,p.useMemo)((()=>{if(!h?.content&&!h?.blocks)return!1;if(h?.blocks)return J_(h?.blocks);const e="string"==typeof h?.content?h?.content:"";return J_((0,x.parse)(e))||!1}),[h?.content,h?.blocks]),{layout:V={},align:U=""}=O||{},H=Z_(O,"core/post-content"),z=mr({"is-layout-flow":!E},E&&H,U&&`align${U}`),G=Y_(O,"core/post-content",".block-editor-block-list__layout.is-root-container"),W=(0,p.useMemo)((()=>V&&("constrained"===V?.type||V?.inherit||V?.contentSize||V?.wideSize)?{...M,...V,type:"constrained"}:{...M,...V,type:"default"}),[V?.type,V?.inherit,V?.contentSize,V?.wideSize,M]),Z=l?W:L,Y="default"!==Z?.type||F?Z:L,q=(0,g.__unstableUseTypingObserver)(),K=(0,p.useRef)();(0,p.useEffect)((()=>{e&&C()&&K?.current?.focus()}),[e,C]);const Q=[R,I,N].includes(w)&&!S&&!i&&!T,X=(0,p.useMemo)((()=>{if(!D.current)return k;const{ownerDocument:e}=D.current,t=e.documentElement.scrollTop||e.body.scrollTop;return k+t}),[k]),J=(0,p.useMemo)((()=>[...t??[],{css:`:where(.block-editor-iframe__body){display:flow-root;${X?`min-height:${X}px;`:""}}.is-root-container{display:flow-root;${Q?"min-height:0!important;":""}}\n\t\t\t\t${Q?".block-editor-iframe__html{background:var(--wp-editor-canvas-background);display:flex;align-items:center;justify-content:center;min-height:100vh;}.block-editor-iframe__body{width:100%;}":""}`}]),[t,Q,X]),ee=(0,g.__unstableUseTypewriter)();return o=(0,m.useMergeRefs)([D,o,"post-only"===a?ee:null,K_({isEnabled:"template-locked"===a}),G_({isEnabled:"template-locked"===a}),$_()]),(0,c.jsx)("div",{className:mr("editor-visual-editor","edit-post-visual-editor",r,{"has-padding":y||Q,"is-resizable":Q,"is-iframed":!s}),children:(0,c.jsx)(U_,{enableResizing:Q,height:"100%",children:(0,c.jsxs)(q_,{shouldIframe:!s,contentRef:o,styles:J,height:"100%",iframeProps:{...n,style:{...n?.style,...A}},children:[E&&!j&&"post-only"===a&&!v&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(W_,{selector:".editor-visual-editor__post-title-wrapper",layout:L}),(0,c.jsx)(W_,{selector:".block-editor-block-list__layout.is-root-container",layout:Y}),U&&(0,c.jsx)(W_,{css:".is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}"}),G&&(0,c.jsx)(W_,{layout:W,css:G})]}),"post-only"===a&&!v&&(0,c.jsx)("div",{className:mr("editor-visual-editor__post-title-wrapper","edit-post-visual-editor__post-title-wrapper",{"has-global-padding":P}),contentEditable:!1,ref:q,style:{marginTop:"4rem"},children:(0,c.jsx)(vh,{ref:K})}),(0,c.jsxs)(g.RecursionProvider,{blockName:_,uniqueId:f,children:[(0,c.jsx)(g.BlockList,{className:mr("is-"+b.toLowerCase()+"-preview","post-only"!==a||v?"wp-site-blocks":`${z} wp-block-post-content`,{"has-global-padding":"post-only"===a&&!v&&P}),layout:Z,dropZoneElement:s?D.current:D.current?.parentNode,__unstableDisableDropZone:"template-locked"===a}),"template-locked"===a&&(0,c.jsx)(O_,{contentRef:D})]})]})})})};const tf={header:(0,fs.__)("Editor top bar"),body:(0,fs.__)("Editor content"),sidebar:(0,fs.__)("Editor settings"),actions:(0,fs.__)("Editor publish"),footer:(0,fs.__)("Editor footer")};function sf({className:e,styles:t,children:s,forceIsDirty:n,contentRef:o,disableIframe:r,autoFocus:i,customSaveButton:a,customSavePanel:l,forceDisableBlockTools:u,title:h,iframeProps:_}){const{mode:f,isInserterOpened:b,isListViewOpened:y,isDistractionFree:x,isPreviewMode:v,showBlockBreadcrumbs:w,documentLabel:S}=(0,d.useSelect)((e=>{const{get:t}=e(C.store),{getEditorSettings:s,getPostTypeLabel:n}=e(vc),o=s(),r=n();let i=e(vc).getEditorMode();return o.richEditingEnabled||"visual"!==i||(i="text"),o.codeEditingEnabled||"text"!==i||(i="visual"),{mode:i,isInserterOpened:e(vc).isInserterOpened(),isListViewOpened:e(vc).isListViewOpened(),isDistractionFree:t("core","distractionFree"),isPreviewMode:o.isPreviewMode,showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),documentLabel:r||(0,fs._x)("Document","noun, breadcrumb")}}),[]),k=(0,m.useViewportMatch)("medium"),P=y?(0,fs.__)("Document Overview"):(0,fs.__)("Block Library"),[j,E]=(0,p.useState)(!1),T=(0,p.useCallback)((e=>{"function"==typeof j&&j(e),E(!1)}),[j]);return(0,c.jsx)(Wa,{isDistractionFree:x,className:mr("editor-editor-interface",e,{"is-entity-save-view-open":!!j,"is-distraction-free":x&&!v}),labels:{...tf,secondarySidebar:P},header:!v&&(0,c.jsx)(E_,{forceIsDirty:n,setEntitiesSavedStatesCallback:E,customSaveButton:a,forceDisableBlockTools:u,title:h}),editorNotices:(0,c.jsx)(ld,{}),secondarySidebar:!v&&"visual"===f&&(b&&(0,c.jsx)(B_,{})||y&&(0,c.jsx)(R_,{})),sidebar:!v&&!x&&(0,c.jsx)(Va.Slot,{scope:"core"}),content:(0,c.jsxs)(c.Fragment,{children:[!x&&!v&&(0,c.jsx)(ld,{}),(0,c.jsx)(Zg.Slot,{children:([e])=>e||(0,c.jsxs)(c.Fragment,{children:[!v&&"text"===f&&(0,c.jsx)(L_,{autoFocus:i}),!v&&!k&&"visual"===f&&(0,c.jsx)(g.BlockToolbar,{hideDragHandle:!0}),(v||"visual"===f)&&(0,c.jsx)(ef,{styles:t,contentRef:o,disableIframe:r,autoFocus:i,iframeProps:_}),s]})})]}),footer:!v&&!x&&k&&w&&"visual"===f&&(0,c.jsx)(g.BlockBreadcrumb,{rootLabelText:S}),actions:v?void 0:l||(0,c.jsx)(M_,{closeEntitiesSavedStates:T,isEntitiesSavedStatesOpen:j,setEntitiesSavedStatesCallback:E,forceIsDirtyPublishPanel:n})})}const{OverridesPanel:nf}=$(ao.privateApis);function of(){return(0,d.useSelect)((e=>"wp_block"===e(vc).getCurrentPostType()),[])?(0,c.jsx)(nf,{}):null}function rf(e){return"string"==typeof e.title?(0,Ln.decodeEntities)(e.title):e.title&&"rendered"in e.title?(0,Ln.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title?(0,Ln.decodeEntities)(e.title.raw):""}const af=({items:e,closeModal:t})=>{const[s]=e,n=rf(s),{showOnFront:o,currentHomePage:r,isSaving:i}=(0,d.useSelect)((e=>{const{getEntityRecord:t,isSavingEntityRecord:s}=e(u.store),n=t("root","site"),o=t("postType","page",n?.page_on_front);return{showOnFront:n?.show_on_front,currentHomePage:o,isSaving:s("root","site")}})),{saveEntityRecord:a}=(0,d.useDispatch)(u.store),{createSuccessNotice:l,createErrorNotice:p}=(0,d.useDispatch)(_s.store);let m="";"posts"===o?m=(0,fs.__)("This will replace the current homepage which is set to display latest posts."):r&&(m=(0,fs.sprintf)((0,fs.__)('This will replace the current homepage: "%s"'),rf(r)));const h=(0,fs.sprintf)((0,fs.__)('Set "%1$s" as the site homepage? %2$s'),n,m).trim(),g=(0,fs.__)("Set homepage");return(0,c.jsx)("form",{onSubmit:async function(e){e.preventDefault();try{await a("root","site",{page_on_front:s.id,show_on_front:"page"}),l((0,fs.__)("Homepage updated."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while setting the homepage.");p(t,{type:"snackbar"})}finally{t?.()}},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:h}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:i,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:i,accessibleWhenDisabled:!0,children:g})]})]})})},lf=({items:e,closeModal:t})=>{const[s]=e,n=rf(s),{currentPostsPage:o,isPageForPostsSet:r,isSaving:i}=(0,d.useSelect)((e=>{const{getEntityRecord:t,isSavingEntityRecord:s}=e(u.store),n=t("root","site");return{currentPostsPage:t("postType","page",n?.page_for_posts),isPageForPostsSet:0!==n?.page_for_posts,isSaving:s("root","site")}})),{saveEntityRecord:a}=(0,d.useDispatch)(u.store),{createSuccessNotice:l,createErrorNotice:p}=(0,d.useDispatch)(_s.store);const m=r&&o?(0,fs.sprintf)((0,fs.__)('This will replace the current posts page: "%s"'),rf(o)):(0,fs.__)("This page will show the latest posts."),h=(0,fs.sprintf)((0,fs.__)('Set "%1$s" as the posts page? %2$s'),n,m),g=(0,fs.__)("Set posts page");return(0,c.jsx)("form",{onSubmit:async function(e){e.preventDefault();try{await a("root","site",{page_for_posts:s.id,show_on_front:"page"}),l((0,fs.__)("Posts page updated."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while setting the posts page.");p(t,{type:"snackbar"})}finally{t?.()}},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:h}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:i,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:i,accessibleWhenDisabled:!0,children:g})]})]})})};function cf({postType:e,onActionPerformed:t,context:s}){const{defaultActions:n}=(0,d.useSelect)((t=>{const{getEntityActions:s}=$(t(vc));return{defaultActions:s("postType",e)}}),[e]),o=(0,d.useSelect)((t=>{if("page"!==e)return!1;const{getDefaultTemplateId:s,getEntityRecord:n,canUser:o}=t(u.store);if(!o("update",{kind:"root",name:"site"}))return!1;const r=s({slug:"front-page"});if(!r)return!0;const i=n("postType","wp_template",r);return!i||"front-page"!==i.slug}),[e]),r=(()=>{const{pageOnFront:e,pageForPosts:t}=(0,d.useSelect)((e=>{const{getEntityRecord:t,canUser:s}=e(u.store),n=s("read",{kind:"root",name:"site"})?t("root","site"):void 0;return{pageOnFront:n?.page_on_front,pageForPosts:n?.page_for_posts}}));return(0,p.useMemo)((()=>({id:"set-as-homepage",label:(0,fs.__)("Set as homepage"),isEligible:s=>"publish"===s.status&&"page"===s.type&&e!==s.id&&t!==s.id,modalFocusOnMount:"firstContentElement",RenderModal:af})),[t,e])})(),i=(()=>{const{pageOnFront:e,pageForPosts:t}=(0,d.useSelect)((e=>{const{getEntityRecord:t,canUser:s}=e(u.store),n=s("read",{kind:"root",name:"site"})?t("root","site"):void 0;return{pageOnFront:n?.page_on_front,pageForPosts:n?.page_for_posts}}));return(0,p.useMemo)((()=>({id:"set-as-posts-page",label:(0,fs.__)("Set as posts page"),isEligible:s=>"publish"===s.status&&"page"===s.type&&e!==s.id&&t!==s.id,modalFocusOnMount:"firstContentElement",RenderModal:lf})),[t,e])})(),{registerPostTypeSchema:a}=$((0,d.useDispatch)(vc));return(0,p.useEffect)((()=>{a(e)}),[a,e]),(0,p.useMemo)((()=>{let e=[...n];if(o&&e.push(r,i),e=e.sort(((e,t)=>"move-to-trash"===t.id?-1:0)),e=e.filter((e=>!e.context||e.context===s)),t)for(let s=0;s<e.length;++s){if(e[s].callback){const n=e[s].callback;e[s]={...e[s],callback:(o,r)=>{n(o,{...r,onActionPerformed:n=>{r?.onActionPerformed&&r.onActionPerformed(n),t(e[s].id,n)}})}}}if(e[s].RenderModal){const n=e[s].RenderModal;e[s]={...e[s],RenderModal:o=>(0,c.jsx)(n,{...o,onActionPerformed:n=>{o.onActionPerformed&&o.onActionPerformed(n),t(e[s].id,n)}})}}}return e}),[s,n,t,r,i,o])}const{Menu:df,kebabCase:uf}=$(Hn.privateApis);function pf({postType:e,postId:t,onActionPerformed:s}){const[n,o]=(0,p.useState)(null),{item:r,permissions:i}=(0,d.useSelect)((s=>{const{getEditedEntityRecord:n,getEntityRecordPermissions:o}=$(s(u.store));return{item:n("postType",e,t),permissions:o("postType",e,t)}}),[t,e]),a=(0,p.useMemo)((()=>({...r,permissions:i})),[r,i]),l=cf({postType:e,onActionPerformed:s}),m=(0,p.useMemo)((()=>l.filter((e=>!e.isEligible||e.isEligible(a)))),[l,a]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(df,{placement:"bottom-end",children:[(0,c.jsx)(df.TriggerButton,{render:(0,c.jsx)(Hn.Button,{size:"small",icon:r_,label:(0,fs.__)("Actions"),disabled:!m.length,accessibleWhenDisabled:!0,className:"editor-all-actions-button"})}),(0,c.jsx)(df.Popover,{children:(0,c.jsx)(gf,{actions:m,items:[a],setActiveModalAction:o})})]}),!!n&&(0,c.jsx)(hf,{action:n,items:[a],closeModal:()=>o(null)})]})}function mf({action:e,onClick:t,items:s}){const n="string"==typeof e.label?e.label:e.label(s);return(0,c.jsx)(df.Item,{onClick:t,children:(0,c.jsx)(df.ItemLabel,{children:n})})}function hf({action:e,items:t,closeModal:s}){const n="string"==typeof e.label?e.label:e.label(t);return(0,c.jsx)(Hn.Modal,{title:e.modalHeader||n,__experimentalHideHeader:!!e.hideModalHeader,onRequestClose:s??(()=>{}),focusOnMount:"firstContentElement",size:"medium",overlayClassName:`editor-action-modal editor-action-modal__${uf(e.id)}`,children:(0,c.jsx)(e.RenderModal,{items:t,closeModal:s})})}function gf({actions:e,items:t,setActiveModalAction:s}){const n=(0,d.useRegistry)();return(0,c.jsx)(df.Group,{children:e.map((e=>(0,c.jsx)(mf,{action:e,onClick:()=>{"RenderModal"in e?s(e):e.callback(t,{registry:n})},items:t},e.id)))})}const{Badge:_f}=$(Hn.privateApis);function ff({postType:e,postId:t,onActionPerformed:s}){const n=(0,p.useMemo)((()=>Array.isArray(t)?t:[t]),[t]),{postTitle:o,icon:r,labels:i}=(0,d.useSelect)((t=>{const{getEditedEntityRecord:s,getCurrentTheme:o,getPostType:r}=t(u.store),{getPostIcon:i}=$(t(vc));let a="";const l=s("postType",e,n[0]);if(1===n.length){const{default_template_types:t=[]}=o()??{},s=[B,I].includes(e)?Y({template:l,templateTypes:t}):{};a=s?.title||l?.title}return{postTitle:a,icon:i(e,{area:l?.area}),labels:r(e)?.labels}}),[n,e]),a=Hc(t);let l=(0,fs.__)("No title");return i?.name&&n.length>1?l=(0,fs.sprintf)((0,fs.__)("%1$d %2$s"),n.length,i?.name):o&&(l=(0,Uc.__unstableStripHTML)(o)),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:1,className:"editor-post-card-panel",children:[(0,c.jsxs)(Hn.__experimentalHStack,{spacing:2,className:"editor-post-card-panel__header",align:"flex-start",children:[(0,c.jsx)(Hn.Icon,{className:"editor-post-card-panel__icon",icon:r}),(0,c.jsxs)(Hn.__experimentalText,{numberOfLines:2,truncate:!0,className:"editor-post-card-panel__title",as:"h2",children:[(0,c.jsx)("span",{className:"editor-post-card-panel__title-name",children:l}),a&&1===n.length&&(0,c.jsx)(_f,{children:a})]}),1===n.length&&(0,c.jsx)(pf,{postType:e,postId:n[0],onActionPerformed:s})]}),n.length>1&&(0,c.jsx)(Hn.__experimentalText,{className:"editor-post-card-panel__description",children:(0,fs.sprintf)((0,fs.__)("Changes will be applied to all selected %s."),i?.name.toLowerCase())})]})}function bf(){const{postContent:e}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s,getCurrentPostId:n}=e(vc),{canUser:o}=e(u.store),{getEntityRecord:r}=e(u.store),i=o("read",{kind:"root",name:"site"})?r("root","site"):void 0,a=s();return{postContent:!(+n()===i?.page_for_posts)&&![B,I].includes(a)&&t("content")}}),[]),t=(0,fs._x)("words","Word count type. Do not translate!"),s=(0,p.useMemo)((()=>e?(0,Dh.count)(e,t):0),[e,t]);if(!s)return null;const n=Math.round(s/189),o=(0,fs.sprintf)((0,fs._n)("%s word","%s words",s),s.toLocaleString()),r=n<=1?(0,fs.__)("1 minute"):(0,fs.sprintf)((0,fs._n)("%s minute","%s minutes",n),n.toLocaleString());return(0,c.jsx)("div",{className:"editor-post-content-information",children:(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.sprintf)((0,fs.__)("%1$s, %2$s read time."),o,r)})})}var yf=function(){const{postFormat:e}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc);return{postFormat:t("format")??"standard"}}),[]),t=Pp.find((t=>t.id===e)),[s,n]=(0,p.useState)(null),o=(0,p.useMemo)((()=>({anchor:s,placement:"left-start",offset:36,shift:!0})),[s]);return(0,c.jsx)(Cp,{children:(0,c.jsx)(Rd,{label:(0,fs.__)("Format"),ref:n,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:o,contentClassName:"editor-post-format__dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change format: %s"),t?.caption),onClick:s,children:t?.caption}),renderContent:({onClose:e})=>(0,c.jsxs)("div",{className:"editor-post-format__dialog-content",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Format"),onClose:e}),(0,c.jsx)(jp,{})]})})})})};function xf(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("modified")),[]),t=e&&(0,fs.sprintf)((0,fs.__)("Last edited %s."),(0,v.humanTimeDiff)(e));return t?(0,c.jsx)("div",{className:"editor-post-last-edited-panel",children:(0,c.jsx)(Hn.__experimentalText,{children:t})}):null}var vf=function({className:e,children:t}){return(0,c.jsx)(Hn.__experimentalVStack,{className:mr("editor-post-panel__section",e),children:t})};const wf={};function Sf(){const{editEntityRecord:e}=(0,d.useDispatch)(u.store),{postsPageTitle:t,postsPageId:s,isTemplate:n,postSlug:o}=(0,d.useSelect)((e=>{const{getEntityRecord:t,getEditedEntityRecord:s,canUser:n}=e(u.store),o=n("read",{kind:"root",name:"site"})?t("root","site"):void 0,r=o?.page_for_posts?s("postType","page",o?.page_for_posts):wf,{getEditedPostAttribute:i,getCurrentPostType:a}=e(vc);return{postsPageId:r?.id,postsPageTitle:r?.title,isTemplate:a()===B,postSlug:i("slug")}}),[]),[r,i]=(0,p.useState)(null),a=(0,p.useMemo)((()=>({anchor:r,placement:"left-start",offset:36,shift:!0})),[r]);if(!n||!["home","index"].includes(o)||!s)return null;const l=t=>{e("postType","page",s,{title:t})},h=(0,Ln.decodeEntities)(t);return(0,c.jsx)(Rd,{label:(0,fs.__)("Blog title"),ref:i,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:a,contentClassName:"editor-blog-title-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change blog title: %s"),h),onClick:t,children:h}),renderContent:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Blog title"),onClose:e}),(0,c.jsx)(Hn.__experimentalInputControl,{placeholder:(0,fs.__)("No title"),size:"__unstable-large",value:t,onChange:(0,m.debounce)(l,300),label:(0,fs.__)("Blog title"),help:(0,fs.__)("Set the Posts Page title. Appears in search results, and when the page is shared on social media."),hideLabelFromVision:!0})]})})})}function kf(){const{editEntityRecord:e}=(0,d.useDispatch)(u.store),{postsPerPage:t,isTemplate:s,postSlug:n}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s}=e(vc),{getEditedEntityRecord:n,canUser:o}=e(u.store),r=o("read",{kind:"root",name:"site"})?n("root","site"):void 0;return{isTemplate:s()===B,postSlug:t("slug"),postsPerPage:r?.posts_per_page||1}}),[]),[o,r]=(0,p.useState)(null),i=(0,p.useMemo)((()=>({anchor:o,placement:"left-start",offset:36,shift:!0})),[o]);if(!s||!["home","index"].includes(n))return null;const a=t=>{e("root","site",void 0,{posts_per_page:t})};return(0,c.jsx)(Rd,{label:(0,fs.__)("Posts per page"),ref:r,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:i,contentClassName:"editor-posts-per-page-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Change posts per page"),onClick:s,children:t}),renderContent:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Posts per page"),onClose:e}),(0,c.jsx)(Hn.__experimentalNumberControl,{placeholder:0,value:t,size:"__unstable-large",spinControls:"custom",step:"1",min:"1",onChange:a,label:(0,fs.__)("Posts per page"),help:(0,fs.__)("Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting."),hideLabelFromVision:!0})]})})})}const Cf=[{label:(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:(0,fs.__)("Visitors can add new comments and replies.")},{label:(0,fs.__)("Closed"),value:"",description:[(0,fs.__)("Visitors cannot add new comments or replies."),(0,fs.__)("Existing comments remain visible.")].join(" ")}];function Pf(){const{editEntityRecord:e}=(0,d.useDispatch)(u.store),{allowCommentsOnNewPosts:t,isTemplate:s,postSlug:n}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s}=e(vc),{getEditedEntityRecord:n,canUser:o}=e(u.store),r=o("read",{kind:"root",name:"site"})?n("root","site"):void 0;return{isTemplate:s()===B,postSlug:t("slug"),allowCommentsOnNewPosts:r?.default_comment_status||""}}),[]),[o,r]=(0,p.useState)(null),i=(0,p.useMemo)((()=>({anchor:o,placement:"left-start",offset:36,shift:!0})),[o]);if(!s||!["home","index"].includes(n))return null;const a=t=>{e("root","site",void 0,{default_comment_status:t?"open":null})};return(0,c.jsx)(Rd,{label:(0,fs.__)("Discussion"),ref:r,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:i,contentClassName:"editor-site-discussion-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Change discussion settings"),onClick:s,children:t?(0,fs.__)("Comments open"):(0,fs.__)("Comments closed")}),renderContent:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Discussion"),onClose:e}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:3,children:[(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Changes will apply to new posts only. Individual posts may override these settings.")}),(0,c.jsx)(Hn.RadioControl,{className:"editor-site-discussion__options",hideLabelFromVision:!0,label:(0,fs.__)("Comment status"),options:Cf,onChange:a,selected:t})]})]})})})}function jf({onActionPerformed:e}){const{isRemovedPostStatusPanel:t,postType:s,postId:n}=(0,d.useSelect)((e=>{const{isEditorPanelRemoved:t,getCurrentPostType:s,getCurrentPostId:n}=e(vc);return{isRemovedPostStatusPanel:t("post-status"),postType:s(),postId:n()}}),[]);return(0,c.jsx)(vf,{className:"editor-post-summary",children:(0,c.jsx)(Cu.Slot,{children:o=>(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:4,children:[(0,c.jsx)(ff,{postType:s,postId:n,onActionPerformed:e}),(0,c.jsx)(kp,{withPanelBody:!1}),(0,c.jsx)(pp,{}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:1,children:[(0,c.jsx)(bf,{}),(0,c.jsx)(xf,{})]}),!t&&(0,c.jsxs)(Hn.__experimentalVStack,{spacing:4,children:[(0,c.jsxs)(Hn.__experimentalVStack,{spacing:1,children:[(0,c.jsx)(sh,{}),(0,c.jsx)(ih,{}),(0,c.jsx)(Th,{}),(0,c.jsx)(qu,{}),(0,c.jsx)(Vu,{}),(0,c.jsx)(sp,{}),(0,c.jsx)(Bp,{}),(0,c.jsx)(Wd,{}),(0,c.jsx)(lh,{}),(0,c.jsx)(Sf,{}),(0,c.jsx)(kf,{}),(0,c.jsx)(Pf,{}),(0,c.jsx)(yf,{}),o]}),(0,c.jsx)(kh,{onActionPerformed:e})]})]})})})})}const{EXCLUDED_PATTERN_SOURCES:Ef,PATTERN_TYPES:Tf}=$(ao.privateApis);function Bf(e,t){return e.innerBlocks=e.innerBlocks.map((e=>Bf(e,t))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=t),e}function If(e,t){return e.filter(((e,s,n)=>((e,t,s)=>t===s.findIndex((t=>e.name===t.name)))(e,s,n)&&(e=>!Ef.includes(e.source))(e)&&(e=>e.templateTypes?.includes(t.slug)||e.blockTypes?.includes("core/template-part/"+t.area))(e)))}function Nf(e,t){return e.map((e=>({...e,keywords:e.keywords||[],type:Tf.theme,blocks:(0,x.parse)(e.content,{__unstableSkipMigrationLogs:!0}).map((e=>Bf(e,t)))})))}function Rf({availableTemplates:e,onSelect:t}){return e&&0!==e?.length?(0,c.jsx)(g.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:e,onClickPattern:t,showTitlesAsTooltip:!0}):null}function Df(){const{area:e,name:t,slug:s,postType:n,postId:o}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc),{getEditedEntityRecord:n}=e(u.store),o=t(),r=s(),i=n("postType",o,r);return{area:i?.area,name:i?.name,slug:i?.slug,postType:o,postId:r}}),[]),{editEntityRecord:r}=(0,d.useDispatch)(u.store),i=function({area:e,name:t,slug:s}){const{blockPatterns:n,restBlockPatterns:o,currentThemeStylesheet:r}=(0,d.useSelect)((e=>{const{getEditorSettings:t}=e(vc),s=t();return{blockPatterns:s.__experimentalAdditionalBlockPatterns??s.__experimentalBlockPatterns,restBlockPatterns:e(u.store).getBlockPatterns(),currentThemeStylesheet:e(u.store).getCurrentTheme().stylesheet}}),[]);return(0,p.useMemo)((()=>Nf(If([...n||[],...o||[]],{area:e,name:t,slug:s}),r)),[e,t,s,n,o,r])}({area:e,name:t,slug:s});return i?.length?(0,c.jsx)(Hn.PanelBody,{title:(0,fs.__)("Design"),initialOpen:n===I,children:(0,c.jsx)(Rf,{availableTemplates:i,onSelect:async e=>{await r("postType",n,o,{blocks:e.blocks,content:(0,x.serialize)(e.blocks)})}})}):null}function Af(){const{postType:e}=(0,d.useSelect)((e=>{const{getCurrentPostType:t}=e(vc);return{postType:t()}}),[]);return[I,B].includes(e)?(0,c.jsx)(Df,{}):null}const Mf={document:"edit-post/document",block:"edit-post/block"},{Tabs:Lf}=$(Hn.privateApis);var Of=(0,p.forwardRef)(((e,t)=>{const{documentLabel:s}=(0,d.useSelect)((e=>{const{getPostTypeLabel:t}=e(vc);return{documentLabel:t()||(0,fs._x)("Document","noun, panel")}}),[]);return(0,c.jsxs)(Lf.TabList,{ref:t,children:[(0,c.jsx)(Lf.Tab,{tabId:Mf.document,"data-tab-id":Mf.document,children:s}),(0,c.jsx)(Lf.Tab,{tabId:Mf.block,"data-tab-id":Mf.block,children:(0,fs.__)("Block")})]})}));const{BlockQuickNavigation:Ff}=$(g.privateApis),Vf=["core/post-title","core/post-featured-image","core/post-content"];function Uf(){const e=(0,p.useMemo)((()=>(0,h.applyFilters)("editor.postContentBlockTypes",Vf)),[]),{clientIds:t,postType:s,renderingMode:n}=(0,d.useSelect)((t=>{const{getCurrentPostType:s,getPostBlocksByName:n,getRenderingMode:o}=$(t(vc)),r=s();return{postType:r,clientIds:n(B===r?"core/template-part":e),renderingMode:o()}}),[e]),{enableComplementaryArea:o}=(0,d.useDispatch)(ja);return"post-only"===n&&s!==B||0===t.length?null:(0,c.jsx)(Hn.PanelBody,{title:(0,fs.__)("Content"),children:(0,c.jsx)(Ff,{clientIds:t,onSelect:()=>{o("core","edit-post/document")}})})}const{BlockQuickNavigation:Hf}=$(g.privateApis);function zf(){const e=(0,d.useSelect)((e=>{const{getBlockTypes:t}=e(x.store);return t()}),[]),t=(0,p.useMemo)((()=>e.filter((e=>"theme"===e.category)).map((({name:e})=>e))),[e]),s=(0,d.useSelect)((e=>{const{getBlocksByName:s}=e(g.store);return s(t)}),[t]);return 0===s.length?null:(0,c.jsx)(Hn.PanelBody,{title:(0,fs.__)("Content"),children:(0,c.jsx)(Hf,{clientIds:s})})}function Gf(){const e=(0,d.useSelect)((e=>{const{getCurrentPostType:t}=e(vc);return t()}),[]);return e!==I?null:(0,c.jsx)(zf,{})}var $f=function(){const{hasBlockSelection:e}=(0,d.useSelect)((e=>({hasBlockSelection:!!e(g.store).getBlockSelectionStart()})),[]),{getActiveComplementaryArea:t}=(0,d.useSelect)(ja),{enableComplementaryArea:s}=(0,d.useDispatch)(ja),{get:n}=(0,d.useSelect)(C.store);(0,p.useEffect)((()=>{const o=t("core"),r=["edit-post/document","edit-post/block"].includes(o),i=n("core","distractionFree");r&&!i&&s("core",e?"edit-post/block":"edit-post/document")}),[e,t,s,n])};const{Tabs:Wf}=$(Hn.privateApis),Zf=p.Platform.select({web:!0,native:!1}),Yf=({tabName:e,keyboardShortcut:t,onActionPerformed:s,extraPanels:n})=>{const o=(0,p.useRef)(null),r=(0,p.useContext)(Wf.Context);return(0,p.useEffect)((()=>{const t=Array.from(o.current?.querySelectorAll('[role="tab"]')||[]),s=t.find((t=>t.getAttribute("data-tab-id")===e)),n=s?.ownerDocument.activeElement;t.some((e=>n&&n.id===e.id))&&s&&s.id!==n?.id&&s?.focus()}),[e]),(0,c.jsx)(Iu,{identifier:e,header:(0,c.jsx)(Wf.Context.Provider,{value:r,children:(0,c.jsx)(Of,{ref:o})}),closeLabel:(0,fs.__)("Close Settings"),className:"editor-sidebar__panel",headerClassName:"editor-sidebar__panel-tabs",title:(0,fs._x)("Settings","panel button label"),toggleShortcut:t,icon:(0,fs.isRTL)()?Yi:qi,isActiveByDefault:Zf,children:(0,c.jsxs)(Wf.Context.Provider,{value:r,children:[(0,c.jsxs)(Wf.TabPanel,{tabId:Mf.document,focusable:!1,children:[(0,c.jsx)(jf,{onActionPerformed:s}),(0,c.jsx)(gu.Slot,{}),(0,c.jsx)(Uf,{}),(0,c.jsx)(Gf,{}),(0,c.jsx)(Af,{}),(0,c.jsx)(mh,{}),(0,c.jsx)(of,{}),n]}),(0,c.jsx)(Wf.TabPanel,{tabId:Mf.block,focusable:!1,children:(0,c.jsx)(g.BlockInspector,{})})]})})};var qf=({extraPanels:e,onActionPerformed:t})=>{$f();const{tabName:s,keyboardShortcut:n,showSummary:o}=(0,d.useSelect)((e=>{const t=e(il.store).getShortcutRepresentation("core/editor/toggle-sidebar"),s=e(ja).getActiveComplementaryArea("core");let n=s;return[Mf.block,Mf.document].includes(s)||(n=e(g.store).getBlockSelectionStart()?Mf.block:Mf.document),{tabName:n,keyboardShortcut:t,showSummary:![B,I,R].includes(e(vc).getCurrentPostType())}}),[]),{enableComplementaryArea:r}=(0,d.useDispatch)(ja),i=(0,p.useCallback)((e=>{e&&r("core",e)}),[r]);return(0,c.jsx)(Wf,{selectedTabId:s,onSelect:i,selectOnMove:!1,children:(0,c.jsx)(Yf,{tabName:s,keyboardShortcut:n,showSummary:o,onActionPerformed:t,extraPanels:e})})},Kf=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"})});const Qf="edit-post/collab-history-sidebar",Xf="edit-post/collab-sidebar",Jf=[Qf,Xf];function eb(){}const tb=["#3858E9","#9fB1FF","#1D35B4","#1A1919","#E26F56","#33F078","#FFF972","#7A00DF"];function sb(e){return tb[e%tb.length]}function nb(e,t,s){if(!t)return;const n=e?`[role=treeitem][id="comment-thread-${e}"]`:"[role=treeitem]:not([id])",o=s?`${n} ${s}`:n;return new Promise((e=>{if(t.querySelector(o))return e(t.querySelector(o));let s=null;const n=new window.MutationObserver((()=>{t.querySelector(o)&&(clearTimeout(s),n.disconnect(),e(t.querySelector(o)))}));n.observe(t,{childList:!0,subtree:!0}),s=setTimeout((()=>{n.disconnect(),e(null)}),3e3)})).then((e=>e?.focus()))}var ob=function({avatar:e,name:t,date:s,userId:n}){const o=!!e,r=(0,v.getSettings)(),{currentUserAvatar:i,currentUserName:a,currentUserId:l,dateFormat:p=r.formats.date}=(0,d.useSelect)((e=>{const{canUser:t,getCurrentUser:s,getEntityRecord:n}=e(u.store),r=t("read",{kind:"root",name:"site"})?n("root","site"):void 0;if(o)return{dateFormat:r?.date_format};const{getSettings:i}=e(g.store),{__experimentalDiscussionSettings:a}=i(),l=a?.avatarURL,c=s();return{currentUserAvatar:c?.avatar_urls?.[48]??l,currentUserName:c?.name,currentUserId:c?.id,dateFormat:r?.date_format}}),[o]),m=(0,v.getDate)(s),h=(0,v.dateI18n)("c",m),_=Math.floor((new Date-m)/864e5)<30?(0,v.humanTimeDiff)(m):(0,v.dateI18n)(p,m),f=(0,v.dateI18n)((0,fs._x)("F j, Y g:i a","Note date full date format"),s);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("img",{src:e||i,className:"editor-collab-sidebar-panel__user-avatar",alt:(0,fs.__)("User avatar"),width:32,height:32,style:{borderColor:sb(n??l)}}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"0",children:[(0,c.jsx)("span",{className:"editor-collab-sidebar-panel__user-name",children:t??a}),s&&(0,c.jsx)(Hn.Tooltip,{text:f,children:(0,c.jsx)("time",{dateTime:h,className:"editor-collab-sidebar-panel__user-time",children:_})})]})]})};var rb=function e({onSubmit:t,onCancel:s,thread:n,submitButtonText:o,labelText:r,reflowComments:i=eb}){const[a,l]=(0,p.useState)(n?.content?.raw??""),d=(0,m.useDebounce)(i,100),u=(0,m.useInstanceId)(e,"comment-input"),h=a===n?.content?.raw||!(g=a,g.trim()).length;var g;return(0,c.jsxs)(Hn.__experimentalVStack,{className:"editor-collab-sidebar-panel__comment-form",spacing:"4",as:"form",onSubmit:e=>{e.preventDefault(),t(a),l("")},children:[(0,c.jsx)(Hn.VisuallyHidden,{as:"label",htmlFor:u,children:r??(0,fs.__)("Note")}),(0,c.jsx)(hh.A,{id:u,value:a??"",onChange:e=>{var t;t=e.target.value,l(t),d()},rows:1,maxRows:20,onKeyDown:e=>{ll.isKeyboardEvent.primary(e,"Enter")&&!h&&e.target.parentNode.requestSubmit()}}),(0,c.jsxs)(Hn.__experimentalHStack,{spacing:"2",justify:"flex-end",wrap:!0,children:[(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary",onClick:s,children:(0,c.jsx)(Hn.__experimentalTruncate,{children:(0,fs.__)("Cancel")})}),(0,c.jsx)(Hn.Button,{size:"compact",accessibleWhenDisabled:!0,variant:"primary",type:"submit",disabled:h,children:(0,c.jsx)(Hn.__experimentalTruncate,{children:o})})]})]})};Math.min,Math.max,Math.round,Math.floor;function ib(e){return e.split("-")[0]}function ab(e){return e.split("-")[1]}function lb(e){return"y"===e?"height":"width"}function cb(e){return["top","bottom"].includes(ib(e))?"y":"x"}function db(e){return"x"===cb(e)?"y":"x"}function ub(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function pb(e,t,s){let{reference:n,floating:o}=e;const r=cb(t),i=db(t),a=lb(i),l=ib(t),c="y"===r,d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,p=n[a]/2-o[a]/2;let m;switch(l){case"top":m={x:d,y:n.y-o.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:u};break;case"left":m={x:n.x-o.width,y:u};break;default:m={x:n.x,y:n.y}}switch(ab(t)){case"start":m[i]-=p*(s&&c?-1:1);break;case"end":m[i]+=p*(s&&c?-1:1)}return m}const mb=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:s,y:n}=t,o=await async function(e,t){const{placement:s,platform:n,elements:o}=e,r=await(null==n.isRTL?void 0:n.isRTL(o.floating)),i=ib(s),a=ab(s),l="y"===cb(s),c=["left","top"].includes(i)?-1:1,d=r&&l?-1:1,u=(m=e,"function"==typeof(p=t)?p(m):p);var p,m;let{mainAxis:h,crossAxis:g,alignmentAxis:_}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&"number"==typeof _&&(g="end"===a?-1*_:_),l?{x:g*d,y:h*c}:{x:h*c,y:g*d}}(t,e);return{x:s+o.x,y:n+o.y,data:o}}}},hb=Math.min,gb=Math.max,_b=Math.round,fb=Math.floor,bb=e=>({x:e,y:e});function yb(){return"undefined"!=typeof window}function xb(e){return Sb(e)?(e.nodeName||"").toLowerCase():"#document"}function vb(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function wb(e){var t;return null==(t=(Sb(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Sb(e){return!!yb()&&(e instanceof Node||e instanceof vb(e).Node)}function kb(e){return!!yb()&&(e instanceof Element||e instanceof vb(e).Element)}function Cb(e){return!!yb()&&(e instanceof HTMLElement||e instanceof vb(e).HTMLElement)}function Pb(e){return!(!yb()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof vb(e).ShadowRoot)}function jb(e){const{overflow:t,overflowX:s,overflowY:n,display:o}=Rb(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+s)&&!["inline","contents"].includes(o)}function Eb(e){return["table","td","th"].includes(xb(e))}function Tb(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Bb(e){const t=Ib(),s=kb(e)?Rb(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!s[e]&&"none"!==s[e]))||!!s.containerType&&"normal"!==s.containerType||!t&&!!s.backdropFilter&&"none"!==s.backdropFilter||!t&&!!s.filter&&"none"!==s.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(s.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(s.contain||"").includes(e)))}function Ib(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Nb(e){return["html","body","#document"].includes(xb(e))}function Rb(e){return vb(e).getComputedStyle(e)}function Db(e){return kb(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ab(e){if("html"===xb(e))return e;const t=e.assignedSlot||e.parentNode||Pb(e)&&e.host||wb(e);return Pb(t)?t.host:t}function Mb(e){const t=Ab(e);return Nb(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cb(t)&&jb(t)?t:Mb(t)}function Lb(e,t,s){var n;void 0===t&&(t=[]),void 0===s&&(s=!0);const o=Mb(e),r=o===(null==(n=e.ownerDocument)?void 0:n.body),i=vb(o);if(r){const e=function(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}(i);return t.concat(i,i.visualViewport||[],jb(o)?o:[],e&&s?Lb(e):[])}return t.concat(o,Lb(o,[],s))}function Ob(e){const t=Rb(e);let s=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Cb(e),r=o?e.offsetWidth:s,i=o?e.offsetHeight:n,a=_b(s)!==r||_b(n)!==i;return a&&(s=r,n=i),{width:s,height:n,$:a}}function Fb(e){return kb(e)?e:e.contextElement}function Vb(e){const t=Fb(e);if(!Cb(t))return bb(1);const s=t.getBoundingClientRect(),{width:n,height:o,$:r}=Ob(t);let i=(r?_b(s.width):s.width)/n,a=(r?_b(s.height):s.height)/o;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}const Ub=bb(0);function Hb(e){const t=vb(e);return Ib()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ub}function zb(e,t,s,n){void 0===t&&(t=!1),void 0===s&&(s=!1);const o=e.getBoundingClientRect(),r=Fb(e);let i=bb(1);t&&(n?kb(n)&&(i=Vb(n)):i=Vb(e));const a=function(e,t,s){return void 0===t&&(t=!1),!(!s||t&&s!==vb(e))&&t}(r,s,n)?Hb(r):bb(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(r){const e=vb(r),t=n&&kb(n)?vb(n):n;let s=e,o=s.frameElement;for(;o&&n&&t!==s;){const e=Vb(o),t=o.getBoundingClientRect(),n=Rb(o),r=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=r,c+=i,s=vb(o),o=s.frameElement}}return ub({width:d,height:u,x:l,y:c})}const Gb=[":popover-open",":modal"];function $b(e){return Gb.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Wb(e){return zb(wb(e)).left+Db(e).scrollLeft}function Zb(e,t,s){let n;if("viewport"===t)n=function(e,t){const s=vb(e),n=wb(e),o=s.visualViewport;let r=n.clientWidth,i=n.clientHeight,a=0,l=0;if(o){r=o.width,i=o.height;const e=Ib();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:r,height:i,x:a,y:l}}(e,s);else if("document"===t)n=function(e){const t=wb(e),s=Db(e),n=e.ownerDocument.body,o=gb(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=gb(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-s.scrollLeft+Wb(e);const a=-s.scrollTop;return"rtl"===Rb(n).direction&&(i+=gb(t.clientWidth,n.clientWidth)-o),{width:o,height:r,x:i,y:a}}(wb(e));else if(kb(t))n=function(e,t){const s=zb(e,!0,"fixed"===t),n=s.top+e.clientTop,o=s.left+e.clientLeft,r=Cb(e)?Vb(e):bb(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:o*r.x,y:n*r.y}}(t,s);else{const s=Hb(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return ub(n)}function Yb(e,t){const s=Ab(e);return!(s===t||!kb(s)||Nb(s))&&("fixed"===Rb(s).position||Yb(s,t))}function qb(e,t,s){const n=Cb(t),o=wb(t),r="fixed"===s,i=zb(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const l=bb(0);if(n||!n&&!r)if(("body"!==xb(t)||jb(o))&&(a=Db(t)),n){const e=zb(t,!0,r,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Wb(o));return{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function Kb(e,t){return Cb(e)&&"fixed"!==Rb(e).position?t?t(e):e.offsetParent:null}function Qb(e,t){const s=vb(e);if(!Cb(e)||$b(e))return s;let n=Kb(e,t);for(;n&&Eb(n)&&"static"===Rb(n).position;)n=Kb(n,t);return n&&("html"===xb(n)||"body"===xb(n)&&"static"===Rb(n).position&&!Bb(n))?s:n||function(e){let t=Ab(e);for(;Cb(t)&&!Nb(t);){if(Bb(t))return t;if(Tb(t))return null;t=Ab(t)}return null}(e)||s}const Xb={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:s,offsetParent:n,strategy:o}=e;const r="fixed"===o,i=wb(n),a=!!t&&$b(t.floating);if(n===i||a&&r)return s;let l={scrollLeft:0,scrollTop:0},c=bb(1);const d=bb(0),u=Cb(n);if((u||!u&&!r)&&(("body"!==xb(n)||jb(i))&&(l=Db(n)),Cb(n))){const e=zb(n);c=Vb(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}return{width:s.width*c.x,height:s.height*c.y,x:s.x*c.x-l.scrollLeft*c.x+d.x,y:s.y*c.y-l.scrollTop*c.y+d.y}},getDocumentElement:wb,getClippingRect:function(e){let{element:t,boundary:s,rootBoundary:n,strategy:o}=e;const r=[..."clippingAncestors"===s?function(e,t){const s=t.get(e);if(s)return s;let n=Lb(e,[],!1).filter((e=>kb(e)&&"body"!==xb(e))),o=null;const r="fixed"===Rb(e).position;let i=r?Ab(e):e;for(;kb(i)&&!Nb(i);){const t=Rb(i),s=Bb(i);s||"fixed"!==t.position||(o=null),(r?!s&&!o:!s&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||jb(i)&&!s&&Yb(e,i))?n=n.filter((e=>e!==i)):o=t,i=Ab(i)}return t.set(e,n),n}(t,this._c):[].concat(s),n],i=r[0],a=r.reduce(((e,s)=>{const n=Zb(t,s,o);return e.top=gb(n.top,e.top),e.right=hb(n.right,e.right),e.bottom=hb(n.bottom,e.bottom),e.left=gb(n.left,e.left),e}),Zb(t,i,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Qb,getElementRects:async function(e){const t=this.getOffsetParent||Qb,s=this.getDimensions;return{reference:qb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await s(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:s}=Ob(e);return{width:t,height:s}},getScale:Vb,isElement:kb,isRTL:function(e){return"rtl"===Rb(e).direction}};function Jb(e,t,s,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=Fb(e),d=o||r?[...c?Lb(c):[],...Lb(t)]:[];d.forEach((e=>{o&&e.addEventListener("scroll",s,{passive:!0}),r&&e.addEventListener("resize",s)}));const u=c&&a?function(e,t){let s,n=null;const o=wb(e);function r(){var e;clearTimeout(s),null==(e=n)||e.disconnect(),n=null}return function i(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),r();const{left:c,top:d,width:u,height:p}=e.getBoundingClientRect();if(a||t(),!u||!p)return;const m={rootMargin:-fb(d)+"px "+-fb(o.clientWidth-(c+u))+"px "+-fb(o.clientHeight-(d+p))+"px "+-fb(c)+"px",threshold:gb(0,hb(1,l))||1};let h=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return i();t?i(!1,t):s=setTimeout((()=>{i(!1,1e-7)}),100)}h=!1}try{n=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(g,m)}n.observe(e)}(!0),r}(c,s):null;let p,m=-1,h=null;i&&(h=new ResizeObserver((e=>{let[n]=e;n&&n.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),s()})),c&&!l&&h.observe(c),h.observe(t));let g=l?zb(e):null;return l&&function t(){const n=zb(e);!g||n.x===g.x&&n.y===g.y&&n.width===g.width&&n.height===g.height||s();g=n,p=requestAnimationFrame(t)}(),s(),()=>{var e;d.forEach((e=>{o&&e.removeEventListener("scroll",s),r&&e.removeEventListener("resize",s)})),null==u||u(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const ey=(e,t,s)=>{const n=new Map,o={platform:Xb,...s},r={...o.platform,_c:n};return(async(e,t,s)=>{const{placement:n="bottom",strategy:o="absolute",middleware:r=[],platform:i}=s,a=r.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=pb(c,n,l),p=n,m={},h=0;for(let s=0;s<a.length;s++){const{name:r,fn:g}=a[s],{x:_,y:f,data:b,reset:y}=await g({x:d,y:u,initialPlacement:n,placement:p,strategy:o,middlewareData:m,rects:c,platform:i,elements:{reference:e,floating:t}});d=null!=_?_:d,u=null!=f?f:u,m={...m,[r]:{...m[r],...b}},y&&h<=50&&(h++,"object"==typeof y&&(y.placement&&(p=y.placement),y.rects&&(c=!0===y.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):y.rects),({x:d,y:u}=pb(c,p,l))),s=-1)}return{x:d,y:u,placement:p,strategy:o,middlewareData:m}})(e,t,{...o,platform:r})};var ty=s(1609);const sy=window.ReactDOM;var ny="undefined"!=typeof document?ty.useLayoutEffect:ty.useEffect;function oy(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let s,n,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(n=s;0!=n--;)if(!oy(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),s=o.length,s!==Object.keys(t).length)return!1;for(n=s;0!=n--;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=s;0!=n--;){const s=o[n];if(("_owner"!==s||!e.$$typeof)&&!oy(e[s],t[s]))return!1}return!0}return e!=e&&t!=t}function ry(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function iy(e,t){const s=ry(e);return Math.round(t*s)/s}function ay(e){const t=ty.useRef(e);return ny((()=>{t.current=e})),t}const{useBlockElementRef:ly,cleanEmptyObject:cy}=$(g.privateApis);function dy({thread:e,calculatedOffset:t,setHeights:s,selectedThread:n,setBlockRef:o,commentLastUpdated:r}){const i=(0,p.useRef)();ly(e.blockClientId,i);const a=(0,p.useCallback)(((e,t)=>{s((s=>s[e]!==t?{...s,[e]:t}:s))}),[s]),{y:l,refs:c}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:s="absolute",middleware:n=[],platform:o,elements:{reference:r,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,u]=ty.useState({x:0,y:0,strategy:s,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=ty.useState(n);oy(p,n)||m(n);const[h,g]=ty.useState(null),[_,f]=ty.useState(null),b=ty.useCallback((e=>{e!==w.current&&(w.current=e,g(e))}),[]),y=ty.useCallback((e=>{e!==S.current&&(S.current=e,f(e))}),[]),x=r||h,v=i||_,w=ty.useRef(null),S=ty.useRef(null),k=ty.useRef(d),C=null!=l,P=ay(l),j=ay(o),E=ty.useCallback((()=>{if(!w.current||!S.current)return;const e={placement:t,strategy:s,middleware:p};j.current&&(e.platform=j.current),ey(w.current,S.current,e).then((e=>{const t={...e,isPositioned:!0};T.current&&!oy(k.current,t)&&(k.current=t,sy.flushSync((()=>{u(t)})))}))}),[p,t,s,j]);ny((()=>{!1===c&&k.current.isPositioned&&(k.current.isPositioned=!1,u((e=>({...e,isPositioned:!1}))))}),[c]);const T=ty.useRef(!1);ny((()=>(T.current=!0,()=>{T.current=!1})),[]),ny((()=>{if(x&&(w.current=x),v&&(S.current=v),x&&v){if(P.current)return P.current(x,v,E);E()}}),[x,v,E,P,C]);const B=ty.useMemo((()=>({reference:w,floating:S,setReference:b,setFloating:y})),[b,y]),I=ty.useMemo((()=>({reference:x,floating:v})),[x,v]),N=ty.useMemo((()=>{const e={position:s,left:0,top:0};if(!I.floating)return e;const t=iy(I.floating,d.x),n=iy(I.floating,d.y);return a?{...e,transform:"translate("+t+"px, "+n+"px)",...ry(I.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:t,top:n}}),[s,a,I.floating,d.x,d.y]);return ty.useMemo((()=>({...d,update:E,refs:B,elements:I,floatingStyles:N})),[d,E,B,I,N])}({placement:"right-start",middleware:[mb({crossAxis:t||-16})],whileElementsMounted:Jb});return(0,p.useEffect)((()=>{i.current&&c.setReference(i.current)}),[i,c,r]),(0,p.useEffect)((()=>{c.floating?.current&&o(e.id,i.current)}),[e.id,c.floating,o]),(0,p.useEffect)((()=>{if(c.floating?.current){const t=c.floating.current.scrollHeight;a(e.id,t)}}),[e.id,a,c.floating,n,r]),{blockRef:i,y:l,refs:c}}const{useBlockElement:uy}=$(g.privateApis);function py({onSubmit:e,newNoteFormState:t,setNewNoteFormState:s,commentSidebarRef:n,reflowComments:o=eb,isFloating:r=!1,y:i,refs:a}){const{clientId:l}=(0,d.useSelect)((e=>{const{getSelectedBlockClientId:t}=e(g.store);return{clientId:t()}}),[]),u=uy(l),{toggleBlockSpotlight:p}=$((0,d.useDispatch)(g.store));return"open"===t&&l?(0,c.jsxs)(Hn.__experimentalVStack,{className:mr("editor-collab-sidebar-panel__thread is-selected",{"is-floating":r}),spacing:"3",tabIndex:0,"aria-label":(0,fs.__)("New note"),role:"treeitem",ref:r?a.setFloating:void 0,style:r?{top:i,opacity:i?void 0:0}:void 0,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(p(l,!1),s("closed"))},children:[(0,c.jsx)(Hn.__experimentalHStack,{alignment:"left",spacing:"3",children:(0,c.jsx)(ob,{})}),(0,c.jsx)(rb,{onSubmit:async t=>{const{id:o}=await e({content:t});nb(o,n.current),s("creating")},onCancel:()=>{s("closed"),u?.focus(),p(l,!1)},reflowComments:o,submitButtonText:(0,fs.__)("Add note"),labelText:(0,fs.__)("New note")})]}):null}const{useBlockElement:my}=$(g.privateApis),{Menu:hy}=$(Hn.privateApis);function gy({threads:e,onEditComment:t,onAddReply:s,onCommentDelete:n,newNoteFormState:o,setNewNoteFormState:r,commentSidebarRef:i,reflowComments:a,isFloating:l=!1,commentLastUpdated:u}){const[m,h]=(0,p.useState)({}),[_,f]=(0,p.useState)(null),[b,y]=(0,p.useState)({}),[x,v]=(0,p.useState)({}),{setCanvasMinHeight:w}=$((0,d.useDispatch)(vc)),{selectBlock:S,toggleBlockSpotlight:k}=$((0,d.useDispatch)(g.store)),{blockCommentId:C,selectedBlockClientId:P,orderedBlockIds:j}=(0,d.useSelect)((e=>{const{getBlockAttributes:t,getSelectedBlockClientId:s,getClientIdsWithDescendants:n}=e(g.store),o=s();return{blockCommentId:o?t(o)?.metadata?.noteId:null,selectedBlockClientId:o,orderedBlockIds:n()}}),[]),E=my(P),T=(0,p.useMemo)((()=>{const t=[...e],s=[];if(l&&"open"===o){const e={id:"new-note-thread",blockClientId:P,content:{rendered:""}};return j.forEach((n=>{if(n===P)s.push(e);else{const e=t.find((e=>e.blockClientId===n));e&&s.push(e)}})),s}return t}),[e,l,o,P,j]),B=async e=>{const t=T.findIndex((t=>t.id===e.id)),s=T[t+1],o=T[t-1];if(await n(e),0!==e.parent)return f(e.parent),void nb(e.parent,i.current);s?(f(s.id),nb(s.id,i.current)):o?(f(o.id),nb(o.id,i.current)):(f(null),r("closed"),E?.focus())};(0,p.useEffect)((()=>{f("open"===o?"new-note-thread":C)}),[C,o]);const I=(0,p.useCallback)(((e,t)=>{v((s=>({...s,[e]:t})))}),[]);(0,p.useEffect)((()=>{const{offsets:e,minHeight:t}=(()=>{const e={};if(!l)return{offsets:e,minHeight:0};const t=T.findIndex((e=>e.id===_)),s=-1===t?0:t,n=T[s];if(!n||!x[n.id])return{offsets:e,minHeight:0};let o=x[n.id],r=o?.getBoundingClientRect();const i=r?.top||0,a=m[n.id]||0;e[n.id]=-16;let c={threadTop:i-16,threadHeight:a};for(let t=s+1;t<T.length;t++){const s=T[t];if(!x[s.id])continue;o=x[s.id],r=o?.getBoundingClientRect();const n=r?.top||0,i=m[s.id]||0;let a=-16;const l=c.threadTop+c.threadHeight;n<l+16&&(a=l-n+20),e[s.id]=a,c={threadTop:n+a,threadHeight:i}}let d={threadTop:i-16};for(let s=t-1;s>=0;s--){const t=T[s];if(!x[t.id])continue;o=x[t.id],r=o?.getBoundingClientRect();const n=r?.top||0,i=m[t.id]||0;let a=-16;n+i>d.threadTop&&(a=d.threadTop-n-i-20),e[t.id]=a,d={threadTop:n+a}}let u=0;const p=T[T.length-1];if(x[p.id]){const t=x[p.id],s=t?.getBoundingClientRect();u=(s?.top||0)+(m[p.id]||0)+(e[p.id]||0)+32}return{offsets:e,minHeight:u}})();Object.keys(e).length>0&&y(e),w(t)}),[m,x,l,T,_,w]);return Array.isArray(T)&&T.length>0||l?(0,c.jsxs)(c.Fragment,{children:[!l&&"open"===o&&(0,c.jsx)(py,{onSubmit:s,newNoteFormState:o,setNewNoteFormState:r,commentSidebarRef:i}),T.map((e=>(0,c.jsx)(_y,{thread:e,onAddReply:s,onCommentDelete:B,onEditComment:t,isSelected:_===e.id,setSelectedThread:f,setNewNoteFormState:r,commentSidebarRef:i,reflowComments:a,isFloating:l,calculatedOffset:b[e.id]??0,setHeights:h,setBlockRef:I,selectedThread:_,commentLastUpdated:u,newNoteFormState:o,onKeyDown:t=>((e,t,s)=>{if(e.defaultPrevented)return;const n=T.findIndex((e=>e.id===t.id));"Enter"!==e.key&&"ArrowRight"!==e.key||e.currentTarget!==e.target||s?("Enter"===e.key||"ArrowLeft"===e.key)&&e.currentTarget===e.target&&s||"Escape"===e.key?(f(null),r("closed"),t.blockClientId&&k(t.blockClientId,!1),nb(t.id,i.current)):"ArrowDown"===e.key&&n<T.length-1&&e.currentTarget===e.target?nb(T[n+1].id,i.current):"ArrowUp"===e.key&&n>0&&e.currentTarget===e.target?nb(T[n-1].id,i.current):"Home"===e.key&&e.currentTarget===e.target?nb(T[0].id,i.current):"End"===e.key&&e.currentTarget===e.target&&nb(T[T.length-1].id,i.current):(r("closed"),f(t.id),t.blockClientId&&(S(t.blockClientId,null),k(t.blockClientId,!0)))})(t,e,_===e.id)},e.id)))]}):(0,c.jsx)(py,{onSubmit:s,newNoteFormState:o,setNewNoteFormState:r,commentSidebarRef:i})}function _y({thread:e,onEditComment:t,onAddReply:s,onCommentDelete:n,isSelected:o,setNewNoteFormState:r,commentSidebarRef:i,reflowComments:a,isFloating:l,calculatedOffset:u,setHeights:h,setBlockRef:_,setSelectedThread:f,selectedThread:b,commentLastUpdated:y,newNoteFormState:x,onKeyDown:v}){const{toggleBlockHighlight:w,selectBlock:S,toggleBlockSpotlight:k}=$((0,d.useDispatch)(g.store)),C=my(e.blockClientId),P=(0,m.useDebounce)(w,50),{y:j,refs:E}=dy({thread:e,calculatedOffset:u,setHeights:h,setBlockRef:_,selectedThread:b,commentLastUpdated:y}),T=(0,p.useRef)(!1),B=()=>{f(null),r("closed"),k(e.blockClientId,!1)},I=e?.reply||[],N=I.length>0?I[I.length-1]:void 0,R=I.length>0?I.slice(0,-1):[],D=function(e,t=10){if(!e)return"";const s=(0,fs._x)("words","Word count type. Do not translate!"),n=e.trim();let o="";if("words"===s)o=n.split(" ",t).join(" ");else if("characters_excluding_spaces"===s){const e=n.split("",t).join(""),s=e.length-e.replaceAll(" ","").length;o=n.split("",t+s).join("")}else"characters_including_spaces"===s&&(o=n.split("",t).join(""));return o!==n?o+"…":o}((0,Uc.__unstableStripHTML)(e.content?.rendered),10),A=e.blockClientId?(0,fs.sprintf)((0,fs.__)("Note: %s"),D):(0,fs.sprintf)((0,fs.__)("Original block deleted. Note: %s"),D);return"new-note-thread"===e.id&&"open"===x&&l?(0,c.jsx)(py,{onSubmit:s,newNoteFormState:x,setNewNoteFormState:r,commentSidebarRef:i,reflowComments:a,isFloating:l,y:j,refs:E}):(0,c.jsxs)(Hn.__experimentalVStack,{className:mr("editor-collab-sidebar-panel__thread",{"is-selected":o,"is-floating":l}),id:`comment-thread-${e.id}`,spacing:"3",onClick:()=>{r("closed"),f(e.id),k(e.blockClientId,!0),e.blockClientId&&S(e.blockClientId,null)},onMouseEnter:()=>{P(e.blockClientId,!0)},onMouseLeave:()=>{P(e.blockClientId,!1)},onFocus:()=>{w(e.blockClientId,!0)},onBlur:t=>{const s=t.relatedTarget?.closest(".editor-collab-sidebar-panel__thread"),n=t.relatedTarget?.closest('[role="dialog"]'),o=T.current;s&&!o||n||o&&t.currentTarget.contains(t.relatedTarget)||(w(e.blockClientId,!1),B())},onKeyUp:e=>{"Tab"===e.key&&(T.current=!1)},onKeyDown:e=>{"Tab"===e.key?T.current=!0:v(e)},tabIndex:0,role:"treeitem","aria-label":A,"aria-expanded":o,ref:l?E.setFloating:void 0,style:l?{top:j}:void 0,children:[(0,c.jsx)(Hn.Button,{className:"editor-collab-sidebar-panel__skip-to-comment",variant:"secondary",size:"compact",onClick:()=>{nb(e.id,i.current,"textarea")},children:(0,fs.__)("Add new reply")}),!e.blockClientId&&(0,c.jsx)(Hn.__experimentalText,{as:"p",weight:500,variant:"muted",children:(0,fs.__)("Original block deleted.")}),(0,c.jsx)(fy,{thread:e,isExpanded:o,onEdit:(s={})=>{t(s),"approved"===s.status&&(B(),l?C?.focus():nb(e.id,i.current))},onDelete:n,reflowComments:a}),o&&I.map((s=>(0,c.jsx)(fy,{thread:s,parent:e,isExpanded:o,onEdit:t,onDelete:n,reflowComments:a},s.id))),!o&&R.length>0&&(0,c.jsx)(Hn.__experimentalHStack,{className:"editor-collab-sidebar-panel__more-reply-separator",children:(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary",className:"editor-collab-sidebar-panel__more-reply-button",onClick:()=>{f(e.id),nb(e.id,i.current)},children:(0,fs.sprintf)((0,fs._n)("%s more reply","%s more replies",R.length),R.length)})}),!o&&N&&(0,c.jsx)(fy,{thread:N,parent:e,isExpanded:o,onEdit:t,onDelete:n,reflowComments:a}),o&&(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"2",role:"treeitem",children:[(0,c.jsx)(Hn.__experimentalHStack,{alignment:"left",spacing:"3",justify:"flex-start",children:(0,c.jsx)(ob,{})}),(0,c.jsx)(Hn.__experimentalVStack,{spacing:"2",children:(0,c.jsx)(rb,{onSubmit:n=>{"approved"===e.status?t({id:e.id,status:"hold",content:n}):s({content:n,parent:e.id})},onCancel:t=>{t.stopPropagation(),B(),nb(e.id,i.current)},submitButtonText:"approved"===e.status?(0,fs.__)("Reopen & Reply"):(0,fs.__)("Reply"),rows:"approved"===e.status?2:4,labelText:(0,fs.sprintf)((0,fs.__)("Reply to note %1$s by %2$s"),e.id,e.author_name),reflowComments:a})})]}),!!e.blockClientId&&(0,c.jsx)(Hn.Button,{className:"editor-collab-sidebar-panel__skip-to-block",variant:"secondary",size:"compact",onClick:e=>{e.stopPropagation(),C?.focus()},children:(0,fs.__)("Back to block")})]})}const fy=({thread:e,parent:t,isExpanded:s,onEdit:n,onDelete:o,reflowComments:r})=>{const[i,a]=(0,p.useState)(!1),[l,d]=(0,p.useState)(!1),u=(0,p.useRef)(null),m=()=>{a(!1),d(!1),u.current?.focus()},h="note"===e.type&&e.meta&&("resolved"===e.meta._wp_note_status||"reopen"===e.meta._wp_note_status),g=[{id:"edit",title:(0,fs.__)("Edit"),isEligible:({status:e})=>"approved"!==e,onClick:()=>{a("edit")}},{id:"reopen",title:(0,fs._x)("Reopen","Reopen note"),isEligible:({status:e})=>"approved"===e,onClick:()=>{n({id:e.id,status:"hold"})}},{id:"delete",title:(0,fs.__)("Delete"),isEligible:()=>!0,onClick:()=>{a("delete"),d(!0)}}],_=0===e.parent,f="approved"!==t?.status?g.filter((t=>t.isEligible(e))):[],b=0===e.parent?(0,fs.__)("Are you sure you want to delete this note? This will also delete all of this note's replies."):(0,fs.__)("Are you sure you want to delete this reply?");return(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"2",role:0!==e.parent?"treeitem":void 0,children:[(0,c.jsxs)(Hn.__experimentalHStack,{alignment:"left",spacing:"3",justify:"flex-start",children:[(0,c.jsx)(ob,{avatar:e?.author_avatar_urls?.[48],name:e?.author_name,date:e?.date,userId:e?.author}),s&&(0,c.jsx)(Hn.FlexItem,{className:"editor-collab-sidebar-panel__comment-status",onClick:e=>{e.stopPropagation()},children:(0,c.jsxs)(Hn.__experimentalHStack,{spacing:"0",children:[_&&(0,c.jsx)(Hn.Button,{label:(0,fs._x)("Resolve","Mark note as resolved"),size:"small",icon:wr,disabled:"approved"===e.status,accessibleWhenDisabled:"approved"===e.status,onClick:()=>{n({id:e.id,status:"approved"})}}),(0,c.jsxs)(hy,{placement:"bottom-end",children:[(0,c.jsx)(hy.TriggerButton,{render:(0,c.jsx)(Hn.Button,{ref:u,size:"small",icon:r_,label:(0,fs.__)("Actions"),disabled:!f.length,accessibleWhenDisabled:!0})}),(0,c.jsx)(hy.Popover,{modal:!1,children:f.map((e=>(0,c.jsx)(hy.Item,{onClick:()=>e.onClick(),children:(0,c.jsx)(hy.ItemLabel,{children:e.title})},e.id)))})]})]})})]}),"edit"===i?(0,c.jsx)(rb,{onSubmit:t=>{n({id:e.id,content:t}),a(!1),u.current?.focus()},onCancel:()=>m(),thread:e,submitButtonText:(0,fs._x)("Update","verb"),labelText:(0,fs.sprintf)((0,fs.__)("Edit note %1$s by %2$s"),e.id,e.author_name),reflowComments:r}):(0,c.jsx)(p.RawHTML,{className:mr("editor-collab-sidebar-panel__user-comment",{"editor-collab-sidebar-panel__resolution-text":h}),children:h?(()=>{const t="resolved"===e.meta._wp_note_status?(0,fs.__)("Marked as resolved"):(0,fs.__)("Reopened"),s=e?.content?.raw;return s&&"string"==typeof s&&""!==s.trim()?(0,fs.sprintf)((0,fs.__)("%1$s: %2$s"),t,s):t})():e?.content?.rendered}),"delete"===i&&(0,c.jsx)(Hn.__experimentalConfirmDialog,{isOpen:l,onConfirm:()=>{o(e),a(!1),d(!1)},onCancel:m,confirmButtonText:(0,fs.__)("Delete"),children:b})]})};const{CommentIconSlotFill:by}=$(g.privateApis),yy=({clientId:e,onClick:t,isDistractionFree:s})=>{const n=(0,d.useSelect)((t=>t(g.store).getBlock(e)),[e]);if(!n?.isValid||n?.name===(0,x.getUnregisteredTypeHandlerName)())return null;const o=s||"core/freeform"===n?.name;let r;return s?r=(0,fs.__)("Notes are disabled in distraction free mode."):"core/freeform"===n?.name&&(r=(0,fs.__)("Convert to blocks to add notes.")),(0,c.jsx)(Hn.MenuItem,{icon:Kf,onClick:t,"aria-haspopup":"dialog",disabled:o,info:r,children:(0,fs.__)("Add note")})};var xy=({onClick:e,isDistractionFree:t})=>(0,c.jsx)(by.Fill,{children:({clientId:s,onClose:n})=>(0,c.jsx)(yy,{clientId:s,isDistractionFree:t,onClick:()=>{e(),n()}})});const{CommentIconToolbarSlotFill:vy}=$(g.privateApis);var wy=({onClick:e,thread:t})=>{const s=(0,p.useMemo)((()=>{if(!t)return[];const e=new Map,s=[t,...t.reply];return s.sort(((e,t)=>new Date(e.date)-new Date(t.date))),s.forEach((t=>{t.author_name&&t.author_avatar_urls&&(e.has(t.author)||e.set(t.author,{name:t.author_name,avatar:t.author_avatar_urls?.[48]||t.author_avatar_urls?.[96],id:t.author,date:t.date}))})),Array.from(e.values())}),[t]);if(!s.length)return null;const n=s.length>3?s.slice(0,2):s,o=Math.max(0,s.length-n.length),r=s.length>100&&o>0?(0,fs.__)("100+"):(0,fs.sprintf)((0,fs.__)("+%s"),o);return(0,c.jsx)(vy.Fill,{children:(0,c.jsx)(Hn.ToolbarButton,{className:"comment-avatar-indicator",label:(0,fs.__)("View notes"),onClick:e,showTooltip:!0,children:(0,c.jsxs)(Hn.__experimentalHStack,{spacing:"1",children:[n.map((e=>(0,c.jsx)("img",{src:e.avatar,alt:e.name,className:"comment-avatar",style:{borderColor:sb(e.id)}},e.id))),o>0&&(0,c.jsx)(Hn.__experimentalText,{weight:500,children:r})]})})})};function Sy({newNoteFormState:e,setNewNoteFormState:t,styles:s,comments:n,commentSidebarRef:o,reflowComments:r,commentLastUpdated:i,isFloating:a=!1}){const{onCreate:l,onEdit:p,onDelete:m}=function(e=eb){const{createNotice:t}=(0,d.useDispatch)(_s.store),{saveEntityRecord:s,deleteEntityRecord:n}=(0,d.useDispatch)(u.store),{getCurrentPostId:o}=(0,d.useSelect)(vc),{getBlockAttributes:r,getSelectedBlockClientId:i}=(0,d.useSelect)(g.store),{updateBlockAttributes:a}=(0,d.useDispatch)(g.store),l=e=>{const s=e.message&&"unknown_error"!==e.code?(0,Ln.decodeEntities)(e.message):(0,fs.__)("An error occurred while performing an update.");t("error",s,{type:"snackbar",isDismissible:!0})};return{onCreate:async({content:n,parent:c})=>{try{const l=await s("root","comment",{post:o(),content:n,status:"hold",type:"note",parent:c||0},{throwOnError:!0});if(!c&&l?.id){const e=i(),t=r(e)?.metadata;a(e,{metadata:{...t,noteId:l.id}})}return t("snackbar",c?(0,fs.__)("Reply added."):(0,fs.__)("Note added."),{type:"snackbar",isDismissible:!0}),setTimeout(e,300),l}catch(t){e(),l(t)}},onEdit:async({id:n,content:r,status:i})=>{const a=i||"updated",c={approved:(0,fs.__)("Note marked as resolved."),hold:(0,fs.__)("Note reopened."),updated:(0,fs.__)("Note updated.")};try{if("approved"===i||"hold"===i){await s("root","comment",{id:n,status:i},{throwOnError:!0});const e={post:o(),content:r||"",type:"note",status:i,parent:n,meta:{_wp_note_status:"approved"===i?"resolved":"reopen"}};await s("root","comment",e,{throwOnError:!0})}else{const e={id:n,content:r,status:i};await s("root","comment",e,{throwOnError:!0})}t("snackbar",c[a]??(0,fs.__)("Note updated."),{type:"snackbar",isDismissible:!0}),e()}catch(t){e(),l(t)}},onDelete:async s=>{try{if(await n("root","comment",s.id,void 0,{throwOnError:!0}),!s.parent){const e=i(),t=r(e)?.metadata;a(e,{metadata:cy({...t,noteId:void 0})})}t("snackbar",(0,fs.__)("Note deleted."),{type:"snackbar",isDismissible:!0}),e()}catch(t){e(),l(t)}}}}(r);return(0,c.jsx)(Hn.__experimentalVStack,{className:"editor-collab-sidebar-panel",style:s,role:"tree",spacing:"3",justify:"flex-start",ref:e=>{e&&(o.current=e)},"aria-label":a?(0,fs.__)("Unresolved notes"):(0,fs.__)("All notes"),children:(0,c.jsx)(gy,{threads:n,onEditComment:p,onAddReply:l,onCommentDelete:m,newNoteFormState:e,setNewNoteFormState:t,commentSidebarRef:o,reflowComments:r,commentLastUpdated:i,isFloating:a})})}function ky({postId:e,mode:t}){const[s,n]=(0,p.useState)("closed"),{getActiveComplementaryArea:o}=(0,d.useSelect)(ja),{enableComplementaryArea:r}=(0,d.useDispatch)(ja),{toggleBlockSpotlight:i}=$((0,d.useDispatch)(g.store)),a=(0,m.useViewportMatch)("medium"),l=(0,p.useRef)(null),h=a&&"post-only"===t,{clientId:_,blockCommentId:f,isDistractionFree:b}=(0,d.useSelect)((e=>{const{getBlockAttributes:t,getSelectedBlockClientId:s,getSettings:n}=e(g.store),o=s();return{clientId:o,blockCommentId:o?t(o)?.metadata?.noteId:null,isDistractionFree:n().isDistractionFree}}),[]),{resultComments:y,unresolvedSortedThreads:x,reflowComments:v,commentLastUpdated:w}=function(e){const[t,s]=(0,p.useReducer)((()=>Date.now()),0),n={post:e,type:"note",status:"all",per_page:-1},{records:o}=(0,u.useEntityRecords)("root","comment",n,{enabled:!!e&&"number"==typeof e}),{getBlockAttributes:r}=(0,d.useSelect)(g.store),{clientIds:i}=(0,d.useSelect)((e=>{const{getClientIdsWithDescendants:t}=e(g.store);return{clientIds:t()}}),[]),{resultComments:a,unresolvedSortedThreads:l}=(0,p.useMemo)((()=>{if(!o||0===o.length)return{resultComments:[],unresolvedSortedThreads:[]};const e=i.reduce(((e,t)=>{const s=r(t)?.metadata?.noteId;return s&&(e[t]=s),e}),{}),t={},s=[];if(o.forEach((s=>{const n=Object.keys(e).find((t=>e[t]===s.id));t[s.id]={...s,reply:[],blockClientId:0===s.parent?n:null}})),o.forEach((e=>{0===e.parent?s.push(t[e.id]):t[e.parent]&&t[e.parent].reply.push(t[e.id])})),0===s?.length)return{resultComments:[],unresolvedSortedThreads:[]};const n=s.map((e=>({...e,reply:[...e.reply].reverse()}))),a=new Map(n.map((e=>[String(e.id),e]))),l=new Set(Object.values(e).map((e=>String(e)))),c=Object.values(e).map((e=>a.get(String(e)))).filter((e=>void 0!==e&&"hold"===e.status)),d=Object.values(e).map((e=>a.get(String(e)))).filter((e=>void 0!==e&&"approved"===e.status)),u=n.filter((e=>!l.has(String(e.id))));return{resultComments:[...c,...d,...u],unresolvedSortedThreads:c}}),[i,o,r]);return{resultComments:a,unresolvedSortedThreads:l,reflowComments:s,commentLastUpdated:t}}(e);!function(e=!1){const t=(0,d.useRegistry)();(0,p.useEffect)((()=>{if(!e)return;const{getActiveComplementaryArea:s}=t.select(ja),{disableComplementaryArea:n,enableComplementaryArea:o}=t.dispatch(ja),r=t.subscribe((()=>{null===s("core")&&o("core",Xf)}));return()=>{r(),s("core")===Xf&&n("core",Xf)}}),[e,t])}(h&&(x.length>0||"closed"!==s));const{merged:S}=Ti(),k=S?.styles?.color?.background,C=f?y.find((e=>e.id===f)):null,P=y.length>0||!h;async function j(){const e=await o("core"),t=Jf.find((t=>t===e));"approved"===C?.status?r("core",Qf):t&&P||r("core",h?Xf:Qf);const s=await o("core");Jf.includes(s)&&(n(C?"closed":"open"),nb(C?.id,l.current,C?void 0:"textarea"),i(_,!0))}return b?(0,c.jsx)(xy,{isDistractionFree:!0}):(0,c.jsxs)(c.Fragment,{children:[!!C&&(0,c.jsx)(wy,{thread:C,onClick:j}),(0,c.jsx)(xy,{onClick:j}),P&&(0,c.jsx)(Iu,{identifier:Qf,name:Qf,title:(0,fs.__)("All notes"),header:(0,c.jsx)("h2",{className:"interface-complementary-area-header__title",children:(0,fs.__)("All notes")}),icon:Kf,closeLabel:(0,fs.__)("Close Notes"),children:(0,c.jsx)(Sy,{comments:y,newNoteFormState:s,setNewNoteFormState:n,commentSidebarRef:l,reflowComments:v,commentLastUpdated:w})}),a&&(0,c.jsx)(Iu,{isPinnable:!1,header:!1,identifier:Xf,className:"editor-collab-sidebar",headerClassName:"editor-collab-sidebar__header",backgroundColor:k,children:(0,c.jsx)(Sy,{comments:x,newNoteFormState:s,setNewNoteFormState:n,commentSidebarRef:l,reflowComments:v,commentLastUpdated:w,styles:{backgroundColor:k},isFloating:!0})})]})}function Cy(){const{postId:e,mode:t,editorMode:s}=(0,d.useSelect)((e=>{const{getCurrentPostId:t,getRenderingMode:s,getEditorMode:n}=e(vc);return{postId:t(),mode:s(),editorMode:n()}}),[]);return e&&"number"==typeof e?"text"===s?null:(0,c.jsx)(Bd,{supportKeys:"editor.notes",children:(0,c.jsx)(ky,{postId:e,mode:t})}):null}var Py=function({postType:e,postId:t,templateId:s,settings:n,children:o,initialEdits:r,onActionPerformed:i,extraContent:a,extraSidebarPanels:l,...p}){const{post:m,template:h,hasLoadedPost:g,error:_}=(0,d.useSelect)((n=>{const{getEntityRecord:o,getResolutionError:r,hasFinishedResolution:i}=n(u.store),a=["postType",e,t];return{post:o(...a),template:s?o("postType",B,s):void 0,hasLoadedPost:i("getEntityRecord",a),error:r("getEntityRecord",a)?.message}}),[e,t,s]);return(0,c.jsxs)(c.Fragment,{children:[g&&!m&&(0,c.jsx)(Hn.Notice,{status:_?"error":"warning",isDismissible:!1,children:_||(0,fs.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")}),!!m&&(0,c.jsxs)(Rl,{post:m,__unstableTemplate:h,settings:n,initialEdits:r,useSubRegistry:!1,children:[(0,c.jsx)(sf,{...p,children:a}),o,(0,c.jsx)(qf,{onActionPerformed:i,extraPanels:l}),(0,c.jsx)(Cy,{})]})]})};const{PreferenceBaseOption:jy}=$(C.privateApis);function Ey(e){const t=(0,d.useSelect)((e=>e(vc).isPublishSidebarEnabled()),[]),{enablePublishSidebar:s,disablePublishSidebar:n}=(0,d.useDispatch)(vc);return(0,c.jsx)(jy,{isChecked:t,onChange:e=>e?s():n(),...e})}const{BlockManager:Ty}=$(g.privateApis),By=[];function Iy(){const{showBlockTypes:e,hideBlockTypes:t}=$((0,d.useDispatch)(vc)),{blockTypes:s,allowedBlockTypes:n,hiddenBlockTypes:o}=(0,d.useSelect)((e=>({blockTypes:e(x.store).getBlockTypes(),allowedBlockTypes:e(vc).getEditorSettings().allowedBlockTypes,hiddenBlockTypes:e(C.store).get("core","hiddenBlockTypes")??By})),[]),r=(0,p.useMemo)((()=>!0===n?s:s.filter((({name:e})=>n?.includes(e)))),[n,s]).filter((e=>(0,x.hasBlockSupport)(e,"inserter",!0)&&(!e.parent||e.parent.includes("core/post-content")))),i=o.filter((e=>r.some((t=>t.name===e)))),a=r.filter((e=>!i.includes(e.name))),l=r.length-a.length;const u=s=>{if(a.length>s.length){const e=a.filter((e=>!s.find((({name:t})=>t===e.name))));t(e.map((({name:e})=>e)))}else if(a.length<s.length){const t=s.filter((e=>!a.find((({name:t})=>t===e.name))));e(t.map((({name:e})=>e)))}};return(0,c.jsxs)("div",{className:"editor-block-visibility",children:[!!l&&(0,c.jsxs)("div",{className:"editor-block-visibility__disabled-blocks-count",children:[(0,fs.sprintf)((0,fs._n)("%d block is hidden.","%d blocks are hidden.",l),l),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:function(){u(r)},children:(0,fs.__)("Reset")})]}),(0,c.jsx)(Ty,{blockTypes:r,selectedBlockTypes:a,onChange:u,showSelectAll:!1})]})}const{PreferencesModal:Ny,PreferencesModalTabs:Ry,PreferencesModalSection:Dy,PreferenceToggleControl:Ay}=$(C.privateApis);function My({extraSections:e={}}){const t=(0,m.useViewportMatch)("medium"),s=(0,d.useSelect)((e=>{const{getEditorSettings:s}=e(vc),{get:n}=e(C.store),o=s().richEditingEnabled;return!n("core","distractionFree")&&t&&o}),[t]),{setIsListViewOpened:n,setIsInserterOpened:o}=(0,d.useDispatch)(vc),{set:r}=(0,d.useDispatch)(C.store),i=(0,p.useMemo)((()=>[{name:"general",tabLabel:(0,fs.__)("General"),content:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(Dy,{title:(0,fs.__)("Interface"),children:[(0,c.jsx)(Ay,{scope:"core",featureName:"showListViewByDefault",help:(0,fs.__)("Opens the List View panel by default."),label:(0,fs.__)("Always open List View")}),s&&(0,c.jsx)(Ay,{scope:"core",featureName:"showBlockBreadcrumbs",help:(0,fs.__)("Display the block hierarchy trail at the bottom of the editor."),label:(0,fs.__)("Show block breadcrumbs")}),(0,c.jsx)(Ay,{scope:"core",featureName:"allowRightClickOverrides",help:(0,fs.__)("Allows contextual List View menus via right-click, overriding browser defaults."),label:(0,fs.__)("Allow right-click contextual menus")}),(0,c.jsx)(Ay,{scope:"core",featureName:"enableChoosePatternModal",help:(0,fs.__)("Pick from starter content when creating a new page."),label:(0,fs.__)("Show starter patterns")})]}),(0,c.jsxs)(Dy,{title:(0,fs.__)("Document settings"),description:(0,fs.__)("Select what settings are shown in the document panel."),children:[(0,c.jsx)(uu.Slot,{}),(0,c.jsx)(dh,{taxonomyWrapper:(e,t)=>(0,c.jsx)(au,{label:t.labels.menu_name,panelName:`taxonomy-panel-${t.slug}`})}),(0,c.jsx)(gp,{children:(0,c.jsx)(au,{label:(0,fs.__)("Featured image"),panelName:"featured-image"})}),(0,c.jsx)(op,{children:(0,c.jsx)(au,{label:(0,fs.__)("Excerpt"),panelName:"post-excerpt"})}),(0,c.jsx)(Bd,{supportKeys:["comments","trackbacks"],children:(0,c.jsx)(au,{label:(0,fs.__)("Discussion"),panelName:"discussion-panel"})}),(0,c.jsx)(Td,{children:(0,c.jsx)(au,{label:(0,fs.__)("Page attributes"),panelName:"page-attributes"})})]}),t&&(0,c.jsx)(Dy,{title:(0,fs.__)("Publishing"),children:(0,c.jsx)(Ey,{help:(0,fs.__)("Review settings, such as visibility and tags."),label:(0,fs.__)("Enable pre-publish checks")})}),e?.general]})},{name:"appearance",tabLabel:(0,fs.__)("Appearance"),content:(0,c.jsxs)(Dy,{title:(0,fs.__)("Appearance"),description:(0,fs.__)("Customize the editor interface to suit your needs."),children:[(0,c.jsx)(Ay,{scope:"core",featureName:"fixedToolbar",onToggle:()=>r("core","distractionFree",!1),help:(0,fs.__)("Access all block and document tools in a single place."),label:(0,fs.__)("Top toolbar")}),(0,c.jsx)(Ay,{scope:"core",featureName:"distractionFree",onToggle:()=>{r("core","fixedToolbar",!0),o(!1),n(!1)},help:(0,fs.__)("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:(0,fs.__)("Distraction free")}),(0,c.jsx)(Ay,{scope:"core",featureName:"focusMode",help:(0,fs.__)("Highlights the current block and fades other content."),label:(0,fs.__)("Spotlight mode")}),e?.appearance]})},{name:"accessibility",tabLabel:(0,fs.__)("Accessibility"),content:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Dy,{title:(0,fs.__)("Navigation"),description:(0,fs.__)("Optimize the editing experience for enhanced control."),children:(0,c.jsx)(Ay,{scope:"core",featureName:"keepCaretInsideBlock",help:(0,fs.__)("Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users."),label:(0,fs.__)("Contain text cursor inside block")})}),(0,c.jsx)(Dy,{title:(0,fs.__)("Interface"),children:(0,c.jsx)(Ay,{scope:"core",featureName:"showIconLabels",label:(0,fs.__)("Show button text labels"),help:(0,fs.__)("Show text instead of icons on buttons across the interface.")})})]})},{name:"blocks",tabLabel:(0,fs.__)("Blocks"),content:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Dy,{title:(0,fs.__)("Inserter"),children:(0,c.jsx)(Ay,{scope:"core",featureName:"mostUsedBlocks",help:(0,fs.__)("Adds a category with the most frequently used blocks in the inserter."),label:(0,fs.__)("Show most used blocks")})}),(0,c.jsx)(Dy,{title:(0,fs.__)("Manage block visibility"),description:(0,fs.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."),children:(0,c.jsx)(Iy,{})})]})},window.__experimentalMediaProcessing&&{name:"media",tabLabel:(0,fs.__)("Media"),content:(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(Dy,{title:(0,fs.__)("General"),description:(0,fs.__)("Customize options related to the media upload flow."),children:[(0,c.jsx)(Ay,{scope:"core/media",featureName:"optimizeOnUpload",help:(0,fs.__)("Compress media items before uploading to the server."),label:(0,fs.__)("Pre-upload compression")}),(0,c.jsx)(Ay,{scope:"core/media",featureName:"requireApproval",help:(0,fs.__)("Require approval step when optimizing existing media."),label:(0,fs.__)("Approval step")})]})})}].filter(Boolean)),[s,e,o,n,r,t]);return(0,c.jsx)(Ry,{sections:i})}var Ly=function({postType:e}){const{registerPostTypeSchema:t}=$((0,d.useDispatch)(vc));(0,p.useEffect)((()=>{t(e)}),[t,e]);const{fields:s}=(0,d.useSelect)((t=>{const{getEntityFields:s}=$(t(vc));return{fields:s("postType",e)}}),[e]);return s};const Oy="content";var Fy={name:"core/pattern-overrides",getValues({select:e,clientId:t,context:s,bindings:n}){const o=s["pattern/overrides"],{getBlockAttributes:r}=e(g.store),i=r(t),a={};for(const e of Object.keys(n)){const t=o?.[i?.metadata?.name]?.[e];void 0!==t?a[e]=""===t?void 0:t:a[e]=i[e]}return a},setValues({select:e,dispatch:t,clientId:s,bindings:n}){const{getBlockAttributes:o,getBlockParentsByBlockName:r,getBlocks:i}=e(g.store),a=o(s),l=a?.metadata?.name;if(!l)return;const[c]=r(s,"core/block",!0),d=Object.entries(n).reduce(((e,[t,{newValue:s}])=>(e[t]=s,e)),{});if(!c){const e=s=>{for(const n of s)n.attributes?.metadata?.name===l&&t(g.store).updateBlockAttributes(n.clientId,d),e(n.innerBlocks)};return void e(i())}const u=o(c)?.[Oy];t(g.store).updateBlockAttributes(c,{[Oy]:{...u,[l]:{...u?.[l],...Object.entries(d).reduce(((e,[t,s])=>(e[t]=void 0===s?"":s,e)),{})}}})},canUserEditValue:()=>!0};const Vy=["core/navigation-link","core/navigation-submenu"],Uy=[{label:(0,fs.__)("Post Date"),args:{field:"date"},type:"string"},{label:(0,fs.__)("Post Modified Date"),args:{field:"modified"},type:"string"},{label:(0,fs.__)("Post Link"),args:{field:"link"},type:"string"}];var Hy={name:"core/post-data",getValues({select:e,context:t,bindings:s,clientId:n}){const o=Uy.map((e=>e.args.field)),{getBlockAttributes:r,getBlockName:i}=e(g.store),a=i?.(n);let l,c;if(Vy.includes(a)){const e=r?.(n);l=e?.id,c=e?.type}else l=t?.postId,c=t?.postType;const{getEditedEntityRecord:d}=e(u.store),p=d("postType",c,l),m={};for(const[e,t]of Object.entries(s))o.includes(t.args.field)?m[e]=p?.[t.args.field]??Uy.find((e=>e.args.field===t.args.field)).label:m[e]={};return m},setValues({dispatch:e,context:t,bindings:s,clientId:n,select:o}){const{getBlockName:r}=o(g.store),i=r?.(n);if(Vy.includes(i))return!1;const a={};Object.values(s).forEach((({args:e,newValue:t})=>{a[e.field]=t})),e(u.store).editEntityRecord("postType",t?.postType,t?.postId,a)},canUserEditValue({select:e,context:t}){const{getBlockName:s,getSelectedBlockClientId:n}=e(g.store),o=n(),r=s?.(o);if(Vy.includes(r))return!1;if(t?.query||t?.queryId)return!1;if(!t?.postType)return!1;return!!e(u.store).canUser("update",{kind:"postType",name:t?.postType,id:t?.postId})},getFieldsList({select:e}){const t=e(g.store).getSelectedBlock();return"core/post-date"!==t?.name||Vy.includes(t?.name)?[]:Uy}};function zy(e,t){const{getRegisteredPostMeta:s}=$(e(u.store)),n=s(t?.postType),o=[];return Object.entries(n).forEach((([e,t])=>{"footnotes"!==e&&"_"!==e.charAt(0)&&o.push({label:t.title||e,args:{key:e},default:t.default,type:t.type})})),o}function Gy({select:e,context:t,args:s}){const n=zy(e,t).find((e=>e.args.key===s.key));if(!n)return s.key;if(!t?.postId)return n.default||n.label||s.key;const{getEditedEntityRecord:o}=e(u.store),r=o("postType",t?.postType,t?.postId).meta;return r?.[s.key]??n?.label??s.key}var $y={name:"core/post-meta",getValues({select:e,context:t,bindings:s}){const n={};for(const[o,r]of Object.entries(s))n[o]=Gy({select:e,context:t,args:r.args});return n},setValues({dispatch:e,context:t,bindings:s}){const n={};Object.values(s).forEach((({args:e,newValue:t})=>{n[e.key]=t})),e(u.store).editEntityRecord("postType",t?.postType,t?.postId,{meta:n})},canUserEditValue({select:e,context:t,args:s}){if(t?.query||t?.queryId)return!1;if(!t?.postType)return!1;if(!zy(e,t).some((e=>e.args.key===s.key)))return!1;if(e(vc).getEditorSettings().enableCustomFields)return!1;return!!e(u.store).canUser("update",{kind:"postType",name:t?.postType,id:t?.postId})},getFieldsList:({select:e,context:t})=>zy(e,t).map((({default:e,...t})=>({...t})))};const Wy=["core/navigation-link","core/navigation-submenu"];function Zy(e,t){return{id:{label:(0,fs.__)("Term ID"),value:t,type:"string"},name:{label:(0,fs.__)("Name"),value:e?.name,type:"string"},slug:{label:(0,fs.__)("Slug"),value:e?.slug,type:"string"},link:{label:(0,fs.__)("Link"),value:e?.link,type:"string"},description:{label:(0,fs.__)("Description"),value:e?.description,type:"string"},parent:{label:(0,fs.__)("Parent ID"),value:e?.parent,type:"string"},count:{label:(0,fs.__)("Count"),value:`(${e?.count??0})`,type:"string"}}}function Yy(e,t,s){const{getEntityRecord:n}=e(u.store),{getBlockAttributes:o,getBlockName:r}=e(g.store);let i,a;const l=r?.(s);let c,d;if(Wy.includes(l)){const e=o?.(s);c=e?.id;const t=e?.type;d="tag"===t?"post_tag":t}else c=t?.termId,d=t?.taxonomy;return d&&c?(i=n("taxonomy",d,c),!i&&t?.termData&&(i=t.termData),i&&(a=Zy(i,c))):t?.termData&&(i=t.termData,a=Zy(i,i?.term_id)),a&&Object.keys(a).length?a:null}var qy={name:"core/term-data",usesContext:["taxonomy","termId","termData"],getValues({select:e,context:t,bindings:s,clientId:n}){const o=Yy(e,t,n),r={};for(const[e,t]of Object.entries(s)){const s=t.args.field,{value:n,label:i}=o?.[s]||{};r[e]=n??i??s}return r},setValues:({dispatch:e,context:t,bindings:s})=>!1,canUserEditValue({select:e,context:t,args:s}){const{getBlockName:n,getSelectedBlockClientId:o}=e(g.store),r=o(),i=n?.(r);if(Wy.includes(i))return!1;if(t?.termQuery)return!1;if(!t?.taxonomy||!t?.termId)return!1;Yy(e,t,void 0)?.[s.field];return!1},getFieldsList({select:e,context:t}){const s=e(g.store).getSelectedBlockClientId(),n=Yy(e,t,s);return n?Object.entries(n).map((([e,t])=>({label:t.label,type:t.type,args:{field:e}}))):[]}};const{store:Ky,...Qy}=i,Xy={};function Jy(e,t,s){const{registerEntityAction:n}=$((0,d.dispatch)(vc))}function ex(e,t,s){const{unregisterEntityAction:n}=$((0,d.dispatch)(vc))}function tx(e,t,s){const{registerEntityField:n}=$((0,d.dispatch)(vc))}function sx(e,t,s){const{unregisterEntityField:n}=$((0,d.dispatch)(vc))}G(Xy,{CreateTemplatePartModal:Jn,patternTitleField:ni,templateTitleField:Jr,BackButton:Xg,EntitiesSavedStatesExtensible:xd,Editor:Py,EditorContentSlotFill:Zg,GlobalStylesProvider:function({children:e}){const t=Ti();return t.isReady?(0,c.jsx)(Pi.Provider,{value:t,children:e}):null},mergeBaseAndUserConfigs:Ei,PluginPostExcerpt:lp,PostCardPanel:ff,PreferencesModal:function({extraSections:e={}}){const t=(0,d.useSelect)((e=>e(ja).isModalActive("editor/preferences")),[]),{closeModal:s}=(0,d.useDispatch)(ja);return t?(0,c.jsx)(Ny,{closeModal:s,children:(0,c.jsx)(My,{extraSections:e})}):null},usePostActions:cf,usePostFields:Ly,ToolsMoreMenuGroup:u_,ViewMoreMenuGroup:h_,ResizableEditor:U_,registerCoreBlockBindingsSources:function(){(0,x.registerBlockBindingsSource)(Fy),(0,x.registerBlockBindingsSource)(Hy),(0,x.registerBlockBindingsSource)($y),(0,x.registerBlockBindingsSource)(qy)},getTemplateInfo:Y,interfaceStore:Ky,...Qy})})(),(window.wp=window.wp||{}).editor=n})(); edit-site.js 0000644 00007034565 15121363547 0007024 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 66:
/***/ ((module) => {
"use strict";
var isMergeableObject = function isMergeableObject(value) {
return isNonNullObject(value)
&& !isSpecial(value)
};
function isNonNullObject(value) {
return !!value && typeof value === 'object'
}
function isSpecial(value) {
var stringValue = Object.prototype.toString.call(value);
return stringValue === '[object RegExp]'
|| stringValue === '[object Date]'
|| isReactElement(value)
}
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
function isReactElement(value) {
return value.$$typeof === REACT_ELEMENT_TYPE
}
function emptyTarget(val) {
return Array.isArray(val) ? [] : {}
}
function cloneUnlessOtherwiseSpecified(value, options) {
return (options.clone !== false && options.isMergeableObject(value))
? deepmerge(emptyTarget(value), value, options)
: value
}
function defaultArrayMerge(target, source, options) {
return target.concat(source).map(function(element) {
return cloneUnlessOtherwiseSpecified(element, options)
})
}
function getMergeFunction(key, options) {
if (!options.customMerge) {
return deepmerge
}
var customMerge = options.customMerge(key);
return typeof customMerge === 'function' ? customMerge : deepmerge
}
function getEnumerableOwnPropertySymbols(target) {
return Object.getOwnPropertySymbols
? Object.getOwnPropertySymbols(target).filter(function(symbol) {
return Object.propertyIsEnumerable.call(target, symbol)
})
: []
}
function getKeys(target) {
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
}
function propertyIsOnObject(object, property) {
try {
return property in object
} catch(_) {
return false
}
}
// Protects from prototype poisoning and unexpected merging up the prototype chain.
function propertyIsUnsafe(target, key) {
return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
}
function mergeObject(target, source, options) {
var destination = {};
if (options.isMergeableObject(target)) {
getKeys(target).forEach(function(key) {
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
});
}
getKeys(source).forEach(function(key) {
if (propertyIsUnsafe(target, key)) {
return
}
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
} else {
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
}
});
return destination
}
function deepmerge(target, source, options) {
options = options || {};
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
// implementations can use it. The caller may not replace it.
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
var sourceIsArray = Array.isArray(source);
var targetIsArray = Array.isArray(target);
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
if (!sourceAndTargetTypesMatch) {
return cloneUnlessOtherwiseSpecified(source, options)
} else if (sourceIsArray) {
return options.arrayMerge(target, source, options)
} else {
return mergeObject(target, source, options)
}
}
deepmerge.all = function deepmergeAll(array, options) {
if (!Array.isArray(array)) {
throw new Error('first argument should be an array')
}
return array.reduce(function(prev, next) {
return deepmerge(prev, next, options)
}, {})
};
var deepmerge_1 = deepmerge;
module.exports = deepmerge_1;
/***/ }),
/***/ 83:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var React = __webpack_require__(1609);
function is(x, y) {
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
}
var objectIs = "function" === typeof Object.is ? Object.is : is,
useState = React.useState,
useEffect = React.useEffect,
useLayoutEffect = React.useLayoutEffect,
useDebugValue = React.useDebugValue;
function useSyncExternalStore$2(subscribe, getSnapshot) {
var value = getSnapshot(),
_useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),
inst = _useState[0].inst,
forceUpdate = _useState[1];
useLayoutEffect(
function () {
inst.value = value;
inst.getSnapshot = getSnapshot;
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
},
[subscribe, value, getSnapshot]
);
useEffect(
function () {
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
return subscribe(function () {
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
});
},
[subscribe]
);
useDebugValue(value);
return value;
}
function checkIfSnapshotChanged(inst) {
var latestGetSnapshot = inst.getSnapshot;
inst = inst.value;
try {
var nextValue = latestGetSnapshot();
return !objectIs(inst, nextValue);
} catch (error) {
return !0;
}
}
function useSyncExternalStore$1(subscribe, getSnapshot) {
return getSnapshot();
}
var shim =
"undefined" === typeof window ||
"undefined" === typeof window.document ||
"undefined" === typeof window.document.createElement
? useSyncExternalStore$1
: useSyncExternalStore$2;
exports.useSyncExternalStore =
void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
/***/ }),
/***/ 422:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
if (true) {
module.exports = __webpack_require__(83);
} else {}
/***/ }),
/***/ 1233:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["preferences"];
/***/ }),
/***/ 1609:
/***/ ((module) => {
"use strict";
module.exports = window["React"];
/***/ }),
/***/ 4660:
/***/ ((module) => {
/**
* Credits:
*
* lib-font
* https://github.com/Pomax/lib-font
* https://github.com/Pomax/lib-font/blob/master/lib/inflate.js
*
* The MIT License (MIT)
*
* Copyright (c) 2020 pomax@nihongoresources.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/* eslint eslint-comments/no-unlimited-disable: 0 */
/* eslint-disable */
/* pako 1.0.10 nodeca/pako */(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=undefined;if(!f&&c)return require(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=undefined,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
'use strict';
var TYPED_OK = (typeof Uint8Array !== 'undefined') &&
(typeof Uint16Array !== 'undefined') &&
(typeof Int32Array !== 'undefined');
function _has(obj, key) {
return Object.prototype.hasOwnProperty.call(obj, key);
}
exports.assign = function (obj /*from1, from2, from3, ...*/) {
var sources = Array.prototype.slice.call(arguments, 1);
while (sources.length) {
var source = sources.shift();
if (!source) { continue; }
if (typeof source !== 'object') {
throw new TypeError(source + 'must be non-object');
}
for (var p in source) {
if (_has(source, p)) {
obj[p] = source[p];
}
}
}
return obj;
};
// reduce buffer size, avoiding mem copy
exports.shrinkBuf = function (buf, size) {
if (buf.length === size) { return buf; }
if (buf.subarray) { return buf.subarray(0, size); }
buf.length = size;
return buf;
};
var fnTyped = {
arraySet: function (dest, src, src_offs, len, dest_offs) {
if (src.subarray && dest.subarray) {
dest.set(src.subarray(src_offs, src_offs + len), dest_offs);
return;
}
// Fallback to ordinary array
for (var i = 0; i < len; i++) {
dest[dest_offs + i] = src[src_offs + i];
}
},
// Join array of chunks to single array.
flattenChunks: function (chunks) {
var i, l, len, pos, chunk, result;
// calculate data length
len = 0;
for (i = 0, l = chunks.length; i < l; i++) {
len += chunks[i].length;
}
// join chunks
result = new Uint8Array(len);
pos = 0;
for (i = 0, l = chunks.length; i < l; i++) {
chunk = chunks[i];
result.set(chunk, pos);
pos += chunk.length;
}
return result;
}
};
var fnUntyped = {
arraySet: function (dest, src, src_offs, len, dest_offs) {
for (var i = 0; i < len; i++) {
dest[dest_offs + i] = src[src_offs + i];
}
},
// Join array of chunks to single array.
flattenChunks: function (chunks) {
return [].concat.apply([], chunks);
}
};
// Enable/Disable typed arrays use, for testing
//
exports.setTyped = function (on) {
if (on) {
exports.Buf8 = Uint8Array;
exports.Buf16 = Uint16Array;
exports.Buf32 = Int32Array;
exports.assign(exports, fnTyped);
} else {
exports.Buf8 = Array;
exports.Buf16 = Array;
exports.Buf32 = Array;
exports.assign(exports, fnUntyped);
}
};
exports.setTyped(TYPED_OK);
},{}],2:[function(require,module,exports){
// String encode/decode helpers
'use strict';
var utils = require('./common');
// Quick check if we can use fast array to bin string conversion
//
// - apply(Array) can fail on Android 2.2
// - apply(Uint8Array) can fail on iOS 5.1 Safari
//
var STR_APPLY_OK = true;
var STR_APPLY_UIA_OK = true;
try { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }
try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }
// Table with utf8 lengths (calculated by first byte of sequence)
// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
// because max possible codepoint is 0x10ffff
var _utf8len = new utils.Buf8(256);
for (var q = 0; q < 256; q++) {
_utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);
}
_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start
// convert string to array (typed, when possible)
exports.string2buf = function (str) {
var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
// count binary size
for (m_pos = 0; m_pos < str_len; m_pos++) {
c = str.charCodeAt(m_pos);
if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
c2 = str.charCodeAt(m_pos + 1);
if ((c2 & 0xfc00) === 0xdc00) {
c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
m_pos++;
}
}
buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;
}
// allocate buffer
buf = new utils.Buf8(buf_len);
// convert
for (i = 0, m_pos = 0; i < buf_len; m_pos++) {
c = str.charCodeAt(m_pos);
if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
c2 = str.charCodeAt(m_pos + 1);
if ((c2 & 0xfc00) === 0xdc00) {
c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
m_pos++;
}
}
if (c < 0x80) {
/* one byte */
buf[i++] = c;
} else if (c < 0x800) {
/* two bytes */
buf[i++] = 0xC0 | (c >>> 6);
buf[i++] = 0x80 | (c & 0x3f);
} else if (c < 0x10000) {
/* three bytes */
buf[i++] = 0xE0 | (c >>> 12);
buf[i++] = 0x80 | (c >>> 6 & 0x3f);
buf[i++] = 0x80 | (c & 0x3f);
} else {
/* four bytes */
buf[i++] = 0xf0 | (c >>> 18);
buf[i++] = 0x80 | (c >>> 12 & 0x3f);
buf[i++] = 0x80 | (c >>> 6 & 0x3f);
buf[i++] = 0x80 | (c & 0x3f);
}
}
return buf;
};
// Helper (used in 2 places)
function buf2binstring(buf, len) {
// On Chrome, the arguments in a function call that are allowed is `65534`.
// If the length of the buffer is smaller than that, we can use this optimization,
// otherwise we will take a slower path.
if (len < 65534) {
if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {
return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));
}
}
var result = '';
for (var i = 0; i < len; i++) {
result += String.fromCharCode(buf[i]);
}
return result;
}
// Convert byte array to binary string
exports.buf2binstring = function (buf) {
return buf2binstring(buf, buf.length);
};
// Convert binary string (typed, when possible)
exports.binstring2buf = function (str) {
var buf = new utils.Buf8(str.length);
for (var i = 0, len = buf.length; i < len; i++) {
buf[i] = str.charCodeAt(i);
}
return buf;
};
// convert array to string
exports.buf2string = function (buf, max) {
var i, out, c, c_len;
var len = max || buf.length;
// Reserve max possible length (2 words per char)
// NB: by unknown reasons, Array is significantly faster for
// String.fromCharCode.apply than Uint16Array.
var utf16buf = new Array(len * 2);
for (out = 0, i = 0; i < len;) {
c = buf[i++];
// quick process ascii
if (c < 0x80) { utf16buf[out++] = c; continue; }
c_len = _utf8len[c];
// skip 5 & 6 byte codes
if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }
// apply mask on first byte
c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;
// join the rest
while (c_len > 1 && i < len) {
c = (c << 6) | (buf[i++] & 0x3f);
c_len--;
}
// terminated by end of string?
if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }
if (c < 0x10000) {
utf16buf[out++] = c;
} else {
c -= 0x10000;
utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);
utf16buf[out++] = 0xdc00 | (c & 0x3ff);
}
}
return buf2binstring(utf16buf, out);
};
// Calculate max possible position in utf8 buffer,
// that will not break sequence. If that's not possible
// - (very small limits) return max size as is.
//
// buf[] - utf8 bytes array
// max - length limit (mandatory);
exports.utf8border = function (buf, max) {
var pos;
max = max || buf.length;
if (max > buf.length) { max = buf.length; }
// go back from last position, until start of sequence found
pos = max - 1;
while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }
// Very small and broken sequence,
// return max, because we should return something anyway.
if (pos < 0) { return max; }
// If we came to start of buffer - that means buffer is too small,
// return max too.
if (pos === 0) { return max; }
return (pos + _utf8len[buf[pos]] > max) ? pos : max;
};
},{"./common":1}],3:[function(require,module,exports){
'use strict';
// Note: adler32 takes 12% for level 0 and 2% for level 6.
// It isn't worth it to make additional optimizations as in original.
// Small size is preferable.
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
function adler32(adler, buf, len, pos) {
var s1 = (adler & 0xffff) |0,
s2 = ((adler >>> 16) & 0xffff) |0,
n = 0;
while (len !== 0) {
// Set limit ~ twice less than 5552, to keep
// s2 in 31-bits, because we force signed ints.
// in other case %= will fail.
n = len > 2000 ? 2000 : len;
len -= n;
do {
s1 = (s1 + buf[pos++]) |0;
s2 = (s2 + s1) |0;
} while (--n);
s1 %= 65521;
s2 %= 65521;
}
return (s1 | (s2 << 16)) |0;
}
module.exports = adler32;
},{}],4:[function(require,module,exports){
'use strict';
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
module.exports = {
/* Allowed flush values; see deflate() and inflate() below for details */
Z_NO_FLUSH: 0,
Z_PARTIAL_FLUSH: 1,
Z_SYNC_FLUSH: 2,
Z_FULL_FLUSH: 3,
Z_FINISH: 4,
Z_BLOCK: 5,
Z_TREES: 6,
/* Return codes for the compression/decompression functions. Negative values
* are errors, positive values are used for special but normal events.
*/
Z_OK: 0,
Z_STREAM_END: 1,
Z_NEED_DICT: 2,
Z_ERRNO: -1,
Z_STREAM_ERROR: -2,
Z_DATA_ERROR: -3,
//Z_MEM_ERROR: -4,
Z_BUF_ERROR: -5,
//Z_VERSION_ERROR: -6,
/* compression levels */
Z_NO_COMPRESSION: 0,
Z_BEST_SPEED: 1,
Z_BEST_COMPRESSION: 9,
Z_DEFAULT_COMPRESSION: -1,
Z_FILTERED: 1,
Z_HUFFMAN_ONLY: 2,
Z_RLE: 3,
Z_FIXED: 4,
Z_DEFAULT_STRATEGY: 0,
/* Possible values of the data_type field (though see inflate()) */
Z_BINARY: 0,
Z_TEXT: 1,
//Z_ASCII: 1, // = Z_TEXT (deprecated)
Z_UNKNOWN: 2,
/* The deflate compression method */
Z_DEFLATED: 8
//Z_NULL: null // Use -1 or null inline, depending on var type
};
},{}],5:[function(require,module,exports){
'use strict';
// Note: we can't get significant speed boost here.
// So write code to minimize size - no pregenerated tables
// and array tools dependencies.
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
// Use ordinary array, since untyped makes no boost here
function makeTable() {
var c, table = [];
for (var n = 0; n < 256; n++) {
c = n;
for (var k = 0; k < 8; k++) {
c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
}
table[n] = c;
}
return table;
}
// Create table on load. Just 255 signed longs. Not a problem.
var crcTable = makeTable();
function crc32(crc, buf, len, pos) {
var t = crcTable,
end = pos + len;
crc ^= -1;
for (var i = pos; i < end; i++) {
crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
}
return (crc ^ (-1)); // >>> 0;
}
module.exports = crc32;
},{}],6:[function(require,module,exports){
'use strict';
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
function GZheader() {
/* true if compressed data believed to be text */
this.text = 0;
/* modification time */
this.time = 0;
/* extra flags (not used when writing a gzip file) */
this.xflags = 0;
/* operating system */
this.os = 0;
/* pointer to extra field or Z_NULL if none */
this.extra = null;
/* extra field length (valid if extra != Z_NULL) */
this.extra_len = 0; // Actually, we don't need it in JS,
// but leave for few code modifications
//
// Setup limits is not necessary because in js we should not preallocate memory
// for inflate use constant limit in 65536 bytes
//
/* space at extra (only when reading header) */
// this.extra_max = 0;
/* pointer to zero-terminated file name or Z_NULL */
this.name = '';
/* space at name (only when reading header) */
// this.name_max = 0;
/* pointer to zero-terminated comment or Z_NULL */
this.comment = '';
/* space at comment (only when reading header) */
// this.comm_max = 0;
/* true if there was or will be a header crc */
this.hcrc = 0;
/* true when done reading gzip header (not used when writing a gzip file) */
this.done = false;
}
module.exports = GZheader;
},{}],7:[function(require,module,exports){
'use strict';
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
// See state defs from inflate.js
var BAD = 30; /* got a data error -- remain here until reset */
var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
/*
Decode literal, length, and distance codes and write out the resulting
literal and match bytes until either not enough input or output is
available, an end-of-block is encountered, or a data error is encountered.
When large enough input and output buffers are supplied to inflate(), for
example, a 16K input buffer and a 64K output buffer, more than 95% of the
inflate execution time is spent in this routine.
Entry assumptions:
state.mode === LEN
strm.avail_in >= 6
strm.avail_out >= 258
start >= strm.avail_out
state.bits < 8
On return, state.mode is one of:
LEN -- ran out of enough output space or enough available input
TYPE -- reached end of block code, inflate() to interpret next block
BAD -- error in block data
Notes:
- The maximum input bits used by a length/distance pair is 15 bits for the
length code, 5 bits for the length extra, 15 bits for the distance code,
and 13 bits for the distance extra. This totals 48 bits, or six bytes.
Therefore if strm.avail_in >= 6, then there is enough input to avoid
checking for available input while decoding.
- The maximum bytes that a single length/distance pair can output is 258
bytes, which is the maximum length that can be coded. inflate_fast()
requires strm.avail_out >= 258 for each loop to avoid checking for
output space.
*/
module.exports = function inflate_fast(strm, start) {
var state;
var _in; /* local strm.input */
var last; /* have enough input while in < last */
var _out; /* local strm.output */
var beg; /* inflate()'s initial strm.output */
var end; /* while out < end, enough space available */
//#ifdef INFLATE_STRICT
var dmax; /* maximum distance from zlib header */
//#endif
var wsize; /* window size or zero if not using window */
var whave; /* valid bytes in the window */
var wnext; /* window write index */
// Use `s_window` instead `window`, avoid conflict with instrumentation tools
var s_window; /* allocated sliding window, if wsize != 0 */
var hold; /* local strm.hold */
var bits; /* local strm.bits */
var lcode; /* local strm.lencode */
var dcode; /* local strm.distcode */
var lmask; /* mask for first level of length codes */
var dmask; /* mask for first level of distance codes */
var here; /* retrieved table entry */
var op; /* code bits, operation, extra bits, or */
/* window position, window bytes to copy */
var len; /* match length, unused bytes */
var dist; /* match distance */
var from; /* where to copy match from */
var from_source;
var input, output; // JS specific, because we have no pointers
/* copy state to local variables */
state = strm.state;
//here = state.here;
_in = strm.next_in;
input = strm.input;
last = _in + (strm.avail_in - 5);
_out = strm.next_out;
output = strm.output;
beg = _out - (start - strm.avail_out);
end = _out + (strm.avail_out - 257);
//#ifdef INFLATE_STRICT
dmax = state.dmax;
//#endif
wsize = state.wsize;
whave = state.whave;
wnext = state.wnext;
s_window = state.window;
hold = state.hold;
bits = state.bits;
lcode = state.lencode;
dcode = state.distcode;
lmask = (1 << state.lenbits) - 1;
dmask = (1 << state.distbits) - 1;
/* decode literals and length/distances until end-of-block or not enough
input data or output space */
top:
do {
if (bits < 15) {
hold += input[_in++] << bits;
bits += 8;
hold += input[_in++] << bits;
bits += 8;
}
here = lcode[hold & lmask];
dolen:
for (;;) { // Goto emulation
op = here >>> 24/*here.bits*/;
hold >>>= op;
bits -= op;
op = (here >>> 16) & 0xff/*here.op*/;
if (op === 0) { /* literal */
//Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
// "inflate: literal '%c'\n" :
// "inflate: literal 0x%02x\n", here.val));
output[_out++] = here & 0xffff/*here.val*/;
}
else if (op & 16) { /* length base */
len = here & 0xffff/*here.val*/;
op &= 15; /* number of extra bits */
if (op) {
if (bits < op) {
hold += input[_in++] << bits;
bits += 8;
}
len += hold & ((1 << op) - 1);
hold >>>= op;
bits -= op;
}
//Tracevv((stderr, "inflate: length %u\n", len));
if (bits < 15) {
hold += input[_in++] << bits;
bits += 8;
hold += input[_in++] << bits;
bits += 8;
}
here = dcode[hold & dmask];
dodist:
for (;;) { // goto emulation
op = here >>> 24/*here.bits*/;
hold >>>= op;
bits -= op;
op = (here >>> 16) & 0xff/*here.op*/;
if (op & 16) { /* distance base */
dist = here & 0xffff/*here.val*/;
op &= 15; /* number of extra bits */
if (bits < op) {
hold += input[_in++] << bits;
bits += 8;
if (bits < op) {
hold += input[_in++] << bits;
bits += 8;
}
}
dist += hold & ((1 << op) - 1);
//#ifdef INFLATE_STRICT
if (dist > dmax) {
strm.msg = 'invalid distance too far back';
state.mode = BAD;
break top;
}
//#endif
hold >>>= op;
bits -= op;
//Tracevv((stderr, "inflate: distance %u\n", dist));
op = _out - beg; /* max distance in output */
if (dist > op) { /* see if copy from window */
op = dist - op; /* distance back in window */
if (op > whave) {
if (state.sane) {
strm.msg = 'invalid distance too far back';
state.mode = BAD;
break top;
}
// (!) This block is disabled in zlib defaults,
// don't enable it for binary compatibility
//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
// if (len <= op - whave) {
// do {
// output[_out++] = 0;
// } while (--len);
// continue top;
// }
// len -= op - whave;
// do {
// output[_out++] = 0;
// } while (--op > whave);
// if (op === 0) {
// from = _out - dist;
// do {
// output[_out++] = output[from++];
// } while (--len);
// continue top;
// }
//#endif
}
from = 0; // window index
from_source = s_window;
if (wnext === 0) { /* very common case */
from += wsize - op;
if (op < len) { /* some from window */
len -= op;
do {
output[_out++] = s_window[from++];
} while (--op);
from = _out - dist; /* rest from output */
from_source = output;
}
}
else if (wnext < op) { /* wrap around window */
from += wsize + wnext - op;
op -= wnext;
if (op < len) { /* some from end of window */
len -= op;
do {
output[_out++] = s_window[from++];
} while (--op);
from = 0;
if (wnext < len) { /* some from start of window */
op = wnext;
len -= op;
do {
output[_out++] = s_window[from++];
} while (--op);
from = _out - dist; /* rest from output */
from_source = output;
}
}
}
else { /* contiguous in window */
from += wnext - op;
if (op < len) { /* some from window */
len -= op;
do {
output[_out++] = s_window[from++];
} while (--op);
from = _out - dist; /* rest from output */
from_source = output;
}
}
while (len > 2) {
output[_out++] = from_source[from++];
output[_out++] = from_source[from++];
output[_out++] = from_source[from++];
len -= 3;
}
if (len) {
output[_out++] = from_source[from++];
if (len > 1) {
output[_out++] = from_source[from++];
}
}
}
else {
from = _out - dist; /* copy direct from output */
do { /* minimum length is three */
output[_out++] = output[from++];
output[_out++] = output[from++];
output[_out++] = output[from++];
len -= 3;
} while (len > 2);
if (len) {
output[_out++] = output[from++];
if (len > 1) {
output[_out++] = output[from++];
}
}
}
}
else if ((op & 64) === 0) { /* 2nd level distance code */
here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
continue dodist;
}
else {
strm.msg = 'invalid distance code';
state.mode = BAD;
break top;
}
break; // need to emulate goto via "continue"
}
}
else if ((op & 64) === 0) { /* 2nd level length code */
here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
continue dolen;
}
else if (op & 32) { /* end-of-block */
//Tracevv((stderr, "inflate: end of block\n"));
state.mode = TYPE;
break top;
}
else {
strm.msg = 'invalid literal/length code';
state.mode = BAD;
break top;
}
break; // need to emulate goto via "continue"
}
} while (_in < last && _out < end);
/* return unused bytes (on entry, bits < 8, so in won't go too far back) */
len = bits >> 3;
_in -= len;
bits -= len << 3;
hold &= (1 << bits) - 1;
/* update state and return */
strm.next_in = _in;
strm.next_out = _out;
strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));
strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
state.hold = hold;
state.bits = bits;
return;
};
},{}],8:[function(require,module,exports){
'use strict';
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
var utils = require('../utils/common');
var adler32 = require('./adler32');
var crc32 = require('./crc32');
var inflate_fast = require('./inffast');
var inflate_table = require('./inftrees');
var CODES = 0;
var LENS = 1;
var DISTS = 2;
/* Public constants ==========================================================*/
/* ===========================================================================*/
/* Allowed flush values; see deflate() and inflate() below for details */
//var Z_NO_FLUSH = 0;
//var Z_PARTIAL_FLUSH = 1;
//var Z_SYNC_FLUSH = 2;
//var Z_FULL_FLUSH = 3;
var Z_FINISH = 4;
var Z_BLOCK = 5;
var Z_TREES = 6;
/* Return codes for the compression/decompression functions. Negative values
* are errors, positive values are used for special but normal events.
*/
var Z_OK = 0;
var Z_STREAM_END = 1;
var Z_NEED_DICT = 2;
//var Z_ERRNO = -1;
var Z_STREAM_ERROR = -2;
var Z_DATA_ERROR = -3;
var Z_MEM_ERROR = -4;
var Z_BUF_ERROR = -5;
//var Z_VERSION_ERROR = -6;
/* The deflate compression method */
var Z_DEFLATED = 8;
/* STATES ====================================================================*/
/* ===========================================================================*/
var HEAD = 1; /* i: waiting for magic header */
var FLAGS = 2; /* i: waiting for method and flags (gzip) */
var TIME = 3; /* i: waiting for modification time (gzip) */
var OS = 4; /* i: waiting for extra flags and operating system (gzip) */
var EXLEN = 5; /* i: waiting for extra length (gzip) */
var EXTRA = 6; /* i: waiting for extra bytes (gzip) */
var NAME = 7; /* i: waiting for end of file name (gzip) */
var COMMENT = 8; /* i: waiting for end of comment (gzip) */
var HCRC = 9; /* i: waiting for header crc (gzip) */
var DICTID = 10; /* i: waiting for dictionary check value */
var DICT = 11; /* waiting for inflateSetDictionary() call */
var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */
var STORED = 14; /* i: waiting for stored size (length and complement) */
var COPY_ = 15; /* i/o: same as COPY below, but only first time in */
var COPY = 16; /* i/o: waiting for input or output to copy stored block */
var TABLE = 17; /* i: waiting for dynamic block table lengths */
var LENLENS = 18; /* i: waiting for code length code lengths */
var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */
var LEN_ = 20; /* i: same as LEN below, but only first time in */
var LEN = 21; /* i: waiting for length/lit/eob code */
var LENEXT = 22; /* i: waiting for length extra bits */
var DIST = 23; /* i: waiting for distance code */
var DISTEXT = 24; /* i: waiting for distance extra bits */
var MATCH = 25; /* o: waiting for output space to copy string */
var LIT = 26; /* o: waiting for output space to write literal */
var CHECK = 27; /* i: waiting for 32-bit check value */
var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */
var DONE = 29; /* finished check, done -- remain here until reset */
var BAD = 30; /* got a data error -- remain here until reset */
var MEM = 31; /* got an inflate() memory error -- remain here until reset */
var SYNC = 32; /* looking for synchronization bytes to restart inflate() */
/* ===========================================================================*/
var ENOUGH_LENS = 852;
var ENOUGH_DISTS = 592;
//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
var MAX_WBITS = 15;
/* 32K LZ77 window */
var DEF_WBITS = MAX_WBITS;
function zswap32(q) {
return (((q >>> 24) & 0xff) +
((q >>> 8) & 0xff00) +
((q & 0xff00) << 8) +
((q & 0xff) << 24));
}
function InflateState() {
this.mode = 0; /* current inflate mode */
this.last = false; /* true if processing last block */
this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
this.havedict = false; /* true if dictionary provided */
this.flags = 0; /* gzip header method and flags (0 if zlib) */
this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */
this.check = 0; /* protected copy of check value */
this.total = 0; /* protected copy of output count */
// TODO: may be {}
this.head = null; /* where to save gzip header information */
/* sliding window */
this.wbits = 0; /* log base 2 of requested window size */
this.wsize = 0; /* window size or zero if not using window */
this.whave = 0; /* valid bytes in the window */
this.wnext = 0; /* window write index */
this.window = null; /* allocated sliding window, if needed */
/* bit accumulator */
this.hold = 0; /* input bit accumulator */
this.bits = 0; /* number of bits in "in" */
/* for string and stored block copying */
this.length = 0; /* literal or length of data to copy */
this.offset = 0; /* distance back to copy string from */
/* for table and code decoding */
this.extra = 0; /* extra bits needed */
/* fixed and dynamic code tables */
this.lencode = null; /* starting table for length/literal codes */
this.distcode = null; /* starting table for distance codes */
this.lenbits = 0; /* index bits for lencode */
this.distbits = 0; /* index bits for distcode */
/* dynamic table building */
this.ncode = 0; /* number of code length code lengths */
this.nlen = 0; /* number of length code lengths */
this.ndist = 0; /* number of distance code lengths */
this.have = 0; /* number of code lengths in lens[] */
this.next = null; /* next available space in codes[] */
this.lens = new utils.Buf16(320); /* temporary storage for code lengths */
this.work = new utils.Buf16(288); /* work area for code table building */
/*
because we don't have pointers in js, we use lencode and distcode directly
as buffers so we don't need codes
*/
//this.codes = new utils.Buf32(ENOUGH); /* space for code tables */
this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */
this.distdyn = null; /* dynamic table for distance codes (JS specific) */
this.sane = 0; /* if false, allow invalid distance too far */
this.back = 0; /* bits back of last unprocessed length/lit */
this.was = 0; /* initial length of match */
}
function inflateResetKeep(strm) {
var state;
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
state = strm.state;
strm.total_in = strm.total_out = state.total = 0;
strm.msg = ''; /*Z_NULL*/
if (state.wrap) { /* to support ill-conceived Java test suite */
strm.adler = state.wrap & 1;
}
state.mode = HEAD;
state.last = 0;
state.havedict = 0;
state.dmax = 32768;
state.head = null/*Z_NULL*/;
state.hold = 0;
state.bits = 0;
//state.lencode = state.distcode = state.next = state.codes;
state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);
state.sane = 1;
state.back = -1;
//Tracev((stderr, "inflate: reset\n"));
return Z_OK;
}
function inflateReset(strm) {
var state;
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
state = strm.state;
state.wsize = 0;
state.whave = 0;
state.wnext = 0;
return inflateResetKeep(strm);
}
function inflateReset2(strm, windowBits) {
var wrap;
var state;
/* get the state */
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
state = strm.state;
/* extract wrap request from windowBits parameter */
if (windowBits < 0) {
wrap = 0;
windowBits = -windowBits;
}
else {
wrap = (windowBits >> 4) + 1;
if (windowBits < 48) {
windowBits &= 15;
}
}
/* set number of window bits, free window if different */
if (windowBits && (windowBits < 8 || windowBits > 15)) {
return Z_STREAM_ERROR;
}
if (state.window !== null && state.wbits !== windowBits) {
state.window = null;
}
/* update state and reset the rest of it */
state.wrap = wrap;
state.wbits = windowBits;
return inflateReset(strm);
}
function inflateInit2(strm, windowBits) {
var ret;
var state;
if (!strm) { return Z_STREAM_ERROR; }
//strm.msg = Z_NULL; /* in case we return an error */
state = new InflateState();
//if (state === Z_NULL) return Z_MEM_ERROR;
//Tracev((stderr, "inflate: allocated\n"));
strm.state = state;
state.window = null/*Z_NULL*/;
ret = inflateReset2(strm, windowBits);
if (ret !== Z_OK) {
strm.state = null/*Z_NULL*/;
}
return ret;
}
function inflateInit(strm) {
return inflateInit2(strm, DEF_WBITS);
}
/*
Return state with length and distance decoding tables and index sizes set to
fixed code decoding. Normally this returns fixed tables from inffixed.h.
If BUILDFIXED is defined, then instead this routine builds the tables the
first time it's called, and returns those tables the first time and
thereafter. This reduces the size of the code by about 2K bytes, in
exchange for a little execution time. However, BUILDFIXED should not be
used for threaded applications, since the rewriting of the tables and virgin
may not be thread-safe.
*/
var virgin = true;
var lenfix, distfix; // We have no pointers in JS, so keep tables separate
function fixedtables(state) {
/* build fixed huffman tables if first call (may not be thread safe) */
if (virgin) {
var sym;
lenfix = new utils.Buf32(512);
distfix = new utils.Buf32(32);
/* literal/length table */
sym = 0;
while (sym < 144) { state.lens[sym++] = 8; }
while (sym < 256) { state.lens[sym++] = 9; }
while (sym < 280) { state.lens[sym++] = 7; }
while (sym < 288) { state.lens[sym++] = 8; }
inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });
/* distance table */
sym = 0;
while (sym < 32) { state.lens[sym++] = 5; }
inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });
/* do this just once */
virgin = false;
}
state.lencode = lenfix;
state.lenbits = 9;
state.distcode = distfix;
state.distbits = 5;
}
/*
Update the window with the last wsize (normally 32K) bytes written before
returning. If window does not exist yet, create it. This is only called
when a window is already in use, or when output has been written during this
inflate call, but the end of the deflate stream has not been reached yet.
It is also called to create a window for dictionary data when a dictionary
is loaded.
Providing output buffers larger than 32K to inflate() should provide a speed
advantage, since only the last 32K of output is copied to the sliding window
upon return from inflate(), and since all distances after the first 32K of
output will fall in the output data, making match copies simpler and faster.
The advantage may be dependent on the size of the processor's data caches.
*/
function updatewindow(strm, src, end, copy) {
var dist;
var state = strm.state;
/* if it hasn't been done already, allocate space for the window */
if (state.window === null) {
state.wsize = 1 << state.wbits;
state.wnext = 0;
state.whave = 0;
state.window = new utils.Buf8(state.wsize);
}
/* copy state->wsize or less output bytes into the circular window */
if (copy >= state.wsize) {
utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);
state.wnext = 0;
state.whave = state.wsize;
}
else {
dist = state.wsize - state.wnext;
if (dist > copy) {
dist = copy;
}
//zmemcpy(state->window + state->wnext, end - copy, dist);
utils.arraySet(state.window, src, end - copy, dist, state.wnext);
copy -= dist;
if (copy) {
//zmemcpy(state->window, end - copy, copy);
utils.arraySet(state.window, src, end - copy, copy, 0);
state.wnext = copy;
state.whave = state.wsize;
}
else {
state.wnext += dist;
if (state.wnext === state.wsize) { state.wnext = 0; }
if (state.whave < state.wsize) { state.whave += dist; }
}
}
return 0;
}
function inflate(strm, flush) {
var state;
var input, output; // input/output buffers
var next; /* next input INDEX */
var put; /* next output INDEX */
var have, left; /* available input and output */
var hold; /* bit buffer */
var bits; /* bits in bit buffer */
var _in, _out; /* save starting available input and output */
var copy; /* number of stored or match bytes to copy */
var from; /* where to copy match bytes from */
var from_source;
var here = 0; /* current decoding table entry */
var here_bits, here_op, here_val; // paked "here" denormalized (JS specific)
//var last; /* parent table entry */
var last_bits, last_op, last_val; // paked "last" denormalized (JS specific)
var len; /* length to copy for repeats, bits to drop */
var ret; /* return code */
var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */
var opts;
var n; // temporary var for NEED_BITS
var order = /* permutation of code lengths */
[ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];
if (!strm || !strm.state || !strm.output ||
(!strm.input && strm.avail_in !== 0)) {
return Z_STREAM_ERROR;
}
state = strm.state;
if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */
//--- LOAD() ---
put = strm.next_out;
output = strm.output;
left = strm.avail_out;
next = strm.next_in;
input = strm.input;
have = strm.avail_in;
hold = state.hold;
bits = state.bits;
//---
_in = have;
_out = left;
ret = Z_OK;
inf_leave: // goto emulation
for (;;) {
switch (state.mode) {
case HEAD:
if (state.wrap === 0) {
state.mode = TYPEDO;
break;
}
//=== NEEDBITS(16);
while (bits < 16) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */
state.check = 0/*crc32(0L, Z_NULL, 0)*/;
//=== CRC2(state.check, hold);
hbuf[0] = hold & 0xff;
hbuf[1] = (hold >>> 8) & 0xff;
state.check = crc32(state.check, hbuf, 2, 0);
//===//
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = FLAGS;
break;
}
state.flags = 0; /* expect zlib header */
if (state.head) {
state.head.done = false;
}
if (!(state.wrap & 1) || /* check if zlib header allowed */
(((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {
strm.msg = 'incorrect header check';
state.mode = BAD;
break;
}
if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
strm.msg = 'unknown compression method';
state.mode = BAD;
break;
}
//--- DROPBITS(4) ---//
hold >>>= 4;
bits -= 4;
//---//
len = (hold & 0x0f)/*BITS(4)*/ + 8;
if (state.wbits === 0) {
state.wbits = len;
}
else if (len > state.wbits) {
strm.msg = 'invalid window size';
state.mode = BAD;
break;
}
state.dmax = 1 << len;
//Tracev((stderr, "inflate: zlib header ok\n"));
strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
state.mode = hold & 0x200 ? DICTID : TYPE;
//=== INITBITS();
hold = 0;
bits = 0;
//===//
break;
case FLAGS:
//=== NEEDBITS(16); */
while (bits < 16) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.flags = hold;
if ((state.flags & 0xff) !== Z_DEFLATED) {
strm.msg = 'unknown compression method';
state.mode = BAD;
break;
}
if (state.flags & 0xe000) {
strm.msg = 'unknown header flags set';
state.mode = BAD;
break;
}
if (state.head) {
state.head.text = ((hold >> 8) & 1);
}
if (state.flags & 0x0200) {
//=== CRC2(state.check, hold);
hbuf[0] = hold & 0xff;
hbuf[1] = (hold >>> 8) & 0xff;
state.check = crc32(state.check, hbuf, 2, 0);
//===//
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = TIME;
/* falls through */
case TIME:
//=== NEEDBITS(32); */
while (bits < 32) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if (state.head) {
state.head.time = hold;
}
if (state.flags & 0x0200) {
//=== CRC4(state.check, hold)
hbuf[0] = hold & 0xff;
hbuf[1] = (hold >>> 8) & 0xff;
hbuf[2] = (hold >>> 16) & 0xff;
hbuf[3] = (hold >>> 24) & 0xff;
state.check = crc32(state.check, hbuf, 4, 0);
//===
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = OS;
/* falls through */
case OS:
//=== NEEDBITS(16); */
while (bits < 16) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if (state.head) {
state.head.xflags = (hold & 0xff);
state.head.os = (hold >> 8);
}
if (state.flags & 0x0200) {
//=== CRC2(state.check, hold);
hbuf[0] = hold & 0xff;
hbuf[1] = (hold >>> 8) & 0xff;
state.check = crc32(state.check, hbuf, 2, 0);
//===//
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = EXLEN;
/* falls through */
case EXLEN:
if (state.flags & 0x0400) {
//=== NEEDBITS(16); */
while (bits < 16) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.length = hold;
if (state.head) {
state.head.extra_len = hold;
}
if (state.flags & 0x0200) {
//=== CRC2(state.check, hold);
hbuf[0] = hold & 0xff;
hbuf[1] = (hold >>> 8) & 0xff;
state.check = crc32(state.check, hbuf, 2, 0);
//===//
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
}
else if (state.head) {
state.head.extra = null/*Z_NULL*/;
}
state.mode = EXTRA;
/* falls through */
case EXTRA:
if (state.flags & 0x0400) {
copy = state.length;
if (copy > have) { copy = have; }
if (copy) {
if (state.head) {
len = state.head.extra_len - state.length;
if (!state.head.extra) {
// Use untyped array for more convenient processing later
state.head.extra = new Array(state.head.extra_len);
}
utils.arraySet(
state.head.extra,
input,
next,
// extra field is limited to 65536 bytes
// - no need for additional size check
copy,
/*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
len
);
//zmemcpy(state.head.extra + len, next,
// len + copy > state.head.extra_max ?
// state.head.extra_max - len : copy);
}
if (state.flags & 0x0200) {
state.check = crc32(state.check, input, copy, next);
}
have -= copy;
next += copy;
state.length -= copy;
}
if (state.length) { break inf_leave; }
}
state.length = 0;
state.mode = NAME;
/* falls through */
case NAME:
if (state.flags & 0x0800) {
if (have === 0) { break inf_leave; }
copy = 0;
do {
// TODO: 2 or 1 bytes?
len = input[next + copy++];
/* use constant limit because in js we should not preallocate memory */
if (state.head && len &&
(state.length < 65536 /*state.head.name_max*/)) {
state.head.name += String.fromCharCode(len);
}
} while (len && copy < have);
if (state.flags & 0x0200) {
state.check = crc32(state.check, input, copy, next);
}
have -= copy;
next += copy;
if (len) { break inf_leave; }
}
else if (state.head) {
state.head.name = null;
}
state.length = 0;
state.mode = COMMENT;
/* falls through */
case COMMENT:
if (state.flags & 0x1000) {
if (have === 0) { break inf_leave; }
copy = 0;
do {
len = input[next + copy++];
/* use constant limit because in js we should not preallocate memory */
if (state.head && len &&
(state.length < 65536 /*state.head.comm_max*/)) {
state.head.comment += String.fromCharCode(len);
}
} while (len && copy < have);
if (state.flags & 0x0200) {
state.check = crc32(state.check, input, copy, next);
}
have -= copy;
next += copy;
if (len) { break inf_leave; }
}
else if (state.head) {
state.head.comment = null;
}
state.mode = HCRC;
/* falls through */
case HCRC:
if (state.flags & 0x0200) {
//=== NEEDBITS(16); */
while (bits < 16) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if (hold !== (state.check & 0xffff)) {
strm.msg = 'header crc mismatch';
state.mode = BAD;
break;
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
}
if (state.head) {
state.head.hcrc = ((state.flags >> 9) & 1);
state.head.done = true;
}
strm.adler = state.check = 0;
state.mode = TYPE;
break;
case DICTID:
//=== NEEDBITS(32); */
while (bits < 32) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
strm.adler = state.check = zswap32(hold);
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = DICT;
/* falls through */
case DICT:
if (state.havedict === 0) {
//--- RESTORE() ---
strm.next_out = put;
strm.avail_out = left;
strm.next_in = next;
strm.avail_in = have;
state.hold = hold;
state.bits = bits;
//---
return Z_NEED_DICT;
}
strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
state.mode = TYPE;
/* falls through */
case TYPE:
if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
/* falls through */
case TYPEDO:
if (state.last) {
//--- BYTEBITS() ---//
hold >>>= bits & 7;
bits -= bits & 7;
//---//
state.mode = CHECK;
break;
}
//=== NEEDBITS(3); */
while (bits < 3) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.last = (hold & 0x01)/*BITS(1)*/;
//--- DROPBITS(1) ---//
hold >>>= 1;
bits -= 1;
//---//
switch ((hold & 0x03)/*BITS(2)*/) {
case 0: /* stored block */
//Tracev((stderr, "inflate: stored block%s\n",
// state.last ? " (last)" : ""));
state.mode = STORED;
break;
case 1: /* fixed block */
fixedtables(state);
//Tracev((stderr, "inflate: fixed codes block%s\n",
// state.last ? " (last)" : ""));
state.mode = LEN_; /* decode codes */
if (flush === Z_TREES) {
//--- DROPBITS(2) ---//
hold >>>= 2;
bits -= 2;
//---//
break inf_leave;
}
break;
case 2: /* dynamic block */
//Tracev((stderr, "inflate: dynamic codes block%s\n",
// state.last ? " (last)" : ""));
state.mode = TABLE;
break;
case 3:
strm.msg = 'invalid block type';
state.mode = BAD;
}
//--- DROPBITS(2) ---//
hold >>>= 2;
bits -= 2;
//---//
break;
case STORED:
//--- BYTEBITS() ---// /* go to byte boundary */
hold >>>= bits & 7;
bits -= bits & 7;
//---//
//=== NEEDBITS(32); */
while (bits < 32) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
strm.msg = 'invalid stored block lengths';
state.mode = BAD;
break;
}
state.length = hold & 0xffff;
//Tracev((stderr, "inflate: stored length %u\n",
// state.length));
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = COPY_;
if (flush === Z_TREES) { break inf_leave; }
/* falls through */
case COPY_:
state.mode = COPY;
/* falls through */
case COPY:
copy = state.length;
if (copy) {
if (copy > have) { copy = have; }
if (copy > left) { copy = left; }
if (copy === 0) { break inf_leave; }
//--- zmemcpy(put, next, copy); ---
utils.arraySet(output, input, next, copy, put);
//---//
have -= copy;
next += copy;
left -= copy;
put += copy;
state.length -= copy;
break;
}
//Tracev((stderr, "inflate: stored end\n"));
state.mode = TYPE;
break;
case TABLE:
//=== NEEDBITS(14); */
while (bits < 14) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;
//--- DROPBITS(5) ---//
hold >>>= 5;
bits -= 5;
//---//
state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;
//--- DROPBITS(5) ---//
hold >>>= 5;
bits -= 5;
//---//
state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;
//--- DROPBITS(4) ---//
hold >>>= 4;
bits -= 4;
//---//
//#ifndef PKZIP_BUG_WORKAROUND
if (state.nlen > 286 || state.ndist > 30) {
strm.msg = 'too many length or distance symbols';
state.mode = BAD;
break;
}
//#endif
//Tracev((stderr, "inflate: table sizes ok\n"));
state.have = 0;
state.mode = LENLENS;
/* falls through */
case LENLENS:
while (state.have < state.ncode) {
//=== NEEDBITS(3);
while (bits < 3) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);
//--- DROPBITS(3) ---//
hold >>>= 3;
bits -= 3;
//---//
}
while (state.have < 19) {
state.lens[order[state.have++]] = 0;
}
// We have separate tables & no pointers. 2 commented lines below not needed.
//state.next = state.codes;
//state.lencode = state.next;
// Switch to use dynamic table
state.lencode = state.lendyn;
state.lenbits = 7;
opts = { bits: state.lenbits };
ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
state.lenbits = opts.bits;
if (ret) {
strm.msg = 'invalid code lengths set';
state.mode = BAD;
break;
}
//Tracev((stderr, "inflate: code lengths ok\n"));
state.have = 0;
state.mode = CODELENS;
/* falls through */
case CODELENS:
while (state.have < state.nlen + state.ndist) {
for (;;) {
here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/
here_bits = here >>> 24;
here_op = (here >>> 16) & 0xff;
here_val = here & 0xffff;
if ((here_bits) <= bits) { break; }
//--- PULLBYTE() ---//
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
//---//
}
if (here_val < 16) {
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
state.lens[state.have++] = here_val;
}
else {
if (here_val === 16) {
//=== NEEDBITS(here.bits + 2);
n = here_bits + 2;
while (bits < n) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
if (state.have === 0) {
strm.msg = 'invalid bit length repeat';
state.mode = BAD;
break;
}
len = state.lens[state.have - 1];
copy = 3 + (hold & 0x03);//BITS(2);
//--- DROPBITS(2) ---//
hold >>>= 2;
bits -= 2;
//---//
}
else if (here_val === 17) {
//=== NEEDBITS(here.bits + 3);
n = here_bits + 3;
while (bits < n) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
len = 0;
copy = 3 + (hold & 0x07);//BITS(3);
//--- DROPBITS(3) ---//
hold >>>= 3;
bits -= 3;
//---//
}
else {
//=== NEEDBITS(here.bits + 7);
n = here_bits + 7;
while (bits < n) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
len = 0;
copy = 11 + (hold & 0x7f);//BITS(7);
//--- DROPBITS(7) ---//
hold >>>= 7;
bits -= 7;
//---//
}
if (state.have + copy > state.nlen + state.ndist) {
strm.msg = 'invalid bit length repeat';
state.mode = BAD;
break;
}
while (copy--) {
state.lens[state.have++] = len;
}
}
}
/* handle error breaks in while */
if (state.mode === BAD) { break; }
/* check for end-of-block code (better have one) */
if (state.lens[256] === 0) {
strm.msg = 'invalid code -- missing end-of-block';
state.mode = BAD;
break;
}
/* build code tables -- note: do not change the lenbits or distbits
values here (9 and 6) without reading the comments in inftrees.h
concerning the ENOUGH constants, which depend on those values */
state.lenbits = 9;
opts = { bits: state.lenbits };
ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
// We have separate tables & no pointers. 2 commented lines below not needed.
// state.next_index = opts.table_index;
state.lenbits = opts.bits;
// state.lencode = state.next;
if (ret) {
strm.msg = 'invalid literal/lengths set';
state.mode = BAD;
break;
}
state.distbits = 6;
//state.distcode.copy(state.codes);
// Switch to use dynamic table
state.distcode = state.distdyn;
opts = { bits: state.distbits };
ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
// We have separate tables & no pointers. 2 commented lines below not needed.
// state.next_index = opts.table_index;
state.distbits = opts.bits;
// state.distcode = state.next;
if (ret) {
strm.msg = 'invalid distances set';
state.mode = BAD;
break;
}
//Tracev((stderr, 'inflate: codes ok\n'));
state.mode = LEN_;
if (flush === Z_TREES) { break inf_leave; }
/* falls through */
case LEN_:
state.mode = LEN;
/* falls through */
case LEN:
if (have >= 6 && left >= 258) {
//--- RESTORE() ---
strm.next_out = put;
strm.avail_out = left;
strm.next_in = next;
strm.avail_in = have;
state.hold = hold;
state.bits = bits;
//---
inflate_fast(strm, _out);
//--- LOAD() ---
put = strm.next_out;
output = strm.output;
left = strm.avail_out;
next = strm.next_in;
input = strm.input;
have = strm.avail_in;
hold = state.hold;
bits = state.bits;
//---
if (state.mode === TYPE) {
state.back = -1;
}
break;
}
state.back = 0;
for (;;) {
here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/
here_bits = here >>> 24;
here_op = (here >>> 16) & 0xff;
here_val = here & 0xffff;
if (here_bits <= bits) { break; }
//--- PULLBYTE() ---//
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
//---//
}
if (here_op && (here_op & 0xf0) === 0) {
last_bits = here_bits;
last_op = here_op;
last_val = here_val;
for (;;) {
here = state.lencode[last_val +
((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
here_bits = here >>> 24;
here_op = (here >>> 16) & 0xff;
here_val = here & 0xffff;
if ((last_bits + here_bits) <= bits) { break; }
//--- PULLBYTE() ---//
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
//---//
}
//--- DROPBITS(last.bits) ---//
hold >>>= last_bits;
bits -= last_bits;
//---//
state.back += last_bits;
}
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
state.back += here_bits;
state.length = here_val;
if (here_op === 0) {
//Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
// "inflate: literal '%c'\n" :
// "inflate: literal 0x%02x\n", here.val));
state.mode = LIT;
break;
}
if (here_op & 32) {
//Tracevv((stderr, "inflate: end of block\n"));
state.back = -1;
state.mode = TYPE;
break;
}
if (here_op & 64) {
strm.msg = 'invalid literal/length code';
state.mode = BAD;
break;
}
state.extra = here_op & 15;
state.mode = LENEXT;
/* falls through */
case LENEXT:
if (state.extra) {
//=== NEEDBITS(state.extra);
n = state.extra;
while (bits < n) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
//--- DROPBITS(state.extra) ---//
hold >>>= state.extra;
bits -= state.extra;
//---//
state.back += state.extra;
}
//Tracevv((stderr, "inflate: length %u\n", state.length));
state.was = state.length;
state.mode = DIST;
/* falls through */
case DIST:
for (;;) {
here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/
here_bits = here >>> 24;
here_op = (here >>> 16) & 0xff;
here_val = here & 0xffff;
if ((here_bits) <= bits) { break; }
//--- PULLBYTE() ---//
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
//---//
}
if ((here_op & 0xf0) === 0) {
last_bits = here_bits;
last_op = here_op;
last_val = here_val;
for (;;) {
here = state.distcode[last_val +
((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
here_bits = here >>> 24;
here_op = (here >>> 16) & 0xff;
here_val = here & 0xffff;
if ((last_bits + here_bits) <= bits) { break; }
//--- PULLBYTE() ---//
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
//---//
}
//--- DROPBITS(last.bits) ---//
hold >>>= last_bits;
bits -= last_bits;
//---//
state.back += last_bits;
}
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
state.back += here_bits;
if (here_op & 64) {
strm.msg = 'invalid distance code';
state.mode = BAD;
break;
}
state.offset = here_val;
state.extra = (here_op) & 15;
state.mode = DISTEXT;
/* falls through */
case DISTEXT:
if (state.extra) {
//=== NEEDBITS(state.extra);
n = state.extra;
while (bits < n) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
//--- DROPBITS(state.extra) ---//
hold >>>= state.extra;
bits -= state.extra;
//---//
state.back += state.extra;
}
//#ifdef INFLATE_STRICT
if (state.offset > state.dmax) {
strm.msg = 'invalid distance too far back';
state.mode = BAD;
break;
}
//#endif
//Tracevv((stderr, "inflate: distance %u\n", state.offset));
state.mode = MATCH;
/* falls through */
case MATCH:
if (left === 0) { break inf_leave; }
copy = _out - left;
if (state.offset > copy) { /* copy from window */
copy = state.offset - copy;
if (copy > state.whave) {
if (state.sane) {
strm.msg = 'invalid distance too far back';
state.mode = BAD;
break;
}
// (!) This block is disabled in zlib defaults,
// don't enable it for binary compatibility
//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
// Trace((stderr, "inflate.c too far\n"));
// copy -= state.whave;
// if (copy > state.length) { copy = state.length; }
// if (copy > left) { copy = left; }
// left -= copy;
// state.length -= copy;
// do {
// output[put++] = 0;
// } while (--copy);
// if (state.length === 0) { state.mode = LEN; }
// break;
//#endif
}
if (copy > state.wnext) {
copy -= state.wnext;
from = state.wsize - copy;
}
else {
from = state.wnext - copy;
}
if (copy > state.length) { copy = state.length; }
from_source = state.window;
}
else { /* copy from output */
from_source = output;
from = put - state.offset;
copy = state.length;
}
if (copy > left) { copy = left; }
left -= copy;
state.length -= copy;
do {
output[put++] = from_source[from++];
} while (--copy);
if (state.length === 0) { state.mode = LEN; }
break;
case LIT:
if (left === 0) { break inf_leave; }
output[put++] = state.length;
left--;
state.mode = LEN;
break;
case CHECK:
if (state.wrap) {
//=== NEEDBITS(32);
while (bits < 32) {
if (have === 0) { break inf_leave; }
have--;
// Use '|' instead of '+' to make sure that result is signed
hold |= input[next++] << bits;
bits += 8;
}
//===//
_out -= left;
strm.total_out += _out;
state.total += _out;
if (_out) {
strm.adler = state.check =
/*UPDATE(state.check, put - _out, _out);*/
(state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));
}
_out = left;
// NB: crc32 stored as signed 32-bit int, zswap32 returns signed too
if ((state.flags ? hold : zswap32(hold)) !== state.check) {
strm.msg = 'incorrect data check';
state.mode = BAD;
break;
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
//Tracev((stderr, "inflate: check matches trailer\n"));
}
state.mode = LENGTH;
/* falls through */
case LENGTH:
if (state.wrap && state.flags) {
//=== NEEDBITS(32);
while (bits < 32) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if (hold !== (state.total & 0xffffffff)) {
strm.msg = 'incorrect length check';
state.mode = BAD;
break;
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
//Tracev((stderr, "inflate: length matches trailer\n"));
}
state.mode = DONE;
/* falls through */
case DONE:
ret = Z_STREAM_END;
break inf_leave;
case BAD:
ret = Z_DATA_ERROR;
break inf_leave;
case MEM:
return Z_MEM_ERROR;
case SYNC:
/* falls through */
default:
return Z_STREAM_ERROR;
}
}
// inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave"
/*
Return from inflate(), updating the total counts and the check value.
If there was no progress during the inflate() call, return a buffer
error. Call updatewindow() to create and/or update the window state.
Note: a memory error from inflate() is non-recoverable.
*/
//--- RESTORE() ---
strm.next_out = put;
strm.avail_out = left;
strm.next_in = next;
strm.avail_in = have;
state.hold = hold;
state.bits = bits;
//---
if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
(state.mode < CHECK || flush !== Z_FINISH))) {
if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
state.mode = MEM;
return Z_MEM_ERROR;
}
}
_in -= strm.avail_in;
_out -= strm.avail_out;
strm.total_in += _in;
strm.total_out += _out;
state.total += _out;
if (state.wrap && _out) {
strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
(state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));
}
strm.data_type = state.bits + (state.last ? 64 : 0) +
(state.mode === TYPE ? 128 : 0) +
(state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {
ret = Z_BUF_ERROR;
}
return ret;
}
function inflateEnd(strm) {
if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {
return Z_STREAM_ERROR;
}
var state = strm.state;
if (state.window) {
state.window = null;
}
strm.state = null;
return Z_OK;
}
function inflateGetHeader(strm, head) {
var state;
/* check state */
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
state = strm.state;
if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }
/* save header structure */
state.head = head;
head.done = false;
return Z_OK;
}
function inflateSetDictionary(strm, dictionary) {
var dictLength = dictionary.length;
var state;
var dictid;
var ret;
/* check state */
if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }
state = strm.state;
if (state.wrap !== 0 && state.mode !== DICT) {
return Z_STREAM_ERROR;
}
/* check for correct dictionary identifier */
if (state.mode === DICT) {
dictid = 1; /* adler32(0, null, 0)*/
/* dictid = adler32(dictid, dictionary, dictLength); */
dictid = adler32(dictid, dictionary, dictLength, 0);
if (dictid !== state.check) {
return Z_DATA_ERROR;
}
}
/* copy dictionary to window using updatewindow(), which will amend the
existing dictionary if appropriate */
ret = updatewindow(strm, dictionary, dictLength, dictLength);
if (ret) {
state.mode = MEM;
return Z_MEM_ERROR;
}
state.havedict = 1;
// Tracev((stderr, "inflate: dictionary set\n"));
return Z_OK;
}
exports.inflateReset = inflateReset;
exports.inflateReset2 = inflateReset2;
exports.inflateResetKeep = inflateResetKeep;
exports.inflateInit = inflateInit;
exports.inflateInit2 = inflateInit2;
exports.inflate = inflate;
exports.inflateEnd = inflateEnd;
exports.inflateGetHeader = inflateGetHeader;
exports.inflateSetDictionary = inflateSetDictionary;
exports.inflateInfo = 'pako inflate (from Nodeca project)';
/* Not implemented
exports.inflateCopy = inflateCopy;
exports.inflateGetDictionary = inflateGetDictionary;
exports.inflateMark = inflateMark;
exports.inflatePrime = inflatePrime;
exports.inflateSync = inflateSync;
exports.inflateSyncPoint = inflateSyncPoint;
exports.inflateUndermine = inflateUndermine;
*/
},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(require,module,exports){
'use strict';
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
var utils = require('../utils/common');
var MAXBITS = 15;
var ENOUGH_LENS = 852;
var ENOUGH_DISTS = 592;
//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
var CODES = 0;
var LENS = 1;
var DISTS = 2;
var lbase = [ /* Length codes 257..285 base */
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
];
var lext = [ /* Length codes 257..285 extra */
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78
];
var dbase = [ /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
8193, 12289, 16385, 24577, 0, 0
];
var dext = [ /* Distance codes 0..29 extra */
16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
28, 28, 29, 29, 64, 64
];
module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)
{
var bits = opts.bits;
//here = opts.here; /* table entry for duplication */
var len = 0; /* a code's length in bits */
var sym = 0; /* index of code symbols */
var min = 0, max = 0; /* minimum and maximum code lengths */
var root = 0; /* number of index bits for root table */
var curr = 0; /* number of index bits for current table */
var drop = 0; /* code bits to drop for sub-table */
var left = 0; /* number of prefix codes available */
var used = 0; /* code entries in table used */
var huff = 0; /* Huffman code */
var incr; /* for incrementing code, index */
var fill; /* index for replicating entries */
var low; /* low bits for current root entry */
var mask; /* mask for low root bits */
var next; /* next available space in table */
var base = null; /* base value table to use */
var base_index = 0;
// var shoextra; /* extra bits table to use */
var end; /* use base and extra for symbol > end */
var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */
var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */
var extra = null;
var extra_index = 0;
var here_bits, here_op, here_val;
/*
Process a set of code lengths to create a canonical Huffman code. The
code lengths are lens[0..codes-1]. Each length corresponds to the
symbols 0..codes-1. The Huffman code is generated by first sorting the
symbols by length from short to long, and retaining the symbol order
for codes with equal lengths. Then the code starts with all zero bits
for the first code of the shortest length, and the codes are integer
increments for the same length, and zeros are appended as the length
increases. For the deflate format, these bits are stored backwards
from their more natural integer increment ordering, and so when the
decoding tables are built in the large loop below, the integer codes
are incremented backwards.
This routine assumes, but does not check, that all of the entries in
lens[] are in the range 0..MAXBITS. The caller must assure this.
1..MAXBITS is interpreted as that code length. zero means that that
symbol does not occur in this code.
The codes are sorted by computing a count of codes for each length,
creating from that a table of starting indices for each length in the
sorted table, and then entering the symbols in order in the sorted
table. The sorted table is work[], with that space being provided by
the caller.
The length counts are used for other purposes as well, i.e. finding
the minimum and maximum length codes, determining if there are any
codes at all, checking for a valid set of lengths, and looking ahead
at length counts to determine sub-table sizes when building the
decoding tables.
*/
/* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
for (len = 0; len <= MAXBITS; len++) {
count[len] = 0;
}
for (sym = 0; sym < codes; sym++) {
count[lens[lens_index + sym]]++;
}
/* bound code lengths, force root to be within code lengths */
root = bits;
for (max = MAXBITS; max >= 1; max--) {
if (count[max] !== 0) { break; }
}
if (root > max) {
root = max;
}
if (max === 0) { /* no symbols to code at all */
//table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */
//table.bits[opts.table_index] = 1; //here.bits = (var char)1;
//table.val[opts.table_index++] = 0; //here.val = (var short)0;
table[table_index++] = (1 << 24) | (64 << 16) | 0;
//table.op[opts.table_index] = 64;
//table.bits[opts.table_index] = 1;
//table.val[opts.table_index++] = 0;
table[table_index++] = (1 << 24) | (64 << 16) | 0;
opts.bits = 1;
return 0; /* no symbols, but wait for decoding to report error */
}
for (min = 1; min < max; min++) {
if (count[min] !== 0) { break; }
}
if (root < min) {
root = min;
}
/* check for an over-subscribed or incomplete set of lengths */
left = 1;
for (len = 1; len <= MAXBITS; len++) {
left <<= 1;
left -= count[len];
if (left < 0) {
return -1;
} /* over-subscribed */
}
if (left > 0 && (type === CODES || max !== 1)) {
return -1; /* incomplete set */
}
/* generate offsets into symbol table for each length for sorting */
offs[1] = 0;
for (len = 1; len < MAXBITS; len++) {
offs[len + 1] = offs[len] + count[len];
}
/* sort symbols by length, by symbol order within each length */
for (sym = 0; sym < codes; sym++) {
if (lens[lens_index + sym] !== 0) {
work[offs[lens[lens_index + sym]]++] = sym;
}
}
/*
Create and fill in decoding tables. In this loop, the table being
filled is at next and has curr index bits. The code being used is huff
with length len. That code is converted to an index by dropping drop
bits off of the bottom. For codes where len is less than drop + curr,
those top drop + curr - len bits are incremented through all values to
fill the table with replicated entries.
root is the number of index bits for the root table. When len exceeds
root, sub-tables are created pointed to by the root entry with an index
of the low root bits of huff. This is saved in low to check for when a
new sub-table should be started. drop is zero when the root table is
being filled, and drop is root when sub-tables are being filled.
When a new sub-table is needed, it is necessary to look ahead in the
code lengths to determine what size sub-table is needed. The length
counts are used for this, and so count[] is decremented as codes are
entered in the tables.
used keeps track of how many table entries have been allocated from the
provided *table space. It is checked for LENS and DIST tables against
the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
the initial root table size constants. See the comments in inftrees.h
for more information.
sym increments through all symbols, and the loop terminates when
all codes of length max, i.e. all codes, have been processed. This
routine permits incomplete codes, so another loop after this one fills
in the rest of the decoding tables with invalid code markers.
*/
/* set up for code type */
// poor man optimization - use if-else instead of switch,
// to avoid deopts in old v8
if (type === CODES) {
base = extra = work; /* dummy value--not used */
end = 19;
} else if (type === LENS) {
base = lbase;
base_index -= 257;
extra = lext;
extra_index -= 257;
end = 256;
} else { /* DISTS */
base = dbase;
extra = dext;
end = -1;
}
/* initialize opts for loop */
huff = 0; /* starting code */
sym = 0; /* starting code symbol */
len = min; /* starting code length */
next = table_index; /* current table to fill in */
curr = root; /* current table index bits */
drop = 0; /* current bits to drop from code for index */
low = -1; /* trigger new sub-table when len > root */
used = 1 << root; /* use root table entries */
mask = used - 1; /* mask for comparing low */
/* check available table space */
if ((type === LENS && used > ENOUGH_LENS) ||
(type === DISTS && used > ENOUGH_DISTS)) {
return 1;
}
/* process all codes and make table entries */
for (;;) {
/* create table entry */
here_bits = len - drop;
if (work[sym] < end) {
here_op = 0;
here_val = work[sym];
}
else if (work[sym] > end) {
here_op = extra[extra_index + work[sym]];
here_val = base[base_index + work[sym]];
}
else {
here_op = 32 + 64; /* end of block */
here_val = 0;
}
/* replicate for those indices with low len bits equal to huff */
incr = 1 << (len - drop);
fill = 1 << curr;
min = fill; /* save offset to next table */
do {
fill -= incr;
table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;
} while (fill !== 0);
/* backwards increment the len-bit code huff */
incr = 1 << (len - 1);
while (huff & incr) {
incr >>= 1;
}
if (incr !== 0) {
huff &= incr - 1;
huff += incr;
} else {
huff = 0;
}
/* go to next symbol, update count, len */
sym++;
if (--count[len] === 0) {
if (len === max) { break; }
len = lens[lens_index + work[sym]];
}
/* create new sub-table if needed */
if (len > root && (huff & mask) !== low) {
/* if first time, transition to sub-tables */
if (drop === 0) {
drop = root;
}
/* increment past last table */
next += min; /* here min is 1 << curr */
/* determine length of next table */
curr = len - drop;
left = 1 << curr;
while (curr + drop < max) {
left -= count[curr + drop];
if (left <= 0) { break; }
curr++;
left <<= 1;
}
/* check for enough space */
used += 1 << curr;
if ((type === LENS && used > ENOUGH_LENS) ||
(type === DISTS && used > ENOUGH_DISTS)) {
return 1;
}
/* point entry in root table to sub-table */
low = huff & mask;
/*table.op[low] = curr;
table.bits[low] = root;
table.val[low] = next - opts.table_index;*/
table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;
}
}
/* fill in remaining table entry if code is incomplete (guaranteed to have
at most one remaining entry, since if the code is incomplete, the
maximum code length that was allowed to get this far is one bit) */
if (huff !== 0) {
//table.op[next + huff] = 64; /* invalid code marker */
//table.bits[next + huff] = len - drop;
//table.val[next + huff] = 0;
table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;
}
/* set return parameters */
//opts.table_index += used;
opts.bits = root;
return 0;
};
},{"../utils/common":1}],10:[function(require,module,exports){
'use strict';
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
module.exports = {
2: 'need dictionary', /* Z_NEED_DICT 2 */
1: 'stream end', /* Z_STREAM_END 1 */
0: '', /* Z_OK 0 */
'-1': 'file error', /* Z_ERRNO (-1) */
'-2': 'stream error', /* Z_STREAM_ERROR (-2) */
'-3': 'data error', /* Z_DATA_ERROR (-3) */
'-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */
'-5': 'buffer error', /* Z_BUF_ERROR (-5) */
'-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
};
},{}],11:[function(require,module,exports){
'use strict';
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
function ZStream() {
/* next input byte */
this.input = null; // JS specific, because we have no pointers
this.next_in = 0;
/* number of bytes available at input */
this.avail_in = 0;
/* total number of input bytes read so far */
this.total_in = 0;
/* next output byte should be put there */
this.output = null; // JS specific, because we have no pointers
this.next_out = 0;
/* remaining free space at output */
this.avail_out = 0;
/* total number of bytes output so far */
this.total_out = 0;
/* last error message, NULL if no error */
this.msg = ''/*Z_NULL*/;
/* not visible by applications */
this.state = null;
/* best guess about the data type: binary or text */
this.data_type = 2/*Z_UNKNOWN*/;
/* adler32 value of the uncompressed data */
this.adler = 0;
}
module.exports = ZStream;
},{}],"/lib/inflate.js":[function(require,module,exports){
'use strict';
var zlib_inflate = require('./zlib/inflate');
var utils = require('./utils/common');
var strings = require('./utils/strings');
var c = require('./zlib/constants');
var msg = require('./zlib/messages');
var ZStream = require('./zlib/zstream');
var GZheader = require('./zlib/gzheader');
var toString = Object.prototype.toString;
/**
* class Inflate
*
* Generic JS-style wrapper for zlib calls. If you don't need
* streaming behaviour - use more simple functions: [[inflate]]
* and [[inflateRaw]].
**/
/* internal
* inflate.chunks -> Array
*
* Chunks of output data, if [[Inflate#onData]] not overridden.
**/
/**
* Inflate.result -> Uint8Array|Array|String
*
* Uncompressed result, generated by default [[Inflate#onData]]
* and [[Inflate#onEnd]] handlers. Filled after you push last chunk
* (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you
* push a chunk with explicit flush (call [[Inflate#push]] with
* `Z_SYNC_FLUSH` param).
**/
/**
* Inflate.err -> Number
*
* Error code after inflate finished. 0 (Z_OK) on success.
* Should be checked if broken data possible.
**/
/**
* Inflate.msg -> String
*
* Error message, if [[Inflate.err]] != 0
**/
/**
* new Inflate(options)
* - options (Object): zlib inflate options.
*
* Creates new inflator instance with specified params. Throws exception
* on bad params. Supported options:
*
* - `windowBits`
* - `dictionary`
*
* [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
* for more information on these.
*
* Additional options, for internal needs:
*
* - `chunkSize` - size of generated data chunks (16K by default)
* - `raw` (Boolean) - do raw inflate
* - `to` (String) - if equal to 'string', then result will be converted
* from utf8 to utf16 (javascript) string. When string output requested,
* chunk length can differ from `chunkSize`, depending on content.
*
* By default, when no options set, autodetect deflate/gzip data format via
* wrapper header.
*
* ##### Example:
*
* ```javascript
* var pako = require('pako')
* , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
* , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
*
* var inflate = new pako.Inflate({ level: 3});
*
* inflate.push(chunk1, false);
* inflate.push(chunk2, true); // true -> last chunk
*
* if (inflate.err) { throw new Error(inflate.err); }
*
* console.log(inflate.result);
* ```
**/
function Inflate(options) {
if (!(this instanceof Inflate)) return new Inflate(options);
this.options = utils.assign({
chunkSize: 16384,
windowBits: 0,
to: ''
}, options || {});
var opt = this.options;
// Force window size for `raw` data, if not set directly,
// because we have no header for autodetect.
if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {
opt.windowBits = -opt.windowBits;
if (opt.windowBits === 0) { opt.windowBits = -15; }
}
// If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate
if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&
!(options && options.windowBits)) {
opt.windowBits += 32;
}
// Gzip header has no info about windows size, we can do autodetect only
// for deflate. So, if window size not set, force it to max when gzip possible
if ((opt.windowBits > 15) && (opt.windowBits < 48)) {
// bit 3 (16) -> gzipped data
// bit 4 (32) -> autodetect gzip/deflate
if ((opt.windowBits & 15) === 0) {
opt.windowBits |= 15;
}
}
this.err = 0; // error code, if happens (0 = Z_OK)
this.msg = ''; // error message
this.ended = false; // used to avoid multiple onEnd() calls
this.chunks = []; // chunks of compressed data
this.strm = new ZStream();
this.strm.avail_out = 0;
var status = zlib_inflate.inflateInit2(
this.strm,
opt.windowBits
);
if (status !== c.Z_OK) {
throw new Error(msg[status]);
}
this.header = new GZheader();
zlib_inflate.inflateGetHeader(this.strm, this.header);
// Setup dictionary
if (opt.dictionary) {
// Convert data if needed
if (typeof opt.dictionary === 'string') {
opt.dictionary = strings.string2buf(opt.dictionary);
} else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {
opt.dictionary = new Uint8Array(opt.dictionary);
}
if (opt.raw) { //In raw mode we need to set the dictionary early
status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);
if (status !== c.Z_OK) {
throw new Error(msg[status]);
}
}
}
}
/**
* Inflate#push(data[, mode]) -> Boolean
* - data (Uint8Array|Array|ArrayBuffer|String): input data
* - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
* See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.
*
* Sends input data to inflate pipe, generating [[Inflate#onData]] calls with
* new output chunks. Returns `true` on success. The last data block must have
* mode Z_FINISH (or `true`). That will flush internal pending buffers and call
* [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you
* can use mode Z_SYNC_FLUSH, keeping the decompression context.
*
* On fail call [[Inflate#onEnd]] with error code and return false.
*
* We strongly recommend to use `Uint8Array` on input for best speed (output
* format is detected automatically). Also, don't skip last param and always
* use the same type in your code (boolean or number). That will improve JS speed.
*
* For regular `Array`-s make sure all elements are [0..255].
*
* ##### Example
*
* ```javascript
* push(chunk, false); // push one of data chunks
* ...
* push(chunk, true); // push last chunk
* ```
**/
Inflate.prototype.push = function (data, mode) {
var strm = this.strm;
var chunkSize = this.options.chunkSize;
var dictionary = this.options.dictionary;
var status, _mode;
var next_out_utf8, tail, utf8str;
// Flag to properly process Z_BUF_ERROR on testing inflate call
// when we check that all output data was flushed.
var allowBufError = false;
if (this.ended) { return false; }
_mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);
// Convert data if needed
if (typeof data === 'string') {
// Only binary strings can be decompressed on practice
strm.input = strings.binstring2buf(data);
} else if (toString.call(data) === '[object ArrayBuffer]') {
strm.input = new Uint8Array(data);
} else {
strm.input = data;
}
strm.next_in = 0;
strm.avail_in = strm.input.length;
do {
if (strm.avail_out === 0) {
strm.output = new utils.Buf8(chunkSize);
strm.next_out = 0;
strm.avail_out = chunkSize;
}
status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */
if (status === c.Z_NEED_DICT && dictionary) {
status = zlib_inflate.inflateSetDictionary(this.strm, dictionary);
}
if (status === c.Z_BUF_ERROR && allowBufError === true) {
status = c.Z_OK;
allowBufError = false;
}
if (status !== c.Z_STREAM_END && status !== c.Z_OK) {
this.onEnd(status);
this.ended = true;
return false;
}
if (strm.next_out) {
if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {
if (this.options.to === 'string') {
next_out_utf8 = strings.utf8border(strm.output, strm.next_out);
tail = strm.next_out - next_out_utf8;
utf8str = strings.buf2string(strm.output, next_out_utf8);
// move tail
strm.next_out = tail;
strm.avail_out = chunkSize - tail;
if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }
this.onData(utf8str);
} else {
this.onData(utils.shrinkBuf(strm.output, strm.next_out));
}
}
}
// When no more input data, we should check that internal inflate buffers
// are flushed. The only way to do it when avail_out = 0 - run one more
// inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.
// Here we set flag to process this error properly.
//
// NOTE. Deflate does not return error in this case and does not needs such
// logic.
if (strm.avail_in === 0 && strm.avail_out === 0) {
allowBufError = true;
}
} while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);
if (status === c.Z_STREAM_END) {
_mode = c.Z_FINISH;
}
// Finalize on the last chunk.
if (_mode === c.Z_FINISH) {
status = zlib_inflate.inflateEnd(this.strm);
this.onEnd(status);
this.ended = true;
return status === c.Z_OK;
}
// callback interim results if Z_SYNC_FLUSH.
if (_mode === c.Z_SYNC_FLUSH) {
this.onEnd(c.Z_OK);
strm.avail_out = 0;
return true;
}
return true;
};
/**
* Inflate#onData(chunk) -> Void
* - chunk (Uint8Array|Array|String): output data. Type of array depends
* on js engine support. When string output requested, each chunk
* will be string.
*
* By default, stores data blocks in `chunks[]` property and glue
* those in `onEnd`. Override this handler, if you need another behaviour.
**/
Inflate.prototype.onData = function (chunk) {
this.chunks.push(chunk);
};
/**
* Inflate#onEnd(status) -> Void
* - status (Number): inflate status. 0 (Z_OK) on success,
* other if not.
*
* Called either after you tell inflate that the input stream is
* complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
* or if an error happened. By default - join collected chunks,
* free memory and fill `results` / `err` properties.
**/
Inflate.prototype.onEnd = function (status) {
// On success - join
if (status === c.Z_OK) {
if (this.options.to === 'string') {
// Glue & convert here, until we teach pako to send
// utf8 aligned strings to onData
this.result = this.chunks.join('');
} else {
this.result = utils.flattenChunks(this.chunks);
}
}
this.chunks = [];
this.err = status;
this.msg = this.strm.msg;
};
/**
* inflate(data[, options]) -> Uint8Array|Array|String
* - data (Uint8Array|Array|String): input data to decompress.
* - options (Object): zlib inflate options.
*
* Decompress `data` with inflate/ungzip and `options`. Autodetect
* format via wrapper header by default. That's why we don't provide
* separate `ungzip` method.
*
* Supported options are:
*
* - windowBits
*
* [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
* for more information.
*
* Sugar (options):
*
* - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
* negative windowBits implicitly.
* - `to` (String) - if equal to 'string', then result will be converted
* from utf8 to utf16 (javascript) string. When string output requested,
* chunk length can differ from `chunkSize`, depending on content.
*
*
* ##### Example:
*
* ```javascript
* var pako = require('pako')
* , input = pako.deflate([1,2,3,4,5,6,7,8,9])
* , output;
*
* try {
* output = pako.inflate(input);
* } catch (err)
* console.log(err);
* }
* ```
**/
function inflate(input, options) {
var inflator = new Inflate(options);
inflator.push(input, true);
// That will never happens, if you don't cheat with options :)
if (inflator.err) { throw inflator.msg || msg[inflator.err]; }
return inflator.result;
}
/**
* inflateRaw(data[, options]) -> Uint8Array|Array|String
* - data (Uint8Array|Array|String): input data to decompress.
* - options (Object): zlib inflate options.
*
* The same as [[inflate]], but creates raw data, without wrapper
* (header and adler32 crc).
**/
function inflateRaw(input, options) {
options = options || {};
options.raw = true;
return inflate(input, options);
}
/**
* ungzip(data[, options]) -> Uint8Array|Array|String
* - data (Uint8Array|Array|String): input data to decompress.
* - options (Object): zlib inflate options.
*
* Just shortcut to [[inflate]], because it autodetects format
* by header.content. Done for convenience.
**/
exports.Inflate = Inflate;
exports.inflate = inflate;
exports.inflateRaw = inflateRaw;
exports.ungzip = inflate;
},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")
});
/* eslint-enable */
/***/ }),
/***/ 6087:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["element"];
/***/ }),
/***/ 7143:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["data"];
/***/ }),
/***/ 7734:
/***/ ((module) => {
"use strict";
// do not edit .js files directly - edit src/index.jst
var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';
module.exports = function equal(a, b) {
if (a === b) return true;
if (a && b && typeof a == 'object' && typeof b == 'object') {
if (a.constructor !== b.constructor) return false;
var length, i, keys;
if (Array.isArray(a)) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0;)
if (!equal(a[i], b[i])) return false;
return true;
}
if ((a instanceof Map) && (b instanceof Map)) {
if (a.size !== b.size) return false;
for (i of a.entries())
if (!b.has(i[0])) return false;
for (i of a.entries())
if (!equal(i[1], b.get(i[0]))) return false;
return true;
}
if ((a instanceof Set) && (b instanceof Set)) {
if (a.size !== b.size) return false;
for (i of a.entries())
if (!b.has(i[0])) return false;
return true;
}
if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0;)
if (a[i] !== b[i]) return false;
return true;
}
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
keys = Object.keys(a);
length = keys.length;
if (length !== Object.keys(b).length) return false;
for (i = length; i-- !== 0;)
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
for (i = length; i-- !== 0;) {
var key = keys[i];
if (!equal(a[key], b[key])) return false;
}
return true;
}
// true if both NaN, false otherwise
return a!==a && b!==b;
};
/***/ }),
/***/ 7951:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
loadView: () => (/* reexport */ loadView),
useView: () => (/* reexport */ useView)
});
;// ./node_modules/dequal/dist/index.mjs
var has = Object.prototype.hasOwnProperty;
function find(iter, tar, key) {
for (key of iter.keys()) {
if (dequal(key, tar)) return key;
}
}
function dequal(foo, bar) {
var ctor, len, tmp;
if (foo === bar) return true;
if (foo && bar && (ctor=foo.constructor) === bar.constructor) {
if (ctor === Date) return foo.getTime() === bar.getTime();
if (ctor === RegExp) return foo.toString() === bar.toString();
if (ctor === Array) {
if ((len=foo.length) === bar.length) {
while (len-- && dequal(foo[len], bar[len]));
}
return len === -1;
}
if (ctor === Set) {
if (foo.size !== bar.size) {
return false;
}
for (len of foo) {
tmp = len;
if (tmp && typeof tmp === 'object') {
tmp = find(bar, tmp);
if (!tmp) return false;
}
if (!bar.has(tmp)) return false;
}
return true;
}
if (ctor === Map) {
if (foo.size !== bar.size) {
return false;
}
for (len of foo) {
tmp = len[0];
if (tmp && typeof tmp === 'object') {
tmp = find(bar, tmp);
if (!tmp) return false;
}
if (!dequal(len[1], bar.get(tmp))) {
return false;
}
}
return true;
}
if (ctor === ArrayBuffer) {
foo = new Uint8Array(foo);
bar = new Uint8Array(bar);
} else if (ctor === DataView) {
if ((len=foo.byteLength) === bar.byteLength) {
while (len-- && foo.getInt8(len) === bar.getInt8(len));
}
return len === -1;
}
if (ArrayBuffer.isView(foo)) {
if ((len=foo.byteLength) === bar.byteLength) {
while (len-- && foo[len] === bar[len]);
}
return len === -1;
}
if (!ctor || typeof foo === 'object') {
len = 0;
for (ctor in foo) {
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
}
return Object.keys(bar).length === len;
}
}
return foo !== foo && bar !== bar;
}
;// ./node_modules/@wordpress/views/build-module/preference-keys.js
function generatePreferenceKey(kind, name, slug) {
return `dataviews-${kind}-${name}-${slug}`;
}
// EXTERNAL MODULE: external ["wp","element"]
var external_wp_element_ = __webpack_require__(6087);
// EXTERNAL MODULE: external ["wp","data"]
var external_wp_data_ = __webpack_require__(7143);
// EXTERNAL MODULE: external ["wp","preferences"]
var external_wp_preferences_ = __webpack_require__(1233);
;// ./node_modules/@wordpress/views/build-module/use-view.js
function omit(obj, keys) {
const result = { ...obj };
for (const key of keys) {
delete result[key];
}
return result;
}
function useView(config) {
const { kind, name, slug, defaultView, queryParams, onChangeQueryParams } = config;
const preferenceKey = generatePreferenceKey(kind, name, slug);
const persistedView = (0,external_wp_data_.useSelect)(
(select) => {
return select(external_wp_preferences_.store).get(
"core/views",
preferenceKey
);
},
[preferenceKey]
);
const { set } = (0,external_wp_data_.useDispatch)(external_wp_preferences_.store);
const baseView = persistedView ?? defaultView;
const page = Number(queryParams?.page ?? baseView.page ?? 1);
const search = queryParams?.search ?? baseView.search ?? "";
const view = (0,external_wp_element_.useMemo)(() => {
return {
...baseView,
page,
search
};
}, [baseView, page, search]);
const isModified = !!persistedView;
const updateView = (0,external_wp_element_.useCallback)(
(newView) => {
const urlParams = {
page: newView?.page,
search: newView?.search
};
const preferenceView = omit(newView, ["page", "search"]);
if (onChangeQueryParams && !dequal(urlParams, { page, search })) {
onChangeQueryParams(urlParams);
}
if (!dequal(baseView, preferenceView)) {
if (dequal(preferenceView, defaultView)) {
set("core/views", preferenceKey, void 0);
} else {
set("core/views", preferenceKey, preferenceView);
}
}
},
[
onChangeQueryParams,
page,
search,
baseView,
defaultView,
set,
preferenceKey
]
);
const resetToDefault = (0,external_wp_element_.useCallback)(() => {
set("core/views", preferenceKey, void 0);
}, [preferenceKey, set]);
return {
view,
isModified,
updateView,
resetToDefault
};
}
;// ./node_modules/@wordpress/views/build-module/load-view.js
async function loadView(config) {
const { kind, name, slug, defaultView, queryParams } = config;
const preferenceKey = generatePreferenceKey(kind, name, slug);
const persistedView = (0,external_wp_data_.select)(external_wp_preferences_.store).get(
"core/views",
preferenceKey
);
const baseView = persistedView ?? defaultView;
const page = queryParams?.page ?? 1;
const search = queryParams?.search ?? "";
return {
...baseView,
page,
search
};
}
;// ./node_modules/@wordpress/views/build-module/index.js
/***/ }),
/***/ 8572:
/***/ ((module) => {
/**
* Credits:
*
* lib-font
* https://github.com/Pomax/lib-font
* https://github.com/Pomax/lib-font/blob/master/lib/unbrotli.js
*
* The MIT License (MIT)
*
* Copyright (c) 2020 pomax@nihongoresources.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/* eslint eslint-comments/no-unlimited-disable: 0 */
/* eslint-disable */
(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=undefined;if(!f&&c)return require(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=undefined,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
/* Copyright 2013 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Bit reading helpers
*/
var BROTLI_READ_SIZE = 4096;
var BROTLI_IBUF_SIZE = (2 * BROTLI_READ_SIZE + 32);
var BROTLI_IBUF_MASK = (2 * BROTLI_READ_SIZE - 1);
var kBitMask = new Uint32Array([
0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767,
65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215
]);
/* Input byte buffer, consist of a ringbuffer and a "slack" region where */
/* bytes from the start of the ringbuffer are copied. */
function BrotliBitReader(input) {
this.buf_ = new Uint8Array(BROTLI_IBUF_SIZE);
this.input_ = input; /* input callback */
this.reset();
}
BrotliBitReader.READ_SIZE = BROTLI_READ_SIZE;
BrotliBitReader.IBUF_MASK = BROTLI_IBUF_MASK;
BrotliBitReader.prototype.reset = function() {
this.buf_ptr_ = 0; /* next input will write here */
this.val_ = 0; /* pre-fetched bits */
this.pos_ = 0; /* byte position in stream */
this.bit_pos_ = 0; /* current bit-reading position in val_ */
this.bit_end_pos_ = 0; /* bit-reading end position from LSB of val_ */
this.eos_ = 0; /* input stream is finished */
this.readMoreInput();
for (var i = 0; i < 4; i++) {
this.val_ |= this.buf_[this.pos_] << (8 * i);
++this.pos_;
}
return this.bit_end_pos_ > 0;
};
/* Fills up the input ringbuffer by calling the input callback.
Does nothing if there are at least 32 bytes present after current position.
Returns 0 if either:
- the input callback returned an error, or
- there is no more input and the position is past the end of the stream.
After encountering the end of the input stream, 32 additional zero bytes are
copied to the ringbuffer, therefore it is safe to call this function after
every 32 bytes of input is read.
*/
BrotliBitReader.prototype.readMoreInput = function() {
if (this.bit_end_pos_ > 256) {
return;
} else if (this.eos_) {
if (this.bit_pos_ > this.bit_end_pos_)
throw new Error('Unexpected end of input ' + this.bit_pos_ + ' ' + this.bit_end_pos_);
} else {
var dst = this.buf_ptr_;
var bytes_read = this.input_.read(this.buf_, dst, BROTLI_READ_SIZE);
if (bytes_read < 0) {
throw new Error('Unexpected end of input');
}
if (bytes_read < BROTLI_READ_SIZE) {
this.eos_ = 1;
/* Store 32 bytes of zero after the stream end. */
for (var p = 0; p < 32; p++)
this.buf_[dst + bytes_read + p] = 0;
}
if (dst === 0) {
/* Copy the head of the ringbuffer to the slack region. */
for (var p = 0; p < 32; p++)
this.buf_[(BROTLI_READ_SIZE << 1) + p] = this.buf_[p];
this.buf_ptr_ = BROTLI_READ_SIZE;
} else {
this.buf_ptr_ = 0;
}
this.bit_end_pos_ += bytes_read << 3;
}
};
/* Guarantees that there are at least 24 bits in the buffer. */
BrotliBitReader.prototype.fillBitWindow = function() {
while (this.bit_pos_ >= 8) {
this.val_ >>>= 8;
this.val_ |= this.buf_[this.pos_ & BROTLI_IBUF_MASK] << 24;
++this.pos_;
this.bit_pos_ = this.bit_pos_ - 8 >>> 0;
this.bit_end_pos_ = this.bit_end_pos_ - 8 >>> 0;
}
};
/* Reads the specified number of bits from Read Buffer. */
BrotliBitReader.prototype.readBits = function(n_bits) {
if (32 - this.bit_pos_ < n_bits) {
this.fillBitWindow();
}
var val = ((this.val_ >>> this.bit_pos_) & kBitMask[n_bits]);
this.bit_pos_ += n_bits;
return val;
};
module.exports = BrotliBitReader;
},{}],2:[function(require,module,exports){
/* Copyright 2013 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Lookup table to map the previous two bytes to a context id.
There are four different context modeling modes defined here:
CONTEXT_LSB6: context id is the least significant 6 bits of the last byte,
CONTEXT_MSB6: context id is the most significant 6 bits of the last byte,
CONTEXT_UTF8: second-order context model tuned for UTF8-encoded text,
CONTEXT_SIGNED: second-order context model tuned for signed integers.
The context id for the UTF8 context model is calculated as follows. If p1
and p2 are the previous two bytes, we calcualte the context as
context = kContextLookup[p1] | kContextLookup[p2 + 256].
If the previous two bytes are ASCII characters (i.e. < 128), this will be
equivalent to
context = 4 * context1(p1) + context2(p2),
where context1 is based on the previous byte in the following way:
0 : non-ASCII control
1 : \t, \n, \r
2 : space
3 : other punctuation
4 : " '
5 : %
6 : ( < [ {
7 : ) > ] }
8 : , ; :
9 : .
10 : =
11 : number
12 : upper-case vowel
13 : upper-case consonant
14 : lower-case vowel
15 : lower-case consonant
and context2 is based on the second last byte:
0 : control, space
1 : punctuation
2 : upper-case letter, number
3 : lower-case letter
If the last byte is ASCII, and the second last byte is not (in a valid UTF8
stream it will be a continuation byte, value between 128 and 191), the
context is the same as if the second last byte was an ASCII control or space.
If the last byte is a UTF8 lead byte (value >= 192), then the next byte will
be a continuation byte and the context id is 2 or 3 depending on the LSB of
the last byte and to a lesser extent on the second last byte if it is ASCII.
If the last byte is a UTF8 continuation byte, the second last byte can be:
- continuation byte: the next byte is probably ASCII or lead byte (assuming
4-byte UTF8 characters are rare) and the context id is 0 or 1.
- lead byte (192 - 207): next byte is ASCII or lead byte, context is 0 or 1
- lead byte (208 - 255): next byte is continuation byte, context is 2 or 3
The possible value combinations of the previous two bytes, the range of
context ids and the type of the next byte is summarized in the table below:
|--------\-----------------------------------------------------------------|
| \ Last byte |
| Second \---------------------------------------------------------------|
| last byte \ ASCII | cont. byte | lead byte |
| \ (0-127) | (128-191) | (192-) |
|=============|===================|=====================|==================|
| ASCII | next: ASCII/lead | not valid | next: cont. |
| (0-127) | context: 4 - 63 | | context: 2 - 3 |
|-------------|-------------------|---------------------|------------------|
| cont. byte | next: ASCII/lead | next: ASCII/lead | next: cont. |
| (128-191) | context: 4 - 63 | context: 0 - 1 | context: 2 - 3 |
|-------------|-------------------|---------------------|------------------|
| lead byte | not valid | next: ASCII/lead | not valid |
| (192-207) | | context: 0 - 1 | |
|-------------|-------------------|---------------------|------------------|
| lead byte | not valid | next: cont. | not valid |
| (208-) | | context: 2 - 3 | |
|-------------|-------------------|---------------------|------------------|
The context id for the signed context mode is calculated as:
context = (kContextLookup[512 + p1] << 3) | kContextLookup[512 + p2].
For any context modeling modes, the context ids can be calculated by |-ing
together two lookups from one table using context model dependent offsets:
context = kContextLookup[offset1 + p1] | kContextLookup[offset2 + p2].
where offset1 and offset2 are dependent on the context mode.
*/
var CONTEXT_LSB6 = 0;
var CONTEXT_MSB6 = 1;
var CONTEXT_UTF8 = 2;
var CONTEXT_SIGNED = 3;
/* Common context lookup table for all context modes. */
exports.lookup = new Uint8Array([
/* CONTEXT_UTF8, last byte. */
/* ASCII range. */
0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 4, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
8, 12, 16, 12, 12, 20, 12, 16, 24, 28, 12, 12, 32, 12, 36, 12,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 32, 32, 24, 40, 28, 12,
12, 48, 52, 52, 52, 48, 52, 52, 52, 48, 52, 52, 52, 52, 52, 48,
52, 52, 52, 52, 52, 48, 52, 52, 52, 52, 52, 24, 12, 28, 12, 12,
12, 56, 60, 60, 60, 56, 60, 60, 60, 56, 60, 60, 60, 60, 60, 56,
60, 60, 60, 60, 60, 56, 60, 60, 60, 60, 60, 24, 12, 28, 12, 0,
/* UTF8 continuation byte range. */
0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
/* UTF8 lead byte range. */
2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3,
2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3,
2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3,
2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3,
/* CONTEXT_UTF8 second last byte. */
/* ASCII range. */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1,
1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 0,
/* UTF8 continuation byte range. */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* UTF8 lead byte range. */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
/* CONTEXT_SIGNED, second last byte. */
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7,
/* CONTEXT_SIGNED, last byte, same as the above values shifted by 3 bits. */
0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56,
/* CONTEXT_LSB6, last byte. */
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
/* CONTEXT_MSB6, last byte. */
0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3,
4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7,
8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11,
12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15,
16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19,
20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23,
24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27,
28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31,
32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35,
36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39,
40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43,
44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47,
48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51,
52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55,
56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59,
60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63,
/* CONTEXT_{M,L}SB6, second last byte, */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
]);
exports.lookupOffsets = new Uint16Array([
/* CONTEXT_LSB6 */
1024, 1536,
/* CONTEXT_MSB6 */
1280, 1536,
/* CONTEXT_UTF8 */
0, 256,
/* CONTEXT_SIGNED */
768, 512,
]);
},{}],3:[function(require,module,exports){
/* Copyright 2013 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
var BrotliInput = require('./streams').BrotliInput;
var BrotliOutput = require('./streams').BrotliOutput;
var BrotliBitReader = require('./bit_reader');
var BrotliDictionary = require('./dictionary');
var HuffmanCode = require('./huffman').HuffmanCode;
var BrotliBuildHuffmanTable = require('./huffman').BrotliBuildHuffmanTable;
var Context = require('./context');
var Prefix = require('./prefix');
var Transform = require('./transform');
var kDefaultCodeLength = 8;
var kCodeLengthRepeatCode = 16;
var kNumLiteralCodes = 256;
var kNumInsertAndCopyCodes = 704;
var kNumBlockLengthCodes = 26;
var kLiteralContextBits = 6;
var kDistanceContextBits = 2;
var HUFFMAN_TABLE_BITS = 8;
var HUFFMAN_TABLE_MASK = 0xff;
/* Maximum possible Huffman table size for an alphabet size of 704, max code
* length 15 and root table bits 8. */
var HUFFMAN_MAX_TABLE_SIZE = 1080;
var CODE_LENGTH_CODES = 18;
var kCodeLengthCodeOrder = new Uint8Array([
1, 2, 3, 4, 0, 5, 17, 6, 16, 7, 8, 9, 10, 11, 12, 13, 14, 15,
]);
var NUM_DISTANCE_SHORT_CODES = 16;
var kDistanceShortCodeIndexOffset = new Uint8Array([
3, 2, 1, 0, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2
]);
var kDistanceShortCodeValueOffset = new Int8Array([
0, 0, 0, 0, -1, 1, -2, 2, -3, 3, -1, 1, -2, 2, -3, 3
]);
var kMaxHuffmanTableSize = new Uint16Array([
256, 402, 436, 468, 500, 534, 566, 598, 630, 662, 694, 726, 758, 790, 822,
854, 886, 920, 952, 984, 1016, 1048, 1080
]);
function DecodeWindowBits(br) {
var n;
if (br.readBits(1) === 0) {
return 16;
}
n = br.readBits(3);
if (n > 0) {
return 17 + n;
}
n = br.readBits(3);
if (n > 0) {
return 8 + n;
}
return 17;
}
/* Decodes a number in the range [0..255], by reading 1 - 11 bits. */
function DecodeVarLenUint8(br) {
if (br.readBits(1)) {
var nbits = br.readBits(3);
if (nbits === 0) {
return 1;
} else {
return br.readBits(nbits) + (1 << nbits);
}
}
return 0;
}
function MetaBlockLength() {
this.meta_block_length = 0;
this.input_end = 0;
this.is_uncompressed = 0;
this.is_metadata = false;
}
function DecodeMetaBlockLength(br) {
var out = new MetaBlockLength;
var size_nibbles;
var size_bytes;
var i;
out.input_end = br.readBits(1);
if (out.input_end && br.readBits(1)) {
return out;
}
size_nibbles = br.readBits(2) + 4;
if (size_nibbles === 7) {
out.is_metadata = true;
if (br.readBits(1) !== 0)
throw new Error('Invalid reserved bit');
size_bytes = br.readBits(2);
if (size_bytes === 0)
return out;
for (i = 0; i < size_bytes; i++) {
var next_byte = br.readBits(8);
if (i + 1 === size_bytes && size_bytes > 1 && next_byte === 0)
throw new Error('Invalid size byte');
out.meta_block_length |= next_byte << (i * 8);
}
} else {
for (i = 0; i < size_nibbles; ++i) {
var next_nibble = br.readBits(4);
if (i + 1 === size_nibbles && size_nibbles > 4 && next_nibble === 0)
throw new Error('Invalid size nibble');
out.meta_block_length |= next_nibble << (i * 4);
}
}
++out.meta_block_length;
if (!out.input_end && !out.is_metadata) {
out.is_uncompressed = br.readBits(1);
}
return out;
}
/* Decodes the next Huffman code from bit-stream. */
function ReadSymbol(table, index, br) {
var start_index = index;
var nbits;
br.fillBitWindow();
index += (br.val_ >>> br.bit_pos_) & HUFFMAN_TABLE_MASK;
nbits = table[index].bits - HUFFMAN_TABLE_BITS;
if (nbits > 0) {
br.bit_pos_ += HUFFMAN_TABLE_BITS;
index += table[index].value;
index += (br.val_ >>> br.bit_pos_) & ((1 << nbits) - 1);
}
br.bit_pos_ += table[index].bits;
return table[index].value;
}
function ReadHuffmanCodeLengths(code_length_code_lengths, num_symbols, code_lengths, br) {
var symbol = 0;
var prev_code_len = kDefaultCodeLength;
var repeat = 0;
var repeat_code_len = 0;
var space = 32768;
var table = [];
for (var i = 0; i < 32; i++)
table.push(new HuffmanCode(0, 0));
BrotliBuildHuffmanTable(table, 0, 5, code_length_code_lengths, CODE_LENGTH_CODES);
while (symbol < num_symbols && space > 0) {
var p = 0;
var code_len;
br.readMoreInput();
br.fillBitWindow();
p += (br.val_ >>> br.bit_pos_) & 31;
br.bit_pos_ += table[p].bits;
code_len = table[p].value & 0xff;
if (code_len < kCodeLengthRepeatCode) {
repeat = 0;
code_lengths[symbol++] = code_len;
if (code_len !== 0) {
prev_code_len = code_len;
space -= 32768 >> code_len;
}
} else {
var extra_bits = code_len - 14;
var old_repeat;
var repeat_delta;
var new_len = 0;
if (code_len === kCodeLengthRepeatCode) {
new_len = prev_code_len;
}
if (repeat_code_len !== new_len) {
repeat = 0;
repeat_code_len = new_len;
}
old_repeat = repeat;
if (repeat > 0) {
repeat -= 2;
repeat <<= extra_bits;
}
repeat += br.readBits(extra_bits) + 3;
repeat_delta = repeat - old_repeat;
if (symbol + repeat_delta > num_symbols) {
throw new Error('[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols');
}
for (var x = 0; x < repeat_delta; x++)
code_lengths[symbol + x] = repeat_code_len;
symbol += repeat_delta;
if (repeat_code_len !== 0) {
space -= repeat_delta << (15 - repeat_code_len);
}
}
}
if (space !== 0) {
throw new Error("[ReadHuffmanCodeLengths] space = " + space);
}
for (; symbol < num_symbols; symbol++)
code_lengths[symbol] = 0;
}
function ReadHuffmanCode(alphabet_size, tables, table, br) {
var table_size = 0;
var simple_code_or_skip;
var code_lengths = new Uint8Array(alphabet_size);
br.readMoreInput();
/* simple_code_or_skip is used as follows:
1 for simple code;
0 for no skipping, 2 skips 2 code lengths, 3 skips 3 code lengths */
simple_code_or_skip = br.readBits(2);
if (simple_code_or_skip === 1) {
/* Read symbols, codes & code lengths directly. */
var i;
var max_bits_counter = alphabet_size - 1;
var max_bits = 0;
var symbols = new Int32Array(4);
var num_symbols = br.readBits(2) + 1;
while (max_bits_counter) {
max_bits_counter >>= 1;
++max_bits;
}
for (i = 0; i < num_symbols; ++i) {
symbols[i] = br.readBits(max_bits) % alphabet_size;
code_lengths[symbols[i]] = 2;
}
code_lengths[symbols[0]] = 1;
switch (num_symbols) {
case 1:
break;
case 3:
if ((symbols[0] === symbols[1]) ||
(symbols[0] === symbols[2]) ||
(symbols[1] === symbols[2])) {
throw new Error('[ReadHuffmanCode] invalid symbols');
}
break;
case 2:
if (symbols[0] === symbols[1]) {
throw new Error('[ReadHuffmanCode] invalid symbols');
}
code_lengths[symbols[1]] = 1;
break;
case 4:
if ((symbols[0] === symbols[1]) ||
(symbols[0] === symbols[2]) ||
(symbols[0] === symbols[3]) ||
(symbols[1] === symbols[2]) ||
(symbols[1] === symbols[3]) ||
(symbols[2] === symbols[3])) {
throw new Error('[ReadHuffmanCode] invalid symbols');
}
if (br.readBits(1)) {
code_lengths[symbols[2]] = 3;
code_lengths[symbols[3]] = 3;
} else {
code_lengths[symbols[0]] = 2;
}
break;
}
} else { /* Decode Huffman-coded code lengths. */
var i;
var code_length_code_lengths = new Uint8Array(CODE_LENGTH_CODES);
var space = 32;
var num_codes = 0;
/* Static Huffman code for the code length code lengths */
var huff = [
new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(3, 2),
new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(4, 1),
new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(3, 2),
new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(4, 5)
];
for (i = simple_code_or_skip; i < CODE_LENGTH_CODES && space > 0; ++i) {
var code_len_idx = kCodeLengthCodeOrder[i];
var p = 0;
var v;
br.fillBitWindow();
p += (br.val_ >>> br.bit_pos_) & 15;
br.bit_pos_ += huff[p].bits;
v = huff[p].value;
code_length_code_lengths[code_len_idx] = v;
if (v !== 0) {
space -= (32 >> v);
++num_codes;
}
}
if (!(num_codes === 1 || space === 0))
throw new Error('[ReadHuffmanCode] invalid num_codes or space');
ReadHuffmanCodeLengths(code_length_code_lengths, alphabet_size, code_lengths, br);
}
table_size = BrotliBuildHuffmanTable(tables, table, HUFFMAN_TABLE_BITS, code_lengths, alphabet_size);
if (table_size === 0) {
throw new Error("[ReadHuffmanCode] BuildHuffmanTable failed: ");
}
return table_size;
}
function ReadBlockLength(table, index, br) {
var code;
var nbits;
code = ReadSymbol(table, index, br);
nbits = Prefix.kBlockLengthPrefixCode[code].nbits;
return Prefix.kBlockLengthPrefixCode[code].offset + br.readBits(nbits);
}
function TranslateShortCodes(code, ringbuffer, index) {
var val;
if (code < NUM_DISTANCE_SHORT_CODES) {
index += kDistanceShortCodeIndexOffset[code];
index &= 3;
val = ringbuffer[index] + kDistanceShortCodeValueOffset[code];
} else {
val = code - NUM_DISTANCE_SHORT_CODES + 1;
}
return val;
}
function MoveToFront(v, index) {
var value = v[index];
var i = index;
for (; i; --i) v[i] = v[i - 1];
v[0] = value;
}
function InverseMoveToFrontTransform(v, v_len) {
var mtf = new Uint8Array(256);
var i;
for (i = 0; i < 256; ++i) {
mtf[i] = i;
}
for (i = 0; i < v_len; ++i) {
var index = v[i];
v[i] = mtf[index];
if (index) MoveToFront(mtf, index);
}
}
/* Contains a collection of huffman trees with the same alphabet size. */
function HuffmanTreeGroup(alphabet_size, num_htrees) {
this.alphabet_size = alphabet_size;
this.num_htrees = num_htrees;
this.codes = new Array(num_htrees + num_htrees * kMaxHuffmanTableSize[(alphabet_size + 31) >>> 5]);
this.htrees = new Uint32Array(num_htrees);
}
HuffmanTreeGroup.prototype.decode = function(br) {
var i;
var table_size;
var next = 0;
for (i = 0; i < this.num_htrees; ++i) {
this.htrees[i] = next;
table_size = ReadHuffmanCode(this.alphabet_size, this.codes, next, br);
next += table_size;
}
};
function DecodeContextMap(context_map_size, br) {
var out = { num_htrees: null, context_map: null };
var use_rle_for_zeros;
var max_run_length_prefix = 0;
var table;
var i;
br.readMoreInput();
var num_htrees = out.num_htrees = DecodeVarLenUint8(br) + 1;
var context_map = out.context_map = new Uint8Array(context_map_size);
if (num_htrees <= 1) {
return out;
}
use_rle_for_zeros = br.readBits(1);
if (use_rle_for_zeros) {
max_run_length_prefix = br.readBits(4) + 1;
}
table = [];
for (i = 0; i < HUFFMAN_MAX_TABLE_SIZE; i++) {
table[i] = new HuffmanCode(0, 0);
}
ReadHuffmanCode(num_htrees + max_run_length_prefix, table, 0, br);
for (i = 0; i < context_map_size;) {
var code;
br.readMoreInput();
code = ReadSymbol(table, 0, br);
if (code === 0) {
context_map[i] = 0;
++i;
} else if (code <= max_run_length_prefix) {
var reps = 1 + (1 << code) + br.readBits(code);
while (--reps) {
if (i >= context_map_size) {
throw new Error("[DecodeContextMap] i >= context_map_size");
}
context_map[i] = 0;
++i;
}
} else {
context_map[i] = code - max_run_length_prefix;
++i;
}
}
if (br.readBits(1)) {
InverseMoveToFrontTransform(context_map, context_map_size);
}
return out;
}
function DecodeBlockType(max_block_type, trees, tree_type, block_types, ringbuffers, indexes, br) {
var ringbuffer = tree_type * 2;
var index = tree_type;
var type_code = ReadSymbol(trees, tree_type * HUFFMAN_MAX_TABLE_SIZE, br);
var block_type;
if (type_code === 0) {
block_type = ringbuffers[ringbuffer + (indexes[index] & 1)];
} else if (type_code === 1) {
block_type = ringbuffers[ringbuffer + ((indexes[index] - 1) & 1)] + 1;
} else {
block_type = type_code - 2;
}
if (block_type >= max_block_type) {
block_type -= max_block_type;
}
block_types[tree_type] = block_type;
ringbuffers[ringbuffer + (indexes[index] & 1)] = block_type;
++indexes[index];
}
function CopyUncompressedBlockToOutput(output, len, pos, ringbuffer, ringbuffer_mask, br) {
var rb_size = ringbuffer_mask + 1;
var rb_pos = pos & ringbuffer_mask;
var br_pos = br.pos_ & BrotliBitReader.IBUF_MASK;
var nbytes;
/* For short lengths copy byte-by-byte */
if (len < 8 || br.bit_pos_ + (len << 3) < br.bit_end_pos_) {
while (len-- > 0) {
br.readMoreInput();
ringbuffer[rb_pos++] = br.readBits(8);
if (rb_pos === rb_size) {
output.write(ringbuffer, rb_size);
rb_pos = 0;
}
}
return;
}
if (br.bit_end_pos_ < 32) {
throw new Error('[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32');
}
/* Copy remaining 0-4 bytes from br.val_ to ringbuffer. */
while (br.bit_pos_ < 32) {
ringbuffer[rb_pos] = (br.val_ >>> br.bit_pos_);
br.bit_pos_ += 8;
++rb_pos;
--len;
}
/* Copy remaining bytes from br.buf_ to ringbuffer. */
nbytes = (br.bit_end_pos_ - br.bit_pos_) >> 3;
if (br_pos + nbytes > BrotliBitReader.IBUF_MASK) {
var tail = BrotliBitReader.IBUF_MASK + 1 - br_pos;
for (var x = 0; x < tail; x++)
ringbuffer[rb_pos + x] = br.buf_[br_pos + x];
nbytes -= tail;
rb_pos += tail;
len -= tail;
br_pos = 0;
}
for (var x = 0; x < nbytes; x++)
ringbuffer[rb_pos + x] = br.buf_[br_pos + x];
rb_pos += nbytes;
len -= nbytes;
/* If we wrote past the logical end of the ringbuffer, copy the tail of the
ringbuffer to its beginning and flush the ringbuffer to the output. */
if (rb_pos >= rb_size) {
output.write(ringbuffer, rb_size);
rb_pos -= rb_size;
for (var x = 0; x < rb_pos; x++)
ringbuffer[x] = ringbuffer[rb_size + x];
}
/* If we have more to copy than the remaining size of the ringbuffer, then we
first fill the ringbuffer from the input and then flush the ringbuffer to
the output */
while (rb_pos + len >= rb_size) {
nbytes = rb_size - rb_pos;
if (br.input_.read(ringbuffer, rb_pos, nbytes) < nbytes) {
throw new Error('[CopyUncompressedBlockToOutput] not enough bytes');
}
output.write(ringbuffer, rb_size);
len -= nbytes;
rb_pos = 0;
}
/* Copy straight from the input onto the ringbuffer. The ringbuffer will be
flushed to the output at a later time. */
if (br.input_.read(ringbuffer, rb_pos, len) < len) {
throw new Error('[CopyUncompressedBlockToOutput] not enough bytes');
}
/* Restore the state of the bit reader. */
br.reset();
}
/* Advances the bit reader position to the next byte boundary and verifies
that any skipped bits are set to zero. */
function JumpToByteBoundary(br) {
var new_bit_pos = (br.bit_pos_ + 7) & ~7;
var pad_bits = br.readBits(new_bit_pos - br.bit_pos_);
return pad_bits == 0;
}
function BrotliDecompressedSize(buffer) {
var input = new BrotliInput(buffer);
var br = new BrotliBitReader(input);
DecodeWindowBits(br);
var out = DecodeMetaBlockLength(br);
return out.meta_block_length;
}
exports.BrotliDecompressedSize = BrotliDecompressedSize;
function BrotliDecompressBuffer(buffer, output_size) {
var input = new BrotliInput(buffer);
if (output_size == null) {
output_size = BrotliDecompressedSize(buffer);
}
var output_buffer = new Uint8Array(output_size);
var output = new BrotliOutput(output_buffer);
BrotliDecompress(input, output);
if (output.pos < output.buffer.length) {
output.buffer = output.buffer.subarray(0, output.pos);
}
return output.buffer;
}
exports.BrotliDecompressBuffer = BrotliDecompressBuffer;
function BrotliDecompress(input, output) {
var i;
var pos = 0;
var input_end = 0;
var window_bits = 0;
var max_backward_distance;
var max_distance = 0;
var ringbuffer_size;
var ringbuffer_mask;
var ringbuffer;
var ringbuffer_end;
/* This ring buffer holds a few past copy distances that will be used by */
/* some special distance codes. */
var dist_rb = [ 16, 15, 11, 4 ];
var dist_rb_idx = 0;
/* The previous 2 bytes used for context. */
var prev_byte1 = 0;
var prev_byte2 = 0;
var hgroup = [new HuffmanTreeGroup(0, 0), new HuffmanTreeGroup(0, 0), new HuffmanTreeGroup(0, 0)];
var block_type_trees;
var block_len_trees;
var br;
/* We need the slack region for the following reasons:
- always doing two 8-byte copies for fast backward copying
- transforms
- flushing the input ringbuffer when decoding uncompressed blocks */
var kRingBufferWriteAheadSlack = 128 + BrotliBitReader.READ_SIZE;
br = new BrotliBitReader(input);
/* Decode window size. */
window_bits = DecodeWindowBits(br);
max_backward_distance = (1 << window_bits) - 16;
ringbuffer_size = 1 << window_bits;
ringbuffer_mask = ringbuffer_size - 1;
ringbuffer = new Uint8Array(ringbuffer_size + kRingBufferWriteAheadSlack + BrotliDictionary.maxDictionaryWordLength);
ringbuffer_end = ringbuffer_size;
block_type_trees = [];
block_len_trees = [];
for (var x = 0; x < 3 * HUFFMAN_MAX_TABLE_SIZE; x++) {
block_type_trees[x] = new HuffmanCode(0, 0);
block_len_trees[x] = new HuffmanCode(0, 0);
}
while (!input_end) {
var meta_block_remaining_len = 0;
var is_uncompressed;
var block_length = [ 1 << 28, 1 << 28, 1 << 28 ];
var block_type = [ 0 ];
var num_block_types = [ 1, 1, 1 ];
var block_type_rb = [ 0, 1, 0, 1, 0, 1 ];
var block_type_rb_index = [ 0 ];
var distance_postfix_bits;
var num_direct_distance_codes;
var distance_postfix_mask;
var num_distance_codes;
var context_map = null;
var context_modes = null;
var num_literal_htrees;
var dist_context_map = null;
var num_dist_htrees;
var context_offset = 0;
var context_map_slice = null;
var literal_htree_index = 0;
var dist_context_offset = 0;
var dist_context_map_slice = null;
var dist_htree_index = 0;
var context_lookup_offset1 = 0;
var context_lookup_offset2 = 0;
var context_mode;
var htree_command;
for (i = 0; i < 3; ++i) {
hgroup[i].codes = null;
hgroup[i].htrees = null;
}
br.readMoreInput();
var _out = DecodeMetaBlockLength(br);
meta_block_remaining_len = _out.meta_block_length;
if (pos + meta_block_remaining_len > output.buffer.length) {
/* We need to grow the output buffer to fit the additional data. */
var tmp = new Uint8Array( pos + meta_block_remaining_len );
tmp.set( output.buffer );
output.buffer = tmp;
}
input_end = _out.input_end;
is_uncompressed = _out.is_uncompressed;
if (_out.is_metadata) {
JumpToByteBoundary(br);
for (; meta_block_remaining_len > 0; --meta_block_remaining_len) {
br.readMoreInput();
/* Read one byte and ignore it. */
br.readBits(8);
}
continue;
}
if (meta_block_remaining_len === 0) {
continue;
}
if (is_uncompressed) {
br.bit_pos_ = (br.bit_pos_ + 7) & ~7;
CopyUncompressedBlockToOutput(output, meta_block_remaining_len, pos,
ringbuffer, ringbuffer_mask, br);
pos += meta_block_remaining_len;
continue;
}
for (i = 0; i < 3; ++i) {
num_block_types[i] = DecodeVarLenUint8(br) + 1;
if (num_block_types[i] >= 2) {
ReadHuffmanCode(num_block_types[i] + 2, block_type_trees, i * HUFFMAN_MAX_TABLE_SIZE, br);
ReadHuffmanCode(kNumBlockLengthCodes, block_len_trees, i * HUFFMAN_MAX_TABLE_SIZE, br);
block_length[i] = ReadBlockLength(block_len_trees, i * HUFFMAN_MAX_TABLE_SIZE, br);
block_type_rb_index[i] = 1;
}
}
br.readMoreInput();
distance_postfix_bits = br.readBits(2);
num_direct_distance_codes = NUM_DISTANCE_SHORT_CODES + (br.readBits(4) << distance_postfix_bits);
distance_postfix_mask = (1 << distance_postfix_bits) - 1;
num_distance_codes = (num_direct_distance_codes + (48 << distance_postfix_bits));
context_modes = new Uint8Array(num_block_types[0]);
for (i = 0; i < num_block_types[0]; ++i) {
br.readMoreInput();
context_modes[i] = (br.readBits(2) << 1);
}
var _o1 = DecodeContextMap(num_block_types[0] << kLiteralContextBits, br);
num_literal_htrees = _o1.num_htrees;
context_map = _o1.context_map;
var _o2 = DecodeContextMap(num_block_types[2] << kDistanceContextBits, br);
num_dist_htrees = _o2.num_htrees;
dist_context_map = _o2.context_map;
hgroup[0] = new HuffmanTreeGroup(kNumLiteralCodes, num_literal_htrees);
hgroup[1] = new HuffmanTreeGroup(kNumInsertAndCopyCodes, num_block_types[1]);
hgroup[2] = new HuffmanTreeGroup(num_distance_codes, num_dist_htrees);
for (i = 0; i < 3; ++i) {
hgroup[i].decode(br);
}
context_map_slice = 0;
dist_context_map_slice = 0;
context_mode = context_modes[block_type[0]];
context_lookup_offset1 = Context.lookupOffsets[context_mode];
context_lookup_offset2 = Context.lookupOffsets[context_mode + 1];
htree_command = hgroup[1].htrees[0];
while (meta_block_remaining_len > 0) {
var cmd_code;
var range_idx;
var insert_code;
var copy_code;
var insert_length;
var copy_length;
var distance_code;
var distance;
var context;
var j;
var copy_dst;
br.readMoreInput();
if (block_length[1] === 0) {
DecodeBlockType(num_block_types[1],
block_type_trees, 1, block_type, block_type_rb,
block_type_rb_index, br);
block_length[1] = ReadBlockLength(block_len_trees, HUFFMAN_MAX_TABLE_SIZE, br);
htree_command = hgroup[1].htrees[block_type[1]];
}
--block_length[1];
cmd_code = ReadSymbol(hgroup[1].codes, htree_command, br);
range_idx = cmd_code >> 6;
if (range_idx >= 2) {
range_idx -= 2;
distance_code = -1;
} else {
distance_code = 0;
}
insert_code = Prefix.kInsertRangeLut[range_idx] + ((cmd_code >> 3) & 7);
copy_code = Prefix.kCopyRangeLut[range_idx] + (cmd_code & 7);
insert_length = Prefix.kInsertLengthPrefixCode[insert_code].offset +
br.readBits(Prefix.kInsertLengthPrefixCode[insert_code].nbits);
copy_length = Prefix.kCopyLengthPrefixCode[copy_code].offset +
br.readBits(Prefix.kCopyLengthPrefixCode[copy_code].nbits);
prev_byte1 = ringbuffer[pos-1 & ringbuffer_mask];
prev_byte2 = ringbuffer[pos-2 & ringbuffer_mask];
for (j = 0; j < insert_length; ++j) {
br.readMoreInput();
if (block_length[0] === 0) {
DecodeBlockType(num_block_types[0],
block_type_trees, 0, block_type, block_type_rb,
block_type_rb_index, br);
block_length[0] = ReadBlockLength(block_len_trees, 0, br);
context_offset = block_type[0] << kLiteralContextBits;
context_map_slice = context_offset;
context_mode = context_modes[block_type[0]];
context_lookup_offset1 = Context.lookupOffsets[context_mode];
context_lookup_offset2 = Context.lookupOffsets[context_mode + 1];
}
context = (Context.lookup[context_lookup_offset1 + prev_byte1] |
Context.lookup[context_lookup_offset2 + prev_byte2]);
literal_htree_index = context_map[context_map_slice + context];
--block_length[0];
prev_byte2 = prev_byte1;
prev_byte1 = ReadSymbol(hgroup[0].codes, hgroup[0].htrees[literal_htree_index], br);
ringbuffer[pos & ringbuffer_mask] = prev_byte1;
if ((pos & ringbuffer_mask) === ringbuffer_mask) {
output.write(ringbuffer, ringbuffer_size);
}
++pos;
}
meta_block_remaining_len -= insert_length;
if (meta_block_remaining_len <= 0) break;
if (distance_code < 0) {
var context;
br.readMoreInput();
if (block_length[2] === 0) {
DecodeBlockType(num_block_types[2],
block_type_trees, 2, block_type, block_type_rb,
block_type_rb_index, br);
block_length[2] = ReadBlockLength(block_len_trees, 2 * HUFFMAN_MAX_TABLE_SIZE, br);
dist_context_offset = block_type[2] << kDistanceContextBits;
dist_context_map_slice = dist_context_offset;
}
--block_length[2];
context = (copy_length > 4 ? 3 : copy_length - 2) & 0xff;
dist_htree_index = dist_context_map[dist_context_map_slice + context];
distance_code = ReadSymbol(hgroup[2].codes, hgroup[2].htrees[dist_htree_index], br);
if (distance_code >= num_direct_distance_codes) {
var nbits;
var postfix;
var offset;
distance_code -= num_direct_distance_codes;
postfix = distance_code & distance_postfix_mask;
distance_code >>= distance_postfix_bits;
nbits = (distance_code >> 1) + 1;
offset = ((2 + (distance_code & 1)) << nbits) - 4;
distance_code = num_direct_distance_codes +
((offset + br.readBits(nbits)) <<
distance_postfix_bits) + postfix;
}
}
/* Convert the distance code to the actual distance by possibly looking */
/* up past distnaces from the ringbuffer. */
distance = TranslateShortCodes(distance_code, dist_rb, dist_rb_idx);
if (distance < 0) {
throw new Error('[BrotliDecompress] invalid distance');
}
if (pos < max_backward_distance &&
max_distance !== max_backward_distance) {
max_distance = pos;
} else {
max_distance = max_backward_distance;
}
copy_dst = pos & ringbuffer_mask;
if (distance > max_distance) {
if (copy_length >= BrotliDictionary.minDictionaryWordLength &&
copy_length <= BrotliDictionary.maxDictionaryWordLength) {
var offset = BrotliDictionary.offsetsByLength[copy_length];
var word_id = distance - max_distance - 1;
var shift = BrotliDictionary.sizeBitsByLength[copy_length];
var mask = (1 << shift) - 1;
var word_idx = word_id & mask;
var transform_idx = word_id >> shift;
offset += word_idx * copy_length;
if (transform_idx < Transform.kNumTransforms) {
var len = Transform.transformDictionaryWord(ringbuffer, copy_dst, offset, copy_length, transform_idx);
copy_dst += len;
pos += len;
meta_block_remaining_len -= len;
if (copy_dst >= ringbuffer_end) {
output.write(ringbuffer, ringbuffer_size);
for (var _x = 0; _x < (copy_dst - ringbuffer_end); _x++)
ringbuffer[_x] = ringbuffer[ringbuffer_end + _x];
}
} else {
throw new Error("Invalid backward reference. pos: " + pos + " distance: " + distance +
" len: " + copy_length + " bytes left: " + meta_block_remaining_len);
}
} else {
throw new Error("Invalid backward reference. pos: " + pos + " distance: " + distance +
" len: " + copy_length + " bytes left: " + meta_block_remaining_len);
}
} else {
if (distance_code > 0) {
dist_rb[dist_rb_idx & 3] = distance;
++dist_rb_idx;
}
if (copy_length > meta_block_remaining_len) {
throw new Error("Invalid backward reference. pos: " + pos + " distance: " + distance +
" len: " + copy_length + " bytes left: " + meta_block_remaining_len);
}
for (j = 0; j < copy_length; ++j) {
ringbuffer[pos & ringbuffer_mask] = ringbuffer[(pos - distance) & ringbuffer_mask];
if ((pos & ringbuffer_mask) === ringbuffer_mask) {
output.write(ringbuffer, ringbuffer_size);
}
++pos;
--meta_block_remaining_len;
}
}
/* When we get here, we must have inserted at least one literal and */
/* made a copy of at least length two, therefore accessing the last 2 */
/* bytes is valid. */
prev_byte1 = ringbuffer[(pos - 1) & ringbuffer_mask];
prev_byte2 = ringbuffer[(pos - 2) & ringbuffer_mask];
}
/* Protect pos from overflow, wrap it around at every GB of input data */
pos &= 0x3fffffff;
}
output.write(ringbuffer, pos & ringbuffer_mask);
}
exports.BrotliDecompress = BrotliDecompress;
BrotliDictionary.init();
},{"./bit_reader":1,"./context":2,"./dictionary":6,"./huffman":7,"./prefix":9,"./streams":10,"./transform":11}],4:[function(require,module,exports){
var base64 = require('base64-js');
//var fs = require('fs');
/**
* The normal dictionary-data.js is quite large, which makes it
* unsuitable for browser usage. In order to make it smaller,
* we read dictionary.bin, which is a compressed version of
* the dictionary, and on initial load, Brotli decompresses
* it's own dictionary. 😜
*/
exports.init = function() {
var BrotliDecompressBuffer = require('./decode').BrotliDecompressBuffer;
var compressed = base64.toByteArray(require('./dictionary.bin.js'));
return BrotliDecompressBuffer(compressed);
};
},{"./decode":3,"./dictionary.bin.js":5,"base64-js":8}],5:[function(require,module,exports){
module.exports="W5/fcQLn5gKf2XUbAiQ1XULX+TZz6ADToDsgqk6qVfeC0e4m6OO2wcQ1J76ZBVRV1fRkEsdu//62zQsFEZWSTCnMhcsQKlS2qOhuVYYMGCkV0fXWEoMFbESXrKEZ9wdUEsyw9g4bJlEt1Y6oVMxMRTEVbCIwZzJzboK5j8m4YH02qgXYhv1V+PM435sLVxyHJihaJREEhZGqL03txGFQLm76caGO/ovxKvzCby/3vMTtX/459f0igi7WutnKiMQ6wODSoRh/8Lx1V3Q99MvKtwB6bHdERYRY0hStJoMjNeTsNX7bn+Y7e4EQ3bf8xBc7L0BsyfFPK43dGSXpL6clYC/I328h54/VYrQ5i0648FgbGtl837svJ35L3Mot/+nPlNpWgKx1gGXQYqX6n+bbZ7wuyCHKcUok12Xjqub7NXZGzqBx0SD+uziNf87t7ve42jxSKQoW3nyxVrWIGlFShhCKxjpZZ5MeGna0+lBkk+kaN8F9qFBAFgEogyMBdcX/T1W/WnMOi/7ycWUQloEBKGeC48MkiwqJkJO+12eQiOFHMmck6q/IjWW3RZlany23TBm+cNr/84/oi5GGmGBZWrZ6j+zykVozz5fT/QH/Da6WTbZYYPynVNO7kxzuNN2kxKKWche5WveitPKAecB8YcAHz/+zXLjcLzkdDSktNIDwZE9J9X+tto43oJy65wApM3mDzYtCwX9lM+N5VR3kXYo0Z3t0TtXfgBFg7gU8oN0Dgl7fZlUbhNll+0uuohRVKjrEd8egrSndy5/Tgd2gqjA4CAVuC7ESUmL3DZoGnfhQV8uwnpi8EGvAVVsowNRxPudck7+oqAUDkwZopWqFnW1riss0t1z6iCISVKreYGNvQcXv+1L9+jbP8cd/dPUiqBso2q+7ZyFBvENCkkVr44iyPbtOoOoCecWsiuqMSML5lv+vN5MzUr+Dnh73G7Q1YnRYJVYXHRJaNAOByiaK6CusgFdBPE40r0rvqXV7tksKO2DrHYXBTv8P5ysqxEx8VDXUDDqkPH6NNOV/a2WH8zlkXRELSa8P+heNyJBBP7PgsG1EtWtNef6/i+lcayzQwQCsduidpbKfhWUDgAEmyhGu/zVTacI6RS0zTABrOYueemnVa19u9fT23N/Ta6RvTpof5DWygqreCqrDAgM4LID1+1T/taU6yTFVLqXOv+/MuQOFnaF8vLMKD7tKWDoBdALgxF33zQccCcdHx8fKIVdW69O7qHtXpeGr9jbbpFA+qRMWr5hp0s67FPc7HAiLV0g0/peZlW7hJPYEhZyhpSwahnf93/tZgfqZWXFdmdXBzqxGHLrQKxoAY6fRoBhgCRPmmGueYZ5JexTVDKUIXzkG/fqp/0U3hAgQdJ9zumutK6nqWbaqvm1pgu03IYR+G+8s0jDBBz8cApZFSBeuWasyqo2OMDKAZCozS+GWSvL/HsE9rHxooe17U3s/lTE+VZAk4j3dp6uIGaC0JMiqR5CUsabPyM0dOYDR7Ea7ip4USZlya38YfPtvrX/tBlhHilj55nZ1nfN24AOAi9BVtz/Mbn8AEDJCqJgsVUa6nQnSxv2Fs7l/NlCzpfYEjmPrNyib/+t0ei2eEMjvNhLkHCZlci4WhBe7ePZTmzYqlY9+1pxtS4GB+5lM1BHT9tS270EWUDYFq1I0yY/fNiAk4bk9yBgmef/f2k6AlYQZHsNFnW8wBQxCd68iWv7/35bXfz3JZmfGligWAKRjIs3IpzxQ27vAglHSiOzCYzJ9L9A1CdiyFvyR66ucA4jKifu5ehwER26yV7HjKqn5Mfozo7Coxxt8LWWPT47BeMxX8p0Pjb7hZn+6bw7z3Lw+7653j5sI8CLu5kThpMlj1m4c2ch3jGcP1FsT13vuK3qjecKTZk2kHcOZY40UX+qdaxstZqsqQqgXz+QGF99ZJLqr3VYu4aecl1Ab5GmqS8k/GV5b95zxQ5d4EfXUJ6kTS/CXF/aiqKDOT1T7Jz5z0PwDUcwr9clLN1OJGCiKfqvah+h3XzrBOiLOW8wvn8gW6qE8vPxi+Efv+UH55T7PQFVMh6cZ1pZQlzJpKZ7P7uWvwPGJ6DTlR6wbyj3Iv2HyefnRo/dv7dNx+qaa0N38iBsR++Uil7Wd4afwDNsrzDAK4fXZwvEY/jdKuIKXlfrQd2C39dW7ntnRbIp9OtGy9pPBn/V2ASoi/2UJZfS+xuGLH8bnLuPlzdTNS6zdyk8Dt/h6sfOW5myxh1f+zf3zZ3MX/mO9cQPp5pOx967ZA6/pqHvclNfnUFF+rq+Vd7alKr6KWPcIDhpn6v2K6NlUu6LrKo8b/pYpU/Gazfvtwhn7tEOUuXht5rUJdSf6sLjYf0VTYDgwJ81yaqKTUYej/tbHckSRb/HZicwGJqh1mAHB/IuNs9dc9yuvF3D5Xocm3elWFdq5oEy70dYFit79yaLiNjPj5UUcVmZUVhQEhW5V2Z6Cm4HVH/R8qlamRYwBileuh07CbEce3TXa2JmXWBf+ozt319psboobeZhVnwhMZzOeQJzhpTDbP71Tv8HuZxxUI/+ma3XW6DFDDs4+qmpERwHGBd2edxwUKlODRdUWZ/g0GOezrbzOZauFMai4QU6GVHV6aPNBiBndHSsV4IzpvUiiYyg6OyyrL4Dj5q/Lw3N5kAwftEVl9rNd7Jk5PDij2hTH6wIXnsyXkKePxbmHYgC8A6an5Fob/KH5GtC0l4eFso+VpxedtJHdHpNm+Bvy4C79yVOkrZsLrQ3OHCeB0Ra+kBIRldUGlDCEmq2RwXnfyh6Dz+alk6eftI2n6sastRrGwbwszBeDRS/Fa/KwRJkCzTsLr/JCs5hOPE/MPLYdZ1F1fv7D+VmysX6NpOC8aU9F4Qs6HvDyUy9PvFGDKZ/P5101TYHFl8pjj6wm/qyS75etZhhfg0UEL4OYmHk6m6dO192AzoIyPSV9QedDA4Ml23rRbqxMPMxf7FJnDc5FTElVS/PyqgePzmwVZ26NWhRDQ+oaT7ly7ell4s3DypS1s0g+tOr7XHrrkZj9+x/mJBttrLx98lFIaRZzHz4aC7r52/JQ4VjHahY2/YVXZn/QC2ztQb/sY3uRlyc5vQS8nLPGT/n27495i8HPA152z7Fh5aFpyn1GPJKHuPL8Iw94DuW3KjkURAWZXn4EQy89xiKEHN1mk/tkM4gYDBxwNoYvRfE6LFqsxWJtPrDGbsnLMap3Ka3MUoytW0cvieozOmdERmhcqzG+3HmZv2yZeiIeQTKGdRT4HHNxekm1tY+/n06rGmFleqLscSERzctTKM6G9P0Pc1RmVvrascIxaO1CQCiYPE15bD7c3xSeW7gXxYjgxcrUlcbIvO0r+Yplhx0kTt3qafDOmFyMjgGxXu73rddMHpV1wMubyAGcf/v5dLr5P72Ta9lBF+fzMJrMycwv+9vnU3ANIl1cH9tfW7af8u0/HG0vV47jNFXzFTtaha1xvze/s8KMtCYucXc1nzfd/MQydUXn/b72RBt5wO/3jRcMH9BdhC/yctKBIveRYPrNpDWqBsO8VMmP+WvRaOcA4zRMR1PvSoO92rS7pYEv+fZfEfTMzEdM+6X5tLlyxExhqLRkms5EuLovLfx66de5fL2/yX02H52FPVwahrPqmN/E0oVXnsCKhbi/yRxX83nRbUKWhzYceXOntfuXn51NszJ6MO73pQf5Pl4in3ec4JU8hF7ppV34+mm9r1LY0ee/i1O1wpd8+zfLztE0cqBxggiBi5Bu95v9l3r9r/U5hweLn+TbfxowrWDqdJauKd8+q/dH8sbPkc9ttuyO94f7/XK/nHX46MPFLEb5qQlNPvhJ50/59t9ft3LXu7uVaWaO2bDrDCnRSzZyWvFKxO1+vT8MwwunR3bX0CkfPjqb4K9O19tn5X50PvmYpEwHtiW9WtzuV/s76B1zvLLNkViNd8ySxIl/3orfqP90TyTGaf7/rx8jQzeHJXdmh/N6YDvbvmTBwCdxfEQ1NcL6wNMdSIXNq7b1EUzRy1/Axsyk5p22GMG1b+GxFgbHErZh92wuvco0AuOLXct9hvw2nw/LqIcDRRmJmmZzcgUa7JpM/WV/S9IUfbF56TL2orzqwebdRD8nIYNJ41D/hz37Fo11p2Y21wzPcn713qVGhqtevStYfGH4n69OEJtPvbbLYWvscDqc3Hgnu166+tAyLnxrX0Y5zoYjV++1sI7t5kMr02KT/+uwtkc+rZLOf/qn/s3nYCf13Dg8/sB2diJgjGqjQ+TLhxbzyue2Ob7X6/9lUwW7a+lbznHzOYy8LKW1C/uRPbQY3KW/0gO9LXunHLvPL97afba9bFtc9hmz7GAttjVYlCvQAiOwAk/gC5+hkLEs6tr3AZKxLJtOEwk2dLxTYWsIB/j/ToWtIWzo906FrSG8iaqqqqqqiIiIiAgzMzMzNz+AyK+01/zi8n8S+Y1MjoRaQ80WU/G8MBlO+53VPXANrWm4wzGUVZUjjBJZVdhpcfkjsmcWaO+UEldXi1e+zq+HOsCpknYshuh8pOLISJun7TN0EIGW2xTnlOImeecnoGW4raxe2G1T3HEvfYUYMhG+gAFOAwh5nK8mZhwJMmN7r224QVsNFvZ87Z0qatvknklyPDK3Hy45PgVKXji52Wen4d4PlFVVYGnNap+fSpFbK90rYnhUc6n91Q3AY9E0tJOFrcfZtm/491XbcG/jsViUPPX76qmeuiz+qY1Hk7/1VPM405zWVuoheLUimpWYdVzCmUdKHebMdzgrYrb8mL2eeLSnRWHdonfZa8RsOU9F37w+591l5FLYHiOqWeHtE/lWrBHcRKp3uhtr8yXm8LU/5ms+NM6ZKsqu90cFZ4o58+k4rdrtB97NADFbwmEG7lXqvirhOTOqU14xuUF2myIjURcPHrPOQ4lmM3PeMg7bUuk0nnZi67bXsU6H8lhqIo8TaOrEafCO1ARK9PjC0QOoq2BxmMdgYB9G/lIb9++fqNJ2s7BHGFyBNmZAR8J3KCo012ikaSP8BCrf6VI0X5xdnbhHIO+B5rbOyB54zXkzfObyJ4ecwxfqBJMLFc7m59rNcw7hoHnFZ0b00zee+gTqvjm61Pb4xn0kcDX4jvHM0rBXZypG3DCKnD/Waa/ZtHmtFPgO5eETx+k7RrVg3aSwm2YoNXnCs3XPQDhNn+Fia6IlOOuIG6VJH7TP6ava26ehKHQa2T4N0tcZ9dPCGo3ZdnNltsHQbeYt5vPnJezV/cAeNypdml1vCHI8M81nSRP5Qi2+mI8v/sxiZru9187nRtp3f/42NemcONa+4eVC3PCZzc88aZh851CqSsshe70uPxeN/dmYwlwb3trwMrN1Gq8jbnApcVDx/yDPeYs5/7r62tsQ6lLg+DiFXTEhzR9dHqv0iT4tgj825W+H3XiRUNUZT2kR9Ri0+lp+UM3iQtS8uOE23Ly4KYtvqH13jghUntJRAewuzNLDXp8RxdcaA3cMY6TO2IeSFRXezeWIjCqyhsUdMYuCgYTZSKpBype1zRfq8FshvfBPc6BAQWl7/QxIDp3VGo1J3vn42OEs3qznws+YLRXbymyB19a9XBx6n/owcyxlEYyFWCi+kG9F+EyD/4yn80+agaZ9P7ay2Dny99aK2o91FkfEOY8hBwyfi5uwx2y5SaHmG+oq/zl1FX/8irOf8Y3vAcX/6uLP6A6nvMO24edSGPjQc827Rw2atX+z2bKq0CmW9mOtYnr5/AfDa1ZfPaXnKtlWborup7QYx+Or2uWb+N3N//2+yDcXMqIJdf55xl7/vsj4WoPPlxLxtVrkJ4w/tTe3mLdATOOYwxcq52w5Wxz5MbPdVs5O8/lhfE7dPj0bIiPQ3QV0iqm4m3YX8hRfc6jQ3fWepevMqUDJd86Z4vwM40CWHnn+WphsGHfieF02D3tmZvpWD+kBpNCFcLnZhcmmrhpGzzbdA+sQ1ar18OJD87IOKOFoRNznaHPNHUfUNhvY1iU+uhvEvpKHaUn3qK3exVVyX4joipp3um7FmYJWmA+WbIDshRpbVRx5/nqstCgy87FGbfVB8yDGCqS+2qCsnRwnSAN6zgzxfdB2nBT/vZ4/6uxb6oH8b4VBRxiIB93wLa47hG3w2SL/2Z27yOXJFwZpSJaBYyvajA7vRRYNKqljXKpt/CFD/tSMr18DKKbwB0xggBePatl1nki0yvqW5zchlyZmJ0OTxJ3D+fsYJs/mxYN5+Le5oagtcl+YsVvy8kSjI2YGvGjvmpkRS9W2dtXqWnVuxUhURm1lKtou/hdEq19VBp9OjGvHEQSmrpuf2R24mXGheil8KeiANY8fW1VERUfBImb64j12caBZmRViZHbeVMjCrPDg9A90IXrtnsYCuZtRQ0PyrKDjBNOsPfKsg1pA02gHlVr0OXiFhtp6nJqXVzcbfM0KnzC3ggOENPE9VBdmHKN6LYaijb4wXxJn5A0FSDF5j+h1ooZx885Jt3ZKzO5n7Z5WfNEOtyyPqQEnn7WLv5Fis3PdgMshjF1FRydbNyeBbyKI1oN1TRVrVK7kgsb/zjX4NDPIRMctVeaxVB38Vh1x5KbeJbU138AM5KzmZu3uny0ErygxiJF7GVXUrPzFxrlx1uFdAaZFDN9cvIb74qD9tzBMo7L7WIEYK+sla1DVMHpF0F7b3+Y6S+zjvLeDMCpapmJo1weBWuxKF3rOocih1gun4BoJh1kWnV/Jmiq6uOhK3VfKxEHEkafjLgK3oujaPzY6SXg8phhL4TNR1xvJd1Wa0aYFfPUMLrNBDCh4AuGRTbtKMc6Z1Udj8evY/ZpCuMAUefdo69DZUngoqE1P9A3PJfOf7WixCEj+Y6t7fYeHbbxUAoFV3M89cCKfma3fc1+jKRe7MFWEbQqEfyzO2x/wrO2VYH7iYdQ9BkPyI8/3kXBpLaCpU7eC0Yv/am/tEDu7HZpqg0EvHo0nf/R/gRzUWy33/HXMJQeu1GylKmOkXzlCfGFruAcPPhaGqZOtu19zsJ1SO2Jz4Ztth5cBX6mRQwWmDwryG9FUMlZzNckMdK+IoMJv1rOWnBamS2w2KHiaPMPLC15hCZm4KTpoZyj4E2TqC/P6r7/EhnDMhKicZZ1ZwxuC7DPzDGs53q8gXaI9kFTK+2LTq7bhwsTbrMV8Rsfua5lMS0FwbTitUVnVa1yTb5IX51mmYnUcP9wPr8Ji1tiYJeJV9GZTrQhF7vvdU2OTU42ogJ9FDwhmycI2LIg++03C6scYhUyUuMV5tkw6kGUoL+mjNC38+wMdWNljn6tGPpRES7veqrSn5TRuv+dh6JVL/iDHU1db4c9WK3++OrH3PqziF916UMUKn8G67nN60GfWiHrXYhUG3yVWmyYak59NHj8t1smG4UDiWz2rPHNrKnN4Zo1LBbr2/eF9YZ0n0blx2nG4X+EKFxvS3W28JESD+FWk61VCD3z/URGHiJl++7TdBwkCj6tGOH3qDb0QqcOF9Kzpj0HUb/KyFW3Yhj2VMKJqGZleFBH7vqvf7WqLC3XMuHV8q8a4sTFuxUtkD/6JIBvKaVjv96ndgruKZ1k/BHzqf2K9fLk7HGXANyLDd1vxkK/i055pnzl+zw6zLnwXlVYVtfmacJgEpRP1hbGgrYPVN6v2lG+idQNGmwcKXu/8xEj/P6qe/sB2WmwNp6pp8jaISMkwdleFXYK55NHWLTTbutSUqjBfDGWo/Yg918qQ+8BRZSAHZbfuNZz2O0sov1Ue4CWlVg3rFhM3Kljj9ksGd/NUhk4nH+a5UN2+1i8+NM3vRNp7uQ6sqexSCukEVlVZriHNqFi5rLm9TMWa4qm3idJqppQACol2l4VSuvWLfta4JcXy3bROPNbXOgdOhG47LC0CwW/dMlSx4Jf17aEU3yA1x9p+Yc0jupXgcMuYNku64iYOkGToVDuJvlbEKlJqsmiHbvNrIVZEH+yFdF8DbleZ6iNiWwMqvtMp/mSpwx5KxRrT9p3MAPTHGtMbfvdFhyj9vhaKcn3At8Lc16Ai+vBcSp1ztXi7rCJZx/ql7TXcclq6Q76UeKWDy9boS0WHIjUuWhPG8LBmW5y2rhuTpM5vsLt+HOLh1Yf0DqXa9tsfC+kaKt2htA0ai/L2i7RKoNjEwztkmRU0GfgW1TxUvPFhg0V7DdfWJk5gfrccpYv+MA9M0dkGTLECeYwUixRzjRFdmjG7zdZIl3XKB9YliNKI31lfa7i2JG5C8Ss+rHe0D7Z696/V3DEAOWHnQ9yNahMUl5kENWS6pHKKp2D1BaSrrHdE1w2qNxIztpXgUIrF0bm15YML4b6V1k+GpNysTahKMVrrS85lTVo9OGJ96I47eAy5rYWpRf/mIzeoYU1DKaQCTUVwrhHeyNoDqHel+lLxr9WKzhSYw7vrR6+V5q0pfi2k3L1zqkubY6rrd9ZLvSuWNf0uqnkY+FpTvFzSW9Fp0b9l8JA7THV9eCi/PY/SCZIUYx3BU2alj7Cm3VV6eYpios4b6WuNOJdYXUK3zTqj5CVG2FqYM4Z7CuIU0qO05XR0d71FHM0YhZmJmTRfLlXEumN82BGtzdX0S19t1e+bUieK8zRmqpa4Qc5TSjifmaQsY2ETLjhI36gMR1+7qpjdXXHiceUekfBaucHShAOiFXmv3sNmGQyU5iVgnoocuonQXEPTFwslHtS8R+A47StI9wj0iSrtbi5rMysczFiImsQ+bdFClnFjjpXXwMy6O7qfjOr8Fb0a7ODItisjnn3EQO16+ypd1cwyaAW5Yzxz5QknfMO7643fXW/I9y3U2xH27Oapqr56Z/tEzglj6IbT6HEHjopiXqeRbe5mQQvxtcbDOVverN0ZgMdzqRYRjaXtMRd56Q4cZSmdPvZJdSrhJ1D9zNXPqAEqPIavPdfubt5oke2kmv0dztIszSv2VYuoyf1UuopbsYb+uX9h6WpwjpgtZ6fNNawNJ4q8O3CFoSbioAaOSZMx2GYaPYB+rEb6qjQiNRFQ76TvwNFVKD+BhH9VhcKGsXzmMI7BptU/CNWolM7YzROvpFAntsiWJp6eR2d3GarcYShVYSUqhmYOWj5E96NK2WvmYNTeY7Zs4RUEdv9h9QT4EseKt6LzLrqEOs3hxAY1MaNWpSa6zZx8F3YOVeCYMS88W+CYHDuWe4yoc6YK+djDuEOrBR5lvh0r+Q9uM88lrjx9x9AtgpQVNE8r+3O6Gvw59D+kBF/UMXyhliYUtPjmvXGY6Dk3x+kEOW+GtdMVC4EZTqoS/jmR0P0LS75DOc/w2vnri97M4SdbZ8qeU7gg8DVbERkU5geaMQO3mYrSYyAngeUQqrN0C0/vsFmcgWNXNeidsTAj7/4MncJR0caaBUpbLK1yBCBNRjEv6KvuVSdpPnEMJdsRRtqJ+U8tN1gXA4ePHc6ZT0eviI73UOJF0fEZ8YaneAQqQdGphNvwM4nIqPnXxV0xA0fnCT+oAhJuyw/q8jO0y8CjSteZExwBpIN6SvNp6A5G/abi6egeND/1GTguhuNjaUbbnSbGd4L8937Ezm34Eyi6n1maeOBxh3PI0jzJDf5mh/BsLD7F2GOKvlA/5gtvxI3/eV4sLfKW5Wy+oio+es/u6T8UU+nsofy57Icb/JlZHPFtCgd/x+bwt3ZT+xXTtTtTrGAb4QehC6X9G+8YT+ozcLxDsdCjsuOqwPFnrdLYaFc92Ui0m4fr39lYmlCaqTit7G6O/3kWDkgtXjNH4BiEm/+jegQnihOtfffn33WxsFjhfMd48HT+f6o6X65j7XR8WLSHMFkxbvOYsrRsF1bowDuSQ18Mkxk4qz2zoGPL5fu9h2Hqmt1asl3Q3Yu3szOc+spiCmX4AETBM3pLoTYSp3sVxahyhL8eC4mPN9k2x3o0xkiixIzM3CZFzf5oR4mecQ5+ax2wCah3/crmnHoqR0+KMaOPxRif1oEFRFOO/kTPPmtww+NfMXxEK6gn6iU32U6fFruIz8Q4WgljtnaCVTBgWx7diUdshC9ZEa5yKpRBBeW12r/iNc/+EgNqmhswNB8SBoihHXeDF7rrWDLcmt3V8GYYN7pXRy4DZjj4DJuUBL5iC3DQAaoo4vkftqVTYRGLS3mHZ7gdmdTTqbgNN/PTdTCOTgXolc88MhXAEUMdX0iy1JMuk5wLsgeu0QUYlz2S4skTWwJz6pOm/8ihrmgGfFgri+ZWUK2gAPHgbWa8jaocdSuM4FJYoKicYX/ZSENkg9Q1ZzJfwScfVnR2DegOGwCvmogaWJCLQepv9WNlU6QgsmOwICquU28Mlk3d9W5E81lU/5Ez0LcX6lwKMWDNluNKfBDUy/phJgBcMnfkh9iRxrdOzgs08JdPB85Lwo+GUSb4t3nC+0byqMZtO2fQJ4U2zGIr49t/28qmmGv2RanDD7a3FEcdtutkW8twwwlUSpb8QalodddbBfNHKDQ828BdE7OBgFdiKYohLawFYqpybQoxATZrheLhdI7+0Zlu9Q1myRcd15r9UIm8K2LGJxqTegntqNVMKnf1a8zQiyUR1rxoqjiFxeHxqFcYUTHfDu7rhbWng6qOxOsI+5A1p9mRyEPdVkTlE24vY54W7bWc6jMgZvNXdfC9/9q7408KDsbdL7Utz7QFSDetz2picArzrdpL8OaCHC9V26RroemtDZ5yNM/KGkWMyTmfnInEvwtSD23UcFcjhaE3VKzkoaEMKGBft4XbIO6forTY1lmGQwVmKicBCiArDzE+1oIxE08fWeviIOD5TznqH+OoHadvoOP20drMPe5Irg3XBQziW2XDuHYzjqQQ4wySssjXUs5H+t3FWYMHppUnBHMx/nYIT5d7OmjDbgD9F6na3m4l7KdkeSO3kTEPXafiWinogag7b52taiZhL1TSvBFmEZafFq2H8khQaZXuitCewT5FBgVtPK0j4xUHPfUz3Q28eac1Z139DAP23dgki94EC8vbDPTQC97HPPSWjUNG5tWKMsaxAEMKC0665Xvo1Ntd07wCLNf8Q56mrEPVpCxlIMVlQlWRxM3oAfpgIc+8KC3rEXUog5g06vt7zgXY8grH7hhwVSaeuvC06YYRAwpbyk/Unzj9hLEZNs2oxPQB9yc+GnL6zTgq7rI++KDJwX2SP8Sd6YzTuw5lV/kU6eQxRD12omfQAW6caTR4LikYkBB1CMOrvgRr/VY75+NSB40Cni6bADAtaK+vyxVWpf9NeKJxN2KYQ8Q2xPB3K1s7fuhvWbr2XpgW044VD6DRs0qXoqKf1NFsaGvKJc47leUV3pppP/5VTKFhaGuol4Esfjf5zyCyUHmHthChcYh4hYLQF+AFWsuq4t0wJyWgdwQVOZiV0efRHPoK5+E1vjz9wTJmVkITC9oEstAsyZSgE/dbicwKr89YUxKZI+owD205Tm5lnnmDRuP/JnzxX3gMtlrcX0UesZdxyQqYQuEW4R51vmQ5xOZteUd8SJruMlTUzhtVw/Nq7eUBcqN2/HVotgfngif60yKEtoUx3WYOZlVJuJOh8u59fzSDPFYtQgqDUAGyGhQOAvKroXMcOYY0qjnStJR/G3aP+Jt1sLVlGV8POwr/6OGsqetnyF3TmTqZjENfnXh51oxe9qVUw2M78EzAJ+IM8lZ1MBPQ9ZWSVc4J3mWSrLKrMHReA5qdGoz0ODRsaA+vwxXA2cAM4qlfzBJA6581m4hzxItQw5dxrrBL3Y6kCbUcFxo1S8jyV44q//+7ASNNudZ6xeaNOSIUffqMn4A9lIjFctYn2gpEPAb3f7p3iIBN8H14FUGQ9ct2hPsL+cEsTgUrR47uJVN4n4wt/wgfwwHuOnLd4yobkofy8JvxSQTA7rMpDIc608SlZFJfZYcmbT0tAHpPE8MrtQ42siTUNWxqvWZOmvu9f0JPoQmg+6l7sZWwyfi6PXkxJnwBraUG0MYG4zYHQz3igy/XsFkx5tNQxw43qvI9dU3f0DdhOUlHKjmi1VAr2Kiy0HZwD8VeEbhh0OiDdMYspolQsYdSwjCcjeowIXNZVUPmL2wwIkYhmXKhGozdCJ4lRKbsf4NBh/XnQoS92NJEWOVOFs2YhN8c5QZFeK0pRdAG40hqvLbmoSA8xQmzOOEc7wLcme9JOsjPCEgpCwUs9E2DohMHRhUeyGIN6TFvrbny8nDuilsDpzrH5mS76APoIEJmItS67sQJ+nfwddzmjPxcBEBBCw0kWDwd0EZCkNeOD7NNQhtBm7KHL9mRxj6U1yWU2puzlIDtpYxdH4ZPeXBJkTGAJfUr/oTCz/iypY6uXaR2V1doPxJYlrw2ghH0D5gbrhFcIxzYwi4a/4hqVdf2DdxBp6vGYDjavxMAAoy+1+3aiO6S3W/QAKNVXagDtvsNtx7Ks+HKgo6U21B+QSZgIogV5Bt+BnXisdVfy9VyXV+2P5fMuvdpAjM1o/K9Z+XnE4EOCrue+kcdYHqAQ0/Y/OmNlQ6OI33jH/uD1RalPaHpJAm2av0/xtpqdXVKNDrc9F2izo23Wu7firgbURFDNX9eGGeYBhiypyXZft2j3hTvzE6PMWKsod//rEILDkzBXfi7xh0eFkfb3/1zzPK/PI5Nk3FbZyTl4mq5BfBoVoqiPHO4Q4QKZAlrQ3MdNfi3oxIjvsM3kAFv3fdufurqYR3PSwX/mpGy/GFI/B2MNPiNdOppWVbs/gjF3YH+QA9jMhlAbhvasAHstB0IJew09iAkmXHl1/TEj+jvHOpOGrPRQXbPADM+Ig2/OEcUcpgPTItMtW4DdqgfYVI/+4hAFWYjUGpOP/UwNuB7+BbKOcALbjobdgzeBQfjgNSp2GOpxzGLj70Vvq5cw2AoYENwKLUtJUX8sGRox4dVa/TN4xKwaKcl9XawQR/uNus700Hf17pyNnezrUgaY9e4MADhEDBpsJT6y1gDJs1q6wlwGhuUzGR7C8kgpjPyHWwsvrf3yn1zJEIRa5eSxoLAZOCR9xbuztxFRJW9ZmMYfCFJ0evm9F2fVnuje92Rc4Pl6A8bluN8MZyyJGZ0+sNSb//DvAFxC2BqlEsFwccWeAl6CyBcQV1bx4mQMBP1Jxqk1EUADNLeieS2dUFbQ/c/kvwItbZ7tx0st16viqd53WsRmPTKv2AD8CUnhtPWg5aUegNpsYgasaw2+EVooeNKmrW3MFtj76bYHJm5K9gpAXZXsE5U8DM8XmVOSJ1F1WnLy6nQup+jx52bAb+rCq6y9WXl2B2oZDhfDkW7H3oYfT/4xx5VncBuxMXP2lNfhUVQjSSzSRbuZFE4vFawlzveXxaYKVs8LpvAb8IRYF3ZHiRnm0ADeNPWocwxSzNseG7NrSEVZoHdKWqaGEBz1N8Pt7kFbqh3LYmAbm9i1IChIpLpM5AS6mr6OAPHMwwznVy61YpBYX8xZDN/a+lt7n+x5j4bNOVteZ8lj3hpAHSx1VR8vZHec4AHO9XFCdjZ9eRkSV65ljMmZVzaej2qFn/qt1lvWzNZEfHxK3qOJrHL6crr0CRzMox5f2e8ALBB4UGFZKA3tN6F6IXd32GTJXGQ7DTi9j/dNcLF9jCbDcWGKxoKTYblIwbLDReL00LRcDPMcQuXLMh5YzgtfjkFK1DP1iDzzYYVZz5M/kWYRlRpig1htVRjVCknm+h1M5LiEDXOyHREhvzCGpFZjHS0RsK27o2avgdilrJkalWqPW3D9gmwV37HKmfM3F8YZj2ar+vHFvf3B8CRoH4kDHIK9mrAg+owiEwNjjd9V+FsQKYR8czJrUkf7Qoi2YaW6EVDZp5zYlqiYtuXOTHk4fAcZ7qBbdLDiJq0WNV1l2+Hntk1mMWvxrYmc8kIx8G3rW36J6Ra4lLrTOCgiOihmow+YnzUT19jbV2B3RWqSHyxkhmgsBqMYWvOcUom1jDQ436+fcbu3xf2bbeqU/ca+C4DOKE+e3qvmeMqW3AxejfzBRFVcwVYPq4L0APSWWoJu+5UYX4qg5U6YTioqQGPG9XrnuZ/BkxuYpe6Li87+18EskyQW/uA+uk2rpHpr6hut2TlVbKgWkFpx+AZffweiw2+VittkEyf/ifinS/0ItRL2Jq3tQOcxPaWO2xrG68GdFoUpZgFXaP2wYVtRc6xYCfI1CaBqyWpg4bx8OHBQwsV4XWMibZZ0LYjWEy2IxQ1mZrf1/UNbYCJplWu3nZ4WpodIGVA05d+RWSS+ET9tH3RfGGmNI1cIY7evZZq7o+a0bjjygpmR3mVfalkT/SZGT27Q8QGalwGlDOS9VHCyFAIL0a1Q7JiW3saz9gqY8lqKynFrPCzxkU4SIfLc9VfCI5edgRhDXs0edO992nhTKHriREP1NJC6SROMgQ0xO5kNNZOhMOIT99AUElbxqeZF8A3xrfDJsWtDnUenAHdYWSwAbYjFqQZ+D5gi3hNK8CSxU9i6f6ClL9IGlj1OPMQAsr84YG6ijsJpCaGWj75c3yOZKBB9mNpQNPUKkK0D6wgLH8MGoyRxTX6Y05Q4AnYNXMZwXM4eij/9WpsM/9CoRnFQXGR6MEaY+FXvXEO3RO0JaStk6OXuHVATHJE+1W+TU3bSZ2ksMtqjO0zfSJCdBv7y2d8DMx6TfVme3q0ZpTKMMu4YL/t7ciTNtdDkwPogh3Cnjx7qk08SHwf+dksZ7M2vCOlfsF0hQ6J4ehPCaHTNrM/zBSOqD83dBEBCW/F/LEmeh0nOHd7oVl3/Qo/9GUDkkbj7yz+9cvvu+dDAtx8NzCDTP4iKdZvk9MWiizvtILLepysflSvTLFBZ37RLwiriqyRxYv/zrgFd/9XVHh/OmzBvDX4mitMR/lUavs2Vx6cR94lzAkplm3IRNy4TFfu47tuYs9EQPIPVta4P64tV+sZ7n3ued3cgEx2YK+QL5+xms6osk8qQbTyuKVGdaX9FQqk6qfDnT5ykxk0VK7KZ62b6DNDUfQlqGHxSMKv1P0XN5BqMeKG1P4Wp5QfZDUCEldppoX0U6ss2jIko2XpURKCIhfaOqLPfShdtS37ZrT+jFRSH2xYVV1rmT/MBtRQhxiO4MQ3iAGlaZi+9PWBEIXOVnu9jN1f921lWLZky9bqbM3J2MAAI9jmuAx3gyoEUa6P2ivs0EeNv/OR+AX6q5SW6l5HaoFuS6jr6yg9limu+P0KYKzfMXWcQSfTXzpOzKEKpwI3YGXZpSSy2LTlMgfmFA3CF6R5c9xWEtRuCg2ZPUQ2Nb6dRFTNd4TfGHrnEWSKHPuRyiJSDAZ+KX0VxmSHjGPbQTLVpqixia2uyhQ394gBMt7C3ZAmxn/DJS+l1fBsAo2Eir/C0jG9csd4+/tp12pPc/BVJGaK9mfvr7M/CeztrmCO5qY06Edi4xAGtiEhnWAbzLy2VEyazE1J5nPmgU4RpW4Sa0TnOT6w5lgt3/tMpROigHHmexBGAMY0mdcDbDxWIz41NgdD6oxgHsJRgr5RnT6wZAkTOcStU4NMOQNemSO7gxGahdEsC+NRVGxMUhQmmM0llWRbbmFGHzEqLM4Iw0H7577Kyo+Zf+2cUFIOw93gEY171vQaM0HLwpjpdRR6Jz7V0ckE7XzYJ0TmY9znLdzkva0vNrAGGT5SUZ5uaHDkcGvI0ySpwkasEgZPMseYcu85w8HPdSNi+4T6A83iAwDbxgeFcB1ZM2iGXzFcEOUlYVrEckaOyodfvaYSQ7GuB4ISE0nYJc15X/1ciDTPbPCgYJK55VkEor4LvzL9S2WDy4xj+6FOqVyTAC2ZNowheeeSI5hA/02l8UYkv4nk9iaVn+kCVEUstgk5Hyq+gJm6R9vG3rhuM904he/hFmNQaUIATB1y3vw+OmxP4X5Yi6A5I5jJufHCjF9+AGNwnEllZjUco6XhsO5T5+R3yxz5yLVOnAn0zuS+6zdj0nTJbEZCbXJdtpfYZfCeCOqJHoE2vPPFS6eRLjIJlG69X93nfR0mxSFXzp1Zc0lt/VafDaImhUMtbnqWVb9M4nGNQLN68BHP7AR8Il9dkcxzmBv8PCZlw9guY0lurbBsmNYlwJZsA/B15/HfkbjbwPddaVecls/elmDHNW2r4crAx43feNkfRwsaNq/yyJ0d/p5hZ6AZajz7DBfUok0ZU62gCzz7x8eVfJTKA8IWn45vINLSM1q+HF9CV9qF3zP6Ml21kPPL3CXzkuYUlnSqT+Ij4tI/od5KwIs+tDajDs64owN7tOAd6eucGz+KfO26iNcBFpbWA5732bBNWO4kHNpr9D955L61bvHCF/mwSrz6eQaDjfDEANqGMkFc+NGxpKZzCD2sj/JrHd+zlPQ8Iz7Q+2JVIiVCuCKoK/hlAEHzvk/Piq3mRL1rT/fEh9hoT5GJmeYswg1otiKydizJ/fS2SeKHVu6Z3JEHjiW8NaTQgP5xdBli8nC57XiN9hrquBu99hn9zqwo92+PM2JXtpeVZS0PdqR5mDyDreMMtEws+CpwaRyyzoYtfcvt9PJIW0fJVNNi/FFyRsea7peLvJrL+5b4GOXJ8tAr+ATk9f8KmiIsRhqRy0vFzwRV3Z5dZ3QqIU8JQ/uQpkJbjMUMFj2F9sCFeaBjI4+fL/oN3+LQgjI4zuAfQ+3IPIPFQBccf0clJpsfpnBxD84atwtupkGqKvrH7cGNl/QcWcSi6wcVDML6ljOgYbo+2BOAWNNjlUBPiyitUAwbnhFvLbnqw42kR3Yp2kv2dMeDdcGOX5kT4S6M44KHEB/SpCfl7xgsUvs+JNY9G3O2X/6FEt9FyAn57lrbiu+tl83sCymSvq9eZbe9mchL7MTf/Ta78e80zSf0hYY5eUU7+ff14jv7Xy8qjzfzzzvaJnrIdvFb5BLWKcWGy5/w7+vV2cvIfwHqdTB+RuJK5oj9mbt0Hy94AmjMjjwYNZlNS6uiyxNnwNyt3gdreLb64p/3+08nXkb92LTkkRgFOwk1oGEVllcOj5lv1hfAZywDows0944U8vUFw+A/nuVq/UCygsrmWIBnHyU01d0XJPwriEOvx/ISK6Pk4y2w0gmojZs7lU8TtakBAdne4v/aNxmMpK4VcGMp7si0yqsiolXRuOi1Z1P7SqD3Zmp0CWcyK4Ubmp2SXiXuI5nGLCieFHKHNRIlcY3Pys2dwMTYCaqlyWSITwr2oGXvyU3h1Pf8eQ3w1bnD7ilocVjYDkcXR3Oo1BXgMLTUjNw2xMVwjtp99NhSVc5aIWrDQT5DHPKtCtheBP4zHcw4dz2eRdTMamhlHhtfgqJJHI7NGDUw1XL8vsSeSHyKqDtqoAmrQqsYwvwi7HW3ojWyhIa5oz5xJTaq14NAzFLjVLR12rRNUQ6xohDnrWFb5bG9yf8aCD8d5phoackcNJp+Dw3Due3RM+5Rid7EuIgsnwgpX0rUWh/nqPtByMhMZZ69NpgvRTKZ62ViZ+Q7Dp5r4K0d7EfJuiy06KuIYauRh5Ecrhdt2QpTS1k1AscEHvapNbU3HL1F2TFyR33Wxb5MvH5iZsrn3SDcsxlnnshO8PLwmdGN+paWnQuORtZGX37uhFT64SeuPsx8UOokY6ON85WdQ1dki5zErsJGazcBOddWJEKqNPiJpsMD1GrVLrVY+AOdPWQneTyyP1hRX/lMM4ZogGGOhYuAdr7F/DOiAoc++cn5vlf0zkMUJ40Z1rlgv9BelPqVOpxKeOpzKdF8maK+1Vv23MO9k/8+qpLoxrIGH2EDQlnGmH8CD31G8QqlyQIcpmR5bwmSVw9/Ns6IHgulCRehvZ/+VrM60Cu/r3AontFfrljew74skYe2uyn7JKQtFQBQRJ9ryGic/zQOsbS4scUBctA8cPToQ3x6ZBQu6DPu5m1bnCtP8TllLYA0UTQNVqza5nfew3Mopy1GPUwG5jsl0OVXniPmAcmLqO5HG8Hv3nSLecE9oOjPDXcsTxoCBxYyzBdj4wmnyEV4kvFDunipS8SSkvdaMnTBN9brHUR8xdmmEAp/Pdqk9uextp1t+JrtXwpN/MG2w/qhRMpSNxQ1uhg/kKO30eQ/FyHUDkWHT8V6gGRU4DhDMxZu7xXij9Ui6jlpWmQCqJg3FkOTq3WKneCRYZxBXMNAVLQgHXSCGSqNdjebY94oyIpVjMYehAiFx/tqzBXFHZaL5PeeD74rW5OysFoUXY8sebUZleFTUa/+zBKVTFDopTReXNuZq47QjkWnxjirCommO4L/GrFtVV21EpMyw8wyThL5Y59d88xtlx1g1ttSICDwnof6lt/6zliPzgVUL8jWBjC0o2D6Kg+jNuThkAlaDJsq/AG2aKA//A76avw2KNqtv223P+Wq3StRDDNKFFgtsFukYt1GFDWooFVXitaNhb3RCyJi4cMeNjROiPEDb4k+G3+hD8tsg+5hhmSc/8t2JTSwYoCzAI75doq8QTHe+E/Tw0RQSUDlU+6uBeNN3h6jJGX/mH8oj0i3caCNsjvTnoh73BtyZpsflHLq6AfwJNCDX4S98h4+pCOhGKDhV3rtkKHMa3EG4J9y8zFWI4UsfNzC/Rl5midNn7gwoN9j23HGCQQ+OAZpTTPMdiVow740gIyuEtd0qVxMyNXhHcnuXRKdw5wDUSL358ktjMXmAkvIB73BLa1vfF9BAUZInPYJiwxqFWQQBVk7gQH4ojfUQ/KEjn+A/WR6EEe4CtbpoLe1mzHkajgTIoE0SLDHVauKhrq12zrAXBGbPPWKCt4DGedq3JyGRbmPFW32bE7T20+73BatV/qQhhBWfWBFHfhYWXjALts38FemnoT+9bn1jDBMcUMmYgSc0e7GQjv2MUBwLU8ionCpgV+Qrhg7iUIfUY6JFxR0Y+ZTCPM+rVuq0GNLyJXX6nrUTt8HzFBRY1E/FIm2EeVA9NcXrj7S6YYIChVQCWr/m2fYUjC4j0XLkzZ8GCSLfmkW3PB/xq+nlXsKVBOj7vTvqKCOMq7Ztqr3cQ+N8gBnPaAps+oGwWOkbuxnRYj/x/WjiDclVrs22xMK4qArE1Ztk1456kiJriw6abkNeRHogaPRBgbgF9Z8i/tbzWELN4CvbqtrqV9TtGSnmPS2F9kqOIBaazHYaJ9bi3AoDBvlZasMluxt0BDXfhp02Jn411aVt6S4TUB8ZgFDkI6TP6gwPY85w+oUQSsjIeXVminrwIdK2ZAawb8Se6XOJbOaliQxHSrnAeONDLuCnFejIbp4YDtBcQCwMsYiRZfHefuEJqJcwKTTJ8sx5hjHmJI1sPFHOr6W9AhZ2NAod38mnLQk1gOz2LCAohoQbgMbUK9RMEA3LkiF7Sr9tLZp6lkciIGhE2V546w3Mam53VtVkGbB9w0Yk2XiRnCmbpxmHr2k4eSC0RuNbjNsUfDIfc8DZvRvgUDe1IlKdZTzcT4ZGEb53dp8VtsoZlyXzLHOdAbsp1LPTVaHvLA0GYDFMbAW/WUBfUAdHwqLFAV+3uHvYWrCfhUOR2i89qvCBoOb48usAGdcF2M4aKn79k/43WzBZ+xR1L0uZfia70XP9soQReeuhZiUnXFDG1T8/OXNmssTSnYO+3kVLAgeiY719uDwL9FQycgLPessNihMZbAKG7qwPZyG11G1+ZA3jAX2yddpYfmaKBlmfcK/V0mwIRUDC0nJSOPUl2KB8h13F4dlVZiRhdGY5farwN+f9hEb1cRi41ZcGDn6Xe9MMSTOY81ULJyXIHSWFIQHstVYLiJEiUjktlHiGjntN5/btB8Fu+vp28zl2fZXN+dJDyN6EXhS+0yzqpl/LSJNEUVxmu7BsNdjAY0jVsAhkNuuY0E1G48ej25mSt+00yPbQ4SRCVkIwb6ISvYtmJRPz9Zt5dk76blf+lJwAPH5KDF+vHAmACLoCdG2Adii6dOHnNJnTmZtoOGO8Q1jy1veMw6gbLFToQmfJa7nT7Al89mRbRkZZQxJTKgK5Kc9INzmTJFp0tpAPzNmyL/F08bX3nhCumM/cR/2RPn9emZ3VljokttZD1zVWXlUIqEU7SLk5I0lFRU0AcENXBYazNaVzsVHA/sD3o9hm42wbHIRb/BBQTKzAi8s3+bMtpOOZgLdQzCYPfX3UUxKd1WYVkGH7lh/RBBgMZZwXzU9+GYxdBqlGs0LP+DZ5g2BWNh6FAcR944B+K/JTWI3t9YyVyRhlP4CCoUk/mmF7+r2pilVBjxXBHFaBfBtr9hbVn2zDuI0kEOG3kBx8CGdPOjX1ph1POOZJUO1JEGG0jzUy2tK4X0CgVNYhmkqqQysRNtKuPdCJqK3WW57kaV17vXgiyPrl4KEEWgiGF1euI4QkSFHFf0TDroQiLNKJiLbdhH0YBhriRNCHPxSqJmNNoketaioohqMglh6wLtEGWSM1EZbQg72h0UJAIPVFCAJOThpQGGdKfFovcwEeiBuZHN2Ob4uVM7+gwZLz1D9E7ta4RmMZ24OBBAg7Eh6dLXGofZ4U2TFOCQMKjwhVckjrydRS+YaqCw1kYt6UexuzbNEDyYLTZnrY1PzsHZJT4U+awO2xlqTSYu6n/U29O2wPXgGOEKDMSq+zTUtyc8+6iLp0ivav4FKx+xxVy4FxhIF/pucVDqpsVe2jFOfdZhTzLz2QjtzvsTCvDPU7bzDH2eXVKUV9TZ+qFtaSSxnYgYdXKwVreIgvWhT9eGDB2OvnWyPLfIIIfNnfIxU8nW7MbcH05nhlsYtaW9EZRsxWcKdEqInq1DiZPKCz7iGmAU9/ccnnQud2pNgIGFYOTAWjhIrd63aPDgfj8/sdlD4l+UTlcxTI9jbaMqqN0gQxSHs60IAcW3cH4p3V1aSciTKB29L1tz2eUQhRiTgTvmqc+sGtBNh4ky0mQJGsdycBREP+fAaSs1EREDVo5gvgi5+aCN7NECw30owbCc1mSpjiahyNVwJd1jiGgzSwfTpzf2c5XJvG/g1n0fH88KHNnf+u7ZiRMlXueSIsloJBUtW9ezvsx9grfsX/FNxnbxU1Lvg0hLxixypHKGFAaPu0xCD8oDTeFSyfRT6s8109GMUZL8m2xXp8X2dpPCWWdX84iga4BrTlOfqox4shqEgh/Ht4qRst52cA1xOIUuOxgfUivp6v5f8IVyaryEdpVk72ERAwdT4aoY1usBgmP+0m06Q216H/nubtNYxHaOIYjcach3A8Ez/zc0KcShhel0HCYjFsA0FjYqyJ5ZUH1aZw3+zWC0hLpM6GDfcAdn9fq2orPmZbW6XXrf+Krc9RtvII5jeD3dFoT1KwZJwxfUMvc5KLfn8rROW23Jw89sJ2a5dpB3qWDUBWF2iX8OCuKprHosJ2mflBR+Wqs86VvgI/XMnsqb97+VlKdPVysczPj8Jhzf+WCvGBHijAqYlavbF60soMWlHbvKT+ScvhprgeTln51xX0sF+Eadc/l2s2a5BgkVbHYyz0E85p0LstqH+gEGiR84nBRRFIn8hLSZrGwqjZ3E29cuGi+5Z5bp7EM8MWFa9ssS/vy4VrDfECSv7DSU84DaP0sXI3Ap4lWznQ65nQoTKRWU30gd7Nn8ZowUvGIx4aqyXGwmA/PB4qN8msJUODezUHEl0VP9uo+cZ8vPFodSIB4C7lQYjEFj8yu49C2KIV3qxMFYTevG8KqAr0TPlkbzHHnTpDpvpzziAiNFh8xiT7C/TiyH0EguUw4vxAgpnE27WIypV+uFN2zW7xniF/n75trs9IJ5amB1zXXZ1LFkJ6GbS/dFokzl4cc2mamVwhL4XU0Av5gDWAl+aEWhAP7t2VIwU+EpvfOPDcLASX7H7lZpXA2XQfbSlD4qU18NffNPoAKMNSccBfO9YVVgmlW4RydBqfHAV7+hrZ84WJGho6bNT0YMhxxLdOx/dwGj0oyak9aAkNJ8lRJzUuA8sR+fPyiyTgUHio5+Pp+YaKlHrhR41jY5NESPS3x+zTMe0S2HnLOKCOQPpdxKyviBvdHrCDRqO+l96HhhNBLXWv4yEMuEUYo8kXnYJM8oIgVM4XJ+xXOev4YbWeqsvgq0lmw4/PiYr9sYLt+W5EAuYSFnJEan8CwJwbtASBfLBBpJZiRPor/aCJBZsM+MhvS7ZepyHvU8m5WSmaZnxuLts8ojl6KkS8oSAHkq5GWlCB/NgJ5W3rO2Cj1MK7ahxsCrbTT3a0V/QQH+sErxV4XUWDHx0kkFy25bPmBMBQ6BU3HoHhhYcJB9JhP6NXUWKxnE0raXHB6U9KHpWdQCQI72qevp5fMzcm+AvC85rsynVQhruDA9fp9COe7N56cg1UKGSas89vrN+WlGLYTwi5W+0xYdKEGtGCeNJwXKDU0XqU5uQYnWsMwTENLGtbQMvoGjIFIEMzCRal4rnBAg7D/CSn8MsCvS+FDJJAzoiioJEhZJgAp9n2+1Yznr7H+6eT4YkJ9Mpj60ImcW4i4iHDLn9RydB8dx3QYm3rsX6n4VRrZDsYK6DCGwkwd5n3/INFEpk16fYpP6JtMQpqEMzcOfQGAHXBTEGzuLJ03GYQL9bmV2/7ExDlRf+Uvf1sM2frRtCWmal12pMgtonvSCtR4n1CLUZRdTHDHP1Otwqd+rcdlavnKjUB/OYXQHUJzpNyFoKpQK+2OgrEKpGyIgIBgn2y9QHnTJihZOpEvOKIoHAMGAXHmj21Lym39Mbiow4IF+77xNuewziNVBxr6KD5e+9HzZSBIlUa/AmsDFJFXeyrQakR3FwowTGcADJHcEfhGkXYNGSYo4dh4bxwLM+28xjiqkdn0/3R4UEkvcBrBfn/SzBc1XhKM2VPlJgKSorjDac96V2UnQYXl1/yZPT4DVelgO+soMjexXwYO58VLl5xInQUZI8jc3H2CPnCNb9X05nOxIy4MlecasTqGK6s2az4RjpF2cQP2G28R+7wDPsZDZC/kWtjdoHC7SpdPmqQrUAhMwKVuxCmYTiD9q/O7GHtZvPSN0CAUQN/rymXZNniYLlJDE70bsk6Xxsh4kDOdxe7A2wo7P9F5YvqqRDI6brf79yPCSp4I0jVoO4YnLYtX5nzspR5WB4AKOYtR1ujXbOQpPyYDvfRE3FN5zw0i7reehdi7yV0YDRKRllGCGRk5Yz+Uv1fYl2ZwrnGsqsjgAVo0xEUba8ohjaNMJNwTwZA/wBDWFSCpg1eUH8MYL2zdioxRTqgGQrDZxQyNzyBJPXZF0+oxITJAbj7oNC5JwgDMUJaM5GqlGCWc//KCIrI+aclEe4IA0uzv7cuj6GCdaJONpi13O544vbtIHBF+A+JeDFUQNy61Gki3rtyQ4aUywn6ru314/dkGiP8Iwjo0J/2Txs49ZkwEl4mx+iYUUO55I6pJzU4P+7RRs+DXZkyKUYZqVWrPF4I94m4Wx1tXeE74o9GuX977yvJ/jkdak8+AmoHVjI15V+WwBdARFV2IPirJgVMdsg1Pez2VNHqa7EHWdTkl3XTcyjG9BiueWFvQfXI8aWSkuuRmqi/HUuzqyvLJfNfs0txMqldYYflWB1BS31WkuPJGGwXUCpjiQSktkuBMWwHjSkQxeehqw1Kgz0Trzm7QbtgxiEPDVmWCNCAeCfROTphd1ZNOhzLy6XfJyG6Xgd5MCAZw4xie0Sj5AnY1/akDgNS9YFl3Y06vd6FAsg2gVQJtzG7LVq1OH2frbXNHWH/NY89NNZ4QUSJqL2yEcGADbT38X0bGdukqYlSoliKOcsSTuqhcaemUeYLLoI8+MZor2RxXTRThF1LrHfqf/5LcLAjdl4EERgUysYS2geE+yFdasU91UgUDsc2cSQ1ZoT9+uLOwdgAmifwQqF028INc2IQEDfTmUw3eZxvz7Ud1z3xc1PQfeCvfKsB9jOhRj7rFyb9XcDWLcYj0bByosychMezMLVkFiYcdBBQtvI6K0KRuOZQH2kBsYHJaXTkup8F0eIhO1/GcIwWKpr2mouB7g5TUDJNvORXPXa/mU8bh27TAZYBe2sKx4NSv5OjnHIWD2RuysCzBlUfeNXhDd2jxnHoUlheJ3jBApzURy0fwm2FwwsSU0caQGl0Kv8hopRQE211NnvtLRsmCNrhhpEDoNiZEzD2QdJWKbRRWnaFedXHAELSN0t0bfsCsMf0ktfBoXBoNA+nZN9+pSlmuzspFevmsqqcMllzzvkyXrzoA+Ryo1ePXpdGOoJvhyru+EBRsmOp7MXZ0vNUMUqHLUoKglg1p73sWeZmPc+KAw0pE2zIsFFE5H4192KwDvDxdxEYoDBDNZjbg2bmADTeUKK57IPD4fTYF4c6EnXx/teYMORBDtIhPJneiZny7Nv/zG+YmekIKCoxr6kauE2bZtBLufetNG0BtBY7f+/ImUypMBvdWu/Q7vTMRzw5aQGZWuc1V0HEsItFYMIBnoKGZ0xcarba/TYZq50kCaflFysYjA4EDKHqGdpYWdKYmm+a7TADmW35yfnOYpZYrkpVEtiqF0EujI00aeplNs2k+qyFZNeE3CDPL9P6b4PQ/kataHkVpLSEVGK7EX6rAa7IVNrvZtFvOA6okKvBgMtFDAGZOx88MeBcJ8AR3AgUUeIznAN6tjCUipGDZONm1FjWJp4A3QIzSaIOmZ7DvF/ysYYbM/fFDOV0jntAjRdapxJxL0eThpEhKOjCDDq2ks+3GrwxqIFKLe1WdOzII8XIOPGnwy6LKXVfpSDOTEfaRsGujhpS4hBIsMOqHbl16PJxc4EkaVu9wpEYlF/84NSv5Zum4drMfp9yXbzzAOJqqS4YkI4cBrFrC7bMPiCfgI3nNZAqkk3QOZqR+yyqx+nDQKBBBZ7QKrfGMCL+XpqFaBJU0wpkBdAhbR4hJsmT5aynlvkouoxm/NjD5oe6BzVIO9uktM+/5dEC5P7vZvarmuO/lKXz4sBabVPIATuKTrwbJP8XUkdM6uEctHKXICUJGjaZIWRbZp8czquQYfY6ynBUCfIU+gG6wqSIBmYIm9pZpXdaL121V7q0VjDjmQnXvMe7ysoEZnZL15B0SpxS1jjd83uNIOKZwu5MPzg2NhOx3xMOPYwEn2CUzbSrwAs5OAtrz3GAaUkJOU74XwjaYUmGJdZBS1NJVkGYrToINLKDjxcuIlyfVsKQSG/G4DyiO2SlQvJ0d0Ot1uOG5IFSAkq+PRVMgVMDvOIJMdqjeCFKUGRWBW9wigYvcbU7CQL/7meF2KZAaWl+4y9uhowAX7elogAvItAAxo2+SFxGRsHGEW9BnhlTuWigYxRcnVUBRQHV41LV+Fr5CJYV7sHfeywswx4XMtUx6EkBhR+q8AXXUA8uPJ73Pb49i9KG9fOljvXeyFj9ixgbo6CcbAJ7WHWqKHy/h+YjBwp6VcN7M89FGzQ04qbrQtgrOFybg3gQRTYG5xn73ArkfQWjCJROwy3J38Dx/D7jOa6BBNsitEw1wGq780EEioOeD+ZGp2J66ADiVGMayiHYucMk8nTK2zzT9CnEraAk95kQjy4k0GRElLL5YAKLQErJ5rp1eay9O4Fb6yJGm9U4FaMwPGxtKD6odIIHKoWnhKo1U8KIpFC+MVn59ZXmc7ZTBZfsg6FQ8W10YfTr4u0nYrpHZbZ1jXiLmooF0cOm0+mPnJBXQtepc7n0BqOipNCqI6yyloTeRShNKH04FIo0gcMk0H/xThyN4pPAWjDDkEp3lNNPRNVfpMI44CWRlRgViP64eK0JSRp0WUvCWYumlW/c58Vcz/yMwVcW5oYb9+26TEhwvbxiNg48hl1VI1UXTU//Eta+BMKnGUivctfL5wINDD0giQL1ipt6U7C9cd4+lgqY2lMUZ02Uv6Prs+ZEZer7ZfWBXVghlfOOrClwsoOFKzWEfz6RZu1eCs+K8fLvkts5+BX0gyrFYve0C3qHrn5U/Oh6D/CihmWIrY7HUZRhJaxde+tldu6adYJ+LeXupQw0XExC36RETdNFxcq9glMu4cNQSX9cqR/GQYp+IxUkIcNGWVU7ZtGa6P3XAyodRt0XeS3Tp01AnCh0ZbUh4VrSZeV9RWfSoWyxnY3hzcZ30G/InDq4wxRrEejreBxnhIQbkxenxkaxl+k7eLUQkUR6vKJ2iDFNGX3WmVA1yaOH+mvhBd+sE6vacQzFobwY5BqEAFmejwW5ne7HtVNolOUgJc8CsUxmc/LBi8N5mu9VsIA5HyErnS6zeCz7VLI9+n/hbT6hTokMXTVyXJRKSG2hd2labXTbtmK4fNH3IZBPreSA4FMeVouVN3zG5x9CiGpLw/3pceo4qGqp+rVp+z+7yQ98oEf+nyH4F3+J9IheDBa94Wi63zJbLBCIZm7P0asHGpIJt3PzE3m0S4YIWyXBCVXGikj8MudDPB/6Nm2v4IxJ5gU0ii0guy5SUHqGUYzTP0jIJU5E82RHUXtX4lDdrihBLdP1YaG1AGUC12rQKuIaGvCpMjZC9bWSCYnjDlvpWbkdXMTNeBHLKiuoozMGIvkczmP0aRJSJ8PYnLCVNhKHXBNckH79e8Z8Kc2wUej4sQZoH8qDRGkg86maW/ZQWGNnLcXmq3FlXM6ssR/3P6E/bHMvm6HLrv1yRixit25JsH3/IOr2UV4BWJhxXW5BJ6Xdr07n9kF3ZNAk6/Xpc5MSFmYJ2R7bdL8Kk7q1OU9Elg/tCxJ8giT27wSTySF0GOxg4PbYJdi/Nyia9Nn89CGDulfJemm1aiEr/eleGSN+5MRrVJ4K6lgyTTIW3i9cQ0dAi6FHt0YMbH3wDSAtGLSAccezzxHitt1QdhW36CQgPcA8vIIBh3/JNjf/Obmc2yzpk8edSlS4lVdwgW5vzbYEyFoF4GCBBby1keVNueHAH+evi+H7oOVfS3XuPQSNTXOONAbzJeSb5stwdQHl1ZjrGoE49I8+A9j3t+ahhQj74FCSWpZrj7wRSFJJnnwi1T9HL5qrCFW/JZq6P62XkMWTb+u4lGpKfmmwiJWx178GOG7KbrZGqyWwmuyKWPkNswkZ1q8uptUlviIi+AXh2bOOTOLsrtNkfqbQJeh24reebkINLkjut5r4d9GR/r8CBa9SU0UQhsnZp5cP+RqWCixRm7i4YRFbtZ4EAkhtNa6jHb6gPYQv7MKqkPLRmX3dFsK8XsRLVZ6IEVrCbmNDc8o5mqsogjAQfoC9Bc7R6gfw03m+lQpv6kTfhxscDIX6s0w+fBxtkhjXAXr10UouWCx3C/p/FYwJRS/AXRKkjOb5CLmK4XRe0+xeDDwVkJPZau52bzLEDHCqV0f44pPgKOkYKgTZJ33fmk3Tu8SdxJ02SHM8Fem5SMsWqRyi2F1ynfRJszcFKykdWlNqgDA/L9lKYBmc7Zu/q9ii1FPF47VJkqhirUob53zoiJtVVRVwMR34gV9iqcBaHbRu9kkvqk3yMpfRFG49pKKjIiq7h/VpRwPGTHoY4cg05X5028iHsLvUW/uz+kjPyIEhhcKUwCkJAwbR9pIEGOn8z6svAO8i89sJ3dL5qDWFYbS+HGPRMxYwJItFQN86YESeJQhn2urGiLRffQeLptDl8dAgb+Tp47UQPxWOw17OeChLN1WnzlkPL1T5O+O3Menpn4C3IY5LEepHpnPeZHbvuWfeVtPlkH4LZjPbBrkJT3NoRJzBt86CO0Xq59oQ+8dsm0ymRcmQyn8w71mhmcuEI5byuF+C88VPYly2sEzjlzAQ3vdn/1+Hzguw6qFNNbqenhZGbdiG6RwZaTG7jTA2X9RdXjDN9yj1uQpyO4Lx8KRAcZcbZMafp4wPOd5MdXoFY52V1A8M9hi3sso93+uprE0qYNMjkE22CvK4HuUxqN7oIz5pWuETq1lQAjqlSlqdD2Rnr/ggp/TVkQYjn9lMfYelk2sH5HPdopYo7MHwlV1or9Bxf+QCyLzm92vzG2wjiIjC/ZHEJzeroJl6bdFPTpZho5MV2U86fLQqxNlGIMqCGy+9WYhJ8ob1r0+Whxde9L2PdysETv97O+xVw+VNN1TZSQN5I6l9m5Ip6pLIqLm4a1B1ffH6gHyqT9p82NOjntRWGIofO3bJz5GhkvSWbsXueTAMaJDou99kGLqDlhwBZNEQ4mKPuDvVwSK4WmLluHyhA97pZiVe8g+JxmnJF8IkV/tCs4Jq/HgOoAEGR9tCDsDbDmi3OviUQpG5D8XmKcSAUaFLRXb2lmJTNYdhtYyfjBYZQmN5qT5CNuaD3BVnlkCk7bsMW3AtXkNMMTuW4HjUERSJnVQ0vsBGa1wo3Qh7115XGeTF3NTz8w0440AgU7c3bSXO/KMINaIWXd0oLpoq/0/QJxCQSJ9XnYy1W7TYLBJpHsVWD1ahsA7FjNvRd6mxCiHsm8g6Z0pnzqIpF1dHUtP2ITU5Z1hZHbu+L3BEEStBbL9XYvGfEakv1bmf+bOZGnoiuHEdlBnaChxYKNzB23b8sw8YyT7Ajxfk49eJIAvdbVkdFCe2J0gMefhQ0bIZxhx3fzMIysQNiN8PgOUKxOMur10LduigREDRMZyP4oGWrP1GFY4t6groASsZ421os48wAdnrbovNhLt7ScNULkwZ5AIZJTrbaKYTLjA1oJ3sIuN/aYocm/9uoQHEIlacF1s/TM1fLcPTL38O9fOsjMEIwoPKfvt7opuI9G2Hf/PR4aCLDQ7wNmIdEuXJ/QNL72k5q4NejAldPfe3UVVqzkys8YZ/jYOGOp6c+YzRCrCuq0M11y7TiN6qk7YXRMn/gukxrEimbMQjr3jwRM6dKVZ4RUfWQr8noPXLJq6yh5R3EH1IVOHESst/LItbG2D2vRsZRkAObzvQAAD3mb3/G4NzopI0FAiHfbpq0X72adg6SRj+8OHMShtFxxLZlf/nLgRLbClwl5WmaYSs+yEjkq48tY7Z2bE0N91mJwt+ua0NlRJIDh0HikF4UvSVorFj2YVu9YeS5tfvlVjPSoNu/Zu6dEUfBOT555hahBdN3Sa5Xuj2Rvau1lQNIaC944y0RWj9UiNDskAK1WoL+EfXcC6IbBXFRyVfX/WKXxPAwUyIAGW8ggZ08hcijKTt1YKnUO6QPvcrmDVAb0FCLIXn5id4fD/Jx4tw/gbXs7WF9b2RgXtPhLBG9vF5FEkdHAKrQHZAJC/HWvk7nvzzDzIXZlfFTJoC3JpGgLPBY7SQTjGlUvG577yNutZ1hTfs9/1nkSXK9zzKLRZ3VODeKUovJe0WCq1zVMYxCJMenmNzPIU2S8TA4E7wWmbNkxq9rI2dd6v0VpcAPVMxnDsvWTWFayyqvKZO7Z08a62i/oH2/jxf8rpmfO64in3FLiL1GX8IGtVE9M23yGsIqJbxDTy+LtaMWDaPqkymb5VrQdzOvqldeU0SUi6IirG8UZ3jcpRbwHa1C0Dww9G/SFX3gPvTJQE+kyz+g1BeMILKKO+olcHzctOWgzxYHnOD7dpCRtuZEXACjgqesZMasoPgnuDC4nUviAAxDc5pngjoAITIkvhKwg5d608pdrZcA+qn5TMT6Uo/QzBaOxBCLTJX3Mgk85rMfsnWx86oLxf7p2PX5ONqieTa/qM3tPw4ZXvlAp83NSD8F7+ZgctK1TpoYwtiU2h02HCGioH5tkVCqNVTMH5p00sRy2JU1qyDBP2CII/Dg4WDsIl+zgeX7589srx6YORRQMBfKbodbB743Tl4WLKOEnwWUVBsm94SOlCracU72MSyj068wdpYjyz1FwC2bjQnxnB6Mp/pZ+yyZXtguEaYB+kqhjQ6UUmwSFazOb+rhYjLaoiM+aN9/8KKn0zaCTFpN9eKwWy7/u4EHzO46TdFSNjMfn2iPSJwDPCFHc0I1+vjdAZw5ZjqR/uzi9Zn20oAa5JnLEk/EA3VRWE7J/XrupfFJPtCUuqHPpnlL7ISJtRpSVcB8qsZCm2QEkWoROtCKKxUh3yEcMbWYJwk6DlEBG0bZP6eg06FL3v6RPb7odGuwm7FN8fG4woqtB8e7M5klPpo97GoObNwt+ludTAmxyC5hmcFx+dIvEZKI6igFKHqLH01iY1o7903VzG9QGetyVx5RNmBYUU+zIuSva/yIcECUi4pRmE3VkF2avqulQEUY4yZ/wmNboBzPmAPey3+dSYtBZUjeWWT0pPwCz4Vozxp9xeClIU60qvEFMQCaPvPaA70WlOP9f/ey39macvpGCVa+zfa8gO44wbxpJUlC8GN/pRMTQtzY8Z8/hiNrU+Zq64ZfFGIkdj7m7abcK1EBtws1X4J/hnqvasPvvDSDYWN+QcQVGMqXalkDtTad5rYY0TIR1Eqox3czwPMjKPvF5sFv17Thujr1IZ1Ytl4VX1J0vjXKmLY4lmXipRAro0qVGEcXxEVMMEl54jQMd4J7RjgomU0j1ptjyxY+cLiSyXPfiEcIS2lWDK3ISAy6UZ3Hb5vnPncA94411jcy75ay6B6DSTzK6UTCZR9uDANtPBrvIDgjsfarMiwoax2OlLxaSoYn4iRgkpEGqEkwox5tyI8aKkLlfZ12lO11TxsqRMY89j5JaO55XfPJPDL1LGSnC88Re9Ai+Nu5bZjtwRrvFITUFHPR4ZmxGslQMecgbZO7nHk32qHxYkdvWpup07ojcMCaVrpFAyFZJJbNvBpZfdf39Hdo2kPtT7v0/f8R/B5Nz4f1t9/3zNM/7n6SUHfcWk5dfQFJvcJMgPolGCpOFb/WC0FGWU2asuQyT+rm88ZKZ78Cei/CAh939CH0JYbpZIPtxc2ufXqjS3pHH9lnWK4iJ7OjR/EESpCo2R3MYKyE7rHfhTvWho4cL1QdN4jFTyR6syMwFm124TVDDRXMNveI1Dp/ntwdz8k8kxw7iFSx6+Yx6O+1LzMVrN0BBzziZi9kneZSzgollBnVwBh6oSOPHXrglrOj+QmR/AESrhDpKrWT+8/AiMDxS/5wwRNuGQPLlJ9ovomhJWn8sMLVItQ8N/7IXvtD8kdOoHaw+vBSbFImQsv/OCAIui99E+YSIOMlMvBXkAt+NAZK8wB9Jf8CPtB+TOUOR+z71d/AFXpPBT6+A5FLjxMjLIEoJzrQfquvxEIi+WoUzGR1IzQFNvbYOnxb2PyQ0kGdyXKzW2axQL8lNAXPk6NEjqrRD1oZtKLlFoofrXw0dCNWASHzy+7PSzOUJ3XtaPZsxLDjr+o41fKuKWNmjiZtfkOzItvlV2MDGSheGF0ma04qE3TUEfqJMrXFm7DpK+27DSvCUVf7rbNoljPhha5W7KBqVq0ShUSTbRmuqPtQreVWH4JET5yMhuqMoSd4r/N8sDmeQiQQvi1tcZv7Moc7dT5X5AtCD6kNEGZOzVcNYlpX4AbTsLgSYYliiPyVoniuYYySxsBy5cgb3pD+EK0Gpb0wJg031dPgaL8JZt6sIvzNPEHfVPOjXmaXj4bd4voXzpZ5GApMhILgMbCEWZ2zwgdeQgjNHLbPIt+KqxRwWPLTN6HwZ0Ouijj4UF+Sg0Au8XuIKW0WxlexdrFrDcZJ8Shauat3X0XmHygqgL1nAu2hrJFb4wZXkcS+i36KMyU1yFvYv23bQUJi/3yQpqr/naUOoiEWOxckyq/gq43dFou1DVDaYMZK9tho7+IXXokBCs5GRfOcBK7g3A+jXQ39K4YA8PBRW4m5+yR0ZAxWJncjRVbITvIAPHYRt1EJ3YLiUbqIvoKHtzHKtUy1ddRUQ0AUO41vonZDUOW+mrszw+SW/6Q/IUgNpcXFjkM7F4CSSQ2ExZg85otsMs7kqsQD4OxYeBNDcSpifjMoLb7GEbGWTwasVObmB/bfPcUlq0wYhXCYEDWRW02TP5bBrYsKTGWjnWDDJ1F7zWai0zW/2XsCuvBQjPFcTYaQX3tSXRSm8hsAoDdjArK/OFp6vcWYOE7lizP0Yc+8p16i7/NiXIiiQTp7c7Xus925VEtlKAjUdFhyaiLT7VxDagprMFwix4wZ05u0qj7cDWFd0W9OYHIu3JbJKMXRJ1aYNovugg+QqRN7fNHSi26VSgBpn+JfMuPo3aeqPWik/wI5Rz3BWarPQX4i5+dM0npwVOsX+KsOhC7vDg+OJsz4Q5zlnIeflUWL6QYMbf9WDfLmosLF4Qev3mJiOuHjoor/dMeBpA9iKDkMjYBNbRo414HCxjsHrB4EXNbHzNMDHCLuNBG6Sf+J4MZ/ElVsDSLxjIiGsTPhw8BPjxbfQtskj+dyNMKOOcUYIRBEIqbazz3lmjlRQhplxq673VklMMY6597vu+d89ec/zq7Mi4gQvh87ehYbpOuZEXj5g/Q7S7BFDAAB9DzG35SC853xtWVcnZQoH54jeOqYLR9NDuwxsVthTV7V99n/B7HSbAytbEyVTz/5NhJ8gGIjG0E5j3griULUd5Rg7tQR+90hJgNQKQH2btbSfPcaTOfIexc1db1BxUOhM1vWCpLaYuKr3FdNTt/T3PWCpEUWDKEtzYrjpzlL/wri3MITKsFvtF8QVV/NhVo97aKIBgdliNc10dWdXVDpVtsNn+2UIolrgqdWA4EY8so0YvB4a+aLzMXiMAuOHQrXY0tr+CL10JbvZzgjJJuB1cRkdT7DUqTvnswVUp5kkUSFVtIIFYK05+tQxT6992HHNWVhWxUsD1PkceIrlXuUVRogwmfdhyrf6zzaL8+c0L7GXMZOteAhAVQVwdJh+7nrX7x4LaIIfz2F2v7Dg/uDfz2Fa+4gFm2zHAor8UqimJG3VTJtZEoFXhnDYXvxMJFc6ku2bhbCxzij2z5UNuK0jmp1mnvkVNUfR+SEmj1Lr94Lym75PO7Fs0MIr3GdsWXRXSfgLTVY0FLqba97u1In8NAcY7IC6TjWLigwKEIm43NxTdaVTv9mcKkzuzBkKd8x/xt1p/9BbP7Wyb4bpo1K1gnOpbLvKz58pWl3B55RJ/Z5mRDLPtNQg14jdOEs9+h/V5UVpwrAI8kGbX8KPVPDIMfIqKDjJD9UyDOPhjZ3vFAyecwyq4akUE9mDOtJEK1hpDyi6Ae87sWAClXGTiwPwN7PXWwjxaR79ArHRIPeYKTunVW24sPr/3HPz2IwH8oKH4OlWEmt4BLM6W5g4kMcYbLwj2usodD1088stZA7VOsUSpEVl4w7NMb1EUHMRxAxLF0CIV+0L3iZb+ekB1vSDSFjAZ3hfLJf7gFaXrOKn+mhR+rWw/eTXIcAgl4HvFuBg1LOmOAwJH3eoVEjjwheKA4icbrQCmvAtpQ0mXG0agYp5mj4Rb6mdQ+RV4QBPbxMqh9C7o8nP0Wko2ocnCHeRGhN1XVyT2b9ACsL+6ylUy+yC3QEnaKRIJK91YtaoSrcWZMMwxuM0E9J68Z+YyjA0g8p1PfHAAIROy6Sa04VXOuT6A351FOWhKfTGsFJ3RTJGWYPoLk5FVK4OaYR9hkJvezwF9vQN1126r6isMGXWTqFW+3HL3I/jurlIdDWIVvYY+s6yq7lrFSPAGRdnU7PVwY/SvWbZGpXzy3BQ2LmAJlrONUsZs4oGkly0V267xbD5KMY8woNNsmWG1VVgLCra8aQBBcI4DP2BlNwxhiCtHlaz6OWFoCW0vMR3ErrG7JyMjTSCnvRcsEHgmPnwA6iNpJ2DrFb4gLlhKJyZGaWkA97H6FFdwEcLT6DRQQL++fOkVC4cYGW1TG/3iK5dShRSuiBulmihqgjR45Vi03o2RbQbP3sxt90VxQ6vzdlGfkXmmKmjOi080JSHkLntjvsBJnv7gKscOaTOkEaRQqAnCA4HWtB4XnMtOhpRmH2FH8tTXrIjAGNWEmudQLCkcVlGTQ965Kh0H6ixXbgImQP6b42B49sO5C8pc7iRlgyvSYvcnH9FgQ3azLbQG2cUW96SDojTQStxkOJyOuDGTHAnnWkz29aEwN9FT8EJ4yhXOg+jLTrCPKeEoJ9a7lDXOjEr8AgX4BmnMQ668oW0zYPyQiVMPxKRHtpfnEEyaKhdzNVThlxxDQNdrHeZiUFb6NoY2KwvSb7BnRcpJy+/g/zAYx3fYSN5QEaVD2Y1VsNWxB0BSO12MRsRY8JLfAezRMz5lURuLUnG1ToKk6Q30FughqWN6gBNcFxP/nY/iv+iaUQOa+2Nuym46wtI/DvSfzSp1jEi4SdYBE7YhTiVV5cX9gwboVDMVgZp5YBQlHOQvaDNfcCoCJuYhf5kz5kwiIKPjzgpcRJHPbOhJajeoeRL53cuMahhV8Z7IRr6M4hW0JzT7mzaMUzQpm866zwM7Cs07fJYXuWvjAMkbe5O6V4bu71sOG6JQ4oL8zIeXHheFVavzxmlIyBkgc9IZlEDplMPr8xlcyss4pVUdwK1e7CK2kTsSdq7g5SHRAl3pYUB9Ko4fsh4qleOyJv1z3KFSTSvwEcRO/Ew8ozEDYZSqpfoVW9uhJfYrNAXR0Z3VmeoAD+rVWtwP/13sE/3ICX3HhDG3CMc476dEEC0K3umSAD4j+ZQLVdFOsWL2C1TH5+4KiSWH+lMibo+B55hR3Gq40G1n25sGcN0mEcoU2wN9FCVyQLBhYOu9aHVLWjEKx2JIUZi5ySoHUAI9b8hGzaLMxCZDMLhv8MkcpTqEwz9KFDpCpqQhVmsGQN8m24wyB82FAKNmjgfKRsXRmsSESovAwXjBIoMKSG51p6Um8b3i7GISs7kjTq/PZoioCfJzfKdJTN0Q45kQEQuh9H88M3yEs3DbtRTKALraM0YC8laiMiOOe6ADmTcCiREeAWZelBaEXRaSuj2lx0xHaRYqF65O0Lo5OCFU18A8cMDE4MLYm9w2QSr9NgQAIcRxZsNpA7UJR0e71JL+VU+ISWFk5I97lra8uGg7GlQYhGd4Gc6rxsLFRiIeGO4abP4S4ekQ1fiqDCy87GZHd52fn5aaDGuvOmIofrzpVwMvtbreZ/855OaXTRcNiNE0wzGZSxbjg26v8ko8L537v/XCCWP2MFaArJpvnkep0pA+O86MWjRAZPQRfznZiSIaTppy6m3p6HrNSsY7fDtz7Cl4V/DJAjQDoyiL2uwf1UHVd2AIrzBUSlJaTj4k6NL97a/GqhWKU9RUmjnYKpm2r+JYUcrkCuZKvcYvrg8pDoUKQywY9GDWg03DUFSirlUXBS5SWn/KAntnf0IdHGL/7mwXqDG+LZYjbEdQmqUqq4y54TNmWUP7IgcAw5816YBzwiNIJiE9M4lPCzeI/FGBeYy3p6IAmH4AjXXmvQ4Iy0Y82NTobcAggT2Cdqz6Mx4TdGoq9fn2etrWKUNFyatAHydQTVUQ2S5OWVUlugcNvoUrlA8cJJz9MqOa/W3iVno4zDHfE7zhoY5f5lRTVZDhrQbR8LS4eRLz8iPMyBL6o4PiLlp89FjdokQLaSBmKHUwWp0na5fE3v9zny2YcDXG/jfI9sctulHRbdkI5a4GOPJx4oAJQzVZ/yYAado8KNZUdEFs9ZPiBsausotXMNebEgr0dyopuqfScFJ3ODNPHgclACPdccwv0YJGQdsN2lhoV4HVGBxcEUeUX/alr4nqpcc1CCR3vR7g40zteQg/JvWmFlUE4mAiTpHlYGrB7w+U2KdSwQz2QJKBe/5eiixWipmfP15AFWrK8Sh1GBBYLgzki1wTMhGQmagXqJ2+FuqJ8f0XzXCVJFHQdMAw8xco11HhM347alrAu+wmX3pDFABOvkC+WPX0Uhg1Z5MVHKNROxaR84YV3s12UcM+70cJ460SzEaKLyh472vOMD3XnaK7zxZcXlWqenEvcjmgGNR2OKbI1s8U+iwiW+HotHalp3e1MGDy6BMVIvajnAzkFHbeVsgjmJUkrP9OAwnEHYXVBqYx3q7LvXjoVR0mY8h+ZaOnh053pdsGkmbqhyryN01eVHySr+CkDYkSMeZ1xjPNVM+gVLTDKu2VGsMUJqWO4TwPDP0VOg2/8ITbAUaMGb4LjL7L+Pi11lEVMXTYIlAZ/QHmTENjyx3kDkBdfcvvQt6tKk6jYFM4EG5UXDTaF5+1ZjRz6W7MdJPC+wTkbDUim4p5QQH3b9kGk2Bkilyeur8Bc20wm5uJSBO95GfYDI1EZipoRaH7uVveneqz43tlTZGRQ4a7CNmMHgXyOQQOL6WQkgMUTQDT8vh21aSdz7ERiZT1jK9F+v6wgFvuEmGngSvIUR2CJkc5tx1QygfZnAruONobB1idCLB1FCfO7N1ZdRocT8/Wye+EnDiO9pzqIpnLDl4bkaRKW+ekBVwHn46Shw1X0tclt/0ROijuUB4kIInrVJU4buWf4YITJtjOJ6iKdr1u+flgQeFH70GxKjhdgt/MrwfB4K/sXczQ+9zYcrD4dhY6qZhZ010rrxggWA8JaZyg2pYij8ieYEg1aZJkZK9O1Re7sB0iouf60rK0Gd+AYlp7soqCBCDGwfKeUQhCBn0E0o0GS6PdmjLi0TtCYZeqazqwN+yNINIA8Lk3iPDnWUiIPLGNcHmZDxfeK0iAdxm/T7LnN+gemRL61hHIc0NCAZaiYJR+OHnLWSe8sLrK905B5eEJHNlWq4RmEXIaFTmo49f8w61+NwfEUyuJAwVqZCLFcyHBKAcIVj3sNzfEOXzVKIndxHw+AR93owhbCxUZf6Gs8cz6/1VdrFEPrv330+9s6BtMVPJ3zl/Uf9rUi0Z/opexfdL3ykF76e999GPfVv8fJv/Y/+/5hEMon1tqNFyVRevV9y9/uIvsG3dbB8GRRrgaEXfhx+2xeOFt+cEn3RZanNxdEe2+B6MHpNbrRE53PlDifPvFcp4kO78ILR0T4xyW/WGPyBsqGdoA7zJJCu1TKbGfhnqgnRbxbB2B3UZoeQ2bz2sTVnUwokTcTU21RxN1PYPS3Sar7T0eRIsyCNowr9amwoMU/od9s2APtiKNL6ENOlyKADstAEWKA+sdKDhrJ6BOhRJmZ+QJbAaZ3/5Fq0/lumCgEzGEbu3yi0Y4I4EgVAjqxh4HbuQn0GrRhOWyAfsglQJAVL1y/6yezS2k8RE2MstJLh92NOB3GCYgFXznF4d25qiP4ZCyI4RYGesut6FXK6GwPpKK8WHEkhYui0AyEmr5Ml3uBFtPFdnioI8RiCooa7Z1G1WuyIi3nSNglutc+xY8BkeW3JJXPK6jd2VIMpaSxpVtFq+R+ySK9J6WG5Qvt+C+QH1hyYUOVK7857nFmyDBYgZ/o+AnibzNVqyYCJQvyDXDTK+iXdkA71bY7TL3bvuLxLBQ8kbTvTEY9aqkQ3+MiLWbEgjLzOH+lXgco1ERgzd80rDCymlpaRQbOYnKG/ODoFl46lzT0cjM5FYVvv0qLUbD5lyJtMUaC1pFlTkNONx6lliaX9o0i/1vws5bNKn5OuENQEKmLlcP4o2ZmJjD4zzd3Fk32uQ4uRWkPSUqb4LBe3EXHdORNB2BWsws5daRnMfNVX7isPSb1hMQdAJi1/qmDMfRUlCU74pmnzjbXfL8PVG8NsW6IQM2Ne23iCPIpryJjYbVnm5hCvKpMa7HLViNiNc+xTfDIaKm3jctViD8A1M9YPJNk003VVr4Zo2MuGW8vil8SLaGpPXqG7I4DLdtl8a4Rbx1Lt4w5Huqaa1XzZBtj208EJVGcmKYEuaeN27zT9EE6a09JerXdEbpaNgNqYJdhP1NdqiPKsbDRUi86XvvNC7rME5mrSQtrzAZVndtSjCMqd8BmaeGR4l4YFULGRBeXIV9Y4yxLFdyoUNpiy2IhePSWzBofYPP0eIa2q5JP4j9G8at/AqoSsLAUuRXtvgsqX/zYwsE+of6oSDbUOo4RMJw+DOUTJq+hnqwKim9Yy/napyZNTc2rCq6V9jHtJbxGPDwlzWj/Sk3zF/BHOlT/fSjSq7FqlPI1q6J+ru8Aku008SFINXZfOfnZNOvGPMtEmn2gLPt+H4QLA+/SYe4j398auzhKIp2Pok3mPC5q1IN1HgR+mnEfc4NeeHYwd2/kpszR3cBn7ni9NbIqhtSWFW8xbUJuUPVOeeXu3j0IGZmFNiwaNZ6rH4/zQ2ODz6tFxRLsUYZu1bfd1uIvfQDt4YD/efKYv8VF8bHGDgK22w2Wqwpi43vNCOXFJZCGMqWiPbL8mil6tsmOTXAWCyMCw73e2rADZj2IK6rqksM3EXF2cbLb4vjB14wa/yXK5vwU+05MzERJ5nXsXsW21o7M+gO0js2OyKciP5uF2iXyb2DiptwQeHeqygkrNsqVCSlldxBMpwHi1vfc8RKpP/4L3Lmpq6DZcvhDDfxTCE3splacTcOtXdK2g303dIWBVe2wD/Gvja1cClFQ67gw0t1ZUttsUgQ1Veky8oOpS6ksYEc4bqseCbZy766SvL3FodmnahlWJRgVCNjPxhL/fk2wyvlKhITH/VQCipOI0dNcRa5B1M5HmOBjTLeZQJy237e2mobwmDyJNHePhdDmiknvLKaDbShL+Is1XTCJuLQd2wmdJL7+mKvs294whXQD+vtd88KKk0DXP8B1Xu9J+xo69VOuFgexgTrcvI6SyltuLix9OPuE6/iRJYoBMEXxU4shQMf4Fjqwf1PtnJ/wWSZd29rhZjRmTGgiGTAUQqRz+nCdjeMfYhsBD5Lv60KILWEvNEHfmsDs2L0A252351eUoYxAysVaCJVLdH9QFWAmqJDCODUcdoo12+gd6bW2boY0pBVHWL6LQDK5bYWh1V8vFvi0cRpfwv7cJiMX3AZNJuTddHehTIdU0YQ/sQ1dLoF2xQPcCuHKiuCWOY30DHe1OwcClLAhqAKyqlnIbH/8u9ScJpcS4kgp6HKDUdiOgRaRGSiUCRBjzI5gSksMZKqy7Sd51aeg0tgJ+x0TH9YH2Mgsap9N7ENZdEB0bey2DMTrBA1hn56SErNHf3tKtqyL9b6yXEP97/rc+jgD2N1LNUH6RM9AzP3kSipr06RkKOolR7HO768jjWiH1X92jA7dkg7gcNcjqsZCgfqWw0tPXdLg20cF6vnQypg7gLtkazrHAodyYfENPQZsdfnjMZiNu4nJO97D1/sQE+3vNFzrSDOKw+keLECYf7RJwVHeP/j79833oZ0egonYB2FlFE5qj02B/LVOMJQlsB8uNg3Leg4qtZwntsOSNidR0abbZmAK4sCzvt8Yiuz2yrNCJoH5O8XvX/vLeR/BBYTWj0sOPYM/jyxRd5+/JziKAABaPcw/34UA3aj/gLZxZgRCWN6m4m3demanNgsx0P237/Q+Ew5VYnJPkyCY0cIVHoFn2Ay/e7U4P19APbPFXEHX94N6KhEMPG7iwB3+I+O1jd5n6VSgHegxgaSawO6iQCYFgDsPSMsNOcUj4q3sF6KzGaH/0u5PQoAj/8zq6Uc9MoNrGqhYeb2jQo0WlGlXjxtanZLS24/OIN5Gx/2g684BPDQpwlqnkFcxpmP/osnOXrFuu4PqifouQH0eF5qCkvITQbJw/Zvy5mAHWC9oU+cTiYhJmSfKsCyt1cGVxisKu+NymEQIAyaCgud/V09qT3nk/9s/SWsYtha7yNpzBIMM40rCSGaJ9u6lEkl00vXBiEt7p9P5IBCiavynEOv7FgLqPdeqxRiCwuFVMolSIUBcoyfUC2e2FJSAUgYdVGFf0b0Kn2EZlK97yyxrT2MVgvtRikfdaAW8RwEEfN+B7/eK8bBdp7URpbqn1xcrC6d2UjdsKbzCjBFqkKkoZt7Mrhg6YagE7spkqj0jOrWM+UGQ0MUlG2evP1uE1p2xSv4dMK0dna6ENcNUF+xkaJ7B764NdxLCpuvhblltVRAf7vK5qPttJ/9RYFUUSGcLdibnz6mf7WkPO3MkUUhR2mAOuGv8IWw5XG1ZvoVMnjSAZe6T7WYA99GENxoHkMiKxHlCuK5Gd0INrISImHQrQmv6F4mqU/TTQ8nHMDzCRivKySQ8dqkpQgnUMnwIkaAuc6/FGq1hw3b2Sba398BhUwUZSAIO8XZvnuLdY2n6hOXws+gq9BHUKcKFA6kz6FDnpxLPICa3qGhnc97bo1FT/XJk48LrkHJ2CAtBv0RtN97N21plfpXHvZ8gMJb7Zc4cfI6MbPwsW7AilCSXMFIEUEmir8XLEklA0ztYbGpTTGqttp5hpFTTIqUyaAIqvMT9A/x+Ji5ejA4Bhxb/cl1pUdOD6epd3yilIdO6j297xInoiBPuEDW2/UfslDyhGkQs7Wy253bVnlT+SWg89zYIK/9KXFl5fe+jow2rd5FXv8zDPrmfMXiUPt9QBO/iK4QGbX5j/7Rx1c1vzsY8ONbP3lVIaPrhL4+1QrECTN3nyKavGG0gBBtHvTKhGoBHgMXHStFowN+HKrPriYu+OZ05Frn8okQrPaaxoKP1ULCS/cmKFN3gcH7HQlVjraCeQmtjg1pSQxeuqXiSKgLpxc/1OiZsU4+n4lz4hpahGyWBURLi4642n1gn9qz9bIsaCeEPJ0uJmenMWp2tJmIwLQ6VSgDYErOeBCfSj9P4G/vI7oIF+l/n5fp956QgxGvur77ynawAu3G9MdFbJbu49NZnWnnFcQHjxRuhUYvg1U/e84N4JTecciDAKb/KYIFXzloyuE1eYXf54MmhjTq7B/yBToDzzpx3tJCTo3HCmVPYfmtBRe3mPYEE/6RlTIxbf4fSOcaKFGk4gbaUWe44hVk9SZzhW80yfW5QWBHxmtUzvMhfVQli4gZTktIOZd9mjJ5hsbmzttaHQB29Am3dZkmx3g/qvYocyhZ2PXAWsNQiIaf+Q8W/MWPIK7/TjvCx5q2XRp4lVWydMc2wIQkhadDB0xsnw/kSEyGjLKjI4coVIwtubTF3E7MJ6LS6UOsJKj82XVAVPJJcepfewbzE91ivXZvOvYfsmMevwtPpfMzGmC7WJlyW2j0jh7AF1JLmwEJSKYwIvu6DHc3YnyLH9ZdIBnQ+nOVDRiP+REpqv++typYHIvoJyICGA40d8bR7HR2k7do6UQTHF4oriYeIQbxKe4Th6+/l1BjUtS9hqORh3MbgvYrStXTfSwaBOmAVQZzpYNqsAmQyjY56MUqty3c/xH6GuhNvNaG9vGbG6cPtBM8UA3e8r51D0AR9kozKuGGSMgLz3nAHxDNnc7GTwpLj7/6HeWp1iksDeTjwCLpxejuMtpMnGJgsiku1sOACwQ9ukzESiDRN77YNESxR5LphOlcASXA5uIts1LnBIcn1J7BLWs49DMALSnuz95gdOrTZr0u1SeYHinno/pE58xYoXbVO/S+FEMMs5qyWkMnp8Q3ClyTlZP52Y9nq7b8fITPuVXUk9ohG5EFHw4gAEcjFxfKb3xuAsEjx2z1wxNbSZMcgS9GKyW3R6KwJONgtA64LTyxWm8Bvudp0M1FdJPEGopM4Fvg7G/hsptkhCfHFegv4ENwxPeXmYhxwZy7js+BeM27t9ODBMynVCLJ7RWcBMteZJtvjOYHb5lOnCLYWNEMKC59BA7covu1cANa2PXL05iGdufOzkgFqqHBOrgQVUmLEc+Mkz4Rq8O6WkNr7atNkH4M8d+SD1t/tSzt3oFql+neVs+AwEI5JaBJaxARtY2Z4mKoUqxds4UpZ0sv3zIbNoo0J4fihldQTX3XNcuNcZmcrB5LTWMdzeRuAtBk3cZHYQF6gTi3PNuDJ0nmR+4LPLoHvxQIxRgJ9iNNXqf2SYJhcvCtJiVWo85TsyFOuq7EyBPJrAdhEgE0cTq16FQXhYPJFqSfiVn0IQnPOy0LbU4BeG94QjdYNB0CiQ3QaxQqD2ebSMiNjaVaw8WaM4Z5WnzcVDsr4eGweSLa2DE3BWViaxhZFIcSTjgxNCAfelg+hznVOYoe5VqTYs1g7WtfTm3e4/WduC6p+qqAM8H4ZyrJCGpewThTDPe6H7CzX/zQ8Tm+r65HeZn+MsmxUciEWPlAVaK/VBaQBWfoG/aRL/jSZIQfep/89GjasWmbaWzeEZ2R1FOjvyJT37O9B8046SRSKVEnXWlBqbkb5XCS3qFeuE9xb9+frEknxWB5h1D/hruz2iVDEAS7+qkEz5Ot5agHJc7WCdY94Ws61sURcX5nG8UELGBAHZ3i+3VulAyT0nKNNz4K2LBHBWJcTBX1wzf+//u/j/9+//v87+9/l9Lbh/L/uyNYiTsWV2LwsjaA6MxTuzFMqmxW8Jw/+IppdX8t/Clgi1rI1SN0UC/r6tX/4lUc2VV1OQReSeCsjUpKZchw4XUcjHfw6ryCV3R8s6VXm67vp4n+lcPV9gJwmbKQEsmrJi9c2vkwrm8HFbVYNTaRGq8D91t9n5+U+aD/hNtN3HjC/nC/vUoGFSCkXP+NlRcmLUqLbiUBl4LYf1U/CCvwtd3ryCH8gUmGITAxiH1O5rnGTz7y1LuFjmnFGQ1UWuM7HwfXtWl2fPFKklYwNUpF2IL/TmaRETjQiM5SJacI+3Gv5MBU8lP5Io6gWkawpyzNEVGqOdx4YlO1dCvjbWFZWbCmeiFKPSlMKtKcMFLs/KQxtgAHi7NZNCQ32bBAW2mbHflVZ8wXKi1JKVHkW20bnYnl3dKWJeWJOiX3oKPBD6Zbi0ZvSIuWktUHB8qDR8DMMh1ZfkBL9FS9x5r0hBGLJ8pUCJv3NYH+Ae8p40mZWd5m5fhobFjQeQvqTT4VKWIYfRL0tfaXKiVl75hHReuTJEcqVlug+eOIIc4bdIydtn2K0iNZPsYWQvQio2qbO3OqAlPHDDOB7DfjGEfVF51FqqNacd6QmgFKJpMfLp5DHTv4wXlONKVXF9zTJpDV4m1sYZqJPhotcsliZM8yksKkCkzpiXt+EcRQvSQqmBS9WdWkxMTJXPSw94jqI3varCjQxTazjlMH8jTS8ilaW8014/vwA/LNa+YiFoyyx3s/KswP3O8QW1jtq45yTM/DX9a8M4voTVaO2ebvw1EooDw/yg6Y1faY+WwrdVs5Yt0hQ5EwRfYXSFxray1YvSM+kYmlpLG2/9mm1MfmbKHXr44Ih8nVKb1M537ZANUkCtdsPZ80JVKVKabVHCadaLXg+IV8i5GSwpZti0h6diTaKs9sdpUKEpd7jDUpYmHtiX33SKiO3tuydkaxA7pEc9XIQEOfWJlszj5YpL5bKeQyT7aZSBOamvSHl8xsWvgo26IP/bqk+0EJUz+gkkcvlUlyPp2kdKFtt7y5aCdks9ZJJcFp5ZWeaWKgtnXMN3ORwGLBE0PtkEIek5FY2aVssUZHtsWIvnljMVJtuVIjpZup/5VL1yPOHWWHkOMc6YySWMckczD5jUj2mlLVquFaMU8leGVaqeXis+aRRL8zm4WuBk6cyWfGMxgtr8useQEx7k/PvRoZyd9nde1GUCV84gMX8Ogu/BWezYPSR27llzQnA97oo0pYyxobYUJfsj+ysTm9zJ+S4pk0TGo9VTG0KjqYhTmALfoDZVKla2b5yhv241PxFaLJs3i05K0AAIdcGxCJZmT3ZdT7CliR7q+kur7WdQjygYtOWRL9B8E4s4LI8KpAj7bE0dg7DLOaX+MGeAi0hMMSSWZEz+RudXbZCsGYS0QqiXjH9XQbd8sCB+nIVTq7/T/FDS+zWY9q7Z2fdq1tdLb6v3hKKVDAw5gjj6o9r1wHFROdHc18MJp4SJ2Ucvu+iQ9EgkekW8VCM+psM6y+/2SBy8tNN4a3L1MzP+OLsyvESo5gS7IQOnIqMmviJBVc6zbVG1n8eXiA3j46kmvvtJlewwNDrxk4SbJOtP/TV/lIVK9ueShNbbMHfwnLTLLhbZuO79ec5XvfgRwLFK+w1r5ZWW15rVFZrE+wKqNRv5KqsLNfpGgnoUU6Y71NxEmN7MyqwqAQqoIULOw/LbuUB2+uE75gJt+kq1qY4LoxV+qR/zalupea3D5+WMeaRIn0sAI6DDWDh158fqUb4YhAxhREbUN0qyyJYkBU4V2KARXDT65gW3gRsiv7xSPYEKLwzgriWcWgPr0sbZnv7m1XHNFW6xPdGNZUdxFiUYlmXNjDVWuu7LCkX/nVkrXaJhiYktBISC2xgBXQnNEP+cptWl1eG62a7CPXrnrkTQ5BQASbEqUZWMDiZUisKyHDeLFOaJILUo5f6iDt4ZO8MlqaKLto0AmTHVVbkGuyPa1R/ywZsWRoRDoRdNMMHwYTsklMVnlAd2S0282bgMI8fiJpDh69OSL6K3qbo20KfpNMurnYGQSr/stFqZ7hYsxKlLnKAKhsmB8AIpEQ4bd/NrTLTXefsE6ChRmKWjXKVgpGoPs8GAicgKVw4K0qgDgy1A6hFq1WRat3fHF+FkU+b6H4NWpOU3KXTxrIb2qSHAb+qhm8hiSROi/9ofapjxhyKxxntPpge6KL5Z4+WBMYkAcE6+0Hd3Yh2zBsK2MV3iW0Y6cvOCroXlRb2MMJtdWx+3dkFzGh2Pe3DZ9QpSqpaR/rE1ImOrHqYYyccpiLC22amJIjRWVAherTfpQLmo6/K2pna85GrDuQPlH1Tsar8isAJbXLafSwOof4gg9RkAGm/oYpBQQiPUoyDk2BCQ1k+KILq48ErFo4WSRhHLq/y7mgw3+L85PpP6xWr6cgp9sOjYjKagOrxF148uhuaWtjet953fh1IQiEzgC+d2IgBCcUZqgTAICm2bR8oCjDLBsmg+ThyhfD+zBalsKBY1Ce54Y/t9cwfbLu9SFwEgphfopNA3yNxgyDafUM3mYTovZNgPGdd4ZFFOj1vtfFW3u7N+iHEN1HkeesDMXKPyoCDCGVMo4GCCD6PBhQ3dRZIHy0Y/3MaE5zU9mTCrwwnZojtE+qNpMSkJSpmGe0EzLyFelMJqhfFQ7a50uXxZ8pCc2wxtAKWgHoeamR2O7R+bq7IbPYItO0esdRgoTaY38hZLJ5y02oIVwoPokGIzxAMDuanQ1vn2WDQ00Rh6o5QOaCRu99fwDbQcN0XAuqkFpxT/cfz3slGRVokrNU0iqiMAJFEbKScZdmSkTUznC0U+MfwFOGdLgsewRyPKwBZYSmy6U325iUhBQNxbAC3FLKDV9VSOuQpOOukJ/GAmu/tyEbX9DgEp6dv1zoU0IqzpG6gssSjIYRVPGgU1QAQYRgIT8gEV0EXr1sqeh2I6rXjtmoCYyEDCe/PkFEi/Q48FuT29p557iN+LCwk5CK/CZ2WdAdfQZh2Z9QGrzPLSNRj5igUWzl9Vi0rCqH8G1Kp4QMLkuwMCAypdviDXyOIk0AHTM8HBYKh3b0/F+DxoNj4ZdoZfCpQVdnZarqoMaHWnMLNVcyevytGsrXQEoIbubqWYNo7NRHzdc0zvT21fWVirj7g36iy6pxogfvgHp1xH1Turbz8QyyHnXeBJicpYUctbzApwzZ1HT+FPEXMAgUZetgeGMwt4G+DHiDT2Lu+PT21fjJCAfV16a/Wu1PqOkUHSTKYhWW6PhhHUlNtWzFnA7MbY+r64vkwdpfNB2JfWgWXAvkzd42K4lN9x7Wrg4kIKgXCb4mcW595MCPJ/cTfPAMQMFWwnqwde4w8HZYJFpQwcSMhjVz4B8p6ncSCN1X4klxoIH4BN2J6taBMj6lHkAOs8JJAmXq5xsQtrPIPIIp/HG6i21xMGcFgqDXSRF0xQg14d2uy6HgKE13LSvQe52oShF5Jx1R6avyL4thhXQZHfC94oZzuPUBKFYf1VvDaxIrtV6dNGSx7DO0i1p6CzBkuAmEqyWceQY7F9+U0ObYDzoa1iKao/cOD/v6Q9gHrrr1uCeOk8fST9MG23Ul0KmM3r+Wn6Hi6WAcL7gEeaykicvgjzkjSwFsAXIR81Zx4QJ6oosVyJkCcT+4xAldCcihqvTf94HHUPXYp3REIaR4dhpQF6+FK1H0i9i7Pvh8owu3lO4PT1iuqu+DkL2Bj9+kdfGAg2TXw03iNHyobxofLE2ibjsYDPgeEQlRMR7afXbSGQcnPjI2D+sdtmuQ771dbASUsDndU7t58jrrNGRzISvwioAlHs5FA+cBE5Ccznkd8NMV6BR6ksnKLPZnMUawRDU1MZ/ib3xCdkTblHKu4blNiylH5n213yM0zubEie0o4JhzcfAy3H5qh2l17uLooBNLaO+gzonTH2uF8PQu9EyH+pjGsACTMy4cHzsPdymUSXYJOMP3yTkXqvO/lpvt0cX5ekDEu9PUfBeZODkFuAjXCaGdi6ew4qxJ8PmFfwmPpkgQjQlWqomFY6UkjmcnAtJG75EVR+NpzGpP1Ef5qUUbfowrC3zcSLX3BxgWEgEx/v9cP8H8u1Mvt9/rMDYf6sjwU1xSOPBgzFEeJLMRVFtKo5QHsUYT8ZRLCah27599EuqoC9PYjYO6aoAMHB8X1OHwEAYouHfHB3nyb2B+SnZxM/vw/bCtORjLMSy5aZoEpvgdGvlJfNPFUu/p7Z4VVK1hiI0/UTuB3ZPq4ohEbm7Mntgc1evEtknaosgZSwnDC2BdMmibpeg48X8Ixl+/8+xXdbshQXUPPvx8jT3fkELivHSmqbhblfNFShWAyQnJ3WBU6SMYSIpTDmHjdLVAdlADdz9gCplZw6mTiHqDwIsxbm9ErGusiVpg2w8Q3khKV/R9Oj8PFeF43hmW/nSd99nZzhyjCX3QOZkkB6BsH4H866WGyv9E0hVAzPYah2tkRfQZMmP2rinfOeQalge0ovhduBjJs9a1GBwReerceify49ctOh5/65ATYuMsAkVltmvTLBk4oHpdl6i+p8DoNj4Fb2vhdFYer2JSEilEwPd5n5zNoGBXEjreg/wh2NFnNRaIUHSOXa4eJRwygZoX6vnWnqVdCRT1ARxeFrNBJ+tsdooMwqnYhE7zIxnD8pZH+P0Nu1wWxCPTADfNWmqx626IBJJq6NeapcGeOmbtXvl0TeWG0Y7OGGV4+EHTtNBIT5Wd0Bujl7inXgZgfXTM5efD3qDTJ54O9v3Bkv+tdIRlq1kXcVD0BEMirmFxglNPt5pedb1AnxuCYMChUykwsTIWqT23XDpvTiKEru1cTcEMeniB+HQDehxPXNmkotFdwUPnilB/u4Nx5Xc6l8J9jH1EgKZUUt8t8cyoZleDBEt8oibDmJRAoMKJ5Oe9CSWS5ZMEJvacsGVdXDWjp/Ype5x0p9PXB2PAwt2LRD3d+ftNgpuyvxlP8pB84oB1i73vAVpwyrmXW72hfW6Dzn9Jkj4++0VQ4d0KSx1AsDA4OtXXDo63/w+GD+zC7w5SJaxsmnlYRQ4dgdjA7tTl2KNLnpJ+mvkoDxtt1a4oPaX3EVqj96o9sRKBQqU7ZOiupeAIyLMD+Y3YwHx30XWHB5CQiw7q3mj1EDlP2eBsZbz79ayUMbyHQ7s8gu4Lgip1LiGJj7NQj905/+rgUYKAA5qdrlHKIknWmqfuR+PB8RdBkDg/NgnlT89G72h2NvySnj7UyBwD+mi/IWs1xWbxuVwUIVXun5cMqBtFbrccI+DILjsVQg6eeq0itiRfedn89CvyFtpkxaauEvSANuZmB1p8FGPbU94J9medwsZ9HkUYjmI7OH5HuxendLbxTaYrPuIfE2ffXFKhoNBUp33HsFAXmCV/Vxpq5AYgFoRr5Ay93ZLRlgaIPjhZjXZZChT+aE5iWAXMX0oSFQEtwjiuhQQItTQX5IYrKfKB+queTNplR1Hoflo5/I6aPPmACwQCE2jTOYo5Dz1cs7Sod0KTG/3kEDGk3kUaUCON19xSJCab3kNpWZhSWkO8l+SpW70Wn3g0ciOIJO5JXma6dbos6jyisuxXwUUhj2+1uGhcvuliKtWwsUTw4gi1c/diEEpZHoKoxTBeMDmhPhKTx7TXWRakV8imJR355DcIHkR9IREHxohP4TbyR5LtFU24umRPRmEYHbpe1LghyxPx7YgUHjNbbQFRQhh4KeU1EabXx8FS3JAxp2rwRDoeWkJgWRUSKw6gGP5U2PuO9V4ZuiKXGGzFQuRuf+tkSSsbBtRJKhCi3ENuLlXhPbjTKD4djXVnfXFds6Zb+1XiUrRfyayGxJq1+SYBEfbKlgjiSmk0orgTqzSS+DZ5rTqsJbttiNtp+KMqGE2AHGFw6jQqM5vD6vMptmXV9OAjq49Uf/Lx9Opam+Hn5O9p8qoBBAQixzQZ4eNVkO9sPzJAMyR1y4/RCQQ1s0pV5KAU5sKLw3tkcFbI/JqrjCsK4Mw+W8aod4lioYuawUiCyVWBE/qPaFi5bnkgpfu/ae47174rI1fqQoTbW0HrU6FAejq7ByM0V4zkZTg02/YJK2N7hUQRCeZ4BIgSEqgD8XsjzG6LIsSbuHoIdz/LhFzbNn1clci1NHWJ0/6/O8HJMdIpEZbqi1RrrFfoo/rI/7ufm2MPG5lUI0IYJ4MAiHRTSOFJ2oTverFHYXThkYFIoyFx6rMYFgaOKM4xNWdlOnIcKb/suptptgTOTdVIf4YgdaAjJnIAm4qNNHNQqqAzvi53GkyRCEoseUBrHohZsjUbkR8gfKtc/+Oa72lwxJ8Mq6HDfDATbfbJhzeIuFQJSiw1uZprHlzUf90WgqG76zO0eCB1WdPv1IT6sNxxh91GEL2YpgC97ikFHyoaH92ndwduqZ6IYjkg20DX33MWdoZk7QkcKUCgisIYslOaaLyvIIqRKWQj16jE1DlQWJJaPopWTJjXfixEjRJJo8g4++wuQjbq+WVYjsqCuNIQW3YjnxKe2M5ZKEqq+cX7ZVgnkbsU3RWIyXA1rxv4kGersYJjD//auldXGmcEbcfTeF16Y1708FB1HIfmWv6dSFi6oD4E+RIjCsEZ+kY7dKnwReJJw3xCjKvi3kGN42rvyhUlIz0Bp+fNSV5xwFiuBzG296e5s/oHoFtUyUplmPulIPl+e1CQIQVtjlzLzzzbV+D/OVQtYzo5ixtMi5BmHuG4N/uKfJk5UIREp7+12oZlKtPBomXSzAY0KgtbPzzZoHQxujnREUgBU+O/jKKhgxVhRPtbqyHiUaRwRpHv7pgRPyUrnE7fYkVblGmfTY28tFCvlILC04Tz3ivkNWVazA+OsYrxvRM/hiNn8Fc4bQBeUZABGx5S/xFf9Lbbmk298X7iFg2yeimvsQqqJ+hYbt6uq+Zf9jC+Jcwiccd61NKQtFvGWrgJiHB5lwi6fR8KzYS7EaEHf/ka9EC7H8D+WEa3TEACHBkNSj/cXxFeq4RllC+fUFm2xtstYLL2nos1DfzsC9vqDDdRVcPA3Ho95aEQHvExVThXPqym65llkKlfRXbPTRiDepdylHjmV9YTWAEjlD9DdQnCem7Aj/ml58On366392214B5zrmQz/9ySG2mFqEwjq5sFl5tYJPw5hNz8lyZPUTsr5E0F2C9VMPnZckWP7+mbwp/BiN7f4kf7vtGnZF2JGvjK/sDX1RtcFY5oPQnE4lIAYV49U3C9SP0LCY/9i/WIFK9ORjzM9kG/KGrAuwFmgdEpdLaiqQNpCTGZVuAO65afkY1h33hrqyLjZy92JK3/twdj9pafFcwfXONmPQWldPlMe7jlP24Js0v9m8bIJ9TgS2IuRvE9ZVRaCwSJYOtAfL5H/YS4FfzKWKbek+GFulheyKtDNlBtrdmr+KU+ibHTdalzFUmMfxw3f36x+3cQbJLItSilW9cuvZEMjKw987jykZRlsH/UI+HlKfo2tLwemBEeBFtmxF2xmItA/dAIfQ+rXnm88dqvXa+GapOYVt/2waFimXFx3TC2MUiOi5/Ml+3rj/YU6Ihx2hXgiDXFsUeQkRAD6wF3SCPi2flk7XwKAA4zboqynuELD312EJ88lmDEVOMa1W/K/a8tGylZRMrMoILyoMQzzbDJHNZrhH77L9qSC42HVmKiZ5S0016UTp83gOhCwz9XItK9fgXfK3F5d7nZCBUekoLxrutQaPHa16Rjsa0gTrzyjqTnmcIcrxg6X6dkKiucudc0DD5W4pJPf0vuDW8r5/uw24YfMuxFRpD2ovT2mFX79xH6Jf+MVdv2TYqR6/955QgVPe3JCD/WjAYcLA9tpXgFiEjge2J5ljeI/iUzg91KQuHkII4mmHZxC3XQORLAC6G7uFn5LOmlnXkjFdoO976moNTxElS8HdxWoPAkjjocDR136m2l+f5t6xaaNgdodOvTu0rievnhNAB79WNrVs6EsPgkgfahF9gSFzzAd+rJSraw5Mllit7vUP5YxA843lUpu6/5jAR0RvH4rRXkSg3nE+O5GFyfe+L0s5r3k05FyghSFnKo4TTgs07qj4nTLqOYj6qaW9knJTDkF5OFMYbmCP+8H16Ty482OjvERV6OFyw043L9w3hoJi408sR+SGo1WviXUu8d7qS+ehKjpKwxeCthsm2LBFSFeetx0x4AaKPxtp3CxdWqCsLrB1s/j5TAhc1jNZsXWl6tjo/WDoewxzg8T8NnhZ1niUwL/nhfygLanCnRwaFGDyLw+sfZhyZ1UtYTp8TYB6dE7R3VsKKH95CUxJ8u8N+9u2/9HUNKHW3x3w5GQrfOPafk2w5qZq8MaHT0ebeY3wIsp3rN9lrpIsW9c1ws3VNV+JwNz0Lo9+V7zZr6GD56We6gWVIvtmam5GPPkVAbr74r6SwhuL+TRXtW/0pgyX16VNl4/EAD50TnUPuwrW6OcUO2VlWXS0inq872kk7GUlW6o/ozFKq+Sip6LcTtSDfDrPTcCHhx75H8BeRon+KG2wRwzfDgWhALmiWOMO6h3pm1UCZEPEjScyk7tdLx6WrdA2N1QTPENvNnhCQjW6kl057/qv7IwRryHrZBCwVSbLLnFRiHdTwk8mlYixFt1slEcPD7FVht13HyqVeyD55HOXrh2ElAxJyinGeoFzwKA91zfrdLvDxJSjzmImfvTisreI25EDcVfGsmxLVbfU8PGe/7NmWWKjXcdTJ11jAlVIY/Bv/mcxg/Q10vCHwKG1GW/XbJq5nxDhyLqiorn7Wd7VEVL8UgVzpHMjQ+Z8DUgSukiVwWAKkeTlVVeZ7t1DGnCgJVIdBPZAEK5f8CDyDNo7tK4/5DBjdD5MPV86TaEhGsLVFPQSI68KlBYy84FievdU9gWh6XZrugvtCZmi9vfd6db6V7FmoEcRHnG36VZH8N4aZaldq9zZawt1uBFgxYYx+Gs/qW1jwANeFy+LCoymyM6zgG7j8bGzUyLhvrbJkTYAEdICEb4kMKusKT9V3eIwMLsjdUdgijMc+7iKrr+TxrVWG0U+W95SGrxnxGrE4eaJFfgvAjUM4SAy8UaRwE9j6ZQH5qYAWGtXByvDiLSDfOD0yFA3UCMKSyQ30fyy1mIRg4ZcgZHLNHWl+c9SeijOvbOJxoQy7lTN2r3Y8p6ovxvUY74aOYbuVezryqXA6U+fcp6wSV9X5/OZKP18tB56Ua0gMyxJI7XyNT7IrqN8GsB9rL/kP5KMrjXxgqKLDa+V5OCH6a5hmOWemMUsea9vQl9t5Oce76PrTyTv50ExOqngE3PHPfSL//AItPdB7kGnyTRhVUUFNdJJ2z7RtktZwgmQzhBG/G7QsjZmJfCE7k75EmdIKH7xlnmDrNM/XbTT6FzldcH/rcRGxlPrv4qDScqE7JSmQABJWqRT/TUcJSwoQM+1jvDigvrjjH8oeK2in1S+/yO1j8xAws/T5u0VnIvAPqaE1atNuN0cuRliLcH2j0nTL4JpcR7w9Qya0JoaHgsOiALLCCzRkl1UUESz+ze/gIXHGtDwgYrK6pCFKJ1webSDog4zTlPkgXZqxlQDiYMjhDpwTtBW2WxthWbov9dt2X9XFLFmcF+eEc1UaQ74gqZiZsdj63pH1qcv3Vy8JYciogIVKsJ8Yy3J9w/GhjWVSQAmrS0BPOWK+RKV+0lWqXgYMnIFwpcZVD7zPSp547i9HlflB8gVnSTGmmq1ClO081OW/UH11pEQMfkEdDFzjLC1Cdo/BdL3s7cXb8J++Hzz1rhOUVZFIPehRiZ8VYu6+7Er7j5PSZu9g/GBdmNzJmyCD9wiswj9BZw+T3iBrg81re36ihMLjoVLoWc+62a1U/7qVX5CpvTVF7rocSAKwv4cBVqZm7lLDS/qoXs4fMs/VQi6BtVbNA3uSzKpQfjH1o3x4LrvkOn40zhm6hjduDglzJUwA0POabgdXIndp9fzhOo23Pe+Rk9GSLX0d71Poqry8NQDTzNlsa+JTNG9+UrEf+ngxCjGEsDCc0bz+udVRyHQI1jmEO3S+IOQycEq7XwB6z3wfMfa73m8PVRp+iOgtZfeSBl01xn03vMaQJkyj7vnhGCklsCWVRUl4y+5oNUzQ63B2dbjDF3vikd/3RUMifPYnX5Glfuk2FsV/7RqjI9yKTbE8wJY+74p7qXO8+dIYgjtLD/N8TJtRh04N9tXJA4H59IkMmLElgvr0Q5OCeVfdAt+5hkh4pQgfRMHpL74XatLQpPiOyHRs/OdmHtBf8nOZcxVKzdGclIN16lE7kJ+pVMjspOI+5+TqLRO6m0ZpNXJoZRv9MPDRcAfJUtNZHyig/s2wwReakFgPPJwCQmu1I30/tcBbji+Na53i1W1N+BqoY7Zxo+U/M9XyJ4Ok2SSkBtoOrwuhAY3a03Eu6l8wFdIG1cN+e8hopTkiKF093KuH/BcB39rMiGDLn6XVhGKEaaT/vqb/lufuAdpGExevF1+J9itkFhCfymWr9vGb3BTK4j598zRH7+e+MU9maruZqb0pkGxRDRE1CD4Z8LV4vhgPidk5w2Bq816g3nHw1//j3JStz7NR9HIWELO8TMn3QrP/zZp//+Dv9p429/ogv+GATR+n/UdF+ns9xNkXZQJXY4t9jMkJNUFygAtzndXwjss+yWH9HAnLQQfhAskdZS2l01HLWv7L7us5uTH409pqitvfSOQg/c+Zt7k879P3K9+WV68n7+3cZfuRd/dDPP/03rn+d+/nBvWfgDlt8+LzjqJ/vx3CnNOwiXhho778C96iD+1TBvRZYeP+EH81LE0vVwOOrmCLB3iKzI1x+vJEsrPH4uF0UB4TJ4X3uDfOCo3PYpYe0MF4bouh0DQ/l43fxUF7Y+dpWuvTSffB0yO2UQUETI/LwCZE3BvnevJ7c9zUlY3H58xzke6DNFDQG8n0WtDN4LAYN4nogKav1ezOfK/z+t6tsCTp+dhx4ymjWuCJk1dEUifDP+HyS4iP/Vg9B2jTo9L4NbiBuDS4nuuHW6H+JDQn2JtqRKGkEQPEYE7uzazXIkcxIAqUq1esasZBETlEZY7y7Jo+RoV/IsjY9eIMkUvr42Hc0xqtsavZvhz1OLwSxMOTuqzlhb0WbdOwBH9EYiyBjatz40bUxTHbiWxqJ0uma19qhPruvcWJlbiSSH48OLDDpaHPszvyct41ZfTu10+vjox6kOqK6v0K/gEPphEvMl/vwSv+A4Hhm36JSP9IXTyCZDm4kKsqD5ay8b1Sad/vaiyO5N/sDfEV6Z4q95E+yfjxpqBoBETW2C7xl4pIO2bDODDFurUPwE7EWC2Uplq+AHmBHvir2PSgkR12/Ry65O0aZtQPeXi9mTlF/Wj5GQ+vFkYyhXsLTjrBSP9hwk4GPqDP5rBn5/l8b0mLRAvRSzXHc293bs3s8EsdE3m2exxidWVB4joHR+S+dz5/W+v00K3TqN14CDBth8eWcsTbiwXPsygHdGid0PEdy6HHm2v/IUuV5RVapYmzGsX90mpnIdNGcOOq64Dbc5GUbYpD9M7S+6cLY//QmjxFLP5cuTFRm3vA5rkFZroFnO3bjHF35uU3s8mvL7Tp9nyTc4mymTJ5sLIp7umSnGkO23faehtz3mmTS7fbVx5rP7x3HXIjRNeq/A3xCs9JNB08c9S9BF2O3bOur0ItslFxXgRPdaapBIi4dRpKGxVz7ir69t/bc9qTxjvtOyGOfiLGDhR4fYywHv1WdOplxIV87TpLBy3Wc0QP0P9s4G7FBNOdITS/tep3o3h1TEa5XDDii7fWtqRzUEReP2fbxz7bHWWJdbIOxOUJZtItNZpTFRfj6vm9sYjRxQVO+WTdiOhdPeTJ+8YirPvoeL88l5iLYOHd3b/Imkq+1ZN1El3UikhftuteEYxf1Wujof8Pr4ICTu5ezZyZ4tHQMxlzUHLYO2VMOoNMGL/20S5i2o2obfk+8qqdR7xzbRDbgU0lnuIgz4LelQ5XS7xbLuSQtNS95v3ZUOdaUx/Qd8qxCt6xf2E62yb/HukLO6RyorV8KgYl5YNc75y+KvefrxY+lc/64y9kvWP0a0bDz/rojq+RWjO06WeruWqNFU7r3HPIcLWRql8ICZsz2Ls/qOm/CLn6++X+Qf7mGspYCrZod/lpl6Rw4xN/yuq8gqV4B6aHk1hVE1SfILxWu5gvXqbfARYQpspcxKp1F/c8XOPzkZvmoSw+vEqBLdrq1fr3wAPv5NnM9i8F+jdAuxkP5Z71c6uhK3enlnGymr7UsWZKC12qgUiG8XXGQ9mxnqz4GSIlybF9eXmbqj2sHX+a1jf0gRoONHRdRSrIq03Ty89eQ1GbV/Bk+du4+V15zls+vvERvZ4E7ZbnxWTVjDjb4o/k8jlw44pTIrUGxxuJvBeO+heuhOjpFsO6lVJ/aXnJDa/bM0Ql1cLbXE/Pbv3EZ3vj3iVrB5irjupZTzlnv677NrI9UNYNqbPgp/HZXS+lJmk87wec+7YOxTDo2aw2l3NfDr34VNlvqWJBknuK7oSlZ6/T10zuOoPZOeoIk81N+sL843WJ2Q4Z0fZ3scsqC/JV2fuhWi1jGURSKZV637lf53Xnnx16/vKEXY89aVJ0fv91jGdfG+G4+sniwHes4hS+udOr4RfhFhG/F5gUG35QaU+McuLmclb5ZWmR+sG5V6nf+PxYzlrnFGxpZaK8eqqVo0NfmAWoGfXDiT/FnUbWvzGDOTr8aktOZWg4BYvz5YH12ZbfCcGtNk+dDAZNGWvHov+PIOnY9Prjg8h/wLRrT69suaMVZ5bNuK00lSVpnqSX1NON/81FoP92rYndionwgOiA8WMf4vc8l15KqEEG4yAm2+WAN5Brfu1sq9suWYqgoajgOYt/JCk1gC8wPkK+XKCtRX6TAtgvrnuBgNRmn6I8lVDipOVB9kX6Oxkp4ZKyd1M6Gj8/v2U7k+YQBL95Kb9PQENucJb0JlW3b5tObN7m/Z1j1ev388d7o15zgXsI9CikAGAViR6lkJv7nb4Ak40M2G8TJ447kN+pvfHiOFjSUSP6PM+QfbAywKJCBaxSVxpizHseZUyUBhq59vFwrkyGoRiHbo0apweEZeSLuNiQ+HAekOnarFg00dZNXaPeoHPTRR0FmEyqYExOVaaaO8c0uFUh7U4e/UxdBmthlBDgg257Q33j1hA7HTxSeTTSuVnPZbgW1nodwmG16aKBDKxEetv7D9OjO0JhrbJTnoe+kcGoDJazFSO8/fUN9Jy/g4XK5PUkw2dgPDGpJqBfhe7GA+cjzfE/EGsMM+FV9nj9IAhrSfT/J3QE5TEIYyk5UjsI6ZZcCPr6A8FZUF4g9nnpVmjX90MLSQysIPD0nFzqwCcSJmIb5mYv2Cmk+C1MDFkZQyCBq4c/Yai9LJ6xYkGS/x2s5/frIW2vmG2Wrv0APpCdgCA9snFvfpe8uc0OwdRs4G9973PGEBnQB5qKrCQ6m6X/H7NInZ7y/1674/ZXOVp7OeuCRk8JFS516VHrnH1HkIUIlTIljjHaQtEtkJtosYul77cVwjk3gW1Ajaa6zWeyHGLlpk3VHE2VFzT2yI/EvlGUSz2H9zYE1s4nsKMtMqNyKNtL/59CpFJki5Fou6VXGm8vWATEPwrUVOLvoA8jLuwOzVBCgHB2Cr5V6OwEWtJEKokJkfc87h+sNHTvMb0KVTp5284QTPupoWvQVUwUeogZR3kBMESYo0mfukewRVPKh5+rzLQb7HKjFFIgWhj1w3yN/qCNoPI8XFiUgBNT1hCHBsAz8L7Oyt8wQWUFj92ONn/APyJFg8hzueqoJdNj57ROrFbffuS/XxrSXLTRgj5uxZjpgQYceeMc2wJrahReSKpm3QjHfqExTLAB2ipVumE8pqcZv8LYXQiPHHsgb5BMW8zM5pvQit+mQx8XGaVDcfVbLyMTlY8xcfmm/RSAT/H09UQol5gIz7rESDmnrQ4bURIB4iRXMDQwxgex1GgtDxKp2HayIkR+E/aDmCttNm2C6lytWdfOVzD6X2SpDWjQDlMRvAp1symWv4my1bPCD+E1EmGnMGWhNwmycJnDV2WrQNxO45ukEb08AAffizYKVULp15I4vbNK5DzWwCSUADfmKhfGSUqii1L2UsE8rB7mLuHuUJZOx4+WiizHBJ/hwboaBzhpNOVvgFTf5cJsHef7L1HCI9dOUUbb+YxUJWn6dYOLz+THi91kzY5dtO5c+grX7v0jEbsuoOGnoIreDIg/sFMyG+TyCLIcAWd1IZ1UNFxE8Uie13ucm40U2fcxC0u3WLvLOxwu+F7MWUsHsdtFQZ7W+nlfCASiAKyh8rnP3EyDByvtJb6Kax6/HkLzT9SyEyTMVM1zPtM0MJY14DmsWh4MgD15Ea9Hd00AdkTZ0EiG5NAGuIBzQJJ0JR0na+OB7lQA6UKxMfihIQ7GCCnVz694QvykWXTxpS2soDu+smru1UdIxSvAszBFD1c8c6ZOobA8bJiJIvuycgIXBQIXWwhyTgZDQxJTRXgEwRNAawGSXO0a1DKjdihLVNp/taE/xYhsgwe+VpKEEB4LlraQyE84gEihxCnbfoyOuJIEXy2FIYw+JjRusybKlU2g/vhTSGTydvCvXhYBdtAXtS2v7LkHtmXh/8fly1do8FI/D0f8UbzVb5h+KRhMGSAmR2mhi0YG/uj7wgxcfzCrMvdjitUIpXDX8ae2JcF/36qUWIMwN6JsjaRGNj+jEteGDcFyTUb8X/NHSucKMJp7pduxtD6KuxVlyxxwaeiC1FbGBESO84lbyrAugYxdl+2N8/6AgWpo/IeoAOcsG35IA/b3AuSyoa55L7llBLlaWlEWvuCFd8f8NfcTUgzJv6CbB+6ohWwodlk9nGWFpBAOaz5uEW5xBvmjnHFeDsb0mXwayj3mdYq5gxxNf3H3/tnCgHwjSrpSgVxLmiTtuszdRUFIsn6LiMPjL808vL1uQhDbM7aA43mISXReqjSskynIRcHCJ9qeFopJfx9tqyUoGbSwJex/0aDE3plBPGtNBYgWbdLom3+Q/bjdizR2/AS/c/dH/d3G7pyl1qDXgtOFtEqidwLqxPYtrNEveasWq3vPUUtqTeu8gpov4bdOQRI2kneFvRNMrShyVeEupK1PoLDPMSfWMIJcs267mGB8X9CehQCF0gIyhpP10mbyM7lwW1e6TGvHBV1sg/UyTghHPGRqMyaebC6pbB1WKNCQtlai1GGvmq9zUKaUzLaXsXEBYtHxmFbEZ2kJhR164LhWW2Tlp1dhsGE7ZgIWRBOx3Zcu2DxgH+G83WTPceKG0TgQKKiiNNOlWgvqNEbnrk6fVD+AqRam2OguZb0YWSTX88N+i/ELSxbaUUpPx4vJUzYg/WonSeA8xUK6u7DPHgpqWpEe6D4cXg5uK9FIYVba47V/nb+wyOtk+zG8RrS4EA0ouwa04iByRLSvoJA2FzaobbZtXnq8GdbfqEp5I2dpfpj59TCVif6+E75p665faiX8gS213RqBxTZqfHP46nF6NSenOneuT+vgbLUbdTH2/t0REFXZJOEB6DHvx6N6g9956CYrY/AYcm9gELJXYkrSi+0F0geKDZgOCIYkLU/+GOW5aGj8mvLFgtFH5+XC8hvAE3CvHRfl4ofM/Qwk4x2A+R+nyc9gNu/9Tem7XW4XRnyRymf52z09cTOdr+PG6+P/Vb4QiXlwauc5WB1z3o+IJjlbxI8MyWtSzT+k4sKVbhF3xa+vDts3NxXa87iiu+xRH9cAprnOL2h6vV54iQRXuOAj1s8nLFK8gZ70ThIQcWdF19/2xaJmT0efrkNDkWbpAQPdo92Z8+Hn/aLjbOzB9AI/k12fPs9HhUNDJ1u6ax2VxD3R6PywN7BrLJ26z6s3QoMp76qzzwetrDABKSGkfW5PwS1GvYNUbK6uRqxfyVGNyFB0E+OugMM8kKwmJmupuRWO8XkXXXQECyRVw9UyIrtCtcc4oNqXqr7AURBmKn6Khz3eBN96LwIJrAGP9mr/59uTOSx631suyT+QujDd4beUFpZ0kJEEnjlP+X/Kr2kCKhnENTg4BsMTOmMqlj2WMFLRUlVG0fzdCBgUta9odrJfpVdFomTi6ak0tFjXTcdqqvWBAzjY6hVrH9sbt3Z9gn+AVDpTcQImefbB4edirjzrsNievve4ZT4EUZWV3TxEsIW+9MT/RJoKfZZYSRGfC1CwPG/9rdMOM8qR/LUYvw5f/emUSoD7YSFuOoqchdUg2UePd1eCtFSKgxLSZ764oy4lvRCIH6bowPxZWwxNFctksLeil47pfevcBipkkBIc4ngZG+kxGZ71a72KQ7VaZ6MZOZkQJZXM6kb/Ac0/XkJx8dvyfJcWbI3zONEaEPIW8GbkYjsZcwy+eMoKrYjDmvEEixHzkCSCRPRzhOfJZuLdcbx19EL23MA8rnjTZZ787FGMnkqnpuzB5/90w1gtUSRaWcb0eta8198VEeZMUSfIhyuc4/nywFQ9uqn7jdqXh+5wwv+RK9XouNPbYdoEelNGo34KyySwigsrfCe0v/PlWPvQvQg8R0KgHO18mTVThhQrlbEQ0Kp/JxPdjHyR7E1QPw/ut0r+HDDG7BwZFm9IqEUZRpv2WpzlMkOemeLcAt5CsrzskLGaVOAxyySzZV/D2EY7ydNZMf8e8VhHcKGHAWNszf1EOq8fNstijMY4JXyATwTdncFFqcNDfDo+mWFvxJJpc4sEZtjXyBdoFcxbUmniCoKq5jydUHNjYJxMqN1KzYV62MugcELVhS3Bnd+TLLOh7dws/zSXWzxEb4Nj4aFun5x4kDWLK5TUF/yCXB/cZYvI9kPgVsG2jShtXkxfgT+xzjJofXqPEnIXIQ1lnIdmVzBOM90EXvJUW6a0nZ/7XjJGl8ToO3H/fdxnxmTNKBZxnkpXLVgLXCZywGT3YyS75w/PAH5I/jMuRspej8xZObU9kREbRA+kqjmKRFaKGWAmFQspC+QLbKPf0RaK3OXvBSWqo46p70ws/eZpu6jCtZUgQy6r4tHMPUdAgWGGUYNbuv/1a6K+MVFsd3T183+T8capSo6m0+Sh57fEeG/95dykGJBQMj09DSW2bY0mUonDy9a8trLnnL5B5LW3Nl8rJZNysO8Zb+80zXxqUGFpud3Qzwb7bf+8mq6x0TAnJU9pDQR9YQmZhlna2xuxJt0aCO/f1SU8gblOrbIyMsxTlVUW69VJPzYU2HlRXcqE2lLLxnObZuz2tT9CivfTAUYfmzJlt/lOPgsR6VN64/xQd4Jlk/RV7UKVv2Gx/AWsmTAuCWKhdwC+4HmKEKYZh2Xis4KsUR1BeObs1c13wqFRnocdmuheaTV30gvVXZcouzHKK5zwrN52jXJEuX6dGx3BCpV/++4f3hyaW/cQJLFKqasjsMuO3B3WlMq2gyYfdK1e7L2pO/tRye2mwzwZPfdUMrl5wdLqdd2Kv/wVtnpyWYhd49L6rsOV+8HXPrWH2Kup89l2tz6bf80iYSd+V4LROSOHeamvexR524q4r43rTmtFzQvArpvWfLYFZrbFspBsXNUqqenjxNNsFXatZvlIhk7teUPfK+YL32F8McTnjv0BZNppb+vshoCrtLXjIWq3EJXpVXIlG6ZNL0dh6qEm2WMwDjD3LfOfkGh1/czYc/0qhiD2ozNnH4882MVVt3JbVFkbwowNCO3KL5IoYW5wlVeGCViOuv1svZx7FbzxKzA4zGqBlRRaRWCobXaVq4yYCWbZf8eiJwt3OY+MFiSJengcFP2t0JMfzOiJ7cECvpx7neg1Rc5x+7myPJOXt2FohVRyXtD+/rDoTOyGYInJelZMjolecVHUhUNqvdZWg2J2t0jPmiLFeRD/8fOT4o+NGILb+TufCo9ceBBm3JLVn+MO2675n7qiEX/6W+188cYg3Zn5NSTjgOKfWFSAANa6raCxSoVU851oJLY11WIoYK0du0ec5E4tCnAPoKh71riTsjVIp3gKvBbEYQiNYrmH22oLQWA2AdwMnID6PX9b58dR2QKo4qag1D1Z+L/FwEKTR7osOZPWECPJIHQqPUsM5i/CH5YupVPfFA5pHUBcsesh8eO5YhyWnaVRPZn/BmdXVumZWPxMP5e28zm2uqHgFoT9CymHYNNrzrrjlXZM06HnzDxYNlI5b/QosxLmmrqDFqmogQdqk0WLkUceoAvQxHgkIyvWU69BPFr24VB6+lx75Rna6dGtrmOxDnvBojvi1/4dHjVeg8owofPe1cOnxU1ioh016s/Vudv9mhV9f35At+Sh28h1bpp8xhr09+vf47Elx3Ms6hyp6QvB3t0vnLbOhwo660cp7K0vvepabK7YJfxEWWfrC2YzJfYOjygPwfwd/1amTqa0hZ5ueebhWYVMubRTwIjj+0Oq0ohU3zfRfuL8gt59XsHdwKtxTQQ4Y2qz6gisxnm2UdlmpEkgOsZz7iEk6QOt8BuPwr+NR01LTqXmJo1C76o1N274twJvl+I069TiLpenK/miRxhyY8jvYV6W1WuSwhH9q7kuwnJMtm7IWcqs7HsnyHSqWXLSpYtZGaR1V3t0gauninFPZGtWskF65rtti48UV9uV9KM8kfDYs0pgB00S+TlzTXV6P8mxq15b9En8sz3jWSszcifZa/NuufPNnNTb031pptt0+sRSH/7UG8pzbsgtt3OG3ut7B9JzDMt2mTZuyRNIV8D54TuTrpNcHtgmMlYJeiY9XS83NYJicjRjtJSf9BZLsQv629QdDsKQhTK5CnXhpk7vMNkHzPhm0ExW/VCGApHfPyBagtZQTQmPHx7g5IXXsrQDPzIVhv2LB6Ih138iSDww1JNHrDvzUxvp73MsQBVhW8EbrReaVUcLB1R3PUXyaYG4HpJUcLVxMgDxcPkVRQpL7VTAGabDzbKcvg12t5P8TSGQkrj/gOrpnbiDHwluA73xbXts/L7u468cRWSWRtgTwlQnA47EKg0OiZDgFxAKQQUcsbGomITgeXUAAyKe03eA7Mp4gnyKQmm0LXJtEk6ddksMJCuxDmmHzmVhO+XaN2A54MIh3niw5CF7PwiXFZrnA8wOdeHLvvhdoqIDG9PDI7UnWWHq526T8y6ixJPhkuVKZnoUruOpUgOOp3iIKBjk+yi1vHo5cItHXb1PIKzGaZlRS0g5d3MV2pD8FQdGYLZ73aae/eEIUePMc4NFz8pIUfLCrrF4jVWH5gQneN3S8vANBmUXrEcKGn6hIUN95y1vpsvLwbGpzV9L0ZKTan6TDXM05236uLJcIEMKVAxKNT0K8WljuwNny3BNQRfzovA85beI9zr1AGNYnYCVkR1aGngWURUrgqR+gRrQhxW81l3CHevjvGEPzPMTxdsIfB9dfGRbZU0cg/1mcubtECX4tvaedmNAvTxCJtc2QaoUalGfENCGK7IS/O8CRpdOVca8EWCRwv2sSWE8CJPW5PCugjCXPd3h6U60cPD+bdhtXZuYB6stcoveE7Sm5MM2yvfUHXFSW7KzLmi7/EeEWL0wqcOH9MOSKjhCHHmw+JGLcYE/7SBZQCRggox0ZZTAxrlzNNXYXL5fNIjkdT4YMqVUz6p8YDt049v4OXGdg3qTrtLBUXOZf7ahPlZAY/O+7Sp0bvGSHdyQ8B1LOsplqMb9Se8VAE7gIdSZvxbRSrfl+Lk5Qaqi5QJceqjitdErcHXg/3MryljPSIAMaaloFm1cVwBJ8DNmkDqoGROSHFetrgjQ5CahuKkdH5pRPigMrgTtlFI8ufJPJSUlGgTjbBSvpRc0zypiUn6U5KZqcRoyrtzhmJ7/caeZkmVRwJQeLOG8LY6vP5ChpKhc8Js0El+n6FXqbx9ItdtLtYP92kKfaTLtCi8StLZdENJa9Ex1nOoz1kQ7qxoiZFKRyLf4O4CHRT0T/0W9F8epNKVoeyxUXhy3sQMMsJjQJEyMOjmOhMFgOmmlscV4eFi1CldU92yjwleirEKPW3bPAuEhRZV7JsKV3Lr5cETAiFuX5Nw5UlF7d2HZ96Bh0sgFIL5KGaKSoVYVlvdKpZJVP5+NZ7xDEkQhmDgsDKciazJCXJ6ZN2B3FY2f6VZyGl/t4aunGIAk/BHaS+i+SpdRfnB/OktOvyjinWNfM9Ksr6WwtCa1hCmeRI6icpFM4o8quCLsikU0tMoZI/9EqXRMpKGaWzofl4nQuVQm17d5fU5qXCQeCDqVaL9XJ9qJ08n3G3EFZS28SHEb3cdRBdtO0YcTzil3QknNKEe/smQ1fTb0XbpyNB5xAeuIlf+5KWlEY0DqJbsnzJlQxJPOVyHiKMx5Xu9FcEv1Fbg6Fhm4t+Jyy5JC1W3YO8dYLsO0PXPbxodBgttTbH3rt9Cp1lJIk2r3O1Zqu94eRbnIz2f50lWolYzuKsj4PMok4abHLO8NAC884hiXx5Fy5pWKO0bWL7uEGXaJCtznhP67SlQ4xjWIfgq6EpZ28QMtuZK7JC0RGbl9nA4XtFLug/NLMoH1pGt9IonAJqcEDLyH6TDROcbsmGPaGIxMo41IUAnQVPMPGByp4mOmh9ZQMkBAcksUK55LsZj7E5z5XuZoyWCKu6nHmDq22xI/9Z8YdxJy4kWpD16jLVrpwGLWfyOD0Wd+cBzFBxVaGv7S5k9qwh/5t/LQEXsRqI3Q9Rm3QIoaZW9GlsDaKOUyykyWuhNOprSEi0s1G4rgoiX1V743EELti+pJu5og6X0g6oTynUqlhH9k6ezyRi05NGZHz0nvp3HOJr7ebrAUFrDjbkFBObEvdQWkkUbL0pEvMU46X58vF9j9F3j6kpyetNUBItrEubW9ZvMPM4qNqLlsSBJqOH3XbNwv/cXDXNxN8iFLzUhteisYY+RlHYOuP29/Cb+L+xv+35Rv7xudnZ6ohK4cMPfCG8KI7dNmjNk/H4e84pOxn/sZHK9psfvj8ncA8qJz7O8xqbxESDivGJOZzF7o5PJLQ7g34qAWoyuA+x3btU98LT6ZyGyceIXjrqob2CAVql4VOTQPUQYvHV/g4zAuCZGvYQBtf0wmd5lilrvuEn1BXLny01B4h4SMDlYsnNpm9d7m9h578ufpef9Z4WplqWQvqo52fyUA7J24eZD5av6SyGIV9kpmHNqyvdfzcpEMw97BvknV2fq+MFHun9BT3Lsf8pbzvisWiIQvYkng+8Vxk1V+dli1u56kY50LRjaPdotvT5BwqtwyF+emo/z9J3yVUVGfKrxQtJMOAQWoQii/4dp9wgybSa5mkucmRLtEQZ/pz0tL/NVcgWAd95nEQ3Tg6tNbuyn3Iepz65L3huMUUBntllWuu4DbtOFSMSbpILV4fy6wlM0SOvi6CpLh81c1LreIvKd61uEWBcDw1lUBUW1I0Z+m/PaRlX+PQ/oxg0Ye6KUiIiTF4ADNk59Ydpt5/rkxmq9tV5Kcp/eQLUVVmBzQNVuytQCP6Ezd0G8eLxWyHpmZWJ3bAzkWTtg4lZlw42SQezEmiUPaJUuR/qklVA/87S4ArFCpALdY3QRdUw3G3XbWUp6aq9z0zUizcPa7351p9JXOZyfdZBFnqt90VzQndXB/mwf8LC9STj5kenVpNuqOQQP3mIRJj7eV21FxG8VAxKrEn3c+XfmZ800EPb9/5lIlijscUbB6da0RQaMook0zug1G0tKi/JBC4rw7/D3m4ARzAkzMcVrDcT2SyFtUdWAsFlsPDFqV3N+EjyXaoEePwroaZCiLqEzb8MW+PNE9TmTC01EzWli51PzZvUqkmyuROU+V6ik+Le/9qT6nwzUzf9tP68tYei0YaDGx6kAd7jn1cKqOCuYbiELH9zYqcc4MnRJjkeGiqaGwLImhyeKs+xKJMBlOJ05ow9gGCKZ1VpnMKoSCTbMS+X+23y042zOb5MtcY/6oBeAo1Vy89OTyhpavFP78jXCcFH0t7Gx24hMEOm2gsEfGabVpQgvFqbQKMsknFRRmuPHcZu0Su/WMFphZvB2r/EGbG72rpGGho3h+Msz0uGzJ7hNK2uqQiE1qmn0zgacKYYZBCqsxV+sjbpoVdSilW/b94n2xNb648VmNIoizqEWhBnsen+d0kbCPmRItfWqSBeOd9Wne3c6bcd6uvXOJ6WdiSsuXq0ndhqrQ4QoWUjCjYtZ0EAhnSOP1m44xkf0O7jXghrzSJWxP4a/t72jU29Vu2rvu4n7HfHkkmQOMGSS+NPeLGO5I73mC2B7+lMiBQQZRM9/9liLIfowupUFAbPBbR+lxDM6M8Ptgh1paJq5Rvs7yEuLQv/7d1oU2woFSb3FMPWQOKMuCuJ7pDDjpIclus5TeEoMBy2YdVB4fxmesaCeMNsEgTHKS5WDSGyNUOoEpcC2OFWtIRf0w27ck34/DjxRTVIcc9+kqZE6iMSiVDsiKdP/Xz5XfEhm/sBhO50p1rvJDlkyyxuJ9SPgs7YeUJBjXdeAkE+P9OQJm6SZnn1svcduI78dYmbkE2mtziPrcjVisXG78spLvbZaSFx/Rks9zP4LKn0Cdz/3JsetkT06A8f/yCgMO6Mb1Hme0JJ7b2wZz1qleqTuKBGokhPVUZ0dVu+tnQYNEY1fmkZSz6+EGZ5EzL7657mreZGR3jUfaEk458PDniBzsSmBKhDRzfXameryJv9/D5m6HIqZ0R+ouCE54Dzp4IJuuD1e4Dc5i+PpSORJfG23uVgqixAMDvchMR0nZdH5brclYwRoJRWv/rlxGRI5ffD5NPGmIDt7vDE1434pYdVZIFh89Bs94HGGJbTwrN8T6lh1HZFTOB4lWzWj6EVqxSMvC0/ljWBQ3F2kc/mO2b6tWonT2JEqEwFts8rz2h+oWNds9ceR2cb7zZvJTDppHaEhK5avWqsseWa2Dt5BBhabdWSktS80oMQrL4TvAM9b5HMmyDnO+OkkbMXfUJG7eXqTIG6lqSOEbqVR+qYdP7uWb57WEJqzyh411GAVsDinPs7KvUeXItlcMdOUWzXBH6zscymV1LLVCtc8IePojzXHF9m5b5zGwBRdzcyUJkiu938ApmAayRdJrX1PmVguWUvt2ThQ62czItTyWJMW2An/hdDfMK7SiFQlGIdAbltHz3ycoh7j9V7GxNWBpbtcSdqm4XxRwTawc3cbZ+xfSv9qQfEkDKfZTwCkqWGI/ur250ItXlMlh6vUNWEYIg9A3GzbgmbqvTN8js2YMo87CU5y6nZ4dbJLDQJj9fc7yM7tZzJDZFtqOcU8+mZjYlq4VmifI23iHb1ZoT9E+kT2dolnP1AfiOkt7PQCSykBiXy5mv637IegWSKj9IKrYZf4Lu9+I7ub+mkRdlvYzehh/jaJ9n7HUH5b2IbgeNdkY7wx1yVzxS7pbvky6+nmVUtRllEFfweUQ0/nG017WoUYSxs+j2B4FV/F62EtHlMWZXYrjGHpthnNb1x66LKZ0Qe92INWHdfR/vqp02wMS8r1G4dJqHok8KmQ7947G13a4YXbsGgHcBvRuVu1eAi4/A5+ZixmdSXM73LupB/LH7O9yxLTVXJTyBbI1S49TIROrfVCOb/czZ9pM4JsZx8kUz8dQGv7gUWKxXvTH7QM/3J2OuXXgciUhqY+cgtaOliQQVOYthBLV3xpESZT3rmfEYNZxmpBbb24CRao86prn+i9TNOh8VxRJGXJfXHATJHs1T5txgc/opYrY8XjlGQQbRcoxIBcnVsMjmU1ymmIUL4dviJXndMAJ0Yet+c7O52/p98ytlmAsGBaTAmMhimAnvp1TWNGM9BpuitGj+t810CU2UhorrjPKGtThVC8WaXw04WFnT5fTjqmPyrQ0tN3CkLsctVy2xr0ZWgiWVZ1OrlFjjxJYsOiZv2cAoOvE+7sY0I/TwWcZqMoyIKNOftwP7w++Rfg67ljfovKYa50if3fzE/8aPYVey/Nq35+nH2sLPh/fP5TsylSKGOZ4k69d2PnH43+kq++sRXHQqGArWdwhx+hpwQC6JgT2uxehYU4Zbw7oNb6/HLikPyJROGK2ouyr+vzseESp9G50T4AyFrSqOQ0rroCYP4sMDFBrHn342EyZTMlSyk47rHSq89Y9/nI3zG5lX16Z5lxphguLOcZUndL8wNcrkyjH82jqg8Bo8OYkynrxZvbFno5lUS3OPr8Ko3mX9NoRPdYOKKjD07bvgFgpZ/RF+YzkWvJ/Hs/tUbfeGzGWLxNAjfDzHHMVSDwB5SabQLsIZHiBp43FjGkaienYoDd18hu2BGwOK7U3o70K/WY/kuuKdmdrykIBUdG2mvE91L1JtTbh20mOLbk1vCAamu7utlXeGU2ooVikbU/actcgmsC1FKk2qmj3GWeIWbj4tGIxE7BLcBWUvvcnd/lYxsMV4F917fWeFB/XbINN3qGvIyTpCalz1lVewdIGqeAS/gB8Mi+sA+BqDiX3VGD2eUunTRbSY+AuDy4E3Qx3hAhwnSXX+B0zuj3eQ1miS8Vux2z/l6/BkWtjKGU72aJkOCWhGcSf3+kFkkB15vGOsQrSdFr6qTj0gBYiOlnBO41170gOWHSUoBVRU2JjwppYdhIFDfu7tIRHccSNM5KZOFDPz0TGMAjzzEpeLwTWp+kn201kU6NjbiMQJx83+LX1e1tZ10kuChJZ/XBUQ1dwaBHjTDJDqOympEk8X2M3VtVw21JksChA8w1tTefO3RJ1FMbqZ01bHHkudDB/OhLfe7P5GOHaI28ZXKTMuqo0hLWQ4HabBsGG7NbP1RiXtETz074er6w/OerJWEqjmkq2y51q1BVI+JUudnVa3ogBpzdhFE7fC7kybrAt2Z6RqDjATAUEYeYK45WMupBKQRtQlU+uNsjnzj6ZmGrezA+ASrWxQ6LMkHRXqXwNq7ftv28dUx/ZSJciDXP2SWJsWaN0FjPX9Yko6LobZ7aYW/IdUktI9apTLyHS8DyWPyuoZyxN1TK/vtfxk3HwWh6JczZC8Ftn0bIJay2g+n5wd7lm9rEsKO+svqVmi+c1j88hSCxbzrg4+HEP0Nt1/B6YW1XVm09T1CpAKjc9n18hjqsaFGdfyva1ZG0Xu3ip6N6JGpyTSqY5h4BOlpLPaOnyw45PdXTN+DtAKg7DLrLFTnWusoSBHk3s0d7YouJHq85/R09Tfc37ENXZF48eAYLnq9GLioNcwDZrC6FW6godB8JnqYUPvn0pWLfQz0lM0Yy8Mybgn84Ds3Q9bDP10bLyOV+qzxa4Rd9Dhu7cju8mMaONXK3UqmBQ9qIg7etIwEqM/kECk/Dzja4Bs1xR+Q/tCbc8IKrSGsTdJJ0vge7IG20W687uVmK6icWQ6cD3lwFzgNMGtFvO5qyJeKflGLAAcQZOrkxVwy3cWvqlGpvjmf9Qe6Ap20MPbV92DPV0OhFM4kz8Yr0ffC2zLWSQ1kqY6QdQrttR3kh1YLtQd1kCEv5hVoPIRWl5ERcUTttBIrWp6Xs5Ehh5OUUwI5aEBvuiDmUoENmnVw1FohCrbRp1A1E+XSlWVOTi7ADW+5Ohb9z1vK4qx5R5lPdGCPBJZ00mC+Ssp8VUbgpGAvXWMuWQQRbCqI6Rr2jtxZxtfP7W/8onz+yz0Gs76LaT5HX9ecyiZCB/ZR/gFtMxPsDwohoeCRtiuLxE1GM1vUEUgBv86+eehL58/P56QFGQ/MqOe/vC76L63jzmeax4exd/OKTUvkXg+fOJUHych9xt/9goJMrapSgvXrj8+8vk/N80f22Sewj6cyGqt1B6mztoeklVHHraouhvHJaG/OuBz6DHKMpFmQULU1bRWlyYE0RPXYYkUycIemN7TLtgNCJX6BqdyxDKkegO7nJK5xQ7OVYDZTMf9bVHidtk6DQX9Et+V9M7esgbsYBdEeUpsB0Xvw2kd9+rI7V+m47u+O/tq7mw7262HU1WlS9uFzsV6JxIHNmUCy0QS9e077JGRFbG65z3/dOKB/Zk+yDdKpUmdXjn/aS3N5nv4fK7bMHHmPlHd4E2+iTbV5rpzScRnxk6KARuDTJ8Q1LpK2mP8gj1EbuJ9RIyY+EWK4hCiIDBAS1Tm2IEXAFfgKPgdL9O6mAa06wjCcUAL6EsxPQWO9VNegBPm/0GgkZbDxCynxujX/92vmGcjZRMAY45puak2sFLCLSwXpEsyy5fnF0jGJBhm+fNSHKKUUfy+276A7/feLOFxxUuHRNJI2Osenxyvf8DAGObT60pfTTlhEg9u/KKkhJqm5U1/+BEcSkpFDA5XeCqxwXmPac1jcuZ3JWQ+p0NdWzb/5v1ZvF8GtMTFFEdQjpLO0bwPb0BHNWnip3liDXI2fXf05jjvfJ0NpjLCUgfTh9CMFYVFKEd4Z/OG/2C+N435mnK+9t1gvCiVcaaH7rK4+PjCvpVNiz+t2QyqH1O8x3JKZVl6Q+Lp/XK8wMjVMslOq9FdSw5FtUs/CptXH9PW+wbWHgrV17R5jTVOtGtKFu3nb80T+E0tv9QkzW3J2dbaw/8ddAKZ0pxIaEqLjlPrji3VgJ3GvdFvlqD8075woxh4fVt0JZE0KVFsAvqhe0dqN9b35jtSpnYMXkU+vZq+IAHad3IHc2s/LYrnD1anfG46IFiMIr9oNbZDWvwthqYNqOigaKd/XlLU4XHfk/PXIjPsLy/9/kAtQ+/wKH+hI/IROWj5FPvTZAT9f7j4ZXQyG4M0TujMAFXYkKvEHv1xhySekgXGGqNxWeWKlf8dDAlLuB1cb/qOD+rk7cmwt+1yKpk9cudqBanTi6zTbXRtV8qylNtjyOVKy1HTz0GW9rjt6sSjAZcT5R+KdtyYb0zyqG9pSLuCw5WBwAn7fjBjKLLoxLXMI+52L9cLwIR2B6OllJZLHJ8vDxmWdtF+QJnmt1rsHPIWY20lftk8fYePkAIg6Hgn532QoIpegMxiWgAOfe5/U44APR8Ac0NeZrVh3gEhs12W+tVSiWiUQekf/YBECUy5fdYbA08dd7VzPAP9aiVcIB9k6tY7WdJ1wNV+bHeydNtmC6G5ICtFC1ZwmJU/j8hf0I8TRVKSiz5oYIa93EpUI78X8GYIAZabx47/n8LDAAJ0nNtP1rpROprqKMBRecShca6qXuTSI3jZBLOB3Vp381B5rCGhjSvh/NSVkYp2qIdP/Bg=";
},{}],6:[function(require,module,exports){
/* Copyright 2013 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Collection of static dictionary words.
*/
var data = require('./dictionary-browser');
exports.init = function() {
exports.dictionary = data.init();
};
exports.offsetsByLength = new Uint32Array([
0, 0, 0, 0, 0, 4096, 9216, 21504, 35840, 44032,
53248, 63488, 74752, 87040, 93696, 100864, 104704, 106752, 108928, 113536,
115968, 118528, 119872, 121280, 122016,
]);
exports.sizeBitsByLength = new Uint8Array([
0, 0, 0, 0, 10, 10, 11, 11, 10, 10,
10, 10, 10, 9, 9, 8, 7, 7, 8, 7,
7, 6, 6, 5, 5,
]);
exports.minDictionaryWordLength = 4;
exports.maxDictionaryWordLength = 24;
},{"./dictionary-browser":4}],7:[function(require,module,exports){
function HuffmanCode(bits, value) {
this.bits = bits; /* number of bits used for this symbol */
this.value = value; /* symbol value or table offset */
}
exports.HuffmanCode = HuffmanCode;
var MAX_LENGTH = 15;
/* Returns reverse(reverse(key, len) + 1, len), where reverse(key, len) is the
bit-wise reversal of the len least significant bits of key. */
function GetNextKey(key, len) {
var step = 1 << (len - 1);
while (key & step) {
step >>= 1;
}
return (key & (step - 1)) + step;
}
/* Stores code in table[0], table[step], table[2*step], ..., table[end] */
/* Assumes that end is an integer multiple of step */
function ReplicateValue(table, i, step, end, code) {
do {
end -= step;
table[i + end] = new HuffmanCode(code.bits, code.value);
} while (end > 0);
}
/* Returns the table width of the next 2nd level table. count is the histogram
of bit lengths for the remaining symbols, len is the code length of the next
processed symbol */
function NextTableBitSize(count, len, root_bits) {
var left = 1 << (len - root_bits);
while (len < MAX_LENGTH) {
left -= count[len];
if (left <= 0) break;
++len;
left <<= 1;
}
return len - root_bits;
}
exports.BrotliBuildHuffmanTable = function(root_table, table, root_bits, code_lengths, code_lengths_size) {
var start_table = table;
var code; /* current table entry */
var len; /* current code length */
var symbol; /* symbol index in original or sorted table */
var key; /* reversed prefix code */
var step; /* step size to replicate values in current table */
var low; /* low bits for current root entry */
var mask; /* mask for low bits */
var table_bits; /* key length of current table */
var table_size; /* size of current table */
var total_size; /* sum of root table size and 2nd level table sizes */
var sorted; /* symbols sorted by code length */
var count = new Int32Array(MAX_LENGTH + 1); /* number of codes of each length */
var offset = new Int32Array(MAX_LENGTH + 1); /* offsets in sorted table for each length */
sorted = new Int32Array(code_lengths_size);
/* build histogram of code lengths */
for (symbol = 0; symbol < code_lengths_size; symbol++) {
count[code_lengths[symbol]]++;
}
/* generate offsets into sorted symbol table by code length */
offset[1] = 0;
for (len = 1; len < MAX_LENGTH; len++) {
offset[len + 1] = offset[len] + count[len];
}
/* sort symbols by length, by symbol order within each length */
for (symbol = 0; symbol < code_lengths_size; symbol++) {
if (code_lengths[symbol] !== 0) {
sorted[offset[code_lengths[symbol]]++] = symbol;
}
}
table_bits = root_bits;
table_size = 1 << table_bits;
total_size = table_size;
/* special case code with only one value */
if (offset[MAX_LENGTH] === 1) {
for (key = 0; key < total_size; ++key) {
root_table[table + key] = new HuffmanCode(0, sorted[0] & 0xffff);
}
return total_size;
}
/* fill in root table */
key = 0;
symbol = 0;
for (len = 1, step = 2; len <= root_bits; ++len, step <<= 1) {
for (; count[len] > 0; --count[len]) {
code = new HuffmanCode(len & 0xff, sorted[symbol++] & 0xffff);
ReplicateValue(root_table, table + key, step, table_size, code);
key = GetNextKey(key, len);
}
}
/* fill in 2nd level tables and add pointers to root table */
mask = total_size - 1;
low = -1;
for (len = root_bits + 1, step = 2; len <= MAX_LENGTH; ++len, step <<= 1) {
for (; count[len] > 0; --count[len]) {
if ((key & mask) !== low) {
table += table_size;
table_bits = NextTableBitSize(count, len, root_bits);
table_size = 1 << table_bits;
total_size += table_size;
low = key & mask;
root_table[start_table + low] = new HuffmanCode((table_bits + root_bits) & 0xff, ((table - start_table) - low) & 0xffff);
}
code = new HuffmanCode((len - root_bits) & 0xff, sorted[symbol++] & 0xffff);
ReplicateValue(root_table, table + (key >> root_bits), step, table_size, code);
key = GetNextKey(key, len);
}
}
return total_size;
}
},{}],8:[function(require,module,exports){
'use strict'
exports.byteLength = byteLength
exports.toByteArray = toByteArray
exports.fromByteArray = fromByteArray
var lookup = []
var revLookup = []
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
for (var i = 0, len = code.length; i < len; ++i) {
lookup[i] = code[i]
revLookup[code.charCodeAt(i)] = i
}
// Support decoding URL-safe base64 strings, as Node.js does.
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
revLookup['-'.charCodeAt(0)] = 62
revLookup['_'.charCodeAt(0)] = 63
function getLens (b64) {
var len = b64.length
if (len % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4')
}
// Trim off extra bytes after placeholder bytes are found
// See: https://github.com/beatgammit/base64-js/issues/42
var validLen = b64.indexOf('=')
if (validLen === -1) validLen = len
var placeHoldersLen = validLen === len
? 0
: 4 - (validLen % 4)
return [validLen, placeHoldersLen]
}
// base64 is 4/3 + up to two characters of the original data
function byteLength (b64) {
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}
function _byteLength (b64, validLen, placeHoldersLen) {
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}
function toByteArray (b64) {
var tmp
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
var curByte = 0
// if there are placeholders, only get up to the last complete 4 chars
var len = placeHoldersLen > 0
? validLen - 4
: validLen
for (var i = 0; i < len; i += 4) {
tmp =
(revLookup[b64.charCodeAt(i)] << 18) |
(revLookup[b64.charCodeAt(i + 1)] << 12) |
(revLookup[b64.charCodeAt(i + 2)] << 6) |
revLookup[b64.charCodeAt(i + 3)]
arr[curByte++] = (tmp >> 16) & 0xFF
arr[curByte++] = (tmp >> 8) & 0xFF
arr[curByte++] = tmp & 0xFF
}
if (placeHoldersLen === 2) {
tmp =
(revLookup[b64.charCodeAt(i)] << 2) |
(revLookup[b64.charCodeAt(i + 1)] >> 4)
arr[curByte++] = tmp & 0xFF
}
if (placeHoldersLen === 1) {
tmp =
(revLookup[b64.charCodeAt(i)] << 10) |
(revLookup[b64.charCodeAt(i + 1)] << 4) |
(revLookup[b64.charCodeAt(i + 2)] >> 2)
arr[curByte++] = (tmp >> 8) & 0xFF
arr[curByte++] = tmp & 0xFF
}
return arr
}
function tripletToBase64 (num) {
return lookup[num >> 18 & 0x3F] +
lookup[num >> 12 & 0x3F] +
lookup[num >> 6 & 0x3F] +
lookup[num & 0x3F]
}
function encodeChunk (uint8, start, end) {
var tmp
var output = []
for (var i = start; i < end; i += 3) {
tmp =
((uint8[i] << 16) & 0xFF0000) +
((uint8[i + 1] << 8) & 0xFF00) +
(uint8[i + 2] & 0xFF)
output.push(tripletToBase64(tmp))
}
return output.join('')
}
function fromByteArray (uint8) {
var tmp
var len = uint8.length
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
var parts = []
var maxChunkLength = 16383 // must be multiple of 3
// go through the array every three bytes, we'll deal with trailing stuff later
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
parts.push(encodeChunk(
uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
))
}
// pad the end with zeros, but make sure to not forget the extra bytes
if (extraBytes === 1) {
tmp = uint8[len - 1]
parts.push(
lookup[tmp >> 2] +
lookup[(tmp << 4) & 0x3F] +
'=='
)
} else if (extraBytes === 2) {
tmp = (uint8[len - 2] << 8) + uint8[len - 1]
parts.push(
lookup[tmp >> 10] +
lookup[(tmp >> 4) & 0x3F] +
lookup[(tmp << 2) & 0x3F] +
'='
)
}
return parts.join('')
}
},{}],9:[function(require,module,exports){
/* Copyright 2013 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Lookup tables to map prefix codes to value ranges. This is used during
decoding of the block lengths, literal insertion lengths and copy lengths.
*/
/* Represents the range of values belonging to a prefix code: */
/* [offset, offset + 2^nbits) */
function PrefixCodeRange(offset, nbits) {
this.offset = offset;
this.nbits = nbits;
}
exports.kBlockLengthPrefixCode = [
new PrefixCodeRange(1, 2), new PrefixCodeRange(5, 2), new PrefixCodeRange(9, 2), new PrefixCodeRange(13, 2),
new PrefixCodeRange(17, 3), new PrefixCodeRange(25, 3), new PrefixCodeRange(33, 3), new PrefixCodeRange(41, 3),
new PrefixCodeRange(49, 4), new PrefixCodeRange(65, 4), new PrefixCodeRange(81, 4), new PrefixCodeRange(97, 4),
new PrefixCodeRange(113, 5), new PrefixCodeRange(145, 5), new PrefixCodeRange(177, 5), new PrefixCodeRange(209, 5),
new PrefixCodeRange(241, 6), new PrefixCodeRange(305, 6), new PrefixCodeRange(369, 7), new PrefixCodeRange(497, 8),
new PrefixCodeRange(753, 9), new PrefixCodeRange(1265, 10), new PrefixCodeRange(2289, 11), new PrefixCodeRange(4337, 12),
new PrefixCodeRange(8433, 13), new PrefixCodeRange(16625, 24)
];
exports.kInsertLengthPrefixCode = [
new PrefixCodeRange(0, 0), new PrefixCodeRange(1, 0), new PrefixCodeRange(2, 0), new PrefixCodeRange(3, 0),
new PrefixCodeRange(4, 0), new PrefixCodeRange(5, 0), new PrefixCodeRange(6, 1), new PrefixCodeRange(8, 1),
new PrefixCodeRange(10, 2), new PrefixCodeRange(14, 2), new PrefixCodeRange(18, 3), new PrefixCodeRange(26, 3),
new PrefixCodeRange(34, 4), new PrefixCodeRange(50, 4), new PrefixCodeRange(66, 5), new PrefixCodeRange(98, 5),
new PrefixCodeRange(130, 6), new PrefixCodeRange(194, 7), new PrefixCodeRange(322, 8), new PrefixCodeRange(578, 9),
new PrefixCodeRange(1090, 10), new PrefixCodeRange(2114, 12), new PrefixCodeRange(6210, 14), new PrefixCodeRange(22594, 24),
];
exports.kCopyLengthPrefixCode = [
new PrefixCodeRange(2, 0), new PrefixCodeRange(3, 0), new PrefixCodeRange(4, 0), new PrefixCodeRange(5, 0),
new PrefixCodeRange(6, 0), new PrefixCodeRange(7, 0), new PrefixCodeRange(8, 0), new PrefixCodeRange(9, 0),
new PrefixCodeRange(10, 1), new PrefixCodeRange(12, 1), new PrefixCodeRange(14, 2), new PrefixCodeRange(18, 2),
new PrefixCodeRange(22, 3), new PrefixCodeRange(30, 3), new PrefixCodeRange(38, 4), new PrefixCodeRange(54, 4),
new PrefixCodeRange(70, 5), new PrefixCodeRange(102, 5), new PrefixCodeRange(134, 6), new PrefixCodeRange(198, 7),
new PrefixCodeRange(326, 8), new PrefixCodeRange(582, 9), new PrefixCodeRange(1094, 10), new PrefixCodeRange(2118, 24),
];
exports.kInsertRangeLut = [
0, 0, 8, 8, 0, 16, 8, 16, 16,
];
exports.kCopyRangeLut = [
0, 8, 0, 8, 16, 0, 16, 8, 16,
];
},{}],10:[function(require,module,exports){
function BrotliInput(buffer) {
this.buffer = buffer;
this.pos = 0;
}
BrotliInput.prototype.read = function(buf, i, count) {
if (this.pos + count > this.buffer.length) {
count = this.buffer.length - this.pos;
}
for (var p = 0; p < count; p++)
buf[i + p] = this.buffer[this.pos + p];
this.pos += count;
return count;
}
exports.BrotliInput = BrotliInput;
function BrotliOutput(buf) {
this.buffer = buf;
this.pos = 0;
}
BrotliOutput.prototype.write = function(buf, count) {
if (this.pos + count > this.buffer.length)
throw new Error('Output buffer is not large enough');
this.buffer.set(buf.subarray(0, count), this.pos);
this.pos += count;
return count;
};
exports.BrotliOutput = BrotliOutput;
},{}],11:[function(require,module,exports){
/* Copyright 2013 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Transformations on dictionary words.
*/
var BrotliDictionary = require('./dictionary');
var kIdentity = 0;
var kOmitLast1 = 1;
var kOmitLast2 = 2;
var kOmitLast3 = 3;
var kOmitLast4 = 4;
var kOmitLast5 = 5;
var kOmitLast6 = 6;
var kOmitLast7 = 7;
var kOmitLast8 = 8;
var kOmitLast9 = 9;
var kUppercaseFirst = 10;
var kUppercaseAll = 11;
var kOmitFirst1 = 12;
var kOmitFirst2 = 13;
var kOmitFirst3 = 14;
var kOmitFirst4 = 15;
var kOmitFirst5 = 16;
var kOmitFirst6 = 17;
var kOmitFirst7 = 18;
var kOmitFirst8 = 19;
var kOmitFirst9 = 20;
function Transform(prefix, transform, suffix) {
this.prefix = new Uint8Array(prefix.length);
this.transform = transform;
this.suffix = new Uint8Array(suffix.length);
for (var i = 0; i < prefix.length; i++)
this.prefix[i] = prefix.charCodeAt(i);
for (var i = 0; i < suffix.length; i++)
this.suffix[i] = suffix.charCodeAt(i);
}
var kTransforms = [
new Transform( "", kIdentity, "" ),
new Transform( "", kIdentity, " " ),
new Transform( " ", kIdentity, " " ),
new Transform( "", kOmitFirst1, "" ),
new Transform( "", kUppercaseFirst, " " ),
new Transform( "", kIdentity, " the " ),
new Transform( " ", kIdentity, "" ),
new Transform( "s ", kIdentity, " " ),
new Transform( "", kIdentity, " of " ),
new Transform( "", kUppercaseFirst, "" ),
new Transform( "", kIdentity, " and " ),
new Transform( "", kOmitFirst2, "" ),
new Transform( "", kOmitLast1, "" ),
new Transform( ", ", kIdentity, " " ),
new Transform( "", kIdentity, ", " ),
new Transform( " ", kUppercaseFirst, " " ),
new Transform( "", kIdentity, " in " ),
new Transform( "", kIdentity, " to " ),
new Transform( "e ", kIdentity, " " ),
new Transform( "", kIdentity, "\"" ),
new Transform( "", kIdentity, "." ),
new Transform( "", kIdentity, "\">" ),
new Transform( "", kIdentity, "\n" ),
new Transform( "", kOmitLast3, "" ),
new Transform( "", kIdentity, "]" ),
new Transform( "", kIdentity, " for " ),
new Transform( "", kOmitFirst3, "" ),
new Transform( "", kOmitLast2, "" ),
new Transform( "", kIdentity, " a " ),
new Transform( "", kIdentity, " that " ),
new Transform( " ", kUppercaseFirst, "" ),
new Transform( "", kIdentity, ". " ),
new Transform( ".", kIdentity, "" ),
new Transform( " ", kIdentity, ", " ),
new Transform( "", kOmitFirst4, "" ),
new Transform( "", kIdentity, " with " ),
new Transform( "", kIdentity, "'" ),
new Transform( "", kIdentity, " from " ),
new Transform( "", kIdentity, " by " ),
new Transform( "", kOmitFirst5, "" ),
new Transform( "", kOmitFirst6, "" ),
new Transform( " the ", kIdentity, "" ),
new Transform( "", kOmitLast4, "" ),
new Transform( "", kIdentity, ". The " ),
new Transform( "", kUppercaseAll, "" ),
new Transform( "", kIdentity, " on " ),
new Transform( "", kIdentity, " as " ),
new Transform( "", kIdentity, " is " ),
new Transform( "", kOmitLast7, "" ),
new Transform( "", kOmitLast1, "ing " ),
new Transform( "", kIdentity, "\n\t" ),
new Transform( "", kIdentity, ":" ),
new Transform( " ", kIdentity, ". " ),
new Transform( "", kIdentity, "ed " ),
new Transform( "", kOmitFirst9, "" ),
new Transform( "", kOmitFirst7, "" ),
new Transform( "", kOmitLast6, "" ),
new Transform( "", kIdentity, "(" ),
new Transform( "", kUppercaseFirst, ", " ),
new Transform( "", kOmitLast8, "" ),
new Transform( "", kIdentity, " at " ),
new Transform( "", kIdentity, "ly " ),
new Transform( " the ", kIdentity, " of " ),
new Transform( "", kOmitLast5, "" ),
new Transform( "", kOmitLast9, "" ),
new Transform( " ", kUppercaseFirst, ", " ),
new Transform( "", kUppercaseFirst, "\"" ),
new Transform( ".", kIdentity, "(" ),
new Transform( "", kUppercaseAll, " " ),
new Transform( "", kUppercaseFirst, "\">" ),
new Transform( "", kIdentity, "=\"" ),
new Transform( " ", kIdentity, "." ),
new Transform( ".com/", kIdentity, "" ),
new Transform( " the ", kIdentity, " of the " ),
new Transform( "", kUppercaseFirst, "'" ),
new Transform( "", kIdentity, ". This " ),
new Transform( "", kIdentity, "," ),
new Transform( ".", kIdentity, " " ),
new Transform( "", kUppercaseFirst, "(" ),
new Transform( "", kUppercaseFirst, "." ),
new Transform( "", kIdentity, " not " ),
new Transform( " ", kIdentity, "=\"" ),
new Transform( "", kIdentity, "er " ),
new Transform( " ", kUppercaseAll, " " ),
new Transform( "", kIdentity, "al " ),
new Transform( " ", kUppercaseAll, "" ),
new Transform( "", kIdentity, "='" ),
new Transform( "", kUppercaseAll, "\"" ),
new Transform( "", kUppercaseFirst, ". " ),
new Transform( " ", kIdentity, "(" ),
new Transform( "", kIdentity, "ful " ),
new Transform( " ", kUppercaseFirst, ". " ),
new Transform( "", kIdentity, "ive " ),
new Transform( "", kIdentity, "less " ),
new Transform( "", kUppercaseAll, "'" ),
new Transform( "", kIdentity, "est " ),
new Transform( " ", kUppercaseFirst, "." ),
new Transform( "", kUppercaseAll, "\">" ),
new Transform( " ", kIdentity, "='" ),
new Transform( "", kUppercaseFirst, "," ),
new Transform( "", kIdentity, "ize " ),
new Transform( "", kUppercaseAll, "." ),
new Transform( "\xc2\xa0", kIdentity, "" ),
new Transform( " ", kIdentity, "," ),
new Transform( "", kUppercaseFirst, "=\"" ),
new Transform( "", kUppercaseAll, "=\"" ),
new Transform( "", kIdentity, "ous " ),
new Transform( "", kUppercaseAll, ", " ),
new Transform( "", kUppercaseFirst, "='" ),
new Transform( " ", kUppercaseFirst, "," ),
new Transform( " ", kUppercaseAll, "=\"" ),
new Transform( " ", kUppercaseAll, ", " ),
new Transform( "", kUppercaseAll, "," ),
new Transform( "", kUppercaseAll, "(" ),
new Transform( "", kUppercaseAll, ". " ),
new Transform( " ", kUppercaseAll, "." ),
new Transform( "", kUppercaseAll, "='" ),
new Transform( " ", kUppercaseAll, ". " ),
new Transform( " ", kUppercaseFirst, "=\"" ),
new Transform( " ", kUppercaseAll, "='" ),
new Transform( " ", kUppercaseFirst, "='" )
];
exports.kTransforms = kTransforms;
exports.kNumTransforms = kTransforms.length;
function ToUpperCase(p, i) {
if (p[i] < 0xc0) {
if (p[i] >= 97 && p[i] <= 122) {
p[i] ^= 32;
}
return 1;
}
/* An overly simplified uppercasing model for utf-8. */
if (p[i] < 0xe0) {
p[i + 1] ^= 32;
return 2;
}
/* An arbitrary transform for three byte characters. */
p[i + 2] ^= 5;
return 3;
}
exports.transformDictionaryWord = function(dst, idx, word, len, transform) {
var prefix = kTransforms[transform].prefix;
var suffix = kTransforms[transform].suffix;
var t = kTransforms[transform].transform;
var skip = t < kOmitFirst1 ? 0 : t - (kOmitFirst1 - 1);
var i = 0;
var start_idx = idx;
var uppercase;
if (skip > len) {
skip = len;
}
var prefix_pos = 0;
while (prefix_pos < prefix.length) {
dst[idx++] = prefix[prefix_pos++];
}
word += skip;
len -= skip;
if (t <= kOmitLast9) {
len -= t;
}
for (i = 0; i < len; i++) {
dst[idx++] = BrotliDictionary.dictionary[word + i];
}
uppercase = idx - len;
if (t === kUppercaseFirst) {
ToUpperCase(dst, uppercase);
} else if (t === kUppercaseAll) {
while (len > 0) {
var step = ToUpperCase(dst, uppercase);
uppercase += step;
len -= step;
}
}
var suffix_pos = 0;
while (suffix_pos < suffix.length) {
dst[idx++] = suffix[suffix_pos++];
}
return idx - start_idx;
}
},{"./dictionary":6}],12:[function(require,module,exports){
module.exports = require('./dec/decode').BrotliDecompressBuffer;
},{"./dec/decode":3}]},{},[12])(12)
});
/* eslint-enable */
/***/ }),
/***/ 9681:
/***/ ((module) => {
var characterMap = {
"À": "A",
"Á": "A",
"Â": "A",
"Ã": "A",
"Ä": "A",
"Å": "A",
"Ấ": "A",
"Ắ": "A",
"Ẳ": "A",
"Ẵ": "A",
"Ặ": "A",
"Æ": "AE",
"Ầ": "A",
"Ằ": "A",
"Ȃ": "A",
"Ả": "A",
"Ạ": "A",
"Ẩ": "A",
"Ẫ": "A",
"Ậ": "A",
"Ç": "C",
"Ḉ": "C",
"È": "E",
"É": "E",
"Ê": "E",
"Ë": "E",
"Ế": "E",
"Ḗ": "E",
"Ề": "E",
"Ḕ": "E",
"Ḝ": "E",
"Ȇ": "E",
"Ẻ": "E",
"Ẽ": "E",
"Ẹ": "E",
"Ể": "E",
"Ễ": "E",
"Ệ": "E",
"Ì": "I",
"Í": "I",
"Î": "I",
"Ï": "I",
"Ḯ": "I",
"Ȋ": "I",
"Ỉ": "I",
"Ị": "I",
"Ð": "D",
"Ñ": "N",
"Ò": "O",
"Ó": "O",
"Ô": "O",
"Õ": "O",
"Ö": "O",
"Ø": "O",
"Ố": "O",
"Ṍ": "O",
"Ṓ": "O",
"Ȏ": "O",
"Ỏ": "O",
"Ọ": "O",
"Ổ": "O",
"Ỗ": "O",
"Ộ": "O",
"Ờ": "O",
"Ở": "O",
"Ỡ": "O",
"Ớ": "O",
"Ợ": "O",
"Ù": "U",
"Ú": "U",
"Û": "U",
"Ü": "U",
"Ủ": "U",
"Ụ": "U",
"Ử": "U",
"Ữ": "U",
"Ự": "U",
"Ý": "Y",
"à": "a",
"á": "a",
"â": "a",
"ã": "a",
"ä": "a",
"å": "a",
"ấ": "a",
"ắ": "a",
"ẳ": "a",
"ẵ": "a",
"ặ": "a",
"æ": "ae",
"ầ": "a",
"ằ": "a",
"ȃ": "a",
"ả": "a",
"ạ": "a",
"ẩ": "a",
"ẫ": "a",
"ậ": "a",
"ç": "c",
"ḉ": "c",
"è": "e",
"é": "e",
"ê": "e",
"ë": "e",
"ế": "e",
"ḗ": "e",
"ề": "e",
"ḕ": "e",
"ḝ": "e",
"ȇ": "e",
"ẻ": "e",
"ẽ": "e",
"ẹ": "e",
"ể": "e",
"ễ": "e",
"ệ": "e",
"ì": "i",
"í": "i",
"î": "i",
"ï": "i",
"ḯ": "i",
"ȋ": "i",
"ỉ": "i",
"ị": "i",
"ð": "d",
"ñ": "n",
"ò": "o",
"ó": "o",
"ô": "o",
"õ": "o",
"ö": "o",
"ø": "o",
"ố": "o",
"ṍ": "o",
"ṓ": "o",
"ȏ": "o",
"ỏ": "o",
"ọ": "o",
"ổ": "o",
"ỗ": "o",
"ộ": "o",
"ờ": "o",
"ở": "o",
"ỡ": "o",
"ớ": "o",
"ợ": "o",
"ù": "u",
"ú": "u",
"û": "u",
"ü": "u",
"ủ": "u",
"ụ": "u",
"ử": "u",
"ữ": "u",
"ự": "u",
"ý": "y",
"ÿ": "y",
"Ā": "A",
"ā": "a",
"Ă": "A",
"ă": "a",
"Ą": "A",
"ą": "a",
"Ć": "C",
"ć": "c",
"Ĉ": "C",
"ĉ": "c",
"Ċ": "C",
"ċ": "c",
"Č": "C",
"č": "c",
"C̆": "C",
"c̆": "c",
"Ď": "D",
"ď": "d",
"Đ": "D",
"đ": "d",
"Ē": "E",
"ē": "e",
"Ĕ": "E",
"ĕ": "e",
"Ė": "E",
"ė": "e",
"Ę": "E",
"ę": "e",
"Ě": "E",
"ě": "e",
"Ĝ": "G",
"Ǵ": "G",
"ĝ": "g",
"ǵ": "g",
"Ğ": "G",
"ğ": "g",
"Ġ": "G",
"ġ": "g",
"Ģ": "G",
"ģ": "g",
"Ĥ": "H",
"ĥ": "h",
"Ħ": "H",
"ħ": "h",
"Ḫ": "H",
"ḫ": "h",
"Ĩ": "I",
"ĩ": "i",
"Ī": "I",
"ī": "i",
"Ĭ": "I",
"ĭ": "i",
"Į": "I",
"į": "i",
"İ": "I",
"ı": "i",
"IJ": "IJ",
"ij": "ij",
"Ĵ": "J",
"ĵ": "j",
"Ķ": "K",
"ķ": "k",
"Ḱ": "K",
"ḱ": "k",
"K̆": "K",
"k̆": "k",
"Ĺ": "L",
"ĺ": "l",
"Ļ": "L",
"ļ": "l",
"Ľ": "L",
"ľ": "l",
"Ŀ": "L",
"ŀ": "l",
"Ł": "l",
"ł": "l",
"Ḿ": "M",
"ḿ": "m",
"M̆": "M",
"m̆": "m",
"Ń": "N",
"ń": "n",
"Ņ": "N",
"ņ": "n",
"Ň": "N",
"ň": "n",
"ʼn": "n",
"N̆": "N",
"n̆": "n",
"Ō": "O",
"ō": "o",
"Ŏ": "O",
"ŏ": "o",
"Ő": "O",
"ő": "o",
"Œ": "OE",
"œ": "oe",
"P̆": "P",
"p̆": "p",
"Ŕ": "R",
"ŕ": "r",
"Ŗ": "R",
"ŗ": "r",
"Ř": "R",
"ř": "r",
"R̆": "R",
"r̆": "r",
"Ȓ": "R",
"ȓ": "r",
"Ś": "S",
"ś": "s",
"Ŝ": "S",
"ŝ": "s",
"Ş": "S",
"Ș": "S",
"ș": "s",
"ş": "s",
"Š": "S",
"š": "s",
"Ţ": "T",
"ţ": "t",
"ț": "t",
"Ț": "T",
"Ť": "T",
"ť": "t",
"Ŧ": "T",
"ŧ": "t",
"T̆": "T",
"t̆": "t",
"Ũ": "U",
"ũ": "u",
"Ū": "U",
"ū": "u",
"Ŭ": "U",
"ŭ": "u",
"Ů": "U",
"ů": "u",
"Ű": "U",
"ű": "u",
"Ų": "U",
"ų": "u",
"Ȗ": "U",
"ȗ": "u",
"V̆": "V",
"v̆": "v",
"Ŵ": "W",
"ŵ": "w",
"Ẃ": "W",
"ẃ": "w",
"X̆": "X",
"x̆": "x",
"Ŷ": "Y",
"ŷ": "y",
"Ÿ": "Y",
"Y̆": "Y",
"y̆": "y",
"Ź": "Z",
"ź": "z",
"Ż": "Z",
"ż": "z",
"Ž": "Z",
"ž": "z",
"ſ": "s",
"ƒ": "f",
"Ơ": "O",
"ơ": "o",
"Ư": "U",
"ư": "u",
"Ǎ": "A",
"ǎ": "a",
"Ǐ": "I",
"ǐ": "i",
"Ǒ": "O",
"ǒ": "o",
"Ǔ": "U",
"ǔ": "u",
"Ǖ": "U",
"ǖ": "u",
"Ǘ": "U",
"ǘ": "u",
"Ǚ": "U",
"ǚ": "u",
"Ǜ": "U",
"ǜ": "u",
"Ứ": "U",
"ứ": "u",
"Ṹ": "U",
"ṹ": "u",
"Ǻ": "A",
"ǻ": "a",
"Ǽ": "AE",
"ǽ": "ae",
"Ǿ": "O",
"ǿ": "o",
"Þ": "TH",
"þ": "th",
"Ṕ": "P",
"ṕ": "p",
"Ṥ": "S",
"ṥ": "s",
"X́": "X",
"x́": "x",
"Ѓ": "Г",
"ѓ": "г",
"Ќ": "К",
"ќ": "к",
"A̋": "A",
"a̋": "a",
"E̋": "E",
"e̋": "e",
"I̋": "I",
"i̋": "i",
"Ǹ": "N",
"ǹ": "n",
"Ồ": "O",
"ồ": "o",
"Ṑ": "O",
"ṑ": "o",
"Ừ": "U",
"ừ": "u",
"Ẁ": "W",
"ẁ": "w",
"Ỳ": "Y",
"ỳ": "y",
"Ȁ": "A",
"ȁ": "a",
"Ȅ": "E",
"ȅ": "e",
"Ȉ": "I",
"ȉ": "i",
"Ȍ": "O",
"ȍ": "o",
"Ȑ": "R",
"ȑ": "r",
"Ȕ": "U",
"ȕ": "u",
"B̌": "B",
"b̌": "b",
"Č̣": "C",
"č̣": "c",
"Ê̌": "E",
"ê̌": "e",
"F̌": "F",
"f̌": "f",
"Ǧ": "G",
"ǧ": "g",
"Ȟ": "H",
"ȟ": "h",
"J̌": "J",
"ǰ": "j",
"Ǩ": "K",
"ǩ": "k",
"M̌": "M",
"m̌": "m",
"P̌": "P",
"p̌": "p",
"Q̌": "Q",
"q̌": "q",
"Ř̩": "R",
"ř̩": "r",
"Ṧ": "S",
"ṧ": "s",
"V̌": "V",
"v̌": "v",
"W̌": "W",
"w̌": "w",
"X̌": "X",
"x̌": "x",
"Y̌": "Y",
"y̌": "y",
"A̧": "A",
"a̧": "a",
"B̧": "B",
"b̧": "b",
"Ḑ": "D",
"ḑ": "d",
"Ȩ": "E",
"ȩ": "e",
"Ɛ̧": "E",
"ɛ̧": "e",
"Ḩ": "H",
"ḩ": "h",
"I̧": "I",
"i̧": "i",
"Ɨ̧": "I",
"ɨ̧": "i",
"M̧": "M",
"m̧": "m",
"O̧": "O",
"o̧": "o",
"Q̧": "Q",
"q̧": "q",
"U̧": "U",
"u̧": "u",
"X̧": "X",
"x̧": "x",
"Z̧": "Z",
"z̧": "z",
"й":"и",
"Й":"И",
"ё":"е",
"Ё":"Е",
};
var chars = Object.keys(characterMap).join('|');
var allAccents = new RegExp(chars, 'g');
var firstAccent = new RegExp(chars, '');
function matcher(match) {
return characterMap[match];
}
var removeAccents = function(string) {
return string.replace(allAccents, matcher);
};
var hasAccents = function(string) {
return !!string.match(firstAccent);
};
module.exports = removeAccents;
module.exports.has = hasAccents;
module.exports.remove = removeAccents;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/create fake namespace object */
/******/ (() => {
/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
/******/ var leafPrototypes;
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 16: return value when it's Promise-like
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = this(value);
/******/ if(mode & 8) return value;
/******/ if(typeof value === 'object' && value) {
/******/ if((mode & 4) && value.__esModule) return value;
/******/ if((mode & 16) && typeof value.then === 'function') return value;
/******/ }
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ var def = {};
/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
/******/ }
/******/ def['default'] = () => (value);
/******/ __webpack_require__.d(ns, def);
/******/ return ns;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
(() => {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
PluginMoreMenuItem: () => (/* reexport */ PluginMoreMenuItem),
PluginSidebar: () => (/* reexport */ PluginSidebar),
PluginSidebarMoreMenuItem: () => (/* reexport */ PluginSidebarMoreMenuItem),
PluginTemplateSettingPanel: () => (/* reexport */ plugin_template_setting_panel_default),
initializeEditor: () => (/* binding */ initializeEditor),
initializePostsDashboard: () => (/* reexport */ initializePostsDashboard),
reinitializeEditor: () => (/* binding */ reinitializeEditor),
store: () => (/* reexport */ store)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-site/build-module/store/actions.js
var actions_namespaceObject = {};
__webpack_require__.r(actions_namespaceObject);
__webpack_require__.d(actions_namespaceObject, {
__experimentalSetPreviewDeviceType: () => (__experimentalSetPreviewDeviceType),
addTemplate: () => (addTemplate),
closeGeneralSidebar: () => (closeGeneralSidebar),
openGeneralSidebar: () => (openGeneralSidebar),
openNavigationPanelToMenu: () => (openNavigationPanelToMenu),
removeTemplate: () => (removeTemplate),
revertTemplate: () => (revertTemplate),
setEditedEntity: () => (setEditedEntity),
setEditedPostContext: () => (setEditedPostContext),
setHasPageContentFocus: () => (setHasPageContentFocus),
setHomeTemplateId: () => (setHomeTemplateId),
setIsInserterOpened: () => (setIsInserterOpened),
setIsListViewOpened: () => (setIsListViewOpened),
setIsNavigationPanelOpened: () => (setIsNavigationPanelOpened),
setIsSaveViewOpened: () => (setIsSaveViewOpened),
setNavigationMenu: () => (setNavigationMenu),
setNavigationPanelActiveMenu: () => (setNavigationPanelActiveMenu),
setPage: () => (setPage),
setTemplate: () => (setTemplate),
setTemplatePart: () => (setTemplatePart),
switchEditorMode: () => (switchEditorMode),
toggleDistractionFree: () => (toggleDistractionFree),
toggleFeature: () => (toggleFeature),
updateSettings: () => (updateSettings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-site/build-module/store/private-actions.js
var private_actions_namespaceObject = {};
__webpack_require__.r(private_actions_namespaceObject);
__webpack_require__.d(private_actions_namespaceObject, {
registerRoute: () => (registerRoute),
setEditorCanvasContainerView: () => (setEditorCanvasContainerView),
unregisterRoute: () => (unregisterRoute)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-site/build-module/store/selectors.js
var selectors_namespaceObject = {};
__webpack_require__.r(selectors_namespaceObject);
__webpack_require__.d(selectors_namespaceObject, {
__experimentalGetInsertionPoint: () => (__experimentalGetInsertionPoint),
__experimentalGetPreviewDeviceType: () => (__experimentalGetPreviewDeviceType),
getCanUserCreateMedia: () => (getCanUserCreateMedia),
getCurrentTemplateNavigationPanelSubMenu: () => (getCurrentTemplateNavigationPanelSubMenu),
getCurrentTemplateTemplateParts: () => (getCurrentTemplateTemplateParts),
getEditedPostContext: () => (getEditedPostContext),
getEditedPostId: () => (getEditedPostId),
getEditedPostType: () => (getEditedPostType),
getEditorMode: () => (getEditorMode),
getHomeTemplateId: () => (getHomeTemplateId),
getNavigationPanelActiveMenu: () => (getNavigationPanelActiveMenu),
getPage: () => (getPage),
getReusableBlocks: () => (getReusableBlocks),
getSettings: () => (getSettings),
hasPageContentFocus: () => (hasPageContentFocus),
isFeatureActive: () => (isFeatureActive),
isInserterOpened: () => (isInserterOpened),
isListViewOpened: () => (isListViewOpened),
isNavigationOpened: () => (isNavigationOpened),
isPage: () => (isPage),
isSaveViewOpened: () => (isSaveViewOpened)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-site/build-module/store/private-selectors.js
var private_selectors_namespaceObject = {};
__webpack_require__.r(private_selectors_namespaceObject);
__webpack_require__.d(private_selectors_namespaceObject, {
getEditorCanvasContainerView: () => (getEditorCanvasContainerView),
getRoutes: () => (getRoutes)
});
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// external ["wp","blocks"]
const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
;// external ["wp","blockLibrary"]
const external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"];
// EXTERNAL MODULE: external ["wp","data"]
var external_wp_data_ = __webpack_require__(7143);
;// external ["wp","deprecated"]
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
// EXTERNAL MODULE: external ["wp","element"]
var external_wp_element_ = __webpack_require__(6087);
;// external ["wp","editor"]
const external_wp_editor_namespaceObject = window["wp"]["editor"];
// EXTERNAL MODULE: external ["wp","preferences"]
var external_wp_preferences_ = __webpack_require__(1233);
;// external ["wp","widgets"]
const external_wp_widgets_namespaceObject = window["wp"]["widgets"];
;// external ["wp","hooks"]
const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
;// external ["wp","compose"]
const external_wp_compose_namespaceObject = window["wp"]["compose"];
;// external ["wp","blockEditor"]
const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
;// external ["wp","components"]
const external_wp_components_namespaceObject = window["wp"]["components"];
;// external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// external ["wp","notices"]
const external_wp_notices_namespaceObject = window["wp"]["notices"];
;// external ["wp","coreData"]
const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
;// ./node_modules/colord/index.mjs
var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,colord_p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||colord_p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},colord_j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof colord_j?r:new colord_j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(colord_j,y),S.push(r))})},E=function(){return new colord_j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};
;// ./node_modules/colord/plugins/a11y.mjs
var a11y_o=function(o){var t=o/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},a11y_t=function(t){return.2126*a11y_o(t.r)+.7152*a11y_o(t.g)+.0722*a11y_o(t.b)};/* harmony default export */ function a11y(o){o.prototype.luminance=function(){return o=a11y_t(this.rgba),void 0===(r=2)&&(r=0),void 0===n&&(n=Math.pow(10,r)),Math.round(n*o)/n+0;var o,r,n},o.prototype.contrast=function(r){void 0===r&&(r="#FFF");var n,a,i,e,v,u,d,c=r instanceof o?r:new o(r);return e=this.rgba,v=c.toRgb(),u=a11y_t(e),d=a11y_t(v),n=u>d?(u+.05)/(d+.05):(d+.05)/(u+.05),void 0===(a=2)&&(a=0),void 0===i&&(i=Math.pow(10,a)),Math.floor(i*n)/i+0},o.prototype.isReadable=function(o,t){return void 0===o&&(o="#FFF"),void 0===t&&(t={}),this.contrast(o)>=(e=void 0===(i=(r=t).size)?"normal":i,"AAA"===(a=void 0===(n=r.level)?"AA":n)&&"normal"===e?7:"AA"===a&&"large"===e?3:4.5);var r,n,a,i,e}}
;// external ["wp","privateApis"]
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// ./node_modules/@wordpress/edit-site/build-module/lock-unlock.js
const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
"@wordpress/edit-site"
);
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/hooks.js
const { useGlobalSetting, useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
k([a11y]);
function useColorRandomizer(name) {
const [themeColors, setThemeColors] = useGlobalSetting(
"color.palette.theme",
name
);
function randomizeColors() {
const randomRotationValue = Math.floor(Math.random() * 225);
const newColors = themeColors.map((colorObject) => {
const { color } = colorObject;
const newColor = w(color).rotate(randomRotationValue).toHex();
return {
...colorObject,
color: newColor
};
});
setThemeColors(newColors);
}
return window.__experimentalEnableColorRandomizer ? [randomizeColors] : [];
}
function useStylesPreviewColors() {
const [textColor = "black"] = useGlobalStyle("color.text");
const [backgroundColor = "white"] = useGlobalStyle("color.background");
const [headingColor = textColor] = useGlobalStyle(
"elements.h1.color.text"
);
const [linkColor = headingColor] = useGlobalStyle(
"elements.link.color.text"
);
const [buttonBackgroundColor = linkColor] = useGlobalStyle(
"elements.button.color.background"
);
const [coreColors] = useGlobalSetting("color.palette.core");
const [themeColors] = useGlobalSetting("color.palette.theme");
const [customColors] = useGlobalSetting("color.palette.custom");
const paletteColors = (themeColors ?? []).concat(customColors ?? []).concat(coreColors ?? []);
const textColorObject = paletteColors.filter(
({ color }) => color === textColor
);
const buttonBackgroundColorObject = paletteColors.filter(
({ color }) => color === buttonBackgroundColor
);
const highlightedColors = textColorObject.concat(buttonBackgroundColorObject).concat(paletteColors).filter(
// we exclude these background color because it is already visible in the preview.
({ color }) => color !== backgroundColor
).slice(0, 2);
return {
paletteColors,
highlightedColors
};
}
function useSupportedStyles(name, element) {
const { supportedPanels } = (0,external_wp_data_.useSelect)(
(select) => {
return {
supportedPanels: unlock(
select(external_wp_blocks_namespaceObject.store)
).getSupportedStyles(name, element)
};
},
[name, element]
);
return supportedPanels;
}
;// ./node_modules/@wordpress/edit-site/build-module/utils/set-nested-value.js
function setNestedValue(object, path, value) {
if (!object || typeof object !== "object") {
return object;
}
path.reduce((acc, key, idx) => {
if (acc[key] === void 0) {
if (Number.isInteger(path[idx + 1])) {
acc[key] = [];
} else {
acc[key] = {};
}
}
if (idx === path.length - 1) {
acc[key] = value;
}
return acc[key];
}, object);
return object;
}
;// ./node_modules/@wordpress/edit-site/build-module/hooks/push-changes-to-global-styles/index.js
const { cleanEmptyObject, GlobalStylesContext } = unlock(
external_wp_blockEditor_namespaceObject.privateApis
);
const STYLE_PROPERTY = {
...external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY,
blockGap: { value: ["spacing", "blockGap"] }
};
const STYLE_PATH_TO_CSS_VAR_INFIX = {
"border.color": "color",
"color.background": "color",
"color.text": "color",
"elements.link.color.text": "color",
"elements.link.:hover.color.text": "color",
"elements.link.typography.fontFamily": "font-family",
"elements.link.typography.fontSize": "font-size",
"elements.button.color.text": "color",
"elements.button.color.background": "color",
"elements.button.typography.fontFamily": "font-family",
"elements.button.typography.fontSize": "font-size",
"elements.caption.color.text": "color",
"elements.heading.color": "color",
"elements.heading.color.background": "color",
"elements.heading.typography.fontFamily": "font-family",
"elements.heading.gradient": "gradient",
"elements.heading.color.gradient": "gradient",
"elements.h1.color": "color",
"elements.h1.color.background": "color",
"elements.h1.typography.fontFamily": "font-family",
"elements.h1.color.gradient": "gradient",
"elements.h2.color": "color",
"elements.h2.color.background": "color",
"elements.h2.typography.fontFamily": "font-family",
"elements.h2.color.gradient": "gradient",
"elements.h3.color": "color",
"elements.h3.color.background": "color",
"elements.h3.typography.fontFamily": "font-family",
"elements.h3.color.gradient": "gradient",
"elements.h4.color": "color",
"elements.h4.color.background": "color",
"elements.h4.typography.fontFamily": "font-family",
"elements.h4.color.gradient": "gradient",
"elements.h5.color": "color",
"elements.h5.color.background": "color",
"elements.h5.typography.fontFamily": "font-family",
"elements.h5.color.gradient": "gradient",
"elements.h6.color": "color",
"elements.h6.color.background": "color",
"elements.h6.typography.fontFamily": "font-family",
"elements.h6.color.gradient": "gradient",
"color.gradient": "gradient",
blockGap: "spacing",
"typography.fontSize": "font-size",
"typography.fontFamily": "font-family"
};
const STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {
"border.color": "borderColor",
"color.background": "backgroundColor",
"color.text": "textColor",
"color.gradient": "gradient",
"typography.fontSize": "fontSize",
"typography.fontFamily": "fontFamily"
};
const SUPPORTED_STYLES = ["border", "color", "spacing", "typography"];
const getValueFromObjectPath = (object, path) => {
let value = object;
path.forEach((fieldName) => {
value = value?.[fieldName];
});
return value;
};
const flatBorderProperties = ["borderColor", "borderWidth", "borderStyle"];
const sides = ["top", "right", "bottom", "left"];
function getBorderStyleChanges(border, presetColor, userStyle) {
if (!border && !presetColor) {
return [];
}
const changes = [
...getFallbackBorderStyleChange("top", border, userStyle),
...getFallbackBorderStyleChange("right", border, userStyle),
...getFallbackBorderStyleChange("bottom", border, userStyle),
...getFallbackBorderStyleChange("left", border, userStyle)
];
const { color: customColor, style, width } = border || {};
const hasColorOrWidth = presetColor || customColor || width;
if (hasColorOrWidth && !style) {
sides.forEach((side) => {
if (!userStyle?.[side]?.style) {
changes.push({
path: ["border", side, "style"],
value: "solid"
});
}
});
}
return changes;
}
function getFallbackBorderStyleChange(side, border, globalBorderStyle) {
if (!border?.[side] || globalBorderStyle?.[side]?.style) {
return [];
}
const { color, style, width } = border[side];
const hasColorOrWidth = color || width;
if (!hasColorOrWidth || style) {
return [];
}
return [{ path: ["border", side, "style"], value: "solid" }];
}
function useChangesToPush(name, attributes, userConfig) {
const supports = useSupportedStyles(name);
const blockUserConfig = userConfig?.styles?.blocks?.[name];
return (0,external_wp_element_.useMemo)(() => {
const changes = supports.flatMap((key) => {
if (!STYLE_PROPERTY[key]) {
return [];
}
const { value: path } = STYLE_PROPERTY[key];
const presetAttributeKey = path.join(".");
const presetAttributeValue = attributes[STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE[presetAttributeKey]];
const value = presetAttributeValue ? `var:preset|${STYLE_PATH_TO_CSS_VAR_INFIX[presetAttributeKey]}|${presetAttributeValue}` : getValueFromObjectPath(attributes.style, path);
if (key === "linkColor") {
const linkChanges = value ? [{ path, value }] : [];
const hoverPath = [
"elements",
"link",
":hover",
"color",
"text"
];
const hoverValue = getValueFromObjectPath(
attributes.style,
hoverPath
);
if (hoverValue) {
linkChanges.push({ path: hoverPath, value: hoverValue });
}
return linkChanges;
}
if (flatBorderProperties.includes(key) && value) {
const borderChanges = [{ path, value }];
sides.forEach((side) => {
const currentPath = [...path];
currentPath.splice(-1, 0, side);
borderChanges.push({ path: currentPath, value });
});
return borderChanges;
}
return value ? [{ path, value }] : [];
});
getBorderStyleChanges(
attributes.style?.border,
attributes.borderColor,
blockUserConfig?.border
).forEach((change) => changes.push(change));
return changes;
}, [supports, attributes, blockUserConfig]);
}
function PushChangesToGlobalStylesControl({
name,
attributes,
setAttributes
}) {
const { user: userConfig, setUserConfig } = (0,external_wp_element_.useContext)(GlobalStylesContext);
const changes = useChangesToPush(name, attributes, userConfig);
const { __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const { createSuccessNotice } = (0,external_wp_data_.useDispatch)(external_wp_notices_namespaceObject.store);
const pushChanges = (0,external_wp_element_.useCallback)(() => {
if (changes.length === 0) {
return;
}
if (changes.length > 0) {
const { style: blockStyles } = attributes;
const newBlockStyles = structuredClone(blockStyles);
const newUserConfig = structuredClone(userConfig);
for (const { path, value } of changes) {
setNestedValue(newBlockStyles, path, void 0);
setNestedValue(
newUserConfig,
["styles", "blocks", name, ...path],
value
);
}
const newBlockAttributes = {
borderColor: void 0,
backgroundColor: void 0,
textColor: void 0,
gradient: void 0,
fontSize: void 0,
fontFamily: void 0,
style: cleanEmptyObject(newBlockStyles)
};
__unstableMarkNextChangeAsNotPersistent();
setAttributes(newBlockAttributes);
setUserConfig(newUserConfig, { undoIgnore: true });
createSuccessNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Title of the block e.g. 'Heading'.
(0,external_wp_i18n_namespaceObject.__)("%s styles applied."),
(0,external_wp_blocks_namespaceObject.getBlockType)(name).title
),
{
type: "snackbar",
actions: [
{
label: (0,external_wp_i18n_namespaceObject.__)("Undo"),
onClick() {
__unstableMarkNextChangeAsNotPersistent();
setAttributes(attributes);
setUserConfig(userConfig, {
undoIgnore: true
});
}
}
]
}
);
}
}, [
__unstableMarkNextChangeAsNotPersistent,
attributes,
changes,
createSuccessNotice,
name,
setAttributes,
setUserConfig,
userConfig
]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.BaseControl,
{
__nextHasNoMarginBottom: true,
className: "edit-site-push-changes-to-global-styles-control",
help: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Title of the block e.g. 'Heading'.
(0,external_wp_i18n_namespaceObject.__)(
"Apply this block\u2019s typography, spacing, dimensions, and color styles to all %s blocks."
),
(0,external_wp_blocks_namespaceObject.getBlockType)(name).title
),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { children: (0,external_wp_i18n_namespaceObject.__)("Styles") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "secondary",
accessibleWhenDisabled: true,
disabled: changes.length === 0,
onClick: pushChanges,
children: (0,external_wp_i18n_namespaceObject.__)("Apply globally")
}
)
]
}
);
}
function PushChangesToGlobalStyles(props) {
const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)();
const isBlockBasedTheme = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme,
[]
);
const supportsStyles = SUPPORTED_STYLES.some(
(feature) => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(props.name, feature)
);
const isDisplayed = blockEditingMode === "default" && supportsStyles && isBlockBasedTheme;
if (!isDisplayed) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorAdvancedControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PushChangesToGlobalStylesControl, { ...props }) });
}
const withPushChangesToGlobalStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
(BlockEdit) => (props) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { ...props }, "edit"),
props.isSelected && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PushChangesToGlobalStyles, { ...props })
] })
);
(0,external_wp_hooks_namespaceObject.addFilter)(
"editor.BlockEdit",
"core/edit-site/push-changes-to-global-styles",
withPushChangesToGlobalStyles
);
;// ./node_modules/@wordpress/edit-site/build-module/hooks/index.js
;// ./node_modules/@wordpress/edit-site/build-module/store/reducer.js
function settings(state = {}, action) {
switch (action.type) {
case "UPDATE_SETTINGS":
return {
...state,
...action.settings
};
}
return state;
}
function editedPost(state = {}, action) {
switch (action.type) {
case "SET_EDITED_POST":
return {
postType: action.postType,
id: action.id,
context: action.context
};
case "SET_EDITED_POST_CONTEXT":
return {
...state,
context: action.context
};
}
return state;
}
function saveViewPanel(state = false, action) {
switch (action.type) {
case "SET_IS_SAVE_VIEW_OPENED":
return action.isOpen;
}
return state;
}
function editorCanvasContainerView(state = void 0, action) {
switch (action.type) {
case "SET_EDITOR_CANVAS_CONTAINER_VIEW":
return action.view;
}
return state;
}
function routes(state = [], action) {
switch (action.type) {
case "REGISTER_ROUTE":
return [...state, action.route];
case "UNREGISTER_ROUTE":
return state.filter((route) => route.name !== action.name);
}
return state;
}
var reducer_default = (0,external_wp_data_.combineReducers)({
settings,
editedPost,
saveViewPanel,
editorCanvasContainerView,
routes
});
;// external ["wp","patterns"]
const external_wp_patterns_namespaceObject = window["wp"]["patterns"];
;// ./node_modules/@wordpress/edit-site/build-module/utils/constants.js
const NAVIGATION_POST_TYPE = "wp_navigation";
const TEMPLATE_POST_TYPE = "wp_template";
const TEMPLATE_PART_POST_TYPE = "wp_template_part";
const TEMPLATE_ORIGINS = {
custom: "custom",
theme: "theme",
plugin: "plugin"
};
const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = "uncategorized";
const TEMPLATE_PART_ALL_AREAS_CATEGORY = "all-parts";
const {
PATTERN_TYPES,
PATTERN_DEFAULT_CATEGORY,
PATTERN_USER_CATEGORY,
EXCLUDED_PATTERN_SOURCES,
PATTERN_SYNC_TYPES
} = unlock(external_wp_patterns_namespaceObject.privateApis);
const FOCUSABLE_ENTITIES = [
TEMPLATE_PART_POST_TYPE,
NAVIGATION_POST_TYPE,
PATTERN_TYPES.user
];
const POST_TYPE_LABELS = {
[TEMPLATE_POST_TYPE]: (0,external_wp_i18n_namespaceObject.__)("Template"),
[TEMPLATE_PART_POST_TYPE]: (0,external_wp_i18n_namespaceObject.__)("Template part"),
[PATTERN_TYPES.user]: (0,external_wp_i18n_namespaceObject.__)("Pattern"),
[NAVIGATION_POST_TYPE]: (0,external_wp_i18n_namespaceObject.__)("Navigation")
};
const LAYOUT_GRID = "grid";
const LAYOUT_TABLE = "table";
const LAYOUT_LIST = "list";
const OPERATOR_IS = "is";
const OPERATOR_IS_NOT = "isNot";
const OPERATOR_IS_ANY = "isAny";
const OPERATOR_IS_NONE = "isNone";
;// ./node_modules/@wordpress/edit-site/build-module/store/actions.js
const { interfaceStore } = unlock(external_wp_editor_namespaceObject.privateApis);
function toggleFeature(featureName) {
return function({ registry }) {
external_wp_deprecated_default()(
"dispatch( 'core/edit-site' ).toggleFeature( featureName )",
{
since: "6.0",
alternative: "dispatch( 'core/preferences').toggle( 'core/edit-site', featureName )"
}
);
registry.dispatch(external_wp_preferences_.store).toggle("core/edit-site", featureName);
};
}
const __experimentalSetPreviewDeviceType = (deviceType) => ({ registry }) => {
external_wp_deprecated_default()(
"dispatch( 'core/edit-site' ).__experimentalSetPreviewDeviceType",
{
since: "6.5",
version: "6.7",
hint: "registry.dispatch( editorStore ).setDeviceType"
}
);
registry.dispatch(external_wp_editor_namespaceObject.store).setDeviceType(deviceType);
};
function setTemplate() {
external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setTemplate", {
since: "6.5",
version: "6.8",
hint: "The setTemplate is not needed anymore, the correct entity is resolved from the URL automatically."
});
return {
type: "NOTHING"
};
}
const addTemplate = (template) => async ({ dispatch, registry }) => {
external_wp_deprecated_default()("dispatch( 'core/edit-site' ).addTemplate", {
since: "6.5",
version: "6.8",
hint: "use saveEntityRecord directly"
});
const newTemplate = await registry.dispatch(external_wp_coreData_namespaceObject.store).saveEntityRecord("postType", TEMPLATE_POST_TYPE, template);
if (template.content) {
registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(
"postType",
TEMPLATE_POST_TYPE,
newTemplate.id,
{ blocks: (0,external_wp_blocks_namespaceObject.parse)(template.content) },
{ undoIgnore: true }
);
}
dispatch({
type: "SET_EDITED_POST",
postType: TEMPLATE_POST_TYPE,
id: newTemplate.id
});
};
const removeTemplate = (template) => ({ registry }) => {
return unlock(registry.dispatch(external_wp_editor_namespaceObject.store)).removeTemplates([
template
]);
};
function setTemplatePart(templatePartId) {
external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setTemplatePart", {
since: "6.8"
});
return {
type: "SET_EDITED_POST",
postType: TEMPLATE_PART_POST_TYPE,
id: templatePartId
};
}
function setNavigationMenu(navigationMenuId) {
external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setNavigationMenu", {
since: "6.8"
});
return {
type: "SET_EDITED_POST",
postType: NAVIGATION_POST_TYPE,
id: navigationMenuId
};
}
function setEditedEntity(postType, postId, context) {
return {
type: "SET_EDITED_POST",
postType,
id: postId,
context
};
}
function setHomeTemplateId() {
external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setHomeTemplateId", {
since: "6.2",
version: "6.4"
});
return {
type: "NOTHING"
};
}
function setEditedPostContext(context) {
external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setEditedPostContext", {
since: "6.8"
});
return {
type: "SET_EDITED_POST_CONTEXT",
context
};
}
function setPage() {
external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setPage", {
since: "6.5",
version: "6.8",
hint: "The setPage is not needed anymore, the correct entity is resolved from the URL automatically."
});
return { type: "NOTHING" };
}
function setNavigationPanelActiveMenu() {
external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu", {
since: "6.2",
version: "6.4"
});
return { type: "NOTHING" };
}
function openNavigationPanelToMenu() {
external_wp_deprecated_default()("dispatch( 'core/edit-site' ).openNavigationPanelToMenu", {
since: "6.2",
version: "6.4"
});
return { type: "NOTHING" };
}
function setIsNavigationPanelOpened() {
external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setIsNavigationPanelOpened", {
since: "6.2",
version: "6.4"
});
return { type: "NOTHING" };
}
const setIsInserterOpened = (value) => ({ registry }) => {
external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setIsInserterOpened", {
since: "6.5",
alternative: "dispatch( 'core/editor').setIsInserterOpened"
});
registry.dispatch(external_wp_editor_namespaceObject.store).setIsInserterOpened(value);
};
const setIsListViewOpened = (isOpen) => ({ registry }) => {
external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setIsListViewOpened", {
since: "6.5",
alternative: "dispatch( 'core/editor').setIsListViewOpened"
});
registry.dispatch(external_wp_editor_namespaceObject.store).setIsListViewOpened(isOpen);
};
function updateSettings(settings) {
return {
type: "UPDATE_SETTINGS",
settings
};
}
function setIsSaveViewOpened(isOpen) {
return {
type: "SET_IS_SAVE_VIEW_OPENED",
isOpen
};
}
const revertTemplate = (template, options) => ({ registry }) => {
return unlock(registry.dispatch(external_wp_editor_namespaceObject.store)).revertTemplate(
template,
options
);
};
const openGeneralSidebar = (name) => ({ registry }) => {
registry.dispatch(interfaceStore).enableComplementaryArea("core", name);
};
const closeGeneralSidebar = () => ({ registry }) => {
registry.dispatch(interfaceStore).disableComplementaryArea("core");
};
const switchEditorMode = (mode) => ({ registry }) => {
external_wp_deprecated_default()("dispatch( 'core/edit-site' ).switchEditorMode", {
since: "6.6",
alternative: "dispatch( 'core/editor').switchEditorMode"
});
registry.dispatch(external_wp_editor_namespaceObject.store).switchEditorMode(mode);
};
const setHasPageContentFocus = (hasPageContentFocus) => ({ dispatch, registry }) => {
external_wp_deprecated_default()(`dispatch( 'core/edit-site' ).setHasPageContentFocus`, {
since: "6.5"
});
if (hasPageContentFocus) {
registry.dispatch(external_wp_blockEditor_namespaceObject.store).clearSelectedBlock();
}
dispatch({
type: "SET_HAS_PAGE_CONTENT_FOCUS",
hasPageContentFocus
});
};
const toggleDistractionFree = () => ({ registry }) => {
external_wp_deprecated_default()("dispatch( 'core/edit-site' ).toggleDistractionFree", {
since: "6.6",
alternative: "dispatch( 'core/editor').toggleDistractionFree"
});
registry.dispatch(external_wp_editor_namespaceObject.store).toggleDistractionFree();
};
;// ./node_modules/@wordpress/edit-site/build-module/store/private-actions.js
const setEditorCanvasContainerView = (view) => ({ dispatch }) => {
dispatch({
type: "SET_EDITOR_CANVAS_CONTAINER_VIEW",
view
});
};
function registerRoute(route) {
return {
type: "REGISTER_ROUTE",
route
};
}
function unregisterRoute(name) {
return {
type: "UNREGISTER_ROUTE",
name
};
}
;// ./node_modules/@wordpress/edit-site/build-module/utils/get-filtered-template-parts.js
const EMPTY_ARRAY = [];
function getFilteredTemplatePartBlocks(blocks = EMPTY_ARRAY, templateParts) {
const templatePartsById = templateParts ? (
// Key template parts by their ID.
templateParts.reduce(
(newTemplateParts, part) => ({
...newTemplateParts,
[part.id]: part
}),
{}
)
) : {};
const result = [];
const stack = [...blocks];
while (stack.length) {
const { innerBlocks, ...block } = stack.shift();
stack.unshift(...innerBlocks);
if ((0,external_wp_blocks_namespaceObject.isTemplatePart)(block)) {
const {
attributes: { theme, slug }
} = block;
const templatePartId = `${theme}//${slug}`;
const templatePart = templatePartsById[templatePartId];
if (templatePart) {
result.push({
templatePart,
block
});
}
}
}
return result;
}
;// ./node_modules/@wordpress/edit-site/build-module/store/selectors.js
const isFeatureActive = (0,external_wp_data_.createRegistrySelector)(
(select) => (_, featureName) => {
external_wp_deprecated_default()(`select( 'core/edit-site' ).isFeatureActive`, {
since: "6.0",
alternative: `select( 'core/preferences' ).get`
});
return !!select(external_wp_preferences_.store).get(
"core/edit-site",
featureName
);
}
);
const __experimentalGetPreviewDeviceType = (0,external_wp_data_.createRegistrySelector)(
(select) => () => {
external_wp_deprecated_default()(
`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,
{
since: "6.5",
version: "6.7",
alternative: `select( 'core/editor' ).getDeviceType`
}
);
return select(external_wp_editor_namespaceObject.store).getDeviceType();
}
);
const getCanUserCreateMedia = (0,external_wp_data_.createRegistrySelector)(
(select) => () => {
external_wp_deprecated_default()(
`wp.data.select( 'core/edit-site' ).getCanUserCreateMedia()`,
{
since: "6.7",
alternative: `wp.data.select( 'core' ).canUser( 'create', { kind: 'postType', type: 'attachment' } )`
}
);
return select(external_wp_coreData_namespaceObject.store).canUser("create", "media");
}
);
const getReusableBlocks = (0,external_wp_data_.createRegistrySelector)((select) => () => {
external_wp_deprecated_default()(`select( 'core/edit-site' ).getReusableBlocks()`, {
since: "6.5",
version: "6.8",
alternative: `select( 'core/core' ).getEntityRecords( 'postType', 'wp_block' )`
});
const isWeb = external_wp_element_.Platform.OS === "web";
return isWeb ? select(external_wp_coreData_namespaceObject.store).getEntityRecords("postType", "wp_block", {
per_page: -1
}) : [];
});
function getSettings(state) {
return state.settings;
}
function getHomeTemplateId() {
external_wp_deprecated_default()("select( 'core/edit-site' ).getHomeTemplateId", {
since: "6.2",
version: "6.4"
});
}
function getEditedPostType(state) {
external_wp_deprecated_default()("select( 'core/edit-site' ).getEditedPostType", {
since: "6.8",
alternative: "select( 'core/editor' ).getCurrentPostType"
});
return state.editedPost.postType;
}
function getEditedPostId(state) {
external_wp_deprecated_default()("select( 'core/edit-site' ).getEditedPostId", {
since: "6.8",
alternative: "select( 'core/editor' ).getCurrentPostId"
});
return state.editedPost.id;
}
function getEditedPostContext(state) {
external_wp_deprecated_default()("select( 'core/edit-site' ).getEditedPostContext", {
since: "6.8"
});
return state.editedPost.context;
}
function getPage(state) {
external_wp_deprecated_default()("select( 'core/edit-site' ).getPage", {
since: "6.8"
});
return { context: state.editedPost.context };
}
const isInserterOpened = (0,external_wp_data_.createRegistrySelector)((select) => () => {
external_wp_deprecated_default()(`select( 'core/edit-site' ).isInserterOpened`, {
since: "6.5",
alternative: `select( 'core/editor' ).isInserterOpened`
});
return select(external_wp_editor_namespaceObject.store).isInserterOpened();
});
const __experimentalGetInsertionPoint = (0,external_wp_data_.createRegistrySelector)(
(select) => () => {
external_wp_deprecated_default()(
`select( 'core/edit-site' ).__experimentalGetInsertionPoint`,
{
since: "6.5",
version: "6.7"
}
);
return unlock(select(external_wp_editor_namespaceObject.store)).getInserter();
}
);
const isListViewOpened = (0,external_wp_data_.createRegistrySelector)((select) => () => {
external_wp_deprecated_default()(`select( 'core/edit-site' ).isListViewOpened`, {
since: "6.5",
alternative: `select( 'core/editor' ).isListViewOpened`
});
return select(external_wp_editor_namespaceObject.store).isListViewOpened();
});
function isSaveViewOpened(state) {
return state.saveViewPanel;
}
function getBlocksAndTemplateParts(select) {
const templateParts = select(external_wp_coreData_namespaceObject.store).getEntityRecords(
"postType",
TEMPLATE_PART_POST_TYPE,
{ per_page: -1 }
);
const { getBlocksByName, getBlocksByClientId } = select(external_wp_blockEditor_namespaceObject.store);
const clientIds = getBlocksByName("core/template-part");
const blocks = getBlocksByClientId(clientIds);
return [blocks, templateParts];
}
const getCurrentTemplateTemplateParts = (0,external_wp_data_.createRegistrySelector)(
(select) => (0,external_wp_data_.createSelector)(
() => {
external_wp_deprecated_default()(
`select( 'core/edit-site' ).getCurrentTemplateTemplateParts()`,
{
since: "6.7",
version: "6.9",
alternative: `select( 'core/block-editor' ).getBlocksByName( 'core/template-part' )`
}
);
return getFilteredTemplatePartBlocks(
...getBlocksAndTemplateParts(select)
);
},
() => getBlocksAndTemplateParts(select)
)
);
const getEditorMode = (0,external_wp_data_.createRegistrySelector)((select) => () => {
return select(external_wp_preferences_.store).get("core", "editorMode");
});
function getCurrentTemplateNavigationPanelSubMenu() {
external_wp_deprecated_default()(
"dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu",
{
since: "6.2",
version: "6.4"
}
);
}
function getNavigationPanelActiveMenu() {
external_wp_deprecated_default()("dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu", {
since: "6.2",
version: "6.4"
});
}
function isNavigationOpened() {
external_wp_deprecated_default()("dispatch( 'core/edit-site' ).isNavigationOpened", {
since: "6.2",
version: "6.4"
});
}
function isPage(state) {
external_wp_deprecated_default()("select( 'core/edit-site' ).isPage", {
since: "6.8",
alternative: "select( 'core/editor' ).getCurrentPostType"
});
return !!state.editedPost.context?.postId;
}
function hasPageContentFocus() {
external_wp_deprecated_default()(`select( 'core/edit-site' ).hasPageContentFocus`, {
since: "6.5"
});
return false;
}
;// ./node_modules/@wordpress/edit-site/build-module/store/private-selectors.js
function getEditorCanvasContainerView(state) {
return state.editorCanvasContainerView;
}
function getRoutes(state) {
return state.routes;
}
;// ./node_modules/@wordpress/edit-site/build-module/store/constants.js
const STORE_NAME = "core/edit-site";
;// ./node_modules/@wordpress/edit-site/build-module/store/index.js
const storeConfig = {
reducer: reducer_default,
actions: actions_namespaceObject,
selectors: selectors_namespaceObject
};
const store = (0,external_wp_data_.createReduxStore)(STORE_NAME, storeConfig);
(0,external_wp_data_.register)(store);
unlock(store).registerPrivateSelectors(private_selectors_namespaceObject);
unlock(store).registerPrivateActions(private_actions_namespaceObject);
;// external ["wp","router"]
const external_wp_router_namespaceObject = window["wp"]["router"];
;// ./node_modules/clsx/dist/clsx.mjs
function clsx_r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=clsx_r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=clsx_r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx);
;// ./node_modules/@wordpress/admin-ui/build-module/navigable-region/index.js
const NavigableRegion = (0,external_wp_element_.forwardRef)(
({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Tag,
{
ref,
className: dist_clsx("admin-ui-navigable-region", className),
"aria-label": ariaLabel,
role: "region",
tabIndex: "-1",
...props,
children
}
);
}
);
NavigableRegion.displayName = "NavigableRegion";
var navigable_region_default = NavigableRegion;
;// external ["wp","plugins"]
const external_wp_plugins_namespaceObject = window["wp"]["plugins"];
;// external ["wp","htmlEntities"]
const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
;// external ["wp","primitives"]
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
;// ./node_modules/@wordpress/icons/build-module/library/search.js
var search_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) });
;// external ["wp","commands"]
const external_wp_commands_namespaceObject = window["wp"]["commands"];
;// external ["wp","keycodes"]
const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
;// external ["wp","url"]
const external_wp_url_namespaceObject = window["wp"]["url"];
;// ./node_modules/@wordpress/icons/build-module/library/wordpress.js
var wordpress_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 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" }) });
;// ./node_modules/@wordpress/edit-site/build-module/components/site-icon/index.js
function SiteIcon({ className }) {
const { isRequestingSite, siteIconUrl } = (0,external_wp_data_.useSelect)((select) => {
const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store);
const siteData = getEntityRecord("root", "__unstableBase", void 0);
return {
isRequestingSite: !siteData,
siteIconUrl: siteData?.site_icon_url
};
}, []);
if (isRequestingSite && !siteIconUrl) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-site-icon__image" });
}
const icon = siteIconUrl ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
className: "edit-site-site-icon__image",
alt: (0,external_wp_i18n_namespaceObject.__)("Site Icon"),
src: siteIconUrl
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Icon,
{
className: "edit-site-site-icon__icon",
icon: wordpress_default,
size: 48
}
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx(className, "edit-site-site-icon"), children: icon });
}
var site_icon_default = SiteIcon;
;// external ["wp","dom"]
const external_wp_dom_namespaceObject = window["wp"]["dom"];
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar/index.js
const SidebarNavigationContext = (0,external_wp_element_.createContext)(() => {
});
SidebarNavigationContext.displayName = "SidebarNavigationContext";
function focusSidebarElement(el, direction, focusSelector) {
let elementToFocus;
if (direction === "back" && focusSelector) {
elementToFocus = el.querySelector(focusSelector);
}
if (direction !== null && !elementToFocus) {
const [firstTabbable] = external_wp_dom_namespaceObject.focus.tabbable.find(el);
elementToFocus = firstTabbable ?? el;
}
elementToFocus?.focus();
}
function createNavState() {
let state = {
direction: null,
focusSelector: null
};
return {
get() {
return state;
},
navigate(direction, focusSelector = null) {
state = {
direction,
focusSelector: direction === "forward" && focusSelector ? focusSelector : state.focusSelector
};
}
};
}
function SidebarContentWrapper({ children, shouldAnimate }) {
const navState = (0,external_wp_element_.useContext)(SidebarNavigationContext);
const wrapperRef = (0,external_wp_element_.useRef)();
const [navAnimation, setNavAnimation] = (0,external_wp_element_.useState)(null);
(0,external_wp_element_.useLayoutEffect)(() => {
const { direction, focusSelector } = navState.get();
focusSidebarElement(wrapperRef.current, direction, focusSelector);
setNavAnimation(direction);
}, [navState]);
const wrapperCls = dist_clsx(
"edit-site-sidebar__screen-wrapper",
/*
* Some panes do not have sub-panes and therefore
* should not animate when clicked on.
*/
shouldAnimate ? {
"slide-from-left": navAnimation === "back",
"slide-from-right": navAnimation === "forward"
} : {}
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: wrapperRef, className: wrapperCls, children });
}
function SidebarNavigationProvider({ children }) {
const [navState] = (0,external_wp_element_.useState)(createNavState);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationContext.Provider, { value: navState, children });
}
function SidebarContent({ routeKey, shouldAnimate, children }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-sidebar__content", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarContentWrapper,
{
shouldAnimate,
children
},
routeKey
) });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/site-hub/index.js
const { useLocation, useHistory } = unlock(external_wp_router_namespaceObject.privateApis);
const SiteHub = (0,external_wp_element_.memo)(
(0,external_wp_element_.forwardRef)(({ isTransparent }, ref) => {
const { dashboardLink, homeUrl, siteTitle } = (0,external_wp_data_.useSelect)((select) => {
const { getSettings } = unlock(select(store));
const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store);
const _site = getEntityRecord("root", "site");
return {
dashboardLink: getSettings().__experimentalDashboardLink,
homeUrl: getEntityRecord("root", "__unstableBase")?.home,
siteTitle: !_site?.title && !!_site?.url ? (0,external_wp_url_namespaceObject.filterURLForDisplay)(_site?.url) : _site?.title
};
}, []);
const { open: openCommandCenter } = (0,external_wp_data_.useDispatch)(external_wp_commands_namespaceObject.store);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-site-hub", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", spacing: "0", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx(
"edit-site-site-hub__view-mode-toggle-container",
{
"has-transparent-background": isTransparent
}
),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
ref,
href: dashboardLink,
label: (0,external_wp_i18n_namespaceObject.__)("Go to the Dashboard"),
className: "edit-site-layout__view-mode-toggle",
style: {
transform: "scale(0.5333) translateX(-4px)",
// Offset to position the icon 12px from viewport edge
borderRadius: 4
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(site_icon_default, { className: "edit-site-layout__view-mode-toggle-icon" })
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-site-hub__title", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "link",
href: homeUrl,
target: "_blank",
children: [
(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteTitle),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
as: "span",
/* translators: accessibility text */
children: (0,external_wp_i18n_namespaceObject.__)("(opens in a new tab)")
})
]
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHStack,
{
spacing: 0,
expanded: false,
className: "edit-site-site-hub__actions",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "compact",
className: "edit-site-site-hub_toggle-command-center",
icon: search_default,
onClick: () => openCommandCenter(),
label: (0,external_wp_i18n_namespaceObject.__)("Open command palette"),
shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary("k")
}
)
}
)
] })
] }) });
})
);
var site_hub_default = SiteHub;
const SiteHubMobile = (0,external_wp_element_.memo)(
(0,external_wp_element_.forwardRef)(({ isTransparent }, ref) => {
const { path } = useLocation();
const history = useHistory();
const { navigate } = (0,external_wp_element_.useContext)(SidebarNavigationContext);
const {
dashboardLink,
homeUrl,
siteTitle,
isBlockTheme,
isClassicThemeWithStyleBookSupport
} = (0,external_wp_data_.useSelect)((select) => {
const { getSettings } = unlock(select(store));
const { getEntityRecord, getCurrentTheme } = select(external_wp_coreData_namespaceObject.store);
const _site = getEntityRecord("root", "site");
const currentTheme = getCurrentTheme();
const settings = getSettings();
const supportsEditorStyles = currentTheme.theme_supports["editor-styles"];
const hasThemeJson = settings.supportsLayout;
return {
dashboardLink: settings.__experimentalDashboardLink,
homeUrl: getEntityRecord("root", "__unstableBase")?.home,
siteTitle: !_site?.title && !!_site?.url ? (0,external_wp_url_namespaceObject.filterURLForDisplay)(_site?.url) : _site?.title,
isBlockTheme: currentTheme?.is_block_theme,
isClassicThemeWithStyleBookSupport: !currentTheme?.is_block_theme && (supportsEditorStyles || hasThemeJson)
};
}, []);
const { open: openCommandCenter } = (0,external_wp_data_.useDispatch)(external_wp_commands_namespaceObject.store);
let backPath;
if (path !== "/") {
if (isBlockTheme || isClassicThemeWithStyleBookSupport) {
backPath = "/";
} else if (path !== "/pattern") {
backPath = "/pattern";
}
}
const backButtonProps = {
href: !!backPath ? void 0 : dashboardLink,
label: !!backPath ? (0,external_wp_i18n_namespaceObject.__)("Go to Site Editor") : (0,external_wp_i18n_namespaceObject.__)("Go to the Dashboard"),
onClick: !!backPath ? () => {
history.navigate(backPath);
navigate("back");
} : void 0
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-site-hub", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", spacing: "0", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx(
"edit-site-site-hub__view-mode-toggle-container",
{
"has-transparent-background": isTransparent
}
),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
ref,
className: "edit-site-layout__view-mode-toggle",
style: {
transform: "scale(0.5)",
borderRadius: 4
},
...backButtonProps,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(site_icon_default, { className: "edit-site-layout__view-mode-toggle-icon" })
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-site-hub__title", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "link",
href: homeUrl,
target: "_blank",
label: (0,external_wp_i18n_namespaceObject.__)("View site (opens in a new tab)"),
children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteTitle)
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHStack,
{
spacing: 0,
expanded: false,
className: "edit-site-site-hub__actions",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
className: "edit-site-site-hub_toggle-command-center",
icon: search_default,
onClick: () => openCommandCenter(),
label: (0,external_wp_i18n_namespaceObject.__)("Open command palette"),
shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary("k")
}
)
}
)
] })
] }) });
})
);
;// ./node_modules/@wordpress/edit-site/build-module/components/resizable-frame/index.js
const { useLocation: resizable_frame_useLocation, useHistory: resizable_frame_useHistory } = unlock(external_wp_router_namespaceObject.privateApis);
const HANDLE_STYLES_OVERRIDE = {
position: void 0,
userSelect: void 0,
cursor: void 0,
width: void 0,
height: void 0,
top: void 0,
right: void 0,
bottom: void 0,
left: void 0
};
const FRAME_MIN_WIDTH = 320;
const FRAME_REFERENCE_WIDTH = 1300;
const FRAME_TARGET_ASPECT_RATIO = 9 / 19.5;
const SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD = 200;
const INITIAL_FRAME_SIZE = { width: "100%", height: "100%" };
function calculateNewHeight(width, initialAspectRatio) {
const lerp = (a, b, amount) => {
return a + (b - a) * amount;
};
const lerpFactor = 1 - Math.max(
0,
Math.min(
1,
(width - FRAME_MIN_WIDTH) / (FRAME_REFERENCE_WIDTH - FRAME_MIN_WIDTH)
)
);
const intermediateAspectRatio = lerp(
initialAspectRatio,
FRAME_TARGET_ASPECT_RATIO,
lerpFactor
);
return width / intermediateAspectRatio;
}
function ResizableFrame({
isFullWidth,
isOversized,
setIsOversized,
isReady,
children,
/** The default (unresized) width/height of the frame, based on the space available in the viewport. */
defaultSize,
innerContentStyle
}) {
const history = resizable_frame_useHistory();
const { path, query } = resizable_frame_useLocation();
const { canvas = "view" } = query;
const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
const [frameSize, setFrameSize] = (0,external_wp_element_.useState)(INITIAL_FRAME_SIZE);
const [startingWidth, setStartingWidth] = (0,external_wp_element_.useState)();
const [isResizing, setIsResizing] = (0,external_wp_element_.useState)(false);
const [shouldShowHandle, setShouldShowHandle] = (0,external_wp_element_.useState)(false);
const [resizeRatio, setResizeRatio] = (0,external_wp_element_.useState)(1);
const FRAME_TRANSITION = { type: "tween", duration: isResizing ? 0 : 0.5 };
const frameRef = (0,external_wp_element_.useRef)(null);
const resizableHandleHelpId = (0,external_wp_compose_namespaceObject.useInstanceId)(
ResizableFrame,
"edit-site-resizable-frame-handle-help"
);
const defaultAspectRatio = defaultSize.width / defaultSize.height;
const isBlockTheme = (0,external_wp_data_.useSelect)((select) => {
const { getCurrentTheme } = select(external_wp_coreData_namespaceObject.store);
return getCurrentTheme()?.is_block_theme;
}, []);
const handleResizeStart = (_event, _direction, ref) => {
setStartingWidth(ref.offsetWidth);
setIsResizing(true);
};
const handleResize = (_event, _direction, _ref, delta) => {
const normalizedDelta = delta.width / resizeRatio;
const deltaAbs = Math.abs(normalizedDelta);
const maxDoubledDelta = delta.width < 0 ? deltaAbs : (defaultSize.width - startingWidth) / 2;
const deltaToDouble = Math.min(deltaAbs, maxDoubledDelta);
const doubleSegment = deltaAbs === 0 ? 0 : deltaToDouble / deltaAbs;
const singleSegment = 1 - doubleSegment;
setResizeRatio(singleSegment + doubleSegment * 2);
const updatedWidth = startingWidth + delta.width;
setIsOversized(updatedWidth > defaultSize.width);
setFrameSize({
height: isOversized ? "100%" : calculateNewHeight(updatedWidth, defaultAspectRatio)
});
};
const handleResizeStop = (_event, _direction, ref) => {
setIsResizing(false);
if (!isOversized) {
return;
}
setIsOversized(false);
const remainingWidth = ref.ownerDocument.documentElement.offsetWidth - ref.offsetWidth;
if (remainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD || !isBlockTheme) {
setFrameSize(INITIAL_FRAME_SIZE);
} else {
history.navigate(
(0,external_wp_url_namespaceObject.addQueryArgs)(path, {
canvas: "edit"
}),
{
transition: "canvas-mode-edit-transition"
}
);
}
};
const handleResizableHandleKeyDown = (event) => {
if (!["ArrowLeft", "ArrowRight"].includes(event.key)) {
return;
}
event.preventDefault();
const step = 20 * (event.shiftKey ? 5 : 1);
const delta = step * (event.key === "ArrowLeft" ? 1 : -1) * ((0,external_wp_i18n_namespaceObject.isRTL)() ? -1 : 1);
const newWidth = Math.min(
Math.max(
FRAME_MIN_WIDTH,
frameRef.current.resizable.offsetWidth + delta
),
defaultSize.width
);
setFrameSize({
width: newWidth,
height: calculateNewHeight(newWidth, defaultAspectRatio)
});
};
const frameAnimationVariants = {
default: {
flexGrow: 0,
height: frameSize.height
},
fullWidth: {
flexGrow: 1,
height: frameSize.height
}
};
const resizeHandleVariants = {
hidden: {
opacity: 0,
...(0,external_wp_i18n_namespaceObject.isRTL)() ? { right: 0 } : { left: 0 }
},
visible: {
opacity: 1,
// Account for the handle's width.
...(0,external_wp_i18n_namespaceObject.isRTL)() ? { right: -14 } : { left: -14 }
},
active: {
opacity: 1,
// Account for the handle's width.
...(0,external_wp_i18n_namespaceObject.isRTL)() ? { right: -14 } : { left: -14 },
scaleY: 1.3
}
};
const currentResizeHandleVariant = (() => {
if (isResizing) {
return "active";
}
return shouldShowHandle ? "visible" : "hidden";
})();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ResizableBox,
{
as: external_wp_components_namespaceObject.__unstableMotion.div,
ref: frameRef,
initial: false,
variants: frameAnimationVariants,
animate: isFullWidth ? "fullWidth" : "default",
onAnimationComplete: (definition) => {
if (definition === "fullWidth") {
setFrameSize({ width: "100%", height: "100%" });
}
},
whileHover: canvas === "view" && isBlockTheme ? {
scale: 1.005,
transition: {
duration: disableMotion ? 0 : 0.5,
ease: "easeOut"
}
} : {},
transition: FRAME_TRANSITION,
size: frameSize,
enable: {
top: false,
bottom: false,
// Resizing will be disabled until the editor content is loaded.
...(0,external_wp_i18n_namespaceObject.isRTL)() ? { right: isReady, left: false } : { left: isReady, right: false },
topRight: false,
bottomRight: false,
bottomLeft: false,
topLeft: false
},
resizeRatio,
handleClasses: void 0,
handleStyles: {
left: HANDLE_STYLES_OVERRIDE,
right: HANDLE_STYLES_OVERRIDE
},
minWidth: FRAME_MIN_WIDTH,
maxWidth: isFullWidth ? "100%" : "150%",
maxHeight: "100%",
onFocus: () => setShouldShowHandle(true),
onBlur: () => setShouldShowHandle(false),
onMouseOver: () => setShouldShowHandle(true),
onMouseOut: () => setShouldShowHandle(false),
handleComponent: {
[(0,external_wp_i18n_namespaceObject.isRTL)() ? "right" : "left"]: canvas === "view" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: (0,external_wp_i18n_namespaceObject.__)("Drag to resize"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableMotion.button,
{
role: "separator",
"aria-orientation": "vertical",
className: dist_clsx(
"edit-site-resizable-frame__handle",
{ "is-resizing": isResizing }
),
variants: resizeHandleVariants,
animate: currentResizeHandleVariant,
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Drag to resize"),
"aria-describedby": resizableHandleHelpId,
"aria-valuenow": frameRef.current?.resizable?.offsetWidth || void 0,
"aria-valuemin": FRAME_MIN_WIDTH,
"aria-valuemax": defaultSize.width,
onKeyDown: handleResizableHandleKeyDown,
initial: "hidden",
exit: "hidden",
whileFocus: "active",
whileHover: "active"
},
"handle"
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { hidden: true, id: resizableHandleHelpId, children: (0,external_wp_i18n_namespaceObject.__)(
"Use left and right arrow keys to resize the canvas. Hold shift to resize in larger increments."
) })
] })
},
onResizeStart: handleResizeStart,
onResize: handleResize,
onResizeStop: handleResizeStop,
className: dist_clsx("edit-site-resizable-frame__inner", {
"is-resizing": isResizing
}),
showHandle: false,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "edit-site-resizable-frame__inner-content",
style: innerContentStyle,
children
}
)
}
);
}
var resizable_frame_default = ResizableFrame;
;// external ["wp","keyboardShortcuts"]
const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
;// ./node_modules/@wordpress/edit-site/build-module/components/save-keyboard-shortcut/index.js
const shortcutName = "core/edit-site/save";
function SaveKeyboardShortcut() {
const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } = (0,external_wp_data_.useSelect)(external_wp_coreData_namespaceObject.store);
const { hasNonPostEntityChanges, isPostSavingLocked } = (0,external_wp_data_.useSelect)(external_wp_editor_namespaceObject.store);
const { savePost } = (0,external_wp_data_.useDispatch)(external_wp_editor_namespaceObject.store);
const { setIsSaveViewOpened } = (0,external_wp_data_.useDispatch)(store);
const { registerShortcut, unregisterShortcut } = (0,external_wp_data_.useDispatch)(
external_wp_keyboardShortcuts_namespaceObject.store
);
(0,external_wp_element_.useEffect)(() => {
registerShortcut({
name: shortcutName,
category: "global",
description: (0,external_wp_i18n_namespaceObject.__)("Save your changes."),
keyCombination: {
modifier: "primary",
character: "s"
}
});
return () => {
unregisterShortcut(shortcutName);
};
}, [registerShortcut, unregisterShortcut]);
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)("core/edit-site/save", (event) => {
event.preventDefault();
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
const hasDirtyEntities = !!dirtyEntityRecords.length;
const isSaving = dirtyEntityRecords.some(
(record) => isSavingEntityRecord(record.kind, record.name, record.key)
);
if (!hasDirtyEntities || isSaving) {
return;
}
if (hasNonPostEntityChanges()) {
setIsSaveViewOpened(true);
} else if (!isPostSavingLocked()) {
savePost();
}
});
return null;
}
;// ./node_modules/@wordpress/edit-site/build-module/components/layout/hooks.js
const MAX_LOADING_TIME = 1e4;
function useIsSiteEditorLoading() {
const [loaded, setLoaded] = (0,external_wp_element_.useState)(false);
const inLoadingPause = (0,external_wp_data_.useSelect)(
(select) => {
const hasResolvingSelectors = select(external_wp_coreData_namespaceObject.store).hasResolvingSelectors();
return !loaded && !hasResolvingSelectors;
},
[loaded]
);
(0,external_wp_element_.useEffect)(() => {
let timeout;
if (!loaded) {
timeout = setTimeout(() => {
setLoaded(true);
}, MAX_LOADING_TIME);
}
return () => {
clearTimeout(timeout);
};
}, [loaded]);
(0,external_wp_element_.useEffect)(() => {
if (inLoadingPause) {
const ARTIFICIAL_DELAY = 100;
const timeout = setTimeout(() => {
setLoaded(true);
}, ARTIFICIAL_DELAY);
return () => {
clearTimeout(timeout);
};
}
}, [inLoadingPause]);
return !loaded;
}
;// ./node_modules/@react-spring/rafz/dist/esm/index.js
var esm_f=esm_l(),esm_n=e=>esm_c(e,esm_f),esm_m=esm_l();esm_n.write=e=>esm_c(e,esm_m);var esm_d=esm_l();esm_n.onStart=e=>esm_c(e,esm_d);var esm_h=esm_l();esm_n.onFrame=e=>esm_c(e,esm_h);var esm_p=esm_l();esm_n.onFinish=e=>esm_c(e,esm_p);var esm_i=[];esm_n.setTimeout=(e,t)=>{let a=esm_n.now()+t,o=()=>{let F=esm_i.findIndex(z=>z.cancel==o);~F&&esm_i.splice(F,1),esm_u-=~F?1:0},s={time:a,handler:e,cancel:o};return esm_i.splice(esm_w(a),0,s),esm_u+=1,esm_v(),s};var esm_w=e=>~(~esm_i.findIndex(t=>t.time>e)||~esm_i.length);esm_n.cancel=e=>{esm_d.delete(e),esm_h.delete(e),esm_p.delete(e),esm_f.delete(e),esm_m.delete(e)};esm_n.sync=e=>{T=!0,esm_n.batchedUpdates(e),T=!1};esm_n.throttle=e=>{let t;function a(){try{e(...t)}finally{t=null}}function o(...s){t=s,esm_n.onStart(a)}return o.handler=e,o.cancel=()=>{esm_d.delete(a),t=null},o};var esm_y=typeof window<"u"?window.requestAnimationFrame:()=>{};esm_n.use=e=>esm_y=e;esm_n.now=typeof performance<"u"?()=>performance.now():Date.now;esm_n.batchedUpdates=e=>e();esm_n.catch=console.error;esm_n.frameLoop="always";esm_n.advance=()=>{esm_n.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):esm_x()};var esm_r=-1,esm_u=0,T=!1;function esm_c(e,t){T?(t.delete(e),e(0)):(t.add(e),esm_v())}function esm_v(){esm_r<0&&(esm_r=0,esm_n.frameLoop!=="demand"&&esm_y(esm_b))}function esm_R(){esm_r=-1}function esm_b(){~esm_r&&(esm_y(esm_b),esm_n.batchedUpdates(esm_x))}function esm_x(){let e=esm_r;esm_r=esm_n.now();let t=esm_w(esm_r);if(t&&(Q(esm_i.splice(0,t),a=>a.handler()),esm_u-=t),!esm_u){esm_R();return}esm_d.flush(),esm_f.flush(e?Math.min(64,esm_r-e):16.667),esm_h.flush(),esm_m.flush(),esm_p.flush()}function esm_l(){let e=new Set,t=e;return{add(a){esm_u+=t==e&&!e.has(a)?1:0,e.add(a)},delete(a){return esm_u-=t==e&&e.has(a)?1:0,e.delete(a)},flush(a){t.size&&(e=new Set,esm_u-=t.size,Q(t,o=>o(a)&&e.add(o)),esm_u+=e.size,t=e)}}}function Q(e,t){e.forEach(a=>{try{t(a)}catch(o){esm_n.catch(o)}})}var esm_S={count(){return esm_u},isRunning(){return esm_r>=0},clear(){esm_r=-1,esm_i=[],esm_d=esm_l(),esm_f=esm_l(),esm_h=esm_l(),esm_m=esm_l(),esm_p=esm_l(),esm_u=0}};
// EXTERNAL MODULE: external "React"
var external_React_ = __webpack_require__(1609);
var external_React_namespaceObject = /*#__PURE__*/__webpack_require__.t(external_React_, 2);
;// ./node_modules/@react-spring/shared/dist/esm/index.js
var ze=Object.defineProperty;var Le=(e,t)=>{for(var r in t)ze(e,r,{get:t[r],enumerable:!0})};var dist_esm_p={};Le(dist_esm_p,{assign:()=>U,colors:()=>dist_esm_c,createStringInterpolator:()=>esm_k,skipAnimation:()=>ee,to:()=>J,willAdvance:()=>dist_esm_S});function Y(){}var mt=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),dist_esm_l={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function bt(e,t){if(dist_esm_l.arr(e)){if(!dist_esm_l.arr(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return e===t}var esm_Ve=(e,t)=>e.forEach(t);function xt(e,t,r){if(dist_esm_l.arr(e)){for(let n=0;n<e.length;n++)t.call(r,e[n],`${n}`);return}for(let n in e)e.hasOwnProperty(n)&&t.call(r,e[n],n)}var ht=e=>dist_esm_l.und(e)?[]:dist_esm_l.arr(e)?e:[e];function Pe(e,t){if(e.size){let r=Array.from(e);e.clear(),esm_Ve(r,t)}}var yt=(e,...t)=>Pe(e,r=>r(...t)),dist_esm_h=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);var esm_k,J,dist_esm_c=null,ee=!1,dist_esm_S=Y,U=e=>{e.to&&(J=e.to),e.now&&(esm_n.now=e.now),e.colors!==void 0&&(dist_esm_c=e.colors),e.skipAnimation!=null&&(ee=e.skipAnimation),e.createStringInterpolator&&(esm_k=e.createStringInterpolator),e.requestAnimationFrame&&esm_n.use(e.requestAnimationFrame),e.batchedUpdates&&(esm_n.batchedUpdates=e.batchedUpdates),e.willAdvance&&(dist_esm_S=e.willAdvance),e.frameLoop&&(esm_n.frameLoop=e.frameLoop)};var esm_E=new Set,dist_esm_u=[],esm_H=[],A=0,qe={get idle(){return!esm_E.size&&!dist_esm_u.length},start(e){A>e.priority?(esm_E.add(e),esm_n.onStart($e)):(te(e),esm_n(B))},advance:B,sort(e){if(A)esm_n.onFrame(()=>qe.sort(e));else{let t=dist_esm_u.indexOf(e);~t&&(dist_esm_u.splice(t,1),re(e))}},clear(){dist_esm_u=[],esm_E.clear()}};function $e(){esm_E.forEach(te),esm_E.clear(),esm_n(B)}function te(e){dist_esm_u.includes(e)||re(e)}function re(e){dist_esm_u.splice(Ge(dist_esm_u,t=>t.priority>e.priority),0,e)}function B(e){let t=esm_H;for(let r=0;r<dist_esm_u.length;r++){let n=dist_esm_u[r];A=n.priority,n.idle||(dist_esm_S(n),n.advance(e),n.idle||t.push(n))}return A=0,esm_H=dist_esm_u,esm_H.length=0,dist_esm_u=t,dist_esm_u.length>0}function Ge(e,t){let r=e.findIndex(t);return r<0?e.length:r}var ne=(e,t,r)=>Math.min(Math.max(r,e),t);var It={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199};var dist_esm_d="[-+]?\\d*\\.?\\d+",esm_M=dist_esm_d+"%";function C(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var oe=new RegExp("rgb"+C(dist_esm_d,dist_esm_d,dist_esm_d)),fe=new RegExp("rgba"+C(dist_esm_d,dist_esm_d,dist_esm_d,dist_esm_d)),ae=new RegExp("hsl"+C(dist_esm_d,esm_M,esm_M)),ie=new RegExp("hsla"+C(dist_esm_d,esm_M,esm_M,dist_esm_d)),se=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ue=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,le=/^#([0-9a-fA-F]{6})$/,esm_ce=/^#([0-9a-fA-F]{8})$/;function be(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=le.exec(e))?parseInt(t[1]+"ff",16)>>>0:dist_esm_c&&dist_esm_c[e]!==void 0?dist_esm_c[e]:(t=oe.exec(e))?(dist_esm_y(t[1])<<24|dist_esm_y(t[2])<<16|dist_esm_y(t[3])<<8|255)>>>0:(t=fe.exec(e))?(dist_esm_y(t[1])<<24|dist_esm_y(t[2])<<16|dist_esm_y(t[3])<<8|me(t[4]))>>>0:(t=se.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=esm_ce.exec(e))?parseInt(t[1],16)>>>0:(t=ue.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=ae.exec(e))?(de(esm_pe(t[1]),esm_z(t[2]),esm_z(t[3]))|255)>>>0:(t=ie.exec(e))?(de(esm_pe(t[1]),esm_z(t[2]),esm_z(t[3]))|me(t[4]))>>>0:null}function esm_j(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function de(e,t,r){let n=r<.5?r*(1+t):r+t-r*t,f=2*r-n,o=esm_j(f,n,e+1/3),i=esm_j(f,n,e),s=esm_j(f,n,e-1/3);return Math.round(o*255)<<24|Math.round(i*255)<<16|Math.round(s*255)<<8}function dist_esm_y(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function esm_pe(e){return(parseFloat(e)%360+360)%360/360}function me(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function esm_z(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function D(e){let t=be(e);if(t===null)return e;t=t||0;let r=(t&4278190080)>>>24,n=(t&16711680)>>>16,f=(t&65280)>>>8,o=(t&255)/255;return`rgba(${r}, ${n}, ${f}, ${o})`}var W=(e,t,r)=>{if(dist_esm_l.fun(e))return e;if(dist_esm_l.arr(e))return W({range:e,output:t,extrapolate:r});if(dist_esm_l.str(e.output[0]))return esm_k(e);let n=e,f=n.output,o=n.range||[0,1],i=n.extrapolateLeft||n.extrapolate||"extend",s=n.extrapolateRight||n.extrapolate||"extend",x=n.easing||(a=>a);return a=>{let F=He(a,o);return Ue(a,o[F],o[F+1],f[F],f[F+1],x,i,s,n.map)}};function Ue(e,t,r,n,f,o,i,s,x){let a=x?x(e):e;if(a<t){if(i==="identity")return a;i==="clamp"&&(a=t)}if(a>r){if(s==="identity")return a;s==="clamp"&&(a=r)}return n===f?n:t===r?e<=t?n:f:(t===-1/0?a=-a:r===1/0?a=a-t:a=(a-t)/(r-t),a=o(a),n===-1/0?a=-a:f===1/0?a=a+n:a=a*(f-n)+n,a)}function He(e,t){for(var r=1;r<t.length-1&&!(t[r]>=e);++r);return r-1}var Be=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);let n=r*e,f=t==="end"?Math.floor(n):Math.ceil(n);return ne(0,1,f/e)},P=1.70158,L=P*1.525,xe=P+1,he=2*Math.PI/3,ye=2*Math.PI/4.5,V=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,Lt={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>xe*e*e*e-P*e*e,easeOutBack:e=>1+xe*Math.pow(e-1,3)+P*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((L+1)*2*e-L)/2:(Math.pow(2*e-2,2)*((L+1)*(e*2-2)+L)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*he),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*he)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*ye))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*ye)/2+1,easeInBounce:e=>1-V(1-e),easeOutBounce:V,easeInOutBounce:e=>e<.5?(1-V(1-2*e))/2:(1+V(2*e-1))/2,steps:Be};var esm_g=Symbol.for("FluidValue.get"),dist_esm_m=Symbol.for("FluidValue.observers");var Pt=e=>Boolean(e&&e[esm_g]),ve=e=>e&&e[esm_g]?e[esm_g]():e,esm_qt=e=>e[dist_esm_m]||null;function je(e,t){e.eventObserved?e.eventObserved(t):e(t)}function $t(e,t){let r=e[dist_esm_m];r&&r.forEach(n=>{je(n,t)})}var esm_ge=class{[esm_g];[dist_esm_m];constructor(t){if(!t&&!(t=this.get))throw Error("Unknown getter");De(this,t)}},De=(e,t)=>Ee(e,esm_g,t);function Gt(e,t){if(e[esm_g]){let r=e[dist_esm_m];r||Ee(e,dist_esm_m,r=new Set),r.has(t)||(r.add(t),e.observerAdded&&e.observerAdded(r.size,t))}return t}function Qt(e,t){let r=e[dist_esm_m];if(r&&r.has(t)){let n=r.size-1;n?r.delete(t):e[dist_esm_m]=null,e.observerRemoved&&e.observerRemoved(n,t)}}var Ee=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0});var O=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,esm_Oe=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,K=new RegExp(`(${O.source})(%|[a-z]+)`,"i"),we=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,dist_esm_b=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;var esm_N=e=>{let[t,r]=We(e);if(!t||dist_esm_h())return e;let n=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(n)return n.trim();if(r&&r.startsWith("--")){let f=window.getComputedStyle(document.documentElement).getPropertyValue(r);return f||e}else{if(r&&dist_esm_b.test(r))return esm_N(r);if(r)return r}return e},We=e=>{let t=dist_esm_b.exec(e);if(!t)return[,];let[,r,n]=t;return[r,n]};var _,esm_Ke=(e,t,r,n,f)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(n)}, ${f})`,Xt=e=>{_||(_=dist_esm_c?new RegExp(`(${Object.keys(dist_esm_c).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map(o=>ve(o).replace(dist_esm_b,esm_N).replace(esm_Oe,D).replace(_,D)),r=t.map(o=>o.match(O).map(Number)),f=r[0].map((o,i)=>r.map(s=>{if(!(i in s))throw Error('The arity of each "output" value must be equal');return s[i]})).map(o=>W({...e,output:o}));return o=>{let i=!K.test(t[0])&&t.find(x=>K.test(x))?.replace(O,""),s=0;return t[0].replace(O,()=>`${f[s++](o)}${i||""}`).replace(we,esm_Ke)}};var Z="react-spring: ",Te=e=>{let t=e,r=!1;if(typeof t!="function")throw new TypeError(`${Z}once requires a function parameter`);return(...n)=>{r||(t(...n),r=!0)}},Ne=Te(console.warn);function Jt(){Ne(`${Z}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var _e=Te(console.warn);function er(){_e(`${Z}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function esm_or(e){return dist_esm_l.str(e)&&(e[0]=="#"||/\d/.test(e)||!dist_esm_h()&&dist_esm_b.test(e)||e in(dist_esm_c||{}))}var dist_esm_v,q=new WeakMap,Ze=e=>e.forEach(({target:t,contentRect:r})=>q.get(t)?.forEach(n=>n(r)));function Fe(e,t){dist_esm_v||typeof ResizeObserver<"u"&&(dist_esm_v=new ResizeObserver(Ze));let r=q.get(t);return r||(r=new Set,q.set(t,r)),r.add(e),dist_esm_v&&dist_esm_v.observe(t),()=>{let n=q.get(t);!n||(n.delete(e),!n.size&&dist_esm_v&&dist_esm_v.unobserve(t))}}var esm_$=new Set,dist_esm_w,esm_Xe=()=>{let e=()=>{esm_$.forEach(t=>t({width:window.innerWidth,height:window.innerHeight}))};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},Ie=e=>(esm_$.add(e),dist_esm_w||(dist_esm_w=esm_Xe()),()=>{esm_$.delete(e),!esm_$.size&&dist_esm_w&&(dist_esm_w(),dist_esm_w=void 0)});var ke=(e,{container:t=document.documentElement}={})=>t===document.documentElement?Ie(e):Fe(e,t);var Se=(e,t,r)=>t-e===0?1:(r-e)/(t-e);var esm_Ye={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}},esm_G=class{callback;container;info;constructor(t,r){this.callback=t,this.container=r,this.info={time:0,x:this.createAxis(),y:this.createAxis()}}createAxis=()=>({current:0,progress:0,scrollLength:0});updateAxis=t=>{let r=this.info[t],{length:n,position:f}=esm_Ye[t];r.current=this.container[`scroll${f}`],r.scrollLength=this.container["scroll"+n]-this.container["client"+n],r.progress=Se(0,r.scrollLength,r.current)};update=()=>{this.updateAxis("x"),this.updateAxis("y")};sendEvent=()=>{this.callback(this.info)};advance=()=>{this.update(),this.sendEvent()}};var esm_T=new WeakMap,Ae=new WeakMap,X=new WeakMap,Me=e=>e===document.documentElement?window:e,yr=(e,{container:t=document.documentElement}={})=>{let r=X.get(t);r||(r=new Set,X.set(t,r));let n=new esm_G(e,t);if(r.add(n),!esm_T.has(t)){let o=()=>(r?.forEach(s=>s.advance()),!0);esm_T.set(t,o);let i=Me(t);window.addEventListener("resize",o,{passive:!0}),t!==document.documentElement&&Ae.set(t,ke(o,{container:t})),i.addEventListener("scroll",o,{passive:!0})}let f=esm_T.get(t);return Re(f),()=>{Re.cancel(f);let o=X.get(t);if(!o||(o.delete(n),o.size))return;let i=esm_T.get(t);esm_T.delete(t),i&&(Me(t).removeEventListener("scroll",i),window.removeEventListener("resize",i),Ae.get(t)?.())}};function Er(e){let t=Je(null);return t.current===null&&(t.current=e()),t.current}var esm_Q=dist_esm_h()?external_React_.useEffect:external_React_.useLayoutEffect;var Ce=()=>{let e=(0,external_React_.useRef)(!1);return esm_Q(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function Mr(){let e=(0,external_React_.useState)()[1],t=Ce();return()=>{t.current&&e(Math.random())}}function Lr(e,t){let[r]=(0,external_React_.useState)(()=>({inputs:t,result:e()})),n=(0,external_React_.useRef)(),f=n.current,o=f;return o?Boolean(t&&o.inputs&&it(t,o.inputs))||(o={inputs:t,result:e()}):o=r,(0,external_React_.useEffect)(()=>{n.current=o,f==r&&(r.inputs=r.result=void 0)},[o]),o.result}function it(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}var $r=e=>(0,external_React_.useEffect)(e,ut),ut=[];function Ur(e){let t=ct();return lt(()=>{t.current=e}),t.current}var Wr=()=>{let[e,t]=dt(null);return esm_Q(()=>{let r=window.matchMedia("(prefers-reduced-motion)"),n=f=>{t(f.matches),U({skipAnimation:f.matches})};return n(r),r.addEventListener("change",n),()=>{r.removeEventListener("change",n)}},[]),e};
;// ./node_modules/@react-spring/animated/dist/esm/index.js
var animated_dist_esm_h=Symbol.for("Animated:node"),animated_dist_esm_v=e=>!!e&&e[animated_dist_esm_h]===e,dist_esm_k=e=>e&&e[animated_dist_esm_h],esm_D=(e,t)=>mt(e,animated_dist_esm_h,t),F=e=>e&&e[animated_dist_esm_h]&&e[animated_dist_esm_h].getPayload(),animated_dist_esm_c=class{payload;constructor(){esm_D(this,this)}getPayload(){return this.payload||[]}};var animated_dist_esm_l=class extends animated_dist_esm_c{constructor(r){super();this._value=r;dist_esm_l.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(r){return new animated_dist_esm_l(r)}getPayload(){return[this]}getValue(){return this._value}setValue(r,n){return dist_esm_l.num(r)&&(this.lastPosition=r,n&&(r=Math.round(r/n)*n,this.done&&(this.lastPosition=r))),this._value===r?!1:(this._value=r,!0)}reset(){let{done:r}=this;this.done=!1,dist_esm_l.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,r&&(this.lastVelocity=null),this.v0=null)}};var animated_dist_esm_d=class extends animated_dist_esm_l{_string=null;_toString;constructor(t){super(0),this._toString=W({output:[t,t]})}static create(t){return new animated_dist_esm_d(t)}getValue(){let t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if(dist_esm_l.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=W({output:[this.getValue(),t]})),this._value=0,super.reset()}};var dist_esm_f={dependencies:null};var animated_dist_esm_u=class extends animated_dist_esm_c{constructor(r){super();this.source=r;this.setValue(r)}getValue(r){let n={};return xt(this.source,(a,i)=>{animated_dist_esm_v(a)?n[i]=a.getValue(r):Pt(a)?n[i]=ve(a):r||(n[i]=a)}),n}setValue(r){this.source=r,this.payload=this._makePayload(r)}reset(){this.payload&&esm_Ve(this.payload,r=>r.reset())}_makePayload(r){if(r){let n=new Set;return xt(r,this._addToPayload,n),Array.from(n)}}_addToPayload(r){dist_esm_f.dependencies&&Pt(r)&&dist_esm_f.dependencies.add(r);let n=F(r);n&&esm_Ve(n,a=>this.add(a))}};var animated_dist_esm_y=class extends animated_dist_esm_u{constructor(t){super(t)}static create(t){return new animated_dist_esm_y(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){let r=this.getPayload();return t.length==r.length?r.map((n,a)=>n.setValue(t[a])).some(Boolean):(super.setValue(t.map(dist_esm_z)),!0)}};function dist_esm_z(e){return(esm_or(e)?animated_dist_esm_d:animated_dist_esm_l).create(e)}function esm_Le(e){let t=dist_esm_k(e);return t?t.constructor:dist_esm_l.arr(e)?animated_dist_esm_y:esm_or(e)?animated_dist_esm_d:animated_dist_esm_l}var dist_esm_x=(e,t)=>{let r=!dist_esm_l.fun(e)||e.prototype&&e.prototype.isReactComponent;return (0,external_React_.forwardRef)((n,a)=>{let i=(0,external_React_.useRef)(null),o=r&&(0,external_React_.useCallback)(s=>{i.current=esm_ae(a,s)},[a]),[m,T]=esm_ne(n,t),W=Mr(),P=()=>{let s=i.current;if(r&&!s)return;(s?t.applyAnimatedValues(s,m.getValue(!0)):!1)===!1&&W()},_=new animated_dist_esm_b(P,T),p=(0,external_React_.useRef)();esm_Q(()=>(p.current=_,esm_Ve(T,s=>Gt(s,_)),()=>{p.current&&(esm_Ve(p.current.deps,s=>Qt(s,p.current)),esm_n.cancel(p.current.update))})),(0,external_React_.useEffect)(P,[]),$r(()=>()=>{let s=p.current;esm_Ve(s.deps,S=>Qt(S,s))});let $=t.getComponentProps(m.getValue());return external_React_.createElement(e,{...$,ref:o})})},animated_dist_esm_b=class{constructor(t,r){this.update=t;this.deps=r}eventObserved(t){t.type=="change"&&esm_n.write(this.update)}};function esm_ne(e,t){let r=new Set;return dist_esm_f.dependencies=r,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new animated_dist_esm_u(e),dist_esm_f.dependencies=null,[e,r]}function esm_ae(e,t){return e&&(dist_esm_l.fun(e)?e(t):e.current=t),t}var dist_esm_j=Symbol.for("AnimatedComponent"),dist_esm_Ke=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:r=a=>new animated_dist_esm_u(a),getComponentProps:n=a=>a}={})=>{let a={applyAnimatedValues:t,createAnimatedStyle:r,getComponentProps:n},i=o=>{let m=esm_I(o)||"Anonymous";return dist_esm_l.str(o)?o=i[o]||(i[o]=dist_esm_x(o,a)):o=o[dist_esm_j]||(o[dist_esm_j]=dist_esm_x(o,a)),o.displayName=`Animated(${m})`,o};return xt(e,(o,m)=>{dist_esm_l.arr(e)&&(m=esm_I(o)),i[m]=i(o)}),{animated:i}},esm_I=e=>dist_esm_l.str(e)?e:e&&dist_esm_l.str(e.displayName)?e.displayName:dist_esm_l.fun(e)&&e.name||null;
;// ./node_modules/@react-spring/core/dist/esm/index.js
function dist_esm_I(t,...e){return dist_esm_l.fun(t)?t(...e):t}var esm_te=(t,e)=>t===!0||!!(e&&t&&(dist_esm_l.fun(t)?t(e):ht(t).includes(e))),et=(t,e)=>dist_esm_l.obj(t)?e&&t[e]:t;var esm_ke=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,nn=t=>t,dist_esm_ne=(t,e=nn)=>{let n=rn;t.default&&t.default!==!0&&(t=t.default,n=Object.keys(t));let r={};for(let o of n){let s=e(t[o],o);dist_esm_l.und(s)||(r[o]=s)}return r},rn=["config","onProps","onStart","onChange","onPause","onResume","onRest"],on={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function sn(t){let e={},n=0;if(xt(t,(r,o)=>{on[o]||(e[o]=r,n++)}),n)return e}function esm_de(t){let e=sn(t);if(e){let n={to:e};return xt(t,(r,o)=>o in e||(n[o]=r)),n}return{...t}}function esm_me(t){return t=ve(t),dist_esm_l.arr(t)?t.map(esm_me):esm_or(t)?dist_esm_p.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function esm_Ue(t){for(let e in t)return!0;return!1}function esm_Ee(t){return dist_esm_l.fun(t)||dist_esm_l.arr(t)&&dist_esm_l.obj(t[0])}function esm_xe(t,e){t.ref?.delete(t),e?.delete(t)}function esm_he(t,e){e&&t.ref!==e&&(t.ref?.delete(t),e.add(t),t.ref=e)}function wr(t,e,n=1e3){an(()=>{if(e){let r=0;ge(t,(o,s)=>{let a=o.current;if(a.length){let i=n*e[s];isNaN(i)?i=r:r=i,ge(a,u=>{ge(u.queue,p=>{let f=p.delay;p.delay=d=>i+dist_esm_I(f||0,d)})}),o.start()}})}else{let r=Promise.resolve();ge(t,o=>{let s=o.current;if(s.length){let a=s.map(i=>{let u=i.queue;return i.queue=[],u});r=r.then(()=>(ge(s,(i,u)=>ge(a[u]||[],p=>i.queue.push(p))),Promise.all(o.start())))}})}})}var esm_mt={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};var tt={...esm_mt.default,mass:1,damping:1,easing:Lt.linear,clamp:!1},esm_we=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,tt)}};function gt(t,e,n){n&&(n={...n},esm_ht(n,e),e={...n,...e}),esm_ht(t,e),Object.assign(t,e);for(let a in tt)t[a]==null&&(t[a]=tt[a]);let{mass:r,frequency:o,damping:s}=t;return dist_esm_l.und(o)||(o<.01&&(o=.01),s<0&&(s=0),t.tension=Math.pow(2*Math.PI/o,2)*r,t.friction=4*Math.PI*s*r/o),t}function esm_ht(t,e){if(!dist_esm_l.und(e.decay))t.duration=void 0;else{let n=!dist_esm_l.und(e.tension)||!dist_esm_l.und(e.friction);(n||!dist_esm_l.und(e.frequency)||!dist_esm_l.und(e.damping)||!dist_esm_l.und(e.mass))&&(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}}var esm_yt=[],dist_esm_Le=class{changed=!1;values=esm_yt;toValues=null;fromValues=esm_yt;to;from;config=new esm_we;immediate=!1};function esm_Me(t,{key:e,props:n,defaultProps:r,state:o,actions:s}){return new Promise((a,i)=>{let u,p,f=esm_te(n.cancel??r?.cancel,e);if(f)b();else{dist_esm_l.und(n.pause)||(o.paused=esm_te(n.pause,e));let c=r?.pause;c!==!0&&(c=o.paused||esm_te(c,e)),u=dist_esm_I(n.delay||0,e),c?(o.resumeQueue.add(m),s.pause()):(s.resume(),m())}function d(){o.resumeQueue.add(m),o.timeouts.delete(p),p.cancel(),u=p.time-esm_n.now()}function m(){u>0&&!dist_esm_p.skipAnimation?(o.delayed=!0,p=esm_n.setTimeout(b,u),o.pauseQueue.add(d),o.timeouts.add(p)):b()}function b(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(d),o.timeouts.delete(p),t<=(o.cancelId||0)&&(f=!0);try{s.start({...n,callId:t,cancel:f},a)}catch(c){i(c)}}})}var esm_be=(t,e)=>e.length==1?e[0]:e.some(n=>n.cancelled)?esm_q(t.get()):e.every(n=>n.noop)?nt(t.get()):dist_esm_E(t.get(),e.every(n=>n.finished)),nt=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),dist_esm_E=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),esm_q=t=>({value:t,cancelled:!0,finished:!1});function esm_De(t,e,n,r){let{callId:o,parentId:s,onRest:a}=e,{asyncTo:i,promise:u}=n;return!s&&t===i&&!e.reset?u:n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;let p=dist_esm_ne(e,(l,h)=>h==="onRest"?void 0:l),f,d,m=new Promise((l,h)=>(f=l,d=h)),b=l=>{let h=o<=(n.cancelId||0)&&esm_q(r)||o!==n.asyncId&&dist_esm_E(r,!1);if(h)throw l.result=h,d(l),l},c=(l,h)=>{let g=new esm_Ae,x=new esm_Ne;return(async()=>{if(dist_esm_p.skipAnimation)throw esm_oe(n),x.result=dist_esm_E(r,!1),d(x),x;b(g);let S=dist_esm_l.obj(l)?{...l}:{...h,to:l};S.parentId=o,xt(p,(V,_)=>{dist_esm_l.und(S[_])&&(S[_]=V)});let A=await r.start(S);return b(g),n.paused&&await new Promise(V=>{n.resumeQueue.add(V)}),A})()},P;if(dist_esm_p.skipAnimation)return esm_oe(n),dist_esm_E(r,!1);try{let l;dist_esm_l.arr(t)?l=(async h=>{for(let g of h)await c(g)})(t):l=Promise.resolve(t(c,r.stop.bind(r))),await Promise.all([l.then(f),m]),P=dist_esm_E(r.get(),!0,!1)}catch(l){if(l instanceof esm_Ae)P=l.result;else if(l instanceof esm_Ne)P=l.result;else throw l}finally{o==n.asyncId&&(n.asyncId=s,n.asyncTo=s?i:void 0,n.promise=s?u:void 0)}return dist_esm_l.fun(a)&&esm_n.batchedUpdates(()=>{a(P,r,r.item)}),P})()}function esm_oe(t,e){Pe(t.timeouts,n=>n.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var esm_Ae=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},esm_Ne=class extends Error{result;constructor(){super("SkipAnimationSignal")}};var esm_Re=t=>t instanceof esm_X,Sn=1,esm_X=class extends esm_ge{id=Sn++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=dist_esm_k(this);return e&&e.getValue()}to(...e){return dist_esm_p.to(this,e)}interpolate(...e){return Jt(),dist_esm_p.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,n=!1){$t(this,{type:"change",parent:this,value:e,idle:n})}_onPriorityChange(e){this.idle||qe.sort(this),$t(this,{type:"priority",parent:this,priority:e})}};var esm_se=Symbol.for("SpringPhase"),esm_bt=1,rt=2,ot=4,esm_qe=t=>(t[esm_se]&esm_bt)>0,dist_esm_Q=t=>(t[esm_se]&rt)>0,esm_ye=t=>(t[esm_se]&ot)>0,st=(t,e)=>e?t[esm_se]|=rt|esm_bt:t[esm_se]&=~rt,esm_it=(t,e)=>e?t[esm_se]|=ot:t[esm_se]&=~ot;var esm_ue=class extends esm_X{key;animation=new dist_esm_Le;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,n){if(super(),!dist_esm_l.und(e)||!dist_esm_l.und(n)){let r=dist_esm_l.obj(e)?{...e}:{...n,from:e};dist_esm_l.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(dist_esm_Q(this)||this._state.asyncTo)||esm_ye(this)}get goal(){return ve(this.animation.to)}get velocity(){let e=dist_esm_k(this);return e instanceof animated_dist_esm_l?e.lastVelocity||0:e.getPayload().map(n=>n.lastVelocity||0)}get hasAnimated(){return esm_qe(this)}get isAnimating(){return dist_esm_Q(this)}get isPaused(){return esm_ye(this)}get isDelayed(){return this._state.delayed}advance(e){let n=!0,r=!1,o=this.animation,{config:s,toValues:a}=o,i=F(o.to);!i&&Pt(o.to)&&(a=ht(ve(o.to))),o.values.forEach((f,d)=>{if(f.done)return;let m=f.constructor==animated_dist_esm_d?1:i?i[d].lastPosition:a[d],b=o.immediate,c=m;if(!b){if(c=f.lastPosition,s.tension<=0){f.done=!0;return}let P=f.elapsedTime+=e,l=o.fromValues[d],h=f.v0!=null?f.v0:f.v0=dist_esm_l.arr(s.velocity)?s.velocity[d]:s.velocity,g,x=s.precision||(l==m?.005:Math.min(1,Math.abs(m-l)*.001));if(dist_esm_l.und(s.duration))if(s.decay){let S=s.decay===!0?.998:s.decay,A=Math.exp(-(1-S)*P);c=l+h/(1-S)*(1-A),b=Math.abs(f.lastPosition-c)<=x,g=h*A}else{g=f.lastVelocity==null?h:f.lastVelocity;let S=s.restVelocity||x/10,A=s.clamp?0:s.bounce,V=!dist_esm_l.und(A),_=l==m?f.v0>0:l<m,v,w=!1,C=1,$=Math.ceil(e/C);for(let L=0;L<$&&(v=Math.abs(g)>S,!(!v&&(b=Math.abs(m-c)<=x,b)));++L){V&&(w=c==m||c>m==_,w&&(g=-g*A,c=m));let N=-s.tension*1e-6*(c-m),y=-s.friction*.001*g,T=(N+y)/s.mass;g=g+T*C,c=c+g*C}}else{let S=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,f.durationProgress>0&&(f.elapsedTime=s.duration*f.durationProgress,P=f.elapsedTime+=e)),S=(s.progress||0)+P/this._memoizedDuration,S=S>1?1:S<0?0:S,f.durationProgress=S),c=l+s.easing(S)*(m-l),g=(c-f.lastPosition)/e,b=S==1}f.lastVelocity=g,Number.isNaN(c)&&(console.warn("Got NaN while animating:",this),b=!0)}i&&!i[d].done&&(b=!1),b?f.done=!0:n=!1,f.setValue(c,s.round)&&(r=!0)});let u=dist_esm_k(this),p=u.getValue();if(n){let f=ve(o.to);(p!==f||r)&&!s.decay?(u.setValue(f),this._onChange(f)):r&&s.decay&&this._onChange(p),this._stop()}else r&&this._onChange(p)}set(e){return esm_n.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(dist_esm_Q(this)){let{to:e,config:n}=this.animation;esm_n.batchedUpdates(()=>{this._onStart(),n.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,n){let r;return dist_esm_l.und(e)?(r=this.queue||[],this.queue=[]):r=[dist_esm_l.obj(e)?e:{...n,to:e}],Promise.all(r.map(o=>this._update(o))).then(o=>esm_be(this,o))}stop(e){let{to:n}=this.animation;return this._focus(this.get()),esm_oe(this._state,e&&this._lastCallId),esm_n.batchedUpdates(()=>this._stop(n,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){let n=this.key||"",{to:r,from:o}=e;r=dist_esm_l.obj(r)?r[n]:r,(r==null||esm_Ee(r))&&(r=void 0),o=dist_esm_l.obj(o)?o[n]:o,o==null&&(o=void 0);let s={to:r,from:o};return esm_qe(this)||(e.reverse&&([r,o]=[o,r]),o=ve(o),dist_esm_l.und(o)?dist_esm_k(this)||this._set(r):this._set(o)),s}_update({...e},n){let{key:r,defaultProps:o}=this;e.default&&Object.assign(o,dist_esm_ne(e,(i,u)=>/^on/.test(u)?et(i,r):i)),_t(this,e,"onProps"),esm_Ie(this,"onProps",e,this);let s=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let a=this._state;return esm_Me(++this._lastCallId,{key:r,props:e,defaultProps:o,state:a,actions:{pause:()=>{esm_ye(this)||(esm_it(this,!0),yt(a.pauseQueue),esm_Ie(this,"onPause",dist_esm_E(this,esm_Ce(this,this.animation.to)),this))},resume:()=>{esm_ye(this)&&(esm_it(this,!1),dist_esm_Q(this)&&this._resume(),yt(a.resumeQueue),esm_Ie(this,"onResume",dist_esm_E(this,esm_Ce(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(i=>{if(e.loop&&i.finished&&!(n&&i.noop)){let u=at(e);if(u)return this._update(u,!0)}return i})}_merge(e,n,r){if(n.cancel)return this.stop(!0),r(esm_q(this));let o=!dist_esm_l.und(e.to),s=!dist_esm_l.und(e.from);if(o||s)if(n.callId>this._lastToId)this._lastToId=n.callId;else return r(esm_q(this));let{key:a,defaultProps:i,animation:u}=this,{to:p,from:f}=u,{to:d=p,from:m=f}=e;s&&!o&&(!n.default||dist_esm_l.und(d))&&(d=m),n.reverse&&([d,m]=[m,d]);let b=!bt(m,f);b&&(u.from=m),m=ve(m);let c=!bt(d,p);c&&this._focus(d);let P=esm_Ee(n.to),{config:l}=u,{decay:h,velocity:g}=l;(o||s)&&(l.velocity=0),n.config&&!P&>(l,dist_esm_I(n.config,a),n.config!==i.config?dist_esm_I(i.config,a):void 0);let x=dist_esm_k(this);if(!x||dist_esm_l.und(d))return r(dist_esm_E(this,!0));let S=dist_esm_l.und(n.reset)?s&&!n.default:!dist_esm_l.und(m)&&esm_te(n.reset,a),A=S?m:this.get(),V=esm_me(d),_=dist_esm_l.num(V)||dist_esm_l.arr(V)||esm_or(V),v=!P&&(!_||esm_te(i.immediate||n.immediate,a));if(c){let L=esm_Le(d);if(L!==x.constructor)if(v)x=this._set(V);else throw Error(`Cannot animate between ${x.constructor.name} and ${L.name}, as the "to" prop suggests`)}let w=x.constructor,C=Pt(d),$=!1;if(!C){let L=S||!esm_qe(this)&&b;(c||L)&&($=bt(esm_me(A),V),C=!$),(!bt(u.immediate,v)&&!v||!bt(l.decay,h)||!bt(l.velocity,g))&&(C=!0)}if($&&dist_esm_Q(this)&&(u.changed&&!S?C=!0:C||this._stop(p)),!P&&((C||Pt(p))&&(u.values=x.getPayload(),u.toValues=Pt(d)?null:w==animated_dist_esm_d?[1]:ht(V)),u.immediate!=v&&(u.immediate=v,!v&&!S&&this._set(p)),C)){let{onRest:L}=u;esm_Ve(dist_esm_n,y=>_t(this,n,y));let N=dist_esm_E(this,esm_Ce(this,p));yt(this._pendingCalls,N),this._pendingCalls.add(r),u.changed&&esm_n.batchedUpdates(()=>{u.changed=!S,L?.(N,this),S?dist_esm_I(i.onRest,N):u.onStart?.(N,this)})}S&&this._set(A),P?r(esm_De(n.to,n,this._state,this)):C?this._start():dist_esm_Q(this)&&!c?this._pendingCalls.add(r):r(nt(A))}_focus(e){let n=this.animation;e!==n.to&&(esm_qt(this)&&this._detach(),n.to=e,esm_qt(this)&&this._attach())}_attach(){let e=0,{to:n}=this.animation;Pt(n)&&(Gt(n,this),esm_Re(n)&&(e=n.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Pt(e)&&Qt(e,this)}_set(e,n=!0){let r=ve(e);if(!dist_esm_l.und(r)){let o=dist_esm_k(this);if(!o||!bt(r,o.getValue())){let s=esm_Le(r);!o||o.constructor!=s?esm_D(this,s.create(r)):o.setValue(r),o&&esm_n.batchedUpdates(()=>{this._onChange(r,n)})}}return dist_esm_k(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,esm_Ie(this,"onStart",dist_esm_E(this,esm_Ce(this,e.to)),this))}_onChange(e,n){n||(this._onStart(),dist_esm_I(this.animation.onChange,e,this)),dist_esm_I(this.defaultProps.onChange,e,this),super._onChange(e,n)}_start(){let e=this.animation;dist_esm_k(this).reset(ve(e.to)),e.immediate||(e.fromValues=e.values.map(n=>n.lastPosition)),dist_esm_Q(this)||(st(this,!0),esm_ye(this)||this._resume())}_resume(){dist_esm_p.skipAnimation?this.finish():qe.start(this)}_stop(e,n){if(dist_esm_Q(this)){st(this,!1);let r=this.animation;esm_Ve(r.values,s=>{s.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),$t(this,{type:"idle",parent:this});let o=n?esm_q(this.get()):dist_esm_E(this.get(),esm_Ce(this,e??r.to));yt(this._pendingCalls,o),r.changed&&(r.changed=!1,esm_Ie(this,"onRest",o,this))}}};function esm_Ce(t,e){let n=esm_me(e),r=esm_me(t.get());return bt(r,n)}function at(t,e=t.loop,n=t.to){let r=dist_esm_I(e);if(r){let o=r!==!0&&esm_de(r),s=(o||t).reverse,a=!o||o.reset;return esm_Pe({...t,loop:e,default:!1,pause:void 0,to:!s||esm_Ee(n)?n:void 0,from:a?t.from:void 0,reset:a,...o})}}function esm_Pe(t){let{to:e,from:n}=t=esm_de(t),r=new Set;return dist_esm_l.obj(e)&&Vt(e,r),dist_esm_l.obj(n)&&Vt(n,r),t.keys=r.size?Array.from(r):null,t}function Ot(t){let e=esm_Pe(t);return R.und(e.default)&&(e.default=dist_esm_ne(e)),e}function Vt(t,e){xt(t,(n,r)=>n!=null&&e.add(r))}var dist_esm_n=["onStart","onRest","onChange","onPause","onResume"];function _t(t,e,n){t.animation[n]=e[n]!==esm_ke(e,n)?et(e[n],t.key):void 0}function esm_Ie(t,e,...n){t.animation[e]?.(...n),t.defaultProps[e]?.(...n)}var Fn=["onStart","onChange","onRest"],kn=1,esm_le=class{id=kn++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,n){this._onFrame=this._onFrame.bind(this),n&&(this._flush=n),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((n,r)=>e[r]=n.get()),e}set(e){for(let n in e){let r=e[n];dist_esm_l.und(r)||this.springs[n].set(r)}}update(e){return e&&this.queue.push(esm_Pe(e)),this}start(e){let{queue:n}=this;return e?n=ht(e).map(esm_Pe):this.queue=[],this._flush?this._flush(this,n):(jt(this,n),esm_ze(this,n))}stop(e,n){if(e!==!!e&&(n=e),n){let r=this.springs;esm_Ve(ht(n),o=>r[o].stop(!!e))}else esm_oe(this._state,this._lastAsyncId),this.each(r=>r.stop(!!e));return this}pause(e){if(dist_esm_l.und(e))this.start({pause:!0});else{let n=this.springs;esm_Ve(ht(e),r=>n[r].pause())}return this}resume(e){if(dist_esm_l.und(e))this.start({pause:!1});else{let n=this.springs;esm_Ve(ht(e),r=>n[r].resume())}return this}each(e){xt(this.springs,e)}_onFrame(){let{onStart:e,onChange:n,onRest:r}=this._events,o=this._active.size>0,s=this._changed.size>0;(o&&!this._started||s&&!this._started)&&(this._started=!0,Pe(e,([u,p])=>{p.value=this.get(),u(p,this,this._item)}));let a=!o&&this._started,i=s||a&&r.size?this.get():null;s&&n.size&&Pe(n,([u,p])=>{p.value=i,u(p,this,this._item)}),a&&(this._started=!1,Pe(r,([u,p])=>{p.value=i,u(p,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;esm_n.onFrame(this._onFrame)}};function esm_ze(t,e){return Promise.all(e.map(n=>wt(t,n))).then(n=>esm_be(t,n))}async function wt(t,e,n){let{keys:r,to:o,from:s,loop:a,onRest:i,onResolve:u}=e,p=dist_esm_l.obj(e.default)&&e.default;a&&(e.loop=!1),o===!1&&(e.to=null),s===!1&&(e.from=null);let f=dist_esm_l.arr(o)||dist_esm_l.fun(o)?o:void 0;f?(e.to=void 0,e.onRest=void 0,p&&(p.onRest=void 0)):esm_Ve(Fn,P=>{let l=e[P];if(dist_esm_l.fun(l)){let h=t._events[P];e[P]=({finished:g,cancelled:x})=>{let S=h.get(l);S?(g||(S.finished=!1),x&&(S.cancelled=!0)):h.set(l,{value:null,finished:g||!1,cancelled:x||!1})},p&&(p[P]=e[P])}});let d=t._state;e.pause===!d.paused?(d.paused=e.pause,yt(e.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(e.pause=!0);let m=(r||Object.keys(t.springs)).map(P=>t.springs[P].start(e)),b=e.cancel===!0||esm_ke(e,"cancel")===!0;(f||b&&d.asyncId)&&m.push(esm_Me(++t._lastAsyncId,{props:e,state:d,actions:{pause:Y,resume:Y,start(P,l){b?(esm_oe(d,t._lastAsyncId),l(esm_q(t))):(P.onRest=i,l(esm_De(f,P,d,t)))}}})),d.paused&&await new Promise(P=>{d.resumeQueue.add(P)});let c=esm_be(t,await Promise.all(m));if(a&&c.finished&&!(n&&c.noop)){let P=at(e,a,o);if(P)return jt(t,[P]),wt(t,P,!0)}return u&&esm_n.batchedUpdates(()=>u(c,t,t.item)),c}function esm_e(t,e){let n={...t.springs};return e&&pe(Ve(e),r=>{z.und(r.keys)&&(r=esm_Pe(r)),z.obj(r.to)||(r={...r,to:void 0}),Mt(n,r,o=>esm_Lt(o))}),pt(t,n),n}function pt(t,e){Ut(e,(n,r)=>{t.springs[r]||(t.springs[r]=n,Et(n,t))})}function esm_Lt(t,e){let n=new esm_ue;return n.key=t,e&&Gt(n,e),n}function Mt(t,e,n){e.keys&&esm_Ve(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function jt(t,e){esm_Ve(e,n=>{Mt(t.springs,n,r=>esm_Lt(r,t))})}var dist_esm_H=({children:t,...e})=>{let n=(0,external_React_.useContext)(esm_Ge),r=e.pause||!!n.pause,o=e.immediate||!!n.immediate;e=Lr(()=>({pause:r,immediate:o}),[r,o]);let{Provider:s}=esm_Ge;return external_React_.createElement(s,{value:e},t)},esm_Ge=wn(dist_esm_H,{});dist_esm_H.Provider=esm_Ge.Provider;dist_esm_H.Consumer=esm_Ge.Consumer;function wn(t,e){return Object.assign(t,external_React_.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}var esm_fe=()=>{let t=[],e=function(r){Ln();let o=[];return ce(t,(s,a)=>{if(Ke.und(r))o.push(s.start());else{let i=n(r,s,a);i&&o.push(s.start(i))}}),o};e.current=t,e.add=function(r){t.includes(r)||t.push(r)},e.delete=function(r){let o=t.indexOf(r);~o&&t.splice(o,1)},e.pause=function(){return ce(t,r=>r.pause(...arguments)),this},e.resume=function(){return ce(t,r=>r.resume(...arguments)),this},e.set=function(r){ce(t,(o,s)=>{let a=Ke.fun(r)?r(s,o):r;a&&o.set(a)})},e.start=function(r){let o=[];return ce(t,(s,a)=>{if(Ke.und(r))o.push(s.start());else{let i=this._getProps(r,s,a);i&&o.push(s.start(i))}}),o},e.stop=function(){return ce(t,r=>r.stop(...arguments)),this},e.update=function(r){return ce(t,(o,s)=>o.update(this._getProps(r,o,s))),this};let n=function(r,o,s){return Ke.fun(r)?r(s,o):r};return e._getProps=n,e};function esm_He(t,e,n){let r=jn.fun(e)&&e;r&&!n&&(n=[]);let o=Xe(()=>r||arguments.length==3?esm_fe():void 0,[]),s=Nt(0),a=Dn(),i=Xe(()=>({ctrls:[],queue:[],flush(h,g){let x=esm_e(h,g);return s.current>0&&!i.queue.length&&!Object.keys(x).some(A=>!h.springs[A])?esm_ze(h,g):new Promise(A=>{pt(h,x),i.queue.push(()=>{A(esm_ze(h,g))}),a()})}}),[]),u=Nt([...i.ctrls]),p=[],f=Dt(t)||0;Xe(()=>{Ye(u.current.slice(t,f),h=>{esm_xe(h,o),h.stop(!0)}),u.current.length=t,d(f,t)},[t]),Xe(()=>{d(0,Math.min(f,t))},n);function d(h,g){for(let x=h;x<g;x++){let S=u.current[x]||(u.current[x]=new esm_le(null,i.flush)),A=r?r(x,S):e[x];A&&(p[x]=Ot(A))}}let m=u.current.map((h,g)=>esm_e(h,p[g])),b=Mn(dist_esm_H),c=Dt(b),P=b!==c&&esm_Ue(b);qn(()=>{s.current++,i.ctrls=u.current;let{queue:h}=i;h.length&&(i.queue=[],Ye(h,g=>g())),Ye(u.current,(g,x)=>{o?.add(g),P&&g.start({default:b});let S=p[x];S&&(esm_he(g,S.ref),g.ref?g.queue.push(S):g.start(S))})}),Nn(()=>()=>{Ye(i.ctrls,h=>h.stop(!0))});let l=m.map(h=>({...h}));return o?[l,o]:l}function esm_J(t,e){let n=Qn.fun(t),[[r],o]=esm_He(1,n?t:[t],n?e||[]:e);return n||arguments.length==2?[r,o]:r}var Gn=()=>esm_fe(),Xo=()=>zn(Gn)[0];var Wo=(t,e)=>{let n=Bn(()=>new esm_ue(t,e));return Kn(()=>()=>{n.stop()}),n};function esm_Qt(t,e,n){let r=qt.fun(e)&&e;r&&!n&&(n=[]);let o=!0,s,a=esm_He(t,(i,u)=>{let p=r?r(i,u):e;return s=p.ref,o=o&&p.reverse,p},n||[{}]);if(Yn(()=>{Xn(a[1].current,(i,u)=>{let p=a[1].current[u+(o?1:-1)];if(esm_he(i,s),i.ref){p&&i.update({to:p.springs});return}p?i.start({to:p.springs}):i.start()})},n),r||arguments.length==3){let i=s??a[1];return i._getProps=(u,p,f)=>{let d=qt.fun(u)?u(f,p):u;if(d){let m=i.current[f+(d.reverse?1:-1)];return m&&(d.to=m.springs),d}},a}return a[0]}function esm_Gt(t,e,n){let r=G.fun(e)&&e,{reset:o,sort:s,trail:a=0,expires:i=!0,exitBeforeEnter:u=!1,onDestroyed:p,ref:f,config:d}=r?r():e,m=Jn(()=>r||arguments.length==3?esm_fe():void 0,[]),b=zt(t),c=[],P=lt(null),l=o?null:P.current;Je(()=>{P.current=c}),$n(()=>(j(c,y=>{m?.add(y.ctrl),y.ctrl.ref=m}),()=>{j(P.current,y=>{y.expired&&clearTimeout(y.expirationId),esm_xe(y.ctrl,m),y.ctrl.stop(!0)})}));let h=tr(b,r?r():e,l),g=o&&P.current||[];Je(()=>j(g,({ctrl:y,item:T,key:F})=>{esm_xe(y,m),dist_esm_I(p,T,F)}));let x=[];if(l&&j(l,(y,T)=>{y.expired?(clearTimeout(y.expirationId),g.push(y)):(T=x[T]=h.indexOf(y.key),~T&&(c[T]=y))}),j(b,(y,T)=>{c[T]||(c[T]={key:h[T],item:y,phase:"mount",ctrl:new esm_le},c[T].ctrl.item=y)}),x.length){let y=-1,{leave:T}=r?r():e;j(x,(F,k)=>{let O=l[k];~F?(y=c.indexOf(O),c[y]={...O,item:b[F]}):T&&c.splice(++y,0,O)})}G.fun(s)&&c.sort((y,T)=>s(y.item,T.item));let S=-a,A=Wn(),V=dist_esm_ne(e),_=new Map,v=lt(new Map),w=lt(!1);j(c,(y,T)=>{let F=y.key,k=y.phase,O=r?r():e,U,D,Jt=dist_esm_I(O.delay||0,F);if(k=="mount")U=O.enter,D="enter";else{let M=h.indexOf(F)<0;if(k!="leave")if(M)U=O.leave,D="leave";else if(U=O.update)D="update";else return;else if(!M)U=O.enter,D="enter";else return}if(U=dist_esm_I(U,y.item,T),U=G.obj(U)?esm_de(U):{to:U},!U.config){let M=d||V.config;U.config=dist_esm_I(M,y.item,T,D)}S+=a;let Z={...V,delay:Jt+S,ref:f,immediate:O.immediate,reset:!1,...U};if(D=="enter"&&G.und(Z.from)){let M=r?r():e,Te=G.und(M.initial)||l?M.from:M.initial;Z.from=dist_esm_I(Te,y.item,T)}let{onResolve:Wt}=Z;Z.onResolve=M=>{dist_esm_I(Wt,M);let Te=P.current,B=Te.find(Fe=>Fe.key===F);if(!!B&&!(M.cancelled&&B.phase!="update")&&B.ctrl.idle){let Fe=Te.every(ee=>ee.ctrl.idle);if(B.phase=="leave"){let ee=dist_esm_I(i,B.item);if(ee!==!1){let Ze=ee===!0?0:ee;if(B.expired=!0,!Fe&&Ze>0){Ze<=2147483647&&(B.expirationId=setTimeout(A,Ze));return}}}Fe&&Te.some(ee=>ee.expired)&&(v.current.delete(B),u&&(w.current=!0),A())}};let ft=esm_e(y.ctrl,Z);D==="leave"&&u?v.current.set(y,{phase:D,springs:ft,payload:Z}):_.set(y,{phase:D,springs:ft,payload:Z})});let C=Hn(dist_esm_H),$=Zn(C),L=C!==$&&esm_Ue(C);Je(()=>{L&&j(c,y=>{y.ctrl.start({default:C})})},[C]),j(_,(y,T)=>{if(v.current.size){let F=c.findIndex(k=>k.key===T.key);c.splice(F,1)}}),Je(()=>{j(v.current.size?v.current:_,({phase:y,payload:T},F)=>{let{ctrl:k}=F;F.phase=y,m?.add(k),L&&y=="enter"&&k.start({default:C}),T&&(esm_he(k,T.ref),(k.ref||m)&&!w.current?k.update(T):(k.start(T),w.current&&(w.current=!1)))})},o?void 0:n);let N=y=>Oe.createElement(Oe.Fragment,null,c.map((T,F)=>{let{springs:k}=_.get(T)||T.ctrl,O=y({...k},T.item,T,F);return O&&O.type?Oe.createElement(O.type,{...O.props,key:G.str(T.key)||G.num(T.key)?T.key:T.ctrl.id,ref:O.ref}):O}));return m?[N,m]:N}var esm_er=1;function tr(t,{key:e,keys:n=e},r){if(n===null){let o=new Set;return t.map(s=>{let a=r&&r.find(i=>i.item===s&&i.phase!=="leave"&&!o.has(i));return a?(o.add(a),a.key):esm_er++})}return G.und(n)?t:G.fun(n)?t.map(n):zt(n)}var hs=({container:t,...e}={})=>{let[n,r]=esm_J(()=>({scrollX:0,scrollY:0,scrollXProgress:0,scrollYProgress:0,...e}),[]);return or(()=>{let o=rr(({x:s,y:a})=>{r.start({scrollX:s.current,scrollXProgress:s.progress,scrollY:a.current,scrollYProgress:a.progress})},{container:t?.current||void 0});return()=>{nr(Object.values(n),s=>s.stop()),o()}},[]),n};var Ps=({container:t,...e})=>{let[n,r]=esm_J(()=>({width:0,height:0,...e}),[]);return ar(()=>{let o=sr(({width:s,height:a})=>{r.start({width:s,height:a,immediate:n.width.get()===0||n.height.get()===0})},{container:t?.current||void 0});return()=>{ir(Object.values(n),s=>s.stop()),o()}},[]),n};var cr={any:0,all:1};function Cs(t,e){let[n,r]=pr(!1),o=ur(),s=Bt.fun(t)&&t,a=s?s():{},{to:i={},from:u={},...p}=a,f=s?e:t,[d,m]=esm_J(()=>({from:u,...p}),[]);return lr(()=>{let b=o.current,{root:c,once:P,amount:l="any",...h}=f??{};if(!b||P&&n||typeof IntersectionObserver>"u")return;let g=new WeakMap,x=()=>(i&&m.start(i),r(!0),P?void 0:()=>{u&&m.start(u),r(!1)}),S=V=>{V.forEach(_=>{let v=g.get(_.target);if(_.isIntersecting!==Boolean(v))if(_.isIntersecting){let w=x();Bt.fun(w)?g.set(_.target,w):A.unobserve(_.target)}else v&&(v(),g.delete(_.target))})},A=new IntersectionObserver(S,{root:c&&c.current||void 0,threshold:typeof l=="number"||Array.isArray(l)?l:cr[l],...h});return A.observe(b),()=>A.unobserve(b)},[f]),s?[o,d]:[o,n]}function qs({children:t,...e}){return t(esm_J(e))}function Bs({items:t,children:e,...n}){let r=esm_Qt(t.length,n);return t.map((o,s)=>{let a=e(o,s);return fr.fun(a)?a(r[s]):a})}function Ys({items:t,children:e,...n}){return esm_Gt(t,n)(e)}var esm_W=class extends esm_X{constructor(n,r){super();this.source=n;this.calc=W(...r);let o=this._get(),s=esm_Le(o);esm_D(this,s.create(o))}key;idle=!0;calc;_active=new Set;advance(n){let r=this._get(),o=this.get();bt(r,o)||(dist_esm_k(this).setValue(r),this._onChange(r,this.idle)),!this.idle&&Yt(this._active)&&esm_ct(this)}_get(){let n=dist_esm_l.arr(this.source)?this.source.map(ve):ht(ve(this.source));return this.calc(...n)}_start(){this.idle&&!Yt(this._active)&&(this.idle=!1,esm_Ve(F(this),n=>{n.done=!1}),dist_esm_p.skipAnimation?(esm_n.batchedUpdates(()=>this.advance()),esm_ct(this)):qe.start(this))}_attach(){let n=1;esm_Ve(ht(this.source),r=>{Pt(r)&&Gt(r,this),esm_Re(r)&&(r.idle||this._active.add(r),n=Math.max(n,r.priority+1))}),this.priority=n,this._start()}_detach(){esm_Ve(ht(this.source),n=>{Pt(n)&&Qt(n,this)}),this._active.clear(),esm_ct(this)}eventObserved(n){n.type=="change"?n.idle?this.advance():(this._active.add(n.parent),this._start()):n.type=="idle"?this._active.delete(n.parent):n.type=="priority"&&(this.priority=ht(this.source).reduce((r,o)=>Math.max(r,(esm_Re(o)?o.priority:0)+1),0))}};function vr(t){return t.idle!==!1}function Yt(t){return!t.size||Array.from(t).every(vr)}function esm_ct(t){t.idle||(t.idle=!0,esm_Ve(F(t),e=>{e.done=!0}),$t(t,{type:"idle",parent:t}))}var ui=(t,...e)=>new esm_W(t,e),pi=(t,...e)=>(Cr(),new esm_W(t,e));dist_esm_p.assign({createStringInterpolator:Xt,to:(t,e)=>new esm_W(t,e)});var di=qe.advance;
;// external "ReactDOM"
const external_ReactDOM_namespaceObject = window["ReactDOM"];
;// ./node_modules/@react-spring/web/dist/esm/index.js
var web_dist_esm_k=/^--/;function web_dist_esm_I(t,e){return e==null||typeof e=="boolean"||e===""?"":typeof e=="number"&&e!==0&&!web_dist_esm_k.test(t)&&!(web_dist_esm_c.hasOwnProperty(t)&&web_dist_esm_c[t])?e+"px":(""+e).trim()}var web_dist_esm_v={};function esm_V(t,e){if(!t.nodeType||!t.setAttribute)return!1;let r=t.nodeName==="filter"||t.parentNode&&t.parentNode.nodeName==="filter",{style:i,children:s,scrollTop:u,scrollLeft:l,viewBox:a,...n}=e,d=Object.values(n),m=Object.keys(n).map(o=>r||t.hasAttribute(o)?o:web_dist_esm_v[o]||(web_dist_esm_v[o]=o.replace(/([A-Z])/g,p=>"-"+p.toLowerCase())));s!==void 0&&(t.textContent=s);for(let o in i)if(i.hasOwnProperty(o)){let p=web_dist_esm_I(o,i[o]);web_dist_esm_k.test(o)?t.style.setProperty(o,p):t.style[o]=p}m.forEach((o,p)=>{t.setAttribute(o,d[p])}),u!==void 0&&(t.scrollTop=u),l!==void 0&&(t.scrollLeft=l),a!==void 0&&t.setAttribute("viewBox",a)}var web_dist_esm_c={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},esm_F=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1),esm_L=["Webkit","Ms","Moz","O"];web_dist_esm_c=Object.keys(web_dist_esm_c).reduce((t,e)=>(esm_L.forEach(r=>t[esm_F(r,e)]=t[e]),t),web_dist_esm_c);var esm_=/^(matrix|translate|scale|rotate|skew)/,dist_esm_$=/^(translate)/,dist_esm_G=/^(rotate|skew)/,web_dist_esm_y=(t,e)=>dist_esm_l.num(t)&&t!==0?t+e:t,web_dist_esm_h=(t,e)=>dist_esm_l.arr(t)?t.every(r=>web_dist_esm_h(r,e)):dist_esm_l.num(t)?t===e:parseFloat(t)===e,dist_esm_g=class extends animated_dist_esm_u{constructor({x:e,y:r,z:i,...s}){let u=[],l=[];(e||r||i)&&(u.push([e||0,r||0,i||0]),l.push(a=>[`translate3d(${a.map(n=>web_dist_esm_y(n,"px")).join(",")})`,web_dist_esm_h(a,0)])),xt(s,(a,n)=>{if(n==="transform")u.push([a||""]),l.push(d=>[d,d===""]);else if(esm_.test(n)){if(delete s[n],dist_esm_l.und(a))return;let d=dist_esm_$.test(n)?"px":dist_esm_G.test(n)?"deg":"";u.push(ht(a)),l.push(n==="rotate3d"?([m,o,p,O])=>[`rotate3d(${m},${o},${p},${web_dist_esm_y(O,d)})`,web_dist_esm_h(O,0)]:m=>[`${n}(${m.map(o=>web_dist_esm_y(o,d)).join(",")})`,web_dist_esm_h(m,n.startsWith("scale")?1:0)])}}),u.length&&(s.transform=new web_dist_esm_x(u,l)),super(s)}},web_dist_esm_x=class extends esm_ge{constructor(r,i){super();this.inputs=r;this.transforms=i}_value=null;get(){return this._value||(this._value=this._get())}_get(){let r="",i=!0;return esm_Ve(this.inputs,(s,u)=>{let l=ve(s[0]),[a,n]=this.transforms[u](dist_esm_l.arr(l)?l:s.map(ve));r+=" "+a,i=i&&n}),i?"none":r}observerAdded(r){r==1&&esm_Ve(this.inputs,i=>esm_Ve(i,s=>Pt(s)&&Gt(s,this)))}observerRemoved(r){r==0&&esm_Ve(this.inputs,i=>esm_Ve(i,s=>Pt(s)&&Qt(s,this)))}eventObserved(r){r.type=="change"&&(this._value=null),$t(this,r)}};var esm_C=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];dist_esm_p.assign({batchedUpdates:external_ReactDOM_namespaceObject.unstable_batchedUpdates,createStringInterpolator:Xt,colors:It});var dist_esm_q=dist_esm_Ke(esm_C,{applyAnimatedValues:esm_V,createAnimatedStyle:t=>new dist_esm_g(t),getComponentProps:({scrollTop:t,scrollLeft:e,...r})=>r}),dist_esm_it=dist_esm_q.animated;
;// ./node_modules/@wordpress/edit-site/build-module/components/layout/animation.js
function getAbsolutePosition(element) {
return {
top: element.offsetTop,
left: element.offsetLeft
};
}
const ANIMATION_DURATION = 400;
function useMovingAnimation({ triggerAnimationOnChange }) {
const ref = (0,external_wp_element_.useRef)();
const { previous, prevRect } = (0,external_wp_element_.useMemo)(
() => ({
previous: ref.current && getAbsolutePosition(ref.current),
prevRect: ref.current && ref.current.getBoundingClientRect()
}),
[triggerAnimationOnChange]
);
(0,external_wp_element_.useLayoutEffect)(() => {
if (!previous || !ref.current) {
return;
}
const disableAnimation = window.matchMedia(
"(prefers-reduced-motion: reduce)"
).matches;
if (disableAnimation) {
return;
}
const controller = new esm_le({
x: 0,
y: 0,
width: prevRect.width,
height: prevRect.height,
config: {
duration: ANIMATION_DURATION,
easing: Lt.easeInOutQuint
},
onChange({ value }) {
if (!ref.current) {
return;
}
let { x: x2, y: y2, width: width2, height: height2 } = value;
x2 = Math.round(x2);
y2 = Math.round(y2);
width2 = Math.round(width2);
height2 = Math.round(height2);
const finishedMoving = x2 === 0 && y2 === 0;
ref.current.style.transformOrigin = "center center";
ref.current.style.transform = finishedMoving ? null : `translate3d(${x2}px,${y2}px,0)`;
ref.current.style.width = finishedMoving ? null : `${width2}px`;
ref.current.style.height = finishedMoving ? null : `${height2}px`;
}
});
ref.current.style.transform = void 0;
const destination = ref.current.getBoundingClientRect();
const x = Math.round(prevRect.left - destination.left);
const y = Math.round(prevRect.top - destination.top);
const width = destination.width;
const height = destination.height;
controller.start({
x: 0,
y: 0,
width,
height,
from: { x, y, width: prevRect.width, height: prevRect.height }
});
return () => {
controller.stop();
controller.set({
x: 0,
y: 0,
width: prevRect.width,
height: prevRect.height
});
};
}, [previous, prevRect]);
return ref;
}
var animation_default = useMovingAnimation;
;// ./node_modules/@wordpress/icons/build-module/library/check.js
var check_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) });
;// ./node_modules/@wordpress/edit-site/build-module/utils/is-previewing-theme.js
function isPreviewingTheme() {
return !!(0,external_wp_url_namespaceObject.getQueryArg)(window.location.href, "wp_theme_preview");
}
function currentlyPreviewingTheme() {
if (isPreviewingTheme()) {
return (0,external_wp_url_namespaceObject.getQueryArg)(window.location.href, "wp_theme_preview");
}
return null;
}
;// ./node_modules/@wordpress/edit-site/build-module/components/save-button/index.js
const { useLocation: save_button_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
function SaveButton({
className = "edit-site-save-button__button",
variant = "primary",
showTooltip = true,
showReviewMessage,
icon,
size,
__next40pxDefaultSize = false
}) {
const { params } = save_button_useLocation();
const { setIsSaveViewOpened } = (0,external_wp_data_.useDispatch)(store);
const { saveDirtyEntities } = unlock((0,external_wp_data_.useDispatch)(external_wp_editor_namespaceObject.store));
const { dirtyEntityRecords } = (0,external_wp_editor_namespaceObject.useEntitiesSavedStatesIsDirty)();
const { isSaving, isSaveViewOpen, previewingThemeName } = (0,external_wp_data_.useSelect)(
(select) => {
const { isSavingEntityRecord, isResolving } = select(external_wp_coreData_namespaceObject.store);
const { isSaveViewOpened } = select(store);
const isActivatingTheme = isResolving("activateTheme");
const currentlyPreviewingThemeId = currentlyPreviewingTheme();
return {
isSaving: dirtyEntityRecords.some(
(record) => isSavingEntityRecord(
record.kind,
record.name,
record.key
)
) || isActivatingTheme,
isSaveViewOpen: isSaveViewOpened(),
// Do not call `getTheme` with null, it will cause a request to
// the server.
previewingThemeName: currentlyPreviewingThemeId ? select(external_wp_coreData_namespaceObject.store).getTheme(currentlyPreviewingThemeId)?.name?.rendered : void 0
};
},
[dirtyEntityRecords]
);
const hasDirtyEntities = !!dirtyEntityRecords.length;
let isOnlyCurrentEntityDirty;
if (dirtyEntityRecords.length === 1) {
if (params.postId) {
isOnlyCurrentEntityDirty = `${dirtyEntityRecords[0].key}` === params.postId && dirtyEntityRecords[0].name === params.postType;
} else if (params.path?.includes("wp_global_styles")) {
isOnlyCurrentEntityDirty = dirtyEntityRecords[0].name === "globalStyles";
}
}
const disabled = isSaving || !hasDirtyEntities && !isPreviewingTheme();
const getLabel = () => {
if (isPreviewingTheme()) {
if (isSaving) {
return (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: The name of theme to be activated. */
(0,external_wp_i18n_namespaceObject.__)("Activating %s"),
previewingThemeName
);
} else if (disabled) {
return (0,external_wp_i18n_namespaceObject.__)("Saved");
} else if (hasDirtyEntities) {
return (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: The name of theme to be activated. */
(0,external_wp_i18n_namespaceObject.__)("Activate %s & Save"),
previewingThemeName
);
}
return (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: The name of theme to be activated. */
(0,external_wp_i18n_namespaceObject.__)("Activate %s"),
previewingThemeName
);
}
if (isSaving) {
return (0,external_wp_i18n_namespaceObject.__)("Saving");
}
if (disabled) {
return (0,external_wp_i18n_namespaceObject.__)("Saved");
}
if (!isOnlyCurrentEntityDirty && showReviewMessage) {
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %d: number of unsaved changes (number).
(0,external_wp_i18n_namespaceObject._n)(
"Review %d change\u2026",
"Review %d changes\u2026",
dirtyEntityRecords.length
),
dirtyEntityRecords.length
);
}
return (0,external_wp_i18n_namespaceObject.__)("Save");
};
const label = getLabel();
const onClick = isOnlyCurrentEntityDirty ? () => saveDirtyEntities({ dirtyEntityRecords }) : () => setIsSaveViewOpened(true);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant,
className,
"aria-disabled": disabled,
"aria-expanded": isSaveViewOpen,
isBusy: isSaving,
onClick: disabled ? void 0 : onClick,
label,
shortcut: disabled ? void 0 : external_wp_keycodes_namespaceObject.displayShortcut.primary("s"),
showTooltip,
icon,
__next40pxDefaultSize,
size,
children: label
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/save-hub/index.js
function SaveHub() {
const { isDisabled, isSaving } = (0,external_wp_data_.useSelect)((select) => {
const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } = select(external_wp_coreData_namespaceObject.store);
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
const _isSaving = dirtyEntityRecords.some(
(record) => isSavingEntityRecord(record.kind, record.name, record.key)
);
return {
isSaving: _isSaving,
isDisabled: _isSaving || !dirtyEntityRecords.length && !isPreviewingTheme()
};
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { className: "edit-site-save-hub", alignment: "right", spacing: 4, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SaveButton,
{
className: "edit-site-save-hub__button",
variant: isDisabled ? null : "primary",
showTooltip: false,
icon: isDisabled && !isSaving ? check_default : null,
showReviewMessage: true,
__next40pxDefaultSize: true
}
) });
}
;// ./node_modules/@wordpress/edit-site/build-module/utils/use-activate-theme.js
const { useHistory: use_activate_theme_useHistory, useLocation: use_activate_theme_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
function useActivateTheme() {
const history = use_activate_theme_useHistory();
const { path } = use_activate_theme_useLocation();
const { startResolution, finishResolution } = (0,external_wp_data_.useDispatch)(external_wp_coreData_namespaceObject.store);
return async () => {
if (isPreviewingTheme()) {
const activationURL = "themes.php?action=activate&stylesheet=" + currentlyPreviewingTheme() + "&_wpnonce=" + window.WP_BLOCK_THEME_ACTIVATE_NONCE;
startResolution("activateTheme");
await window.fetch(activationURL);
finishResolution("activateTheme");
history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { wp_theme_preview: "" }));
}
};
}
;// external ["wp","apiFetch"]
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
;// ./node_modules/@wordpress/edit-site/build-module/utils/use-actual-current-theme.js
const ACTIVE_THEMES_URL = "/wp/v2/themes?status=active";
function useActualCurrentTheme() {
const [currentTheme, setCurrentTheme] = (0,external_wp_element_.useState)();
(0,external_wp_element_.useEffect)(() => {
const path = (0,external_wp_url_namespaceObject.addQueryArgs)(ACTIVE_THEMES_URL, {
context: "edit",
wp_theme_preview: ""
});
external_wp_apiFetch_default()({ path }).then((activeThemes) => setCurrentTheme(activeThemes[0])).catch(() => {
});
}, []);
return currentTheme;
}
;// ./node_modules/@wordpress/edit-site/build-module/components/save-panel/index.js
const { EntitiesSavedStatesExtensible } = unlock(external_wp_editor_namespaceObject.privateApis);
const { useLocation: save_panel_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
const EntitiesSavedStatesForPreview = ({
onClose,
renderDialog,
variant
}) => {
const isDirtyProps = (0,external_wp_editor_namespaceObject.useEntitiesSavedStatesIsDirty)();
let activateSaveLabel;
if (isDirtyProps.isDirty) {
activateSaveLabel = (0,external_wp_i18n_namespaceObject.__)("Activate & Save");
} else {
activateSaveLabel = (0,external_wp_i18n_namespaceObject.__)("Activate");
}
const currentTheme = useActualCurrentTheme();
const previewingTheme = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).getCurrentTheme(),
[]
);
const additionalPrompt = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: The name of active theme, 2: The name of theme to be activated. */
(0,external_wp_i18n_namespaceObject.__)(
"Saving your changes will change your active theme from %1$s to %2$s."
),
currentTheme?.name?.rendered ?? "...",
previewingTheme?.name?.rendered ?? "..."
) });
const activateTheme = useActivateTheme();
const onSave = async (values) => {
await activateTheme();
return values;
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
EntitiesSavedStatesExtensible,
{
...{
...isDirtyProps,
additionalPrompt,
close: onClose,
onSave,
saveEnabled: true,
saveLabel: activateSaveLabel,
renderDialog,
variant
}
}
);
};
const _EntitiesSavedStates = ({ onClose, renderDialog, variant }) => {
if (isPreviewingTheme()) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
EntitiesSavedStatesForPreview,
{
onClose,
renderDialog,
variant
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_editor_namespaceObject.EntitiesSavedStates,
{
close: onClose,
renderDialog,
variant
}
);
};
function SavePanel() {
const { query } = save_panel_useLocation();
const { canvas = "view" } = query;
const { isSaveViewOpen, isDirty, isSaving } = (0,external_wp_data_.useSelect)((select) => {
const {
__experimentalGetDirtyEntityRecords,
isSavingEntityRecord,
isResolving
} = select(external_wp_coreData_namespaceObject.store);
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
const isActivatingTheme = isResolving("activateTheme");
const { isSaveViewOpened } = unlock(select(store));
return {
isSaveViewOpen: isSaveViewOpened(),
isDirty: dirtyEntityRecords.length > 0,
isSaving: dirtyEntityRecords.some(
(record) => isSavingEntityRecord(record.kind, record.name, record.key)
) || isActivatingTheme
};
}, []);
const { setIsSaveViewOpened } = (0,external_wp_data_.useDispatch)(store);
const onClose = () => setIsSaveViewOpened(false);
(0,external_wp_element_.useEffect)(() => {
setIsSaveViewOpened(false);
}, [canvas, setIsSaveViewOpened]);
if (canvas === "view") {
return isSaveViewOpen ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
className: "edit-site-save-panel__modal",
onRequestClose: onClose,
title: (0,external_wp_i18n_namespaceObject.__)("Review changes"),
size: "small",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(_EntitiesSavedStates, { onClose, variant: "inline" })
}
) : null;
}
const activateSaveEnabled = isPreviewingTheme() || isDirty;
const disabled = isSaving || !activateSaveEnabled;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
navigable_region_default,
{
className: dist_clsx("edit-site-layout__actions", {
"is-entity-save-view-open": isSaveViewOpen
}),
ariaLabel: (0,external_wp_i18n_namespaceObject.__)("Save panel"),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx("edit-site-editor__toggle-save-panel", {
"screen-reader-text": isSaveViewOpen
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "secondary",
className: "edit-site-editor__toggle-save-panel-button",
onClick: () => setIsSaveViewOpened(true),
"aria-haspopup": "dialog",
disabled,
accessibleWhenDisabled: true,
children: (0,external_wp_i18n_namespaceObject.__)("Open save panel")
}
)
}
),
isSaveViewOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(_EntitiesSavedStates, { onClose, renderDialog: true })
]
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/layout/index.js
const { useGlobalStyle: layout_useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const { GlobalStylesProvider } = unlock(external_wp_editor_namespaceObject.privateApis);
const { useLocation: layout_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
const layout_ANIMATION_DURATION = 0.3;
function Layout() {
const { query, name: routeKey, areas, widths } = layout_useLocation();
const { canvas = "view" } = query;
const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
const toggleRef = (0,external_wp_element_.useRef)();
const navigateRegionsProps = (0,external_wp_components_namespaceObject.__unstableUseNavigateRegions)();
const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
const [canvasResizer, canvasSize] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
const isEditorLoading = useIsSiteEditorLoading();
const [isResizableFrameOversized, setIsResizableFrameOversized] = (0,external_wp_element_.useState)(false);
const animationRef = animation_default({
triggerAnimationOnChange: routeKey + "-" + canvas
});
const { showIconLabels } = (0,external_wp_data_.useSelect)((select) => {
return {
showIconLabels: select(external_wp_preferences_.store).get(
"core",
"showIconLabels"
)
};
});
const [backgroundColor] = layout_useGlobalStyle("color.background");
const [gradientValue] = layout_useGlobalStyle("color.gradient");
const previousCanvaMode = (0,external_wp_compose_namespaceObject.usePrevious)(canvas);
(0,external_wp_element_.useEffect)(() => {
if (previousCanvaMode === "edit") {
toggleRef.current?.focus();
}
}, [canvas]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.UnsavedChangesWarning, {}),
canvas === "view" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SaveKeyboardShortcut, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
...navigateRegionsProps,
ref: navigateRegionsProps.ref,
className: dist_clsx(
"edit-site-layout",
navigateRegionsProps.className,
{
"is-full-canvas": canvas === "edit",
"show-icon-labels": showIconLabels
}
),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-site-layout__content", children: [
(!isMobileViewport || !areas.mobile) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
navigable_region_default,
{
ariaLabel: (0,external_wp_i18n_namespaceObject.__)("Navigation"),
className: "edit-site-layout__sidebar-region",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { children: canvas === "view" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
initial: { opacity: 0 },
animate: { opacity: 1 },
exit: { opacity: 0 },
transition: {
type: "tween",
duration: (
// Disable transition in mobile to emulate a full page transition.
disableMotion || isMobileViewport ? 0 : layout_ANIMATION_DURATION
),
ease: "easeOut"
},
className: "edit-site-layout__sidebar",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
site_hub_default,
{
ref: toggleRef,
isTransparent: isResizableFrameOversized
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationProvider, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarContent,
{
shouldAnimate: routeKey !== "styles",
routeKey,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.ErrorBoundary, { children: areas.sidebar })
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SaveHub, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SavePanel, {})
]
}
) })
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorSnackbars, {}),
isMobileViewport && areas.mobile && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-layout__mobile", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationProvider, { children: canvas !== "edit" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SiteHubMobile,
{
ref: toggleRef,
isTransparent: isResizableFrameOversized
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContent, { routeKey, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.ErrorBoundary, { children: areas.mobile }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SaveHub, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SavePanel, {})
] }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.ErrorBoundary, { children: areas.mobile }) }) }),
!isMobileViewport && areas.content && canvas !== "edit" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "edit-site-layout__area",
style: {
maxWidth: widths?.content
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.ErrorBoundary, { children: areas.content })
}
),
!isMobileViewport && areas.edit && canvas !== "edit" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "edit-site-layout__area",
style: {
maxWidth: widths?.edit
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.ErrorBoundary, { children: areas.edit })
}
),
!isMobileViewport && areas.preview && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-site-layout__canvas-container", children: [
canvasResizer,
!!canvasSize.width && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx(
"edit-site-layout__canvas",
{
"is-right-aligned": isResizableFrameOversized
}
),
ref: animationRef,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.ErrorBoundary, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
resizable_frame_default,
{
isReady: !isEditorLoading,
isFullWidth: canvas === "edit",
defaultSize: {
width: canvasSize.width - 24,
height: canvasSize.height
},
isOversized: isResizableFrameOversized,
setIsOversized: setIsResizableFrameOversized,
innerContentStyle: {
background: gradientValue ?? backgroundColor
},
children: areas.preview
}
) })
}
)
] })
] })
}
)
] });
}
function LayoutWithGlobalStylesProvider(props) {
const { createErrorNotice } = (0,external_wp_data_.useDispatch)(external_wp_notices_namespaceObject.store);
function onPluginAreaError(name) {
createErrorNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: plugin name */
(0,external_wp_i18n_namespaceObject.__)(
'The "%s" plugin has encountered an error and cannot be rendered.'
),
name
)
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SlotFillProvider, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(GlobalStylesProvider, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_plugins_namespaceObject.PluginArea, { onError: onPluginAreaError }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Layout, { ...props })
] }) });
}
;// ./node_modules/@wordpress/icons/build-module/library/help.js
var help_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 4a8 8 0 1 1 .001 16.001A8 8 0 0 1 12 4Zm0 1.5a6.5 6.5 0 1 0-.001 13.001A6.5 6.5 0 0 0 12 5.5Zm.75 11h-1.5V15h1.5v1.5Zm-.445-9.234a3 3 0 0 1 .445 5.89V14h-1.5v-1.25c0-.57.452-.958.917-1.01A1.5 1.5 0 0 0 12 8.75a1.5 1.5 0 0 0-1.5 1.5H9a3 3 0 0 1 3.305-2.984Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/rotate-right.js
var rotate_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/rotate-left.js
var rotate_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/backup.js
var backup_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z" }) });
;// ./node_modules/@wordpress/edit-site/build-module/hooks/commands/use-common-commands.js
const { useGlobalStylesReset } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const { useHistory: use_common_commands_useHistory, useLocation: use_common_commands_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
const getGlobalStylesToggleWelcomeGuideCommands = () => function useGlobalStylesToggleWelcomeGuideCommands() {
const { openGeneralSidebar } = unlock((0,external_wp_data_.useDispatch)(store));
const { params } = use_common_commands_useLocation();
const { canvas = "view" } = params;
const { set } = (0,external_wp_data_.useDispatch)(external_wp_preferences_.store);
const history = use_common_commands_useHistory();
const isBlockBasedTheme = (0,external_wp_data_.useSelect)((select) => {
return select(external_wp_coreData_namespaceObject.store).getCurrentTheme().is_block_theme;
}, []);
const commands = (0,external_wp_element_.useMemo)(() => {
if (!isBlockBasedTheme) {
return [];
}
return [
{
name: "core/edit-site/toggle-styles-welcome-guide",
label: (0,external_wp_i18n_namespaceObject.__)("Learn about styles"),
callback: ({ close }) => {
close();
if (canvas !== "edit") {
history.navigate("/styles?canvas=edit", {
transition: "canvas-mode-edit-transition"
});
}
openGeneralSidebar("edit-site/global-styles");
set("core/edit-site", "welcomeGuideStyles", true);
setTimeout(() => {
set("core/edit-site", "welcomeGuideStyles", true);
}, 500);
},
icon: help_default
}
];
}, [history, openGeneralSidebar, canvas, isBlockBasedTheme, set]);
return {
isLoading: false,
commands
};
};
const getGlobalStylesResetCommands = () => function useGlobalStylesResetCommands() {
const [canReset, onReset] = useGlobalStylesReset();
const commands = (0,external_wp_element_.useMemo)(() => {
if (!canReset) {
return [];
}
return [
{
name: "core/edit-site/reset-global-styles",
label: (0,external_wp_i18n_namespaceObject.__)("Reset styles"),
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? rotate_right_default : rotate_left_default,
callback: ({ close }) => {
close();
onReset();
}
}
];
}, [canReset, onReset]);
return {
isLoading: false,
commands
};
};
const getGlobalStylesOpenRevisionsCommands = () => function useGlobalStylesOpenRevisionsCommands() {
const { openGeneralSidebar, setEditorCanvasContainerView } = unlock(
(0,external_wp_data_.useDispatch)(store)
);
const { params } = use_common_commands_useLocation();
const { canvas = "view" } = params;
const history = use_common_commands_useHistory();
const hasRevisions = (0,external_wp_data_.useSelect)((select) => {
const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } = select(external_wp_coreData_namespaceObject.store);
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
const globalStyles = globalStylesId ? getEntityRecord("root", "globalStyles", globalStylesId) : void 0;
return !!globalStyles?._links?.["version-history"]?.[0]?.count;
}, []);
const commands = (0,external_wp_element_.useMemo)(() => {
if (!hasRevisions) {
return [];
}
return [
{
name: "core/edit-site/open-styles-revisions",
label: (0,external_wp_i18n_namespaceObject.__)("Open style revisions"),
icon: backup_default,
callback: ({ close }) => {
close();
if (canvas !== "edit") {
history.navigate("/styles?canvas=edit", {
transition: "canvas-mode-edit-transition"
});
}
openGeneralSidebar("edit-site/global-styles");
setEditorCanvasContainerView(
"global-styles-revisions"
);
}
}
];
}, [
history,
openGeneralSidebar,
setEditorCanvasContainerView,
hasRevisions,
canvas
]);
return {
isLoading: false,
commands
};
};
function useCommonCommands() {
(0,external_wp_commands_namespaceObject.useCommandLoader)({
name: "core/edit-site/toggle-styles-welcome-guide",
hook: getGlobalStylesToggleWelcomeGuideCommands()
});
(0,external_wp_commands_namespaceObject.useCommandLoader)({
name: "core/edit-site/reset-global-styles",
hook: getGlobalStylesResetCommands()
});
(0,external_wp_commands_namespaceObject.useCommandLoader)({
name: "core/edit-site/open-styles-revisions",
hook: getGlobalStylesOpenRevisionsCommands()
});
}
;// ./node_modules/@wordpress/icons/build-module/library/close-small.js
var close_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 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" }) });
;// ./node_modules/@wordpress/edit-site/build-module/components/editor-canvas-container/index.js
const { EditorContentSlotFill, ResizableEditor } = unlock(external_wp_editor_namespaceObject.privateApis);
function getEditorCanvasContainerTitle(view) {
switch (view) {
case "style-book":
return (0,external_wp_i18n_namespaceObject.__)("Style Book");
case "global-styles-revisions":
case "global-styles-revisions:style-book":
return (0,external_wp_i18n_namespaceObject.__)("Style Revisions");
default:
return "";
}
}
function EditorCanvasContainer({
children,
closeButtonLabel,
onClose,
enableResizing = false
}) {
const { editorCanvasContainerView, showListViewByDefault } = (0,external_wp_data_.useSelect)(
(select) => {
const _editorCanvasContainerView = unlock(
select(store)
).getEditorCanvasContainerView();
const _showListViewByDefault = select(external_wp_preferences_.store).get(
"core",
"showListViewByDefault"
);
return {
editorCanvasContainerView: _editorCanvasContainerView,
showListViewByDefault: _showListViewByDefault
};
},
[]
);
const [isClosed, setIsClosed] = (0,external_wp_element_.useState)(false);
const { setEditorCanvasContainerView } = unlock(
(0,external_wp_data_.useDispatch)(store)
);
const { setIsListViewOpened } = (0,external_wp_data_.useDispatch)(external_wp_editor_namespaceObject.store);
const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)("firstElement");
const sectionFocusReturnRef = (0,external_wp_compose_namespaceObject.useFocusReturn)();
function onCloseContainer() {
setIsListViewOpened(showListViewByDefault);
setEditorCanvasContainerView(void 0);
setIsClosed(true);
if (typeof onClose === "function") {
onClose();
}
}
function closeOnEscape(event) {
if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) {
event.preventDefault();
onCloseContainer();
}
}
const childrenWithProps = Array.isArray(children) ? external_wp_element_.Children.map(
children,
(child, index) => index === 0 ? (0,external_wp_element_.cloneElement)(child, {
ref: sectionFocusReturnRef
}) : child
) : (0,external_wp_element_.cloneElement)(children, {
ref: sectionFocusReturnRef
});
if (isClosed) {
return null;
}
const title = getEditorCanvasContainerTitle(editorCanvasContainerView);
const shouldShowCloseButton = onClose || closeButtonLabel;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorContentSlotFill.Fill, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-editor-canvas-container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableEditor, { enableResizing, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"section",
{
className: "edit-site-editor-canvas-container__section",
ref: shouldShowCloseButton ? focusOnMountRef : null,
onKeyDown: closeOnEscape,
"aria-label": title,
children: [
shouldShowCloseButton && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "compact",
className: "edit-site-editor-canvas-container__close-button",
icon: close_small_default,
label: closeButtonLabel || (0,external_wp_i18n_namespaceObject.__)("Close"),
onClick: onCloseContainer
}
),
childrenWithProps
]
}
) }) }) });
}
function useHasEditorCanvasContainer() {
const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(EditorContentSlotFill.name);
return !!fills?.length;
}
var editor_canvas_container_default = EditorCanvasContainer;
;// ./node_modules/@wordpress/edit-site/build-module/hooks/commands/use-set-command-context.js
const { useCommandContext } = unlock(external_wp_commands_namespaceObject.privateApis);
const { useLocation: use_set_command_context_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
function useSetCommandContext() {
const { query = {} } = use_set_command_context_useLocation();
const { canvas = "view" } = query;
const hasBlockSelected = (0,external_wp_data_.useSelect)((select) => {
return select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart();
}, []);
const hasEditorCanvasContainer = useHasEditorCanvasContainer();
let commandContext = "site-editor";
if (canvas === "edit") {
commandContext = "entity-edit";
}
if (hasBlockSelected) {
commandContext = "block-selection-edit";
}
if (hasEditorCanvasContainer) {
commandContext = "";
}
useCommandContext(commandContext);
}
;// ./node_modules/@wordpress/icons/build-module/library/styles.js
var styles_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/navigation.js
var navigation_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/page.js
var page_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z" })
] });
;// ./node_modules/@wordpress/icons/build-module/library/layout.js
var layout_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 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" }) });
;// ./node_modules/@wordpress/icons/build-module/library/symbol.js
var symbol_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/chevron-right.js
var chevron_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/chevron-left.js
var chevron_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) });
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-button/index.js
function SidebarButton(props) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "compact",
...props,
className: dist_clsx("edit-site-sidebar-button", props.className)
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen/index.js
const { useHistory: sidebar_navigation_screen_useHistory, useLocation: sidebar_navigation_screen_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
function SidebarNavigationScreen({
isRoot,
title,
actions,
content,
footer,
description,
backPath: backPathProp
}) {
const { dashboardLink, dashboardLinkText, previewingThemeName } = (0,external_wp_data_.useSelect)(
(select) => {
const { getSettings } = unlock(select(store));
const currentlyPreviewingThemeId = currentlyPreviewingTheme();
return {
dashboardLink: getSettings().__experimentalDashboardLink,
dashboardLinkText: getSettings().__experimentalDashboardLinkText,
// Do not call `getTheme` with null, it will cause a request to
// the server.
previewingThemeName: currentlyPreviewingThemeId ? select(external_wp_coreData_namespaceObject.store).getTheme(currentlyPreviewingThemeId)?.name?.rendered : void 0
};
},
[]
);
const location = sidebar_navigation_screen_useLocation();
const history = sidebar_navigation_screen_useHistory();
const { navigate } = (0,external_wp_element_.useContext)(SidebarNavigationContext);
const backPath = backPathProp ?? location.state?.backPath;
const icon = (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right_default : chevron_left_default;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
className: dist_clsx("edit-site-sidebar-navigation-screen__main", {
"has-footer": !!footer
}),
spacing: 0,
justify: "flex-start",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
spacing: 3,
alignment: "flex-start",
className: "edit-site-sidebar-navigation-screen__title-icon",
children: [
!isRoot && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarButton,
{
onClick: () => {
history.navigate(backPath);
navigate("back");
},
icon,
label: (0,external_wp_i18n_namespaceObject.__)("Back"),
showTooltip: false
}
),
isRoot && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarButton,
{
icon,
label: dashboardLinkText || (0,external_wp_i18n_namespaceObject.__)("Go to the Dashboard"),
href: dashboardLink
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHeading,
{
className: "edit-site-sidebar-navigation-screen__title",
color: "#e0e0e0",
level: 1,
size: 20,
children: !isPreviewingTheme() ? title : (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: theme name. 2: title */
(0,external_wp_i18n_namespaceObject.__)("Previewing %1$s: %2$s"),
previewingThemeName,
title
)
}
),
actions && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-sidebar-navigation-screen__actions", children: actions })
]
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-site-sidebar-navigation-screen__content", children: [
description && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-sidebar-navigation-screen__description", children: description }),
content
] })
]
}
),
footer && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("footer", { className: "edit-site-sidebar-navigation-screen__footer", children: footer })
] });
}
;// ./node_modules/@wordpress/icons/build-module/icon/index.js
var icon_default = (0,external_wp_element_.forwardRef)(
({ icon, size = 24, ...props }, ref) => {
return (0,external_wp_element_.cloneElement)(icon, {
width: size,
height: size,
...props,
ref
});
}
);
;// ./node_modules/@wordpress/icons/build-module/library/chevron-left-small.js
var chevron_left_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js
var chevron_right_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" }) });
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-item/index.js
const { useHistory: sidebar_navigation_item_useHistory, useLink } = unlock(external_wp_router_namespaceObject.privateApis);
function SidebarNavigationItem({
className,
icon,
withChevron = false,
suffix,
uid,
to,
onClick,
children,
...props
}) {
const history = sidebar_navigation_item_useHistory();
const { navigate } = (0,external_wp_element_.useContext)(SidebarNavigationContext);
function handleClick(e) {
if (onClick) {
onClick(e);
navigate("forward");
} else if (to) {
e.preventDefault();
history.navigate(to);
navigate("forward", `[id="${uid}"]`);
}
}
const linkProps = useLink(to);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalItem,
{
className: dist_clsx(
"edit-site-sidebar-navigation-item",
{ "with-suffix": !withChevron && suffix },
className
),
id: uid,
onClick: handleClick,
href: to ? linkProps.href : void 0,
...props,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", children: [
icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
icon_default,
{
style: { fill: "currentcolor" },
icon,
size: 24
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { children }),
withChevron && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
icon_default,
{
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_small_default : chevron_right_small_default,
className: "edit-site-sidebar-navigation-item__drilldown-indicator",
size: 24
}
),
!withChevron && suffix
] })
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js
const SITE_EDITOR_AUTHORS_QUERY = {
per_page: -1,
_fields: "id,name,avatar_urls",
context: "view",
capabilities: ["edit_theme_options"]
};
const DEFAULT_QUERY = { per_page: 100, page: 1 };
const use_global_styles_revisions_EMPTY_ARRAY = [];
const { GlobalStylesContext: use_global_styles_revisions_GlobalStylesContext } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function useGlobalStylesRevisions({ query } = {}) {
const { user: userConfig } = (0,external_wp_element_.useContext)(use_global_styles_revisions_GlobalStylesContext);
const _query = { ...DEFAULT_QUERY, ...query };
const {
authors,
currentUser,
isDirty,
revisions,
isLoadingGlobalStylesRevisions,
revisionsCount
} = (0,external_wp_data_.useSelect)(
(select) => {
const {
__experimentalGetDirtyEntityRecords,
getCurrentUser,
getUsers,
getRevisions,
__experimentalGetCurrentGlobalStylesId,
getEntityRecord,
isResolving
} = select(external_wp_coreData_namespaceObject.store);
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
const _currentUser = getCurrentUser();
const _isDirty = dirtyEntityRecords.length > 0;
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
const globalStyles = globalStylesId ? getEntityRecord("root", "globalStyles", globalStylesId) : void 0;
const _revisionsCount = globalStyles?._links?.["version-history"]?.[0]?.count ?? 0;
const globalStylesRevisions = getRevisions(
"root",
"globalStyles",
globalStylesId,
_query
) || use_global_styles_revisions_EMPTY_ARRAY;
const _authors = getUsers(SITE_EDITOR_AUTHORS_QUERY) || use_global_styles_revisions_EMPTY_ARRAY;
const _isResolving = isResolving("getRevisions", [
"root",
"globalStyles",
globalStylesId,
_query
]);
return {
authors: _authors,
currentUser: _currentUser,
isDirty: _isDirty,
revisions: globalStylesRevisions,
isLoadingGlobalStylesRevisions: _isResolving,
revisionsCount: _revisionsCount
};
},
[query]
);
return (0,external_wp_element_.useMemo)(() => {
if (!authors.length || isLoadingGlobalStylesRevisions) {
return {
revisions: use_global_styles_revisions_EMPTY_ARRAY,
hasUnsavedChanges: isDirty,
isLoading: true,
revisionsCount
};
}
const _modifiedRevisions = revisions.map((revision) => {
return {
...revision,
author: authors.find(
(author) => author.id === revision.author
)
};
});
const fetchedRevisionsCount = revisions.length;
if (fetchedRevisionsCount) {
if (_modifiedRevisions[0].id !== "unsaved" && _query.page === 1) {
_modifiedRevisions[0].isLatest = true;
}
if (isDirty && userConfig && Object.keys(userConfig).length > 0 && currentUser && _query.page === 1) {
const unsavedRevision = {
id: "unsaved",
styles: userConfig?.styles,
settings: userConfig?.settings,
_links: userConfig?._links,
author: {
name: currentUser?.name,
avatar_urls: currentUser?.avatar_urls
},
modified: /* @__PURE__ */ new Date()
};
_modifiedRevisions.unshift(unsavedRevision);
}
if (_query.page === Math.ceil(revisionsCount / _query.per_page)) {
_modifiedRevisions.push({
id: "parent",
styles: {},
settings: {}
});
}
}
return {
revisions: _modifiedRevisions,
hasUnsavedChanges: isDirty,
isLoading: false,
revisionsCount
};
}, [
isDirty,
revisions,
currentUser,
authors,
userConfig,
isLoadingGlobalStylesRevisions
]);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-details-footer/index.js
function SidebarNavigationScreenDetailsFooter({
record,
revisionsCount,
...otherProps
}) {
const hrefProps = {};
const lastRevisionId = record?._links?.["predecessor-version"]?.[0]?.id ?? null;
revisionsCount = revisionsCount || record?._links?.["version-history"]?.[0]?.count || 0;
if (lastRevisionId && revisionsCount > 1) {
hrefProps.href = (0,external_wp_url_namespaceObject.addQueryArgs)("revision.php", {
revision: record?._links["predecessor-version"][0].id
});
hrefProps.as = "a";
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalItemGroup,
{
size: "large",
className: "edit-site-sidebar-navigation-screen-details-footer",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationItem,
{
icon: backup_default,
...hrefProps,
...otherProps,
children: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: Number of Styles revisions. */
(0,external_wp_i18n_namespaceObject._n)("%d Revision", "%d Revisions", revisionsCount),
revisionsCount
)
}
)
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-global-styles/index.js
const { useLocation: sidebar_navigation_screen_global_styles_useLocation, useHistory: sidebar_navigation_screen_global_styles_useHistory } = unlock(external_wp_router_namespaceObject.privateApis);
function SidebarNavigationItemGlobalStyles(props) {
const { name } = sidebar_navigation_screen_global_styles_useLocation();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationItem,
{
...props,
"aria-current": name === "styles"
}
);
}
function SidebarNavigationScreenGlobalStyles() {
const history = sidebar_navigation_screen_global_styles_useHistory();
const { path } = sidebar_navigation_screen_global_styles_useLocation();
const {
revisions,
isLoading: isLoadingRevisions,
revisionsCount
} = useGlobalStylesRevisions();
const { openGeneralSidebar } = (0,external_wp_data_.useDispatch)(store);
const { setEditorCanvasContainerView } = unlock(
(0,external_wp_data_.useDispatch)(store)
);
const { set: setPreference } = (0,external_wp_data_.useDispatch)(external_wp_preferences_.store);
const openGlobalStyles = (0,external_wp_element_.useCallback)(async () => {
history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { canvas: "edit" }), {
transition: "canvas-mode-edit-transition"
});
return Promise.all([
setPreference("core", "distractionFree", false),
openGeneralSidebar("edit-site/global-styles")
]);
}, [path, history, openGeneralSidebar, setPreference]);
const openRevisions = (0,external_wp_element_.useCallback)(async () => {
await openGlobalStyles();
setEditorCanvasContainerView("global-styles-revisions");
}, [openGlobalStyles, setEditorCanvasContainerView]);
const shouldShowGlobalStylesFooter = !!revisionsCount && !isLoadingRevisions;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationScreen,
{
title: (0,external_wp_i18n_namespaceObject.__)("Design"),
isRoot: true,
description: (0,external_wp_i18n_namespaceObject.__)(
"Customize the appearance of your website using the block editor."
),
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MainSidebarNavigationContent, { activeItem: "styles-navigation-item" }),
footer: shouldShowGlobalStylesFooter && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationScreenDetailsFooter,
{
record: revisions?.[0],
revisionsCount,
onClick: openRevisions
}
)
}
) });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-main/index.js
function MainSidebarNavigationContent({ isBlockBasedTheme = true }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-main", children: [
isBlockBasedTheme && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationItemGlobalStyles,
{
to: "/styles",
uid: "global-styles-navigation-item",
icon: styles_default,
children: (0,external_wp_i18n_namespaceObject.__)("Styles")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationItem,
{
uid: "navigation-navigation-item",
to: "/navigation",
withChevron: true,
icon: navigation_default,
children: (0,external_wp_i18n_namespaceObject.__)("Navigation")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationItem,
{
uid: "page-navigation-item",
to: "/page",
withChevron: true,
icon: page_default,
children: (0,external_wp_i18n_namespaceObject.__)("Pages")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationItem,
{
uid: "template-navigation-item",
to: "/template",
withChevron: true,
icon: layout_default,
children: (0,external_wp_i18n_namespaceObject.__)("Templates")
}
)
] }),
!isBlockBasedTheme && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationItem,
{
uid: "stylebook-navigation-item",
to: "/stylebook",
withChevron: true,
icon: styles_default,
children: (0,external_wp_i18n_namespaceObject.__)("Styles")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationItem,
{
uid: "patterns-navigation-item",
to: "/pattern",
withChevron: true,
icon: symbol_default,
children: (0,external_wp_i18n_namespaceObject.__)("Patterns")
}
)
] });
}
function SidebarNavigationScreenMain({ customDescription }) {
const isBlockBasedTheme = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme,
[]
);
const { setEditorCanvasContainerView } = unlock(
(0,external_wp_data_.useDispatch)(store)
);
(0,external_wp_element_.useEffect)(() => {
setEditorCanvasContainerView(void 0);
}, [setEditorCanvasContainerView]);
let description;
if (customDescription) {
description = customDescription;
} else if (isBlockBasedTheme) {
description = (0,external_wp_i18n_namespaceObject.__)(
"Customize the appearance of your website using the block editor."
);
} else {
description = (0,external_wp_i18n_namespaceObject.__)(
"Explore block styles and patterns to refine your site."
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationScreen,
{
isRoot: true,
title: (0,external_wp_i18n_namespaceObject.__)("Design"),
description,
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
MainSidebarNavigationContent,
{
isBlockBasedTheme
}
)
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-unsupported/index.js
function SidebarNavigationScreenUnsupported() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { padding: 3, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "warning", isDismissible: false, children: (0,external_wp_i18n_namespaceObject.__)(
"The theme you are currently using does not support this screen."
) }) });
}
;// ./node_modules/@wordpress/icons/build-module/library/arrow-up-left.js
var arrow_up_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M14 6H6v8h1.5V8.5L17 18l1-1-9.5-9.5H14V6Z" }) });
;// ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/image.js
function WelcomeGuideImage({ nonAnimatedSrc, animatedSrc }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("picture", { className: "edit-site-welcome-guide__image", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"source",
{
srcSet: nonAnimatedSrc,
media: "(prefers-reduced-motion: reduce)"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: animatedSrc, width: "312", height: "240", alt: "" })
] });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/editor.js
function WelcomeGuideEditor() {
const { toggle } = (0,external_wp_data_.useDispatch)(external_wp_preferences_.store);
const { isActive, isBlockBasedTheme } = (0,external_wp_data_.useSelect)((select) => {
return {
isActive: !!select(external_wp_preferences_.store).get(
"core/edit-site",
"welcomeGuide"
),
isBlockBasedTheme: select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme
};
}, []);
if (!isActive || !isBlockBasedTheme) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Guide,
{
className: "edit-site-welcome-guide guide-editor",
contentLabel: (0,external_wp_i18n_namespaceObject.__)("Welcome to the site editor"),
finishButtonText: (0,external_wp_i18n_namespaceObject.__)("Get started"),
onFinish: () => toggle("core/edit-site", "welcomeGuide"),
pages: [
{
image: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
WelcomeGuideImage,
{
nonAnimatedSrc: "https://s.w.org/images/block-editor/edit-your-site.svg?1",
animatedSrc: "https://s.w.org/images/block-editor/edit-your-site.gif?1"
}
),
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-site-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)("Edit your site") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-site-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)(
"Design everything on your site \u2014 from the header right down to the footer \u2014 using blocks."
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-site-welcome-guide__text", children: (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.__)(
"Click <StylesIconImage /> to start designing your blocks, and choose your typography, layout, and colors."
),
{
StylesIconImage: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
alt: (0,external_wp_i18n_namespaceObject.__)("styles"),
src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A"
}
)
}
) })
] })
}
]
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/styles.js
const { interfaceStore: styles_interfaceStore } = unlock(external_wp_editor_namespaceObject.privateApis);
function WelcomeGuideStyles() {
const { toggle } = (0,external_wp_data_.useDispatch)(external_wp_preferences_.store);
const { isActive, isStylesOpen } = (0,external_wp_data_.useSelect)((select) => {
const sidebar = select(styles_interfaceStore).getActiveComplementaryArea("core");
return {
isActive: !!select(external_wp_preferences_.store).get(
"core/edit-site",
"welcomeGuideStyles"
),
isStylesOpen: sidebar === "edit-site/global-styles"
};
}, []);
if (!isActive || !isStylesOpen) {
return null;
}
const welcomeLabel = (0,external_wp_i18n_namespaceObject.__)("Welcome to Styles");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Guide,
{
className: "edit-site-welcome-guide guide-styles",
contentLabel: welcomeLabel,
finishButtonText: (0,external_wp_i18n_namespaceObject.__)("Get started"),
onFinish: () => toggle("core/edit-site", "welcomeGuideStyles"),
pages: [
{
image: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
WelcomeGuideImage,
{
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-to-styles.svg?1",
animatedSrc: "https://s.w.org/images/block-editor/welcome-to-styles.gif?1"
}
),
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-site-welcome-guide__heading", children: welcomeLabel }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-site-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)(
"Tweak your site, or give it a whole new look! Get creative \u2014 how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here."
) })
] })
},
{
image: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
WelcomeGuideImage,
{
nonAnimatedSrc: "https://s.w.org/images/block-editor/set-the-design.svg?1",
animatedSrc: "https://s.w.org/images/block-editor/set-the-design.gif?1"
}
),
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-site-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)("Set the design") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-site-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)(
"You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle!"
) })
] })
},
{
image: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
WelcomeGuideImage,
{
nonAnimatedSrc: "https://s.w.org/images/block-editor/personalize-blocks.svg?1",
animatedSrc: "https://s.w.org/images/block-editor/personalize-blocks.gif?1"
}
),
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-site-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)("Personalize blocks") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-site-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)(
"You can adjust your blocks to ensure a cohesive experience across your site \u2014 add your unique colors to a branded Button block, or adjust the Heading block to your preferred size."
) })
] })
},
{
image: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
WelcomeGuideImage,
{
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg",
animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif"
}
),
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-site-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)("Learn more") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { className: "edit-site-welcome-guide__text", children: [
(0,external_wp_i18n_namespaceObject.__)(
"New to block themes and styling your site?"
),
" ",
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ExternalLink,
{
href: (0,external_wp_i18n_namespaceObject.__)(
"https://wordpress.org/documentation/article/styles-overview/"
),
children: (0,external_wp_i18n_namespaceObject.__)(
"Here\u2019s a detailed guide to learn how to make the most of it."
)
}
)
] })
] })
}
]
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/page.js
function WelcomeGuidePage() {
const { toggle } = (0,external_wp_data_.useDispatch)(external_wp_preferences_.store);
const isVisible = (0,external_wp_data_.useSelect)((select) => {
const isPageActive = !!select(external_wp_preferences_.store).get(
"core/edit-site",
"welcomeGuidePage"
);
const isEditorActive = !!select(external_wp_preferences_.store).get(
"core/edit-site",
"welcomeGuide"
);
return isPageActive && !isEditorActive;
}, []);
if (!isVisible) {
return null;
}
const heading = (0,external_wp_i18n_namespaceObject.__)("Editing a page");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Guide,
{
className: "edit-site-welcome-guide guide-page",
contentLabel: heading,
finishButtonText: (0,external_wp_i18n_namespaceObject.__)("Continue"),
onFinish: () => toggle("core/edit-site", "welcomeGuidePage"),
pages: [
{
image: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"video",
{
className: "edit-site-welcome-guide__video",
autoPlay: true,
loop: true,
muted: true,
width: "312",
height: "240",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"source",
{
src: "https://s.w.org/images/block-editor/editing-your-page.mp4",
type: "video/mp4"
}
)
}
),
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-site-welcome-guide__heading", children: heading }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-site-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)(
// eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts
"It\u2019s now possible to edit page content in the site editor. To customise other parts of the page like the header and footer switch to editing the template using the settings sidebar."
) })
] })
}
]
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/template.js
function WelcomeGuideTemplate() {
const { toggle } = (0,external_wp_data_.useDispatch)(external_wp_preferences_.store);
const { isActive, hasPreviousEntity } = (0,external_wp_data_.useSelect)((select) => {
const { getEditorSettings } = select(external_wp_editor_namespaceObject.store);
const { get } = select(external_wp_preferences_.store);
return {
isActive: get("core/edit-site", "welcomeGuideTemplate"),
hasPreviousEntity: !!getEditorSettings().onNavigateToPreviousEntityRecord
};
}, []);
const isVisible = isActive && hasPreviousEntity;
if (!isVisible) {
return null;
}
const heading = (0,external_wp_i18n_namespaceObject.__)("Editing a template");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Guide,
{
className: "edit-site-welcome-guide guide-template",
contentLabel: heading,
finishButtonText: (0,external_wp_i18n_namespaceObject.__)("Continue"),
onFinish: () => toggle("core/edit-site", "welcomeGuideTemplate"),
pages: [
{
image: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"video",
{
className: "edit-site-welcome-guide__video",
autoPlay: true,
loop: true,
muted: true,
width: "312",
height: "240",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"source",
{
src: "https://s.w.org/images/block-editor/editing-your-template.mp4",
type: "video/mp4"
}
)
}
),
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-site-welcome-guide__heading", children: heading }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-site-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)(
"Note that the same template can be used by multiple pages, so any changes made here may affect other pages on the site. To switch back to editing the page content click the \u2018Back\u2019 button in the toolbar."
) })
] })
}
]
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/index.js
function WelcomeGuide({ postType }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideEditor, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideStyles, {}),
postType === "page" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuidePage, {}),
postType === "wp_template" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideTemplate, {})
] });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles-renderer/index.js
const { useGlobalStylesOutput } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function useGlobalStylesRenderer(disableRootPadding) {
const [styles, settings] = useGlobalStylesOutput(disableRootPadding);
const { getSettings } = (0,external_wp_data_.useSelect)(store);
const { updateSettings } = (0,external_wp_data_.useDispatch)(store);
(0,external_wp_element_.useEffect)(() => {
if (!styles || !settings) {
return;
}
const currentStoreSettings = getSettings();
const nonGlobalStyles = Object.values(
currentStoreSettings.styles ?? []
).filter((style) => !style.isGlobalStyles);
updateSettings({
...currentStoreSettings,
styles: [...nonGlobalStyles, ...styles],
__experimentalFeatures: settings
});
}, [styles, settings, updateSettings, getSettings]);
}
function GlobalStylesRenderer({ disableRootPadding }) {
useGlobalStylesRenderer(disableRootPadding);
return null;
}
;// ./node_modules/@wordpress/edit-site/build-module/components/canvas-loader/index.js
const { Theme } = unlock(external_wp_components_namespaceObject.privateApis);
const { useGlobalStyle: canvas_loader_useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function CanvasLoader({ id }) {
const [fallbackIndicatorColor] = canvas_loader_useGlobalStyle("color.text");
const [backgroundColor] = canvas_loader_useGlobalStyle("color.background");
const { highlightedColors } = useStylesPreviewColors();
const indicatorColor = highlightedColors[0]?.color ?? fallbackIndicatorColor;
const { elapsed, total } = (0,external_wp_data_.useSelect)((select) => {
const selectorsByStatus = select(external_wp_coreData_namespaceObject.store).countSelectorsByStatus();
const resolving = selectorsByStatus.resolving ?? 0;
const finished = selectorsByStatus.finished ?? 0;
return {
elapsed: finished,
total: finished + resolving
};
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-canvas-loader", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Theme, { accent: indicatorColor, background: backgroundColor, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ProgressBar, { id, max: total, value: elapsed }) }) });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/block-editor/use-navigate-to-entity-record.js
const { useHistory: use_navigate_to_entity_record_useHistory } = unlock(external_wp_router_namespaceObject.privateApis);
function useNavigateToEntityRecord() {
const history = use_navigate_to_entity_record_useHistory();
const onNavigateToEntityRecord = (0,external_wp_element_.useCallback)(
(params) => {
history.navigate(
`/${params.postType}/${params.postId}?canvas=edit&focusMode=true`
);
},
[history]
);
return onNavigateToEntityRecord;
}
;// ./node_modules/@wordpress/edit-site/build-module/components/block-editor/use-site-editor-settings.js
const { useLocation: use_site_editor_settings_useLocation, useHistory: use_site_editor_settings_useHistory } = unlock(external_wp_router_namespaceObject.privateApis);
function useNavigateToPreviousEntityRecord() {
const location = use_site_editor_settings_useLocation();
const previousLocation = (0,external_wp_compose_namespaceObject.usePrevious)(location);
const history = use_site_editor_settings_useHistory();
const goBack = (0,external_wp_element_.useMemo)(() => {
const isFocusMode = location.query.focusMode || location?.params?.postId && FOCUSABLE_ENTITIES.includes(location?.params?.postType);
const didComeFromEditorCanvas = previousLocation?.query.canvas === "edit";
const showBackButton = isFocusMode && didComeFromEditorCanvas;
return showBackButton ? () => history.back() : void 0;
}, [location, history]);
return goBack;
}
function useSpecificEditorSettings() {
const { query } = use_site_editor_settings_useLocation();
const { canvas = "view" } = query;
const onNavigateToEntityRecord = useNavigateToEntityRecord();
const { settings } = (0,external_wp_data_.useSelect)((select) => {
const { getSettings } = select(store);
return {
settings: getSettings()
};
}, []);
const onNavigateToPreviousEntityRecord = useNavigateToPreviousEntityRecord();
const defaultEditorSettings = (0,external_wp_element_.useMemo)(() => {
return {
...settings,
richEditingEnabled: true,
supportsTemplateMode: true,
focusMode: canvas !== "view",
onNavigateToEntityRecord,
onNavigateToPreviousEntityRecord,
isPreviewMode: canvas === "view"
};
}, [
settings,
canvas,
onNavigateToEntityRecord,
onNavigateToPreviousEntityRecord
]);
return defaultEditorSettings;
}
;// ./node_modules/@wordpress/edit-site/build-module/components/plugin-template-setting-panel/index.js
const { Fill, Slot } = (0,external_wp_components_namespaceObject.createSlotFill)("PluginTemplateSettingPanel");
const PluginTemplateSettingPanel = ({ children }) => {
external_wp_deprecated_default()("wp.editSite.PluginTemplateSettingPanel", {
since: "6.6",
version: "6.8",
alternative: "wp.editor.PluginDocumentSettingPanel"
});
const isCurrentEntityTemplate = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_editor_namespaceObject.store).getCurrentPostType() === "wp_template",
[]
);
if (!isCurrentEntityTemplate) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Fill, { children });
};
PluginTemplateSettingPanel.Slot = Slot;
var plugin_template_setting_panel_default = PluginTemplateSettingPanel;
;// ./node_modules/@wordpress/icons/build-module/library/seen.js
var seen_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/more-vertical.js
var more_vertical_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) });
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/icon-with-current-color.js
function IconWithCurrentColor({ className, ...props }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Icon,
{
className: dist_clsx(
className,
"edit-site-global-styles-icon-with-current-color"
),
...props
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/navigation-button.js
function GenericNavigationButton({ icon, children, ...props }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItem, { ...props, children: [
icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(IconWithCurrentColor, { icon, size: 24 }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children })
] }),
!icon && children
] });
}
function NavigationButtonAsItem(props) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.Button, { as: GenericNavigationButton, ...props });
}
function NavigationBackButtonAsItem(props) {
return /* @__PURE__ */ jsx(Navigator.BackButton, { as: GenericNavigationButton, ...props });
}
;// ./node_modules/@wordpress/icons/build-module/library/typography.js
var typography_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m8.6 7 3.9 10.8h-1.7l-1-2.8H5.7l-1 2.8H3L6.9 7h1.7Zm-2.4 6.6h3L7.7 9.3l-1.5 4.3ZM17.691 8.879c.473 0 .88.055 1.221.165.352.1.643.264.875.495.274.253.456.572.544.957.088.374.132.83.132 1.37v4.554c0 .274.033.472.099.593.077.11.198.166.363.166.11 0 .215-.028.313-.083.11-.055.237-.137.38-.247l.165.28a3.304 3.304 0 0 1-.71.446c-.23.11-.527.165-.89.165-.352 0-.639-.055-.858-.165-.22-.11-.386-.27-.495-.479-.1-.209-.149-.468-.149-.775-.286.462-.627.814-1.023 1.056-.396.242-.858.363-1.386.363-.462 0-.858-.088-1.188-.264a1.752 1.752 0 0 1-.742-.726 2.201 2.201 0 0 1-.248-1.056c0-.484.11-.875.33-1.172.22-.308.5-.556.841-.742.352-.187.721-.341 1.106-.462.396-.132.765-.253 1.106-.363.351-.121.637-.259.857-.413.232-.154.347-.357.347-.61V10.81c0-.396-.066-.71-.198-.941a1.05 1.05 0 0 0-.511-.511 1.763 1.763 0 0 0-.76-.149c-.253 0-.522.039-.808.116a1.165 1.165 0 0 0-.677.412 1.1 1.1 0 0 1 .595.396c.165.187.247.424.247.71 0 .307-.104.55-.313.726-.198.176-.451.263-.76.263-.34 0-.594-.104-.758-.313a1.231 1.231 0 0 1-.248-.759c0-.297.072-.539.214-.726.154-.187.352-.363.595-.528.264-.176.6-.324 1.006-.445.418-.121.88-.182 1.386-.182Zm.99 3.729a1.57 1.57 0 0 1-.528.462c-.231.121-.479.248-.742.38a5.377 5.377 0 0 0-.76.462c-.23.165-.423.38-.577.643-.154.264-.231.6-.231 1.007 0 .429.11.77.33 1.023.22.242.517.363.891.363.308 0 .594-.088.858-.264.275-.176.528-.44.759-.792v-3.284Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/color.js
var color_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/background.js
var background_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M11.53 4.47a.75.75 0 1 0-1.06 1.06l8 8a.75.75 0 1 0 1.06-1.06l-8-8Zm5 1a.75.75 0 1 0-1.06 1.06l2 2a.75.75 0 1 0 1.06-1.06l-2-2Zm-11.06 10a.75.75 0 0 1 1.06 0l2 2a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06Zm.06-5a.75.75 0 0 0-1.06 1.06l8 8a.75.75 0 1 0 1.06-1.06l-8-8Zm-.06-3a.75.75 0 0 1 1.06 0l10 10a.75.75 0 1 1-1.06 1.06l-10-10a.75.75 0 0 1 0-1.06Zm3.06-2a.75.75 0 0 0-1.06 1.06l10 10a.75.75 0 1 0 1.06-1.06l-10-10Z"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/shadow.js
var shadow_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z" }) });
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/root-menu.js
const {
useHasDimensionsPanel,
useHasTypographyPanel,
useHasColorPanel,
useGlobalSetting: root_menu_useGlobalSetting,
useSettingsForBlockElement,
useHasBackgroundPanel
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function RootMenu() {
const [rawSettings] = root_menu_useGlobalSetting("");
const settings = useSettingsForBlockElement(rawSettings);
const hasBackgroundPanel = useHasBackgroundPanel(rawSettings);
const hasTypographyPanel = useHasTypographyPanel(settings);
const hasColorPanel = useHasColorPanel(settings);
const hasShadowPanel = true;
const hasDimensionsPanel = useHasDimensionsPanel(settings);
const hasLayoutPanel = hasDimensionsPanel;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { children: [
hasTypographyPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
NavigationButtonAsItem,
{
icon: typography_default,
path: "/typography",
children: (0,external_wp_i18n_namespaceObject.__)("Typography")
}
),
hasColorPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { icon: color_default, path: "/colors", children: (0,external_wp_i18n_namespaceObject.__)("Colors") }),
hasBackgroundPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
NavigationButtonAsItem,
{
icon: background_default,
path: "/background",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Background styles"),
children: (0,external_wp_i18n_namespaceObject.__)("Background")
}
),
hasShadowPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { icon: shadow_default, path: "/shadows", children: (0,external_wp_i18n_namespaceObject.__)("Shadows") }),
hasLayoutPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { icon: layout_default, path: "/layout", children: (0,external_wp_i18n_namespaceObject.__)("Layout") })
] }) });
}
var root_menu_default = RootMenu;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/preview-styles.js
function findNearest(input, numbers) {
if (numbers.length === 0) {
return null;
}
numbers.sort((a, b) => Math.abs(input - a) - Math.abs(input - b));
return numbers[0];
}
function extractFontWeights(fontFaces) {
const result = [];
fontFaces.forEach((face) => {
const weights = String(face.fontWeight).split(" ");
if (weights.length === 2) {
const start = parseInt(weights[0]);
const end = parseInt(weights[1]);
for (let i = start; i <= end; i += 100) {
result.push(i);
}
} else if (weights.length === 1) {
result.push(parseInt(weights[0]));
}
});
return result;
}
function formatFontFamily(input) {
const regex = /^(?!generic\([ a-zA-Z\-]+\)$)(?!^[a-zA-Z\-]+$).+/;
const output = input.trim();
const formatItem = (item) => {
item = item.trim();
if (item.match(regex)) {
item = item.replace(/^["']|["']$/g, "");
return `"${item}"`;
}
return item;
};
if (output.includes(",")) {
return output.split(",").map(formatItem).filter((item) => item !== "").join(", ");
}
return formatItem(output);
}
function formatFontFaceName(input) {
if (!input) {
return "";
}
let output = input.trim();
if (output.includes(",")) {
output = output.split(",").find((item) => item.trim() !== "").trim();
}
output = output.replace(/^["']|["']$/g, "");
if (window.navigator.userAgent.toLowerCase().includes("firefox")) {
output = `"${output}"`;
}
return output;
}
function getFamilyPreviewStyle(family) {
const style = { fontFamily: formatFontFamily(family.fontFamily) };
if (!Array.isArray(family.fontFace)) {
style.fontWeight = "400";
style.fontStyle = "normal";
return style;
}
if (family.fontFace) {
const normalFaces = family.fontFace.filter(
(face) => face?.fontStyle && face.fontStyle.toLowerCase() === "normal"
);
if (normalFaces.length > 0) {
style.fontStyle = "normal";
const normalWeights = extractFontWeights(normalFaces);
const nearestWeight = findNearest(400, normalWeights);
style.fontWeight = String(nearestWeight) || "400";
} else {
style.fontStyle = family.fontFace.length && family.fontFace[0].fontStyle || "normal";
style.fontWeight = family.fontFace.length && String(family.fontFace[0].fontWeight) || "400";
}
}
return style;
}
function getFacePreviewStyle(face) {
return {
fontFamily: formatFontFamily(face.fontFamily),
fontStyle: face.fontStyle || "normal",
fontWeight: face.fontWeight || "400"
};
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/utils.js
function getVariationClassName(variation) {
if (!variation) {
return "";
}
return `is-style-${variation}`;
}
function getNewIndexFromPresets(presets, slugPrefix) {
const nameRegex = new RegExp(`^${slugPrefix}([\\d]+)$`);
const highestPresetValue = presets.reduce((currentHighest, preset) => {
if (typeof preset?.slug === "string") {
const matches = preset?.slug.match(nameRegex);
if (matches) {
const id = parseInt(matches[1], 10);
if (id > currentHighest) {
return id;
}
}
}
return currentHighest;
}, 0);
return highestPresetValue + 1;
}
function getFontFamilyFromSetting(fontFamilies, setting) {
if (!Array.isArray(fontFamilies) || !setting) {
return null;
}
const fontFamilyVariable = setting.replace("var(", "").replace(")", "");
const fontFamilySlug = fontFamilyVariable?.split("--").slice(-1)[0];
return fontFamilies.find(
(fontFamily) => fontFamily.slug === fontFamilySlug
);
}
function getFontFamilies(themeJson) {
const themeFontFamilies = themeJson?.settings?.typography?.fontFamilies?.theme;
const customFontFamilies = themeJson?.settings?.typography?.fontFamilies?.custom;
let fontFamilies = [];
if (themeFontFamilies && customFontFamilies) {
fontFamilies = [...themeFontFamilies, ...customFontFamilies];
} else if (themeFontFamilies) {
fontFamilies = themeFontFamilies;
} else if (customFontFamilies) {
fontFamilies = customFontFamilies;
}
const bodyFontFamilySetting = themeJson?.styles?.typography?.fontFamily;
const bodyFontFamily = getFontFamilyFromSetting(
fontFamilies,
bodyFontFamilySetting
);
const headingFontFamilySetting = themeJson?.styles?.elements?.heading?.typography?.fontFamily;
let headingFontFamily;
if (!headingFontFamilySetting) {
headingFontFamily = bodyFontFamily;
} else {
headingFontFamily = getFontFamilyFromSetting(
fontFamilies,
themeJson?.styles?.elements?.heading?.typography?.fontFamily
);
}
return [bodyFontFamily, headingFontFamily];
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/typography-example.js
const { useGlobalStyle: typography_example_useGlobalStyle, GlobalStylesContext: typography_example_GlobalStylesContext } = unlock(
external_wp_blockEditor_namespaceObject.privateApis
);
const { mergeBaseAndUserConfigs } = unlock(external_wp_editor_namespaceObject.privateApis);
function PreviewTypography({ fontSize, variation }) {
const { base } = (0,external_wp_element_.useContext)(typography_example_GlobalStylesContext);
let config = base;
if (variation) {
config = mergeBaseAndUserConfigs(base, variation);
}
const [textColor] = typography_example_useGlobalStyle("color.text");
const [bodyFontFamilies, headingFontFamilies] = getFontFamilies(config);
const bodyPreviewStyle = bodyFontFamilies ? getFamilyPreviewStyle(bodyFontFamilies) : {};
const headingPreviewStyle = headingFontFamilies ? getFamilyPreviewStyle(headingFontFamilies) : {};
if (textColor) {
bodyPreviewStyle.color = textColor;
headingPreviewStyle.color = textColor;
}
if (fontSize) {
bodyPreviewStyle.fontSize = fontSize;
headingPreviewStyle.fontSize = fontSize;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
animate: {
scale: 1,
opacity: 1
},
initial: {
scale: 0.1,
opacity: 0
},
transition: {
delay: 0.3,
type: "tween"
},
style: {
textAlign: "center",
lineHeight: 1
},
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { style: headingPreviewStyle, children: (0,external_wp_i18n_namespaceObject._x)("A", "Uppercase letter A") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { style: bodyPreviewStyle, children: (0,external_wp_i18n_namespaceObject._x)("a", "Lowercase letter A") })
]
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/highlighted-colors.js
function HighlightedColors({
normalizedColorSwatchSize,
ratio
}) {
const { highlightedColors } = useStylesPreviewColors();
const scaledSwatchSize = normalizedColorSwatchSize * ratio;
return highlightedColors.map(({ slug, color }, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
style: {
height: scaledSwatchSize,
width: scaledSwatchSize,
background: color,
borderRadius: scaledSwatchSize / 2
},
animate: {
scale: 1,
opacity: 1
},
initial: {
scale: 0.1,
opacity: 0
},
transition: {
delay: index === 1 ? 0.2 : 0.1
}
},
`${slug}-${index}`
));
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview-wrapper.js
const { useGlobalStyle: preview_wrapper_useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const normalizedWidth = 248;
const normalizedHeight = 152;
const THROTTLE_OPTIONS = {
leading: true,
trailing: true
};
function PreviewWrapper({
children,
label,
isFocused,
withHoverView
}) {
const [backgroundColor = "white"] = preview_wrapper_useGlobalStyle("color.background");
const [gradientValue] = preview_wrapper_useGlobalStyle("color.gradient");
const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
const [isHovered, setIsHovered] = (0,external_wp_element_.useState)(false);
const [containerResizeListener, { width }] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
const [throttledWidth, setThrottledWidthState] = (0,external_wp_element_.useState)(width);
const [ratioState, setRatioState] = (0,external_wp_element_.useState)();
const setThrottledWidth = (0,external_wp_compose_namespaceObject.useThrottle)(
setThrottledWidthState,
250,
THROTTLE_OPTIONS
);
(0,external_wp_element_.useLayoutEffect)(() => {
if (width) {
setThrottledWidth(width);
}
}, [width, setThrottledWidth]);
(0,external_wp_element_.useLayoutEffect)(() => {
const newRatio = throttledWidth ? throttledWidth / normalizedWidth : 1;
const ratioDiff = newRatio - (ratioState || 0);
const isRatioDiffBigEnough = Math.abs(ratioDiff) > 0.1;
if (isRatioDiffBigEnough || !ratioState) {
setRatioState(newRatio);
}
}, [throttledWidth, ratioState]);
const fallbackRatio = width ? width / normalizedWidth : 1;
const ratio = ratioState ? ratioState : fallbackRatio;
const isReady = !!width;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { style: { position: "relative" }, children: containerResizeListener }),
isReady && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "edit-site-global-styles-preview__wrapper",
style: {
height: normalizedHeight * ratio
},
onMouseEnter: () => setIsHovered(true),
onMouseLeave: () => setIsHovered(false),
tabIndex: -1,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
style: {
height: normalizedHeight * ratio,
width: "100%",
background: gradientValue ?? backgroundColor,
cursor: withHoverView ? "pointer" : void 0
},
initial: "start",
animate: (isHovered || isFocused) && !disableMotion && label ? "hover" : "start",
children: [].concat(children).map((child, key) => child({ ratio, key }))
}
)
}
)
] });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview-styles.js
const { useGlobalStyle: preview_styles_useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const firstFrameVariants = {
start: {
scale: 1,
opacity: 1
},
hover: {
scale: 0,
opacity: 0
}
};
const midFrameVariants = {
hover: {
opacity: 1
},
start: {
opacity: 0.5
}
};
const secondFrameVariants = {
hover: {
scale: 1,
opacity: 1
},
start: {
scale: 0,
opacity: 0
}
};
const PreviewStyles = ({ label, isFocused, withHoverView, variation }) => {
const [fontWeight] = preview_styles_useGlobalStyle("typography.fontWeight");
const [fontFamily = "serif"] = preview_styles_useGlobalStyle("typography.fontFamily");
const [headingFontFamily = fontFamily] = preview_styles_useGlobalStyle(
"elements.h1.typography.fontFamily"
);
const [headingFontWeight = fontWeight] = preview_styles_useGlobalStyle(
"elements.h1.typography.fontWeight"
);
const [textColor = "black"] = preview_styles_useGlobalStyle("color.text");
const [headingColor = textColor] = preview_styles_useGlobalStyle(
"elements.h1.color.text"
);
const { paletteColors } = useStylesPreviewColors();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
PreviewWrapper,
{
label,
isFocused,
withHoverView,
children: [
({ ratio, key }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
variants: firstFrameVariants,
style: {
height: "100%",
overflow: "hidden"
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
spacing: 10 * ratio,
justify: "center",
style: {
height: "100%",
overflow: "hidden"
},
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PreviewTypography,
{
fontSize: 65 * ratio,
variation
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4 * ratio, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
HighlightedColors,
{
normalizedColorSwatchSize: 32,
ratio
}
) })
]
}
)
},
key
),
({ key }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
variants: withHoverView && midFrameVariants,
style: {
height: "100%",
width: "100%",
position: "absolute",
top: 0,
overflow: "hidden",
filter: "blur(60px)",
opacity: 0.1
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHStack,
{
spacing: 0,
justify: "flex-start",
style: {
height: "100%",
overflow: "hidden"
},
children: paletteColors.slice(0, 4).map(({ color }, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
style: {
height: "100%",
background: color,
flexGrow: 1
}
},
index
))
}
)
},
key
),
({ ratio, key }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
variants: secondFrameVariants,
style: {
height: "100%",
width: "100%",
overflow: "hidden",
position: "absolute",
top: 0
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalVStack,
{
spacing: 3 * ratio,
justify: "center",
style: {
height: "100%",
overflow: "hidden",
padding: 10 * ratio,
boxSizing: "border-box"
},
children: label && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
style: {
fontSize: 40 * ratio,
fontFamily: headingFontFamily,
color: headingColor,
fontWeight: headingFontWeight,
lineHeight: "1em",
textAlign: "center"
},
children: label
}
)
}
)
},
key
)
]
}
);
};
var preview_styles_default = PreviewStyles;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-root.js
function ScreenRoot() {
const hasVariations = (0,external_wp_data_.useSelect)((select) => {
const { __experimentalGetCurrentThemeGlobalStylesVariations } = select(external_wp_coreData_namespaceObject.store);
return !!__experimentalGetCurrentThemeGlobalStylesVariations()?.length;
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Card,
{
size: "small",
isBorderless: true,
className: "edit-site-global-styles-screen-root",
isRounded: false,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CardBody, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Card, { className: "edit-site-global-styles-screen-root__active-style-tile", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CardMedia, { className: "edit-site-global-styles-screen-root__active-style-tile-preview", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(preview_styles_default, {}) }) }),
hasVariations && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: "/variations", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: (0,external_wp_i18n_namespaceObject.__)("Browse styles") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
IconWithCurrentColor,
{
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_default : chevron_right_default
}
)
] }) }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(root_menu_default, {})
] }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CardDivider, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.CardBody, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalSpacer,
{
as: "p",
paddingTop: 2,
paddingX: "13px",
marginBottom: 2,
children: (0,external_wp_i18n_namespaceObject.__)(
"Customize the appearance of specific blocks for the whole site."
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: "/blocks", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: (0,external_wp_i18n_namespaceObject.__)("Blocks") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
IconWithCurrentColor,
{
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_default : chevron_right_default
}
)
] }) }) })
] })
]
}
);
}
var screen_root_default = ScreenRoot;
;// external ["wp","a11y"]
const external_wp_a11y_namespaceObject = window["wp"]["a11y"];
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/variations/variations-panel.js
const { useGlobalStyle: variations_panel_useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function getFilteredBlockStyles(blockStyles, variations) {
return blockStyles?.filter(
(style) => style.source === "block" || variations.includes(style.name)
);
}
function useBlockVariations(name) {
const blockStyles = (0,external_wp_data_.useSelect)(
(select) => {
const { getBlockStyles } = select(external_wp_blocks_namespaceObject.store);
return getBlockStyles(name);
},
[name]
);
const [variations] = variations_panel_useGlobalStyle("variations", name);
const variationNames = Object.keys(variations ?? {});
return getFilteredBlockStyles(blockStyles, variationNames);
}
function VariationsPanel({ name }) {
const coreBlockStyles = useBlockVariations(name);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { isBordered: true, isSeparated: true, children: coreBlockStyles.map((style, index) => {
if (style?.isDefault) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
NavigationButtonAsItem,
{
path: "/blocks/" + encodeURIComponent(name) + "/variations/" + encodeURIComponent(style.name),
children: style.label
},
index
);
}) });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/header.js
function ScreenHeader({ title, description, onBack }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 0, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalView, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginBottom: 0, paddingX: 4, paddingY: 3, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 2, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Navigator.BackButton,
{
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right_default : chevron_left_default,
size: "small",
label: (0,external_wp_i18n_namespaceObject.__)("Back"),
onClick: onBack
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHeading,
{
className: "edit-site-global-styles-header",
level: 2,
size: 13,
children: title
}
) })
] }) }) }),
description && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-site-global-styles-header__description", children: description })
] });
}
var header_default = ScreenHeader;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-block-list.js
const {
useHasDimensionsPanel: screen_block_list_useHasDimensionsPanel,
useHasTypographyPanel: screen_block_list_useHasTypographyPanel,
useHasBorderPanel,
useGlobalSetting: screen_block_list_useGlobalSetting,
useSettingsForBlockElement: screen_block_list_useSettingsForBlockElement,
useHasColorPanel: screen_block_list_useHasColorPanel
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function useSortedBlockTypes() {
const blockItems = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_blocks_namespaceObject.store).getBlockTypes(),
[]
);
const groupByType = (blocks, block) => {
const { core, noncore } = blocks;
const type = block.name.startsWith("core/") ? core : noncore;
type.push(block);
return blocks;
};
const { core: coreItems, noncore: nonCoreItems } = blockItems.reduce(
groupByType,
{ core: [], noncore: [] }
);
return [...coreItems, ...nonCoreItems];
}
function useBlockHasGlobalStyles(blockName) {
const [rawSettings] = screen_block_list_useGlobalSetting("", blockName);
const settings = screen_block_list_useSettingsForBlockElement(rawSettings, blockName);
const hasTypographyPanel = screen_block_list_useHasTypographyPanel(settings);
const hasColorPanel = screen_block_list_useHasColorPanel(settings);
const hasBorderPanel = useHasBorderPanel(settings);
const hasDimensionsPanel = screen_block_list_useHasDimensionsPanel(settings);
const hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;
const hasVariationsPanel = !!useBlockVariations(blockName)?.length;
const hasGlobalStyles = hasTypographyPanel || hasColorPanel || hasLayoutPanel || hasVariationsPanel;
return hasGlobalStyles;
}
function BlockMenuItem({ block }) {
const hasBlockMenuItem = useBlockHasGlobalStyles(block.name);
if (!hasBlockMenuItem) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
NavigationButtonAsItem,
{
path: "/blocks/" + encodeURIComponent(block.name),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: block.icon }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: block.title })
] })
}
);
}
function BlockList({ filterValue }) {
const sortedBlockTypes = useSortedBlockTypes();
const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500);
const { isMatchingSearchTerm } = (0,external_wp_data_.useSelect)(external_wp_blocks_namespaceObject.store);
const filteredBlockTypes = !filterValue ? sortedBlockTypes : sortedBlockTypes.filter(
(blockType) => isMatchingSearchTerm(blockType, filterValue)
);
const blockTypesListRef = (0,external_wp_element_.useRef)();
(0,external_wp_element_.useEffect)(() => {
if (!filterValue) {
return;
}
const count = blockTypesListRef.current.childElementCount;
const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: number of results. */
(0,external_wp_i18n_namespaceObject._n)("%d result found.", "%d results found.", count),
count
);
debouncedSpeak(resultsFoundMessage, count);
}, [filterValue, debouncedSpeak]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
ref: blockTypesListRef,
className: "edit-site-block-types-item-list",
role: "list",
children: filteredBlockTypes.length === 0 ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { align: "center", as: "p", children: (0,external_wp_i18n_namespaceObject.__)("No blocks found.") }) : filteredBlockTypes.map((block) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockMenuItem,
{
block
},
"menu-itemblock-" + block.name
))
}
);
}
const MemoizedBlockList = (0,external_wp_element_.memo)(BlockList);
function ScreenBlockList() {
const [filterValue, setFilterValue] = (0,external_wp_element_.useState)("");
const deferredFilterValue = (0,external_wp_element_.useDeferredValue)(filterValue);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
header_default,
{
title: (0,external_wp_i18n_namespaceObject.__)("Blocks"),
description: (0,external_wp_i18n_namespaceObject.__)(
"Customize the appearance of specific blocks and for the whole site."
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SearchControl,
{
__nextHasNoMarginBottom: true,
className: "edit-site-block-types-search",
onChange: setFilterValue,
value: filterValue,
label: (0,external_wp_i18n_namespaceObject.__)("Search"),
placeholder: (0,external_wp_i18n_namespaceObject.__)("Search")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MemoizedBlockList, { filterValue: deferredFilterValue })
] });
}
var screen_block_list_default = ScreenBlockList;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/block-preview-panel.js
const BlockPreviewPanel = ({ name, variation = "" }) => {
const blockExample = (0,external_wp_blocks_namespaceObject.getBlockType)(name)?.example;
const blocks = (0,external_wp_element_.useMemo)(() => {
if (!blockExample) {
return null;
}
const example = {
...blockExample,
attributes: {
...blockExample.attributes,
style: void 0,
className: variation ? getVariationClassName(variation) : blockExample.attributes?.className
}
};
return (0,external_wp_blocks_namespaceObject.getBlockFromExample)(name, example);
}, [name, blockExample, variation]);
const viewportWidth = blockExample?.viewportWidth ?? 500;
const previewHeight = 144;
const sidebarWidth = 235;
const scale = sidebarWidth / viewportWidth;
const minHeight = scale !== 0 && scale < 1 && previewHeight ? previewHeight / scale : previewHeight;
if (!blockExample) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginX: 4, marginBottom: 4, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "edit-site-global-styles__block-preview-panel",
style: { maxHeight: previewHeight, boxSizing: "initial" },
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.BlockPreview,
{
blocks,
viewportWidth,
minHeight: previewHeight,
additionalStyles: (
//We want this CSS to be in sync with the one in InserterPreviewPanel.
[
{
css: `
body{
padding: 24px;
min-height:${Math.round(minHeight)}px;
display:flex;
align-items:center;
}
.is-root-container { width: 100%; }
`
}
]
)
}
)
}
) });
};
var block_preview_panel_default = BlockPreviewPanel;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/subtitle.js
function Subtitle({ children, level }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHeading,
{
className: "edit-site-global-styles-subtitle",
level: level ?? 2,
children
}
);
}
var subtitle_default = Subtitle;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-block.js
const BACKGROUND_BLOCK_DEFAULT_VALUES = {
backgroundSize: "cover",
backgroundPosition: "50% 50%"
// used only when backgroundSize is 'contain'.
};
function applyFallbackStyle(border) {
if (!border) {
return border;
}
const hasColorOrWidth = border.color || border.width;
if (!border.style && hasColorOrWidth) {
return { ...border, style: "solid" };
}
if (border.style && !hasColorOrWidth) {
return void 0;
}
return border;
}
function applyAllFallbackStyles(border) {
if (!border) {
return border;
}
if ((0,external_wp_components_namespaceObject.__experimentalHasSplitBorders)(border)) {
return {
top: applyFallbackStyle(border.top),
right: applyFallbackStyle(border.right),
bottom: applyFallbackStyle(border.bottom),
left: applyFallbackStyle(border.left)
};
}
return applyFallbackStyle(border);
}
const {
useHasDimensionsPanel: screen_block_useHasDimensionsPanel,
useHasTypographyPanel: screen_block_useHasTypographyPanel,
useHasBorderPanel: screen_block_useHasBorderPanel,
useGlobalSetting: screen_block_useGlobalSetting,
useSettingsForBlockElement: screen_block_useSettingsForBlockElement,
useHasColorPanel: screen_block_useHasColorPanel,
useHasFiltersPanel,
useHasImageSettingsPanel,
useGlobalStyle: screen_block_useGlobalStyle,
useHasBackgroundPanel: screen_block_useHasBackgroundPanel,
BackgroundPanel: StylesBackgroundPanel,
BorderPanel: StylesBorderPanel,
ColorPanel: StylesColorPanel,
TypographyPanel: StylesTypographyPanel,
DimensionsPanel: StylesDimensionsPanel,
FiltersPanel: StylesFiltersPanel,
ImageSettingsPanel,
AdvancedPanel: StylesAdvancedPanel
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function ScreenBlock({ name, variation }) {
let prefixParts = [];
if (variation) {
prefixParts = ["variations", variation].concat(prefixParts);
}
const prefix = prefixParts.join(".");
const [style] = screen_block_useGlobalStyle(prefix, name, "user", {
shouldDecodeEncode: false
});
const [inheritedStyle, setStyle] = screen_block_useGlobalStyle(prefix, name, "all", {
shouldDecodeEncode: false
});
const [userSettings] = screen_block_useGlobalSetting("", name, "user");
const [rawSettings, setSettings] = screen_block_useGlobalSetting("", name);
const settingsForBlockElement = screen_block_useSettingsForBlockElement(
rawSettings,
name
);
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name);
let disableBlockGap = false;
if (settingsForBlockElement?.spacing?.blockGap && blockType?.supports?.spacing?.blockGap && (blockType?.supports?.spacing?.__experimentalSkipSerialization === true || blockType?.supports?.spacing?.__experimentalSkipSerialization?.some?.(
(spacingType) => spacingType === "blockGap"
))) {
disableBlockGap = true;
}
let disableAspectRatio = false;
if (settingsForBlockElement?.dimensions?.aspectRatio && name === "core/group") {
disableAspectRatio = true;
}
const settings = (0,external_wp_element_.useMemo)(() => {
const updatedSettings = structuredClone(settingsForBlockElement);
if (disableBlockGap) {
updatedSettings.spacing.blockGap = false;
}
if (disableAspectRatio) {
updatedSettings.dimensions.aspectRatio = false;
}
return updatedSettings;
}, [settingsForBlockElement, disableBlockGap, disableAspectRatio]);
const blockVariations = useBlockVariations(name);
const hasBackgroundPanel = screen_block_useHasBackgroundPanel(settings);
const hasTypographyPanel = screen_block_useHasTypographyPanel(settings);
const hasColorPanel = screen_block_useHasColorPanel(settings);
const hasBorderPanel = screen_block_useHasBorderPanel(settings);
const hasDimensionsPanel = screen_block_useHasDimensionsPanel(settings);
const hasFiltersPanel = useHasFiltersPanel(settings);
const hasImageSettingsPanel = useHasImageSettingsPanel(
name,
userSettings,
settings
);
const hasVariationsPanel = !!blockVariations?.length && !variation;
const { canEditCSS } = (0,external_wp_data_.useSelect)((select) => {
const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } = select(external_wp_coreData_namespaceObject.store);
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
const globalStyles = globalStylesId ? getEntityRecord("root", "globalStyles", globalStylesId) : void 0;
return {
canEditCSS: !!globalStyles?._links?.["wp:action-edit-css"]
};
}, []);
const currentBlockStyle = variation ? blockVariations.find((s) => s.name === variation) : null;
const inheritedStyleWithLayout = (0,external_wp_element_.useMemo)(() => {
return {
...inheritedStyle,
layout: settings.layout
};
}, [inheritedStyle, settings.layout]);
const styleWithLayout = (0,external_wp_element_.useMemo)(() => {
return {
...style,
layout: userSettings.layout
};
}, [style, userSettings.layout]);
const onChangeDimensions = (newStyle) => {
const updatedStyle = { ...newStyle };
delete updatedStyle.layout;
setStyle(updatedStyle);
if (newStyle.layout !== userSettings.layout) {
setSettings({
...userSettings,
layout: newStyle.layout
});
}
};
const onChangeLightbox = (newSetting) => {
if (newSetting === void 0) {
setSettings({
...rawSettings,
lightbox: void 0
});
} else {
setSettings({
...rawSettings,
lightbox: {
...rawSettings.lightbox,
...newSetting
}
});
}
};
const onChangeBorders = (newStyle) => {
if (!newStyle?.border) {
setStyle(newStyle);
return;
}
const { radius, ...newBorder } = newStyle.border;
const border = applyAllFallbackStyles(newBorder);
const updatedBorder = !(0,external_wp_components_namespaceObject.__experimentalHasSplitBorders)(border) ? {
top: border,
right: border,
bottom: border,
left: border
} : {
color: null,
style: null,
width: null,
...border
};
setStyle({ ...newStyle, border: { ...updatedBorder, radius } });
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
header_default,
{
title: variation ? currentBlockStyle?.label : blockType.title
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(block_preview_panel_default, { name, variation }),
hasVariationsPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-global-styles-screen-variations", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(subtitle_default, { children: (0,external_wp_i18n_namespaceObject.__)("Style Variations") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(VariationsPanel, { name })
] }) }),
hasColorPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
StylesColorPanel,
{
inheritedValue: inheritedStyle,
value: style,
onChange: setStyle,
settings
}
),
hasBackgroundPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
StylesBackgroundPanel,
{
inheritedValue: inheritedStyle,
value: style,
onChange: setStyle,
settings,
defaultValues: BACKGROUND_BLOCK_DEFAULT_VALUES
}
),
hasTypographyPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
StylesTypographyPanel,
{
inheritedValue: inheritedStyle,
value: style,
onChange: setStyle,
settings
}
),
hasDimensionsPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
StylesDimensionsPanel,
{
inheritedValue: inheritedStyleWithLayout,
value: styleWithLayout,
onChange: onChangeDimensions,
settings,
includeLayoutControls: true
}
),
hasBorderPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
StylesBorderPanel,
{
inheritedValue: inheritedStyle,
value: style,
onChange: onChangeBorders,
settings
}
),
hasFiltersPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
StylesFiltersPanel,
{
inheritedValue: inheritedStyleWithLayout,
value: styleWithLayout,
onChange: setStyle,
settings,
includeLayoutControls: true
}
),
hasImageSettingsPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ImageSettingsPanel,
{
onChange: onChangeLightbox,
value: userSettings,
inheritedValue: settings
}
),
canEditCSS && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)("Advanced"), initialOpen: false, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: is the name of a block e.g., 'Image' or 'Table'.
(0,external_wp_i18n_namespaceObject.__)(
"Add your own CSS to customize the appearance of the %s block. You do not need to include a CSS selector, just add the property and value."
),
blockType?.title
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
StylesAdvancedPanel,
{
value: style,
onChange: setStyle,
inheritedValue: inheritedStyle
}
)
] })
] });
}
var screen_block_default = ScreenBlock;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/typography-elements.js
const { useGlobalStyle: typography_elements_useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function ElementItem({ parentMenu, element, label }) {
const prefix = element === "text" || !element ? "" : `elements.${element}.`;
const extraStyles = element === "link" ? {
textDecoration: "underline"
} : {};
const [fontFamily] = typography_elements_useGlobalStyle(prefix + "typography.fontFamily");
const [fontStyle] = typography_elements_useGlobalStyle(prefix + "typography.fontStyle");
const [fontWeight] = typography_elements_useGlobalStyle(prefix + "typography.fontWeight");
const [backgroundColor] = typography_elements_useGlobalStyle(prefix + "color.background");
const [fallbackBackgroundColor] = typography_elements_useGlobalStyle("color.background");
const [gradientValue] = typography_elements_useGlobalStyle(prefix + "color.gradient");
const [color] = typography_elements_useGlobalStyle(prefix + "color.text");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: parentMenu + "/typography/" + element, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.FlexItem,
{
className: "edit-site-global-styles-screen-typography__indicator",
style: {
fontFamily: fontFamily ?? "serif",
background: gradientValue ?? backgroundColor ?? fallbackBackgroundColor,
color,
fontStyle,
fontWeight,
...extraStyles
},
"aria-hidden": "true",
children: (0,external_wp_i18n_namespaceObject.__)("Aa")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: label })
] }) });
}
function TypographyElements() {
const parentMenu = "";
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(subtitle_default, { level: 3, children: (0,external_wp_i18n_namespaceObject.__)("Elements") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { isBordered: true, isSeparated: true, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ElementItem,
{
parentMenu,
element: "text",
label: (0,external_wp_i18n_namespaceObject.__)("Text")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ElementItem,
{
parentMenu,
element: "link",
label: (0,external_wp_i18n_namespaceObject.__)("Links")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ElementItem,
{
parentMenu,
element: "heading",
label: (0,external_wp_i18n_namespaceObject.__)("Headings")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ElementItem,
{
parentMenu,
element: "caption",
label: (0,external_wp_i18n_namespaceObject.__)("Captions")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ElementItem,
{
parentMenu,
element: "button",
label: (0,external_wp_i18n_namespaceObject.__)("Buttons")
}
)
] })
] });
}
var typography_elements_default = TypographyElements;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview-typography.js
const StylesPreviewTypography = ({ variation, isFocused, withHoverView }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PreviewWrapper,
{
label: variation.title,
isFocused,
withHoverView,
children: ({ ratio, key }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHStack,
{
spacing: 10 * ratio,
justify: "center",
style: {
height: "100%",
overflow: "hidden"
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PreviewTypography,
{
variation,
fontSize: 85 * ratio
}
)
},
key
)
}
);
};
var preview_typography_default = StylesPreviewTypography;
;// ./node_modules/@wordpress/edit-site/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js
const use_theme_style_variations_by_property_EMPTY_ARRAY = [];
const { GlobalStylesContext: use_theme_style_variations_by_property_GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(
external_wp_blockEditor_namespaceObject.privateApis
);
const { mergeBaseAndUserConfigs: use_theme_style_variations_by_property_mergeBaseAndUserConfigs } = unlock(external_wp_editor_namespaceObject.privateApis);
function removePropertiesFromObject(object, properties) {
if (!properties?.length) {
return object;
}
if (typeof object !== "object" || !object || !Object.keys(object).length) {
return object;
}
for (const key in object) {
if (properties.includes(key)) {
delete object[key];
} else if (typeof object[key] === "object") {
removePropertiesFromObject(object[key], properties);
}
}
return object;
}
function hasThemeVariation({ title, settings, styles }) {
return title === (0,external_wp_i18n_namespaceObject.__)("Default") || // Always preserve the default variation.
Object.keys(settings).length > 0 || Object.keys(styles).length > 0;
}
function useCurrentMergeThemeStyleVariationsWithUserConfig(properties = []) {
const { variationsFromTheme } = (0,external_wp_data_.useSelect)((select) => {
const _variationsFromTheme = select(
external_wp_coreData_namespaceObject.store
).__experimentalGetCurrentThemeGlobalStylesVariations();
return {
variationsFromTheme: _variationsFromTheme || use_theme_style_variations_by_property_EMPTY_ARRAY
};
}, []);
const { user: userVariation } = (0,external_wp_element_.useContext)(use_theme_style_variations_by_property_GlobalStylesContext);
const propertiesAsString = properties.toString();
return (0,external_wp_element_.useMemo)(() => {
const clonedUserVariation = structuredClone(userVariation);
const userVariationWithoutProperties = removePropertiesFromObject(
clonedUserVariation,
properties
);
userVariationWithoutProperties.title = (0,external_wp_i18n_namespaceObject.__)("Default");
const variationsWithPropertiesAndBase = variationsFromTheme.filter((variation) => {
return isVariationWithProperties(variation, properties);
}).map((variation) => {
return use_theme_style_variations_by_property_mergeBaseAndUserConfigs(
userVariationWithoutProperties,
variation
);
});
const variationsByProperties = [
userVariationWithoutProperties,
...variationsWithPropertiesAndBase
];
return variationsByProperties?.length ? variationsByProperties.filter(hasThemeVariation) : [];
}, [propertiesAsString, userVariation, variationsFromTheme]);
}
const filterObjectByProperties = (object, properties) => {
if (!object || !properties?.length) {
return {};
}
const newObject = {};
Object.keys(object).forEach((key) => {
if (properties.includes(key)) {
newObject[key] = object[key];
} else if (typeof object[key] === "object") {
const newFilter = filterObjectByProperties(
object[key],
properties
);
if (Object.keys(newFilter).length) {
newObject[key] = newFilter;
}
}
});
return newObject;
};
function isVariationWithProperties(variation, properties) {
const variationWithProperties = filterObjectByProperties(
structuredClone(variation),
properties
);
return areGlobalStyleConfigsEqual(variationWithProperties, variation);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/variations/variation.js
const { mergeBaseAndUserConfigs: variation_mergeBaseAndUserConfigs } = unlock(external_wp_editor_namespaceObject.privateApis);
const { GlobalStylesContext: variation_GlobalStylesContext, areGlobalStyleConfigsEqual: variation_areGlobalStyleConfigsEqual } = unlock(
external_wp_blockEditor_namespaceObject.privateApis
);
function Variation({
variation,
children,
isPill,
properties,
showTooltip
}) {
const [isFocused, setIsFocused] = (0,external_wp_element_.useState)(false);
const { base, user, setUserConfig } = (0,external_wp_element_.useContext)(variation_GlobalStylesContext);
const context = (0,external_wp_element_.useMemo)(() => {
let merged = variation_mergeBaseAndUserConfigs(base, variation);
if (properties) {
merged = filterObjectByProperties(merged, properties);
}
return {
user: variation,
base,
merged,
setUserConfig: () => {
}
};
}, [variation, base, properties]);
const selectVariation = () => setUserConfig(variation);
const selectOnEnter = (event) => {
if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER) {
event.preventDefault();
selectVariation();
}
};
const isActive = (0,external_wp_element_.useMemo)(
() => variation_areGlobalStyleConfigsEqual(user, variation),
[user, variation]
);
let label = variation?.title;
if (variation?.description) {
label = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: variation title. 2: variation description. */
(0,external_wp_i18n_namespaceObject._x)("%1$s (%2$s)", "variation label"),
variation?.title,
variation?.description
);
}
const content = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx("edit-site-global-styles-variations_item", {
"is-active": isActive
}),
role: "button",
onClick: selectVariation,
onKeyDown: selectOnEnter,
tabIndex: "0",
"aria-label": label,
"aria-current": isActive,
onFocus: () => setIsFocused(true),
onBlur: () => setIsFocused(false),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx(
"edit-site-global-styles-variations_item-preview",
{ "is-pill": isPill }
),
children: children(isFocused)
}
)
}
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(variation_GlobalStylesContext.Provider, { value: context, children: showTooltip ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: variation?.title, children: content }) : content });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/variations/variations-typography.js
function TypographyVariations({ title, gap = 2 }) {
const propertiesToFilter = ["typography"];
const typographyVariations = useCurrentMergeThemeStyleVariationsWithUserConfig(propertiesToFilter);
if (typographyVariations?.length <= 1) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, children: [
title && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(subtitle_default, { level: 3, children: title }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalGrid,
{
columns: 3,
gap,
className: "edit-site-global-styles-style-variations-container",
children: typographyVariations.map((variation, index) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Variation,
{
variation,
properties: propertiesToFilter,
showTooltip: true,
children: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
preview_typography_default,
{
variation
}
)
},
index
);
})
}
)
] });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-sizes/font-sizes-count.js
function FontSizes() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 2, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(subtitle_default, { level: 3, children: (0,external_wp_i18n_namespaceObject.__)("Font Sizes") }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { isBordered: true, isSeparated: true, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: "/typography/font-sizes", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { direction: "row", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: (0,external_wp_i18n_namespaceObject.__)("Font size presets") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_default : chevron_right_default })
] }) }) })
] });
}
var font_sizes_count_default = FontSizes;
;// ./node_modules/@wordpress/icons/build-module/library/settings.js
var settings_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z" })
] });
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/resolvers.js
const FONT_FAMILIES_URL = "/wp/v2/font-families";
const FONT_COLLECTIONS_URL = "/wp/v2/font-collections";
async function fetchInstallFontFamily(data) {
const config = {
path: FONT_FAMILIES_URL,
method: "POST",
body: data
};
const response = await external_wp_apiFetch_default()(config);
return {
id: response.id,
...response.font_family_settings,
fontFace: []
};
}
async function fetchInstallFontFace(fontFamilyId, data) {
const config = {
path: `${FONT_FAMILIES_URL}/${fontFamilyId}/font-faces`,
method: "POST",
body: data
};
const response = await external_wp_apiFetch_default()(config);
return {
id: response.id,
...response.font_face_settings
};
}
async function fetchGetFontFamilyBySlug(slug) {
const config = {
path: `${FONT_FAMILIES_URL}?slug=${slug}&_embed=true`,
method: "GET"
};
const response = await external_wp_apiFetch_default()(config);
if (!response || response.length === 0) {
return null;
}
const fontFamilyPost = response[0];
return {
id: fontFamilyPost.id,
...fontFamilyPost.font_family_settings,
fontFace: fontFamilyPost?._embedded?.font_faces.map(
(face) => face.font_face_settings
) || []
};
}
async function fetchUninstallFontFamily(fontFamilyId) {
const config = {
path: `${FONT_FAMILIES_URL}/${fontFamilyId}?force=true`,
method: "DELETE"
};
return await external_wp_apiFetch_default()(config);
}
async function fetchFontCollections() {
const config = {
path: `${FONT_COLLECTIONS_URL}?_fields=slug,name,description`,
method: "GET"
};
return await external_wp_apiFetch_default()(config);
}
async function fetchFontCollection(id) {
const config = {
path: `${FONT_COLLECTIONS_URL}/${id}`,
method: "GET"
};
return await external_wp_apiFetch_default()(config);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/constants.js
const ALLOWED_FILE_EXTENSIONS = ["otf", "ttf", "woff", "woff2"];
const FONT_WEIGHTS = {
100: (0,external_wp_i18n_namespaceObject._x)("Thin", "font weight"),
200: (0,external_wp_i18n_namespaceObject._x)("Extra-light", "font weight"),
300: (0,external_wp_i18n_namespaceObject._x)("Light", "font weight"),
400: (0,external_wp_i18n_namespaceObject._x)("Normal", "font weight"),
500: (0,external_wp_i18n_namespaceObject._x)("Medium", "font weight"),
600: (0,external_wp_i18n_namespaceObject._x)("Semi-bold", "font weight"),
700: (0,external_wp_i18n_namespaceObject._x)("Bold", "font weight"),
800: (0,external_wp_i18n_namespaceObject._x)("Extra-bold", "font weight"),
900: (0,external_wp_i18n_namespaceObject._x)("Black", "font weight")
};
const FONT_STYLES = {
normal: (0,external_wp_i18n_namespaceObject._x)("Normal", "font style"),
italic: (0,external_wp_i18n_namespaceObject._x)("Italic", "font style")
};
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/index.js
const { File } = window;
const { kebabCase } = unlock(external_wp_components_namespaceObject.privateApis);
function setUIValuesNeeded(font, extraValues = {}) {
if (!font.name && (font.fontFamily || font.slug)) {
font.name = font.fontFamily || font.slug;
}
return {
...font,
...extraValues
};
}
function isUrlEncoded(url) {
if (typeof url !== "string") {
return false;
}
return url !== decodeURIComponent(url);
}
function getFontFaceVariantName(face) {
const weightName = FONT_WEIGHTS[face.fontWeight] || face.fontWeight;
const styleName = face.fontStyle === "normal" ? "" : FONT_STYLES[face.fontStyle] || face.fontStyle;
return `${weightName} ${styleName}`;
}
function mergeFontFaces(existing = [], incoming = []) {
const map = /* @__PURE__ */ new Map();
for (const face of existing) {
map.set(`${face.fontWeight}${face.fontStyle}`, face);
}
for (const face of incoming) {
map.set(`${face.fontWeight}${face.fontStyle}`, face);
}
return Array.from(map.values());
}
function mergeFontFamilies(existing = [], incoming = []) {
const map = /* @__PURE__ */ new Map();
for (const font of existing) {
map.set(font.slug, { ...font });
}
for (const font of incoming) {
if (map.has(font.slug)) {
const { fontFace: incomingFontFaces, ...restIncoming } = font;
const existingFont = map.get(font.slug);
const mergedFontFaces = mergeFontFaces(
existingFont.fontFace,
incomingFontFaces
);
map.set(font.slug, {
...restIncoming,
fontFace: mergedFontFaces
});
} else {
map.set(font.slug, { ...font });
}
}
return Array.from(map.values());
}
async function loadFontFaceInBrowser(fontFace, source, addTo = "all") {
let dataSource;
if (typeof source === "string") {
dataSource = `url(${source})`;
} else if (source instanceof File) {
dataSource = await source.arrayBuffer();
} else {
return;
}
const newFont = new window.FontFace(
formatFontFaceName(fontFace.fontFamily),
dataSource,
{
style: fontFace.fontStyle,
weight: fontFace.fontWeight
}
);
const loadedFace = await newFont.load();
if (addTo === "document" || addTo === "all") {
document.fonts.add(loadedFace);
}
if (addTo === "iframe" || addTo === "all") {
const iframeDocument = document.querySelector(
'iframe[name="editor-canvas"]'
).contentDocument;
iframeDocument.fonts.add(loadedFace);
}
}
function unloadFontFaceInBrowser(fontFace, removeFrom = "all") {
const unloadFontFace = (fonts) => {
fonts.forEach((f) => {
if (f.family === formatFontFaceName(fontFace?.fontFamily) && f.weight === fontFace?.fontWeight && f.style === fontFace?.fontStyle) {
fonts.delete(f);
}
});
};
if (removeFrom === "document" || removeFrom === "all") {
unloadFontFace(document.fonts);
}
if (removeFrom === "iframe" || removeFrom === "all") {
const iframeDocument = document.querySelector(
'iframe[name="editor-canvas"]'
).contentDocument;
unloadFontFace(iframeDocument.fonts);
}
}
function getDisplaySrcFromFontFace(input) {
if (!input) {
return;
}
let src;
if (Array.isArray(input)) {
src = input[0];
} else {
src = input;
}
if (src.startsWith("file:.")) {
return;
}
if (!isUrlEncoded(src)) {
src = encodeURI(src);
}
return src;
}
function makeFontFamilyFormData(fontFamily) {
const formData = new FormData();
const { fontFace, category, ...familyWithValidParameters } = fontFamily;
const fontFamilySettings = {
...familyWithValidParameters,
slug: kebabCase(fontFamily.slug)
};
formData.append(
"font_family_settings",
JSON.stringify(fontFamilySettings)
);
return formData;
}
function makeFontFacesFormData(font) {
if (font?.fontFace) {
const fontFacesFormData = font.fontFace.map((item, faceIndex) => {
const face = { ...item };
const formData = new FormData();
if (face.file) {
const files = Array.isArray(face.file) ? face.file : [face.file];
const src = [];
files.forEach((file, key) => {
const fileId = `file-${faceIndex}-${key}`;
formData.append(fileId, file, file.name);
src.push(fileId);
});
face.src = src.length === 1 ? src[0] : src;
delete face.file;
formData.append("font_face_settings", JSON.stringify(face));
} else {
formData.append("font_face_settings", JSON.stringify(face));
}
return formData;
});
return fontFacesFormData;
}
}
async function batchInstallFontFaces(fontFamilyId, fontFacesData) {
const responses = [];
for (const faceData of fontFacesData) {
try {
const response = await fetchInstallFontFace(
fontFamilyId,
faceData
);
responses.push({ status: "fulfilled", value: response });
} catch (error) {
responses.push({ status: "rejected", reason: error });
}
}
const results = {
errors: [],
successes: []
};
responses.forEach((result, index) => {
if (result.status === "fulfilled") {
const response = result.value;
if (response.id) {
results.successes.push(response);
} else {
results.errors.push({
data: fontFacesData[index],
message: `Error: ${response.message}`
});
}
} else {
results.errors.push({
data: fontFacesData[index],
message: result.reason.message
});
}
});
return results;
}
async function downloadFontFaceAssets(src) {
src = Array.isArray(src) ? src : [src];
const files = await Promise.all(
src.map(async (url) => {
return fetch(new Request(url)).then((response) => {
if (!response.ok) {
throw new Error(
`Error downloading font face asset from ${url}. Server responded with status: ${response.status}`
);
}
return response.blob();
}).then((blob) => {
const filename = url.split("/").pop();
const file = new File([blob], filename, {
type: blob.type
});
return file;
});
})
);
return files.length === 1 ? files[0] : files;
}
function checkFontFaceInstalled(fontFace, collection) {
return -1 !== collection.findIndex((collectionFontFace) => {
return collectionFontFace.fontWeight === fontFace.fontWeight && collectionFontFace.fontStyle === fontFace.fontStyle;
});
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/toggleFont.js
function toggleFont(font, face, initialfonts) {
const isFontActivated = (f) => f.slug === font.slug;
const getActivatedFont = (fonts) => fonts.find(isFontActivated);
const toggleEntireFontFamily = (activatedFont2) => {
if (!activatedFont2) {
return [...initialfonts, font];
}
return initialfonts.filter((f) => !isFontActivated(f));
};
const toggleFontVariant = (activatedFont2) => {
const isFaceActivated = (f) => f.fontWeight === face.fontWeight && f.fontStyle === face.fontStyle;
if (!activatedFont2) {
return [...initialfonts, { ...font, fontFace: [face] }];
}
let newFontFaces = activatedFont2.fontFace || [];
if (newFontFaces.find(isFaceActivated)) {
newFontFaces = newFontFaces.filter(
(f) => !isFaceActivated(f)
);
} else {
newFontFaces = [...newFontFaces, face];
}
if (newFontFaces.length === 0) {
return initialfonts.filter((f) => !isFontActivated(f));
}
return initialfonts.map(
(f) => isFontActivated(f) ? { ...f, fontFace: newFontFaces } : f
);
};
const activatedFont = getActivatedFont(initialfonts);
if (!face) {
return toggleEntireFontFamily(activatedFont);
}
return toggleFontVariant(activatedFont);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/context.js
const { useGlobalSetting: context_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const FontLibraryContext = (0,external_wp_element_.createContext)({});
FontLibraryContext.displayName = "FontLibraryContext";
function FontLibraryProvider({ children }) {
const { saveEntityRecord } = (0,external_wp_data_.useDispatch)(external_wp_coreData_namespaceObject.store);
const { globalStylesId } = (0,external_wp_data_.useSelect)((select) => {
const { __experimentalGetCurrentGlobalStylesId } = select(external_wp_coreData_namespaceObject.store);
return { globalStylesId: __experimentalGetCurrentGlobalStylesId() };
});
const globalStyles = (0,external_wp_coreData_namespaceObject.useEntityRecord)(
"root",
"globalStyles",
globalStylesId
);
const [isInstalling, setIsInstalling] = (0,external_wp_element_.useState)(false);
const [refreshKey, setRefreshKey] = (0,external_wp_element_.useState)(0);
const refreshLibrary = () => {
setRefreshKey(Date.now());
};
const { records: libraryPosts = [], isResolving: isResolvingLibrary } = (0,external_wp_coreData_namespaceObject.useEntityRecords)("postType", "wp_font_family", {
refreshKey,
_embed: true
});
const libraryFonts = (libraryPosts || []).map((fontFamilyPost) => {
return {
id: fontFamilyPost.id,
...fontFamilyPost.font_family_settings,
fontFace: fontFamilyPost?._embedded?.font_faces.map(
(face) => face.font_face_settings
) || []
};
}) || [];
const [fontFamilies, setFontFamilies] = context_useGlobalSetting(
"typography.fontFamilies"
);
const saveFontFamilies = async (fonts) => {
const updatedGlobalStyles = globalStyles.record;
setNestedValue(
updatedGlobalStyles,
["settings", "typography", "fontFamilies"],
fonts
);
await saveEntityRecord("root", "globalStyles", updatedGlobalStyles);
};
const [modalTabOpen, setModalTabOpen] = (0,external_wp_element_.useState)(false);
const [libraryFontSelected, setLibraryFontSelected] = (0,external_wp_element_.useState)(null);
const themeFonts = fontFamilies?.theme ? fontFamilies.theme.map((f) => setUIValuesNeeded(f, { source: "theme" })).sort((a, b) => a.name.localeCompare(b.name)) : [];
const customFonts = fontFamilies?.custom ? fontFamilies.custom.map((f) => setUIValuesNeeded(f, { source: "custom" })).sort((a, b) => a.name.localeCompare(b.name)) : [];
const baseCustomFonts = libraryFonts ? libraryFonts.map((f) => setUIValuesNeeded(f, { source: "custom" })).sort((a, b) => a.name.localeCompare(b.name)) : [];
(0,external_wp_element_.useEffect)(() => {
if (!modalTabOpen) {
setLibraryFontSelected(null);
}
}, [modalTabOpen]);
const handleSetLibraryFontSelected = (font) => {
if (!font) {
setLibraryFontSelected(null);
return;
}
const fonts = font.source === "theme" ? themeFonts : baseCustomFonts;
const fontSelected = fonts.find((f) => f.slug === font.slug);
setLibraryFontSelected({
...fontSelected || font,
source: font.source
});
};
const [loadedFontUrls] = (0,external_wp_element_.useState)(/* @__PURE__ */ new Set());
const getAvailableFontsOutline = (availableFontFamilies) => {
const outline = availableFontFamilies.reduce((acc, font) => {
const availableFontFaces = font?.fontFace && font.fontFace?.length > 0 ? font?.fontFace.map(
(face) => `${face.fontStyle + face.fontWeight}`
) : ["normal400"];
acc[font.slug] = availableFontFaces;
return acc;
}, {});
return outline;
};
const getActivatedFontsOutline = (source) => {
switch (source) {
case "theme":
return getAvailableFontsOutline(themeFonts);
case "custom":
default:
return getAvailableFontsOutline(customFonts);
}
};
const isFontActivated = (slug, style, weight, source) => {
if (!style && !weight) {
return !!getActivatedFontsOutline(source)[slug];
}
return !!getActivatedFontsOutline(source)[slug]?.includes(
style + weight
);
};
const getFontFacesActivated = (slug, source) => {
return getActivatedFontsOutline(source)[slug] || [];
};
async function installFonts(fontFamiliesToInstall) {
setIsInstalling(true);
try {
const fontFamiliesToActivate = [];
let installationErrors = [];
for (const fontFamilyToInstall of fontFamiliesToInstall) {
let isANewFontFamily = false;
let installedFontFamily = await fetchGetFontFamilyBySlug(
fontFamilyToInstall.slug
);
if (!installedFontFamily) {
isANewFontFamily = true;
installedFontFamily = await fetchInstallFontFamily(
makeFontFamilyFormData(fontFamilyToInstall)
);
}
const alreadyInstalledFontFaces = installedFontFamily.fontFace && fontFamilyToInstall.fontFace ? installedFontFamily.fontFace.filter(
(fontFaceToInstall) => checkFontFaceInstalled(
fontFaceToInstall,
fontFamilyToInstall.fontFace
)
) : [];
if (installedFontFamily.fontFace && fontFamilyToInstall.fontFace) {
fontFamilyToInstall.fontFace = fontFamilyToInstall.fontFace.filter(
(fontFaceToInstall) => !checkFontFaceInstalled(
fontFaceToInstall,
installedFontFamily.fontFace
)
);
}
let successfullyInstalledFontFaces = [];
let unsuccessfullyInstalledFontFaces = [];
if (fontFamilyToInstall?.fontFace?.length > 0) {
const response = await batchInstallFontFaces(
installedFontFamily.id,
makeFontFacesFormData(fontFamilyToInstall)
);
successfullyInstalledFontFaces = response?.successes;
unsuccessfullyInstalledFontFaces = response?.errors;
}
if (successfullyInstalledFontFaces?.length > 0 || alreadyInstalledFontFaces?.length > 0) {
installedFontFamily.fontFace = [
...successfullyInstalledFontFaces
];
fontFamiliesToActivate.push(installedFontFamily);
}
if (installedFontFamily && !fontFamilyToInstall?.fontFace?.length) {
fontFamiliesToActivate.push(installedFontFamily);
}
if (isANewFontFamily && fontFamilyToInstall?.fontFace?.length > 0 && successfullyInstalledFontFaces?.length === 0) {
await fetchUninstallFontFamily(installedFontFamily.id);
}
installationErrors = installationErrors.concat(
unsuccessfullyInstalledFontFaces
);
}
installationErrors = installationErrors.reduce(
(unique, item) => unique.includes(item.message) ? unique : [...unique, item.message],
[]
);
if (fontFamiliesToActivate.length > 0) {
const activeFonts = activateCustomFontFamilies(
fontFamiliesToActivate
);
await saveFontFamilies(activeFonts);
refreshLibrary();
}
if (installationErrors.length > 0) {
const installError = new Error(
(0,external_wp_i18n_namespaceObject.__)("There was an error installing fonts.")
);
installError.installationErrors = installationErrors;
throw installError;
}
} finally {
setIsInstalling(false);
}
}
async function uninstallFontFamily(fontFamilyToUninstall) {
try {
const uninstalledFontFamily = await fetchUninstallFontFamily(
fontFamilyToUninstall.id
);
if (uninstalledFontFamily.deleted) {
const activeFonts = deactivateFontFamily(
fontFamilyToUninstall
);
await saveFontFamilies(activeFonts);
}
refreshLibrary();
return uninstalledFontFamily;
} catch (error) {
console.error(
`There was an error uninstalling the font family:`,
error
);
throw error;
}
}
const deactivateFontFamily = (font) => {
const initialCustomFonts = fontFamilies?.[font.source] ?? [];
const newCustomFonts = initialCustomFonts.filter(
(f) => f.slug !== font.slug
);
const activeFonts = {
...fontFamilies,
[font.source]: newCustomFonts
};
setFontFamilies(activeFonts);
if (font.fontFace) {
font.fontFace.forEach((face) => {
unloadFontFaceInBrowser(face, "all");
});
}
return activeFonts;
};
const activateCustomFontFamilies = (fontsToAdd) => {
const fontsToActivate = cleanFontsForSave(fontsToAdd);
const activeFonts = {
...fontFamilies,
// Merge the existing custom fonts with the new fonts.
custom: mergeFontFamilies(fontFamilies?.custom, fontsToActivate)
};
setFontFamilies(activeFonts);
loadFontsInBrowser(fontsToActivate);
return activeFonts;
};
const cleanFontsForSave = (fonts) => {
return fonts.map(({ id: _familyDbId, fontFace, ...font }) => ({
...font,
...fontFace && fontFace.length > 0 ? {
fontFace: fontFace.map(
({ id: _faceDbId, ...face }) => face
)
} : {}
}));
};
const loadFontsInBrowser = (fonts) => {
fonts.forEach((font) => {
if (font.fontFace) {
font.fontFace.forEach((face) => {
loadFontFaceInBrowser(
face,
getDisplaySrcFromFontFace(face.src),
"all"
);
});
}
});
};
const toggleActivateFont = (font, face) => {
const initialFonts = fontFamilies?.[font.source] ?? [];
const newFonts = toggleFont(font, face, initialFonts);
setFontFamilies({
...fontFamilies,
[font.source]: newFonts
});
const isFaceActivated = isFontActivated(
font.slug,
face?.fontStyle,
face?.fontWeight,
font.source
);
if (isFaceActivated) {
unloadFontFaceInBrowser(face, "all");
} else {
loadFontFaceInBrowser(
face,
getDisplaySrcFromFontFace(face?.src),
"all"
);
}
};
const loadFontFaceAsset = async (fontFace) => {
if (!fontFace.src) {
return;
}
const src = getDisplaySrcFromFontFace(fontFace.src);
if (!src || loadedFontUrls.has(src)) {
return;
}
loadFontFaceInBrowser(fontFace, src, "document");
loadedFontUrls.add(src);
};
const [collections, setFontCollections] = (0,external_wp_element_.useState)([]);
const getFontCollections = async () => {
const response = await fetchFontCollections();
setFontCollections(response);
};
const getFontCollection = async (slug) => {
try {
const hasData = !!collections.find(
(collection) => collection.slug === slug
)?.font_families;
if (hasData) {
return;
}
const response = await fetchFontCollection(slug);
const updatedCollections = collections.map(
(collection) => collection.slug === slug ? { ...collection, ...response } : collection
);
setFontCollections(updatedCollections);
} catch (e) {
console.error(e);
throw e;
}
};
(0,external_wp_element_.useEffect)(() => {
getFontCollections();
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FontLibraryContext.Provider,
{
value: {
libraryFontSelected,
handleSetLibraryFontSelected,
fontFamilies,
baseCustomFonts,
isFontActivated,
getFontFacesActivated,
loadFontFaceAsset,
installFonts,
uninstallFontFamily,
toggleActivateFont,
getAvailableFontsOutline,
modalTabOpen,
setModalTabOpen,
refreshLibrary,
saveFontFamilies,
isResolvingLibrary,
isInstalling,
collections,
getFontCollection
},
children
}
);
}
var context_default = FontLibraryProvider;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/font-demo.js
function getPreviewUrl(fontFace) {
if (fontFace.preview) {
return fontFace.preview;
}
if (fontFace.src) {
return Array.isArray(fontFace.src) ? fontFace.src[0] : fontFace.src;
}
}
function getDisplayFontFace(font) {
if (font.fontStyle || font.fontWeight) {
return font;
}
if (font.fontFace && font.fontFace.length) {
return font.fontFace.find(
(face) => face.fontStyle === "normal" && face.fontWeight === "400"
) || font.fontFace[0];
}
return {
fontStyle: "normal",
fontWeight: "400",
fontFamily: font.fontFamily,
fake: true
};
}
function FontDemo({ font, text }) {
const ref = (0,external_wp_element_.useRef)(null);
const fontFace = getDisplayFontFace(font);
const style = getFamilyPreviewStyle(font);
text = text || font.name;
const customPreviewUrl = font.preview;
const [isIntersecting, setIsIntersecting] = (0,external_wp_element_.useState)(false);
const [isAssetLoaded, setIsAssetLoaded] = (0,external_wp_element_.useState)(false);
const { loadFontFaceAsset } = (0,external_wp_element_.useContext)(FontLibraryContext);
const previewUrl = customPreviewUrl ?? getPreviewUrl(fontFace);
const isPreviewImage = previewUrl && previewUrl.match(/\.(png|jpg|jpeg|gif|svg)$/i);
const faceStyles = getFacePreviewStyle(fontFace);
const textDemoStyle = {
fontSize: "18px",
lineHeight: 1,
opacity: isAssetLoaded ? "1" : "0",
...style,
...faceStyles
};
(0,external_wp_element_.useEffect)(() => {
const observer = new window.IntersectionObserver(([entry]) => {
setIsIntersecting(entry.isIntersecting);
}, {});
observer.observe(ref.current);
return () => observer.disconnect();
}, [ref]);
(0,external_wp_element_.useEffect)(() => {
const loadAsset = async () => {
if (isIntersecting) {
if (!isPreviewImage && fontFace.src) {
await loadFontFaceAsset(fontFace);
}
setIsAssetLoaded(true);
}
};
loadAsset();
}, [fontFace, isIntersecting, loadFontFaceAsset, isPreviewImage]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref, children: isPreviewImage ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
src: previewUrl,
loading: "lazy",
alt: text,
className: "font-library-modal__font-variant_demo-image"
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalText,
{
style: textDemoStyle,
className: "font-library-modal__font-variant_demo-text",
children: text
}
) });
}
var font_demo_default = FontDemo;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/font-card.js
function FontCard({ font, onClick, variantsText, navigatorPath }) {
const variantsCount = font.fontFace?.length || 1;
const style = {
cursor: !!onClick ? "pointer" : "default"
};
const navigator = (0,external_wp_components_namespaceObject.useNavigator)();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
onClick: () => {
onClick();
if (navigatorPath) {
navigator.goTo(navigatorPath);
}
},
style,
className: "font-library-modal__font-card",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { justify: "space-between", wrap: false, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(font_demo_default, { font }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { justify: "flex-end", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { className: "font-library-modal__font-card__count", children: variantsText || (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: Number of font variants. */
(0,external_wp_i18n_namespaceObject._n)(
"%d variant",
"%d variants",
variantsCount
),
variantsCount
) }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_default : chevron_right_default }) })
] })
] })
}
);
}
var font_card_default = FontCard;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/library-font-variant.js
function LibraryFontVariant({ face, font }) {
const { isFontActivated, toggleActivateFont } = (0,external_wp_element_.useContext)(FontLibraryContext);
const isInstalled = font?.fontFace?.length > 0 ? isFontActivated(
font.slug,
face.fontStyle,
face.fontWeight,
font.source
) : isFontActivated(font.slug, null, null, font.source);
const handleToggleActivation = () => {
if (font?.fontFace?.length > 0) {
toggleActivateFont(font, face);
return;
}
toggleActivateFont(font);
};
const displayName = font.name + " " + getFontFaceVariantName(face);
const checkboxId = (0,external_wp_element_.useId)();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "font-library-modal__font-card", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { justify: "flex-start", align: "center", gap: "1rem", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CheckboxControl,
{
checked: isInstalled,
onChange: handleToggleActivation,
__nextHasNoMarginBottom: true,
id: checkboxId
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("label", { htmlFor: checkboxId, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
font_demo_default,
{
font: face,
text: displayName,
onClick: handleToggleActivation
}
) })
] }) });
}
var library_font_variant_default = LibraryFontVariant;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js
function getNumericFontWeight(value) {
switch (value) {
case "normal":
return 400;
case "bold":
return 700;
case "bolder":
return 500;
case "lighter":
return 300;
default:
return parseInt(value, 10);
}
}
function sortFontFaces(faces) {
return faces.sort((a, b) => {
if (a.fontStyle === "normal" && b.fontStyle !== "normal") {
return -1;
}
if (b.fontStyle === "normal" && a.fontStyle !== "normal") {
return 1;
}
if (a.fontStyle === b.fontStyle) {
return getNumericFontWeight(a.fontWeight) - getNumericFontWeight(b.fontWeight);
}
return a.fontStyle.localeCompare(b.fontStyle);
});
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/installed-fonts.js
const { useGlobalSetting: installed_fonts_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function InstalledFonts() {
const {
baseCustomFonts,
libraryFontSelected,
handleSetLibraryFontSelected,
refreshLibrary,
uninstallFontFamily,
isResolvingLibrary,
isInstalling,
saveFontFamilies,
getFontFacesActivated
} = (0,external_wp_element_.useContext)(FontLibraryContext);
const [fontFamilies, setFontFamilies] = installed_fonts_useGlobalSetting(
"typography.fontFamilies"
);
const [isConfirmDeleteOpen, setIsConfirmDeleteOpen] = (0,external_wp_element_.useState)(false);
const [notice, setNotice] = (0,external_wp_element_.useState)(false);
const [baseFontFamilies] = installed_fonts_useGlobalSetting(
"typography.fontFamilies",
void 0,
"base"
);
const globalStylesId = (0,external_wp_data_.useSelect)((select) => {
const { __experimentalGetCurrentGlobalStylesId } = select(external_wp_coreData_namespaceObject.store);
return __experimentalGetCurrentGlobalStylesId();
});
const globalStyles = (0,external_wp_coreData_namespaceObject.useEntityRecord)(
"root",
"globalStyles",
globalStylesId
);
const fontFamiliesHasChanges = !!globalStyles?.edits?.settings?.typography?.fontFamilies;
const themeFonts = fontFamilies?.theme ? fontFamilies.theme.map((f) => setUIValuesNeeded(f, { source: "theme" })).sort((a, b) => a.name.localeCompare(b.name)) : [];
const themeFontsSlugs = new Set(themeFonts.map((f) => f.slug));
const baseThemeFonts = baseFontFamilies?.theme ? themeFonts.concat(
baseFontFamilies.theme.filter((f) => !themeFontsSlugs.has(f.slug)).map((f) => setUIValuesNeeded(f, { source: "theme" })).sort((a, b) => a.name.localeCompare(b.name))
) : [];
const customFontFamilyId = libraryFontSelected?.source === "custom" && libraryFontSelected?.id;
const canUserDelete = (0,external_wp_data_.useSelect)(
(select) => {
const { canUser } = select(external_wp_coreData_namespaceObject.store);
return customFontFamilyId && canUser("delete", {
kind: "postType",
name: "wp_font_family",
id: customFontFamilyId
});
},
[customFontFamilyId]
);
const shouldDisplayDeleteButton = !!libraryFontSelected && libraryFontSelected?.source !== "theme" && canUserDelete;
const handleUninstallClick = () => {
setIsConfirmDeleteOpen(true);
};
const handleUpdate = async () => {
setNotice(null);
try {
await saveFontFamilies(fontFamilies);
setNotice({
type: "success",
message: (0,external_wp_i18n_namespaceObject.__)("Font family updated successfully.")
});
} catch (error) {
setNotice({
type: "error",
message: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: error message */
(0,external_wp_i18n_namespaceObject.__)("There was an error updating the font family. %s"),
error.message
)
});
}
};
const getFontFacesToDisplay = (font) => {
if (!font) {
return [];
}
if (!font.fontFace || !font.fontFace.length) {
return [
{
fontFamily: font.fontFamily,
fontStyle: "normal",
fontWeight: "400"
}
];
}
return sortFontFaces(font.fontFace);
};
const getFontCardVariantsText = (font) => {
const variantsInstalled = font?.fontFace?.length > 0 ? font.fontFace.length : 1;
const variantsActive = getFontFacesActivated(
font.slug,
font.source
).length;
return (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Active font variants, 2: Total font variants. */
(0,external_wp_i18n_namespaceObject.__)("%1$s/%2$s variants active"),
variantsActive,
variantsInstalled
);
};
(0,external_wp_element_.useEffect)(() => {
handleSetLibraryFontSelected(libraryFontSelected);
refreshLibrary();
}, []);
const activeFontsCount = libraryFontSelected ? getFontFacesActivated(
libraryFontSelected.slug,
libraryFontSelected.source
).length : 0;
const selectedFontsCount = libraryFontSelected?.fontFace?.length ?? (libraryFontSelected?.fontFamily ? 1 : 0);
const isIndeterminate = activeFontsCount > 0 && activeFontsCount !== selectedFontsCount;
const isSelectAllChecked = activeFontsCount === selectedFontsCount;
const toggleSelectAll = () => {
const initialFonts = fontFamilies?.[libraryFontSelected.source]?.filter(
(f) => f.slug !== libraryFontSelected.slug
) ?? [];
const newFonts = isSelectAllChecked ? initialFonts : [...initialFonts, libraryFontSelected];
setFontFamilies({
...fontFamilies,
[libraryFontSelected.source]: newFonts
});
if (libraryFontSelected.fontFace) {
libraryFontSelected.fontFace.forEach((face) => {
if (isSelectAllChecked) {
unloadFontFaceInBrowser(face, "all");
} else {
loadFontFaceInBrowser(
face,
getDisplaySrcFromFontFace(face?.src),
"all"
);
}
});
}
};
const hasFonts = baseThemeFonts.length > 0 || baseCustomFonts.length > 0;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "font-library-modal__tabpanel-layout", children: [
isResolvingLibrary && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "font-library-modal__loading", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ProgressBar, {}) }),
!isResolvingLibrary && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Navigator,
{
initialPath: libraryFontSelected ? "/fontFamily" : "/",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.Screen, { path: "/", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "8", children: [
notice && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Notice,
{
status: notice.type,
onRemove: () => setNotice(null),
children: notice.message
}
),
!hasFonts && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { as: "p", children: (0,external_wp_i18n_namespaceObject.__)("No fonts installed.") }),
baseThemeFonts.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", {
className: "font-library-modal__fonts-title",
/* translators: Heading for a list of fonts provided by the theme. */
children: (0,external_wp_i18n_namespaceObject._x)("Theme", "font source")
}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"ul",
{
role: "list",
className: "font-library-modal__fonts-list",
children: baseThemeFonts.map((font) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"li",
{
className: "font-library-modal__fonts-list-item",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
font_card_default,
{
font,
navigatorPath: "/fontFamily",
variantsText: getFontCardVariantsText(
font
),
onClick: () => {
setNotice(null);
handleSetLibraryFontSelected(
font
);
}
}
)
},
font.slug
))
}
)
] }),
baseCustomFonts.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", {
className: "font-library-modal__fonts-title",
/* translators: Heading for a list of fonts installed by the user. */
children: (0,external_wp_i18n_namespaceObject._x)("Custom", "font source")
}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"ul",
{
role: "list",
className: "font-library-modal__fonts-list",
children: baseCustomFonts.map((font) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"li",
{
className: "font-library-modal__fonts-list-item",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
font_card_default,
{
font,
navigatorPath: "/fontFamily",
variantsText: getFontCardVariantsText(
font
),
onClick: () => {
setNotice(null);
handleSetLibraryFontSelected(
font
);
}
}
)
},
font.slug
))
}
)
] })
] }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator.Screen, { path: "/fontFamily", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ConfirmDeleteDialog,
{
font: libraryFontSelected,
isOpen: isConfirmDeleteOpen,
setIsOpen: setIsConfirmDeleteOpen,
setNotice,
uninstallFontFamily,
handleSetLibraryFontSelected
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { justify: "flex-start", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Navigator.BackButton,
{
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right_default : chevron_left_default,
size: "small",
onClick: () => {
handleSetLibraryFontSelected(null);
setNotice(null);
},
label: (0,external_wp_i18n_namespaceObject.__)("Back")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHeading,
{
level: 2,
size: 13,
className: "edit-site-global-styles-header",
children: libraryFontSelected?.name
}
)
] }),
notice && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 1 }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Notice,
{
status: notice.type,
onRemove: () => setNotice(null),
children: notice.message
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 1 })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 4 }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)(
"Choose font variants. Keep in mind that too many variants could make your site slower."
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 4 }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 0, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CheckboxControl,
{
className: "font-library-modal__select-all",
label: (0,external_wp_i18n_namespaceObject.__)("Select all"),
checked: isSelectAllChecked,
onChange: toggleSelectAll,
indeterminate: isIndeterminate,
__nextHasNoMarginBottom: true
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 8 }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"ul",
{
role: "list",
className: "font-library-modal__fonts-list",
children: getFontFacesToDisplay(
libraryFontSelected
).map((face, i) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"li",
{
className: "font-library-modal__fonts-list-item",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
library_font_variant_default,
{
font: libraryFontSelected,
face
},
`face${i}`
)
},
`face${i}`
))
}
)
] })
] })
]
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
justify: "flex-end",
className: "font-library-modal__footer",
children: [
isInstalling && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ProgressBar, {}),
shouldDisplayDeleteButton && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
isDestructive: true,
variant: "tertiary",
onClick: handleUninstallClick,
children: (0,external_wp_i18n_namespaceObject.__)("Delete")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "primary",
onClick: handleUpdate,
disabled: !fontFamiliesHasChanges,
accessibleWhenDisabled: true,
children: (0,external_wp_i18n_namespaceObject.__)("Update")
}
)
]
}
)
] })
] });
}
function ConfirmDeleteDialog({
font,
isOpen,
setIsOpen,
setNotice,
uninstallFontFamily,
handleSetLibraryFontSelected
}) {
const navigator = (0,external_wp_components_namespaceObject.useNavigator)();
const handleConfirmUninstall = async () => {
setNotice(null);
setIsOpen(false);
try {
await uninstallFontFamily(font);
navigator.goBack();
handleSetLibraryFontSelected(null);
setNotice({
type: "success",
message: (0,external_wp_i18n_namespaceObject.__)("Font family uninstalled successfully.")
});
} catch (error) {
setNotice({
type: "error",
message: (0,external_wp_i18n_namespaceObject.__)("There was an error uninstalling the font family.") + error.message
});
}
};
const handleCancelUninstall = () => {
setIsOpen(false);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalConfirmDialog,
{
isOpen,
cancelButtonText: (0,external_wp_i18n_namespaceObject.__)("Cancel"),
confirmButtonText: (0,external_wp_i18n_namespaceObject.__)("Delete"),
onCancel: handleCancelUninstall,
onConfirm: handleConfirmUninstall,
size: "medium",
children: font && (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Name of the font. */
(0,external_wp_i18n_namespaceObject.__)(
'Are you sure you want to delete "%s" font and all its variants and assets?'
),
font.name
)
}
);
}
var installed_fonts_default = InstalledFonts;
;// ./node_modules/@wordpress/icons/build-module/library/next.js
var next_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/previous.js
var previous_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z" }) });
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js
function filterFonts(fonts, filters) {
const { category, search } = filters;
let filteredFonts = fonts || [];
if (category && category !== "all") {
filteredFonts = filteredFonts.filter(
(font) => font.categories.indexOf(category) !== -1
);
}
if (search) {
filteredFonts = filteredFonts.filter(
(font) => font.font_family_settings.name.toLowerCase().includes(search.toLowerCase())
);
}
return filteredFonts;
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js
function getFontsOutline(fonts) {
return fonts.reduce(
(acc, font) => ({
...acc,
[font.slug]: (font?.fontFace || []).reduce(
(faces, face) => ({
...faces,
[`${face.fontStyle}-${face.fontWeight}`]: true
}),
{}
)
}),
{}
);
}
function isFontFontFaceInOutline(slug, face, outline) {
if (!face) {
return !!outline[slug];
}
return !!outline[slug]?.[`${face.fontStyle}-${face.fontWeight}`];
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js
function GoogleFontsConfirmDialog() {
const handleConfirm = () => {
window.localStorage.setItem(
"wp-font-library-google-fonts-permission",
"true"
);
window.dispatchEvent(new Event("storage"));
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "font-library__google-fonts-confirm", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Card, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.CardBody, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { level: 2, children: (0,external_wp_i18n_namespaceObject.__)("Connect to Google Fonts") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 6 }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { as: "p", children: (0,external_wp_i18n_namespaceObject.__)(
"To install fonts from Google you must give permission to connect directly to Google servers. The fonts you install will be downloaded from Google and stored on your site. Your site will then use these locally-hosted fonts."
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 3 }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { as: "p", children: (0,external_wp_i18n_namespaceObject.__)(
"You can alternatively upload files directly on the Upload tab."
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 6 }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "primary",
onClick: handleConfirm,
children: (0,external_wp_i18n_namespaceObject.__)("Allow access to Google Fonts")
}
)
] }) }) });
}
var google_fonts_confirm_dialog_default = GoogleFontsConfirmDialog;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/collection-font-variant.js
function CollectionFontVariant({
face,
font,
handleToggleVariant,
selected
}) {
const handleToggleActivation = () => {
if (font?.fontFace) {
handleToggleVariant(font, face);
return;
}
handleToggleVariant(font);
};
const displayName = font.name + " " + getFontFaceVariantName(face);
const checkboxId = (0,external_wp_element_.useId)();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "font-library-modal__font-card", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { justify: "flex-start", align: "center", gap: "1rem", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CheckboxControl,
{
checked: selected,
onChange: handleToggleActivation,
__nextHasNoMarginBottom: true,
id: checkboxId
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("label", { htmlFor: checkboxId, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
font_demo_default,
{
font: face,
text: displayName,
onClick: handleToggleActivation
}
) })
] }) });
}
var collection_font_variant_default = CollectionFontVariant;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/font-collection.js
const DEFAULT_CATEGORY = {
slug: "all",
name: (0,external_wp_i18n_namespaceObject._x)("All", "font categories")
};
const LOCAL_STORAGE_ITEM = "wp-font-library-google-fonts-permission";
const MIN_WINDOW_HEIGHT = 500;
function FontCollection({ slug }) {
const requiresPermission = slug === "google-fonts";
const getGoogleFontsPermissionFromStorage = () => {
return window.localStorage.getItem(LOCAL_STORAGE_ITEM) === "true";
};
const [selectedFont, setSelectedFont] = (0,external_wp_element_.useState)(null);
const [notice, setNotice] = (0,external_wp_element_.useState)(false);
const [fontsToInstall, setFontsToInstall] = (0,external_wp_element_.useState)([]);
const [page, setPage] = (0,external_wp_element_.useState)(1);
const [filters, setFilters] = (0,external_wp_element_.useState)({});
const [renderConfirmDialog, setRenderConfirmDialog] = (0,external_wp_element_.useState)(
requiresPermission && !getGoogleFontsPermissionFromStorage()
);
const { collections, getFontCollection, installFonts, isInstalling } = (0,external_wp_element_.useContext)(FontLibraryContext);
const selectedCollection = collections.find(
(collection) => collection.slug === slug
);
(0,external_wp_element_.useEffect)(() => {
const handleStorage = () => {
setRenderConfirmDialog(
requiresPermission && !getGoogleFontsPermissionFromStorage()
);
};
handleStorage();
window.addEventListener("storage", handleStorage);
return () => window.removeEventListener("storage", handleStorage);
}, [slug, requiresPermission]);
const revokeAccess = () => {
window.localStorage.setItem(LOCAL_STORAGE_ITEM, "false");
window.dispatchEvent(new Event("storage"));
};
(0,external_wp_element_.useEffect)(() => {
const fetchFontCollection = async () => {
try {
await getFontCollection(slug);
resetFilters();
} catch (e) {
if (!notice) {
setNotice({
type: "error",
message: e?.message
});
}
}
};
fetchFontCollection();
}, [slug, getFontCollection, setNotice, notice]);
(0,external_wp_element_.useEffect)(() => {
setSelectedFont(null);
}, [slug]);
(0,external_wp_element_.useEffect)(() => {
setFontsToInstall([]);
}, [selectedFont]);
const collectionFonts = (0,external_wp_element_.useMemo)(
() => selectedCollection?.font_families ?? [],
[selectedCollection]
);
const collectionCategories = selectedCollection?.categories ?? [];
const categories = [DEFAULT_CATEGORY, ...collectionCategories];
const fonts = (0,external_wp_element_.useMemo)(
() => filterFonts(collectionFonts, filters),
[collectionFonts, filters]
);
const isLoading = !selectedCollection?.font_families && !notice;
const windowHeight = Math.max(window.innerHeight, MIN_WINDOW_HEIGHT);
const pageSize = Math.floor((windowHeight - 417) / 61);
const totalPages = Math.ceil(fonts.length / pageSize);
const itemsStart = (page - 1) * pageSize;
const itemsLimit = page * pageSize;
const items = fonts.slice(itemsStart, itemsLimit);
const handleCategoryFilter = (category) => {
setFilters({ ...filters, category });
setPage(1);
};
const handleUpdateSearchInput = (value) => {
setFilters({ ...filters, search: value });
setPage(1);
};
const debouncedUpdateSearchInput = (0,external_wp_compose_namespaceObject.debounce)(handleUpdateSearchInput, 300);
const resetFilters = () => {
setFilters({});
setPage(1);
};
const handleToggleVariant = (font, face) => {
const newFontsToInstall = toggleFont(font, face, fontsToInstall);
setFontsToInstall(newFontsToInstall);
};
const fontToInstallOutline = getFontsOutline(fontsToInstall);
const resetFontsToInstall = () => {
setFontsToInstall([]);
};
const selectFontCount = fontsToInstall.length > 0 ? fontsToInstall[0]?.fontFace?.length : 0;
const isIndeterminate = selectFontCount > 0 && selectFontCount !== selectedFont?.fontFace?.length;
const isSelectAllChecked = selectFontCount === selectedFont?.fontFace?.length;
const toggleSelectAll = () => {
const newFonts = isSelectAllChecked ? [] : [selectedFont];
setFontsToInstall(newFonts);
};
const handleInstall = async () => {
setNotice(null);
const fontFamily = fontsToInstall[0];
try {
if (fontFamily?.fontFace) {
await Promise.all(
fontFamily.fontFace.map(async (fontFace) => {
if (fontFace.src) {
fontFace.file = await downloadFontFaceAssets(
fontFace.src
);
}
})
);
}
} catch (error) {
setNotice({
type: "error",
message: (0,external_wp_i18n_namespaceObject.__)(
"Error installing the fonts, could not be downloaded."
)
});
return;
}
try {
await installFonts([fontFamily]);
setNotice({
type: "success",
message: (0,external_wp_i18n_namespaceObject.__)("Fonts were installed successfully.")
});
} catch (error) {
setNotice({
type: "error",
message: error.message
});
}
resetFontsToInstall();
};
const getSortedFontFaces = (fontFamily) => {
if (!fontFamily) {
return [];
}
if (!fontFamily.fontFace || !fontFamily.fontFace.length) {
return [
{
fontFamily: fontFamily.fontFamily,
fontStyle: "normal",
fontWeight: "400"
}
];
}
return sortFontFaces(fontFamily.fontFace);
};
if (renderConfirmDialog) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(google_fonts_confirm_dialog_default, {});
}
const ActionsComponent = () => {
if (slug !== "google-fonts" || renderConfirmDialog || selectedFont) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropdownMenu,
{
icon: more_vertical_default,
label: (0,external_wp_i18n_namespaceObject.__)("Actions"),
popoverProps: {
position: "bottom left"
},
controls: [
{
title: (0,external_wp_i18n_namespaceObject.__)("Revoke access to Google Fonts"),
onClick: revokeAccess
}
]
}
);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "font-library-modal__tabpanel-layout", children: [
isLoading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "font-library-modal__loading", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ProgressBar, {}) }),
!isLoading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Navigator,
{
initialPath: "/",
className: "font-library-modal__tabpanel-layout",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator.Screen, { path: "/", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { level: 2, size: 13, children: selectedCollection.name }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: selectedCollection.description })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionsComponent, {})
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 4 }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SearchControl,
{
className: "font-library-modal__search",
value: filters.search,
placeholder: (0,external_wp_i18n_namespaceObject.__)("Font name\u2026"),
label: (0,external_wp_i18n_namespaceObject.__)("Search"),
onChange: debouncedUpdateSearchInput,
__nextHasNoMarginBottom: true,
hideLabelFromVision: false
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SelectControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Category"),
value: filters.category,
onChange: handleCategoryFilter,
children: categories && categories.map((category) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"option",
{
value: category.slug,
children: category.name
},
category.slug
))
}
) })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 4 }),
!!selectedCollection?.font_families?.length && !fonts.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)(
"No fonts found. Try with a different search term."
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "font-library-modal__fonts-grid__main", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"ul",
{
role: "list",
className: "font-library-modal__fonts-list",
children: items.map((font) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"li",
{
className: "font-library-modal__fonts-list-item",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
font_card_default,
{
font: font.font_family_settings,
navigatorPath: "/fontFamily",
onClick: () => {
setSelectedFont(
font.font_family_settings
);
}
}
)
},
font.font_family_settings.slug
))
}
) })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator.Screen, { path: "/fontFamily", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { justify: "flex-start", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Navigator.BackButton,
{
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right_default : chevron_left_default,
size: "small",
onClick: () => {
setSelectedFont(null);
setNotice(null);
},
label: (0,external_wp_i18n_namespaceObject.__)("Back")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHeading,
{
level: 2,
size: 13,
className: "edit-site-global-styles-header",
children: selectedFont?.name
}
)
] }),
notice && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 1 }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Notice,
{
status: notice.type,
onRemove: () => setNotice(null),
children: notice.message
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 1 })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 4 }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)("Select font variants to install.") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 4 }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CheckboxControl,
{
className: "font-library-modal__select-all",
label: (0,external_wp_i18n_namespaceObject.__)("Select all"),
checked: isSelectAllChecked,
onChange: toggleSelectAll,
indeterminate: isIndeterminate,
__nextHasNoMarginBottom: true
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 0, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"ul",
{
role: "list",
className: "font-library-modal__fonts-list",
children: getSortedFontFaces(selectedFont).map(
(face, i) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"li",
{
className: "font-library-modal__fonts-list-item",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
collection_font_variant_default,
{
font: selectedFont,
face,
handleToggleVariant,
selected: isFontFontFaceInOutline(
selectedFont.slug,
selectedFont.fontFace ? face : null,
// If the font has no fontFace, we want to check if the font is in the outline
fontToInstallOutline
)
}
)
},
`face${i}`
)
)
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 16 })
] })
]
}
),
selectedFont && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Flex,
{
justify: "flex-end",
className: "font-library-modal__footer",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "primary",
onClick: handleInstall,
isBusy: isInstalling,
disabled: fontsToInstall.length === 0 || isInstalling,
accessibleWhenDisabled: true,
children: (0,external_wp_i18n_namespaceObject.__)("Install")
}
)
}
),
!selectedFont && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
expanded: false,
className: "font-library-modal__footer",
justify: "end",
spacing: 6,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHStack,
{
justify: "flex-start",
expanded: false,
spacing: 1,
className: "font-library-modal__page-selection",
children: (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Current page number, 2: Total number of pages.
(0,external_wp_i18n_namespaceObject._x)(
"<div>Page</div>%1$s<div>of %2$s</div>",
"paging"
),
"<CurrentPage />",
totalPages
),
{
div: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { "aria-hidden": true }),
CurrentPage: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SelectControl,
{
"aria-label": (0,external_wp_i18n_namespaceObject.__)(
"Current page"
),
value: page,
options: [
...Array(totalPages)
].map((e, i) => {
return {
label: i + 1,
value: i + 1
};
}),
onChange: (newPage) => setPage(
parseInt(newPage)
),
size: "small",
__nextHasNoMarginBottom: true,
variant: "minimal"
}
)
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { expanded: false, spacing: 1, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
onClick: () => setPage(page - 1),
disabled: page === 1,
accessibleWhenDisabled: true,
label: (0,external_wp_i18n_namespaceObject.__)("Previous page"),
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? next_default : previous_default,
showTooltip: true,
size: "compact",
tooltipPosition: "top"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
onClick: () => setPage(page + 1),
disabled: page === totalPages,
accessibleWhenDisabled: true,
label: (0,external_wp_i18n_namespaceObject.__)("Next page"),
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? previous_default : next_default,
showTooltip: true,
size: "compact",
tooltipPosition: "top"
}
)
] })
]
}
)
] })
] });
}
var font_collection_default = FontCollection;
// EXTERNAL MODULE: ./node_modules/@wordpress/edit-site/lib/unbrotli.js
var unbrotli = __webpack_require__(8572);
var unbrotli_default = /*#__PURE__*/__webpack_require__.n(unbrotli);
// EXTERNAL MODULE: ./node_modules/@wordpress/edit-site/lib/inflate.js
var inflate = __webpack_require__(4660);
var inflate_default = /*#__PURE__*/__webpack_require__.n(inflate);
;// ./node_modules/@wordpress/edit-site/lib/lib-font.browser.js
/**
* Credits:
*
* lib-font
* https://github.com/Pomax/lib-font
* https://github.com/Pomax/lib-font/blob/master/lib-font.browser.js
*
* The MIT License (MIT)
*
* Copyright (c) 2020 pomax@nihongoresources.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/* eslint eslint-comments/no-unlimited-disable: 0 */
/* eslint-disable */
// import pako from 'pako';
let fetchFunction = globalThis.fetch;
// if ( ! fetchFunction ) {
// let backlog = [];
// fetchFunction = globalThis.fetch = ( ...args ) =>
// new Promise( ( resolve, reject ) => {
// backlog.push( { args: args, resolve: resolve, reject: reject } );
// } );
// import( 'fs' )
// .then( ( fs ) => {
// fetchFunction = globalThis.fetch = async function ( path ) {
// return new Promise( ( resolve, reject ) => {
// fs.readFile( path, ( err, data ) => {
// if ( err ) return reject( err );
// resolve( { ok: true, arrayBuffer: () => data.buffer } );
// } );
// } );
// };
// while ( backlog.length ) {
// let instruction = backlog.shift();
// fetchFunction( ...instruction.args )
// .then( ( data ) => instruction.resolve( data ) )
// .catch( ( err ) => instruction.reject( err ) );
// }
// } )
// .catch( ( err ) => {
// console.error( err );
// throw new Error(
// `lib-font cannot run unless either the Fetch API or Node's filesystem module is available.`
// );
// } );
// }
class lib_font_browser_Event {
constructor( type, detail = {}, msg ) {
this.type = type;
this.detail = detail;
this.msg = msg;
Object.defineProperty( this, `__mayPropagate`, {
enumerable: false,
writable: true,
} );
this.__mayPropagate = true;
}
preventDefault() {}
stopPropagation() {
this.__mayPropagate = false;
}
valueOf() {
return this;
}
toString() {
return this.msg
? `[${ this.type } event]: ${ this.msg }`
: `[${ this.type } event]`;
}
}
class EventManager {
constructor() {
this.listeners = {};
}
addEventListener( type, listener, useCapture ) {
let bin = this.listeners[ type ] || [];
if ( useCapture ) bin.unshift( listener );
else bin.push( listener );
this.listeners[ type ] = bin;
}
removeEventListener( type, listener ) {
let bin = this.listeners[ type ] || [];
let pos = bin.findIndex( ( e ) => e === listener );
if ( pos > -1 ) {
bin.splice( pos, 1 );
this.listeners[ type ] = bin;
}
}
dispatch( event ) {
let bin = this.listeners[ event.type ];
if ( bin ) {
for ( let l = 0, e = bin.length; l < e; l++ ) {
if ( ! event.__mayPropagate ) break;
bin[ l ]( event );
}
}
}
}
const startDate = new Date( `1904-01-01T00:00:00+0000` ).getTime();
function asText( data ) {
return Array.from( data )
.map( ( v ) => String.fromCharCode( v ) )
.join( `` );
}
class Parser {
constructor( dict, dataview, name ) {
this.name = ( name || dict.tag || `` ).trim();
this.length = dict.length;
this.start = dict.offset;
this.offset = 0;
this.data = dataview;
[
`getInt8`,
`getUint8`,
`getInt16`,
`getUint16`,
`getInt32`,
`getUint32`,
`getBigInt64`,
`getBigUint64`,
].forEach( ( name ) => {
let fn = name.replace( /get(Big)?/, '' ).toLowerCase();
let increment = parseInt( name.replace( /[^\d]/g, '' ) ) / 8;
Object.defineProperty( this, fn, {
get: () => this.getValue( name, increment ),
} );
} );
}
get currentPosition() {
return this.start + this.offset;
}
set currentPosition( position ) {
this.start = position;
this.offset = 0;
}
skip( n = 0, bits = 8 ) {
this.offset += ( n * bits ) / 8;
}
getValue( type, increment ) {
let pos = this.start + this.offset;
this.offset += increment;
try {
return this.data[ type ]( pos );
} catch ( e ) {
console.error( `parser`, type, increment, this );
console.error( `parser`, this.start, this.offset );
throw e;
}
}
flags( n ) {
if ( n === 8 || n === 16 || n === 32 || n === 64 ) {
return this[ `uint${ n }` ]
.toString( 2 )
.padStart( n, 0 )
.split( `` )
.map( ( v ) => v === '1' );
}
console.error(
`Error parsing flags: flag types can only be 1, 2, 4, or 8 bytes long`
);
console.trace();
}
get tag() {
const t = this.uint32;
return asText( [
( t >> 24 ) & 255,
( t >> 16 ) & 255,
( t >> 8 ) & 255,
t & 255,
] );
}
get fixed() {
let major = this.int16;
let minor = Math.round( ( 1e3 * this.uint16 ) / 65356 );
return major + minor / 1e3;
}
get legacyFixed() {
let major = this.uint16;
let minor = this.uint16.toString( 16 ).padStart( 4, 0 );
return parseFloat( `${ major }.${ minor }` );
}
get uint24() {
return ( this.uint8 << 16 ) + ( this.uint8 << 8 ) + this.uint8;
}
get uint128() {
let value = 0;
for ( let i = 0; i < 5; i++ ) {
let byte = this.uint8;
value = value * 128 + ( byte & 127 );
if ( byte < 128 ) break;
}
return value;
}
get longdatetime() {
return new Date( startDate + 1e3 * parseInt( this.int64.toString() ) );
}
get fword() {
return this.int16;
}
get ufword() {
return this.uint16;
}
get Offset16() {
return this.uint16;
}
get Offset32() {
return this.uint32;
}
get F2DOT14() {
const bits = p.uint16;
const integer = [ 0, 1, -2, -1 ][ bits >> 14 ];
const fraction = bits & 16383;
return integer + fraction / 16384;
}
verifyLength() {
if ( this.offset != this.length ) {
console.error(
`unexpected parsed table size (${ this.offset }) for "${ this.name }" (expected ${ this.length })`
);
}
}
readBytes( n = 0, position = 0, bits = 8, signed = false ) {
n = n || this.length;
if ( n === 0 ) return [];
if ( position ) this.currentPosition = position;
const fn = `${ signed ? `` : `u` }int${ bits }`,
slice = [];
while ( n-- ) slice.push( this[ fn ] );
return slice;
}
}
class ParsedData {
constructor( parser ) {
const pGetter = { enumerable: false, get: () => parser };
Object.defineProperty( this, `parser`, pGetter );
const start = parser.currentPosition;
const startGetter = { enumerable: false, get: () => start };
Object.defineProperty( this, `start`, startGetter );
}
load( struct ) {
Object.keys( struct ).forEach( ( p ) => {
let props = Object.getOwnPropertyDescriptor( struct, p );
if ( props.get ) {
this[ p ] = props.get.bind( this );
} else if ( props.value !== undefined ) {
this[ p ] = props.value;
}
} );
if ( this.parser.length ) {
this.parser.verifyLength();
}
}
}
class SimpleTable extends ParsedData {
constructor( dict, dataview, name ) {
const { parser: parser, start: start } = super(
new Parser( dict, dataview, name )
);
const pGetter = { enumerable: false, get: () => parser };
Object.defineProperty( this, `p`, pGetter );
const startGetter = { enumerable: false, get: () => start };
Object.defineProperty( this, `tableStart`, startGetter );
}
}
function lazy$1( object, property, getter ) {
let val;
Object.defineProperty( object, property, {
get: () => {
if ( val ) return val;
val = getter();
return val;
},
enumerable: true,
} );
}
class SFNT extends SimpleTable {
constructor( font, dataview, createTable ) {
const { p: p } = super( { offset: 0, length: 12 }, dataview, `sfnt` );
this.version = p.uint32;
this.numTables = p.uint16;
this.searchRange = p.uint16;
this.entrySelector = p.uint16;
this.rangeShift = p.uint16;
p.verifyLength();
this.directory = [ ...new Array( this.numTables ) ].map(
( _ ) => new TableRecord( p )
);
this.tables = {};
this.directory.forEach( ( entry ) => {
const getter = () =>
createTable(
this.tables,
{
tag: entry.tag,
offset: entry.offset,
length: entry.length,
},
dataview
);
lazy$1( this.tables, entry.tag.trim(), getter );
} );
}
}
class TableRecord {
constructor( p ) {
this.tag = p.tag;
this.checksum = p.uint32;
this.offset = p.uint32;
this.length = p.uint32;
}
}
const gzipDecode = (inflate_default()).inflate || undefined;
let nativeGzipDecode = undefined;
// if ( ! gzipDecode ) {
// import( 'zlib' ).then( ( zlib ) => {
// nativeGzipDecode = ( buffer ) => zlib.unzipSync( buffer );
// } );
// }
class WOFF$1 extends SimpleTable {
constructor( font, dataview, createTable ) {
const { p: p } = super( { offset: 0, length: 44 }, dataview, `woff` );
this.signature = p.tag;
this.flavor = p.uint32;
this.length = p.uint32;
this.numTables = p.uint16;
p.uint16;
this.totalSfntSize = p.uint32;
this.majorVersion = p.uint16;
this.minorVersion = p.uint16;
this.metaOffset = p.uint32;
this.metaLength = p.uint32;
this.metaOrigLength = p.uint32;
this.privOffset = p.uint32;
this.privLength = p.uint32;
p.verifyLength();
this.directory = [ ...new Array( this.numTables ) ].map(
( _ ) => new WoffTableDirectoryEntry( p )
);
buildWoffLazyLookups( this, dataview, createTable );
}
}
class WoffTableDirectoryEntry {
constructor( p ) {
this.tag = p.tag;
this.offset = p.uint32;
this.compLength = p.uint32;
this.origLength = p.uint32;
this.origChecksum = p.uint32;
}
}
function buildWoffLazyLookups( woff, dataview, createTable ) {
woff.tables = {};
woff.directory.forEach( ( entry ) => {
lazy$1( woff.tables, entry.tag.trim(), () => {
let offset = 0;
let view = dataview;
if ( entry.compLength !== entry.origLength ) {
const data = dataview.buffer.slice(
entry.offset,
entry.offset + entry.compLength
);
let unpacked;
if ( gzipDecode ) {
unpacked = gzipDecode( new Uint8Array( data ) );
} else if ( nativeGzipDecode ) {
unpacked = nativeGzipDecode( new Uint8Array( data ) );
} else {
const msg = `no brotli decoder available to decode WOFF2 font`;
if ( font.onerror ) font.onerror( msg );
throw new Error( msg );
}
view = new DataView( unpacked.buffer );
} else {
offset = entry.offset;
}
return createTable(
woff.tables,
{ tag: entry.tag, offset: offset, length: entry.origLength },
view
);
} );
} );
}
const brotliDecode = (unbrotli_default());
let nativeBrotliDecode = undefined;
// if ( ! brotliDecode ) {
// import( 'zlib' ).then( ( zlib ) => {
// nativeBrotliDecode = ( buffer ) => zlib.brotliDecompressSync( buffer );
// } );
// }
class WOFF2$1 extends SimpleTable {
constructor( font, dataview, createTable ) {
const { p: p } = super( { offset: 0, length: 48 }, dataview, `woff2` );
this.signature = p.tag;
this.flavor = p.uint32;
this.length = p.uint32;
this.numTables = p.uint16;
p.uint16;
this.totalSfntSize = p.uint32;
this.totalCompressedSize = p.uint32;
this.majorVersion = p.uint16;
this.minorVersion = p.uint16;
this.metaOffset = p.uint32;
this.metaLength = p.uint32;
this.metaOrigLength = p.uint32;
this.privOffset = p.uint32;
this.privLength = p.uint32;
p.verifyLength();
this.directory = [ ...new Array( this.numTables ) ].map(
( _ ) => new Woff2TableDirectoryEntry( p )
);
let dictOffset = p.currentPosition;
this.directory[ 0 ].offset = 0;
this.directory.forEach( ( e, i ) => {
let next = this.directory[ i + 1 ];
if ( next ) {
next.offset =
e.offset +
( e.transformLength !== undefined
? e.transformLength
: e.origLength );
}
} );
let decoded;
let buffer = dataview.buffer.slice( dictOffset );
if ( brotliDecode ) {
decoded = brotliDecode( new Uint8Array( buffer ) );
} else if ( nativeBrotliDecode ) {
decoded = new Uint8Array( nativeBrotliDecode( buffer ) );
} else {
const msg = `no brotli decoder available to decode WOFF2 font`;
if ( font.onerror ) font.onerror( msg );
throw new Error( msg );
}
buildWoff2LazyLookups( this, decoded, createTable );
}
}
class Woff2TableDirectoryEntry {
constructor( p ) {
this.flags = p.uint8;
const tagNumber = ( this.tagNumber = this.flags & 63 );
if ( tagNumber === 63 ) {
this.tag = p.tag;
} else {
this.tag = getWOFF2Tag( tagNumber );
}
const transformVersion = ( this.transformVersion =
( this.flags & 192 ) >> 6 );
let hasTransforms = transformVersion !== 0;
if ( this.tag === `glyf` || this.tag === `loca` ) {
hasTransforms = this.transformVersion !== 3;
}
this.origLength = p.uint128;
if ( hasTransforms ) {
this.transformLength = p.uint128;
}
}
}
function buildWoff2LazyLookups( woff2, decoded, createTable ) {
woff2.tables = {};
woff2.directory.forEach( ( entry ) => {
lazy$1( woff2.tables, entry.tag.trim(), () => {
const start = entry.offset;
const end =
start +
( entry.transformLength
? entry.transformLength
: entry.origLength );
const data = new DataView( decoded.slice( start, end ).buffer );
try {
return createTable(
woff2.tables,
{ tag: entry.tag, offset: 0, length: entry.origLength },
data
);
} catch ( e ) {
console.error( e );
}
} );
} );
}
function getWOFF2Tag( flag ) {
return [
`cmap`,
`head`,
`hhea`,
`hmtx`,
`maxp`,
`name`,
`OS/2`,
`post`,
`cvt `,
`fpgm`,
`glyf`,
`loca`,
`prep`,
`CFF `,
`VORG`,
`EBDT`,
`EBLC`,
`gasp`,
`hdmx`,
`kern`,
`LTSH`,
`PCLT`,
`VDMX`,
`vhea`,
`vmtx`,
`BASE`,
`GDEF`,
`GPOS`,
`GSUB`,
`EBSC`,
`JSTF`,
`MATH`,
`CBDT`,
`CBLC`,
`COLR`,
`CPAL`,
`SVG `,
`sbix`,
`acnt`,
`avar`,
`bdat`,
`bloc`,
`bsln`,
`cvar`,
`fdsc`,
`feat`,
`fmtx`,
`fvar`,
`gvar`,
`hsty`,
`just`,
`lcar`,
`mort`,
`morx`,
`opbd`,
`prop`,
`trak`,
`Zapf`,
`Silf`,
`Glat`,
`Gloc`,
`Feat`,
`Sill`,
][ flag & 63 ];
}
const tableClasses = {};
let tableClassesLoaded = false;
Promise.all( [
Promise.resolve().then( function () {
return cmap$1;
} ),
Promise.resolve().then( function () {
return head$1;
} ),
Promise.resolve().then( function () {
return hhea$1;
} ),
Promise.resolve().then( function () {
return hmtx$1;
} ),
Promise.resolve().then( function () {
return maxp$1;
} ),
Promise.resolve().then( function () {
return name$1;
} ),
Promise.resolve().then( function () {
return OS2$1;
} ),
Promise.resolve().then( function () {
return post$1;
} ),
Promise.resolve().then( function () {
return BASE$1;
} ),
Promise.resolve().then( function () {
return GDEF$1;
} ),
Promise.resolve().then( function () {
return GSUB$1;
} ),
Promise.resolve().then( function () {
return GPOS$1;
} ),
Promise.resolve().then( function () {
return SVG$1;
} ),
Promise.resolve().then( function () {
return fvar$1;
} ),
Promise.resolve().then( function () {
return cvt$1;
} ),
Promise.resolve().then( function () {
return fpgm$1;
} ),
Promise.resolve().then( function () {
return gasp$1;
} ),
Promise.resolve().then( function () {
return glyf$1;
} ),
Promise.resolve().then( function () {
return loca$1;
} ),
Promise.resolve().then( function () {
return prep$1;
} ),
Promise.resolve().then( function () {
return CFF$1;
} ),
Promise.resolve().then( function () {
return CFF2$1;
} ),
Promise.resolve().then( function () {
return VORG$1;
} ),
Promise.resolve().then( function () {
return EBLC$1;
} ),
Promise.resolve().then( function () {
return EBDT$1;
} ),
Promise.resolve().then( function () {
return EBSC$1;
} ),
Promise.resolve().then( function () {
return CBLC$1;
} ),
Promise.resolve().then( function () {
return CBDT$1;
} ),
Promise.resolve().then( function () {
return sbix$1;
} ),
Promise.resolve().then( function () {
return COLR$1;
} ),
Promise.resolve().then( function () {
return CPAL$1;
} ),
Promise.resolve().then( function () {
return DSIG$1;
} ),
Promise.resolve().then( function () {
return hdmx$1;
} ),
Promise.resolve().then( function () {
return kern$1;
} ),
Promise.resolve().then( function () {
return LTSH$1;
} ),
Promise.resolve().then( function () {
return MERG$1;
} ),
Promise.resolve().then( function () {
return meta$1;
} ),
Promise.resolve().then( function () {
return PCLT$1;
} ),
Promise.resolve().then( function () {
return VDMX$1;
} ),
Promise.resolve().then( function () {
return vhea$1;
} ),
Promise.resolve().then( function () {
return vmtx$1;
} ),
] ).then( ( data ) => {
data.forEach( ( e ) => {
let name = Object.keys( e )[ 0 ];
tableClasses[ name ] = e[ name ];
} );
tableClassesLoaded = true;
} );
function createTable( tables, dict, dataview ) {
let name = dict.tag.replace( /[^\w\d]/g, `` );
let Type = tableClasses[ name ];
if ( Type ) return new Type( dict, dataview, tables );
console.warn(
`lib-font has no definition for ${ name }. The table was skipped.`
);
return {};
}
function loadTableClasses() {
let count = 0;
function checkLoaded( resolve, reject ) {
if ( ! tableClassesLoaded ) {
if ( count > 10 ) {
return reject( new Error( `loading took too long` ) );
}
count++;
return setTimeout( () => checkLoaded( resolve ), 250 );
}
resolve( createTable );
}
return new Promise( ( resolve, reject ) => checkLoaded( resolve ) );
}
function getFontCSSFormat( path, errorOnStyle ) {
let pos = path.lastIndexOf( `.` );
let ext = ( path.substring( pos + 1 ) || `` ).toLowerCase();
let format = {
ttf: `truetype`,
otf: `opentype`,
woff: `woff`,
woff2: `woff2`,
}[ ext ];
if ( format ) return format;
let msg = {
eot: `The .eot format is not supported: it died in January 12, 2016, when Microsoft retired all versions of IE that didn't already support WOFF.`,
svg: `The .svg format is not supported: SVG fonts (not to be confused with OpenType with embedded SVG) were so bad we took the entire fonts chapter out of the SVG specification again.`,
fon: `The .fon format is not supported: this is an ancient Windows bitmap font format.`,
ttc: `Based on the current CSS specification, font collections are not (yet?) supported.`,
}[ ext ];
if ( ! msg ) msg = `${ path } is not a known webfont format.`;
if ( errorOnStyle ) {
throw new Error( msg );
} else {
console.warn( `Could not load font: ${ msg }` );
}
}
async function setupFontFace( name, url, options = {} ) {
if ( ! globalThis.document ) return;
let format = getFontCSSFormat( url, options.errorOnStyle );
if ( ! format ) return;
let style = document.createElement( `style` );
style.className = `injected-by-Font-js`;
let rules = [];
if ( options.styleRules ) {
rules = Object.entries( options.styleRules ).map(
( [ key, value ] ) => `${ key }: ${ value };`
);
}
style.textContent = `\n@font-face {\n font-family: "${ name }";\n ${ rules.join(
`\n\t`
) }\n src: url("${ url }") format("${ format }");\n}`;
globalThis.document.head.appendChild( style );
return style;
}
const TTF = [ 0, 1, 0, 0 ];
const OTF = [ 79, 84, 84, 79 ];
const WOFF = [ 119, 79, 70, 70 ];
const WOFF2 = [ 119, 79, 70, 50 ];
function match( ar1, ar2 ) {
if ( ar1.length !== ar2.length ) return;
for ( let i = 0; i < ar1.length; i++ ) {
if ( ar1[ i ] !== ar2[ i ] ) return;
}
return true;
}
function validFontFormat( dataview ) {
const LEAD_BYTES = [
dataview.getUint8( 0 ),
dataview.getUint8( 1 ),
dataview.getUint8( 2 ),
dataview.getUint8( 3 ),
];
if ( match( LEAD_BYTES, TTF ) || match( LEAD_BYTES, OTF ) ) return `SFNT`;
if ( match( LEAD_BYTES, WOFF ) ) return `WOFF`;
if ( match( LEAD_BYTES, WOFF2 ) ) return `WOFF2`;
}
function checkFetchResponseStatus( response ) {
if ( ! response.ok ) {
throw new Error(
`HTTP ${ response.status } - ${ response.statusText }`
);
}
return response;
}
class Font extends EventManager {
constructor( name, options = {} ) {
super();
this.name = name;
this.options = options;
this.metrics = false;
}
get src() {
return this.__src;
}
set src( src ) {
this.__src = src;
( async () => {
if ( globalThis.document && ! this.options.skipStyleSheet ) {
await setupFontFace( this.name, src, this.options );
}
this.loadFont( src );
} )();
}
async loadFont( url, filename ) {
fetch( url )
.then(
( response ) =>
checkFetchResponseStatus( response ) &&
response.arrayBuffer()
)
.then( ( buffer ) =>
this.fromDataBuffer( buffer, filename || url )
)
.catch( ( err ) => {
const evt = new lib_font_browser_Event(
`error`,
err,
`Failed to load font at ${ filename || url }`
);
this.dispatch( evt );
if ( this.onerror ) this.onerror( evt );
} );
}
async fromDataBuffer( buffer, filenameOrUrL ) {
this.fontData = new DataView( buffer );
let type = validFontFormat( this.fontData );
if ( ! type ) {
throw new Error(
`${ filenameOrUrL } is either an unsupported font format, or not a font at all.`
);
}
await this.parseBasicData( type );
const evt = new lib_font_browser_Event( 'load', { font: this } );
this.dispatch( evt );
if ( this.onload ) this.onload( evt );
}
async parseBasicData( type ) {
return loadTableClasses().then( ( createTable ) => {
if ( type === `SFNT` ) {
this.opentype = new SFNT( this, this.fontData, createTable );
}
if ( type === `WOFF` ) {
this.opentype = new WOFF$1( this, this.fontData, createTable );
}
if ( type === `WOFF2` ) {
this.opentype = new WOFF2$1( this, this.fontData, createTable );
}
return this.opentype;
} );
}
getGlyphId( char ) {
return this.opentype.tables.cmap.getGlyphId( char );
}
reverse( glyphid ) {
return this.opentype.tables.cmap.reverse( glyphid );
}
supports( char ) {
return this.getGlyphId( char ) !== 0;
}
supportsVariation( variation ) {
return (
this.opentype.tables.cmap.supportsVariation( variation ) !== false
);
}
measureText( text, size = 16 ) {
if ( this.__unloaded )
throw new Error(
'Cannot measure text: font was unloaded. Please reload before calling measureText()'
);
let d = document.createElement( 'div' );
d.textContent = text;
d.style.fontFamily = this.name;
d.style.fontSize = `${ size }px`;
d.style.color = `transparent`;
d.style.background = `transparent`;
d.style.top = `0`;
d.style.left = `0`;
d.style.position = `absolute`;
document.body.appendChild( d );
let bbox = d.getBoundingClientRect();
document.body.removeChild( d );
const OS2 = this.opentype.tables[ 'OS/2' ];
bbox.fontSize = size;
bbox.ascender = OS2.sTypoAscender;
bbox.descender = OS2.sTypoDescender;
return bbox;
}
unload() {
if ( this.styleElement.parentNode ) {
this.styleElement.parentNode.removeElement( this.styleElement );
const evt = new lib_font_browser_Event( 'unload', { font: this } );
this.dispatch( evt );
if ( this.onunload ) this.onunload( evt );
}
this._unloaded = true;
}
load() {
if ( this.__unloaded ) {
delete this.__unloaded;
document.head.appendChild( this.styleElement );
const evt = new lib_font_browser_Event( 'load', { font: this } );
this.dispatch( evt );
if ( this.onload ) this.onload( evt );
}
}
}
globalThis.Font = Font;
class Subtable extends ParsedData {
constructor( p, plaformID, encodingID ) {
super( p );
this.plaformID = plaformID;
this.encodingID = encodingID;
}
}
class Format0 extends Subtable {
constructor( p, platformID, encodingID ) {
super( p, platformID, encodingID );
this.format = 0;
this.length = p.uint16;
this.language = p.uint16;
this.glyphIdArray = [ ...new Array( 256 ) ].map( ( _ ) => p.uint8 );
}
supports( charCode ) {
if ( charCode.charCodeAt ) {
charCode = -1;
console.warn(
`supports(character) not implemented for cmap subtable format 0. only supports(id) is implemented.`
);
}
return 0 <= charCode && charCode <= 255;
}
reverse( glyphID ) {
console.warn( `reverse not implemented for cmap subtable format 0` );
return {};
}
getSupportedCharCodes() {
return [ { start: 1, end: 256 } ];
}
}
class Format2 extends Subtable {
constructor( p, platformID, encodingID ) {
super( p, platformID, encodingID );
this.format = 2;
this.length = p.uint16;
this.language = p.uint16;
this.subHeaderKeys = [ ...new Array( 256 ) ].map( ( _ ) => p.uint16 );
const subHeaderCount = Math.max( ...this.subHeaderKeys );
const subHeaderOffset = p.currentPosition;
lazy$1( this, `subHeaders`, () => {
p.currentPosition = subHeaderOffset;
return [ ...new Array( subHeaderCount ) ].map(
( _ ) => new SubHeader( p )
);
} );
const glyphIndexOffset = subHeaderOffset + subHeaderCount * 8;
lazy$1( this, `glyphIndexArray`, () => {
p.currentPosition = glyphIndexOffset;
return [ ...new Array( subHeaderCount ) ].map( ( _ ) => p.uint16 );
} );
}
supports( charCode ) {
if ( charCode.charCodeAt ) {
charCode = -1;
console.warn(
`supports(character) not implemented for cmap subtable format 2. only supports(id) is implemented.`
);
}
const low = charCode && 255;
const high = charCode && 65280;
const subHeaderKey = this.subHeaders[ high ];
const subheader = this.subHeaders[ subHeaderKey ];
const first = subheader.firstCode;
const last = first + subheader.entryCount;
return first <= low && low <= last;
}
reverse( glyphID ) {
console.warn( `reverse not implemented for cmap subtable format 2` );
return {};
}
getSupportedCharCodes( preservePropNames = false ) {
if ( preservePropNames ) {
return this.subHeaders.map( ( h ) => ( {
firstCode: h.firstCode,
lastCode: h.lastCode,
} ) );
}
return this.subHeaders.map( ( h ) => ( {
start: h.firstCode,
end: h.lastCode,
} ) );
}
}
class SubHeader {
constructor( p ) {
this.firstCode = p.uint16;
this.entryCount = p.uint16;
this.lastCode = this.first + this.entryCount;
this.idDelta = p.int16;
this.idRangeOffset = p.uint16;
}
}
class Format4 extends Subtable {
constructor( p, platformID, encodingID ) {
super( p, platformID, encodingID );
this.format = 4;
this.length = p.uint16;
this.language = p.uint16;
this.segCountX2 = p.uint16;
this.segCount = this.segCountX2 / 2;
this.searchRange = p.uint16;
this.entrySelector = p.uint16;
this.rangeShift = p.uint16;
const endCodePosition = p.currentPosition;
lazy$1( this, `endCode`, () =>
p.readBytes( this.segCount, endCodePosition, 16 )
);
const startCodePosition = endCodePosition + 2 + this.segCountX2;
lazy$1( this, `startCode`, () =>
p.readBytes( this.segCount, startCodePosition, 16 )
);
const idDeltaPosition = startCodePosition + this.segCountX2;
lazy$1( this, `idDelta`, () =>
p.readBytes( this.segCount, idDeltaPosition, 16, true )
);
const idRangePosition = idDeltaPosition + this.segCountX2;
lazy$1( this, `idRangeOffset`, () =>
p.readBytes( this.segCount, idRangePosition, 16 )
);
const glyphIdArrayPosition = idRangePosition + this.segCountX2;
const glyphIdArrayLength =
this.length - ( glyphIdArrayPosition - this.tableStart );
lazy$1( this, `glyphIdArray`, () =>
p.readBytes( glyphIdArrayLength, glyphIdArrayPosition, 16 )
);
lazy$1( this, `segments`, () =>
this.buildSegments( idRangePosition, glyphIdArrayPosition, p )
);
}
buildSegments( idRangePosition, glyphIdArrayPosition, p ) {
const build = ( _, i ) => {
let startCode = this.startCode[ i ],
endCode = this.endCode[ i ],
idDelta = this.idDelta[ i ],
idRangeOffset = this.idRangeOffset[ i ],
idRangeOffsetPointer = idRangePosition + 2 * i,
glyphIDs = [];
if ( idRangeOffset === 0 ) {
for (
let i = startCode + idDelta, e = endCode + idDelta;
i <= e;
i++
) {
glyphIDs.push( i );
}
} else {
for ( let i = 0, e = endCode - startCode; i <= e; i++ ) {
p.currentPosition =
idRangeOffsetPointer + idRangeOffset + i * 2;
glyphIDs.push( p.uint16 );
}
}
return {
startCode: startCode,
endCode: endCode,
idDelta: idDelta,
idRangeOffset: idRangeOffset,
glyphIDs: glyphIDs,
};
};
return [ ...new Array( this.segCount ) ].map( build );
}
reverse( glyphID ) {
let s = this.segments.find( ( v ) => v.glyphIDs.includes( glyphID ) );
if ( ! s ) return {};
const code = s.startCode + s.glyphIDs.indexOf( glyphID );
return { code: code, unicode: String.fromCodePoint( code ) };
}
getGlyphId( charCode ) {
if ( charCode.charCodeAt ) charCode = charCode.charCodeAt( 0 );
if ( 55296 <= charCode && charCode <= 57343 ) return 0;
if ( ( charCode & 65534 ) === 65534 || ( charCode & 65535 ) === 65535 )
return 0;
let segment = this.segments.find(
( s ) => s.startCode <= charCode && charCode <= s.endCode
);
if ( ! segment ) return 0;
return segment.glyphIDs[ charCode - segment.startCode ];
}
supports( charCode ) {
return this.getGlyphId( charCode ) !== 0;
}
getSupportedCharCodes( preservePropNames = false ) {
if ( preservePropNames ) return this.segments;
return this.segments.map( ( v ) => ( {
start: v.startCode,
end: v.endCode,
} ) );
}
}
class Format6 extends Subtable {
constructor( p, platformID, encodingID ) {
super( p, platformID, encodingID );
this.format = 6;
this.length = p.uint16;
this.language = p.uint16;
this.firstCode = p.uint16;
this.entryCount = p.uint16;
this.lastCode = this.firstCode + this.entryCount - 1;
const getter = () =>
[ ...new Array( this.entryCount ) ].map( ( _ ) => p.uint16 );
lazy$1( this, `glyphIdArray`, getter );
}
supports( charCode ) {
if ( charCode.charCodeAt ) {
charCode = -1;
console.warn(
`supports(character) not implemented for cmap subtable format 6. only supports(id) is implemented.`
);
}
if ( charCode < this.firstCode ) return {};
if ( charCode > this.firstCode + this.entryCount ) return {};
const code = charCode - this.firstCode;
return { code: code, unicode: String.fromCodePoint( code ) };
}
reverse( glyphID ) {
let pos = this.glyphIdArray.indexOf( glyphID );
if ( pos > -1 ) return this.firstCode + pos;
}
getSupportedCharCodes( preservePropNames = false ) {
if ( preservePropNames ) {
return [ { firstCode: this.firstCode, lastCode: this.lastCode } ];
}
return [ { start: this.firstCode, end: this.lastCode } ];
}
}
class Format8 extends Subtable {
constructor( p, platformID, encodingID ) {
super( p, platformID, encodingID );
this.format = 8;
p.uint16;
this.length = p.uint32;
this.language = p.uint32;
this.is32 = [ ...new Array( 8192 ) ].map( ( _ ) => p.uint8 );
this.numGroups = p.uint32;
const getter = () =>
[ ...new Array( this.numGroups ) ].map(
( _ ) => new SequentialMapGroup$1( p )
);
lazy$1( this, `groups`, getter );
}
supports( charCode ) {
if ( charCode.charCodeAt ) {
charCode = -1;
console.warn(
`supports(character) not implemented for cmap subtable format 8. only supports(id) is implemented.`
);
}
return (
this.groups.findIndex(
( s ) =>
s.startcharCode <= charCode && charCode <= s.endcharCode
) !== -1
);
}
reverse( glyphID ) {
console.warn( `reverse not implemented for cmap subtable format 8` );
return {};
}
getSupportedCharCodes( preservePropNames = false ) {
if ( preservePropNames ) return this.groups;
return this.groups.map( ( v ) => ( {
start: v.startcharCode,
end: v.endcharCode,
} ) );
}
}
class SequentialMapGroup$1 {
constructor( p ) {
this.startcharCode = p.uint32;
this.endcharCode = p.uint32;
this.startGlyphID = p.uint32;
}
}
class Format10 extends Subtable {
constructor( p, platformID, encodingID ) {
super( p, platformID, encodingID );
this.format = 10;
p.uint16;
this.length = p.uint32;
this.language = p.uint32;
this.startCharCode = p.uint32;
this.numChars = p.uint32;
this.endCharCode = this.startCharCode + this.numChars;
const getter = () =>
[ ...new Array( this.numChars ) ].map( ( _ ) => p.uint16 );
lazy$1( this, `glyphs`, getter );
}
supports( charCode ) {
if ( charCode.charCodeAt ) {
charCode = -1;
console.warn(
`supports(character) not implemented for cmap subtable format 10. only supports(id) is implemented.`
);
}
if ( charCode < this.startCharCode ) return false;
if ( charCode > this.startCharCode + this.numChars ) return false;
return charCode - this.startCharCode;
}
reverse( glyphID ) {
console.warn( `reverse not implemented for cmap subtable format 10` );
return {};
}
getSupportedCharCodes( preservePropNames = false ) {
if ( preservePropNames ) {
return [
{
startCharCode: this.startCharCode,
endCharCode: this.endCharCode,
},
];
}
return [ { start: this.startCharCode, end: this.endCharCode } ];
}
}
class Format12 extends Subtable {
constructor( p, platformID, encodingID ) {
super( p, platformID, encodingID );
this.format = 12;
p.uint16;
this.length = p.uint32;
this.language = p.uint32;
this.numGroups = p.uint32;
const getter = () =>
[ ...new Array( this.numGroups ) ].map(
( _ ) => new SequentialMapGroup( p )
);
lazy$1( this, `groups`, getter );
}
supports( charCode ) {
if ( charCode.charCodeAt ) charCode = charCode.charCodeAt( 0 );
if ( 55296 <= charCode && charCode <= 57343 ) return 0;
if ( ( charCode & 65534 ) === 65534 || ( charCode & 65535 ) === 65535 )
return 0;
return (
this.groups.findIndex(
( s ) =>
s.startCharCode <= charCode && charCode <= s.endCharCode
) !== -1
);
}
reverse( glyphID ) {
for ( let group of this.groups ) {
let start = group.startGlyphID;
if ( start > glyphID ) continue;
if ( start === glyphID ) return group.startCharCode;
let end = start + ( group.endCharCode - group.startCharCode );
if ( end < glyphID ) continue;
const code = group.startCharCode + ( glyphID - start );
return { code: code, unicode: String.fromCodePoint( code ) };
}
return {};
}
getSupportedCharCodes( preservePropNames = false ) {
if ( preservePropNames ) return this.groups;
return this.groups.map( ( v ) => ( {
start: v.startCharCode,
end: v.endCharCode,
} ) );
}
}
class SequentialMapGroup {
constructor( p ) {
this.startCharCode = p.uint32;
this.endCharCode = p.uint32;
this.startGlyphID = p.uint32;
}
}
class Format13 extends Subtable {
constructor( p, platformID, encodingID ) {
super( p, platformID, encodingID );
this.format = 13;
p.uint16;
this.length = p.uint32;
this.language = p.uint32;
this.numGroups = p.uint32;
const getter = [ ...new Array( this.numGroups ) ].map(
( _ ) => new ConstantMapGroup( p )
);
lazy$1( this, `groups`, getter );
}
supports( charCode ) {
if ( charCode.charCodeAt ) charCode = charCode.charCodeAt( 0 );
return (
this.groups.findIndex(
( s ) =>
s.startCharCode <= charCode && charCode <= s.endCharCode
) !== -1
);
}
reverse( glyphID ) {
console.warn( `reverse not implemented for cmap subtable format 13` );
return {};
}
getSupportedCharCodes( preservePropNames = false ) {
if ( preservePropNames ) return this.groups;
return this.groups.map( ( v ) => ( {
start: v.startCharCode,
end: v.endCharCode,
} ) );
}
}
class ConstantMapGroup {
constructor( p ) {
this.startCharCode = p.uint32;
this.endCharCode = p.uint32;
this.glyphID = p.uint32;
}
}
class Format14 extends Subtable {
constructor( p, platformID, encodingID ) {
super( p, platformID, encodingID );
this.subTableStart = p.currentPosition;
this.format = 14;
this.length = p.uint32;
this.numVarSelectorRecords = p.uint32;
lazy$1( this, `varSelectors`, () =>
[ ...new Array( this.numVarSelectorRecords ) ].map(
( _ ) => new VariationSelector( p )
)
);
}
supports() {
console.warn( `supports not implemented for cmap subtable format 14` );
return 0;
}
getSupportedCharCodes() {
console.warn(
`getSupportedCharCodes not implemented for cmap subtable format 14`
);
return [];
}
reverse( glyphID ) {
console.warn( `reverse not implemented for cmap subtable format 14` );
return {};
}
supportsVariation( variation ) {
let v = this.varSelector.find(
( uvs ) => uvs.varSelector === variation
);
return v ? v : false;
}
getSupportedVariations() {
return this.varSelectors.map( ( v ) => v.varSelector );
}
}
class VariationSelector {
constructor( p ) {
this.varSelector = p.uint24;
this.defaultUVSOffset = p.Offset32;
this.nonDefaultUVSOffset = p.Offset32;
}
}
function createSubTable( parser, platformID, encodingID ) {
const format = parser.uint16;
if ( format === 0 ) return new Format0( parser, platformID, encodingID );
if ( format === 2 ) return new Format2( parser, platformID, encodingID );
if ( format === 4 ) return new Format4( parser, platformID, encodingID );
if ( format === 6 ) return new Format6( parser, platformID, encodingID );
if ( format === 8 ) return new Format8( parser, platformID, encodingID );
if ( format === 10 ) return new Format10( parser, platformID, encodingID );
if ( format === 12 ) return new Format12( parser, platformID, encodingID );
if ( format === 13 ) return new Format13( parser, platformID, encodingID );
if ( format === 14 ) return new Format14( parser, platformID, encodingID );
return {};
}
class cmap extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.version = p.uint16;
this.numTables = p.uint16;
this.encodingRecords = [ ...new Array( this.numTables ) ].map(
( _ ) => new EncodingRecord( p, this.tableStart )
);
}
getSubTable( tableID ) {
return this.encodingRecords[ tableID ].table;
}
getSupportedEncodings() {
return this.encodingRecords.map( ( r ) => ( {
platformID: r.platformID,
encodingId: r.encodingID,
} ) );
}
getSupportedCharCodes( platformID, encodingID ) {
const recordID = this.encodingRecords.findIndex(
( r ) => r.platformID === platformID && r.encodingID === encodingID
);
if ( recordID === -1 ) return false;
const subtable = this.getSubTable( recordID );
return subtable.getSupportedCharCodes();
}
reverse( glyphid ) {
for ( let i = 0; i < this.numTables; i++ ) {
let code = this.getSubTable( i ).reverse( glyphid );
if ( code ) return code;
}
}
getGlyphId( char ) {
let last = 0;
this.encodingRecords.some( ( _, tableID ) => {
let t = this.getSubTable( tableID );
if ( ! t.getGlyphId ) return false;
last = t.getGlyphId( char );
return last !== 0;
} );
return last;
}
supports( char ) {
return this.encodingRecords.some( ( _, tableID ) => {
const t = this.getSubTable( tableID );
return t.supports && t.supports( char ) !== false;
} );
}
supportsVariation( variation ) {
return this.encodingRecords.some( ( _, tableID ) => {
const t = this.getSubTable( tableID );
return (
t.supportsVariation &&
t.supportsVariation( variation ) !== false
);
} );
}
}
class EncodingRecord {
constructor( p, tableStart ) {
const platformID = ( this.platformID = p.uint16 );
const encodingID = ( this.encodingID = p.uint16 );
const offset = ( this.offset = p.Offset32 );
lazy$1( this, `table`, () => {
p.currentPosition = tableStart + offset;
return createSubTable( p, platformID, encodingID );
} );
}
}
var cmap$1 = Object.freeze( { __proto__: null, cmap: cmap } );
class head extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.load( {
majorVersion: p.uint16,
minorVersion: p.uint16,
fontRevision: p.fixed,
checkSumAdjustment: p.uint32,
magicNumber: p.uint32,
flags: p.flags( 16 ),
unitsPerEm: p.uint16,
created: p.longdatetime,
modified: p.longdatetime,
xMin: p.int16,
yMin: p.int16,
xMax: p.int16,
yMax: p.int16,
macStyle: p.flags( 16 ),
lowestRecPPEM: p.uint16,
fontDirectionHint: p.uint16,
indexToLocFormat: p.uint16,
glyphDataFormat: p.uint16,
} );
}
}
var head$1 = Object.freeze( { __proto__: null, head: head } );
class hhea extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.majorVersion = p.uint16;
this.minorVersion = p.uint16;
this.ascender = p.fword;
this.descender = p.fword;
this.lineGap = p.fword;
this.advanceWidthMax = p.ufword;
this.minLeftSideBearing = p.fword;
this.minRightSideBearing = p.fword;
this.xMaxExtent = p.fword;
this.caretSlopeRise = p.int16;
this.caretSlopeRun = p.int16;
this.caretOffset = p.int16;
p.int16;
p.int16;
p.int16;
p.int16;
this.metricDataFormat = p.int16;
this.numberOfHMetrics = p.uint16;
p.verifyLength();
}
}
var hhea$1 = Object.freeze( { __proto__: null, hhea: hhea } );
class hmtx extends SimpleTable {
constructor( dict, dataview, tables ) {
const { p: p } = super( dict, dataview );
const numberOfHMetrics = tables.hhea.numberOfHMetrics;
const numGlyphs = tables.maxp.numGlyphs;
const metricsStart = p.currentPosition;
lazy$1( this, `hMetrics`, () => {
p.currentPosition = metricsStart;
return [ ...new Array( numberOfHMetrics ) ].map(
( _ ) => new LongHorMetric( p.uint16, p.int16 )
);
} );
if ( numberOfHMetrics < numGlyphs ) {
const lsbStart = metricsStart + numberOfHMetrics * 4;
lazy$1( this, `leftSideBearings`, () => {
p.currentPosition = lsbStart;
return [ ...new Array( numGlyphs - numberOfHMetrics ) ].map(
( _ ) => p.int16
);
} );
}
}
}
class LongHorMetric {
constructor( w, b ) {
this.advanceWidth = w;
this.lsb = b;
}
}
var hmtx$1 = Object.freeze( { __proto__: null, hmtx: hmtx } );
class maxp extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.version = p.legacyFixed;
this.numGlyphs = p.uint16;
if ( this.version === 1 ) {
this.maxPoints = p.uint16;
this.maxContours = p.uint16;
this.maxCompositePoints = p.uint16;
this.maxCompositeContours = p.uint16;
this.maxZones = p.uint16;
this.maxTwilightPoints = p.uint16;
this.maxStorage = p.uint16;
this.maxFunctionDefs = p.uint16;
this.maxInstructionDefs = p.uint16;
this.maxStackElements = p.uint16;
this.maxSizeOfInstructions = p.uint16;
this.maxComponentElements = p.uint16;
this.maxComponentDepth = p.uint16;
}
p.verifyLength();
}
}
var maxp$1 = Object.freeze( { __proto__: null, maxp: maxp } );
class lib_font_browser_name extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.format = p.uint16;
this.count = p.uint16;
this.stringOffset = p.Offset16;
this.nameRecords = [ ...new Array( this.count ) ].map(
( _ ) => new NameRecord( p, this )
);
if ( this.format === 1 ) {
this.langTagCount = p.uint16;
this.langTagRecords = [ ...new Array( this.langTagCount ) ].map(
( _ ) => new LangTagRecord( p.uint16, p.Offset16 )
);
}
this.stringStart = this.tableStart + this.stringOffset;
}
get( nameID ) {
let record = this.nameRecords.find(
( record ) => record.nameID === nameID
);
if ( record ) return record.string;
}
}
class LangTagRecord {
constructor( length, offset ) {
this.length = length;
this.offset = offset;
}
}
class NameRecord {
constructor( p, nameTable ) {
this.platformID = p.uint16;
this.encodingID = p.uint16;
this.languageID = p.uint16;
this.nameID = p.uint16;
this.length = p.uint16;
this.offset = p.Offset16;
lazy$1( this, `string`, () => {
p.currentPosition = nameTable.stringStart + this.offset;
return decodeString( p, this );
} );
}
}
function decodeString( p, record ) {
const { platformID: platformID, length: length } = record;
if ( length === 0 ) return ``;
if ( platformID === 0 || platformID === 3 ) {
const str = [];
for ( let i = 0, e = length / 2; i < e; i++ )
str[ i ] = String.fromCharCode( p.uint16 );
return str.join( `` );
}
const bytes = p.readBytes( length );
const str = [];
bytes.forEach( function ( b, i ) {
str[ i ] = String.fromCharCode( b );
} );
return str.join( `` );
}
var name$1 = Object.freeze( { __proto__: null, name: lib_font_browser_name } );
class OS2 extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.version = p.uint16;
this.xAvgCharWidth = p.int16;
this.usWeightClass = p.uint16;
this.usWidthClass = p.uint16;
this.fsType = p.uint16;
this.ySubscriptXSize = p.int16;
this.ySubscriptYSize = p.int16;
this.ySubscriptXOffset = p.int16;
this.ySubscriptYOffset = p.int16;
this.ySuperscriptXSize = p.int16;
this.ySuperscriptYSize = p.int16;
this.ySuperscriptXOffset = p.int16;
this.ySuperscriptYOffset = p.int16;
this.yStrikeoutSize = p.int16;
this.yStrikeoutPosition = p.int16;
this.sFamilyClass = p.int16;
this.panose = [ ...new Array( 10 ) ].map( ( _ ) => p.uint8 );
this.ulUnicodeRange1 = p.flags( 32 );
this.ulUnicodeRange2 = p.flags( 32 );
this.ulUnicodeRange3 = p.flags( 32 );
this.ulUnicodeRange4 = p.flags( 32 );
this.achVendID = p.tag;
this.fsSelection = p.uint16;
this.usFirstCharIndex = p.uint16;
this.usLastCharIndex = p.uint16;
this.sTypoAscender = p.int16;
this.sTypoDescender = p.int16;
this.sTypoLineGap = p.int16;
this.usWinAscent = p.uint16;
this.usWinDescent = p.uint16;
if ( this.version === 0 ) return p.verifyLength();
this.ulCodePageRange1 = p.flags( 32 );
this.ulCodePageRange2 = p.flags( 32 );
if ( this.version === 1 ) return p.verifyLength();
this.sxHeight = p.int16;
this.sCapHeight = p.int16;
this.usDefaultChar = p.uint16;
this.usBreakChar = p.uint16;
this.usMaxContext = p.uint16;
if ( this.version <= 4 ) return p.verifyLength();
this.usLowerOpticalPointSize = p.uint16;
this.usUpperOpticalPointSize = p.uint16;
if ( this.version === 5 ) return p.verifyLength();
}
}
var OS2$1 = Object.freeze( { __proto__: null, OS2: OS2 } );
class post extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.version = p.legacyFixed;
this.italicAngle = p.fixed;
this.underlinePosition = p.fword;
this.underlineThickness = p.fword;
this.isFixedPitch = p.uint32;
this.minMemType42 = p.uint32;
this.maxMemType42 = p.uint32;
this.minMemType1 = p.uint32;
this.maxMemType1 = p.uint32;
if ( this.version === 1 || this.version === 3 ) return p.verifyLength();
this.numGlyphs = p.uint16;
if ( this.version === 2 ) {
this.glyphNameIndex = [ ...new Array( this.numGlyphs ) ].map(
( _ ) => p.uint16
);
this.namesOffset = p.currentPosition;
this.glyphNameOffsets = [ 1 ];
for ( let i = 0; i < this.numGlyphs; i++ ) {
let index = this.glyphNameIndex[ i ];
if ( index < macStrings.length ) {
this.glyphNameOffsets.push( this.glyphNameOffsets[ i ] );
continue;
}
let bytelength = p.int8;
p.skip( bytelength );
this.glyphNameOffsets.push(
this.glyphNameOffsets[ i ] + bytelength + 1
);
}
}
if ( this.version === 2.5 ) {
this.offset = [ ...new Array( this.numGlyphs ) ].map(
( _ ) => p.int8
);
}
}
getGlyphName( glyphid ) {
if ( this.version !== 2 ) {
console.warn(
`post table version ${ this.version } does not support glyph name lookups`
);
return ``;
}
let index = this.glyphNameIndex[ glyphid ];
if ( index < 258 ) return macStrings[ index ];
let offset = this.glyphNameOffsets[ glyphid ];
let next = this.glyphNameOffsets[ glyphid + 1 ];
let len = next - offset - 1;
if ( len === 0 ) return `.notdef.`;
this.parser.currentPosition = this.namesOffset + offset;
const data = this.parser.readBytes(
len,
this.namesOffset + offset,
8,
true
);
return data.map( ( b ) => String.fromCharCode( b ) ).join( `` );
}
}
const macStrings = [
`.notdef`,
`.null`,
`nonmarkingreturn`,
`space`,
`exclam`,
`quotedbl`,
`numbersign`,
`dollar`,
`percent`,
`ampersand`,
`quotesingle`,
`parenleft`,
`parenright`,
`asterisk`,
`plus`,
`comma`,
`hyphen`,
`period`,
`slash`,
`zero`,
`one`,
`two`,
`three`,
`four`,
`five`,
`six`,
`seven`,
`eight`,
`nine`,
`colon`,
`semicolon`,
`less`,
`equal`,
`greater`,
`question`,
`at`,
`A`,
`B`,
`C`,
`D`,
`E`,
`F`,
`G`,
`H`,
`I`,
`J`,
`K`,
`L`,
`M`,
`N`,
`O`,
`P`,
`Q`,
`R`,
`S`,
`T`,
`U`,
`V`,
`W`,
`X`,
`Y`,
`Z`,
`bracketleft`,
`backslash`,
`bracketright`,
`asciicircum`,
`underscore`,
`grave`,
`a`,
`b`,
`c`,
`d`,
`e`,
`f`,
`g`,
`h`,
`i`,
`j`,
`k`,
`l`,
`m`,
`n`,
`o`,
`p`,
`q`,
`r`,
`s`,
`t`,
`u`,
`v`,
`w`,
`x`,
`y`,
`z`,
`braceleft`,
`bar`,
`braceright`,
`asciitilde`,
`Adieresis`,
`Aring`,
`Ccedilla`,
`Eacute`,
`Ntilde`,
`Odieresis`,
`Udieresis`,
`aacute`,
`agrave`,
`acircumflex`,
`adieresis`,
`atilde`,
`aring`,
`ccedilla`,
`eacute`,
`egrave`,
`ecircumflex`,
`edieresis`,
`iacute`,
`igrave`,
`icircumflex`,
`idieresis`,
`ntilde`,
`oacute`,
`ograve`,
`ocircumflex`,
`odieresis`,
`otilde`,
`uacute`,
`ugrave`,
`ucircumflex`,
`udieresis`,
`dagger`,
`degree`,
`cent`,
`sterling`,
`section`,
`bullet`,
`paragraph`,
`germandbls`,
`registered`,
`copyright`,
`trademark`,
`acute`,
`dieresis`,
`notequal`,
`AE`,
`Oslash`,
`infinity`,
`plusminus`,
`lessequal`,
`greaterequal`,
`yen`,
`mu`,
`partialdiff`,
`summation`,
`product`,
`pi`,
`integral`,
`ordfeminine`,
`ordmasculine`,
`Omega`,
`ae`,
`oslash`,
`questiondown`,
`exclamdown`,
`logicalnot`,
`radical`,
`florin`,
`approxequal`,
`Delta`,
`guillemotleft`,
`guillemotright`,
`ellipsis`,
`nonbreakingspace`,
`Agrave`,
`Atilde`,
`Otilde`,
`OE`,
`oe`,
`endash`,
`emdash`,
`quotedblleft`,
`quotedblright`,
`quoteleft`,
`quoteright`,
`divide`,
`lozenge`,
`ydieresis`,
`Ydieresis`,
`fraction`,
`currency`,
`guilsinglleft`,
`guilsinglright`,
`fi`,
`fl`,
`daggerdbl`,
`periodcentered`,
`quotesinglbase`,
`quotedblbase`,
`perthousand`,
`Acircumflex`,
`Ecircumflex`,
`Aacute`,
`Edieresis`,
`Egrave`,
`Iacute`,
`Icircumflex`,
`Idieresis`,
`Igrave`,
`Oacute`,
`Ocircumflex`,
`apple`,
`Ograve`,
`Uacute`,
`Ucircumflex`,
`Ugrave`,
`dotlessi`,
`circumflex`,
`tilde`,
`macron`,
`breve`,
`dotaccent`,
`ring`,
`cedilla`,
`hungarumlaut`,
`ogonek`,
`caron`,
`Lslash`,
`lslash`,
`Scaron`,
`scaron`,
`Zcaron`,
`zcaron`,
`brokenbar`,
`Eth`,
`eth`,
`Yacute`,
`yacute`,
`Thorn`,
`thorn`,
`minus`,
`multiply`,
`onesuperior`,
`twosuperior`,
`threesuperior`,
`onehalf`,
`onequarter`,
`threequarters`,
`franc`,
`Gbreve`,
`gbreve`,
`Idotaccent`,
`Scedilla`,
`scedilla`,
`Cacute`,
`cacute`,
`Ccaron`,
`ccaron`,
`dcroat`,
];
var post$1 = Object.freeze( { __proto__: null, post: post } );
class BASE extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.majorVersion = p.uint16;
this.minorVersion = p.uint16;
this.horizAxisOffset = p.Offset16;
this.vertAxisOffset = p.Offset16;
lazy$1(
this,
`horizAxis`,
() =>
new AxisTable(
{ offset: dict.offset + this.horizAxisOffset },
dataview
)
);
lazy$1(
this,
`vertAxis`,
() =>
new AxisTable(
{ offset: dict.offset + this.vertAxisOffset },
dataview
)
);
if ( this.majorVersion === 1 && this.minorVersion === 1 ) {
this.itemVarStoreOffset = p.Offset32;
lazy$1(
this,
`itemVarStore`,
() =>
new AxisTable(
{ offset: dict.offset + this.itemVarStoreOffset },
dataview
)
);
}
}
}
class AxisTable extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview, `AxisTable` );
this.baseTagListOffset = p.Offset16;
this.baseScriptListOffset = p.Offset16;
lazy$1(
this,
`baseTagList`,
() =>
new BaseTagListTable(
{ offset: dict.offset + this.baseTagListOffset },
dataview
)
);
lazy$1(
this,
`baseScriptList`,
() =>
new BaseScriptListTable(
{ offset: dict.offset + this.baseScriptListOffset },
dataview
)
);
}
}
class BaseTagListTable extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview, `BaseTagListTable` );
this.baseTagCount = p.uint16;
this.baselineTags = [ ...new Array( this.baseTagCount ) ].map(
( _ ) => p.tag
);
}
}
class BaseScriptListTable extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview, `BaseScriptListTable` );
this.baseScriptCount = p.uint16;
const recordStart = p.currentPosition;
lazy$1( this, `baseScriptRecords`, () => {
p.currentPosition = recordStart;
return [ ...new Array( this.baseScriptCount ) ].map(
( _ ) => new BaseScriptRecord( this.start, p )
);
} );
}
}
class BaseScriptRecord {
constructor( baseScriptListTableStart, p ) {
this.baseScriptTag = p.tag;
this.baseScriptOffset = p.Offset16;
lazy$1( this, `baseScriptTable`, () => {
p.currentPosition =
baseScriptListTableStart + this.baseScriptOffset;
return new BaseScriptTable( p );
} );
}
}
class BaseScriptTable {
constructor( p ) {
this.start = p.currentPosition;
this.baseValuesOffset = p.Offset16;
this.defaultMinMaxOffset = p.Offset16;
this.baseLangSysCount = p.uint16;
this.baseLangSysRecords = [ ...new Array( this.baseLangSysCount ) ].map(
( _ ) => new BaseLangSysRecord( this.start, p )
);
lazy$1( this, `baseValues`, () => {
p.currentPosition = this.start + this.baseValuesOffset;
return new BaseValuesTable( p );
} );
lazy$1( this, `defaultMinMax`, () => {
p.currentPosition = this.start + this.defaultMinMaxOffset;
return new MinMaxTable( p );
} );
}
}
class BaseLangSysRecord {
constructor( baseScriptTableStart, p ) {
this.baseLangSysTag = p.tag;
this.minMaxOffset = p.Offset16;
lazy$1( this, `minMax`, () => {
p.currentPosition = baseScriptTableStart + this.minMaxOffset;
return new MinMaxTable( p );
} );
}
}
class BaseValuesTable {
constructor( p ) {
this.parser = p;
this.start = p.currentPosition;
this.defaultBaselineIndex = p.uint16;
this.baseCoordCount = p.uint16;
this.baseCoords = [ ...new Array( this.baseCoordCount ) ].map(
( _ ) => p.Offset16
);
}
getTable( id ) {
this.parser.currentPosition = this.start + this.baseCoords[ id ];
return new BaseCoordTable( this.parser );
}
}
class MinMaxTable {
constructor( p ) {
this.minCoord = p.Offset16;
this.maxCoord = p.Offset16;
this.featMinMaxCount = p.uint16;
const recordStart = p.currentPosition;
lazy$1( this, `featMinMaxRecords`, () => {
p.currentPosition = recordStart;
return [ ...new Array( this.featMinMaxCount ) ].map(
( _ ) => new FeatMinMaxRecord( p )
);
} );
}
}
class FeatMinMaxRecord {
constructor( p ) {
this.featureTableTag = p.tag;
this.minCoord = p.Offset16;
this.maxCoord = p.Offset16;
}
}
class BaseCoordTable {
constructor( p ) {
this.baseCoordFormat = p.uint16;
this.coordinate = p.int16;
if ( this.baseCoordFormat === 2 ) {
this.referenceGlyph = p.uint16;
this.baseCoordPoint = p.uint16;
}
if ( this.baseCoordFormat === 3 ) {
this.deviceTable = p.Offset16;
}
}
}
var BASE$1 = Object.freeze( { __proto__: null, BASE: BASE } );
class ClassDefinition {
constructor( p ) {
this.classFormat = p.uint16;
if ( this.classFormat === 1 ) {
this.startGlyphID = p.uint16;
this.glyphCount = p.uint16;
this.classValueArray = [ ...new Array( this.glyphCount ) ].map(
( _ ) => p.uint16
);
}
if ( this.classFormat === 2 ) {
this.classRangeCount = p.uint16;
this.classRangeRecords = [
...new Array( this.classRangeCount ),
].map( ( _ ) => new ClassRangeRecord( p ) );
}
}
}
class ClassRangeRecord {
constructor( p ) {
this.startGlyphID = p.uint16;
this.endGlyphID = p.uint16;
this.class = p.uint16;
}
}
class CoverageTable extends ParsedData {
constructor( p ) {
super( p );
this.coverageFormat = p.uint16;
if ( this.coverageFormat === 1 ) {
this.glyphCount = p.uint16;
this.glyphArray = [ ...new Array( this.glyphCount ) ].map(
( _ ) => p.uint16
);
}
if ( this.coverageFormat === 2 ) {
this.rangeCount = p.uint16;
this.rangeRecords = [ ...new Array( this.rangeCount ) ].map(
( _ ) => new CoverageRangeRecord( p )
);
}
}
}
class CoverageRangeRecord {
constructor( p ) {
this.startGlyphID = p.uint16;
this.endGlyphID = p.uint16;
this.startCoverageIndex = p.uint16;
}
}
class ItemVariationStoreTable {
constructor( table, p ) {
this.table = table;
this.parser = p;
this.start = p.currentPosition;
this.format = p.uint16;
this.variationRegionListOffset = p.Offset32;
this.itemVariationDataCount = p.uint16;
this.itemVariationDataOffsets = [
...new Array( this.itemVariationDataCount ),
].map( ( _ ) => p.Offset32 );
}
}
class GDEF extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.majorVersion = p.uint16;
this.minorVersion = p.uint16;
this.glyphClassDefOffset = p.Offset16;
lazy$1( this, `glyphClassDefs`, () => {
if ( this.glyphClassDefOffset === 0 ) return undefined;
p.currentPosition = this.tableStart + this.glyphClassDefOffset;
return new ClassDefinition( p );
} );
this.attachListOffset = p.Offset16;
lazy$1( this, `attachList`, () => {
if ( this.attachListOffset === 0 ) return undefined;
p.currentPosition = this.tableStart + this.attachListOffset;
return new AttachList( p );
} );
this.ligCaretListOffset = p.Offset16;
lazy$1( this, `ligCaretList`, () => {
if ( this.ligCaretListOffset === 0 ) return undefined;
p.currentPosition = this.tableStart + this.ligCaretListOffset;
return new LigCaretList( p );
} );
this.markAttachClassDefOffset = p.Offset16;
lazy$1( this, `markAttachClassDef`, () => {
if ( this.markAttachClassDefOffset === 0 ) return undefined;
p.currentPosition = this.tableStart + this.markAttachClassDefOffset;
return new ClassDefinition( p );
} );
if ( this.minorVersion >= 2 ) {
this.markGlyphSetsDefOffset = p.Offset16;
lazy$1( this, `markGlyphSetsDef`, () => {
if ( this.markGlyphSetsDefOffset === 0 ) return undefined;
p.currentPosition =
this.tableStart + this.markGlyphSetsDefOffset;
return new MarkGlyphSetsTable( p );
} );
}
if ( this.minorVersion === 3 ) {
this.itemVarStoreOffset = p.Offset32;
lazy$1( this, `itemVarStore`, () => {
if ( this.itemVarStoreOffset === 0 ) return undefined;
p.currentPosition = this.tableStart + this.itemVarStoreOffset;
return new ItemVariationStoreTable( p );
} );
}
}
}
class AttachList extends ParsedData {
constructor( p ) {
super( p );
this.coverageOffset = p.Offset16;
this.glyphCount = p.uint16;
this.attachPointOffsets = [ ...new Array( this.glyphCount ) ].map(
( _ ) => p.Offset16
);
}
getPoint( pointID ) {
this.parser.currentPosition =
this.start + this.attachPointOffsets[ pointID ];
return new AttachPoint( this.parser );
}
}
class AttachPoint {
constructor( p ) {
this.pointCount = p.uint16;
this.pointIndices = [ ...new Array( this.pointCount ) ].map(
( _ ) => p.uint16
);
}
}
class LigCaretList extends ParsedData {
constructor( p ) {
super( p );
this.coverageOffset = p.Offset16;
lazy$1( this, `coverage`, () => {
p.currentPosition = this.start + this.coverageOffset;
return new CoverageTable( p );
} );
this.ligGlyphCount = p.uint16;
this.ligGlyphOffsets = [ ...new Array( this.ligGlyphCount ) ].map(
( _ ) => p.Offset16
);
}
getLigGlyph( ligGlyphID ) {
this.parser.currentPosition =
this.start + this.ligGlyphOffsets[ ligGlyphID ];
return new LigGlyph( this.parser );
}
}
class LigGlyph extends ParsedData {
constructor( p ) {
super( p );
this.caretCount = p.uint16;
this.caretValueOffsets = [ ...new Array( this.caretCount ) ].map(
( _ ) => p.Offset16
);
}
getCaretValue( caretID ) {
this.parser.currentPosition =
this.start + this.caretValueOffsets[ caretID ];
return new CaretValue( this.parser );
}
}
class CaretValue {
constructor( p ) {
this.caretValueFormat = p.uint16;
if ( this.caretValueFormat === 1 ) {
this.coordinate = p.int16;
}
if ( this.caretValueFormat === 2 ) {
this.caretValuePointIndex = p.uint16;
}
if ( this.caretValueFormat === 3 ) {
this.coordinate = p.int16;
this.deviceOffset = p.Offset16;
}
}
}
class MarkGlyphSetsTable extends ParsedData {
constructor( p ) {
super( p );
this.markGlyphSetTableFormat = p.uint16;
this.markGlyphSetCount = p.uint16;
this.coverageOffsets = [ ...new Array( this.markGlyphSetCount ) ].map(
( _ ) => p.Offset32
);
}
getMarkGlyphSet( markGlyphSetID ) {
this.parser.currentPosition =
this.start + this.coverageOffsets[ markGlyphSetID ];
return new CoverageTable( this.parser );
}
}
var GDEF$1 = Object.freeze( { __proto__: null, GDEF: GDEF } );
class ScriptList extends ParsedData {
static EMPTY = { scriptCount: 0, scriptRecords: [] };
constructor( p ) {
super( p );
this.scriptCount = p.uint16;
this.scriptRecords = [ ...new Array( this.scriptCount ) ].map(
( _ ) => new ScriptRecord( p )
);
}
}
class ScriptRecord {
constructor( p ) {
this.scriptTag = p.tag;
this.scriptOffset = p.Offset16;
}
}
class ScriptTable extends ParsedData {
constructor( p ) {
super( p );
this.defaultLangSys = p.Offset16;
this.langSysCount = p.uint16;
this.langSysRecords = [ ...new Array( this.langSysCount ) ].map(
( _ ) => new LangSysRecord( p )
);
}
}
class LangSysRecord {
constructor( p ) {
this.langSysTag = p.tag;
this.langSysOffset = p.Offset16;
}
}
class LangSysTable {
constructor( p ) {
this.lookupOrder = p.Offset16;
this.requiredFeatureIndex = p.uint16;
this.featureIndexCount = p.uint16;
this.featureIndices = [ ...new Array( this.featureIndexCount ) ].map(
( _ ) => p.uint16
);
}
}
class FeatureList extends ParsedData {
static EMPTY = { featureCount: 0, featureRecords: [] };
constructor( p ) {
super( p );
this.featureCount = p.uint16;
this.featureRecords = [ ...new Array( this.featureCount ) ].map(
( _ ) => new FeatureRecord( p )
);
}
}
class FeatureRecord {
constructor( p ) {
this.featureTag = p.tag;
this.featureOffset = p.Offset16;
}
}
class FeatureTable extends ParsedData {
constructor( p ) {
super( p );
this.featureParams = p.Offset16;
this.lookupIndexCount = p.uint16;
this.lookupListIndices = [ ...new Array( this.lookupIndexCount ) ].map(
( _ ) => p.uint16
);
}
getFeatureParams() {
if ( this.featureParams > 0 ) {
const p = this.parser;
p.currentPosition = this.start + this.featureParams;
const tag = this.featureTag;
if ( tag === `size` ) return new Size( p );
if ( tag.startsWith( `cc` ) ) return new CharacterVariant( p );
if ( tag.startsWith( `ss` ) ) return new StylisticSet( p );
}
}
}
class CharacterVariant {
constructor( p ) {
this.format = p.uint16;
this.featUiLabelNameId = p.uint16;
this.featUiTooltipTextNameId = p.uint16;
this.sampleTextNameId = p.uint16;
this.numNamedParameters = p.uint16;
this.firstParamUiLabelNameId = p.uint16;
this.charCount = p.uint16;
this.character = [ ...new Array( this.charCount ) ].map(
( _ ) => p.uint24
);
}
}
class Size {
constructor( p ) {
this.designSize = p.uint16;
this.subfamilyIdentifier = p.uint16;
this.subfamilyNameID = p.uint16;
this.smallEnd = p.uint16;
this.largeEnd = p.uint16;
}
}
class StylisticSet {
constructor( p ) {
this.version = p.uint16;
this.UINameID = p.uint16;
}
}
function undoCoverageOffsetParsing( instance ) {
instance.parser.currentPosition -= 2;
delete instance.coverageOffset;
delete instance.getCoverageTable;
}
class LookupType$1 extends ParsedData {
constructor( p ) {
super( p );
this.substFormat = p.uint16;
this.coverageOffset = p.Offset16;
}
getCoverageTable() {
let p = this.parser;
p.currentPosition = this.start + this.coverageOffset;
return new CoverageTable( p );
}
}
class SubstLookupRecord {
constructor( p ) {
this.glyphSequenceIndex = p.uint16;
this.lookupListIndex = p.uint16;
}
}
class LookupType1$1 extends LookupType$1 {
constructor( p ) {
super( p );
this.deltaGlyphID = p.int16;
}
}
class LookupType2$1 extends LookupType$1 {
constructor( p ) {
super( p );
this.sequenceCount = p.uint16;
this.sequenceOffsets = [ ...new Array( this.sequenceCount ) ].map(
( _ ) => p.Offset16
);
}
getSequence( index ) {
let p = this.parser;
p.currentPosition = this.start + this.sequenceOffsets[ index ];
return new SequenceTable( p );
}
}
class SequenceTable {
constructor( p ) {
this.glyphCount = p.uint16;
this.substituteGlyphIDs = [ ...new Array( this.glyphCount ) ].map(
( _ ) => p.uint16
);
}
}
class LookupType3$1 extends LookupType$1 {
constructor( p ) {
super( p );
this.alternateSetCount = p.uint16;
this.alternateSetOffsets = [
...new Array( this.alternateSetCount ),
].map( ( _ ) => p.Offset16 );
}
getAlternateSet( index ) {
let p = this.parser;
p.currentPosition = this.start + this.alternateSetOffsets[ index ];
return new AlternateSetTable( p );
}
}
class AlternateSetTable {
constructor( p ) {
this.glyphCount = p.uint16;
this.alternateGlyphIDs = [ ...new Array( this.glyphCount ) ].map(
( _ ) => p.uint16
);
}
}
class LookupType4$1 extends LookupType$1 {
constructor( p ) {
super( p );
this.ligatureSetCount = p.uint16;
this.ligatureSetOffsets = [ ...new Array( this.ligatureSetCount ) ].map(
( _ ) => p.Offset16
);
}
getLigatureSet( index ) {
let p = this.parser;
p.currentPosition = this.start + this.ligatureSetOffsets[ index ];
return new LigatureSetTable( p );
}
}
class LigatureSetTable extends ParsedData {
constructor( p ) {
super( p );
this.ligatureCount = p.uint16;
this.ligatureOffsets = [ ...new Array( this.ligatureCount ) ].map(
( _ ) => p.Offset16
);
}
getLigature( index ) {
let p = this.parser;
p.currentPosition = this.start + this.ligatureOffsets[ index ];
return new LigatureTable( p );
}
}
class LigatureTable {
constructor( p ) {
this.ligatureGlyph = p.uint16;
this.componentCount = p.uint16;
this.componentGlyphIDs = [
...new Array( this.componentCount - 1 ),
].map( ( _ ) => p.uint16 );
}
}
class LookupType5$1 extends LookupType$1 {
constructor( p ) {
super( p );
if ( this.substFormat === 1 ) {
this.subRuleSetCount = p.uint16;
this.subRuleSetOffsets = [
...new Array( this.subRuleSetCount ),
].map( ( _ ) => p.Offset16 );
}
if ( this.substFormat === 2 ) {
this.classDefOffset = p.Offset16;
this.subClassSetCount = p.uint16;
this.subClassSetOffsets = [
...new Array( this.subClassSetCount ),
].map( ( _ ) => p.Offset16 );
}
if ( this.substFormat === 3 ) {
undoCoverageOffsetParsing( this );
this.glyphCount = p.uint16;
this.substitutionCount = p.uint16;
this.coverageOffsets = [ ...new Array( this.glyphCount ) ].map(
( _ ) => p.Offset16
);
this.substLookupRecords = [
...new Array( this.substitutionCount ),
].map( ( _ ) => new SubstLookupRecord( p ) );
}
}
getSubRuleSet( index ) {
if ( this.substFormat !== 1 )
throw new Error(
`lookup type 5.${ this.substFormat } has no subrule sets.`
);
let p = this.parser;
p.currentPosition = this.start + this.subRuleSetOffsets[ index ];
return new SubRuleSetTable( p );
}
getSubClassSet( index ) {
if ( this.substFormat !== 2 )
throw new Error(
`lookup type 5.${ this.substFormat } has no subclass sets.`
);
let p = this.parser;
p.currentPosition = this.start + this.subClassSetOffsets[ index ];
return new SubClassSetTable( p );
}
getCoverageTable( index ) {
if ( this.substFormat !== 3 && ! index )
return super.getCoverageTable();
if ( ! index )
throw new Error(
`lookup type 5.${ this.substFormat } requires an coverage table index.`
);
let p = this.parser;
p.currentPosition = this.start + this.coverageOffsets[ index ];
return new CoverageTable( p );
}
}
class SubRuleSetTable extends ParsedData {
constructor( p ) {
super( p );
this.subRuleCount = p.uint16;
this.subRuleOffsets = [ ...new Array( this.subRuleCount ) ].map(
( _ ) => p.Offset16
);
}
getSubRule( index ) {
let p = this.parser;
p.currentPosition = this.start + this.subRuleOffsets[ index ];
return new SubRuleTable( p );
}
}
class SubRuleTable {
constructor( p ) {
this.glyphCount = p.uint16;
this.substitutionCount = p.uint16;
this.inputSequence = [ ...new Array( this.glyphCount - 1 ) ].map(
( _ ) => p.uint16
);
this.substLookupRecords = [
...new Array( this.substitutionCount ),
].map( ( _ ) => new SubstLookupRecord( p ) );
}
}
class SubClassSetTable extends ParsedData {
constructor( p ) {
super( p );
this.subClassRuleCount = p.uint16;
this.subClassRuleOffsets = [
...new Array( this.subClassRuleCount ),
].map( ( _ ) => p.Offset16 );
}
getSubClass( index ) {
let p = this.parser;
p.currentPosition = this.start + this.subClassRuleOffsets[ index ];
return new SubClassRuleTable( p );
}
}
class SubClassRuleTable extends SubRuleTable {
constructor( p ) {
super( p );
}
}
class LookupType6$1 extends LookupType$1 {
constructor( p ) {
super( p );
if ( this.substFormat === 1 ) {
this.chainSubRuleSetCount = p.uint16;
this.chainSubRuleSetOffsets = [
...new Array( this.chainSubRuleSetCount ),
].map( ( _ ) => p.Offset16 );
}
if ( this.substFormat === 2 ) {
this.backtrackClassDefOffset = p.Offset16;
this.inputClassDefOffset = p.Offset16;
this.lookaheadClassDefOffset = p.Offset16;
this.chainSubClassSetCount = p.uint16;
this.chainSubClassSetOffsets = [
...new Array( this.chainSubClassSetCount ),
].map( ( _ ) => p.Offset16 );
}
if ( this.substFormat === 3 ) {
undoCoverageOffsetParsing( this );
this.backtrackGlyphCount = p.uint16;
this.backtrackCoverageOffsets = [
...new Array( this.backtrackGlyphCount ),
].map( ( _ ) => p.Offset16 );
this.inputGlyphCount = p.uint16;
this.inputCoverageOffsets = [
...new Array( this.inputGlyphCount ),
].map( ( _ ) => p.Offset16 );
this.lookaheadGlyphCount = p.uint16;
this.lookaheadCoverageOffsets = [
...new Array( this.lookaheadGlyphCount ),
].map( ( _ ) => p.Offset16 );
this.seqLookupCount = p.uint16;
this.seqLookupRecords = [
...new Array( this.substitutionCount ),
].map( ( _ ) => new SequenceLookupRecord( p ) );
}
}
getChainSubRuleSet( index ) {
if ( this.substFormat !== 1 )
throw new Error(
`lookup type 6.${ this.substFormat } has no chainsubrule sets.`
);
let p = this.parser;
p.currentPosition = this.start + this.chainSubRuleSetOffsets[ index ];
return new ChainSubRuleSetTable( p );
}
getChainSubClassSet( index ) {
if ( this.substFormat !== 2 )
throw new Error(
`lookup type 6.${ this.substFormat } has no chainsubclass sets.`
);
let p = this.parser;
p.currentPosition = this.start + this.chainSubClassSetOffsets[ index ];
return new ChainSubClassSetTable( p );
}
getCoverageFromOffset( offset ) {
if ( this.substFormat !== 3 )
throw new Error(
`lookup type 6.${ this.substFormat } does not use contextual coverage offsets.`
);
let p = this.parser;
p.currentPosition = this.start + offset;
return new CoverageTable( p );
}
}
class ChainSubRuleSetTable extends ParsedData {
constructor( p ) {
super( p );
this.chainSubRuleCount = p.uint16;
this.chainSubRuleOffsets = [
...new Array( this.chainSubRuleCount ),
].map( ( _ ) => p.Offset16 );
}
getSubRule( index ) {
let p = this.parser;
p.currentPosition = this.start + this.chainSubRuleOffsets[ index ];
return new ChainSubRuleTable( p );
}
}
class ChainSubRuleTable {
constructor( p ) {
this.backtrackGlyphCount = p.uint16;
this.backtrackSequence = [
...new Array( this.backtrackGlyphCount ),
].map( ( _ ) => p.uint16 );
this.inputGlyphCount = p.uint16;
this.inputSequence = [ ...new Array( this.inputGlyphCount - 1 ) ].map(
( _ ) => p.uint16
);
this.lookaheadGlyphCount = p.uint16;
this.lookAheadSequence = [
...new Array( this.lookAheadGlyphCount ),
].map( ( _ ) => p.uint16 );
this.substitutionCount = p.uint16;
this.substLookupRecords = [ ...new Array( this.SubstCount ) ].map(
( _ ) => new SubstLookupRecord( p )
);
}
}
class ChainSubClassSetTable extends ParsedData {
constructor( p ) {
super( p );
this.chainSubClassRuleCount = p.uint16;
this.chainSubClassRuleOffsets = [
...new Array( this.chainSubClassRuleCount ),
].map( ( _ ) => p.Offset16 );
}
getSubClass( index ) {
let p = this.parser;
p.currentPosition = this.start + this.chainSubRuleOffsets[ index ];
return new ChainSubClassRuleTable( p );
}
}
class ChainSubClassRuleTable {
constructor( p ) {
this.backtrackGlyphCount = p.uint16;
this.backtrackSequence = [
...new Array( this.backtrackGlyphCount ),
].map( ( _ ) => p.uint16 );
this.inputGlyphCount = p.uint16;
this.inputSequence = [ ...new Array( this.inputGlyphCount - 1 ) ].map(
( _ ) => p.uint16
);
this.lookaheadGlyphCount = p.uint16;
this.lookAheadSequence = [
...new Array( this.lookAheadGlyphCount ),
].map( ( _ ) => p.uint16 );
this.substitutionCount = p.uint16;
this.substLookupRecords = [
...new Array( this.substitutionCount ),
].map( ( _ ) => new SequenceLookupRecord( p ) );
}
}
class SequenceLookupRecord extends ParsedData {
constructor( p ) {
super( p );
this.sequenceIndex = p.uint16;
this.lookupListIndex = p.uint16;
}
}
class LookupType7$1 extends ParsedData {
constructor( p ) {
super( p );
this.substFormat = p.uint16;
this.extensionLookupType = p.uint16;
this.extensionOffset = p.Offset32;
}
}
class LookupType8$1 extends LookupType$1 {
constructor( p ) {
super( p );
this.backtrackGlyphCount = p.uint16;
this.backtrackCoverageOffsets = [
...new Array( this.backtrackGlyphCount ),
].map( ( _ ) => p.Offset16 );
this.lookaheadGlyphCount = p.uint16;
this.lookaheadCoverageOffsets = [
new Array( this.lookaheadGlyphCount ),
].map( ( _ ) => p.Offset16 );
this.glyphCount = p.uint16;
this.substituteGlyphIDs = [ ...new Array( this.glyphCount ) ].map(
( _ ) => p.uint16
);
}
}
var GSUBtables = {
buildSubtable: function ( type, p ) {
const subtable = new [
undefined,
LookupType1$1,
LookupType2$1,
LookupType3$1,
LookupType4$1,
LookupType5$1,
LookupType6$1,
LookupType7$1,
LookupType8$1,
][ type ]( p );
subtable.type = type;
return subtable;
},
};
class LookupType extends ParsedData {
constructor( p ) {
super( p );
}
}
class LookupType1 extends LookupType {
constructor( p ) {
super( p );
console.log( `lookup type 1` );
}
}
class LookupType2 extends LookupType {
constructor( p ) {
super( p );
console.log( `lookup type 2` );
}
}
class LookupType3 extends LookupType {
constructor( p ) {
super( p );
console.log( `lookup type 3` );
}
}
class LookupType4 extends LookupType {
constructor( p ) {
super( p );
console.log( `lookup type 4` );
}
}
class LookupType5 extends LookupType {
constructor( p ) {
super( p );
console.log( `lookup type 5` );
}
}
class LookupType6 extends LookupType {
constructor( p ) {
super( p );
console.log( `lookup type 6` );
}
}
class LookupType7 extends LookupType {
constructor( p ) {
super( p );
console.log( `lookup type 7` );
}
}
class LookupType8 extends LookupType {
constructor( p ) {
super( p );
console.log( `lookup type 8` );
}
}
class LookupType9 extends LookupType {
constructor( p ) {
super( p );
console.log( `lookup type 9` );
}
}
var GPOStables = {
buildSubtable: function ( type, p ) {
const subtable = new [
undefined,
LookupType1,
LookupType2,
LookupType3,
LookupType4,
LookupType5,
LookupType6,
LookupType7,
LookupType8,
LookupType9,
][ type ]( p );
subtable.type = type;
return subtable;
},
};
class LookupList extends ParsedData {
static EMPTY = { lookupCount: 0, lookups: [] };
constructor( p ) {
super( p );
this.lookupCount = p.uint16;
this.lookups = [ ...new Array( this.lookupCount ) ].map(
( _ ) => p.Offset16
);
}
}
class LookupTable extends ParsedData {
constructor( p, type ) {
super( p );
this.ctType = type;
this.lookupType = p.uint16;
this.lookupFlag = p.uint16;
this.subTableCount = p.uint16;
this.subtableOffsets = [ ...new Array( this.subTableCount ) ].map(
( _ ) => p.Offset16
);
this.markFilteringSet = p.uint16;
}
get rightToLeft() {
return this.lookupFlag & ( 1 === 1 );
}
get ignoreBaseGlyphs() {
return this.lookupFlag & ( 2 === 2 );
}
get ignoreLigatures() {
return this.lookupFlag & ( 4 === 4 );
}
get ignoreMarks() {
return this.lookupFlag & ( 8 === 8 );
}
get useMarkFilteringSet() {
return this.lookupFlag & ( 16 === 16 );
}
get markAttachmentType() {
return this.lookupFlag & ( 65280 === 65280 );
}
getSubTable( index ) {
const builder = this.ctType === `GSUB` ? GSUBtables : GPOStables;
this.parser.currentPosition =
this.start + this.subtableOffsets[ index ];
return builder.buildSubtable( this.lookupType, this.parser );
}
}
class CommonLayoutTable extends SimpleTable {
constructor( dict, dataview, name ) {
const { p: p, tableStart: tableStart } = super( dict, dataview, name );
this.majorVersion = p.uint16;
this.minorVersion = p.uint16;
this.scriptListOffset = p.Offset16;
this.featureListOffset = p.Offset16;
this.lookupListOffset = p.Offset16;
if ( this.majorVersion === 1 && this.minorVersion === 1 ) {
this.featureVariationsOffset = p.Offset32;
}
const no_content = ! (
this.scriptListOffset ||
this.featureListOffset ||
this.lookupListOffset
);
lazy$1( this, `scriptList`, () => {
if ( no_content ) return ScriptList.EMPTY;
p.currentPosition = tableStart + this.scriptListOffset;
return new ScriptList( p );
} );
lazy$1( this, `featureList`, () => {
if ( no_content ) return FeatureList.EMPTY;
p.currentPosition = tableStart + this.featureListOffset;
return new FeatureList( p );
} );
lazy$1( this, `lookupList`, () => {
if ( no_content ) return LookupList.EMPTY;
p.currentPosition = tableStart + this.lookupListOffset;
return new LookupList( p );
} );
if ( this.featureVariationsOffset ) {
lazy$1( this, `featureVariations`, () => {
if ( no_content ) return FeatureVariations.EMPTY;
p.currentPosition = tableStart + this.featureVariationsOffset;
return new FeatureVariations( p );
} );
}
}
getSupportedScripts() {
return this.scriptList.scriptRecords.map( ( r ) => r.scriptTag );
}
getScriptTable( scriptTag ) {
let record = this.scriptList.scriptRecords.find(
( r ) => r.scriptTag === scriptTag
);
this.parser.currentPosition =
this.scriptList.start + record.scriptOffset;
let table = new ScriptTable( this.parser );
table.scriptTag = scriptTag;
return table;
}
ensureScriptTable( arg ) {
if ( typeof arg === 'string' ) {
return this.getScriptTable( arg );
}
return arg;
}
getSupportedLangSys( scriptTable ) {
scriptTable = this.ensureScriptTable( scriptTable );
const hasDefault = scriptTable.defaultLangSys !== 0;
const supported = scriptTable.langSysRecords.map(
( l ) => l.langSysTag
);
if ( hasDefault ) supported.unshift( `dflt` );
return supported;
}
getDefaultLangSysTable( scriptTable ) {
scriptTable = this.ensureScriptTable( scriptTable );
let offset = scriptTable.defaultLangSys;
if ( offset !== 0 ) {
this.parser.currentPosition = scriptTable.start + offset;
let table = new LangSysTable( this.parser );
table.langSysTag = ``;
table.defaultForScript = scriptTable.scriptTag;
return table;
}
}
getLangSysTable( scriptTable, langSysTag = `dflt` ) {
if ( langSysTag === `dflt` )
return this.getDefaultLangSysTable( scriptTable );
scriptTable = this.ensureScriptTable( scriptTable );
let record = scriptTable.langSysRecords.find(
( l ) => l.langSysTag === langSysTag
);
this.parser.currentPosition = scriptTable.start + record.langSysOffset;
let table = new LangSysTable( this.parser );
table.langSysTag = langSysTag;
return table;
}
getFeatures( langSysTable ) {
return langSysTable.featureIndices.map( ( index ) =>
this.getFeature( index )
);
}
getFeature( indexOrTag ) {
let record;
if ( parseInt( indexOrTag ) == indexOrTag ) {
record = this.featureList.featureRecords[ indexOrTag ];
} else {
record = this.featureList.featureRecords.find(
( f ) => f.featureTag === indexOrTag
);
}
if ( ! record ) return;
this.parser.currentPosition =
this.featureList.start + record.featureOffset;
let table = new FeatureTable( this.parser );
table.featureTag = record.featureTag;
return table;
}
getLookups( featureTable ) {
return featureTable.lookupListIndices.map( ( index ) =>
this.getLookup( index )
);
}
getLookup( lookupIndex, type ) {
let lookupOffset = this.lookupList.lookups[ lookupIndex ];
this.parser.currentPosition = this.lookupList.start + lookupOffset;
return new LookupTable( this.parser, type );
}
}
class GSUB extends CommonLayoutTable {
constructor( dict, dataview ) {
super( dict, dataview, `GSUB` );
}
getLookup( lookupIndex ) {
return super.getLookup( lookupIndex, `GSUB` );
}
}
var GSUB$1 = Object.freeze( { __proto__: null, GSUB: GSUB } );
class GPOS extends CommonLayoutTable {
constructor( dict, dataview ) {
super( dict, dataview, `GPOS` );
}
getLookup( lookupIndex ) {
return super.getLookup( lookupIndex, `GPOS` );
}
}
var GPOS$1 = Object.freeze( { __proto__: null, GPOS: GPOS } );
class SVG extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.version = p.uint16;
this.offsetToSVGDocumentList = p.Offset32;
p.currentPosition = this.tableStart + this.offsetToSVGDocumentList;
this.documentList = new SVGDocumentList( p );
}
}
class SVGDocumentList extends ParsedData {
constructor( p ) {
super( p );
this.numEntries = p.uint16;
this.documentRecords = [ ...new Array( this.numEntries ) ].map(
( _ ) => new SVGDocumentRecord( p )
);
}
getDocument( documentID ) {
let record = this.documentRecords[ documentID ];
if ( ! record ) return '';
let offset = this.start + record.svgDocOffset;
this.parser.currentPosition = offset;
return this.parser.readBytes( record.svgDocLength );
}
getDocumentForGlyph( glyphID ) {
let id = this.documentRecords.findIndex(
( d ) => d.startGlyphID <= glyphID && glyphID <= d.endGlyphID
);
if ( id === -1 ) return '';
return this.getDocument( id );
}
}
class SVGDocumentRecord {
constructor( p ) {
this.startGlyphID = p.uint16;
this.endGlyphID = p.uint16;
this.svgDocOffset = p.Offset32;
this.svgDocLength = p.uint32;
}
}
var SVG$1 = Object.freeze( { __proto__: null, SVG: SVG } );
class fvar extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.majorVersion = p.uint16;
this.minorVersion = p.uint16;
this.axesArrayOffset = p.Offset16;
p.uint16;
this.axisCount = p.uint16;
this.axisSize = p.uint16;
this.instanceCount = p.uint16;
this.instanceSize = p.uint16;
const axisStart = this.tableStart + this.axesArrayOffset;
lazy$1( this, `axes`, () => {
p.currentPosition = axisStart;
return [ ...new Array( this.axisCount ) ].map(
( _ ) => new VariationAxisRecord( p )
);
} );
const instanceStart = axisStart + this.axisCount * this.axisSize;
lazy$1( this, `instances`, () => {
let instances = [];
for ( let i = 0; i < this.instanceCount; i++ ) {
p.currentPosition = instanceStart + i * this.instanceSize;
instances.push(
new InstanceRecord( p, this.axisCount, this.instanceSize )
);
}
return instances;
} );
}
getSupportedAxes() {
return this.axes.map( ( a ) => a.tag );
}
getAxis( name ) {
return this.axes.find( ( a ) => a.tag === name );
}
}
class VariationAxisRecord {
constructor( p ) {
this.tag = p.tag;
this.minValue = p.fixed;
this.defaultValue = p.fixed;
this.maxValue = p.fixed;
this.flags = p.flags( 16 );
this.axisNameID = p.uint16;
}
}
class InstanceRecord {
constructor( p, axisCount, size ) {
let start = p.currentPosition;
this.subfamilyNameID = p.uint16;
p.uint16;
this.coordinates = [ ...new Array( axisCount ) ].map(
( _ ) => p.fixed
);
if ( p.currentPosition - start < size ) {
this.postScriptNameID = p.uint16;
}
}
}
var fvar$1 = Object.freeze( { __proto__: null, fvar: fvar } );
class cvt extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
const n = dict.length / 2;
lazy$1( this, `items`, () =>
[ ...new Array( n ) ].map( ( _ ) => p.fword )
);
}
}
var cvt$1 = Object.freeze( { __proto__: null, cvt: cvt } );
class fpgm extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
lazy$1( this, `instructions`, () =>
[ ...new Array( dict.length ) ].map( ( _ ) => p.uint8 )
);
}
}
var fpgm$1 = Object.freeze( { __proto__: null, fpgm: fpgm } );
class gasp extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.version = p.uint16;
this.numRanges = p.uint16;
const getter = () =>
[ ...new Array( this.numRanges ) ].map(
( _ ) => new GASPRange( p )
);
lazy$1( this, `gaspRanges`, getter );
}
}
class GASPRange {
constructor( p ) {
this.rangeMaxPPEM = p.uint16;
this.rangeGaspBehavior = p.uint16;
}
}
var gasp$1 = Object.freeze( { __proto__: null, gasp: gasp } );
class glyf extends SimpleTable {
constructor( dict, dataview ) {
super( dict, dataview );
}
getGlyphData( offset, length ) {
this.parser.currentPosition = this.tableStart + offset;
return this.parser.readBytes( length );
}
}
var glyf$1 = Object.freeze( { __proto__: null, glyf: glyf } );
class loca extends SimpleTable {
constructor( dict, dataview, tables ) {
const { p: p } = super( dict, dataview );
const n = tables.maxp.numGlyphs + 1;
if ( tables.head.indexToLocFormat === 0 ) {
this.x2 = true;
lazy$1( this, `offsets`, () =>
[ ...new Array( n ) ].map( ( _ ) => p.Offset16 )
);
} else {
lazy$1( this, `offsets`, () =>
[ ...new Array( n ) ].map( ( _ ) => p.Offset32 )
);
}
}
getGlyphDataOffsetAndLength( glyphID ) {
let offset = this.offsets[ glyphID ] * this.x2 ? 2 : 1;
let nextOffset = this.offsets[ glyphID + 1 ] * this.x2 ? 2 : 1;
return { offset: offset, length: nextOffset - offset };
}
}
var loca$1 = Object.freeze( { __proto__: null, loca: loca } );
class prep extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
lazy$1( this, `instructions`, () =>
[ ...new Array( dict.length ) ].map( ( _ ) => p.uint8 )
);
}
}
var prep$1 = Object.freeze( { __proto__: null, prep: prep } );
class CFF extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
lazy$1( this, `data`, () => p.readBytes() );
}
}
var CFF$1 = Object.freeze( { __proto__: null, CFF: CFF } );
class CFF2 extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
lazy$1( this, `data`, () => p.readBytes() );
}
}
var CFF2$1 = Object.freeze( { __proto__: null, CFF2: CFF2 } );
class VORG extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.majorVersion = p.uint16;
this.minorVersion = p.uint16;
this.defaultVertOriginY = p.int16;
this.numVertOriginYMetrics = p.uint16;
lazy$1( this, `vertORiginYMetrics`, () =>
[ ...new Array( this.numVertOriginYMetrics ) ].map(
( _ ) => new VertOriginYMetric( p )
)
);
}
}
class VertOriginYMetric {
constructor( p ) {
this.glyphIndex = p.uint16;
this.vertOriginY = p.int16;
}
}
var VORG$1 = Object.freeze( { __proto__: null, VORG: VORG } );
class BitmapSize {
constructor( p ) {
this.indexSubTableArrayOffset = p.Offset32;
this.indexTablesSize = p.uint32;
this.numberofIndexSubTables = p.uint32;
this.colorRef = p.uint32;
this.hori = new SbitLineMetrics( p );
this.vert = new SbitLineMetrics( p );
this.startGlyphIndex = p.uint16;
this.endGlyphIndex = p.uint16;
this.ppemX = p.uint8;
this.ppemY = p.uint8;
this.bitDepth = p.uint8;
this.flags = p.int8;
}
}
class BitmapScale {
constructor( p ) {
this.hori = new SbitLineMetrics( p );
this.vert = new SbitLineMetrics( p );
this.ppemX = p.uint8;
this.ppemY = p.uint8;
this.substitutePpemX = p.uint8;
this.substitutePpemY = p.uint8;
}
}
class SbitLineMetrics {
constructor( p ) {
this.ascender = p.int8;
this.descender = p.int8;
this.widthMax = p.uint8;
this.caretSlopeNumerator = p.int8;
this.caretSlopeDenominator = p.int8;
this.caretOffset = p.int8;
this.minOriginSB = p.int8;
this.minAdvanceSB = p.int8;
this.maxBeforeBL = p.int8;
this.minAfterBL = p.int8;
this.pad1 = p.int8;
this.pad2 = p.int8;
}
}
class EBLC extends SimpleTable {
constructor( dict, dataview, name ) {
const { p: p } = super( dict, dataview, name );
this.majorVersion = p.uint16;
this.minorVersion = p.uint16;
this.numSizes = p.uint32;
lazy$1( this, `bitMapSizes`, () =>
[ ...new Array( this.numSizes ) ].map(
( _ ) => new BitmapSize( p )
)
);
}
}
var EBLC$1 = Object.freeze( { __proto__: null, EBLC: EBLC } );
class EBDT extends SimpleTable {
constructor( dict, dataview, name ) {
const { p: p } = super( dict, dataview, name );
this.majorVersion = p.uint16;
this.minorVersion = p.uint16;
}
}
var EBDT$1 = Object.freeze( { __proto__: null, EBDT: EBDT } );
class EBSC extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.majorVersion = p.uint16;
this.minorVersion = p.uint16;
this.numSizes = p.uint32;
lazy$1( this, `bitmapScales`, () =>
[ ...new Array( this.numSizes ) ].map(
( _ ) => new BitmapScale( p )
)
);
}
}
var EBSC$1 = Object.freeze( { __proto__: null, EBSC: EBSC } );
class CBLC extends EBLC {
constructor( dict, dataview ) {
super( dict, dataview, `CBLC` );
}
}
var CBLC$1 = Object.freeze( { __proto__: null, CBLC: CBLC } );
class CBDT extends EBDT {
constructor( dict, dataview ) {
super( dict, dataview, `CBDT` );
}
}
var CBDT$1 = Object.freeze( { __proto__: null, CBDT: CBDT } );
class sbix extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.version = p.uint16;
this.flags = p.flags( 16 );
this.numStrikes = p.uint32;
lazy$1( this, `strikeOffsets`, () =>
[ ...new Array( this.numStrikes ) ].map( ( _ ) => p.Offset32 )
);
}
}
var sbix$1 = Object.freeze( { __proto__: null, sbix: sbix } );
class COLR extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.version = p.uint16;
this.numBaseGlyphRecords = p.uint16;
this.baseGlyphRecordsOffset = p.Offset32;
this.layerRecordsOffset = p.Offset32;
this.numLayerRecords = p.uint16;
}
getBaseGlyphRecord( glyphID ) {
let start = this.tableStart + this.baseGlyphRecordsOffset;
this.parser.currentPosition = start;
let first = new BaseGlyphRecord( this.parser );
let firstID = first.gID;
let end = this.tableStart + this.layerRecordsOffset - 6;
this.parser.currentPosition = end;
let last = new BaseGlyphRecord( this.parser );
let lastID = last.gID;
if ( firstID === glyphID ) return first;
if ( lastID === glyphID ) return last;
while ( true ) {
if ( start === end ) break;
let mid = start + ( end - start ) / 12;
this.parser.currentPosition = mid;
let middle = new BaseGlyphRecord( this.parser );
let midID = middle.gID;
if ( midID === glyphID ) return middle;
else if ( midID > glyphID ) {
end = mid;
} else if ( midID < glyphID ) {
start = mid;
}
}
return false;
}
getLayers( glyphID ) {
let record = this.getBaseGlyphRecord( glyphID );
this.parser.currentPosition =
this.tableStart +
this.layerRecordsOffset +
4 * record.firstLayerIndex;
return [ ...new Array( record.numLayers ) ].map(
( _ ) => new LayerRecord( p )
);
}
}
class BaseGlyphRecord {
constructor( p ) {
this.gID = p.uint16;
this.firstLayerIndex = p.uint16;
this.numLayers = p.uint16;
}
}
class LayerRecord {
constructor( p ) {
this.gID = p.uint16;
this.paletteIndex = p.uint16;
}
}
var COLR$1 = Object.freeze( { __proto__: null, COLR: COLR } );
class CPAL extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.version = p.uint16;
this.numPaletteEntries = p.uint16;
const numPalettes = ( this.numPalettes = p.uint16 );
this.numColorRecords = p.uint16;
this.offsetFirstColorRecord = p.Offset32;
this.colorRecordIndices = [ ...new Array( this.numPalettes ) ].map(
( _ ) => p.uint16
);
lazy$1( this, `colorRecords`, () => {
p.currentPosition = this.tableStart + this.offsetFirstColorRecord;
return [ ...new Array( this.numColorRecords ) ].map(
( _ ) => new ColorRecord( p )
);
} );
if ( this.version === 1 ) {
this.offsetPaletteTypeArray = p.Offset32;
this.offsetPaletteLabelArray = p.Offset32;
this.offsetPaletteEntryLabelArray = p.Offset32;
lazy$1( this, `paletteTypeArray`, () => {
p.currentPosition =
this.tableStart + this.offsetPaletteTypeArray;
return new PaletteTypeArray( p, numPalettes );
} );
lazy$1( this, `paletteLabelArray`, () => {
p.currentPosition =
this.tableStart + this.offsetPaletteLabelArray;
return new PaletteLabelsArray( p, numPalettes );
} );
lazy$1( this, `paletteEntryLabelArray`, () => {
p.currentPosition =
this.tableStart + this.offsetPaletteEntryLabelArray;
return new PaletteEntryLabelArray( p, numPalettes );
} );
}
}
}
class ColorRecord {
constructor( p ) {
this.blue = p.uint8;
this.green = p.uint8;
this.red = p.uint8;
this.alpha = p.uint8;
}
}
class PaletteTypeArray {
constructor( p, numPalettes ) {
this.paletteTypes = [ ...new Array( numPalettes ) ].map(
( _ ) => p.uint32
);
}
}
class PaletteLabelsArray {
constructor( p, numPalettes ) {
this.paletteLabels = [ ...new Array( numPalettes ) ].map(
( _ ) => p.uint16
);
}
}
class PaletteEntryLabelArray {
constructor( p, numPalettes ) {
this.paletteEntryLabels = [ ...new Array( numPalettes ) ].map(
( _ ) => p.uint16
);
}
}
var CPAL$1 = Object.freeze( { __proto__: null, CPAL: CPAL } );
class DSIG extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.version = p.uint32;
this.numSignatures = p.uint16;
this.flags = p.uint16;
this.signatureRecords = [ ...new Array( this.numSignatures ) ].map(
( _ ) => new SignatureRecord( p )
);
}
getData( signatureID ) {
const record = this.signatureRecords[ signatureID ];
this.parser.currentPosition = this.tableStart + record.offset;
return new SignatureBlockFormat1( this.parser );
}
}
class SignatureRecord {
constructor( p ) {
this.format = p.uint32;
this.length = p.uint32;
this.offset = p.Offset32;
}
}
class SignatureBlockFormat1 {
constructor( p ) {
p.uint16;
p.uint16;
this.signatureLength = p.uint32;
this.signature = p.readBytes( this.signatureLength );
}
}
var DSIG$1 = Object.freeze( { __proto__: null, DSIG: DSIG } );
class hdmx extends SimpleTable {
constructor( dict, dataview, tables ) {
const { p: p } = super( dict, dataview );
const numGlyphs = tables.hmtx.numGlyphs;
this.version = p.uint16;
this.numRecords = p.int16;
this.sizeDeviceRecord = p.int32;
this.records = [ ...new Array( numRecords ) ].map(
( _ ) => new DeviceRecord( p, numGlyphs )
);
}
}
class DeviceRecord {
constructor( p, numGlyphs ) {
this.pixelSize = p.uint8;
this.maxWidth = p.uint8;
this.widths = p.readBytes( numGlyphs );
}
}
var hdmx$1 = Object.freeze( { __proto__: null, hdmx: hdmx } );
class kern extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.version = p.uint16;
this.nTables = p.uint16;
lazy$1( this, `tables`, () => {
let offset = this.tableStart + 4;
const tables = [];
for ( let i = 0; i < this.nTables; i++ ) {
p.currentPosition = offset;
let subtable = new KernSubTable( p );
tables.push( subtable );
offset += subtable;
}
return tables;
} );
}
}
class KernSubTable {
constructor( p ) {
this.version = p.uint16;
this.length = p.uint16;
this.coverage = p.flags( 8 );
this.format = p.uint8;
if ( this.format === 0 ) {
this.nPairs = p.uint16;
this.searchRange = p.uint16;
this.entrySelector = p.uint16;
this.rangeShift = p.uint16;
lazy$1( this, `pairs`, () =>
[ ...new Array( this.nPairs ) ].map( ( _ ) => new Pair( p ) )
);
}
if ( this.format === 2 ) {
console.warn(
`Kern subtable format 2 is not supported: this parser currently only parses universal table data.`
);
}
}
get horizontal() {
return this.coverage[ 0 ];
}
get minimum() {
return this.coverage[ 1 ];
}
get crossstream() {
return this.coverage[ 2 ];
}
get override() {
return this.coverage[ 3 ];
}
}
class Pair {
constructor( p ) {
this.left = p.uint16;
this.right = p.uint16;
this.value = p.fword;
}
}
var kern$1 = Object.freeze( { __proto__: null, kern: kern } );
class LTSH extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.version = p.uint16;
this.numGlyphs = p.uint16;
this.yPels = p.readBytes( this.numGlyphs );
}
}
var LTSH$1 = Object.freeze( { __proto__: null, LTSH: LTSH } );
class MERG extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.version = p.uint16;
this.mergeClassCount = p.uint16;
this.mergeDataOffset = p.Offset16;
this.classDefCount = p.uint16;
this.offsetToClassDefOffsets = p.Offset16;
lazy$1( this, `mergeEntryMatrix`, () =>
[ ...new Array( this.mergeClassCount ) ].map( ( _ ) =>
p.readBytes( this.mergeClassCount )
)
);
console.warn( `Full MERG parsing is currently not supported.` );
console.warn(
`If you need this table parsed, please file an issue, or better yet, a PR.`
);
}
}
var MERG$1 = Object.freeze( { __proto__: null, MERG: MERG } );
class meta extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.version = p.uint32;
this.flags = p.uint32;
p.uint32;
this.dataMapsCount = p.uint32;
this.dataMaps = [ ...new Array( this.dataMapsCount ) ].map(
( _ ) => new DataMap( this.tableStart, p )
);
}
}
class DataMap {
constructor( tableStart, p ) {
this.tableStart = tableStart;
this.parser = p;
this.tag = p.tag;
this.dataOffset = p.Offset32;
this.dataLength = p.uint32;
}
getData() {
this.parser.currentField = this.tableStart + this.dataOffset;
return this.parser.readBytes( this.dataLength );
}
}
var meta$1 = Object.freeze( { __proto__: null, meta: meta } );
class PCLT extends SimpleTable {
constructor( dict, dataview ) {
super( dict, dataview );
console.warn(
`This font uses a PCLT table, which is currently not supported by this parser.`
);
console.warn(
`If you need this table parsed, please file an issue, or better yet, a PR.`
);
}
}
var PCLT$1 = Object.freeze( { __proto__: null, PCLT: PCLT } );
class VDMX extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.version = p.uint16;
this.numRecs = p.uint16;
this.numRatios = p.uint16;
this.ratRanges = [ ...new Array( this.numRatios ) ].map(
( _ ) => new RatioRange( p )
);
this.offsets = [ ...new Array( this.numRatios ) ].map(
( _ ) => p.Offset16
);
this.VDMXGroups = [ ...new Array( this.numRecs ) ].map(
( _ ) => new VDMXGroup( p )
);
}
}
class RatioRange {
constructor( p ) {
this.bCharSet = p.uint8;
this.xRatio = p.uint8;
this.yStartRatio = p.uint8;
this.yEndRatio = p.uint8;
}
}
class VDMXGroup {
constructor( p ) {
this.recs = p.uint16;
this.startsz = p.uint8;
this.endsz = p.uint8;
this.records = [ ...new Array( this.recs ) ].map(
( _ ) => new vTable( p )
);
}
}
class vTable {
constructor( p ) {
this.yPelHeight = p.uint16;
this.yMax = p.int16;
this.yMin = p.int16;
}
}
var VDMX$1 = Object.freeze( { __proto__: null, VDMX: VDMX } );
class vhea extends SimpleTable {
constructor( dict, dataview ) {
const { p: p } = super( dict, dataview );
this.version = p.fixed;
this.ascent = this.vertTypoAscender = p.int16;
this.descent = this.vertTypoDescender = p.int16;
this.lineGap = this.vertTypoLineGap = p.int16;
this.advanceHeightMax = p.int16;
this.minTopSideBearing = p.int16;
this.minBottomSideBearing = p.int16;
this.yMaxExtent = p.int16;
this.caretSlopeRise = p.int16;
this.caretSlopeRun = p.int16;
this.caretOffset = p.int16;
this.reserved = p.int16;
this.reserved = p.int16;
this.reserved = p.int16;
this.reserved = p.int16;
this.metricDataFormat = p.int16;
this.numOfLongVerMetrics = p.uint16;
p.verifyLength();
}
}
var vhea$1 = Object.freeze( { __proto__: null, vhea: vhea } );
class vmtx extends SimpleTable {
constructor( dict, dataview, tables ) {
super( dict, dataview );
const numOfLongVerMetrics = tables.vhea.numOfLongVerMetrics;
const numGlyphs = tables.maxp.numGlyphs;
const metricsStart = p.currentPosition;
lazy( this, `vMetrics`, () => {
p.currentPosition = metricsStart;
return [ ...new Array( numOfLongVerMetrics ) ].map(
( _ ) => new LongVertMetric( p.uint16, p.int16 )
);
} );
if ( numOfLongVerMetrics < numGlyphs ) {
const tsbStart = metricsStart + numOfLongVerMetrics * 4;
lazy( this, `topSideBearings`, () => {
p.currentPosition = tsbStart;
return [ ...new Array( numGlyphs - numOfLongVerMetrics ) ].map(
( _ ) => p.int16
);
} );
}
}
}
class LongVertMetric {
constructor( h, b ) {
this.advanceHeight = h;
this.topSideBearing = b;
}
}
var vmtx$1 = Object.freeze( { __proto__: null, vmtx: vmtx } );
/* eslint-enable */
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js
const { kebabCase: make_families_from_faces_kebabCase } = unlock(external_wp_components_namespaceObject.privateApis);
function makeFamiliesFromFaces(fontFaces) {
const fontFamiliesObject = fontFaces.reduce((acc, item) => {
if (!acc[item.fontFamily]) {
acc[item.fontFamily] = {
name: item.fontFamily,
fontFamily: item.fontFamily,
slug: make_families_from_faces_kebabCase(item.fontFamily.toLowerCase()),
fontFace: []
};
}
acc[item.fontFamily].fontFace.push(item);
return acc;
}, {});
return Object.values(fontFamiliesObject);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/upload-fonts.js
function UploadFonts() {
const { installFonts } = (0,external_wp_element_.useContext)(FontLibraryContext);
const [isUploading, setIsUploading] = (0,external_wp_element_.useState)(false);
const [notice, setNotice] = (0,external_wp_element_.useState)(false);
const handleDropZone = (files) => {
handleFilesUpload(files);
};
const onFilesUpload = (event) => {
handleFilesUpload(event.target.files);
};
const handleFilesUpload = async (files) => {
setNotice(null);
setIsUploading(true);
const uniqueFilenames = /* @__PURE__ */ new Set();
const selectedFiles = [...files];
let hasInvalidFiles = false;
const checkFilesPromises = selectedFiles.map(async (file) => {
const isFont = await isFontFile(file);
if (!isFont) {
hasInvalidFiles = true;
return null;
}
if (uniqueFilenames.has(file.name)) {
return null;
}
const fileExtension = file.name.split(".").pop().toLowerCase();
if (ALLOWED_FILE_EXTENSIONS.includes(fileExtension)) {
uniqueFilenames.add(file.name);
return file;
}
return null;
});
const allowedFiles = (await Promise.all(checkFilesPromises)).filter(
(file) => null !== file
);
if (allowedFiles.length > 0) {
loadFiles(allowedFiles);
} else {
const message = hasInvalidFiles ? (0,external_wp_i18n_namespaceObject.__)("Sorry, you are not allowed to upload this file type.") : (0,external_wp_i18n_namespaceObject.__)("No fonts found to install.");
setNotice({
type: "error",
message
});
setIsUploading(false);
}
};
const loadFiles = async (files) => {
const fontFacesLoaded = await Promise.all(
files.map(async (fontFile) => {
const fontFaceData = await getFontFaceMetadata(fontFile);
await loadFontFaceInBrowser(
fontFaceData,
fontFaceData.file,
"all"
);
return fontFaceData;
})
);
handleInstall(fontFacesLoaded);
};
async function isFontFile(file) {
const font = new Font("Uploaded Font");
try {
const buffer = await readFileAsArrayBuffer(file);
await font.fromDataBuffer(buffer, "font");
return true;
} catch (error) {
return false;
}
}
async function readFileAsArrayBuffer(file) {
return new Promise((resolve, reject) => {
const reader = new window.FileReader();
reader.readAsArrayBuffer(file);
reader.onload = () => resolve(reader.result);
reader.onerror = reject;
});
}
const getFontFaceMetadata = async (fontFile) => {
const buffer = await readFileAsArrayBuffer(fontFile);
const fontObj = new Font("Uploaded Font");
fontObj.fromDataBuffer(buffer, fontFile.name);
const onloadEvent = await new Promise(
(resolve) => fontObj.onload = resolve
);
const font = onloadEvent.detail.font;
const { name } = font.opentype.tables;
const fontName = name.get(16) || name.get(1);
const isItalic = name.get(2).toLowerCase().includes("italic");
const fontWeight = font.opentype.tables["OS/2"].usWeightClass || "normal";
const isVariable = !!font.opentype.tables.fvar;
const weightAxis = isVariable && font.opentype.tables.fvar.axes.find(
({ tag }) => tag === "wght"
);
const weightRange = weightAxis ? `${weightAxis.minValue} ${weightAxis.maxValue}` : null;
return {
file: fontFile,
fontFamily: fontName,
fontStyle: isItalic ? "italic" : "normal",
fontWeight: weightRange || fontWeight
};
};
const handleInstall = async (fontFaces) => {
const fontFamilies = makeFamiliesFromFaces(fontFaces);
try {
await installFonts(fontFamilies);
setNotice({
type: "success",
message: (0,external_wp_i18n_namespaceObject.__)("Fonts were installed successfully.")
});
} catch (error) {
setNotice({
type: "error",
message: error.message,
errors: error?.installationErrors
});
}
setIsUploading(false);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "font-library-modal__tabpanel-layout", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropZone, { onFilesDrop: handleDropZone }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { className: "font-library-modal__local-fonts", children: [
notice && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Notice,
{
status: notice.type,
__unstableHTML: true,
onRemove: () => setNotice(null),
children: [
notice.message,
notice.errors && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { children: notice.errors.map((error, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { children: error }, index)) })
]
}
),
isUploading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "font-library-modal__upload-area", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ProgressBar, {}) }) }),
!isUploading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.FormFileUpload,
{
accept: ALLOWED_FILE_EXTENSIONS.map(
(ext) => `.${ext}`
).join(","),
multiple: true,
onChange: onFilesUpload,
render: ({ openFileDialog }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
className: "font-library-modal__upload-area",
onClick: openFileDialog,
children: (0,external_wp_i18n_namespaceObject.__)("Upload font")
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 2 }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { className: "font-library-modal__upload-area__text", children: (0,external_wp_i18n_namespaceObject.__)(
"Uploaded fonts appear in your library and can be used in your theme. Supported formats: .ttf, .otf, .woff, and .woff2."
) })
] })
] });
}
var upload_fonts_default = UploadFonts;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/index.js
const { Tabs } = unlock(external_wp_components_namespaceObject.privateApis);
const DEFAULT_TAB = {
id: "installed-fonts",
title: (0,external_wp_i18n_namespaceObject._x)("Library", "Font library")
};
const UPLOAD_TAB = {
id: "upload-fonts",
title: (0,external_wp_i18n_namespaceObject._x)("Upload", "noun")
};
const tabsFromCollections = (collections) => collections.map(({ slug, name }) => ({
id: slug,
title: collections.length === 1 && slug === "google-fonts" ? (0,external_wp_i18n_namespaceObject.__)("Install Fonts") : name
}));
function FontLibraryModal({
onRequestClose,
defaultTabId = "installed-fonts"
}) {
const { collections } = (0,external_wp_element_.useContext)(FontLibraryContext);
const canUserCreate = (0,external_wp_data_.useSelect)((select) => {
return select(external_wp_coreData_namespaceObject.store).canUser("create", {
kind: "postType",
name: "wp_font_family"
});
}, []);
const tabs = [DEFAULT_TAB];
if (canUserCreate) {
tabs.push(UPLOAD_TAB);
tabs.push(...tabsFromCollections(collections || []));
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
title: (0,external_wp_i18n_namespaceObject.__)("Fonts"),
onRequestClose,
isFullScreen: true,
className: "font-library-modal",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs, { defaultTabId, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "font-library-modal__tablist-container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabList, { children: tabs.map(({ id, title }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, { tabId: id, children: title }, id)) }) }),
tabs.map(({ id }) => {
let contents;
switch (id) {
case "upload-fonts":
contents = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(upload_fonts_default, {});
break;
case "installed-fonts":
contents = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(installed_fonts_default, {});
break;
default:
contents = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(font_collection_default, { slug: id });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Tabs.TabPanel,
{
tabId: id,
focusable: false,
children: contents
},
id
);
})
] })
}
);
}
var font_library_modal_default = FontLibraryModal;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-family-item.js
function FontFamilyItem({ font }) {
const { handleSetLibraryFontSelected, setModalTabOpen } = (0,external_wp_element_.useContext)(FontLibraryContext);
const variantsCount = font?.fontFace?.length || 1;
const handleClick = () => {
handleSetLibraryFontSelected(font);
setModalTabOpen("installed-fonts");
};
const previewStyle = getFamilyPreviewStyle(font);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItem, { onClick: handleClick, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { style: previewStyle, children: font.name }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { className: "edit-site-global-styles-screen-typography__font-variants-count", children: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: Number of font variants. */
(0,external_wp_i18n_namespaceObject._n)("%d variant", "%d variants", variantsCount),
variantsCount
) })
] }) });
}
var font_family_item_default = FontFamilyItem;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-families.js
const { useGlobalSetting: font_families_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function mapFontsWithSource(fonts, source) {
return fonts ? fonts.map((f) => setUIValuesNeeded(f, { source })) : [];
}
function FontFamilies() {
const { baseCustomFonts, modalTabOpen, setModalTabOpen } = (0,external_wp_element_.useContext)(FontLibraryContext);
const [fontFamilies] = font_families_useGlobalSetting("typography.fontFamilies");
const [baseFontFamilies] = font_families_useGlobalSetting(
"typography.fontFamilies",
void 0,
"base"
);
const themeFonts = mapFontsWithSource(fontFamilies?.theme, "theme");
const customFonts = mapFontsWithSource(fontFamilies?.custom, "custom");
const activeFonts = [...themeFonts, ...customFonts].sort(
(a, b) => a.name.localeCompare(b.name)
);
const hasFonts = 0 < activeFonts.length;
const hasInstalledFonts = hasFonts || baseFontFamilies?.theme?.length > 0 || baseCustomFonts?.length > 0;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
!!modalTabOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
font_library_modal_default,
{
onRequestClose: () => setModalTabOpen(null),
defaultTabId: modalTabOpen
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 2, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(subtitle_default, { level: 3, children: (0,external_wp_i18n_namespaceObject.__)("Fonts") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
onClick: () => setModalTabOpen("installed-fonts"),
label: (0,external_wp_i18n_namespaceObject.__)("Manage fonts"),
icon: settings_default,
size: "small"
}
)
] }),
activeFonts.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { size: "large", isBordered: true, isSeparated: true, children: activeFonts.map((font) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
font_family_item_default,
{
font
},
font.slug
)) }) }),
!hasFonts && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { as: "p", children: hasInstalledFonts ? (0,external_wp_i18n_namespaceObject.__)("No fonts activated.") : (0,external_wp_i18n_namespaceObject.__)("No fonts installed.") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
className: "edit-site-global-styles-font-families__manage-fonts",
variant: "secondary",
__next40pxDefaultSize: true,
onClick: () => {
setModalTabOpen(
hasInstalledFonts ? "installed-fonts" : "upload-fonts"
);
},
children: hasInstalledFonts ? (0,external_wp_i18n_namespaceObject.__)("Manage fonts") : (0,external_wp_i18n_namespaceObject.__)("Add fonts")
}
)
] })
] })
] });
}
var font_families_default = ({ ...props }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(context_default, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FontFamilies, { ...props }) });
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-typography.js
function ScreenTypography() {
const fontLibraryEnabled = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_editor_namespaceObject.store).getEditorSettings().fontLibraryEnabled,
[]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
header_default,
{
title: (0,external_wp_i18n_namespaceObject.__)("Typography"),
description: (0,external_wp_i18n_namespaceObject.__)(
"Available fonts, typographic styles, and the application of those styles."
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-global-styles-screen", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 7, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TypographyVariations, { title: (0,external_wp_i18n_namespaceObject.__)("Typesets") }),
fontLibraryEnabled && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(font_families_default, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(typography_elements_default, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes_count_default, {})
] }) })
] });
}
var screen_typography_default = ScreenTypography;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/typography-panel.js
const {
useGlobalStyle: typography_panel_useGlobalStyle,
useGlobalSetting: typography_panel_useGlobalSetting,
useSettingsForBlockElement: typography_panel_useSettingsForBlockElement,
TypographyPanel: typography_panel_StylesTypographyPanel
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function TypographyPanel({ element, headingLevel }) {
let prefixParts = [];
if (element === "heading") {
prefixParts = prefixParts.concat(["elements", headingLevel]);
} else if (element && element !== "text") {
prefixParts = prefixParts.concat(["elements", element]);
}
const prefix = prefixParts.join(".");
const [style] = typography_panel_useGlobalStyle(prefix, void 0, "user", {
shouldDecodeEncode: false
});
const [inheritedStyle, setStyle] = typography_panel_useGlobalStyle(
prefix,
void 0,
"all",
{
shouldDecodeEncode: false
}
);
const [rawSettings] = typography_panel_useGlobalSetting("");
const usedElement = element === "heading" ? headingLevel : element;
const settings = typography_panel_useSettingsForBlockElement(
rawSettings,
void 0,
usedElement
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
typography_panel_StylesTypographyPanel,
{
inheritedValue: inheritedStyle,
value: style,
onChange: setStyle,
settings
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/typography-preview.js
const { useGlobalStyle: typography_preview_useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function TypographyPreview({ name, element, headingLevel }) {
let prefix = "";
if (element === "heading") {
prefix = `elements.${headingLevel}.`;
} else if (element && element !== "text") {
prefix = `elements.${element}.`;
}
const [fontFamily] = typography_preview_useGlobalStyle(
prefix + "typography.fontFamily",
name
);
const [gradientValue] = typography_preview_useGlobalStyle(prefix + "color.gradient", name);
const [backgroundColor] = typography_preview_useGlobalStyle(
prefix + "color.background",
name
);
const [fallbackBackgroundColor] = typography_preview_useGlobalStyle("color.background");
const [color] = typography_preview_useGlobalStyle(prefix + "color.text", name);
const [fontSize] = typography_preview_useGlobalStyle(prefix + "typography.fontSize", name);
const [fontStyle] = typography_preview_useGlobalStyle(
prefix + "typography.fontStyle",
name
);
const [fontWeight] = typography_preview_useGlobalStyle(
prefix + "typography.fontWeight",
name
);
const [letterSpacing] = typography_preview_useGlobalStyle(
prefix + "typography.letterSpacing",
name
);
const extraStyles = element === "link" ? {
textDecoration: "underline"
} : {};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "edit-site-typography-preview",
style: {
fontFamily: fontFamily ?? "serif",
background: gradientValue ?? backgroundColor ?? fallbackBackgroundColor,
color,
fontSize,
fontStyle,
fontWeight,
letterSpacing,
...extraStyles
},
children: "Aa"
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-typography-element.js
const screen_typography_element_elements = {
text: {
description: (0,external_wp_i18n_namespaceObject.__)("Manage the fonts used on the site."),
title: (0,external_wp_i18n_namespaceObject.__)("Text")
},
link: {
description: (0,external_wp_i18n_namespaceObject.__)("Manage the fonts and typography used on the links."),
title: (0,external_wp_i18n_namespaceObject.__)("Links")
},
heading: {
description: (0,external_wp_i18n_namespaceObject.__)("Manage the fonts and typography used on headings."),
title: (0,external_wp_i18n_namespaceObject.__)("Headings")
},
caption: {
description: (0,external_wp_i18n_namespaceObject.__)("Manage the fonts and typography used on captions."),
title: (0,external_wp_i18n_namespaceObject.__)("Captions")
},
button: {
description: (0,external_wp_i18n_namespaceObject.__)("Manage the fonts and typography used on buttons."),
title: (0,external_wp_i18n_namespaceObject.__)("Buttons")
}
};
function ScreenTypographyElement({ element }) {
const [headingLevel, setHeadingLevel] = (0,external_wp_element_.useState)("heading");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
header_default,
{
title: screen_typography_element_elements[element].title,
description: screen_typography_element_elements[element].description
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginX: 4, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
TypographyPreview,
{
element,
headingLevel
}
) }),
element === "heading" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginX: 4, marginBottom: "1em", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Select heading level"),
hideLabelFromVision: true,
value: headingLevel,
onChange: setHeadingLevel,
isBlock: true,
size: "__unstable-large",
__nextHasNoMarginBottom: true,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "heading",
showTooltip: true,
"aria-label": (0,external_wp_i18n_namespaceObject.__)("All headings"),
label: (0,external_wp_i18n_namespaceObject._x)("All", "heading levels")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "h1",
showTooltip: true,
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Heading 1"),
label: (0,external_wp_i18n_namespaceObject.__)("H1")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "h2",
showTooltip: true,
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Heading 2"),
label: (0,external_wp_i18n_namespaceObject.__)("H2")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "h3",
showTooltip: true,
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Heading 3"),
label: (0,external_wp_i18n_namespaceObject.__)("H3")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "h4",
showTooltip: true,
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Heading 4"),
label: (0,external_wp_i18n_namespaceObject.__)("H4")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "h5",
showTooltip: true,
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Heading 5"),
label: (0,external_wp_i18n_namespaceObject.__)("H5")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "h6",
showTooltip: true,
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Heading 6"),
label: (0,external_wp_i18n_namespaceObject.__)("H6")
}
)
]
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
TypographyPanel,
{
element,
headingLevel
}
)
] });
}
var screen_typography_element_default = ScreenTypographyElement;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-sizes/font-size-preview.js
const { useGlobalStyle: font_size_preview_useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function FontSizePreview({ fontSize }) {
const [font] = font_size_preview_useGlobalStyle("typography");
const input = fontSize?.fluid?.min && fontSize?.fluid?.max ? {
minimumFontSize: fontSize.fluid.min,
maximumFontSize: fontSize.fluid.max
} : {
fontSize: fontSize.size
};
const computedFontSize = (0,external_wp_blockEditor_namespaceObject.getComputedFluidTypographyValue)(input);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "edit-site-typography-preview",
style: {
fontSize: computedFontSize,
fontFamily: font?.fontFamily ?? "serif"
},
children: (0,external_wp_i18n_namespaceObject.__)("Aa")
}
);
}
var font_size_preview_default = FontSizePreview;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js
function ConfirmDeleteFontSizeDialog({
fontSize,
isOpen,
toggleOpen,
handleRemoveFontSize
}) {
const handleConfirm = async () => {
toggleOpen();
handleRemoveFontSize(fontSize);
};
const handleCancel = () => {
toggleOpen();
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalConfirmDialog,
{
isOpen,
cancelButtonText: (0,external_wp_i18n_namespaceObject.__)("Cancel"),
confirmButtonText: (0,external_wp_i18n_namespaceObject.__)("Delete"),
onCancel: handleCancel,
onConfirm: handleConfirm,
size: "medium",
children: fontSize && (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Name of the font size preset. */
(0,external_wp_i18n_namespaceObject.__)(
'Are you sure you want to delete "%s" font size preset?'
),
fontSize.name
)
}
);
}
var confirm_delete_font_size_dialog_default = ConfirmDeleteFontSizeDialog;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js
function RenameFontSizeDialog({ fontSize, toggleOpen, handleRename }) {
const [newName, setNewName] = (0,external_wp_element_.useState)(fontSize.name);
const handleConfirm = () => {
if (newName.trim()) {
handleRename(newName);
}
toggleOpen();
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
onRequestClose: toggleOpen,
focusOnMount: "firstContentElement",
title: (0,external_wp_i18n_namespaceObject.__)("Rename"),
size: "small",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"form",
{
onSubmit: (event) => {
event.preventDefault();
handleConfirm();
toggleOpen();
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "3", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalInputControl,
{
__next40pxDefaultSize: true,
autoComplete: "off",
value: newName,
onChange: setNewName,
label: (0,external_wp_i18n_namespaceObject.__)("Name"),
placeholder: (0,external_wp_i18n_namespaceObject.__)("Font size preset name")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: toggleOpen,
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "primary",
type: "submit",
children: (0,external_wp_i18n_namespaceObject.__)("Save")
}
)
] })
] })
}
)
}
);
}
var rename_font_size_dialog_default = RenameFontSizeDialog;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/size-control/index.js
const DEFAULT_UNITS = ["px", "em", "rem", "vw", "vh"];
function SizeControl({
// Do not allow manipulation of margin bottom
__nextHasNoMarginBottom,
...props
}) {
const { baseControlProps } = (0,external_wp_components_namespaceObject.useBaseControlProps)(props);
const { value, onChange, fallbackValue, disabled, label } = props;
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits: DEFAULT_UNITS
});
const [valueQuantity, valueUnit = "px"] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value, units);
const isValueUnitRelative = !!valueUnit && ["em", "rem", "vw", "vh"].includes(valueUnit);
const handleUnitControlChange = (newValue) => {
onChange(newValue);
};
const handleRangeControlChange = (newValue) => {
onChange?.(newValue + valueUnit);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl, { ...baseControlProps, __nextHasNoMarginBottom: true, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label,
hideLabelFromVision: true,
value,
onChange: handleUnitControlChange,
units,
min: 0,
disabled
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginX: 2, marginBottom: 0, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.RangeControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label,
hideLabelFromVision: true,
value: valueQuantity,
initialPosition: fallbackValue,
withInputField: false,
onChange: handleRangeControlChange,
min: 0,
max: isValueUnitRelative ? 10 : 100,
step: isValueUnitRelative ? 0.1 : 1,
disabled
}
) }) })
] }) });
}
var size_control_default = SizeControl;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-sizes/font-size.js
const { Menu } = unlock(external_wp_components_namespaceObject.privateApis);
const { useGlobalSetting: font_size_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function FontSize() {
const [isDeleteConfirmOpen, setIsDeleteConfirmOpen] = (0,external_wp_element_.useState)(false);
const [isRenameDialogOpen, setIsRenameDialogOpen] = (0,external_wp_element_.useState)(false);
const {
params: { origin, slug },
goBack
} = (0,external_wp_components_namespaceObject.useNavigator)();
const [fontSizes, setFontSizes] = font_size_useGlobalSetting(
"typography.fontSizes"
);
const [globalFluid] = font_size_useGlobalSetting("typography.fluid");
const sizes = fontSizes[origin] ?? [];
const fontSize = sizes.find((size) => size.slug === slug);
(0,external_wp_element_.useEffect)(() => {
if (!!slug && !fontSize) {
goBack();
}
}, [slug, fontSize, goBack]);
if (!origin || !slug || !fontSize) {
return null;
}
const isFluid = fontSize?.fluid !== void 0 ? !!fontSize.fluid : !!globalFluid;
const isCustomFluid = typeof fontSize?.fluid === "object";
const handleNameChange = (value) => {
updateFontSize("name", value);
};
const handleFontSizeChange = (value) => {
updateFontSize("size", value);
};
const handleFluidChange = (value) => {
updateFontSize("fluid", value);
};
const handleCustomFluidValues = (value) => {
if (value) {
updateFontSize("fluid", {
min: fontSize.size,
max: fontSize.size
});
} else {
updateFontSize("fluid", true);
}
};
const handleMinChange = (value) => {
updateFontSize("fluid", { ...fontSize.fluid, min: value });
};
const handleMaxChange = (value) => {
updateFontSize("fluid", { ...fontSize.fluid, max: value });
};
const updateFontSize = (key, value) => {
const newFontSizes = sizes.map((size) => {
if (size.slug === slug) {
return { ...size, [key]: value };
}
return size;
});
setFontSizes({
...fontSizes,
[origin]: newFontSizes
});
};
const handleRemoveFontSize = () => {
const newFontSizes = sizes.filter((size) => size.slug !== slug);
setFontSizes({
...fontSizes,
[origin]: newFontSizes
});
};
const toggleDeleteConfirm = () => {
setIsDeleteConfirmOpen(!isDeleteConfirmOpen);
};
const toggleRenameDialog = () => {
setIsRenameDialogOpen(!isRenameDialogOpen);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
confirm_delete_font_size_dialog_default,
{
fontSize,
isOpen: isDeleteConfirmOpen,
toggleOpen: toggleDeleteConfirm,
handleRemoveFontSize
}
),
isRenameDialogOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
rename_font_size_dialog_default,
{
fontSize,
toggleOpen: toggleRenameDialog,
handleRename: handleNameChange
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", align: "flex-start", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
header_default,
{
title: fontSize.name,
description: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: font size preset name. */
(0,external_wp_i18n_namespaceObject.__)("Manage the font size %s."),
fontSize.name
)
}
),
origin === "custom" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalSpacer,
{
marginTop: 3,
marginBottom: 0,
paddingX: 4,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Menu, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Menu.TriggerButton,
{
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "small",
icon: more_vertical_default,
label: (0,external_wp_i18n_namespaceObject.__)(
"Font size options"
)
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Menu.Popover, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Menu.Item,
{
onClick: toggleRenameDialog,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.ItemLabel, { children: (0,external_wp_i18n_namespaceObject.__)("Rename") })
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Menu.Item,
{
onClick: toggleDeleteConfirm,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.ItemLabel, { children: (0,external_wp_i18n_namespaceObject.__)("Delete") })
}
)
] })
] })
}
) })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalView, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalSpacer,
{
paddingX: 4,
marginBottom: 0,
paddingBottom: 6,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(font_size_preview_default, { fontSize }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
size_control_default,
{
label: (0,external_wp_i18n_namespaceObject.__)("Size"),
value: !isCustomFluid ? fontSize.size : "",
onChange: handleFontSizeChange,
disabled: isCustomFluid
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Fluid typography"),
help: (0,external_wp_i18n_namespaceObject.__)(
"Scale the font size dynamically to fit the screen or viewport."
),
checked: isFluid,
onChange: handleFluidChange,
__nextHasNoMarginBottom: true
}
),
isFluid && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Custom fluid values"),
help: (0,external_wp_i18n_namespaceObject.__)(
"Set custom min and max values for the fluid font size."
),
checked: isCustomFluid,
onChange: handleCustomFluidValues,
__nextHasNoMarginBottom: true
}
),
isCustomFluid && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
size_control_default,
{
label: (0,external_wp_i18n_namespaceObject.__)("Minimum"),
value: fontSize.fluid?.min,
onChange: handleMinChange
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
size_control_default,
{
label: (0,external_wp_i18n_namespaceObject.__)("Maximum"),
value: fontSize.fluid?.max,
onChange: handleMaxChange
}
)
] })
] })
}
) })
] })
] });
}
var font_size_default = FontSize;
;// ./node_modules/@wordpress/icons/build-module/library/plus.js
var plus_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) });
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js
function ConfirmResetFontSizesDialog({
text,
confirmButtonText,
isOpen,
toggleOpen,
onConfirm
}) {
const handleConfirm = async () => {
toggleOpen();
onConfirm();
};
const handleCancel = () => {
toggleOpen();
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalConfirmDialog,
{
isOpen,
cancelButtonText: (0,external_wp_i18n_namespaceObject.__)("Cancel"),
confirmButtonText,
onCancel: handleCancel,
onConfirm: handleConfirm,
size: "medium",
children: text
}
);
}
var confirm_reset_font_sizes_dialog_default = ConfirmResetFontSizesDialog;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-sizes/font-sizes.js
const { Menu: font_sizes_Menu } = unlock(external_wp_components_namespaceObject.privateApis);
const { useGlobalSetting: font_sizes_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function FontSizeGroup({
label,
origin,
sizes,
handleAddFontSize,
handleResetFontSizes
}) {
const [isResetDialogOpen, setIsResetDialogOpen] = (0,external_wp_element_.useState)(false);
const toggleResetDialog = () => setIsResetDialogOpen(!isResetDialogOpen);
const resetDialogText = origin === "custom" ? (0,external_wp_i18n_namespaceObject.__)(
"Are you sure you want to remove all custom font size presets?"
) : (0,external_wp_i18n_namespaceObject.__)(
"Are you sure you want to reset all font size presets to their default values?"
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
isResetDialogOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
confirm_reset_font_sizes_dialog_default,
{
text: resetDialogText,
confirmButtonText: origin === "custom" ? (0,external_wp_i18n_namespaceObject.__)("Remove") : (0,external_wp_i18n_namespaceObject.__)("Reset"),
isOpen: isResetDialogOpen,
toggleOpen: toggleResetDialog,
onConfirm: handleResetFontSizes
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(subtitle_default, { level: 3, children: label }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.FlexItem, { className: "edit-site-global-styles__typography-panel__options-container", children: [
origin === "custom" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
label: (0,external_wp_i18n_namespaceObject.__)("Add font size"),
icon: plus_default,
size: "small",
onClick: handleAddFontSize
}
),
!!handleResetFontSizes && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(font_sizes_Menu, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
font_sizes_Menu.TriggerButton,
{
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "small",
icon: more_vertical_default,
label: (0,external_wp_i18n_namespaceObject.__)(
"Font size presets options"
)
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes_Menu.Popover, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes_Menu.Item, { onClick: toggleResetDialog, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes_Menu.ItemLabel, { children: origin === "custom" ? (0,external_wp_i18n_namespaceObject.__)(
"Remove font size presets"
) : (0,external_wp_i18n_namespaceObject.__)(
"Reset font size presets"
) }) }) })
] })
] })
] }),
!!sizes.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { isBordered: true, isSeparated: true, children: sizes.map((size) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
NavigationButtonAsItem,
{
path: `/typography/font-sizes/${origin}/${size.slug}`,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { className: "edit-site-font-size__item", children: size.name }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { display: "flex", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
icon_default,
{
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_default : chevron_right_default
}
) })
] })
},
size.slug
)) })
] })
] });
}
function font_sizes_FontSizes() {
const [themeFontSizes, setThemeFontSizes] = font_sizes_useGlobalSetting(
"typography.fontSizes.theme"
);
const [baseThemeFontSizes] = font_sizes_useGlobalSetting(
"typography.fontSizes.theme",
null,
"base"
);
const [defaultFontSizes, setDefaultFontSizes] = font_sizes_useGlobalSetting(
"typography.fontSizes.default"
);
const [baseDefaultFontSizes] = font_sizes_useGlobalSetting(
"typography.fontSizes.default",
null,
"base"
);
const [customFontSizes = [], setCustomFontSizes] = font_sizes_useGlobalSetting(
"typography.fontSizes.custom"
);
const [defaultFontSizesEnabled] = font_sizes_useGlobalSetting(
"typography.defaultFontSizes"
);
const handleAddFontSize = () => {
const index = getNewIndexFromPresets(customFontSizes, "custom-");
const newFontSize = {
/* translators: %d: font size index */
name: (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("New Font Size %d"), index),
size: "16px",
slug: `custom-${index}`
};
setCustomFontSizes([...customFontSizes, newFontSize]);
};
const hasSameSizeValues = (arr1, arr2) => arr1.map((item) => item.size).join("") === arr2.map((item) => item.size).join("");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 2, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
header_default,
{
title: (0,external_wp_i18n_namespaceObject.__)("Font size presets"),
description: (0,external_wp_i18n_namespaceObject.__)(
"Create and edit the presets used for font sizes across the site."
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalView, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { paddingX: 4, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 8, children: [
!!themeFontSizes?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FontSizeGroup,
{
label: (0,external_wp_i18n_namespaceObject.__)("Theme"),
origin: "theme",
sizes: themeFontSizes,
baseSizes: baseThemeFontSizes,
handleAddFontSize,
handleResetFontSizes: hasSameSizeValues(
themeFontSizes,
baseThemeFontSizes
) ? null : () => setThemeFontSizes(
baseThemeFontSizes
)
}
),
defaultFontSizesEnabled && !!defaultFontSizes?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FontSizeGroup,
{
label: (0,external_wp_i18n_namespaceObject.__)("Default"),
origin: "default",
sizes: defaultFontSizes,
baseSizes: baseDefaultFontSizes,
handleAddFontSize,
handleResetFontSizes: hasSameSizeValues(
defaultFontSizes,
baseDefaultFontSizes
) ? null : () => setDefaultFontSizes(
baseDefaultFontSizes
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FontSizeGroup,
{
label: (0,external_wp_i18n_namespaceObject.__)("Custom"),
origin: "custom",
sizes: customFontSizes,
handleAddFontSize,
handleResetFontSizes: customFontSizes.length > 0 ? () => setCustomFontSizes([]) : null
}
)
] }) }) })
] });
}
var font_sizes_default = font_sizes_FontSizes;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/color-indicator-wrapper.js
function ColorIndicatorWrapper({ className, ...props }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Flex,
{
className: dist_clsx(
"edit-site-global-styles__color-indicator-wrapper",
className
),
...props
}
);
}
var color_indicator_wrapper_default = ColorIndicatorWrapper;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/palette.js
const { useGlobalSetting: palette_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const EMPTY_COLORS = [];
function Palette({ name }) {
const [customColors] = palette_useGlobalSetting("color.palette.custom");
const [themeColors] = palette_useGlobalSetting("color.palette.theme");
const [defaultColors] = palette_useGlobalSetting("color.palette.default");
const [defaultPaletteEnabled] = palette_useGlobalSetting(
"color.defaultPalette",
name
);
const colors = (0,external_wp_element_.useMemo)(
() => [
...customColors || EMPTY_COLORS,
...themeColors || EMPTY_COLORS,
...defaultColors && defaultPaletteEnabled ? defaultColors : EMPTY_COLORS
],
[customColors, themeColors, defaultColors, defaultPaletteEnabled]
);
const screenPath = !name ? "/colors/palette" : "/blocks/" + encodeURIComponent(name) + "/colors/palette";
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(subtitle_default, { level: 3, children: (0,external_wp_i18n_namespaceObject.__)("Palette") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { isBordered: true, isSeparated: true, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: screenPath, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { direction: "row", children: [
colors.length > 0 ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalZStack, { isLayered: false, offset: -8, children: colors.slice(0, 5).map(({ color }, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
color_indicator_wrapper_default,
{
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ColorIndicator,
{
colorValue: color
}
)
},
`${color}-${index}`
)) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, children: (0,external_wp_i18n_namespaceObject.__)("Edit palette") })
] }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: (0,external_wp_i18n_namespaceObject.__)("Add colors") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_default : chevron_right_default })
] }) }) })
] });
}
var palette_default = Palette;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-colors.js
const {
useGlobalStyle: screen_colors_useGlobalStyle,
useGlobalSetting: screen_colors_useGlobalSetting,
useSettingsForBlockElement: screen_colors_useSettingsForBlockElement,
ColorPanel: screen_colors_StylesColorPanel
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function ScreenColors() {
const [style] = screen_colors_useGlobalStyle("", void 0, "user", {
shouldDecodeEncode: false
});
const [inheritedStyle, setStyle] = screen_colors_useGlobalStyle("", void 0, "all", {
shouldDecodeEncode: false
});
const [rawSettings] = screen_colors_useGlobalSetting("");
const settings = screen_colors_useSettingsForBlockElement(rawSettings);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
header_default,
{
title: (0,external_wp_i18n_namespaceObject.__)("Colors"),
description: (0,external_wp_i18n_namespaceObject.__)(
"Palette colors and the application of those colors on site elements."
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-global-styles-screen", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 7, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(palette_default, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
screen_colors_StylesColorPanel,
{
inheritedValue: inheritedStyle,
value: style,
onChange: setStyle,
settings
}
)
] }) })
] });
}
var screen_colors_default = ScreenColors;
;// ./node_modules/@wordpress/icons/build-module/library/shuffle.js
var shuffle_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/SVG", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.192 6.75L15.47 5.03l1.06-1.06 3.537 3.53-3.537 3.53-1.06-1.06 1.723-1.72h-3.19c-.602 0-.993.202-1.28.498-.309.319-.538.792-.695 1.383-.13.488-.222 1.023-.296 1.508-.034.664-.116 1.413-.303 2.117-.193.721-.513 1.467-1.068 2.04-.575.594-1.359.954-2.357.954H4v-1.5h4.003c.601 0 .993-.202 1.28-.498.308-.319.538-.792.695-1.383.149-.557.216-1.093.288-1.662l.039-.31a9.653 9.653 0 0 1 .272-1.653c.193-.722.513-1.467 1.067-2.04.576-.594 1.36-.954 2.358-.954h3.19zM8.004 6.75c.8 0 1.46.23 1.988.628a6.24 6.24 0 0 0-.684 1.396 1.725 1.725 0 0 0-.024-.026c-.287-.296-.679-.498-1.28-.498H4v-1.5h4.003zM12.699 14.726c-.161.459-.38.94-.684 1.396.527.397 1.188.628 1.988.628h3.19l-1.722 1.72 1.06 1.06L20.067 16l-3.537-3.53-1.06 1.06 1.723 1.72h-3.19c-.602 0-.993-.202-1.28-.498a1.96 1.96 0 0 1-.024-.026z" }) });
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preset-colors.js
function PresetColors() {
const { paletteColors } = useStylesPreviewColors();
return paletteColors.slice(0, 4).map(({ slug, color }, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
style: {
flexGrow: 1,
height: "100%",
background: color
}
},
`${slug}-${index}`
));
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview-colors.js
const preview_colors_firstFrameVariants = {
start: {
scale: 1,
opacity: 1
},
hover: {
scale: 0,
opacity: 0
}
};
const StylesPreviewColors = ({ label, isFocused, withHoverView }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PreviewWrapper,
{
label,
isFocused,
withHoverView,
children: ({ key }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
variants: preview_colors_firstFrameVariants,
style: {
height: "100%",
overflow: "hidden"
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHStack,
{
spacing: 0,
justify: "center",
style: {
height: "100%",
overflow: "hidden"
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PresetColors, {})
}
)
},
key
)
}
);
};
var preview_colors_default = StylesPreviewColors;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/variations/variations-color.js
function ColorVariations({ title, gap = 2 }) {
const propertiesToFilter = ["color"];
const colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig(propertiesToFilter);
if (colorVariations?.length <= 1) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, children: [
title && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(subtitle_default, { level: 3, children: title }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalGrid, { spacing: gap, children: colorVariations.map((variation, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Variation,
{
variation,
isPill: true,
properties: propertiesToFilter,
showTooltip: true,
children: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(preview_colors_default, {})
},
index
)) })
] });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/color-palette-panel.js
const { useGlobalSetting: color_palette_panel_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const mobilePopoverProps = { placement: "bottom-start", offset: 8 };
function ColorPalettePanel({ name }) {
const [themeColors, setThemeColors] = color_palette_panel_useGlobalSetting(
"color.palette.theme",
name
);
const [baseThemeColors] = color_palette_panel_useGlobalSetting(
"color.palette.theme",
name,
"base"
);
const [defaultColors, setDefaultColors] = color_palette_panel_useGlobalSetting(
"color.palette.default",
name
);
const [baseDefaultColors] = color_palette_panel_useGlobalSetting(
"color.palette.default",
name,
"base"
);
const [customColors, setCustomColors] = color_palette_panel_useGlobalSetting(
"color.palette.custom",
name
);
const [defaultPaletteEnabled] = color_palette_panel_useGlobalSetting(
"color.defaultPalette",
name
);
const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("small", "<");
const popoverProps = isMobileViewport ? mobilePopoverProps : void 0;
const [randomizeThemeColors] = useColorRandomizer();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
className: "edit-site-global-styles-color-palette-panel",
spacing: 8,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
!!themeColors && !!themeColors.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalPaletteEdit,
{
canReset: themeColors !== baseThemeColors,
canOnlyChangeValues: true,
colors: themeColors,
onChange: setThemeColors,
paletteLabel: (0,external_wp_i18n_namespaceObject.__)("Theme"),
paletteLabelHeadingLevel: 3,
popoverProps
}
),
window.__experimentalEnableColorRandomizer && themeColors?.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "secondary",
icon: shuffle_default,
onClick: randomizeThemeColors,
children: (0,external_wp_i18n_namespaceObject.__)("Randomize colors")
}
)
] }),
!!defaultColors && !!defaultColors.length && !!defaultPaletteEnabled && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalPaletteEdit,
{
canReset: defaultColors !== baseDefaultColors,
canOnlyChangeValues: true,
colors: defaultColors,
onChange: setDefaultColors,
paletteLabel: (0,external_wp_i18n_namespaceObject.__)("Default"),
paletteLabelHeadingLevel: 3,
popoverProps
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalPaletteEdit,
{
colors: customColors,
onChange: setCustomColors,
paletteLabel: (0,external_wp_i18n_namespaceObject.__)("Custom"),
paletteLabelHeadingLevel: 3,
slugPrefix: "custom-",
popoverProps
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorVariations, { title: (0,external_wp_i18n_namespaceObject.__)("Palettes") })
]
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/gradients-palette-panel.js
const { useGlobalSetting: gradients_palette_panel_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const gradients_palette_panel_mobilePopoverProps = { placement: "bottom-start", offset: 8 };
const noop = () => {
};
function GradientPalettePanel({ name }) {
const [themeGradients, setThemeGradients] = gradients_palette_panel_useGlobalSetting(
"color.gradients.theme",
name
);
const [baseThemeGradients] = gradients_palette_panel_useGlobalSetting(
"color.gradients.theme",
name,
"base"
);
const [defaultGradients, setDefaultGradients] = gradients_palette_panel_useGlobalSetting(
"color.gradients.default",
name
);
const [baseDefaultGradients] = gradients_palette_panel_useGlobalSetting(
"color.gradients.default",
name,
"base"
);
const [customGradients, setCustomGradients] = gradients_palette_panel_useGlobalSetting(
"color.gradients.custom",
name
);
const [defaultPaletteEnabled] = gradients_palette_panel_useGlobalSetting(
"color.defaultGradients",
name
);
const [customDuotone] = gradients_palette_panel_useGlobalSetting("color.duotone.custom") || [];
const [defaultDuotone] = gradients_palette_panel_useGlobalSetting("color.duotone.default") || [];
const [themeDuotone] = gradients_palette_panel_useGlobalSetting("color.duotone.theme") || [];
const [defaultDuotoneEnabled] = gradients_palette_panel_useGlobalSetting(
"color.defaultDuotone"
);
const duotonePalette = [
...customDuotone || [],
...themeDuotone || [],
...defaultDuotone && defaultDuotoneEnabled ? defaultDuotone : []
];
const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("small", "<");
const popoverProps = isMobileViewport ? gradients_palette_panel_mobilePopoverProps : void 0;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
className: "edit-site-global-styles-gradient-palette-panel",
spacing: 8,
children: [
!!themeGradients && !!themeGradients.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalPaletteEdit,
{
canReset: themeGradients !== baseThemeGradients,
canOnlyChangeValues: true,
gradients: themeGradients,
onChange: setThemeGradients,
paletteLabel: (0,external_wp_i18n_namespaceObject.__)("Theme"),
paletteLabelHeadingLevel: 3,
popoverProps
}
),
!!defaultGradients && !!defaultGradients.length && !!defaultPaletteEnabled && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalPaletteEdit,
{
canReset: defaultGradients !== baseDefaultGradients,
canOnlyChangeValues: true,
gradients: defaultGradients,
onChange: setDefaultGradients,
paletteLabel: (0,external_wp_i18n_namespaceObject.__)("Default"),
paletteLabelLevel: 3,
popoverProps
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalPaletteEdit,
{
gradients: customGradients,
onChange: setCustomGradients,
paletteLabel: (0,external_wp_i18n_namespaceObject.__)("Custom"),
paletteLabelLevel: 3,
slugPrefix: "custom-",
popoverProps
}
),
!!duotonePalette && !!duotonePalette.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(subtitle_default, { level: 3, children: (0,external_wp_i18n_namespaceObject.__)("Duotone") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 3 }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DuotonePicker,
{
duotonePalette,
disableCustomDuotone: true,
disableCustomColors: true,
clearable: false,
onChange: noop
}
)
] })
]
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-color-palette.js
const { Tabs: screen_color_palette_Tabs } = unlock(external_wp_components_namespaceObject.privateApis);
function ScreenColorPalette({ name }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
header_default,
{
title: (0,external_wp_i18n_namespaceObject.__)("Edit palette"),
description: (0,external_wp_i18n_namespaceObject.__)(
"The combination of colors used across the site and in color pickers."
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(screen_color_palette_Tabs, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(screen_color_palette_Tabs.TabList, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_color_palette_Tabs.Tab, { tabId: "color", children: (0,external_wp_i18n_namespaceObject.__)("Color") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_color_palette_Tabs.Tab, { tabId: "gradient", children: (0,external_wp_i18n_namespaceObject.__)("Gradient") })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_color_palette_Tabs.TabPanel, { tabId: "color", focusable: false, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorPalettePanel, { name }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_color_palette_Tabs.TabPanel, { tabId: "gradient", focusable: false, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GradientPalettePanel, { name }) })
] })
] });
}
var screen_color_palette_default = ScreenColorPalette;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/background-panel.js
const BACKGROUND_DEFAULT_VALUES = {
backgroundSize: "auto"
};
const {
useGlobalStyle: background_panel_useGlobalStyle,
useGlobalSetting: background_panel_useGlobalSetting,
BackgroundPanel: background_panel_StylesBackgroundPanel
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function hasBackgroundImageValue(style) {
return !!style?.background?.backgroundImage?.id || !!style?.background?.backgroundImage?.url || typeof style?.background?.backgroundImage === "string";
}
function BackgroundPanel() {
const [style] = background_panel_useGlobalStyle("", void 0, "user", {
shouldDecodeEncode: false
});
const [inheritedStyle, setStyle] = background_panel_useGlobalStyle("", void 0, "all", {
shouldDecodeEncode: false
});
const [settings] = background_panel_useGlobalSetting("");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
background_panel_StylesBackgroundPanel,
{
inheritedValue: inheritedStyle,
value: style,
onChange: setStyle,
settings,
defaultValues: BACKGROUND_DEFAULT_VALUES
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-background.js
const { useHasBackgroundPanel: screen_background_useHasBackgroundPanel, useGlobalSetting: screen_background_useGlobalSetting } = unlock(
external_wp_blockEditor_namespaceObject.privateApis
);
function ScreenBackground() {
const [settings] = screen_background_useGlobalSetting("");
const hasBackgroundPanel = screen_background_useHasBackgroundPanel(settings);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
header_default,
{
title: (0,external_wp_i18n_namespaceObject.__)("Background"),
description: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)("Set styles for the site\u2019s background.") })
}
),
hasBackgroundPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BackgroundPanel, {})
] });
}
var screen_background_default = ScreenBackground;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/confirm-reset-shadow-dialog.js
function ConfirmResetShadowDialog({
text,
confirmButtonText,
isOpen,
toggleOpen,
onConfirm
}) {
const handleConfirm = async () => {
toggleOpen();
onConfirm();
};
const handleCancel = () => {
toggleOpen();
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalConfirmDialog,
{
isOpen,
cancelButtonText: (0,external_wp_i18n_namespaceObject.__)("Cancel"),
confirmButtonText,
onCancel: handleCancel,
onConfirm: handleConfirm,
size: "medium",
children: text
}
);
}
var confirm_reset_shadow_dialog_default = ConfirmResetShadowDialog;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/shadows-panel.js
const { useGlobalSetting: shadows_panel_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const { Menu: shadows_panel_Menu } = unlock(external_wp_components_namespaceObject.privateApis);
const defaultShadow = "6px 6px 9px rgba(0, 0, 0, 0.2)";
function ShadowsPanel() {
const [defaultShadows] = shadows_panel_useGlobalSetting("shadow.presets.default");
const [defaultShadowsEnabled] = shadows_panel_useGlobalSetting(
"shadow.defaultPresets"
);
const [themeShadows] = shadows_panel_useGlobalSetting("shadow.presets.theme");
const [customShadows, setCustomShadows] = shadows_panel_useGlobalSetting(
"shadow.presets.custom"
);
const onCreateShadow = (shadow) => {
setCustomShadows([...customShadows || [], shadow]);
};
const handleResetShadows = () => {
setCustomShadows([]);
};
const [isResetDialogOpen, setIsResetDialogOpen] = (0,external_wp_element_.useState)(false);
const toggleResetDialog = () => setIsResetDialogOpen(!isResetDialogOpen);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
isResetDialogOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
confirm_reset_shadow_dialog_default,
{
text: (0,external_wp_i18n_namespaceObject.__)(
"Are you sure you want to remove all custom shadows?"
),
confirmButtonText: (0,external_wp_i18n_namespaceObject.__)("Remove"),
isOpen: isResetDialogOpen,
toggleOpen: toggleResetDialog,
onConfirm: handleResetShadows
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
header_default,
{
title: (0,external_wp_i18n_namespaceObject.__)("Shadows"),
description: (0,external_wp_i18n_namespaceObject.__)(
"Manage and create shadow styles for use across the site."
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-global-styles-screen", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
className: "edit-site-global-styles__shadows-panel",
spacing: 7,
children: [
defaultShadowsEnabled && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ShadowList,
{
label: (0,external_wp_i18n_namespaceObject.__)("Default"),
shadows: defaultShadows || [],
category: "default"
}
),
themeShadows && themeShadows.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ShadowList,
{
label: (0,external_wp_i18n_namespaceObject.__)("Theme"),
shadows: themeShadows || [],
category: "theme"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ShadowList,
{
label: (0,external_wp_i18n_namespaceObject.__)("Custom"),
shadows: customShadows || [],
category: "custom",
canCreate: true,
onCreate: onCreateShadow,
onReset: toggleResetDialog
}
)
]
}
) })
] });
}
function ShadowList({
label,
shadows,
category,
canCreate,
onCreate,
onReset
}) {
const handleAddShadow = () => {
const newIndex = getNewIndexFromPresets(shadows, "shadow-");
onCreate({
name: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: is an index for a preset */
(0,external_wp_i18n_namespaceObject.__)("Shadow %s"),
newIndex
),
shadow: defaultShadow,
slug: `shadow-${newIndex}`
});
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 2, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(subtitle_default, { level: 3, children: label }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.FlexItem, { className: "edit-site-global-styles__shadows-panel__options-container", children: [
canCreate && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "small",
icon: plus_default,
label: (0,external_wp_i18n_namespaceObject.__)("Add shadow"),
onClick: () => {
handleAddShadow();
}
}
),
!!shadows?.length && category === "custom" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(shadows_panel_Menu, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
shadows_panel_Menu.TriggerButton,
{
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "small",
icon: more_vertical_default,
label: (0,external_wp_i18n_namespaceObject.__)("Shadow options")
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_panel_Menu.Popover, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_panel_Menu.Item, { onClick: onReset, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_panel_Menu.ItemLabel, { children: (0,external_wp_i18n_namespaceObject.__)("Remove all custom shadows") }) }) })
] })
] })
] }),
shadows.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { isBordered: true, isSeparated: true, children: shadows.map((shadow) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ShadowItem,
{
shadow,
category
},
shadow.slug
)) })
] });
}
function ShadowItem({ shadow, category }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
NavigationButtonAsItem,
{
path: `/shadows/edit/${category}/${shadow.slug}`,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: shadow.name }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_default : chevron_right_default })
] })
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/reset.js
var reset_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7 11.5h10V13H7z" }) });
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/shadow-utils.js
const CUSTOM_VALUE_SETTINGS = {
px: { max: 20, step: 1 },
"%": { max: 100, step: 1 },
vw: { max: 100, step: 1 },
vh: { max: 100, step: 1 },
em: { max: 10, step: 0.1 },
rm: { max: 10, step: 0.1 },
svw: { max: 100, step: 1 },
lvw: { max: 100, step: 1 },
dvw: { max: 100, step: 1 },
svh: { max: 100, step: 1 },
lvh: { max: 100, step: 1 },
dvh: { max: 100, step: 1 },
vi: { max: 100, step: 1 },
svi: { max: 100, step: 1 },
lvi: { max: 100, step: 1 },
dvi: { max: 100, step: 1 },
vb: { max: 100, step: 1 },
svb: { max: 100, step: 1 },
lvb: { max: 100, step: 1 },
dvb: { max: 100, step: 1 },
vmin: { max: 100, step: 1 },
svmin: { max: 100, step: 1 },
lvmin: { max: 100, step: 1 },
dvmin: { max: 100, step: 1 },
vmax: { max: 100, step: 1 },
svmax: { max: 100, step: 1 },
lvmax: { max: 100, step: 1 },
dvmax: { max: 100, step: 1 }
};
function getShadowParts(shadow) {
const shadowValues = shadow.match(/(?:[^,(]|\([^)]*\))+/g) || [];
return shadowValues.map((value) => value.trim());
}
function shadowStringToObject(shadowValue) {
const defaultShadow = {
x: "0",
y: "0",
blur: "0",
spread: "0",
color: "#000",
inset: false
};
if (!shadowValue) {
return defaultShadow;
}
if (shadowValue.includes("none")) {
return defaultShadow;
}
const lengthsRegex = /((?:^|\s+)(-?\d*\.?\d+(?:px|%|in|cm|mm|em|rem|ex|pt|pc|vh|vw|vmin|vmax|ch|lh)?)(?=\s|$)(?![^(]*\))){1,4}/g;
const matches = shadowValue.match(lengthsRegex) || [];
if (matches.length !== 1) {
return defaultShadow;
}
const lengths = matches[0].split(" ").map((value) => value.trim()).filter((value) => value);
if (lengths.length < 2) {
return defaultShadow;
}
const insets = shadowValue.match(/inset/gi) || [];
if (insets.length > 1) {
return defaultShadow;
}
const hasInset = insets.length === 1;
let colorString = shadowValue.replace(lengthsRegex, "").trim();
if (hasInset) {
colorString = colorString.replace("inset", "").replace("INSET", "").trim();
}
const colorRegex = /^#([0-9a-f]{3}){1,2}$|^#([0-9a-f]{4}){1,2}$|^(?:rgb|hsl)a?\(?[\d*\.?\d+%?,?\/?\s]*\)$/gi;
let colorMatches = (colorString.match(colorRegex) || []).map((value) => value?.trim()).filter((value) => value);
if (colorMatches.length > 1) {
return defaultShadow;
} else if (colorMatches.length === 0) {
colorMatches = colorString.trim().split(" ").filter((value) => value);
if (colorMatches.length > 1) {
return defaultShadow;
}
}
const [x, y, blur, spread] = lengths;
return {
x,
y,
blur: blur || defaultShadow.blur,
spread: spread || defaultShadow.spread,
inset: hasInset,
color: colorString || defaultShadow.color
};
}
function shadowObjectToString(shadowObj) {
const shadowString = `${shadowObj.x || "0px"} ${shadowObj.y || "0px"} ${shadowObj.blur || "0px"} ${shadowObj.spread || "0px"}`;
return `${shadowObj.inset ? "inset" : ""} ${shadowString} ${shadowObj.color || ""}`.trim();
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/shadows-edit-panel.js
const { useGlobalSetting: shadows_edit_panel_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const { Menu: shadows_edit_panel_Menu } = unlock(external_wp_components_namespaceObject.privateApis);
const customShadowMenuItems = [
{
label: (0,external_wp_i18n_namespaceObject.__)("Rename"),
action: "rename"
},
{
label: (0,external_wp_i18n_namespaceObject.__)("Delete"),
action: "delete"
}
];
const presetShadowMenuItems = [
{
label: (0,external_wp_i18n_namespaceObject.__)("Reset"),
action: "reset"
}
];
function ShadowsEditPanel() {
const {
goBack,
params: { category, slug }
} = (0,external_wp_components_namespaceObject.useNavigator)();
const [shadows, setShadows] = shadows_edit_panel_useGlobalSetting(
`shadow.presets.${category}`
);
(0,external_wp_element_.useEffect)(() => {
const hasCurrentShadow = shadows?.some(
(shadow) => shadow.slug === slug
);
if (!!slug && !hasCurrentShadow) {
goBack();
}
}, [shadows, slug, goBack]);
const [baseShadows] = shadows_edit_panel_useGlobalSetting(
`shadow.presets.${category}`,
void 0,
"base"
);
const [selectedShadow, setSelectedShadow] = (0,external_wp_element_.useState)(
() => (shadows || []).find((shadow) => shadow.slug === slug)
);
const baseSelectedShadow = (0,external_wp_element_.useMemo)(
() => (baseShadows || []).find((b) => b.slug === slug),
[baseShadows, slug]
);
const [isConfirmDialogVisible, setIsConfirmDialogVisible] = (0,external_wp_element_.useState)(false);
const [isRenameModalVisible, setIsRenameModalVisible] = (0,external_wp_element_.useState)(false);
const [shadowName, setShadowName] = (0,external_wp_element_.useState)(selectedShadow.name);
if (!category || !slug) {
return null;
}
const onShadowChange = (shadow) => {
setSelectedShadow({ ...selectedShadow, shadow });
const updatedShadows = shadows.map(
(s) => s.slug === slug ? { ...selectedShadow, shadow } : s
);
setShadows(updatedShadows);
};
const onMenuClick = (action) => {
if (action === "reset") {
const updatedShadows = shadows.map(
(s) => s.slug === slug ? baseSelectedShadow : s
);
setSelectedShadow(baseSelectedShadow);
setShadows(updatedShadows);
} else if (action === "delete") {
setIsConfirmDialogVisible(true);
} else if (action === "rename") {
setIsRenameModalVisible(true);
}
};
const handleShadowDelete = () => {
setShadows(shadows.filter((s) => s.slug !== slug));
};
const handleShadowRename = (newName) => {
if (!newName) {
return;
}
const updatedShadows = shadows.map(
(s) => s.slug === slug ? { ...selectedShadow, name: newName } : s
);
setSelectedShadow({ ...selectedShadow, name: newName });
setShadows(updatedShadows);
};
return !selectedShadow ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(header_default, { title: "" }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(header_default, { title: selectedShadow.name }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginTop: 2, marginBottom: 0, paddingX: 4, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(shadows_edit_panel_Menu, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
shadows_edit_panel_Menu.TriggerButton,
{
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "small",
icon: more_vertical_default,
label: (0,external_wp_i18n_namespaceObject.__)("Menu")
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_edit_panel_Menu.Popover, { children: (category === "custom" ? customShadowMenuItems : presetShadowMenuItems).map((item) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
shadows_edit_panel_Menu.Item,
{
onClick: () => onMenuClick(item.action),
disabled: item.action === "reset" && selectedShadow.shadow === baseSelectedShadow.shadow,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_edit_panel_Menu.ItemLabel, { children: item.label })
},
item.action
)) })
] }) }) })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-site-global-styles-screen", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowsPreview, { shadow: selectedShadow.shadow }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ShadowEditor,
{
shadow: selectedShadow.shadow,
onChange: onShadowChange
}
)
] }),
isConfirmDialogVisible && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalConfirmDialog,
{
isOpen: true,
onConfirm: () => {
handleShadowDelete();
setIsConfirmDialogVisible(false);
},
onCancel: () => {
setIsConfirmDialogVisible(false);
},
confirmButtonText: (0,external_wp_i18n_namespaceObject.__)("Delete"),
size: "medium",
children: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Name of the shadow preset. */
(0,external_wp_i18n_namespaceObject.__)(
'Are you sure you want to delete "%s" shadow preset?'
),
selectedShadow.name
)
}
),
isRenameModalVisible && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
title: (0,external_wp_i18n_namespaceObject.__)("Rename"),
onRequestClose: () => setIsRenameModalVisible(false),
size: "small",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"form",
{
onSubmit: (event) => {
event.preventDefault();
handleShadowRename(shadowName);
setIsRenameModalVisible(false);
},
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalInputControl,
{
__next40pxDefaultSize: true,
autoComplete: "off",
label: (0,external_wp_i18n_namespaceObject.__)("Name"),
placeholder: (0,external_wp_i18n_namespaceObject.__)("Shadow name"),
value: shadowName,
onChange: (value) => setShadowName(value)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginBottom: 6 }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Flex,
{
className: "block-editor-shadow-edit-modal__actions",
justify: "flex-end",
expanded: false,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: () => setIsRenameModalVisible(false),
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "primary",
type: "submit",
children: (0,external_wp_i18n_namespaceObject.__)("Save")
}
) })
]
}
)
]
}
)
}
)
] });
}
function ShadowsPreview({ shadow }) {
const shadowStyle = {
boxShadow: shadow
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginBottom: 4, marginTop: -2, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHStack,
{
align: "center",
justify: "center",
className: "edit-site-global-styles__shadow-preview-panel",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "edit-site-global-styles__shadow-preview-block",
style: shadowStyle
}
)
}
) });
}
function ShadowEditor({ shadow, onChange }) {
const addShadowButtonRef = (0,external_wp_element_.useRef)();
const shadowParts = (0,external_wp_element_.useMemo)(() => getShadowParts(shadow), [shadow]);
const onChangeShadowPart = (index, part) => {
const newShadowParts = [...shadowParts];
newShadowParts[index] = part;
onChange(newShadowParts.join(", "));
};
const onAddShadowPart = () => {
onChange([...shadowParts, defaultShadow].join(", "));
};
const onRemoveShadowPart = (index) => {
onChange(shadowParts.filter((p, i) => i !== index).join(", "));
addShadowButtonRef.current.focus();
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 2, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(subtitle_default, { level: 3, children: (0,external_wp_i18n_namespaceObject.__)("Shadows") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { className: "edit-site-global-styles__shadows-panel__options-container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "small",
icon: plus_default,
label: (0,external_wp_i18n_namespaceObject.__)("Add shadow"),
onClick: () => {
onAddShadowPart();
},
ref: addShadowButtonRef
}
) })
] }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { isBordered: true, isSeparated: true, children: shadowParts.map((part, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
shadows_edit_panel_ShadowItem,
{
shadow: part,
onChange: (value) => onChangeShadowPart(index, value),
canRemove: shadowParts.length > 1,
onRemove: () => onRemoveShadowPart(index)
},
index
)) })
] });
}
function shadows_edit_panel_ShadowItem({ shadow, onChange, canRemove, onRemove }) {
const popoverProps = {
placement: "left-start",
offset: 36,
shift: true
};
const shadowObj = (0,external_wp_element_.useMemo)(
() => shadowStringToObject(shadow),
[shadow]
);
const onShadowChange = (newShadow) => {
onChange(shadowObjectToString(newShadow));
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
popoverProps,
className: "edit-site-global-styles__shadow-editor__dropdown",
renderToggle: ({ onToggle, isOpen }) => {
const toggleProps = {
onClick: onToggle,
className: dist_clsx(
"edit-site-global-styles__shadow-editor__dropdown-toggle",
{ "is-open": isOpen }
),
"aria-expanded": isOpen
};
const removeButtonProps = {
onClick: () => {
if (isOpen) {
onToggle();
}
onRemove();
},
className: dist_clsx(
"edit-site-global-styles__shadow-editor__remove-button",
{ "is-open": isOpen }
),
label: (0,external_wp_i18n_namespaceObject.__)("Remove shadow")
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
icon: shadow_default,
...toggleProps,
children: shadowObj.inset ? (0,external_wp_i18n_namespaceObject.__)("Inner shadow") : (0,external_wp_i18n_namespaceObject.__)("Drop shadow")
}
),
canRemove && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "small",
icon: reset_default,
...removeButtonProps
}
)
] });
},
renderContent: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalDropdownContentWrapper,
{
paddingSize: "medium",
className: "edit-site-global-styles__shadow-editor__dropdown-content",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ShadowPopover,
{
shadowObj,
onChange: onShadowChange
}
)
}
)
}
);
}
function ShadowPopover({ shadowObj, onChange }) {
const __experimentalIsRenderedInSidebar = true;
const enableAlpha = true;
const onShadowChange = (key, value) => {
const newShadow = {
...shadowObj,
[key]: value
};
onChange(newShadow);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
spacing: 4,
className: "edit-site-global-styles__shadow-editor-panel",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ColorPalette,
{
clearable: false,
enableAlpha,
__experimentalIsRenderedInSidebar,
value: shadowObj.color,
onChange: (value) => onShadowChange("color", value)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
__nextHasNoMarginBottom: true,
value: shadowObj.inset ? "inset" : "outset",
isBlock: true,
onChange: (value) => onShadowChange("inset", value === "inset"),
hideLabelFromVision: true,
__next40pxDefaultSize: true,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "outset",
label: (0,external_wp_i18n_namespaceObject.__)("Outset")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "inset",
label: (0,external_wp_i18n_namespaceObject.__)("Inset")
}
)
]
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalGrid, { columns: 2, gap: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ShadowInputControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("X Position"),
value: shadowObj.x,
onChange: (value) => onShadowChange("x", value)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ShadowInputControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Y Position"),
value: shadowObj.y,
onChange: (value) => onShadowChange("y", value)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ShadowInputControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Blur"),
value: shadowObj.blur,
onChange: (value) => onShadowChange("blur", value)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ShadowInputControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Spread"),
value: shadowObj.spread,
onChange: (value) => onShadowChange("spread", value)
}
)
] })
]
}
);
}
function ShadowInputControl({ label, value, onChange }) {
const onValueChange = (next) => {
const isNumeric = next !== void 0 && !isNaN(parseFloat(next));
const nextValue = isNumeric ? next : "0px";
onChange(nextValue);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
label,
__next40pxDefaultSize: true,
value,
onChange: onValueChange
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-shadows.js
function ScreenShadows() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowsPanel, {});
}
function ScreenShadowsEdit() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowsEditPanel, {});
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/dimensions-panel.js
const {
useGlobalStyle: dimensions_panel_useGlobalStyle,
useGlobalSetting: dimensions_panel_useGlobalSetting,
useSettingsForBlockElement: dimensions_panel_useSettingsForBlockElement,
DimensionsPanel: dimensions_panel_StylesDimensionsPanel
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const DEFAULT_CONTROLS = {
contentSize: true,
wideSize: true,
padding: true,
margin: true,
blockGap: true,
minHeight: true,
childLayout: false
};
function DimensionsPanel() {
const [style] = dimensions_panel_useGlobalStyle("", void 0, "user", {
shouldDecodeEncode: false
});
const [inheritedStyle, setStyle] = dimensions_panel_useGlobalStyle("", void 0, "all", {
shouldDecodeEncode: false
});
const [userSettings] = dimensions_panel_useGlobalSetting("", void 0, "user");
const [rawSettings, setSettings] = dimensions_panel_useGlobalSetting("");
const settings = dimensions_panel_useSettingsForBlockElement(rawSettings);
const inheritedStyleWithLayout = (0,external_wp_element_.useMemo)(() => {
return {
...inheritedStyle,
layout: settings.layout
};
}, [inheritedStyle, settings.layout]);
const styleWithLayout = (0,external_wp_element_.useMemo)(() => {
return {
...style,
layout: userSettings.layout
};
}, [style, userSettings.layout]);
const onChange = (newStyle) => {
const updatedStyle = { ...newStyle };
delete updatedStyle.layout;
setStyle(updatedStyle);
if (newStyle.layout !== userSettings.layout) {
const updatedSettings = {
...userSettings,
layout: newStyle.layout
};
if (updatedSettings.layout?.definitions) {
delete updatedSettings.layout.definitions;
}
setSettings(updatedSettings);
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
dimensions_panel_StylesDimensionsPanel,
{
inheritedValue: inheritedStyleWithLayout,
value: styleWithLayout,
onChange,
settings,
includeLayoutControls: true,
defaultControls: DEFAULT_CONTROLS
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-layout.js
const { useHasDimensionsPanel: screen_layout_useHasDimensionsPanel, useGlobalSetting: screen_layout_useGlobalSetting, useSettingsForBlockElement: screen_layout_useSettingsForBlockElement } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function ScreenLayout() {
const [rawSettings] = screen_layout_useGlobalSetting("");
const settings = screen_layout_useSettingsForBlockElement(rawSettings);
const hasDimensionsPanel = screen_layout_useHasDimensionsPanel(settings);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(header_default, { title: (0,external_wp_i18n_namespaceObject.__)("Layout") }),
hasDimensionsPanel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DimensionsPanel, {})
] });
}
var screen_layout_default = ScreenLayout;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/style-variations-container.js
const { GlobalStylesContext: style_variations_container_GlobalStylesContext } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function StyleVariationsContainer({ gap = 2 }) {
const { user } = (0,external_wp_element_.useContext)(style_variations_container_GlobalStylesContext);
const userStyles = user?.styles;
const variations = (0,external_wp_data_.useSelect)((select) => {
return select(
external_wp_coreData_namespaceObject.store
).__experimentalGetCurrentThemeGlobalStylesVariations();
}, []);
const fullStyleVariations = variations?.filter((variation) => {
return !isVariationWithProperties(variation, ["color"]) && !isVariationWithProperties(variation, [
"typography",
"spacing"
]);
});
const themeVariations = (0,external_wp_element_.useMemo)(() => {
const withEmptyVariation = [
{
title: (0,external_wp_i18n_namespaceObject.__)("Default"),
settings: {},
styles: {}
},
...fullStyleVariations ?? []
];
return [
...withEmptyVariation.map((variation) => {
const blockStyles = { ...variation?.styles?.blocks };
if (userStyles?.blocks) {
Object.keys(userStyles.blocks).forEach((blockName) => {
if (userStyles.blocks[blockName].css) {
const variationBlockStyles = blockStyles[blockName] || {};
const customCSS = {
css: `${blockStyles[blockName]?.css || ""} ${userStyles.blocks[blockName].css.trim() || ""}`
};
blockStyles[blockName] = {
...variationBlockStyles,
...customCSS
};
}
});
}
const css = userStyles?.css || variation.styles?.css ? {
css: `${variation.styles?.css || ""} ${userStyles?.css || ""}`
} : {};
const blocks = Object.keys(blockStyles).length > 0 ? { blocks: blockStyles } : {};
const styles = {
...variation.styles,
...css,
...blocks
};
return {
...variation,
settings: variation.settings ?? {},
styles
};
})
];
}, [fullStyleVariations, userStyles?.blocks, userStyles?.css]);
if (!fullStyleVariations || fullStyleVariations?.length < 1) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalGrid,
{
columns: 2,
className: "edit-site-global-styles-style-variations-container",
gap,
children: themeVariations.map((variation, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Variation, { variation, children: (isFocused) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
preview_styles_default,
{
label: variation?.title,
withHoverView: true,
isFocused,
variation
}
) }, index))
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-global-styles/content.js
function SidebarNavigationScreenGlobalStylesContent() {
const gap = 3;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
spacing: 10,
className: "edit-site-global-styles-variation-container",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleVariationsContainer, { gap }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorVariations, { title: (0,external_wp_i18n_namespaceObject.__)("Palettes"), gap }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TypographyVariations, { title: (0,external_wp_i18n_namespaceObject.__)("Typography"), gap })
]
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-style-variations.js
const { useZoomOut } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function ScreenStyleVariations() {
const isPreviewMode = (0,external_wp_data_.useSelect)((select) => {
return select(external_wp_blockEditor_namespaceObject.store).getSettings().isPreviewMode;
}, []);
useZoomOut(!isPreviewMode);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
header_default,
{
title: (0,external_wp_i18n_namespaceObject.__)("Browse styles"),
description: (0,external_wp_i18n_namespaceObject.__)(
"Choose a variation to change the look of the site."
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Card,
{
size: "small",
isBorderless: true,
className: "edit-site-global-styles-screen-style-variations",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CardBody, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenGlobalStylesContent, {}) })
}
)
] });
}
var screen_style_variations_default = ScreenStyleVariations;
;// external ["wp","mediaUtils"]
const external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"];
;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/constants.js
const STYLE_BOOK_COLOR_GROUPS = [
{
slug: "theme-colors",
title: (0,external_wp_i18n_namespaceObject.__)("Theme Colors"),
origin: "theme",
type: "colors"
},
{
slug: "theme-gradients",
title: (0,external_wp_i18n_namespaceObject.__)("Theme Gradients"),
origin: "theme",
type: "gradients"
},
{
slug: "custom-colors",
title: (0,external_wp_i18n_namespaceObject.__)("Custom Colors"),
origin: "custom",
type: "colors"
},
{
slug: "custom-gradients",
title: (0,external_wp_i18n_namespaceObject.__)("Custom Gradients"),
origin: "custom",
// User.
type: "gradients"
},
{
slug: "duotones",
title: (0,external_wp_i18n_namespaceObject.__)("Duotones"),
origin: "theme",
type: "duotones"
},
{
slug: "default-colors",
title: (0,external_wp_i18n_namespaceObject.__)("Default Colors"),
origin: "default",
type: "colors"
},
{
slug: "default-gradients",
title: (0,external_wp_i18n_namespaceObject.__)("Default Gradients"),
origin: "default",
type: "gradients"
}
];
const STYLE_BOOK_THEME_SUBCATEGORIES = [
{
slug: "site-identity",
title: (0,external_wp_i18n_namespaceObject.__)("Site Identity"),
blocks: ["core/site-logo", "core/site-title", "core/site-tagline"]
},
{
slug: "design",
title: (0,external_wp_i18n_namespaceObject.__)("Design"),
blocks: ["core/navigation", "core/avatar", "core/post-time-to-read"],
exclude: ["core/home-link", "core/navigation-link"]
},
{
slug: "posts",
title: (0,external_wp_i18n_namespaceObject.__)("Posts"),
blocks: [
"core/post-title",
"core/post-excerpt",
"core/post-author",
"core/post-author-name",
"core/post-author-biography",
"core/post-date",
"core/post-terms",
"core/term-description",
"core/query-title",
"core/query-no-results",
"core/query-pagination",
"core/query-numbers"
]
},
{
slug: "comments",
title: (0,external_wp_i18n_namespaceObject.__)("Comments"),
blocks: [
"core/comments-title",
"core/comments-pagination",
"core/comments-pagination-numbers",
"core/comments",
"core/comments-author-name",
"core/comment-content",
"core/comment-date",
"core/comment-edit-link",
"core/comment-reply-link",
"core/comment-template",
"core/post-comments-count",
"core/post-comments-link"
]
}
];
const STYLE_BOOK_CATEGORIES = [
{
slug: "overview",
title: (0,external_wp_i18n_namespaceObject.__)("Overview"),
blocks: []
},
{
slug: "text",
title: (0,external_wp_i18n_namespaceObject.__)("Text"),
blocks: [
"core/post-content",
"core/home-link",
"core/navigation-link"
]
},
{
slug: "colors",
title: (0,external_wp_i18n_namespaceObject.__)("Colors"),
blocks: []
},
{
slug: "theme",
title: (0,external_wp_i18n_namespaceObject.__)("Theme"),
subcategories: STYLE_BOOK_THEME_SUBCATEGORIES
},
{
slug: "media",
title: (0,external_wp_i18n_namespaceObject.__)("Media"),
blocks: ["core/post-featured-image"]
},
{
slug: "widgets",
title: (0,external_wp_i18n_namespaceObject.__)("Widgets"),
blocks: []
},
{
slug: "embed",
title: (0,external_wp_i18n_namespaceObject.__)("Embeds"),
include: []
}
];
const STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES = [
...STYLE_BOOK_THEME_SUBCATEGORIES,
{
slug: "media",
title: (0,external_wp_i18n_namespaceObject.__)("Media"),
blocks: ["core/post-featured-image"]
},
{
slug: "widgets",
title: (0,external_wp_i18n_namespaceObject.__)("Widgets"),
blocks: []
},
{
slug: "embed",
title: (0,external_wp_i18n_namespaceObject.__)("Embeds"),
include: []
}
];
const STYLE_BOOK_PREVIEW_CATEGORIES = [
{
slug: "overview",
title: (0,external_wp_i18n_namespaceObject.__)("Overview"),
blocks: []
},
{
slug: "text",
title: (0,external_wp_i18n_namespaceObject.__)("Text"),
blocks: [
"core/post-content",
"core/home-link",
"core/navigation-link"
]
},
{
slug: "colors",
title: (0,external_wp_i18n_namespaceObject.__)("Colors"),
blocks: []
},
{
slug: "blocks",
title: (0,external_wp_i18n_namespaceObject.__)("All Blocks"),
blocks: [],
subcategories: STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES
}
];
const ROOT_CONTAINER = `
.is-root-container {
display: flow-root;
}
`;
const STYLE_BOOK_IFRAME_STYLES = `
body {
position: relative;
padding: 32px !important;
}
${ROOT_CONTAINER}
.edit-site-style-book__examples {
max-width: 1200px;
margin: 0 auto;
}
.edit-site-style-book__example {
max-width: 900px;
border-radius: 2px;
cursor: pointer;
display: flex;
flex-direction: column;
gap: 40px;
padding: 16px;
width: 100%;
box-sizing: border-box;
scroll-margin-top: 32px;
scroll-margin-bottom: 32px;
margin: 0 auto 40px auto;
}
.edit-site-style-book__example.is-selected {
box-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
}
.edit-site-style-book__example.is-disabled-example {
pointer-events: none;
}
.edit-site-style-book__example:focus:not(:disabled) {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
outline: 3px solid transparent;
}
.edit-site-style-book__duotone-example > div:first-child {
display: flex;
aspect-ratio: 16 / 9;
grid-row: span 1;
grid-column: span 2;
}
.edit-site-style-book__duotone-example img {
width: 100%;
height: 100%;
object-fit: cover;
}
.edit-site-style-book__duotone-example > div:not(:first-child) {
height: 20px;
border: 1px solid color-mix( in srgb, currentColor 10%, transparent );
}
.edit-site-style-book__color-example {
border: 1px solid color-mix( in srgb, currentColor 10%, transparent );
}
.edit-site-style-book__subcategory-title,
.edit-site-style-book__example-title {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 13px;
font-weight: normal;
line-height: normal;
margin: 0;
text-align: left;
padding-top: 8px;
border-top: 1px solid color-mix( in srgb, currentColor 10%, transparent );
color: color-mix( in srgb, currentColor 60%, transparent );
}
.edit-site-style-book__subcategory-title {
font-size: 16px;
margin-bottom: 40px;
padding-bottom: 8px;
}
.edit-site-style-book__example-preview {
width: 100%;
}
.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,
.edit-site-style-book__example-preview .block-list-appender {
display: none;
}
:where(.is-root-container > .wp-block:first-child) {
margin-top: 0;
}
:where(.is-root-container > .wp-block:last-child) {
margin-bottom: 0;
}
`;
;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/categories.js
function getExamplesByCategory(categoryDefinition, examples) {
if (!categoryDefinition?.slug || !examples?.length) {
return;
}
const categories = categoryDefinition?.subcategories ?? [];
if (categories.length) {
return categories.reduce(
(acc, subcategoryDefinition) => {
const subcategoryExamples = getExamplesByCategory(
subcategoryDefinition,
examples
);
if (subcategoryExamples) {
if (!acc.subcategories) {
acc.subcategories = [];
}
acc.subcategories = [
...acc.subcategories,
subcategoryExamples
];
}
return acc;
},
{
title: categoryDefinition.title,
slug: categoryDefinition.slug
}
);
}
const blocksToInclude = categoryDefinition?.blocks || [];
const blocksToExclude = categoryDefinition?.exclude || [];
const categoryExamples = examples.filter((example) => {
return !blocksToExclude.includes(example.name) && (example.category === categoryDefinition.slug || blocksToInclude.includes(example.name));
});
if (!categoryExamples.length) {
return;
}
return {
title: categoryDefinition.title,
slug: categoryDefinition.slug,
examples: categoryExamples
};
}
function getTopLevelStyleBookCategories() {
const reservedCategories = [
...STYLE_BOOK_THEME_SUBCATEGORIES,
...STYLE_BOOK_CATEGORIES
].map(({ slug }) => slug);
const extraCategories = (0,external_wp_blocks_namespaceObject.getCategories)();
const extraCategoriesFiltered = extraCategories.filter(
({ slug }) => !reservedCategories.includes(slug)
);
return [...STYLE_BOOK_CATEGORIES, ...extraCategoriesFiltered];
}
;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/color-examples.js
const ColorExamples = ({
colors,
type,
templateColumns = "1fr 1fr",
itemHeight = "52px"
}) => {
if (!colors) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalGrid, { templateColumns, rowGap: 8, columnGap: 16, children: colors.map((color) => {
const className = type === "gradients" ? (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(color.slug) : (0,external_wp_blockEditor_namespaceObject.getColorClassName)("background-color", color.slug);
const classes = dist_clsx(
"edit-site-style-book__color-example",
className
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.View,
{
className: classes,
style: { height: itemHeight }
},
color.slug
);
}) });
};
var color_examples_default = ColorExamples;
;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/duotone-examples.js
const DuotoneExamples = ({
duotones
}) => {
if (!duotones) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalGrid, { columns: 2, rowGap: 16, columnGap: 16, children: duotones.map((duotone) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalGrid,
{
className: "edit-site-style-book__duotone-example",
columns: 2,
rowGap: 8,
columnGap: 8,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
alt: `Duotone example: ${duotone.slug}`,
src: "https://s.w.org/images/core/5.3/MtBlanc1.jpg",
style: {
filter: `url(#wp-duotone-${duotone.slug})`
}
}
) }),
duotone.colors.map((color) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.View,
{
className: "edit-site-style-book__color-example",
style: { backgroundColor: color }
},
color
);
})
]
},
duotone.slug
);
}) });
};
var duotone_examples_default = DuotoneExamples;
;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/examples.js
function getColorExamples(colors) {
if (!colors) {
return [];
}
const examples = [];
STYLE_BOOK_COLOR_GROUPS.forEach((group) => {
const palette = colors[group.type];
const paletteFiltered = Array.isArray(palette) ? palette.find(
(origin) => origin.slug === group.origin
) : void 0;
if (paletteFiltered?.[group.type]) {
const example = {
name: group.slug,
title: group.title,
category: "colors"
};
if (group.type === "duotones") {
example.content = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
duotone_examples_default,
{
duotones: paletteFiltered[group.type]
}
);
examples.push(example);
} else {
example.content = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
color_examples_default,
{
colors: paletteFiltered[group.type],
type: group.type
}
);
examples.push(example);
}
}
});
return examples;
}
function getOverviewBlockExamples(colors) {
const examples = [];
const themePalette = Array.isArray(colors?.colors) ? colors.colors.find(
(origin) => origin.slug === "theme"
) : void 0;
if (themePalette) {
const themeColorexample = {
name: "theme-colors",
title: (0,external_wp_i18n_namespaceObject.__)("Colors"),
category: "overview",
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
color_examples_default,
{
colors: themePalette.colors,
type: "colors",
templateColumns: "repeat(auto-fill, minmax( 200px, 1fr ))",
itemHeight: "32px"
}
)
};
examples.push(themeColorexample);
}
const typographyBlockExamples = [];
if ((0,external_wp_blocks_namespaceObject.getBlockType)("core/heading")) {
const headingBlock = (0,external_wp_blocks_namespaceObject.createBlock)("core/heading", {
// translators: Typography example. Your local alphabet, numbers and some common special characters.
content: (0,external_wp_i18n_namespaceObject.__)(
`AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789X{(\u2026)},.-<>?!*&:/A@HELFO\u2122\xA9`
),
level: 1
});
typographyBlockExamples.push(headingBlock);
}
if ((0,external_wp_blocks_namespaceObject.getBlockType)("core/paragraph")) {
const firstParagraphBlock = (0,external_wp_blocks_namespaceObject.createBlock)("core/paragraph", {
content: (0,external_wp_i18n_namespaceObject.__)(
`A paragraph in a website refers to a distinct block of text that is used to present and organize information. It is a fundamental unit of content in web design and is typically composed of a group of related sentences or thoughts focused on a particular topic or idea. Paragraphs play a crucial role in improving the readability and user experience of a website. They break down the text into smaller, manageable chunks, allowing readers to scan the content more easily.`
)
});
const secondParagraphBlock = (0,external_wp_blocks_namespaceObject.createBlock)("core/paragraph", {
content: (0,external_wp_i18n_namespaceObject.__)(
`Additionally, paragraphs help structure the flow of information and provide logical breaks between different concepts or pieces of information. In terms of formatting, paragraphs in websites are commonly denoted by a vertical gap or indentation between each block of text. This visual separation helps visually distinguish one paragraph from another, creating a clear and organized layout that guides the reader through the content smoothly.`
)
});
if ((0,external_wp_blocks_namespaceObject.getBlockType)("core/group")) {
const groupBlock = (0,external_wp_blocks_namespaceObject.createBlock)(
"core/group",
{
layout: {
type: "grid",
columnCount: 2,
minimumColumnWidth: "12rem"
},
style: {
spacing: {
blockGap: "1.5rem"
}
}
},
[firstParagraphBlock, secondParagraphBlock]
);
typographyBlockExamples.push(groupBlock);
} else {
typographyBlockExamples.push(firstParagraphBlock);
}
}
if (!!typographyBlockExamples.length) {
examples.push({
name: "typography",
title: (0,external_wp_i18n_namespaceObject.__)("Typography"),
category: "overview",
blocks: typographyBlockExamples
});
}
const otherBlockExamples = [
"core/image",
"core/separator",
"core/buttons",
"core/pullquote",
"core/search"
];
otherBlockExamples.forEach((blockName) => {
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName);
if (blockType && blockType.example) {
const blockExample = {
name: blockName,
title: blockType.title,
category: "overview",
/*
* CSS generated from style attributes will take precedence over global styles CSS,
* so remove the style attribute from the example to ensure the example
* demonstrates changes to global styles.
*/
blocks: (0,external_wp_blocks_namespaceObject.getBlockFromExample)(blockName, {
...blockType.example,
attributes: {
...blockType.example.attributes,
style: void 0
}
})
};
examples.push(blockExample);
}
});
return examples;
}
function getExamples(colors) {
const nonHeadingBlockExamples = (0,external_wp_blocks_namespaceObject.getBlockTypes)().filter((blockType) => {
const { name, example, supports } = blockType;
return name !== "core/heading" && !!example && supports?.inserter !== false;
}).map((blockType) => ({
name: blockType.name,
title: blockType.title,
category: blockType.category,
/*
* CSS generated from style attributes will take precedence over global styles CSS,
* so remove the style attribute from the example to ensure the example
* demonstrates changes to global styles.
*/
blocks: (0,external_wp_blocks_namespaceObject.getBlockFromExample)(blockType.name, {
...blockType.example,
attributes: {
...blockType.example.attributes,
style: void 0
}
})
}));
const isHeadingBlockRegistered = !!(0,external_wp_blocks_namespaceObject.getBlockType)("core/heading");
if (!isHeadingBlockRegistered) {
return nonHeadingBlockExamples;
}
const headingsExample = {
name: "core/heading",
title: (0,external_wp_i18n_namespaceObject.__)("Headings"),
category: "text",
blocks: [1, 2, 3, 4, 5, 6].map((level) => {
return (0,external_wp_blocks_namespaceObject.createBlock)("core/heading", {
content: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %d: heading level e.g: "1", "2", "3"
(0,external_wp_i18n_namespaceObject.__)("Heading %d"),
level
),
level
});
})
};
const colorExamples = getColorExamples(colors);
const overviewBlockExamples = getOverviewBlockExamples(colors);
return [
headingsExample,
...colorExamples,
...nonHeadingBlockExamples,
...overviewBlockExamples
];
}
;// ./node_modules/@wordpress/admin-ui/build-module/page/header.js
function Header({
breadcrumbs,
badges,
title,
subTitle,
actions
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { className: "admin-ui-page__header", as: "header", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
className: "admin-ui-page__header-title",
justify: "space-between",
spacing: 2,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 2, children: [
title && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { as: "h2", level: 3, weight: 500, truncate: true, children: title }),
breadcrumbs,
badges
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHStack,
{
style: { width: "auto", flexShrink: 0 },
spacing: 2,
className: "admin-ui-page__header-actions",
children: actions
}
)
]
}
),
subTitle && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "admin-ui-page__header-subtitle", children: subTitle })
] });
}
;// ./node_modules/@wordpress/admin-ui/build-module/page/index.js
function Page({
breadcrumbs,
badges,
title,
subTitle,
children,
className,
actions,
hasPadding = false
}) {
const classes = dist_clsx("admin-ui-page", className);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(navigable_region_default, { className: classes, ariaLabel: title, children: [
(title || breadcrumbs || badges) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Header,
{
breadcrumbs,
badges,
title,
subTitle,
actions
}
),
hasPadding ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "admin-ui-page__content has-padding", children }) : children
] });
}
var page_page_default = Page;
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-global-styles-wrapper/index.js
const { useLocation: sidebar_global_styles_wrapper_useLocation, useHistory: sidebar_global_styles_wrapper_useHistory } = unlock(external_wp_router_namespaceObject.privateApis);
const GlobalStylesPageActions = ({
isStyleBookOpened,
setIsStyleBookOpened,
path
}) => {
const history = sidebar_global_styles_wrapper_useHistory();
const canEditCSS = (0,external_wp_data_.useSelect)((select) => {
const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } = select(external_wp_coreData_namespaceObject.store);
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
const globalStyles = globalStylesId ? getEntityRecord("root", "globalStyles", globalStylesId) : void 0;
return !!globalStyles?._links?.["wp:action-edit-css"];
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
isPressed: isStyleBookOpened,
icon: seen_default,
label: (0,external_wp_i18n_namespaceObject.__)("Style Book"),
onClick: () => {
setIsStyleBookOpened(!isStyleBookOpened);
const updatedPath = !isStyleBookOpened ? (0,external_wp_url_namespaceObject.addQueryArgs)(path, { preview: "stylebook" }) : (0,external_wp_url_namespaceObject.removeQueryArgs)(path, "preview");
history.navigate(updatedPath);
},
size: "compact"
}
),
canEditCSS && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropdownMenu,
{
icon: more_vertical_default,
label: (0,external_wp_i18n_namespaceObject.__)("More"),
toggleProps: { size: "compact" },
children: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: canEditCSS && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: () => {
onClose();
history.navigate(
(0,external_wp_url_namespaceObject.addQueryArgs)(path, {
section: "/css"
})
);
},
children: (0,external_wp_i18n_namespaceObject.__)("Additional CSS")
}
) })
}
)
] });
};
const useSection = () => {
const { path, query } = sidebar_global_styles_wrapper_useLocation();
const history = sidebar_global_styles_wrapper_useHistory();
return (0,external_wp_element_.useMemo)(() => {
return [
query.section ?? "/",
(updatedSection) => {
history.navigate(
(0,external_wp_url_namespaceObject.addQueryArgs)(path, {
section: updatedSection
})
);
}
];
}, [path, query.section, history]);
};
function GlobalStylesUIWrapper() {
const { path } = sidebar_global_styles_wrapper_useLocation();
const [isStyleBookOpened, setIsStyleBookOpened] = (0,external_wp_element_.useState)(
path.includes("preview=stylebook")
);
const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
const [section, onChangeSection] = useSection();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
page_page_default,
{
actions: !isMobileViewport ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GlobalStylesPageActions,
{
isStyleBookOpened,
setIsStyleBookOpened,
path
}
) : null,
className: "edit-site-styles",
title: (0,external_wp_i18n_namespaceObject.__)("Styles"),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ui_default, { path: section, onPathChange: onChangeSection })
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/index.js
const {
ExperimentalBlockEditorProvider,
useGlobalStyle: style_book_useGlobalStyle,
GlobalStylesContext: style_book_GlobalStylesContext,
useGlobalStylesOutputWithConfig
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const { mergeBaseAndUserConfigs: style_book_mergeBaseAndUserConfigs } = unlock(external_wp_editor_namespaceObject.privateApis);
const { Tabs: style_book_Tabs } = unlock(external_wp_components_namespaceObject.privateApis);
function isObjectEmpty(object) {
return !object || Object.keys(object).length === 0;
}
const scrollToSection = (anchorId, iframe) => {
if (!anchorId || !iframe || !iframe?.contentDocument) {
return;
}
const element = anchorId === "top" ? iframe.contentDocument.body : iframe.contentDocument.getElementById(anchorId);
if (element) {
element.scrollIntoView({
behavior: "smooth"
});
}
};
const getStyleBookNavigationFromPath = (path) => {
if (path && typeof path === "string") {
if (path === "/" || path.startsWith("/typography") || path.startsWith("/colors") || path.startsWith("/blocks")) {
return {
top: true
};
}
}
return null;
};
function useMultiOriginPalettes() {
const { colors, gradients } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)();
const [
shouldDisplayDefaultDuotones,
customDuotones,
themeDuotones,
defaultDuotones
] = (0,external_wp_blockEditor_namespaceObject.useSettings)(
"color.defaultDuotone",
"color.duotone.custom",
"color.duotone.theme",
"color.duotone.default"
);
const palettes = (0,external_wp_element_.useMemo)(() => {
const result = { colors, gradients, duotones: [] };
if (themeDuotones && themeDuotones.length) {
result.duotones.push({
name: (0,external_wp_i18n_namespaceObject._x)(
"Theme",
"Indicates these duotone filters come from the theme."
),
slug: "theme",
duotones: themeDuotones
});
}
if (shouldDisplayDefaultDuotones && defaultDuotones && defaultDuotones.length) {
result.duotones.push({
name: (0,external_wp_i18n_namespaceObject._x)(
"Default",
"Indicates these duotone filters come from WordPress."
),
slug: "default",
duotones: defaultDuotones
});
}
if (customDuotones && customDuotones.length) {
result.duotones.push({
name: (0,external_wp_i18n_namespaceObject._x)(
"Custom",
"Indicates these doutone filters are created by the user."
),
slug: "custom",
duotones: customDuotones
});
}
return result;
}, [
colors,
gradients,
customDuotones,
themeDuotones,
defaultDuotones,
shouldDisplayDefaultDuotones
]);
return palettes;
}
function getExamplesForSinglePageUse(examples) {
const examplesForSinglePageUse = [];
const overviewCategoryExamples = getExamplesByCategory(
{ slug: "overview" },
examples
);
examplesForSinglePageUse.push(...overviewCategoryExamples.examples);
const otherExamples = examples.filter((example) => {
return example.category !== "overview" && !overviewCategoryExamples.examples.find(
(overviewExample) => overviewExample.name === example.name
);
});
examplesForSinglePageUse.push(...otherExamples);
return examplesForSinglePageUse;
}
function applyBlockVariationsToExamples(examples, variation) {
if (!variation) {
return examples;
}
return examples.map((example) => {
return {
...example,
variation,
blocks: Array.isArray(example.blocks) ? example.blocks.map((block) => ({
...block,
attributes: {
...block.attributes,
style: void 0,
className: getVariationClassName(variation)
}
})) : {
...example.blocks,
attributes: {
...example.blocks.attributes,
style: void 0,
className: getVariationClassName(variation)
}
}
};
});
}
function StyleBook({
enableResizing = true,
isSelected,
onClick,
onSelect,
showCloseButton = true,
onClose,
showTabs = true,
userConfig = {},
path = ""
}) {
const [textColor] = style_book_useGlobalStyle("color.text");
const [backgroundColor] = style_book_useGlobalStyle("color.background");
const colors = useMultiOriginPalettes();
const examples = (0,external_wp_element_.useMemo)(() => getExamples(colors), [colors]);
const tabs = (0,external_wp_element_.useMemo)(
() => getTopLevelStyleBookCategories().filter(
(category) => examples.some(
(example) => example.category === category.slug
)
),
[examples]
);
const examplesForSinglePageUse = getExamplesForSinglePageUse(examples);
const { base: baseConfig } = (0,external_wp_element_.useContext)(style_book_GlobalStylesContext);
const goTo = getStyleBookNavigationFromPath(path);
const mergedConfig = (0,external_wp_element_.useMemo)(() => {
if (!isObjectEmpty(userConfig) && !isObjectEmpty(baseConfig)) {
return style_book_mergeBaseAndUserConfigs(baseConfig, userConfig);
}
return {};
}, [baseConfig, userConfig]);
const originalSettings = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_blockEditor_namespaceObject.store).getSettings(),
[]
);
const [globalStyles] = useGlobalStylesOutputWithConfig(mergedConfig);
const settings = (0,external_wp_element_.useMemo)(
() => ({
...originalSettings,
styles: !isObjectEmpty(globalStyles) && !isObjectEmpty(userConfig) ? globalStyles : originalSettings.styles,
isPreviewMode: true
}),
[globalStyles, originalSettings, userConfig]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
editor_canvas_container_default,
{
onClose,
enableResizing,
closeButtonLabel: showCloseButton ? (0,external_wp_i18n_namespaceObject.__)("Close") : null,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx("edit-site-style-book", {
"is-button": !!onClick
}),
style: {
color: textColor,
background: backgroundColor
},
children: showTabs ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(style_book_Tabs, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-style-book__tablist-container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(style_book_Tabs.TabList, { children: tabs.map((tab) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
style_book_Tabs.Tab,
{
tabId: tab.slug,
children: tab.title
},
tab.slug
)) }) }),
tabs.map((tab) => {
const categoryDefinition = tab.slug ? getTopLevelStyleBookCategories().find(
(_category) => _category.slug === tab.slug
) : null;
const filteredExamples = categoryDefinition ? getExamplesByCategory(
categoryDefinition,
examples
) : { examples };
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
style_book_Tabs.TabPanel,
{
tabId: tab.slug,
focusable: false,
className: "edit-site-style-book__tabpanel",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
StyleBookBody,
{
category: tab.slug,
examples: filteredExamples,
isSelected,
onSelect,
settings,
title: tab.title,
goTo
}
)
},
tab.slug
);
})
] }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
StyleBookBody,
{
examples: { examples: examplesForSinglePageUse },
isSelected,
onClick,
onSelect,
settings,
goTo
}
)
}
)
}
);
}
const StyleBookPreview = ({ userConfig = {}, isStatic = false }) => {
const siteEditorSettings = (0,external_wp_data_.useSelect)(
(select) => select(store).getSettings(),
[]
);
const canUserUploadMedia = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).canUser("create", {
kind: "postType",
name: "attachment"
}),
[]
);
(0,external_wp_element_.useEffect)(() => {
(0,external_wp_data_.dispatch)(external_wp_blockEditor_namespaceObject.store).updateSettings({
...siteEditorSettings,
mediaUpload: canUserUploadMedia ? external_wp_mediaUtils_namespaceObject.uploadMedia : void 0
});
}, [siteEditorSettings, canUserUploadMedia]);
const [section, onChangeSection] = useSection();
const isSelected = (blockName) => {
return section === `/blocks/${encodeURIComponent(blockName)}` || section.startsWith(
`/blocks/${encodeURIComponent(blockName)}/`
);
};
const onSelect = (blockName, isBlockVariation = false) => {
if (STYLE_BOOK_COLOR_GROUPS.find(
(group) => group.slug === blockName
)) {
onChangeSection("/colors/palette");
return;
}
if (blockName === "typography") {
onChangeSection("/typography");
return;
}
if (isBlockVariation) {
return;
}
onChangeSection(`/blocks/${encodeURIComponent(blockName)}`);
};
const colors = useMultiOriginPalettes();
const examples = getExamples(colors);
const examplesForSinglePageUse = getExamplesForSinglePageUse(examples);
let previewCategory = null;
let blockVariation = null;
if (section.includes("/colors")) {
previewCategory = "colors";
} else if (section.includes("/typography")) {
previewCategory = "text";
} else if (section.includes("/blocks")) {
previewCategory = "blocks";
let blockName = decodeURIComponent(section).split("/blocks/")[1];
if (blockName?.includes("/variations")) {
[blockName, blockVariation] = blockName.split("/variations/");
}
if (blockName && examples.find((example) => example.name === blockName)) {
previewCategory = blockName;
}
} else if (!isStatic) {
previewCategory = "overview";
}
const categoryDefinition = STYLE_BOOK_PREVIEW_CATEGORIES.find(
(category) => category.slug === previewCategory
);
const filteredExamples = (0,external_wp_element_.useMemo)(() => {
if (!categoryDefinition) {
return {
examples: [
examples.find(
(example) => example.name === previewCategory
)
]
};
}
return getExamplesByCategory(categoryDefinition, examples);
}, [categoryDefinition, examples, previewCategory]);
const displayedExamples = (0,external_wp_element_.useMemo)(() => {
if (!previewCategory) {
return { examples: examplesForSinglePageUse };
}
if (blockVariation) {
return {
examples: applyBlockVariationsToExamples(
filteredExamples.examples,
blockVariation
)
};
}
return filteredExamples;
}, [
previewCategory,
examplesForSinglePageUse,
blockVariation,
filteredExamples
]);
const { base: baseConfig } = (0,external_wp_element_.useContext)(style_book_GlobalStylesContext);
const goTo = getStyleBookNavigationFromPath(section);
const mergedConfig = (0,external_wp_element_.useMemo)(() => {
if (!isObjectEmpty(userConfig) && !isObjectEmpty(baseConfig)) {
return style_book_mergeBaseAndUserConfigs(baseConfig, userConfig);
}
return {};
}, [baseConfig, userConfig]);
const [globalStyles] = useGlobalStylesOutputWithConfig(mergedConfig);
const settings = (0,external_wp_element_.useMemo)(
() => ({
...siteEditorSettings,
styles: !isObjectEmpty(globalStyles) && !isObjectEmpty(userConfig) ? globalStyles : siteEditorSettings.styles,
isPreviewMode: true
}),
[globalStyles, siteEditorSettings, userConfig]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-style-book", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, { settings, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesRenderer, { disableRootPadding: true }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
StyleBookBody,
{
examples: displayedExamples,
settings,
goTo,
isSelected: !isStatic ? isSelected : null,
onSelect: !isStatic ? onSelect : null
}
)
] }) });
};
const StyleBookBody = ({
examples,
isSelected,
onClick,
onSelect,
settings,
title,
goTo
}) => {
const [isFocused, setIsFocused] = (0,external_wp_element_.useState)(false);
const [hasIframeLoaded, setHasIframeLoaded] = (0,external_wp_element_.useState)(false);
const iframeRef = (0,external_wp_element_.useRef)(null);
const buttonModeProps = {
role: "button",
onFocus: () => setIsFocused(true),
onBlur: () => setIsFocused(false),
onKeyDown: (event) => {
if (event.defaultPrevented) {
return;
}
const { keyCode } = event;
if (onClick && (keyCode === external_wp_keycodes_namespaceObject.ENTER || keyCode === external_wp_keycodes_namespaceObject.SPACE)) {
event.preventDefault();
onClick(event);
}
},
onClick: (event) => {
if (event.defaultPrevented) {
return;
}
if (onClick) {
event.preventDefault();
onClick(event);
}
},
readonly: true
};
const handleLoad = () => setHasIframeLoaded(true);
(0,external_wp_element_.useLayoutEffect)(() => {
if (hasIframeLoaded && iframeRef?.current) {
if (goTo?.top) {
scrollToSection("top", iframeRef?.current);
}
}
}, [iframeRef?.current, goTo, scrollToSection, hasIframeLoaded]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_blockEditor_namespaceObject.__unstableIframe,
{
onLoad: handleLoad,
ref: iframeRef,
className: dist_clsx("edit-site-style-book__iframe", {
"is-focused": isFocused && !!onClick,
"is-button": !!onClick
}),
name: "style-book-canvas",
tabIndex: 0,
...onClick ? buttonModeProps : {},
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, { styles: settings.styles }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("style", { children: [
STYLE_BOOK_IFRAME_STYLES,
!!onClick && "body { cursor: pointer; } body * { pointer-events: none; }"
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Examples,
{
className: "edit-site-style-book__examples",
filteredExamples: examples,
label: title ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Category of blocks, e.g. Text.
(0,external_wp_i18n_namespaceObject.__)("Examples of blocks in the %s category"),
title
) : (0,external_wp_i18n_namespaceObject.__)("Examples of blocks"),
isSelected,
onSelect
},
title
)
]
}
);
};
const Examples = (0,external_wp_element_.memo)(
({ className, filteredExamples, label, isSelected, onSelect }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Composite,
{
orientation: "vertical",
className,
"aria-label": label,
role: "grid",
children: [
!!filteredExamples?.examples?.length && filteredExamples.examples.map((example) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Example,
{
id: `example-${example.name}`,
title: example.title,
content: example.content,
blocks: example.blocks,
isSelected: isSelected?.(example.name),
onClick: !!onSelect ? () => onSelect(
example.name,
!!example.variation
) : null
},
example.name
)),
!!filteredExamples?.subcategories?.length && filteredExamples.subcategories.map((subcategory) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Composite.Group,
{
className: "edit-site-style-book__subcategory",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.GroupLabel, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "edit-site-style-book__subcategory-title", children: subcategory.title }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Subcategory,
{
examples: subcategory.examples,
isSelected,
onSelect
}
)
]
},
`subcategory-${subcategory.slug}`
))
]
}
);
}
);
const Subcategory = ({ examples, isSelected, onSelect }) => {
return !!examples?.length && examples.map((example) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Example,
{
id: `example-${example.name}`,
title: example.title,
content: example.content,
blocks: example.blocks,
isSelected: isSelected?.(example.name),
onClick: !!onSelect ? () => onSelect(example.name) : null
},
example.name
));
};
const disabledExamples = ["example-duotones"];
const Example = ({ id, title, blocks, isSelected, onClick, content }) => {
const originalSettings = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_blockEditor_namespaceObject.store).getSettings(),
[]
);
const settings = (0,external_wp_element_.useMemo)(
() => ({
...originalSettings,
focusMode: false,
// Disable "Spotlight mode".
isPreviewMode: true
}),
[originalSettings]
);
const renderedBlocks = (0,external_wp_element_.useMemo)(
() => Array.isArray(blocks) ? blocks : [blocks],
[blocks]
);
const disabledProps = disabledExamples.includes(id) || !onClick ? {
disabled: true,
accessibleWhenDisabled: !!onClick
} : {};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "row", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Composite.Item,
{
className: dist_clsx("edit-site-style-book__example", {
"is-selected": isSelected,
"is-disabled-example": !!disabledProps?.disabled
}),
id,
"aria-label": !!onClick ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Title of a block, e.g. Heading.
(0,external_wp_i18n_namespaceObject.__)("Open %s styles in Styles panel"),
title
) : void 0,
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {}),
role: !!onClick ? "button" : null,
onClick,
...disabledProps,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "edit-site-style-book__example-title", children: title }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "edit-site-style-book__example-preview",
"aria-hidden": true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { className: "edit-site-style-book__example-preview__content", children: content ? content : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
ExperimentalBlockEditorProvider,
{
value: renderedBlocks,
settings,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, { renderAppender: false })
]
}
) })
}
)
]
}
) }) });
};
var style_book_default = StyleBook;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-css.js
const { useGlobalStyle: screen_css_useGlobalStyle, AdvancedPanel: screen_css_StylesAdvancedPanel } = unlock(
external_wp_blockEditor_namespaceObject.privateApis
);
function ScreenCSS() {
const [style] = screen_css_useGlobalStyle("", void 0, "user", {
shouldDecodeEncode: false
});
const [inheritedStyle, setStyle] = screen_css_useGlobalStyle("", void 0, "all", {
shouldDecodeEncode: false
});
const { setEditorCanvasContainerView } = unlock(
(0,external_wp_data_.useDispatch)(store)
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
header_default,
{
title: (0,external_wp_i18n_namespaceObject.__)("Additional CSS"),
description: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
(0,external_wp_i18n_namespaceObject.__)(
"You can add custom CSS to further customize the appearance and layout of your site."
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ExternalLink,
{
href: (0,external_wp_i18n_namespaceObject.__)(
"https://developer.wordpress.org/advanced-administration/wordpress/css/"
),
className: "edit-site-global-styles-screen-css-help-link",
children: (0,external_wp_i18n_namespaceObject.__)("Learn more about CSS")
}
)
] }),
onBack: () => {
setEditorCanvasContainerView(void 0);
}
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-global-styles-screen-css", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
screen_css_StylesAdvancedPanel,
{
value: style,
onChange: setStyle,
inheritedValue: inheritedStyle
}
) })
] });
}
var screen_css_default = ScreenCSS;
;// ./node_modules/@wordpress/edit-site/build-module/components/revisions/index.js
const {
ExperimentalBlockEditorProvider: revisions_ExperimentalBlockEditorProvider,
GlobalStylesContext: revisions_GlobalStylesContext,
useGlobalStylesOutputWithConfig: revisions_useGlobalStylesOutputWithConfig,
__unstableBlockStyleVariationOverridesWithConfig
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const { mergeBaseAndUserConfigs: revisions_mergeBaseAndUserConfigs } = unlock(external_wp_editor_namespaceObject.privateApis);
function revisions_isObjectEmpty(object) {
return !object || Object.keys(object).length === 0;
}
function Revisions({ userConfig, blocks }) {
const { base: baseConfig } = (0,external_wp_element_.useContext)(revisions_GlobalStylesContext);
const mergedConfig = (0,external_wp_element_.useMemo)(() => {
if (!revisions_isObjectEmpty(userConfig) && !revisions_isObjectEmpty(baseConfig)) {
return revisions_mergeBaseAndUserConfigs(baseConfig, userConfig);
}
return {};
}, [baseConfig, userConfig]);
const renderedBlocksArray = (0,external_wp_element_.useMemo)(
() => Array.isArray(blocks) ? blocks : [blocks],
[blocks]
);
const originalSettings = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_blockEditor_namespaceObject.store).getSettings(),
[]
);
const settings = (0,external_wp_element_.useMemo)(
() => ({
...originalSettings,
isPreviewMode: true
}),
[originalSettings]
);
const [globalStyles] = revisions_useGlobalStylesOutputWithConfig(mergedConfig);
const editorStyles = !revisions_isObjectEmpty(globalStyles) && !revisions_isObjectEmpty(userConfig) ? globalStyles : settings.styles;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
editor_canvas_container_default,
{
title: (0,external_wp_i18n_namespaceObject.__)("Revisions"),
closeButtonLabel: (0,external_wp_i18n_namespaceObject.__)("Close revisions"),
enableResizing: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_blockEditor_namespaceObject.__unstableIframe,
{
className: "edit-site-revisions__iframe",
name: "revisions",
tabIndex: 0,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("style", {
// Forming a "block formatting context" to prevent margin collapsing.
// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
children: `.is-root-container { display: flow-root; }`
}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { className: "edit-site-revisions__example-preview__content", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
revisions_ExperimentalBlockEditorProvider,
{
value: renderedBlocksArray,
settings,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, { renderAppender: false }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, { styles: editorStyles }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
__unstableBlockStyleVariationOverridesWithConfig,
{
config: mergedConfig
}
)
]
}
) })
]
}
)
}
);
}
var revisions_default = Revisions;
;// external ["wp","date"]
const external_wp_date_namespaceObject = window["wp"]["date"];
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-revisions/revisions-buttons.js
const DAY_IN_MILLISECONDS = 60 * 60 * 1e3 * 24;
const { getGlobalStylesChanges } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function ChangesSummary({ revision, previousRevision }) {
const changes = getGlobalStylesChanges(revision, previousRevision, {
maxResults: 7
});
if (!changes.length) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"ul",
{
"data-testid": "global-styles-revision-changes",
className: "edit-site-global-styles-screen-revisions__changes",
children: changes.map((change) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { children: change }, change))
}
);
}
function getRevisionLabel(id, authorDisplayName, formattedModifiedDate, areStylesEqual) {
if ("parent" === id) {
return (0,external_wp_i18n_namespaceObject.__)("Reset the styles to the theme defaults");
}
if ("unsaved" === id) {
return (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: author display name */
(0,external_wp_i18n_namespaceObject.__)("Unsaved changes by %s"),
authorDisplayName
);
}
return areStylesEqual ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: author display name. 2: revision creation date.
(0,external_wp_i18n_namespaceObject.__)(
"Changes saved by %1$s on %2$s. This revision matches current editor styles."
),
authorDisplayName,
formattedModifiedDate
) : (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: author display name. 2: revision creation date.
(0,external_wp_i18n_namespaceObject.__)("Changes saved by %1$s on %2$s"),
authorDisplayName,
formattedModifiedDate
);
}
function RevisionsButtons({
userRevisions,
selectedRevisionId,
onChange,
canApplyRevision,
onApplyRevision
}) {
const { currentThemeName, currentUser } = (0,external_wp_data_.useSelect)((select) => {
const { getCurrentTheme, getCurrentUser } = select(external_wp_coreData_namespaceObject.store);
const currentTheme = getCurrentTheme();
return {
currentThemeName: currentTheme?.name?.rendered || currentTheme?.stylesheet,
currentUser: getCurrentUser()
};
}, []);
const dateNowInMs = (0,external_wp_date_namespaceObject.getDate)().getTime();
const { datetimeAbbreviated } = (0,external_wp_date_namespaceObject.getSettings)().formats;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite,
{
orientation: "vertical",
className: "edit-site-global-styles-screen-revisions__revisions-list",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Global styles revisions list"),
role: "listbox",
children: userRevisions.map((revision, index) => {
const { id, author, modified } = revision;
const isUnsaved = "unsaved" === id;
const revisionAuthor = isUnsaved ? currentUser : author;
const authorDisplayName = revisionAuthor?.name || (0,external_wp_i18n_namespaceObject.__)("User");
const authorAvatar = revisionAuthor?.avatar_urls?.["48"];
const isFirstItem = index === 0;
const isSelected = selectedRevisionId ? selectedRevisionId === id : isFirstItem;
const areStylesEqual = !canApplyRevision && isSelected;
const isReset = "parent" === id;
const modifiedDate = (0,external_wp_date_namespaceObject.getDate)(modified);
const displayDate = modified && dateNowInMs - modifiedDate.getTime() > DAY_IN_MILLISECONDS ? (0,external_wp_date_namespaceObject.dateI18n)(datetimeAbbreviated, modifiedDate) : (0,external_wp_date_namespaceObject.humanTimeDiff)(modified);
const revisionLabel = getRevisionLabel(
id,
authorDisplayName,
(0,external_wp_date_namespaceObject.dateI18n)(datetimeAbbreviated, modifiedDate),
areStylesEqual
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Composite.Item,
{
className: "edit-site-global-styles-screen-revisions__revision-item",
"aria-current": isSelected,
role: "option",
onKeyDown: (event) => {
const { keyCode } = event;
if (keyCode === external_wp_keycodes_namespaceObject.ENTER || keyCode === external_wp_keycodes_namespaceObject.SPACE) {
onChange(revision);
}
},
onClick: (event) => {
event.preventDefault();
onChange(revision);
},
"aria-selected": isSelected,
"aria-label": revisionLabel,
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {}),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "edit-site-global-styles-screen-revisions__revision-item-wrapper", children: isReset ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { className: "edit-site-global-styles-screen-revisions__description", children: [
(0,external_wp_i18n_namespaceObject.__)("Default styles"),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "edit-site-global-styles-screen-revisions__meta", children: currentThemeName })
] }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { className: "edit-site-global-styles-screen-revisions__description", children: [
isUnsaved ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "edit-site-global-styles-screen-revisions__date", children: (0,external_wp_i18n_namespaceObject.__)("(Unsaved)") }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"time",
{
className: "edit-site-global-styles-screen-revisions__date",
dateTime: modified,
children: displayDate
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { className: "edit-site-global-styles-screen-revisions__meta", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
alt: authorDisplayName,
src: authorAvatar
}
),
authorDisplayName
] }),
isSelected && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ChangesSummary,
{
revision,
previousRevision: index < userRevisions.length ? userRevisions[index + 1] : {}
}
)
] }) }),
isSelected && (areStylesEqual ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-site-global-styles-screen-revisions__applied-text", children: (0,external_wp_i18n_namespaceObject.__)(
"These styles are already applied to your site."
) }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "compact",
variant: "primary",
className: "edit-site-global-styles-screen-revisions__apply-button",
onClick: onApplyRevision,
"aria-label": (0,external_wp_i18n_namespaceObject.__)(
"Apply the selected revision to your site."
),
children: isReset ? (0,external_wp_i18n_namespaceObject.__)("Reset to defaults") : (0,external_wp_i18n_namespaceObject.__)("Apply")
}
))
]
},
id
);
})
}
);
}
var revisions_buttons_default = RevisionsButtons;
;// ./node_modules/@wordpress/edit-site/build-module/components/pagination/index.js
function Pagination({
currentPage,
numPages,
changePage,
totalItems,
className,
disabled = false,
buttonVariant = "tertiary",
label = (0,external_wp_i18n_namespaceObject.__)("Pagination")
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
expanded: false,
as: "nav",
"aria-label": label,
spacing: 3,
justify: "flex-start",
className: dist_clsx("edit-site-pagination", className),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
variant: "muted",
className: "edit-site-pagination__total",
// translators: %s: Total number of patterns.
children: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Total number of patterns.
(0,external_wp_i18n_namespaceObject._n)("%s item", "%s items", totalItems),
totalItems
)
}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { expanded: false, spacing: 1, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: buttonVariant,
onClick: () => changePage(1),
accessibleWhenDisabled: true,
disabled: disabled || currentPage === 1,
label: (0,external_wp_i18n_namespaceObject.__)("First page"),
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? next_default : previous_default,
size: "compact"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: buttonVariant,
onClick: () => changePage(currentPage - 1),
accessibleWhenDisabled: true,
disabled: disabled || currentPage === 1,
label: (0,external_wp_i18n_namespaceObject.__)("Previous page"),
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right_default : chevron_left_default,
size: "compact"
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { variant: "muted", children: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Current page number. 2: Total number of pages.
(0,external_wp_i18n_namespaceObject._x)("%1$s of %2$s", "paging"),
currentPage,
numPages
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { expanded: false, spacing: 1, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: buttonVariant,
onClick: () => changePage(currentPage + 1),
accessibleWhenDisabled: true,
disabled: disabled || currentPage === numPages,
label: (0,external_wp_i18n_namespaceObject.__)("Next page"),
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_default : chevron_right_default,
size: "compact"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: buttonVariant,
onClick: () => changePage(numPages),
accessibleWhenDisabled: true,
disabled: disabled || currentPage === numPages,
label: (0,external_wp_i18n_namespaceObject.__)("Last page"),
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? previous_default : next_default,
size: "compact"
}
)
] })
]
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-revisions/index.js
const { GlobalStylesContext: screen_revisions_GlobalStylesContext, areGlobalStyleConfigsEqual: screen_revisions_areGlobalStyleConfigsEqual } = unlock(
external_wp_blockEditor_namespaceObject.privateApis
);
const PAGE_SIZE = 10;
function ScreenRevisions() {
const { user: currentEditorGlobalStyles, setUserConfig } = (0,external_wp_element_.useContext)(screen_revisions_GlobalStylesContext);
const { blocks, editorCanvasContainerView } = (0,external_wp_data_.useSelect)(
(select) => ({
editorCanvasContainerView: unlock(
select(store)
).getEditorCanvasContainerView(),
blocks: select(external_wp_blockEditor_namespaceObject.store).getBlocks()
}),
[]
);
const [currentPage, setCurrentPage] = (0,external_wp_element_.useState)(1);
const [currentRevisions, setCurrentRevisions] = (0,external_wp_element_.useState)([]);
const { revisions, isLoading, hasUnsavedChanges, revisionsCount } = useGlobalStylesRevisions({
query: {
per_page: PAGE_SIZE,
page: currentPage
}
});
const numPages = Math.ceil(revisionsCount / PAGE_SIZE);
const [currentlySelectedRevision, setCurrentlySelectedRevision] = (0,external_wp_element_.useState)(currentEditorGlobalStyles);
const [
isLoadingRevisionWithUnsavedChanges,
setIsLoadingRevisionWithUnsavedChanges
] = (0,external_wp_element_.useState)(false);
const { setEditorCanvasContainerView } = unlock(
(0,external_wp_data_.useDispatch)(store)
);
const selectedRevisionMatchesEditorStyles = screen_revisions_areGlobalStyleConfigsEqual(
currentlySelectedRevision,
currentEditorGlobalStyles
);
const onCloseRevisions = () => {
const canvasContainerView = editorCanvasContainerView === "global-styles-revisions:style-book" ? "style-book" : void 0;
setEditorCanvasContainerView(canvasContainerView);
};
const restoreRevision = (revision) => {
setUserConfig(() => revision);
setIsLoadingRevisionWithUnsavedChanges(false);
onCloseRevisions();
};
(0,external_wp_element_.useEffect)(() => {
if (!isLoading && revisions.length) {
setCurrentRevisions(revisions);
}
}, [revisions, isLoading]);
const firstRevision = revisions[0];
const currentlySelectedRevisionId = currentlySelectedRevision?.id;
const shouldSelectFirstItem = !!firstRevision?.id && !selectedRevisionMatchesEditorStyles && !currentlySelectedRevisionId;
(0,external_wp_element_.useEffect)(() => {
if (shouldSelectFirstItem) {
setCurrentlySelectedRevision(firstRevision);
}
}, [shouldSelectFirstItem, firstRevision]);
const isLoadButtonEnabled = !!currentlySelectedRevisionId && currentlySelectedRevisionId !== "unsaved" && !selectedRevisionMatchesEditorStyles;
const hasRevisions = !!currentRevisions.length;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
header_default,
{
title: revisionsCount && // translators: %s: number of revisions.
(0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Revisions (%s)"), revisionsCount),
description: (0,external_wp_i18n_namespaceObject.__)(
`Click on previously saved styles to preview them. To restore a selected version to the editor, hit "Apply." When you're ready, use the Save button to save your changes.`
),
onBack: onCloseRevisions
}
),
!hasRevisions && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, { className: "edit-site-global-styles-screen-revisions__loading" }),
hasRevisions && (editorCanvasContainerView === "global-styles-revisions:style-book" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
style_book_default,
{
userConfig: currentlySelectedRevision,
isSelected: () => {
},
onClose: () => {
setEditorCanvasContainerView(
"global-styles-revisions"
);
}
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
revisions_default,
{
blocks,
userConfig: currentlySelectedRevision,
closeButtonLabel: (0,external_wp_i18n_namespaceObject.__)("Close revisions")
}
)),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
revisions_buttons_default,
{
onChange: setCurrentlySelectedRevision,
selectedRevisionId: currentlySelectedRevisionId,
userRevisions: currentRevisions,
canApplyRevision: isLoadButtonEnabled,
onApplyRevision: () => hasUnsavedChanges ? setIsLoadingRevisionWithUnsavedChanges(true) : restoreRevision(currentlySelectedRevision)
}
),
numPages > 1 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-global-styles-screen-revisions__footer", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Pagination,
{
className: "edit-site-global-styles-screen-revisions__pagination",
currentPage,
numPages,
changePage: setCurrentPage,
totalItems: revisionsCount,
disabled: isLoading,
label: (0,external_wp_i18n_namespaceObject.__)("Global Styles pagination")
}
) }),
isLoadingRevisionWithUnsavedChanges && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalConfirmDialog,
{
isOpen: isLoadingRevisionWithUnsavedChanges,
confirmButtonText: (0,external_wp_i18n_namespaceObject.__)("Apply"),
onConfirm: () => restoreRevision(currentlySelectedRevision),
onCancel: () => setIsLoadingRevisionWithUnsavedChanges(false),
size: "medium",
children: (0,external_wp_i18n_namespaceObject.__)(
"Are you sure you want to apply this revision? Any unsaved changes will be lost."
)
}
)
] });
}
var screen_revisions_default = ScreenRevisions;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/ui.js
const SLOT_FILL_NAME = "GlobalStylesMenu";
const { useGlobalStylesReset: ui_useGlobalStylesReset } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } = (0,external_wp_components_namespaceObject.createSlotFill)(SLOT_FILL_NAME);
function GlobalStylesActionMenu() {
const [canReset, onReset] = ui_useGlobalStylesReset();
const { toggle } = (0,external_wp_data_.useDispatch)(external_wp_preferences_.store);
const { canEditCSS } = (0,external_wp_data_.useSelect)((select) => {
const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } = select(external_wp_coreData_namespaceObject.store);
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
const globalStyles = globalStylesId ? getEntityRecord("root", "globalStyles", globalStylesId) : void 0;
return {
canEditCSS: !!globalStyles?._links?.["wp:action-edit-css"]
};
}, []);
const { setEditorCanvasContainerView } = unlock(
(0,external_wp_data_.useDispatch)(store)
);
const loadCustomCSS = () => {
setEditorCanvasContainerView("global-styles-css");
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesMenuFill, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropdownMenu,
{
icon: more_vertical_default,
label: (0,external_wp_i18n_namespaceObject.__)("More"),
toggleProps: { size: "compact" },
children: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { children: [
canEditCSS && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: loadCustomCSS, children: (0,external_wp_i18n_namespaceObject.__)("Additional CSS") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: () => {
toggle(
"core/edit-site",
"welcomeGuideStyles"
);
onClose();
},
children: (0,external_wp_i18n_namespaceObject.__)("Welcome Guide")
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: () => {
onReset();
onClose();
},
disabled: !canReset,
children: (0,external_wp_i18n_namespaceObject.__)("Reset styles")
}
) })
] })
}
) });
}
function GlobalStylesNavigationScreen({ className, ...props }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Navigator.Screen,
{
className: [
"edit-site-global-styles-sidebar__navigator-screen",
className
].filter(Boolean).join(" "),
...props
}
);
}
function BlockStylesNavigationScreens({
parentMenu,
blockStyles,
blockName
}) {
return blockStyles.map((style, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GlobalStylesNavigationScreen,
{
path: parentMenu + "/variations/" + style.name,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_block_default, { name: blockName, variation: style.name })
},
index
));
}
function ContextScreens({ name, parentMenu = "" }) {
const blockStyleVariations = (0,external_wp_data_.useSelect)(
(select) => {
const { getBlockStyles } = select(external_wp_blocks_namespaceObject.store);
return getBlockStyles(name);
},
[name]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GlobalStylesNavigationScreen,
{
path: parentMenu + "/colors/palette",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_color_palette_default, { name })
}
),
!!blockStyleVariations?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BlockStylesNavigationScreens,
{
parentMenu,
blockStyles: blockStyleVariations,
blockName: name
}
)
] });
}
function GlobalStylesStyleBook() {
const navigator = (0,external_wp_components_namespaceObject.useNavigator)();
const { path } = navigator.location;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
style_book_default,
{
isSelected: (blockName) => (
// Match '/blocks/core%2Fbutton' and
// '/blocks/core%2Fbutton/typography', but not
// '/blocks/core%2Fbuttons'.
path === `/blocks/${encodeURIComponent(blockName)}` || path.startsWith(
`/blocks/${encodeURIComponent(blockName)}/`
)
),
onSelect: (blockName) => {
if (STYLE_BOOK_COLOR_GROUPS.find(
(group) => group.slug === blockName
)) {
navigator.goTo("/colors/palette");
return;
}
if (blockName === "typography") {
navigator.goTo("/typography");
return;
}
navigator.goTo("/blocks/" + encodeURIComponent(blockName));
}
}
);
}
function GlobalStylesBlockLink() {
const navigator = (0,external_wp_components_namespaceObject.useNavigator)();
const { selectedBlockName, selectedBlockClientId } = (0,external_wp_data_.useSelect)(
(select) => {
const { getSelectedBlockClientId, getBlockName } = select(external_wp_blockEditor_namespaceObject.store);
const clientId = getSelectedBlockClientId();
return {
selectedBlockName: getBlockName(clientId),
selectedBlockClientId: clientId
};
},
[]
);
const blockHasGlobalStyles = useBlockHasGlobalStyles(selectedBlockName);
(0,external_wp_element_.useEffect)(() => {
if (!selectedBlockClientId || !blockHasGlobalStyles) {
return;
}
const currentPath = navigator.location.path;
if (currentPath !== "/blocks" && !currentPath.startsWith("/blocks/")) {
return;
}
const newPath = "/blocks/" + encodeURIComponent(selectedBlockName);
if (newPath !== currentPath) {
navigator.goTo(newPath, { skipFocus: true });
}
}, [selectedBlockClientId, selectedBlockName, blockHasGlobalStyles]);
}
function GlobalStylesEditorCanvasContainerLink() {
const { goTo, location } = (0,external_wp_components_namespaceObject.useNavigator)();
const editorCanvasContainerView = (0,external_wp_data_.useSelect)(
(select) => unlock(select(store)).getEditorCanvasContainerView(),
[]
);
const path = location?.path;
const isRevisionsOpen = path === "/revisions";
(0,external_wp_element_.useEffect)(() => {
switch (editorCanvasContainerView) {
case "global-styles-revisions":
case "global-styles-revisions:style-book":
if (!isRevisionsOpen) {
goTo("/revisions");
}
break;
case "global-styles-css":
goTo("/css");
break;
// The stand-alone style book is open
// and the revisions panel is open,
// close the revisions panel.
// Otherwise keep the style book open while
// browsing global styles panel.
//
// Falling through as it matches the default scenario.
case "style-book":
default:
if (isRevisionsOpen) {
goTo("/", { isBack: true });
}
break;
}
}, [editorCanvasContainerView, isRevisionsOpen, goTo]);
}
function useNavigatorSync(parentPath, onPathChange) {
const navigator = (0,external_wp_components_namespaceObject.useNavigator)();
const { path: childPath } = navigator.location;
const previousParentPath = (0,external_wp_compose_namespaceObject.usePrevious)(parentPath);
const previousChildPath = (0,external_wp_compose_namespaceObject.usePrevious)(childPath);
(0,external_wp_element_.useEffect)(() => {
if (parentPath !== childPath) {
if (parentPath !== previousParentPath) {
navigator.goTo(parentPath);
} else if (childPath !== previousChildPath) {
onPathChange(childPath);
}
}
}, [
onPathChange,
parentPath,
previousChildPath,
previousParentPath,
childPath,
navigator
]);
}
function NavigationSync({ path: parentPath, onPathChange, children }) {
useNavigatorSync(parentPath, onPathChange);
return children;
}
function GlobalStylesUI({ path, onPathChange }) {
const blocks = (0,external_wp_blocks_namespaceObject.getBlockTypes)();
const editorCanvasContainerView = (0,external_wp_data_.useSelect)(
(select) => unlock(select(store)).getEditorCanvasContainerView(),
[]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Navigator,
{
className: "edit-site-global-styles-sidebar__navigator-provider",
initialPath: "/",
children: [
path && onPathChange && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationSync, { path, onPathChange }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_root_default, {}) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/variations", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_style_variations_default, {}) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/blocks", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_block_list_default, {}) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/typography", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_typography_default, {}) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/typography/font-sizes", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes_default, {}) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/typography/font-sizes/:origin/:slug", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(font_size_default, {}) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/typography/text", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_typography_element_default, { element: "text" }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/typography/link", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_typography_element_default, { element: "link" }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/typography/heading", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_typography_element_default, { element: "heading" }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/typography/caption", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_typography_element_default, { element: "caption" }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/typography/button", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_typography_element_default, { element: "button" }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/colors", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_colors_default, {}) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/shadows", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ScreenShadows, {}) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/shadows/edit/:category/:slug", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ScreenShadowsEdit, {}) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/layout", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_layout_default, {}) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/css", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_css_default, {}) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/revisions", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_revisions_default, {}) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/background", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_background_default, {}) }),
blocks.map((block) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GlobalStylesNavigationScreen,
{
path: "/blocks/" + encodeURIComponent(block.name),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_block_default, { name: block.name })
},
"menu-block-" + block.name
)),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextScreens, {}),
blocks.map((block) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ContextScreens,
{
name: block.name,
parentMenu: "/blocks/" + encodeURIComponent(block.name)
},
"screens-block-" + block.name
)),
"style-book" === editorCanvasContainerView && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesStyleBook, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesActionMenu, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesBlockLink, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesEditorCanvasContainerLink, {})
]
}
);
}
var ui_default = GlobalStylesUI;
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/index.js
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles-sidebar/default-sidebar.js
const { ComplementaryArea, ComplementaryAreaMoreMenuItem } = unlock(external_wp_editor_namespaceObject.privateApis);
function DefaultSidebar({
className,
identifier,
title,
icon,
children,
closeLabel,
header,
headerClassName,
panelClassName,
isActiveByDefault
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ComplementaryArea,
{
className,
scope: "core",
identifier,
title,
icon,
closeLabel,
header,
headerClassName,
panelClassName,
isActiveByDefault,
children
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ComplementaryAreaMoreMenuItem,
{
scope: "core",
identifier,
icon,
children: title
}
)
] });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles-sidebar/index.js
const { interfaceStore: global_styles_sidebar_interfaceStore } = unlock(external_wp_editor_namespaceObject.privateApis);
const { useLocation: global_styles_sidebar_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
function GlobalStylesSidebar() {
const { query } = global_styles_sidebar_useLocation();
const { canvas = "view", name } = query;
const {
shouldClearCanvasContainerView,
isStyleBookOpened,
showListViewByDefault,
hasRevisions,
isRevisionsOpened,
isRevisionsStyleBookOpened
} = (0,external_wp_data_.useSelect)(
(select) => {
const { getActiveComplementaryArea: getActiveComplementaryArea2 } = select(global_styles_sidebar_interfaceStore);
const { getEditorCanvasContainerView } = unlock(
select(store)
);
const canvasContainerView = getEditorCanvasContainerView();
const _isVisualEditorMode = "visual" === select(external_wp_editor_namespaceObject.store).getEditorMode();
const _isEditCanvasMode = "edit" === canvas;
const _showListViewByDefault = select(external_wp_preferences_.store).get(
"core",
"showListViewByDefault"
);
const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } = select(external_wp_coreData_namespaceObject.store);
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
const globalStyles = globalStylesId ? getEntityRecord("root", "globalStyles", globalStylesId) : void 0;
return {
isStyleBookOpened: "style-book" === canvasContainerView,
shouldClearCanvasContainerView: "edit-site/global-styles" !== getActiveComplementaryArea2("core") || !_isVisualEditorMode || !_isEditCanvasMode,
showListViewByDefault: _showListViewByDefault,
hasRevisions: !!globalStyles?._links?.["version-history"]?.[0]?.count,
isRevisionsStyleBookOpened: "global-styles-revisions:style-book" === canvasContainerView,
isRevisionsOpened: "global-styles-revisions" === canvasContainerView
};
},
[canvas]
);
const { setEditorCanvasContainerView } = unlock(
(0,external_wp_data_.useDispatch)(store)
);
const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
(0,external_wp_element_.useEffect)(() => {
if (shouldClearCanvasContainerView) {
setEditorCanvasContainerView(void 0);
}
}, [shouldClearCanvasContainerView, setEditorCanvasContainerView]);
const { setIsListViewOpened } = (0,external_wp_data_.useDispatch)(external_wp_editor_namespaceObject.store);
const toggleRevisions = () => {
setIsListViewOpened(false);
if (isRevisionsStyleBookOpened) {
setEditorCanvasContainerView("style-book");
return;
}
if (isRevisionsOpened) {
setEditorCanvasContainerView(void 0);
return;
}
if (isStyleBookOpened) {
setEditorCanvasContainerView(
"global-styles-revisions:style-book"
);
} else {
setEditorCanvasContainerView("global-styles-revisions");
}
};
const toggleStyleBook = () => {
if (isRevisionsOpened) {
setEditorCanvasContainerView(
"global-styles-revisions:style-book"
);
return;
}
if (isRevisionsStyleBookOpened) {
setEditorCanvasContainerView("global-styles-revisions");
return;
}
setIsListViewOpened(isStyleBookOpened && showListViewByDefault);
setEditorCanvasContainerView(
isStyleBookOpened ? void 0 : "style-book"
);
};
const { getActiveComplementaryArea } = (0,external_wp_data_.useSelect)(global_styles_sidebar_interfaceStore);
const { enableComplementaryArea } = (0,external_wp_data_.useDispatch)(global_styles_sidebar_interfaceStore);
const previousActiveAreaRef = (0,external_wp_element_.useRef)(null);
(0,external_wp_element_.useEffect)(() => {
if (name === "styles" && canvas === "edit") {
previousActiveAreaRef.current = getActiveComplementaryArea("core");
enableComplementaryArea("core", "edit-site/global-styles");
} else if (previousActiveAreaRef.current) {
enableComplementaryArea("core", previousActiveAreaRef.current);
}
}, [name, enableComplementaryArea, canvas, getActiveComplementaryArea]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DefaultSidebar,
{
className: "edit-site-global-styles-sidebar",
identifier: "edit-site/global-styles",
title: (0,external_wp_i18n_namespaceObject.__)("Styles"),
icon: styles_default,
closeLabel: (0,external_wp_i18n_namespaceObject.__)("Close Styles"),
panelClassName: "edit-site-global-styles-sidebar__panel",
header: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Flex,
{
className: "edit-site-global-styles-sidebar__header",
gap: 1,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "edit-site-global-styles-sidebar__header-title", children: (0,external_wp_i18n_namespaceObject.__)("Styles") }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Flex,
{
justify: "flex-end",
gap: 1,
className: "edit-site-global-styles-sidebar__header-actions",
children: [
!isMobileViewport && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
icon: seen_default,
label: (0,external_wp_i18n_namespaceObject.__)("Style Book"),
isPressed: isStyleBookOpened || isRevisionsStyleBookOpened,
accessibleWhenDisabled: true,
disabled: shouldClearCanvasContainerView,
onClick: toggleStyleBook,
size: "compact"
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
label: (0,external_wp_i18n_namespaceObject.__)("Revisions"),
icon: backup_default,
onClick: toggleRevisions,
accessibleWhenDisabled: true,
disabled: !hasRevisions,
isPressed: isRevisionsOpened || isRevisionsStyleBookOpened,
size: "compact"
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesMenuSlot, {})
]
}
)
]
}
),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ui_default, {})
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/download.js
var download_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z" }) });
;// external ["wp","blob"]
const external_wp_blob_namespaceObject = window["wp"]["blob"];
;// ./node_modules/@wordpress/edit-site/build-module/components/more-menu/site-export.js
function SiteExport() {
const canExport = (0,external_wp_data_.useSelect)((select) => {
const targetHints = select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?._links?.["wp:export-theme"]?.[0]?.targetHints ?? {};
return !!targetHints.allow?.includes("GET");
}, []);
const { createErrorNotice } = (0,external_wp_data_.useDispatch)(external_wp_notices_namespaceObject.store);
if (!canExport) {
return null;
}
async function handleExport() {
try {
const response = await external_wp_apiFetch_default()({
path: "/wp-block-editor/v1/export",
parse: false,
headers: {
Accept: "application/zip"
}
});
const blob = await response.blob();
const contentDisposition = response.headers.get(
"content-disposition"
);
const contentDispositionMatches = contentDisposition.match(/=(.+)\.zip/);
const fileName = contentDispositionMatches[1] ? contentDispositionMatches[1] : "edit-site-export";
(0,external_wp_blob_namespaceObject.downloadBlob)(fileName + ".zip", blob, "application/zip");
} catch (errorResponse) {
let error = {};
try {
error = await errorResponse.json();
} catch (e) {
}
const errorMessage = error.message && error.code !== "unknown_error" ? error.message : (0,external_wp_i18n_namespaceObject.__)("An error occurred while creating the site export.");
createErrorNotice(errorMessage, { type: "snackbar" });
}
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
role: "menuitem",
icon: download_default,
onClick: handleExport,
info: (0,external_wp_i18n_namespaceObject.__)(
"Download your theme with updated templates and styles."
),
children: (0,external_wp_i18n_namespaceObject._x)("Export", "site exporter menu item")
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/more-menu/welcome-guide-menu-item.js
function WelcomeGuideMenuItem() {
const { toggle } = (0,external_wp_data_.useDispatch)(external_wp_preferences_.store);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => toggle("core/edit-site", "welcomeGuide"), children: (0,external_wp_i18n_namespaceObject.__)("Welcome Guide") });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/more-menu/index.js
const { ToolsMoreMenuGroup, PreferencesModal } = unlock(external_wp_editor_namespaceObject.privateApis);
function MoreMenu() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ToolsMoreMenuGroup, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteExport, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideMenuItem, {})
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModal, {})
] });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/block-editor/use-editor-iframe-props.js
const { useLocation: use_editor_iframe_props_useLocation, useHistory: use_editor_iframe_props_useHistory } = unlock(external_wp_router_namespaceObject.privateApis);
function useEditorIframeProps() {
const { query, path } = use_editor_iframe_props_useLocation();
const history = use_editor_iframe_props_useHistory();
const { canvas = "view" } = query;
const currentPostIsTrashed = (0,external_wp_data_.useSelect)((select) => {
return select(external_wp_editor_namespaceObject.store).getCurrentPostAttribute("status") === "trash";
}, []);
const [isFocused, setIsFocused] = (0,external_wp_element_.useState)(false);
(0,external_wp_element_.useEffect)(() => {
if (canvas === "edit") {
setIsFocused(false);
}
}, [canvas]);
const viewModeIframeProps = {
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Edit"),
"aria-disabled": currentPostIsTrashed,
title: null,
role: "button",
tabIndex: 0,
onFocus: () => setIsFocused(true),
onBlur: () => setIsFocused(false),
onKeyDown: (event) => {
const { keyCode } = event;
if ((keyCode === external_wp_keycodes_namespaceObject.ENTER || keyCode === external_wp_keycodes_namespaceObject.SPACE) && !currentPostIsTrashed) {
event.preventDefault();
history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { canvas: "edit" }), {
transition: "canvas-mode-edit-transition"
});
}
},
onClick: () => history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { canvas: "edit" }), {
transition: "canvas-mode-edit-transition"
}),
onClickCapture: (event) => {
if (currentPostIsTrashed) {
event.preventDefault();
event.stopPropagation();
}
},
readonly: true
};
return {
className: dist_clsx("edit-site-visual-editor__editor-canvas", {
"is-focused": isFocused && canvas === "view"
}),
...canvas === "view" ? viewModeIframeProps : {}
};
}
;// ./node_modules/@wordpress/edit-site/build-module/components/routes/use-title.js
const { useLocation: use_title_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
function useTitle(title) {
const location = use_title_useLocation();
const siteTitle = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).getEntityRecord("root", "site")?.title,
[]
);
const isInitialLocationRef = (0,external_wp_element_.useRef)(true);
(0,external_wp_element_.useEffect)(() => {
isInitialLocationRef.current = false;
}, [location]);
(0,external_wp_element_.useEffect)(() => {
if (isInitialLocationRef.current) {
return;
}
if (title && siteTitle) {
const formattedTitle = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: Admin document title. 1: Admin screen name, 2: Network or site name. */
(0,external_wp_i18n_namespaceObject.__)("%1$s \u2039 %2$s \u2039 Editor \u2014 WordPress"),
(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title),
(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteTitle)
);
document.title = formattedTitle;
(0,external_wp_a11y_namespaceObject.speak)(title, "assertive");
}
}, [title, siteTitle, location]);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/editor/use-editor-title.js
const { getTemplateInfo } = unlock(external_wp_editor_namespaceObject.privateApis);
function useEditorTitle(postType, postId) {
const { title, isLoaded } = (0,external_wp_data_.useSelect)(
(select) => {
const {
getEditedEntityRecord,
getCurrentTheme,
hasFinishedResolution
} = select(external_wp_coreData_namespaceObject.store);
if (!postId) {
return { isLoaded: false };
}
const _record = getEditedEntityRecord(
"postType",
postType,
postId
);
const { default_template_types: templateTypes = [] } = getCurrentTheme() ?? {};
const templateInfo = getTemplateInfo({
template: _record,
templateTypes
});
const _isLoaded = hasFinishedResolution("getEditedEntityRecord", [
"postType",
postType,
postId
]);
return {
title: templateInfo.title,
isLoaded: _isLoaded
};
},
[postType, postId]
);
let editorTitle;
if (isLoaded) {
editorTitle = (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: A breadcrumb trail for the Admin document title. 1: title of template being edited, 2: type of template (Template or Template Part).
(0,external_wp_i18n_namespaceObject._x)("%1$s \u2039 %2$s", "breadcrumb trail"),
(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title),
POST_TYPE_LABELS[postType] ?? POST_TYPE_LABELS[TEMPLATE_POST_TYPE]
);
}
useTitle(isLoaded && editorTitle);
}
var use_editor_title_default = useEditorTitle;
;// ./node_modules/@wordpress/edit-site/build-module/components/editor/use-adapt-editor-to-canvas.js
function useAdaptEditorToCanvas(canvas) {
const { clearSelectedBlock } = (0,external_wp_data_.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const {
setDeviceType,
closePublishSidebar,
setIsListViewOpened,
setIsInserterOpened
} = (0,external_wp_data_.useDispatch)(external_wp_editor_namespaceObject.store);
const { get: getPreference } = (0,external_wp_data_.useSelect)(external_wp_preferences_.store);
const registry = (0,external_wp_data_.useRegistry)();
(0,external_wp_element_.useLayoutEffect)(() => {
const isMediumOrBigger = window.matchMedia("(min-width: 782px)").matches;
registry.batch(() => {
clearSelectedBlock();
setDeviceType("Desktop");
closePublishSidebar();
setIsInserterOpened(false);
if (isMediumOrBigger && canvas === "edit" && getPreference("core", "showListViewByDefault") && !getPreference("core", "distractionFree")) {
setIsListViewOpened(true);
} else {
setIsListViewOpened(false);
}
});
}, [
canvas,
registry,
clearSelectedBlock,
setDeviceType,
closePublishSidebar,
setIsInserterOpened,
setIsListViewOpened,
getPreference
]);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/editor/use-resolve-edited-entity.js
const { useLocation: use_resolve_edited_entity_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
const postTypesWithoutParentTemplate = [
TEMPLATE_POST_TYPE,
TEMPLATE_PART_POST_TYPE,
NAVIGATION_POST_TYPE,
PATTERN_TYPES.user
];
const authorizedPostTypes = ["page", "post"];
function useResolveEditedEntity() {
const { name, params = {}, query } = use_resolve_edited_entity_useLocation();
const { postId = query?.postId } = params;
let postType;
if (name === "navigation-item") {
postType = NAVIGATION_POST_TYPE;
} else if (name === "pattern-item") {
postType = PATTERN_TYPES.user;
} else if (name === "template-part-item") {
postType = TEMPLATE_PART_POST_TYPE;
} else if (name === "template-item" || name === "templates") {
postType = TEMPLATE_POST_TYPE;
} else if (name === "page-item" || name === "pages") {
postType = "page";
} else if (name === "post-item" || name === "posts") {
postType = "post";
}
const homePage = (0,external_wp_data_.useSelect)((select) => {
const { getHomePage } = unlock(select(external_wp_coreData_namespaceObject.store));
return getHomePage();
}, []);
const resolvedTemplateId = (0,external_wp_data_.useSelect)(
(select) => {
if (postTypesWithoutParentTemplate.includes(postType) && postId) {
return;
}
if (postId && postId.includes(",")) {
return;
}
const { getTemplateId } = unlock(select(external_wp_coreData_namespaceObject.store));
if (postType && postId && authorizedPostTypes.includes(postType)) {
return getTemplateId(postType, postId);
}
if (homePage?.postType === "page") {
return getTemplateId("page", homePage?.postId);
}
if (homePage?.postType === "wp_template") {
return homePage?.postId;
}
},
[homePage, postId, postType]
);
const context = (0,external_wp_element_.useMemo)(() => {
if (postTypesWithoutParentTemplate.includes(postType) && postId) {
return {};
}
if (postType && postId && authorizedPostTypes.includes(postType)) {
return { postType, postId };
}
if (homePage?.postType === "page") {
return { postType: "page", postId: homePage?.postId };
}
return {};
}, [homePage, postType, postId]);
if (postTypesWithoutParentTemplate.includes(postType) && postId) {
return { isReady: true, postType, postId, context };
}
if (!!homePage) {
return {
isReady: resolvedTemplateId !== void 0,
postType: TEMPLATE_POST_TYPE,
postId: resolvedTemplateId,
context
};
}
return { isReady: false };
}
function useSyncDeprecatedEntityIntoState({
postType,
postId,
context,
isReady
}) {
const { setEditedEntity } = (0,external_wp_data_.useDispatch)(store);
(0,external_wp_element_.useEffect)(() => {
if (isReady) {
setEditedEntity(postType, postId, context);
}
}, [isReady, postType, postId, context, setEditedEntity]);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/editor/site-preview.js
function SitePreview() {
const siteUrl = (0,external_wp_data_.useSelect)((select) => {
const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store);
const siteData = getEntityRecord("root", "__unstableBase");
return siteData?.home;
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"iframe",
{
src: (0,external_wp_url_namespaceObject.addQueryArgs)(siteUrl, {
// Parameter for hiding the admin bar.
wp_site_preview: 1
}),
title: (0,external_wp_i18n_namespaceObject.__)("Site Preview"),
style: {
display: "block",
width: "100%",
height: "100%",
backgroundColor: "#fff"
},
onLoad: (event) => {
const document = event.target.contentDocument;
const focusableElements = external_wp_dom_namespaceObject.focus.focusable.find(document);
focusableElements.forEach((element) => {
element.style.pointerEvents = "none";
element.tabIndex = -1;
element.setAttribute("aria-hidden", "true");
});
}
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/editor/index.js
const { Editor, BackButton } = unlock(external_wp_editor_namespaceObject.privateApis);
const { useHistory: editor_useHistory, useLocation: editor_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
const { BlockKeyboardShortcuts } = unlock(external_wp_blockLibrary_namespaceObject.privateApis);
const toggleHomeIconVariants = {
edit: {
opacity: 0,
scale: 0.2
},
hover: {
opacity: 1,
scale: 1,
clipPath: "inset( 22% round 2px )"
}
};
const siteIconVariants = {
edit: {
clipPath: "inset(0% round 0px)"
},
hover: {
clipPath: "inset( 22% round 2px )"
},
tap: {
clipPath: "inset(0% round 0px)"
}
};
function getListPathForPostType(postType) {
switch (postType) {
case "navigation":
return "/navigation";
case "wp_block":
return "/pattern?postType=wp_block";
case "wp_template_part":
return "/pattern?postType=wp_template_part";
case "wp_template":
return "/template";
case "page":
return "/page";
case "post":
return "/";
}
throw "Unknown post type";
}
function getNavigationPath(location, postType) {
const { path, name } = location;
if ([
"pattern-item",
"template-part-item",
"page-item",
"template-item",
"post-item"
].includes(name)) {
return getListPathForPostType(postType);
}
return (0,external_wp_url_namespaceObject.addQueryArgs)(path, { canvas: void 0 });
}
function EditSiteEditor({
isHomeRoute = false,
isPostsList = false
}) {
const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
const location = editor_useLocation();
const { canvas = "view" } = location.query;
const isLoading = useIsSiteEditorLoading();
useAdaptEditorToCanvas(canvas);
const entity = useResolveEditedEntity();
useSyncDeprecatedEntityIntoState(entity);
const { postType, postId, context } = entity;
const {
isBlockBasedTheme,
editorCanvasView,
currentPostIsTrashed,
hasSiteIcon
} = (0,external_wp_data_.useSelect)((select) => {
const { getEditorCanvasContainerView } = unlock(
select(store)
);
const { getCurrentTheme, getEntityRecord } = select(external_wp_coreData_namespaceObject.store);
const siteData = getEntityRecord("root", "__unstableBase", void 0);
return {
isBlockBasedTheme: getCurrentTheme()?.is_block_theme,
editorCanvasView: getEditorCanvasContainerView(),
currentPostIsTrashed: select(external_wp_editor_namespaceObject.store).getCurrentPostAttribute("status") === "trash",
hasSiteIcon: !!siteData?.site_icon_url
};
}, []);
const postWithTemplate = !!context?.postId;
use_editor_title_default(
postWithTemplate ? context.postType : postType,
postWithTemplate ? context.postId : postId
);
const _isPreviewingTheme = isPreviewingTheme();
const hasDefaultEditorCanvasView = !useHasEditorCanvasContainer();
const iframeProps = useEditorIframeProps();
const isEditMode = canvas === "edit";
const loadingProgressId = (0,external_wp_compose_namespaceObject.useInstanceId)(
CanvasLoader,
"edit-site-editor__loading-progress"
);
const settings = useSpecificEditorSettings();
const styles = (0,external_wp_element_.useMemo)(
() => [
...settings.styles,
{
// Forming a "block formatting context" to prevent margin collapsing.
// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
css: canvas === "view" ? `body{min-height: 100vh; ${currentPostIsTrashed ? "" : "cursor: pointer;"}}` : void 0
}
],
[settings.styles, canvas, currentPostIsTrashed]
);
const { resetZoomLevel } = unlock((0,external_wp_data_.useDispatch)(external_wp_blockEditor_namespaceObject.store));
const { createSuccessNotice } = (0,external_wp_data_.useDispatch)(external_wp_notices_namespaceObject.store);
const history = editor_useHistory();
const onActionPerformed = (0,external_wp_element_.useCallback)(
(actionId, items) => {
switch (actionId) {
case "move-to-trash":
case "delete-post":
{
history.navigate(
getListPathForPostType(
postWithTemplate ? context.postType : postType
)
);
}
break;
case "duplicate-post":
{
const newItem = items[0];
const _title = typeof newItem.title === "string" ? newItem.title : newItem.title?.rendered;
createSuccessNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Title of the created post or template, e.g: "Hello world".
(0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'),
(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(_title) || (0,external_wp_i18n_namespaceObject.__)("(no title)")
),
{
type: "snackbar",
id: "duplicate-post-action",
actions: [
{
label: (0,external_wp_i18n_namespaceObject.__)("Edit"),
onClick: () => {
history.navigate(
`/${newItem.type}/${newItem.id}?canvas=edit`
);
}
}
]
}
);
}
break;
}
},
[
postType,
context?.postType,
postWithTemplate,
history,
createSuccessNotice
]
);
const title = getEditorCanvasContainerTitle(editorCanvasView);
const isReady = !isLoading;
const transition = {
duration: disableMotion ? 0 : 0.2
};
return !isBlockBasedTheme && isHomeRoute ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SitePreview, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GlobalStylesRenderer,
{
disableRootPadding: postType !== TEMPLATE_POST_TYPE
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorKeyboardShortcutsRegister, {}),
isEditMode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}),
!isReady ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CanvasLoader, { id: loadingProgressId }) : null,
isEditMode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
WelcomeGuide,
{
postType: postWithTemplate ? context.postType : postType
}
),
isReady && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
Editor,
{
postType: postWithTemplate ? context.postType : postType,
postId: postWithTemplate ? context.postId : postId,
templateId: postWithTemplate ? postId : void 0,
settings,
className: "edit-site-editor__editor-interface",
styles,
customSaveButton: _isPreviewingTheme && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SaveButton, { size: "compact" }),
customSavePanel: _isPreviewingTheme && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SavePanel, {}),
forceDisableBlockTools: !hasDefaultEditorCanvasView,
title,
iframeProps,
onActionPerformed,
extraSidebarPanels: !postWithTemplate && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_template_setting_panel_default.Slot, {}),
children: [
isEditMode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BackButton, { children: ({ length }) => length <= 1 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
className: "edit-site-editor__view-mode-toggle",
transition,
animate: "edit",
initial: "edit",
whileHover: "hover",
whileTap: "tap",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Open Navigation"),
showTooltip: true,
tooltipPosition: "middle right",
onClick: () => {
resetZoomLevel();
if (isPostsList && location.query?.focusMode) {
history.navigate("/", {
transition: "canvas-mode-view-transition"
});
} else {
history.navigate(
getNavigationPath(
location,
postWithTemplate ? context.postType : postType
),
{
transition: "canvas-mode-view-transition"
}
);
}
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
variants: siteIconVariants,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(site_icon_default, { className: "edit-site-editor__view-mode-toggle-icon" })
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
className: dist_clsx(
"edit-site-editor__back-icon",
{
"has-site-icon": hasSiteIcon
}
),
variants: toggleHomeIconVariants,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon: arrow_up_left_default })
}
)
]
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MoreMenu, {}),
isBlockBasedTheme && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesSidebar, {})
]
}
)
] });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/utils.js
function isClassicThemeWithStyleBookSupport(siteData) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
const supportsEditorStyles = siteData.currentTheme?.theme_supports["editor-styles"];
const hasThemeJson = siteData.editorSettings?.supportsLayout;
return !isBlockTheme && (supportsEditorStyles || hasThemeJson);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/home.js
const homeRoute = {
name: "home",
path: "/",
areas: {
sidebar({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenMain, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
},
preview({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { isHomeRoute: true }) : void 0;
},
mobile({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenMain, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
}
}
};
;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/styles.js
const { useLocation: styles_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
function MobileGlobalStylesUI() {
const { query = {} } = styles_useLocation();
const { canvas } = query;
if (canvas === "edit") {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesUIWrapper, {});
}
const stylesRoute = {
name: "styles",
path: "/styles",
areas: {
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesUIWrapper, {}),
sidebar: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenGlobalStyles, { backPath: "/" }),
preview({ query }) {
const isStylebook = query.preview === "stylebook";
return isStylebook ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleBookPreview, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {});
},
mobile: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MobileGlobalStylesUI, {})
},
widths: {
content: 380
}
};
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js
const PRELOADED_NAVIGATION_MENUS_QUERY = {
per_page: 100,
status: ["publish", "draft"],
order: "desc",
orderby: "date"
};
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js
const notEmptyString = (testString) => testString?.trim()?.length > 0;
function RenameModal({ menuTitle, onClose, onSave }) {
const [editedMenuTitle, setEditedMenuTitle] = (0,external_wp_element_.useState)(menuTitle);
const titleHasChanged = editedMenuTitle !== menuTitle;
const isEditedMenuTitleValid = titleHasChanged && notEmptyString(editedMenuTitle);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
title: (0,external_wp_i18n_namespaceObject.__)("Rename"),
onRequestClose: onClose,
focusOnMount: "firstContentElement",
size: "small",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { className: "sidebar-navigation__rename-modal-form", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "3", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
value: editedMenuTitle,
placeholder: (0,external_wp_i18n_namespaceObject.__)("Navigation title"),
onChange: setEditedMenuTitle,
label: (0,external_wp_i18n_namespaceObject.__)("Name")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: onClose,
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
accessibleWhenDisabled: true,
disabled: !isEditedMenuTitleValid,
variant: "primary",
type: "submit",
onClick: (e) => {
e.preventDefault();
if (!isEditedMenuTitleValid) {
return;
}
onSave({ title: editedMenuTitle });
onClose();
},
children: (0,external_wp_i18n_namespaceObject.__)("Save")
}
)
] })
] }) })
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js
function DeleteConfirmDialog({ onClose, onConfirm }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalConfirmDialog,
{
isOpen: true,
onConfirm: () => {
onConfirm();
onClose();
},
onCancel: onClose,
confirmButtonText: (0,external_wp_i18n_namespaceObject.__)("Delete"),
size: "medium",
children: (0,external_wp_i18n_namespaceObject.__)("Are you sure you want to delete this Navigation Menu?")
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js
const { useHistory: more_menu_useHistory } = unlock(external_wp_router_namespaceObject.privateApis);
const POPOVER_PROPS = {
position: "bottom right"
};
function ScreenNavigationMoreMenu(props) {
const { onDelete, onSave, onDuplicate, menuTitle, menuId } = props;
const [renameModalOpen, setRenameModalOpen] = (0,external_wp_element_.useState)(false);
const [deleteConfirmDialogOpen, setDeleteConfirmDialogOpen] = (0,external_wp_element_.useState)(false);
const history = more_menu_useHistory();
const closeModals = () => {
setRenameModalOpen(false);
setDeleteConfirmDialogOpen(false);
};
const openRenameModal = () => setRenameModalOpen(true);
const openDeleteConfirmDialog = () => setDeleteConfirmDialogOpen(true);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropdownMenu,
{
className: "sidebar-navigation__more-menu",
label: (0,external_wp_i18n_namespaceObject.__)("Actions"),
icon: more_vertical_default,
popoverProps: POPOVER_PROPS,
children: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: () => {
openRenameModal();
onClose();
},
children: (0,external_wp_i18n_namespaceObject.__)("Rename")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: () => {
history.navigate(
`/wp_navigation/${menuId}?canvas=edit`
);
},
children: (0,external_wp_i18n_namespaceObject.__)("Edit")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: () => {
onDuplicate();
onClose();
},
children: (0,external_wp_i18n_namespaceObject.__)("Duplicate")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
isDestructive: true,
onClick: () => {
openDeleteConfirmDialog();
onClose();
},
children: (0,external_wp_i18n_namespaceObject.__)("Delete")
}
)
] })
}
),
deleteConfirmDialogOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DeleteConfirmDialog,
{
onClose: closeModals,
onConfirm: onDelete
}
),
renameModalOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
RenameModal,
{
onClose: closeModals,
menuTitle,
onSave
}
)
] });
}
;// ./node_modules/@wordpress/icons/build-module/library/chevron-up.js
var chevron_up_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/chevron-down.js
var chevron_down_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" }) });
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js
const leaf_more_menu_POPOVER_PROPS = {
className: "block-editor-block-settings-menu__popover",
placement: "bottom-start"
};
const { useHistory: leaf_more_menu_useHistory, useLocation: leaf_more_menu_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
function LeafMoreMenu(props) {
const history = leaf_more_menu_useHistory();
const { path } = leaf_more_menu_useLocation();
const { block } = props;
const { clientId } = block;
const { moveBlocksDown, moveBlocksUp, removeBlocks } = (0,external_wp_data_.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const removeLabel = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: block name */
(0,external_wp_i18n_namespaceObject.__)("Remove %s"),
(0,external_wp_blockEditor_namespaceObject.BlockTitle)({ clientId, maximumLength: 25 })
);
const goToLabel = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: block name */
(0,external_wp_i18n_namespaceObject.__)("Go to %s"),
(0,external_wp_blockEditor_namespaceObject.BlockTitle)({ clientId, maximumLength: 25 })
);
const rootClientId = (0,external_wp_data_.useSelect)(
(select) => {
const { getBlockRootClientId } = select(external_wp_blockEditor_namespaceObject.store);
return getBlockRootClientId(clientId);
},
[clientId]
);
const onGoToPage = (0,external_wp_element_.useCallback)(
(selectedBlock) => {
const { attributes, name } = selectedBlock;
if (attributes.kind === "post-type" && attributes.id && attributes.type && history) {
history.navigate(
`/${attributes.type}/${attributes.id}?canvas=edit`,
{
state: { backPath: path }
}
);
}
if (name === "core/page-list-item" && attributes.id && history) {
history.navigate(`/page/${attributes.id}?canvas=edit`, {
state: { backPath: path }
});
}
},
[path, history]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropdownMenu,
{
icon: more_vertical_default,
label: (0,external_wp_i18n_namespaceObject.__)("Options"),
className: "block-editor-block-settings-menu",
popoverProps: leaf_more_menu_POPOVER_PROPS,
noIcons: true,
...props,
children: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
icon: chevron_up_default,
onClick: () => {
moveBlocksUp([clientId], rootClientId);
onClose();
},
children: (0,external_wp_i18n_namespaceObject.__)("Move up")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
icon: chevron_down_default,
onClick: () => {
moveBlocksDown([clientId], rootClientId);
onClose();
},
children: (0,external_wp_i18n_namespaceObject.__)("Move down")
}
),
block.attributes?.type === "page" && block.attributes?.id && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: () => {
onGoToPage(block);
onClose();
},
children: goToLabel
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: () => {
removeBlocks([clientId], false);
onClose();
},
children: removeLabel
}
) })
] })
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js
const { PrivateListView } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const MAX_PAGE_COUNT = 100;
const PAGES_QUERY = [
"postType",
"page",
{
per_page: MAX_PAGE_COUNT,
_fields: ["id", "link", "menu_order", "parent", "title", "type"],
// TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby
// values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent
// sort.
orderby: "menu_order",
order: "asc"
}
];
function NavigationMenuContent({ rootClientId }) {
const { listViewRootClientId, isLoading } = (0,external_wp_data_.useSelect)(
(select) => {
const {
areInnerBlocksControlled,
getBlockName,
getBlockCount,
getBlockOrder
} = select(external_wp_blockEditor_namespaceObject.store);
const { isResolving } = select(external_wp_coreData_namespaceObject.store);
const blockClientIds = getBlockOrder(rootClientId);
const hasOnlyPageListBlock = blockClientIds.length === 1 && getBlockName(blockClientIds[0]) === "core/page-list";
const pageListHasBlocks = hasOnlyPageListBlock && getBlockCount(blockClientIds[0]) > 0;
const isLoadingPages = isResolving(
"getEntityRecords",
PAGES_QUERY
);
return {
listViewRootClientId: pageListHasBlocks ? blockClientIds[0] : rootClientId,
// This is a small hack to wait for the navigation block
// to actually load its inner blocks.
isLoading: !areInnerBlocksControlled(rootClientId) || isLoadingPages
};
},
[rootClientId]
);
const { replaceBlock, __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const offCanvasOnselect = (0,external_wp_element_.useCallback)(
(block) => {
if (block.name === "core/navigation-link" && !block.attributes.url) {
__unstableMarkNextChangeAsNotPersistent();
replaceBlock(
block.clientId,
(0,external_wp_blocks_namespaceObject.createBlock)("core/navigation-link", block.attributes)
);
}
},
[__unstableMarkNextChangeAsNotPersistent, replaceBlock]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
!isLoading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PrivateListView,
{
rootClientId: listViewRootClientId,
onSelect: offCanvasOnselect,
blockSettingsMenu: LeafMoreMenu,
showAppender: false,
isExpanded: true
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-sidebar-navigation-screen-navigation-menus__helper-block-editor", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, {}) })
] });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js
const navigation_menu_editor_noop = () => {
};
function NavigationMenuEditor({ navigationMenuId }) {
const { storedSettings } = (0,external_wp_data_.useSelect)((select) => {
const { getSettings } = unlock(select(store));
return {
storedSettings: getSettings()
};
}, []);
const blocks = (0,external_wp_element_.useMemo)(() => {
if (!navigationMenuId) {
return [];
}
return [(0,external_wp_blocks_namespaceObject.createBlock)("core/navigation", { ref: navigationMenuId })];
}, [navigationMenuId]);
if (!navigationMenuId || !blocks?.length) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.BlockEditorProvider,
{
settings: storedSettings,
value: blocks,
onChange: navigation_menu_editor_noop,
onInput: navigation_menu_editor_noop,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-sidebar-navigation-screen-navigation-menus__content", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuContent, { rootClientId: blocks[0].clientId }) })
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js
function buildNavigationLabel(title, id, status) {
if (!title?.rendered) {
return (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("(no title %s)"), id);
}
if (status === "publish") {
return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title?.rendered);
}
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).
(0,external_wp_i18n_namespaceObject._x)("%1$s (%2$s)", "menu label"),
(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title?.rendered),
status
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js
function SingleNavigationMenu({
navigationMenu,
backPath,
handleDelete,
handleDuplicate,
handleSave
}) {
const menuTitle = navigationMenu?.title?.rendered;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationScreenWrapper,
{
actions: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ScreenNavigationMoreMenu,
{
menuId: navigationMenu?.id,
menuTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menuTitle),
onDelete: handleDelete,
onSave: handleSave,
onDuplicate: handleDuplicate
}
) }),
backPath,
title: buildNavigationLabel(
navigationMenu?.title,
navigationMenu?.id,
navigationMenu?.status
),
description: (0,external_wp_i18n_namespaceObject.__)(
"Navigation Menus are a curated collection of blocks that allow visitors to get around your site."
),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuEditor, { navigationMenuId: navigationMenu?.id })
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/index.js
const { useLocation: sidebar_navigation_screen_navigation_menu_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
const postType = `wp_navigation`;
function SidebarNavigationScreenNavigationMenu({ backPath }) {
const {
params: { postId }
} = sidebar_navigation_screen_navigation_menu_useLocation();
const { record: navigationMenu, isResolving } = (0,external_wp_coreData_namespaceObject.useEntityRecord)(
"postType",
postType,
postId
);
const { isSaving, isDeleting } = (0,external_wp_data_.useSelect)(
(select) => {
const { isSavingEntityRecord, isDeletingEntityRecord } = select(external_wp_coreData_namespaceObject.store);
return {
isSaving: isSavingEntityRecord("postType", postType, postId),
isDeleting: isDeletingEntityRecord(
"postType",
postType,
postId
)
};
},
[postId]
);
const isLoading = isResolving || isSaving || isDeleting;
const menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug;
const { handleSave, handleDelete, handleDuplicate } = useNavigationMenuHandlers();
const _handleDelete = () => handleDelete(navigationMenu);
const _handleSave = (edits) => handleSave(navigationMenu, edits);
const _handleDuplicate = () => handleDuplicate(navigationMenu);
if (isLoading) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationScreenWrapper,
{
description: (0,external_wp_i18n_namespaceObject.__)(
"Navigation Menus are a curated collection of blocks that allow visitors to get around your site."
),
backPath,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, { className: "edit-site-sidebar-navigation-screen-navigation-menus__loading" })
}
);
}
if (!isLoading && !navigationMenu) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationScreenWrapper,
{
description: (0,external_wp_i18n_namespaceObject.__)("Navigation Menu missing."),
backPath
}
);
}
if (!navigationMenu?.content?.raw) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationScreenWrapper,
{
actions: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ScreenNavigationMoreMenu,
{
menuId: navigationMenu?.id,
menuTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menuTitle),
onDelete: _handleDelete,
onSave: _handleSave,
onDuplicate: _handleDuplicate
}
),
backPath,
title: buildNavigationLabel(
navigationMenu?.title,
navigationMenu?.id,
navigationMenu?.status
),
description: (0,external_wp_i18n_namespaceObject.__)("This Navigation Menu is empty.")
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SingleNavigationMenu,
{
navigationMenu,
backPath,
handleDelete: _handleDelete,
handleSave: _handleSave,
handleDuplicate: _handleDuplicate
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js
const { useHistory: use_navigation_menu_handlers_useHistory } = unlock(external_wp_router_namespaceObject.privateApis);
function useDeleteNavigationMenu() {
const { deleteEntityRecord } = (0,external_wp_data_.useDispatch)(external_wp_coreData_namespaceObject.store);
const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_.useDispatch)(external_wp_notices_namespaceObject.store);
const history = use_navigation_menu_handlers_useHistory();
const handleDelete = async (navigationMenu) => {
const postId = navigationMenu?.id;
try {
await deleteEntityRecord(
"postType",
postType,
postId,
{
force: true
},
{
throwOnError: true
}
);
createSuccessNotice(
(0,external_wp_i18n_namespaceObject.__)("Navigation Menu successfully deleted."),
{
type: "snackbar"
}
);
history.navigate("/navigation");
} catch (error) {
createErrorNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: error message describing why the navigation menu could not be deleted. */
(0,external_wp_i18n_namespaceObject.__)(`Unable to delete Navigation Menu (%s).`),
error?.message
),
{
type: "snackbar"
}
);
}
};
return handleDelete;
}
function useSaveNavigationMenu() {
const { getEditedEntityRecord } = (0,external_wp_data_.useSelect)((select) => {
const { getEditedEntityRecord: getEditedEntityRecordSelector } = select(external_wp_coreData_namespaceObject.store);
return {
getEditedEntityRecord: getEditedEntityRecordSelector
};
}, []);
const {
editEntityRecord,
__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits
} = (0,external_wp_data_.useDispatch)(external_wp_coreData_namespaceObject.store);
const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_.useDispatch)(external_wp_notices_namespaceObject.store);
const handleSave = async (navigationMenu, edits) => {
if (!edits) {
return;
}
const postId = navigationMenu?.id;
const originalRecord = getEditedEntityRecord(
"postType",
NAVIGATION_POST_TYPE,
postId
);
editEntityRecord("postType", postType, postId, edits);
const recordPropertiesToSave = Object.keys(edits);
try {
await saveSpecifiedEntityEdits(
"postType",
postType,
postId,
recordPropertiesToSave,
{
throwOnError: true
}
);
createSuccessNotice((0,external_wp_i18n_namespaceObject.__)("Renamed Navigation Menu"), {
type: "snackbar"
});
} catch (error) {
editEntityRecord("postType", postType, postId, originalRecord);
createErrorNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: error message describing why the navigation menu could not be renamed. */
(0,external_wp_i18n_namespaceObject.__)(`Unable to rename Navigation Menu (%s).`),
error?.message
),
{
type: "snackbar"
}
);
}
};
return handleSave;
}
function useDuplicateNavigationMenu() {
const history = use_navigation_menu_handlers_useHistory();
const { saveEntityRecord } = (0,external_wp_data_.useDispatch)(external_wp_coreData_namespaceObject.store);
const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_.useDispatch)(external_wp_notices_namespaceObject.store);
const handleDuplicate = async (navigationMenu) => {
const menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug;
try {
const savedRecord = await saveEntityRecord(
"postType",
postType,
{
title: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Navigation menu title */
(0,external_wp_i18n_namespaceObject._x)("%s (Copy)", "navigation menu"),
menuTitle
),
content: navigationMenu?.content?.raw,
status: "publish"
},
{
throwOnError: true
}
);
if (savedRecord) {
createSuccessNotice((0,external_wp_i18n_namespaceObject.__)("Duplicated Navigation Menu"), {
type: "snackbar"
});
history.navigate(`/wp_navigation/${savedRecord.id}`);
}
} catch (error) {
createErrorNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: error message describing why the navigation menu could not be deleted. */
(0,external_wp_i18n_namespaceObject.__)(`Unable to duplicate Navigation Menu (%s).`),
error?.message
),
{
type: "snackbar"
}
);
}
};
return handleDuplicate;
}
function useNavigationMenuHandlers() {
return {
handleDelete: useDeleteNavigationMenu(),
handleSave: useSaveNavigationMenu(),
handleDuplicate: useDuplicateNavigationMenu()
};
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/index.js
function buildMenuLabel(title, id, status) {
if (!title) {
return (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("(no title %s)"), id);
}
if (status === "publish") {
return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title);
}
return (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).
(0,external_wp_i18n_namespaceObject._x)("%1$s (%2$s)", "menu label"),
(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title),
status
);
}
function SidebarNavigationScreenNavigationMenus({ backPath }) {
const {
records: navigationMenus,
isResolving: isResolvingNavigationMenus,
hasResolved: hasResolvedNavigationMenus
} = (0,external_wp_coreData_namespaceObject.useEntityRecords)(
"postType",
NAVIGATION_POST_TYPE,
PRELOADED_NAVIGATION_MENUS_QUERY
);
const isLoading = isResolvingNavigationMenus && !hasResolvedNavigationMenus;
const { getNavigationFallbackId } = unlock((0,external_wp_data_.useSelect)(external_wp_coreData_namespaceObject.store));
const isCreatingNavigationFallback = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).isResolving("getNavigationFallbackId"),
[]
);
const firstNavigationMenu = navigationMenus?.[0];
if (!firstNavigationMenu && !isResolvingNavigationMenus && hasResolvedNavigationMenus && // Ensure a fallback navigation is created only once
!isCreatingNavigationFallback) {
getNavigationFallbackId();
}
const { handleSave, handleDelete, handleDuplicate } = useNavigationMenuHandlers();
const hasNavigationMenus = !!navigationMenus?.length;
if (isLoading) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { backPath, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, { className: "edit-site-sidebar-navigation-screen-navigation-menus__loading" }) });
}
if (!isLoading && !hasNavigationMenus) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationScreenWrapper,
{
description: (0,external_wp_i18n_namespaceObject.__)("No Navigation Menus found."),
backPath
}
);
}
if (navigationMenus?.length === 1) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SingleNavigationMenu,
{
navigationMenu: firstNavigationMenu,
backPath,
handleDelete: () => handleDelete(firstNavigationMenu),
handleDuplicate: () => handleDuplicate(firstNavigationMenu),
handleSave: (edits) => handleSave(firstNavigationMenu, edits)
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { backPath, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-navigation-menus", children: navigationMenus?.map(({ id, title, status }, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
NavMenuItem,
{
postId: id,
withChevron: true,
icon: navigation_default,
children: buildMenuLabel(title?.rendered, index + 1, status)
},
id
)) }) });
}
function SidebarNavigationScreenWrapper({
children,
actions,
title,
description,
backPath
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationScreen,
{
title: title || (0,external_wp_i18n_namespaceObject.__)("Navigation"),
actions,
description: description || (0,external_wp_i18n_namespaceObject.__)("Manage your Navigation Menus."),
backPath,
content: children
}
);
}
const NavMenuItem = ({ postId, ...props }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationItem,
{
to: `/wp_navigation/${postId}`,
...props
}
);
};
;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/navigation.js
const { useLocation: navigation_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
function MobileNavigationView() {
const { query = {} } = navigation_useLocation();
const { canvas = "view" } = query;
return canvas === "edit" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenNavigationMenus, { backPath: "/" });
}
const navigationRoute = {
name: "navigation",
path: "/navigation",
areas: {
sidebar({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenNavigationMenus, { backPath: "/" }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
},
preview({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : void 0;
},
mobile({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MobileNavigationView, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
}
}
};
;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/navigation-item.js
const { useLocation: navigation_item_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
function MobileNavigationItemView() {
const { query = {} } = navigation_item_useLocation();
const { canvas = "view" } = query;
return canvas === "edit" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenNavigationMenu, { backPath: "/navigation" });
}
const navigationItemRoute = {
name: "navigation-item",
path: "/wp_navigation/:postId",
areas: {
sidebar({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenNavigationMenu, { backPath: "/navigation" }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
},
preview({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
},
mobile({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MobileNavigationItemView, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
}
}
};
;// ./node_modules/@wordpress/icons/build-module/library/file.js
var file_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z"
}
) });
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/category-item.js
function CategoryItem({
count,
icon,
id,
isActive,
label,
type
}) {
if (!count) {
return;
}
const queryArgs = [`postType=${type}`];
if (id) {
queryArgs.push(`categoryId=${id}`);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationItem,
{
icon,
suffix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: count }),
"aria-current": isActive ? "true" : void 0,
to: `/pattern?${queryArgs.join("&")}`,
children: label
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js
function useDefaultPatternCategories() {
const blockPatternCategories = (0,external_wp_data_.useSelect)((select) => {
const { getSettings } = unlock(select(store));
const settings = getSettings();
return settings.__experimentalAdditionalBlockPatternCategories ?? settings.__experimentalBlockPatternCategories;
});
const restBlockPatternCategories = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).getBlockPatternCategories()
);
return [
...blockPatternCategories || [],
...restBlockPatternCategories || []
];
}
;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/utils.js
const filterOutDuplicatesByName = (currentItem, index, items) => index === items.findIndex((item) => currentItem.name === item.name);
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js
function useThemePatterns() {
const blockPatterns = (0,external_wp_data_.useSelect)((select) => {
const { getSettings } = unlock(select(store));
return getSettings().__experimentalAdditionalBlockPatterns ?? getSettings().__experimentalBlockPatterns;
});
const restBlockPatterns = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).getBlockPatterns()
);
const patterns = (0,external_wp_element_.useMemo)(
() => [...blockPatterns || [], ...restBlockPatterns || []].filter(
(pattern) => !EXCLUDED_PATTERN_SOURCES.includes(pattern.source)
).filter(filterOutDuplicatesByName).filter((pattern) => pattern.inserter !== false),
[blockPatterns, restBlockPatterns]
);
return patterns;
}
;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/search-items.js
const { extractWords, getNormalizedSearchTerms, normalizeString } = unlock(
external_wp_blockEditor_namespaceObject.privateApis
);
const defaultGetName = (item) => {
if (item.type === PATTERN_TYPES.user) {
return item.slug;
}
if (item.type === TEMPLATE_PART_POST_TYPE) {
return "";
}
return item.name || "";
};
const defaultGetTitle = (item) => {
if (typeof item.title === "string") {
return item.title;
}
if (item.title && item.title.rendered) {
return item.title.rendered;
}
if (item.title && item.title.raw) {
return item.title.raw;
}
return "";
};
const defaultGetDescription = (item) => {
if (item.type === PATTERN_TYPES.user) {
return item.excerpt.raw;
}
return item.description || "";
};
const defaultGetKeywords = (item) => item.keywords || [];
const defaultHasCategory = () => false;
const removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => {
return unmatchedTerms.filter(
(term) => !getNormalizedSearchTerms(unprocessedTerms).some(
(unprocessedTerm) => unprocessedTerm.includes(term)
)
);
};
const searchItems = (items = [], searchInput = "", config = {}) => {
const normalizedSearchTerms = getNormalizedSearchTerms(searchInput);
const onlyFilterByCategory = config.categoryId !== PATTERN_DEFAULT_CATEGORY && !normalizedSearchTerms.length;
const searchRankConfig = { ...config, onlyFilterByCategory };
const threshold = onlyFilterByCategory ? 0 : 1;
const rankedItems = items.map((item) => {
return [
item,
getItemSearchRank(item, searchInput, searchRankConfig)
];
}).filter(([, rank]) => rank > threshold);
if (normalizedSearchTerms.length === 0) {
return rankedItems.map(([item]) => item);
}
rankedItems.sort(([, rank1], [, rank2]) => rank2 - rank1);
return rankedItems.map(([item]) => item);
};
function getItemSearchRank(item, searchTerm, config) {
const {
categoryId,
getName = defaultGetName,
getTitle = defaultGetTitle,
getDescription = defaultGetDescription,
getKeywords = defaultGetKeywords,
hasCategory = defaultHasCategory,
onlyFilterByCategory
} = config;
let rank = categoryId === PATTERN_DEFAULT_CATEGORY || categoryId === TEMPLATE_PART_ALL_AREAS_CATEGORY || categoryId === PATTERN_USER_CATEGORY && item.type === PATTERN_TYPES.user || hasCategory(item, categoryId) ? 1 : 0;
if (!rank || onlyFilterByCategory) {
return rank;
}
const name = getName(item);
const title = getTitle(item);
const description = getDescription(item);
const keywords = getKeywords(item);
const normalizedSearchInput = normalizeString(searchTerm);
const normalizedTitle = normalizeString(title);
if (normalizedSearchInput === normalizedTitle) {
rank += 30;
} else if (normalizedTitle.startsWith(normalizedSearchInput)) {
rank += 20;
} else {
const terms = [name, title, description, ...keywords].join(" ");
const normalizedSearchTerms = extractWords(normalizedSearchInput);
const unmatchedTerms = removeMatchingTerms(
normalizedSearchTerms,
terms
);
if (unmatchedTerms.length === 0) {
rank += 10;
}
}
return rank;
}
;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/use-patterns.js
const EMPTY_PATTERN_LIST = [];
const selectTemplateParts = (0,external_wp_data_.createSelector)(
(select, categoryId, search = "") => {
const {
getEntityRecords,
getCurrentTheme,
isResolving: isResolvingSelector
} = select(external_wp_coreData_namespaceObject.store);
const query = { per_page: -1 };
const templateParts = getEntityRecords("postType", TEMPLATE_PART_POST_TYPE, query) ?? EMPTY_PATTERN_LIST;
const knownAreas = getCurrentTheme()?.default_template_part_areas || [];
const templatePartAreas = knownAreas.map((area) => area.area);
const templatePartHasCategory = (item, category) => {
if (category !== TEMPLATE_PART_AREA_DEFAULT_CATEGORY) {
return item.area === category;
}
return item.area === category || !templatePartAreas.includes(item.area);
};
const isResolving = isResolvingSelector("getEntityRecords", [
"postType",
TEMPLATE_PART_POST_TYPE,
query
]);
const patterns = searchItems(templateParts, search, {
categoryId,
hasCategory: templatePartHasCategory
});
return { patterns, isResolving };
},
(select) => [
select(external_wp_coreData_namespaceObject.store).getEntityRecords(
"postType",
TEMPLATE_PART_POST_TYPE,
{
per_page: -1
}
),
select(external_wp_coreData_namespaceObject.store).isResolving("getEntityRecords", [
"postType",
TEMPLATE_PART_POST_TYPE,
{ per_page: -1 }
]),
select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_part_areas
]
);
const selectThemePatterns = (0,external_wp_data_.createSelector)(
(select) => {
const { getSettings } = unlock(select(store));
const { isResolving: isResolvingSelector } = select(external_wp_coreData_namespaceObject.store);
const settings = getSettings();
const blockPatterns = settings.__experimentalAdditionalBlockPatterns ?? settings.__experimentalBlockPatterns;
const restBlockPatterns = select(external_wp_coreData_namespaceObject.store).getBlockPatterns();
const patterns = [
...blockPatterns || [],
...restBlockPatterns || []
].filter(
(pattern) => !EXCLUDED_PATTERN_SOURCES.includes(pattern.source)
).filter(filterOutDuplicatesByName).filter((pattern) => pattern.inserter !== false).map((pattern) => ({
...pattern,
keywords: pattern.keywords || [],
type: PATTERN_TYPES.theme,
blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content, {
__unstableSkipMigrationLogs: true
})
}));
return {
patterns,
isResolving: isResolvingSelector("getBlockPatterns")
};
},
(select) => [
select(external_wp_coreData_namespaceObject.store).getBlockPatterns(),
select(external_wp_coreData_namespaceObject.store).isResolving("getBlockPatterns"),
unlock(select(store)).getSettings()
]
);
const selectPatterns = (0,external_wp_data_.createSelector)(
(select, categoryId, syncStatus, search = "") => {
const {
patterns: themePatterns,
isResolving: isResolvingThemePatterns
} = selectThemePatterns(select);
const {
patterns: userPatterns,
isResolving: isResolvingUserPatterns,
categories: userPatternCategories
} = selectUserPatterns(select);
let patterns = [
...themePatterns || [],
...userPatterns || []
];
if (syncStatus) {
patterns = patterns.filter((pattern) => {
return pattern.type === PATTERN_TYPES.user ? (pattern.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full) === syncStatus : syncStatus === PATTERN_SYNC_TYPES.unsynced;
});
}
if (categoryId) {
patterns = searchItems(patterns, search, {
categoryId,
hasCategory: (item, currentCategory) => {
if (item.type === PATTERN_TYPES.user) {
return item.wp_pattern_category?.some(
(catId) => userPatternCategories.find(
(cat) => cat.id === catId
)?.slug === currentCategory
);
}
return item.categories?.includes(currentCategory);
}
});
} else {
patterns = searchItems(patterns, search, {
hasCategory: (item) => {
if (item.type === PATTERN_TYPES.user) {
return userPatternCategories?.length && (!item.wp_pattern_category?.length || !item.wp_pattern_category?.some(
(catId) => userPatternCategories.find(
(cat) => cat.id === catId
)
));
}
return !item.hasOwnProperty("categories");
}
});
}
return {
patterns,
isResolving: isResolvingThemePatterns || isResolvingUserPatterns
};
},
(select) => [
selectThemePatterns(select),
selectUserPatterns(select)
]
);
const selectUserPatterns = (0,external_wp_data_.createSelector)(
(select, syncStatus, search = "") => {
const {
getEntityRecords,
isResolving: isResolvingSelector,
getUserPatternCategories
} = select(external_wp_coreData_namespaceObject.store);
const query = { per_page: -1 };
const patternPosts = getEntityRecords(
"postType",
PATTERN_TYPES.user,
query
);
const userPatternCategories = getUserPatternCategories();
const categories = /* @__PURE__ */ new Map();
userPatternCategories.forEach(
(userCategory) => categories.set(userCategory.id, userCategory)
);
let patterns = patternPosts ?? EMPTY_PATTERN_LIST;
const isResolving = isResolvingSelector("getEntityRecords", [
"postType",
PATTERN_TYPES.user,
query
]);
if (syncStatus) {
patterns = patterns.filter(
(pattern) => pattern.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full === syncStatus
);
}
patterns = searchItems(patterns, search, {
// We exit user pattern retrieval early if we aren't in the
// catch-all category for user created patterns, so it has
// to be in the category.
hasCategory: () => true
});
return {
patterns,
isResolving,
categories: userPatternCategories
};
},
(select) => [
select(external_wp_coreData_namespaceObject.store).getEntityRecords("postType", PATTERN_TYPES.user, {
per_page: -1
}),
select(external_wp_coreData_namespaceObject.store).isResolving("getEntityRecords", [
"postType",
PATTERN_TYPES.user,
{ per_page: -1 }
]),
select(external_wp_coreData_namespaceObject.store).getUserPatternCategories()
]
);
function useAugmentPatternsWithPermissions(patterns) {
const idsAndTypes = (0,external_wp_element_.useMemo)(
() => patterns?.filter((record) => record.type !== PATTERN_TYPES.theme).map((record) => [record.type, record.id]) ?? [],
[patterns]
);
const permissions = (0,external_wp_data_.useSelect)(
(select) => {
const { getEntityRecordPermissions } = unlock(
select(external_wp_coreData_namespaceObject.store)
);
return idsAndTypes.reduce((acc, [type, id]) => {
acc[id] = getEntityRecordPermissions("postType", type, id);
return acc;
}, {});
},
[idsAndTypes]
);
return (0,external_wp_element_.useMemo)(
() => patterns?.map((record) => ({
...record,
permissions: permissions?.[record.id] ?? {}
})) ?? [],
[patterns, permissions]
);
}
const usePatterns = (postType, categoryId, { search = "", syncStatus } = {}) => {
return (0,external_wp_data_.useSelect)(
(select) => {
if (postType === TEMPLATE_PART_POST_TYPE) {
return selectTemplateParts(select, categoryId, search);
} else if (postType === PATTERN_TYPES.user && !!categoryId) {
const appliedCategory = categoryId === "uncategorized" ? "" : categoryId;
return selectPatterns(
select,
appliedCategory,
syncStatus,
search
);
} else if (postType === PATTERN_TYPES.user) {
return selectUserPatterns(select, syncStatus, search);
}
return {
patterns: EMPTY_PATTERN_LIST,
isResolving: false
};
},
[categoryId, postType, search, syncStatus]
);
};
var use_patterns_default = usePatterns;
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js
function usePatternCategories() {
const defaultCategories = useDefaultPatternCategories();
defaultCategories.push({
name: TEMPLATE_PART_AREA_DEFAULT_CATEGORY,
label: (0,external_wp_i18n_namespaceObject.__)("Uncategorized")
});
const themePatterns = useThemePatterns();
const { patterns: userPatterns, categories: userPatternCategories } = use_patterns_default(PATTERN_TYPES.user);
const patternCategories = (0,external_wp_element_.useMemo)(() => {
const categoryMap = {};
const categoriesWithCounts = [];
defaultCategories.forEach((category) => {
if (!categoryMap[category.name]) {
categoryMap[category.name] = { ...category, count: 0 };
}
});
userPatternCategories.forEach((category) => {
if (!categoryMap[category.name]) {
categoryMap[category.name] = { ...category, count: 0 };
}
});
themePatterns.forEach((pattern) => {
pattern.categories?.forEach((category) => {
if (categoryMap[category]) {
categoryMap[category].count += 1;
}
});
if (!pattern.categories?.length) {
categoryMap.uncategorized.count += 1;
}
});
userPatterns.forEach((pattern) => {
pattern.wp_pattern_category?.forEach((catId) => {
const category = userPatternCategories.find(
(cat) => cat.id === catId
)?.name;
if (categoryMap[category]) {
categoryMap[category].count += 1;
}
});
if (!pattern.wp_pattern_category?.length || !pattern.wp_pattern_category?.some(
(catId) => userPatternCategories.find((cat) => cat.id === catId)
)) {
categoryMap.uncategorized.count += 1;
}
});
[...defaultCategories, ...userPatternCategories].forEach(
(category) => {
if (categoryMap[category.name].count && !categoriesWithCounts.find(
(cat) => cat.name === category.name
)) {
categoriesWithCounts.push(categoryMap[category.name]);
}
}
);
const sortedCategories = categoriesWithCounts.sort(
(a, b) => a.label.localeCompare(b.label)
);
sortedCategories.unshift({
name: PATTERN_USER_CATEGORY,
label: (0,external_wp_i18n_namespaceObject.__)("My patterns"),
count: userPatterns.length
});
sortedCategories.unshift({
name: PATTERN_DEFAULT_CATEGORY,
label: (0,external_wp_i18n_namespaceObject.__)("All patterns"),
description: (0,external_wp_i18n_namespaceObject.__)("A list of all patterns from all sources."),
count: themePatterns.length + userPatterns.length
});
return sortedCategories;
}, [
defaultCategories,
themePatterns,
userPatternCategories,
userPatterns
]);
return { patternCategories, hasPatterns: !!patternCategories.length };
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js
const useTemplatePartsGroupedByArea = (items) => {
const allItems = items || [];
const templatePartAreas = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_part_areas || [],
[]
);
const knownAreas = {
header: {},
footer: {},
sidebar: {},
uncategorized: {}
};
templatePartAreas.forEach(
(templatePartArea) => knownAreas[templatePartArea.area] = {
...templatePartArea,
templateParts: []
}
);
const groupedByArea = allItems.reduce((accumulator, item) => {
const key = accumulator[item.area] ? item.area : TEMPLATE_PART_AREA_DEFAULT_CATEGORY;
accumulator[key]?.templateParts?.push(item);
return accumulator;
}, knownAreas);
return groupedByArea;
};
function useTemplatePartAreas() {
const { records: templateParts, isResolving: isLoading } = (0,external_wp_coreData_namespaceObject.useEntityRecords)(
"postType",
TEMPLATE_PART_POST_TYPE,
{ per_page: -1 }
);
return {
hasTemplateParts: templateParts ? !!templateParts.length : false,
isLoading,
templatePartAreas: useTemplatePartsGroupedByArea(templateParts)
};
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/index.js
const { useLocation: sidebar_navigation_screen_patterns_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
function CategoriesGroup({
templatePartAreas,
patternCategories,
currentCategory,
currentType
}) {
const [allPatterns, ...otherPatterns] = patternCategories;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-patterns__group", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CategoryItem,
{
count: Object.values(templatePartAreas).map(({ templateParts }) => templateParts?.length || 0).reduce((acc, val) => acc + val, 0),
icon: (0,external_wp_editor_namespaceObject.getTemplatePartIcon)(),
label: (0,external_wp_i18n_namespaceObject.__)("All template parts"),
id: TEMPLATE_PART_ALL_AREAS_CATEGORY,
type: TEMPLATE_PART_POST_TYPE,
isActive: currentCategory === TEMPLATE_PART_ALL_AREAS_CATEGORY && currentType === TEMPLATE_PART_POST_TYPE
},
"all"
),
Object.entries(templatePartAreas).map(
([area, { label, templateParts }]) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CategoryItem,
{
count: templateParts?.length,
icon: (0,external_wp_editor_namespaceObject.getTemplatePartIcon)(area),
label,
id: area,
type: TEMPLATE_PART_POST_TYPE,
isActive: currentCategory === area && currentType === TEMPLATE_PART_POST_TYPE
},
area
)
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-sidebar-navigation-screen-patterns__divider" }),
allPatterns && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CategoryItem,
{
count: allPatterns.count,
label: allPatterns.label,
icon: file_default,
id: allPatterns.name,
type: PATTERN_TYPES.user,
isActive: currentCategory === `${allPatterns.name}` && currentType === PATTERN_TYPES.user
},
allPatterns.name
),
otherPatterns.map((category) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CategoryItem,
{
count: category.count,
label: category.label,
icon: file_default,
id: category.name,
type: PATTERN_TYPES.user,
isActive: currentCategory === `${category.name}` && currentType === PATTERN_TYPES.user
},
category.name
))
] });
}
function SidebarNavigationScreenPatterns({ backPath }) {
const {
query: { postType = "wp_block", categoryId }
} = sidebar_navigation_screen_patterns_useLocation();
const currentCategory = categoryId || (postType === PATTERN_TYPES.user ? PATTERN_DEFAULT_CATEGORY : TEMPLATE_PART_ALL_AREAS_CATEGORY);
const { templatePartAreas, hasTemplateParts, isLoading } = useTemplatePartAreas();
const { patternCategories, hasPatterns } = usePatternCategories();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationScreen,
{
title: (0,external_wp_i18n_namespaceObject.__)("Patterns"),
description: (0,external_wp_i18n_namespaceObject.__)(
"Manage what patterns are available when editing the site."
),
isRoot: !backPath,
backPath,
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
isLoading && (0,external_wp_i18n_namespaceObject.__)("Loading items\u2026"),
!isLoading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
!hasTemplateParts && !hasPatterns && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-patterns__group", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItem, { children: (0,external_wp_i18n_namespaceObject.__)("No items found") }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CategoriesGroup,
{
templatePartAreas,
patternCategories,
currentCategory,
currentType: postType
}
)
] })
] })
}
);
}
// EXTERNAL MODULE: ./node_modules/remove-accents/index.js
var remove_accents = __webpack_require__(9681);
var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/constants.js
/**
* @module constants
* @summary Useful constants
* @description
* Collection of useful date constants.
*
* The constants could be imported from `date-fns/constants`:
*
* ```ts
* import { maxTime, minTime } from "./constants/date-fns/constants";
*
* function isAllowedTime(time) {
* return time <= maxTime && time >= minTime;
* }
* ```
*/
/**
* @constant
* @name daysInWeek
* @summary Days in 1 week.
*/
const daysInWeek = 7;
/**
* @constant
* @name daysInYear
* @summary Days in 1 year.
*
* @description
* How many days in a year.
*
* One years equals 365.2425 days according to the formula:
*
* > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.
* > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
*/
const daysInYear = 365.2425;
/**
* @constant
* @name maxTime
* @summary Maximum allowed time.
*
* @example
* import { maxTime } from "./constants/date-fns/constants";
*
* const isValid = 8640000000000001 <= maxTime;
* //=> false
*
* new Date(8640000000000001);
* //=> Invalid Date
*/
const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
/**
* @constant
* @name minTime
* @summary Minimum allowed time.
*
* @example
* import { minTime } from "./constants/date-fns/constants";
*
* const isValid = -8640000000000001 >= minTime;
* //=> false
*
* new Date(-8640000000000001)
* //=> Invalid Date
*/
const minTime = -maxTime;
/**
* @constant
* @name millisecondsInWeek
* @summary Milliseconds in 1 week.
*/
const millisecondsInWeek = 604800000;
/**
* @constant
* @name millisecondsInDay
* @summary Milliseconds in 1 day.
*/
const millisecondsInDay = 86400000;
/**
* @constant
* @name millisecondsInMinute
* @summary Milliseconds in 1 minute
*/
const millisecondsInMinute = 60000;
/**
* @constant
* @name millisecondsInHour
* @summary Milliseconds in 1 hour
*/
const millisecondsInHour = 3600000;
/**
* @constant
* @name millisecondsInSecond
* @summary Milliseconds in 1 second
*/
const millisecondsInSecond = 1000;
/**
* @constant
* @name minutesInYear
* @summary Minutes in 1 year.
*/
const minutesInYear = 525600;
/**
* @constant
* @name minutesInMonth
* @summary Minutes in 1 month.
*/
const minutesInMonth = 43200;
/**
* @constant
* @name minutesInDay
* @summary Minutes in 1 day.
*/
const minutesInDay = 1440;
/**
* @constant
* @name minutesInHour
* @summary Minutes in 1 hour.
*/
const minutesInHour = 60;
/**
* @constant
* @name monthsInQuarter
* @summary Months in 1 quarter.
*/
const monthsInQuarter = 3;
/**
* @constant
* @name monthsInYear
* @summary Months in 1 year.
*/
const monthsInYear = 12;
/**
* @constant
* @name quartersInYear
* @summary Quarters in 1 year
*/
const quartersInYear = 4;
/**
* @constant
* @name secondsInHour
* @summary Seconds in 1 hour.
*/
const secondsInHour = 3600;
/**
* @constant
* @name secondsInMinute
* @summary Seconds in 1 minute.
*/
const secondsInMinute = 60;
/**
* @constant
* @name secondsInDay
* @summary Seconds in 1 day.
*/
const secondsInDay = secondsInHour * 24;
/**
* @constant
* @name secondsInWeek
* @summary Seconds in 1 week.
*/
const secondsInWeek = secondsInDay * 7;
/**
* @constant
* @name secondsInYear
* @summary Seconds in 1 year.
*/
const secondsInYear = secondsInDay * daysInYear;
/**
* @constant
* @name secondsInMonth
* @summary Seconds in 1 month
*/
const secondsInMonth = secondsInYear / 12;
/**
* @constant
* @name secondsInQuarter
* @summary Seconds in 1 quarter.
*/
const secondsInQuarter = secondsInMonth * 3;
/**
* @constant
* @name constructFromSymbol
* @summary Symbol enabling Date extensions to inherit properties from the reference date.
*
* The symbol is used to enable the `constructFrom` function to construct a date
* using a reference date and a value. It allows to transfer extra properties
* from the reference date to the new date. It's useful for extensions like
* [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
* a constructor argument.
*/
const constructFromSymbol = Symbol.for("constructDateFrom");
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js
/**
* @name constructFrom
* @category Generic Helpers
* @summary Constructs a date using the reference date and the value
*
* @description
* The function constructs a new date using the constructor from the reference
* date and the given value. It helps to build generic functions that accept
* date extensions.
*
* It defaults to `Date` if the passed reference date is a number or a string.
*
* Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]`
* enabling to transfer extra properties from the reference date to the new date.
* It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
* that accept a time zone as a constructor argument.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The reference date to take constructor from
* @param value - The value to create the date
*
* @returns Date initialized using the given date and value
*
* @example
* import { constructFrom } from "./constructFrom/date-fns";
*
* // A function that clones a date preserving the original type
* function cloneDate<DateType extends Date>(date: DateType): DateType {
* return constructFrom(
* date, // Use constructor from the given date
* date.getTime() // Use the date value to create a new date
* );
* }
*/
function constructFrom(date, value) {
if (typeof date === "function") return date(value);
if (date && typeof date === "object" && constructFromSymbol in date)
return date[constructFromSymbol](value);
if (date instanceof Date) return new date.constructor(value);
return new Date(value);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_constructFrom = ((/* unused pure expression or super */ null && (constructFrom)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js
/**
* @name toDate
* @category Common Helpers
* @summary Convert the given argument to an instance of Date.
*
* @description
* Convert the given argument to an instance of Date.
*
* If the argument is an instance of Date, the function returns its clone.
*
* If the argument is a number, it is treated as a timestamp.
*
* If the argument is none of the above, the function returns Invalid Date.
*
* Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
* enabling to transfer extra properties from the reference date to the new date.
* It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
* that accept a time zone as a constructor argument.
*
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param argument - The value to convert
*
* @returns The parsed date in the local time zone
*
* @example
* // Clone the date:
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
* //=> Tue Feb 11 2014 11:30:30
*
* @example
* // Convert the timestamp to date:
* const result = toDate(1392098430000)
* //=> Tue Feb 11 2014 11:30:30
*/
function toDate(argument, context) {
// [TODO] Get rid of `toDate` or `constructFrom`?
return constructFrom(context || argument, argument);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_toDate = ((/* unused pure expression or super */ null && (toDate)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/addDays.js
/**
* The {@link addDays} function options.
*/
/**
* @name addDays
* @category Day Helpers
* @summary Add the specified number of days to the given date.
*
* @description
* Add the specified number of days to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param amount - The amount of days to be added.
* @param options - An object with options
*
* @returns The new date with the days added
*
* @example
* // Add 10 days to 1 September 2014:
* const result = addDays(new Date(2014, 8, 1), 10)
* //=> Thu Sep 11 2014 00:00:00
*/
function addDays(date, amount, options) {
const _date = toDate(date, options?.in);
if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
// If 0 days, no-op to avoid changing times in the hour before end of DST
if (!amount) return _date;
_date.setDate(_date.getDate() + amount);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_addDays = ((/* unused pure expression or super */ null && (addDays)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/subDays.js
/**
* The {@link subDays} function options.
*/
/**
* @name subDays
* @category Day Helpers
* @summary Subtract the specified number of days from the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param amount - The amount of days to be subtracted.
* @param options - An object with options
*
* @returns The new date with the days subtracted
*
* @example
* // Subtract 10 days from 1 September 2014:
* const result = subDays(new Date(2014, 8, 1), 10)
* //=> Fri Aug 22 2014 00:00:00
*/
function subDays(date, amount, options) {
return addDays(date, -amount, options);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_subDays = ((/* unused pure expression or super */ null && (subDays)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/addWeeks.js
/**
* The {@link addWeeks} function options.
*/
/**
* @name addWeeks
* @category Week Helpers
* @summary Add the specified number of weeks to the given date.
*
* @description
* Add the specified number of weeks to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param amount - The amount of weeks to be added.
* @param options - An object with options
*
* @returns The new date with the weeks added
*
* @example
* // Add 4 weeks to 1 September 2014:
* const result = addWeeks(new Date(2014, 8, 1), 4)
* //=> Mon Sep 29 2014 00:00:00
*/
function addWeeks(date, amount, options) {
return addDays(date, amount * 7, options);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_addWeeks = ((/* unused pure expression or super */ null && (addWeeks)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/subWeeks.js
/**
* The {@link subWeeks} function options.
*/
/**
* @name subWeeks
* @category Week Helpers
* @summary Subtract the specified number of weeks from the given date.
*
* @description
* Subtract the specified number of weeks from the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param amount - The amount of weeks to be subtracted.
* @param options - An object with options
*
* @returns The new date with the weeks subtracted
*
* @example
* // Subtract 4 weeks from 1 September 2014:
* const result = subWeeks(new Date(2014, 8, 1), 4)
* //=> Mon Aug 04 2014 00:00:00
*/
function subWeeks(date, amount, options) {
return addWeeks(date, -amount, options);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_subWeeks = ((/* unused pure expression or super */ null && (subWeeks)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/addMonths.js
/**
* The {@link addMonths} function options.
*/
/**
* @name addMonths
* @category Month Helpers
* @summary Add the specified number of months to the given date.
*
* @description
* Add the specified number of months to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param amount - The amount of months to be added.
* @param options - The options object
*
* @returns The new date with the months added
*
* @example
* // Add 5 months to 1 September 2014:
* const result = addMonths(new Date(2014, 8, 1), 5)
* //=> Sun Feb 01 2015 00:00:00
*
* // Add one month to 30 January 2023:
* const result = addMonths(new Date(2023, 0, 30), 1)
* //=> Tue Feb 28 2023 00:00:00
*/
function addMonths(date, amount, options) {
const _date = toDate(date, options?.in);
if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
if (!amount) {
// If 0 months, no-op to avoid changing times in the hour before end of DST
return _date;
}
const dayOfMonth = _date.getDate();
// The JS Date object supports date math by accepting out-of-bounds values for
// month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
// new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
// want except that dates will wrap around the end of a month, meaning that
// new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
// we'll default to the end of the desired month by adding 1 to the desired
// month and using a date of 0 to back up one day to the end of the desired
// month.
const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime());
endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
const daysInMonth = endOfDesiredMonth.getDate();
if (dayOfMonth >= daysInMonth) {
// If we're already at the end of the month, then this is the correct date
// and we're done.
return endOfDesiredMonth;
} else {
// Otherwise, we now know that setting the original day-of-month value won't
// cause an overflow, so set the desired day-of-month. Note that we can't
// just set the date of `endOfDesiredMonth` because that object may have had
// its time changed in the unusual case where where a DST transition was on
// the last day of the month and its local time was in the hour skipped or
// repeated next to a DST transition. So we use `date` instead which is
// guaranteed to still have the original time.
_date.setFullYear(
endOfDesiredMonth.getFullYear(),
endOfDesiredMonth.getMonth(),
dayOfMonth,
);
return _date;
}
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_addMonths = ((/* unused pure expression or super */ null && (addMonths)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/subMonths.js
/**
* The subMonths function options.
*/
/**
* @name subMonths
* @category Month Helpers
* @summary Subtract the specified number of months from the given date.
*
* @description
* Subtract the specified number of months from the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param amount - The amount of months to be subtracted.
* @param options - An object with options
*
* @returns The new date with the months subtracted
*
* @example
* // Subtract 5 months from 1 February 2015:
* const result = subMonths(new Date(2015, 1, 1), 5)
* //=> Mon Sep 01 2014 00:00:00
*/
function subMonths(date, amount, options) {
return addMonths(date, -amount, options);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_subMonths = ((/* unused pure expression or super */ null && (subMonths)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/addYears.js
/**
* The {@link addYears} function options.
*/
/**
* @name addYears
* @category Year Helpers
* @summary Add the specified number of years to the given date.
*
* @description
* Add the specified number of years to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type.
*
* @param date - The date to be changed
* @param amount - The amount of years to be added.
* @param options - The options
*
* @returns The new date with the years added
*
* @example
* // Add 5 years to 1 September 2014:
* const result = addYears(new Date(2014, 8, 1), 5)
* //=> Sun Sep 01 2019 00:00:00
*/
function addYears(date, amount, options) {
return addMonths(date, amount * 12, options);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_addYears = ((/* unused pure expression or super */ null && (addYears)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/subYears.js
/**
* The {@link subYears} function options.
*/
/**
* @name subYears
* @category Year Helpers
* @summary Subtract the specified number of years from the given date.
*
* @description
* Subtract the specified number of years from the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param amount - The amount of years to be subtracted.
* @param options - An object with options
*
* @returns The new date with the years subtracted
*
* @example
* // Subtract 5 years from 1 September 2014:
* const result = subYears(new Date(2014, 8, 1), 5)
* //=> Tue Sep 01 2009 00:00:00
*/
function subYears(date, amount, options) {
return addYears(date, -amount, options);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_subYears = ((/* unused pure expression or super */ null && (subYears)));
;// ./node_modules/@wordpress/icons/build-module/library/arrow-up.js
var arrow_up_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/arrow-down.js
var arrow_down_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z" }) });
;// ./node_modules/@wordpress/dataviews/build-module/constants.js
const constants_OPERATOR_IS = "is";
const constants_OPERATOR_IS_NOT = "isNot";
const constants_OPERATOR_IS_ANY = "isAny";
const constants_OPERATOR_IS_NONE = "isNone";
const OPERATOR_IS_ALL = "isAll";
const OPERATOR_IS_NOT_ALL = "isNotAll";
const OPERATOR_LESS_THAN = "lessThan";
const OPERATOR_GREATER_THAN = "greaterThan";
const OPERATOR_LESS_THAN_OR_EQUAL = "lessThanOrEqual";
const OPERATOR_GREATER_THAN_OR_EQUAL = "greaterThanOrEqual";
const OPERATOR_BEFORE = "before";
const OPERATOR_AFTER = "after";
const OPERATOR_BEFORE_INC = "beforeInc";
const OPERATOR_AFTER_INC = "afterInc";
const OPERATOR_CONTAINS = "contains";
const OPERATOR_NOT_CONTAINS = "notContains";
const OPERATOR_STARTS_WITH = "startsWith";
const OPERATOR_BETWEEN = "between";
const OPERATOR_ON = "on";
const OPERATOR_NOT_ON = "notOn";
const OPERATOR_IN_THE_PAST = "inThePast";
const OPERATOR_OVER = "over";
const ALL_OPERATORS = [
constants_OPERATOR_IS,
constants_OPERATOR_IS_NOT,
constants_OPERATOR_IS_ANY,
constants_OPERATOR_IS_NONE,
OPERATOR_IS_ALL,
OPERATOR_IS_NOT_ALL,
OPERATOR_LESS_THAN,
OPERATOR_GREATER_THAN,
OPERATOR_LESS_THAN_OR_EQUAL,
OPERATOR_GREATER_THAN_OR_EQUAL,
OPERATOR_BEFORE,
OPERATOR_AFTER,
OPERATOR_BEFORE_INC,
OPERATOR_AFTER_INC,
OPERATOR_CONTAINS,
OPERATOR_NOT_CONTAINS,
OPERATOR_STARTS_WITH,
OPERATOR_BETWEEN,
OPERATOR_ON,
OPERATOR_NOT_ON,
OPERATOR_IN_THE_PAST,
OPERATOR_OVER
];
const SINGLE_SELECTION_OPERATORS = [
constants_OPERATOR_IS,
constants_OPERATOR_IS_NOT,
OPERATOR_LESS_THAN,
OPERATOR_GREATER_THAN,
OPERATOR_LESS_THAN_OR_EQUAL,
OPERATOR_GREATER_THAN_OR_EQUAL,
OPERATOR_BEFORE,
OPERATOR_AFTER,
OPERATOR_BEFORE_INC,
OPERATOR_AFTER_INC,
OPERATOR_CONTAINS,
OPERATOR_NOT_CONTAINS,
OPERATOR_STARTS_WITH,
OPERATOR_ON,
OPERATOR_NOT_ON
];
const OPERATORS = {
[constants_OPERATOR_IS]: {
key: "is-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Is")
},
[constants_OPERATOR_IS_NOT]: {
key: "is-not-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Is not")
},
[constants_OPERATOR_IS_ANY]: {
key: "is-any-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Is any")
},
[constants_OPERATOR_IS_NONE]: {
key: "is-none-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Is none")
},
[OPERATOR_IS_ALL]: {
key: "is-all-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Is all")
},
[OPERATOR_IS_NOT_ALL]: {
key: "is-not-all-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Is not all")
},
[OPERATOR_LESS_THAN]: {
key: "less-than-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Less than")
},
[OPERATOR_GREATER_THAN]: {
key: "greater-than-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Greater than")
},
[OPERATOR_LESS_THAN_OR_EQUAL]: {
key: "less-than-or-equal-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Less than or equal")
},
[OPERATOR_GREATER_THAN_OR_EQUAL]: {
key: "greater-than-or-equal-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Greater than or equal")
},
[OPERATOR_BEFORE]: {
key: "before-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Before")
},
[OPERATOR_AFTER]: {
key: "after-filter",
label: (0,external_wp_i18n_namespaceObject.__)("After")
},
[OPERATOR_BEFORE_INC]: {
key: "before-inc-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Before (inc)")
},
[OPERATOR_AFTER_INC]: {
key: "after-inc-filter",
label: (0,external_wp_i18n_namespaceObject.__)("After (inc)")
},
[OPERATOR_CONTAINS]: {
key: "contains-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Contains")
},
[OPERATOR_NOT_CONTAINS]: {
key: "not-contains-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Doesn't contain")
},
[OPERATOR_STARTS_WITH]: {
key: "starts-with-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Starts with")
},
[OPERATOR_BETWEEN]: {
key: "between-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Between (inc)")
},
[OPERATOR_ON]: {
key: "on-filter",
label: (0,external_wp_i18n_namespaceObject.__)("On")
},
[OPERATOR_NOT_ON]: {
key: "not-on-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Not on")
},
[OPERATOR_IN_THE_PAST]: {
key: "in-the-past-filter",
label: (0,external_wp_i18n_namespaceObject.__)("In the past")
},
[OPERATOR_OVER]: {
key: "over-filter",
label: (0,external_wp_i18n_namespaceObject.__)("Over")
}
};
const SORTING_DIRECTIONS = ["asc", "desc"];
const sortArrows = { asc: "\u2191", desc: "\u2193" };
const sortValues = { asc: "ascending", desc: "descending" };
const sortLabels = {
asc: (0,external_wp_i18n_namespaceObject.__)("Sort ascending"),
desc: (0,external_wp_i18n_namespaceObject.__)("Sort descending")
};
const sortIcons = {
asc: arrow_up_default,
desc: arrow_down_default
};
const constants_LAYOUT_TABLE = "table";
const constants_LAYOUT_GRID = "grid";
const constants_LAYOUT_LIST = "list";
const LAYOUT_PICKER_GRID = "pickerGrid";
;// ./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js
const use_elements_EMPTY_ARRAY = [];
function useElements({
elements,
getElements
}) {
const staticElements = Array.isArray(elements) && elements.length > 0 ? elements : use_elements_EMPTY_ARRAY;
const [records, setRecords] = (0,external_wp_element_.useState)(staticElements);
const [isLoading, setIsLoading] = (0,external_wp_element_.useState)(false);
(0,external_wp_element_.useEffect)(() => {
if (!getElements) {
setRecords(staticElements);
return;
}
let cancelled = false;
setIsLoading(true);
getElements().then((fetchedElements) => {
if (!cancelled) {
const dynamicElements = Array.isArray(fetchedElements) && fetchedElements.length > 0 ? fetchedElements : staticElements;
setRecords(dynamicElements);
}
}).catch(() => {
if (!cancelled) {
setRecords(staticElements);
}
}).finally(() => {
if (!cancelled) {
setIsLoading(false);
}
});
return () => {
cancelled = true;
};
}, [getElements, staticElements]);
return {
elements: records,
isLoading
};
}
;// ./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js
function RenderFromElements({
item,
field
}) {
const { elements, isLoading } = useElements({
elements: field.elements,
getElements: field.getElements
});
const value = field.getValue({ item });
if (isLoading) {
return value;
}
if (elements.length === 0) {
return value;
}
return elements?.find((element) => element.value === value)?.label || field.getValue({ item });
}
;// ./node_modules/@wordpress/dataviews/build-module/field-types/email.js
function sort(valueA, valueB, direction) {
return direction === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
}
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
var email_default = {
sort,
isValid: {
elements: true,
custom: (item, field) => {
const value = field.getValue({ item });
if (![void 0, "", null].includes(value) && !emailRegex.test(value)) {
return (0,external_wp_i18n_namespaceObject.__)("Value must be a valid email address.");
}
return null;
}
},
Edit: "email",
render: ({ item, field }) => {
return field.hasElements ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderFromElements, { item, field }) : field.getValue({ item });
},
enableSorting: true,
filterBy: {
defaultOperators: [constants_OPERATOR_IS_ANY, constants_OPERATOR_IS_NONE],
validOperators: [
constants_OPERATOR_IS,
constants_OPERATOR_IS_NOT,
OPERATOR_CONTAINS,
OPERATOR_NOT_CONTAINS,
OPERATOR_STARTS_WITH,
// Multiple selection
constants_OPERATOR_IS_ANY,
constants_OPERATOR_IS_NONE,
OPERATOR_IS_ALL,
OPERATOR_IS_NOT_ALL
]
}
};
;// ./node_modules/@wordpress/dataviews/build-module/field-types/integer.js
function integer_sort(a, b, direction) {
return direction === "asc" ? a - b : b - a;
}
var integer_default = {
sort: integer_sort,
isValid: {
elements: true,
custom: (item, field) => {
const value = field.getValue({ item });
if (![void 0, "", null].includes(value) && !Number.isInteger(value)) {
return (0,external_wp_i18n_namespaceObject.__)("Value must be an integer.");
}
return null;
}
},
Edit: "integer",
render: ({ item, field }) => {
return field.hasElements ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderFromElements, { item, field }) : field.getValue({ item });
},
enableSorting: true,
filterBy: {
defaultOperators: [
constants_OPERATOR_IS,
constants_OPERATOR_IS_NOT,
OPERATOR_LESS_THAN,
OPERATOR_GREATER_THAN,
OPERATOR_LESS_THAN_OR_EQUAL,
OPERATOR_GREATER_THAN_OR_EQUAL,
OPERATOR_BETWEEN
],
validOperators: [
// Single-selection
constants_OPERATOR_IS,
constants_OPERATOR_IS_NOT,
OPERATOR_LESS_THAN,
OPERATOR_GREATER_THAN,
OPERATOR_LESS_THAN_OR_EQUAL,
OPERATOR_GREATER_THAN_OR_EQUAL,
OPERATOR_BETWEEN,
// Multiple-selection
constants_OPERATOR_IS_ANY,
constants_OPERATOR_IS_NONE,
OPERATOR_IS_ALL,
OPERATOR_IS_NOT_ALL
]
}
};
;// ./node_modules/@wordpress/dataviews/build-module/field-types/number.js
function number_sort(a, b, direction) {
return direction === "asc" ? a - b : b - a;
}
function isEmpty(value) {
return value === "" || value === void 0 || value === null;
}
var number_default = {
sort: number_sort,
isValid: {
elements: true,
custom: (item, field) => {
const value = field.getValue({ item });
if (!isEmpty(value) && !Number.isFinite(value)) {
return (0,external_wp_i18n_namespaceObject.__)("Value must be a number.");
}
return null;
}
},
Edit: "number",
render: ({ item, field }) => {
if (field.hasElements) {
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderFromElements, { item, field });
}
const value = field.getValue({ item });
if (![null, void 0].includes(value)) {
return Number(value).toFixed(2);
}
return null;
},
enableSorting: true,
filterBy: {
defaultOperators: [
constants_OPERATOR_IS,
constants_OPERATOR_IS_NOT,
OPERATOR_LESS_THAN,
OPERATOR_GREATER_THAN,
OPERATOR_LESS_THAN_OR_EQUAL,
OPERATOR_GREATER_THAN_OR_EQUAL,
OPERATOR_BETWEEN
],
validOperators: [
// Single-selection
constants_OPERATOR_IS,
constants_OPERATOR_IS_NOT,
OPERATOR_LESS_THAN,
OPERATOR_GREATER_THAN,
OPERATOR_LESS_THAN_OR_EQUAL,
OPERATOR_GREATER_THAN_OR_EQUAL,
OPERATOR_BETWEEN,
// Multiple-selection
constants_OPERATOR_IS_ANY,
constants_OPERATOR_IS_NONE,
OPERATOR_IS_ALL,
OPERATOR_IS_NOT_ALL
]
}
};
;// ./node_modules/@wordpress/dataviews/build-module/field-types/text.js
function text_sort(valueA, valueB, direction) {
return direction === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
}
var text_default = {
sort: text_sort,
isValid: {
elements: true,
custom: () => null
},
Edit: "text",
render: ({ item, field }) => {
return field.hasElements ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderFromElements, { item, field }) : field.getValue({ item });
},
enableSorting: true,
filterBy: {
defaultOperators: [constants_OPERATOR_IS_ANY, constants_OPERATOR_IS_NONE],
validOperators: [
// Single selection
constants_OPERATOR_IS,
constants_OPERATOR_IS_NOT,
OPERATOR_CONTAINS,
OPERATOR_NOT_CONTAINS,
OPERATOR_STARTS_WITH,
// Multiple selection
constants_OPERATOR_IS_ANY,
constants_OPERATOR_IS_NONE,
OPERATOR_IS_ALL,
OPERATOR_IS_NOT_ALL
]
}
};
;// ./node_modules/@wordpress/dataviews/build-module/field-types/datetime.js
function datetime_sort(a, b, direction) {
const timeA = new Date(a).getTime();
const timeB = new Date(b).getTime();
return direction === "asc" ? timeA - timeB : timeB - timeA;
}
var datetime_default = {
sort: datetime_sort,
isValid: {
elements: true,
custom: () => null
},
Edit: "datetime",
render: ({ item, field }) => {
return field.hasElements ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderFromElements, { item, field }) : field.getValue({ item });
},
enableSorting: true,
filterBy: {
defaultOperators: [
OPERATOR_ON,
OPERATOR_NOT_ON,
OPERATOR_BEFORE,
OPERATOR_AFTER,
OPERATOR_BEFORE_INC,
OPERATOR_AFTER_INC,
OPERATOR_IN_THE_PAST,
OPERATOR_OVER
],
validOperators: [
OPERATOR_ON,
OPERATOR_NOT_ON,
OPERATOR_BEFORE,
OPERATOR_AFTER,
OPERATOR_BEFORE_INC,
OPERATOR_AFTER_INC,
OPERATOR_IN_THE_PAST,
OPERATOR_OVER
]
}
};
;// ./node_modules/@wordpress/dataviews/build-module/field-types/date.js
const getFormattedDate = (dateToDisplay) => (0,external_wp_date_namespaceObject.dateI18n)((0,external_wp_date_namespaceObject.getSettings)().formats.date, (0,external_wp_date_namespaceObject.getDate)(dateToDisplay));
function date_sort(a, b, direction) {
const timeA = new Date(a).getTime();
const timeB = new Date(b).getTime();
return direction === "asc" ? timeA - timeB : timeB - timeA;
}
var date_default = {
sort: date_sort,
Edit: "date",
isValid: {
elements: true,
custom: () => null
},
render: ({ item, field }) => {
if (field.hasElements) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderFromElements, { item, field });
}
const value = field.getValue({ item });
if (!value) {
return "";
}
return getFormattedDate(value);
},
enableSorting: true,
filterBy: {
defaultOperators: [
OPERATOR_ON,
OPERATOR_NOT_ON,
OPERATOR_BEFORE,
OPERATOR_AFTER,
OPERATOR_BEFORE_INC,
OPERATOR_AFTER_INC,
OPERATOR_IN_THE_PAST,
OPERATOR_OVER,
OPERATOR_BETWEEN
],
validOperators: [
OPERATOR_ON,
OPERATOR_NOT_ON,
OPERATOR_BEFORE,
OPERATOR_AFTER,
OPERATOR_BEFORE_INC,
OPERATOR_AFTER_INC,
OPERATOR_IN_THE_PAST,
OPERATOR_OVER,
OPERATOR_BETWEEN
]
}
};
;// ./node_modules/@wordpress/dataviews/build-module/field-types/boolean.js
function boolean_sort(a, b, direction) {
const boolA = Boolean(a);
const boolB = Boolean(b);
if (boolA === boolB) {
return 0;
}
if (direction === "asc") {
return boolA ? 1 : -1;
}
return boolA ? -1 : 1;
}
var boolean_default = {
sort: boolean_sort,
isValid: {
elements: true,
custom: (item, field) => {
const value = field.getValue({ item });
if (![void 0, "", null].includes(value) && ![true, false].includes(value)) {
return (0,external_wp_i18n_namespaceObject.__)("Value must be true, false, or undefined");
}
return null;
}
},
Edit: "checkbox",
render: ({ item, field }) => {
if (field.hasElements) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderFromElements, { item, field });
}
if (field.getValue({ item }) === true) {
return (0,external_wp_i18n_namespaceObject.__)("True");
}
if (field.getValue({ item }) === false) {
return (0,external_wp_i18n_namespaceObject.__)("False");
}
return null;
},
enableSorting: true,
filterBy: {
defaultOperators: [constants_OPERATOR_IS, constants_OPERATOR_IS_NOT],
validOperators: [constants_OPERATOR_IS, constants_OPERATOR_IS_NOT]
}
};
;// ./node_modules/@wordpress/dataviews/build-module/field-types/media.js
function media_sort() {
return 0;
}
var media_default = {
sort: media_sort,
isValid: {
elements: true,
custom: () => null
},
Edit: null,
render: () => null,
enableSorting: false,
filterBy: false
};
;// ./node_modules/@wordpress/dataviews/build-module/field-types/array.js
function array_sort(valueA, valueB, direction) {
const arrA = Array.isArray(valueA) ? valueA : [];
const arrB = Array.isArray(valueB) ? valueB : [];
if (arrA.length !== arrB.length) {
return direction === "asc" ? arrA.length - arrB.length : arrB.length - arrA.length;
}
const joinedA = arrA.join(",");
const joinedB = arrB.join(",");
return direction === "asc" ? joinedA.localeCompare(joinedB) : joinedB.localeCompare(joinedA);
}
function render({ item, field }) {
const value = field.getValue({ item }) || [];
return value.join(", ");
}
const arrayFieldType = {
sort: array_sort,
isValid: {
elements: true,
custom: (item, field) => {
const value = field.getValue({ item });
if (![void 0, "", null].includes(value) && !Array.isArray(value)) {
return (0,external_wp_i18n_namespaceObject.__)("Value must be an array.");
}
if (!value.every((v) => typeof v === "string")) {
return (0,external_wp_i18n_namespaceObject.__)("Every value must be a string.");
}
return null;
}
},
Edit: "array",
// Use array control
render,
enableSorting: true,
filterBy: {
defaultOperators: [constants_OPERATOR_IS_ANY, constants_OPERATOR_IS_NONE],
validOperators: [
constants_OPERATOR_IS_ANY,
constants_OPERATOR_IS_NONE,
OPERATOR_IS_ALL,
OPERATOR_IS_NOT_ALL
]
}
};
var array_default = arrayFieldType;
;// ./node_modules/@wordpress/dataviews/build-module/field-types/password.js
function password_sort(valueA, valueB, direction) {
return 0;
}
var password_default = {
sort: password_sort,
isValid: {
elements: true,
custom: () => null
},
Edit: "password",
render: ({ item, field }) => {
return field.hasElements ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderFromElements, { item, field }) : "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022";
},
enableSorting: false,
filterBy: false
};
;// ./node_modules/@wordpress/dataviews/build-module/field-types/telephone.js
function telephone_sort(valueA, valueB, direction) {
return direction === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
}
var telephone_default = {
sort: telephone_sort,
isValid: {
elements: true,
custom: () => null
},
Edit: "telephone",
render: ({ item, field }) => {
return field.hasElements ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderFromElements, { item, field }) : field.getValue({ item });
},
enableSorting: true,
filterBy: {
defaultOperators: [constants_OPERATOR_IS_ANY, constants_OPERATOR_IS_NONE],
validOperators: [
constants_OPERATOR_IS,
constants_OPERATOR_IS_NOT,
OPERATOR_CONTAINS,
OPERATOR_NOT_CONTAINS,
OPERATOR_STARTS_WITH,
// Multiple selection
constants_OPERATOR_IS_ANY,
constants_OPERATOR_IS_NONE,
OPERATOR_IS_ALL,
OPERATOR_IS_NOT_ALL
]
}
};
;// ./node_modules/@wordpress/dataviews/build-module/field-types/color.js
function color_sort(valueA, valueB, direction) {
const colorA = w(valueA);
const colorB = w(valueB);
if (!colorA.isValid() && !colorB.isValid()) {
return 0;
}
if (!colorA.isValid()) {
return direction === "asc" ? 1 : -1;
}
if (!colorB.isValid()) {
return direction === "asc" ? -1 : 1;
}
const hslA = colorA.toHsl();
const hslB = colorB.toHsl();
if (hslA.h !== hslB.h) {
return direction === "asc" ? hslA.h - hslB.h : hslB.h - hslA.h;
}
if (hslA.s !== hslB.s) {
return direction === "asc" ? hslA.s - hslB.s : hslB.s - hslA.s;
}
return direction === "asc" ? hslA.l - hslB.l : hslB.l - hslA.l;
}
var color_color_default = {
sort: color_sort,
isValid: {
elements: true,
custom: (item, field) => {
const value = field.getValue({ item });
if (![void 0, "", null].includes(value) && !w(value).isValid()) {
return (0,external_wp_i18n_namespaceObject.__)("Value must be a valid color.");
}
return null;
}
},
Edit: "color",
render: ({ item, field }) => {
if (field.hasElements) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderFromElements, { item, field });
}
const value = field.getValue({ item });
if (!value || !w(value).isValid()) {
return value;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
style: { display: "flex", alignItems: "center", gap: "8px" },
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
style: {
width: "16px",
height: "16px",
borderRadius: "50%",
backgroundColor: value,
border: "1px solid #ddd",
flexShrink: 0
}
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: value })
]
}
);
},
enableSorting: true,
filterBy: {
defaultOperators: [constants_OPERATOR_IS_ANY, constants_OPERATOR_IS_NONE],
validOperators: [constants_OPERATOR_IS, constants_OPERATOR_IS_NOT]
}
};
;// ./node_modules/@wordpress/dataviews/build-module/field-types/url.js
function url_sort(valueA, valueB, direction) {
return direction === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
}
var url_default = {
sort: url_sort,
isValid: {
elements: true,
custom: () => null
},
Edit: "url",
render: ({ item, field }) => {
return field.hasElements ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderFromElements, { item, field }) : field.getValue({ item });
},
enableSorting: true,
filterBy: {
defaultOperators: [constants_OPERATOR_IS_ANY, constants_OPERATOR_IS_NONE],
validOperators: [
constants_OPERATOR_IS,
constants_OPERATOR_IS_NOT,
OPERATOR_CONTAINS,
OPERATOR_NOT_CONTAINS,
OPERATOR_STARTS_WITH,
// Multiple selection
constants_OPERATOR_IS_ANY,
constants_OPERATOR_IS_NONE,
OPERATOR_IS_ALL,
OPERATOR_IS_NOT_ALL
]
}
};
;// ./node_modules/@wordpress/dataviews/build-module/field-types/index.js
function getFieldTypeDefinition(type) {
if ("email" === type) {
return email_default;
}
if ("integer" === type) {
return integer_default;
}
if ("number" === type) {
return number_default;
}
if ("text" === type) {
return text_default;
}
if ("datetime" === type) {
return datetime_default;
}
if ("date" === type) {
return date_default;
}
if ("boolean" === type) {
return boolean_default;
}
if ("media" === type) {
return media_default;
}
if ("array" === type) {
return array_default;
}
if ("password" === type) {
return password_default;
}
if ("telephone" === type) {
return telephone_default;
}
if ("color" === type) {
return color_color_default;
}
if ("url" === type) {
return url_default;
}
return {
sort: (a, b, direction) => {
if (typeof a === "number" && typeof b === "number") {
return direction === "asc" ? a - b : b - a;
}
return direction === "asc" ? a.localeCompare(b) : b.localeCompare(a);
},
isValid: {
elements: true,
custom: () => null
},
Edit: null,
render: ({ item, field }) => {
return field.hasElements ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderFromElements, { item, field }) : field.getValue({ item });
},
enableSorting: true,
filterBy: {
defaultOperators: [constants_OPERATOR_IS, constants_OPERATOR_IS_NOT],
validOperators: ALL_OPERATORS
}
};
}
;// ./node_modules/@wordpress/dataviews/build-module/lock-unlock.js
const { lock: lock_unlock_lock, unlock: lock_unlock_unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
"@wordpress/dataviews"
);
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js
function getCustomValidity(isValid, validity) {
let customValidity;
if (isValid?.required && validity?.required) {
customValidity = validity?.required?.message ? validity.required : void 0;
} else if (isValid?.elements && validity?.elements) {
customValidity = validity.elements;
} else if (validity?.custom) {
customValidity = validity.custom;
}
return customValidity;
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/checkbox.js
const { ValidatedCheckboxControl } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
function Checkbox({
field,
onChange,
data,
hideLabelFromVision,
validity
}) {
const { getValue, setValue, label, description, isValid } = field;
const onChangeControl = (0,external_wp_element_.useCallback)(() => {
onChange(
setValue({ item: data, value: !getValue({ item: data }) })
);
}, [data, getValue, onChange, setValue]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ValidatedCheckboxControl,
{
required: !!field.isValid?.required,
customValidity: getCustomValidity(isValid, validity),
hidden: hideLabelFromVision,
label,
help: description,
checked: getValue({ item: data }),
onChange: onChangeControl
}
);
}
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/isDate.js
/**
* @name isDate
* @category Common Helpers
* @summary Is the given value a date?
*
* @description
* Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
*
* @param value - The value to check
*
* @returns True if the given value is a date
*
* @example
* // For a valid date:
* const result = isDate(new Date())
* //=> true
*
* @example
* // For an invalid date:
* const result = isDate(new Date(NaN))
* //=> true
*
* @example
* // For some value:
* const result = isDate('2014-02-31')
* //=> false
*
* @example
* // For an object:
* const result = isDate({})
* //=> false
*/
function isDate(value) {
return (
value instanceof Date ||
(typeof value === "object" &&
Object.prototype.toString.call(value) === "[object Date]")
);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_isDate = ((/* unused pure expression or super */ null && (isDate)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/isValid.js
/**
* @name isValid
* @category Common Helpers
* @summary Is the given date valid?
*
* @description
* Returns false if argument is Invalid Date and true otherwise.
* Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
* Invalid Date is a Date, whose time value is NaN.
*
* Time value of Date: http://es5.github.io/#x15.9.1.1
*
* @param date - The date to check
*
* @returns The date is valid
*
* @example
* // For the valid date:
* const result = isValid(new Date(2014, 1, 31))
* //=> true
*
* @example
* // For the value, convertible into a date:
* const result = isValid(1393804800000)
* //=> true
*
* @example
* // For the invalid date:
* const result = isValid(new Date(''))
* //=> false
*/
function isValid(date) {
return !((!isDate(date) && typeof date !== "number") || isNaN(+toDate(date)));
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_isValid = ((/* unused pure expression or super */ null && (isValid)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatDistance.js
const formatDistanceLocale = {
lessThanXSeconds: {
one: "less than a second",
other: "less than {{count}} seconds",
},
xSeconds: {
one: "1 second",
other: "{{count}} seconds",
},
halfAMinute: "half a minute",
lessThanXMinutes: {
one: "less than a minute",
other: "less than {{count}} minutes",
},
xMinutes: {
one: "1 minute",
other: "{{count}} minutes",
},
aboutXHours: {
one: "about 1 hour",
other: "about {{count}} hours",
},
xHours: {
one: "1 hour",
other: "{{count}} hours",
},
xDays: {
one: "1 day",
other: "{{count}} days",
},
aboutXWeeks: {
one: "about 1 week",
other: "about {{count}} weeks",
},
xWeeks: {
one: "1 week",
other: "{{count}} weeks",
},
aboutXMonths: {
one: "about 1 month",
other: "about {{count}} months",
},
xMonths: {
one: "1 month",
other: "{{count}} months",
},
aboutXYears: {
one: "about 1 year",
other: "about {{count}} years",
},
xYears: {
one: "1 year",
other: "{{count}} years",
},
overXYears: {
one: "over 1 year",
other: "over {{count}} years",
},
almostXYears: {
one: "almost 1 year",
other: "almost {{count}} years",
},
};
const formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", count.toString());
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "in " + result;
} else {
return result + " ago";
}
}
return result;
};
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildFormatLongFn.js
function buildFormatLongFn(args) {
return (options = {}) => {
// TODO: Remove String()
const width = options.width ? String(options.width) : args.defaultWidth;
const format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatLong.js
const dateFormats = {
full: "EEEE, MMMM do, y",
long: "MMMM do, y",
medium: "MMM d, y",
short: "MM/dd/yyyy",
};
const timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a",
};
const dateTimeFormats = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatRelative.js
const formatRelativeLocale = {
lastWeek: "'last' eeee 'at' p",
yesterday: "'yesterday at' p",
today: "'today at' p",
tomorrow: "'tomorrow at' p",
nextWeek: "eeee 'at' p",
other: "P",
};
const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildLocalizeFn.js
/**
* The localize function argument callback which allows to convert raw value to
* the actual type.
*
* @param value - The value to convert
*
* @returns The converted value
*/
/**
* The map of localized values for each width.
*/
/**
* The index type of the locale unit value. It types conversion of units of
* values that don't start at 0 (i.e. quarters).
*/
/**
* Converts the unit value to the tuple of values.
*/
/**
* The tuple of localized era values. The first element represents BC,
* the second element represents AD.
*/
/**
* The tuple of localized quarter values. The first element represents Q1.
*/
/**
* The tuple of localized day values. The first element represents Sunday.
*/
/**
* The tuple of localized month values. The first element represents January.
*/
function buildLocalizeFn(args) {
return (value, options) => {
const context = options?.context ? String(options.context) : "standalone";
let valuesArray;
if (context === "formatting" && args.formattingValues) {
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
const width = options?.width ? String(options.width) : defaultWidth;
valuesArray =
args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
const defaultWidth = args.defaultWidth;
const width = options?.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[width] || args.values[defaultWidth];
}
const index = args.argumentCallback ? args.argumentCallback(value) : value;
// @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
return valuesArray[index];
};
}
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/localize.js
const eraValues = {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"],
};
// Note: in English, the names of days of the week and months are capitalized.
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
// Generally, formatted dates should look like they are in the middle of a sentence,
// e.g. in Spanish language the weekdays and months should be in the lowercase.
const monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
],
wide: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
],
};
const dayValues = {
narrow: ["S", "M", "T", "W", "T", "F", "S"],
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
wide: [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
],
};
const dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
// If ordinal numbers depend on context, for example,
// if they are different for different grammatical genders,
// use `options.unit`.
//
// `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
// 'day', 'hour', 'minute', 'second'.
const rem100 = number % 100;
if (rem100 > 20 || rem100 < 10) {
switch (rem100 % 10) {
case 1:
return number + "st";
case 2:
return number + "nd";
case 3:
return number + "rd";
}
}
return number + "th";
};
const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildMatchFn.js
function buildMatchFn(args) {
return (string, options = {}) => {
const width = options.width;
const matchPattern =
(width && args.matchPatterns[width]) ||
args.matchPatterns[args.defaultMatchWidth];
const matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
const matchedString = matchResult[0];
const parsePatterns =
(width && args.parsePatterns[width]) ||
args.parsePatterns[args.defaultParseWidth];
const key = Array.isArray(parsePatterns)
? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))
: // [TODO] -- I challenge you to fix the type
findKey(parsePatterns, (pattern) => pattern.test(matchedString));
let value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback
? // [TODO] -- I challenge you to fix the type
options.valueCallback(value)
: value;
const rest = string.slice(matchedString.length);
return { value, rest };
};
}
function findKey(object, predicate) {
for (const key in object) {
if (
Object.prototype.hasOwnProperty.call(object, key) &&
predicate(object[key])
) {
return key;
}
}
return undefined;
}
function findIndex(array, predicate) {
for (let key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return undefined;
}
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
function buildMatchPatternFn(args) {
return (string, options = {}) => {
const matchResult = string.match(args.matchPattern);
if (!matchResult) return null;
const matchedString = matchResult[0];
const parseResult = string.match(args.parsePattern);
if (!parseResult) return null;
let value = args.valueCallback
? args.valueCallback(parseResult[0])
: parseResult[0];
// [TODO] I challenge you to fix the type
value = options.valueCallback ? options.valueCallback(value) : value;
const rest = string.slice(matchedString.length);
return { value, rest };
};
}
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/match.js
const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(b|a)/i,
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
wide: /^(before christ|before common era|anno domini|common era)/i,
};
const parseEraPatterns = {
any: [/^b/i, /^(a|c)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](th|st|nd|rd)? quarter/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,
};
const parseMonthPatterns = {
narrow: [
/^j/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^j/i,
/^j/i,
/^a/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
any: [
/^ja/i,
/^f/i,
/^mar/i,
/^ap/i,
/^may/i,
/^jun/i,
/^jul/i,
/^au/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
};
const matchDayPatterns = {
narrow: /^[smtwf]/i,
short: /^(su|mo|tu|we|th|fr|sa)/i,
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,
};
const parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
};
const matchDayPeriodPatterns = {
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^mi/i,
noon: /^no/i,
morning: /morning/i,
afternoon: /afternoon/i,
evening: /evening/i,
night: /night/i,
},
};
const match_match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US.js
/**
* @category Locales
* @summary English locale (United States).
* @language English
* @iso-639-2 eng
* @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
* @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
*/
const enUS = {
code: "en-US",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match_match,
options: {
weekStartsOn: 0 /* Sunday */,
firstWeekContainsDate: 1,
},
};
// Fallback for modularized imports:
/* harmony default export */ const en_US = ((/* unused pure expression or super */ null && (enUS)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/defaultOptions.js
let defaultOptions = {};
function getDefaultOptions() {
return defaultOptions;
}
function setDefaultOptions(newOptions) {
defaultOptions = newOptions;
}
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
/**
* Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
* They usually appear for dates that denote time before the timezones were introduced
* (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
* and GMT+01:00:00 after that date)
*
* Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
* which would lead to incorrect calculations.
*
* This function returns the timezone offset in milliseconds that takes seconds in account.
*/
function getTimezoneOffsetInMilliseconds(date) {
const _date = toDate(date);
const utcDate = new Date(
Date.UTC(
_date.getFullYear(),
_date.getMonth(),
_date.getDate(),
_date.getHours(),
_date.getMinutes(),
_date.getSeconds(),
_date.getMilliseconds(),
),
);
utcDate.setUTCFullYear(_date.getFullYear());
return +date - +utcDate;
}
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/normalizeDates.js
function normalizeDates(context, ...dates) {
const normalize = constructFrom.bind(
null,
context || dates.find((date) => typeof date === "object"),
);
return dates.map(normalize);
}
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfDay.js
/**
* The {@link startOfDay} function options.
*/
/**
* @name startOfDay
* @category Day Helpers
* @summary Return the start of a day for the given date.
*
* @description
* Return the start of a day for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - The options
*
* @returns The start of a day
*
* @example
* // The start of a day for 2 September 2014 11:55:00:
* const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
* //=> Tue Sep 02 2014 00:00:00
*/
function startOfDay(date, options) {
const _date = toDate(date, options?.in);
_date.setHours(0, 0, 0, 0);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfDay = ((/* unused pure expression or super */ null && (startOfDay)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/differenceInCalendarDays.js
/**
* The {@link differenceInCalendarDays} function options.
*/
/**
* @name differenceInCalendarDays
* @category Day Helpers
* @summary Get the number of calendar days between the given dates.
*
* @description
* Get the number of calendar days between the given dates. This means that the times are removed
* from the dates and then the difference in days is calculated.
*
* @param laterDate - The later date
* @param earlierDate - The earlier date
* @param options - The options object
*
* @returns The number of calendar days
*
* @example
* // How many calendar days are between
* // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
* const result = differenceInCalendarDays(
* new Date(2012, 6, 2, 0, 0),
* new Date(2011, 6, 2, 23, 0)
* )
* //=> 366
* // How many calendar days are between
* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
* const result = differenceInCalendarDays(
* new Date(2011, 6, 3, 0, 1),
* new Date(2011, 6, 2, 23, 59)
* )
* //=> 1
*/
function differenceInCalendarDays(laterDate, earlierDate, options) {
const [laterDate_, earlierDate_] = normalizeDates(
options?.in,
laterDate,
earlierDate,
);
const laterStartOfDay = startOfDay(laterDate_);
const earlierStartOfDay = startOfDay(earlierDate_);
const laterTimestamp =
+laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
const earlierTimestamp =
+earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
// Round the number of days to the nearest integer because the number of
// milliseconds in a day is not constant (e.g. it's different in the week of
// the daylight saving time clock shift).
return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_differenceInCalendarDays = ((/* unused pure expression or super */ null && (differenceInCalendarDays)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfYear.js
/**
* The {@link startOfYear} function options.
*/
/**
* @name startOfYear
* @category Year Helpers
* @summary Return the start of a year for the given date.
*
* @description
* Return the start of a year for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - The options
*
* @returns The start of a year
*
* @example
* // The start of a year for 2 September 2014 11:55:00:
* const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
* //=> Wed Jan 01 2014 00:00:00
*/
function startOfYear(date, options) {
const date_ = toDate(date, options?.in);
date_.setFullYear(date_.getFullYear(), 0, 1);
date_.setHours(0, 0, 0, 0);
return date_;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfYear = ((/* unused pure expression or super */ null && (startOfYear)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/getDayOfYear.js
/**
* The {@link getDayOfYear} function options.
*/
/**
* @name getDayOfYear
* @category Day Helpers
* @summary Get the day of the year of the given date.
*
* @description
* Get the day of the year of the given date.
*
* @param date - The given date
* @param options - The options
*
* @returns The day of year
*
* @example
* // Which day of the year is 2 July 2014?
* const result = getDayOfYear(new Date(2014, 6, 2))
* //=> 183
*/
function getDayOfYear(date, options) {
const _date = toDate(date, options?.in);
const diff = differenceInCalendarDays(_date, startOfYear(_date));
const dayOfYear = diff + 1;
return dayOfYear;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_getDayOfYear = ((/* unused pure expression or super */ null && (getDayOfYear)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeek.js
/**
* The {@link startOfWeek} function options.
*/
/**
* @name startOfWeek
* @category Week Helpers
* @summary Return the start of a week for the given date.
*
* @description
* Return the start of a week for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The start of a week
*
* @example
* // The start of a week for 2 September 2014 11:55:00:
* const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
* //=> Sun Aug 31 2014 00:00:00
*
* @example
* // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
* const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
* //=> Mon Sep 01 2014 00:00:00
*/
function startOfWeek(date, options) {
const defaultOptions = getDefaultOptions();
const weekStartsOn =
options?.weekStartsOn ??
options?.locale?.options?.weekStartsOn ??
defaultOptions.weekStartsOn ??
defaultOptions.locale?.options?.weekStartsOn ??
0;
const _date = toDate(date, options?.in);
const day = _date.getDay();
const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
_date.setDate(_date.getDate() - diff);
_date.setHours(0, 0, 0, 0);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfWeek = ((/* unused pure expression or super */ null && (startOfWeek)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeek.js
/**
* The {@link startOfISOWeek} function options.
*/
/**
* @name startOfISOWeek
* @category ISO Week Helpers
* @summary Return the start of an ISO week for the given date.
*
* @description
* Return the start of an ISO week for the given date.
* The result will be in the local timezone.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The start of an ISO week
*
* @example
* // The start of an ISO week for 2 September 2014 11:55:00:
* const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
* //=> Mon Sep 01 2014 00:00:00
*/
function startOfISOWeek(date, options) {
return startOfWeek(date, { ...options, weekStartsOn: 1 });
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfISOWeek = ((/* unused pure expression or super */ null && (startOfISOWeek)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/getISOWeekYear.js
/**
* The {@link getISOWeekYear} function options.
*/
/**
* @name getISOWeekYear
* @category ISO Week-Numbering Year Helpers
* @summary Get the ISO week-numbering year of the given date.
*
* @description
* Get the ISO week-numbering year of the given date,
* which always starts 3 days before the year's first Thursday.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @param date - The given date
*
* @returns The ISO week-numbering year
*
* @example
* // Which ISO-week numbering year is 2 January 2005?
* const result = getISOWeekYear(new Date(2005, 0, 2))
* //=> 2004
*/
function getISOWeekYear(date, options) {
const _date = toDate(date, options?.in);
const year = _date.getFullYear();
const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
if (_date.getTime() >= startOfNextYear.getTime()) {
return year + 1;
} else if (_date.getTime() >= startOfThisYear.getTime()) {
return year;
} else {
return year - 1;
}
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_getISOWeekYear = ((/* unused pure expression or super */ null && (getISOWeekYear)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeekYear.js
/**
* The {@link startOfISOWeekYear} function options.
*/
/**
* @name startOfISOWeekYear
* @category ISO Week-Numbering Year Helpers
* @summary Return the start of an ISO week-numbering year for the given date.
*
* @description
* Return the start of an ISO week-numbering year,
* which always starts 3 days before the year's first Thursday.
* The result will be in the local timezone.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The start of an ISO week-numbering year
*
* @example
* // The start of an ISO week-numbering year for 2 July 2005:
* const result = startOfISOWeekYear(new Date(2005, 6, 2))
* //=> Mon Jan 03 2005 00:00:00
*/
function startOfISOWeekYear(date, options) {
const year = getISOWeekYear(date, options);
const fourthOfJanuary = constructFrom(options?.in || date, 0);
fourthOfJanuary.setFullYear(year, 0, 4);
fourthOfJanuary.setHours(0, 0, 0, 0);
return startOfISOWeek(fourthOfJanuary);
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfISOWeekYear = ((/* unused pure expression or super */ null && (startOfISOWeekYear)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/getISOWeek.js
/**
* The {@link getISOWeek} function options.
*/
/**
* @name getISOWeek
* @category ISO Week Helpers
* @summary Get the ISO week of the given date.
*
* @description
* Get the ISO week of the given date.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @param date - The given date
* @param options - The options
*
* @returns The ISO week
*
* @example
* // Which week of the ISO-week numbering year is 2 January 2005?
* const result = getISOWeek(new Date(2005, 0, 2))
* //=> 53
*/
function getISOWeek(date, options) {
const _date = toDate(date, options?.in);
const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
// Round the number of weeks to the nearest integer because the number of
// milliseconds in a week is not constant (e.g. it's different in the week of
// the daylight saving time clock shift).
return Math.round(diff / millisecondsInWeek) + 1;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_getISOWeek = ((/* unused pure expression or super */ null && (getISOWeek)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/getWeekYear.js
/**
* The {@link getWeekYear} function options.
*/
/**
* @name getWeekYear
* @category Week-Numbering Year Helpers
* @summary Get the local week-numbering year of the given date.
*
* @description
* Get the local week-numbering year of the given date.
* The exact calculation depends on the values of
* `options.weekStartsOn` (which is the index of the first day of the week)
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
* the first week of the week-numbering year)
*
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
*
* @param date - The given date
* @param options - An object with options.
*
* @returns The local week-numbering year
*
* @example
* // Which week numbering year is 26 December 2004 with the default settings?
* const result = getWeekYear(new Date(2004, 11, 26))
* //=> 2005
*
* @example
* // Which week numbering year is 26 December 2004 if week starts on Saturday?
* const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
* //=> 2004
*
* @example
* // Which week numbering year is 26 December 2004 if the first week contains 4 January?
* const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
* //=> 2004
*/
function getWeekYear(date, options) {
const _date = toDate(date, options?.in);
const year = _date.getFullYear();
const defaultOptions = getDefaultOptions();
const firstWeekContainsDate =
options?.firstWeekContainsDate ??
options?.locale?.options?.firstWeekContainsDate ??
defaultOptions.firstWeekContainsDate ??
defaultOptions.locale?.options?.firstWeekContainsDate ??
1;
const firstWeekOfNextYear = constructFrom(options?.in || date, 0);
firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
firstWeekOfNextYear.setHours(0, 0, 0, 0);
const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
const firstWeekOfThisYear = constructFrom(options?.in || date, 0);
firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
firstWeekOfThisYear.setHours(0, 0, 0, 0);
const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
if (+_date >= +startOfNextYear) {
return year + 1;
} else if (+_date >= +startOfThisYear) {
return year;
} else {
return year - 1;
}
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_getWeekYear = ((/* unused pure expression or super */ null && (getWeekYear)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeekYear.js
/**
* The {@link startOfWeekYear} function options.
*/
/**
* @name startOfWeekYear
* @category Week-Numbering Year Helpers
* @summary Return the start of a local week-numbering year for the given date.
*
* @description
* Return the start of a local week-numbering year.
* The exact calculation depends on the values of
* `options.weekStartsOn` (which is the index of the first day of the week)
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
* the first week of the week-numbering year)
*
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The start of a week-numbering year
*
* @example
* // The start of an a week-numbering year for 2 July 2005 with default settings:
* const result = startOfWeekYear(new Date(2005, 6, 2))
* //=> Sun Dec 26 2004 00:00:00
*
* @example
* // The start of a week-numbering year for 2 July 2005
* // if Monday is the first day of week
* // and 4 January is always in the first week of the year:
* const result = startOfWeekYear(new Date(2005, 6, 2), {
* weekStartsOn: 1,
* firstWeekContainsDate: 4
* })
* //=> Mon Jan 03 2005 00:00:00
*/
function startOfWeekYear(date, options) {
const defaultOptions = getDefaultOptions();
const firstWeekContainsDate =
options?.firstWeekContainsDate ??
options?.locale?.options?.firstWeekContainsDate ??
defaultOptions.firstWeekContainsDate ??
defaultOptions.locale?.options?.firstWeekContainsDate ??
1;
const year = getWeekYear(date, options);
const firstWeek = constructFrom(options?.in || date, 0);
firstWeek.setFullYear(year, 0, firstWeekContainsDate);
firstWeek.setHours(0, 0, 0, 0);
const _date = startOfWeek(firstWeek, options);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfWeekYear = ((/* unused pure expression or super */ null && (startOfWeekYear)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/getWeek.js
/**
* The {@link getWeek} function options.
*/
/**
* @name getWeek
* @category Week Helpers
* @summary Get the local week index of the given date.
*
* @description
* Get the local week index of the given date.
* The exact calculation depends on the values of
* `options.weekStartsOn` (which is the index of the first day of the week)
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
* the first week of the week-numbering year)
*
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
*
* @param date - The given date
* @param options - An object with options
*
* @returns The week
*
* @example
* // Which week of the local week numbering year is 2 January 2005 with default options?
* const result = getWeek(new Date(2005, 0, 2))
* //=> 2
*
* @example
* // Which week of the local week numbering year is 2 January 2005,
* // if Monday is the first day of the week,
* // and the first week of the year always contains 4 January?
* const result = getWeek(new Date(2005, 0, 2), {
* weekStartsOn: 1,
* firstWeekContainsDate: 4
* })
* //=> 53
*/
function getWeek(date, options) {
const _date = toDate(date, options?.in);
const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
// Round the number of weeks to the nearest integer because the number of
// milliseconds in a week is not constant (e.g. it's different in the week of
// the daylight saving time clock shift).
return Math.round(diff / millisecondsInWeek) + 1;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_getWeek = ((/* unused pure expression or super */ null && (getWeek)));
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/addLeadingZeros.js
function addLeadingZeros(number, targetLength) {
const sign = number < 0 ? "-" : "";
const output = Math.abs(number).toString().padStart(targetLength, "0");
return sign + output;
}
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/lightFormatters.js
/*
* | | Unit | | Unit |
* |-----|--------------------------------|-----|--------------------------------|
* | a | AM, PM | A* | |
* | d | Day of month | D | |
* | h | Hour [1-12] | H | Hour [0-23] |
* | m | Minute | M | Month |
* | s | Second | S | Fraction of second |
* | y | Year (abs) | Y | |
*
* Letters marked by * are not implemented but reserved by Unicode standard.
*/
const lightFormatters = {
// Year
y(date, token) {
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
// | Year | y | yy | yyy | yyyy | yyyyy |
// |----------|-------|----|-------|-------|-------|
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
const signedYear = date.getFullYear();
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const year = signedYear > 0 ? signedYear : 1 - signedYear;
return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
},
// Month
M(date, token) {
const month = date.getMonth();
return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
},
// Day of the month
d(date, token) {
return addLeadingZeros(date.getDate(), token.length);
},
// AM or PM
a(date, token) {
const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
switch (token) {
case "a":
case "aa":
return dayPeriodEnumValue.toUpperCase();
case "aaa":
return dayPeriodEnumValue;
case "aaaaa":
return dayPeriodEnumValue[0];
case "aaaa":
default:
return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
}
},
// Hour [1-12]
h(date, token) {
return addLeadingZeros(date.getHours() % 12 || 12, token.length);
},
// Hour [0-23]
H(date, token) {
return addLeadingZeros(date.getHours(), token.length);
},
// Minute
m(date, token) {
return addLeadingZeros(date.getMinutes(), token.length);
},
// Second
s(date, token) {
return addLeadingZeros(date.getSeconds(), token.length);
},
// Fraction of second
S(date, token) {
const numberOfDigits = token.length;
const milliseconds = date.getMilliseconds();
const fractionalSeconds = Math.trunc(
milliseconds * Math.pow(10, numberOfDigits - 3),
);
return addLeadingZeros(fractionalSeconds, token.length);
},
};
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/formatters.js
const dayPeriodEnum = {
am: "am",
pm: "pm",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
};
/*
* | | Unit | | Unit |
* |-----|--------------------------------|-----|--------------------------------|
* | a | AM, PM | A* | Milliseconds in day |
* | b | AM, PM, noon, midnight | B | Flexible day period |
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
* | d | Day of month | D | Day of year |
* | e | Local day of week | E | Day of week |
* | f | | F* | Day of week in month |
* | g* | Modified Julian day | G | Era |
* | h | Hour [1-12] | H | Hour [0-23] |
* | i! | ISO day of week | I! | ISO week of year |
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
* | k | Hour [1-24] | K | Hour [0-11] |
* | l* | (deprecated) | L | Stand-alone month |
* | m | Minute | M | Month |
* | n | | N | |
* | o! | Ordinal number modifier | O | Timezone (GMT) |
* | p! | Long localized time | P! | Long localized date |
* | q | Stand-alone quarter | Q | Quarter |
* | r* | Related Gregorian year | R! | ISO week-numbering year |
* | s | Second | S | Fraction of second |
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
* | u | Extended year | U* | Cyclic year |
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
* | w | Local week of year | W* | Week of month |
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
* | y | Year (abs) | Y | Local week-numbering year |
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
*
* Letters marked by * are not implemented but reserved by Unicode standard.
*
* Letters marked by ! are non-standard, but implemented by date-fns:
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
* i.e. 7 for Sunday, 1 for Monday, etc.
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
* `R` is supposed to be used in conjunction with `I` and `i`
* for universal ISO week-numbering date, whereas
* `Y` is supposed to be used in conjunction with `w` and `e`
* for week-numbering date specific to the locale.
* - `P` is long localized date format
* - `p` is long localized time format
*/
const formatters = {
// Era
G: function (date, token, localize) {
const era = date.getFullYear() > 0 ? 1 : 0;
switch (token) {
// AD, BC
case "G":
case "GG":
case "GGG":
return localize.era(era, { width: "abbreviated" });
// A, B
case "GGGGG":
return localize.era(era, { width: "narrow" });
// Anno Domini, Before Christ
case "GGGG":
default:
return localize.era(era, { width: "wide" });
}
},
// Year
y: function (date, token, localize) {
// Ordinal number
if (token === "yo") {
const signedYear = date.getFullYear();
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const year = signedYear > 0 ? signedYear : 1 - signedYear;
return localize.ordinalNumber(year, { unit: "year" });
}
return lightFormatters.y(date, token);
},
// Local week-numbering year
Y: function (date, token, localize, options) {
const signedWeekYear = getWeekYear(date, options);
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
// Two digit year
if (token === "YY") {
const twoDigitYear = weekYear % 100;
return addLeadingZeros(twoDigitYear, 2);
}
// Ordinal number
if (token === "Yo") {
return localize.ordinalNumber(weekYear, { unit: "year" });
}
// Padding
return addLeadingZeros(weekYear, token.length);
},
// ISO week-numbering year
R: function (date, token) {
const isoWeekYear = getISOWeekYear(date);
// Padding
return addLeadingZeros(isoWeekYear, token.length);
},
// Extended year. This is a single number designating the year of this calendar system.
// The main difference between `y` and `u` localizers are B.C. years:
// | Year | `y` | `u` |
// |------|-----|-----|
// | AC 1 | 1 | 1 |
// | BC 1 | 1 | 0 |
// | BC 2 | 2 | -1 |
// Also `yy` always returns the last two digits of a year,
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
u: function (date, token) {
const year = date.getFullYear();
return addLeadingZeros(year, token.length);
},
// Quarter
Q: function (date, token, localize) {
const quarter = Math.ceil((date.getMonth() + 1) / 3);
switch (token) {
// 1, 2, 3, 4
case "Q":
return String(quarter);
// 01, 02, 03, 04
case "QQ":
return addLeadingZeros(quarter, 2);
// 1st, 2nd, 3rd, 4th
case "Qo":
return localize.ordinalNumber(quarter, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "QQQ":
return localize.quarter(quarter, {
width: "abbreviated",
context: "formatting",
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "QQQQQ":
return localize.quarter(quarter, {
width: "narrow",
context: "formatting",
});
// 1st quarter, 2nd quarter, ...
case "QQQQ":
default:
return localize.quarter(quarter, {
width: "wide",
context: "formatting",
});
}
},
// Stand-alone quarter
q: function (date, token, localize) {
const quarter = Math.ceil((date.getMonth() + 1) / 3);
switch (token) {
// 1, 2, 3, 4
case "q":
return String(quarter);
// 01, 02, 03, 04
case "qq":
return addLeadingZeros(quarter, 2);
// 1st, 2nd, 3rd, 4th
case "qo":
return localize.ordinalNumber(quarter, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "qqq":
return localize.quarter(quarter, {
width: "abbreviated",
context: "standalone",
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "qqqqq":
return localize.quarter(quarter, {
width: "narrow",
context: "standalone",
});
// 1st quarter, 2nd quarter, ...
case "qqqq":
default:
return localize.quarter(quarter, {
width: "wide",
context: "standalone",
});
}
},
// Month
M: function (date, token, localize) {
const month = date.getMonth();
switch (token) {
case "M":
case "MM":
return lightFormatters.M(date, token);
// 1st, 2nd, ..., 12th
case "Mo":
return localize.ordinalNumber(month + 1, { unit: "month" });
// Jan, Feb, ..., Dec
case "MMM":
return localize.month(month, {
width: "abbreviated",
context: "formatting",
});
// J, F, ..., D
case "MMMMM":
return localize.month(month, {
width: "narrow",
context: "formatting",
});
// January, February, ..., December
case "MMMM":
default:
return localize.month(month, { width: "wide", context: "formatting" });
}
},
// Stand-alone month
L: function (date, token, localize) {
const month = date.getMonth();
switch (token) {
// 1, 2, ..., 12
case "L":
return String(month + 1);
// 01, 02, ..., 12
case "LL":
return addLeadingZeros(month + 1, 2);
// 1st, 2nd, ..., 12th
case "Lo":
return localize.ordinalNumber(month + 1, { unit: "month" });
// Jan, Feb, ..., Dec
case "LLL":
return localize.month(month, {
width: "abbreviated",
context: "standalone",
});
// J, F, ..., D
case "LLLLL":
return localize.month(month, {
width: "narrow",
context: "standalone",
});
// January, February, ..., December
case "LLLL":
default:
return localize.month(month, { width: "wide", context: "standalone" });
}
},
// Local week of year
w: function (date, token, localize, options) {
const week = getWeek(date, options);
if (token === "wo") {
return localize.ordinalNumber(week, { unit: "week" });
}
return addLeadingZeros(week, token.length);
},
// ISO week of year
I: function (date, token, localize) {
const isoWeek = getISOWeek(date);
if (token === "Io") {
return localize.ordinalNumber(isoWeek, { unit: "week" });
}
return addLeadingZeros(isoWeek, token.length);
},
// Day of the month
d: function (date, token, localize) {
if (token === "do") {
return localize.ordinalNumber(date.getDate(), { unit: "date" });
}
return lightFormatters.d(date, token);
},
// Day of year
D: function (date, token, localize) {
const dayOfYear = getDayOfYear(date);
if (token === "Do") {
return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
}
return addLeadingZeros(dayOfYear, token.length);
},
// Day of week
E: function (date, token, localize) {
const dayOfWeek = date.getDay();
switch (token) {
// Tue
case "E":
case "EE":
case "EEE":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "EEEEE":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "EEEEEE":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "EEEE":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// Local day of week
e: function (date, token, localize, options) {
const dayOfWeek = date.getDay();
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
// Numerical value (Nth day of week with current locale or weekStartsOn)
case "e":
return String(localDayOfWeek);
// Padded numerical value
case "ee":
return addLeadingZeros(localDayOfWeek, 2);
// 1st, 2nd, ..., 7th
case "eo":
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
case "eee":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "eeeee":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "eeeeee":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "eeee":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// Stand-alone local day of week
c: function (date, token, localize, options) {
const dayOfWeek = date.getDay();
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
// Numerical value (same as in `e`)
case "c":
return String(localDayOfWeek);
// Padded numerical value
case "cc":
return addLeadingZeros(localDayOfWeek, token.length);
// 1st, 2nd, ..., 7th
case "co":
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
case "ccc":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "standalone",
});
// T
case "ccccc":
return localize.day(dayOfWeek, {
width: "narrow",
context: "standalone",
});
// Tu
case "cccccc":
return localize.day(dayOfWeek, {
width: "short",
context: "standalone",
});
// Tuesday
case "cccc":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "standalone",
});
}
},
// ISO day of week
i: function (date, token, localize) {
const dayOfWeek = date.getDay();
const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
switch (token) {
// 2
case "i":
return String(isoDayOfWeek);
// 02
case "ii":
return addLeadingZeros(isoDayOfWeek, token.length);
// 2nd
case "io":
return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
// Tue
case "iii":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "iiiii":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "iiiiii":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "iiii":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// AM or PM
a: function (date, token, localize) {
const hours = date.getHours();
const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
switch (token) {
case "a":
case "aa":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "aaa":
return localize
.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
})
.toLowerCase();
case "aaaaa":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "aaaa":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// AM, PM, midnight, noon
b: function (date, token, localize) {
const hours = date.getHours();
let dayPeriodEnumValue;
if (hours === 12) {
dayPeriodEnumValue = dayPeriodEnum.noon;
} else if (hours === 0) {
dayPeriodEnumValue = dayPeriodEnum.midnight;
} else {
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
}
switch (token) {
case "b":
case "bb":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "bbb":
return localize
.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
})
.toLowerCase();
case "bbbbb":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "bbbb":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// in the morning, in the afternoon, in the evening, at night
B: function (date, token, localize) {
const hours = date.getHours();
let dayPeriodEnumValue;
if (hours >= 17) {
dayPeriodEnumValue = dayPeriodEnum.evening;
} else if (hours >= 12) {
dayPeriodEnumValue = dayPeriodEnum.afternoon;
} else if (hours >= 4) {
dayPeriodEnumValue = dayPeriodEnum.morning;
} else {
dayPeriodEnumValue = dayPeriodEnum.night;
}
switch (token) {
case "B":
case "BB":
case "BBB":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "BBBBB":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "BBBB":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// Hour [1-12]
h: function (date, token, localize) {
if (token === "ho") {
let hours = date.getHours() % 12;
if (hours === 0) hours = 12;
return localize.ordinalNumber(hours, { unit: "hour" });
}
return lightFormatters.h(date, token);
},
// Hour [0-23]
H: function (date, token, localize) {
if (token === "Ho") {
return localize.ordinalNumber(date.getHours(), { unit: "hour" });
}
return lightFormatters.H(date, token);
},
// Hour [0-11]
K: function (date, token, localize) {
const hours = date.getHours() % 12;
if (token === "Ko") {
return localize.ordinalNumber(hours, { unit: "hour" });
}
return addLeadingZeros(hours, token.length);
},
// Hour [1-24]
k: function (date, token, localize) {
let hours = date.getHours();
if (hours === 0) hours = 24;
if (token === "ko") {
return localize.ordinalNumber(hours, { unit: "hour" });
}
return addLeadingZeros(hours, token.length);
},
// Minute
m: function (date, token, localize) {
if (token === "mo") {
return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
}
return lightFormatters.m(date, token);
},
// Second
s: function (date, token, localize) {
if (token === "so") {
return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
}
return lightFormatters.s(date, token);
},
// Fraction of second
S: function (date, token) {
return lightFormatters.S(date, token);
},
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
X: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
if (timezoneOffset === 0) {
return "Z";
}
switch (token) {
// Hours and optional minutes
case "X":
return formatTimezoneWithOptionalMinutes(timezoneOffset);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XX`
case "XXXX":
case "XX": // Hours and minutes without `:` delimiter
return formatTimezone(timezoneOffset);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XXX`
case "XXXXX":
case "XXX": // Hours and minutes with `:` delimiter
default:
return formatTimezone(timezoneOffset, ":");
}
},
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
x: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Hours and optional minutes
case "x":
return formatTimezoneWithOptionalMinutes(timezoneOffset);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xx`
case "xxxx":
case "xx": // Hours and minutes without `:` delimiter
return formatTimezone(timezoneOffset);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xxx`
case "xxxxx":
case "xxx": // Hours and minutes with `:` delimiter
default:
return formatTimezone(timezoneOffset, ":");
}
},
// Timezone (GMT)
O: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Short
case "O":
case "OO":
case "OOO":
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
// Long
case "OOOO":
default:
return "GMT" + formatTimezone(timezoneOffset, ":");
}
},
// Timezone (specific non-location)
z: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Short
case "z":
case "zz":
case "zzz":
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
// Long
case "zzzz":
default:
return "GMT" + formatTimezone(timezoneOffset, ":");
}
},
// Seconds timestamp
t: function (date, token, _localize) {
const timestamp = Math.trunc(+date / 1000);
return addLeadingZeros(timestamp, token.length);
},
// Milliseconds timestamp
T: function (date, token, _localize) {
return addLeadingZeros(+date, token.length);
},
};
function formatTimezoneShort(offset, delimiter = "") {
const sign = offset > 0 ? "-" : "+";
const absOffset = Math.abs(offset);
const hours = Math.trunc(absOffset / 60);
const minutes = absOffset % 60;
if (minutes === 0) {
return sign + String(hours);
}
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
}
function formatTimezoneWithOptionalMinutes(offset, delimiter) {
if (offset % 60 === 0) {
const sign = offset > 0 ? "-" : "+";
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
}
return formatTimezone(offset, delimiter);
}
function formatTimezone(offset, delimiter = "") {
const sign = offset > 0 ? "-" : "+";
const absOffset = Math.abs(offset);
const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
const minutes = addLeadingZeros(absOffset % 60, 2);
return sign + hours + delimiter + minutes;
}
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/longFormatters.js
const dateLongFormatter = (pattern, formatLong) => {
switch (pattern) {
case "P":
return formatLong.date({ width: "short" });
case "PP":
return formatLong.date({ width: "medium" });
case "PPP":
return formatLong.date({ width: "long" });
case "PPPP":
default:
return formatLong.date({ width: "full" });
}
};
const timeLongFormatter = (pattern, formatLong) => {
switch (pattern) {
case "p":
return formatLong.time({ width: "short" });
case "pp":
return formatLong.time({ width: "medium" });
case "ppp":
return formatLong.time({ width: "long" });
case "pppp":
default:
return formatLong.time({ width: "full" });
}
};
const dateTimeLongFormatter = (pattern, formatLong) => {
const matchResult = pattern.match(/(P+)(p+)?/) || [];
const datePattern = matchResult[1];
const timePattern = matchResult[2];
if (!timePattern) {
return dateLongFormatter(pattern, formatLong);
}
let dateTimeFormat;
switch (datePattern) {
case "P":
dateTimeFormat = formatLong.dateTime({ width: "short" });
break;
case "PP":
dateTimeFormat = formatLong.dateTime({ width: "medium" });
break;
case "PPP":
dateTimeFormat = formatLong.dateTime({ width: "long" });
break;
case "PPPP":
default:
dateTimeFormat = formatLong.dateTime({ width: "full" });
break;
}
return dateTimeFormat
.replace("{{date}}", dateLongFormatter(datePattern, formatLong))
.replace("{{time}}", timeLongFormatter(timePattern, formatLong));
};
const longFormatters = {
p: timeLongFormatter,
P: dateTimeLongFormatter,
};
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/protectedTokens.js
const dayOfYearTokenRE = /^D+$/;
const weekYearTokenRE = /^Y+$/;
const throwTokens = ["D", "DD", "YY", "YYYY"];
function isProtectedDayOfYearToken(token) {
return dayOfYearTokenRE.test(token);
}
function isProtectedWeekYearToken(token) {
return weekYearTokenRE.test(token);
}
function warnOrThrowProtectedError(token, format, input) {
const _message = message(token, format, input);
console.warn(_message);
if (throwTokens.includes(token)) throw new RangeError(_message);
}
function message(token, format, input) {
const subject = token[0] === "Y" ? "years" : "days of the month";
return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
}
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/format.js
// Rexports of internal for libraries to use.
// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874
// This RegExp consists of three parts separated by `|`:
// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
// (one of the certain letters followed by `o`)
// - (\w)\1* matches any sequences of the same letter
// - '' matches two quote characters in a row
// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
// except a single quote symbol, which ends the sequence.
// Two quote characters do not end the sequence.
// If there is no matching single quote
// then the sequence will continue until the end of the string.
// - . matches any single character unmatched by previous parts of the RegExps
const formattingTokensRegExp =
/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
// This RegExp catches symbols escaped by quotes, and also
// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
const escapedStringRegExp = /^'([^]*?)'?$/;
const doubleQuoteRegExp = /''/g;
const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
/**
* The {@link format} function options.
*/
/**
* @name format
* @alias formatDate
* @category Common Helpers
* @summary Format the date.
*
* @description
* Return the formatted date string in the given format. The result may vary by locale.
*
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
* > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* The characters wrapped between two single quotes characters (') are escaped.
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
* (see the last example)
*
* Format of the string is based on Unicode Technical Standard #35:
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
* with a few additions (see note 7 below the table).
*
* Accepted patterns:
* | Unit | Pattern | Result examples | Notes |
* |---------------------------------|---------|-----------------------------------|-------|
* | Era | G..GGG | AD, BC | |
* | | GGGG | Anno Domini, Before Christ | 2 |
* | | GGGGG | A, B | |
* | Calendar year | y | 44, 1, 1900, 2017 | 5 |
* | | yo | 44th, 1st, 0th, 17th | 5,7 |
* | | yy | 44, 01, 00, 17 | 5 |
* | | yyy | 044, 001, 1900, 2017 | 5 |
* | | yyyy | 0044, 0001, 1900, 2017 | 5 |
* | | yyyyy | ... | 3,5 |
* | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
* | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
* | | YY | 44, 01, 00, 17 | 5,8 |
* | | YYY | 044, 001, 1900, 2017 | 5 |
* | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
* | | YYYYY | ... | 3,5 |
* | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
* | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
* | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
* | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
* | | RRRRR | ... | 3,5,7 |
* | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
* | | uu | -43, 01, 1900, 2017 | 5 |
* | | uuu | -043, 001, 1900, 2017 | 5 |
* | | uuuu | -0043, 0001, 1900, 2017 | 5 |
* | | uuuuu | ... | 3,5 |
* | Quarter (formatting) | Q | 1, 2, 3, 4 | |
* | | Qo | 1st, 2nd, 3rd, 4th | 7 |
* | | QQ | 01, 02, 03, 04 | |
* | | QQQ | Q1, Q2, Q3, Q4 | |
* | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
* | | QQQQQ | 1, 2, 3, 4 | 4 |
* | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
* | | qo | 1st, 2nd, 3rd, 4th | 7 |
* | | qq | 01, 02, 03, 04 | |
* | | qqq | Q1, Q2, Q3, Q4 | |
* | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
* | | qqqqq | 1, 2, 3, 4 | 4 |
* | Month (formatting) | M | 1, 2, ..., 12 | |
* | | Mo | 1st, 2nd, ..., 12th | 7 |
* | | MM | 01, 02, ..., 12 | |
* | | MMM | Jan, Feb, ..., Dec | |
* | | MMMM | January, February, ..., December | 2 |
* | | MMMMM | J, F, ..., D | |
* | Month (stand-alone) | L | 1, 2, ..., 12 | |
* | | Lo | 1st, 2nd, ..., 12th | 7 |
* | | LL | 01, 02, ..., 12 | |
* | | LLL | Jan, Feb, ..., Dec | |
* | | LLLL | January, February, ..., December | 2 |
* | | LLLLL | J, F, ..., D | |
* | Local week of year | w | 1, 2, ..., 53 | |
* | | wo | 1st, 2nd, ..., 53th | 7 |
* | | ww | 01, 02, ..., 53 | |
* | ISO week of year | I | 1, 2, ..., 53 | 7 |
* | | Io | 1st, 2nd, ..., 53th | 7 |
* | | II | 01, 02, ..., 53 | 7 |
* | Day of month | d | 1, 2, ..., 31 | |
* | | do | 1st, 2nd, ..., 31st | 7 |
* | | dd | 01, 02, ..., 31 | |
* | Day of year | D | 1, 2, ..., 365, 366 | 9 |
* | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
* | | DD | 01, 02, ..., 365, 366 | 9 |
* | | DDD | 001, 002, ..., 365, 366 | |
* | | DDDD | ... | 3 |
* | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
* | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
* | | EEEEE | M, T, W, T, F, S, S | |
* | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
* | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
* | | io | 1st, 2nd, ..., 7th | 7 |
* | | ii | 01, 02, ..., 07 | 7 |
* | | iii | Mon, Tue, Wed, ..., Sun | 7 |
* | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
* | | iiiii | M, T, W, T, F, S, S | 7 |
* | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
* | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
* | | eo | 2nd, 3rd, ..., 1st | 7 |
* | | ee | 02, 03, ..., 01 | |
* | | eee | Mon, Tue, Wed, ..., Sun | |
* | | eeee | Monday, Tuesday, ..., Sunday | 2 |
* | | eeeee | M, T, W, T, F, S, S | |
* | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
* | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
* | | co | 2nd, 3rd, ..., 1st | 7 |
* | | cc | 02, 03, ..., 01 | |
* | | ccc | Mon, Tue, Wed, ..., Sun | |
* | | cccc | Monday, Tuesday, ..., Sunday | 2 |
* | | ccccc | M, T, W, T, F, S, S | |
* | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
* | AM, PM | a..aa | AM, PM | |
* | | aaa | am, pm | |
* | | aaaa | a.m., p.m. | 2 |
* | | aaaaa | a, p | |
* | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
* | | bbb | am, pm, noon, midnight | |
* | | bbbb | a.m., p.m., noon, midnight | 2 |
* | | bbbbb | a, p, n, mi | |
* | Flexible day period | B..BBB | at night, in the morning, ... | |
* | | BBBB | at night, in the morning, ... | 2 |
* | | BBBBB | at night, in the morning, ... | |
* | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
* | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
* | | hh | 01, 02, ..., 11, 12 | |
* | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
* | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
* | | HH | 00, 01, 02, ..., 23 | |
* | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
* | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
* | | KK | 01, 02, ..., 11, 00 | |
* | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
* | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
* | | kk | 24, 01, 02, ..., 23 | |
* | Minute | m | 0, 1, ..., 59 | |
* | | mo | 0th, 1st, ..., 59th | 7 |
* | | mm | 00, 01, ..., 59 | |
* | Second | s | 0, 1, ..., 59 | |
* | | so | 0th, 1st, ..., 59th | 7 |
* | | ss | 00, 01, ..., 59 | |
* | Fraction of second | S | 0, 1, ..., 9 | |
* | | SS | 00, 01, ..., 99 | |
* | | SSS | 000, 001, ..., 999 | |
* | | SSSS | ... | 3 |
* | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
* | | XX | -0800, +0530, Z | |
* | | XXX | -08:00, +05:30, Z | |
* | | XXXX | -0800, +0530, Z, +123456 | 2 |
* | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
* | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
* | | xx | -0800, +0530, +0000 | |
* | | xxx | -08:00, +05:30, +00:00 | 2 |
* | | xxxx | -0800, +0530, +0000, +123456 | |
* | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
* | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
* | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
* | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
* | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
* | Seconds timestamp | t | 512969520 | 7 |
* | | tt | ... | 3,7 |
* | Milliseconds timestamp | T | 512969520900 | 7 |
* | | TT | ... | 3,7 |
* | Long localized date | P | 04/29/1453 | 7 |
* | | PP | Apr 29, 1453 | 7 |
* | | PPP | April 29th, 1453 | 7 |
* | | PPPP | Friday, April 29th, 1453 | 2,7 |
* | Long localized time | p | 12:00 AM | 7 |
* | | pp | 12:00:00 AM | 7 |
* | | ppp | 12:00:00 AM GMT+2 | 7 |
* | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
* | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
* | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
* | | PPPppp | April 29th, 1453 at ... | 7 |
* | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
* Notes:
* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
* are the same as "stand-alone" units, but are different in some languages.
* "Formatting" units are declined according to the rules of the language
* in the context of a date. "Stand-alone" units are always nominative singular:
*
* `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
*
* `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
*
* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
* the single quote characters (see below).
* If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
* the output will be the same as default pattern for this unit, usually
* the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
* are marked with "2" in the last column of the table.
*
* `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
*
* `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
*
* `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
*
* `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
*
* `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
*
* 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
* The output will be padded with zeros to match the length of the pattern.
*
* `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
*
* 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
* These tokens represent the shortest form of the quarter.
*
* 5. The main difference between `y` and `u` patterns are B.C. years:
*
* | Year | `y` | `u` |
* |------|-----|-----|
* | AC 1 | 1 | 1 |
* | BC 1 | 1 | 0 |
* | BC 2 | 2 | -1 |
*
* Also `yy` always returns the last two digits of a year,
* while `uu` pads single digit years to 2 characters and returns other years unchanged:
*
* | Year | `yy` | `uu` |
* |------|------|------|
* | 1 | 01 | 01 |
* | 14 | 14 | 14 |
* | 376 | 76 | 376 |
* | 1453 | 53 | 1453 |
*
* The same difference is true for local and ISO week-numbering years (`Y` and `R`),
* except local week-numbering years are dependent on `options.weekStartsOn`
* and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
* and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
*
* 6. Specific non-location timezones are currently unavailable in `date-fns`,
* so right now these tokens fall back to GMT timezones.
*
* 7. These patterns are not in the Unicode Technical Standard #35:
* - `i`: ISO day of week
* - `I`: ISO week of year
* - `R`: ISO week-numbering year
* - `t`: seconds timestamp
* - `T`: milliseconds timestamp
* - `o`: ordinal number modifier
* - `P`: long localized date
* - `p`: long localized time
*
* 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* @param date - The original date
* @param format - The string of tokens
* @param options - An object with options
*
* @returns The formatted date string
*
* @throws `date` must not be Invalid Date
* @throws `options.locale` must contain `localize` property
* @throws `options.locale` must contain `formatLong` property
* @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws format string contains an unescaped latin alphabet character
*
* @example
* // Represent 11 February 2014 in middle-endian format:
* const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
* //=> '02/11/2014'
*
* @example
* // Represent 2 July 2014 in Esperanto:
* import { eoLocale } from 'date-fns/locale/eo'
* const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
* locale: eoLocale
* })
* //=> '2-a de julio 2014'
*
* @example
* // Escape string by single quote characters:
* const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
* //=> "3 o'clock"
*/
function format(date, formatStr, options) {
const defaultOptions = getDefaultOptions();
const locale = options?.locale ?? defaultOptions.locale ?? enUS;
const firstWeekContainsDate =
options?.firstWeekContainsDate ??
options?.locale?.options?.firstWeekContainsDate ??
defaultOptions.firstWeekContainsDate ??
defaultOptions.locale?.options?.firstWeekContainsDate ??
1;
const weekStartsOn =
options?.weekStartsOn ??
options?.locale?.options?.weekStartsOn ??
defaultOptions.weekStartsOn ??
defaultOptions.locale?.options?.weekStartsOn ??
0;
const originalDate = toDate(date, options?.in);
if (!isValid(originalDate)) {
throw new RangeError("Invalid time value");
}
let parts = formatStr
.match(longFormattingTokensRegExp)
.map((substring) => {
const firstCharacter = substring[0];
if (firstCharacter === "p" || firstCharacter === "P") {
const longFormatter = longFormatters[firstCharacter];
return longFormatter(substring, locale.formatLong);
}
return substring;
})
.join("")
.match(formattingTokensRegExp)
.map((substring) => {
// Replace two single quote characters with one single quote character
if (substring === "''") {
return { isToken: false, value: "'" };
}
const firstCharacter = substring[0];
if (firstCharacter === "'") {
return { isToken: false, value: cleanEscapedString(substring) };
}
if (formatters[firstCharacter]) {
return { isToken: true, value: substring };
}
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
throw new RangeError(
"Format string contains an unescaped latin alphabet character `" +
firstCharacter +
"`",
);
}
return { isToken: false, value: substring };
});
// invoke localize preprocessor (only for french locales at the moment)
if (locale.localize.preprocessor) {
parts = locale.localize.preprocessor(originalDate, parts);
}
const formatterOptions = {
firstWeekContainsDate,
weekStartsOn,
locale,
};
return parts
.map((part) => {
if (!part.isToken) return part.value;
const token = part.value;
if (
(!options?.useAdditionalWeekYearTokens &&
isProtectedWeekYearToken(token)) ||
(!options?.useAdditionalDayOfYearTokens &&
isProtectedDayOfYearToken(token))
) {
warnOrThrowProtectedError(token, formatStr, String(date));
}
const formatter = formatters[token[0]];
return formatter(originalDate, token, locale.localize, formatterOptions);
})
.join("");
}
function cleanEscapedString(input) {
const matched = input.match(escapedStringRegExp);
if (!matched) {
return input;
}
return matched[1].replace(doubleQuoteRegExp, "'");
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_format = ((/* unused pure expression or super */ null && (format)));
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/relative-date-control.js
const TIME_UNITS_OPTIONS = {
[OPERATOR_IN_THE_PAST]: [
{ value: "days", label: (0,external_wp_i18n_namespaceObject.__)("Days") },
{ value: "weeks", label: (0,external_wp_i18n_namespaceObject.__)("Weeks") },
{ value: "months", label: (0,external_wp_i18n_namespaceObject.__)("Months") },
{ value: "years", label: (0,external_wp_i18n_namespaceObject.__)("Years") }
],
[OPERATOR_OVER]: [
{ value: "days", label: (0,external_wp_i18n_namespaceObject.__)("Days ago") },
{ value: "weeks", label: (0,external_wp_i18n_namespaceObject.__)("Weeks ago") },
{ value: "months", label: (0,external_wp_i18n_namespaceObject.__)("Months ago") },
{ value: "years", label: (0,external_wp_i18n_namespaceObject.__)("Years ago") }
]
};
function RelativeDateControl({
className,
data,
field,
onChange,
hideLabelFromVision,
operator
}) {
const options = TIME_UNITS_OPTIONS[operator === OPERATOR_IN_THE_PAST ? "inThePast" : "over"];
const { id, label, getValue, setValue } = field;
const fieldValue = getValue({ item: data });
const { value: relValue = "", unit = options[0].value } = fieldValue && typeof fieldValue === "object" ? fieldValue : {};
const onChangeValue = (0,external_wp_element_.useCallback)(
(newValue) => onChange(
setValue({
item: data,
value: { value: Number(newValue), unit }
})
),
[onChange, setValue, data, unit]
);
const onChangeUnit = (0,external_wp_element_.useCallback)(
(newUnit) => onChange(
setValue({
item: data,
value: { value: relValue, unit: newUnit }
})
),
[onChange, setValue, data, relValue]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.BaseControl,
{
id,
__nextHasNoMarginBottom: true,
className: dist_clsx(className, "dataviews-controls__relative-date"),
label,
hideLabelFromVision,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 2.5, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalNumberControl,
{
__next40pxDefaultSize: true,
className: "dataviews-controls__relative-date-number",
spinControls: "none",
min: 1,
step: 1,
value: relValue,
onChange: onChangeValue
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SelectControl,
{
className: "dataviews-controls__relative-date-unit",
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Unit"),
value: unit,
options,
onChange: onChangeUnit,
hideLabelFromVision: true
}
)
] })
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/datetime.js
const { DateCalendar, ValidatedInputControl } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
const parseDateTime = (dateTimeString) => {
if (!dateTimeString) {
return null;
}
const parsed = (0,external_wp_date_namespaceObject.getDate)(dateTimeString);
return parsed && isValid(parsed) ? parsed : null;
};
const formatDateTime = (date) => {
if (!date) {
return "";
}
if (typeof date === "string") {
return date;
}
return format(date, "yyyy-MM-dd'T'HH:mm");
};
function CalendarDateTimeControl({
data,
field,
onChange,
hideLabelFromVision,
validity
}) {
const { id, label, description, setValue, getValue, isValid } = field;
const fieldValue = getValue({ item: data });
const value = typeof fieldValue === "string" ? fieldValue : void 0;
const [calendarMonth, setCalendarMonth] = (0,external_wp_element_.useState)(() => {
const parsedDate = parseDateTime(value);
return parsedDate || /* @__PURE__ */ new Date();
});
const inputControlRef = (0,external_wp_element_.useRef)(null);
const validationTimeoutRef = (0,external_wp_element_.useRef)();
const previousFocusRef = (0,external_wp_element_.useRef)(null);
const onChangeCallback = (0,external_wp_element_.useCallback)(
(newValue) => onChange(setValue({ item: data, value: newValue })),
[data, onChange, setValue]
);
(0,external_wp_element_.useEffect)(() => {
return () => {
if (validationTimeoutRef.current) {
clearTimeout(validationTimeoutRef.current);
}
};
}, []);
const onSelectDate = (0,external_wp_element_.useCallback)(
(newDate) => {
let dateTimeValue;
if (newDate) {
let finalDateTime = newDate;
if (value) {
const currentDateTime = parseDateTime(value);
if (currentDateTime) {
finalDateTime = new Date(newDate);
finalDateTime.setHours(currentDateTime.getHours());
finalDateTime.setMinutes(
currentDateTime.getMinutes()
);
}
}
dateTimeValue = finalDateTime.toISOString();
onChangeCallback(dateTimeValue);
if (validationTimeoutRef.current) {
clearTimeout(validationTimeoutRef.current);
}
} else {
onChangeCallback(void 0);
}
previousFocusRef.current = inputControlRef.current && inputControlRef.current.ownerDocument.activeElement;
validationTimeoutRef.current = setTimeout(() => {
if (inputControlRef.current) {
inputControlRef.current.focus();
inputControlRef.current.blur();
onChangeCallback(dateTimeValue);
if (previousFocusRef.current && previousFocusRef.current instanceof HTMLElement) {
previousFocusRef.current.focus();
}
}
}, 0);
},
[onChangeCallback, value]
);
const handleManualDateTimeChange = (0,external_wp_element_.useCallback)(
(newValue) => {
if (newValue) {
const dateTime = new Date(newValue);
onChangeCallback(dateTime.toISOString());
const parsedDate = parseDateTime(dateTime.toISOString());
if (parsedDate) {
setCalendarMonth(parsedDate);
}
} else {
onChangeCallback(void 0);
}
},
[onChangeCallback]
);
const {
timezone: { string: timezoneString },
l10n: { startOfWeek }
} = (0,external_wp_date_namespaceObject.getSettings)();
const displayLabel = isValid?.required && !hideLabelFromVision ? `${label} (${(0,external_wp_i18n_namespaceObject.__)("Required")})` : label;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.BaseControl,
{
__nextHasNoMarginBottom: true,
id,
label: displayLabel,
help: description,
hideLabelFromVision,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DateCalendar,
{
style: { width: "100%" },
selected: value ? parseDateTime(value) || void 0 : void 0,
onSelect: onSelectDate,
month: calendarMonth,
onMonthChange: setCalendarMonth,
timeZone: timezoneString || void 0,
weekStartsOn: startOfWeek
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ValidatedInputControl,
{
ref: inputControlRef,
__next40pxDefaultSize: true,
required: !!isValid?.required,
customValidity: getCustomValidity(isValid, validity),
type: "datetime-local",
label: (0,external_wp_i18n_namespaceObject.__)("Date time"),
hideLabelFromVision: true,
value: value ? formatDateTime(
parseDateTime(value) || void 0
) : "",
onChange: handleManualDateTimeChange
}
)
] })
}
);
}
function DateTime({
data,
field,
onChange,
hideLabelFromVision,
operator,
validity
}) {
if (operator === OPERATOR_IN_THE_PAST || operator === OPERATOR_OVER) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
RelativeDateControl,
{
className: "dataviews-controls__datetime",
data,
field,
onChange,
hideLabelFromVision,
operator
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CalendarDateTimeControl,
{
data,
field,
onChange,
hideLabelFromVision,
validity
}
);
}
;// ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfMonth.js
/**
* The {@link startOfMonth} function options.
*/
/**
* @name startOfMonth
* @category Month Helpers
* @summary Return the start of a month for the given date.
*
* @description
* Return the start of a month for the given date. The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments.
* Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed,
* or inferred from the arguments.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The start of a month
*
* @example
* // The start of a month for 2 September 2014 11:55:00:
* const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
* //=> Mon Sep 01 2014 00:00:00
*/
function startOfMonth(date, options) {
const _date = toDate(date, options?.in);
_date.setDate(1);
_date.setHours(0, 0, 0, 0);
return _date;
}
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfMonth = ((/* unused pure expression or super */ null && (startOfMonth)));
;// ./node_modules/@wordpress/icons/build-module/library/error.js
var error_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"
}
) });
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/date.js
const { DateCalendar: date_DateCalendar, DateRangeCalendar } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
const DATE_PRESETS = [
{
id: "today",
label: (0,external_wp_i18n_namespaceObject.__)("Today"),
getValue: () => (0,external_wp_date_namespaceObject.getDate)(null)
},
{
id: "yesterday",
label: (0,external_wp_i18n_namespaceObject.__)("Yesterday"),
getValue: () => {
const today = (0,external_wp_date_namespaceObject.getDate)(null);
return subDays(today, 1);
}
},
{
id: "past-week",
label: (0,external_wp_i18n_namespaceObject.__)("Past week"),
getValue: () => {
const today = (0,external_wp_date_namespaceObject.getDate)(null);
return subDays(today, 7);
}
},
{
id: "past-month",
label: (0,external_wp_i18n_namespaceObject.__)("Past month"),
getValue: () => {
const today = (0,external_wp_date_namespaceObject.getDate)(null);
return subMonths(today, 1);
}
}
];
const DATE_RANGE_PRESETS = [
{
id: "last-7-days",
label: (0,external_wp_i18n_namespaceObject.__)("Last 7 days"),
getValue: () => {
const today = (0,external_wp_date_namespaceObject.getDate)(null);
return [subDays(today, 7), today];
}
},
{
id: "last-30-days",
label: (0,external_wp_i18n_namespaceObject.__)("Last 30 days"),
getValue: () => {
const today = (0,external_wp_date_namespaceObject.getDate)(null);
return [subDays(today, 30), today];
}
},
{
id: "month-to-date",
label: (0,external_wp_i18n_namespaceObject.__)("Month to date"),
getValue: () => {
const today = (0,external_wp_date_namespaceObject.getDate)(null);
return [startOfMonth(today), today];
}
},
{
id: "last-year",
label: (0,external_wp_i18n_namespaceObject.__)("Last year"),
getValue: () => {
const today = (0,external_wp_date_namespaceObject.getDate)(null);
return [subYears(today, 1), today];
}
},
{
id: "year-to-date",
label: (0,external_wp_i18n_namespaceObject.__)("Year to date"),
getValue: () => {
const today = (0,external_wp_date_namespaceObject.getDate)(null);
return [startOfYear(today), today];
}
}
];
const parseDate = (dateString) => {
if (!dateString) {
return null;
}
const parsed = (0,external_wp_date_namespaceObject.getDate)(dateString);
return parsed && isValid(parsed) ? parsed : null;
};
const formatDate = (date) => {
if (!date) {
return "";
}
return typeof date === "string" ? date : format(date, "yyyy-MM-dd");
};
function ValidatedDateControl({
field,
validity,
inputRefs,
isTouched,
setIsTouched,
children
}) {
const { isValid } = field;
const [customValidity, setCustomValidity] = (0,external_wp_element_.useState)(void 0);
const validateRefs = (0,external_wp_element_.useCallback)(() => {
const refs = Array.isArray(inputRefs) ? inputRefs : [inputRefs];
for (const ref of refs) {
const input = ref.current;
if (input && !input.validity.valid) {
setCustomValidity({
type: "invalid",
message: input.validationMessage
});
return;
}
}
setCustomValidity(void 0);
}, [inputRefs]);
(0,external_wp_element_.useEffect)(() => {
if (isTouched) {
const timeoutId = setTimeout(() => {
if (validity) {
setCustomValidity(getCustomValidity(isValid, validity));
} else {
validateRefs();
}
}, 0);
return () => clearTimeout(timeoutId);
}
return void 0;
}, [isTouched, isValid, validity, validateRefs]);
const onBlur = (event) => {
if (isTouched) {
return;
}
if (!event.relatedTarget || !event.currentTarget.contains(event.relatedTarget)) {
setIsTouched(true);
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { onBlur, children: [
children,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { "aria-live": "polite", children: customValidity && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"p",
{
className: dist_clsx(
"components-validated-control__indicator",
customValidity.type === "invalid" ? "is-invalid" : void 0,
customValidity.type === "valid" ? "is-valid" : void 0
),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Icon,
{
className: "components-validated-control__indicator-icon",
icon: error_default,
size: 16,
fill: "currentColor"
}
),
customValidity.message
]
}
) })
] });
}
function CalendarDateControl({
data,
field,
onChange,
hideLabelFromVision,
validity
}) {
const { id, label, setValue, getValue, isValid } = field;
const [selectedPresetId, setSelectedPresetId] = (0,external_wp_element_.useState)(
null
);
const fieldValue = getValue({ item: data });
const value = typeof fieldValue === "string" ? fieldValue : void 0;
const [calendarMonth, setCalendarMonth] = (0,external_wp_element_.useState)(() => {
const parsedDate = parseDate(value);
return parsedDate || /* @__PURE__ */ new Date();
});
const [isTouched, setIsTouched] = (0,external_wp_element_.useState)(false);
const validityTargetRef = (0,external_wp_element_.useRef)(null);
const onChangeCallback = (0,external_wp_element_.useCallback)(
(newValue) => onChange(setValue({ item: data, value: newValue })),
[data, onChange, setValue]
);
const onSelectDate = (0,external_wp_element_.useCallback)(
(newDate) => {
const dateValue = newDate ? format(newDate, "yyyy-MM-dd") : void 0;
onChangeCallback(dateValue);
setSelectedPresetId(null);
setIsTouched(true);
},
[onChangeCallback]
);
const handlePresetClick = (0,external_wp_element_.useCallback)(
(preset) => {
const presetDate = preset.getValue();
const dateValue = formatDate(presetDate);
setCalendarMonth(presetDate);
onChangeCallback(dateValue);
setSelectedPresetId(preset.id);
setIsTouched(true);
},
[onChangeCallback]
);
const handleManualDateChange = (0,external_wp_element_.useCallback)(
(newValue) => {
onChangeCallback(newValue);
if (newValue) {
const parsedDate = parseDate(newValue);
if (parsedDate) {
setCalendarMonth(parsedDate);
}
}
setSelectedPresetId(null);
setIsTouched(true);
},
[onChangeCallback]
);
const {
timezone: { string: timezoneString },
l10n: { startOfWeek }
} = (0,external_wp_date_namespaceObject.getSettings)();
const displayLabel = isValid?.required ? `${label} (${(0,external_wp_i18n_namespaceObject.__)("Required")})` : label;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ValidatedDateControl,
{
field,
validity,
inputRefs: validityTargetRef,
isTouched,
setIsTouched,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.BaseControl,
{
__nextHasNoMarginBottom: true,
id,
className: "dataviews-controls__date",
label: displayLabel,
hideLabelFromVision,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 2, wrap: true, justify: "flex-start", children: [
DATE_PRESETS.map((preset) => {
const isSelected = selectedPresetId === preset.id;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
className: "dataviews-controls__date-preset",
variant: "tertiary",
isPressed: isSelected,
size: "small",
onClick: () => handlePresetClick(preset),
children: preset.label
},
preset.id
);
}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
className: "dataviews-controls__date-preset",
variant: "tertiary",
isPressed: !selectedPresetId,
size: "small",
disabled: !!selectedPresetId,
accessibleWhenDisabled: false,
children: (0,external_wp_i18n_namespaceObject.__)("Custom")
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalInputControl,
{
__next40pxDefaultSize: true,
ref: validityTargetRef,
type: "date",
label: (0,external_wp_i18n_namespaceObject.__)("Date"),
hideLabelFromVision: true,
value,
onChange: handleManualDateChange,
required: !!field.isValid?.required
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
date_DateCalendar,
{
style: { width: "100%" },
selected: value ? parseDate(value) || void 0 : void 0,
onSelect: onSelectDate,
month: calendarMonth,
onMonthChange: setCalendarMonth,
timeZone: timezoneString || void 0,
weekStartsOn: startOfWeek
}
)
] })
}
)
}
);
}
function CalendarDateRangeControl({
data,
field,
onChange,
hideLabelFromVision,
validity
}) {
const { id, label, getValue, setValue } = field;
let value;
const fieldValue = getValue({ item: data });
if (Array.isArray(fieldValue) && fieldValue.length === 2 && fieldValue.every((date) => typeof date === "string")) {
value = fieldValue;
}
const onChangeCallback = (0,external_wp_element_.useCallback)(
(newValue) => {
onChange(
setValue({
item: data,
value: newValue
})
);
},
[data, onChange, setValue]
);
const [selectedPresetId, setSelectedPresetId] = (0,external_wp_element_.useState)(
null
);
const selectedRange = (0,external_wp_element_.useMemo)(() => {
if (!value) {
return { from: void 0, to: void 0 };
}
const [from, to] = value;
return {
from: parseDate(from) || void 0,
to: parseDate(to) || void 0
};
}, [value]);
const [calendarMonth, setCalendarMonth] = (0,external_wp_element_.useState)(() => {
return selectedRange.from || /* @__PURE__ */ new Date();
});
const [isTouched, setIsTouched] = (0,external_wp_element_.useState)(false);
const fromInputRef = (0,external_wp_element_.useRef)(null);
const toInputRef = (0,external_wp_element_.useRef)(null);
const updateDateRange = (0,external_wp_element_.useCallback)(
(fromDate, toDate) => {
if (fromDate && toDate) {
onChangeCallback([
formatDate(fromDate),
formatDate(toDate)
]);
} else if (!fromDate && !toDate) {
onChangeCallback(void 0);
}
},
[onChangeCallback]
);
const onSelectCalendarRange = (0,external_wp_element_.useCallback)(
(newRange) => {
updateDateRange(newRange?.from, newRange?.to);
setSelectedPresetId(null);
setIsTouched(true);
},
[updateDateRange]
);
const handlePresetClick = (0,external_wp_element_.useCallback)(
(preset) => {
const [startDate, endDate] = preset.getValue();
setCalendarMonth(startDate);
updateDateRange(startDate, endDate);
setSelectedPresetId(preset.id);
setIsTouched(true);
},
[updateDateRange]
);
const handleManualDateChange = (0,external_wp_element_.useCallback)(
(fromOrTo, newValue) => {
const [currentFrom, currentTo] = value || [
void 0,
void 0
];
const updatedFrom = fromOrTo === "from" ? newValue : currentFrom;
const updatedTo = fromOrTo === "to" ? newValue : currentTo;
updateDateRange(updatedFrom, updatedTo);
if (newValue) {
const parsedDate = parseDate(newValue);
if (parsedDate) {
setCalendarMonth(parsedDate);
}
}
setSelectedPresetId(null);
setIsTouched(true);
},
[value, updateDateRange]
);
const { timezone, l10n } = (0,external_wp_date_namespaceObject.getSettings)();
const displayLabel = field.isValid?.required ? `${label} (${(0,external_wp_i18n_namespaceObject.__)("Required")})` : label;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ValidatedDateControl,
{
field,
validity,
inputRefs: [fromInputRef, toInputRef],
isTouched,
setIsTouched,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.BaseControl,
{
__nextHasNoMarginBottom: true,
id,
className: "dataviews-controls__date",
label: displayLabel,
hideLabelFromVision,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 2, wrap: true, justify: "flex-start", children: [
DATE_RANGE_PRESETS.map((preset) => {
const isSelected = selectedPresetId === preset.id;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
className: "dataviews-controls__date-preset",
variant: "tertiary",
isPressed: isSelected,
size: "small",
onClick: () => handlePresetClick(preset),
children: preset.label
},
preset.id
);
}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
className: "dataviews-controls__date-preset",
variant: "tertiary",
isPressed: !selectedPresetId,
size: "small",
accessibleWhenDisabled: false,
disabled: !!selectedPresetId,
children: (0,external_wp_i18n_namespaceObject.__)("Custom")
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 2, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalInputControl,
{
__next40pxDefaultSize: true,
ref: fromInputRef,
type: "date",
label: (0,external_wp_i18n_namespaceObject.__)("From"),
hideLabelFromVision: true,
value: value?.[0],
onChange: (newValue) => handleManualDateChange("from", newValue),
required: !!field.isValid?.required
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalInputControl,
{
__next40pxDefaultSize: true,
ref: toInputRef,
type: "date",
label: (0,external_wp_i18n_namespaceObject.__)("To"),
hideLabelFromVision: true,
value: value?.[1],
onChange: (newValue) => handleManualDateChange("to", newValue),
required: !!field.isValid?.required
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DateRangeCalendar,
{
style: { width: "100%" },
selected: selectedRange,
onSelect: onSelectCalendarRange,
month: calendarMonth,
onMonthChange: setCalendarMonth,
timeZone: timezone.string || void 0,
weekStartsOn: l10n.startOfWeek
}
)
] })
}
)
}
);
}
function DateControl({
data,
field,
onChange,
hideLabelFromVision,
operator,
validity
}) {
if (operator === OPERATOR_IN_THE_PAST || operator === OPERATOR_OVER) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
RelativeDateControl,
{
className: "dataviews-controls__date",
data,
field,
onChange,
hideLabelFromVision,
operator
}
);
}
if (operator === OPERATOR_BETWEEN) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CalendarDateRangeControl,
{
data,
field,
onChange,
hideLabelFromVision,
validity
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CalendarDateControl,
{
data,
field,
onChange,
hideLabelFromVision,
validity
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/at-symbol.js
var at_symbol_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12.5939 21C14.1472 21 16.1269 20.5701 17.0711 20.1975L16.6447 18.879C16.0964 19.051 14.3299 19.6242 12.6548 19.6242C7.4467 19.6242 4.67513 16.8726 4.67513 12C4.67513 7.21338 7.50762 4.34713 12.2893 4.34713C17.132 4.34713 19.4162 7.55732 19.4162 10.7675C19.4162 14.035 19.0508 15.4968 17.4975 15.4968C16.5838 15.4968 16.0964 14.7803 16.0964 13.9777V7.5H14.4822V8.30255H14.3909C14.1777 7.67198 12.9898 7.12739 11.467 7.2707C9.18274 7.5 7.4467 9.27707 7.4467 11.8567C7.4467 14.5796 8.81726 16.672 11.467 16.758C13.203 16.8153 14.1168 16.0127 14.4822 15.1815H14.5736C14.7563 16.414 16.401 16.8439 17.467 16.8439C20.6954 16.8439 21 13.5764 21 10.7962C21 6.86943 18.0761 3 12.3807 3C6.50254 3 3 6.3535 3 11.9427C3 17.7325 6.38071 21 12.5939 21ZM11.7107 15.2962C9.73096 15.2962 9.03046 13.6051 9.03046 11.7707C9.03046 10.1083 10.0355 8.67516 11.7716 8.67516C13.599 8.67516 14.5736 9.36306 14.5736 11.7707C14.5736 14.1497 13.7513 15.2962 11.7107 15.2962Z" }) });
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-input.js
const { ValidatedInputControl: validated_input_ValidatedInputControl } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
function ValidatedText({
data,
field,
onChange,
hideLabelFromVision,
type,
prefix,
suffix,
validity
}) {
const { label, placeholder, description, getValue, setValue, isValid } = field;
const value = getValue({ item: data });
const onChangeControl = (0,external_wp_element_.useCallback)(
(newValue) => onChange(
setValue({
item: data,
value: newValue
})
),
[data, setValue, onChange]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
validated_input_ValidatedInputControl,
{
required: !!isValid?.required,
customValidity: getCustomValidity(isValid, validity),
label,
placeholder,
value: value ?? "",
help: description,
onChange: onChangeControl,
hideLabelFromVision,
type,
prefix,
suffix,
__next40pxDefaultSize: true
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/email.js
function Email({
data,
field,
onChange,
hideLabelFromVision,
validity
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ValidatedText,
{
...{
data,
field,
onChange,
hideLabelFromVision,
validity,
type: "email",
prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: at_symbol_default }) })
}
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/mobile.js
var mobile_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z" }) });
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/telephone.js
function Telephone({
data,
field,
onChange,
hideLabelFromVision,
validity
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ValidatedText,
{
...{
data,
field,
onChange,
hideLabelFromVision,
validity,
type: "tel",
prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: mobile_default }) })
}
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/link.js
var link_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) });
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/url.js
function Url({
data,
field,
onChange,
hideLabelFromVision,
validity
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ValidatedText,
{
...{
data,
field,
onChange,
hideLabelFromVision,
validity,
type: "url",
prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: link_default }) })
}
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-number.js
const { ValidatedNumberControl } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
function toNumberOrEmpty(value) {
if (value === "" || value === void 0) {
return "";
}
const number = Number(value);
return Number.isFinite(number) ? number : "";
}
function BetweenControls({
value,
onChange,
hideLabelFromVision,
step
}) {
const [min = "", max = ""] = value;
const onChangeMin = (0,external_wp_element_.useCallback)(
(newValue) => onChange([toNumberOrEmpty(newValue), max]),
[onChange, max]
);
const onChangeMax = (0,external_wp_element_.useCallback)(
(newValue) => onChange([min, toNumberOrEmpty(newValue)]),
[onChange, min]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.BaseControl,
{
__nextHasNoMarginBottom: true,
help: (0,external_wp_i18n_namespaceObject.__)("The max. value must be greater than the min. value."),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { direction: "row", gap: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalNumberControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Min."),
value: min,
max: max ? Number(max) - step : void 0,
onChange: onChangeMin,
__next40pxDefaultSize: true,
hideLabelFromVision,
step
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalNumberControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Max."),
value: max,
min: min ? Number(min) + step : void 0,
onChange: onChangeMax,
__next40pxDefaultSize: true,
hideLabelFromVision,
step
}
)
] })
}
);
}
function ValidatedNumber({
data,
field,
onChange,
hideLabelFromVision,
operator,
decimals,
validity
}) {
const step = Math.pow(10, Math.abs(decimals) * -1);
const { label, description, getValue, setValue, isValid } = field;
const value = getValue({ item: data }) ?? "";
const onChangeControl = (0,external_wp_element_.useCallback)(
(newValue) => {
onChange(
setValue({
item: data,
// Do not convert an empty string or undefined to a number,
// otherwise there's a mismatch between the UI control (empty)
// and the data relied by onChange (0).
value: ["", void 0].includes(newValue) ? void 0 : Number(newValue)
})
);
},
[data, onChange, setValue]
);
const onChangeBetweenControls = (0,external_wp_element_.useCallback)(
(newValue) => {
onChange(
setValue({
item: data,
value: newValue
})
);
},
[data, onChange, setValue]
);
if (operator === OPERATOR_BETWEEN) {
let valueBetween = ["", ""];
if (Array.isArray(value) && value.length === 2 && value.every(
(element) => typeof element === "number" || element === ""
)) {
valueBetween = value;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BetweenControls,
{
value: valueBetween,
onChange: onChangeBetweenControls,
hideLabelFromVision,
step
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ValidatedNumberControl,
{
required: !!isValid?.required,
customValidity: getCustomValidity(isValid, validity),
label,
help: description,
value,
onChange: onChangeControl,
__next40pxDefaultSize: true,
hideLabelFromVision,
step
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/integer.js
function integer_Number(props) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ValidatedNumber, { ...props, decimals: 0 });
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/number.js
function number_Number(props) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ValidatedNumber, { ...props, decimals: 2 });
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/radio.js
const { ValidatedRadioControl } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
function Radio({
data,
field,
onChange,
hideLabelFromVision,
validity
}) {
const { label, description, getValue, setValue, isValid } = field;
const { elements, isLoading } = useElements({
elements: field.elements,
getElements: field.getElements
});
const value = getValue({ item: data });
const onChangeControl = (0,external_wp_element_.useCallback)(
(newValue) => onChange(setValue({ item: data, value: newValue })),
[data, onChange, setValue]
);
if (isLoading) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ValidatedRadioControl,
{
required: !!field.isValid?.required,
customValidity: getCustomValidity(isValid, validity),
label,
help: description,
onChange: onChangeControl,
options: elements,
selected: value,
hideLabelFromVision
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/select.js
const { ValidatedSelectControl } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
function Select({
data,
field,
onChange,
hideLabelFromVision,
validity
}) {
const { type, label, description, getValue, setValue, isValid } = field;
const isMultiple = type === "array";
const value = getValue({ item: data }) ?? (isMultiple ? [] : "");
const onChangeControl = (0,external_wp_element_.useCallback)(
(newValue) => onChange(setValue({ item: data, value: newValue })),
[data, onChange, setValue]
);
const { elements, isLoading } = useElements({
elements: field.elements,
getElements: field.getElements
});
if (isLoading) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ValidatedSelectControl,
{
required: !!field.isValid?.required,
customValidity: getCustomValidity(isValid, validity),
label,
value,
help: description,
options: elements,
onChange: onChangeControl,
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
hideLabelFromVision,
multiple: isMultiple
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/text.js
function Text({
data,
field,
onChange,
hideLabelFromVision,
config,
validity
}) {
const { prefix, suffix } = config || {};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ValidatedText,
{
...{
data,
field,
onChange,
hideLabelFromVision,
validity,
prefix: prefix ? (0,external_wp_element_.createElement)(prefix) : void 0,
suffix: suffix ? (0,external_wp_element_.createElement)(suffix) : void 0
}
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/toggle.js
const { ValidatedToggleControl } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
function Toggle({
field,
onChange,
data,
hideLabelFromVision,
validity
}) {
const { label, description, getValue, setValue, isValid } = field;
const onChangeControl = (0,external_wp_element_.useCallback)(() => {
onChange(
setValue({ item: data, value: !getValue({ item: data }) })
);
}, [onChange, setValue, data, getValue]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ValidatedToggleControl,
{
required: !!isValid.required,
customValidity: getCustomValidity(isValid, validity),
hidden: hideLabelFromVision,
__nextHasNoMarginBottom: true,
label,
help: description,
checked: getValue({ item: data }),
onChange: onChangeControl
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/textarea.js
const { ValidatedTextareaControl } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
function Textarea({
data,
field,
onChange,
hideLabelFromVision,
config,
validity
}) {
const { rows = 4 } = config || {};
const { label, placeholder, description, setValue, isValid } = field;
const value = field.getValue({ item: data });
const onChangeControl = (0,external_wp_element_.useCallback)(
(newValue) => onChange(setValue({ item: data, value: newValue })),
[data, onChange, setValue]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ValidatedTextareaControl,
{
required: !!isValid?.required,
customValidity: getCustomValidity(isValid, validity),
label,
placeholder,
value: value ?? "",
help: description,
onChange: onChangeControl,
rows,
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
hideLabelFromVision
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/toggle-group.js
const { ValidatedToggleGroupControl } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
function ToggleGroup({
data,
field,
onChange,
hideLabelFromVision,
validity
}) {
const { getValue, setValue, isValid } = field;
const value = getValue({ item: data });
const onChangeControl = (0,external_wp_element_.useCallback)(
(newValue) => onChange(setValue({ item: data, value: newValue })),
[data, onChange, setValue]
);
const { elements, isLoading } = useElements({
elements: field.elements,
getElements: field.getElements
});
if (isLoading) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {});
}
if (elements.length === 0) {
return null;
}
const selectedOption = elements.find((el) => el.value === value);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ValidatedToggleGroupControl,
{
required: !!field.isValid?.required,
customValidity: getCustomValidity(isValid, validity),
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
isBlock: true,
label: field.label,
help: selectedOption?.description || field.description,
onChange: onChangeControl,
value,
hideLabelFromVision,
children: elements.map((el) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
label: el.label,
value: el.value
},
el.value
))
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/array.js
const { ValidatedFormTokenField } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
function ArrayControl({
data,
field,
onChange,
hideLabelFromVision,
validity
}) {
const { label, placeholder, getValue, setValue, isValid } = field;
const value = getValue({ item: data });
const { elements, isLoading } = useElements({
elements: field.elements,
getElements: field.getElements
});
const arrayValueAsElements = (0,external_wp_element_.useMemo)(
() => Array.isArray(value) ? value.map((token) => {
const element = elements?.find(
(suggestion) => suggestion.value === token
);
return element || { value: token, label: token };
}) : [],
[value, elements]
);
const onChangeControl = (0,external_wp_element_.useCallback)(
(tokens) => {
const valueTokens = tokens.map((token) => {
if (typeof token === "object" && "value" in token) {
return token.value;
}
return token;
});
onChange(setValue({ item: data, value: valueTokens }));
},
[onChange, setValue, data]
);
if (isLoading) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ValidatedFormTokenField,
{
required: !!isValid?.required,
customValidity: getCustomValidity(isValid, validity),
label: hideLabelFromVision ? void 0 : label,
value: arrayValueAsElements,
onChange: onChangeControl,
placeholder,
suggestions: elements?.map((element) => element.value),
__experimentalValidateInput: (token) => {
if (field.isValid?.elements && elements) {
return elements.some(
(element) => element.value === token || element.label === token
);
}
return true;
},
__experimentalExpandOnFocus: elements && elements.length > 0,
__experimentalShowHowTo: !field.isValid?.elements,
displayTransform: (token) => {
if (typeof token === "object" && "label" in token) {
return token.label;
}
if (typeof token === "string" && elements) {
const element = elements.find(
(el) => el.value === token
);
return element?.label || token;
}
return token;
},
__experimentalRenderItem: ({ item }) => {
if (typeof item === "string" && elements) {
const element = elements.find(
(el) => el.value === item
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: element?.label || item });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: item });
}
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/color.js
const { ValidatedInputControl: color_ValidatedInputControl, Picker } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
const ColorPicker = ({
color,
onColorChange
}) => {
const validColor = color && w(color).isValid() ? color : "#ffffff";
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
renderToggle: ({ onToggle, isOpen }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"button",
{
type: "button",
onClick: onToggle,
style: {
width: "24px",
height: "24px",
borderRadius: "50%",
backgroundColor: validColor,
border: "1px solid #ddd",
cursor: "pointer",
outline: isOpen ? "2px solid #007cba" : "none",
outlineOffset: "2px",
display: "flex",
alignItems: "center",
justifyContent: "center",
padding: 0,
margin: 0
},
"aria-label": "Open color picker"
}
) }),
renderContent: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { style: { padding: "16px" }, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Picker,
{
color: w(validColor),
onChange: onColorChange,
enableAlpha: true
}
) })
}
);
};
function Color({
data,
field,
onChange,
hideLabelFromVision,
validity
}) {
const { label, placeholder, description, setValue, isValid } = field;
const value = field.getValue({ item: data }) || "";
const handleColorChange = (0,external_wp_element_.useCallback)(
(colorObject) => {
onChange(setValue({ item: data, value: colorObject.toHex() }));
},
[data, onChange, setValue]
);
const handleInputChange = (0,external_wp_element_.useCallback)(
(newValue) => {
onChange(setValue({ item: data, value: newValue || "" }));
},
[data, onChange, setValue]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
color_ValidatedInputControl,
{
required: !!field.isValid?.required,
customValidity: getCustomValidity(isValid, validity),
label,
placeholder,
value,
help: description,
onChange: handleInputChange,
hideLabelFromVision,
type: "text",
prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ColorPicker,
{
color: value,
onColorChange: handleColorChange
}
)
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/unseen.js
var unseen_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z" }) });
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/password.js
function Password({
data,
field,
onChange,
hideLabelFromVision,
validity
}) {
const [isVisible, setIsVisible] = (0,external_wp_element_.useState)(false);
const toggleVisibility = (0,external_wp_element_.useCallback)(() => {
setIsVisible((prev) => !prev);
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ValidatedText,
{
...{
data,
field,
onChange,
hideLabelFromVision,
validity,
type: isVisible ? "text" : "password",
suffix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
icon: isVisible ? unseen_default : seen_default,
onClick: toggleVisibility,
size: "small",
variant: "tertiary",
"aria-label": isVisible ? (0,external_wp_i18n_namespaceObject.__)("Hide password") : (0,external_wp_i18n_namespaceObject.__)("Show password")
}
)
}
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/utils/has-elements.js
function hasElements(field) {
return Array.isArray(field.elements) && field.elements.length > 0 || typeof field.getElements === "function";
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/index.js
const FORM_CONTROLS = {
array: ArrayControl,
checkbox: Checkbox,
color: Color,
datetime: DateTime,
date: DateControl,
email: Email,
telephone: Telephone,
url: Url,
integer: integer_Number,
number: number_Number,
password: Password,
radio: Radio,
select: Select,
text: Text,
toggle: Toggle,
textarea: Textarea,
toggleGroup: ToggleGroup
};
function isEditConfig(value) {
return value && typeof value === "object" && typeof value.control === "string";
}
function createConfiguredControl(config) {
const { control, ...controlConfig } = config;
const BaseControlType = getControlByType(control);
return function ConfiguredControl(props) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BaseControlType, { ...props, config: controlConfig });
};
}
function getControl(field, fieldTypeDefinition) {
if (typeof field.Edit === "function") {
return field.Edit;
}
if (typeof field.Edit === "string") {
return getControlByType(field.Edit);
}
if (isEditConfig(field.Edit)) {
return createConfiguredControl(field.Edit);
}
if (hasElements(field) && field.type !== "array") {
return getControlByType("select");
}
if (typeof fieldTypeDefinition.Edit === "string") {
return getControlByType(fieldTypeDefinition.Edit);
}
if (isEditConfig(fieldTypeDefinition.Edit)) {
return createConfiguredControl(fieldTypeDefinition.Edit);
}
return fieldTypeDefinition.Edit;
}
function getControlByType(type) {
if (Object.keys(FORM_CONTROLS).includes(type)) {
return FORM_CONTROLS[type];
}
throw "Control " + type + " not found";
}
;// ./node_modules/@wordpress/dataviews/build-module/utils/normalize-fields.js
const getValueFromId = (id) => ({ item }) => {
const path = id.split(".");
let value = item;
for (const segment of path) {
if (value.hasOwnProperty(segment)) {
value = value[segment];
} else {
value = void 0;
}
}
return value;
};
const setValueFromId = (id) => ({ value }) => {
const path = id.split(".");
const result = {};
let current = result;
for (const segment of path.slice(0, -1)) {
current[segment] = {};
current = current[segment];
}
current[path.at(-1)] = value;
return result;
};
function getFilterBy(field, fieldTypeDefinition) {
if (field.filterBy === false) {
return false;
}
if (typeof field.filterBy === "object") {
let operators = field.filterBy.operators;
if (!operators || !Array.isArray(operators)) {
operators = !!fieldTypeDefinition.filterBy ? fieldTypeDefinition.filterBy.defaultOperators : [];
}
let validOperators = ALL_OPERATORS;
if (typeof fieldTypeDefinition.filterBy === "object") {
validOperators = fieldTypeDefinition.filterBy.validOperators;
}
operators = operators.filter(
(operator) => validOperators.includes(operator)
);
if (hasElements(field) && operators.includes(OPERATOR_BETWEEN)) {
operators = operators.filter(
(operator) => operator !== OPERATOR_BETWEEN
);
}
const hasSingleSelectionOperator = operators.some(
(operator) => SINGLE_SELECTION_OPERATORS.includes(operator)
);
if (hasSingleSelectionOperator) {
operators = operators.filter(
(operator) => (
// The 'Between' operator is unique as it can be combined with single selection operators.
[...SINGLE_SELECTION_OPERATORS, OPERATOR_BETWEEN].includes(
operator
)
)
);
}
if (operators.length === 0) {
return false;
}
return {
isPrimary: !!field.filterBy.isPrimary,
operators
};
}
if (fieldTypeDefinition.filterBy === false) {
return false;
}
let defaultOperators = fieldTypeDefinition.filterBy.defaultOperators;
if (hasElements(field) && defaultOperators.includes(OPERATOR_BETWEEN)) {
defaultOperators = defaultOperators.filter(
(operator) => operator !== OPERATOR_BETWEEN
);
}
return {
operators: defaultOperators
};
}
function normalizeFields(fields) {
return fields.map((field) => {
const fieldTypeDefinition = getFieldTypeDefinition(
field.type
);
const getValue = field.getValue || getValueFromId(field.id);
const setValue = field.setValue || setValueFromId(field.id);
const sort = field.sort ?? function sort2(a, b, direction) {
return fieldTypeDefinition.sort(
getValue({ item: a }),
getValue({ item: b }),
direction
);
};
const isValid = {
...fieldTypeDefinition.isValid,
...field.isValid
};
const Edit = getControl(field, fieldTypeDefinition);
const render = field.render ?? function render2({
item,
field: renderedField
}) {
return fieldTypeDefinition.render({ item, field: renderedField });
};
const filterBy = getFilterBy(field, fieldTypeDefinition);
return {
...field,
label: field.label || field.id,
header: field.header || field.label || field.id,
getValue,
setValue,
render,
sort,
isValid,
Edit,
hasElements: hasElements(field),
enableHiding: field.enableHiding ?? true,
enableSorting: field.enableSorting ?? fieldTypeDefinition.enableSorting ?? true,
filterBy,
readOnly: field.readOnly ?? fieldTypeDefinition.readOnly ?? false
};
});
}
;// ./node_modules/@wordpress/dataviews/build-module/utils/filter-sort-and-paginate.js
function normalizeSearchInput(input = "") {
return remove_accents_default()(input.trim().toLowerCase());
}
const filter_sort_and_paginate_EMPTY_ARRAY = [];
function getRelativeDate(value, unit) {
switch (unit) {
case "days":
return subDays(/* @__PURE__ */ new Date(), value);
case "weeks":
return subWeeks(/* @__PURE__ */ new Date(), value);
case "months":
return subMonths(/* @__PURE__ */ new Date(), value);
case "years":
return subYears(/* @__PURE__ */ new Date(), value);
default:
return /* @__PURE__ */ new Date();
}
}
function filterSortAndPaginate(data, view, fields) {
if (!data) {
return {
data: filter_sort_and_paginate_EMPTY_ARRAY,
paginationInfo: { totalItems: 0, totalPages: 0 }
};
}
const _fields = normalizeFields(fields);
let filteredData = [...data];
if (view.search) {
const normalizedSearch = normalizeSearchInput(view.search);
filteredData = filteredData.filter((item) => {
return _fields.filter((field) => field.enableGlobalSearch).some((field) => {
const fieldValue = field.getValue({ item });
const values = Array.isArray(fieldValue) ? fieldValue : [fieldValue];
return values.some(
(value) => normalizeSearchInput(String(value)).includes(
normalizedSearch
)
);
});
});
}
if (view.filters && view.filters?.length > 0) {
view.filters.forEach((filter) => {
const field = _fields.find(
(_field) => _field.id === filter.field
);
if (field) {
if (filter.operator === constants_OPERATOR_IS_ANY && filter?.value?.length > 0) {
filteredData = filteredData.filter((item) => {
const fieldValue = field.getValue({ item });
if (Array.isArray(fieldValue)) {
return filter.value.some(
(filterValue) => fieldValue.includes(filterValue)
);
} else if (typeof fieldValue === "string") {
return filter.value.includes(fieldValue);
}
return false;
});
} else if (filter.operator === constants_OPERATOR_IS_NONE && filter?.value?.length > 0) {
filteredData = filteredData.filter((item) => {
const fieldValue = field.getValue({ item });
if (Array.isArray(fieldValue)) {
return !filter.value.some(
(filterValue) => fieldValue.includes(filterValue)
);
} else if (typeof fieldValue === "string") {
return !filter.value.includes(fieldValue);
}
return false;
});
} else if (filter.operator === OPERATOR_IS_ALL && filter?.value?.length > 0) {
filteredData = filteredData.filter((item) => {
return filter.value.every((value) => {
return field.getValue({ item })?.includes(value);
});
});
} else if (filter.operator === OPERATOR_IS_NOT_ALL && filter?.value?.length > 0) {
filteredData = filteredData.filter((item) => {
return filter.value.every((value) => {
return !field.getValue({ item })?.includes(value);
});
});
} else if (filter.operator === constants_OPERATOR_IS) {
filteredData = filteredData.filter((item) => {
return filter.value === field.getValue({ item }) || filter.value === void 0;
});
} else if (filter.operator === constants_OPERATOR_IS_NOT) {
filteredData = filteredData.filter((item) => {
return filter.value !== field.getValue({ item });
});
} else if (filter.operator === OPERATOR_ON && filter.value !== void 0) {
const filterDate = (0,external_wp_date_namespaceObject.getDate)(filter.value);
filteredData = filteredData.filter((item) => {
const fieldDate = (0,external_wp_date_namespaceObject.getDate)(field.getValue({ item }));
return filterDate.getTime() === fieldDate.getTime();
});
} else if (filter.operator === OPERATOR_NOT_ON && filter.value !== void 0) {
const filterDate = (0,external_wp_date_namespaceObject.getDate)(filter.value);
filteredData = filteredData.filter((item) => {
const fieldDate = (0,external_wp_date_namespaceObject.getDate)(field.getValue({ item }));
return filterDate.getTime() !== fieldDate.getTime();
});
} else if (filter.operator === OPERATOR_LESS_THAN && filter.value !== void 0) {
filteredData = filteredData.filter((item) => {
const fieldValue = field.getValue({ item });
return fieldValue < filter.value;
});
} else if (filter.operator === OPERATOR_GREATER_THAN && filter.value !== void 0) {
filteredData = filteredData.filter((item) => {
const fieldValue = field.getValue({ item });
return fieldValue > filter.value;
});
} else if (filter.operator === OPERATOR_LESS_THAN_OR_EQUAL && filter.value !== void 0) {
filteredData = filteredData.filter((item) => {
const fieldValue = field.getValue({ item });
return fieldValue <= filter.value;
});
} else if (filter.operator === OPERATOR_GREATER_THAN_OR_EQUAL && filter.value !== void 0) {
filteredData = filteredData.filter((item) => {
const fieldValue = field.getValue({ item });
return fieldValue >= filter.value;
});
} else if (filter.operator === OPERATOR_CONTAINS && filter?.value !== void 0) {
filteredData = filteredData.filter((item) => {
const fieldValue = field.getValue({ item });
return typeof fieldValue === "string" && filter.value && fieldValue.toLowerCase().includes(
String(filter.value).toLowerCase()
);
});
} else if (filter.operator === OPERATOR_NOT_CONTAINS && filter?.value !== void 0) {
filteredData = filteredData.filter((item) => {
const fieldValue = field.getValue({ item });
return typeof fieldValue === "string" && filter.value && !fieldValue.toLowerCase().includes(
String(filter.value).toLowerCase()
);
});
} else if (filter.operator === OPERATOR_STARTS_WITH && filter?.value !== void 0) {
filteredData = filteredData.filter((item) => {
const fieldValue = field.getValue({ item });
return typeof fieldValue === "string" && filter.value && fieldValue.toLowerCase().startsWith(
String(filter.value).toLowerCase()
);
});
} else if (filter.operator === OPERATOR_BEFORE && filter.value !== void 0) {
const filterValue = (0,external_wp_date_namespaceObject.getDate)(filter.value);
filteredData = filteredData.filter((item) => {
const fieldValue = (0,external_wp_date_namespaceObject.getDate)(
field.getValue({ item })
);
return fieldValue < filterValue;
});
} else if (filter.operator === OPERATOR_AFTER && filter.value !== void 0) {
const filterValue = (0,external_wp_date_namespaceObject.getDate)(filter.value);
filteredData = filteredData.filter((item) => {
const fieldValue = (0,external_wp_date_namespaceObject.getDate)(
field.getValue({ item })
);
return fieldValue > filterValue;
});
} else if (filter.operator === OPERATOR_BEFORE_INC && filter.value !== void 0) {
const filterValue = (0,external_wp_date_namespaceObject.getDate)(filter.value);
filteredData = filteredData.filter((item) => {
const fieldValue = (0,external_wp_date_namespaceObject.getDate)(
field.getValue({ item })
);
return fieldValue <= filterValue;
});
} else if (filter.operator === OPERATOR_AFTER_INC && filter.value !== void 0) {
const filterValue = (0,external_wp_date_namespaceObject.getDate)(filter.value);
filteredData = filteredData.filter((item) => {
const fieldValue = (0,external_wp_date_namespaceObject.getDate)(
field.getValue({ item })
);
return fieldValue >= filterValue;
});
} else if (filter.operator === OPERATOR_BETWEEN && Array.isArray(filter.value) && filter.value.length === 2 && filter.value[0] !== void 0 && filter.value[1] !== void 0) {
filteredData = filteredData.filter((item) => {
const fieldValue = field.getValue({ item });
if (typeof fieldValue === "number" || fieldValue instanceof Date || typeof fieldValue === "string") {
return fieldValue >= filter.value[0] && fieldValue <= filter.value[1];
}
return false;
});
} else if (filter.operator === OPERATOR_IN_THE_PAST && filter.value?.value !== void 0 && filter.value?.unit !== void 0) {
const targetDate = getRelativeDate(
filter.value.value,
filter.value.unit
);
filteredData = filteredData.filter((item) => {
const fieldValue = (0,external_wp_date_namespaceObject.getDate)(
field.getValue({ item })
);
return fieldValue >= targetDate && fieldValue <= /* @__PURE__ */ new Date();
});
} else if (filter.operator === OPERATOR_OVER && filter.value?.value !== void 0 && filter.value?.unit !== void 0) {
const targetDate = getRelativeDate(
filter.value.value,
filter.value.unit
);
filteredData = filteredData.filter((item) => {
const fieldValue = (0,external_wp_date_namespaceObject.getDate)(
field.getValue({ item })
);
return fieldValue < targetDate;
});
}
}
});
}
const sortByField = view.sort?.field ? _fields.find((field) => {
return field.id === view.sort?.field;
}) : null;
const groupByField = view.groupByField ? _fields.find((field) => {
return field.id === view.groupByField;
}) : null;
if (sortByField || groupByField) {
filteredData.sort((a, b) => {
if (groupByField) {
const groupCompare = groupByField.sort(a, b, "asc");
if (groupCompare !== 0) {
return groupCompare;
}
}
if (sortByField) {
return sortByField.sort(a, b, view.sort?.direction ?? "desc");
}
return 0;
});
}
let totalItems = filteredData.length;
let totalPages = 1;
if (view.page !== void 0 && view.perPage !== void 0) {
const start = (view.page - 1) * view.perPage;
totalItems = filteredData?.length || 0;
totalPages = Math.ceil(totalItems / view.perPage);
filteredData = filteredData?.slice(start, start + view.perPage);
}
return {
data: filteredData,
paginationInfo: {
totalItems,
totalPages
}
};
}
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js
const dataviews_context_DataViewsContext = (0,external_wp_element_.createContext)({
view: { type: constants_LAYOUT_TABLE },
onChangeView: () => {
},
fields: [],
data: [],
paginationInfo: {
totalItems: 0,
totalPages: 0
},
selection: [],
onChangeSelection: () => {
},
setOpenedFilter: () => {
},
openedFilter: null,
getItemId: (item) => item.id,
isItemClickable: () => true,
renderItemLink: void 0,
containerWidth: 0,
containerRef: (0,external_wp_element_.createRef)(),
resizeObserverRef: () => {
},
defaultLayouts: { list: {}, grid: {}, table: {} },
filters: [],
isShowingFilter: false,
setIsShowingFilter: () => {
},
hasInfiniteScrollHandler: false,
config: {
perPageSizes: []
}
});
dataviews_context_DataViewsContext.displayName = "DataViewsContext";
var dataviews_context_default = dataviews_context_DataViewsContext;
;// ./node_modules/@wordpress/icons/build-module/library/block-table.js
var block_table_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/category.js
var category_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",
fillRule: "evenodd",
clipRule: "evenodd"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js
var format_list_bullets_rtl_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js
var format_list_bullets_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }) });
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-selection-checkbox/index.js
function DataViewsSelectionCheckbox({
selection,
onChangeSelection,
item,
getItemId,
titleField,
disabled,
...extraProps
}) {
const id = getItemId(item);
const checked = !disabled && selection.includes(id);
const selectionLabel = titleField?.getValue?.({ item }) || (0,external_wp_i18n_namespaceObject.__)("(no title)");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CheckboxControl,
{
className: "dataviews-selection-checkbox",
__nextHasNoMarginBottom: true,
"aria-label": selectionLabel,
"aria-disabled": disabled,
checked,
onChange: () => {
if (disabled) {
return;
}
onChangeSelection(
selection.includes(id) ? selection.filter((itemId) => id !== itemId) : [...selection, id]
);
},
...extraProps
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.js
const { Menu: dataviews_item_actions_Menu, kebabCase: dataviews_item_actions_kebabCase } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
function ButtonTrigger({
action,
onClick,
items
}) {
const label = typeof action.label === "string" ? action.label : action.label(items);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
disabled: !!action.disabled,
accessibleWhenDisabled: true,
size: "compact",
onClick,
children: label
}
);
}
function MenuItemTrigger({
action,
onClick,
items
}) {
const label = typeof action.label === "string" ? action.label : action.label(items);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_Menu.Item, { disabled: action.disabled, onClick, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_Menu.ItemLabel, { children: label }) });
}
function ActionModal({
action,
items,
closeModal
}) {
const label = typeof action.label === "string" ? action.label : action.label(items);
const modalHeader = typeof action.modalHeader === "function" ? action.modalHeader(items) : action.modalHeader;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
title: modalHeader || label,
__experimentalHideHeader: !!action.hideModalHeader,
onRequestClose: closeModal,
focusOnMount: action.modalFocusOnMount ?? true,
size: action.modalSize || "medium",
overlayClassName: `dataviews-action-modal dataviews-action-modal__${dataviews_item_actions_kebabCase(
action.id
)}`,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(action.RenderModal, { items, closeModal })
}
);
}
function ActionsMenuGroup({
actions,
item,
registry,
setActiveModalAction
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_Menu.Group, { children: actions.map((action) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
MenuItemTrigger,
{
action,
onClick: () => {
if ("RenderModal" in action) {
setActiveModalAction(action);
return;
}
action.callback([item], { registry });
},
items: [item]
},
action.id
)) });
}
function ItemActions({
item,
actions,
isCompact
}) {
const registry = (0,external_wp_data_.useRegistry)();
const { primaryActions, eligibleActions } = (0,external_wp_element_.useMemo)(() => {
const _eligibleActions = actions.filter(
(action) => !action.isEligible || action.isEligible(item)
);
const _primaryActions = _eligibleActions.filter(
(action) => action.isPrimary
);
return {
primaryActions: _primaryActions,
eligibleActions: _eligibleActions
};
}, [actions, item]);
if (isCompact) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CompactItemActions,
{
item,
actions: eligibleActions,
isSmall: true,
registry
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
spacing: 0,
justify: "flex-end",
className: "dataviews-item-actions",
style: {
flexShrink: 0,
width: "auto"
},
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PrimaryActions,
{
item,
actions: primaryActions,
registry
}
),
primaryActions.length < eligibleActions.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CompactItemActions,
{
item,
actions: eligibleActions,
registry
}
)
]
}
);
}
function CompactItemActions({
item,
actions,
isSmall,
registry
}) {
const [activeModalAction, setActiveModalAction] = (0,external_wp_element_.useState)(
null
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(dataviews_item_actions_Menu, { placement: "bottom-end", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
dataviews_item_actions_Menu.TriggerButton,
{
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: isSmall ? "small" : "compact",
icon: more_vertical_default,
label: (0,external_wp_i18n_namespaceObject.__)("Actions"),
accessibleWhenDisabled: true,
disabled: !actions.length,
className: "dataviews-all-actions-button"
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_Menu.Popover, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ActionsMenuGroup,
{
actions,
item,
registry,
setActiveModalAction
}
) })
] }),
!!activeModalAction && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ActionModal,
{
action: activeModalAction,
items: [item],
closeModal: () => setActiveModalAction(null)
}
)
] });
}
function PrimaryActions({
item,
actions,
registry
}) {
const [activeModalAction, setActiveModalAction] = (0,external_wp_element_.useState)(null);
const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
if (isMobileViewport) {
return null;
}
if (!Array.isArray(actions) || actions.length === 0) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
actions.map((action) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ButtonTrigger,
{
action,
onClick: () => {
if ("RenderModal" in action) {
setActiveModalAction(action);
return;
}
action.callback([item], { registry });
},
items: [item]
},
action.id
)),
!!activeModalAction && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ActionModal,
{
action: activeModalAction,
items: [item],
closeModal: () => setActiveModalAction(null)
}
)
] });
}
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.js
function ActionWithModal({
action,
items,
ActionTriggerComponent
}) {
const [isModalOpen, setIsModalOpen] = (0,external_wp_element_.useState)(false);
const actionTriggerProps = {
action,
onClick: () => {
setIsModalOpen(true);
},
items
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionTriggerComponent, { ...actionTriggerProps }),
isModalOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ActionModal,
{
action,
items,
closeModal: () => setIsModalOpen(false)
}
)
] });
}
function useHasAPossibleBulkAction(actions, item) {
return (0,external_wp_element_.useMemo)(() => {
return actions.some((action) => {
return action.supportsBulk && (!action.isEligible || action.isEligible(item));
});
}, [actions, item]);
}
function useSomeItemHasAPossibleBulkAction(actions, data) {
return (0,external_wp_element_.useMemo)(() => {
return data.some((item) => {
return actions.some((action) => {
return action.supportsBulk && (!action.isEligible || action.isEligible(item));
});
});
}, [actions, data]);
}
function BulkSelectionCheckbox({
selection,
onChangeSelection,
data,
actions,
getItemId
}) {
const selectableItems = (0,external_wp_element_.useMemo)(() => {
return data.filter((item) => {
return actions.some(
(action) => action.supportsBulk && (!action.isEligible || action.isEligible(item))
);
});
}, [data, actions]);
const selectedItems = data.filter(
(item) => selection.includes(getItemId(item)) && selectableItems.includes(item)
);
const areAllSelected = selectedItems.length === selectableItems.length;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.CheckboxControl,
{
className: "dataviews-view-table-selection-checkbox",
__nextHasNoMarginBottom: true,
checked: areAllSelected,
indeterminate: !areAllSelected && !!selectedItems.length,
onChange: () => {
if (areAllSelected) {
onChangeSelection([]);
} else {
onChangeSelection(
selectableItems.map((item) => getItemId(item))
);
}
},
"aria-label": areAllSelected ? (0,external_wp_i18n_namespaceObject.__)("Deselect all") : (0,external_wp_i18n_namespaceObject.__)("Select all")
}
);
}
function ActionTrigger({
action,
onClick,
isBusy,
items
}) {
const label = typeof action.label === "string" ? action.label : action.label(items);
const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
if (isMobile) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
disabled: isBusy,
accessibleWhenDisabled: true,
label,
icon: action.icon,
size: "compact",
onClick,
isBusy
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
disabled: isBusy,
accessibleWhenDisabled: true,
size: "compact",
onClick,
isBusy,
children: label
}
);
}
const dataviews_bulk_actions_EMPTY_ARRAY = [];
function ActionButton({
action,
selectedItems,
actionInProgress,
setActionInProgress
}) {
const registry = (0,external_wp_data_.useRegistry)();
const selectedEligibleItems = (0,external_wp_element_.useMemo)(() => {
return selectedItems.filter((item) => {
return !action.isEligible || action.isEligible(item);
});
}, [action, selectedItems]);
if ("RenderModal" in action) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ActionWithModal,
{
action,
items: selectedEligibleItems,
ActionTriggerComponent: ActionTrigger
},
action.id
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ActionTrigger,
{
action,
onClick: async () => {
setActionInProgress(action.id);
await action.callback(selectedItems, {
registry
});
setActionInProgress(null);
},
items: selectedEligibleItems,
isBusy: actionInProgress === action.id
},
action.id
);
}
function renderFooterContent(data, actions, getItemId, selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onChangeSelection) {
const message = selectedItems.length > 0 ? (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: number of items. */
(0,external_wp_i18n_namespaceObject._n)(
"%d Item selected",
"%d Items selected",
selectedItems.length
),
selectedItems.length
) : (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: number of items. */
(0,external_wp_i18n_namespaceObject._n)("%d Item", "%d Items", data.length),
data.length
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
expanded: false,
className: "dataviews-bulk-actions-footer__container",
spacing: 3,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BulkSelectionCheckbox,
{
selection,
onChangeSelection,
data,
actions,
getItemId
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "dataviews-bulk-actions-footer__item-count", children: message }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
className: "dataviews-bulk-actions-footer__action-buttons",
expanded: false,
spacing: 1,
children: [
actionsToShow.map((action) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ActionButton,
{
action,
selectedItems,
actionInProgress,
setActionInProgress
},
action.id
);
}),
selectedItems.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
icon: close_small_default,
showTooltip: true,
tooltipPosition: "top",
size: "compact",
label: (0,external_wp_i18n_namespaceObject.__)("Cancel"),
disabled: !!actionInProgress,
accessibleWhenDisabled: false,
onClick: () => {
onChangeSelection(dataviews_bulk_actions_EMPTY_ARRAY);
}
}
)
]
}
)
]
}
);
}
function FooterContent({
selection,
actions,
onChangeSelection,
data,
getItemId
}) {
const [actionInProgress, setActionInProgress] = (0,external_wp_element_.useState)(
null
);
const footerContentRef = (0,external_wp_element_.useRef)(null);
const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
const bulkActions = (0,external_wp_element_.useMemo)(
() => actions.filter((action) => action.supportsBulk),
[actions]
);
const selectableItems = (0,external_wp_element_.useMemo)(() => {
return data.filter((item) => {
return bulkActions.some(
(action) => !action.isEligible || action.isEligible(item)
);
});
}, [data, bulkActions]);
const selectedItems = (0,external_wp_element_.useMemo)(() => {
return data.filter(
(item) => selection.includes(getItemId(item)) && selectableItems.includes(item)
);
}, [selection, data, getItemId, selectableItems]);
const actionsToShow = (0,external_wp_element_.useMemo)(
() => actions.filter((action) => {
return action.supportsBulk && (!isMobile || action.icon) && selectedItems.some(
(item) => !action.isEligible || action.isEligible(item)
);
}),
[actions, selectedItems, isMobile]
);
if (!actionInProgress) {
if (footerContentRef.current) {
footerContentRef.current = null;
}
return renderFooterContent(
data,
actions,
getItemId,
selection,
actionsToShow,
selectedItems,
actionInProgress,
setActionInProgress,
onChangeSelection
);
} else if (!footerContentRef.current) {
footerContentRef.current = renderFooterContent(
data,
actions,
getItemId,
selection,
actionsToShow,
selectedItems,
actionInProgress,
setActionInProgress,
onChangeSelection
);
}
return footerContentRef.current;
}
function BulkActionsFooter() {
const {
data,
selection,
actions = dataviews_bulk_actions_EMPTY_ARRAY,
onChangeSelection,
getItemId
} = (0,external_wp_element_.useContext)(dataviews_context_default);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FooterContent,
{
selection,
onChangeSelection,
data,
actions,
getItemId
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/funnel.js
var funnel_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/arrow-left.js
var arrow_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/arrow-right.js
var arrow_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" }) });
;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-header-menu.js
const { Menu: column_header_menu_Menu } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
function WithMenuSeparators({ children }) {
return external_wp_element_.Children.toArray(children).filter(Boolean).map((child, i) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_element_.Fragment, { children: [
i > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Separator, {}),
child
] }, i));
}
const _HeaderMenu = (0,external_wp_element_.forwardRef)(function HeaderMenu({
fieldId,
view,
fields,
onChangeView,
onHide,
setOpenedFilter,
canMove = true
}, ref) {
const visibleFieldIds = view.fields ?? [];
const index = visibleFieldIds?.indexOf(fieldId);
const isSorted = view.sort?.field === fieldId;
let isHidable = false;
let isSortable = false;
let canAddFilter = false;
let operators = [];
const field = fields.find((f) => f.id === fieldId);
if (!field) {
return null;
}
isHidable = field.enableHiding !== false;
isSortable = field.enableSorting !== false;
const header = field.header;
operators = !!field.filterBy && field.filterBy?.operators || [];
canAddFilter = !view.filters?.some((_filter) => fieldId === _filter.field) && !!(field.hasElements || field.Edit) && field.filterBy !== false && !field.filterBy?.isPrimary;
if (!isSortable && !canMove && !isHidable && !canAddFilter) {
return header;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(column_header_menu_Menu, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
column_header_menu_Menu.TriggerButton,
{
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "compact",
className: "dataviews-view-table-header-button",
ref,
variant: "tertiary"
}
),
children: [
header,
view.sort && isSorted && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", children: sortArrows[view.sort.direction] })
]
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Popover, { style: { minWidth: "240px" }, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(WithMenuSeparators, { children: [
isSortable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Group, { children: SORTING_DIRECTIONS.map(
(direction) => {
const isChecked = view.sort && isSorted && view.sort.direction === direction;
const value = `${fieldId}-${direction}`;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
column_header_menu_Menu.RadioItem,
{
name: "view-table-sorting",
value,
checked: isChecked,
onChange: () => {
onChangeView({
...view,
sort: {
field: fieldId,
direction
},
showLevels: false
});
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.ItemLabel, { children: sortLabels[direction] })
},
value
);
}
) }),
canAddFilter && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Group, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
column_header_menu_Menu.Item,
{
prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: funnel_default }),
onClick: () => {
setOpenedFilter(fieldId);
onChangeView({
...view,
page: 1,
filters: [
...view.filters || [],
{
field: fieldId,
value: void 0,
operator: operators[0]
}
]
});
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.ItemLabel, { children: (0,external_wp_i18n_namespaceObject.__)("Add filter") })
}
) }),
(canMove || isHidable) && field && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(column_header_menu_Menu.Group, { children: [
canMove && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
column_header_menu_Menu.Item,
{
prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: arrow_left_default }),
disabled: index < 1,
onClick: () => {
onChangeView({
...view,
fields: [
...visibleFieldIds.slice(
0,
index - 1
) ?? [],
fieldId,
visibleFieldIds[index - 1],
...visibleFieldIds.slice(
index + 1
)
]
});
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.ItemLabel, { children: (0,external_wp_i18n_namespaceObject.__)("Move left") })
}
),
canMove && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
column_header_menu_Menu.Item,
{
prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: arrow_right_default }),
disabled: index >= visibleFieldIds.length - 1,
onClick: () => {
onChangeView({
...view,
fields: [
...visibleFieldIds.slice(
0,
index
) ?? [],
visibleFieldIds[index + 1],
fieldId,
...visibleFieldIds.slice(
index + 2
)
]
});
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.ItemLabel, { children: (0,external_wp_i18n_namespaceObject.__)("Move right") })
}
),
isHidable && field && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
column_header_menu_Menu.Item,
{
prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: unseen_default }),
onClick: () => {
onHide(field);
onChangeView({
...view,
fields: visibleFieldIds.filter(
(id) => id !== fieldId
)
});
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.ItemLabel, { children: (0,external_wp_i18n_namespaceObject.__)("Hide column") })
}
)
] })
] }) })
] });
});
const ColumnHeaderMenu = _HeaderMenu;
var column_header_menu_default = ColumnHeaderMenu;
;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/item-click-wrapper.js
function getClickableItemProps({
item,
isItemClickable,
onClickItem,
className
}) {
if (!isItemClickable(item) || !onClickItem) {
return { className };
}
return {
className: className ? `${className} ${className}--clickable` : void 0,
role: "button",
tabIndex: 0,
onClick: (event) => {
event.stopPropagation();
onClickItem(item);
},
onKeyDown: (event) => {
if (event.key === "Enter" || event.key === "" || event.key === " ") {
event.stopPropagation();
onClickItem(item);
}
}
};
}
function ItemClickWrapper({
item,
isItemClickable,
onClickItem,
renderItemLink,
className,
children,
...extraProps
}) {
if (!isItemClickable(item)) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className, ...extraProps, children });
}
if (renderItemLink) {
const renderedElement = renderItemLink({
item,
className: `${className} ${className}--clickable`,
...extraProps,
children
});
return (0,external_wp_element_.cloneElement)(renderedElement, {
onClick: (event) => {
event.stopPropagation();
if (renderedElement.props.onClick) {
renderedElement.props.onClick(event);
}
},
onKeyDown: (event) => {
if (event.key === "Enter" || event.key === "" || event.key === " ") {
event.stopPropagation();
if (renderedElement.props.onKeyDown) {
renderedElement.props.onKeyDown(event);
}
}
}
});
}
const clickProps = getClickableItemProps({
item,
isItemClickable,
onClickItem,
className
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...clickProps, ...extraProps, children });
}
;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-primary.js
function ColumnPrimary({
item,
level,
titleField,
mediaField,
descriptionField,
onClickItem,
renderItemLink,
isItemClickable
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 3, justify: "flex-start", children: [
mediaField && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ItemClickWrapper,
{
item,
isItemClickable,
onClickItem,
renderItemLink,
className: "dataviews-view-table__cell-content-wrapper dataviews-column-primary__media",
"aria-label": titleField ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s is the item title.
(0,external_wp_i18n_namespaceObject.__)("Click item: %s"),
titleField.getValue?.({ item })
) : void 0,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
mediaField.render,
{
item,
field: mediaField,
config: { sizes: "32px" }
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
spacing: 0,
alignment: "flex-start",
className: "dataviews-view-table__primary-column-content",
children: [
titleField && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
ItemClickWrapper,
{
item,
isItemClickable,
onClickItem,
renderItemLink,
className: "dataviews-view-table__cell-content-wrapper dataviews-title-field",
children: [
level !== void 0 && level > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { className: "dataviews-view-table__level", children: [
"\u2014".repeat(level),
"\xA0"
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(titleField.render, { item, field: titleField })
]
}
),
descriptionField && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
descriptionField.render,
{
item,
field: descriptionField
}
)
]
}
)
] });
}
var column_primary_default = ColumnPrimary;
;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/use-is-horizontal-scroll-end.js
const isScrolledToEnd = (element) => {
if ((0,external_wp_i18n_namespaceObject.isRTL)()) {
const scrollLeft = Math.abs(element.scrollLeft);
return scrollLeft <= 1;
}
return element.scrollLeft + element.clientWidth >= element.scrollWidth - 1;
};
function useIsHorizontalScrollEnd({
scrollContainerRef,
enabled = false
}) {
const [isHorizontalScrollEnd, setIsHorizontalScrollEnd] = (0,external_wp_element_.useState)(false);
const handleIsHorizontalScrollEnd = (0,external_wp_compose_namespaceObject.useDebounce)(
(0,external_wp_element_.useCallback)(() => {
const scrollContainer = scrollContainerRef.current;
if (scrollContainer) {
setIsHorizontalScrollEnd(isScrolledToEnd(scrollContainer));
}
}, [scrollContainerRef, setIsHorizontalScrollEnd]),
200
);
(0,external_wp_element_.useEffect)(() => {
if (typeof window === "undefined" || !enabled || !scrollContainerRef.current) {
return () => {
};
}
handleIsHorizontalScrollEnd();
scrollContainerRef.current.addEventListener(
"scroll",
handleIsHorizontalScrollEnd
);
window.addEventListener("resize", handleIsHorizontalScrollEnd);
return () => {
scrollContainerRef.current?.removeEventListener(
"scroll",
handleIsHorizontalScrollEnd
);
window.removeEventListener("resize", handleIsHorizontalScrollEnd);
};
}, [scrollContainerRef, enabled]);
return isHorizontalScrollEnd;
}
;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/get-data-by-group.js
function getDataByGroup(data, groupByField) {
return data.reduce((groups, item) => {
const groupName = groupByField.getValue({ item });
if (!groups.has(groupName)) {
groups.set(groupName, []);
}
groups.get(groupName)?.push(item);
return groups;
}, /* @__PURE__ */ new Map());
}
;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/index.js
function TableColumnField({
item,
fields,
column,
align
}) {
const field = fields.find((f) => f.id === column);
if (!field) {
return null;
}
const className = dist_clsx("dataviews-view-table__cell-content-wrapper", {
"dataviews-view-table__cell-align-end": align === "end",
"dataviews-view-table__cell-align-center": align === "center"
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(field.render, { item, field }) });
}
function TableRow({
hasBulkActions,
item,
level,
actions,
fields,
id,
view,
titleField,
mediaField,
descriptionField,
selection,
getItemId,
isItemClickable,
onClickItem,
renderItemLink,
onChangeSelection,
isActionsColumnSticky,
posinset
}) {
const { paginationInfo } = (0,external_wp_element_.useContext)(dataviews_context_default);
const hasPossibleBulkAction = useHasAPossibleBulkAction(actions, item);
const isSelected = hasPossibleBulkAction && selection.includes(id);
const [isHovered, setIsHovered] = (0,external_wp_element_.useState)(false);
const {
showTitle = true,
showMedia = true,
showDescription = true,
infiniteScrollEnabled
} = view;
const handleMouseEnter = () => {
setIsHovered(true);
};
const handleMouseLeave = () => {
setIsHovered(false);
};
const isTouchDeviceRef = (0,external_wp_element_.useRef)(false);
const columns = view.fields ?? [];
const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"tr",
{
className: dist_clsx("dataviews-view-table__row", {
"is-selected": hasPossibleBulkAction && isSelected,
"is-hovered": isHovered,
"has-bulk-actions": hasPossibleBulkAction
}),
onMouseEnter: handleMouseEnter,
onMouseLeave: handleMouseLeave,
onTouchStart: () => {
isTouchDeviceRef.current = true;
},
"aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0,
"aria-posinset": posinset,
role: infiniteScrollEnabled ? "article" : void 0,
onClick: (event) => {
if (!hasPossibleBulkAction) {
return;
}
if (!isTouchDeviceRef.current && document.getSelection()?.type !== "Range") {
if ((0,external_wp_keycodes_namespaceObject.isAppleOS)() ? event.metaKey : event.ctrlKey) {
onChangeSelection(
selection.includes(id) ? selection.filter(
(itemId) => id !== itemId
) : [...selection, id]
);
} else {
onChangeSelection(
selection.includes(id) ? selection.filter(
(itemId) => id !== itemId
) : [id]
);
}
}
},
children: [
hasBulkActions && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("td", { className: "dataviews-view-table__checkbox-column", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataviews-view-table__cell-content-wrapper", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DataViewsSelectionCheckbox,
{
item,
selection,
onChangeSelection,
getItemId,
titleField,
disabled: !hasPossibleBulkAction
}
) }) }),
hasPrimaryColumn && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("td", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
column_primary_default,
{
item,
level,
titleField: showTitle ? titleField : void 0,
mediaField: showMedia ? mediaField : void 0,
descriptionField: showDescription ? descriptionField : void 0,
isItemClickable,
onClickItem,
renderItemLink
}
) }),
columns.map((column) => {
const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"td",
{
style: {
width,
maxWidth,
minWidth
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
TableColumnField,
{
fields,
item,
column,
align
}
)
},
column
);
}),
!!actions?.length && // Disable reason: we are not making the element interactive,
// but preventing any click events from bubbling up to the
// table row. This allows us to add a click handler to the row
// itself (to toggle row selection) without erroneously
// intercepting click events from ItemActions.
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"td",
{
className: dist_clsx("dataviews-view-table__actions-column", {
"dataviews-view-table__actions-column--sticky": true,
"dataviews-view-table__actions-column--stuck": isActionsColumnSticky
}),
onClick: (e) => e.stopPropagation(),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemActions, { item, actions })
}
)
]
}
);
}
function ViewTable({
actions,
data,
fields,
getItemId,
getItemLevel,
isLoading = false,
onChangeView,
onChangeSelection,
selection,
setOpenedFilter,
onClickItem,
isItemClickable,
renderItemLink,
view,
className,
empty
}) {
const { containerRef } = (0,external_wp_element_.useContext)(dataviews_context_default);
const headerMenuRefs = (0,external_wp_element_.useRef)(/* @__PURE__ */ new Map());
const headerMenuToFocusRef = (0,external_wp_element_.useRef)();
const [nextHeaderMenuToFocus, setNextHeaderMenuToFocus] = (0,external_wp_element_.useState)();
const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions, data);
(0,external_wp_element_.useEffect)(() => {
if (headerMenuToFocusRef.current) {
headerMenuToFocusRef.current.focus();
headerMenuToFocusRef.current = void 0;
}
});
const tableNoticeId = (0,external_wp_element_.useId)();
const isHorizontalScrollEnd = useIsHorizontalScrollEnd({
scrollContainerRef: containerRef,
enabled: !!actions?.length
});
if (nextHeaderMenuToFocus) {
headerMenuToFocusRef.current = nextHeaderMenuToFocus;
setNextHeaderMenuToFocus(void 0);
return;
}
const onHide = (field) => {
const hidden = headerMenuRefs.current.get(field.id);
const fallback = hidden ? headerMenuRefs.current.get(hidden.fallback) : void 0;
setNextHeaderMenuToFocus(fallback?.node);
};
const hasData = !!data?.length;
const titleField = fields.find((field) => field.id === view.titleField);
const mediaField = fields.find((field) => field.id === view.mediaField);
const descriptionField = fields.find(
(field) => field.id === view.descriptionField
);
const groupField = view.groupByField ? fields.find((f) => f.id === view.groupByField) : null;
const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
const { showTitle = true, showMedia = true, showDescription = true } = view;
const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
const columns = view.fields ?? [];
const headerMenuRef = (column, index) => (node) => {
if (node) {
headerMenuRefs.current.set(column, {
node,
fallback: columns[index > 0 ? index - 1 : 1]
});
} else {
headerMenuRefs.current.delete(column);
}
};
const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"table",
{
className: dist_clsx("dataviews-view-table", className, {
[`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
view.layout.density
)
}),
"aria-busy": isLoading,
"aria-describedby": tableNoticeId,
role: isInfiniteScroll ? "feed" : void 0,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("colgroup", { children: [
hasBulkActions && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("col", { className: "dataviews-view-table__col-checkbox" }),
hasPrimaryColumn && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("col", { className: "dataviews-view-table__col-primary" }),
columns.map((column) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"col",
{
className: `dataviews-view-table__col-${column}`
},
`col-${column}`
)),
!!actions?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("col", { className: "dataviews-view-table__col-actions" })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("thead", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("tr", { className: "dataviews-view-table__row", children: [
hasBulkActions && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"th",
{
className: "dataviews-view-table__checkbox-column",
scope: "col",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
BulkSelectionCheckbox,
{
selection,
onChangeSelection,
data,
actions,
getItemId
}
)
}
),
hasPrimaryColumn && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("th", { scope: "col", children: titleField && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
column_header_menu_default,
{
ref: headerMenuRef(
titleField.id,
0
),
fieldId: titleField.id,
view,
fields,
onChangeView,
onHide,
setOpenedFilter,
canMove: false
}
) }),
columns.map((column, index) => {
const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"th",
{
style: {
width,
maxWidth,
minWidth,
textAlign: align
},
"aria-sort": view.sort?.direction && view.sort?.field === column ? sortValues[view.sort.direction] : void 0,
scope: "col",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
column_header_menu_default,
{
ref: headerMenuRef(column, index),
fieldId: column,
view,
fields,
onChangeView,
onHide,
setOpenedFilter,
canMove: view.layout?.enableMoving ?? true
}
)
},
column
);
}),
!!actions?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"th",
{
className: dist_clsx(
"dataviews-view-table__actions-column",
{
"dataviews-view-table__actions-column--sticky": true,
"dataviews-view-table__actions-column--stuck": !isHorizontalScrollEnd
}
),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "dataviews-view-table-header", children: (0,external_wp_i18n_namespaceObject.__)("Actions") })
}
)
] }) }),
hasData && groupField && dataByGroup ? Array.from(dataByGroup.entries()).map(
([groupName, groupItems]) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("tbody", { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", { className: "dataviews-view-table__group-header-row", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"td",
{
colSpan: columns.length + (hasPrimaryColumn ? 1 : 0) + (hasBulkActions ? 1 : 0) + (actions?.length ? 1 : 0),
className: "dataviews-view-table__group-header-cell",
children: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
(0,external_wp_i18n_namespaceObject.__)("%1$s: %2$s"),
groupField.label,
groupName
)
}
) }),
groupItems.map((item, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
TableRow,
{
item,
level: view.showLevels && typeof getItemLevel === "function" ? getItemLevel(item) : void 0,
hasBulkActions,
actions,
fields,
id: getItemId(item) || index.toString(),
view,
titleField,
mediaField,
descriptionField,
selection,
getItemId,
onChangeSelection,
onClickItem,
renderItemLink,
isItemClickable,
isActionsColumnSticky: !isHorizontalScrollEnd
},
getItemId(item)
))
] }, `group-${groupName}`)
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("tbody", { children: hasData && data.map((item, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
TableRow,
{
item,
level: view.showLevels && typeof getItemLevel === "function" ? getItemLevel(item) : void 0,
hasBulkActions,
actions,
fields,
id: getItemId(item) || index.toString(),
view,
titleField,
mediaField,
descriptionField,
selection,
getItemId,
onChangeSelection,
onClickItem,
renderItemLink,
isItemClickable,
isActionsColumnSticky: !isHorizontalScrollEnd,
posinset: isInfiniteScroll ? index + 1 : void 0
},
getItemId(item)
)) })
]
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
className: dist_clsx({
"dataviews-loading": isLoading,
"dataviews-no-results": !hasData && !isLoading
}),
id: tableNoticeId,
children: [
!hasData && (isLoading ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }) : empty),
hasData && isLoading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) })
]
}
)
] });
}
var table_default = ViewTable;
;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/grid-items.js
const GridItems = (0,external_wp_element_.forwardRef)(({ className, previewSize, ...props }, ref) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
ref,
className: dist_clsx("dataviews-view-grid-items", className),
style: {
gridTemplateColumns: previewSize && `repeat(auto-fill, minmax(${previewSize}px, 1fr))`
},
...props
}
);
});
;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/grid/index.js
const { Badge } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
function GridItem({
view,
selection,
onChangeSelection,
onClickItem,
isItemClickable,
renderItemLink,
getItemId,
item,
actions,
mediaField,
titleField,
descriptionField,
regularFields,
badgeFields,
hasBulkActions,
config,
posinset
}) {
const {
showTitle = true,
showMedia = true,
showDescription = true,
infiniteScrollEnabled
} = view;
const hasBulkAction = useHasAPossibleBulkAction(actions, item);
const id = getItemId(item);
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(GridItem);
const isSelected = selection.includes(id);
const renderedMediaField = mediaField?.render ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
mediaField.render,
{
item,
field: mediaField,
config
}
) : null;
const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(titleField.render, { item, field: titleField }) : null;
const shouldRenderMedia = showMedia && renderedMediaField;
let mediaA11yProps;
let titleA11yProps;
if (isItemClickable(item) && onClickItem) {
if (renderedTitleField) {
mediaA11yProps = {
"aria-labelledby": `dataviews-view-grid__title-field-${instanceId}`
};
titleA11yProps = {
id: `dataviews-view-grid__title-field-${instanceId}`
};
} else {
mediaA11yProps = {
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Navigate to item")
};
}
}
const { paginationInfo } = (0,external_wp_element_.useContext)(dataviews_context_default);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
spacing: 0,
className: dist_clsx("dataviews-view-grid__card", {
"is-selected": hasBulkAction && isSelected
}),
onClickCapture: (event) => {
if ((0,external_wp_keycodes_namespaceObject.isAppleOS)() ? event.metaKey : event.ctrlKey) {
event.stopPropagation();
event.preventDefault();
if (!hasBulkAction) {
return;
}
onChangeSelection(
selection.includes(id) ? selection.filter((itemId) => id !== itemId) : [...selection, id]
);
}
},
role: infiniteScrollEnabled ? "article" : void 0,
"aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0,
"aria-posinset": posinset,
children: [
shouldRenderMedia && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ItemClickWrapper,
{
item,
isItemClickable,
onClickItem,
renderItemLink,
className: "dataviews-view-grid__media",
...mediaA11yProps,
children: renderedMediaField
}
),
hasBulkActions && shouldRenderMedia && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DataViewsSelectionCheckbox,
{
item,
selection,
onChangeSelection,
getItemId,
titleField,
disabled: !hasBulkAction
}
),
!showTitle && shouldRenderMedia && !!actions?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataviews-view-grid__media-actions", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemActions, { item, actions, isCompact: true }) }),
showTitle && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
justify: "space-between",
className: "dataviews-view-grid__title-actions",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ItemClickWrapper,
{
item,
isItemClickable,
onClickItem,
renderItemLink,
className: "dataviews-view-grid__title-field dataviews-title-field",
...titleA11yProps,
children: renderedTitleField
}
),
!!actions?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ItemActions,
{
item,
actions,
isCompact: true
}
)
]
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 1, children: [
showDescription && descriptionField?.render && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
descriptionField.render,
{
item,
field: descriptionField
}
),
!!badgeFields?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHStack,
{
className: "dataviews-view-grid__badge-fields",
spacing: 2,
wrap: true,
alignment: "top",
justify: "flex-start",
children: badgeFields.map((field) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Badge,
{
className: "dataviews-view-grid__field-value",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
field.render,
{
item,
field
}
)
},
field.id
);
})
}
),
!!regularFields?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalVStack,
{
className: "dataviews-view-grid__fields",
spacing: 1,
children: regularFields.map((field) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Flex,
{
className: "dataviews-view-grid__field",
gap: 1,
justify: "flex-start",
expanded: true,
style: { height: "auto" },
direction: "row",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: field.label, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { className: "dataviews-view-grid__field-name", children: field.header }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.FlexItem,
{
className: "dataviews-view-grid__field-value",
style: { maxHeight: "none" },
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
field.render,
{
item,
field
}
)
}
)
] })
},
field.id
);
})
}
)
] })
]
},
id
);
}
function ViewGrid({
actions,
data,
fields,
getItemId,
isLoading,
onChangeSelection,
onClickItem,
isItemClickable,
renderItemLink,
selection,
view,
className,
empty
}) {
const { resizeObserverRef } = (0,external_wp_element_.useContext)(dataviews_context_default);
const titleField = fields.find(
(field) => field.id === view?.titleField
);
const mediaField = fields.find(
(field) => field.id === view?.mediaField
);
const descriptionField = fields.find(
(field) => field.id === view?.descriptionField
);
const otherFields = view.fields ?? [];
const { regularFields, badgeFields } = otherFields.reduce(
(accumulator, fieldId) => {
const field = fields.find((f) => f.id === fieldId);
if (!field) {
return accumulator;
}
const key = view.layout?.badgeFields?.includes(fieldId) ? "badgeFields" : "regularFields";
accumulator[key].push(field);
return accumulator;
},
{ regularFields: [], badgeFields: [] }
);
const hasData = !!data?.length;
const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions, data);
const usedPreviewSize = view.layout?.previewSize;
const size = "900px";
const groupField = view.groupByField ? fields.find((f) => f.id === view.groupByField) : null;
const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
// Render multiple groups.
children: [
hasData && groupField && dataByGroup && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: Array.from(dataByGroup.entries()).map(
([groupName, groupItems]) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 2, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", { className: "dataviews-view-grid__group-header", children: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
(0,external_wp_i18n_namespaceObject.__)("%1$s: %2$s"),
groupField.label,
groupName
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridItems,
{
className: dist_clsx(
"dataviews-view-grid",
className
),
previewSize: usedPreviewSize,
"aria-busy": isLoading,
ref: resizeObserverRef,
children: groupItems.map((item) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridItem,
{
view,
selection,
onChangeSelection,
onClickItem,
isItemClickable,
renderItemLink,
getItemId,
item,
actions,
mediaField,
titleField,
descriptionField,
regularFields,
badgeFields,
hasBulkActions,
config: {
sizes: size
}
},
getItemId(item)
);
})
}
)
] }, groupName)
) }),
// Render a single grid with all data.
hasData && !dataByGroup && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridItems,
{
className: dist_clsx("dataviews-view-grid", className),
previewSize: usedPreviewSize,
"aria-busy": isLoading,
ref: resizeObserverRef,
role: isInfiniteScroll ? "feed" : void 0,
children: data.map((item, index) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridItem,
{
view,
selection,
onChangeSelection,
onClickItem,
isItemClickable,
renderItemLink,
getItemId,
item,
actions,
mediaField,
titleField,
descriptionField,
regularFields,
badgeFields,
hasBulkActions,
config: {
sizes: size
},
posinset: isInfiniteScroll ? index + 1 : void 0
},
getItemId(item)
);
})
}
),
// Render empty state.
!hasData && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx({
"dataviews-loading": isLoading,
"dataviews-no-results": !isLoading
}),
children: isLoading ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }) : empty
}
),
hasData && isLoading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) })
]
});
}
var grid_default = ViewGrid;
;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/list/index.js
const { Menu: list_Menu } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
function generateItemWrapperCompositeId(idPrefix) {
return `${idPrefix}-item-wrapper`;
}
function generatePrimaryActionCompositeId(idPrefix, primaryActionId) {
return `${idPrefix}-primary-action-${primaryActionId}`;
}
function generateDropdownTriggerCompositeId(idPrefix) {
return `${idPrefix}-dropdown`;
}
function PrimaryActionGridCell({
idPrefix,
primaryAction,
item
}) {
const registry = (0,external_wp_data_.useRegistry)();
const [isModalOpen, setIsModalOpen] = (0,external_wp_element_.useState)(false);
const compositeItemId = generatePrimaryActionCompositeId(
idPrefix,
primaryAction.id
);
const label = typeof primaryAction.label === "string" ? primaryAction.label : primaryAction.label([item]);
return "RenderModal" in primaryAction ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite.Item,
{
id: compositeItemId,
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
disabled: !!primaryAction.disabled,
accessibleWhenDisabled: true,
text: label,
size: "small",
onClick: () => setIsModalOpen(true)
}
),
children: isModalOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ActionModal,
{
action: primaryAction,
items: [item],
closeModal: () => setIsModalOpen(false)
}
)
}
) }, primaryAction.id) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite.Item,
{
id: compositeItemId,
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
disabled: !!primaryAction.disabled,
accessibleWhenDisabled: true,
size: "small",
onClick: () => {
primaryAction.callback([item], { registry });
},
children: label
}
)
}
) }, primaryAction.id);
}
function ListItem({
view,
actions,
idPrefix,
isSelected,
item,
titleField,
mediaField,
descriptionField,
onSelect,
otherFields,
onDropdownTriggerKeyDown,
posinset
}) {
const {
showTitle = true,
showMedia = true,
showDescription = true,
infiniteScrollEnabled
} = view;
const itemRef = (0,external_wp_element_.useRef)(null);
const labelId = `${idPrefix}-label`;
const descriptionId = `${idPrefix}-description`;
const registry = (0,external_wp_data_.useRegistry)();
const [isHovered, setIsHovered] = (0,external_wp_element_.useState)(false);
const [activeModalAction, setActiveModalAction] = (0,external_wp_element_.useState)(
null
);
const handleHover = ({ type }) => {
const isHover = type === "mouseenter";
setIsHovered(isHover);
};
const { paginationInfo } = (0,external_wp_element_.useContext)(dataviews_context_default);
(0,external_wp_element_.useEffect)(() => {
if (isSelected) {
itemRef.current?.scrollIntoView({
behavior: "auto",
block: "nearest",
inline: "nearest"
});
}
}, [isSelected]);
const { primaryAction, eligibleActions } = (0,external_wp_element_.useMemo)(() => {
const _eligibleActions = actions.filter(
(action) => !action.isEligible || action.isEligible(item)
);
const _primaryActions = _eligibleActions.filter(
(action) => action.isPrimary
);
return {
primaryAction: _primaryActions[0],
eligibleActions: _eligibleActions
};
}, [actions, item]);
const hasOnlyOnePrimaryAction = primaryAction && actions.length === 1;
const renderedMediaField = showMedia && mediaField?.render ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataviews-view-list__media-wrapper", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
mediaField.render,
{
item,
field: mediaField,
config: { sizes: "52px" }
}
) }) : null;
const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(titleField.render, { item, field: titleField }) : null;
const usedActions = eligibleActions?.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 3, className: "dataviews-view-list__item-actions", children: [
primaryAction && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PrimaryActionGridCell,
{
idPrefix,
primaryAction,
item
}
),
!hasOnlyOnePrimaryAction && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { role: "gridcell", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(list_Menu, { placement: "bottom-end", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
list_Menu.TriggerButton,
{
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite.Item,
{
id: generateDropdownTriggerCompositeId(
idPrefix
),
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "small",
icon: more_vertical_default,
label: (0,external_wp_i18n_namespaceObject.__)("Actions"),
accessibleWhenDisabled: true,
disabled: !actions.length,
onKeyDown: onDropdownTriggerKeyDown
}
)
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(list_Menu.Popover, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ActionsMenuGroup,
{
actions: eligibleActions,
item,
registry,
setActiveModalAction
}
) })
] }),
!!activeModalAction && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ActionModal,
{
action: activeModalAction,
items: [item],
closeModal: () => setActiveModalAction(null)
}
)
] })
] });
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite.Row,
{
ref: itemRef,
render: (
/* aria-posinset breaks Composite.Row if passed to it directly. */
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
"aria-posinset": posinset,
"aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0
}
)
),
role: infiniteScrollEnabled ? "article" : "row",
className: dist_clsx({
"is-selected": isSelected,
"is-hovered": isHovered
}),
onMouseEnter: handleHover,
onMouseLeave: handleHover,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { className: "dataviews-view-list__item-wrapper", spacing: 0, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite.Item,
{
id: generateItemWrapperCompositeId(idPrefix),
"aria-pressed": isSelected,
"aria-labelledby": labelId,
"aria-describedby": descriptionId,
className: "dataviews-view-list__item",
onClick: () => onSelect(item)
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 3, justify: "start", alignment: "flex-start", children: [
renderedMediaField,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
spacing: 1,
className: "dataviews-view-list__field-wrapper",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 0, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "dataviews-title-field",
id: labelId,
children: renderedTitleField
}
),
usedActions
] }),
showDescription && descriptionField?.render && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataviews-view-list__field", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
descriptionField.render,
{
item,
field: descriptionField
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "dataviews-view-list__fields",
id: descriptionId,
children: otherFields.map((field) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
className: "dataviews-view-list__field",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.VisuallyHidden,
{
as: "span",
className: "dataviews-view-list__field-label",
children: field.label
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "dataviews-view-list__field-value", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
field.render,
{
item,
field
}
) })
]
},
field.id
))
}
)
]
}
)
] })
] })
}
);
}
function isDefined(item) {
return !!item;
}
function ViewList(props) {
const {
actions,
data,
fields,
getItemId,
isLoading,
onChangeSelection,
selection,
view,
className,
empty
} = props;
const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(ViewList, "view-list");
const selectedItem = data?.findLast(
(item) => selection.includes(getItemId(item))
);
const titleField = fields.find((field) => field.id === view.titleField);
const mediaField = fields.find((field) => field.id === view.mediaField);
const descriptionField = fields.find(
(field) => field.id === view.descriptionField
);
const otherFields = (view?.fields ?? []).map((fieldId) => fields.find((f) => fieldId === f.id)).filter(isDefined);
const onSelect = (item) => onChangeSelection([getItemId(item)]);
const generateCompositeItemIdPrefix = (0,external_wp_element_.useCallback)(
(item) => `${baseId}-${getItemId(item)}`,
[baseId, getItemId]
);
const isActiveCompositeItem = (0,external_wp_element_.useCallback)(
(item, idToCheck) => {
return idToCheck.startsWith(
generateCompositeItemIdPrefix(item)
);
},
[generateCompositeItemIdPrefix]
);
const [activeCompositeId, setActiveCompositeId] = (0,external_wp_element_.useState)(void 0);
(0,external_wp_element_.useEffect)(() => {
if (selectedItem) {
setActiveCompositeId(
generateItemWrapperCompositeId(
generateCompositeItemIdPrefix(selectedItem)
)
);
}
}, [selectedItem, generateCompositeItemIdPrefix]);
const activeItemIndex = data.findIndex(
(item) => isActiveCompositeItem(item, activeCompositeId ?? "")
);
const previousActiveItemIndex = (0,external_wp_compose_namespaceObject.usePrevious)(activeItemIndex);
const isActiveIdInList = activeItemIndex !== -1;
const selectCompositeItem = (0,external_wp_element_.useCallback)(
(targetIndex, generateCompositeId) => {
const clampedIndex = Math.min(
data.length - 1,
Math.max(0, targetIndex)
);
if (!data[clampedIndex]) {
return;
}
const itemIdPrefix = generateCompositeItemIdPrefix(
data[clampedIndex]
);
const targetCompositeItemId = generateCompositeId(itemIdPrefix);
setActiveCompositeId(targetCompositeItemId);
document.getElementById(targetCompositeItemId)?.focus();
},
[data, generateCompositeItemIdPrefix]
);
(0,external_wp_element_.useEffect)(() => {
const wasActiveIdInList = previousActiveItemIndex !== void 0 && previousActiveItemIndex !== -1;
if (!isActiveIdInList && wasActiveIdInList) {
selectCompositeItem(
previousActiveItemIndex,
generateItemWrapperCompositeId
);
}
}, [isActiveIdInList, selectCompositeItem, previousActiveItemIndex]);
const onDropdownTriggerKeyDown = (0,external_wp_element_.useCallback)(
(event) => {
if (event.key === "ArrowDown") {
event.preventDefault();
selectCompositeItem(
activeItemIndex + 1,
generateDropdownTriggerCompositeId
);
}
if (event.key === "ArrowUp") {
event.preventDefault();
selectCompositeItem(
activeItemIndex - 1,
generateDropdownTriggerCompositeId
);
}
},
[selectCompositeItem, activeItemIndex]
);
const hasData = data?.length;
if (!hasData) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx({
"dataviews-loading": isLoading,
"dataviews-no-results": !hasData && !isLoading
}),
children: !hasData && (isLoading ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }) : empty)
}
);
}
const groupField = view.groupByField ? fields.find((field) => field.id === view.groupByField) : null;
const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
if (hasData && groupField && dataByGroup) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite,
{
id: `${baseId}`,
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {}),
className: "dataviews-view-list__group",
role: "grid",
activeId: activeCompositeId,
setActiveId: setActiveCompositeId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalVStack,
{
spacing: 4,
className: dist_clsx("dataviews-view-list", className),
children: Array.from(dataByGroup.entries()).map(
([groupName, groupItems]) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 2, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", { className: "dataviews-view-list__group-header", children: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
(0,external_wp_i18n_namespaceObject.__)("%1$s: %2$s"),
groupField.label,
groupName
) }),
groupItems.map((item) => {
const id = generateCompositeItemIdPrefix(item);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ListItem,
{
view,
idPrefix: id,
actions,
item,
isSelected: item === selectedItem,
onSelect,
mediaField,
titleField,
descriptionField,
otherFields,
onDropdownTriggerKeyDown
},
id
);
})
] }, groupName)
)
}
)
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite,
{
id: baseId,
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {}),
className: dist_clsx("dataviews-view-list", className),
role: view.infiniteScrollEnabled ? "feed" : "grid",
activeId: activeCompositeId,
setActiveId: setActiveCompositeId,
children: data.map((item, index) => {
const id = generateCompositeItemIdPrefix(item);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ListItem,
{
view,
idPrefix: id,
actions,
item,
isSelected: item === selectedItem,
onSelect,
mediaField,
titleField,
descriptionField,
otherFields,
onDropdownTriggerKeyDown,
posinset: view.infiniteScrollEnabled ? index + 1 : void 0
},
id
);
})
}
),
hasData && isLoading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) })
] });
}
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-picker/footer.js
const footer_EMPTY_ARRAY = (/* unused pure expression or super */ null && ([]));
function useIsMultiselectPicker(actions) {
return (0,external_wp_element_.useMemo)(() => {
return actions?.every((action) => action.supportsBulk);
}, [actions]);
}
function footer_BulkSelectionCheckbox({
selection,
selectedItems,
onChangeSelection,
data,
getItemId
}) {
const areAllSelected = selectedItems.length === data.length;
return /* @__PURE__ */ jsx(
CheckboxControl,
{
className: "dataviews-view-table-selection-checkbox",
__nextHasNoMarginBottom: true,
checked: areAllSelected,
indeterminate: !areAllSelected && !!selectedItems.length,
onChange: () => {
if (areAllSelected) {
onChangeSelection(
selection.filter(
(id) => !data.some(
(item) => id === getItemId(item)
)
)
);
} else {
const selectionSet = /* @__PURE__ */ new Set([
...selection,
...data.map((item) => getItemId(item))
]);
onChangeSelection(Array.from(selectionSet));
}
},
"aria-label": areAllSelected ? __("Deselect all") : __("Select all")
}
);
}
function ActionButtons({
actions,
items,
selection
}) {
const registry = useRegistry();
const [actionInProgress, setActionInProgress] = useState(
null
);
return /* @__PURE__ */ jsx(HStack, { expanded: false, spacing: 1, children: actions.map((action) => {
if (!("callback" in action)) {
return null;
}
const { id, label, icon, isPrimary, callback } = action;
const _label = typeof label === "string" ? label : label(items);
const variant = isPrimary ? "primary" : "tertiary";
const isInProgress = id === actionInProgress;
return /* @__PURE__ */ jsx(
Button,
{
accessibleWhenDisabled: true,
icon,
disabled: isInProgress || !selection?.length,
isBusy: isInProgress,
onClick: async () => {
setActionInProgress(id);
await callback(items, {
registry
});
setActionInProgress(null);
},
size: "compact",
variant,
children: _label
},
id
);
}) });
}
function DataViewsPickerFooter() {
const {
data,
selection,
onChangeSelection,
getItemId,
actions = footer_EMPTY_ARRAY
} = useContext(DataViewsContext);
const selectionCount = selection.length;
const isMultiselect = useIsMultiselectPicker(actions);
const message = selectionCount > 0 ? sprintf(
/* translators: %d: number of items. */
_n(
"%d Item selected",
"%d Items selected",
selectionCount
),
selectionCount
) : sprintf(
/* translators: %d: number of items. */
_n("%d Item", "%d Items", data.length),
data.length
);
const selectedItems = useMemo(
() => data.filter((item) => selection.includes(getItemId(item))),
[selection, getItemId, data]
);
return /* @__PURE__ */ jsxs(
HStack,
{
expanded: false,
justify: "space-between",
className: "dataviews-footer",
children: [
/* @__PURE__ */ jsxs(
HStack,
{
className: "dataviews-picker-footer__bulk-selection",
expanded: false,
spacing: 3,
children: [
isMultiselect && /* @__PURE__ */ jsx(
footer_BulkSelectionCheckbox,
{
selection,
selectedItems,
onChangeSelection,
data,
getItemId
}
),
/* @__PURE__ */ jsx("span", { className: "dataviews-bulk-actions-footer__item-count", children: message })
]
}
),
/* @__PURE__ */ jsx(DataViewsPagination, {}),
Boolean(actions?.length) && /* @__PURE__ */ jsx("div", { className: "dataviews-picker-footer__actions", children: /* @__PURE__ */ jsx(
ActionButtons,
{
actions,
items: selectedItems,
selection
}
) })
]
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/picker-grid/index.js
const { Badge: picker_grid_Badge } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
function picker_grid_GridItem({
view,
multiselect,
selection,
onChangeSelection,
getItemId,
item,
mediaField,
titleField,
descriptionField,
regularFields,
badgeFields,
config,
posinset,
setsize
}) {
const { showTitle = true, showMedia = true, showDescription = true } = view;
const id = getItemId(item);
const isSelected = selection.includes(id);
const renderedMediaField = mediaField?.render ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
mediaField.render,
{
item,
field: mediaField,
config
}
) : null;
const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(titleField.render, { item, field: titleField }) : null;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Composite.Item,
{
"aria-label": titleField ? titleField.getValue({ item }) || (0,external_wp_i18n_namespaceObject.__)("(no title)") : void 0,
render: ({ children, ...props }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 0, children, ...props }),
role: "option",
"aria-posinset": posinset,
"aria-setsize": setsize,
className: dist_clsx("dataviews-view-picker-grid__card", {
"is-selected": isSelected
}),
"aria-selected": isSelected,
onClick: () => {
if (isSelected) {
onChangeSelection(
selection.filter((itemId) => id !== itemId)
);
} else {
const newSelection = multiselect ? [...selection, id] : [id];
onChangeSelection(newSelection);
}
},
children: [
showMedia && renderedMediaField && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataviews-view-picker-grid__media", children: renderedMediaField }),
showMedia && renderedMediaField && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DataViewsSelectionCheckbox,
{
item,
selection,
onChangeSelection,
getItemId,
titleField,
disabled: false,
"aria-hidden": true,
tabIndex: -1
}
),
showTitle && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHStack,
{
justify: "space-between",
className: "dataviews-view-picker-grid__title-actions",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataviews-view-picker-grid__title-field dataviews-title-field", children: renderedTitleField })
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 1, children: [
showDescription && descriptionField?.render && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
descriptionField.render,
{
item,
field: descriptionField
}
),
!!badgeFields?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHStack,
{
className: "dataviews-view-picker-grid__badge-fields",
spacing: 2,
wrap: true,
alignment: "top",
justify: "flex-start",
children: badgeFields.map((field) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
picker_grid_Badge,
{
className: "dataviews-view-picker-grid__field-value",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
field.render,
{
item,
field
}
)
},
field.id
);
})
}
),
!!regularFields?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalVStack,
{
className: "dataviews-view-picker-grid__fields",
spacing: 1,
children: regularFields.map((field) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Flex,
{
className: "dataviews-view-picker-grid__field",
gap: 1,
justify: "flex-start",
expanded: true,
style: { height: "auto" },
direction: "row",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { className: "dataviews-view-picker-grid__field-name", children: field.header }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.FlexItem,
{
className: "dataviews-view-picker-grid__field-value",
style: { maxHeight: "none" },
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
field.render,
{
item,
field
}
)
}
)
] })
},
field.id
);
})
}
)
] })
]
},
id
);
}
function GridGroup({
groupName,
groupField,
children
}) {
const headerId = (0,external_wp_compose_namespaceObject.useInstanceId)(
GridGroup,
"dataviews-view-picker-grid-group__header"
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
spacing: 2,
role: "group",
"aria-labelledby": headerId,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"h3",
{
className: "dataviews-view-picker-grid-group__header",
id: headerId,
children: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
(0,external_wp_i18n_namespaceObject.__)("%1$s: %2$s"),
groupField.label,
groupName
)
}
),
children
]
},
groupName
);
}
function ViewPickerGrid({
actions,
data,
fields,
getItemId,
isLoading,
onChangeSelection,
selection,
view,
className,
empty
}) {
const { resizeObserverRef, paginationInfo, itemListLabel } = (0,external_wp_element_.useContext)(dataviews_context_default);
const titleField = fields.find(
(field) => field.id === view?.titleField
);
const mediaField = fields.find(
(field) => field.id === view?.mediaField
);
const descriptionField = fields.find(
(field) => field.id === view?.descriptionField
);
const otherFields = view.fields ?? [];
const { regularFields, badgeFields } = otherFields.reduce(
(accumulator, fieldId) => {
const field = fields.find((f) => f.id === fieldId);
if (!field) {
return accumulator;
}
const key = view.layout?.badgeFields?.includes(fieldId) ? "badgeFields" : "regularFields";
accumulator[key].push(field);
return accumulator;
},
{ regularFields: [], badgeFields: [] }
);
const hasData = !!data?.length;
const usedPreviewSize = view.layout?.previewSize;
const isMultiselect = useIsMultiselectPicker(actions);
const size = "900px";
const groupField = view.groupByField ? fields.find((f) => f.id === view.groupByField) : null;
const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
const currentPage = view?.page ?? 1;
const perPage = view?.perPage ?? 0;
const setSize = isInfiniteScroll ? paginationInfo?.totalItems : void 0;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
// Render multiple groups.
children: [
hasData && groupField && dataByGroup && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite,
{
virtualFocus: true,
orientation: "horizontal",
role: "listbox",
"aria-multiselectable": isMultiselect,
className: dist_clsx(
"dataviews-view-picker-grid",
className
),
"aria-label": itemListLabel,
render: ({ children, ...props }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalVStack,
{
spacing: 4,
children,
...props
}
),
children: Array.from(dataByGroup.entries()).map(
([groupName, groupItems]) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridGroup,
{
groupName,
groupField,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridItems,
{
previewSize: usedPreviewSize,
style: {
gridTemplateColumns: usedPreviewSize && `repeat(auto-fill, minmax(${usedPreviewSize}px, 1fr))`
},
"aria-busy": isLoading,
ref: resizeObserverRef,
children: groupItems.map((item) => {
const posInSet = (currentPage - 1) * perPage + data.indexOf(item) + 1;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
picker_grid_GridItem,
{
view,
multiselect: isMultiselect,
selection,
onChangeSelection,
getItemId,
item,
mediaField,
titleField,
descriptionField,
regularFields,
badgeFields,
config: {
sizes: size
},
posinset: posInSet,
setsize: setSize
},
getItemId(item)
);
})
}
)
},
groupName
)
)
}
),
// Render a single grid with all data.
hasData && !dataByGroup && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite,
{
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
GridItems,
{
className: dist_clsx(
"dataviews-view-picker-grid",
className
),
previewSize: usedPreviewSize,
"aria-busy": isLoading,
ref: resizeObserverRef
}
),
virtualFocus: true,
orientation: "horizontal",
role: "listbox",
"aria-multiselectable": isMultiselect,
"aria-label": itemListLabel,
children: data.map((item, index) => {
let posinset = isInfiniteScroll ? index + 1 : void 0;
if (!isInfiniteScroll) {
posinset = (currentPage - 1) * perPage + index + 1;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
picker_grid_GridItem,
{
view,
multiselect: isMultiselect,
selection,
onChangeSelection,
getItemId,
item,
mediaField,
titleField,
descriptionField,
regularFields,
badgeFields,
config: {
sizes: size
},
posinset,
setsize: setSize
},
getItemId(item)
);
})
}
),
// Render empty state.
!hasData && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx({
"dataviews-loading": isLoading,
"dataviews-no-results": !isLoading
}),
children: isLoading ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }) : empty
}
),
hasData && isLoading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) })
]
});
}
var picker_grid_default = ViewPickerGrid;
;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/preview-size-picker.js
const imageSizes = [
{
value: 120,
breakpoint: 1
},
{
value: 170,
breakpoint: 1
},
{
value: 230,
breakpoint: 1
},
{
value: 290,
breakpoint: 1112
// at minimum image width, 4 images display at this container size
},
{
value: 350,
breakpoint: 1636
// at minimum image width, 6 images display at this container size
},
{
value: 430,
breakpoint: 588
// at minimum image width, 2 images display at this container size
}
];
function PreviewSizePicker() {
const context = (0,external_wp_element_.useContext)(dataviews_context_default);
const view = context.view;
const breakValues = imageSizes.filter((size) => {
return context.containerWidth >= size.breakpoint;
});
const layoutPreviewSize = view.layout?.previewSize ?? 230;
const previewSizeToUse = breakValues.map((size, index) => ({ ...size, index })).filter((size) => size.value <= layoutPreviewSize).sort((a, b) => b.value - a.value)[0]?.index ?? 0;
const marks = breakValues.map((size, index) => {
return {
value: index
};
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.RangeControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
showTooltip: false,
label: (0,external_wp_i18n_namespaceObject.__)("Preview size"),
value: previewSizeToUse,
min: 0,
max: breakValues.length - 1,
withInputField: false,
onChange: (value = 0) => {
context.onChangeView({
...view,
layout: {
...view.layout,
previewSize: breakValues[value].value
}
});
},
step: 1,
marks
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/density-picker.js
function DensityPicker() {
const context = (0,external_wp_element_.useContext)(dataviews_context_default);
const view = context.view;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
__nextHasNoMarginBottom: true,
size: "__unstable-large",
label: (0,external_wp_i18n_namespaceObject.__)("Density"),
value: view.layout?.density || "balanced",
onChange: (value) => {
context.onChangeView({
...view,
layout: {
...view.layout,
density: value
}
});
},
isBlock: true,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "comfortable",
label: (0,external_wp_i18n_namespaceObject._x)(
"Comfortable",
"Density option for DataView layout"
)
},
"comfortable"
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "balanced",
label: (0,external_wp_i18n_namespaceObject._x)("Balanced", "Density option for DataView layout")
},
"balanced"
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "compact",
label: (0,external_wp_i18n_namespaceObject._x)("Compact", "Density option for DataView layout")
},
"compact"
)
]
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/index.js
const VIEW_LAYOUTS = [
{
type: constants_LAYOUT_TABLE,
label: (0,external_wp_i18n_namespaceObject.__)("Table"),
component: table_default,
icon: block_table_default,
viewConfigOptions: DensityPicker
},
{
type: constants_LAYOUT_GRID,
label: (0,external_wp_i18n_namespaceObject.__)("Grid"),
component: grid_default,
icon: category_default,
viewConfigOptions: PreviewSizePicker
},
{
type: constants_LAYOUT_LIST,
label: (0,external_wp_i18n_namespaceObject.__)("List"),
component: ViewList,
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_bullets_rtl_default : format_list_bullets_default
},
{
type: LAYOUT_PICKER_GRID,
label: (0,external_wp_i18n_namespaceObject.__)("Grid"),
component: picker_grid_default,
icon: category_default,
viewConfigOptions: PreviewSizePicker,
isPicker: true
}
];
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/add-filter.js
const { Menu: add_filter_Menu } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
function AddFilterMenu({
filters,
view,
onChangeView,
setOpenedFilter,
triggerProps
}) {
const inactiveFilters = filters.filter((filter) => !filter.isVisible);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(add_filter_Menu, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter_Menu.TriggerButton, { ...triggerProps }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter_Menu.Popover, { children: inactiveFilters.map((filter) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
add_filter_Menu.Item,
{
onClick: () => {
setOpenedFilter(filter.field);
onChangeView({
...view,
page: 1,
filters: [
...view.filters || [],
{
field: filter.field,
value: void 0,
operator: filter.operators[0]
}
]
});
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter_Menu.ItemLabel, { children: filter.name })
},
filter.field
);
}) })
] });
}
function AddFilter({ filters, view, onChangeView, setOpenedFilter }, ref) {
if (!filters.length || filters.every(({ isPrimary }) => isPrimary)) {
return null;
}
const inactiveFilters = filters.filter((filter) => !filter.isVisible);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
AddFilterMenu,
{
triggerProps: {
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
accessibleWhenDisabled: true,
size: "compact",
className: "dataviews-filters-button",
variant: "tertiary",
disabled: !inactiveFilters.length,
ref
}
),
children: (0,external_wp_i18n_namespaceObject.__)("Add filter")
},
...{ filters, view, onChangeView, setOpenedFilter }
}
);
}
var add_filter_default = (0,external_wp_element_.forwardRef)(AddFilter);
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/toggle.js
function FiltersToggle() {
const {
filters,
view,
onChangeView,
setOpenedFilter,
isShowingFilter,
setIsShowingFilter
} = (0,external_wp_element_.useContext)(dataviews_context_default);
const buttonRef = (0,external_wp_element_.useRef)(null);
const onChangeViewWithFilterVisibility = (0,external_wp_element_.useCallback)(
(_view) => {
onChangeView(_view);
setIsShowingFilter(true);
},
[onChangeView, setIsShowingFilter]
);
const visibleFilters = filters.filter((filter) => filter.isVisible);
const hasVisibleFilters = !!visibleFilters.length;
if (filters.length === 0) {
return null;
}
const addFilterButtonProps = {
label: (0,external_wp_i18n_namespaceObject.__)("Add filter"),
"aria-expanded": false,
isPressed: false
};
const toggleFiltersButtonProps = {
label: (0,external_wp_i18n_namespaceObject._x)("Filter", "verb"),
"aria-expanded": isShowingFilter,
isPressed: isShowingFilter,
onClick: () => {
if (!isShowingFilter) {
setOpenedFilter(null);
}
setIsShowingFilter(!isShowingFilter);
}
};
const buttonComponent = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
ref: buttonRef,
className: "dataviews-filters__visibility-toggle",
size: "compact",
icon: funnel_default,
...hasVisibleFilters ? toggleFiltersButtonProps : addFilterButtonProps
}
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataviews-filters__container-visibility-toggle", children: !hasVisibleFilters ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
AddFilterMenu,
{
filters,
view,
onChangeView: onChangeViewWithFilterVisibility,
setOpenedFilter,
triggerProps: { render: buttonComponent }
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FilterVisibilityToggle,
{
buttonRef,
filtersCount: view.filters?.length,
children: buttonComponent
}
) });
}
function FilterVisibilityToggle({
buttonRef,
filtersCount,
children
}) {
(0,external_wp_element_.useEffect)(
() => () => {
buttonRef.current?.focus();
},
[buttonRef]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
children,
!!filtersCount && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "dataviews-filters-toggle__count", children: filtersCount })
] });
}
var toggle_default = FiltersToggle;
;// ./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js
"use client";
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var _3YLGPPWQ_spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var _3YLGPPWQ_spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
;// ./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js
"use client";
var _3YLGPPWQ_defProp = Object.defineProperty;
var _3YLGPPWQ_defProps = Object.defineProperties;
var _3YLGPPWQ_getOwnPropDescs = Object.getOwnPropertyDescriptors;
var _3YLGPPWQ_getOwnPropSymbols = Object.getOwnPropertySymbols;
var _3YLGPPWQ_hasOwnProp = Object.prototype.hasOwnProperty;
var _3YLGPPWQ_propIsEnum = Object.prototype.propertyIsEnumerable;
var _3YLGPPWQ_defNormalProp = (obj, key, value) => key in obj ? _3YLGPPWQ_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var _chunks_3YLGPPWQ_spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (_3YLGPPWQ_hasOwnProp.call(b, prop))
_3YLGPPWQ_defNormalProp(a, prop, b[prop]);
if (_3YLGPPWQ_getOwnPropSymbols)
for (var prop of _3YLGPPWQ_getOwnPropSymbols(b)) {
if (_3YLGPPWQ_propIsEnum.call(b, prop))
_3YLGPPWQ_defNormalProp(a, prop, b[prop]);
}
return a;
};
var _chunks_3YLGPPWQ_spreadProps = (a, b) => _3YLGPPWQ_defProps(a, _3YLGPPWQ_getOwnPropDescs(b));
var _3YLGPPWQ_objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (_3YLGPPWQ_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && _3YLGPPWQ_getOwnPropSymbols)
for (var prop of _3YLGPPWQ_getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && _3YLGPPWQ_propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
;// ./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js
"use client";
// src/utils/misc.ts
function PBFD2E7P_noop(..._) {
}
function shallowEqual(a, b) {
if (a === b) return true;
if (!a) return false;
if (!b) return false;
if (typeof a !== "object") return false;
if (typeof b !== "object") return false;
const aKeys = Object.keys(a);
const bKeys = Object.keys(b);
const { length } = aKeys;
if (bKeys.length !== length) return false;
for (const key of aKeys) {
if (a[key] !== b[key]) {
return false;
}
}
return true;
}
function applyState(argument, currentValue) {
if (isUpdater(argument)) {
const value = isLazyValue(currentValue) ? currentValue() : currentValue;
return argument(value);
}
return argument;
}
function isUpdater(argument) {
return typeof argument === "function";
}
function isLazyValue(value) {
return typeof value === "function";
}
function isObject(arg) {
return typeof arg === "object" && arg != null;
}
function PBFD2E7P_isEmpty(arg) {
if (Array.isArray(arg)) return !arg.length;
if (isObject(arg)) return !Object.keys(arg).length;
if (arg == null) return true;
if (arg === "") return true;
return false;
}
function isInteger(arg) {
if (typeof arg === "number") {
return Math.floor(arg) === arg;
}
return String(Math.floor(Number(arg))) === arg;
}
function PBFD2E7P_hasOwnProperty(object, prop) {
if (typeof Object.hasOwn === "function") {
return Object.hasOwn(object, prop);
}
return Object.prototype.hasOwnProperty.call(object, prop);
}
function chain(...fns) {
return (...args) => {
for (const fn of fns) {
if (typeof fn === "function") {
fn(...args);
}
}
};
}
function cx(...args) {
return args.filter(Boolean).join(" ") || void 0;
}
function PBFD2E7P_normalizeString(str) {
return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
}
function omit(object, keys) {
const result = _chunks_3YLGPPWQ_spreadValues({}, object);
for (const key of keys) {
if (PBFD2E7P_hasOwnProperty(result, key)) {
delete result[key];
}
}
return result;
}
function pick(object, paths) {
const result = {};
for (const key of paths) {
if (PBFD2E7P_hasOwnProperty(object, key)) {
result[key] = object[key];
}
}
return result;
}
function identity(value) {
return value;
}
function beforePaint(cb = PBFD2E7P_noop) {
const raf = requestAnimationFrame(cb);
return () => cancelAnimationFrame(raf);
}
function afterPaint(cb = PBFD2E7P_noop) {
let raf = requestAnimationFrame(() => {
raf = requestAnimationFrame(cb);
});
return () => cancelAnimationFrame(raf);
}
function invariant(condition, message) {
if (condition) return;
if (typeof message !== "string") throw new Error("Invariant failed");
throw new Error(message);
}
function getKeys(obj) {
return Object.keys(obj);
}
function isFalsyBooleanCallback(booleanOrCallback, ...args) {
const result = typeof booleanOrCallback === "function" ? booleanOrCallback(...args) : booleanOrCallback;
if (result == null) return false;
return !result;
}
function disabledFromProps(props) {
return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true";
}
function removeUndefinedValues(obj) {
const result = {};
for (const key in obj) {
if (obj[key] !== void 0) {
result[key] = obj[key];
}
}
return result;
}
function defaultValue(...values) {
for (const value of values) {
if (value !== void 0) return value;
}
return void 0;
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/SK3NAZA3.js
"use client";
// src/utils/misc.ts
function setRef(ref, value) {
if (typeof ref === "function") {
ref(value);
} else if (ref) {
ref.current = value;
}
}
function isValidElementWithRef(element) {
if (!element) return false;
if (!(0,external_React_.isValidElement)(element)) return false;
if ("ref" in element.props) return true;
if ("ref" in element) return true;
return false;
}
function getRefProperty(element) {
if (!isValidElementWithRef(element)) return null;
const props = _3YLGPPWQ_spreadValues({}, element.props);
return props.ref || element.ref;
}
function mergeProps(base, overrides) {
const props = _3YLGPPWQ_spreadValues({}, base);
for (const key in overrides) {
if (!PBFD2E7P_hasOwnProperty(overrides, key)) continue;
if (key === "className") {
const prop = "className";
props[prop] = base[prop] ? `${base[prop]} ${overrides[prop]}` : overrides[prop];
continue;
}
if (key === "style") {
const prop = "style";
props[prop] = base[prop] ? _3YLGPPWQ_spreadValues(_3YLGPPWQ_spreadValues({}, base[prop]), overrides[prop]) : overrides[prop];
continue;
}
const overrideValue = overrides[key];
if (typeof overrideValue === "function" && key.startsWith("on")) {
const baseValue = base[key];
if (typeof baseValue === "function") {
props[key] = (...args) => {
overrideValue(...args);
baseValue(...args);
};
continue;
}
}
props[key] = overrideValue;
}
return props;
}
;// ./node_modules/@ariakit/core/esm/__chunks/DTR5TSDJ.js
"use client";
// src/utils/dom.ts
var DTR5TSDJ_canUseDOM = checkIsBrowser();
function checkIsBrowser() {
var _a;
return typeof window !== "undefined" && !!((_a = window.document) == null ? void 0 : _a.createElement);
}
function getDocument(node) {
if (!node) return document;
if ("self" in node) return node.document;
return node.ownerDocument || document;
}
function getWindow(node) {
if (!node) return self;
if ("self" in node) return node.self;
return getDocument(node).defaultView || window;
}
function DTR5TSDJ_getActiveElement(node, activeDescendant = false) {
const { activeElement } = getDocument(node);
if (!(activeElement == null ? void 0 : activeElement.nodeName)) {
return null;
}
if (DTR5TSDJ_isFrame(activeElement) && activeElement.contentDocument) {
return DTR5TSDJ_getActiveElement(
activeElement.contentDocument.body,
activeDescendant
);
}
if (activeDescendant) {
const id = activeElement.getAttribute("aria-activedescendant");
if (id) {
const element = getDocument(activeElement).getElementById(id);
if (element) {
return element;
}
}
}
return activeElement;
}
function contains(parent, child) {
return parent === child || parent.contains(child);
}
function DTR5TSDJ_isFrame(element) {
return element.tagName === "IFRAME";
}
function isButton(element) {
const tagName = element.tagName.toLowerCase();
if (tagName === "button") return true;
if (tagName === "input" && element.type) {
return buttonInputTypes.indexOf(element.type) !== -1;
}
return false;
}
var buttonInputTypes = [
"button",
"color",
"file",
"image",
"reset",
"submit"
];
function isVisible(element) {
if (typeof element.checkVisibility === "function") {
return element.checkVisibility();
}
const htmlElement = element;
return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0;
}
function isTextField(element) {
try {
const isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null;
const isTextArea = element.tagName === "TEXTAREA";
return isTextInput || isTextArea || false;
} catch (error) {
return false;
}
}
function isTextbox(element) {
return element.isContentEditable || isTextField(element);
}
function getTextboxValue(element) {
if (isTextField(element)) {
return element.value;
}
if (element.isContentEditable) {
const range = getDocument(element).createRange();
range.selectNodeContents(element);
return range.toString();
}
return "";
}
function getTextboxSelection(element) {
let start = 0;
let end = 0;
if (isTextField(element)) {
start = element.selectionStart || 0;
end = element.selectionEnd || 0;
} else if (element.isContentEditable) {
const selection = getDocument(element).getSelection();
if ((selection == null ? void 0 : selection.rangeCount) && selection.anchorNode && contains(element, selection.anchorNode) && selection.focusNode && contains(element, selection.focusNode)) {
const range = selection.getRangeAt(0);
const nextRange = range.cloneRange();
nextRange.selectNodeContents(element);
nextRange.setEnd(range.startContainer, range.startOffset);
start = nextRange.toString().length;
nextRange.setEnd(range.endContainer, range.endOffset);
end = nextRange.toString().length;
}
}
return { start, end };
}
function getPopupRole(element, fallback) {
const allowedPopupRoles = ["dialog", "menu", "listbox", "tree", "grid"];
const role = element == null ? void 0 : element.getAttribute("role");
if (role && allowedPopupRoles.indexOf(role) !== -1) {
return role;
}
return fallback;
}
function getPopupItemRole(element, fallback) {
var _a;
const itemRoleByPopupRole = {
menu: "menuitem",
listbox: "option",
tree: "treeitem"
};
const popupRole = getPopupRole(element);
if (!popupRole) return fallback;
const key = popupRole;
return (_a = itemRoleByPopupRole[key]) != null ? _a : fallback;
}
function scrollIntoViewIfNeeded(element, arg) {
if (isPartiallyHidden(element) && "scrollIntoView" in element) {
element.scrollIntoView(arg);
}
}
function getScrollingElement(element) {
if (!element) return null;
const isScrollableOverflow = (overflow) => {
if (overflow === "auto") return true;
if (overflow === "scroll") return true;
return false;
};
if (element.clientHeight && element.scrollHeight > element.clientHeight) {
const { overflowY } = getComputedStyle(element);
if (isScrollableOverflow(overflowY)) return element;
} else if (element.clientWidth && element.scrollWidth > element.clientWidth) {
const { overflowX } = getComputedStyle(element);
if (isScrollableOverflow(overflowX)) return element;
}
return getScrollingElement(element.parentElement) || document.scrollingElement || document.body;
}
function isPartiallyHidden(element) {
const elementRect = element.getBoundingClientRect();
const scroller = getScrollingElement(element);
if (!scroller) return false;
const scrollerRect = scroller.getBoundingClientRect();
const isHTML = scroller.tagName === "HTML";
const scrollerTop = isHTML ? scrollerRect.top + scroller.scrollTop : scrollerRect.top;
const scrollerBottom = isHTML ? scroller.clientHeight : scrollerRect.bottom;
const scrollerLeft = isHTML ? scrollerRect.left + scroller.scrollLeft : scrollerRect.left;
const scrollerRight = isHTML ? scroller.clientWidth : scrollerRect.right;
const top = elementRect.top < scrollerTop;
const left = elementRect.left < scrollerLeft;
const bottom = elementRect.bottom > scrollerBottom;
const right = elementRect.right > scrollerRight;
return top || left || bottom || right;
}
function setSelectionRange(element, ...args) {
if (/text|search|password|tel|url/i.test(element.type)) {
element.setSelectionRange(...args);
}
}
function sortBasedOnDOMPosition(items, getElement) {
const pairs = items.map((item, index) => [index, item]);
let isOrderDifferent = false;
pairs.sort(([indexA, a], [indexB, b]) => {
const elementA = getElement(a);
const elementB = getElement(b);
if (elementA === elementB) return 0;
if (!elementA || !elementB) return 0;
if (isElementPreceding(elementA, elementB)) {
if (indexA > indexB) {
isOrderDifferent = true;
}
return -1;
}
if (indexA < indexB) {
isOrderDifferent = true;
}
return 1;
});
if (isOrderDifferent) {
return pairs.map(([_, item]) => item);
}
return items;
}
function isElementPreceding(a, b) {
return Boolean(
b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING
);
}
;// ./node_modules/@ariakit/core/esm/__chunks/QAGXQEUG.js
"use client";
// src/utils/platform.ts
function isTouchDevice() {
return DTR5TSDJ_canUseDOM && !!navigator.maxTouchPoints;
}
function isApple() {
if (!DTR5TSDJ_canUseDOM) return false;
return /mac|iphone|ipad|ipod/i.test(navigator.platform);
}
function isSafari() {
return DTR5TSDJ_canUseDOM && isApple() && /apple/i.test(navigator.vendor);
}
function isFirefox() {
return DTR5TSDJ_canUseDOM && /firefox\//i.test(navigator.userAgent);
}
function isMac() {
return canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
}
;// ./node_modules/@ariakit/core/esm/utils/events.js
"use client";
// src/utils/events.ts
function isPortalEvent(event) {
return Boolean(
event.currentTarget && !contains(event.currentTarget, event.target)
);
}
function isSelfTarget(event) {
return event.target === event.currentTarget;
}
function isOpeningInNewTab(event) {
const element = event.currentTarget;
if (!element) return false;
const isAppleDevice = isApple();
if (isAppleDevice && !event.metaKey) return false;
if (!isAppleDevice && !event.ctrlKey) return false;
const tagName = element.tagName.toLowerCase();
if (tagName === "a") return true;
if (tagName === "button" && element.type === "submit") return true;
if (tagName === "input" && element.type === "submit") return true;
return false;
}
function isDownloading(event) {
const element = event.currentTarget;
if (!element) return false;
const tagName = element.tagName.toLowerCase();
if (!event.altKey) return false;
if (tagName === "a") return true;
if (tagName === "button" && element.type === "submit") return true;
if (tagName === "input" && element.type === "submit") return true;
return false;
}
function fireEvent(element, type, eventInit) {
const event = new Event(type, eventInit);
return element.dispatchEvent(event);
}
function fireBlurEvent(element, eventInit) {
const event = new FocusEvent("blur", eventInit);
const defaultAllowed = element.dispatchEvent(event);
const bubbleInit = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, eventInit), { bubbles: true });
element.dispatchEvent(new FocusEvent("focusout", bubbleInit));
return defaultAllowed;
}
function fireFocusEvent(element, eventInit) {
const event = new FocusEvent("focus", eventInit);
const defaultAllowed = element.dispatchEvent(event);
const bubbleInit = __spreadProps(__spreadValues({}, eventInit), { bubbles: true });
element.dispatchEvent(new FocusEvent("focusin", bubbleInit));
return defaultAllowed;
}
function fireKeyboardEvent(element, type, eventInit) {
const event = new KeyboardEvent(type, eventInit);
return element.dispatchEvent(event);
}
function fireClickEvent(element, eventInit) {
const event = new MouseEvent("click", eventInit);
return element.dispatchEvent(event);
}
function isFocusEventOutside(event, container) {
const containerElement = container || event.currentTarget;
const relatedTarget = event.relatedTarget;
return !relatedTarget || !contains(containerElement, relatedTarget);
}
function getInputType(event) {
const nativeEvent = "nativeEvent" in event ? event.nativeEvent : event;
if (!nativeEvent) return;
if (!("inputType" in nativeEvent)) return;
if (typeof nativeEvent.inputType !== "string") return;
return nativeEvent.inputType;
}
function queueBeforeEvent(element, type, callback, timeout) {
const createTimer = (callback2) => {
if (timeout) {
const timerId2 = setTimeout(callback2, timeout);
return () => clearTimeout(timerId2);
}
const timerId = requestAnimationFrame(callback2);
return () => cancelAnimationFrame(timerId);
};
const cancelTimer = createTimer(() => {
element.removeEventListener(type, callSync, true);
callback();
});
const callSync = () => {
cancelTimer();
callback();
};
element.addEventListener(type, callSync, { once: true, capture: true });
return cancelTimer;
}
function addGlobalEventListener(type, listener, options, scope = window) {
const children = [];
try {
scope.document.addEventListener(type, listener, options);
for (const frame of Array.from(scope.frames)) {
children.push(addGlobalEventListener(type, listener, options, frame));
}
} catch (e) {
}
const removeEventListener = () => {
try {
scope.document.removeEventListener(type, listener, options);
} catch (e) {
}
for (const remove of children) {
remove();
}
};
return removeEventListener;
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/ABQUS43J.js
"use client";
// src/utils/hooks.ts
var _React = _3YLGPPWQ_spreadValues({}, external_React_namespaceObject);
var useReactId = _React.useId;
var useReactDeferredValue = _React.useDeferredValue;
var useReactInsertionEffect = _React.useInsertionEffect;
var useSafeLayoutEffect = DTR5TSDJ_canUseDOM ? external_React_.useLayoutEffect : external_React_.useEffect;
function useInitialValue(value) {
const [initialValue] = (0,external_React_.useState)(value);
return initialValue;
}
function useLazyValue(init) {
const ref = useRef();
if (ref.current === void 0) {
ref.current = init();
}
return ref.current;
}
function useLiveRef(value) {
const ref = (0,external_React_.useRef)(value);
useSafeLayoutEffect(() => {
ref.current = value;
});
return ref;
}
function usePreviousValue(value) {
const [previousValue, setPreviousValue] = useState(value);
if (value !== previousValue) {
setPreviousValue(value);
}
return previousValue;
}
function useEvent(callback) {
const ref = (0,external_React_.useRef)(() => {
throw new Error("Cannot call an event handler while rendering.");
});
if (useReactInsertionEffect) {
useReactInsertionEffect(() => {
ref.current = callback;
});
} else {
ref.current = callback;
}
return (0,external_React_.useCallback)((...args) => {
var _a;
return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);
}, []);
}
function useTransactionState(callback) {
const [state, setState] = (0,external_React_.useState)(null);
useSafeLayoutEffect(() => {
if (state == null) return;
if (!callback) return;
let prevState = null;
callback((prev) => {
prevState = prev;
return state;
});
return () => {
callback(prevState);
};
}, [state, callback]);
return [state, setState];
}
function useMergeRefs(...refs) {
return (0,external_React_.useMemo)(() => {
if (!refs.some(Boolean)) return;
return (value) => {
for (const ref of refs) {
setRef(ref, value);
}
};
}, refs);
}
function useId(defaultId) {
if (useReactId) {
const reactId = useReactId();
if (defaultId) return defaultId;
return reactId;
}
const [id, setId] = (0,external_React_.useState)(defaultId);
useSafeLayoutEffect(() => {
if (defaultId || id) return;
const random = Math.random().toString(36).slice(2, 8);
setId(`id-${random}`);
}, [defaultId, id]);
return defaultId || id;
}
function useDeferredValue(value) {
if (useReactDeferredValue) {
return useReactDeferredValue(value);
}
const [deferredValue, setDeferredValue] = useState(value);
useEffect(() => {
const raf = requestAnimationFrame(() => setDeferredValue(value));
return () => cancelAnimationFrame(raf);
}, [value]);
return deferredValue;
}
function useTagName(refOrElement, type) {
const stringOrUndefined = (type2) => {
if (typeof type2 !== "string") return;
return type2;
};
const [tagName, setTagName] = (0,external_React_.useState)(() => stringOrUndefined(type));
useSafeLayoutEffect(() => {
const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement;
setTagName((element == null ? void 0 : element.tagName.toLowerCase()) || stringOrUndefined(type));
}, [refOrElement, type]);
return tagName;
}
function useAttribute(refOrElement, attributeName, defaultValue) {
const initialValue = useInitialValue(defaultValue);
const [attribute, setAttribute] = (0,external_React_.useState)(initialValue);
(0,external_React_.useEffect)(() => {
const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement;
if (!element) return;
const callback = () => {
const value = element.getAttribute(attributeName);
setAttribute(value == null ? initialValue : value);
};
const observer = new MutationObserver(callback);
observer.observe(element, { attributeFilter: [attributeName] });
callback();
return () => observer.disconnect();
}, [refOrElement, attributeName, initialValue]);
return attribute;
}
function useUpdateEffect(effect, deps) {
const mounted = (0,external_React_.useRef)(false);
(0,external_React_.useEffect)(() => {
if (mounted.current) {
return effect();
}
mounted.current = true;
}, deps);
(0,external_React_.useEffect)(
() => () => {
mounted.current = false;
},
[]
);
}
function useUpdateLayoutEffect(effect, deps) {
const mounted = (0,external_React_.useRef)(false);
useSafeLayoutEffect(() => {
if (mounted.current) {
return effect();
}
mounted.current = true;
}, deps);
useSafeLayoutEffect(
() => () => {
mounted.current = false;
},
[]
);
}
function useForceUpdate() {
return (0,external_React_.useReducer)(() => [], []);
}
function useBooleanEvent(booleanOrCallback) {
return useEvent(
typeof booleanOrCallback === "function" ? booleanOrCallback : () => booleanOrCallback
);
}
function useWrapElement(props, callback, deps = []) {
const wrapElement = (0,external_React_.useCallback)(
(element) => {
if (props.wrapElement) {
element = props.wrapElement(element);
}
return callback(element);
},
[...deps, props.wrapElement]
);
return _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { wrapElement });
}
function usePortalRef(portalProp = false, portalRefProp) {
const [portalNode, setPortalNode] = useState(null);
const portalRef = useMergeRefs(setPortalNode, portalRefProp);
const domReady = !portalProp || portalNode;
return { portalRef, portalNode, domReady };
}
function useMetadataProps(props, key, value) {
const parent = props.onLoadedMetadataCapture;
const onLoadedMetadataCapture = (0,external_React_.useMemo)(() => {
return Object.assign(() => {
}, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, parent), { [key]: value }));
}, [parent, key, value]);
return [parent == null ? void 0 : parent[key], { onLoadedMetadataCapture }];
}
function useIsMouseMoving() {
(0,external_React_.useEffect)(() => {
addGlobalEventListener("mousemove", setMouseMoving, true);
addGlobalEventListener("mousedown", resetMouseMoving, true);
addGlobalEventListener("mouseup", resetMouseMoving, true);
addGlobalEventListener("keydown", resetMouseMoving, true);
addGlobalEventListener("scroll", resetMouseMoving, true);
}, []);
const isMouseMoving = useEvent(() => mouseMoving);
return isMouseMoving;
}
var mouseMoving = false;
var previousScreenX = 0;
var previousScreenY = 0;
function hasMouseMovement(event) {
const movementX = event.movementX || event.screenX - previousScreenX;
const movementY = event.movementY || event.screenY - previousScreenY;
previousScreenX = event.screenX;
previousScreenY = event.screenY;
return movementX || movementY || "production" === "test";
}
function setMouseMoving(event) {
if (!hasMouseMovement(event)) return;
mouseMoving = true;
}
function resetMouseMoving() {
mouseMoving = false;
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/LMDWO4NN.js
"use client";
// src/utils/system.tsx
function forwardRef2(render) {
const Role = external_React_.forwardRef((props, ref) => render(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { ref })));
Role.displayName = render.displayName || render.name;
return Role;
}
function memo2(Component, propsAreEqual) {
return external_React_.memo(Component, propsAreEqual);
}
function createElement(Type, props) {
const _a = props, { wrapElement, render } = _a, rest = __objRest(_a, ["wrapElement", "render"]);
const mergedRef = useMergeRefs(props.ref, getRefProperty(render));
let element;
if (external_React_.isValidElement(render)) {
const renderProps = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, render.props), { ref: mergedRef });
element = external_React_.cloneElement(render, mergeProps(rest, renderProps));
} else if (render) {
element = render(rest);
} else {
element = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Type, _3YLGPPWQ_spreadValues({}, rest));
}
if (wrapElement) {
return wrapElement(element);
}
return element;
}
function createHook(useProps) {
const useRole = (props = {}) => {
return useProps(props);
};
useRole.displayName = useProps.name;
return useRole;
}
function createStoreContext(providers = [], scopedProviders = []) {
const context = external_React_.createContext(void 0);
const scopedContext = external_React_.createContext(void 0);
const useContext2 = () => external_React_.useContext(context);
const useScopedContext = (onlyScoped = false) => {
const scoped = external_React_.useContext(scopedContext);
const store = useContext2();
if (onlyScoped) return scoped;
return scoped || store;
};
const useProviderContext = () => {
const scoped = external_React_.useContext(scopedContext);
const store = useContext2();
if (scoped && scoped === store) return;
return store;
};
const ContextProvider = (props) => {
return providers.reduceRight(
(children, Provider) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { children })),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(context.Provider, _3YLGPPWQ_spreadValues({}, props))
);
};
const ScopedContextProvider = (props) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextProvider, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { children: scopedProviders.reduceRight(
(children, Provider) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { children })),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(scopedContext.Provider, _3YLGPPWQ_spreadValues({}, props))
) }));
};
return {
context,
scopedContext,
useContext: useContext2,
useScopedContext,
useProviderContext,
ContextProvider,
ScopedContextProvider
};
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/VDHZ5F7K.js
"use client";
// src/collection/collection-context.tsx
var ctx = createStoreContext();
var useCollectionContext = ctx.useContext;
var useCollectionScopedContext = ctx.useScopedContext;
var useCollectionProviderContext = ctx.useProviderContext;
var CollectionContextProvider = ctx.ContextProvider;
var CollectionScopedContextProvider = ctx.ScopedContextProvider;
;// ./node_modules/@ariakit/react-core/esm/__chunks/P7GR5CS5.js
"use client";
// src/composite/composite-context.tsx
var P7GR5CS5_ctx = createStoreContext(
[CollectionContextProvider],
[CollectionScopedContextProvider]
);
var useCompositeContext = P7GR5CS5_ctx.useContext;
var useCompositeScopedContext = P7GR5CS5_ctx.useScopedContext;
var useCompositeProviderContext = P7GR5CS5_ctx.useProviderContext;
var CompositeContextProvider = P7GR5CS5_ctx.ContextProvider;
var CompositeScopedContextProvider = P7GR5CS5_ctx.ScopedContextProvider;
var CompositeItemContext = (0,external_React_.createContext)(
void 0
);
var CompositeRowContext = (0,external_React_.createContext)(
void 0
);
;// ./node_modules/@ariakit/react-core/esm/__chunks/3XAVFTCA.js
"use client";
// src/tag/tag-context.tsx
var TagValueContext = (0,external_React_.createContext)(null);
var TagRemoveIdContext = (0,external_React_.createContext)(
null
);
var _3XAVFTCA_ctx = createStoreContext(
[CompositeContextProvider],
[CompositeScopedContextProvider]
);
var useTagContext = _3XAVFTCA_ctx.useContext;
var useTagScopedContext = _3XAVFTCA_ctx.useScopedContext;
var useTagProviderContext = _3XAVFTCA_ctx.useProviderContext;
var TagContextProvider = _3XAVFTCA_ctx.ContextProvider;
var TagScopedContextProvider = _3XAVFTCA_ctx.ScopedContextProvider;
;// ./node_modules/@ariakit/core/esm/__chunks/BCALMBPZ.js
"use client";
// src/utils/store.ts
function getInternal(store, key) {
const internals = store.__unstableInternals;
invariant(internals, "Invalid store");
return internals[key];
}
function createStore(initialState, ...stores) {
let state = initialState;
let prevStateBatch = state;
let lastUpdate = Symbol();
let destroy = PBFD2E7P_noop;
const instances = /* @__PURE__ */ new Set();
const updatedKeys = /* @__PURE__ */ new Set();
const setups = /* @__PURE__ */ new Set();
const listeners = /* @__PURE__ */ new Set();
const batchListeners = /* @__PURE__ */ new Set();
const disposables = /* @__PURE__ */ new WeakMap();
const listenerKeys = /* @__PURE__ */ new WeakMap();
const storeSetup = (callback) => {
setups.add(callback);
return () => setups.delete(callback);
};
const storeInit = () => {
const initialized = instances.size;
const instance = Symbol();
instances.add(instance);
const maybeDestroy = () => {
instances.delete(instance);
if (instances.size) return;
destroy();
};
if (initialized) return maybeDestroy;
const desyncs = getKeys(state).map(
(key) => chain(
...stores.map((store) => {
var _a;
const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store);
if (!storeState) return;
if (!PBFD2E7P_hasOwnProperty(storeState, key)) return;
return sync(store, [key], (state2) => {
setState(
key,
state2[key],
// @ts-expect-error - Not public API. This is just to prevent
// infinite loops.
true
);
});
})
)
);
const teardowns = [];
for (const setup2 of setups) {
teardowns.push(setup2());
}
const cleanups = stores.map(init);
destroy = chain(...desyncs, ...teardowns, ...cleanups);
return maybeDestroy;
};
const sub = (keys, listener, set = listeners) => {
set.add(listener);
listenerKeys.set(listener, keys);
return () => {
var _a;
(_a = disposables.get(listener)) == null ? void 0 : _a();
disposables.delete(listener);
listenerKeys.delete(listener);
set.delete(listener);
};
};
const storeSubscribe = (keys, listener) => sub(keys, listener);
const storeSync = (keys, listener) => {
disposables.set(listener, listener(state, state));
return sub(keys, listener);
};
const storeBatch = (keys, listener) => {
disposables.set(listener, listener(state, prevStateBatch));
return sub(keys, listener, batchListeners);
};
const storePick = (keys) => createStore(pick(state, keys), finalStore);
const storeOmit = (keys) => createStore(omit(state, keys), finalStore);
const getState = () => state;
const setState = (key, value, fromStores = false) => {
var _a;
if (!PBFD2E7P_hasOwnProperty(state, key)) return;
const nextValue = applyState(value, state[key]);
if (nextValue === state[key]) return;
if (!fromStores) {
for (const store of stores) {
(_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue);
}
}
const prevState = state;
state = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, state), { [key]: nextValue });
const thisUpdate = Symbol();
lastUpdate = thisUpdate;
updatedKeys.add(key);
const run = (listener, prev, uKeys) => {
var _a2;
const keys = listenerKeys.get(listener);
const updated = (k) => uKeys ? uKeys.has(k) : k === key;
if (!keys || keys.some(updated)) {
(_a2 = disposables.get(listener)) == null ? void 0 : _a2();
disposables.set(listener, listener(state, prev));
}
};
for (const listener of listeners) {
run(listener, prevState);
}
queueMicrotask(() => {
if (lastUpdate !== thisUpdate) return;
const snapshot = state;
for (const listener of batchListeners) {
run(listener, prevStateBatch, updatedKeys);
}
prevStateBatch = snapshot;
updatedKeys.clear();
});
};
const finalStore = {
getState,
setState,
__unstableInternals: {
setup: storeSetup,
init: storeInit,
subscribe: storeSubscribe,
sync: storeSync,
batch: storeBatch,
pick: storePick,
omit: storeOmit
}
};
return finalStore;
}
function setup(store, ...args) {
if (!store) return;
return getInternal(store, "setup")(...args);
}
function init(store, ...args) {
if (!store) return;
return getInternal(store, "init")(...args);
}
function subscribe(store, ...args) {
if (!store) return;
return getInternal(store, "subscribe")(...args);
}
function sync(store, ...args) {
if (!store) return;
return getInternal(store, "sync")(...args);
}
function batch(store, ...args) {
if (!store) return;
return getInternal(store, "batch")(...args);
}
function omit2(store, ...args) {
if (!store) return;
return getInternal(store, "omit")(...args);
}
function pick2(store, ...args) {
if (!store) return;
return getInternal(store, "pick")(...args);
}
function mergeStore(...stores) {
const initialState = stores.reduce((state, store2) => {
var _a;
const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2);
if (!nextState) return state;
return Object.assign(state, nextState);
}, {});
const store = createStore(initialState, ...stores);
return Object.assign({}, ...stores, store);
}
function throwOnConflictingProps(props, store) {
if (true) return;
if (!store) return;
const defaultKeys = Object.entries(props).filter(([key, value]) => key.startsWith("default") && value !== void 0).map(([key]) => {
var _a;
const stateKey = key.replace("default", "");
return `${((_a = stateKey[0]) == null ? void 0 : _a.toLowerCase()) || ""}${stateKey.slice(1)}`;
});
if (!defaultKeys.length) return;
const storeState = store.getState();
const conflictingProps = defaultKeys.filter(
(key) => PBFD2E7P_hasOwnProperty(storeState, key)
);
if (!conflictingProps.length) return;
throw new Error(
`Passing a store prop in conjunction with a default state is not supported.
const store = useSelectStore();
<SelectProvider store={store} defaultValue="Apple" />
^ ^
Instead, pass the default state to the topmost store:
const store = useSelectStore({ defaultValue: "Apple" });
<SelectProvider store={store} />
See https://github.com/ariakit/ariakit/pull/2745 for more details.
If there's a particular need for this, please submit a feature request at https://github.com/ariakit/ariakit
`
);
}
// EXTERNAL MODULE: ./node_modules/use-sync-external-store/shim/index.js
var shim = __webpack_require__(422);
;// ./node_modules/@ariakit/react-core/esm/__chunks/YV4JVR4I.js
"use client";
// src/utils/store.tsx
var { useSyncExternalStore } = shim;
var noopSubscribe = () => () => {
};
function useStoreState(store, keyOrSelector = identity) {
const storeSubscribe = external_React_.useCallback(
(callback) => {
if (!store) return noopSubscribe();
return subscribe(store, null, callback);
},
[store]
);
const getSnapshot = () => {
const key = typeof keyOrSelector === "string" ? keyOrSelector : null;
const selector = typeof keyOrSelector === "function" ? keyOrSelector : null;
const state = store == null ? void 0 : store.getState();
if (selector) return selector(state);
if (!state) return;
if (!key) return;
if (!PBFD2E7P_hasOwnProperty(state, key)) return;
return state[key];
};
return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot);
}
function useStoreStateObject(store, object) {
const objRef = external_React_.useRef(
{}
);
const storeSubscribe = external_React_.useCallback(
(callback) => {
if (!store) return noopSubscribe();
return subscribe(store, null, callback);
},
[store]
);
const getSnapshot = () => {
const state = store == null ? void 0 : store.getState();
let updated = false;
const obj = objRef.current;
for (const prop in object) {
const keyOrSelector = object[prop];
if (typeof keyOrSelector === "function") {
const value = keyOrSelector(state);
if (value !== obj[prop]) {
obj[prop] = value;
updated = true;
}
}
if (typeof keyOrSelector === "string") {
if (!state) continue;
if (!PBFD2E7P_hasOwnProperty(state, keyOrSelector)) continue;
const value = state[keyOrSelector];
if (value !== obj[prop]) {
obj[prop] = value;
updated = true;
}
}
}
if (updated) {
objRef.current = _3YLGPPWQ_spreadValues({}, obj);
}
return objRef.current;
};
return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot);
}
function useStoreProps(store, props, key, setKey) {
const value = PBFD2E7P_hasOwnProperty(props, key) ? props[key] : void 0;
const setValue = setKey ? props[setKey] : void 0;
const propsRef = useLiveRef({ value, setValue });
useSafeLayoutEffect(() => {
return sync(store, [key], (state, prev) => {
const { value: value2, setValue: setValue2 } = propsRef.current;
if (!setValue2) return;
if (state[key] === prev[key]) return;
if (state[key] === value2) return;
setValue2(state[key]);
});
}, [store, key]);
useSafeLayoutEffect(() => {
if (value === void 0) return;
store.setState(key, value);
return batch(store, [key], () => {
if (value === void 0) return;
store.setState(key, value);
});
});
}
function YV4JVR4I_useStore(createStore, props) {
const [store, setStore] = external_React_.useState(() => createStore(props));
useSafeLayoutEffect(() => init(store), [store]);
const useState2 = external_React_.useCallback(
(keyOrSelector) => useStoreState(store, keyOrSelector),
[store]
);
const memoizedStore = external_React_.useMemo(
() => _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, store), { useState: useState2 }),
[store, useState2]
);
const updateStore = useEvent(() => {
setStore((store2) => createStore(_3YLGPPWQ_spreadValues(_3YLGPPWQ_spreadValues({}, props), store2.getState())));
});
return [memoizedStore, updateStore];
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/C3IKGW5T.js
"use client";
// src/collection/collection-store.ts
function useCollectionStoreProps(store, update, props) {
useUpdateEffect(update, [props.store]);
useStoreProps(store, props, "items", "setItems");
return store;
}
function useCollectionStore(props = {}) {
const [store, update] = useStore(Core.createCollectionStore, props);
return useCollectionStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/4CMBR7SL.js
"use client";
// src/composite/composite-store.ts
function useCompositeStoreOptions(props) {
const id = useId(props.id);
return _3YLGPPWQ_spreadValues({ id }, props);
}
function useCompositeStoreProps(store, update, props) {
store = useCollectionStoreProps(store, update, props);
useStoreProps(store, props, "activeId", "setActiveId");
useStoreProps(store, props, "includesBaseElement");
useStoreProps(store, props, "virtualFocus");
useStoreProps(store, props, "orientation");
useStoreProps(store, props, "rtl");
useStoreProps(store, props, "focusLoop");
useStoreProps(store, props, "focusWrap");
useStoreProps(store, props, "focusShift");
return store;
}
function useCompositeStore(props = {}) {
props = useCompositeStoreOptions(props);
const [store, update] = useStore(Core.createCompositeStore, props);
return useCompositeStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/WYCIER3C.js
"use client";
// src/disclosure/disclosure-store.ts
function useDisclosureStoreProps(store, update, props) {
useUpdateEffect(update, [props.store, props.disclosure]);
useStoreProps(store, props, "open", "setOpen");
useStoreProps(store, props, "mounted", "setMounted");
useStoreProps(store, props, "animated");
return Object.assign(store, { disclosure: props.disclosure });
}
function useDisclosureStore(props = {}) {
const [store, update] = useStore(Core.createDisclosureStore, props);
return useDisclosureStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/BM6PGYQY.js
"use client";
// src/dialog/dialog-store.ts
function useDialogStoreProps(store, update, props) {
return useDisclosureStoreProps(store, update, props);
}
function useDialogStore(props = {}) {
const [store, update] = useStore(Core.createDialogStore, props);
return useDialogStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/O2PQ2652.js
"use client";
// src/popover/popover-store.ts
function usePopoverStoreProps(store, update, props) {
useUpdateEffect(update, [props.popover]);
useStoreProps(store, props, "placement");
return useDialogStoreProps(store, update, props);
}
function usePopoverStore(props = {}) {
const [store, update] = useStore(Core.createPopoverStore, props);
return usePopoverStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/core/esm/__chunks/CYQWQL4J.js
"use client";
// src/collection/collection-store.ts
function getCommonParent(items) {
var _a;
const firstItem = items.find((item) => !!item.element);
const lastItem = [...items].reverse().find((item) => !!item.element);
let parentElement = (_a = firstItem == null ? void 0 : firstItem.element) == null ? void 0 : _a.parentElement;
while (parentElement && (lastItem == null ? void 0 : lastItem.element)) {
const parent = parentElement;
if (lastItem && parent.contains(lastItem.element)) {
return parentElement;
}
parentElement = parentElement.parentElement;
}
return getDocument(parentElement).body;
}
function getPrivateStore(store) {
return store == null ? void 0 : store.__unstablePrivateStore;
}
function createCollectionStore(props = {}) {
var _a;
throwOnConflictingProps(props, props.store);
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
const items = defaultValue(
props.items,
syncState == null ? void 0 : syncState.items,
props.defaultItems,
[]
);
const itemsMap = new Map(items.map((item) => [item.id, item]));
const initialState = {
items,
renderedItems: defaultValue(syncState == null ? void 0 : syncState.renderedItems, [])
};
const syncPrivateStore = getPrivateStore(props.store);
const privateStore = createStore(
{ items, renderedItems: initialState.renderedItems },
syncPrivateStore
);
const collection = createStore(initialState, props.store);
const sortItems = (renderedItems) => {
const sortedItems = sortBasedOnDOMPosition(renderedItems, (i) => i.element);
privateStore.setState("renderedItems", sortedItems);
collection.setState("renderedItems", sortedItems);
};
setup(collection, () => init(privateStore));
setup(privateStore, () => {
return batch(privateStore, ["items"], (state) => {
collection.setState("items", state.items);
});
});
setup(privateStore, () => {
return batch(privateStore, ["renderedItems"], (state) => {
let firstRun = true;
let raf = requestAnimationFrame(() => {
const { renderedItems } = collection.getState();
if (state.renderedItems === renderedItems) return;
sortItems(state.renderedItems);
});
if (typeof IntersectionObserver !== "function") {
return () => cancelAnimationFrame(raf);
}
const ioCallback = () => {
if (firstRun) {
firstRun = false;
return;
}
cancelAnimationFrame(raf);
raf = requestAnimationFrame(() => sortItems(state.renderedItems));
};
const root = getCommonParent(state.renderedItems);
const observer = new IntersectionObserver(ioCallback, { root });
for (const item of state.renderedItems) {
if (!item.element) continue;
observer.observe(item.element);
}
return () => {
cancelAnimationFrame(raf);
observer.disconnect();
};
});
});
const mergeItem = (item, setItems, canDeleteFromMap = false) => {
let prevItem;
setItems((items2) => {
const index = items2.findIndex(({ id }) => id === item.id);
const nextItems = items2.slice();
if (index !== -1) {
prevItem = items2[index];
const nextItem = _chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, prevItem), item);
nextItems[index] = nextItem;
itemsMap.set(item.id, nextItem);
} else {
nextItems.push(item);
itemsMap.set(item.id, item);
}
return nextItems;
});
const unmergeItem = () => {
setItems((items2) => {
if (!prevItem) {
if (canDeleteFromMap) {
itemsMap.delete(item.id);
}
return items2.filter(({ id }) => id !== item.id);
}
const index = items2.findIndex(({ id }) => id === item.id);
if (index === -1) return items2;
const nextItems = items2.slice();
nextItems[index] = prevItem;
itemsMap.set(item.id, prevItem);
return nextItems;
});
};
return unmergeItem;
};
const registerItem = (item) => mergeItem(
item,
(getItems) => privateStore.setState("items", getItems),
true
);
return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, collection), {
registerItem,
renderItem: (item) => chain(
registerItem(item),
mergeItem(
item,
(getItems) => privateStore.setState("renderedItems", getItems)
)
),
item: (id) => {
if (!id) return null;
let item = itemsMap.get(id);
if (!item) {
const { items: items2 } = privateStore.getState();
item = items2.find((item2) => item2.id === id);
if (item) {
itemsMap.set(id, item);
}
}
return item || null;
},
// @ts-expect-error Internal
__unstablePrivateStore: privateStore
});
}
;// ./node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js
"use client";
// src/utils/array.ts
function toArray(arg) {
if (Array.isArray(arg)) {
return arg;
}
return typeof arg !== "undefined" ? [arg] : [];
}
function addItemToArray(array, item, index = -1) {
if (!(index in array)) {
return [...array, item];
}
return [...array.slice(0, index), item, ...array.slice(index)];
}
function flatten2DArray(array) {
const flattened = [];
for (const row of array) {
flattened.push(...row);
}
return flattened;
}
function reverseArray(array) {
return array.slice().reverse();
}
;// ./node_modules/@ariakit/core/esm/__chunks/AJZ4BYF3.js
"use client";
// src/composite/composite-store.ts
var NULL_ITEM = { id: null };
function findFirstEnabledItem(items, excludeId) {
return items.find((item) => {
if (excludeId) {
return !item.disabled && item.id !== excludeId;
}
return !item.disabled;
});
}
function getEnabledItems(items, excludeId) {
return items.filter((item) => {
if (excludeId) {
return !item.disabled && item.id !== excludeId;
}
return !item.disabled;
});
}
function getItemsInRow(items, rowId) {
return items.filter((item) => item.rowId === rowId);
}
function flipItems(items, activeId, shouldInsertNullItem = false) {
const index = items.findIndex((item) => item.id === activeId);
return [
...items.slice(index + 1),
...shouldInsertNullItem ? [NULL_ITEM] : [],
...items.slice(0, index)
];
}
function groupItemsByRows(items) {
const rows = [];
for (const item of items) {
const row = rows.find((currentRow) => {
var _a;
return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId;
});
if (row) {
row.push(item);
} else {
rows.push([item]);
}
}
return rows;
}
function getMaxRowLength(array) {
let maxLength = 0;
for (const { length } of array) {
if (length > maxLength) {
maxLength = length;
}
}
return maxLength;
}
function createEmptyItem(rowId) {
return {
id: "__EMPTY_ITEM__",
disabled: true,
rowId
};
}
function normalizeRows(rows, activeId, focusShift) {
const maxLength = getMaxRowLength(rows);
for (const row of rows) {
for (let i = 0; i < maxLength; i += 1) {
const item = row[i];
if (!item || focusShift && item.disabled) {
const isFirst = i === 0;
const previousItem = isFirst && focusShift ? findFirstEnabledItem(row) : row[i - 1];
row[i] = previousItem && activeId !== previousItem.id && focusShift ? previousItem : createEmptyItem(previousItem == null ? void 0 : previousItem.rowId);
}
}
}
return rows;
}
function verticalizeItems(items) {
const rows = groupItemsByRows(items);
const maxLength = getMaxRowLength(rows);
const verticalized = [];
for (let i = 0; i < maxLength; i += 1) {
for (const row of rows) {
const item = row[i];
if (item) {
verticalized.push(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, item), {
// If there's no rowId, it means that it's not a grid composite, but
// a single row instead. So, instead of verticalizing it, that is,
// assigning a different rowId based on the column index, we keep it
// undefined so they will be part of the same row. This is useful
// when using up/down on one-dimensional composites.
rowId: item.rowId ? `${i}` : void 0
}));
}
}
}
return verticalized;
}
function createCompositeStore(props = {}) {
var _a;
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
const collection = createCollectionStore(props);
const activeId = defaultValue(
props.activeId,
syncState == null ? void 0 : syncState.activeId,
props.defaultActiveId
);
const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, collection.getState()), {
id: defaultValue(
props.id,
syncState == null ? void 0 : syncState.id,
`id-${Math.random().toString(36).slice(2, 8)}`
),
activeId,
baseElement: defaultValue(syncState == null ? void 0 : syncState.baseElement, null),
includesBaseElement: defaultValue(
props.includesBaseElement,
syncState == null ? void 0 : syncState.includesBaseElement,
activeId === null
),
moves: defaultValue(syncState == null ? void 0 : syncState.moves, 0),
orientation: defaultValue(
props.orientation,
syncState == null ? void 0 : syncState.orientation,
"both"
),
rtl: defaultValue(props.rtl, syncState == null ? void 0 : syncState.rtl, false),
virtualFocus: defaultValue(
props.virtualFocus,
syncState == null ? void 0 : syncState.virtualFocus,
false
),
focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),
focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
focusShift: defaultValue(props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
});
const composite = createStore(initialState, collection, props.store);
setup(
composite,
() => sync(composite, ["renderedItems", "activeId"], (state) => {
composite.setState("activeId", (activeId2) => {
var _a2;
if (activeId2 !== void 0) return activeId2;
return (_a2 = findFirstEnabledItem(state.renderedItems)) == null ? void 0 : _a2.id;
});
})
);
const getNextId = (direction = "next", options = {}) => {
var _a2, _b;
const defaultState = composite.getState();
const {
skip = 0,
activeId: activeId2 = defaultState.activeId,
focusShift = defaultState.focusShift,
focusLoop = defaultState.focusLoop,
focusWrap = defaultState.focusWrap,
includesBaseElement = defaultState.includesBaseElement,
renderedItems = defaultState.renderedItems,
rtl = defaultState.rtl
} = options;
const isVerticalDirection = direction === "up" || direction === "down";
const isNextDirection = direction === "next" || direction === "down";
const canReverse = isNextDirection ? rtl && !isVerticalDirection : !rtl || isVerticalDirection;
const canShift = focusShift && !skip;
let items = !isVerticalDirection ? renderedItems : flatten2DArray(
normalizeRows(groupItemsByRows(renderedItems), activeId2, canShift)
);
items = canReverse ? reverseArray(items) : items;
items = isVerticalDirection ? verticalizeItems(items) : items;
if (activeId2 == null) {
return (_a2 = findFirstEnabledItem(items)) == null ? void 0 : _a2.id;
}
const activeItem = items.find((item) => item.id === activeId2);
if (!activeItem) {
return (_b = findFirstEnabledItem(items)) == null ? void 0 : _b.id;
}
const isGrid = items.some((item) => item.rowId);
const activeIndex = items.indexOf(activeItem);
const nextItems = items.slice(activeIndex + 1);
const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId);
if (skip) {
const nextEnabledItemsInRow = getEnabledItems(nextItemsInRow, activeId2);
const nextItem2 = nextEnabledItemsInRow.slice(skip)[0] || // If we can't find an item, just return the last one.
nextEnabledItemsInRow[nextEnabledItemsInRow.length - 1];
return nextItem2 == null ? void 0 : nextItem2.id;
}
const canLoop = focusLoop && (isVerticalDirection ? focusLoop !== "horizontal" : focusLoop !== "vertical");
const canWrap = isGrid && focusWrap && (isVerticalDirection ? focusWrap !== "horizontal" : focusWrap !== "vertical");
const hasNullItem = isNextDirection ? (!isGrid || isVerticalDirection) && canLoop && includesBaseElement : isVerticalDirection ? includesBaseElement : false;
if (canLoop) {
const loopItems = canWrap && !hasNullItem ? items : getItemsInRow(items, activeItem.rowId);
const sortedItems = flipItems(loopItems, activeId2, hasNullItem);
const nextItem2 = findFirstEnabledItem(sortedItems, activeId2);
return nextItem2 == null ? void 0 : nextItem2.id;
}
if (canWrap) {
const nextItem2 = findFirstEnabledItem(
// We can use nextItems, which contains all the next items, including
// items from other rows, to wrap between rows. However, if there is a
// null item (the composite container), we'll only use the next items in
// the row. So moving next from the last item will focus on the
// composite container. On grid composites, horizontal navigation never
// focuses on the composite container, only vertical.
hasNullItem ? nextItemsInRow : nextItems,
activeId2
);
const nextId = hasNullItem ? (nextItem2 == null ? void 0 : nextItem2.id) || null : nextItem2 == null ? void 0 : nextItem2.id;
return nextId;
}
const nextItem = findFirstEnabledItem(nextItemsInRow, activeId2);
if (!nextItem && hasNullItem) {
return null;
}
return nextItem == null ? void 0 : nextItem.id;
};
return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, collection), composite), {
setBaseElement: (element) => composite.setState("baseElement", element),
setActiveId: (id) => composite.setState("activeId", id),
move: (id) => {
if (id === void 0) return;
composite.setState("activeId", id);
composite.setState("moves", (moves) => moves + 1);
},
first: () => {
var _a2;
return (_a2 = findFirstEnabledItem(composite.getState().renderedItems)) == null ? void 0 : _a2.id;
},
last: () => {
var _a2;
return (_a2 = findFirstEnabledItem(reverseArray(composite.getState().renderedItems))) == null ? void 0 : _a2.id;
},
next: (options) => {
if (options !== void 0 && typeof options === "number") {
options = { skip: options };
}
return getNextId("next", options);
},
previous: (options) => {
if (options !== void 0 && typeof options === "number") {
options = { skip: options };
}
return getNextId("previous", options);
},
down: (options) => {
if (options !== void 0 && typeof options === "number") {
options = { skip: options };
}
return getNextId("down", options);
},
up: (options) => {
if (options !== void 0 && typeof options === "number") {
options = { skip: options };
}
return getNextId("up", options);
}
});
}
;// ./node_modules/@ariakit/core/esm/__chunks/RCQ5P4YE.js
"use client";
// src/disclosure/disclosure-store.ts
function createDisclosureStore(props = {}) {
const store = mergeStore(
props.store,
omit2(props.disclosure, ["contentElement", "disclosureElement"])
);
throwOnConflictingProps(props, store);
const syncState = store == null ? void 0 : store.getState();
const open = defaultValue(
props.open,
syncState == null ? void 0 : syncState.open,
props.defaultOpen,
false
);
const animated = defaultValue(props.animated, syncState == null ? void 0 : syncState.animated, false);
const initialState = {
open,
animated,
animating: !!animated && open,
mounted: open,
contentElement: defaultValue(syncState == null ? void 0 : syncState.contentElement, null),
disclosureElement: defaultValue(syncState == null ? void 0 : syncState.disclosureElement, null)
};
const disclosure = createStore(initialState, store);
setup(
disclosure,
() => sync(disclosure, ["animated", "animating"], (state) => {
if (state.animated) return;
disclosure.setState("animating", false);
})
);
setup(
disclosure,
() => subscribe(disclosure, ["open"], () => {
if (!disclosure.getState().animated) return;
disclosure.setState("animating", true);
})
);
setup(
disclosure,
() => sync(disclosure, ["open", "animating"], (state) => {
disclosure.setState("mounted", state.open || state.animating);
})
);
return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, disclosure), {
disclosure: props.disclosure,
setOpen: (value) => disclosure.setState("open", value),
show: () => disclosure.setState("open", true),
hide: () => disclosure.setState("open", false),
toggle: () => disclosure.setState("open", (open2) => !open2),
stopAnimation: () => disclosure.setState("animating", false),
setContentElement: (value) => disclosure.setState("contentElement", value),
setDisclosureElement: (value) => disclosure.setState("disclosureElement", value)
});
}
;// ./node_modules/@ariakit/core/esm/__chunks/FZZ2AVHF.js
"use client";
// src/dialog/dialog-store.ts
function createDialogStore(props = {}) {
return createDisclosureStore(props);
}
;// ./node_modules/@ariakit/core/esm/__chunks/ME2CUF3F.js
"use client";
// src/popover/popover-store.ts
function createPopoverStore(_a = {}) {
var _b = _a, {
popover: otherPopover
} = _b, props = _3YLGPPWQ_objRest(_b, [
"popover"
]);
const store = mergeStore(
props.store,
omit2(otherPopover, [
"arrowElement",
"anchorElement",
"contentElement",
"popoverElement",
"disclosureElement"
])
);
throwOnConflictingProps(props, store);
const syncState = store == null ? void 0 : store.getState();
const dialog = createDialogStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), { store }));
const placement = defaultValue(
props.placement,
syncState == null ? void 0 : syncState.placement,
"bottom"
);
const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, dialog.getState()), {
placement,
currentPlacement: placement,
anchorElement: defaultValue(syncState == null ? void 0 : syncState.anchorElement, null),
popoverElement: defaultValue(syncState == null ? void 0 : syncState.popoverElement, null),
arrowElement: defaultValue(syncState == null ? void 0 : syncState.arrowElement, null),
rendered: Symbol("rendered")
});
const popover = createStore(initialState, dialog, store);
return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, dialog), popover), {
setAnchorElement: (element) => popover.setState("anchorElement", element),
setPopoverElement: (element) => popover.setState("popoverElement", element),
setArrowElement: (element) => popover.setState("arrowElement", element),
render: () => popover.setState("rendered", Symbol("rendered"))
});
}
;// ./node_modules/@ariakit/core/esm/combobox/combobox-store.js
"use client";
// src/combobox/combobox-store.ts
var isTouchSafari = isSafari() && isTouchDevice();
function createComboboxStore(_a = {}) {
var _b = _a, {
tag
} = _b, props = _3YLGPPWQ_objRest(_b, [
"tag"
]);
const store = mergeStore(props.store, pick2(tag, ["value", "rtl"]));
throwOnConflictingProps(props, store);
const tagState = tag == null ? void 0 : tag.getState();
const syncState = store == null ? void 0 : store.getState();
const activeId = defaultValue(
props.activeId,
syncState == null ? void 0 : syncState.activeId,
props.defaultActiveId,
null
);
const composite = createCompositeStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
activeId,
includesBaseElement: defaultValue(
props.includesBaseElement,
syncState == null ? void 0 : syncState.includesBaseElement,
true
),
orientation: defaultValue(
props.orientation,
syncState == null ? void 0 : syncState.orientation,
"vertical"
),
focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true),
focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, true),
virtualFocus: defaultValue(
props.virtualFocus,
syncState == null ? void 0 : syncState.virtualFocus,
true
)
}));
const popover = createPopoverStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
placement: defaultValue(
props.placement,
syncState == null ? void 0 : syncState.placement,
"bottom-start"
)
}));
const value = defaultValue(
props.value,
syncState == null ? void 0 : syncState.value,
props.defaultValue,
""
);
const selectedValue = defaultValue(
props.selectedValue,
syncState == null ? void 0 : syncState.selectedValue,
tagState == null ? void 0 : tagState.values,
props.defaultSelectedValue,
""
);
const multiSelectable = Array.isArray(selectedValue);
const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, composite.getState()), popover.getState()), {
value,
selectedValue,
resetValueOnSelect: defaultValue(
props.resetValueOnSelect,
syncState == null ? void 0 : syncState.resetValueOnSelect,
multiSelectable
),
resetValueOnHide: defaultValue(
props.resetValueOnHide,
syncState == null ? void 0 : syncState.resetValueOnHide,
multiSelectable && !tag
),
activeValue: syncState == null ? void 0 : syncState.activeValue
});
const combobox = createStore(initialState, composite, popover, store);
if (isTouchSafari) {
setup(
combobox,
() => sync(combobox, ["virtualFocus"], () => {
combobox.setState("virtualFocus", false);
})
);
}
setup(combobox, () => {
if (!tag) return;
return chain(
sync(combobox, ["selectedValue"], (state) => {
if (!Array.isArray(state.selectedValue)) return;
tag.setValues(state.selectedValue);
}),
sync(tag, ["values"], (state) => {
combobox.setState("selectedValue", state.values);
})
);
});
setup(
combobox,
() => sync(combobox, ["resetValueOnHide", "mounted"], (state) => {
if (!state.resetValueOnHide) return;
if (state.mounted) return;
combobox.setState("value", value);
})
);
setup(
combobox,
() => sync(combobox, ["open"], (state) => {
if (state.open) return;
combobox.setState("activeId", activeId);
combobox.setState("moves", 0);
})
);
setup(
combobox,
() => sync(combobox, ["moves", "activeId"], (state, prevState) => {
if (state.moves === prevState.moves) {
combobox.setState("activeValue", void 0);
}
})
);
setup(
combobox,
() => batch(combobox, ["moves", "renderedItems"], (state, prev) => {
if (state.moves === prev.moves) return;
const { activeId: activeId2 } = combobox.getState();
const activeItem = composite.item(activeId2);
combobox.setState("activeValue", activeItem == null ? void 0 : activeItem.value);
})
);
return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, popover), composite), combobox), {
tag,
setValue: (value2) => combobox.setState("value", value2),
resetValue: () => combobox.setState("value", initialState.value),
setSelectedValue: (selectedValue2) => combobox.setState("selectedValue", selectedValue2)
});
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/FEOFMWBY.js
"use client";
// src/combobox/combobox-store.ts
function useComboboxStoreOptions(props) {
const tag = useTagContext();
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
tag: props.tag !== void 0 ? props.tag : tag
});
return useCompositeStoreOptions(props);
}
function useComboboxStoreProps(store, update, props) {
useUpdateEffect(update, [props.tag]);
useStoreProps(store, props, "value", "setValue");
useStoreProps(store, props, "selectedValue", "setSelectedValue");
useStoreProps(store, props, "resetValueOnHide");
useStoreProps(store, props, "resetValueOnSelect");
return Object.assign(
useCompositeStoreProps(
usePopoverStoreProps(store, update, props),
update,
props
),
{ tag: props.tag }
);
}
function useComboboxStore(props = {}) {
props = useComboboxStoreOptions(props);
const [store, update] = YV4JVR4I_useStore(createComboboxStore, props);
return useComboboxStoreProps(store, update, props);
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/S6EF7IVO.js
"use client";
// src/disclosure/disclosure-context.tsx
var S6EF7IVO_ctx = createStoreContext();
var useDisclosureContext = S6EF7IVO_ctx.useContext;
var useDisclosureScopedContext = S6EF7IVO_ctx.useScopedContext;
var useDisclosureProviderContext = S6EF7IVO_ctx.useProviderContext;
var DisclosureContextProvider = S6EF7IVO_ctx.ContextProvider;
var DisclosureScopedContextProvider = S6EF7IVO_ctx.ScopedContextProvider;
;// ./node_modules/@ariakit/react-core/esm/__chunks/RS7LB2H4.js
"use client";
// src/dialog/dialog-context.tsx
var RS7LB2H4_ctx = createStoreContext(
[DisclosureContextProvider],
[DisclosureScopedContextProvider]
);
var useDialogContext = RS7LB2H4_ctx.useContext;
var useDialogScopedContext = RS7LB2H4_ctx.useScopedContext;
var useDialogProviderContext = RS7LB2H4_ctx.useProviderContext;
var DialogContextProvider = RS7LB2H4_ctx.ContextProvider;
var DialogScopedContextProvider = RS7LB2H4_ctx.ScopedContextProvider;
var DialogHeadingContext = (0,external_React_.createContext)(void 0);
var DialogDescriptionContext = (0,external_React_.createContext)(void 0);
;// ./node_modules/@ariakit/react-core/esm/__chunks/MTZPJQMC.js
"use client";
// src/popover/popover-context.tsx
var MTZPJQMC_ctx = createStoreContext(
[DialogContextProvider],
[DialogScopedContextProvider]
);
var usePopoverContext = MTZPJQMC_ctx.useContext;
var usePopoverScopedContext = MTZPJQMC_ctx.useScopedContext;
var usePopoverProviderContext = MTZPJQMC_ctx.useProviderContext;
var PopoverContextProvider = MTZPJQMC_ctx.ContextProvider;
var PopoverScopedContextProvider = MTZPJQMC_ctx.ScopedContextProvider;
;// ./node_modules/@ariakit/react-core/esm/__chunks/VEVQD5MH.js
"use client";
// src/combobox/combobox-context.tsx
var ComboboxListRoleContext = (0,external_React_.createContext)(
void 0
);
var VEVQD5MH_ctx = createStoreContext(
[PopoverContextProvider, CompositeContextProvider],
[PopoverScopedContextProvider, CompositeScopedContextProvider]
);
var useComboboxContext = VEVQD5MH_ctx.useContext;
var useComboboxScopedContext = VEVQD5MH_ctx.useScopedContext;
var useComboboxProviderContext = VEVQD5MH_ctx.useProviderContext;
var ComboboxContextProvider = VEVQD5MH_ctx.ContextProvider;
var ComboboxScopedContextProvider = VEVQD5MH_ctx.ScopedContextProvider;
var ComboboxItemValueContext = (0,external_React_.createContext)(
void 0
);
var ComboboxItemCheckedContext = (0,external_React_.createContext)(false);
;// ./node_modules/@ariakit/react-core/esm/combobox/combobox-provider.js
"use client";
// src/combobox/combobox-provider.tsx
function ComboboxProvider(props = {}) {
const store = useComboboxStore(props);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ComboboxContextProvider, { value: store, children: props.children });
}
;// ./node_modules/@ariakit/react-core/esm/combobox/combobox-label.js
"use client";
// src/combobox/combobox-label.tsx
var TagName = "label";
var useComboboxLabel = createHook(
function useComboboxLabel2(_a) {
var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
const context = useComboboxProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const comboboxId = store.useState((state) => {
var _a2;
return (_a2 = state.baseElement) == null ? void 0 : _a2.id;
});
props = _3YLGPPWQ_spreadValues({
htmlFor: comboboxId
}, props);
return removeUndefinedValues(props);
}
);
var ComboboxLabel = memo2(
forwardRef2(function ComboboxLabel2(props) {
const htmlProps = useComboboxLabel(props);
return createElement(TagName, htmlProps);
})
);
;// ./node_modules/@ariakit/react-core/esm/__chunks/OMU7RWRV.js
"use client";
// src/popover/popover-anchor.tsx
var OMU7RWRV_TagName = "div";
var usePopoverAnchor = createHook(
function usePopoverAnchor2(_a) {
var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
const context = usePopoverProviderContext();
store = store || context;
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
ref: useMergeRefs(store == null ? void 0 : store.setAnchorElement, props.ref)
});
return props;
}
);
var PopoverAnchor = forwardRef2(function PopoverAnchor2(props) {
const htmlProps = usePopoverAnchor(props);
return createElement(OMU7RWRV_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/5VQZOHHZ.js
"use client";
// src/composite/utils.ts
var _5VQZOHHZ_NULL_ITEM = { id: null };
function _5VQZOHHZ_flipItems(items, activeId, shouldInsertNullItem = false) {
const index = items.findIndex((item) => item.id === activeId);
return [
...items.slice(index + 1),
...shouldInsertNullItem ? [_5VQZOHHZ_NULL_ITEM] : [],
...items.slice(0, index)
];
}
function _5VQZOHHZ_findFirstEnabledItem(items, excludeId) {
return items.find((item) => {
if (excludeId) {
return !item.disabled && item.id !== excludeId;
}
return !item.disabled;
});
}
function getEnabledItem(store, id) {
if (!id) return null;
return store.item(id) || null;
}
function _5VQZOHHZ_groupItemsByRows(items) {
const rows = [];
for (const item of items) {
const row = rows.find((currentRow) => {
var _a;
return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId;
});
if (row) {
row.push(item);
} else {
rows.push([item]);
}
}
return rows;
}
function selectTextField(element, collapseToEnd = false) {
if (isTextField(element)) {
element.setSelectionRange(
collapseToEnd ? element.value.length : 0,
element.value.length
);
} else if (element.isContentEditable) {
const selection = getDocument(element).getSelection();
selection == null ? void 0 : selection.selectAllChildren(element);
if (collapseToEnd) {
selection == null ? void 0 : selection.collapseToEnd();
}
}
}
var FOCUS_SILENTLY = Symbol("FOCUS_SILENTLY");
function focusSilently(element) {
element[FOCUS_SILENTLY] = true;
element.focus({ preventScroll: true });
}
function silentlyFocused(element) {
const isSilentlyFocused = element[FOCUS_SILENTLY];
delete element[FOCUS_SILENTLY];
return isSilentlyFocused;
}
function isItem(store, element, exclude) {
if (!element) return false;
if (element === exclude) return false;
const item = store.item(element.id);
if (!item) return false;
if (exclude && item.element === exclude) return false;
return true;
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/SWN3JYXT.js
"use client";
// src/focusable/focusable-context.tsx
var FocusableContext = (0,external_React_.createContext)(true);
;// ./node_modules/@ariakit/core/esm/utils/focus.js
"use client";
// src/utils/focus.ts
var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";
function hasNegativeTabIndex(element) {
const tabIndex = Number.parseInt(element.getAttribute("tabindex") || "0", 10);
return tabIndex < 0;
}
function isFocusable(element) {
if (!element.matches(selector)) return false;
if (!isVisible(element)) return false;
if (element.closest("[inert]")) return false;
return true;
}
function isTabbable(element) {
if (!isFocusable(element)) return false;
if (hasNegativeTabIndex(element)) return false;
if (!("form" in element)) return true;
if (!element.form) return true;
if (element.checked) return true;
if (element.type !== "radio") return true;
const radioGroup = element.form.elements.namedItem(element.name);
if (!radioGroup) return true;
if (!("length" in radioGroup)) return true;
const activeElement = getActiveElement(element);
if (!activeElement) return true;
if (activeElement === element) return true;
if (!("form" in activeElement)) return true;
if (activeElement.form !== element.form) return true;
if (activeElement.name !== element.name) return true;
return false;
}
function getAllFocusableIn(container, includeContainer) {
const elements = Array.from(
container.querySelectorAll(selector)
);
if (includeContainer) {
elements.unshift(container);
}
const focusableElements = elements.filter(isFocusable);
focusableElements.forEach((element, i) => {
if (isFrame(element) && element.contentDocument) {
const frameBody = element.contentDocument.body;
focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody));
}
});
return focusableElements;
}
function getAllFocusable(includeBody) {
return getAllFocusableIn(document.body, includeBody);
}
function getFirstFocusableIn(container, includeContainer) {
const [first] = getAllFocusableIn(container, includeContainer);
return first || null;
}
function getFirstFocusable(includeBody) {
return getFirstFocusableIn(document.body, includeBody);
}
function getAllTabbableIn(container, includeContainer, fallbackToFocusable) {
const elements = Array.from(
container.querySelectorAll(selector)
);
const tabbableElements = elements.filter(isTabbable);
if (includeContainer && isTabbable(container)) {
tabbableElements.unshift(container);
}
tabbableElements.forEach((element, i) => {
if (isFrame(element) && element.contentDocument) {
const frameBody = element.contentDocument.body;
const allFrameTabbable = getAllTabbableIn(
frameBody,
false,
fallbackToFocusable
);
tabbableElements.splice(i, 1, ...allFrameTabbable);
}
});
if (!tabbableElements.length && fallbackToFocusable) {
return elements;
}
return tabbableElements;
}
function getAllTabbable(fallbackToFocusable) {
return getAllTabbableIn(document.body, false, fallbackToFocusable);
}
function getFirstTabbableIn(container, includeContainer, fallbackToFocusable) {
const [first] = getAllTabbableIn(
container,
includeContainer,
fallbackToFocusable
);
return first || null;
}
function getFirstTabbable(fallbackToFocusable) {
return getFirstTabbableIn(document.body, false, fallbackToFocusable);
}
function getLastTabbableIn(container, includeContainer, fallbackToFocusable) {
const allTabbable = getAllTabbableIn(
container,
includeContainer,
fallbackToFocusable
);
return allTabbable[allTabbable.length - 1] || null;
}
function getLastTabbable(fallbackToFocusable) {
return getLastTabbableIn(document.body, false, fallbackToFocusable);
}
function getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) {
const activeElement = getActiveElement(container);
const allFocusable = getAllFocusableIn(container, includeContainer);
const activeIndex = allFocusable.indexOf(activeElement);
const nextFocusableElements = allFocusable.slice(activeIndex + 1);
return nextFocusableElements.find(isTabbable) || (fallbackToFirst ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? nextFocusableElements[0] : null) || null;
}
function getNextTabbable(fallbackToFirst, fallbackToFocusable) {
return getNextTabbableIn(
document.body,
false,
fallbackToFirst,
fallbackToFocusable
);
}
function getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) {
const activeElement = getActiveElement(container);
const allFocusable = getAllFocusableIn(container, includeContainer).reverse();
const activeIndex = allFocusable.indexOf(activeElement);
const previousFocusableElements = allFocusable.slice(activeIndex + 1);
return previousFocusableElements.find(isTabbable) || (fallbackToLast ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? previousFocusableElements[0] : null) || null;
}
function getPreviousTabbable(fallbackToFirst, fallbackToFocusable) {
return getPreviousTabbableIn(
document.body,
false,
fallbackToFirst,
fallbackToFocusable
);
}
function getClosestFocusable(element) {
while (element && !isFocusable(element)) {
element = element.closest(selector);
}
return element || null;
}
function hasFocus(element) {
const activeElement = DTR5TSDJ_getActiveElement(element);
if (!activeElement) return false;
if (activeElement === element) return true;
const activeDescendant = activeElement.getAttribute("aria-activedescendant");
if (!activeDescendant) return false;
return activeDescendant === element.id;
}
function hasFocusWithin(element) {
const activeElement = DTR5TSDJ_getActiveElement(element);
if (!activeElement) return false;
if (contains(element, activeElement)) return true;
const activeDescendant = activeElement.getAttribute("aria-activedescendant");
if (!activeDescendant) return false;
if (!("id" in element)) return false;
if (activeDescendant === element.id) return true;
return !!element.querySelector(`#${CSS.escape(activeDescendant)}`);
}
function focusIfNeeded(element) {
if (!hasFocusWithin(element) && isFocusable(element)) {
element.focus();
}
}
function disableFocus(element) {
var _a;
const currentTabindex = (_a = element.getAttribute("tabindex")) != null ? _a : "";
element.setAttribute("data-tabindex", currentTabindex);
element.setAttribute("tabindex", "-1");
}
function disableFocusIn(container, includeContainer) {
const tabbableElements = getAllTabbableIn(container, includeContainer);
for (const element of tabbableElements) {
disableFocus(element);
}
}
function restoreFocusIn(container) {
const elements = container.querySelectorAll("[data-tabindex]");
const restoreTabIndex = (element) => {
const tabindex = element.getAttribute("data-tabindex");
element.removeAttribute("data-tabindex");
if (tabindex) {
element.setAttribute("tabindex", tabindex);
} else {
element.removeAttribute("tabindex");
}
};
if (container.hasAttribute("data-tabindex")) {
restoreTabIndex(container);
}
for (const element of elements) {
restoreTabIndex(element);
}
}
function focusIntoView(element, options) {
if (!("scrollIntoView" in element)) {
element.focus();
} else {
element.focus({ preventScroll: true });
element.scrollIntoView(_chunks_3YLGPPWQ_spreadValues({ block: "nearest", inline: "nearest" }, options));
}
}
;// ./node_modules/@ariakit/react-core/esm/__chunks/LVA2YJMS.js
"use client";
// src/focusable/focusable.tsx
var LVA2YJMS_TagName = "div";
var isSafariBrowser = isSafari();
var alwaysFocusVisibleInputTypes = [
"text",
"search",
"url",
"tel",
"email",
"password",
"number",
"date",
"month",
"week",
"time",
"datetime",
"datetime-local"
];
var safariFocusAncestorSymbol = Symbol("safariFocusAncestor");
function isSafariFocusAncestor(element) {
if (!element) return false;
return !!element[safariFocusAncestorSymbol];
}
function markSafariFocusAncestor(element, value) {
if (!element) return;
element[safariFocusAncestorSymbol] = value;
}
function isAlwaysFocusVisible(element) {
const { tagName, readOnly, type } = element;
if (tagName === "TEXTAREA" && !readOnly) return true;
if (tagName === "SELECT" && !readOnly) return true;
if (tagName === "INPUT" && !readOnly) {
return alwaysFocusVisibleInputTypes.includes(type);
}
if (element.isContentEditable) return true;
const role = element.getAttribute("role");
if (role === "combobox" && element.dataset.name) {
return true;
}
return false;
}
function getLabels(element) {
if ("labels" in element) {
return element.labels;
}
return null;
}
function isNativeCheckboxOrRadio(element) {
const tagName = element.tagName.toLowerCase();
if (tagName === "input" && element.type) {
return element.type === "radio" || element.type === "checkbox";
}
return false;
}
function isNativeTabbable(tagName) {
if (!tagName) return true;
return tagName === "button" || tagName === "summary" || tagName === "input" || tagName === "select" || tagName === "textarea" || tagName === "a";
}
function supportsDisabledAttribute(tagName) {
if (!tagName) return true;
return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea";
}
function getTabIndex(focusable, trulyDisabled, nativeTabbable, supportsDisabled, tabIndexProp) {
if (!focusable) {
return tabIndexProp;
}
if (trulyDisabled) {
if (nativeTabbable && !supportsDisabled) {
return -1;
}
return;
}
if (nativeTabbable) {
return tabIndexProp;
}
return tabIndexProp || 0;
}
function useDisableEvent(onEvent, disabled) {
return useEvent((event) => {
onEvent == null ? void 0 : onEvent(event);
if (event.defaultPrevented) return;
if (disabled) {
event.stopPropagation();
event.preventDefault();
}
});
}
var isKeyboardModality = true;
function onGlobalMouseDown(event) {
const target = event.target;
if (target && "hasAttribute" in target) {
if (!target.hasAttribute("data-focus-visible")) {
isKeyboardModality = false;
}
}
}
function onGlobalKeyDown(event) {
if (event.metaKey) return;
if (event.ctrlKey) return;
if (event.altKey) return;
isKeyboardModality = true;
}
var useFocusable = createHook(
function useFocusable2(_a) {
var _b = _a, {
focusable = true,
accessibleWhenDisabled,
autoFocus,
onFocusVisible
} = _b, props = __objRest(_b, [
"focusable",
"accessibleWhenDisabled",
"autoFocus",
"onFocusVisible"
]);
const ref = (0,external_React_.useRef)(null);
(0,external_React_.useEffect)(() => {
if (!focusable) return;
addGlobalEventListener("mousedown", onGlobalMouseDown, true);
addGlobalEventListener("keydown", onGlobalKeyDown, true);
}, [focusable]);
if (isSafariBrowser) {
(0,external_React_.useEffect)(() => {
if (!focusable) return;
const element = ref.current;
if (!element) return;
if (!isNativeCheckboxOrRadio(element)) return;
const labels = getLabels(element);
if (!labels) return;
const onMouseUp = () => queueMicrotask(() => element.focus());
for (const label of labels) {
label.addEventListener("mouseup", onMouseUp);
}
return () => {
for (const label of labels) {
label.removeEventListener("mouseup", onMouseUp);
}
};
}, [focusable]);
}
const disabled = focusable && disabledFromProps(props);
const trulyDisabled = !!disabled && !accessibleWhenDisabled;
const [focusVisible, setFocusVisible] = (0,external_React_.useState)(false);
(0,external_React_.useEffect)(() => {
if (!focusable) return;
if (trulyDisabled && focusVisible) {
setFocusVisible(false);
}
}, [focusable, trulyDisabled, focusVisible]);
(0,external_React_.useEffect)(() => {
if (!focusable) return;
if (!focusVisible) return;
const element = ref.current;
if (!element) return;
if (typeof IntersectionObserver === "undefined") return;
const observer = new IntersectionObserver(() => {
if (!isFocusable(element)) {
setFocusVisible(false);
}
});
observer.observe(element);
return () => observer.disconnect();
}, [focusable, focusVisible]);
const onKeyPressCapture = useDisableEvent(
props.onKeyPressCapture,
disabled
);
const onMouseDownCapture = useDisableEvent(
props.onMouseDownCapture,
disabled
);
const onClickCapture = useDisableEvent(props.onClickCapture, disabled);
const onMouseDownProp = props.onMouseDown;
const onMouseDown = useEvent((event) => {
onMouseDownProp == null ? void 0 : onMouseDownProp(event);
if (event.defaultPrevented) return;
if (!focusable) return;
const element = event.currentTarget;
if (!isSafariBrowser) return;
if (isPortalEvent(event)) return;
if (!isButton(element) && !isNativeCheckboxOrRadio(element)) return;
let receivedFocus = false;
const onFocus = () => {
receivedFocus = true;
};
const options = { capture: true, once: true };
element.addEventListener("focusin", onFocus, options);
const focusableContainer = getClosestFocusable(element.parentElement);
markSafariFocusAncestor(focusableContainer, true);
queueBeforeEvent(element, "mouseup", () => {
element.removeEventListener("focusin", onFocus, true);
markSafariFocusAncestor(focusableContainer, false);
if (receivedFocus) return;
focusIfNeeded(element);
});
});
const handleFocusVisible = (event, currentTarget) => {
if (currentTarget) {
event.currentTarget = currentTarget;
}
if (!focusable) return;
const element = event.currentTarget;
if (!element) return;
if (!hasFocus(element)) return;
onFocusVisible == null ? void 0 : onFocusVisible(event);
if (event.defaultPrevented) return;
element.dataset.focusVisible = "true";
setFocusVisible(true);
};
const onKeyDownCaptureProp = props.onKeyDownCapture;
const onKeyDownCapture = useEvent((event) => {
onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event);
if (event.defaultPrevented) return;
if (!focusable) return;
if (focusVisible) return;
if (event.metaKey) return;
if (event.altKey) return;
if (event.ctrlKey) return;
if (!isSelfTarget(event)) return;
const element = event.currentTarget;
const applyFocusVisible = () => handleFocusVisible(event, element);
queueBeforeEvent(element, "focusout", applyFocusVisible);
});
const onFocusCaptureProp = props.onFocusCapture;
const onFocusCapture = useEvent((event) => {
onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event);
if (event.defaultPrevented) return;
if (!focusable) return;
if (!isSelfTarget(event)) {
setFocusVisible(false);
return;
}
const element = event.currentTarget;
const applyFocusVisible = () => handleFocusVisible(event, element);
if (isKeyboardModality || isAlwaysFocusVisible(event.target)) {
queueBeforeEvent(event.target, "focusout", applyFocusVisible);
} else {
setFocusVisible(false);
}
});
const onBlurProp = props.onBlur;
const onBlur = useEvent((event) => {
onBlurProp == null ? void 0 : onBlurProp(event);
if (!focusable) return;
if (!isFocusEventOutside(event)) return;
setFocusVisible(false);
});
const autoFocusOnShow = (0,external_React_.useContext)(FocusableContext);
const autoFocusRef = useEvent((element) => {
if (!focusable) return;
if (!autoFocus) return;
if (!element) return;
if (!autoFocusOnShow) return;
queueMicrotask(() => {
if (hasFocus(element)) return;
if (!isFocusable(element)) return;
element.focus();
});
});
const tagName = useTagName(ref);
const nativeTabbable = focusable && isNativeTabbable(tagName);
const supportsDisabled = focusable && supportsDisabledAttribute(tagName);
const styleProp = props.style;
const style = (0,external_React_.useMemo)(() => {
if (trulyDisabled) {
return _3YLGPPWQ_spreadValues({ pointerEvents: "none" }, styleProp);
}
return styleProp;
}, [trulyDisabled, styleProp]);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
"data-focus-visible": focusable && focusVisible || void 0,
"data-autofocus": autoFocus || void 0,
"aria-disabled": disabled || void 0
}, props), {
ref: useMergeRefs(ref, autoFocusRef, props.ref),
style,
tabIndex: getTabIndex(
focusable,
trulyDisabled,
nativeTabbable,
supportsDisabled,
props.tabIndex
),
disabled: supportsDisabled && trulyDisabled ? true : void 0,
// TODO: Test Focusable contentEditable.
contentEditable: disabled ? void 0 : props.contentEditable,
onKeyPressCapture,
onClickCapture,
onMouseDownCapture,
onMouseDown,
onKeyDownCapture,
onFocusCapture,
onBlur
});
return removeUndefinedValues(props);
}
);
var Focusable = forwardRef2(function Focusable2(props) {
const htmlProps = useFocusable(props);
return createElement(LVA2YJMS_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/ITI7HKP4.js
"use client";
// src/composite/composite.tsx
var ITI7HKP4_TagName = "div";
function isGrid(items) {
return items.some((item) => !!item.rowId);
}
function isPrintableKey(event) {
const target = event.target;
if (target && !isTextField(target)) return false;
return event.key.length === 1 && !event.ctrlKey && !event.metaKey;
}
function isModifierKey(event) {
return event.key === "Shift" || event.key === "Control" || event.key === "Alt" || event.key === "Meta";
}
function useKeyboardEventProxy(store, onKeyboardEvent, previousElementRef) {
return useEvent((event) => {
var _a;
onKeyboardEvent == null ? void 0 : onKeyboardEvent(event);
if (event.defaultPrevented) return;
if (event.isPropagationStopped()) return;
if (!isSelfTarget(event)) return;
if (isModifierKey(event)) return;
if (isPrintableKey(event)) return;
const state = store.getState();
const activeElement = (_a = getEnabledItem(store, state.activeId)) == null ? void 0 : _a.element;
if (!activeElement) return;
const _b = event, { view } = _b, eventInit = __objRest(_b, ["view"]);
const previousElement = previousElementRef == null ? void 0 : previousElementRef.current;
if (activeElement !== previousElement) {
activeElement.focus();
}
if (!fireKeyboardEvent(activeElement, event.type, eventInit)) {
event.preventDefault();
}
if (event.currentTarget.contains(activeElement)) {
event.stopPropagation();
}
});
}
function findFirstEnabledItemInTheLastRow(items) {
return _5VQZOHHZ_findFirstEnabledItem(
flatten2DArray(reverseArray(_5VQZOHHZ_groupItemsByRows(items)))
);
}
function useScheduleFocus(store) {
const [scheduled, setScheduled] = (0,external_React_.useState)(false);
const schedule = (0,external_React_.useCallback)(() => setScheduled(true), []);
const activeItem = store.useState(
(state) => getEnabledItem(store, state.activeId)
);
(0,external_React_.useEffect)(() => {
const activeElement = activeItem == null ? void 0 : activeItem.element;
if (!scheduled) return;
if (!activeElement) return;
setScheduled(false);
activeElement.focus({ preventScroll: true });
}, [activeItem, scheduled]);
return schedule;
}
var useComposite = createHook(
function useComposite2(_a) {
var _b = _a, {
store,
composite = true,
focusOnMove = composite,
moveOnKeyPress = true
} = _b, props = __objRest(_b, [
"store",
"composite",
"focusOnMove",
"moveOnKeyPress"
]);
const context = useCompositeProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const ref = (0,external_React_.useRef)(null);
const previousElementRef = (0,external_React_.useRef)(null);
const scheduleFocus = useScheduleFocus(store);
const moves = store.useState("moves");
const [, setBaseElement] = useTransactionState(
composite ? store.setBaseElement : null
);
(0,external_React_.useEffect)(() => {
var _a2;
if (!store) return;
if (!moves) return;
if (!composite) return;
if (!focusOnMove) return;
const { activeId: activeId2 } = store.getState();
const itemElement = (_a2 = getEnabledItem(store, activeId2)) == null ? void 0 : _a2.element;
if (!itemElement) return;
focusIntoView(itemElement);
}, [store, moves, composite, focusOnMove]);
useSafeLayoutEffect(() => {
if (!store) return;
if (!moves) return;
if (!composite) return;
const { baseElement, activeId: activeId2 } = store.getState();
const isSelfAcive = activeId2 === null;
if (!isSelfAcive) return;
if (!baseElement) return;
const previousElement = previousElementRef.current;
previousElementRef.current = null;
if (previousElement) {
fireBlurEvent(previousElement, { relatedTarget: baseElement });
}
if (!hasFocus(baseElement)) {
baseElement.focus();
}
}, [store, moves, composite]);
const activeId = store.useState("activeId");
const virtualFocus = store.useState("virtualFocus");
useSafeLayoutEffect(() => {
var _a2;
if (!store) return;
if (!composite) return;
if (!virtualFocus) return;
const previousElement = previousElementRef.current;
previousElementRef.current = null;
if (!previousElement) return;
const activeElement = (_a2 = getEnabledItem(store, activeId)) == null ? void 0 : _a2.element;
const relatedTarget = activeElement || DTR5TSDJ_getActiveElement(previousElement);
if (relatedTarget === previousElement) return;
fireBlurEvent(previousElement, { relatedTarget });
}, [store, activeId, virtualFocus, composite]);
const onKeyDownCapture = useKeyboardEventProxy(
store,
props.onKeyDownCapture,
previousElementRef
);
const onKeyUpCapture = useKeyboardEventProxy(
store,
props.onKeyUpCapture,
previousElementRef
);
const onFocusCaptureProp = props.onFocusCapture;
const onFocusCapture = useEvent((event) => {
onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event);
if (event.defaultPrevented) return;
if (!store) return;
const { virtualFocus: virtualFocus2 } = store.getState();
if (!virtualFocus2) return;
const previousActiveElement = event.relatedTarget;
const isSilentlyFocused = silentlyFocused(event.currentTarget);
if (isSelfTarget(event) && isSilentlyFocused) {
event.stopPropagation();
previousElementRef.current = previousActiveElement;
}
});
const onFocusProp = props.onFocus;
const onFocus = useEvent((event) => {
onFocusProp == null ? void 0 : onFocusProp(event);
if (event.defaultPrevented) return;
if (!composite) return;
if (!store) return;
const { relatedTarget } = event;
const { virtualFocus: virtualFocus2 } = store.getState();
if (virtualFocus2) {
if (isSelfTarget(event) && !isItem(store, relatedTarget)) {
queueMicrotask(scheduleFocus);
}
} else if (isSelfTarget(event)) {
store.setActiveId(null);
}
});
const onBlurCaptureProp = props.onBlurCapture;
const onBlurCapture = useEvent((event) => {
var _a2;
onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event);
if (event.defaultPrevented) return;
if (!store) return;
const { virtualFocus: virtualFocus2, activeId: activeId2 } = store.getState();
if (!virtualFocus2) return;
const activeElement = (_a2 = getEnabledItem(store, activeId2)) == null ? void 0 : _a2.element;
const nextActiveElement = event.relatedTarget;
const nextActiveElementIsItem = isItem(store, nextActiveElement);
const previousElement = previousElementRef.current;
previousElementRef.current = null;
if (isSelfTarget(event) && nextActiveElementIsItem) {
if (nextActiveElement === activeElement) {
if (previousElement && previousElement !== nextActiveElement) {
fireBlurEvent(previousElement, event);
}
} else if (activeElement) {
fireBlurEvent(activeElement, event);
} else if (previousElement) {
fireBlurEvent(previousElement, event);
}
event.stopPropagation();
} else {
const targetIsItem = isItem(store, event.target);
if (!targetIsItem && activeElement) {
fireBlurEvent(activeElement, event);
}
}
});
const onKeyDownProp = props.onKeyDown;
const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
const onKeyDown = useEvent((event) => {
var _a2;
onKeyDownProp == null ? void 0 : onKeyDownProp(event);
if (event.defaultPrevented) return;
if (!store) return;
if (!isSelfTarget(event)) return;
const { orientation, renderedItems, activeId: activeId2 } = store.getState();
const activeItem = getEnabledItem(store, activeId2);
if ((_a2 = activeItem == null ? void 0 : activeItem.element) == null ? void 0 : _a2.isConnected) return;
const isVertical = orientation !== "horizontal";
const isHorizontal = orientation !== "vertical";
const grid = isGrid(renderedItems);
const isHorizontalKey = event.key === "ArrowLeft" || event.key === "ArrowRight" || event.key === "Home" || event.key === "End";
if (isHorizontalKey && isTextField(event.currentTarget)) return;
const up = () => {
if (grid) {
const item = findFirstEnabledItemInTheLastRow(renderedItems);
return item == null ? void 0 : item.id;
}
return store == null ? void 0 : store.last();
};
const keyMap = {
ArrowUp: (grid || isVertical) && up,
ArrowRight: (grid || isHorizontal) && store.first,
ArrowDown: (grid || isVertical) && store.first,
ArrowLeft: (grid || isHorizontal) && store.last,
Home: store.first,
End: store.last,
PageUp: store.first,
PageDown: store.last
};
const action = keyMap[event.key];
if (action) {
const id = action();
if (id !== void 0) {
if (!moveOnKeyPressProp(event)) return;
event.preventDefault();
store.move(id);
}
}
});
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeContextProvider, { value: store, children: element }),
[store]
);
const activeDescendant = store.useState((state) => {
var _a2;
if (!store) return;
if (!composite) return;
if (!state.virtualFocus) return;
return (_a2 = getEnabledItem(store, state.activeId)) == null ? void 0 : _a2.id;
});
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
"aria-activedescendant": activeDescendant
}, props), {
ref: useMergeRefs(ref, setBaseElement, props.ref),
onKeyDownCapture,
onKeyUpCapture,
onFocusCapture,
onFocus,
onBlurCapture,
onKeyDown
});
const focusable = store.useState(
(state) => composite && (state.virtualFocus || state.activeId === null)
);
props = useFocusable(_3YLGPPWQ_spreadValues({ focusable }, props));
return props;
}
);
var Composite = forwardRef2(function Composite2(props) {
const htmlProps = useComposite(props);
return createElement(ITI7HKP4_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/combobox/combobox.js
"use client";
// src/combobox/combobox.tsx
var combobox_TagName = "input";
function isFirstItemAutoSelected(items, activeValue, autoSelect) {
if (!autoSelect) return false;
const firstItem = items.find((item) => !item.disabled && item.value);
return (firstItem == null ? void 0 : firstItem.value) === activeValue;
}
function hasCompletionString(value, activeValue) {
if (!activeValue) return false;
if (value == null) return false;
value = PBFD2E7P_normalizeString(value);
return activeValue.length > value.length && activeValue.toLowerCase().indexOf(value.toLowerCase()) === 0;
}
function isInputEvent(event) {
return event.type === "input";
}
function isAriaAutoCompleteValue(value) {
return value === "inline" || value === "list" || value === "both" || value === "none";
}
function getDefaultAutoSelectId(items) {
const item = items.find((item2) => {
var _a;
if (item2.disabled) return false;
return ((_a = item2.element) == null ? void 0 : _a.getAttribute("role")) !== "tab";
});
return item == null ? void 0 : item.id;
}
var useCombobox = createHook(
function useCombobox2(_a) {
var _b = _a, {
store,
focusable = true,
autoSelect: autoSelectProp = false,
getAutoSelectId,
setValueOnChange,
showMinLength = 0,
showOnChange,
showOnMouseDown,
showOnClick = showOnMouseDown,
showOnKeyDown,
showOnKeyPress = showOnKeyDown,
blurActiveItemOnClick,
setValueOnClick = true,
moveOnKeyPress = true,
autoComplete = "list"
} = _b, props = __objRest(_b, [
"store",
"focusable",
"autoSelect",
"getAutoSelectId",
"setValueOnChange",
"showMinLength",
"showOnChange",
"showOnMouseDown",
"showOnClick",
"showOnKeyDown",
"showOnKeyPress",
"blurActiveItemOnClick",
"setValueOnClick",
"moveOnKeyPress",
"autoComplete"
]);
const context = useComboboxProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const ref = (0,external_React_.useRef)(null);
const [valueUpdated, forceValueUpdate] = useForceUpdate();
const canAutoSelectRef = (0,external_React_.useRef)(false);
const composingRef = (0,external_React_.useRef)(false);
const autoSelect = store.useState(
(state) => state.virtualFocus && autoSelectProp
);
const inline = autoComplete === "inline" || autoComplete === "both";
const [canInline, setCanInline] = (0,external_React_.useState)(inline);
useUpdateLayoutEffect(() => {
if (!inline) return;
setCanInline(true);
}, [inline]);
const storeValue = store.useState("value");
const prevSelectedValueRef = (0,external_React_.useRef)();
(0,external_React_.useEffect)(() => {
return sync(store, ["selectedValue", "activeId"], (_, prev) => {
prevSelectedValueRef.current = prev.selectedValue;
});
}, []);
const inlineActiveValue = store.useState((state) => {
var _a2;
if (!inline) return;
if (!canInline) return;
if (state.activeValue && Array.isArray(state.selectedValue)) {
if (state.selectedValue.includes(state.activeValue)) return;
if ((_a2 = prevSelectedValueRef.current) == null ? void 0 : _a2.includes(state.activeValue)) return;
}
return state.activeValue;
});
const items = store.useState("renderedItems");
const open = store.useState("open");
const contentElement = store.useState("contentElement");
const value = (0,external_React_.useMemo)(() => {
if (!inline) return storeValue;
if (!canInline) return storeValue;
const firstItemAutoSelected = isFirstItemAutoSelected(
items,
inlineActiveValue,
autoSelect
);
if (firstItemAutoSelected) {
if (hasCompletionString(storeValue, inlineActiveValue)) {
const slice = (inlineActiveValue == null ? void 0 : inlineActiveValue.slice(storeValue.length)) || "";
return storeValue + slice;
}
return storeValue;
}
return inlineActiveValue || storeValue;
}, [inline, canInline, items, inlineActiveValue, autoSelect, storeValue]);
(0,external_React_.useEffect)(() => {
const element = ref.current;
if (!element) return;
const onCompositeItemMove = () => setCanInline(true);
element.addEventListener("combobox-item-move", onCompositeItemMove);
return () => {
element.removeEventListener("combobox-item-move", onCompositeItemMove);
};
}, []);
(0,external_React_.useEffect)(() => {
if (!inline) return;
if (!canInline) return;
if (!inlineActiveValue) return;
const firstItemAutoSelected = isFirstItemAutoSelected(
items,
inlineActiveValue,
autoSelect
);
if (!firstItemAutoSelected) return;
if (!hasCompletionString(storeValue, inlineActiveValue)) return;
let cleanup = PBFD2E7P_noop;
queueMicrotask(() => {
const element = ref.current;
if (!element) return;
const { start: prevStart, end: prevEnd } = getTextboxSelection(element);
const nextStart = storeValue.length;
const nextEnd = inlineActiveValue.length;
setSelectionRange(element, nextStart, nextEnd);
cleanup = () => {
if (!hasFocus(element)) return;
const { start, end } = getTextboxSelection(element);
if (start !== nextStart) return;
if (end !== nextEnd) return;
setSelectionRange(element, prevStart, prevEnd);
};
});
return () => cleanup();
}, [
valueUpdated,
inline,
canInline,
inlineActiveValue,
items,
autoSelect,
storeValue
]);
const scrollingElementRef = (0,external_React_.useRef)(null);
const getAutoSelectIdProp = useEvent(getAutoSelectId);
const autoSelectIdRef = (0,external_React_.useRef)(null);
(0,external_React_.useEffect)(() => {
if (!open) return;
if (!contentElement) return;
const scrollingElement = getScrollingElement(contentElement);
if (!scrollingElement) return;
scrollingElementRef.current = scrollingElement;
const onUserScroll = () => {
canAutoSelectRef.current = false;
};
const onScroll = () => {
if (!store) return;
if (!canAutoSelectRef.current) return;
const { activeId } = store.getState();
if (activeId === null) return;
if (activeId === autoSelectIdRef.current) return;
canAutoSelectRef.current = false;
};
const options = { passive: true, capture: true };
scrollingElement.addEventListener("wheel", onUserScroll, options);
scrollingElement.addEventListener("touchmove", onUserScroll, options);
scrollingElement.addEventListener("scroll", onScroll, options);
return () => {
scrollingElement.removeEventListener("wheel", onUserScroll, true);
scrollingElement.removeEventListener("touchmove", onUserScroll, true);
scrollingElement.removeEventListener("scroll", onScroll, true);
};
}, [open, contentElement, store]);
useSafeLayoutEffect(() => {
if (!storeValue) return;
if (composingRef.current) return;
canAutoSelectRef.current = true;
}, [storeValue]);
useSafeLayoutEffect(() => {
if (autoSelect !== "always" && open) return;
canAutoSelectRef.current = open;
}, [autoSelect, open]);
const resetValueOnSelect = store.useState("resetValueOnSelect");
useUpdateEffect(() => {
var _a2, _b2;
const canAutoSelect = canAutoSelectRef.current;
if (!store) return;
if (!open) return;
if (!canAutoSelect && !resetValueOnSelect) return;
const { baseElement, contentElement: contentElement2, activeId } = store.getState();
if (baseElement && !hasFocus(baseElement)) return;
if (contentElement2 == null ? void 0 : contentElement2.hasAttribute("data-placing")) {
const observer = new MutationObserver(forceValueUpdate);
observer.observe(contentElement2, { attributeFilter: ["data-placing"] });
return () => observer.disconnect();
}
if (autoSelect && canAutoSelect) {
const userAutoSelectId = getAutoSelectIdProp(items);
const autoSelectId = userAutoSelectId !== void 0 ? userAutoSelectId : (_a2 = getDefaultAutoSelectId(items)) != null ? _a2 : store.first();
autoSelectIdRef.current = autoSelectId;
store.move(autoSelectId != null ? autoSelectId : null);
} else {
const element = (_b2 = store.item(activeId || store.first())) == null ? void 0 : _b2.element;
if (element && "scrollIntoView" in element) {
element.scrollIntoView({ block: "nearest", inline: "nearest" });
}
}
return;
}, [
store,
open,
valueUpdated,
storeValue,
autoSelect,
resetValueOnSelect,
getAutoSelectIdProp,
items
]);
(0,external_React_.useEffect)(() => {
if (!inline) return;
const combobox = ref.current;
if (!combobox) return;
const elements = [combobox, contentElement].filter(
(value2) => !!value2
);
const onBlur2 = (event) => {
if (elements.every((el) => isFocusEventOutside(event, el))) {
store == null ? void 0 : store.setValue(value);
}
};
for (const element of elements) {
element.addEventListener("focusout", onBlur2);
}
return () => {
for (const element of elements) {
element.removeEventListener("focusout", onBlur2);
}
};
}, [inline, contentElement, store, value]);
const canShow = (event) => {
const currentTarget = event.currentTarget;
return currentTarget.value.length >= showMinLength;
};
const onChangeProp = props.onChange;
const showOnChangeProp = useBooleanEvent(showOnChange != null ? showOnChange : canShow);
const setValueOnChangeProp = useBooleanEvent(
// If the combobox is combined with tags, the value will be set by the tag
// input component.
setValueOnChange != null ? setValueOnChange : !store.tag
);
const onChange = useEvent((event) => {
onChangeProp == null ? void 0 : onChangeProp(event);
if (event.defaultPrevented) return;
if (!store) return;
const currentTarget = event.currentTarget;
const { value: value2, selectionStart, selectionEnd } = currentTarget;
const nativeEvent = event.nativeEvent;
canAutoSelectRef.current = true;
if (isInputEvent(nativeEvent)) {
if (nativeEvent.isComposing) {
canAutoSelectRef.current = false;
composingRef.current = true;
}
if (inline) {
const textInserted = nativeEvent.inputType === "insertText" || nativeEvent.inputType === "insertCompositionText";
const caretAtEnd = selectionStart === value2.length;
setCanInline(textInserted && caretAtEnd);
}
}
if (setValueOnChangeProp(event)) {
const isSameValue = value2 === store.getState().value;
store.setValue(value2);
queueMicrotask(() => {
setSelectionRange(currentTarget, selectionStart, selectionEnd);
});
if (inline && autoSelect && isSameValue) {
forceValueUpdate();
}
}
if (showOnChangeProp(event)) {
store.show();
}
if (!autoSelect || !canAutoSelectRef.current) {
store.setActiveId(null);
}
});
const onCompositionEndProp = props.onCompositionEnd;
const onCompositionEnd = useEvent((event) => {
canAutoSelectRef.current = true;
composingRef.current = false;
onCompositionEndProp == null ? void 0 : onCompositionEndProp(event);
if (event.defaultPrevented) return;
if (!autoSelect) return;
forceValueUpdate();
});
const onMouseDownProp = props.onMouseDown;
const blurActiveItemOnClickProp = useBooleanEvent(
blurActiveItemOnClick != null ? blurActiveItemOnClick : () => !!(store == null ? void 0 : store.getState().includesBaseElement)
);
const setValueOnClickProp = useBooleanEvent(setValueOnClick);
const showOnClickProp = useBooleanEvent(showOnClick != null ? showOnClick : canShow);
const onMouseDown = useEvent((event) => {
onMouseDownProp == null ? void 0 : onMouseDownProp(event);
if (event.defaultPrevented) return;
if (event.button) return;
if (event.ctrlKey) return;
if (!store) return;
if (blurActiveItemOnClickProp(event)) {
store.setActiveId(null);
}
if (setValueOnClickProp(event)) {
store.setValue(value);
}
if (showOnClickProp(event)) {
queueBeforeEvent(event.currentTarget, "mouseup", store.show);
}
});
const onKeyDownProp = props.onKeyDown;
const showOnKeyPressProp = useBooleanEvent(showOnKeyPress != null ? showOnKeyPress : canShow);
const onKeyDown = useEvent((event) => {
onKeyDownProp == null ? void 0 : onKeyDownProp(event);
if (!event.repeat) {
canAutoSelectRef.current = false;
}
if (event.defaultPrevented) return;
if (event.ctrlKey) return;
if (event.altKey) return;
if (event.shiftKey) return;
if (event.metaKey) return;
if (!store) return;
const { open: open2 } = store.getState();
if (open2) return;
if (event.key === "ArrowUp" || event.key === "ArrowDown") {
if (showOnKeyPressProp(event)) {
event.preventDefault();
store.show();
}
}
});
const onBlurProp = props.onBlur;
const onBlur = useEvent((event) => {
canAutoSelectRef.current = false;
onBlurProp == null ? void 0 : onBlurProp(event);
if (event.defaultPrevented) return;
});
const id = useId(props.id);
const ariaAutoComplete = isAriaAutoCompleteValue(autoComplete) ? autoComplete : void 0;
const isActiveItem = store.useState((state) => state.activeId === null);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
id,
role: "combobox",
"aria-autocomplete": ariaAutoComplete,
"aria-haspopup": getPopupRole(contentElement, "listbox"),
"aria-expanded": open,
"aria-controls": contentElement == null ? void 0 : contentElement.id,
"data-active-item": isActiveItem || void 0,
value
}, props), {
ref: useMergeRefs(ref, props.ref),
onChange,
onCompositionEnd,
onMouseDown,
onKeyDown,
onBlur
});
props = useComposite(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
store,
focusable
}, props), {
// Enable inline autocomplete when the user moves from the combobox input
// to an item.
moveOnKeyPress: (event) => {
if (isFalsyBooleanCallback(moveOnKeyPress, event)) return false;
if (inline) setCanInline(true);
return true;
}
}));
props = usePopoverAnchor(_3YLGPPWQ_spreadValues({ store }, props));
return _3YLGPPWQ_spreadValues({ autoComplete: "off" }, props);
}
);
var Combobox = forwardRef2(function Combobox2(props) {
const htmlProps = useCombobox(props);
return createElement(combobox_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/VGCJ63VH.js
"use client";
// src/disclosure/disclosure-content.tsx
var VGCJ63VH_TagName = "div";
function afterTimeout(timeoutMs, cb) {
const timeoutId = setTimeout(cb, timeoutMs);
return () => clearTimeout(timeoutId);
}
function VGCJ63VH_afterPaint(cb) {
let raf = requestAnimationFrame(() => {
raf = requestAnimationFrame(cb);
});
return () => cancelAnimationFrame(raf);
}
function parseCSSTime(...times) {
return times.join(", ").split(", ").reduce((longestTime, currentTimeString) => {
const multiplier = currentTimeString.endsWith("ms") ? 1 : 1e3;
const currentTime = Number.parseFloat(currentTimeString || "0s") * multiplier;
if (currentTime > longestTime) return currentTime;
return longestTime;
}, 0);
}
function isHidden(mounted, hidden, alwaysVisible) {
return !alwaysVisible && hidden !== false && (!mounted || !!hidden);
}
var useDisclosureContent = createHook(function useDisclosureContent2(_a) {
var _b = _a, { store, alwaysVisible } = _b, props = __objRest(_b, ["store", "alwaysVisible"]);
const context = useDisclosureProviderContext();
store = store || context;
invariant(
store,
false && 0
);
const ref = (0,external_React_.useRef)(null);
const id = useId(props.id);
const [transition, setTransition] = (0,external_React_.useState)(null);
const open = store.useState("open");
const mounted = store.useState("mounted");
const animated = store.useState("animated");
const contentElement = store.useState("contentElement");
const otherElement = useStoreState(store.disclosure, "contentElement");
useSafeLayoutEffect(() => {
if (!ref.current) return;
store == null ? void 0 : store.setContentElement(ref.current);
}, [store]);
useSafeLayoutEffect(() => {
let previousAnimated;
store == null ? void 0 : store.setState("animated", (animated2) => {
previousAnimated = animated2;
return true;
});
return () => {
if (previousAnimated === void 0) return;
store == null ? void 0 : store.setState("animated", previousAnimated);
};
}, [store]);
useSafeLayoutEffect(() => {
if (!animated) return;
if (!(contentElement == null ? void 0 : contentElement.isConnected)) {
setTransition(null);
return;
}
return VGCJ63VH_afterPaint(() => {
setTransition(open ? "enter" : mounted ? "leave" : null);
});
}, [animated, contentElement, open, mounted]);
useSafeLayoutEffect(() => {
if (!store) return;
if (!animated) return;
if (!transition) return;
if (!contentElement) return;
const stopAnimation = () => store == null ? void 0 : store.setState("animating", false);
const stopAnimationSync = () => (0,external_ReactDOM_namespaceObject.flushSync)(stopAnimation);
if (transition === "leave" && open) return;
if (transition === "enter" && !open) return;
if (typeof animated === "number") {
const timeout2 = animated;
return afterTimeout(timeout2, stopAnimationSync);
}
const {
transitionDuration,
animationDuration,
transitionDelay,
animationDelay
} = getComputedStyle(contentElement);
const {
transitionDuration: transitionDuration2 = "0",
animationDuration: animationDuration2 = "0",
transitionDelay: transitionDelay2 = "0",
animationDelay: animationDelay2 = "0"
} = otherElement ? getComputedStyle(otherElement) : {};
const delay = parseCSSTime(
transitionDelay,
animationDelay,
transitionDelay2,
animationDelay2
);
const duration = parseCSSTime(
transitionDuration,
animationDuration,
transitionDuration2,
animationDuration2
);
const timeout = delay + duration;
if (!timeout) {
if (transition === "enter") {
store.setState("animated", false);
}
stopAnimation();
return;
}
const frameRate = 1e3 / 60;
const maxTimeout = Math.max(timeout - frameRate, 0);
return afterTimeout(maxTimeout, stopAnimationSync);
}, [store, animated, contentElement, otherElement, open, transition]);
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogScopedContextProvider, { value: store, children: element }),
[store]
);
const hidden = isHidden(mounted, props.hidden, alwaysVisible);
const styleProp = props.style;
const style = (0,external_React_.useMemo)(() => {
if (hidden) {
return _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, styleProp), { display: "none" });
}
return styleProp;
}, [hidden, styleProp]);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
id,
"data-open": open || void 0,
"data-enter": transition === "enter" || void 0,
"data-leave": transition === "leave" || void 0,
hidden
}, props), {
ref: useMergeRefs(id ? store.setContentElement : null, ref, props.ref),
style
});
return removeUndefinedValues(props);
});
var DisclosureContentImpl = forwardRef2(function DisclosureContentImpl2(props) {
const htmlProps = useDisclosureContent(props);
return createElement(VGCJ63VH_TagName, htmlProps);
});
var DisclosureContent = forwardRef2(function DisclosureContent2(_a) {
var _b = _a, {
unmountOnHide
} = _b, props = __objRest(_b, [
"unmountOnHide"
]);
const context = useDisclosureProviderContext();
const store = props.store || context;
const mounted = useStoreState(
store,
(state) => !unmountOnHide || (state == null ? void 0 : state.mounted)
);
if (mounted === false) return null;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DisclosureContentImpl, _3YLGPPWQ_spreadValues({}, props));
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/HUWAI7RB.js
"use client";
// src/combobox/combobox-list.tsx
var HUWAI7RB_TagName = "div";
var useComboboxList = createHook(
function useComboboxList2(_a) {
var _b = _a, { store, alwaysVisible } = _b, props = __objRest(_b, ["store", "alwaysVisible"]);
const scopedContext = useComboboxScopedContext(true);
const context = useComboboxContext();
store = store || context;
const scopedContextSameStore = !!store && store === scopedContext;
invariant(
store,
false && 0
);
const ref = (0,external_React_.useRef)(null);
const id = useId(props.id);
const mounted = store.useState("mounted");
const hidden = isHidden(mounted, props.hidden, alwaysVisible);
const style = hidden ? _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props.style), { display: "none" }) : props.style;
const multiSelectable = store.useState(
(state) => Array.isArray(state.selectedValue)
);
const role = useAttribute(ref, "role", props.role);
const isCompositeRole = role === "listbox" || role === "tree" || role === "grid";
const ariaMultiSelectable = isCompositeRole ? multiSelectable || void 0 : void 0;
const [hasListboxInside, setHasListboxInside] = (0,external_React_.useState)(false);
const contentElement = store.useState("contentElement");
useSafeLayoutEffect(() => {
if (!mounted) return;
const element = ref.current;
if (!element) return;
if (contentElement !== element) return;
const callback = () => {
setHasListboxInside(!!element.querySelector("[role='listbox']"));
};
const observer = new MutationObserver(callback);
observer.observe(element, {
subtree: true,
childList: true,
attributeFilter: ["role"]
});
callback();
return () => observer.disconnect();
}, [mounted, contentElement]);
if (!hasListboxInside) {
props = _3YLGPPWQ_spreadValues({
role: "listbox",
"aria-multiselectable": ariaMultiSelectable
}, props);
}
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ComboboxScopedContextProvider, { value: store, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ComboboxListRoleContext.Provider, { value: role, children: element }) }),
[store, role]
);
const setContentElement = id && (!scopedContext || !scopedContextSameStore) ? store.setContentElement : null;
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
id,
hidden
}, props), {
ref: useMergeRefs(setContentElement, ref, props.ref),
style
});
return removeUndefinedValues(props);
}
);
var ComboboxList = forwardRef2(function ComboboxList2(props) {
const htmlProps = useComboboxList(props);
return createElement(HUWAI7RB_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/UQQRIHDV.js
"use client";
// src/composite/composite-hover.tsx
var UQQRIHDV_TagName = "div";
function getMouseDestination(event) {
const relatedTarget = event.relatedTarget;
if ((relatedTarget == null ? void 0 : relatedTarget.nodeType) === Node.ELEMENT_NODE) {
return relatedTarget;
}
return null;
}
function hoveringInside(event) {
const nextElement = getMouseDestination(event);
if (!nextElement) return false;
return contains(event.currentTarget, nextElement);
}
var symbol = Symbol("composite-hover");
function movingToAnotherItem(event) {
let dest = getMouseDestination(event);
if (!dest) return false;
do {
if (PBFD2E7P_hasOwnProperty(dest, symbol) && dest[symbol]) return true;
dest = dest.parentElement;
} while (dest);
return false;
}
var useCompositeHover = createHook(
function useCompositeHover2(_a) {
var _b = _a, {
store,
focusOnHover = true,
blurOnHoverEnd = !!focusOnHover
} = _b, props = __objRest(_b, [
"store",
"focusOnHover",
"blurOnHoverEnd"
]);
const context = useCompositeContext();
store = store || context;
invariant(
store,
false && 0
);
const isMouseMoving = useIsMouseMoving();
const onMouseMoveProp = props.onMouseMove;
const focusOnHoverProp = useBooleanEvent(focusOnHover);
const onMouseMove = useEvent((event) => {
onMouseMoveProp == null ? void 0 : onMouseMoveProp(event);
if (event.defaultPrevented) return;
if (!isMouseMoving()) return;
if (!focusOnHoverProp(event)) return;
if (!hasFocusWithin(event.currentTarget)) {
const baseElement = store == null ? void 0 : store.getState().baseElement;
if (baseElement && !hasFocus(baseElement)) {
baseElement.focus();
}
}
store == null ? void 0 : store.setActiveId(event.currentTarget.id);
});
const onMouseLeaveProp = props.onMouseLeave;
const blurOnHoverEndProp = useBooleanEvent(blurOnHoverEnd);
const onMouseLeave = useEvent((event) => {
var _a2;
onMouseLeaveProp == null ? void 0 : onMouseLeaveProp(event);
if (event.defaultPrevented) return;
if (!isMouseMoving()) return;
if (hoveringInside(event)) return;
if (movingToAnotherItem(event)) return;
if (!focusOnHoverProp(event)) return;
if (!blurOnHoverEndProp(event)) return;
store == null ? void 0 : store.setActiveId(null);
(_a2 = store == null ? void 0 : store.getState().baseElement) == null ? void 0 : _a2.focus();
});
const ref = (0,external_React_.useCallback)((element) => {
if (!element) return;
element[symbol] = true;
}, []);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
ref: useMergeRefs(ref, props.ref),
onMouseMove,
onMouseLeave
});
return removeUndefinedValues(props);
}
);
var CompositeHover = memo2(
forwardRef2(function CompositeHover2(props) {
const htmlProps = useCompositeHover(props);
return createElement(UQQRIHDV_TagName, htmlProps);
})
);
;// ./node_modules/@ariakit/react-core/esm/__chunks/RZ4GPYOB.js
"use client";
// src/collection/collection-item.tsx
var RZ4GPYOB_TagName = "div";
var useCollectionItem = createHook(
function useCollectionItem2(_a) {
var _b = _a, {
store,
shouldRegisterItem = true,
getItem = identity,
element: element
} = _b, props = __objRest(_b, [
"store",
"shouldRegisterItem",
"getItem",
// @ts-expect-error This prop may come from a collection renderer.
"element"
]);
const context = useCollectionContext();
store = store || context;
const id = useId(props.id);
const ref = (0,external_React_.useRef)(element);
(0,external_React_.useEffect)(() => {
const element2 = ref.current;
if (!id) return;
if (!element2) return;
if (!shouldRegisterItem) return;
const item = getItem({ id, element: element2 });
return store == null ? void 0 : store.renderItem(item);
}, [id, shouldRegisterItem, getItem, store]);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
ref: useMergeRefs(ref, props.ref)
});
return removeUndefinedValues(props);
}
);
var CollectionItem = forwardRef2(function CollectionItem2(props) {
const htmlProps = useCollectionItem(props);
return createElement(RZ4GPYOB_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/KUU7WJ55.js
"use client";
// src/command/command.tsx
var KUU7WJ55_TagName = "button";
function isNativeClick(event) {
if (!event.isTrusted) return false;
const element = event.currentTarget;
if (event.key === "Enter") {
return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "A";
}
if (event.key === " ") {
return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "INPUT" || element.tagName === "SELECT";
}
return false;
}
var KUU7WJ55_symbol = Symbol("command");
var useCommand = createHook(
function useCommand2(_a) {
var _b = _a, { clickOnEnter = true, clickOnSpace = true } = _b, props = __objRest(_b, ["clickOnEnter", "clickOnSpace"]);
const ref = (0,external_React_.useRef)(null);
const [isNativeButton, setIsNativeButton] = (0,external_React_.useState)(false);
(0,external_React_.useEffect)(() => {
if (!ref.current) return;
setIsNativeButton(isButton(ref.current));
}, []);
const [active, setActive] = (0,external_React_.useState)(false);
const activeRef = (0,external_React_.useRef)(false);
const disabled = disabledFromProps(props);
const [isDuplicate, metadataProps] = useMetadataProps(props, KUU7WJ55_symbol, true);
const onKeyDownProp = props.onKeyDown;
const onKeyDown = useEvent((event) => {
onKeyDownProp == null ? void 0 : onKeyDownProp(event);
const element = event.currentTarget;
if (event.defaultPrevented) return;
if (isDuplicate) return;
if (disabled) return;
if (!isSelfTarget(event)) return;
if (isTextField(element)) return;
if (element.isContentEditable) return;
const isEnter = clickOnEnter && event.key === "Enter";
const isSpace = clickOnSpace && event.key === " ";
const shouldPreventEnter = event.key === "Enter" && !clickOnEnter;
const shouldPreventSpace = event.key === " " && !clickOnSpace;
if (shouldPreventEnter || shouldPreventSpace) {
event.preventDefault();
return;
}
if (isEnter || isSpace) {
const nativeClick = isNativeClick(event);
if (isEnter) {
if (!nativeClick) {
event.preventDefault();
const _a2 = event, { view } = _a2, eventInit = __objRest(_a2, ["view"]);
const click = () => fireClickEvent(element, eventInit);
if (isFirefox()) {
queueBeforeEvent(element, "keyup", click);
} else {
queueMicrotask(click);
}
}
} else if (isSpace) {
activeRef.current = true;
if (!nativeClick) {
event.preventDefault();
setActive(true);
}
}
}
});
const onKeyUpProp = props.onKeyUp;
const onKeyUp = useEvent((event) => {
onKeyUpProp == null ? void 0 : onKeyUpProp(event);
if (event.defaultPrevented) return;
if (isDuplicate) return;
if (disabled) return;
if (event.metaKey) return;
const isSpace = clickOnSpace && event.key === " ";
if (activeRef.current && isSpace) {
activeRef.current = false;
if (!isNativeClick(event)) {
event.preventDefault();
setActive(false);
const element = event.currentTarget;
const _a2 = event, { view } = _a2, eventInit = __objRest(_a2, ["view"]);
queueMicrotask(() => fireClickEvent(element, eventInit));
}
}
});
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues(_3YLGPPWQ_spreadValues({
"data-active": active || void 0,
type: isNativeButton ? "button" : void 0
}, metadataProps), props), {
ref: useMergeRefs(ref, props.ref),
onKeyDown,
onKeyUp
});
props = useFocusable(props);
return props;
}
);
var Command = forwardRef2(function Command2(props) {
const htmlProps = useCommand(props);
return createElement(KUU7WJ55_TagName, htmlProps);
});
;// ./node_modules/@ariakit/react-core/esm/__chunks/P2CTZE2T.js
"use client";
// src/composite/composite-item.tsx
var P2CTZE2T_TagName = "button";
function isEditableElement(element) {
if (isTextbox(element)) return true;
return element.tagName === "INPUT" && !isButton(element);
}
function getNextPageOffset(scrollingElement, pageUp = false) {
const height = scrollingElement.clientHeight;
const { top } = scrollingElement.getBoundingClientRect();
const pageSize = Math.max(height * 0.875, height - 40) * 1.5;
const pageOffset = pageUp ? height - pageSize + top : pageSize + top;
if (scrollingElement.tagName === "HTML") {
return pageOffset + scrollingElement.scrollTop;
}
return pageOffset;
}
function getItemOffset(itemElement, pageUp = false) {
const { top } = itemElement.getBoundingClientRect();
if (pageUp) {
return top + itemElement.clientHeight;
}
return top;
}
function findNextPageItemId(element, store, next, pageUp = false) {
var _a;
if (!store) return;
if (!next) return;
const { renderedItems } = store.getState();
const scrollingElement = getScrollingElement(element);
if (!scrollingElement) return;
const nextPageOffset = getNextPageOffset(scrollingElement, pageUp);
let id;
let prevDifference;
for (let i = 0; i < renderedItems.length; i += 1) {
const previousId = id;
id = next(i);
if (!id) break;
if (id === previousId) continue;
const itemElement = (_a = getEnabledItem(store, id)) == null ? void 0 : _a.element;
if (!itemElement) continue;
const itemOffset = getItemOffset(itemElement, pageUp);
const difference = itemOffset - nextPageOffset;
const absDifference = Math.abs(difference);
if (pageUp && difference <= 0 || !pageUp && difference >= 0) {
if (prevDifference !== void 0 && prevDifference < absDifference) {
id = previousId;
}
break;
}
prevDifference = absDifference;
}
return id;
}
function targetIsAnotherItem(event, store) {
if (isSelfTarget(event)) return false;
return isItem(store, event.target);
}
var useCompositeItem = createHook(
function useCompositeItem2(_a) {
var _b = _a, {
store,
rowId: rowIdProp,
preventScrollOnKeyDown = false,
moveOnKeyPress = true,
tabbable = false,
getItem: getItemProp,
"aria-setsize": ariaSetSizeProp,
"aria-posinset": ariaPosInSetProp
} = _b, props = __objRest(_b, [
"store",
"rowId",
"preventScrollOnKeyDown",
"moveOnKeyPress",
"tabbable",
"getItem",
"aria-setsize",
"aria-posinset"
]);
const context = useCompositeContext();
store = store || context;
const id = useId(props.id);
const ref = (0,external_React_.useRef)(null);
const row = (0,external_React_.useContext)(CompositeRowContext);
const disabled = disabledFromProps(props);
const trulyDisabled = disabled && !props.accessibleWhenDisabled;
const {
rowId,
baseElement,
isActiveItem,
ariaSetSize,
ariaPosInSet,
isTabbable
} = useStoreStateObject(store, {
rowId(state) {
if (rowIdProp) return rowIdProp;
if (!state) return;
if (!(row == null ? void 0 : row.baseElement)) return;
if (row.baseElement !== state.baseElement) return;
return row.id;
},
baseElement(state) {
return (state == null ? void 0 : state.baseElement) || void 0;
},
isActiveItem(state) {
return !!state && state.activeId === id;
},
ariaSetSize(state) {
if (ariaSetSizeProp != null) return ariaSetSizeProp;
if (!state) return;
if (!(row == null ? void 0 : row.ariaSetSize)) return;
if (row.baseElement !== state.baseElement) return;
return row.ariaSetSize;
},
ariaPosInSet(state) {
if (ariaPosInSetProp != null) return ariaPosInSetProp;
if (!state) return;
if (!(row == null ? void 0 : row.ariaPosInSet)) return;
if (row.baseElement !== state.baseElement) return;
const itemsInRow = state.renderedItems.filter(
(item) => item.rowId === rowId
);
return row.ariaPosInSet + itemsInRow.findIndex((item) => item.id === id);
},
isTabbable(state) {
if (!(state == null ? void 0 : state.renderedItems.length)) return true;
if (state.virtualFocus) return false;
if (tabbable) return true;
if (state.activeId === null) return false;
const item = store == null ? void 0 : store.item(state.activeId);
if (item == null ? void 0 : item.disabled) return true;
if (!(item == null ? void 0 : item.element)) return true;
return state.activeId === id;
}
});
const getItem = (0,external_React_.useCallback)(
(item) => {
var _a2;
const nextItem = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, item), {
id: id || item.id,
rowId,
disabled: !!trulyDisabled,
children: (_a2 = item.element) == null ? void 0 : _a2.textContent
});
if (getItemProp) {
return getItemProp(nextItem);
}
return nextItem;
},
[id, rowId, trulyDisabled, getItemProp]
);
const onFocusProp = props.onFocus;
const hasFocusedComposite = (0,external_React_.useRef)(false);
const onFocus = useEvent((event) => {
onFocusProp == null ? void 0 : onFocusProp(event);
if (event.defaultPrevented) return;
if (isPortalEvent(event)) return;
if (!id) return;
if (!store) return;
if (targetIsAnotherItem(event, store)) return;
const { virtualFocus, baseElement: baseElement2 } = store.getState();
store.setActiveId(id);
if (isTextbox(event.currentTarget)) {
selectTextField(event.currentTarget);
}
if (!virtualFocus) return;
if (!isSelfTarget(event)) return;
if (isEditableElement(event.currentTarget)) return;
if (!(baseElement2 == null ? void 0 : baseElement2.isConnected)) return;
if (isSafari() && event.currentTarget.hasAttribute("data-autofocus")) {
event.currentTarget.scrollIntoView({
block: "nearest",
inline: "nearest"
});
}
hasFocusedComposite.current = true;
const fromComposite = event.relatedTarget === baseElement2 || isItem(store, event.relatedTarget);
if (fromComposite) {
focusSilently(baseElement2);
} else {
baseElement2.focus();
}
});
const onBlurCaptureProp = props.onBlurCapture;
const onBlurCapture = useEvent((event) => {
onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event);
if (event.defaultPrevented) return;
const state = store == null ? void 0 : store.getState();
if ((state == null ? void 0 : state.virtualFocus) && hasFocusedComposite.current) {
hasFocusedComposite.current = false;
event.preventDefault();
event.stopPropagation();
}
});
const onKeyDownProp = props.onKeyDown;
const preventScrollOnKeyDownProp = useBooleanEvent(preventScrollOnKeyDown);
const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
const onKeyDown = useEvent((event) => {
onKeyDownProp == null ? void 0 : onKeyDownProp(event);
if (event.defaultPrevented) return;
if (!isSelfTarget(event)) return;
if (!store) return;
const { currentTarget } = event;
const state = store.getState();
const item = store.item(id);
const isGrid = !!(item == null ? void 0 : item.rowId);
const isVertical = state.orientation !== "horizontal";
const isHorizontal = state.orientation !== "vertical";
const canHomeEnd = () => {
if (isGrid) return true;
if (isHorizontal) return true;
if (!state.baseElement) return true;
if (!isTextField(state.baseElement)) return true;
return false;
};
const keyMap = {
ArrowUp: (isGrid || isVertical) && store.up,
ArrowRight: (isGrid || isHorizontal) && store.next,
ArrowDown: (isGrid || isVertical) && store.down,
ArrowLeft: (isGrid || isHorizontal) && store.previous,
Home: () => {
if (!canHomeEnd()) return;
if (!isGrid || event.ctrlKey) {
return store == null ? void 0 : store.first();
}
return store == null ? void 0 : store.previous(-1);
},
End: () => {
if (!canHomeEnd()) return;
if (!isGrid || event.ctrlKey) {
return store == null ? void 0 : store.last();
}
return store == null ? void 0 : store.next(-1);
},
PageUp: () => {
return findNextPageItemId(currentTarget, store, store == null ? void 0 : store.up, true);
},
PageDown: () => {
return findNextPageItemId(currentTarget, store, store == null ? void 0 : store.down);
}
};
const action = keyMap[event.key];
if (action) {
if (isTextbox(currentTarget)) {
const selection = getTextboxSelection(currentTarget);
const isLeft = isHorizontal && event.key === "ArrowLeft";
const isRight = isHorizontal && event.key === "ArrowRight";
const isUp = isVertical && event.key === "ArrowUp";
const isDown = isVertical && event.key === "ArrowDown";
if (isRight || isDown) {
const { length: valueLength } = getTextboxValue(currentTarget);
if (selection.end !== valueLength) return;
} else if ((isLeft || isUp) && selection.start !== 0) return;
}
const nextId = action();
if (preventScrollOnKeyDownProp(event) || nextId !== void 0) {
if (!moveOnKeyPressProp(event)) return;
event.preventDefault();
store.move(nextId);
}
}
});
const providerValue = (0,external_React_.useMemo)(
() => ({ id, baseElement }),
[id, baseElement]
);
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeItemContext.Provider, { value: providerValue, children: element }),
[providerValue]
);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
id,
"data-active-item": isActiveItem || void 0
}, props), {
ref: useMergeRefs(ref, props.ref),
tabIndex: isTabbable ? props.tabIndex : -1,
onFocus,
onBlurCapture,
onKeyDown
});
props = useCommand(props);
props = useCollectionItem(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
store
}, props), {
getItem,
shouldRegisterItem: id ? props.shouldRegisterItem : false
}));
return removeUndefinedValues(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
"aria-setsize": ariaSetSize,
"aria-posinset": ariaPosInSet
}));
}
);
var CompositeItem = memo2(
forwardRef2(function CompositeItem2(props) {
const htmlProps = useCompositeItem(props);
return createElement(P2CTZE2T_TagName, htmlProps);
})
);
;// ./node_modules/@ariakit/react-core/esm/__chunks/ZTDSJLD6.js
"use client";
// src/combobox/combobox-item.tsx
var ZTDSJLD6_TagName = "div";
function isSelected(storeValue, itemValue) {
if (itemValue == null) return;
if (storeValue == null) return false;
if (Array.isArray(storeValue)) {
return storeValue.includes(itemValue);
}
return storeValue === itemValue;
}
function getItemRole(popupRole) {
var _a;
const itemRoleByPopupRole = {
menu: "menuitem",
listbox: "option",
tree: "treeitem"
};
const key = popupRole;
return (_a = itemRoleByPopupRole[key]) != null ? _a : "option";
}
var useComboboxItem = createHook(
function useComboboxItem2(_a) {
var _b = _a, {
store,
value,
hideOnClick,
setValueOnClick,
selectValueOnClick = true,
resetValueOnSelect,
focusOnHover = false,
moveOnKeyPress = true,
getItem: getItemProp
} = _b, props = __objRest(_b, [
"store",
"value",
"hideOnClick",
"setValueOnClick",
"selectValueOnClick",
"resetValueOnSelect",
"focusOnHover",
"moveOnKeyPress",
"getItem"
]);
var _a2;
const context = useComboboxScopedContext();
store = store || context;
invariant(
store,
false && 0
);
const { resetValueOnSelectState, multiSelectable, selected } = useStoreStateObject(store, {
resetValueOnSelectState: "resetValueOnSelect",
multiSelectable(state) {
return Array.isArray(state.selectedValue);
},
selected(state) {
return isSelected(state.selectedValue, value);
}
});
const getItem = (0,external_React_.useCallback)(
(item) => {
const nextItem = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, item), { value });
if (getItemProp) {
return getItemProp(nextItem);
}
return nextItem;
},
[value, getItemProp]
);
setValueOnClick = setValueOnClick != null ? setValueOnClick : !multiSelectable;
hideOnClick = hideOnClick != null ? hideOnClick : value != null && !multiSelectable;
const onClickProp = props.onClick;
const setValueOnClickProp = useBooleanEvent(setValueOnClick);
const selectValueOnClickProp = useBooleanEvent(selectValueOnClick);
const resetValueOnSelectProp = useBooleanEvent(
(_a2 = resetValueOnSelect != null ? resetValueOnSelect : resetValueOnSelectState) != null ? _a2 : multiSelectable
);
const hideOnClickProp = useBooleanEvent(hideOnClick);
const onClick = useEvent((event) => {
onClickProp == null ? void 0 : onClickProp(event);
if (event.defaultPrevented) return;
if (isDownloading(event)) return;
if (isOpeningInNewTab(event)) return;
if (value != null) {
if (selectValueOnClickProp(event)) {
if (resetValueOnSelectProp(event)) {
store == null ? void 0 : store.resetValue();
}
store == null ? void 0 : store.setSelectedValue((prevValue) => {
if (!Array.isArray(prevValue)) return value;
if (prevValue.includes(value)) {
return prevValue.filter((v) => v !== value);
}
return [...prevValue, value];
});
}
if (setValueOnClickProp(event)) {
store == null ? void 0 : store.setValue(value);
}
}
if (hideOnClickProp(event)) {
store == null ? void 0 : store.hide();
}
});
const onKeyDownProp = props.onKeyDown;
const onKeyDown = useEvent((event) => {
onKeyDownProp == null ? void 0 : onKeyDownProp(event);
if (event.defaultPrevented) return;
const baseElement = store == null ? void 0 : store.getState().baseElement;
if (!baseElement) return;
if (hasFocus(baseElement)) return;
const printable = event.key.length === 1;
if (printable || event.key === "Backspace" || event.key === "Delete") {
queueMicrotask(() => baseElement.focus());
if (isTextField(baseElement)) {
store == null ? void 0 : store.setValue(baseElement.value);
}
}
});
if (multiSelectable && selected != null) {
props = _3YLGPPWQ_spreadValues({
"aria-selected": selected
}, props);
}
props = useWrapElement(
props,
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ComboboxItemValueContext.Provider, { value, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ComboboxItemCheckedContext.Provider, { value: selected != null ? selected : false, children: element }) }),
[value, selected]
);
const popupRole = (0,external_React_.useContext)(ComboboxListRoleContext);
props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
role: getItemRole(popupRole),
children: value
}, props), {
onClick,
onKeyDown
});
const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
props = useCompositeItem(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
store
}, props), {
getItem,
// Dispatch a custom event on the combobox input when moving to an item
// with the keyboard so the Combobox component can enable inline
// autocompletion.
moveOnKeyPress: (event) => {
if (!moveOnKeyPressProp(event)) return false;
const moveEvent = new Event("combobox-item-move");
const baseElement = store == null ? void 0 : store.getState().baseElement;
baseElement == null ? void 0 : baseElement.dispatchEvent(moveEvent);
return true;
}
}));
props = useCompositeHover(_3YLGPPWQ_spreadValues({ store, focusOnHover }, props));
return props;
}
);
var ComboboxItem = memo2(
forwardRef2(function ComboboxItem2(props) {
const htmlProps = useComboboxItem(props);
return createElement(ZTDSJLD6_TagName, htmlProps);
})
);
;// ./node_modules/@ariakit/react-core/esm/combobox/combobox-item-value.js
"use client";
// src/combobox/combobox-item-value.tsx
var combobox_item_value_TagName = "span";
function normalizeValue(value) {
return PBFD2E7P_normalizeString(value).toLowerCase();
}
function getOffsets(string, values) {
const offsets = [];
for (const value of values) {
let pos = 0;
const length = value.length;
while (string.indexOf(value, pos) !== -1) {
const index = string.indexOf(value, pos);
if (index !== -1) {
offsets.push([index, length]);
}
pos = index + 1;
}
}
return offsets;
}
function filterOverlappingOffsets(offsets) {
return offsets.filter(([offset, length], i, arr) => {
return !arr.some(
([o, l], j) => j !== i && o <= offset && o + l >= offset + length
);
});
}
function sortOffsets(offsets) {
return offsets.sort(([a], [b]) => a - b);
}
function splitValue(itemValue, userValue) {
if (!itemValue) return itemValue;
if (!userValue) return itemValue;
const userValues = toArray(userValue).filter(Boolean).map(normalizeValue);
const parts = [];
const span = (value, autocomplete = false) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
"data-autocomplete-value": autocomplete ? "" : void 0,
"data-user-value": autocomplete ? void 0 : "",
children: value
},
parts.length
);
const offsets = sortOffsets(
filterOverlappingOffsets(
// Convert userValues into a set to avoid duplicates
getOffsets(normalizeValue(itemValue), new Set(userValues))
)
);
if (!offsets.length) {
parts.push(span(itemValue, true));
return parts;
}
const [firstOffset] = offsets[0];
const values = [
itemValue.slice(0, firstOffset),
...offsets.flatMap(([offset, length], i) => {
var _a;
const value = itemValue.slice(offset, offset + length);
const nextOffset = (_a = offsets[i + 1]) == null ? void 0 : _a[0];
const nextValue = itemValue.slice(offset + length, nextOffset);
return [value, nextValue];
})
];
values.forEach((value, i) => {
if (!value) return;
parts.push(span(value, i % 2 === 0));
});
return parts;
}
var useComboboxItemValue = createHook(function useComboboxItemValue2(_a) {
var _b = _a, { store, value, userValue } = _b, props = __objRest(_b, ["store", "value", "userValue"]);
const context = useComboboxScopedContext();
store = store || context;
const itemContext = (0,external_React_.useContext)(ComboboxItemValueContext);
const itemValue = value != null ? value : itemContext;
const inputValue = useStoreState(store, (state) => userValue != null ? userValue : state == null ? void 0 : state.value);
const children = (0,external_React_.useMemo)(() => {
if (!itemValue) return;
if (!inputValue) return itemValue;
return splitValue(itemValue, inputValue);
}, [itemValue, inputValue]);
props = _3YLGPPWQ_spreadValues({
children
}, props);
return removeUndefinedValues(props);
});
var ComboboxItemValue = forwardRef2(function ComboboxItemValue2(props) {
const htmlProps = useComboboxItemValue(props);
return createElement(combobox_item_value_TagName, htmlProps);
});
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/utils.js
const utils_EMPTY_ARRAY = [];
const getCurrentValue = (filterDefinition, currentFilter) => {
if (filterDefinition.singleSelection) {
return currentFilter?.value;
}
if (Array.isArray(currentFilter?.value)) {
return currentFilter.value;
}
if (!Array.isArray(currentFilter?.value) && !!currentFilter?.value) {
return [currentFilter.value];
}
return utils_EMPTY_ARRAY;
};
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/search-widget.js
function search_widget_normalizeSearchInput(input = "") {
return remove_accents_default()(input.trim().toLowerCase());
}
const getNewValue = (filterDefinition, currentFilter, value) => {
if (filterDefinition.singleSelection) {
return value;
}
if (Array.isArray(currentFilter?.value)) {
return currentFilter.value.includes(value) ? currentFilter.value.filter((v) => v !== value) : [...currentFilter.value, value];
}
return [value];
};
function generateFilterElementCompositeItemId(prefix, filterElementValue) {
return `${prefix}-${filterElementValue}`;
}
const MultiSelectionOption = ({ selected }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: dist_clsx(
"dataviews-filters__search-widget-listitem-multi-selection",
{ "is-selected": selected }
),
children: selected && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: check_default })
}
);
};
const SingleSelectionOption = ({ selected }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: dist_clsx(
"dataviews-filters__search-widget-listitem-single-selection",
{ "is-selected": selected }
)
}
);
};
function ListBox({ view, filter, onChangeView }) {
const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(ListBox, "dataviews-filter-list-box");
const [activeCompositeId, setActiveCompositeId] = (0,external_wp_element_.useState)(
// When there are one or less operators, the first item is set as active
// (by setting the initial `activeId` to `undefined`).
// With 2 or more operators, the focus is moved on the operators control
// (by setting the initial `activeId` to `null`), meaning that there won't
// be an active item initially. Focus is then managed via the
// `onFocusVisible` callback.
filter.operators?.length === 1 ? void 0 : null
);
const currentFilter = view.filters?.find(
(f) => f.field === filter.field
);
const currentValue = getCurrentValue(filter, currentFilter);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite,
{
virtualFocus: true,
focusLoop: true,
activeId: activeCompositeId,
setActiveId: setActiveCompositeId,
role: "listbox",
className: "dataviews-filters__search-widget-listbox",
"aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */
(0,external_wp_i18n_namespaceObject.__)("List of: %1$s"),
filter.name
),
onFocusVisible: () => {
if (!activeCompositeId && filter.elements.length) {
setActiveCompositeId(
generateFilterElementCompositeItemId(
baseId,
filter.elements[0].value
)
);
}
},
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.Typeahead, {}),
children: filter.elements.map((element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Composite.Hover,
{
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite.Item,
{
id: generateFilterElementCompositeItemId(
baseId,
element.value
),
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
"aria-label": element.label,
role: "option",
className: "dataviews-filters__search-widget-listitem"
}
),
onClick: () => {
const newFilters = currentFilter ? [
...(view.filters ?? []).map(
(_filter) => {
if (_filter.field === filter.field) {
return {
..._filter,
operator: currentFilter.operator || filter.operators[0],
value: getNewValue(
filter,
currentFilter,
element.value
)
};
}
return _filter;
}
)
] : [
...view.filters ?? [],
{
field: filter.field,
operator: filter.operators[0],
value: getNewValue(
filter,
currentFilter,
element.value
)
}
];
onChangeView({
...view,
page: 1,
filters: newFilters
});
}
}
),
children: [
filter.singleSelection && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SingleSelectionOption,
{
selected: currentValue === element.value
}
),
!filter.singleSelection && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
MultiSelectionOption,
{
selected: currentValue.includes(element.value)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: element.label })
]
},
element.value
))
}
);
}
function search_widget_ComboboxList({ view, filter, onChangeView }) {
const [searchValue, setSearchValue] = (0,external_wp_element_.useState)("");
const deferredSearchValue = (0,external_wp_element_.useDeferredValue)(searchValue);
const currentFilter = view.filters?.find(
(_filter) => _filter.field === filter.field
);
const currentValue = getCurrentValue(filter, currentFilter);
const matches = (0,external_wp_element_.useMemo)(() => {
const normalizedSearch = search_widget_normalizeSearchInput(deferredSearchValue);
return filter.elements.filter(
(item) => search_widget_normalizeSearchInput(item.label).includes(normalizedSearch)
);
}, [filter.elements, deferredSearchValue]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
ComboboxProvider,
{
selectedValue: currentValue,
setSelectedValue: (value) => {
const newFilters = currentFilter ? [
...(view.filters ?? []).map((_filter) => {
if (_filter.field === filter.field) {
return {
..._filter,
operator: currentFilter.operator || filter.operators[0],
value
};
}
return _filter;
})
] : [
...view.filters ?? [],
{
field: filter.field,
operator: filter.operators[0],
value
}
];
onChangeView({
...view,
page: 1,
filters: newFilters
});
},
setValue: setSearchValue,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "dataviews-filters__search-widget-filter-combobox__wrapper", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ComboboxLabel,
{
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { children: (0,external_wp_i18n_namespaceObject.__)("Search items") }),
children: (0,external_wp_i18n_namespaceObject.__)("Search items")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Combobox,
{
autoSelect: "always",
placeholder: (0,external_wp_i18n_namespaceObject.__)("Search"),
className: "dataviews-filters__search-widget-filter-combobox__input"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataviews-filters__search-widget-filter-combobox__icon", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: search_default }) })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
ComboboxList,
{
className: "dataviews-filters__search-widget-filter-combobox-list",
alwaysVisible: true,
children: [
matches.map((element) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
ComboboxItem,
{
resetValueOnSelect: false,
value: element.value,
className: "dataviews-filters__search-widget-listitem",
hideOnClick: false,
setValueOnClick: false,
focusOnHover: true,
children: [
filter.singleSelection && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SingleSelectionOption,
{
selected: currentValue === element.value
}
),
!filter.singleSelection && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
MultiSelectionOption,
{
selected: currentValue.includes(
element.value
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ComboboxItemValue,
{
className: "dataviews-filters__search-widget-filter-combobox-item-value",
value: element.label
}
),
!!element.description && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "dataviews-filters__search-widget-listitem-description", children: element.description })
] })
]
},
element.value
);
}),
!matches.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)("No results found") })
]
}
)
]
}
);
}
function SearchWidget(props) {
const { elements, isLoading } = useElements({
elements: props.filter.elements,
getElements: props.filter.getElements
});
if (isLoading) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataviews-filters__search-widget-no-elements", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) });
}
if (elements.length === 0) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataviews-filters__search-widget-no-elements", children: (0,external_wp_i18n_namespaceObject.__)("No elements found") });
}
const Widget = elements.length > 10 ? search_widget_ComboboxList : ListBox;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Widget, { ...props, filter: { ...props.filter, elements } });
}
// EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js
var es6 = __webpack_require__(7734);
var es6_default = /*#__PURE__*/__webpack_require__.n(es6);
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/input-widget.js
function InputWidget({
filter,
view,
onChangeView,
fields
}) {
const currentFilter = view.filters?.find(
(f) => f.field === filter.field
);
const currentValue = getCurrentValue(filter, currentFilter);
const field = (0,external_wp_element_.useMemo)(() => {
const currentField = fields.find((f) => f.id === filter.field);
if (currentField) {
return {
...currentField,
// Deactivate validation for filters.
isValid: {
required: false,
custom: () => null
},
// Configure getValue/setValue as if Item was a plain object.
getValue: ({ item }) => item[currentField.id],
setValue: ({ value }) => ({
[currentField.id]: value
})
};
}
return currentField;
}, [fields, filter.field]);
const data = (0,external_wp_element_.useMemo)(() => {
return (view.filters ?? []).reduce(
(acc, activeFilter) => {
acc[activeFilter.field] = activeFilter.value;
return acc;
},
{}
);
}, [view.filters]);
const handleChange = (0,external_wp_compose_namespaceObject.useEvent)((updatedData) => {
if (!field || !currentFilter) {
return;
}
const nextValue = field.getValue({ item: updatedData });
if (es6_default()(nextValue, currentValue)) {
return;
}
onChangeView({
...view,
filters: (view.filters ?? []).map(
(_filter) => _filter.field === filter.field ? {
..._filter,
operator: currentFilter.operator || filter.operators[0],
// Consider empty strings as undefined:
//
// - undefined as value means the filter is unset: the filter widget displays no value and the search returns all records
// - empty string as value means "search empty string": returns only the records that have an empty string as value
//
// In practice, this means the filter will not be able to find an empty string as the value.
value: nextValue === "" ? void 0 : nextValue
} : _filter
)
});
});
if (!field || !field.Edit || !currentFilter) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Flex,
{
className: "dataviews-filters__user-input-widget",
gap: 2.5,
direction: "column",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
field.Edit,
{
hideLabelFromVision: true,
data,
field,
operator: currentFilter.operator,
onChange: handleChange
}
)
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filter.js
const ENTER = "Enter";
const SPACE = " ";
const FilterText = ({
activeElements,
filterInView,
filter
}) => {
if (activeElements === void 0 || activeElements.length === 0) {
return filter.name;
}
const filterTextWrappers = {
Name: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "dataviews-filters__summary-filter-text-name" }),
Value: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "dataviews-filters__summary-filter-text-value" })
};
if (filterInView?.operator === constants_OPERATOR_IS_ANY) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is any: Admin, Editor". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s is any: </Name><Value>%2$s</Value>"),
filter.name,
activeElements.map((element) => element.label).join(", ")
),
filterTextWrappers
);
}
if (filterInView?.operator === constants_OPERATOR_IS_NONE) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is none: Admin, Editor". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s is none: </Name><Value>%2$s</Value>"),
filter.name,
activeElements.map((element) => element.label).join(", ")
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_IS_ALL) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is all: Admin, Editor". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s is all: </Name><Value>%2$s</Value>"),
filter.name,
activeElements.map((element) => element.label).join(", ")
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_IS_NOT_ALL) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not all: Admin, Editor". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s is not all: </Name><Value>%2$s</Value>"),
filter.name,
activeElements.map((element) => element.label).join(", ")
),
filterTextWrappers
);
}
if (filterInView?.operator === constants_OPERATOR_IS) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is: Admin". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s is: </Name><Value>%2$s</Value>"),
filter.name,
activeElements[0].label
),
filterTextWrappers
);
}
if (filterInView?.operator === constants_OPERATOR_IS_NOT) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not: Admin". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s is not: </Name><Value>%2$s</Value>"),
filter.name,
activeElements[0].label
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_LESS_THAN) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than: 10". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s is less than: </Name><Value>%2$s</Value>"),
filter.name,
activeElements[0].label
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_GREATER_THAN) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than: 10". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s is greater than: </Name><Value>%2$s</Value>"),
filter.name,
activeElements[0].label
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_LESS_THAN_OR_EQUAL) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than or equal to: 10". */
(0,external_wp_i18n_namespaceObject.__)(
"<Name>%1$s is less than or equal to: </Name><Value>%2$s</Value>"
),
filter.name,
activeElements[0].label
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_GREATER_THAN_OR_EQUAL) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than or equal to: 10". */
(0,external_wp_i18n_namespaceObject.__)(
"<Name>%1$s is greater than or equal to: </Name><Value>%2$s</Value>"
),
filter.name,
activeElements[0].label
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_CONTAINS) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Title contains: Mars". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s contains: </Name><Value>%2$s</Value>"),
filter.name,
activeElements[0].label
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_NOT_CONTAINS) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Description doesn't contain: photo". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s doesn't contain: </Name><Value>%2$s</Value>"),
filter.name,
activeElements[0].label
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_STARTS_WITH) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Title starts with: Mar". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s starts with: </Name><Value>%2$s</Value>"),
filter.name,
activeElements[0].label
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_BEFORE) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is before: 2024-01-01". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s is before: </Name><Value>%2$s</Value>"),
filter.name,
activeElements[0].label
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_AFTER) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is after: 2024-01-01". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s is after: </Name><Value>%2$s</Value>"),
filter.name,
activeElements[0].label
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_BEFORE_INC) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or before: 2024-01-01". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s is on or before: </Name><Value>%2$s</Value>"),
filter.name,
activeElements[0].label
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_AFTER_INC) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or after: 2024-01-01". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s is on or after: </Name><Value>%2$s</Value>"),
filter.name,
activeElements[0].label
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_BETWEEN) {
const { label } = activeElements[0];
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Min value. 3: Max value. e.g.: "Item count between (inc): 10 and 180". */
(0,external_wp_i18n_namespaceObject.__)(
"<Name>%1$s between (inc): </Name><Value>%2$s and %3$s</Value>"
),
filter.name,
label[0],
label[1]
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_ON) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is: 2024-01-01". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s is: </Name><Value>%2$s</Value>"),
filter.name,
activeElements[0].label
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_NOT_ON) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is not: 2024-01-01". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s is not: </Name><Value>%2$s</Value>"),
filter.name,
activeElements[0].label
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_IN_THE_PAST) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is in the past: 1 days". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s is in the past: </Name><Value>%2$s</Value>"),
filter.name,
`${activeElements[0].value.value} ${activeElements[0].value.unit}`
),
filterTextWrappers
);
}
if (filterInView?.operator === OPERATOR_OVER) {
return (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is over: 1 days ago". */
(0,external_wp_i18n_namespaceObject.__)("<Name>%1$s is over: </Name><Value>%2$s</Value> ago"),
filter.name,
`${activeElements[0].value.value} ${activeElements[0].value.unit}`
),
filterTextWrappers
);
}
return (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name e.g.: "Unknown status for Author". */
(0,external_wp_i18n_namespaceObject.__)("Unknown status for %1$s"),
filter.name
);
};
function OperatorSelector({
filter,
view,
onChangeView
}) {
const operatorOptions = filter.operators?.map((operator) => ({
value: operator,
label: OPERATORS[operator]?.label
}));
const currentFilter = view.filters?.find(
(_filter) => _filter.field === filter.field
);
const value = currentFilter?.operator || filter.operators[0];
return operatorOptions.length > 1 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
spacing: 2,
justify: "flex-start",
className: "dataviews-filters__summary-operators-container",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { className: "dataviews-filters__summary-operators-filter-name", children: filter.name }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SelectControl,
{
className: "dataviews-filters__summary-operators-filter-select",
label: (0,external_wp_i18n_namespaceObject.__)("Conditions"),
value,
options: operatorOptions,
onChange: (newValue) => {
const operator = newValue;
const currentOperator = currentFilter?.operator;
const newFilters = currentFilter ? [
...(view.filters ?? []).map(
(_filter) => {
if (_filter.field === filter.field) {
const OPERATORS_SHOULD_RESET_VALUE = [
OPERATOR_BETWEEN,
OPERATOR_IN_THE_PAST,
OPERATOR_OVER
];
const shouldResetValue = currentOperator && (OPERATORS_SHOULD_RESET_VALUE.includes(
currentOperator
) || OPERATORS_SHOULD_RESET_VALUE.includes(
operator
));
return {
..._filter,
value: shouldResetValue ? void 0 : _filter.value,
operator
};
}
return _filter;
}
)
] : [
...view.filters ?? [],
{
field: filter.field,
operator,
value: void 0
}
];
onChangeView({
...view,
page: 1,
filters: newFilters
});
},
size: "small",
variant: "minimal",
__nextHasNoMarginBottom: true,
hideLabelFromVision: true
}
)
]
}
);
}
function Filter({
addFilterRef,
openedFilter,
fields,
...commonProps
}) {
const toggleRef = (0,external_wp_element_.useRef)(null);
const { filter, view, onChangeView } = commonProps;
const filterInView = view.filters?.find(
(f) => f.field === filter.field
);
let activeElements = [];
const { elements } = useElements({
elements: filter.elements,
getElements: filter.getElements
});
if (elements.length > 0) {
activeElements = elements.filter((element) => {
if (filter.singleSelection) {
return element.value === filterInView?.value;
}
return filterInView?.value?.includes(element.value);
});
} else if (filterInView?.value !== void 0) {
activeElements = [
{
value: filterInView.value,
label: filterInView.value
}
];
}
const isPrimary = filter.isPrimary;
const isLocked = filterInView?.isLocked;
const hasValues = !isLocked && filterInView?.value !== void 0;
const canResetOrRemove = !isLocked && (!isPrimary || hasValues);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
defaultOpen: openedFilter === filter.field,
contentClassName: "dataviews-filters__summary-popover",
popoverProps: { placement: "bottom-start", role: "dialog" },
onClose: () => {
toggleRef.current?.focus();
},
renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "dataviews-filters__summary-chip-container", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Tooltip,
{
text: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Filter name. */
(0,external_wp_i18n_namespaceObject.__)("Filter by: %1$s"),
filter.name.toLowerCase()
),
placement: "top",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx(
"dataviews-filters__summary-chip",
{
"has-reset": canResetOrRemove,
"has-values": hasValues,
"is-not-clickable": isLocked
}
),
role: "button",
tabIndex: isLocked ? -1 : 0,
onClick: () => {
if (!isLocked) {
onToggle();
}
},
onKeyDown: (event) => {
if (!isLocked && [ENTER, SPACE].includes(event.key)) {
onToggle();
event.preventDefault();
}
},
"aria-disabled": isLocked,
"aria-pressed": isOpen,
"aria-expanded": isOpen,
ref: toggleRef,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FilterText,
{
activeElements,
filterInView,
filter
}
)
}
)
}
),
canResetOrRemove && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Tooltip,
{
text: isPrimary ? (0,external_wp_i18n_namespaceObject.__)("Reset") : (0,external_wp_i18n_namespaceObject.__)("Remove"),
placement: "top",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"button",
{
className: dist_clsx(
"dataviews-filters__summary-chip-remove",
{ "has-values": hasValues }
),
onClick: () => {
onChangeView({
...view,
page: 1,
filters: view.filters?.filter(
(_filter) => _filter.field !== filter.field
)
});
if (!isPrimary) {
addFilterRef.current?.focus();
} else {
toggleRef.current?.focus();
}
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: close_small_default })
}
)
}
)
] }),
renderContent: () => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 0, justify: "flex-start", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(OperatorSelector, { ...commonProps }),
commonProps.filter.hasElements ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SearchWidget,
{
...commonProps,
filter: {
...commonProps.filter,
elements
}
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWidget, { ...commonProps, fields })
] });
}
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/reset-filters.js
function ResetFilter({
filters,
view,
onChangeView
}) {
const isPrimary = (field) => filters.some(
(_filter) => _filter.field === field && _filter.isPrimary
);
const isDisabled = !view.search && !view.filters?.some(
(_filter) => !_filter.isLocked && (_filter.value !== void 0 || !isPrimary(_filter.field))
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
disabled: isDisabled,
accessibleWhenDisabled: true,
size: "compact",
variant: "tertiary",
className: "dataviews-filters__reset-button",
onClick: () => {
onChangeView({
...view,
page: 1,
search: "",
filters: view.filters?.filter((f) => !!f.isLocked) || []
});
},
children: (0,external_wp_i18n_namespaceObject.__)("Reset")
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/use-filters.js
function useFilters(fields, view) {
return (0,external_wp_element_.useMemo)(() => {
const filters = [];
fields.forEach((field) => {
if (field.filterBy === false || !field.hasElements && !field.Edit) {
return;
}
const operators = field.filterBy.operators;
const isPrimary = !!field.filterBy?.isPrimary;
const isLocked = view.filters?.some(
(f) => f.field === field.id && !!f.isLocked
) ?? false;
filters.push({
field: field.id,
name: field.label,
elements: field.elements,
getElements: field.getElements,
hasElements: field.hasElements,
singleSelection: operators.some(
(op) => SINGLE_SELECTION_OPERATORS.includes(op)
),
operators,
isVisible: isLocked || isPrimary || !!view.filters?.some(
(f) => f.field === field.id && ALL_OPERATORS.includes(f.operator)
),
isPrimary,
isLocked
});
});
filters.sort((a, b) => {
if (a.isLocked && !b.isLocked) {
return -1;
}
if (!a.isLocked && b.isLocked) {
return 1;
}
if (a.isPrimary && !b.isPrimary) {
return -1;
}
if (!a.isPrimary && b.isPrimary) {
return 1;
}
return a.name.localeCompare(b.name);
});
return filters;
}, [fields, view]);
}
var use_filters_default = useFilters;
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters.js
function Filters({ className }) {
const { fields, view, onChangeView, openedFilter, setOpenedFilter } = (0,external_wp_element_.useContext)(dataviews_context_default);
const addFilterRef = (0,external_wp_element_.useRef)(null);
const filters = use_filters_default(fields, view);
const addFilter = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
add_filter_default,
{
filters,
view,
onChangeView,
ref: addFilterRef,
setOpenedFilter
},
"add-filter"
);
const visibleFilters = filters.filter((filter) => filter.isVisible);
if (visibleFilters.length === 0) {
return null;
}
const filterComponents = [
...visibleFilters.map((filter) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Filter,
{
filter,
view,
fields,
onChangeView,
addFilterRef,
openedFilter
},
filter.field
);
}),
addFilter
];
filterComponents.push(
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ResetFilter,
{
filters,
view,
onChangeView
},
"reset-filters"
)
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHStack,
{
justify: "flex-start",
style: { width: "fit-content" },
wrap: true,
className,
children: filterComponents
}
);
}
var filters_default = (0,external_wp_element_.memo)(Filters);
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters-toggled.js
function FiltersToggled(props) {
const { isShowingFilter } = (0,external_wp_element_.useContext)(dataviews_context_default);
if (!isShowingFilter) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(filters_default, { ...props });
}
var filters_toggled_default = FiltersToggled;
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-layout/index.js
function DataViewsLayout({ className }) {
const {
actions = [],
data,
fields,
getItemId,
getItemLevel,
isLoading,
view,
onChangeView,
selection,
onChangeSelection,
setOpenedFilter,
onClickItem,
isItemClickable,
renderItemLink,
defaultLayouts,
empty = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)("No results") })
} = (0,external_wp_element_.useContext)(dataviews_context_default);
const ViewComponent = VIEW_LAYOUTS.find(
(v) => v.type === view.type && defaultLayouts[v.type]
)?.component;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ViewComponent,
{
className,
actions,
data,
fields,
getItemId,
getItemLevel,
isLoading,
onChangeView,
onChangeSelection,
selection,
setOpenedFilter,
onClickItem,
renderItemLink,
isItemClickable,
view,
empty
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-pagination/index.js
function dataviews_pagination_DataViewsPagination() {
const {
view,
onChangeView,
paginationInfo: { totalItems = 0, totalPages }
} = (0,external_wp_element_.useContext)(dataviews_context_default);
if (!totalItems || !totalPages || view.infiniteScrollEnabled) {
return null;
}
const currentPage = view.page ?? 1;
const pageSelectOptions = Array.from(Array(totalPages)).map(
(_, i) => {
const page = i + 1;
return {
value: page.toString(),
label: page.toString(),
"aria-label": currentPage === page ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: current page number. 2: total number of pages.
(0,external_wp_i18n_namespaceObject.__)("Page %1$d of %2$d"),
currentPage,
totalPages
) : page.toString()
};
}
);
return !!totalItems && totalPages !== 1 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
expanded: false,
className: "dataviews-pagination",
justify: "end",
spacing: 6,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHStack,
{
justify: "flex-start",
expanded: false,
spacing: 1,
className: "dataviews-pagination__page-select",
children: (0,external_wp_element_.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Current page number, 2: Total number of pages.
(0,external_wp_i18n_namespaceObject._x)(
"<div>Page</div>%1$s<div>of %2$d</div>",
"paging"
),
"<CurrentPage />",
totalPages
),
{
div: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { "aria-hidden": true }),
CurrentPage: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SelectControl,
{
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Current page"),
value: currentPage.toString(),
options: pageSelectOptions,
onChange: (newValue) => {
onChangeView({
...view,
page: +newValue
});
},
size: "small",
__nextHasNoMarginBottom: true,
variant: "minimal"
}
)
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { expanded: false, spacing: 1, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
onClick: () => onChangeView({
...view,
page: currentPage - 1
}),
disabled: currentPage === 1,
accessibleWhenDisabled: true,
label: (0,external_wp_i18n_namespaceObject.__)("Previous page"),
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? next_default : previous_default,
showTooltip: true,
size: "compact",
tooltipPosition: "top"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
onClick: () => onChangeView({ ...view, page: currentPage + 1 }),
disabled: currentPage >= totalPages,
accessibleWhenDisabled: true,
label: (0,external_wp_i18n_namespaceObject.__)("Next page"),
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? previous_default : next_default,
showTooltip: true,
size: "compact",
tooltipPosition: "top"
}
)
] })
]
}
);
}
var dataviews_pagination_default = (0,external_wp_element_.memo)(dataviews_pagination_DataViewsPagination);
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-footer/index.js
const dataviews_footer_EMPTY_ARRAY = [];
function DataViewsFooter() {
const {
view,
paginationInfo: { totalItems = 0, totalPages },
data,
actions = dataviews_footer_EMPTY_ARRAY
} = (0,external_wp_element_.useContext)(dataviews_context_default);
const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions, data) && [constants_LAYOUT_TABLE, constants_LAYOUT_GRID].includes(view.type);
if (!totalItems || !totalPages || totalPages <= 1 && !hasBulkActions) {
return null;
}
return !!totalItems && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
expanded: false,
justify: "end",
className: "dataviews-footer",
children: [
hasBulkActions && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BulkActionsFooter, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_pagination_default, {})
]
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-search/index.js
const DataViewsSearch = (0,external_wp_element_.memo)(function Search({ label }) {
const { view, onChangeView } = (0,external_wp_element_.useContext)(dataviews_context_default);
const [search, setSearch, debouncedSearch] = (0,external_wp_compose_namespaceObject.useDebouncedInput)(
view.search
);
(0,external_wp_element_.useEffect)(() => {
setSearch(view.search ?? "");
}, [view.search, setSearch]);
const onChangeViewRef = (0,external_wp_element_.useRef)(onChangeView);
const viewRef = (0,external_wp_element_.useRef)(view);
(0,external_wp_element_.useEffect)(() => {
onChangeViewRef.current = onChangeView;
viewRef.current = view;
}, [onChangeView, view]);
(0,external_wp_element_.useEffect)(() => {
if (debouncedSearch !== viewRef.current?.search) {
onChangeViewRef.current({
...viewRef.current,
page: 1,
search: debouncedSearch
});
}
}, [debouncedSearch]);
const searchLabel = label || (0,external_wp_i18n_namespaceObject.__)("Search");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SearchControl,
{
className: "dataviews-search",
__nextHasNoMarginBottom: true,
onChange: setSearch,
value: search,
label: searchLabel,
placeholder: searchLabel,
size: "compact"
}
);
});
var dataviews_search_default = DataViewsSearch;
;// ./node_modules/@wordpress/icons/build-module/library/lock.js
var lock_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/cog.js
var cog_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
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",
clipRule: "evenodd"
}
) });
;// external ["wp","warning"]
const external_wp_warning_namespaceObject = window["wp"]["warning"];
var external_wp_warning_default = /*#__PURE__*/__webpack_require__.n(external_wp_warning_namespaceObject);
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/infinite-scroll-toggle.js
function InfiniteScrollToggle() {
const context = (0,external_wp_element_.useContext)(dataviews_context_default);
const { view, onChangeView } = context;
const infiniteScrollEnabled = view.infiniteScrollEnabled ?? false;
if (!context.hasInfiniteScrollHandler) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Enable infinite scroll"),
help: (0,external_wp_i18n_namespaceObject.__)(
"Automatically load more content as you scroll, instead of showing pagination links."
),
checked: infiniteScrollEnabled,
onChange: (newValue) => {
onChangeView({
...view,
infiniteScrollEnabled: newValue
});
}
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/index.js
const { Menu: dataviews_view_config_Menu } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
const DATAVIEWS_CONFIG_POPOVER_PROPS = {
className: "dataviews-config__popover",
placement: "bottom-end",
offset: 9
};
function ViewTypeMenu() {
const { view, onChangeView, defaultLayouts } = (0,external_wp_element_.useContext)(dataviews_context_default);
const availableLayouts = Object.keys(defaultLayouts);
if (availableLayouts.length <= 1) {
return null;
}
const activeView = VIEW_LAYOUTS.find((v) => view.type === v.type);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(dataviews_view_config_Menu, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
dataviews_view_config_Menu.TriggerButton,
{
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "compact",
icon: activeView?.icon,
label: (0,external_wp_i18n_namespaceObject.__)("Layout")
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.Popover, { children: availableLayouts.map((layout) => {
const config = VIEW_LAYOUTS.find(
(v) => v.type === layout
);
if (!config) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
dataviews_view_config_Menu.RadioItem,
{
value: layout,
name: "view-actions-available-view",
checked: layout === view.type,
hideOnClick: true,
onChange: (e) => {
switch (e.target.value) {
case "list":
case "grid":
case "table":
case "pickerGrid":
const viewWithoutLayout = { ...view };
if ("layout" in viewWithoutLayout) {
delete viewWithoutLayout.layout;
}
return onChangeView({
...viewWithoutLayout,
type: e.target.value,
...defaultLayouts[e.target.value]
});
}
external_wp_warning_default()("Invalid dataview");
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.ItemLabel, { children: config.label })
},
layout
);
}) })
] });
}
function SortFieldControl() {
const { view, fields, onChangeView } = (0,external_wp_element_.useContext)(dataviews_context_default);
const orderOptions = (0,external_wp_element_.useMemo)(() => {
const sortableFields = fields.filter(
(field) => field.enableSorting !== false
);
return sortableFields.map((field) => {
return {
label: field.label,
value: field.id
};
});
}, [fields]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SelectControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Sort by"),
value: view.sort?.field,
options: orderOptions,
onChange: (value) => {
onChangeView({
...view,
sort: {
direction: view?.sort?.direction || "desc",
field: value
},
showLevels: false
});
}
}
);
}
function SortDirectionControl() {
const { view, fields, onChangeView } = (0,external_wp_element_.useContext)(dataviews_context_default);
const sortableFields = fields.filter(
(field) => field.enableSorting !== false
);
if (sortableFields.length === 0) {
return null;
}
let value = view.sort?.direction;
if (!value && view.sort?.field) {
value = "desc";
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
className: "dataviews-view-config__sort-direction",
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
isBlock: true,
label: (0,external_wp_i18n_namespaceObject.__)("Order"),
value,
onChange: (newDirection) => {
if (newDirection === "asc" || newDirection === "desc") {
onChangeView({
...view,
sort: {
direction: newDirection,
field: view.sort?.field || // If there is no field assigned as the sorting field assign the first sortable field.
fields.find(
(field) => field.enableSorting !== false
)?.id || ""
},
showLevels: false
});
return;
}
external_wp_warning_default()("Invalid direction");
},
children: SORTING_DIRECTIONS.map((direction) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon,
{
value: direction,
icon: sortIcons[direction],
label: sortLabels[direction]
},
direction
);
})
}
);
}
function ItemsPerPageControl() {
const { view, config, onChangeView } = (0,external_wp_element_.useContext)(dataviews_context_default);
const { infiniteScrollEnabled } = view;
if (!config || !config.perPageSizes || config.perPageSizes.length < 2 || config.perPageSizes.length > 6 || infiniteScrollEnabled) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
isBlock: true,
label: (0,external_wp_i18n_namespaceObject.__)("Items per page"),
value: view.perPage || 10,
disabled: !view?.sort?.field,
onChange: (newItemsPerPage) => {
const newItemsPerPageNumber = typeof newItemsPerPage === "number" || newItemsPerPage === void 0 ? newItemsPerPage : parseInt(newItemsPerPage, 10);
onChangeView({
...view,
perPage: newItemsPerPageNumber,
page: 1
});
},
children: config.perPageSizes.map((value) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value,
label: value.toString()
},
value
);
})
}
);
}
function PreviewOptions({
previewOptions,
onChangePreviewOption,
onMenuOpenChange,
activeOption
}) {
const focusPreviewOptionsField = (id) => {
setTimeout(() => {
const element = document.querySelector(
`.dataviews-field-control__field-${id} .dataviews-field-control__field-preview-options-button`
);
if (element instanceof HTMLElement) {
element.focus();
}
}, 50);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(dataviews_view_config_Menu, { onOpenChange: onMenuOpenChange, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
dataviews_view_config_Menu.TriggerButton,
{
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
className: "dataviews-field-control__field-preview-options-button",
size: "compact",
icon: more_vertical_default,
label: (0,external_wp_i18n_namespaceObject.__)("Preview")
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.Popover, { children: previewOptions?.map(({ id, label }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
dataviews_view_config_Menu.RadioItem,
{
value: id,
checked: id === activeOption,
onChange: () => {
onChangePreviewOption?.(id);
focusPreviewOptionsField(id);
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.ItemLabel, { children: label })
},
id
);
}) })
] });
}
function FieldItem({
field,
label,
description,
isVisible,
isFirst,
isLast,
canMove = true,
onToggleVisibility,
onMoveUp,
onMoveDown,
previewOptions,
onChangePreviewOption
}) {
const [isChangingPreviewOption, setIsChangingPreviewOption] = (0,external_wp_element_.useState)(false);
const focusVisibilityField = () => {
setTimeout(() => {
const element = document.querySelector(
`.dataviews-field-control__field-${field.id} .dataviews-field-control__field-visibility-button`
);
if (element instanceof HTMLElement) {
element.focus();
}
}, 50);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
expanded: true,
className: dist_clsx(
"dataviews-field-control__field",
`dataviews-field-control__field-${field.id}`,
// The actions are hidden when the mouse is not hovering the item, or focus
// is outside the item.
// For actions that require a popover, a menu etc, that would mean that when the interactive element
// opens and the focus goes there the actions would be hidden.
// To avoid that we add a class to the item, that makes sure actions are visible while there is some
// interaction with the item.
{ "is-interacting": isChangingPreviewOption }
),
justify: "flex-start",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "dataviews-field-control__icon", children: !canMove && !field.enableHiding && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: lock_default }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { className: "dataviews-field-control__label-sub-label-container", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "dataviews-field-control__label", children: label || field.label }),
description && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "dataviews-field-control__sub-label", children: description })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
justify: "flex-end",
expanded: false,
className: "dataviews-field-control__actions",
children: [
isVisible && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
disabled: isFirst || !canMove,
accessibleWhenDisabled: true,
size: "compact",
onClick: onMoveUp,
icon: chevron_up_default,
label: isFirst || !canMove ? (0,external_wp_i18n_namespaceObject.__)("This field can't be moved up") : (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: field label */
(0,external_wp_i18n_namespaceObject.__)("Move %s up"),
field.label
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
disabled: isLast || !canMove,
accessibleWhenDisabled: true,
size: "compact",
onClick: onMoveDown,
icon: chevron_down_default,
label: isLast || !canMove ? (0,external_wp_i18n_namespaceObject.__)("This field can't be moved down") : (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: field label */
(0,external_wp_i18n_namespaceObject.__)("Move %s down"),
field.label
)
}
)
] }),
onToggleVisibility && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
className: "dataviews-field-control__field-visibility-button",
disabled: !field.enableHiding,
accessibleWhenDisabled: true,
size: "compact",
onClick: () => {
onToggleVisibility();
focusVisibilityField();
},
icon: isVisible ? unseen_default : seen_default,
label: isVisible ? (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: field label */
(0,external_wp_i18n_namespaceObject._x)("Hide %s", "field"),
field.label
) : (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: field label */
(0,external_wp_i18n_namespaceObject._x)("Show %s", "field"),
field.label
)
}
),
previewOptions && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PreviewOptions,
{
previewOptions,
onChangePreviewOption,
onMenuOpenChange: setIsChangingPreviewOption,
activeOption: field.id
}
)
]
}
)
]
}
) });
}
function RegularFieldItem({
index,
field,
view,
onChangeView
}) {
const visibleFieldIds = view.fields ?? [];
const isVisible = index !== void 0 && visibleFieldIds.includes(field.id);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FieldItem,
{
field,
isVisible,
isFirst: index !== void 0 && index < 1,
isLast: index !== void 0 && index === visibleFieldIds.length - 1,
onToggleVisibility: () => {
onChangeView({
...view,
fields: isVisible ? visibleFieldIds.filter(
(fieldId) => fieldId !== field.id
) : [...visibleFieldIds, field.id]
});
},
onMoveUp: index !== void 0 ? () => {
onChangeView({
...view,
fields: [
...visibleFieldIds.slice(
0,
index - 1
) ?? [],
field.id,
visibleFieldIds[index - 1],
...visibleFieldIds.slice(index + 1)
]
});
} : void 0,
onMoveDown: index !== void 0 ? () => {
onChangeView({
...view,
fields: [
...visibleFieldIds.slice(0, index) ?? [],
visibleFieldIds[index + 1],
field.id,
...visibleFieldIds.slice(index + 2)
]
});
} : void 0
}
);
}
function dataviews_view_config_isDefined(item) {
return !!item;
}
function FieldControl() {
const { view, fields, onChangeView } = (0,external_wp_element_.useContext)(dataviews_context_default);
const togglableFields = [
view?.titleField,
view?.mediaField,
view?.descriptionField
].filter(Boolean);
const visibleFieldIds = view.fields ?? [];
const hiddenFields = fields.filter(
(f) => !visibleFieldIds.includes(f.id) && !togglableFields.includes(f.id) && f.type !== "media" && f.enableHiding !== false
);
let visibleFields = visibleFieldIds.map((fieldId) => fields.find((f) => f.id === fieldId)).filter(dataviews_view_config_isDefined);
if (!visibleFields?.length && !hiddenFields?.length) {
return null;
}
const titleField = fields.find((f) => f.id === view.titleField);
const previewField = fields.find((f) => f.id === view.mediaField);
const descriptionField = fields.find(
(f) => f.id === view.descriptionField
);
const previewFields = fields.filter((f) => f.type === "media");
let previewFieldUI;
if (previewFields.length > 1) {
const isPreviewFieldVisible = dataviews_view_config_isDefined(previewField) && (view.showMedia ?? true);
previewFieldUI = dataviews_view_config_isDefined(previewField) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FieldItem,
{
field: previewField,
label: (0,external_wp_i18n_namespaceObject.__)("Preview"),
description: previewField.label,
isVisible: isPreviewFieldVisible,
onToggleVisibility: () => {
onChangeView({
...view,
showMedia: !isPreviewFieldVisible
});
},
canMove: false,
previewOptions: previewFields.map((field) => ({
label: field.label,
id: field.id
})),
onChangePreviewOption: (newPreviewId) => onChangeView({ ...view, mediaField: newPreviewId })
},
previewField.id
);
}
const lockedFields = [
{
field: titleField,
isVisibleFlag: "showTitle"
},
{
field: previewField,
isVisibleFlag: "showMedia",
ui: previewFieldUI
},
{
field: descriptionField,
isVisibleFlag: "showDescription"
}
].filter(({ field }) => dataviews_view_config_isDefined(field));
let visibleLockedFields = lockedFields.filter(
({ field, isVisibleFlag }) => (
// @ts-expect-error
dataviews_view_config_isDefined(field) && (view[isVisibleFlag] ?? true)
)
);
if (visibleLockedFields.length === 1) {
visibleLockedFields = visibleLockedFields.map((locked) => ({
...locked,
field: { ...locked.field, enableHiding: false }
}));
}
if (visibleLockedFields.length === 0 && visibleFields.length === 1) {
visibleFields = [{ ...visibleFields[0], enableHiding: false }];
}
const hiddenLockedFields = lockedFields.filter(
({ field, isVisibleFlag }) => (
// @ts-expect-error
dataviews_view_config_isDefined(field) && !(view[isVisibleFlag] ?? true)
)
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { className: "dataviews-field-control", spacing: 6, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { className: "dataviews-view-config__properties", spacing: 0, children: (visibleLockedFields.length > 0 || !!visibleFields?.length) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { isBordered: true, isSeparated: true, children: [
visibleLockedFields.map(
({ field, isVisibleFlag, ui }) => {
return ui ?? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FieldItem,
{
field,
isVisible: true,
onToggleVisibility: () => {
onChangeView({
...view,
[isVisibleFlag]: false
});
},
canMove: false
},
field.id
);
}
),
visibleFields.map((field, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
RegularFieldItem,
{
field,
view,
onChangeView,
index
},
field.id
))
] }) }),
(!!hiddenFields?.length || !!hiddenLockedFields.length) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { style: { margin: 0 }, children: (0,external_wp_i18n_namespaceObject.__)("Hidden") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalVStack,
{
className: "dataviews-view-config__properties",
spacing: 0,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { isBordered: true, isSeparated: true, children: [
hiddenLockedFields.length > 0 && hiddenLockedFields.map(
({ field, isVisibleFlag, ui }) => {
return ui ?? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FieldItem,
{
field,
isVisible: false,
onToggleVisibility: () => {
onChangeView({
...view,
[isVisibleFlag]: true
});
},
canMove: false
},
field.id
);
}
),
hiddenFields.map((field) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
RegularFieldItem,
{
field,
view,
onChangeView
},
field.id
))
] })
}
)
] })
] });
}
function SettingsSection({
title,
description,
children
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalGrid, { columns: 12, className: "dataviews-settings-section", gap: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "dataviews-settings-section__sidebar", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHeading,
{
level: 2,
className: "dataviews-settings-section__title",
children: title
}
),
description && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalText,
{
variant: "muted",
className: "dataviews-settings-section__description",
children: description
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalGrid,
{
columns: 8,
gap: 4,
className: "dataviews-settings-section__content",
children
}
)
] });
}
function DataviewsViewConfigDropdown() {
const { view } = (0,external_wp_element_.useContext)(dataviews_context_default);
const popoverId = (0,external_wp_compose_namespaceObject.useInstanceId)(
_DataViewsViewConfig,
"dataviews-view-config-dropdown"
);
const activeLayout = VIEW_LAYOUTS.find(
(layout) => layout.type === view.type
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
expandOnMobile: true,
popoverProps: {
...DATAVIEWS_CONFIG_POPOVER_PROPS,
id: popoverId
},
renderToggle: ({ onToggle, isOpen }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "compact",
icon: cog_default,
label: (0,external_wp_i18n_namespaceObject._x)("View options", "View is used as a noun"),
onClick: onToggle,
"aria-expanded": isOpen ? "true" : "false",
"aria-controls": popoverId
}
);
},
renderContent: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalDropdownContentWrapper,
{
paddingSize: "medium",
className: "dataviews-config__popover-content-wrapper",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { className: "dataviews-view-config", spacing: 6, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(SettingsSection, { title: (0,external_wp_i18n_namespaceObject.__)("Appearance"), children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { expanded: true, className: "is-divided-in-two", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SortFieldControl, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SortDirectionControl, {})
] }),
!!activeLayout?.viewConfigOptions && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(activeLayout.viewConfigOptions, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InfiniteScrollToggle, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemsPerPageControl, {})
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SettingsSection, { title: (0,external_wp_i18n_namespaceObject.__)("Properties"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldControl, {}) })
] })
}
)
}
);
}
function _DataViewsViewConfig() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ViewTypeMenu, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsViewConfigDropdown, {})
] });
}
const DataViewsViewConfig = (0,external_wp_element_.memo)(_DataViewsViewConfig);
var dataviews_view_config_default = DataViewsViewConfig;
;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews/index.js
const defaultGetItemId = (item) => item.id;
const defaultIsItemClickable = () => true;
const dataviews_EMPTY_ARRAY = [];
const dataViewsLayouts = VIEW_LAYOUTS.filter(
(viewLayout) => !viewLayout.isPicker
);
function DefaultUI({
header,
search = true,
searchLabel = void 0
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
alignment: "top",
justify: "space-between",
className: "dataviews__view-actions",
spacing: 1,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
justify: "start",
expanded: false,
className: "dataviews__search",
children: [
search && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_search_default, { label: searchLabel }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_default, {})
]
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
spacing: 1,
expanded: false,
style: { flexShrink: 0 },
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_default, {}),
header
]
}
)
]
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(filters_toggled_default, { className: "dataviews-filters__container" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsLayout, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsFooter, {})
] });
}
function DataViews({
view,
onChangeView,
fields,
search = true,
searchLabel = void 0,
actions = dataviews_EMPTY_ARRAY,
data,
getItemId = defaultGetItemId,
getItemLevel,
isLoading = false,
paginationInfo,
defaultLayouts: defaultLayoutsProperty,
selection: selectionProperty,
onChangeSelection,
onClickItem,
renderItemLink,
isItemClickable = defaultIsItemClickable,
header,
children,
config = { perPageSizes: [10, 20, 50, 100] },
empty
}) {
const { infiniteScrollHandler } = paginationInfo;
const containerRef = (0,external_wp_element_.useRef)(null);
const [containerWidth, setContainerWidth] = (0,external_wp_element_.useState)(0);
const resizeObserverRef = (0,external_wp_compose_namespaceObject.useResizeObserver)(
(resizeObserverEntries) => {
setContainerWidth(
resizeObserverEntries[0].borderBoxSize[0].inlineSize
);
},
{ box: "border-box" }
);
const [selectionState, setSelectionState] = (0,external_wp_element_.useState)([]);
const isUncontrolled = selectionProperty === void 0 || onChangeSelection === void 0;
const selection = isUncontrolled ? selectionState : selectionProperty;
const [openedFilter, setOpenedFilter] = (0,external_wp_element_.useState)(null);
function setSelectionWithChange(value) {
const newValue = typeof value === "function" ? value(selection) : value;
if (isUncontrolled) {
setSelectionState(newValue);
}
if (onChangeSelection) {
onChangeSelection(newValue);
}
}
const _fields = (0,external_wp_element_.useMemo)(() => normalizeFields(fields), [fields]);
const _selection = (0,external_wp_element_.useMemo)(() => {
return selection.filter(
(id) => data.some((item) => getItemId(item) === id)
);
}, [selection, data, getItemId]);
const filters = use_filters_default(_fields, view);
const hasPrimaryOrLockedFilters = (0,external_wp_element_.useMemo)(
() => (filters || []).some(
(filter) => filter.isPrimary || filter.isLocked
),
[filters]
);
const [isShowingFilter, setIsShowingFilter] = (0,external_wp_element_.useState)(
hasPrimaryOrLockedFilters
);
(0,external_wp_element_.useEffect)(() => {
if (hasPrimaryOrLockedFilters && !isShowingFilter) {
setIsShowingFilter(true);
}
}, [hasPrimaryOrLockedFilters, isShowingFilter]);
(0,external_wp_element_.useEffect)(() => {
if (!view.infiniteScrollEnabled || !containerRef.current) {
return;
}
const handleScroll = (0,external_wp_compose_namespaceObject.throttle)((event) => {
const target = event.target;
const scrollTop = target.scrollTop;
const scrollHeight = target.scrollHeight;
const clientHeight = target.clientHeight;
if (scrollTop + clientHeight >= scrollHeight - 100) {
infiniteScrollHandler?.();
}
}, 100);
const container = containerRef.current;
container.addEventListener("scroll", handleScroll);
return () => {
container.removeEventListener("scroll", handleScroll);
handleScroll.cancel();
};
}, [infiniteScrollHandler, view.infiniteScrollEnabled]);
const defaultLayouts = (0,external_wp_element_.useMemo)(
() => Object.fromEntries(
Object.entries(defaultLayoutsProperty).filter(
([layoutType]) => {
return dataViewsLayouts.some(
(viewLayout) => viewLayout.type === layoutType
);
}
)
),
[defaultLayoutsProperty]
);
if (!defaultLayouts[view.type]) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
dataviews_context_default.Provider,
{
value: {
view,
onChangeView,
fields: _fields,
actions,
data,
isLoading,
paginationInfo,
selection: _selection,
onChangeSelection: setSelectionWithChange,
openedFilter,
setOpenedFilter,
getItemId,
getItemLevel,
isItemClickable,
onClickItem,
renderItemLink,
containerWidth,
containerRef,
resizeObserverRef,
defaultLayouts,
filters,
isShowingFilter,
setIsShowingFilter,
config,
empty,
hasInfiniteScrollHandler: !!infiniteScrollHandler
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataviews-wrapper", ref: containerRef, children: children ?? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DefaultUI,
{
header,
search,
searchLabel
}
) })
}
);
}
const DataViewsSubComponents = DataViews;
DataViewsSubComponents.BulkActionToolbar = BulkActionsFooter;
DataViewsSubComponents.Filters = filters_default;
DataViewsSubComponents.FiltersToggled = filters_toggled_default;
DataViewsSubComponents.FiltersToggle = toggle_default;
DataViewsSubComponents.Layout = DataViewsLayout;
DataViewsSubComponents.LayoutSwitcher = ViewTypeMenu;
DataViewsSubComponents.Pagination = dataviews_pagination_DataViewsPagination;
DataViewsSubComponents.Search = dataviews_search_default;
DataViewsSubComponents.ViewConfig = DataviewsViewConfigDropdown;
DataViewsSubComponents.Footer = DataViewsFooter;
var dataviews_default = DataViewsSubComponents;
// EXTERNAL MODULE: ./node_modules/@wordpress/views/build-module/index.js + 4 modules
var build_module = __webpack_require__(7951);
;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/use-pattern-settings.js
function usePatternSettings() {
const storedSettings = (0,external_wp_data_.useSelect)((select) => {
const { getSettings } = unlock(select(store));
return getSettings();
}, []);
const settingsBlockPatterns = storedSettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0
storedSettings.__experimentalBlockPatterns;
const restBlockPatterns = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).getBlockPatterns(),
[]
);
const blockPatterns = (0,external_wp_element_.useMemo)(
() => [
...settingsBlockPatterns || [],
...restBlockPatterns || []
].filter(filterOutDuplicatesByName),
[settingsBlockPatterns, restBlockPatterns]
);
const settings = (0,external_wp_element_.useMemo)(() => {
const { __experimentalAdditionalBlockPatterns, ...restStoredSettings } = storedSettings;
return {
...restStoredSettings,
__experimentalBlockPatterns: blockPatterns,
isPreviewMode: true
};
}, [storedSettings, blockPatterns]);
return settings;
}
;// ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js
var symbol_filled_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/upload.js
var upload_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z" }) });
;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-pattern/index.js
const { useHistory: add_new_pattern_useHistory, useLocation: add_new_pattern_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
const { CreatePatternModal, useAddPatternCategory } = unlock(
external_wp_patterns_namespaceObject.privateApis
);
const { CreateTemplatePartModal } = unlock(external_wp_editor_namespaceObject.privateApis);
function AddNewPattern() {
const history = add_new_pattern_useHistory();
const location = add_new_pattern_useLocation();
const [showPatternModal, setShowPatternModal] = (0,external_wp_element_.useState)(false);
const [showTemplatePartModal, setShowTemplatePartModal] = (0,external_wp_element_.useState)(false);
const { createPatternFromFile } = unlock((0,external_wp_data_.useDispatch)(external_wp_patterns_namespaceObject.store));
const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_.useDispatch)(external_wp_notices_namespaceObject.store);
const patternUploadInputRef = (0,external_wp_element_.useRef)();
const {
isBlockBasedTheme,
addNewPatternLabel,
addNewTemplatePartLabel,
canCreatePattern,
canCreateTemplatePart
} = (0,external_wp_data_.useSelect)((select) => {
const { getCurrentTheme, getPostType, canUser } = select(external_wp_coreData_namespaceObject.store);
return {
isBlockBasedTheme: getCurrentTheme()?.is_block_theme,
addNewPatternLabel: getPostType(PATTERN_TYPES.user)?.labels?.add_new_item,
addNewTemplatePartLabel: getPostType(TEMPLATE_PART_POST_TYPE)?.labels?.add_new_item,
// Blocks refers to the wp_block post type, this checks the ability to create a post of that type.
canCreatePattern: canUser("create", {
kind: "postType",
name: PATTERN_TYPES.user
}),
canCreateTemplatePart: canUser("create", {
kind: "postType",
name: TEMPLATE_PART_POST_TYPE
})
};
}, []);
function handleCreatePattern({ pattern }) {
setShowPatternModal(false);
history.navigate(
`/${PATTERN_TYPES.user}/${pattern.id}?canvas=edit`
);
}
function handleCreateTemplatePart(templatePart) {
setShowTemplatePartModal(false);
history.navigate(
`/${TEMPLATE_PART_POST_TYPE}/${templatePart.id}?canvas=edit`
);
}
function handleError() {
setShowPatternModal(false);
setShowTemplatePartModal(false);
}
const controls = [];
if (canCreatePattern) {
controls.push({
icon: symbol_default,
onClick: () => setShowPatternModal(true),
title: addNewPatternLabel
});
}
if (isBlockBasedTheme && canCreateTemplatePart) {
controls.push({
icon: symbol_filled_default,
onClick: () => setShowTemplatePartModal(true),
title: addNewTemplatePartLabel
});
}
if (canCreatePattern) {
controls.push({
icon: upload_default,
onClick: () => {
patternUploadInputRef.current.click();
},
title: (0,external_wp_i18n_namespaceObject.__)("Import pattern from JSON")
});
}
const { categoryMap, findOrCreateTerm } = useAddPatternCategory();
if (controls.length === 0) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
addNewPatternLabel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropdownMenu,
{
controls,
icon: null,
toggleProps: {
variant: "primary",
showTooltip: false,
__next40pxDefaultSize: true
},
text: addNewPatternLabel,
label: addNewPatternLabel
}
),
showPatternModal && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CreatePatternModal,
{
onClose: () => setShowPatternModal(false),
onSuccess: handleCreatePattern,
onError: handleError
}
),
showTemplatePartModal && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CreateTemplatePartModal,
{
closeModal: () => setShowTemplatePartModal(false),
blocks: [],
onCreate: handleCreateTemplatePart,
onError: handleError
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"input",
{
type: "file",
accept: ".json",
hidden: true,
ref: patternUploadInputRef,
onChange: async (event) => {
const file = event.target.files?.[0];
if (!file) {
return;
}
try {
let currentCategoryId;
if (location.query.postType !== TEMPLATE_PART_POST_TYPE) {
const currentCategory = Array.from(
categoryMap.values()
).find(
(term) => term.name === location.query.categoryId
);
if (currentCategory) {
currentCategoryId = currentCategory.id || await findOrCreateTerm(
currentCategory.label
);
}
}
const pattern = await createPatternFromFile(
file,
currentCategoryId ? [currentCategoryId] : void 0
);
if (!currentCategoryId && location.query.categoryId !== "my-patterns") {
history.navigate(
`/pattern?categoryId=${PATTERN_DEFAULT_CATEGORY}`
);
}
createSuccessNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The imported pattern's title.
(0,external_wp_i18n_namespaceObject.__)('Imported "%s" from JSON.'),
pattern.title.raw
),
{
type: "snackbar",
id: "import-pattern-success"
}
);
} catch (err) {
createErrorNotice(err.message, {
type: "snackbar",
id: "import-pattern-error"
});
} finally {
event.target.value = "";
}
}
}
)
] });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/rename-category-menu-item.js
const { RenamePatternCategoryModal } = unlock(external_wp_patterns_namespaceObject.privateApis);
function RenameCategoryMenuItem({ category, onClose }) {
const [isModalOpen, setIsModalOpen] = (0,external_wp_element_.useState)(false);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => setIsModalOpen(true), children: (0,external_wp_i18n_namespaceObject.__)("Rename") }),
isModalOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
rename_category_menu_item_RenameModal,
{
category,
onClose: () => {
setIsModalOpen(false);
onClose();
}
}
)
] });
}
function rename_category_menu_item_RenameModal({ category, onClose }) {
const normalizedCategory = {
id: category.id,
slug: category.slug,
name: category.label
};
const existingCategories = usePatternCategories();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
RenamePatternCategoryModal,
{
category: normalizedCategory,
existingCategories,
onClose,
overlayClassName: "edit-site-list__rename-modal",
focusOnMount: "firstContentElement",
size: "small"
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/delete-category-menu-item.js
const { useHistory: delete_category_menu_item_useHistory } = unlock(external_wp_router_namespaceObject.privateApis);
function DeleteCategoryMenuItem({ category, onClose }) {
const [isModalOpen, setIsModalOpen] = (0,external_wp_element_.useState)(false);
const history = delete_category_menu_item_useHistory();
const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_.useDispatch)(external_wp_notices_namespaceObject.store);
const { deleteEntityRecord, invalidateResolution } = (0,external_wp_data_.useDispatch)(external_wp_coreData_namespaceObject.store);
const onDelete = async () => {
try {
await deleteEntityRecord(
"taxonomy",
"wp_pattern_category",
category.id,
{ force: true },
{ throwOnError: true }
);
invalidateResolution("getUserPatternCategories");
invalidateResolution("getEntityRecords", [
"postType",
PATTERN_TYPES.user,
{ per_page: -1 }
]);
createSuccessNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: The pattern category's name */
(0,external_wp_i18n_namespaceObject._x)('"%s" deleted.', "pattern category"),
category.label
),
{ type: "snackbar", id: "pattern-category-delete" }
);
onClose?.();
history.navigate(
`/pattern?categoryId=${PATTERN_DEFAULT_CATEGORY}`
);
} catch (error) {
const errorMessage = error.message && error.code !== "unknown_error" ? error.message : (0,external_wp_i18n_namespaceObject.__)(
"An error occurred while deleting the pattern category."
);
createErrorNotice(errorMessage, {
type: "snackbar",
id: "pattern-category-delete"
});
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { isDestructive: true, onClick: () => setIsModalOpen(true), children: (0,external_wp_i18n_namespaceObject.__)("Delete") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalConfirmDialog,
{
isOpen: isModalOpen,
onConfirm: onDelete,
onCancel: () => setIsModalOpen(false),
confirmButtonText: (0,external_wp_i18n_namespaceObject.__)("Delete"),
className: "edit-site-patterns__delete-modal",
title: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The pattern category's name.
(0,external_wp_i18n_namespaceObject._x)('Delete "%s"?', "pattern category"),
(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(category.label)
),
size: "medium",
__experimentalHideHeader: false,
children: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The pattern category's name.
(0,external_wp_i18n_namespaceObject.__)(
'Are you sure you want to delete the category "%s"? The patterns will not be deleted.'
),
(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(category.label)
)
}
)
] });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/actions.js
function PatternsActions({ categoryId, type }) {
const { patternCategories } = usePatternCategories();
let patternCategory;
if (type === PATTERN_TYPES.user && !!categoryId) {
patternCategory = patternCategories.find(
(category) => category.name === categoryId
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(AddNewPattern, {}),
!!patternCategory?.id && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropdownMenu,
{
icon: more_vertical_default,
label: (0,external_wp_i18n_namespaceObject.__)("Actions"),
toggleProps: {
className: "edit-site-patterns__button",
size: "compact"
},
children: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
RenameCategoryMenuItem,
{
category: patternCategory,
onClose
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DeleteCategoryMenuItem,
{
category: patternCategory,
onClose
}
)
] })
}
)
] });
}
;// ./node_modules/@wordpress/icons/build-module/library/pencil.js
var pencil_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" }) });
;// ./node_modules/@wordpress/edit-site/build-module/components/dataviews-actions/index.js
const { useHistory: dataviews_actions_useHistory } = unlock(external_wp_router_namespaceObject.privateApis);
const useEditPostAction = () => {
const history = dataviews_actions_useHistory();
return (0,external_wp_element_.useMemo)(
() => ({
id: "edit-post",
label: (0,external_wp_i18n_namespaceObject.__)("Edit"),
isPrimary: true,
icon: pencil_default,
isEligible(post) {
if (post.status === "trash") {
return false;
}
return post.type !== PATTERN_TYPES.theme;
},
callback(items) {
const post = items[0];
history.navigate(`/${post.type}/${post.id}?canvas=edit`);
}
}),
[history]
);
};
;// ./node_modules/@wordpress/icons/build-module/library/plugins.js
var plugins_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/globe.js
var globe_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8Zm6.5 8c0 .6 0 1.2-.2 1.8h-2.7c0-.6.2-1.1.2-1.8s0-1.2-.2-1.8h2.7c.2.6.2 1.1.2 1.8Zm-.9-3.2h-2.4c-.3-.9-.7-1.8-1.1-2.4-.1-.2-.2-.4-.3-.5 1.6.5 3 1.6 3.8 3ZM12.8 17c-.3.5-.6 1-.8 1.3-.2-.3-.5-.8-.8-1.3-.3-.5-.6-1.1-.8-1.7h3.3c-.2.6-.5 1.2-.8 1.7Zm-2.9-3.2c-.1-.6-.2-1.1-.2-1.8s0-1.2.2-1.8H14c.1.6.2 1.1.2 1.8s0 1.2-.2 1.8H9.9ZM11.2 7c.3-.5.6-1 .8-1.3.2.3.5.8.8 1.3.3.5.6 1.1.8 1.7h-3.3c.2-.6.5-1.2.8-1.7Zm-1-1.2c-.1.2-.2.3-.3.5-.4.7-.8 1.5-1.1 2.4H6.4c.8-1.4 2.2-2.5 3.8-3Zm-1.8 8H5.7c-.2-.6-.2-1.1-.2-1.8s0-1.2.2-1.8h2.7c0 .6-.2 1.1-.2 1.8s0 1.2.2 1.8Zm-2 1.4h2.4c.3.9.7 1.8 1.1 2.4.1.2.2.4.3.5-1.6-.5-3-1.6-3.8-3Zm7.4 3c.1-.2.2-.3.3-.5.4-.7.8-1.5 1.1-2.4h2.4c-.8 1.4-2.2 2.5-3.8 3Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js
var comment_author_avatar_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
d: "M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",
clipRule: "evenodd"
}
) });
;// ./node_modules/@wordpress/edit-site/build-module/components/page-templates/hooks.js
function useAddedBy(postType, postId) {
return (0,external_wp_data_.useSelect)(
(select) => {
const { getEntityRecord, getUser, getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store);
const template = getEditedEntityRecord(
"postType",
postType,
postId
);
const originalSource = template?.original_source;
const authorText = template?.author_text;
switch (originalSource) {
case "theme": {
return {
type: originalSource,
icon: layout_default,
text: authorText,
isCustomized: template.source === TEMPLATE_ORIGINS.custom
};
}
case "plugin": {
return {
type: originalSource,
icon: plugins_default,
text: authorText,
isCustomized: template.source === TEMPLATE_ORIGINS.custom
};
}
case "site": {
const siteData = getEntityRecord(
"root",
"__unstableBase"
);
return {
type: originalSource,
icon: globe_default,
imageUrl: siteData?.site_logo ? getEntityRecord(
"postType",
"attachment",
siteData.site_logo
)?.source_url : void 0,
text: authorText,
isCustomized: false
};
}
default: {
const user = getUser(template.author);
return {
type: "user",
icon: comment_author_avatar_default,
imageUrl: user?.avatar_urls?.[48],
text: authorText,
isCustomized: false
};
}
}
},
[postType, postId]
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/fields.js
const { useGlobalStyle: fields_useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function PreviewField({ item }) {
const descriptionId = (0,external_wp_element_.useId)();
const description = item.description || item?.excerpt?.raw;
const isTemplatePart = item.type === TEMPLATE_PART_POST_TYPE;
const [backgroundColor] = fields_useGlobalStyle("color.background");
const blocks = (0,external_wp_element_.useMemo)(() => {
return item.blocks ?? (0,external_wp_blocks_namespaceObject.parse)(item.content.raw, {
__unstableSkipMigrationLogs: true
});
}, [item?.content?.raw, item.blocks]);
const isEmpty = !blocks?.length;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
className: "page-patterns-preview-field",
style: { backgroundColor },
"aria-describedby": !!description ? descriptionId : void 0,
children: [
isEmpty && isTemplatePart && (0,external_wp_i18n_namespaceObject.__)("Empty template part"),
isEmpty && !isTemplatePart && (0,external_wp_i18n_namespaceObject.__)("Empty pattern"),
!isEmpty && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview.Async, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.BlockPreview,
{
blocks,
viewportWidth: item.viewportWidth
}
) }),
!!description && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { hidden: true, id: descriptionId, children: description })
]
}
);
}
const previewField = {
label: (0,external_wp_i18n_namespaceObject.__)("Preview"),
id: "preview",
render: PreviewField,
enableSorting: false
};
const SYNC_FILTERS = [
{
value: PATTERN_SYNC_TYPES.full,
label: (0,external_wp_i18n_namespaceObject._x)("Synced", "pattern (singular)"),
description: (0,external_wp_i18n_namespaceObject.__)("Patterns that are kept in sync across the site.")
},
{
value: PATTERN_SYNC_TYPES.unsynced,
label: (0,external_wp_i18n_namespaceObject._x)("Not synced", "pattern (singular)"),
description: (0,external_wp_i18n_namespaceObject.__)(
"Patterns that can be changed freely without affecting the site."
)
}
];
const patternStatusField = {
label: (0,external_wp_i18n_namespaceObject.__)("Sync status"),
id: "sync-status",
render: ({ item }) => {
const syncStatus = "wp_pattern_sync_status" in item ? item.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full : PATTERN_SYNC_TYPES.unsynced;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: `edit-site-patterns__field-sync-status-${syncStatus}`,
children: SYNC_FILTERS.find(({ value }) => value === syncStatus).label
}
);
},
elements: SYNC_FILTERS,
filterBy: {
operators: [OPERATOR_IS],
isPrimary: true
},
enableSorting: false
};
function AuthorField({ item }) {
const [isImageLoaded, setIsImageLoaded] = (0,external_wp_element_.useState)(false);
const { text, icon, imageUrl } = useAddedBy(item.type, item.id);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "left", spacing: 0, children: [
imageUrl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx("page-templates-author-field__avatar", {
"is-loaded": isImageLoaded
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
onLoad: () => setIsImageLoaded(true),
alt: "",
src: imageUrl
}
)
}
),
!imageUrl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "page-templates-author-field__icon", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_default, { icon }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "page-templates-author-field__name", children: text })
] });
}
const templatePartAuthorField = {
label: (0,external_wp_i18n_namespaceObject.__)("Author"),
id: "author",
getValue: ({ item }) => item.author_text,
render: AuthorField,
filterBy: {
isPrimary: true
}
};
;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/index.js
const { ExperimentalBlockEditorProvider: page_patterns_ExperimentalBlockEditorProvider } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const { usePostActions, patternTitleField } = unlock(external_wp_editor_namespaceObject.privateApis);
const { useLocation: page_patterns_useLocation, useHistory: page_patterns_useHistory } = unlock(external_wp_router_namespaceObject.privateApis);
const page_patterns_EMPTY_ARRAY = [];
const defaultLayouts = {
[LAYOUT_TABLE]: {
layout: {
styles: {
author: {
width: "1%"
}
}
}
},
[LAYOUT_GRID]: {
layout: {
badgeFields: ["sync-status"]
}
}
};
const DEFAULT_VIEW = {
type: LAYOUT_GRID,
perPage: 20,
titleField: "title",
mediaField: "preview",
fields: ["sync-status"],
filters: [],
...defaultLayouts[LAYOUT_GRID]
};
function usePagePatternsHeader(type, categoryId) {
const { patternCategories } = usePatternCategories();
const templatePartAreas = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_part_areas || [],
[]
);
let title, description, patternCategory;
if (type === TEMPLATE_PART_POST_TYPE) {
const templatePartArea = templatePartAreas.find(
(area) => area.area === categoryId
);
title = templatePartArea?.label || (0,external_wp_i18n_namespaceObject.__)("All Template Parts");
description = templatePartArea?.description || (0,external_wp_i18n_namespaceObject.__)("Includes every template part defined for any area.");
} else if (type === PATTERN_TYPES.user && !!categoryId) {
patternCategory = patternCategories.find(
(category) => category.name === categoryId
);
title = patternCategory?.label;
description = patternCategory?.description;
}
return { title, description };
}
function DataviewsPatterns() {
const { path, query } = page_patterns_useLocation();
const { postType = "wp_block", categoryId: categoryIdFromURL } = query;
const history = page_patterns_useHistory();
const categoryId = categoryIdFromURL || PATTERN_DEFAULT_CATEGORY;
const { view, updateView, isModified, resetToDefault } = (0,build_module.useView)({
kind: "postType",
name: postType,
slug: categoryId,
defaultView: DEFAULT_VIEW,
queryParams: {
page: query.pageNumber,
search: query.search
},
onChangeQueryParams: (params) => {
history.navigate(
(0,external_wp_url_namespaceObject.addQueryArgs)(path, {
...query,
pageNumber: params.page,
search: params.search
})
);
}
});
const viewSyncStatus = view.filters?.find(
({ field }) => field === "sync-status"
)?.value;
const { patterns, isResolving } = use_patterns_default(postType, categoryId, {
search: view.search,
syncStatus: viewSyncStatus
});
const { records } = (0,external_wp_coreData_namespaceObject.useEntityRecords)("postType", TEMPLATE_PART_POST_TYPE, {
per_page: -1
});
const authors = (0,external_wp_element_.useMemo)(() => {
if (!records) {
return page_patterns_EMPTY_ARRAY;
}
const authorsSet = /* @__PURE__ */ new Set();
records.forEach((template) => {
authorsSet.add(template.author_text);
});
return Array.from(authorsSet).map((author) => ({
value: author,
label: author
}));
}, [records]);
const fields = (0,external_wp_element_.useMemo)(() => {
const _fields = [previewField, patternTitleField];
if (postType === PATTERN_TYPES.user) {
_fields.push(patternStatusField);
} else if (postType === TEMPLATE_PART_POST_TYPE) {
_fields.push({
...templatePartAuthorField,
elements: authors
});
}
return _fields;
}, [postType, authors]);
const { data, paginationInfo } = (0,external_wp_element_.useMemo)(() => {
const viewWithoutFilters = { ...view };
delete viewWithoutFilters.search;
if (postType !== TEMPLATE_PART_POST_TYPE) {
viewWithoutFilters.filters = [];
}
return filterSortAndPaginate(patterns, viewWithoutFilters, fields);
}, [patterns, view, fields, postType]);
const dataWithPermissions = useAugmentPatternsWithPermissions(data);
const templatePartActions = usePostActions({
postType: TEMPLATE_PART_POST_TYPE,
context: "list"
});
const patternActions = usePostActions({
postType: PATTERN_TYPES.user,
context: "list"
});
const editAction = useEditPostAction();
const actions = (0,external_wp_element_.useMemo)(() => {
if (postType === TEMPLATE_PART_POST_TYPE) {
return [editAction, ...templatePartActions].filter(Boolean);
}
return [editAction, ...patternActions].filter(Boolean);
}, [editAction, postType, templatePartActions, patternActions]);
const settings = usePatternSettings();
const { title, description } = usePagePatternsHeader(
postType,
categoryId
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(page_patterns_ExperimentalBlockEditorProvider, { settings, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
page_page_default,
{
className: "edit-site-page-patterns-dataviews",
title,
subTitle: description,
actions: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
isModified && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
onClick: resetToDefault,
children: (0,external_wp_i18n_namespaceObject.__)("Reset view")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsActions, {})
] }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
dataviews_default,
{
paginationInfo,
fields,
actions,
data: dataWithPermissions || page_patterns_EMPTY_ARRAY,
getItemId: (item) => item.name ?? item.id,
isLoading: isResolving,
isItemClickable: (item) => item.type !== PATTERN_TYPES.theme,
onClickItem: (item) => {
history.navigate(
`/${item.type}/${[
PATTERN_TYPES.user,
TEMPLATE_PART_POST_TYPE
].includes(item.type) ? item.id : item.name}?canvas=edit`
);
},
view,
onChangeView: updateView,
defaultLayouts
},
categoryId + postType
)
}
) });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/patterns.js
const patternsRoute = {
name: "patterns",
path: "/pattern",
areas: {
sidebar({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
const backPath = isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? "/" : void 0;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenPatterns, { backPath });
},
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsPatterns, {}),
mobile({ siteData, query }) {
const { categoryId } = query;
const isBlockTheme = siteData.currentTheme?.is_block_theme;
const backPath = isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? "/" : void 0;
return !!categoryId ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsPatterns, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenPatterns, { backPath });
}
}
};
;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/pattern-item.js
const patternItemRoute = {
name: "pattern-item",
path: "/wp_block/:postId",
areas: {
sidebar({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
const backPath = isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? "/" : void 0;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenPatterns, { backPath });
},
mobile: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}),
preview: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {})
}
};
;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/template-part-item.js
const templatePartItemRoute = {
name: "template-part-item",
path: "/wp_template_part/*postId",
areas: {
sidebar: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenPatterns, { backPath: "/" }),
mobile: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}),
preview: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {})
}
};
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-templates-browse/content.js
const { useLocation: content_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
const content_EMPTY_ARRAY = [];
function TemplateDataviewItem({ template, isActive }) {
const { text, icon } = useAddedBy(template.type, template.id);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationItem,
{
to: (0,external_wp_url_namespaceObject.addQueryArgs)("/template", { activeView: text }),
icon,
"aria-current": isActive,
children: text
}
);
}
function DataviewsTemplatesSidebarContent() {
const {
query: { activeView = "all" }
} = content_useLocation();
const { records } = (0,external_wp_coreData_namespaceObject.useEntityRecords)("postType", TEMPLATE_POST_TYPE, {
per_page: -1
});
const firstItemPerAuthorText = (0,external_wp_element_.useMemo)(() => {
const firstItemPerAuthor = records?.reduce((acc, template) => {
const author = template.author_text;
if (author && !acc[author]) {
acc[author] = template;
}
return acc;
}, {});
return (firstItemPerAuthor && Object.values(firstItemPerAuthor)) ?? content_EMPTY_ARRAY;
}, [records]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-templates-browse", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationItem,
{
to: "/template",
icon: layout_default,
"aria-current": activeView === "all",
children: (0,external_wp_i18n_namespaceObject.__)("All templates")
}
),
firstItemPerAuthorText.map((template) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
TemplateDataviewItem,
{
template,
isActive: activeView === template.author_text
},
template.author_text
);
})
] });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-templates-browse/index.js
function SidebarNavigationScreenTemplatesBrowse({ backPath }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationScreen,
{
title: (0,external_wp_i18n_namespaceObject.__)("Templates"),
description: (0,external_wp_i18n_namespaceObject.__)(
"Create new templates, or reset any customizations made to the templates supplied by your theme."
),
backPath,
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsTemplatesSidebarContent, {})
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/home.js
var home_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/verse.js
var verse_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/pin.js
var pin_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/archive.js
var archive_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M11.934 7.406a1 1 0 0 0 .914.594H19a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h5.764a.5.5 0 0 1 .447.276l.723 1.63Zm1.064-1.216a.5.5 0 0 0 .462.31H19a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5.764a2 2 0 0 1 1.789 1.106l.445 1.084ZM8.5 10.5h7V12h-7v-1.5Zm7 3.5h-7v1.5h7V14Z"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/not-found.js
var not_found_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm.5 12c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v10zm-11-7.6h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-.9 3.5H6.3l1.2-1.7v1.7zm5.6-3.2c-.4-.2-.8-.4-1.2-.4-.5 0-.9.1-1.2.4-.4.2-.6.6-.8 1-.2.4-.3.9-.3 1.5s.1 1.1.3 1.6c.2.4.5.8.8 1 .4.2.8.4 1.2.4.5 0 .9-.1 1.2-.4.4-.2.6-.6.8-1 .2-.4.3-1 .3-1.6 0-.6-.1-1.1-.3-1.5-.1-.5-.4-.8-.8-1zm0 3.6c-.1.3-.3.5-.5.7-.2.1-.4.2-.7.2-.3 0-.5-.1-.7-.2-.2-.1-.4-.4-.5-.7-.1-.3-.2-.7-.2-1.2 0-.7.1-1.2.4-1.5.3-.3.6-.5 1-.5s.7.2 1 .5c.3.3.4.8.4 1.5-.1.5-.1.9-.2 1.2zm5-3.9h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-1 3.5H16l1.2-1.7v1.7z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/list.js
var list_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/block-meta.js
var block_meta_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
d: "M8.95 11.25H4v1.5h4.95v4.5H13V18c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75h-2.55v-7.5H13V9c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75H8.95v4.5ZM14.5 15v3c0 .3.2.5.5.5h3c.3 0 .5-.2.5-.5v-3c0-.3-.2-.5-.5-.5h-3c-.3 0-.5.2-.5.5Zm0-6V6c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5Z",
clipRule: "evenodd"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/calendar.js
var calendar_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/tag.js
var tag_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/media.js
var media_media_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7 6.5 4 2.5-4 2.5z" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z"
}
)
] });
;// ./node_modules/@wordpress/icons/build-module/library/post.js
var post_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z" }) });
;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/utils.js
const EMPTY_OBJECT = {};
const utils_getValueFromObjectPath = (object, path) => {
let value = object;
path.split(".").forEach((fieldName) => {
value = value?.[fieldName];
});
return value;
};
function prefixSlug(prefix, slug) {
return `${prefix}-${(0,external_wp_url_namespaceObject.safeDecodeURI)(slug)}`;
}
const mapToIHasNameAndId = (entities, path) => {
return (entities || []).map((entity) => ({
...entity,
name: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(utils_getValueFromObjectPath(entity, path))
}));
};
const useExistingTemplates = () => {
return (0,external_wp_data_.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).getEntityRecords(
"postType",
TEMPLATE_POST_TYPE,
{
per_page: -1
}
),
[]
);
};
const useDefaultTemplateTypes = () => {
return (0,external_wp_data_.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_types || [],
[]
);
};
const usePublicPostTypes = () => {
const postTypes = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).getPostTypes({ per_page: -1 }),
[]
);
return (0,external_wp_element_.useMemo)(() => {
const excludedPostTypes = ["attachment"];
return postTypes?.filter(
({ viewable, slug }) => viewable && !excludedPostTypes.includes(slug)
).sort((a, b) => {
if (a.slug === "post" || b.slug === "post") {
return 0;
}
return a.name.localeCompare(b.name);
});
}, [postTypes]);
};
const usePublicTaxonomies = () => {
const taxonomies = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).getTaxonomies({ per_page: -1 }),
[]
);
return (0,external_wp_element_.useMemo)(() => {
return taxonomies?.filter(
({ visibility }) => visibility?.publicly_queryable
);
}, [taxonomies]);
};
function usePostTypeArchiveMenuItems() {
const publicPostTypes = usePublicPostTypes();
const postTypesWithArchives = (0,external_wp_element_.useMemo)(
() => publicPostTypes?.filter((postType) => postType.has_archive),
[publicPostTypes]
);
const existingTemplates = useExistingTemplates();
const postTypeLabels = (0,external_wp_element_.useMemo)(
() => publicPostTypes?.reduce((accumulator, { labels }) => {
const singularName = labels.singular_name.toLowerCase();
accumulator[singularName] = (accumulator[singularName] || 0) + 1;
return accumulator;
}, {}),
[publicPostTypes]
);
const needsUniqueIdentifier = (0,external_wp_element_.useCallback)(
({ labels, slug }) => {
const singularName = labels.singular_name.toLowerCase();
return postTypeLabels[singularName] > 1 && singularName !== slug;
},
[postTypeLabels]
);
return (0,external_wp_element_.useMemo)(
() => postTypesWithArchives?.filter(
(postType) => !(existingTemplates || []).some(
(existingTemplate) => existingTemplate.slug === "archive-" + postType.slug
)
).map((postType) => {
let title;
if (needsUniqueIdentifier(postType)) {
title = (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %1s: Name of the post type e.g: "Post"; %2s: Slug of the post type e.g: "book".
(0,external_wp_i18n_namespaceObject.__)("Archive: %1$s (%2$s)"),
postType.labels.singular_name,
postType.slug
);
} else {
title = (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Name of the post type e.g: "Post".
(0,external_wp_i18n_namespaceObject.__)("Archive: %s"),
postType.labels.singular_name
);
}
return {
slug: "archive-" + postType.slug,
description: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Name of the post type e.g: "Post".
(0,external_wp_i18n_namespaceObject.__)(
"Displays an archive with the latest posts of type: %s."
),
postType.labels.singular_name
),
title,
// `icon` is the `menu_icon` property of a post type. We
// only handle `dashicons` for now, even if the `menu_icon`
// also supports urls and svg as values.
icon: typeof postType.icon === "string" && postType.icon.startsWith("dashicons-") ? postType.icon.slice(10) : archive_default,
templatePrefix: "archive"
};
}) || [],
[postTypesWithArchives, existingTemplates, needsUniqueIdentifier]
);
}
const usePostTypeMenuItems = (onClickMenuItem) => {
const publicPostTypes = usePublicPostTypes();
const existingTemplates = useExistingTemplates();
const defaultTemplateTypes = useDefaultTemplateTypes();
const templateLabels = (0,external_wp_element_.useMemo)(
() => publicPostTypes?.reduce((accumulator, { labels }) => {
const templateName = (labels.template_name || labels.singular_name).toLowerCase();
accumulator[templateName] = (accumulator[templateName] || 0) + 1;
return accumulator;
}, {}),
[publicPostTypes]
);
const needsUniqueIdentifier = (0,external_wp_element_.useCallback)(
({ labels, slug }) => {
const templateName = (labels.template_name || labels.singular_name).toLowerCase();
return templateLabels[templateName] > 1 && templateName !== slug;
},
[templateLabels]
);
const templatePrefixes = (0,external_wp_element_.useMemo)(
() => publicPostTypes?.reduce((accumulator, { slug }) => {
let suffix = slug;
if (slug !== "page") {
suffix = `single-${suffix}`;
}
accumulator[slug] = suffix;
return accumulator;
}, {}),
[publicPostTypes]
);
const postTypesInfo = useEntitiesInfo("postType", templatePrefixes);
const existingTemplateSlugs = (existingTemplates || []).map(
({ slug }) => slug
);
const menuItems = (publicPostTypes || []).reduce(
(accumulator, postType) => {
const { slug, labels, icon } = postType;
const generalTemplateSlug = templatePrefixes[slug];
const defaultTemplateType = defaultTemplateTypes?.find(
({ slug: _slug }) => _slug === generalTemplateSlug
);
const hasGeneralTemplate = existingTemplateSlugs?.includes(generalTemplateSlug);
const _needsUniqueIdentifier = needsUniqueIdentifier(postType);
let menuItemTitle = labels.template_name || (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Name of the post type e.g: "Post".
(0,external_wp_i18n_namespaceObject.__)("Single item: %s"),
labels.singular_name
);
if (_needsUniqueIdentifier) {
menuItemTitle = labels.template_name ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Name of the template e.g: "Single Item: Post". 2: Slug of the post type e.g: "book".
(0,external_wp_i18n_namespaceObject._x)("%1$s (%2$s)", "post type menu label"),
labels.template_name,
slug
) : (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Name of the post type e.g: "Post". 2: Slug of the post type e.g: "book".
(0,external_wp_i18n_namespaceObject._x)(
"Single item: %1$s (%2$s)",
"post type menu label"
),
labels.singular_name,
slug
);
}
const menuItem = defaultTemplateType ? {
...defaultTemplateType,
templatePrefix: templatePrefixes[slug]
} : {
slug: generalTemplateSlug,
title: menuItemTitle,
description: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Name of the post type e.g: "Post".
(0,external_wp_i18n_namespaceObject.__)("Displays a single item: %s."),
labels.singular_name
),
// `icon` is the `menu_icon` property of a post type. We
// only handle `dashicons` for now, even if the `menu_icon`
// also supports urls and svg as values.
icon: typeof icon === "string" && icon.startsWith("dashicons-") ? icon.slice(10) : post_default,
templatePrefix: templatePrefixes[slug]
};
const hasEntities = postTypesInfo?.[slug]?.hasEntities;
if (hasEntities) {
menuItem.onClick = (template) => {
onClickMenuItem({
type: "postType",
slug,
config: {
recordNamePath: "title.rendered",
queryArgs: ({ search }) => {
return {
_fields: "id,title,slug,link",
orderBy: search ? "relevance" : "modified",
exclude: postTypesInfo[slug].existingEntitiesIds
};
},
getSpecificTemplate: (suggestion) => {
const templateSlug = prefixSlug(
templatePrefixes[slug],
suggestion.slug
);
return {
title: templateSlug,
slug: templateSlug,
templatePrefix: templatePrefixes[slug]
};
}
},
labels,
hasGeneralTemplate,
template
});
};
}
if (!hasGeneralTemplate || hasEntities) {
accumulator.push(menuItem);
}
return accumulator;
},
[]
);
const postTypesMenuItems = (0,external_wp_element_.useMemo)(
() => menuItems.reduce(
(accumulator, postType) => {
const { slug } = postType;
let key = "postTypesMenuItems";
if (slug === "page") {
key = "defaultPostTypesMenuItems";
}
accumulator[key].push(postType);
return accumulator;
},
{ defaultPostTypesMenuItems: [], postTypesMenuItems: [] }
),
[menuItems]
);
return postTypesMenuItems;
};
const useTaxonomiesMenuItems = (onClickMenuItem) => {
const publicTaxonomies = usePublicTaxonomies();
const existingTemplates = useExistingTemplates();
const defaultTemplateTypes = useDefaultTemplateTypes();
const templatePrefixes = (0,external_wp_element_.useMemo)(
() => publicTaxonomies?.reduce((accumulator, { slug }) => {
let suffix = slug;
if (!["category", "post_tag"].includes(slug)) {
suffix = `taxonomy-${suffix}`;
}
if (slug === "post_tag") {
suffix = `tag`;
}
accumulator[slug] = suffix;
return accumulator;
}, {}),
[publicTaxonomies]
);
const taxonomyLabels = publicTaxonomies?.reduce(
(accumulator, { labels }) => {
const templateName = (labels.template_name || labels.singular_name).toLowerCase();
accumulator[templateName] = (accumulator[templateName] || 0) + 1;
return accumulator;
},
{}
);
const needsUniqueIdentifier = (labels, slug) => {
if (["category", "post_tag"].includes(slug)) {
return false;
}
const templateName = (labels.template_name || labels.singular_name).toLowerCase();
return taxonomyLabels[templateName] > 1 && templateName !== slug;
};
const taxonomiesInfo = useEntitiesInfo("taxonomy", templatePrefixes);
const existingTemplateSlugs = (existingTemplates || []).map(
({ slug }) => slug
);
const menuItems = (publicTaxonomies || []).reduce(
(accumulator, taxonomy) => {
const { slug, labels } = taxonomy;
const generalTemplateSlug = templatePrefixes[slug];
const defaultTemplateType = defaultTemplateTypes?.find(
({ slug: _slug }) => _slug === generalTemplateSlug
);
const hasGeneralTemplate = existingTemplateSlugs?.includes(generalTemplateSlug);
const _needsUniqueIdentifier = needsUniqueIdentifier(
labels,
slug
);
let menuItemTitle = labels.template_name || labels.singular_name;
if (_needsUniqueIdentifier) {
menuItemTitle = labels.template_name ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Name of the template e.g: "Products by Category". 2: Slug of the taxonomy e.g: "product_cat".
(0,external_wp_i18n_namespaceObject._x)("%1$s (%2$s)", "taxonomy template menu label"),
labels.template_name,
slug
) : (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: 1: Name of the taxonomy e.g: "Category". 2: Slug of the taxonomy e.g: "product_cat".
(0,external_wp_i18n_namespaceObject._x)("%1$s (%2$s)", "taxonomy menu label"),
labels.singular_name,
slug
);
}
const menuItem = defaultTemplateType ? {
...defaultTemplateType,
templatePrefix: templatePrefixes[slug]
} : {
slug: generalTemplateSlug,
title: menuItemTitle,
description: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Name of the taxonomy e.g: "Product Categories".
(0,external_wp_i18n_namespaceObject.__)("Displays taxonomy: %s."),
labels.singular_name
),
icon: block_meta_default,
templatePrefix: templatePrefixes[slug]
};
const hasEntities = taxonomiesInfo?.[slug]?.hasEntities;
if (hasEntities) {
menuItem.onClick = (template) => {
onClickMenuItem({
type: "taxonomy",
slug,
config: {
queryArgs: ({ search }) => {
return {
_fields: "id,name,slug,link",
orderBy: search ? "name" : "count",
exclude: taxonomiesInfo[slug].existingEntitiesIds
};
},
getSpecificTemplate: (suggestion) => {
const templateSlug = prefixSlug(
templatePrefixes[slug],
suggestion.slug
);
return {
title: templateSlug,
slug: templateSlug,
templatePrefix: templatePrefixes[slug]
};
}
},
labels,
hasGeneralTemplate,
template
});
};
}
if (!hasGeneralTemplate || hasEntities) {
accumulator.push(menuItem);
}
return accumulator;
},
[]
);
const taxonomiesMenuItems = (0,external_wp_element_.useMemo)(
() => menuItems.reduce(
(accumulator, taxonomy) => {
const { slug } = taxonomy;
let key = "taxonomiesMenuItems";
if (["category", "tag"].includes(slug)) {
key = "defaultTaxonomiesMenuItems";
}
accumulator[key].push(taxonomy);
return accumulator;
},
{ defaultTaxonomiesMenuItems: [], taxonomiesMenuItems: [] }
),
[menuItems]
);
return taxonomiesMenuItems;
};
const USE_AUTHOR_MENU_ITEM_TEMPLATE_PREFIX = { user: "author" };
const USE_AUTHOR_MENU_ITEM_QUERY_PARAMETERS = { user: { who: "authors" } };
function useAuthorMenuItem(onClickMenuItem) {
const existingTemplates = useExistingTemplates();
const defaultTemplateTypes = useDefaultTemplateTypes();
const authorInfo = useEntitiesInfo(
"root",
USE_AUTHOR_MENU_ITEM_TEMPLATE_PREFIX,
USE_AUTHOR_MENU_ITEM_QUERY_PARAMETERS
);
let authorMenuItem = defaultTemplateTypes?.find(
({ slug }) => slug === "author"
);
if (!authorMenuItem) {
authorMenuItem = {
description: (0,external_wp_i18n_namespaceObject.__)(
"Displays latest posts written by a single author."
),
slug: "author",
title: "Author"
};
}
const hasGeneralTemplate = !!existingTemplates?.find(
({ slug }) => slug === "author"
);
if (authorInfo.user?.hasEntities) {
authorMenuItem = { ...authorMenuItem, templatePrefix: "author" };
authorMenuItem.onClick = (template) => {
onClickMenuItem({
type: "root",
slug: "user",
config: {
queryArgs: ({ search }) => {
return {
_fields: "id,name,slug,link",
orderBy: search ? "name" : "registered_date",
exclude: authorInfo.user.existingEntitiesIds,
who: "authors"
};
},
getSpecificTemplate: (suggestion) => {
const templateSlug = prefixSlug(
"author",
suggestion.slug
);
return {
title: templateSlug,
slug: templateSlug,
templatePrefix: "author"
};
}
},
labels: {
singular_name: (0,external_wp_i18n_namespaceObject.__)("Author"),
search_items: (0,external_wp_i18n_namespaceObject.__)("Search Authors"),
not_found: (0,external_wp_i18n_namespaceObject.__)("No authors found."),
all_items: (0,external_wp_i18n_namespaceObject.__)("All Authors")
},
hasGeneralTemplate,
template
});
};
}
if (!hasGeneralTemplate || authorInfo.user?.hasEntities) {
return authorMenuItem;
}
}
const useExistingTemplateSlugs = (templatePrefixes) => {
const existingTemplates = useExistingTemplates();
const existingSlugs = (0,external_wp_element_.useMemo)(() => {
return Object.entries(templatePrefixes || {}).reduce(
(accumulator, [slug, prefix]) => {
const slugsWithTemplates = (existingTemplates || []).reduce(
(_accumulator, existingTemplate) => {
const _prefix = `${prefix}-`;
if (existingTemplate.slug.startsWith(_prefix)) {
_accumulator.push(
existingTemplate.slug.substring(
_prefix.length
)
);
}
return _accumulator;
},
[]
);
if (slugsWithTemplates.length) {
accumulator[slug] = slugsWithTemplates;
}
return accumulator;
},
{}
);
}, [templatePrefixes, existingTemplates]);
return existingSlugs;
};
const useTemplatesToExclude = (entityName, templatePrefixes, additionalQueryParameters = {}) => {
const slugsToExcludePerEntity = useExistingTemplateSlugs(templatePrefixes);
const recordsToExcludePerEntity = (0,external_wp_data_.useSelect)(
(select) => {
return Object.entries(slugsToExcludePerEntity || {}).reduce(
(accumulator, [slug, slugsWithTemplates]) => {
const entitiesWithTemplates = select(
external_wp_coreData_namespaceObject.store
).getEntityRecords(entityName, slug, {
_fields: "id",
context: "view",
slug: slugsWithTemplates,
...additionalQueryParameters[slug]
});
if (entitiesWithTemplates?.length) {
accumulator[slug] = entitiesWithTemplates;
}
return accumulator;
},
{}
);
},
[slugsToExcludePerEntity]
);
return recordsToExcludePerEntity;
};
const useEntitiesInfo = (entityName, templatePrefixes, additionalQueryParameters = EMPTY_OBJECT) => {
const recordsToExcludePerEntity = useTemplatesToExclude(
entityName,
templatePrefixes,
additionalQueryParameters
);
const entitiesHasRecords = (0,external_wp_data_.useSelect)(
(select) => {
return Object.keys(templatePrefixes || {}).reduce(
(accumulator, slug) => {
const existingEntitiesIds = recordsToExcludePerEntity?.[slug]?.map(
({ id }) => id
) || [];
accumulator[slug] = !!select(
external_wp_coreData_namespaceObject.store
).getEntityRecords(entityName, slug, {
per_page: 1,
_fields: "id",
context: "view",
exclude: existingEntitiesIds,
...additionalQueryParameters[slug]
})?.length;
return accumulator;
},
{}
);
},
[
templatePrefixes,
recordsToExcludePerEntity,
entityName,
additionalQueryParameters
]
);
const entitiesInfo = (0,external_wp_element_.useMemo)(() => {
return Object.keys(templatePrefixes || {}).reduce(
(accumulator, slug) => {
const existingEntitiesIds = recordsToExcludePerEntity?.[slug]?.map(
({ id }) => id
) || [];
accumulator[slug] = {
hasEntities: entitiesHasRecords[slug],
existingEntitiesIds
};
return accumulator;
},
{}
);
}, [templatePrefixes, recordsToExcludePerEntity, entitiesHasRecords]);
return entitiesInfo;
};
;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/add-custom-template-modal-content.js
const add_custom_template_modal_content_EMPTY_ARRAY = [];
function SuggestionListItem({
suggestion,
search,
onSelect,
entityForSuggestions
}) {
const baseCssClass = "edit-site-custom-template-modal__suggestions_list__list-item";
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Composite.Item,
{
render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
role: "option",
className: baseCssClass,
onClick: () => onSelect(
entityForSuggestions.config.getSpecificTemplate(
suggestion
)
)
}
),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalText,
{
size: "body",
lineHeight: 1.53846153846,
weight: 500,
className: `${baseCssClass}__title`,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextHighlight,
{
text: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(suggestion.name),
highlight: search
}
)
}
),
suggestion.link && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalText,
{
size: "body",
lineHeight: 1.53846153846,
className: `${baseCssClass}__info`,
children: (0,external_wp_url_namespaceObject.safeDecodeURI)(suggestion.link)
}
)
]
}
);
}
function useSearchSuggestions(entityForSuggestions, search) {
const { config } = entityForSuggestions;
const query = (0,external_wp_element_.useMemo)(
() => ({
order: "asc",
context: "view",
search,
per_page: search ? 20 : 10,
...config.queryArgs(search)
}),
[search, config]
);
const { records: searchResults, hasResolved: searchHasResolved } = (0,external_wp_coreData_namespaceObject.useEntityRecords)(
entityForSuggestions.type,
entityForSuggestions.slug,
query
);
const [suggestions, setSuggestions] = (0,external_wp_element_.useState)(add_custom_template_modal_content_EMPTY_ARRAY);
(0,external_wp_element_.useEffect)(() => {
if (!searchHasResolved) {
return;
}
let newSuggestions = add_custom_template_modal_content_EMPTY_ARRAY;
if (searchResults?.length) {
newSuggestions = searchResults;
if (config.recordNamePath) {
newSuggestions = mapToIHasNameAndId(
newSuggestions,
config.recordNamePath
);
}
}
setSuggestions(newSuggestions);
}, [searchResults, searchHasResolved]);
return suggestions;
}
function SuggestionList({ entityForSuggestions, onSelect }) {
const [search, setSearch, debouncedSearch] = (0,external_wp_compose_namespaceObject.useDebouncedInput)();
const suggestions = useSearchSuggestions(
entityForSuggestions,
debouncedSearch
);
const { labels } = entityForSuggestions;
const [showSearchControl, setShowSearchControl] = (0,external_wp_element_.useState)(false);
if (!showSearchControl && suggestions?.length > 9) {
setShowSearchControl(true);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
showSearchControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SearchControl,
{
__nextHasNoMarginBottom: true,
onChange: setSearch,
value: search,
label: labels.search_items,
placeholder: labels.search_items
}
),
!!suggestions?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Composite,
{
orientation: "vertical",
role: "listbox",
className: "edit-site-custom-template-modal__suggestions_list",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Suggestions list"),
children: suggestions.map((suggestion) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SuggestionListItem,
{
suggestion,
search: debouncedSearch,
onSelect,
entityForSuggestions
},
suggestion.slug
))
}
),
debouncedSearch && !suggestions?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalText,
{
as: "p",
className: "edit-site-custom-template-modal__no-results",
children: labels.not_found
}
)
] });
}
function AddCustomTemplateModalContent({
onSelect,
entityForSuggestions,
onBack,
containerRef
}) {
const [showSearchEntities, setShowSearchEntities] = (0,external_wp_element_.useState)(
entityForSuggestions.hasGeneralTemplate
);
(0,external_wp_element_.useEffect)(() => {
if (containerRef.current) {
const [firstFocusable] = external_wp_dom_namespaceObject.focus.focusable.find(
containerRef.current
);
firstFocusable?.focus();
}
}, [showSearchEntities]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
spacing: 4,
className: "edit-site-custom-template-modal__contents-wrapper",
alignment: "left",
children: [
!showSearchEntities && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { as: "p", children: (0,external_wp_i18n_namespaceObject.__)(
"Select whether to create a single template for all items or a specific one."
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Flex,
{
className: "edit-site-custom-template-modal__contents",
gap: "4",
align: "initial",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.FlexItem,
{
isBlock: true,
as: external_wp_components_namespaceObject.Button,
onClick: () => {
const {
slug,
title,
description,
templatePrefix
} = entityForSuggestions.template;
onSelect({
slug,
title,
description,
templatePrefix
});
},
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalText,
{
as: "span",
weight: 500,
lineHeight: 1.53846153846,
children: entityForSuggestions.labels.all_items
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalText,
{
as: "span",
lineHeight: 1.53846153846,
// translators: The user is given the choice to set up a template for all items of a post type or taxonomy, or just a specific one.
children: (0,external_wp_i18n_namespaceObject.__)("For all items")
}
)
]
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.FlexItem,
{
isBlock: true,
as: external_wp_components_namespaceObject.Button,
onClick: () => {
setShowSearchEntities(true);
},
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalText,
{
as: "span",
weight: 500,
lineHeight: 1.53846153846,
children: entityForSuggestions.labels.singular_name
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalText,
{
as: "span",
lineHeight: 1.53846153846,
// translators: The user is given the choice to set up a template for all items of a post type or taxonomy, or just a specific one.
children: (0,external_wp_i18n_namespaceObject.__)("For a specific item")
}
)
]
}
)
]
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { justify: "right", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: onBack,
children: (0,external_wp_i18n_namespaceObject.__)("Back")
}
) })
] }),
showSearchEntities && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { as: "p", children: (0,external_wp_i18n_namespaceObject.__)(
"This template will be used only for the specific item chosen."
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SuggestionList,
{
entityForSuggestions,
onSelect
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { justify: "right", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: () => {
if (entityForSuggestions.hasGeneralTemplate) {
onBack();
} else {
setShowSearchEntities(false);
}
},
children: (0,external_wp_i18n_namespaceObject.__)("Back")
}
) })
] })
]
}
);
}
var add_custom_template_modal_content_default = AddCustomTemplateModalContent;
;// ./node_modules/tslib/tslib.es6.mjs
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
}
return __assign.apply(this, arguments);
}
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
}
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
var _, done = false;
for (var i = decorators.length - 1; i >= 0; i--) {
var context = {};
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
if (kind === "accessor") {
if (result === void 0) continue;
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
if (_ = accept(result.get)) descriptor.get = _;
if (_ = accept(result.set)) descriptor.set = _;
if (_ = accept(result.init)) initializers.unshift(_);
}
else if (_ = accept(result)) {
if (kind === "field") initializers.unshift(_);
else descriptor[key] = _;
}
}
if (target) Object.defineProperty(target, contextIn.name, descriptor);
done = true;
};
function __runInitializers(thisArg, initializers, value) {
var useValue = arguments.length > 2;
for (var i = 0; i < initializers.length; i++) {
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
}
return useValue ? value : void 0;
};
function __propKey(x) {
return typeof x === "symbol" ? x : "".concat(x);
};
function __setFunctionName(f, name, prefix) {
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
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;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
var __createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
});
function __exportStar(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
}
/** @deprecated */
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
/** @deprecated */
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}
function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}
function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
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);
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); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}
function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __setModuleDefault = Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
};
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
}
function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
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");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
function __classPrivateFieldSet(receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
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");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}
function __classPrivateFieldIn(state, receiver) {
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
return typeof state === "function" ? receiver === state : state.has(receiver);
}
function __addDisposableResource(env, value, async) {
if (value !== null && value !== void 0) {
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
var dispose, inner;
if (async) {
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
dispose = value[Symbol.asyncDispose];
}
if (dispose === void 0) {
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
dispose = value[Symbol.dispose];
if (async) inner = dispose;
}
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
env.stack.push({ value: value, dispose: dispose, async: async });
}
else if (async) {
env.stack.push({ async: true });
}
return value;
}
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
function __disposeResources(env) {
function fail(e) {
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
env.hasError = true;
}
var r, s = 0;
function next() {
while (r = env.stack.pop()) {
try {
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
if (r.dispose) {
var result = r.dispose.call(r.value);
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
}
else s |= 1;
}
catch (e) {
fail(e);
}
}
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
if (env.hasError) throw env.error;
}
return next();
}
function __rewriteRelativeImportExtension(path, preserveJsx) {
if (typeof path === "string" && /^\.\.?\//.test(path)) {
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
});
}
return path;
}
/* harmony default export */ const tslib_es6 = ({
__extends,
__assign,
__rest,
__decorate,
__param,
__esDecorate,
__runInitializers,
__propKey,
__setFunctionName,
__metadata,
__awaiter,
__generator,
__createBinding,
__exportStar,
__values,
__read,
__spread,
__spreadArrays,
__spreadArray,
__await,
__asyncGenerator,
__asyncDelegator,
__asyncValues,
__makeTemplateObject,
__importStar,
__importDefault,
__classPrivateFieldGet,
__classPrivateFieldSet,
__classPrivateFieldIn,
__addDisposableResource,
__disposeResources,
__rewriteRelativeImportExtension,
});
;// ./node_modules/lower-case/dist.es2015/index.js
/**
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
*/
var SUPPORTED_LOCALE = {
tr: {
regexp: /\u0130|\u0049|\u0049\u0307/g,
map: {
İ: "\u0069",
I: "\u0131",
İ: "\u0069",
},
},
az: {
regexp: /\u0130/g,
map: {
İ: "\u0069",
I: "\u0131",
İ: "\u0069",
},
},
lt: {
regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
map: {
I: "\u0069\u0307",
J: "\u006A\u0307",
Į: "\u012F\u0307",
Ì: "\u0069\u0307\u0300",
Í: "\u0069\u0307\u0301",
Ĩ: "\u0069\u0307\u0303",
},
},
};
/**
* Localized lower case.
*/
function localeLowerCase(str, locale) {
var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
if (lang)
return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
return lowerCase(str);
}
/**
* Lower case as a function.
*/
function lowerCase(str) {
return str.toLowerCase();
}
;// ./node_modules/no-case/dist.es2015/index.js
// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
// Remove all non-word characters.
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
/**
* Normalize the string into something other libraries can manipulate easier.
*/
function noCase(input, options) {
if (options === void 0) { options = {}; }
var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
var start = 0;
var end = result.length;
// Trim the delimiter from around the output string.
while (result.charAt(start) === "\0")
start++;
while (result.charAt(end - 1) === "\0")
end--;
// Transform each token independently.
return result.slice(start, end).split("\0").map(transform).join(delimiter);
}
/**
* Replace `re` in the input string with the replacement value.
*/
function replace(input, re, value) {
if (re instanceof RegExp)
return input.replace(re, value);
return re.reduce(function (input, re) { return input.replace(re, value); }, input);
}
;// ./node_modules/dot-case/dist.es2015/index.js
function dotCase(input, options) {
if (options === void 0) { options = {}; }
return noCase(input, __assign({ delimiter: "." }, options));
}
;// ./node_modules/param-case/dist.es2015/index.js
function paramCase(input, options) {
if (options === void 0) { options = {}; }
return dotCase(input, __assign({ delimiter: "-" }, options));
}
;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/add-custom-generic-template-modal-content.js
function AddCustomGenericTemplateModalContent({ createTemplate, onBack }) {
const [title, setTitle] = (0,external_wp_element_.useState)("");
const defaultTitle = (0,external_wp_i18n_namespaceObject.__)("Custom Template");
const [isBusy, setIsBusy] = (0,external_wp_element_.useState)(false);
const inputRef = (0,external_wp_element_.useRef)();
(0,external_wp_element_.useEffect)(() => {
if (inputRef.current) {
inputRef.current.focus();
}
}, []);
async function onCreateTemplate(event) {
event.preventDefault();
if (isBusy) {
return;
}
setIsBusy(true);
try {
await createTemplate(
{
slug: paramCase(title || defaultTitle) || "wp-custom-template",
title: title || defaultTitle
},
false
);
} finally {
setIsBusy(false);
}
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: onCreateTemplate, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 6, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Name"),
value: title,
onChange: setTitle,
placeholder: defaultTitle,
disabled: isBusy,
ref: inputRef,
help: (0,external_wp_i18n_namespaceObject.__)(
// eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts
'Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.'
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
className: "edit-site-custom-generic-template__modal-actions",
justify: "right",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: onBack,
children: (0,external_wp_i18n_namespaceObject.__)("Back")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "primary",
type: "submit",
isBusy,
"aria-disabled": isBusy,
children: (0,external_wp_i18n_namespaceObject.__)("Create")
}
)
]
}
)
] }) });
}
var add_custom_generic_template_modal_content_default = AddCustomGenericTemplateModalContent;
;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/index.js
const { useHistory: add_new_template_useHistory } = unlock(external_wp_router_namespaceObject.privateApis);
const DEFAULT_TEMPLATE_SLUGS = [
"front-page",
"home",
"single",
"page",
"index",
"archive",
"author",
"category",
"date",
"tag",
"search",
"404"
];
const TEMPLATE_ICONS = {
"front-page": home_default,
home: verse_default,
single: pin_default,
page: page_default,
archive: archive_default,
search: search_default,
404: not_found_default,
index: list_default,
category: category_default,
author: comment_author_avatar_default,
taxonomy: block_meta_default,
date: calendar_default,
tag: tag_default,
attachment: media_media_default
};
function TemplateListItem({
title,
direction,
className,
description,
icon,
onClick,
children
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
className,
onClick,
label: description,
showTooltip: !!description,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Flex,
{
as: "span",
spacing: 2,
align: "center",
justify: "center",
style: { width: "100%" },
direction,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-add-new-template__template-icon", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalVStack,
{
className: "edit-site-add-new-template__template-name",
alignment: "center",
spacing: 0,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalText,
{
align: "center",
weight: 500,
lineHeight: 1.53846153846,
children: title
}
),
children
]
}
)
]
}
)
}
);
}
const modalContentMap = {
templatesList: 1,
customTemplate: 2,
customGenericTemplate: 3
};
function NewTemplateModal({ onClose }) {
const [modalContent, setModalContent] = (0,external_wp_element_.useState)(
modalContentMap.templatesList
);
const [entityForSuggestions, setEntityForSuggestions] = (0,external_wp_element_.useState)({});
const [isSubmitting, setIsSubmitting] = (0,external_wp_element_.useState)(false);
const missingTemplates = useMissingTemplates(
setEntityForSuggestions,
() => setModalContent(modalContentMap.customTemplate)
);
const history = add_new_template_useHistory();
const { saveEntityRecord } = (0,external_wp_data_.useDispatch)(external_wp_coreData_namespaceObject.store);
const { createErrorNotice, createSuccessNotice } = (0,external_wp_data_.useDispatch)(external_wp_notices_namespaceObject.store);
const containerRef = (0,external_wp_element_.useRef)(null);
const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
const homeUrl = (0,external_wp_data_.useSelect)((select) => {
return select(external_wp_coreData_namespaceObject.store).getEntityRecord("root", "__unstableBase")?.home;
}, []);
const TEMPLATE_SHORT_DESCRIPTIONS = {
"front-page": homeUrl,
date: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The homepage url.
(0,external_wp_i18n_namespaceObject.__)("E.g. %s"),
homeUrl + "/" + (/* @__PURE__ */ new Date()).getFullYear()
)
};
(0,external_wp_element_.useEffect)(() => {
if (containerRef.current && modalContent === modalContentMap.templatesList) {
const [firstFocusable] = external_wp_dom_namespaceObject.focus.focusable.find(
containerRef.current
);
firstFocusable?.focus();
}
}, [modalContent]);
async function createTemplate(template, isWPSuggestion = true) {
if (isSubmitting) {
return;
}
setIsSubmitting(true);
try {
const { title, description, slug } = template;
const newTemplate = await saveEntityRecord(
"postType",
TEMPLATE_POST_TYPE,
{
description,
// Slugs need to be strings, so this is for template `404`
slug: slug.toString(),
status: "publish",
title,
// This adds a post meta field in template that is part of `is_custom` value calculation.
is_wp_suggestion: isWPSuggestion
},
{ throwOnError: true }
);
history.navigate(
`/${TEMPLATE_POST_TYPE}/${newTemplate.id}?canvas=edit`
);
createSuccessNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Title of the created post or template, e.g: "Hello world".
(0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'),
(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(newTemplate.title?.rendered || title) || (0,external_wp_i18n_namespaceObject.__)("(no title)")
),
{
type: "snackbar"
}
);
} catch (error) {
const errorMessage = error.message && error.code !== "unknown_error" ? error.message : (0,external_wp_i18n_namespaceObject.__)("An error occurred while creating the template.");
createErrorNotice(errorMessage, {
type: "snackbar"
});
} finally {
setIsSubmitting(false);
}
}
const onModalClose = () => {
onClose();
setModalContent(modalContentMap.templatesList);
};
let modalTitle = (0,external_wp_i18n_namespaceObject.__)("Add template");
if (modalContent === modalContentMap.customTemplate) {
modalTitle = (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Name of the post type e.g: "Post".
(0,external_wp_i18n_namespaceObject.__)("Add template: %s"),
entityForSuggestions.labels.singular_name
);
} else if (modalContent === modalContentMap.customGenericTemplate) {
modalTitle = (0,external_wp_i18n_namespaceObject.__)("Create custom template");
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Modal,
{
title: modalTitle,
className: dist_clsx("edit-site-add-new-template__modal", {
"edit-site-add-new-template__modal_template_list": modalContent === modalContentMap.templatesList,
"edit-site-custom-template-modal": modalContent === modalContentMap.customTemplate
}),
onRequestClose: onModalClose,
overlayClassName: modalContent === modalContentMap.customGenericTemplate ? "edit-site-custom-generic-template__modal" : void 0,
ref: containerRef,
children: [
modalContent === modalContentMap.templatesList && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalGrid,
{
columns: isMobile ? 2 : 3,
gap: 4,
align: "flex-start",
justify: "center",
className: "edit-site-add-new-template__template-list__contents",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { className: "edit-site-add-new-template__template-list__prompt", children: (0,external_wp_i18n_namespaceObject.__)(
"Select what the new template should apply to:"
) }),
missingTemplates.map((template) => {
const { title, slug, onClick } = template;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
TemplateListItem,
{
title,
direction: "column",
className: "edit-site-add-new-template__template-button",
description: TEMPLATE_SHORT_DESCRIPTIONS[slug],
icon: TEMPLATE_ICONS[slug] || layout_default,
onClick: () => onClick ? onClick(template) : createTemplate(template)
},
slug
);
}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
TemplateListItem,
{
title: (0,external_wp_i18n_namespaceObject.__)("Custom template"),
direction: "row",
className: "edit-site-add-new-template__custom-template-button",
icon: pencil_default,
onClick: () => setModalContent(
modalContentMap.customGenericTemplate
),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalText,
{
lineHeight: 1.53846153846,
children: (0,external_wp_i18n_namespaceObject.__)(
"A custom template can be manually applied to any post or page."
)
}
)
}
)
]
}
),
modalContent === modalContentMap.customTemplate && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
add_custom_template_modal_content_default,
{
onSelect: createTemplate,
entityForSuggestions,
onBack: () => setModalContent(modalContentMap.templatesList),
containerRef
}
),
modalContent === modalContentMap.customGenericTemplate && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
add_custom_generic_template_modal_content_default,
{
createTemplate,
onBack: () => setModalContent(modalContentMap.templatesList)
}
)
]
}
);
}
function NewTemplate() {
const [showModal, setShowModal] = (0,external_wp_element_.useState)(false);
const { postType } = (0,external_wp_data_.useSelect)((select) => {
const { getPostType } = select(external_wp_coreData_namespaceObject.store);
return {
postType: getPostType(TEMPLATE_POST_TYPE)
};
}, []);
if (!postType) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: "primary",
onClick: () => setShowModal(true),
label: postType.labels.add_new_item,
__next40pxDefaultSize: true,
children: postType.labels.add_new_item
}
),
showModal && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NewTemplateModal, { onClose: () => setShowModal(false) })
] });
}
function useMissingTemplates(setEntityForSuggestions, onClick) {
const existingTemplates = useExistingTemplates();
const defaultTemplateTypes = useDefaultTemplateTypes();
const existingTemplateSlugs = (existingTemplates || []).map(
({ slug }) => slug
);
const missingDefaultTemplates = (defaultTemplateTypes || []).filter(
(template) => DEFAULT_TEMPLATE_SLUGS.includes(template.slug) && !existingTemplateSlugs.includes(template.slug)
);
const onClickMenuItem = (_entityForSuggestions) => {
onClick?.();
setEntityForSuggestions(_entityForSuggestions);
};
const enhancedMissingDefaultTemplateTypes = [...missingDefaultTemplates];
const { defaultTaxonomiesMenuItems, taxonomiesMenuItems } = useTaxonomiesMenuItems(onClickMenuItem);
const { defaultPostTypesMenuItems, postTypesMenuItems } = usePostTypeMenuItems(onClickMenuItem);
const authorMenuItem = useAuthorMenuItem(onClickMenuItem);
[
...defaultTaxonomiesMenuItems,
...defaultPostTypesMenuItems,
authorMenuItem
].forEach((menuItem) => {
if (!menuItem) {
return;
}
const matchIndex = enhancedMissingDefaultTemplateTypes.findIndex(
(template) => template.slug === menuItem.slug
);
if (matchIndex > -1) {
enhancedMissingDefaultTemplateTypes[matchIndex] = menuItem;
} else {
enhancedMissingDefaultTemplateTypes.push(menuItem);
}
});
enhancedMissingDefaultTemplateTypes?.sort((template1, template2) => {
return DEFAULT_TEMPLATE_SLUGS.indexOf(template1.slug) - DEFAULT_TEMPLATE_SLUGS.indexOf(template2.slug);
});
const missingTemplates = [
...enhancedMissingDefaultTemplateTypes,
...usePostTypeArchiveMenuItems(),
...postTypesMenuItems,
...taxonomiesMenuItems
];
return missingTemplates;
}
var add_new_template_default = (0,external_wp_element_.memo)(NewTemplate);
;// ./node_modules/@wordpress/edit-site/build-module/components/page-templates/fields.js
const { useGlobalStyle: page_templates_fields_useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function fields_PreviewField({ item }) {
const settings = usePatternSettings();
const [backgroundColor = "white"] = page_templates_fields_useGlobalStyle("color.background");
const blocks = (0,external_wp_element_.useMemo)(() => {
return (0,external_wp_blocks_namespaceObject.parse)(item.content.raw);
}, [item.content.raw]);
const isEmpty = !blocks?.length;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorProvider, { post: item, settings, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
className: "page-templates-preview-field",
style: { backgroundColor },
children: [
isEmpty && (0,external_wp_i18n_namespaceObject.__)("Empty template"),
!isEmpty && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview.Async, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview, { blocks }) })
]
}
) });
}
const fields_previewField = {
label: (0,external_wp_i18n_namespaceObject.__)("Preview"),
id: "preview",
render: fields_PreviewField,
enableSorting: false
};
const descriptionField = {
label: (0,external_wp_i18n_namespaceObject.__)("Description"),
id: "description",
render: ({ item }) => {
return item.description && (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.description);
},
enableSorting: false,
enableGlobalSearch: true
};
function fields_AuthorField({ item }) {
const [isImageLoaded, setIsImageLoaded] = (0,external_wp_element_.useState)(false);
const { text, icon, imageUrl } = useAddedBy(item.type, item.id);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "left", spacing: 0, children: [
imageUrl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx("page-templates-author-field__avatar", {
"is-loaded": isImageLoaded
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
onLoad: () => setIsImageLoaded(true),
alt: "",
src: imageUrl
}
)
}
),
!imageUrl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "page-templates-author-field__icon", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "page-templates-author-field__name", children: text })
] });
}
const authorField = {
label: (0,external_wp_i18n_namespaceObject.__)("Author"),
id: "author",
getValue: ({ item }) => item.author_text,
render: fields_AuthorField
};
;// ./node_modules/@wordpress/edit-site/build-module/components/page-templates/view-utils.js
const view_utils_defaultLayouts = {
table: {
showMedia: false
},
grid: {
showMedia: true
},
list: {
showMedia: false
}
};
const view_utils_DEFAULT_VIEW = {
type: "grid",
perPage: 20,
sort: {
field: "title",
direction: "asc"
},
titleField: "title",
descriptionField: "description",
mediaField: "preview",
fields: ["author", "active", "slug"],
filters: [],
...view_utils_defaultLayouts.grid
};
function getDefaultView(activeView) {
return {
...view_utils_DEFAULT_VIEW,
filters: !["active", "user"].includes(activeView) ? [
{
field: "author",
operator: "isAny",
value: [activeView]
}
] : []
};
}
;// ./node_modules/@wordpress/edit-site/build-module/components/page-templates/index.js
const { usePostActions: page_templates_usePostActions, templateTitleField } = unlock(external_wp_editor_namespaceObject.privateApis);
const { useHistory: page_templates_useHistory, useLocation: page_templates_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
const { useEntityRecordsWithPermissions } = unlock(external_wp_coreData_namespaceObject.privateApis);
function PageTemplates() {
const { path, query } = page_templates_useLocation();
const { activeView = "active", postId } = query;
const [selection, setSelection] = (0,external_wp_element_.useState)([postId]);
const defaultView = (0,external_wp_element_.useMemo)(() => {
return getDefaultView(activeView);
}, [activeView]);
const { view, updateView, isModified, resetToDefault } = (0,build_module.useView)({
kind: "postType",
name: TEMPLATE_POST_TYPE,
slug: activeView,
defaultView,
queryParams: {
page: query.pageNumber,
search: query.search
},
onChangeQueryParams: (newQueryParams) => {
history.navigate(
(0,external_wp_url_namespaceObject.addQueryArgs)(path, {
...query,
pageNumber: newQueryParams.page,
search: newQueryParams.search || void 0
})
);
}
});
const { records, isResolving: isLoadingData } = useEntityRecordsWithPermissions("postType", TEMPLATE_POST_TYPE, {
per_page: -1
});
const history = page_templates_useHistory();
const onChangeSelection = (0,external_wp_element_.useCallback)(
(items) => {
setSelection(items);
if (view?.type === "list") {
history.navigate(
(0,external_wp_url_namespaceObject.addQueryArgs)(path, {
postId: items.length === 1 ? items[0] : void 0
})
);
}
},
[history, path, view?.type]
);
const authors = (0,external_wp_element_.useMemo)(() => {
if (!records) {
return [];
}
const authorsSet = /* @__PURE__ */ new Set();
records.forEach((template) => {
authorsSet.add(template.author_text);
});
return Array.from(authorsSet).map((author) => ({
value: author,
label: author
}));
}, [records]);
const fields = (0,external_wp_element_.useMemo)(
() => [
fields_previewField,
templateTitleField,
descriptionField,
{
...authorField,
elements: authors
}
],
[authors]
);
const { data, paginationInfo } = (0,external_wp_element_.useMemo)(() => {
return filterSortAndPaginate(records, view, fields);
}, [records, view, fields]);
const postTypeActions = page_templates_usePostActions({
postType: TEMPLATE_POST_TYPE,
context: "list"
});
const editAction = useEditPostAction();
const actions = (0,external_wp_element_.useMemo)(
() => [editAction, ...postTypeActions],
[postTypeActions, editAction]
);
const onChangeView = (0,external_wp_compose_namespaceObject.useEvent)((newView) => {
if (newView.type !== view.type) {
history.invalidate();
}
updateView(newView);
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
page_page_default,
{
className: "edit-site-page-templates",
title: (0,external_wp_i18n_namespaceObject.__)("Templates"),
actions: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
isModified && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
onClick: () => {
resetToDefault();
history.invalidate();
},
children: (0,external_wp_i18n_namespaceObject.__)("Reset view")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(add_new_template_default, {})
] }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
dataviews_default,
{
paginationInfo,
fields,
actions,
data,
isLoading: isLoadingData,
view,
onChangeView,
onChangeSelection,
isItemClickable: () => true,
onClickItem: ({ id }) => {
history.navigate(`/wp_template/${id}?canvas=edit`);
},
selection,
defaultLayouts: view_utils_defaultLayouts
},
activeView
)
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/templates.js
async function isTemplateListView(query) {
const { activeView = "active" } = query;
const view = await (0,build_module.loadView)({
kind: "postType",
name: "wp_template",
slug: activeView,
defaultView: getDefaultView(activeView)
});
return view.type === "list";
}
const templatesRoute = {
name: "templates",
path: "/template",
areas: {
sidebar({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenTemplatesBrowse, { backPath: "/" }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
},
content({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PageTemplates, {}) : void 0;
},
async preview({ query, siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
if (!isBlockTheme) {
return void 0;
}
const isListView = await isTemplateListView(query);
return isListView ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : void 0;
},
mobile({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PageTemplates, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
}
},
widths: {
async content({ query }) {
const isListView = await isTemplateListView(query);
return isListView ? 380 : void 0;
}
}
};
;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/template-item.js
const templateItemRoute = {
name: "template-item",
path: "/wp_template/*postId",
areas: {
sidebar({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenTemplatesBrowse, { backPath: "/" }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
},
mobile({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
},
preview({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
}
}
};
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/dataview-item.js
const { useLocation: dataview_item_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
function DataViewItem({
title,
slug,
type,
icon,
isActive,
suffix
}) {
const { path } = dataview_item_useLocation();
const iconToUse = icon || VIEW_LAYOUTS.find((v) => v.type === type).icon;
if (slug === "all") {
slug = void 0;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
justify: "flex-start",
className: dist_clsx("edit-site-sidebar-dataviews-dataview-item", {
"is-selected": isActive
}),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationItem,
{
icon: iconToUse,
to: (0,external_wp_url_namespaceObject.addQueryArgs)(path, {
activeView: slug
}),
"aria-current": isActive ? "true" : void 0,
children: title
}
),
suffix
]
}
);
}
;// ./node_modules/@wordpress/icons/build-module/library/pages.js
var pages_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16 2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2ZM6 3.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5Z" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z" })
] });
;// ./node_modules/@wordpress/icons/build-module/library/published.js
var published_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/scheduled.js
var scheduled_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/drafts.js
var drafts_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/pending.js
var pending_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/not-allowed.js
var not_allowed_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z"
}
) });
;// ./node_modules/@wordpress/icons/build-module/library/trash.js
var trash_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"
}
) });
;// ./node_modules/@wordpress/edit-site/build-module/components/post-list/view-utils.js
const post_list_view_utils_defaultLayouts = {
table: {},
grid: {},
list: {}
};
const DEFAULT_POST_BASE = {
type: "list",
filters: [],
perPage: 20,
sort: {
field: "title",
direction: "asc"
},
showLevels: true,
titleField: "title",
mediaField: "featured_media",
fields: ["author", "status"],
...post_list_view_utils_defaultLayouts.list
};
function getDefaultViews(postType) {
return [
{
title: postType?.labels?.all_items || (0,external_wp_i18n_namespaceObject.__)("All items"),
slug: "all",
icon: pages_default,
view: DEFAULT_POST_BASE
},
{
title: (0,external_wp_i18n_namespaceObject.__)("Published"),
slug: "published",
icon: published_default,
view: {
...DEFAULT_POST_BASE,
filters: [
{
field: "status",
operator: OPERATOR_IS_ANY,
value: "publish",
isLocked: true
}
]
}
},
{
title: (0,external_wp_i18n_namespaceObject.__)("Scheduled"),
slug: "future",
icon: scheduled_default,
view: {
...DEFAULT_POST_BASE,
filters: [
{
field: "status",
operator: OPERATOR_IS_ANY,
value: "future",
isLocked: true
}
]
}
},
{
title: (0,external_wp_i18n_namespaceObject.__)("Drafts"),
slug: "drafts",
icon: drafts_default,
view: {
...DEFAULT_POST_BASE,
filters: [
{
field: "status",
operator: OPERATOR_IS_ANY,
value: "draft",
isLocked: true
}
]
}
},
{
title: (0,external_wp_i18n_namespaceObject.__)("Pending"),
slug: "pending",
icon: pending_default,
view: {
...DEFAULT_POST_BASE,
filters: [
{
field: "status",
operator: OPERATOR_IS_ANY,
value: "pending",
isLocked: true
}
]
}
},
{
title: (0,external_wp_i18n_namespaceObject.__)("Private"),
slug: "private",
icon: not_allowed_default,
view: {
...DEFAULT_POST_BASE,
filters: [
{
field: "status",
operator: OPERATOR_IS_ANY,
value: "private",
isLocked: true
}
]
}
},
{
title: (0,external_wp_i18n_namespaceObject.__)("Trash"),
slug: "trash",
icon: trash_default,
view: {
...DEFAULT_POST_BASE,
type: "table",
layout: post_list_view_utils_defaultLayouts.table.layout,
filters: [
{
field: "status",
operator: OPERATOR_IS_ANY,
value: "trash",
isLocked: true
}
]
}
}
];
}
const view_utils_getDefaultView = (postType, activeView) => {
return getDefaultViews(postType).find(
({ slug }) => slug === activeView
)?.view;
};
;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/index.js
const { useLocation: sidebar_dataviews_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
function DataViewsSidebarContent({ postType }) {
const {
query: { activeView = "all" }
} = sidebar_dataviews_useLocation();
const postTypeObject = (0,external_wp_data_.useSelect)(
(select) => {
const { getPostType } = select(external_wp_coreData_namespaceObject.store);
return getPostType(postType);
},
[postType]
);
const defaultViews = (0,external_wp_element_.useMemo)(
() => getDefaultViews(postTypeObject),
[postTypeObject]
);
if (!postType) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { className: "edit-site-sidebar-dataviews", children: defaultViews.map((dataview) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DataViewItem,
{
slug: dataview.slug,
title: dataview.title,
icon: dataview.icon,
type: dataview.view.type,
isActive: dataview.slug === activeView
},
dataview.slug
);
}) }) });
}
;// ./node_modules/@wordpress/icons/build-module/library/drawer-right.js
var drawer_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"
}
) });
;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-post/index.js
function AddNewPostModal({ postType, onSave, onClose }) {
const labels = (0,external_wp_data_.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).getPostType(postType)?.labels,
[postType]
);
const [isCreatingPost, setIsCreatingPost] = (0,external_wp_element_.useState)(false);
const [title, setTitle] = (0,external_wp_element_.useState)("");
const { saveEntityRecord } = (0,external_wp_data_.useDispatch)(external_wp_coreData_namespaceObject.store);
const { createErrorNotice, createSuccessNotice } = (0,external_wp_data_.useDispatch)(external_wp_notices_namespaceObject.store);
const { resolveSelect } = (0,external_wp_data_.useRegistry)();
async function createPost(event) {
event.preventDefault();
if (isCreatingPost) {
return;
}
setIsCreatingPost(true);
try {
const postTypeObject = await resolveSelect(external_wp_coreData_namespaceObject.store).getPostType(postType);
const newPage = await saveEntityRecord(
"postType",
postType,
{
status: "draft",
title,
slug: title ?? void 0,
content: !!postTypeObject.template && postTypeObject.template.length ? (0,external_wp_blocks_namespaceObject.serialize)(
(0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)(
[],
postTypeObject.template
)
) : void 0
},
{ throwOnError: true }
);
onSave(newPage);
createSuccessNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Title of the created post or template, e.g: "Hello world".
(0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'),
(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(newPage.title?.rendered || title) || (0,external_wp_i18n_namespaceObject.__)("(no title)")
),
{ type: "snackbar" }
);
} catch (error) {
const errorMessage = error.message && error.code !== "unknown_error" ? error.message : (0,external_wp_i18n_namespaceObject.__)("An error occurred while creating the item.");
createErrorNotice(errorMessage, {
type: "snackbar"
});
} finally {
setIsCreatingPost(false);
}
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
title: (
// translators: %s: post type singular_name label e.g: "Page".
(0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Draft new: %s"), labels?.singular_name)
),
onRequestClose: onClose,
focusOnMount: "firstContentElement",
size: "small",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: createPost, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Title"),
onChange: setTitle,
placeholder: (0,external_wp_i18n_namespaceObject.__)("No title"),
value: title
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 2, justify: "end", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: onClose,
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "primary",
type: "submit",
isBusy: isCreatingPost,
"aria-disabled": isCreatingPost,
children: (0,external_wp_i18n_namespaceObject.__)("Create draft")
}
)
] })
] }) })
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/post-list/index.js
const { usePostActions: post_list_usePostActions, usePostFields } = unlock(external_wp_editor_namespaceObject.privateApis);
const { useLocation: post_list_useLocation, useHistory: post_list_useHistory } = unlock(external_wp_router_namespaceObject.privateApis);
const { useEntityRecordsWithPermissions: post_list_useEntityRecordsWithPermissions } = unlock(external_wp_coreData_namespaceObject.privateApis);
const post_list_EMPTY_ARRAY = [];
const DEFAULT_STATUSES = "draft,future,pending,private,publish";
function getItemId(item) {
return item.id.toString();
}
function getItemLevel(item) {
return item.level;
}
function PostList({ postType }) {
const { path, query } = post_list_useLocation();
const { activeView = "all", postId, quickEdit = false } = query;
const history = post_list_useHistory();
const postTypeObject = (0,external_wp_data_.useSelect)(
(select) => {
const { getPostType } = select(external_wp_coreData_namespaceObject.store);
return getPostType(postType);
},
[postType]
);
const { view, updateView, isModified, resetToDefault } = (0,build_module.useView)({
kind: "postType",
name: postType,
slug: activeView,
queryParams: {
page: query.pageNumber,
search: query.search
},
onChangeQueryParams: (newQueryParams) => {
history.navigate(
(0,external_wp_url_namespaceObject.addQueryArgs)(path, {
...query,
pageNumber: newQueryParams.page,
search: newQueryParams.search || void 0
})
);
},
defaultView: view_utils_getDefaultView(postTypeObject, activeView)
});
const onChangeView = (0,external_wp_compose_namespaceObject.useEvent)((newView) => {
if (newView.type !== view.type) {
history.invalidate();
}
updateView(newView);
});
const [selection, setSelection] = (0,external_wp_element_.useState)(postId?.split(",") ?? []);
const onChangeSelection = (0,external_wp_element_.useCallback)(
(items) => {
setSelection(items);
history.navigate(
(0,external_wp_url_namespaceObject.addQueryArgs)(path, {
postId: items.join(",")
})
);
},
[path, history]
);
const fields = usePostFields({
postType
});
const queryArgs = (0,external_wp_element_.useMemo)(() => {
const filters = {};
view.filters?.forEach((filter) => {
if (filter.field === "status" && filter.operator === OPERATOR_IS_ANY) {
filters.status = filter.value;
}
if (filter.field === "author" && filter.operator === OPERATOR_IS_ANY) {
filters.author = filter.value;
} else if (filter.field === "author" && filter.operator === OPERATOR_IS_NONE) {
filters.author_exclude = filter.value;
}
});
if (!filters.status || filters.status === "") {
filters.status = DEFAULT_STATUSES;
}
return {
per_page: view.perPage,
page: view.page,
_embed: "author,wp:featuredmedia",
order: view.sort?.direction,
orderby: view.sort?.field,
orderby_hierarchy: !!view.showLevels,
search: view.search,
...filters
};
}, [view]);
const {
records,
isResolving: isLoadingData,
totalItems,
totalPages
} = post_list_useEntityRecordsWithPermissions("postType", postType, queryArgs);
const data = (0,external_wp_element_.useMemo)(() => {
if (view?.sort?.field === "author") {
return filterSortAndPaginate(
records,
{ sort: { ...view.sort } },
fields
).data;
}
return records;
}, [records, fields, view?.sort]);
const ids = data?.map((record) => getItemId(record)) ?? [];
const prevIds = (0,external_wp_compose_namespaceObject.usePrevious)(ids) ?? [];
const deletedIds = prevIds.filter((id) => !ids.includes(id));
const postIdWasDeleted = deletedIds.includes(postId);
(0,external_wp_element_.useEffect)(() => {
if (postIdWasDeleted) {
history.navigate(
(0,external_wp_url_namespaceObject.addQueryArgs)(path, {
postId: void 0
})
);
}
}, [history, postIdWasDeleted, path]);
const paginationInfo = (0,external_wp_element_.useMemo)(
() => ({
totalItems,
totalPages
}),
[totalItems, totalPages]
);
const { labels, canCreateRecord } = (0,external_wp_data_.useSelect)(
(select) => {
const { getPostType, canUser } = select(external_wp_coreData_namespaceObject.store);
return {
labels: getPostType(postType)?.labels,
canCreateRecord: canUser("create", {
kind: "postType",
name: postType
})
};
},
[postType]
);
const postTypeActions = post_list_usePostActions({
postType,
context: "list"
});
const editAction = useEditPostAction();
const actions = (0,external_wp_element_.useMemo)(
() => [editAction, ...postTypeActions],
[postTypeActions, editAction]
);
const [showAddPostModal, setShowAddPostModal] = (0,external_wp_element_.useState)(false);
const openModal = () => setShowAddPostModal(true);
const closeModal = () => setShowAddPostModal(false);
const handleNewPage = ({ type, id }) => {
history.navigate(`/${type}/${id}?canvas=edit`);
closeModal();
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
page_page_default,
{
title: labels?.name,
actions: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
isModified && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
onClick: () => {
resetToDefault();
history.invalidate();
},
children: (0,external_wp_i18n_namespaceObject.__)("Reset view")
}
),
labels?.add_new_item && canCreateRecord && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: "primary",
onClick: openModal,
__next40pxDefaultSize: true,
children: labels.add_new_item
}
),
showAddPostModal && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
AddNewPostModal,
{
postType,
onSave: handleNewPage,
onClose: closeModal
}
)
] })
] }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
dataviews_default,
{
paginationInfo,
fields,
actions,
data: data || post_list_EMPTY_ARRAY,
isLoading: isLoadingData,
view,
onChangeView,
selection,
onChangeSelection,
isItemClickable: (item) => item.status !== "trash",
onClickItem: ({ id }) => {
history.navigate(`/${postType}/${id}?canvas=edit`);
},
getItemId,
getItemLevel,
defaultLayouts: post_list_view_utils_defaultLayouts,
header: window.__experimentalQuickEditDataViews && view.type !== LAYOUT_LIST && postType === "page" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "compact",
isPressed: quickEdit,
icon: drawer_right_default,
label: (0,external_wp_i18n_namespaceObject.__)("Details"),
onClick: () => {
history.navigate(
(0,external_wp_url_namespaceObject.addQueryArgs)(path, {
quickEdit: quickEdit ? void 0 : true
})
);
}
}
)
},
activeView
)
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/components/dataform-context/index.js
const DataFormContext = (0,external_wp_element_.createContext)({
fields: []
});
DataFormContext.displayName = "DataFormContext";
function DataFormProvider({
fields,
children
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormContext.Provider, { value: { fields }, children });
}
var dataform_context_default = DataFormContext;
;// ./node_modules/@wordpress/dataviews/build-module/dataform-layouts/is-combined-field.js
function isCombinedField(field) {
return field.children !== void 0;
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-layouts/normalize-form-fields.js
const DEFAULT_LAYOUT = {
type: "regular",
labelPosition: "top"
};
const normalizeCardSummaryField = (sum) => {
if (typeof sum === "string") {
return [{ id: sum, visibility: "when-collapsed" }];
}
return sum.map((item) => {
if (typeof item === "string") {
return { id: item, visibility: "when-collapsed" };
}
return { id: item.id, visibility: item.visibility };
});
};
function normalizeLayout(layout) {
let normalizedLayout = DEFAULT_LAYOUT;
if (layout?.type === "regular") {
normalizedLayout = {
type: "regular",
labelPosition: layout?.labelPosition ?? "top"
};
} else if (layout?.type === "panel") {
const summary = layout.summary ?? [];
const normalizedSummary = Array.isArray(summary) ? summary : [summary];
normalizedLayout = {
type: "panel",
labelPosition: layout?.labelPosition ?? "side",
openAs: layout?.openAs ?? "dropdown",
summary: normalizedSummary
};
} else if (layout?.type === "card") {
if (layout.withHeader === false) {
normalizedLayout = {
type: "card",
withHeader: false,
isOpened: true,
summary: []
};
} else {
const summary = layout.summary ?? [];
normalizedLayout = {
type: "card",
withHeader: true,
isOpened: typeof layout.isOpened === "boolean" ? layout.isOpened : true,
summary: normalizeCardSummaryField(summary)
};
}
} else if (layout?.type === "row") {
normalizedLayout = {
type: "row",
alignment: layout?.alignment ?? "center",
styles: layout?.styles ?? {}
};
}
return normalizedLayout;
}
function normalizeFormFields(form) {
const formLayout = normalizeLayout(form?.layout);
return (form.fields ?? []).map((field) => {
if (typeof field === "string") {
return {
id: field,
layout: formLayout
};
}
const fieldLayout = field.layout ? normalizeLayout(field.layout) : formLayout;
return {
...field,
layout: fieldLayout
};
});
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-layouts/regular/index.js
function regular_Header({ title }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { className: "dataforms-layouts-regular__header", spacing: 4, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "center", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { level: 2, size: 13, children: title }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, {})
] }) });
}
function FormRegularField({
data,
field,
onChange,
hideLabelFromVision,
validity
}) {
const { fields } = (0,external_wp_element_.useContext)(dataform_context_default);
const form = (0,external_wp_element_.useMemo)(
() => ({
layout: DEFAULT_LAYOUT,
fields: isCombinedField(field) ? field.children : []
}),
[field]
);
if (isCombinedField(field)) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
!hideLabelFromVision && field.label && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(regular_Header, { title: field.label }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DataFormLayout,
{
data,
form,
onChange,
validity: validity?.children
}
)
] });
}
const layout = normalizeLayout({
...field.layout,
type: "regular"
});
const labelPosition = layout.labelPosition;
const fieldDefinition = fields.find(
(fieldDef) => fieldDef.id === field.id
);
if (!fieldDefinition || !fieldDefinition.Edit) {
return null;
}
if (labelPosition === "side") {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { className: "dataforms-layouts-regular__field", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx(
"dataforms-layouts-regular__field-label",
`dataforms-layouts-regular__field-label--label-position-${labelPosition}`
),
children: fieldDefinition.label
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataforms-layouts-regular__field-control", children: fieldDefinition.readOnly === true ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
fieldDefinition.render,
{
item: data,
field: fieldDefinition
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
fieldDefinition.Edit,
{
data,
field: fieldDefinition,
onChange,
hideLabelFromVision: true,
validity
},
fieldDefinition.id
) })
] });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataforms-layouts-regular__field", children: fieldDefinition.readOnly === true ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
!hideLabelFromVision && labelPosition !== "none" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { children: fieldDefinition.label }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
fieldDefinition.render,
{
item: data,
field: fieldDefinition
}
)
] }) }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
fieldDefinition.Edit,
{
data,
field: fieldDefinition,
onChange,
hideLabelFromVision: labelPosition === "none" ? true : hideLabelFromVision,
validity
}
) });
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-layouts/panel/summary-button.js
function SummaryButton({
summaryFields,
data,
labelPosition,
fieldLabel,
disabled,
onClick,
"aria-expanded": ariaExpanded
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
className: "dataforms-layouts-panel__summary-button",
size: "compact",
variant: ["none", "top"].includes(labelPosition) ? "link" : "tertiary",
"aria-expanded": ariaExpanded,
"aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Field name.
(0,external_wp_i18n_namespaceObject._x)("Edit %s", "field"),
fieldLabel || ""
),
onClick,
disabled,
accessibleWhenDisabled: true,
style: summaryFields.length > 1 ? {
minHeight: "auto",
height: "auto",
alignItems: "flex-start"
} : void 0,
children: summaryFields.length > 1 ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
style: {
display: "flex",
flexDirection: "column",
alignItems: "flex-start",
width: "100%",
gap: "2px"
},
children: summaryFields.map((summaryField) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
style: { width: "100%" },
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
summaryField.render,
{
item: data,
field: summaryField
}
)
},
summaryField.id
))
}
) : summaryFields.map((summaryField) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
summaryField.render,
{
item: data,
field: summaryField
},
summaryField.id
))
}
);
}
var summary_button_default = SummaryButton;
;// ./node_modules/@wordpress/dataviews/build-module/dataform-layouts/panel/dropdown.js
function DropdownHeader({
title,
onClose
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalVStack,
{
className: "dataforms-layouts-panel__dropdown-header",
spacing: 4,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "center", children: [
title && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { level: 2, size: 13, children: title }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, {}),
onClose && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
label: (0,external_wp_i18n_namespaceObject.__)("Close"),
icon: close_small_default,
onClick: onClose,
size: "small"
}
)
] })
}
);
}
function PanelDropdown({
data,
field,
onChange,
validity,
labelPosition = "side",
summaryFields,
fieldDefinition,
popoverAnchor
}) {
const fieldLabel = isCombinedField(field) ? field.label : fieldDefinition?.label;
const form = (0,external_wp_element_.useMemo)(
() => ({
layout: DEFAULT_LAYOUT,
fields: isCombinedField(field) ? field.children : (
// If not explicit children return the field id itself.
[{ id: field.id }]
)
}),
[field]
);
const formValidity = (0,external_wp_element_.useMemo)(() => {
if (validity === void 0) {
return void 0;
}
if (isCombinedField(field)) {
return validity?.children;
}
return { [field.id]: validity };
}, [validity, field]);
const popoverProps = (0,external_wp_element_.useMemo)(
() => ({
// Anchor the popover to the middle of the entire row so that it doesn't
// move around when the label changes.
anchor: popoverAnchor,
placement: "left-start",
offset: 36,
shift: true
}),
[popoverAnchor]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
contentClassName: "dataforms-layouts-panel__field-dropdown",
popoverProps,
focusOnMount: true,
toggleProps: {
size: "compact",
variant: "tertiary",
tooltipPosition: "middle left"
},
renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
summary_button_default,
{
summaryFields,
data,
labelPosition,
fieldLabel,
disabled: fieldDefinition.readOnly === true,
onClick: onToggle,
"aria-expanded": isOpen
}
),
renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownHeader, { title: fieldLabel, onClose }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DataFormLayout,
{
data,
form,
onChange,
validity: formValidity,
children: (FieldLayout, childField, childFieldValidity) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FieldLayout,
{
data,
field: childField,
onChange,
hideLabelFromVision: (form?.fields ?? []).length < 2,
validity: childFieldValidity
},
childField.id
)
}
)
] })
}
);
}
var dropdown_default = PanelDropdown;
// EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js
var cjs = __webpack_require__(66);
var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
;// ./node_modules/@wordpress/dataviews/build-module/hooks/use-form-validity.js
const isEmptyNullOrUndefined = (value) => [void 0, "", null].includes(value);
const isArrayOrElementsEmptyNullOrUndefined = (value) => {
return !Array.isArray(value) || value.length === 0 || value.every((element) => isEmptyNullOrUndefined(element));
};
function isInvalidForRequired(fieldType, value) {
if (fieldType === void 0 && isEmptyNullOrUndefined(value) || fieldType === "text" && isEmptyNullOrUndefined(value) || fieldType === "email" && isEmptyNullOrUndefined(value) || fieldType === "url" && isEmptyNullOrUndefined(value) || fieldType === "telephone" && isEmptyNullOrUndefined(value) || fieldType === "password" && isEmptyNullOrUndefined(value) || fieldType === "integer" && isEmptyNullOrUndefined(value) || fieldType === "number" && isEmptyNullOrUndefined(value) || fieldType === "array" && isArrayOrElementsEmptyNullOrUndefined(value) || fieldType === "boolean" && value !== true) {
return true;
}
return false;
}
function isFormValid(formValidity) {
if (!formValidity) {
return true;
}
return Object.values(formValidity).every((fieldValidation) => {
return Object.entries(fieldValidation).every(
([key, validation]) => {
if (key === "children" && validation && typeof validation === "object") {
return isFormValid(validation);
}
return validation.type === "valid";
}
);
});
}
function updateFieldValidity(setFormValidity, parentFieldId, fieldId, newValidity) {
if (parentFieldId) {
setFormValidity((prev) => ({
...prev,
[parentFieldId]: {
...prev?.[parentFieldId],
children: {
...prev?.[parentFieldId]?.children,
[fieldId]: {
...newValidity
}
}
}
}));
} else {
setFormValidity((prev) => ({
...prev,
[fieldId]: {
...newValidity
}
}));
}
}
function getFieldsToValidate(fields, form) {
const formFields = normalizeFormFields(form);
if (formFields.length === 0) {
return { fields: [], fieldToParent: /* @__PURE__ */ new Map() };
}
const fieldToParent = /* @__PURE__ */ new Map();
const fieldIdsToValidate = [];
formFields.forEach((formField) => {
if (!!formField.children) {
formField.children.forEach((child) => {
const childId = typeof child === "string" ? child : child.id;
fieldIdsToValidate.push(childId);
fieldToParent.set(childId, formField.id);
});
} else {
fieldIdsToValidate.push(formField.id);
}
});
return {
fields: normalizeFields(
fields.filter(
(field) => fieldIdsToValidate.includes(field.id)
)
),
fieldToParent
};
}
function useFormValidity(item, fields, form) {
const [formValidity, setFormValidity] = (0,external_wp_element_.useState)();
const previousValidatedValuesRef = (0,external_wp_element_.useRef)({});
const customValidationCounterRef = (0,external_wp_element_.useRef)({});
const elementsValidationCounterRef = (0,external_wp_element_.useRef)(
{}
);
const validate = (0,external_wp_element_.useCallback)(() => {
const { fields: fieldsToValidate, fieldToParent } = getFieldsToValidate(
fields,
form
);
if (fieldsToValidate.length === 0) {
setFormValidity(void 0);
return;
}
fieldsToValidate.forEach((field) => {
const value = field.getValue({ item });
if (previousValidatedValuesRef.current.hasOwnProperty(field.id) && value === previousValidatedValuesRef.current[field.id]) {
return;
}
previousValidatedValuesRef.current[field.id] = value;
const parentFieldId = fieldToParent.get(field.id);
if (field.isValid.required && isInvalidForRequired(field.type, value)) {
updateFieldValidity(setFormValidity, parentFieldId, field.id, {
required: { type: "invalid" }
});
return;
}
if (field.isValid.elements && field.hasElements && !field.getElements && Array.isArray(field.elements)) {
const validValues = field.elements.map((el) => el.value);
if (field.type !== "array" && !validValues.includes(value)) {
updateFieldValidity(
setFormValidity,
parentFieldId,
field.id,
{
elements: {
type: "invalid",
message: "Value must be one of the elements."
}
}
);
return;
}
if (field.type === "array" && !Array.isArray(value)) {
updateFieldValidity(
setFormValidity,
parentFieldId,
field.id,
{
elements: {
type: "invalid",
message: "Value must be an array."
}
}
);
return;
}
if (field.type === "array" && value.some((v) => !validValues.includes(v))) {
updateFieldValidity(
setFormValidity,
parentFieldId,
field.id,
{
elements: {
type: "invalid",
message: "Value must be one of the elements."
}
}
);
return;
}
}
if (field.isValid.elements && field.hasElements && typeof field.getElements === "function") {
const currentToken = (elementsValidationCounterRef.current[field.id] || 0) + 1;
elementsValidationCounterRef.current[field.id] = currentToken;
updateFieldValidity(setFormValidity, parentFieldId, field.id, {
elements: {
type: "validating",
message: "Validating..."
}
});
field.getElements().then((result) => {
if (elementsValidationCounterRef.current[field.id] !== currentToken) {
return;
}
if (!Array.isArray(result)) {
updateFieldValidity(
setFormValidity,
parentFieldId,
field.id,
{
elements: {
type: "invalid",
message: "Could not validate elements."
}
}
);
return;
}
const validValues = result.map((el) => el.value);
if (field.type !== "array" && !validValues.includes(value)) {
updateFieldValidity(
setFormValidity,
parentFieldId,
field.id,
{
elements: {
type: "invalid",
message: "Value must be one of the elements."
}
}
);
return;
}
if (field.type === "array" && !Array.isArray(value)) {
updateFieldValidity(
setFormValidity,
parentFieldId,
field.id,
{
elements: {
type: "invalid",
message: "Value must be an array."
}
}
);
return;
}
if (field.type === "array" && value.some(
(v) => !validValues.includes(v)
)) {
updateFieldValidity(
setFormValidity,
parentFieldId,
field.id,
{
elements: {
type: "invalid",
message: "Value must be one of the elements."
}
}
);
}
}).catch((error) => {
if (elementsValidationCounterRef.current[field.id] !== currentToken) {
return;
}
updateFieldValidity(
setFormValidity,
parentFieldId,
field.id,
{
elements: {
type: "invalid",
message: error.message
}
}
);
});
}
let customError;
try {
customError = field.isValid?.custom?.(
cjs_default()(
item,
field.setValue({
item,
value
})
),
field
);
} catch (error) {
let errorMessage;
if (error instanceof Error) {
errorMessage = error.message;
} else {
errorMessage = String(error) || (0,external_wp_i18n_namespaceObject.__)("Unknown error when running custom validation.");
}
updateFieldValidity(setFormValidity, parentFieldId, field.id, {
custom: {
type: "invalid",
message: errorMessage
}
});
}
if (typeof customError === "string") {
updateFieldValidity(setFormValidity, parentFieldId, field.id, {
custom: {
type: "invalid",
message: customError
}
});
return;
}
if (customError instanceof Promise) {
const currentToken = (customValidationCounterRef.current[field.id] || 0) + 1;
customValidationCounterRef.current[field.id] = currentToken;
updateFieldValidity(setFormValidity, parentFieldId, field.id, {
custom: {
type: "validating",
message: "Validating..."
}
});
customError.then((result) => {
if (customValidationCounterRef.current[field.id] !== currentToken) {
return;
}
if (result === null) {
updateFieldValidity(
setFormValidity,
parentFieldId,
field.id,
{
custom: {
type: "valid",
message: "Valid"
}
}
);
return;
}
if (typeof result === "string") {
updateFieldValidity(
setFormValidity,
parentFieldId,
field.id,
{
custom: {
type: "invalid",
message: result
}
}
);
}
}).catch((error) => {
if (customValidationCounterRef.current[field.id] !== currentToken) {
return;
}
updateFieldValidity(
setFormValidity,
parentFieldId,
field.id,
{
custom: {
type: "invalid",
message: error.message
}
}
);
});
return;
}
setFormValidity((prev) => {
if (!prev) {
return prev;
}
if (parentFieldId) {
const parentField = prev[parentFieldId];
if (!parentField?.children) {
return prev;
}
const { [field.id]: removed2, ...restChildren } = parentField.children;
if (Object.keys(restChildren).length === 0) {
const { children, ...restParent } = parentField;
if (Object.keys(restParent).length === 0) {
const {
[parentFieldId]: removedParent,
...restFields
} = prev;
return Object.keys(restFields).length === 0 ? void 0 : restFields;
}
return {
...prev,
[parentFieldId]: restParent
};
}
return {
...prev,
[parentFieldId]: {
...parentField,
children: restChildren
}
};
}
if (!prev[field.id]) {
return prev;
}
const { [field.id]: removed, ...rest } = prev;
if (Object.keys(rest).length === 0) {
return void 0;
}
return rest;
});
});
}, [item, fields, form]);
(0,external_wp_element_.useEffect)(() => {
validate();
}, [validate]);
return {
validity: formValidity,
isValid: isFormValid(formValidity)
};
}
var use_form_validity_default = useFormValidity;
;// ./node_modules/@wordpress/dataviews/build-module/dataform-layouts/panel/modal.js
function ModalContent({
data,
field,
onChange,
fieldLabel,
onClose
}) {
const { fields } = (0,external_wp_element_.useContext)(dataform_context_default);
const [changes, setChanges] = (0,external_wp_element_.useState)({});
const modalData = (0,external_wp_element_.useMemo)(() => {
return cjs_default()(data, changes);
}, [data, changes]);
const form = (0,external_wp_element_.useMemo)(
() => ({
layout: DEFAULT_LAYOUT,
fields: isCombinedField(field) ? field.children : (
// If not explicit children return the field id itself.
[{ id: field.id }]
)
}),
[field]
);
const { validity } = use_form_validity_default(
modalData,
fields,
form
);
const onApply = () => {
onChange(changes);
onClose();
};
const handleOnChange = (newValue) => {
setChanges((prev) => cjs_default()(prev, newValue));
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Modal,
{
className: "dataforms-layouts-panel__modal",
onRequestClose: onClose,
isFullScreen: false,
title: fieldLabel,
size: "medium",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DataFormLayout,
{
data: modalData,
form,
onChange: handleOnChange,
validity,
children: (FieldLayout, childField, childFieldValidity) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FieldLayout,
{
data: modalData,
field: childField,
onChange: handleOnChange,
hideLabelFromVision: (form?.fields ?? []).length < 2,
validity: childFieldValidity
},
childField.id
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
className: "dataforms-layouts-panel__modal-footer",
spacing: 3,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: "tertiary",
onClick: onClose,
__next40pxDefaultSize: true,
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
variant: "primary",
onClick: onApply,
__next40pxDefaultSize: true,
children: (0,external_wp_i18n_namespaceObject.__)("Apply")
}
)
]
}
)
]
}
);
}
function PanelModal({
data,
field,
onChange,
labelPosition,
summaryFields,
fieldDefinition
}) {
const [isOpen, setIsOpen] = (0,external_wp_element_.useState)(false);
const fieldLabel = isCombinedField(field) ? field.label : fieldDefinition?.label;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
summary_button_default,
{
summaryFields,
data,
labelPosition,
fieldLabel,
disabled: fieldDefinition.readOnly === true,
onClick: () => setIsOpen(true),
"aria-expanded": isOpen
}
),
isOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ModalContent,
{
data,
field,
onChange,
fieldLabel: fieldLabel ?? "",
onClose: () => setIsOpen(false)
}
)
] });
}
var modal_default = PanelModal;
;// ./node_modules/@wordpress/dataviews/build-module/dataform-layouts/get-summary-fields.js
function extractSummaryIds(summary) {
if (Array.isArray(summary)) {
return summary.map(
(item) => typeof item === "string" ? item : item.id
);
}
return [];
}
const getSummaryFields = (summaryField, fields) => {
if (Array.isArray(summaryField) && summaryField.length > 0) {
const summaryIds = extractSummaryIds(summaryField);
return summaryIds.map(
(summaryId) => fields.find((_field) => _field.id === summaryId)
).filter((_field) => _field !== void 0);
}
return [];
};
;// ./node_modules/@wordpress/dataviews/build-module/dataform-layouts/panel/index.js
const getFieldDefinition = (field, fields) => {
const fieldDefinition = fields.find((_field) => _field.id === field.id);
if (!fieldDefinition) {
return fields.find((_field) => {
if (isCombinedField(field)) {
const simpleChildren = field.children.filter(
(child) => typeof child === "string" || !isCombinedField(child)
);
if (simpleChildren.length === 0) {
return false;
}
const firstChildFieldId = typeof simpleChildren[0] === "string" ? simpleChildren[0] : simpleChildren[0].id;
return _field.id === firstChildFieldId;
}
return _field.id === field.id;
});
}
return fieldDefinition;
};
const getFieldDefinitionAndSummaryFields = (layout, field, fields) => {
const summaryFields = getSummaryFields(layout.summary, fields);
const fieldDefinition = getFieldDefinition(field, fields);
if (summaryFields.length === 0) {
return {
summaryFields: fieldDefinition ? [fieldDefinition] : [],
fieldDefinition
};
}
return {
summaryFields,
fieldDefinition
};
};
function FormPanelField({
data,
field,
onChange,
validity
}) {
const { fields } = (0,external_wp_element_.useContext)(dataform_context_default);
const layout = normalizeLayout({
...field.layout,
type: "panel"
});
const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_.useState)(
null
);
const { fieldDefinition, summaryFields } = getFieldDefinitionAndSummaryFields(layout, field, fields);
if (!fieldDefinition) {
return null;
}
const labelPosition = layout.labelPosition;
const labelClassName = dist_clsx(
"dataforms-layouts-panel__field-label",
`dataforms-layouts-panel__field-label--label-position-${labelPosition}`
);
const fieldLabel = isCombinedField(field) ? field.label : fieldDefinition?.label;
const renderedControl = layout.openAs === "modal" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
modal_default,
{
data,
field,
onChange,
labelPosition,
summaryFields,
fieldDefinition
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
dropdown_default,
{
data,
field,
onChange,
validity,
labelPosition,
summaryFields,
fieldDefinition,
popoverAnchor
}
);
if (labelPosition === "top") {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { className: "dataforms-layouts-panel__field", spacing: 0, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: labelClassName,
style: { paddingBottom: 0 },
children: fieldLabel
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataforms-layouts-panel__field-control", children: renderedControl })
] });
}
if (labelPosition === "none") {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataforms-layouts-panel__field", children: renderedControl });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
ref: setPopoverAnchor,
className: "dataforms-layouts-panel__field",
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: labelClassName, children: fieldLabel }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataforms-layouts-panel__field-control", children: renderedControl })
]
}
);
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-layouts/card/index.js
function useCollapsibleCard(initialIsOpen = true) {
const [isOpen, setIsOpen] = (0,external_wp_element_.useState)(initialIsOpen);
const toggle = (0,external_wp_element_.useCallback)(() => {
setIsOpen((prev) => !prev);
}, []);
const CollapsibleCardHeader = (0,external_wp_element_.useCallback)(
({
children,
...props
}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.CardHeader,
{
...props,
onClick: toggle,
style: {
cursor: "pointer",
...props.style
},
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
style: {
width: "100%",
display: "flex",
justifyContent: "space-between",
alignItems: "center"
},
children
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
icon: isOpen ? chevron_up_default : chevron_down_default,
"aria-expanded": isOpen,
"aria-label": isOpen ? "Collapse" : "Expand"
}
)
]
}
),
[toggle, isOpen]
);
return { isOpen, CollapsibleCardHeader };
}
function isSummaryFieldVisible(summaryField, summaryConfig, isOpen) {
if (!summaryConfig || Array.isArray(summaryConfig) && summaryConfig.length === 0) {
return false;
}
const summaryConfigArray = Array.isArray(summaryConfig) ? summaryConfig : [summaryConfig];
const fieldConfig = summaryConfigArray.find((config) => {
if (typeof config === "string") {
return config === summaryField.id;
}
if (typeof config === "object" && "id" in config) {
return config.id === summaryField.id;
}
return false;
});
if (!fieldConfig) {
return false;
}
if (typeof fieldConfig === "string") {
return true;
}
if (typeof fieldConfig === "object" && "visibility" in fieldConfig) {
return fieldConfig.visibility === "always" || fieldConfig.visibility === "when-collapsed" && !isOpen;
}
return true;
}
function FormCardField({
data,
field,
onChange,
hideLabelFromVision,
validity
}) {
const { fields } = (0,external_wp_element_.useContext)(dataform_context_default);
const layout = normalizeLayout({
...field.layout,
type: "card"
});
const form = (0,external_wp_element_.useMemo)(
() => ({
layout: DEFAULT_LAYOUT,
fields: isCombinedField(field) ? field.children : []
}),
[field]
);
const { isOpen, CollapsibleCardHeader } = useCollapsibleCard(
layout.isOpened
);
const summaryFields = getSummaryFields(layout.summary, fields);
const visibleSummaryFields = summaryFields.filter(
(summaryField) => isSummaryFieldVisible(summaryField, layout.summary, isOpen)
);
if (isCombinedField(field)) {
const withHeader2 = !!field.label && layout.withHeader;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Card, { className: "dataforms-layouts-card__field", children: [
withHeader2 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(CollapsibleCardHeader, { className: "dataforms-layouts-card__field-header", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "dataforms-layouts-card__field-header-label", children: field.label }),
visibleSummaryFields.length > 0 && layout.withHeader && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataforms-layouts-card__field-summary", children: visibleSummaryFields.map(
(summaryField) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
summaryField.render,
{
item: data,
field: summaryField
},
summaryField.id
)
) })
] }),
(isOpen || !withHeader2) && // If it doesn't have a header, keep it open.
// Otherwise, the card will not be visible.
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.CardBody, { className: "dataforms-layouts-card__field-control", children: [
field.description && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataforms-layouts-card__field-description", children: field.description }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DataFormLayout,
{
data,
form,
onChange,
validity: validity?.children
}
)
] })
] });
}
const fieldDefinition = fields.find(
(fieldDef) => fieldDef.id === field.id
);
if (!fieldDefinition || !fieldDefinition.Edit) {
return null;
}
const RegularLayout = getFormFieldLayout("regular")?.component;
if (!RegularLayout) {
return null;
}
const withHeader = !!fieldDefinition.label && layout.withHeader;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Card, { className: "dataforms-layouts-card__field", children: [
withHeader && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(CollapsibleCardHeader, { className: "dataforms-layouts-card__field-header", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "dataforms-layouts-card__field-header-label", children: fieldDefinition.label }),
visibleSummaryFields.length > 0 && layout.withHeader && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataforms-layouts-card__field-summary", children: visibleSummaryFields.map((summaryField) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
summaryField.render,
{
item: data,
field: summaryField
},
summaryField.id
)) })
] }),
(isOpen || !withHeader) && // If it doesn't have a header, keep it open.
// Otherwise, the card will not be visible.
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CardBody, { className: "dataforms-layouts-card__field-control", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
RegularLayout,
{
data,
field,
onChange,
hideLabelFromVision: hideLabelFromVision || withHeader,
validity
}
) })
] });
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-layouts/row/index.js
function row_Header({ title }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { className: "dataforms-layouts-row__header", spacing: 4, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "center", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { level: 2, size: 13, children: title }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, {})
] }) });
}
const EMPTY_WRAPPER = ({ children }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children });
function FormRowField({
data,
field,
onChange,
hideLabelFromVision,
validity
}) {
const { fields } = (0,external_wp_element_.useContext)(dataform_context_default);
const layout = normalizeLayout({
...field.layout,
type: "row"
});
if (isCombinedField(field)) {
const form = {
fields: field.children.map((child) => {
if (typeof child === "string") {
return { id: child };
}
return child;
})
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "dataforms-layouts-row__field", children: [
!hideLabelFromVision && field.label && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(row_Header, { title: field.label }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: layout.alignment, spacing: 4, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DataFormLayout,
{
data,
form,
onChange,
validity: validity?.children,
as: EMPTY_WRAPPER,
children: (FieldLayout, childField, childFieldValidity) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: "dataforms-layouts-row__field-control",
style: layout.styles[childField.id],
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FieldLayout,
{
data,
field: childField,
onChange,
hideLabelFromVision,
validity: childFieldValidity
}
)
},
childField.id
)
}
) })
] });
}
const fieldDefinition = fields.find((f) => f.id === field.id);
if (!fieldDefinition || !fieldDefinition.Edit) {
return null;
}
const RegularLayout = getFormFieldLayout("regular")?.component;
if (!RegularLayout) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataforms-layouts-row__field-control", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
RegularLayout,
{
data,
field: fieldDefinition,
onChange,
validity
}
) }) });
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-layouts/index.js
const FORM_FIELD_LAYOUTS = [
{
type: "regular",
component: FormRegularField,
wrapper: ({ children }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { className: "dataforms-layouts__wrapper", spacing: 4, children })
},
{
type: "panel",
component: FormPanelField,
wrapper: ({ children }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { className: "dataforms-layouts__wrapper", spacing: 2, children })
},
{
type: "card",
component: FormCardField,
wrapper: ({ children }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { className: "dataforms-layouts__wrapper", spacing: 6, children })
},
{
type: "row",
component: FormRowField,
wrapper: ({
children,
layout
}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { className: "dataforms-layouts__wrapper", spacing: 4, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataforms-layouts-row__field", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalHStack,
{
spacing: 4,
alignment: layout.alignment,
children
}
) }) })
}
];
function getFormFieldLayout(type) {
return FORM_FIELD_LAYOUTS.find((layout) => layout.type === type);
}
;// ./node_modules/@wordpress/dataviews/build-module/dataform-layouts/data-form-layout.js
const DEFAULT_WRAPPER = ({ children }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { className: "dataforms-layouts__wrapper", spacing: 4, children });
function DataFormLayout({
data,
form,
onChange,
validity,
children,
as
}) {
const { fields: fieldDefinitions } = (0,external_wp_element_.useContext)(dataform_context_default);
function getFieldDefinition(field) {
const fieldId = typeof field === "string" ? field : field.id;
return fieldDefinitions.find(
(fieldDefinition) => fieldDefinition.id === fieldId
);
}
const normalizedFormFields = (0,external_wp_element_.useMemo)(
() => normalizeFormFields(form),
[form]
);
const normalizedFormLayout = normalizeLayout(form.layout);
const Wrapper = as ?? getFormFieldLayout(normalizedFormLayout.type)?.wrapper ?? DEFAULT_WRAPPER;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Wrapper, { layout: normalizedFormLayout, children: normalizedFormFields.map((formField) => {
const FieldLayout = getFormFieldLayout(formField.layout.type)?.component;
if (!FieldLayout) {
return null;
}
const fieldDefinition = !isCombinedField(formField) ? getFieldDefinition(formField) : void 0;
if (fieldDefinition && fieldDefinition.isVisible && !fieldDefinition.isVisible(data)) {
return null;
}
if (children) {
return children(
FieldLayout,
formField,
validity?.[formField.id]
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
FieldLayout,
{
data,
field: formField,
onChange,
validity: validity?.[formField.id]
},
formField.id
);
}) });
}
;// ./node_modules/@wordpress/dataviews/build-module/components/dataform/index.js
function DataForm({
data,
form,
fields,
onChange,
validity
}) {
const normalizedFields = (0,external_wp_element_.useMemo)(
() => normalizeFields(fields),
[fields]
);
if (!form.fields) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormProvider, { fields: normalizedFields, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DataFormLayout,
{
data,
form,
onChange,
validity
}
) });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/post-edit/index.js
const { usePostFields: post_edit_usePostFields, PostCardPanel } = unlock(external_wp_editor_namespaceObject.privateApis);
const fieldsWithBulkEditSupport = [
"title",
"status",
"date",
"author",
"discussion"
];
function PostEditForm({ postType, postId }) {
const ids = (0,external_wp_element_.useMemo)(() => postId.split(","), [postId]);
const { record, hasFinishedResolution } = (0,external_wp_data_.useSelect)(
(select) => {
const args = ["postType", postType, ids[0]];
const {
getEditedEntityRecord,
hasFinishedResolution: hasFinished
} = select(external_wp_coreData_namespaceObject.store);
return {
record: ids.length === 1 ? getEditedEntityRecord(...args) : null,
hasFinishedResolution: hasFinished(
"getEditedEntityRecord",
args
)
};
},
[postType, ids]
);
const [multiEdits, setMultiEdits] = (0,external_wp_element_.useState)({});
const { editEntityRecord } = (0,external_wp_data_.useDispatch)(external_wp_coreData_namespaceObject.store);
const _fields = post_edit_usePostFields({ postType });
const fields = (0,external_wp_element_.useMemo)(
() => _fields?.map((field) => {
if (field.id === "status") {
return {
...field,
elements: field.elements.filter(
(element) => element.value !== "trash"
)
};
}
return field;
}),
[_fields]
);
const form = (0,external_wp_element_.useMemo)(
() => ({
layout: {
type: "panel"
},
fields: [
{
id: "featured_media",
layout: {
type: "regular"
}
},
{
id: "status",
label: (0,external_wp_i18n_namespaceObject.__)("Status & Visibility"),
children: ["status", "password"]
},
"author",
"date",
"slug",
"parent",
{
id: "discussion",
label: (0,external_wp_i18n_namespaceObject.__)("Discussion"),
children: ["comment_status", "ping_status"]
},
{
label: (0,external_wp_i18n_namespaceObject.__)("Template"),
id: "template",
layout: {
type: "regular",
labelPosition: "side"
}
}
].filter(
(field) => ids.length === 1 || fieldsWithBulkEditSupport.includes(
typeof field === "string" ? field : field.id
)
)
}),
[ids]
);
const onChange = (edits) => {
for (const id of ids) {
if (edits.status && edits.status !== "future" && record?.status === "future" && new Date(record.date) > /* @__PURE__ */ new Date()) {
edits.date = null;
}
if (edits.status && edits.status === "private" && record.password) {
edits.password = "";
}
editEntityRecord("postType", postType, id, edits);
if (ids.length > 1) {
setMultiEdits((prev) => ({
...prev,
...edits
}));
}
}
};
(0,external_wp_element_.useEffect)(() => {
setMultiEdits({});
}, [ids]);
const { ExperimentalBlockEditorProvider } = unlock(
external_wp_blockEditor_namespaceObject.privateApis
);
const settings = usePatternSettings();
const fieldsWithDependency = (0,external_wp_element_.useMemo)(() => {
return fields.map((field) => {
if (field.id === "template") {
return {
...field,
Edit: (data) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalBlockEditorProvider, { settings, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(field.Edit, { ...data }) })
};
}
return field;
});
}, [fields, settings]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostCardPanel, { postType, postId: ids }),
hasFinishedResolution && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DataForm,
{
data: ids.length === 1 ? record : multiEdits,
fields: fieldsWithDependency,
form,
onChange
}
)
] });
}
function PostEdit({ postType, postId }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
page_page_default,
{
className: dist_clsx("edit-site-post-edit", {
"is-empty": !postId
}),
label: (0,external_wp_i18n_namespaceObject.__)("Post Edit"),
children: [
postId && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostEditForm, { postType, postId }),
!postId && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)("Select a page to edit") })
]
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/pages.js
const { useLocation: pages_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
async function isListView(query) {
const { activeView = "all" } = query;
const postTypeObject = await (0,external_wp_data_.resolveSelect)(external_wp_coreData_namespaceObject.store).getPostType("page");
const view = await (0,build_module.loadView)({
kind: "postType",
name: "page",
slug: activeView,
defaultView: view_utils_getDefaultView(postTypeObject, activeView)
});
return view.type === "list";
}
function MobilePagesView() {
const { query = {} } = pages_useLocation();
const { canvas = "view" } = query;
return canvas === "edit" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostList, { postType: "page" });
}
const pagesRoute = {
name: "pages",
path: "/page",
areas: {
sidebar({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationScreen,
{
title: (0,external_wp_i18n_namespaceObject.__)("Pages"),
backPath: "/",
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSidebarContent, { postType: "page" })
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
},
content({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostList, { postType: "page" }) : void 0;
},
async preview({ query, siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
if (!isBlockTheme) {
return void 0;
}
const isList = await isListView(query);
return isList ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : void 0;
},
mobile({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MobilePagesView, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
},
async edit({ query }) {
const isList = await isListView(query);
const hasQuickEdit = !isList && !!query.quickEdit;
return hasQuickEdit ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostEdit, { postType: "page", postId: query.postId }) : void 0;
}
},
widths: {
async content({ query }) {
const isList = await isListView(query);
return isList ? 380 : void 0;
},
async edit({ query }) {
const isList = await isListView(query);
const hasQuickEdit = !isList && !!query.quickEdit;
return hasQuickEdit ? 380 : void 0;
}
}
};
;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/page-item.js
const pageItemRoute = {
name: "page-item",
path: "/page/:postId",
areas: {
sidebar({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationScreen,
{
title: (0,external_wp_i18n_namespaceObject.__)("Pages"),
backPath: "/",
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSidebarContent, { postType: "page" })
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
},
mobile({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
},
preview({ siteData }) {
const isBlockTheme = siteData.currentTheme?.is_block_theme;
return isBlockTheme ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
}
}
};
;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/stylebook.js
const stylebookRoute = {
name: "stylebook",
path: "/stylebook",
areas: {
sidebar({ siteData }) {
return isClassicThemeWithStyleBookSupport(siteData) ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationScreen,
{
title: (0,external_wp_i18n_namespaceObject.__)("Styles"),
backPath: "/",
description: (0,external_wp_i18n_namespaceObject.__)(
`Preview your website's visual identity: colors, typography, and blocks.`
)
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {});
},
preview({ siteData }) {
return isClassicThemeWithStyleBookSupport(siteData) ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleBookPreview, { isStatic: true }) : void 0;
},
mobile({ siteData }) {
return isClassicThemeWithStyleBookSupport(siteData) ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleBookPreview, { isStatic: true }) : void 0;
}
}
};
;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/notfound.js
function NotFoundError() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "error", isDismissible: false, children: (0,external_wp_i18n_namespaceObject.__)(
"The requested page could not be found. Please check the URL."
) });
}
const notFoundRoute = {
name: "notfound",
path: "*",
areas: {
sidebar: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenMain, {}),
mobile: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationScreenMain,
{
customDescription: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NotFoundError, {})
}
),
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { padding: 2, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NotFoundError, {}) })
}
};
;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/index.js
const site_editor_routes_routes = [
pageItemRoute,
pagesRoute,
templateItemRoute,
templatesRoute,
templatePartItemRoute,
patternItemRoute,
patternsRoute,
navigationItemRoute,
navigationRoute,
stylesRoute,
homeRoute,
stylebookRoute,
notFoundRoute
];
function useRegisterSiteEditorRoutes() {
const registry = (0,external_wp_data_.useRegistry)();
const { registerRoute } = unlock((0,external_wp_data_.useDispatch)(store));
(0,external_wp_element_.useEffect)(() => {
registry.batch(() => {
site_editor_routes_routes.forEach(registerRoute);
});
}, [registry, registerRoute]);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/app/index.js
const { RouterProvider } = unlock(external_wp_router_namespaceObject.privateApis);
function AppLayout() {
useCommonCommands();
useSetCommandContext();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutWithGlobalStylesProvider, {});
}
function App() {
useRegisterSiteEditorRoutes();
const { routes, currentTheme, editorSettings } = (0,external_wp_data_.useSelect)((select) => {
return {
routes: unlock(select(store)).getRoutes(),
currentTheme: select(external_wp_coreData_namespaceObject.store).getCurrentTheme(),
// This is a temp solution until the has_theme_json value is available for the current theme.
editorSettings: select(store).getSettings()
};
}, []);
const beforeNavigate = (0,external_wp_element_.useCallback)(({ path, query }) => {
if (!isPreviewingTheme()) {
return { path, query };
}
return {
path,
query: {
...query,
wp_theme_preview: "wp_theme_preview" in query ? query.wp_theme_preview : currentlyPreviewingTheme()
}
};
}, []);
const matchResolverArgsValue = (0,external_wp_element_.useMemo)(
() => ({
siteData: { currentTheme, editorSettings }
}),
[currentTheme, editorSettings]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
RouterProvider,
{
routes,
pathArg: "p",
beforeNavigate,
matchResolverArgs: matchResolverArgsValue,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(AppLayout, {})
}
);
}
;// ./node_modules/@wordpress/edit-site/build-module/deprecated.js
const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes(
"site-editor.php"
);
const deprecateSlot = (name) => {
external_wp_deprecated_default()(`wp.editPost.${name}`, {
since: "6.6",
alternative: `wp.editor.${name}`
});
};
function PluginMoreMenuItem(props) {
if (!isSiteEditor) {
return null;
}
deprecateSlot("PluginMoreMenuItem");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginMoreMenuItem, { ...props });
}
function PluginSidebar(props) {
if (!isSiteEditor) {
return null;
}
deprecateSlot("PluginSidebar");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginSidebar, { ...props });
}
function PluginSidebarMoreMenuItem(props) {
if (!isSiteEditor) {
return null;
}
deprecateSlot("PluginSidebarMoreMenuItem");
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginSidebarMoreMenuItem, { ...props });
}
;// ./node_modules/@wordpress/edit-site/build-module/components/posts-app-routes/posts.js
const { useLocation: posts_useLocation } = unlock(external_wp_router_namespaceObject.privateApis);
async function posts_isListView(query) {
const { activeView = "all" } = query;
const postTypeObject = await (0,external_wp_data_.resolveSelect)(external_wp_coreData_namespaceObject.store).getPostType("post");
const view = await (0,build_module.loadView)({
kind: "postType",
name: "post",
slug: activeView,
defaultView: view_utils_getDefaultView(postTypeObject, activeView)
});
return view.type === "list";
}
function MobilePostsView() {
const { query = {} } = posts_useLocation();
const { canvas = "view" } = query;
return canvas === "edit" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostList, { postType: "post" });
}
const postsRoute = {
name: "posts",
path: "/",
areas: {
sidebar: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationScreen,
{
title: (0,external_wp_i18n_namespaceObject.__)("Posts"),
isRoot: true,
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSidebarContent, { postType: "post" })
}
),
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostList, { postType: "post" }),
async preview({ query }) {
const isList = await posts_isListView(query);
return isList ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { isPostsList: true }) : void 0;
},
mobile: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MobilePostsView, {}),
async edit({ query }) {
const isList = await posts_isListView(query);
const hasQuickEdit = !isList && !!query.quickEdit;
return hasQuickEdit ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostEdit, { postType: "post", postId: query.postId }) : void 0;
}
},
widths: {
async content({ query }) {
const isList = await posts_isListView(query);
return isList ? 380 : void 0;
},
async edit({ query }) {
const isList = await posts_isListView(query);
const hasQuickEdit = !isList && !!query.quickEdit;
return hasQuickEdit ? 380 : void 0;
}
}
};
;// ./node_modules/@wordpress/edit-site/build-module/components/posts-app-routes/post-item.js
const postItemRoute = {
name: "post-item",
path: "/post/:postId",
areas: {
sidebar: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
SidebarNavigationScreen,
{
title: (0,external_wp_i18n_namespaceObject.__)("Posts"),
isRoot: true,
content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSidebarContent, { postType: "post" })
}
),
mobile: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { isPostsList: true }),
preview: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { isPostsList: true })
}
};
;// ./node_modules/@wordpress/edit-site/build-module/components/posts-app-routes/index.js
const posts_app_routes_routes = [postItemRoute, postsRoute];
function useRegisterPostsAppRoutes() {
const registry = (0,external_wp_data_.useRegistry)();
const { registerRoute } = unlock((0,external_wp_data_.useDispatch)(store));
(0,external_wp_element_.useEffect)(() => {
registry.batch(() => {
posts_app_routes_routes.forEach(registerRoute);
});
}, [registry, registerRoute]);
}
;// ./node_modules/@wordpress/edit-site/build-module/components/posts-app/index.js
const { RouterProvider: posts_app_RouterProvider } = unlock(external_wp_router_namespaceObject.privateApis);
function PostsApp() {
useRegisterPostsAppRoutes();
const routes = (0,external_wp_data_.useSelect)((select) => {
return unlock(select(store)).getRoutes();
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(posts_app_RouterProvider, { routes, pathArg: "p", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutWithGlobalStylesProvider, {}) });
}
;// ./node_modules/@wordpress/edit-site/build-module/posts.js
function initializePostsDashboard(id, settings) {
if (true) {
return;
}
const target = document.getElementById(id);
const root = (0,external_wp_element_.createRoot)(target);
(0,external_wp_data_.dispatch)(external_wp_blocks_namespaceObject.store).reapplyBlockTypeFilters();
const coreBlocks = (0,external_wp_blockLibrary_namespaceObject.__experimentalGetCoreBlocks)().filter(
({ name }) => name !== "core/freeform"
);
(0,external_wp_blockLibrary_namespaceObject.registerCoreBlocks)(coreBlocks);
(0,external_wp_data_.dispatch)(external_wp_blocks_namespaceObject.store).setFreeformFallbackBlockName("core/html");
(0,external_wp_widgets_namespaceObject.registerLegacyWidgetBlock)({ inserter: false });
(0,external_wp_widgets_namespaceObject.registerWidgetGroupBlock)({ inserter: false });
if (false) {}
(0,external_wp_data_.dispatch)(external_wp_preferences_.store).setDefaults("core/edit-site", {
welcomeGuide: true,
welcomeGuideStyles: true,
welcomeGuidePage: true,
welcomeGuideTemplate: true
});
(0,external_wp_data_.dispatch)(external_wp_preferences_.store).setDefaults("core", {
allowRightClickOverrides: true,
distractionFree: false,
editorMode: "visual",
editorTool: "edit",
fixedToolbar: false,
focusMode: false,
inactivePanels: [],
keepCaretInsideBlock: false,
openPanels: ["post-status"],
showBlockBreadcrumbs: true,
showListViewByDefault: false,
enableChoosePatternModal: true
});
(0,external_wp_data_.dispatch)(store).updateSettings(settings);
window.addEventListener("dragover", (e) => e.preventDefault(), false);
window.addEventListener("drop", (e) => e.preventDefault(), false);
root.render(
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_.StrictMode, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostsApp, {}) })
);
return root;
}
;// ./node_modules/@wordpress/edit-site/build-module/index.js
const { registerCoreBlockBindingsSources } = unlock(external_wp_editor_namespaceObject.privateApis);
function initializeEditor(id, settings) {
const target = document.getElementById(id);
const root = (0,external_wp_element_.createRoot)(target);
(0,external_wp_data_.dispatch)(external_wp_blocks_namespaceObject.store).reapplyBlockTypeFilters();
const coreBlocks = (0,external_wp_blockLibrary_namespaceObject.__experimentalGetCoreBlocks)().filter(
({ name }) => name !== "core/freeform"
);
(0,external_wp_blockLibrary_namespaceObject.registerCoreBlocks)(coreBlocks);
registerCoreBlockBindingsSources();
(0,external_wp_data_.dispatch)(external_wp_blocks_namespaceObject.store).setFreeformFallbackBlockName("core/html");
(0,external_wp_widgets_namespaceObject.registerLegacyWidgetBlock)({ inserter: false });
(0,external_wp_widgets_namespaceObject.registerWidgetGroupBlock)({ inserter: false });
if (false) {}
(0,external_wp_data_.dispatch)(external_wp_preferences_.store).setDefaults("core/edit-site", {
welcomeGuide: true,
welcomeGuideStyles: true,
welcomeGuidePage: true,
welcomeGuideTemplate: true
});
(0,external_wp_data_.dispatch)(external_wp_preferences_.store).setDefaults("core", {
allowRightClickOverrides: true,
distractionFree: false,
editorMode: "visual",
editorTool: "edit",
fixedToolbar: false,
focusMode: false,
inactivePanels: [],
keepCaretInsideBlock: false,
openPanels: ["post-status"],
showBlockBreadcrumbs: true,
showListViewByDefault: false,
enableChoosePatternModal: true
});
if (window.__experimentalMediaProcessing) {
(0,external_wp_data_.dispatch)(external_wp_preferences_.store).setDefaults("core/media", {
requireApproval: true,
optimizeOnUpload: true
});
}
(0,external_wp_data_.dispatch)(store).updateSettings(settings);
window.addEventListener("dragover", (e) => e.preventDefault(), false);
window.addEventListener("drop", (e) => e.preventDefault(), false);
root.render(
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_.StrictMode, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(App, {}) })
);
return root;
}
function reinitializeEditor() {
external_wp_deprecated_default()("wp.editSite.reinitializeEditor", {
since: "6.2",
version: "6.3"
});
}
})();
(window.wp = window.wp || {}).editSite = __webpack_exports__;
/******/ })()
; blocks.min.js 0000644 00000531134 15121363551 0007152 0 ustar 00 /*! This file is auto-generated */
(()=>{var e={1030:function(e,t,r){var n;/*! showdown v 1.9.1 - 02-11-2019 */
(function(){function o(e){"use strict";var t={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:"Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,description:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,description:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,description:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(!1===e)return JSON.parse(JSON.stringify(t));var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n].defaultValue);return r}var a={},i={},s={},c=o(!0),l="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:o(!0),allOn:function(){"use strict";var e=o(!0),t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=!0);return t}()};function d(e,t){"use strict";var r=t?"Error in "+t+" extension->":"Error in unnamed extension",n={valid:!0,error:""};a.helper.isArray(e)||(e=[e]);for(var o=0;o<e.length;++o){var i=r+" sub-extension "+o+": ",s=e[o];if("object"!=typeof s)return n.valid=!1,n.error=i+"must be an object, but "+typeof s+" given",n;if(!a.helper.isString(s.type))return n.valid=!1,n.error=i+'property "type" must be a string, but '+typeof s.type+" given",n;var c=s.type=s.type.toLowerCase();if("language"===c&&(c=s.type="lang"),"html"===c&&(c=s.type="output"),"lang"!==c&&"output"!==c&&"listener"!==c)return n.valid=!1,n.error=i+"type "+c+' is not recognized. Valid values: "lang/language", "output/html" or "listener"',n;if("listener"===c){if(a.helper.isUndefined(s.listeners))return n.valid=!1,n.error=i+'. Extensions of type "listener" must have a property called "listeners"',n}else if(a.helper.isUndefined(s.filter)&&a.helper.isUndefined(s.regex))return n.valid=!1,n.error=i+c+' extensions must define either a "regex" property or a "filter" method',n;if(s.listeners){if("object"!=typeof s.listeners)return n.valid=!1,n.error=i+'"listeners" property must be an object but '+typeof s.listeners+" given",n;for(var l in s.listeners)if(s.listeners.hasOwnProperty(l)&&"function"!=typeof s.listeners[l])return n.valid=!1,n.error=i+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+l+" must be a function but "+typeof s.listeners[l]+" given",n}if(s.filter){if("function"!=typeof s.filter)return n.valid=!1,n.error=i+'"filter" must be a function, but '+typeof s.filter+" given",n}else if(s.regex){if(a.helper.isString(s.regex)&&(s.regex=new RegExp(s.regex,"g")),!(s.regex instanceof RegExp))return n.valid=!1,n.error=i+'"regex" property must either be a string or a RegExp object, but '+typeof s.regex+" given",n;if(a.helper.isUndefined(s.replace))return n.valid=!1,n.error=i+'"regex" extensions must implement a replace string or function',n}}return n}function p(e,t){"use strict";return"¨E"+t.charCodeAt(0)+"E"}a.helper={},a.extensions={},a.setOption=function(e,t){"use strict";return c[e]=t,this},a.getOption=function(e){"use strict";return c[e]},a.getOptions=function(){"use strict";return c},a.resetOptions=function(){"use strict";c=o(!0)},a.setFlavor=function(e){"use strict";if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");a.resetOptions();var t=u[e];for(var r in l=e,t)t.hasOwnProperty(r)&&(c[r]=t[r])},a.getFlavor=function(){"use strict";return l},a.getFlavorOptions=function(e){"use strict";if(u.hasOwnProperty(e))return u[e]},a.getDefaultOptions=function(e){"use strict";return o(e)},a.subParser=function(e,t){"use strict";if(a.helper.isString(e)){if(void 0===t){if(i.hasOwnProperty(e))return i[e];throw Error("SubParser named "+e+" not registered!")}i[e]=t}},a.extension=function(e,t){"use strict";if(!a.helper.isString(e))throw Error("Extension 'name' must be a string");if(e=a.helper.stdExtName(e),a.helper.isUndefined(t)){if(!s.hasOwnProperty(e))throw Error("Extension named "+e+" is not registered!");return s[e]}"function"==typeof t&&(t=t()),a.helper.isArray(t)||(t=[t]);var r=d(t,e);if(!r.valid)throw Error(r.error);s[e]=t},a.getAllExtensions=function(){"use strict";return s},a.removeExtension=function(e){"use strict";delete s[e]},a.resetExtensions=function(){"use strict";s={}},a.validateExtension=function(e){"use strict";var t=d(e,null);return!!t.valid||(console.warn(t.error),!1)},a.hasOwnProperty("helper")||(a.helper={}),a.helper.isString=function(e){"use strict";return"string"==typeof e||e instanceof String},a.helper.isFunction=function(e){"use strict";return e&&"[object Function]"==={}.toString.call(e)},a.helper.isArray=function(e){"use strict";return Array.isArray(e)},a.helper.isUndefined=function(e){"use strict";return void 0===e},a.helper.forEach=function(e,t){"use strict";if(a.helper.isUndefined(e))throw new Error("obj param is required");if(a.helper.isUndefined(t))throw new Error("callback param is required");if(!a.helper.isFunction(t))throw new Error("callback param must be a function/closure");if("function"==typeof e.forEach)e.forEach(t);else if(a.helper.isArray(e))for(var r=0;r<e.length;r++)t(e[r],r,e);else{if("object"!=typeof e)throw new Error("obj does not seem to be an array or an iterable object");for(var n in e)e.hasOwnProperty(n)&&t(e[n],n,e)}},a.helper.stdExtName=function(e){"use strict";return e.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()},a.helper.escapeCharactersCallback=p,a.helper.escapeCharacters=function(e,t,r){"use strict";var n="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])";r&&(n="\\\\"+n);var o=new RegExp(n,"g");return e=e.replace(o,p)},a.helper.unescapeHTMLEntities=function(e){"use strict";return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")};var f=function(e,t,r,n){"use strict";var o,a,i,s,c,l=n||"",u=l.indexOf("g")>-1,d=new RegExp(t+"|"+r,"g"+l.replace(/g/g,"")),p=new RegExp(t,l.replace(/g/g,"")),f=[];do{for(o=0;i=d.exec(e);)if(p.test(i[0]))o++||(s=(a=d.lastIndex)-i[0].length);else if(o&&! --o){c=i.index+i[0].length;var h={left:{start:s,end:a},match:{start:a,end:i.index},right:{start:i.index,end:c},wholeMatch:{start:s,end:c}};if(f.push(h),!u)return f}}while(o&&(d.lastIndex=a));return f};a.helper.matchRecursiveRegExp=function(e,t,r,n){"use strict";for(var o=f(e,t,r,n),a=[],i=0;i<o.length;++i)a.push([e.slice(o[i].wholeMatch.start,o[i].wholeMatch.end),e.slice(o[i].match.start,o[i].match.end),e.slice(o[i].left.start,o[i].left.end),e.slice(o[i].right.start,o[i].right.end)]);return a},a.helper.replaceRecursiveRegExp=function(e,t,r,n,o){"use strict";if(!a.helper.isFunction(t)){var i=t;t=function(){return i}}var s=f(e,r,n,o),c=e,l=s.length;if(l>0){var u=[];0!==s[0].wholeMatch.start&&u.push(e.slice(0,s[0].wholeMatch.start));for(var d=0;d<l;++d)u.push(t(e.slice(s[d].wholeMatch.start,s[d].wholeMatch.end),e.slice(s[d].match.start,s[d].match.end),e.slice(s[d].left.start,s[d].left.end),e.slice(s[d].right.start,s[d].right.end))),d<l-1&&u.push(e.slice(s[d].wholeMatch.end,s[d+1].wholeMatch.start));s[l-1].wholeMatch.end<e.length&&u.push(e.slice(s[l-1].wholeMatch.end)),c=u.join("")}return c},a.helper.regexIndexOf=function(e,t,r){"use strict";if(!a.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";if(t instanceof RegExp==!1)throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";var n=e.substring(r||0).search(t);return n>=0?n+(r||0):n},a.helper.splitAtIndex=function(e,t){"use strict";if(!a.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[e.substring(0,t),e.substring(t)]},a.helper.encodeEmailAddress=function(e){"use strict";var t=[function(e){return"&#"+e.charCodeAt(0)+";"},function(e){return"&#x"+e.charCodeAt(0).toString(16)+";"},function(e){return e}];return e=e.replace(/./g,(function(e){if("@"===e)e=t[Math.floor(2*Math.random())](e);else{var r=Math.random();e=r>.9?t[2](e):r>.45?t[1](e):t[0](e)}return e}))},a.helper.padEnd=function(e,t,r){"use strict";return t|=0,r=String(r||" "),e.length>t?String(e):((t-=e.length)>r.length&&(r+=r.repeat(t/r.length)),String(e)+r.slice(0,t))},"undefined"==typeof console&&(console={warn:function(e){"use strict";alert(e)},log:function(e){"use strict";alert(e)},error:function(e){"use strict";throw e}}),a.helper.regexes={asteriskDashAndColon:/([*_:~])/g},a.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',showdown:"<span style=\"font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;\">S</span>"},a.Converter=function(e){"use strict";var t={},r=[],n=[],o={},i=l,p={parsed:{},raw:"",format:""};function f(e,t){if(t=t||null,a.helper.isString(e)){if(t=e=a.helper.stdExtName(e),a.extensions[e])return console.warn("DEPRECATION WARNING: "+e+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),void function(e,t){"function"==typeof e&&(e=e(new a.Converter));a.helper.isArray(e)||(e=[e]);var o=d(e,t);if(!o.valid)throw Error(o.error);for(var i=0;i<e.length;++i)switch(e[i].type){case"lang":r.push(e[i]);break;case"output":n.push(e[i]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}(a.extensions[e],e);if(a.helper.isUndefined(s[e]))throw Error('Extension "'+e+'" could not be loaded. It was either not found or is not a valid extension.');e=s[e]}"function"==typeof e&&(e=e()),a.helper.isArray(e)||(e=[e]);var o=d(e,t);if(!o.valid)throw Error(o.error);for(var i=0;i<e.length;++i){switch(e[i].type){case"lang":r.push(e[i]);break;case"output":n.push(e[i])}if(e[i].hasOwnProperty("listeners"))for(var c in e[i].listeners)e[i].listeners.hasOwnProperty(c)&&h(c,e[i].listeners[c])}}function h(e,t){if(!a.helper.isString(e))throw Error("Invalid argument in converter.listen() method: name must be a string, but "+typeof e+" given");if("function"!=typeof t)throw Error("Invalid argument in converter.listen() method: callback must be a function, but "+typeof t+" given");o.hasOwnProperty(e)||(o[e]=[]),o[e].push(t)}!function(){for(var r in e=e||{},c)c.hasOwnProperty(r)&&(t[r]=c[r]);if("object"!=typeof e)throw Error("Converter expects the passed parameter to be an object, but "+typeof e+" was passed instead.");for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.extensions&&a.helper.forEach(t.extensions,f)}(),this._dispatch=function(e,t,r,n){if(o.hasOwnProperty(e))for(var a=0;a<o[e].length;++a){var i=o[e][a](e,t,this,r,n);i&&void 0!==i&&(t=i)}return t},this.listen=function(e,t){return h(e,t),this},this.makeHtml=function(e){if(!e)return e;var o={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:r,outputModifiers:n,converter:this,ghCodeBlocks:[],metadata:{parsed:{},raw:"",format:""}};return e=(e=(e=(e=(e=e.replace(/¨/g,"¨T")).replace(/\$/g,"¨D")).replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/\u00A0/g," "),t.smartIndentationFix&&(e=function(e){var t=e.match(/^\s*/)[0].length,r=new RegExp("^\\s{0,"+t+"}","gm");return e.replace(r,"")}(e)),e="\n\n"+e+"\n\n",e=(e=a.subParser("detab")(e,t,o)).replace(/^[ \t]+$/gm,""),a.helper.forEach(r,(function(r){e=a.subParser("runExtension")(r,e,t,o)})),e=a.subParser("metadata")(e,t,o),e=a.subParser("hashPreCodeTags")(e,t,o),e=a.subParser("githubCodeBlocks")(e,t,o),e=a.subParser("hashHTMLBlocks")(e,t,o),e=a.subParser("hashCodeTags")(e,t,o),e=a.subParser("stripLinkDefinitions")(e,t,o),e=a.subParser("blockGamut")(e,t,o),e=a.subParser("unhashHTMLSpans")(e,t,o),e=(e=(e=a.subParser("unescapeSpecialChars")(e,t,o)).replace(/¨D/g,"$$")).replace(/¨T/g,"¨"),e=a.subParser("completeHTMLDocument")(e,t,o),a.helper.forEach(n,(function(r){e=a.subParser("runExtension")(r,e,t,o)})),p=o.metadata,e},this.makeMarkdown=this.makeMd=function(e,t){if(e=(e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/>[ \t]+</,">¨NBSP;<"),!t){if(!window||!window.document)throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");t=window.document}var r=t.createElement("div");r.innerHTML=e;var n={preList:function(e){for(var t=e.querySelectorAll("pre"),r=[],n=0;n<t.length;++n)if(1===t[n].childElementCount&&"code"===t[n].firstChild.tagName.toLowerCase()){var o=t[n].firstChild.innerHTML.trim(),i=t[n].firstChild.getAttribute("data-language")||"";if(""===i)for(var s=t[n].firstChild.className.split(" "),c=0;c<s.length;++c){var l=s[c].match(/^language-(.+)$/);if(null!==l){i=l[1];break}}o=a.helper.unescapeHTMLEntities(o),r.push(o),t[n].outerHTML='<precode language="'+i+'" precodenum="'+n.toString()+'"></precode>'}else r.push(t[n].innerHTML),t[n].innerHTML="",t[n].setAttribute("prenum",n.toString());return r}(r)};!function e(t){for(var r=0;r<t.childNodes.length;++r){var n=t.childNodes[r];3===n.nodeType?/\S/.test(n.nodeValue)?(n.nodeValue=n.nodeValue.split("\n").join(" "),n.nodeValue=n.nodeValue.replace(/(\s)+/g,"$1")):(t.removeChild(n),--r):1===n.nodeType&&e(n)}}(r);for(var o=r.childNodes,i="",s=0;s<o.length;s++)i+=a.subParser("makeMarkdown.node")(o[s],n);return i},this.setOption=function(e,r){t[e]=r},this.getOption=function(e){return t[e]},this.getOptions=function(){return t},this.addExtension=function(e,t){f(e,t=t||null)},this.useExtension=function(e){f(e)},this.setFlavor=function(e){if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");var r=u[e];for(var n in i=e,r)r.hasOwnProperty(n)&&(t[n]=r[n])},this.getFlavor=function(){return i},this.removeExtension=function(e){a.helper.isArray(e)||(e=[e]);for(var t=0;t<e.length;++t){for(var o=e[t],i=0;i<r.length;++i)r[i]===o&&r[i].splice(i,1);for(;0<n.length;++i)n[0]===o&&n[0].splice(i,1)}},this.getAllExtensions=function(){return{language:r,output:n}},this.getMetadata=function(e){return e?p.raw:p.parsed},this.getMetadataFormat=function(){return p.format},this._setMetadataPair=function(e,t){p.parsed[e]=t},this._setMetadataFormat=function(e){p.format=e},this._setMetadataRaw=function(e){p.raw=e}},a.subParser("anchors",(function(e,t,r){"use strict";var n=function(e,n,o,i,s,c,l){if(a.helper.isUndefined(l)&&(l=""),o=o.toLowerCase(),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)i="";else if(!i){if(o||(o=n.toLowerCase().replace(/ ?\n/g," ")),i="#"+o,a.helper.isUndefined(r.gUrls[o]))return e;i=r.gUrls[o],a.helper.isUndefined(r.gTitles[o])||(l=r.gTitles[o])}var u='<a href="'+(i=i.replace(a.helper.regexes.asteriskDashAndColon,a.helper.escapeCharactersCallback))+'"';return""!==l&&null!==l&&(u+=' title="'+(l=(l=l.replace(/"/g,""")).replace(a.helper.regexes.asteriskDashAndColon,a.helper.escapeCharactersCallback))+'"'),t.openLinksInNewWindow&&!/^#/.test(i)&&(u+=' rel="noopener noreferrer" target="¨E95Eblank"'),u+=">"+n+"</a>"};return e=(e=(e=(e=(e=r.converter._dispatch("anchors.before",e,t,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,n)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,n)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,n)).replace(/\[([^\[\]]+)]()()()()()/g,n),t.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim,(function(e,r,n,o,i){if("\\"===n)return r+o;if(!a.helper.isString(t.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var s=t.ghMentionsLink.replace(/\{u}/g,i),c="";return t.openLinksInNewWindow&&(c=' rel="noopener noreferrer" target="¨E95Eblank"'),r+'<a href="'+s+'"'+c+">"+o+"</a>"}))),e=r.converter._dispatch("anchors.after",e,t,r)}));var h=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,g=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,m=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,b=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,_=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,y=function(e){"use strict";return function(t,r,n,o,i,s,c){var l=n=n.replace(a.helper.regexes.asteriskDashAndColon,a.helper.escapeCharactersCallback),u="",d="",p=r||"",f=c||"";return/^www\./i.test(n)&&(n=n.replace(/^www\./i,"http://www.")),e.excludeTrailingPunctuationFromURLs&&s&&(u=s),e.openLinksInNewWindow&&(d=' rel="noopener noreferrer" target="¨E95Eblank"'),p+'<a href="'+n+'"'+d+">"+l+"</a>"+u+f}},k=function(e,t){"use strict";return function(r,n,o){var i="mailto:";return n=n||"",o=a.subParser("unescapeSpecialChars")(o,e,t),e.encodeEmails?(i=a.helper.encodeEmailAddress(i+o),o=a.helper.encodeEmailAddress(o)):i+=o,n+'<a href="'+i+'">'+o+"</a>"}};a.subParser("autoLinks",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("autoLinks.before",e,t,r)).replace(m,y(t))).replace(_,k(t,r)),e=r.converter._dispatch("autoLinks.after",e,t,r)})),a.subParser("simplifiedAutoLinks",(function(e,t,r){"use strict";return t.simplifiedAutoLink?(e=r.converter._dispatch("simplifiedAutoLinks.before",e,t,r),e=(e=t.excludeTrailingPunctuationFromURLs?e.replace(g,y(t)):e.replace(h,y(t))).replace(b,k(t,r)),e=r.converter._dispatch("simplifiedAutoLinks.after",e,t,r)):e})),a.subParser("blockGamut",(function(e,t,r){"use strict";return e=r.converter._dispatch("blockGamut.before",e,t,r),e=a.subParser("blockQuotes")(e,t,r),e=a.subParser("headers")(e,t,r),e=a.subParser("horizontalRule")(e,t,r),e=a.subParser("lists")(e,t,r),e=a.subParser("codeBlocks")(e,t,r),e=a.subParser("tables")(e,t,r),e=a.subParser("hashHTMLBlocks")(e,t,r),e=a.subParser("paragraphs")(e,t,r),e=r.converter._dispatch("blockGamut.after",e,t,r)})),a.subParser("blockQuotes",(function(e,t,r){"use strict";e=r.converter._dispatch("blockQuotes.before",e,t,r),e+="\n\n";var n=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return t.splitAdjacentBlockquotes&&(n=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),e=e.replace(n,(function(e){return e=(e=(e=e.replace(/^[ \t]*>[ \t]?/gm,"")).replace(/¨0/g,"")).replace(/^[ \t]+$/gm,""),e=a.subParser("githubCodeBlocks")(e,t,r),e=(e=(e=a.subParser("blockGamut")(e,t,r)).replace(/(^|\n)/g,"$1 ")).replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,(function(e,t){var r=t;return r=(r=r.replace(/^ /gm,"¨0")).replace(/¨0/g,"")})),a.subParser("hashBlock")("<blockquote>\n"+e+"\n</blockquote>",t,r)})),e=r.converter._dispatch("blockQuotes.after",e,t,r)})),a.subParser("codeBlocks",(function(e,t,r){"use strict";e=r.converter._dispatch("codeBlocks.before",e,t,r);return e=(e=(e+="¨0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g,(function(e,n,o){var i=n,s=o,c="\n";return i=a.subParser("outdent")(i,t,r),i=a.subParser("encodeCode")(i,t,r),i=(i=(i=a.subParser("detab")(i,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,""),t.omitExtraWLInCodeBlocks&&(c=""),i="<pre><code>"+i+c+"</code></pre>",a.subParser("hashBlock")(i,t,r)+s}))).replace(/¨0/,""),e=r.converter._dispatch("codeBlocks.after",e,t,r)})),a.subParser("codeSpans",(function(e,t,r){"use strict";return void 0===(e=r.converter._dispatch("codeSpans.before",e,t,r))&&(e=""),e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,(function(e,n,o,i){var s=i;return s=(s=s.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),s=n+"<code>"+(s=a.subParser("encodeCode")(s,t,r))+"</code>",s=a.subParser("hashHTMLSpans")(s,t,r)})),e=r.converter._dispatch("codeSpans.after",e,t,r)})),a.subParser("completeHTMLDocument",(function(e,t,r){"use strict";if(!t.completeHTMLDocument)return e;e=r.converter._dispatch("completeHTMLDocument.before",e,t,r);var n="html",o="<!DOCTYPE HTML>\n",a="",i='<meta charset="utf-8">\n',s="",c="";for(var l in void 0!==r.metadata.parsed.doctype&&(o="<!DOCTYPE "+r.metadata.parsed.doctype+">\n","html"!==(n=r.metadata.parsed.doctype.toString().toLowerCase())&&"html5"!==n||(i='<meta charset="utf-8">')),r.metadata.parsed)if(r.metadata.parsed.hasOwnProperty(l))switch(l.toLowerCase()){case"doctype":break;case"title":a="<title>"+r.metadata.parsed.title+"</title>\n";break;case"charset":i="html"===n||"html5"===n?'<meta charset="'+r.metadata.parsed.charset+'">\n':'<meta name="charset" content="'+r.metadata.parsed.charset+'">\n';break;case"language":case"lang":s=' lang="'+r.metadata.parsed[l]+'"',c+='<meta name="'+l+'" content="'+r.metadata.parsed[l]+'">\n';break;default:c+='<meta name="'+l+'" content="'+r.metadata.parsed[l]+'">\n'}return e=o+"<html"+s+">\n<head>\n"+a+i+c+"</head>\n<body>\n"+e.trim()+"\n</body>\n</html>",e=r.converter._dispatch("completeHTMLDocument.after",e,t,r)})),a.subParser("detab",(function(e,t,r){"use strict";return e=(e=(e=(e=(e=(e=r.converter._dispatch("detab.before",e,t,r)).replace(/\t(?=\t)/g," ")).replace(/\t/g,"¨A¨B")).replace(/¨B(.+?)¨A/g,(function(e,t){for(var r=t,n=4-r.length%4,o=0;o<n;o++)r+=" ";return r}))).replace(/¨A/g," ")).replace(/¨B/g,""),e=r.converter._dispatch("detab.after",e,t,r)})),a.subParser("ellipsis",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("ellipsis.before",e,t,r)).replace(/\.\.\./g,"…"),e=r.converter._dispatch("ellipsis.after",e,t,r)})),a.subParser("emoji",(function(e,t,r){"use strict";if(!t.emoji)return e;return e=(e=r.converter._dispatch("emoji.before",e,t,r)).replace(/:([\S]+?):/g,(function(e,t){return a.helper.emojis.hasOwnProperty(t)?a.helper.emojis[t]:e})),e=r.converter._dispatch("emoji.after",e,t,r)})),a.subParser("encodeAmpsAndAngles",(function(e,t,r){"use strict";return e=(e=(e=(e=(e=r.converter._dispatch("encodeAmpsAndAngles.before",e,t,r)).replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&")).replace(/<(?![a-z\/?$!])/gi,"<")).replace(/</g,"<")).replace(/>/g,">"),e=r.converter._dispatch("encodeAmpsAndAngles.after",e,t,r)})),a.subParser("encodeBackslashEscapes",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("encodeBackslashEscapes.before",e,t,r)).replace(/\\(\\)/g,a.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,a.helper.escapeCharactersCallback),e=r.converter._dispatch("encodeBackslashEscapes.after",e,t,r)})),a.subParser("encodeCode",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("encodeCode.before",e,t,r)).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/([*_{}\[\]\\=~-])/g,a.helper.escapeCharactersCallback),e=r.converter._dispatch("encodeCode.after",e,t,r)})),a.subParser("escapeSpecialCharsWithinTagAttributes",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",e,t,r)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,(function(e){return e.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,a.helper.escapeCharactersCallback)}))).replace(/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi,(function(e){return e.replace(/([\\`*_~=|])/g,a.helper.escapeCharactersCallback)})),e=r.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,t,r)})),a.subParser("githubCodeBlocks",(function(e,t,r){"use strict";return t.ghCodeBlocks?(e=r.converter._dispatch("githubCodeBlocks.before",e,t,r),e=(e=(e+="¨0").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,(function(e,n,o,i){var s=t.omitExtraWLInCodeBlocks?"":"\n";return i=a.subParser("encodeCode")(i,t,r),i="<pre><code"+(o?' class="'+o+" language-"+o+'"':"")+">"+(i=(i=(i=a.subParser("detab")(i,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+s+"</code></pre>",i=a.subParser("hashBlock")(i,t,r),"\n\n¨G"+(r.ghCodeBlocks.push({text:e,codeblock:i})-1)+"G\n\n"}))).replace(/¨0/,""),r.converter._dispatch("githubCodeBlocks.after",e,t,r)):e})),a.subParser("hashBlock",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("hashBlock.before",e,t,r)).replace(/(^\n+|\n+$)/g,""),e="\n\n¨K"+(r.gHtmlBlocks.push(e)-1)+"K\n\n",e=r.converter._dispatch("hashBlock.after",e,t,r)})),a.subParser("hashCodeTags",(function(e,t,r){"use strict";e=r.converter._dispatch("hashCodeTags.before",e,t,r);return e=a.helper.replaceRecursiveRegExp(e,(function(e,n,o,i){var s=o+a.subParser("encodeCode")(n,t,r)+i;return"¨C"+(r.gHtmlSpans.push(s)-1)+"C"}),"<code\\b[^>]*>","</code>","gim"),e=r.converter._dispatch("hashCodeTags.after",e,t,r)})),a.subParser("hashElement",(function(e,t,r){"use strict";return function(e,t){var n=t;return n=(n=(n=n.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),n="\n\n¨K"+(r.gHtmlBlocks.push(n)-1)+"K\n\n"}})),a.subParser("hashHTMLBlocks",(function(e,t,r){"use strict";e=r.converter._dispatch("hashHTMLBlocks.before",e,t,r);var n=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],o=function(e,t,n,o){var a=e;return-1!==n.search(/\bmarkdown\b/)&&(a=n+r.converter.makeHtml(t)+o),"\n\n¨K"+(r.gHtmlBlocks.push(a)-1)+"K\n\n"};t.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,(function(e,t){return"<"+t+">"})));for(var i=0;i<n.length;++i)for(var s,c=new RegExp("^ {0,3}(<"+n[i]+"\\b[^>]*>)","im"),l="<"+n[i]+"\\b[^>]*>",u="</"+n[i]+">";-1!==(s=a.helper.regexIndexOf(e,c));){var d=a.helper.splitAtIndex(e,s),p=a.helper.replaceRecursiveRegExp(d[1],o,l,u,"im");if(p===d[1])break;e=d[0].concat(p)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,a.subParser("hashElement")(e,t,r)),e=(e=a.helper.replaceRecursiveRegExp(e,(function(e){return"\n\n¨K"+(r.gHtmlBlocks.push(e)-1)+"K\n\n"}),"^ {0,3}\x3c!--","--\x3e","gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,a.subParser("hashElement")(e,t,r)),e=r.converter._dispatch("hashHTMLBlocks.after",e,t,r)})),a.subParser("hashHTMLSpans",(function(e,t,r){"use strict";function n(e){return"¨C"+(r.gHtmlSpans.push(e)-1)+"C"}return e=(e=(e=(e=(e=r.converter._dispatch("hashHTMLSpans.before",e,t,r)).replace(/<[^>]+?\/>/gi,(function(e){return n(e)}))).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,(function(e){return n(e)}))).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,(function(e){return n(e)}))).replace(/<[^>]+?>/gi,(function(e){return n(e)})),e=r.converter._dispatch("hashHTMLSpans.after",e,t,r)})),a.subParser("unhashHTMLSpans",(function(e,t,r){"use strict";e=r.converter._dispatch("unhashHTMLSpans.before",e,t,r);for(var n=0;n<r.gHtmlSpans.length;++n){for(var o=r.gHtmlSpans[n],a=0;/¨C(\d+)C/.test(o);){var i=RegExp.$1;if(o=o.replace("¨C"+i+"C",r.gHtmlSpans[i]),10===a){console.error("maximum nesting of 10 spans reached!!!");break}++a}e=e.replace("¨C"+n+"C",o)}return e=r.converter._dispatch("unhashHTMLSpans.after",e,t,r)})),a.subParser("hashPreCodeTags",(function(e,t,r){"use strict";e=r.converter._dispatch("hashPreCodeTags.before",e,t,r);return e=a.helper.replaceRecursiveRegExp(e,(function(e,n,o,i){var s=o+a.subParser("encodeCode")(n,t,r)+i;return"\n\n¨G"+(r.ghCodeBlocks.push({text:e,codeblock:s})-1)+"G\n\n"}),"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>","^ {0,3}</code>\\s*</pre>","gim"),e=r.converter._dispatch("hashPreCodeTags.after",e,t,r)})),a.subParser("headers",(function(e,t,r){"use strict";e=r.converter._dispatch("headers.before",e,t,r);var n=isNaN(parseInt(t.headerLevelStart))?1:parseInt(t.headerLevelStart),o=t.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,i=t.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;e=(e=e.replace(o,(function(e,o){var i=a.subParser("spanGamut")(o,t,r),s=t.noHeaderId?"":' id="'+c(o)+'"',l="<h"+n+s+">"+i+"</h"+n+">";return a.subParser("hashBlock")(l,t,r)}))).replace(i,(function(e,o){var i=a.subParser("spanGamut")(o,t,r),s=t.noHeaderId?"":' id="'+c(o)+'"',l=n+1,u="<h"+l+s+">"+i+"</h"+l+">";return a.subParser("hashBlock")(u,t,r)}));var s=t.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;function c(e){var n,o;if(t.customizedHeaderId){var i=e.match(/\{([^{]+?)}\s*$/);i&&i[1]&&(e=i[1])}return n=e,o=a.helper.isString(t.prefixHeaderId)?t.prefixHeaderId:!0===t.prefixHeaderId?"section-":"",t.rawPrefixHeaderId||(n=o+n),n=t.ghCompatibleHeaderId?n.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():t.rawHeaderId?n.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():n.replace(/[^\w]/g,"").toLowerCase(),t.rawPrefixHeaderId&&(n=o+n),r.hashLinkCounts[n]?n=n+"-"+r.hashLinkCounts[n]++:r.hashLinkCounts[n]=1,n}return e=e.replace(s,(function(e,o,i){var s=i;t.customizedHeaderId&&(s=i.replace(/\s?\{([^{]+?)}\s*$/,""));var l=a.subParser("spanGamut")(s,t,r),u=t.noHeaderId?"":' id="'+c(i)+'"',d=n-1+o.length,p="<h"+d+u+">"+l+"</h"+d+">";return a.subParser("hashBlock")(p,t,r)})),e=r.converter._dispatch("headers.after",e,t,r)})),a.subParser("horizontalRule",(function(e,t,r){"use strict";e=r.converter._dispatch("horizontalRule.before",e,t,r);var n=a.subParser("hashBlock")("<hr />",t,r);return e=(e=(e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,n)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,n)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,n),e=r.converter._dispatch("horizontalRule.after",e,t,r)})),a.subParser("images",(function(e,t,r){"use strict";function n(e,t,n,o,i,s,c,l){var u=r.gUrls,d=r.gTitles,p=r.gDimensions;if(n=n.toLowerCase(),l||(l=""),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)o="";else if(""===o||null===o){if(""!==n&&null!==n||(n=t.toLowerCase().replace(/ ?\n/g," ")),o="#"+n,a.helper.isUndefined(u[n]))return e;o=u[n],a.helper.isUndefined(d[n])||(l=d[n]),a.helper.isUndefined(p[n])||(i=p[n].width,s=p[n].height)}t=t.replace(/"/g,""").replace(a.helper.regexes.asteriskDashAndColon,a.helper.escapeCharactersCallback);var f='<img src="'+(o=o.replace(a.helper.regexes.asteriskDashAndColon,a.helper.escapeCharactersCallback))+'" alt="'+t+'"';return l&&a.helper.isString(l)&&(f+=' title="'+(l=l.replace(/"/g,""").replace(a.helper.regexes.asteriskDashAndColon,a.helper.escapeCharactersCallback))+'"'),i&&s&&(f+=' width="'+(i="*"===i?"auto":i)+'"',f+=' height="'+(s="*"===s?"auto":s)+'"'),f+=" />"}return e=(e=(e=(e=(e=(e=r.converter._dispatch("images.before",e,t,r)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,n)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,(function(e,t,r,o,a,i,s,c){return n(e,t,r,o=o.replace(/\s/g,""),a,i,s,c)}))).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,n)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,n)).replace(/!\[([^\[\]]+)]()()()()()/g,n),e=r.converter._dispatch("images.after",e,t,r)})),a.subParser("italicsAndBold",(function(e,t,r){"use strict";function n(e,t,r){return t+e+r}return e=r.converter._dispatch("italicsAndBold.before",e,t,r),e=t.literalMidWordUnderscores?(e=(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return n(t,"<strong><em>","</em></strong>")}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return n(t,"<strong>","</strong>")}))).replace(/\b_(\S[\s\S]*?)_\b/g,(function(e,t){return n(t,"<em>","</em>")})):(e=(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?n(t,"<strong><em>","</em></strong>"):e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?n(t,"<strong>","</strong>"):e}))).replace(/_([^\s_][\s\S]*?)_/g,(function(e,t){return/\S$/.test(t)?n(t,"<em>","</em>"):e})),e=t.literalMidWordAsterisks?(e=(e=e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,(function(e,t,r){return n(r,t+"<strong><em>","</em></strong>")}))).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,(function(e,t,r){return n(r,t+"<strong>","</strong>")}))).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,(function(e,t,r){return n(r,t+"<em>","</em>")})):(e=(e=e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,(function(e,t){return/\S$/.test(t)?n(t,"<strong><em>","</em></strong>"):e}))).replace(/\*\*(\S[\s\S]*?)\*\*/g,(function(e,t){return/\S$/.test(t)?n(t,"<strong>","</strong>"):e}))).replace(/\*([^\s*][\s\S]*?)\*/g,(function(e,t){return/\S$/.test(t)?n(t,"<em>","</em>"):e})),e=r.converter._dispatch("italicsAndBold.after",e,t,r)})),a.subParser("lists",(function(e,t,r){"use strict";function n(e,n){r.gListLevel++,e=e.replace(/\n{2,}$/,"\n");var o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,i=/\n[ \t]*\n(?!¨0)/.test(e+="¨0");return t.disableForced4SpacesIndentedSublists&&(o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=(e=e.replace(o,(function(e,n,o,s,c,l,u){u=u&&""!==u.trim();var d=a.subParser("outdent")(c,t,r),p="";return l&&t.tasklists&&(p=' class="task-list-item" style="list-style-type: none;"',d=d.replace(/^[ \t]*\[(x|X| )?]/m,(function(){var e='<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';return u&&(e+=" checked"),e+=">"}))),d=d.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,(function(e){return"¨A"+e})),n||d.search(/\n{2,}/)>-1?(d=a.subParser("githubCodeBlocks")(d,t,r),d=a.subParser("blockGamut")(d,t,r)):(d=(d=a.subParser("lists")(d,t,r)).replace(/\n$/,""),d=(d=a.subParser("hashHTMLBlocks")(d,t,r)).replace(/\n\n+/g,"\n\n"),d=i?a.subParser("paragraphs")(d,t,r):a.subParser("spanGamut")(d,t,r)),d="<li"+p+">"+(d=d.replace("¨A",""))+"</li>\n"}))).replace(/¨0/g,""),r.gListLevel--,n&&(e=e.replace(/\s+$/,"")),e}function o(e,t){if("ol"===t){var r=e.match(/^ *(\d+)\./);if(r&&"1"!==r[1])return' start="'+r[1]+'"'}return""}function i(e,r,a){var i=t.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,s=t.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,c="ul"===r?i:s,l="";if(-1!==e.search(c))!function t(u){var d=u.search(c),p=o(e,r);-1!==d?(l+="\n\n<"+r+p+">\n"+n(u.slice(0,d),!!a)+"</"+r+">\n",c="ul"===(r="ul"===r?"ol":"ul")?i:s,t(u.slice(d))):l+="\n\n<"+r+p+">\n"+n(u,!!a)+"</"+r+">\n"}(e);else{var u=o(e,r);l="\n\n<"+r+u+">\n"+n(e,!!a)+"</"+r+">\n"}return l}return e=r.converter._dispatch("lists.before",e,t,r),e+="¨0",e=(e=r.gListLevel?e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,r){return i(t,r.search(/[*+-]/g)>-1?"ul":"ol",!0)})):e.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,r,n){return i(r,n.search(/[*+-]/g)>-1?"ul":"ol",!1)}))).replace(/¨0/,""),e=r.converter._dispatch("lists.after",e,t,r)})),a.subParser("metadata",(function(e,t,r){"use strict";if(!t.metadata)return e;function n(e){r.metadata.raw=e,(e=(e=e.replace(/&/g,"&").replace(/"/g,""")).replace(/\n {4}/g," ")).replace(/^([\S ]+): +([\s\S]+?)$/gm,(function(e,t,n){return r.metadata.parsed[t]=n,""}))}return e=(e=(e=(e=r.converter._dispatch("metadata.before",e,t,r)).replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,(function(e,t,r){return n(r),"¨M"}))).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,(function(e,t,o){return t&&(r.metadata.format=t),n(o),"¨M"}))).replace(/¨M/g,""),e=r.converter._dispatch("metadata.after",e,t,r)})),a.subParser("outdent",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("outdent.before",e,t,r)).replace(/^(\t|[ ]{1,4})/gm,"¨0")).replace(/¨0/g,""),e=r.converter._dispatch("outdent.after",e,t,r)})),a.subParser("paragraphs",(function(e,t,r){"use strict";for(var n=(e=(e=(e=r.converter._dispatch("paragraphs.before",e,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),o=[],i=n.length,s=0;s<i;s++){var c=n[s];c.search(/¨(K|G)(\d+)\1/g)>=0?o.push(c):c.search(/\S/)>=0&&(c=(c=a.subParser("spanGamut")(c,t,r)).replace(/^([ \t]*)/g,"<p>"),c+="</p>",o.push(c))}for(i=o.length,s=0;s<i;s++){for(var l="",u=o[s],d=!1;/¨(K|G)(\d+)\1/.test(u);){var p=RegExp.$1,f=RegExp.$2;l=(l="K"===p?r.gHtmlBlocks[f]:d?a.subParser("encodeCode")(r.ghCodeBlocks[f].text,t,r):r.ghCodeBlocks[f].codeblock).replace(/\$/g,"$$$$"),u=u.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/,l),/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(u)&&(d=!0)}o[s]=u}return e=(e=(e=o.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),r.converter._dispatch("paragraphs.after",e,t,r)})),a.subParser("runExtension",(function(e,t,r,n){"use strict";if(e.filter)t=e.filter(t,n.converter,r);else if(e.regex){var o=e.regex;o instanceof RegExp||(o=new RegExp(o,"g")),t=t.replace(o,e.replace)}return t})),a.subParser("spanGamut",(function(e,t,r){"use strict";return e=r.converter._dispatch("spanGamut.before",e,t,r),e=a.subParser("codeSpans")(e,t,r),e=a.subParser("escapeSpecialCharsWithinTagAttributes")(e,t,r),e=a.subParser("encodeBackslashEscapes")(e,t,r),e=a.subParser("images")(e,t,r),e=a.subParser("anchors")(e,t,r),e=a.subParser("autoLinks")(e,t,r),e=a.subParser("simplifiedAutoLinks")(e,t,r),e=a.subParser("emoji")(e,t,r),e=a.subParser("underline")(e,t,r),e=a.subParser("italicsAndBold")(e,t,r),e=a.subParser("strikethrough")(e,t,r),e=a.subParser("ellipsis")(e,t,r),e=a.subParser("hashHTMLSpans")(e,t,r),e=a.subParser("encodeAmpsAndAngles")(e,t,r),t.simpleLineBreaks?/\n\n¨K/.test(e)||(e=e.replace(/\n+/g,"<br />\n")):e=e.replace(/ +\n/g,"<br />\n"),e=r.converter._dispatch("spanGamut.after",e,t,r)})),a.subParser("strikethrough",(function(e,t,r){"use strict";return t.strikethrough&&(e=(e=r.converter._dispatch("strikethrough.before",e,t,r)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,(function(e,n){return function(e){return t.simplifiedAutoLink&&(e=a.subParser("simplifiedAutoLinks")(e,t,r)),"<del>"+e+"</del>"}(n)})),e=r.converter._dispatch("strikethrough.after",e,t,r)),e})),a.subParser("stripLinkDefinitions",(function(e,t,r){"use strict";var n=function(e,n,o,i,s,c,l){return n=n.toLowerCase(),o.match(/^data:.+?\/.+?;base64,/)?r.gUrls[n]=o.replace(/\s/g,""):r.gUrls[n]=a.subParser("encodeAmpsAndAngles")(o,t,r),c?c+l:(l&&(r.gTitles[n]=l.replace(/"|'/g,""")),t.parseImgDimensions&&i&&s&&(r.gDimensions[n]={width:i,height:s}),"")};return e=(e=(e=(e+="¨0").replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,n)).replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,n)).replace(/¨0/,"")})),a.subParser("tables",(function(e,t,r){"use strict";if(!t.tables)return e;function n(e,n){return"<td"+n+">"+a.subParser("spanGamut")(e,t,r)+"</td>\n"}function o(e){var o,i=e.split("\n");for(o=0;o<i.length;++o)/^ {0,3}\|/.test(i[o])&&(i[o]=i[o].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(i[o])&&(i[o]=i[o].replace(/\|[ \t]*$/,"")),i[o]=a.subParser("codeSpans")(i[o],t,r);var s,c,l,u,d=i[0].split("|").map((function(e){return e.trim()})),p=i[1].split("|").map((function(e){return e.trim()})),f=[],h=[],g=[],m=[];for(i.shift(),i.shift(),o=0;o<i.length;++o)""!==i[o].trim()&&f.push(i[o].split("|").map((function(e){return e.trim()})));if(d.length<p.length)return e;for(o=0;o<p.length;++o)g.push((s=p[o],/^:[ \t]*--*$/.test(s)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(s)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(s)?' style="text-align:center;"':""));for(o=0;o<d.length;++o)a.helper.isUndefined(g[o])&&(g[o]=""),h.push((c=d[o],l=g[o],u=void 0,u="",c=c.trim(),(t.tablesHeaderId||t.tableHeaderId)&&(u=' id="'+c.replace(/ /g,"_").toLowerCase()+'"'),"<th"+u+l+">"+(c=a.subParser("spanGamut")(c,t,r))+"</th>\n"));for(o=0;o<f.length;++o){for(var b=[],_=0;_<h.length;++_)a.helper.isUndefined(f[o][_]),b.push(n(f[o][_],g[_]));m.push(b)}return function(e,t){for(var r="<table>\n<thead>\n<tr>\n",n=e.length,o=0;o<n;++o)r+=e[o];for(r+="</tr>\n</thead>\n<tbody>\n",o=0;o<t.length;++o){r+="<tr>\n";for(var a=0;a<n;++a)r+=t[o][a];r+="</tr>\n"}return r+"</tbody>\n</table>\n"}(h,m)}return e=(e=(e=(e=r.converter._dispatch("tables.before",e,t,r)).replace(/\\(\|)/g,a.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,o)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm,o),e=r.converter._dispatch("tables.after",e,t,r)})),a.subParser("underline",(function(e,t,r){"use strict";return t.underline?(e=r.converter._dispatch("underline.before",e,t,r),e=(e=t.literalMidWordUnderscores?(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return"<u>"+t+"</u>"}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return"<u>"+t+"</u>"})):(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e}))).replace(/(_)/g,a.helper.escapeCharactersCallback),e=r.converter._dispatch("underline.after",e,t,r)):e})),a.subParser("unescapeSpecialChars",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("unescapeSpecialChars.before",e,t,r)).replace(/¨E(\d+)E/g,(function(e,t){var r=parseInt(t);return String.fromCharCode(r)})),e=r.converter._dispatch("unescapeSpecialChars.after",e,t,r)})),a.subParser("makeMarkdown.blockquote",(function(e,t){"use strict";var r="";if(e.hasChildNodes())for(var n=e.childNodes,o=n.length,i=0;i<o;++i){var s=a.subParser("makeMarkdown.node")(n[i],t);""!==s&&(r+=s)}return r="> "+(r=r.trim()).split("\n").join("\n> ")})),a.subParser("makeMarkdown.codeBlock",(function(e,t){"use strict";var r=e.getAttribute("language"),n=e.getAttribute("precodenum");return"```"+r+"\n"+t.preList[n]+"\n```"})),a.subParser("makeMarkdown.codeSpan",(function(e){"use strict";return"`"+e.innerHTML+"`"})),a.subParser("makeMarkdown.emphasis",(function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="*";for(var n=e.childNodes,o=n.length,i=0;i<o;++i)r+=a.subParser("makeMarkdown.node")(n[i],t);r+="*"}return r})),a.subParser("makeMarkdown.header",(function(e,t,r){"use strict";var n=new Array(r+1).join("#"),o="";if(e.hasChildNodes()){o=n+" ";for(var i=e.childNodes,s=i.length,c=0;c<s;++c)o+=a.subParser("makeMarkdown.node")(i[c],t)}return o})),a.subParser("makeMarkdown.hr",(function(){"use strict";return"---"})),a.subParser("makeMarkdown.image",(function(e){"use strict";var t="";return e.hasAttribute("src")&&(t+="+">",e.hasAttribute("width")&&e.hasAttribute("height")&&(t+=" ="+e.getAttribute("width")+"x"+e.getAttribute("height")),e.hasAttribute("title")&&(t+=' "'+e.getAttribute("title")+'"'),t+=")"),t})),a.subParser("makeMarkdown.links",(function(e,t){"use strict";var r="";if(e.hasChildNodes()&&e.hasAttribute("href")){var n=e.childNodes,o=n.length;r="[";for(var i=0;i<o;++i)r+=a.subParser("makeMarkdown.node")(n[i],t);r+="](",r+="<"+e.getAttribute("href")+">",e.hasAttribute("title")&&(r+=' "'+e.getAttribute("title")+'"'),r+=")"}return r})),a.subParser("makeMarkdown.list",(function(e,t,r){"use strict";var n="";if(!e.hasChildNodes())return"";for(var o=e.childNodes,i=o.length,s=e.getAttribute("start")||1,c=0;c<i;++c)if(void 0!==o[c].tagName&&"li"===o[c].tagName.toLowerCase()){n+=("ol"===r?s.toString()+". ":"- ")+a.subParser("makeMarkdown.listItem")(o[c],t),++s}return(n+="\n\x3c!-- --\x3e\n").trim()})),a.subParser("makeMarkdown.listItem",(function(e,t){"use strict";for(var r="",n=e.childNodes,o=n.length,i=0;i<o;++i)r+=a.subParser("makeMarkdown.node")(n[i],t);return/\n$/.test(r)?r=r.split("\n").join("\n ").replace(/^ {4}$/gm,"").replace(/\n\n+/g,"\n\n"):r+="\n",r})),a.subParser("makeMarkdown.node",(function(e,t,r){"use strict";r=r||!1;var n="";if(3===e.nodeType)return a.subParser("makeMarkdown.txt")(e,t);if(8===e.nodeType)return"\x3c!--"+e.data+"--\x3e\n\n";if(1!==e.nodeType)return"";switch(e.tagName.toLowerCase()){case"h1":r||(n=a.subParser("makeMarkdown.header")(e,t,1)+"\n\n");break;case"h2":r||(n=a.subParser("makeMarkdown.header")(e,t,2)+"\n\n");break;case"h3":r||(n=a.subParser("makeMarkdown.header")(e,t,3)+"\n\n");break;case"h4":r||(n=a.subParser("makeMarkdown.header")(e,t,4)+"\n\n");break;case"h5":r||(n=a.subParser("makeMarkdown.header")(e,t,5)+"\n\n");break;case"h6":r||(n=a.subParser("makeMarkdown.header")(e,t,6)+"\n\n");break;case"p":r||(n=a.subParser("makeMarkdown.paragraph")(e,t)+"\n\n");break;case"blockquote":r||(n=a.subParser("makeMarkdown.blockquote")(e,t)+"\n\n");break;case"hr":r||(n=a.subParser("makeMarkdown.hr")(e,t)+"\n\n");break;case"ol":r||(n=a.subParser("makeMarkdown.list")(e,t,"ol")+"\n\n");break;case"ul":r||(n=a.subParser("makeMarkdown.list")(e,t,"ul")+"\n\n");break;case"precode":r||(n=a.subParser("makeMarkdown.codeBlock")(e,t)+"\n\n");break;case"pre":r||(n=a.subParser("makeMarkdown.pre")(e,t)+"\n\n");break;case"table":r||(n=a.subParser("makeMarkdown.table")(e,t)+"\n\n");break;case"code":n=a.subParser("makeMarkdown.codeSpan")(e,t);break;case"em":case"i":n=a.subParser("makeMarkdown.emphasis")(e,t);break;case"strong":case"b":n=a.subParser("makeMarkdown.strong")(e,t);break;case"del":n=a.subParser("makeMarkdown.strikethrough")(e,t);break;case"a":n=a.subParser("makeMarkdown.links")(e,t);break;case"img":n=a.subParser("makeMarkdown.image")(e,t);break;default:n=e.outerHTML+"\n\n"}return n})),a.subParser("makeMarkdown.paragraph",(function(e,t){"use strict";var r="";if(e.hasChildNodes())for(var n=e.childNodes,o=n.length,i=0;i<o;++i)r+=a.subParser("makeMarkdown.node")(n[i],t);return r=r.trim()})),a.subParser("makeMarkdown.pre",(function(e,t){"use strict";var r=e.getAttribute("prenum");return"<pre>"+t.preList[r]+"</pre>"})),a.subParser("makeMarkdown.strikethrough",(function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="~~";for(var n=e.childNodes,o=n.length,i=0;i<o;++i)r+=a.subParser("makeMarkdown.node")(n[i],t);r+="~~"}return r})),a.subParser("makeMarkdown.strong",(function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="**";for(var n=e.childNodes,o=n.length,i=0;i<o;++i)r+=a.subParser("makeMarkdown.node")(n[i],t);r+="**"}return r})),a.subParser("makeMarkdown.table",(function(e,t){"use strict";var r,n,o="",i=[[],[]],s=e.querySelectorAll("thead>tr>th"),c=e.querySelectorAll("tbody>tr");for(r=0;r<s.length;++r){var l=a.subParser("makeMarkdown.tableCell")(s[r],t),u="---";if(s[r].hasAttribute("style"))switch(s[r].getAttribute("style").toLowerCase().replace(/\s/g,"")){case"text-align:left;":u=":---";break;case"text-align:right;":u="---:";break;case"text-align:center;":u=":---:"}i[0][r]=l.trim(),i[1][r]=u}for(r=0;r<c.length;++r){var d=i.push([])-1,p=c[r].getElementsByTagName("td");for(n=0;n<s.length;++n){var f=" ";void 0!==p[n]&&(f=a.subParser("makeMarkdown.tableCell")(p[n],t)),i[d].push(f)}}var h=3;for(r=0;r<i.length;++r)for(n=0;n<i[r].length;++n){var g=i[r][n].length;g>h&&(h=g)}for(r=0;r<i.length;++r){for(n=0;n<i[r].length;++n)1===r?":"===i[r][n].slice(-1)?i[r][n]=a.helper.padEnd(i[r][n].slice(-1),h-1,"-")+":":i[r][n]=a.helper.padEnd(i[r][n],h,"-"):i[r][n]=a.helper.padEnd(i[r][n],h);o+="| "+i[r].join(" | ")+" |\n"}return o.trim()})),a.subParser("makeMarkdown.tableCell",(function(e,t){"use strict";var r="";if(!e.hasChildNodes())return"";for(var n=e.childNodes,o=n.length,i=0;i<o;++i)r+=a.subParser("makeMarkdown.node")(n[i],t,!0);return r.trim()})),a.subParser("makeMarkdown.txt",(function(e){"use strict";var t=e.nodeValue;return t=(t=t.replace(/ +/g," ")).replace(/¨NBSP;/g," "),t=(t=(t=(t=(t=(t=(t=(t=(t=a.helper.unescapeHTMLEntities(t)).replace(/([*_~|`])/g,"\\$1")).replace(/^(\s*)>/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")}));void 0===(n=function(){"use strict";return a}.call(t,r,t,e))||(e.exports=n)}).call(this)},5373:(e,t)=>{"use strict";var r,n=Symbol.for("react.element"),o=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");
/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case a:case s:case i:case p:case f:return e;default:switch(e=e&&e.$$typeof){case u:case l:case d:case g:case h:case c:return e;default:return t}}case o:return t}}}r=Symbol.for("react.module.reference"),t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===s||e===i||e===p||e===f||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===c||e.$$typeof===l||e.$$typeof===d||e.$$typeof===r||void 0!==e.getModuleId)}},7734:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,a;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!=o--;)if(!e(t[o],r[o]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(o of t.entries())if(!r.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],r.get(o[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(o of t.entries())if(!r.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if((n=t.length)!=r.length)return!1;for(o=n;0!=o--;)if(t[o]!==r[o])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;0!=o--;){var i=a[o];if(!e(t[i],r[i]))return!1}return!0}return t!=t&&r!=r}},8529:(e,t,r)=>{"use strict";e.exports=r(5373)},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},r=Object.keys(t).join("|"),n=new RegExp(r,"g"),o=new RegExp(r,"");function a(e){return t[e]}var i=function(e){return e.replace(n,a)};e.exports=i,e.exports.has=function(e){return!!e.match(o)},e.exports.remove=i}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{__EXPERIMENTAL_ELEMENTS:()=>ee,__EXPERIMENTAL_PATHS_WITH_OVERRIDE:()=>te,__EXPERIMENTAL_STYLE_PROPERTY:()=>J,__experimentalCloneSanitizedBlock:()=>Sr,__experimentalGetAccessibleBlockLabel:()=>We,__experimentalGetBlockAttributesNamesByRole:()=>Je,__experimentalGetBlockLabel:()=>Ke,__experimentalSanitizeBlockAttributes:()=>Qe,__unstableGetBlockProps:()=>Zr,__unstableGetInnerBlocksProps:()=>Qr,__unstableSerializeAndClean:()=>nn,children:()=>to,cloneBlock:()=>Br,createBlock:()=>xr,createBlocksFromInnerBlocksTemplate:()=>Er,doBlocksMatchTemplate:()=>ca,findTransform:()=>jr,getBlockAttributes:()=>so,getBlockAttributesNamesByRole:()=>Xe,getBlockBindingsSource:()=>Re,getBlockBindingsSources:()=>Ve,getBlockContent:()=>en,getBlockDefaultClassName:()=>Gr,getBlockFromExample:()=>Rr,getBlockMenuDefaultClassName:()=>Kr,getBlockSupport:()=>xe,getBlockTransforms:()=>Dr,getBlockType:()=>Te,getBlockTypes:()=>Ce,getBlockVariations:()=>Me,getCategories:()=>aa,getChildBlockNames:()=>Ae,getDefaultBlockName:()=>ve,getFreeformContentHandlerName:()=>me,getGroupingBlockName:()=>be,getPhrasingContentSchema:()=>jo,getPossibleBlockTransformations:()=>Mr,getSaveContent:()=>Jr,getSaveElement:()=>Xr,getUnregisteredTypeHandlerName:()=>ye,hasBlockSupport:()=>Ee,hasChildBlocks:()=>Ne,hasChildBlocksWithInserterSupport:()=>Pe,isReusableBlock:()=>Se,isTemplatePart:()=>Be,isUnmodifiedBlock:()=>$e,isUnmodifiedDefaultBlock:()=>Ue,isValidBlockContent:()=>$n,isValidIcon:()=>Fe,node:()=>Qn,normalizeIconObject:()=>qe,parse:()=>mo,parseWithAttributeSchema:()=>io,pasteHandler:()=>oa,privateApis:()=>ha,rawHandler:()=>Do,registerBlockBindingsSource:()=>ze,registerBlockCollection:()=>fe,registerBlockStyle:()=>Oe,registerBlockType:()=>de,registerBlockVariation:()=>je,serialize:()=>on,serializeRawBlock:()=>qr,setCategories:()=>ia,setDefaultBlockName:()=>ke,setFreeformContentHandlerName:()=>ge,setGroupingBlockName:()=>we,setUnregisteredTypeHandlerName:()=>_e,store:()=>br,switchToBlockType:()=>Ir,synchronizeBlocksWithTemplate:()=>fa,unregisterBlockBindingsSource:()=>Ie,unregisterBlockStyle:()=>Le,unregisterBlockType:()=>he,unregisterBlockVariation:()=>De,unstable__bootstrapServerSideBlockDefinitions:()=>le,updateCategory:()=>sa,validateBlock:()=>Hn,withBlockContentContext:()=>ga});var e={};r.r(e),r.d(e,{getAllBlockBindingsSources:()=>wt,getBlockBindingsSource:()=>vt,getBootstrappedBlockType:()=>yt,getSupportedStyles:()=>_t,getUnprocessedBlockTypes:()=>kt,hasContentRoleAttribute:()=>Tt});var t={};r.r(t),r.d(t,{__experimentalHasContentRoleAttribute:()=>Ft,getActiveBlockVariation:()=>At,getBlockStyles:()=>St,getBlockSupport:()=>It,getBlockType:()=>Et,getBlockTypes:()=>xt,getBlockVariations:()=>Bt,getCategories:()=>Pt,getChildBlockNames:()=>zt,getCollections:()=>Ot,getDefaultBlockName:()=>Lt,getDefaultBlockVariation:()=>Nt,getFreeformFallbackBlockName:()=>Mt,getGroupingBlockName:()=>Dt,getUnregisteredFallbackBlockName:()=>jt,hasBlockSupport:()=>Rt,hasChildBlocks:()=>$t,hasChildBlocksWithInserterSupport:()=>Ut,isMatchingSearchTerm:()=>Ht});var o={};r.r(o),r.d(o,{__experimentalReapplyBlockFilters:()=>Jt,addBlockCollection:()=>dr,addBlockStyles:()=>tr,addBlockTypes:()=>Qt,addBlockVariations:()=>nr,reapplyBlockTypeFilters:()=>Xt,removeBlockCollection:()=>pr,removeBlockStyles:()=>rr,removeBlockTypes:()=>er,removeBlockVariations:()=>or,setCategories:()=>lr,setDefaultBlockName:()=>ar,setFreeformFallbackBlockName:()=>ir,setGroupingBlockName:()=>cr,setUnregisteredFallbackBlockName:()=>sr,updateCategory:()=>ur});var a={};r.r(a),r.d(a,{addBlockBindingsSource:()=>gr,addBootstrappedBlockType:()=>fr,addUnprocessedBlockType:()=>hr,removeBlockBindingsSource:()=>mr});const i=window.wp.data;var s=function(){return s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function c(e){return e.toLowerCase()}var l=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],u=/[^A-Z0-9]+/gi;function d(e,t,r){return t instanceof RegExp?e.replace(t,r):t.reduce((function(e,t){return e.replace(t,r)}),e)}function p(e,t){var r=e.charAt(0),n=e.substr(1).toLowerCase();return t>0&&r>="0"&&r<="9"?"_"+r+n:""+r.toUpperCase()+n}function f(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var r=t.splitRegexp,n=void 0===r?l:r,o=t.stripRegexp,a=void 0===o?u:o,i=t.transform,s=void 0===i?c:i,p=t.delimiter,f=void 0===p?" ":p,h=d(d(e,n,"$1\0$2"),a,"\0"),g=0,m=h.length;"\0"===h.charAt(g);)g++;for(;"\0"===h.charAt(m-1);)m--;return h.slice(g,m).split("\0").map(s).join(f)}(e,s({delimiter:"",transform:p},t))}function h(e,t){return 0===t?e.toLowerCase():p(e,t)}const g=window.wp.i18n;var m={grad:.9,turn:360,rad:360/(2*Math.PI)},b=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},_=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},y=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e>t?e:t},k=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},w=function(e){return{r:y(e.r,0,255),g:y(e.g,0,255),b:y(e.b,0,255),a:y(e.a)}},v=function(e){return{r:_(e.r),g:_(e.g),b:_(e.b),a:_(e.a,3)}},T=/^#([0-9a-f]{3,8})$/i,C=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},x=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,a=Math.max(t,r,n),i=a-Math.min(t,r,n),s=i?a===t?(r-n)/i:a===r?2+(n-t)/i:4+(t-r)/i:0;return{h:60*(s<0?s+6:s),s:a?i/a*100:0,v:a/255*100,a:o}},E=function(e){var t=e.h,r=e.s,n=e.v,o=e.a;t=t/360*6,r/=100,n/=100;var a=Math.floor(t),i=n*(1-r),s=n*(1-(t-a)*r),c=n*(1-(1-t+a)*r),l=a%6;return{r:255*[n,s,i,i,c,n][l],g:255*[c,n,n,s,i,i][l],b:255*[i,i,c,n,n,s][l],a:o}},S=function(e){return{h:k(e.h),s:y(e.s,0,100),l:y(e.l,0,100),a:y(e.a)}},B=function(e){return{h:_(e.h),s:_(e.s),l:_(e.l),a:_(e.a,3)}},A=function(e){return E((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}));var t,r,n},N=function(e){return{h:(t=x(e)).h,s:(o=(200-(r=t.s))*(n=t.v)/100)>0&&o<200?r*n/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,r,n,o},P=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,O=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,L=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,M=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,j={string:[[function(e){var t=T.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?_(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?_(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=L.exec(e)||M.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:w({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=P.exec(e)||O.exec(e);if(!t)return null;var r,n,o=S({h:(r=t[1],n=t[2],void 0===n&&(n="deg"),Number(r)*(m[n]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return A(o)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,o=e.a,a=void 0===o?1:o;return b(t)&&b(r)&&b(n)?w({r:Number(t),g:Number(r),b:Number(n),a:Number(a)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,o=e.a,a=void 0===o?1:o;if(!b(t)||!b(r)||!b(n))return null;var i=S({h:Number(t),s:Number(r),l:Number(n),a:Number(a)});return A(i)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,o=e.a,a=void 0===o?1:o;if(!b(t)||!b(r)||!b(n))return null;var i=function(e){return{h:k(e.h),s:y(e.s,0,100),v:y(e.v,0,100),a:y(e.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(a)});return E(i)},"hsv"]]},D=function(e,t){for(var r=0;r<t.length;r++){var n=t[r][0](e);if(n)return[n,t[r][1]]}return[null,void 0]},z=function(e){return"string"==typeof e?D(e.trim(),j.string):"object"==typeof e&&null!==e?D(e,j.object):[null,void 0]},I=function(e,t){var r=N(e);return{h:r.h,s:y(r.s+100*t,0,100),l:r.l,a:r.a}},R=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},V=function(e,t){var r=N(e);return{h:r.h,s:r.s,l:y(r.l+100*t,0,100),a:r.a}},H=function(){function e(e){this.parsed=z(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return _(R(this.rgba),2)},e.prototype.isDark=function(){return R(this.rgba)<.5},e.prototype.isLight=function(){return R(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=v(this.rgba)).r,r=e.g,n=e.b,a=(o=e.a)<1?C(_(255*o)):"","#"+C(t)+C(r)+C(n)+a;var e,t,r,n,o,a},e.prototype.toRgb=function(){return v(this.rgba)},e.prototype.toRgbString=function(){return t=(e=v(this.rgba)).r,r=e.g,n=e.b,(o=e.a)<1?"rgba("+t+", "+r+", "+n+", "+o+")":"rgb("+t+", "+r+", "+n+")";var e,t,r,n,o},e.prototype.toHsl=function(){return B(N(this.rgba))},e.prototype.toHslString=function(){return t=(e=B(N(this.rgba))).h,r=e.s,n=e.l,(o=e.a)<1?"hsla("+t+", "+r+"%, "+n+"%, "+o+")":"hsl("+t+", "+r+"%, "+n+"%)";var e,t,r,n,o},e.prototype.toHsv=function(){return e=x(this.rgba),{h:_(e.h),s:_(e.s),v:_(e.v),a:_(e.a,3)};var e},e.prototype.invert=function(){return $({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),$(I(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),$(I(this.rgba,-e))},e.prototype.grayscale=function(){return $(I(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),$(V(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),$(V(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?$({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):_(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=N(this.rgba);return"number"==typeof e?$({h:e,s:t.s,l:t.l,a:t.a}):_(t.h)},e.prototype.isEqual=function(e){return this.toHex()===$(e).toHex()},e}(),$=function(e){return e instanceof H?e:new H(e)},U=[];var F=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},q=function(e){return.2126*F(e.r)+.7152*F(e.g)+.0722*F(e.b)};const G=window.wp.element,K=window.wp.dom,W=window.wp.richText,Y=window.wp.deprecated;var Z=r.n(Y);const Q="block-default",X=["attributes","supports","save","migrate","isEligible","apiVersion"],J={"--wp--style--color--link":{value:["color","link"],support:["color","link"]},aspectRatio:{value:["dimensions","aspectRatio"],support:["dimensions","aspectRatio"],useEngine:!0},background:{value:["color","gradient"],support:["color","gradients"],useEngine:!0},backgroundColor:{value:["color","background"],support:["color","background"],requiresOptOut:!0,useEngine:!0},backgroundImage:{value:["background","backgroundImage"],support:["background","backgroundImage"],useEngine:!0},backgroundRepeat:{value:["background","backgroundRepeat"],support:["background","backgroundRepeat"],useEngine:!0},backgroundSize:{value:["background","backgroundSize"],support:["background","backgroundSize"],useEngine:!0},backgroundPosition:{value:["background","backgroundPosition"],support:["background","backgroundPosition"],useEngine:!0},borderColor:{value:["border","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRadius:{value:["border","radius"],support:["__experimentalBorder","radius"],properties:{borderTopLeftRadius:"topLeft",borderTopRightRadius:"topRight",borderBottomLeftRadius:"bottomLeft",borderBottomRightRadius:"bottomRight"},useEngine:!0},borderStyle:{value:["border","style"],support:["__experimentalBorder","style"],useEngine:!0},borderWidth:{value:["border","width"],support:["__experimentalBorder","width"],useEngine:!0},borderTopColor:{value:["border","top","color"],support:["__experimentalBorder","color"],useEngine:!0},borderTopStyle:{value:["border","top","style"],support:["__experimentalBorder","style"],useEngine:!0},borderTopWidth:{value:["border","top","width"],support:["__experimentalBorder","width"],useEngine:!0},borderRightColor:{value:["border","right","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRightStyle:{value:["border","right","style"],support:["__experimentalBorder","style"],useEngine:!0},borderRightWidth:{value:["border","right","width"],support:["__experimentalBorder","width"],useEngine:!0},borderBottomColor:{value:["border","bottom","color"],support:["__experimentalBorder","color"],useEngine:!0},borderBottomStyle:{value:["border","bottom","style"],support:["__experimentalBorder","style"],useEngine:!0},borderBottomWidth:{value:["border","bottom","width"],support:["__experimentalBorder","width"],useEngine:!0},borderLeftColor:{value:["border","left","color"],support:["__experimentalBorder","color"],useEngine:!0},borderLeftStyle:{value:["border","left","style"],support:["__experimentalBorder","style"],useEngine:!0},borderLeftWidth:{value:["border","left","width"],support:["__experimentalBorder","width"],useEngine:!0},color:{value:["color","text"],support:["color","text"],requiresOptOut:!0,useEngine:!0},columnCount:{value:["typography","textColumns"],support:["typography","textColumns"],useEngine:!0},filter:{value:["filter","duotone"],support:["filter","duotone"]},linkColor:{value:["elements","link","color","text"],support:["color","link"]},captionColor:{value:["elements","caption","color","text"],support:["color","caption"]},buttonColor:{value:["elements","button","color","text"],support:["color","button"]},buttonBackgroundColor:{value:["elements","button","color","background"],support:["color","button"]},headingColor:{value:["elements","heading","color","text"],support:["color","heading"]},headingBackgroundColor:{value:["elements","heading","color","background"],support:["color","heading"]},fontFamily:{value:["typography","fontFamily"],support:["typography","__experimentalFontFamily"],useEngine:!0},fontSize:{value:["typography","fontSize"],support:["typography","fontSize"],useEngine:!0},fontStyle:{value:["typography","fontStyle"],support:["typography","__experimentalFontStyle"],useEngine:!0},fontWeight:{value:["typography","fontWeight"],support:["typography","__experimentalFontWeight"],useEngine:!0},lineHeight:{value:["typography","lineHeight"],support:["typography","lineHeight"],useEngine:!0},margin:{value:["spacing","margin"],support:["spacing","margin"],properties:{marginTop:"top",marginRight:"right",marginBottom:"bottom",marginLeft:"left"},useEngine:!0},minHeight:{value:["dimensions","minHeight"],support:["dimensions","minHeight"],useEngine:!0},padding:{value:["spacing","padding"],support:["spacing","padding"],properties:{paddingTop:"top",paddingRight:"right",paddingBottom:"bottom",paddingLeft:"left"},useEngine:!0},textAlign:{value:["typography","textAlign"],support:["typography","textAlign"],useEngine:!1},textDecoration:{value:["typography","textDecoration"],support:["typography","__experimentalTextDecoration"],useEngine:!0},textTransform:{value:["typography","textTransform"],support:["typography","__experimentalTextTransform"],useEngine:!0},letterSpacing:{value:["typography","letterSpacing"],support:["typography","__experimentalLetterSpacing"],useEngine:!0},writingMode:{value:["typography","writingMode"],support:["typography","__experimentalWritingMode"],useEngine:!0},"--wp--style--root--padding":{value:["spacing","padding"],support:["spacing","padding"],properties:{"--wp--style--root--padding-top":"top","--wp--style--root--padding-right":"right","--wp--style--root--padding-bottom":"bottom","--wp--style--root--padding-left":"left"},rootOnly:!0}},ee={link:"a:where(:not(.wp-element-button))",heading:"h1, h2, h3, h4, h5, h6",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",button:".wp-element-button, .wp-block-button__link",caption:".wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption",cite:"cite",select:"select",textInput:"textarea, input:where([type=email],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=url])"},te={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"dimensions.aspectRatios":!0,"typography.fontSizes":!0,"spacing.spacingSizes":!0},re=window.wp.warning;var ne=r.n(re);const oe=JSON.parse('{"title":"block title","description":"block description","keywords":["block keyword"],"styles":[{"label":"block style label"}],"variations":[{"title":"block variation title","description":"block variation description","keywords":["block variation keyword"]}]}'),ae=window.wp.privateApis,{lock:ie,unlock:se}=(0,ae.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/blocks");function ce(e){return null!==e&&"object"==typeof e}function le(e){const{addBootstrappedBlockType:t}=se((0,i.dispatch)(br));for(const[r,n]of Object.entries(e))t(r,n)}function ue({textdomain:e,...t}){const r=["apiVersion","title","category","parent","ancestor","icon","description","keywords","attributes","providesContext","usesContext","selectors","supports","styles","example","variations","blockHooks","allowedBlocks"],n=Object.fromEntries(Object.entries(t).filter((([e])=>r.includes(e))));return e&&Object.keys(oe).forEach((t=>{n[t]&&(n[t]=pe(oe[t],n[t],e))})),n}function de(e,t){const r=ce(e)?e.name:e;if("string"!=typeof r)return void ne()("Block names must be strings.");if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(r))return void ne()("Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block");if((0,i.select)(br).getBlockType(r))return void ne()('Block "'+r+'" is already registered.');const{addBootstrappedBlockType:n,addUnprocessedBlockType:o}=se((0,i.dispatch)(br));if(ce(e)){n(r,ue(e))}return o(r,t),(0,i.select)(br).getBlockType(r)}function pe(e,t,r){return"string"==typeof e&&"string"==typeof t?(0,g._x)(t,e,r):Array.isArray(e)&&e.length&&Array.isArray(t)?t.map((t=>pe(e[0],t,r))):ce(e)&&Object.entries(e).length&&ce(t)?Object.keys(t).reduce(((n,o)=>e[o]?(n[o]=pe(e[o],t[o],r),n):(n[o]=t[o],n)),{}):t}function fe(e,{title:t,icon:r}){(0,i.dispatch)(br).addBlockCollection(e,t,r)}function he(e){const t=(0,i.select)(br).getBlockType(e);if(t)return(0,i.dispatch)(br).removeBlockTypes(e),t;ne()('Block "'+e+'" is not registered.')}function ge(e){(0,i.dispatch)(br).setFreeformFallbackBlockName(e)}function me(){return(0,i.select)(br).getFreeformFallbackBlockName()}function be(){return(0,i.select)(br).getGroupingBlockName()}function _e(e){(0,i.dispatch)(br).setUnregisteredFallbackBlockName(e)}function ye(){return(0,i.select)(br).getUnregisteredFallbackBlockName()}function ke(e){(0,i.dispatch)(br).setDefaultBlockName(e)}function we(e){(0,i.dispatch)(br).setGroupingBlockName(e)}function ve(){return(0,i.select)(br).getDefaultBlockName()}function Te(e){return(0,i.select)(br)?.getBlockType(e)}function Ce(){return(0,i.select)(br).getBlockTypes()}function xe(e,t,r){return(0,i.select)(br).getBlockSupport(e,t,r)}function Ee(e,t,r){return(0,i.select)(br).hasBlockSupport(e,t,r)}function Se(e){return"core/block"===e?.name}function Be(e){return"core/template-part"===e?.name}const Ae=e=>(0,i.select)(br).getChildBlockNames(e),Ne=e=>(0,i.select)(br).hasChildBlocks(e),Pe=e=>(0,i.select)(br).hasChildBlocksWithInserterSupport(e),Oe=(e,t)=>{(0,i.dispatch)(br).addBlockStyles(e,t)},Le=(e,t)=>{(0,i.dispatch)(br).removeBlockStyles(e,t)},Me=(e,t)=>(0,i.select)(br).getBlockVariations(e,t),je=(e,t)=>{"string"!=typeof t.name&&ne()("Variation names must be unique strings."),(0,i.dispatch)(br).addBlockVariations(e,t)},De=(e,t)=>{(0,i.dispatch)(br).removeBlockVariations(e,t)},ze=e=>{const{name:t,label:r,usesContext:n,getValues:o,setValues:a,canUserEditValue:s,getFieldsList:c}=e,l=se((0,i.select)(br)).getBlockBindingsSource(t),u=["label","usesContext"];for(const e in l)if(!u.includes(e)&&l[e])return void ne()('Block bindings source "'+t+'" is already registered.');if(t)if("string"==typeof t)if(/[A-Z]+/.test(t))ne()("Block bindings source name must not contain uppercase characters.");else if(/^[a-z0-9/-]+$/.test(t))if(/^[a-z0-9-]+\/[a-z0-9-]+$/.test(t))if(r||l?.label)if(r&&"string"!=typeof r)ne()("Block bindings source label must be a string.");else if(r&&l?.label&&r!==l?.label&&ne()('Block bindings "'+t+'" source label was overridden.'),!n||Array.isArray(n))if(o&&"function"!=typeof o)ne()("Block bindings source getValues must be a function.");else if(a&&"function"!=typeof a)ne()("Block bindings source setValues must be a function.");else if(s&&"function"!=typeof s)ne()("Block bindings source canUserEditValue must be a function.");else{if(!c||"function"==typeof c)return se((0,i.dispatch)(br)).addBlockBindingsSource(e);ne()("Block bindings source getFieldsList must be a function.")}else ne()("Block bindings source usesContext must be an array.");else ne()("Block bindings source must contain a label.");else ne()("Block bindings source name must contain a namespace and valid characters. Example: my-plugin/my-custom-source.");else ne()("Block bindings source name must contain only valid characters: lowercase characters, hyphens, or digits. Example: my-plugin/my-custom-source.");else ne()("Block bindings source name must be a string.");else ne()("Block bindings source must contain a name.")};function Ie(e){Re(e)?se((0,i.dispatch)(br)).removeBlockBindingsSource(e):ne()('Block bindings source "'+e+'" is not registered.')}function Re(e){return se((0,i.select)(br)).getBlockBindingsSource(e)}function Ve(){return se((0,i.select)(br)).getAllBlockBindingsSources()}!function(e){e.forEach((function(e){U.indexOf(e)<0&&(e(H,j),U.push(e))}))}([function(e,t){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},n={};for(var o in r)n[r[o]]=o;var a={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,i,s=n[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var c=this.toRgb(),l=1/0,u="black";if(!a.length)for(var d in r)a[d]=new e(r[d]).toRgb();for(var p in r){var f=(o=c,i=a[p],Math.pow(o.r-i.r,2)+Math.pow(o.g-i.g,2)+Math.pow(o.b-i.b,2));f<l&&(l=f,u=p)}return u}},t.string.push([function(t){var n=t.toLowerCase(),o="transparent"===n?"#0000":r[n];return o?new e(o).toRgb():null},"name"])},function(e){e.prototype.luminance=function(){return e=q(this.rgba),void 0===(t=2)&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r+0;var e,t,r},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var r,n,o,a,i,s,c,l=t instanceof e?t:new e(t);return a=this.rgba,i=l.toRgb(),r=(s=q(a))>(c=q(i))?(s+.05)/(c+.05):(c+.05)/(s+.05),void 0===(n=2)&&(n=0),void 0===o&&(o=Math.pow(10,n)),Math.floor(o*r)/o+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(a=(r=t).size)?"normal":a,"AAA"===(o=void 0===(n=r.level)?"AA":n)&&"normal"===i?7:"AA"===o&&"large"===i?3:4.5);var r,n,o,a,i}}]);const He=["#191e23","#f8f9f9"];function $e(e,t){const r=Te(e.name)?.attributes??{};return(t?Object.entries(r).filter((([e,r])=>"content"===t&&"metadata"===e||(r.role===t||r.__experimentalRole===t))):Object.entries(r)).every((([t,r])=>{const n=e.attributes[t];return r.hasOwnProperty("default")?n===r.default:"rich-text"===r.type?!n?.length:void 0===n}))}function Ue(e,t){return e.name===ve()&&$e(e,t)}function Fe(e){return!!e&&("string"==typeof e||(0,G.isValidElement)(e)||"function"==typeof e||e instanceof G.Component)}function qe(e){if(Fe(e=e||Q))return{src:e};if("background"in e){const t=$(e.background),r=e=>t.contrast(e),n=Math.max(...He.map(r));return{...e,foreground:e.foreground?e.foreground:He.find((e=>r(e)===n)),shadowColor:t.alpha(.3).toRgbString()}}return e}function Ge(e){return"string"==typeof e?Te(e):e}function Ke(e,t,r="visual"){const{__experimentalLabel:n,title:o}=e,a=n&&n(t,{context:r});return a?a.toPlainText?a.toPlainText():(0,K.__unstableStripHTML)(a):o}function We(e,t,r,n="vertical"){const o=e?.title,a=e?Ke(e,t,"accessibility"):"",i=void 0!==r,s=a&&a!==o;return i&&"vertical"===n?s?(0,g.sprintf)((0,g.__)("%1$s Block. Row %2$d. %3$s"),o,r,a):(0,g.sprintf)((0,g.__)("%1$s Block. Row %2$d"),o,r):i&&"horizontal"===n?s?(0,g.sprintf)((0,g.__)("%1$s Block. Column %2$d. %3$s"),o,r,a):(0,g.sprintf)((0,g.__)("%1$s Block. Column %2$d"),o,r):s?(0,g.sprintf)((0,g.__)("%1$s Block. %2$s"),o,a):(0,g.sprintf)((0,g.__)("%s Block"),o)}function Ye(e){return void 0!==e.default?e.default:"rich-text"===e.type?new W.RichTextData:void 0}function Ze(e){return void 0!==Te(e)}function Qe(e,t){const r=Te(e);if(void 0===r)throw new Error(`Block type '${e}' is not registered.`);return Object.entries(r.attributes).reduce(((e,[r,n])=>{const o=t[r];if(void 0!==o)"rich-text"===n.type?o instanceof W.RichTextData?e[r]=o:"string"==typeof o&&(e[r]=W.RichTextData.fromHTMLString(o)):"string"===n.type&&o instanceof W.RichTextData?e[r]=o.toHTMLString():e[r]=o;else{const t=Ye(n);void 0!==t&&(e[r]=t)}return-1!==["node","children"].indexOf(n.source)&&("string"==typeof e[r]?e[r]=[e[r]]:Array.isArray(e[r])||(e[r]=[])),e}),{})}function Xe(e,t){const r=Te(e)?.attributes;if(!r)return[];const n=Object.keys(r);return t?n.filter((n=>{const o=r[n];return o?.role===t||o?.__experimentalRole===t&&(Z()("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e} block.`}),!0)})):n}const Je=(...e)=>(Z()("__experimentalGetBlockAttributesNamesByRole",{since:"6.7",version:"6.8",alternative:"getBlockAttributesNamesByRole"}),Xe(...e));function et(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}const tt=[{slug:"text",title:(0,g.__)("Text")},{slug:"media",title:(0,g.__)("Media")},{slug:"design",title:(0,g.__)("Design")},{slug:"widgets",title:(0,g.__)("Widgets")},{slug:"theme",title:(0,g.__)("Theme")},{slug:"embed",title:(0,g.__)("Embeds")},{slug:"reusable",title:(0,g.__)("Reusable blocks")}];function rt(e){return e.reduce(((e,t)=>({...e,[t.name]:t})),{})}function nt(e){return e.reduce(((e,t)=>(e.some((e=>e.name===t.name))||e.push(t),e)),[])}function ot(e){return(t=null,r)=>{switch(r.type){case"REMOVE_BLOCK_TYPES":return-1!==r.names.indexOf(t)?null:t;case e:return r.name||null}return t}}const at=ot("SET_DEFAULT_BLOCK_NAME"),it=ot("SET_FREEFORM_FALLBACK_BLOCK_NAME"),st=ot("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),ct=ot("SET_GROUPING_BLOCK_NAME");function lt(e=[],t=[]){const r=Array.from(new Set(e.concat(t)));return r.length>0?r:void 0}var ut=(0,i.combineReducers)({bootstrappedBlockTypes:function(e={},t){switch(t.type){case"ADD_BOOTSTRAPPED_BLOCK_TYPE":const{name:r,blockType:n}=t,o=e[r];let a;return o?(void 0===o.blockHooks&&n.blockHooks&&(a={...o,...a,blockHooks:n.blockHooks}),void 0===o.allowedBlocks&&n.allowedBlocks&&(a={...o,...a,allowedBlocks:n.allowedBlocks})):(a=Object.fromEntries(Object.entries(n).filter((([,e])=>null!=e)).map((([e,t])=>{return[(r=e,void 0===n&&(n={}),f(r,s({transform:h},n))),t];var r,n}))),a.name=r),a?{...e,[r]:a}:e;case"REMOVE_BLOCK_TYPES":return et(e,t.names)}return e},unprocessedBlockTypes:function(e={},t){switch(t.type){case"ADD_UNPROCESSED_BLOCK_TYPE":return{...e,[t.name]:t.blockType};case"REMOVE_BLOCK_TYPES":return et(e,t.names)}return e},blockTypes:function(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...rt(t.blockTypes)};case"REMOVE_BLOCK_TYPES":return et(e,t.names)}return e},blockStyles:function(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(rt(t.blockTypes)).map((([t,r])=>[t,nt([...(r.styles??[]).map((e=>({...e,source:"block"}))),...(e[r.name]??[]).filter((({source:e})=>"block"!==e))])])))};case"ADD_BLOCK_STYLES":const r={};return t.blockNames.forEach((n=>{r[n]=nt([...e[n]??[],...t.styles])})),{...e,...r};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:(e[t.blockName]??[]).filter((e=>-1===t.styleNames.indexOf(e.name)))}}return e},blockVariations:function(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(rt(t.blockTypes)).map((([t,r])=>[t,nt([...(r.variations??[]).map((e=>({...e,source:"block"}))),...(e[r.name]??[]).filter((({source:e})=>"block"!==e))])])))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:nt([...e[t.blockName]??[],...t.variations])};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:(e[t.blockName]??[]).filter((e=>-1===t.variationNames.indexOf(e.name)))}}return e},defaultBlockName:at,freeformFallbackBlockName:it,unregisteredFallbackBlockName:st,groupingBlockName:ct,categories:function(e=tt,t){switch(t.type){case"SET_CATEGORIES":const r=new Map;return(t.categories||[]).forEach((e=>{r.set(e.slug,e)})),[...r.values()];case"UPDATE_CATEGORY":if(!t.category||!Object.keys(t.category).length)return e;if(e.find((({slug:e})=>e===t.slug)))return e.map((e=>e.slug===t.slug?{...e,...t.category}:e))}return e},collections:function(e={},t){switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return et(e,t.namespace)}return e},blockBindingsSources:function(e={},t){switch(t.type){case"ADD_BLOCK_BINDINGS_SOURCE":return{...e,[t.name]:{label:t.label||e[t.name]?.label,usesContext:lt(e[t.name]?.usesContext,t.usesContext),getValues:t.getValues,setValues:t.setValues,canUserEditValue:t.setValues&&t.canUserEditValue,getFieldsList:t.getFieldsList}};case"REMOVE_BLOCK_BINDINGS_SOURCE":return et(e,t.name)}return e}}),dt=r(9681),pt=r.n(dt);const ft=(e,t,r)=>{const n=Array.isArray(t)?t:t.split(".");let o=e;return n.forEach((e=>{o=o?.[e]})),o??r};function ht(e){return"object"==typeof e&&e.constructor===Object&&null!==e}function gt(e,t){return ht(e)&&ht(t)?Object.entries(t).every((([t,r])=>gt(e?.[t],r))):e===t}const mt=["background","backgroundColor","color","linkColor","captionColor","buttonColor","headingColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","padding","contentSize","wideSize","blockGap","textDecoration","textTransform","letterSpacing"];function bt(e,t,r){return e.filter((e=>("fontSize"!==e||"heading"!==r)&&(!("textDecoration"===e&&!t&&"link"!==r)&&(!("textTransform"===e&&!t&&!["heading","h1","h2","h3","h4","h5","h6"].includes(r)&&"button"!==r&&"caption"!==r&&"text"!==r)&&(!("letterSpacing"===e&&!t&&!["heading","h1","h2","h3","h4","h5","h6"].includes(r)&&"button"!==r&&"caption"!==r&&"text"!==r)&&!("textColumns"===e&&!t))))))}const _t=(0,i.createSelector)(((e,t,r)=>{if(!t)return bt(mt,t,r);const n=Et(e,t);if(!n)return[];const o=[];return n?.supports?.spacing?.blockGap&&o.push("blockGap"),n?.supports?.shadow&&o.push("shadow"),Object.keys(J).forEach((e=>{J[e].support&&(J[e].requiresOptOut&&J[e].support[0]in n.supports&&!1!==ft(n.supports,J[e].support)||ft(n.supports,J[e].support,!1))&&o.push(e)})),bt(o,t,r)}),((e,t)=>[e.blockTypes[t]]));function yt(e,t){return e.bootstrappedBlockTypes[t]}function kt(e){return e.unprocessedBlockTypes}function wt(e){return e.blockBindingsSources}function vt(e,t){return e.blockBindingsSources[t]}const Tt=(e,t)=>{const r=Et(e,t);return!!r&&Object.values(r.attributes).some((({role:e,__experimentalRole:r})=>"content"===e||"content"===r&&(Z()("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${t} block.`}),!0)))},Ct=(e,t)=>"string"==typeof t?Et(e,t):t,xt=(0,i.createSelector)((e=>Object.values(e.blockTypes)),(e=>[e.blockTypes]));function Et(e,t){return e.blockTypes[t]}function St(e,t){return e.blockStyles[t]}const Bt=(0,i.createSelector)(((e,t,r)=>{const n=e.blockVariations[t];return n&&r?n.filter((e=>(e.scope||["block","inserter"]).includes(r))):n}),((e,t)=>[e.blockVariations[t]]));function At(e,t,r,n){const o=Bt(e,t,n);if(!o)return o;const a=Et(e,t),i=Object.keys(a?.attributes||{});let s,c=0;for(const e of o)if(Array.isArray(e.isActive)){const t=e.isActive.filter((e=>{const t=e.split(".")[0];return i.includes(t)})),n=t.length;if(0===n)continue;t.every((t=>{const n=ft(e.attributes,t);if(void 0===n)return!1;let o=ft(r,t);return o instanceof W.RichTextData&&(o=o.toHTMLString()),gt(o,n)}))&&n>c&&(s=e,c=n)}else if(e.isActive?.(r,e.attributes))return s||e;return!s&&["block","transform"].includes(n)&&(s=o.find((e=>e?.isDefault&&!Object.hasOwn(e,"isActive")))),s}function Nt(e,t,r){const n=Bt(e,t,r);return[...n].reverse().find((({isDefault:e})=>!!e))||n[0]}function Pt(e){return e.categories}function Ot(e){return e.collections}function Lt(e){return e.defaultBlockName}function Mt(e){return e.freeformFallbackBlockName}function jt(e){return e.unregisteredFallbackBlockName}function Dt(e){return e.groupingBlockName}const zt=(0,i.createSelector)(((e,t)=>xt(e).filter((e=>e.parent?.includes(t))).map((({name:e})=>e))),(e=>[e.blockTypes])),It=(e,t,r,n)=>{const o=Ct(e,t);return o?.supports?ft(o.supports,r,n):n};function Rt(e,t,r,n){return!!It(e,t,r,n)}function Vt(e){return pt()(e??"").toLowerCase().trim()}function Ht(e,t,r=""){const n=Ct(e,t),o=Vt(r),a=e=>Vt(e).includes(o);return a(n.title)||n.keywords?.some(a)||a(n.category)||"string"==typeof n.description&&a(n.description)}const $t=(e,t)=>zt(e,t).length>0,Ut=(e,t)=>zt(e,t).some((t=>Rt(e,t,"inserter",!0))),Ft=(...e)=>(Z()("__experimentalHasContentRoleAttribute",{since:"6.7",version:"6.8",hint:"This is a private selector."}),Tt(...e));
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function qt(e){return"[object Object]"===Object.prototype.toString.call(e)}var Gt=r(8529);const Kt=window.wp.hooks,Wt={common:"text",formatting:"text",layout:"design"};function Yt(e=[],t=[]){const r=[...e];return t.forEach((e=>{const t=r.findIndex((t=>t.name===e.name));-1!==t?r[t]={...r[t],...e}:r.push(e)})),r}const Zt=(e,t)=>({select:r})=>{const n=r.getBootstrappedBlockType(e),o={apiVersion:1,name:e,icon:Q,keywords:[],attributes:{},providesContext:{},usesContext:[],selectors:{},supports:{},styles:[],blockHooks:{},save:()=>null,...n,...t,variations:Yt(Array.isArray(n?.variations)?n.variations:[],Array.isArray(t?.variations)?t.variations:[])},a=(0,Kt.applyFilters)("blocks.registerBlockType",o,e,null);if(a.apiVersion<=2&&ne()(`The block "${e}" is registered with API version 2 or lower. This means that the post editor may work as a non-iframe editor.\nSince all editors are planned to work as iframes in the future, set the \`apiVersion\` field to 3 and test the block inside the iframe editor.\nSee: https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/#version-3-wordpress-6-3`),a.description&&"string"!=typeof a.description&&Z()("Declaring non-string block descriptions",{since:"6.2"}),a.deprecated&&(a.deprecated=a.deprecated.map((e=>Object.fromEntries(Object.entries((0,Kt.applyFilters)("blocks.registerBlockType",{...et(o,X),...e},o.name,e)).filter((([e])=>X.includes(e))))))),function(e){var t,r;return!1!==qt(e)&&(void 0===(t=e.constructor)||!1!==qt(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}(a))if("function"==typeof a.save)if(!("edit"in a)||(0,Gt.isValidElementType)(a.edit))if(Wt.hasOwnProperty(a.category)&&(a.category=Wt[a.category]),"category"in a&&!r.getCategories().some((({slug:e})=>e===a.category))&&(ne()('The block "'+e+'" is registered with an invalid category "'+a.category+'".'),delete a.category),"title"in a&&""!==a.title)if("string"==typeof a.title)if(a.icon=qe(a.icon),Fe(a.icon.src))if(("string"==typeof a?.parent||a?.parent instanceof String)&&(a.parent=[a.parent],ne()("Parent must be undefined or an array of strings (block types), but it is a string.")),Array.isArray(a?.parent)||void 0===a?.parent){if(1!==a?.parent?.length||e!==a.parent[0])return a;ne()('Block "'+e+'" cannot be a parent of itself. Please remove the block name from the parent list.')}else ne()("Parent must be undefined or an array of block types, but it is ",a.parent);else ne()("The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional");else ne()("Block titles must be strings.");else ne()('The block "'+e+'" must have a title.');else ne()('The "edit" property must be a valid component.');else ne()('The "save" property must be a valid function.');else ne()("Block settings must be a valid object.")};function Qt(e){return{type:"ADD_BLOCK_TYPES",blockTypes:Array.isArray(e)?e:[e]}}function Xt(){return({dispatch:e,select:t})=>{const r=[];for(const[n,o]of Object.entries(t.getUnprocessedBlockTypes())){const t=e(Zt(n,o));t&&r.push(t)}r.length&&e.addBlockTypes(r)}}function Jt(){return Z()('wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters',{since:"6.4",alternative:"reapplyBlockFilters"}),Xt()}function er(e){return{type:"REMOVE_BLOCK_TYPES",names:Array.isArray(e)?e:[e]}}function tr(e,t){return{type:"ADD_BLOCK_STYLES",styles:Array.isArray(t)?t:[t],blockNames:Array.isArray(e)?e:[e]}}function rr(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:Array.isArray(t)?t:[t],blockName:e}}function nr(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:Array.isArray(t)?t:[t],blockName:e}}function or(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:Array.isArray(t)?t:[t],blockName:e}}function ar(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function ir(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function sr(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function cr(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function lr(e){return{type:"SET_CATEGORIES",categories:e}}function ur(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function dr(e,t,r){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:r}}function pr(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}function fr(e,t){return{type:"ADD_BOOTSTRAPPED_BLOCK_TYPE",name:e,blockType:t}}function hr(e,t){return({dispatch:r})=>{r({type:"ADD_UNPROCESSED_BLOCK_TYPE",name:e,blockType:t});const n=r(Zt(e,t));n&&r.addBlockTypes(n)}}function gr(e){return{type:"ADD_BLOCK_BINDINGS_SOURCE",name:e.name,label:e.label,usesContext:e.usesContext,getValues:e.getValues,setValues:e.setValues,canUserEditValue:e.canUserEditValue,getFieldsList:e.getFieldsList}}function mr(e){return{type:"REMOVE_BLOCK_BINDINGS_SOURCE",name:e}}const br=(0,i.createReduxStore)("core/blocks",{reducer:ut,selectors:t,actions:o});(0,i.register)(br),se(br).registerPrivateSelectors(e),se(br).registerPrivateActions(a);const _r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let yr;const kr=new Uint8Array(16);function wr(){if(!yr&&(yr="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yr(kr)}const vr=[];for(let e=0;e<256;++e)vr.push((e+256).toString(16).slice(1));function Tr(e,t=0){return vr[e[t+0]]+vr[e[t+1]]+vr[e[t+2]]+vr[e[t+3]]+"-"+vr[e[t+4]]+vr[e[t+5]]+"-"+vr[e[t+6]]+vr[e[t+7]]+"-"+vr[e[t+8]]+vr[e[t+9]]+"-"+vr[e[t+10]]+vr[e[t+11]]+vr[e[t+12]]+vr[e[t+13]]+vr[e[t+14]]+vr[e[t+15]]}const Cr=function(e,t,r){if(_r.randomUUID&&!t&&!e)return _r.randomUUID();const n=(e=e||{}).random||(e.rng||wr)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return Tr(n)};function xr(e,t={},r=[]){if(!Ze(e))return xr("core/missing",{originalName:e,originalContent:"",originalUndelimitedContent:""});const n=Qe(e,t);return{clientId:Cr(),name:e,isValid:!0,attributes:n,innerBlocks:r}}function Er(e=[]){return e.map((e=>{const t=Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],[r,n,o=[]]=t;return xr(r,n,Er(o))}))}function Sr(e,t={},r){const{name:n}=e;if(!Ze(n))return xr("core/missing",{originalName:n,originalContent:"",originalUndelimitedContent:""});const o=Cr(),a=Qe(n,{...e.attributes,...t});return{...e,clientId:o,attributes:a,innerBlocks:r||e.innerBlocks.map((e=>Sr(e)))}}function Br(e,t={},r){const n=Cr();return{...e,clientId:n,attributes:{...e.attributes,...t},innerBlocks:r||e.innerBlocks.map((e=>Br(e)))}}const Ar=(e,t,r)=>{if(!r.length)return!1;const n=r.length>1,o=r[0].name;if(!(Or(e)||!n||e.isMultiBlock))return!1;if(!Or(e)&&!r.every((e=>e.name===o)))return!1;if(!("block"===e.type))return!1;const a=r[0];return!("from"===t&&-1===e.blocks.indexOf(a.name)&&!Or(e))&&(!(!n&&"from"===t&&Lr(a.name)&&Lr(e.blockName))&&!!zr(e,r))},Nr=e=>{if(!e.length)return[];return Ce().filter((t=>!!jr(Dr("from",t.name),(t=>Ar(t,"from",e)))))},Pr=e=>{if(!e.length)return[];const t=Te(e[0].name);return(t?Dr("to",t.name):[]).filter((t=>t&&Ar(t,"to",e))).map((e=>e.blocks)).flat().map(Te)},Or=e=>e&&"block"===e.type&&Array.isArray(e.blocks)&&e.blocks.includes("*"),Lr=e=>e===be();function Mr(e){if(!e.length)return[];const t=Nr(e),r=Pr(e);return[...new Set([...t,...r])]}function jr(e,t){const r=(0,Kt.createHooks)();for(let n=0;n<e.length;n++){const o=e[n];t(o)&&r.addFilter("transform","transform/"+n.toString(),(e=>e||o),o.priority)}return r.applyFilters("transform",null)}function Dr(e,t){if(void 0===t)return Ce().map((({name:t})=>Dr(e,t))).flat();const r=Ge(t),{name:n,transforms:o}=r||{};if(!o||!Array.isArray(o[e]))return[];const a=o.supportedMobileTransforms&&Array.isArray(o.supportedMobileTransforms),i=a?o[e].filter((e=>"raw"===e.type||("prefix"===e.type||!(!e.blocks||!e.blocks.length)&&(!!Or(e)||e.blocks.every((e=>o.supportedMobileTransforms.includes(e))))))):o[e];return i.map((e=>({...e,blockName:n,usingMobileTransformations:a})))}function zr(e,t){if("function"!=typeof e.isMatch)return!0;const r=t[0],n=e.isMultiBlock?t.map((e=>e.attributes)):r.attributes,o=e.isMultiBlock?t:r;return e.isMatch(n,o)}function Ir(e,t){const r=Array.isArray(e)?e:[e],n=r.length>1,o=r[0],a=o.name,i=Dr("from",t),s=jr(Dr("to",a),(e=>"block"===e.type&&(Or(e)||-1!==e.blocks.indexOf(t))&&(!n||e.isMultiBlock)&&zr(e,r)))||jr(i,(e=>"block"===e.type&&(Or(e)||-1!==e.blocks.indexOf(a))&&(!n||e.isMultiBlock)&&zr(e,r)));if(!s)return null;let c;if(c=s.isMultiBlock?"__experimentalConvert"in s?s.__experimentalConvert(r):s.transform(r.map((e=>e.attributes)),r.map((e=>e.innerBlocks))):"__experimentalConvert"in s?s.__experimentalConvert(o):s.transform(o.attributes,o.innerBlocks),null===c||"object"!=typeof c)return null;if(c=Array.isArray(c)?c:[c],c.some((e=>!Te(e.name))))return null;if(!c.some((e=>e.name===t)))return null;return c.map(((t,r,n)=>(0,Kt.applyFilters)("blocks.switchToBlockType.transformedBlock",t,e,r,n)))}const Rr=(e,t)=>xr(e,t.attributes,(t.innerBlocks??[]).map((e=>Rr(e.name,e)))),Vr=window.wp.blockSerializationDefaultParser,Hr=window.wp.autop,$r=window.ReactJSXRuntime,Ur=window.wp.isShallowEqual;var Fr=r.n(Ur);function qr(e,t={}){const{isCommentDelimited:r=!0}=t,{blockName:n,attrs:o={},innerBlocks:a=[],innerContent:i=[]}=e;let s=0;const c=i.map((e=>null!==e?e:qr(a[s++],t))).join("\n").replace(/\n+/g,"\n").trim();return r?tn(n,o,c):c}function Gr(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,Kt.applyFilters)("blocks.getBlockDefaultClassName",t,e)}function Kr(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,Kt.applyFilters)("blocks.getBlockMenuDefaultClassName",t,e)}const Wr={},Yr={};function Zr(e={}){const{blockType:t,attributes:r}=Wr;return Zr.skipFilters?e:(0,Kt.applyFilters)("blocks.getSaveContent.extraProps",{...e},t,r)}function Qr(e={}){const{innerBlocks:t}=Yr;if(!Array.isArray(t))return{...e,children:t};const r=on(t,{isInnerBlocks:!0}),n=(0,$r.jsx)(G.RawHTML,{children:r});return{...e,children:n}}function Xr(e,t,r=[]){const n=Ge(e);if(!n?.save)return null;let{save:o}=n;if(o.prototype instanceof G.Component){const e=new o({attributes:t});o=e.render.bind(e)}Wr.blockType=n,Wr.attributes=t,Yr.innerBlocks=r;let a=o({attributes:t,innerBlocks:r});if(null!==a&&"object"==typeof a&&(0,Kt.hasFilter)("blocks.getSaveContent.extraProps")&&!(n.apiVersion>1)){const e=(0,Kt.applyFilters)("blocks.getSaveContent.extraProps",{...a.props},n,t);Fr()(e,a.props)||(a=(0,G.cloneElement)(a,e))}return(0,Kt.applyFilters)("blocks.getSaveElement",a,n,t)}function Jr(e,t,r){const n=Ge(e);return(0,G.renderToString)(Xr(n,t,r))}function en(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=Jr(e.name,e.attributes,e.innerBlocks)}catch(e){}return t}function tn(e,t,r){const n=t&&Object.entries(t).length?function(e){return JSON.stringify(e).replaceAll("\\\\","\\u005c").replaceAll("--","\\u002d\\u002d").replaceAll("<","\\u003c").replaceAll(">","\\u003e").replaceAll("&","\\u0026").replaceAll('\\"',"\\u0022")}(t)+" ":"",o=e?.startsWith("core/")?e.slice(5):e;return r?`\x3c!-- wp:${o} ${n}--\x3e\n`+r+`\n\x3c!-- /wp:${o} --\x3e`:`\x3c!-- wp:${o} ${n}/--\x3e`}function rn(e,{isInnerBlocks:t=!1}={}){if(!e.isValid&&e.__unstableBlockSource)return qr(e.__unstableBlockSource);const r=e.name,n=en(e);if(r===ye()||!t&&r===me())return n;const o=Te(r);if(!o)return n;const a=function(e,t){return Object.entries(e.attributes??{}).reduce(((r,[n,o])=>{const a=t[n];return void 0===a||void 0!==o.source||"local"===o.role?r:"local"===o.__experimentalRole?(Z()("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e?.name} block.`}),r):("default"in o&&JSON.stringify(o.default)===JSON.stringify(a)||(r[n]=a),r)}),{})}(o,e.attributes);return tn(r,a,n)}function nn(e){1===e.length&&Ue(e[0])&&(e=[]);let t=on(e);return 1===e.length&&e[0].name===me()&&"core/freeform"===e[0].name&&(t=(0,Hr.removep)(t)),t}function on(e,t){return(Array.isArray(e)?e:[e]).map((e=>rn(e,t))).join("\n\n")}var an=/^#[xX]([A-Fa-f0-9]+)$/,sn=/^#([0-9]+)$/,cn=/^([A-Za-z0-9]+)$/,ln=(function(){function e(e){this.named=e}e.prototype.parse=function(e){if(e){var t=e.match(an);return t?String.fromCharCode(parseInt(t[1],16)):(t=e.match(sn))?String.fromCharCode(parseInt(t[1],10)):(t=e.match(cn))?this.named[t[1]]:void 0}}}(),/[\t\n\f ]/),un=/[A-Za-z]/,dn=/\r\n?/g;function pn(e){return ln.test(e)}function fn(e){return un.test(e)}var hn=function(){function e(e,t,r){void 0===r&&(r="precompile"),this.delegate=e,this.entityParser=t,this.mode=r,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var e=this.peek();if("<"!==e||this.isIgnoredEndTag()){if("precompile"===this.mode&&"\n"===e){var t=this.tagNameBuffer.toLowerCase();"pre"!==t&&"textarea"!==t||this.consume()}this.transitionTo("data"),this.delegate.beginData()}else this.transitionTo("tagOpen"),this.markTagStart(),this.consume()},data:function(){var e=this.peek(),t=this.tagNameBuffer;"<"!==e||this.isIgnoredEndTag()?"&"===e&&"script"!==t&&"style"!==t?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(e)):(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume())},tagOpen:function(){var e=this.consume();"!"===e?this.transitionTo("markupDeclarationOpen"):"/"===e?this.transitionTo("endTagOpen"):("@"===e||":"===e||fn(e))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(e))},markupDeclarationOpen:function(){var e=this.consume();"-"===e&&"-"===this.peek()?(this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment()):"DOCTYPE"===e.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase()&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())},doctype:function(){pn(this.consume())&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var e=this.consume();pn(e)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase()))},doctypeName:function(){var e=this.consume();pn(e)?this.transitionTo("afterDoctypeName"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase())},afterDoctypeName:function(){var e=this.consume();if(!pn(e))if(">"===e)this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var t=e.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),r="PUBLIC"===t.toUpperCase(),n="SYSTEM"===t.toUpperCase();(r||n)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),r?this.transitionTo("afterDoctypePublicKeyword"):n&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var e=this.peek();pn(e)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):'"'===e?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):"'"===e?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):">"===e&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},doctypePublicIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},afterDoctypePublicIdentifier:function(){var e=this.consume();pn(e)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var e=this.consume();pn(e)||(">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},doctypeSystemIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},afterDoctypeSystemIdentifier:function(){var e=this.consume();pn(e)||">"===e&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart:function(){var e=this.consume();"-"===e?this.transitionTo("commentStartDash"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(e),this.transitionTo("comment"))},commentStartDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var e=this.consume();"-"===e?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(e)},commentEndDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+e),this.transitionTo("comment"))},commentEnd:function(){var e=this.consume();">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+e),this.transitionTo("comment"))},tagName:function(){var e=this.consume();pn(e)?this.transitionTo("beforeAttributeName"):"/"===e?this.transitionTo("selfClosingStartTag"):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(e)},endTagName:function(){var e=this.consume();pn(e)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):"/"===e?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(e)},beforeAttributeName:function(){var e=this.peek();pn(e)?this.consume():"/"===e?(this.transitionTo("selfClosingStartTag"),this.consume()):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):"="===e?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var e=this.peek();pn(e)?(this.transitionTo("afterAttributeName"),this.consume()):"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.transitionTo("beforeAttributeValue"),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):'"'===e||"'"===e||"<"===e?(this.delegate.reportSyntaxError(e+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(e)):(this.consume(),this.delegate.appendToAttributeName(e))},afterAttributeName:function(){var e=this.peek();pn(e)?this.consume():"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.consume(),this.transitionTo("beforeAttributeValue")):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e))},beforeAttributeValue:function(){var e=this.peek();pn(e)?this.consume():'"'===e?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):"'"===e?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(e))},attributeValueDoubleQuoted:function(){var e=this.consume();'"'===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueSingleQuoted:function(){var e=this.consume();"'"===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueUnquoted:function(){var e=this.peek();pn(e)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"&"===e?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):">"===e?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(e))},afterAttributeValueQuoted:function(){var e=this.peek();pn(e)?(this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.consume(),this.transitionTo("selfClosingStartTag")):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){">"===this.peek()?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var e=this.consume();("@"===e||":"===e||fn(e))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(e))}},this.reset()}return e.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},e.prototype.transitionTo=function(e){this.state=e},e.prototype.tokenize=function(e){this.reset(),this.tokenizePart(e),this.tokenizeEOF()},e.prototype.tokenizePart=function(e){for(this.input+=function(e){return e.replace(dn,"\n")}(e);this.index<this.input.length;){var t=this.states[this.state];if(void 0===t)throw new Error("unhandled state "+this.state);t.call(this)}},e.prototype.tokenizeEOF=function(){this.flushData()},e.prototype.flushData=function(){"data"===this.state&&(this.delegate.finishData(),this.transitionTo("beforeData"))},e.prototype.peek=function(){return this.input.charAt(this.index)},e.prototype.consume=function(){var e=this.peek();return this.index++,"\n"===e?(this.line++,this.column=0):this.column++,e},e.prototype.consumeCharRef=function(){var e=this.input.indexOf(";",this.index);if(-1!==e){var t=this.input.slice(this.index,e),r=this.entityParser.parse(t);if(r){for(var n=t.length;n;)this.consume(),n--;return this.consume(),r}}},e.prototype.markTagStart=function(){this.delegate.tagOpen()},e.prototype.appendToTagName=function(e){this.tagNameBuffer+=e,this.delegate.appendToTagName(e)},e.prototype.isIgnoredEndTag=function(){var e=this.tagNameBuffer;return"title"===e&&"</title>"!==this.input.substring(this.index,this.index+8)||"style"===e&&"</style>"!==this.input.substring(this.index,this.index+8)||"script"===e&&"<\/script>"!==this.input.substring(this.index,this.index+9)},e}(),gn=function(){function e(e,t){void 0===t&&(t={}),this.options=t,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new hn(this,e,t.mode),this._currentAttribute=void 0}return e.prototype.tokenize=function(e){return this.tokens=[],this.tokenizer.tokenize(e),this.tokens},e.prototype.tokenizePart=function(e){return this.tokens=[],this.tokenizer.tokenizePart(e),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var e=this.token;if(null===e)throw new Error("token was unexpectedly null");if(0===arguments.length)return e;for(var t=0;t<arguments.length;t++)if(e.type===arguments[t])return e;throw new Error("token type was unexpectedly "+e.type)},e.prototype.push=function(e){this.token=e,this.tokens.push(e)},e.prototype.currentAttribute=function(){return this._currentAttribute},e.prototype.addLocInfo=function(){this.options.loc&&(this.current().loc={start:{line:this.startLine,column:this.startColumn},end:{line:this.tokenizer.line,column:this.tokenizer.column}}),this.startLine=this.tokenizer.line,this.startColumn=this.tokenizer.column},e.prototype.beginDoctype=function(){this.push({type:"Doctype",name:""})},e.prototype.appendToDoctypeName=function(e){this.current("Doctype").name+=e},e.prototype.appendToDoctypePublicIdentifier=function(e){var t=this.current("Doctype");void 0===t.publicIdentifier?t.publicIdentifier=e:t.publicIdentifier+=e},e.prototype.appendToDoctypeSystemIdentifier=function(e){var t=this.current("Doctype");void 0===t.systemIdentifier?t.systemIdentifier=e:t.systemIdentifier+=e},e.prototype.endDoctype=function(){this.addLocInfo()},e.prototype.beginData=function(){this.push({type:"Chars",chars:""})},e.prototype.appendToData=function(e){this.current("Chars").chars+=e},e.prototype.finishData=function(){this.addLocInfo()},e.prototype.beginComment=function(){this.push({type:"Comment",chars:""})},e.prototype.appendToCommentData=function(e){this.current("Comment").chars+=e},e.prototype.finishComment=function(){this.addLocInfo()},e.prototype.tagOpen=function(){},e.prototype.beginStartTag=function(){this.push({type:"StartTag",tagName:"",attributes:[],selfClosing:!1})},e.prototype.beginEndTag=function(){this.push({type:"EndTag",tagName:""})},e.prototype.finishTag=function(){this.addLocInfo()},e.prototype.markTagAsSelfClosing=function(){this.current("StartTag").selfClosing=!0},e.prototype.appendToTagName=function(e){this.current("StartTag","EndTag").tagName+=e},e.prototype.beginAttribute=function(){this._currentAttribute=["","",!1]},e.prototype.appendToAttributeName=function(e){this.currentAttribute()[0]+=e},e.prototype.beginAttributeValue=function(e){this.currentAttribute()[2]=e},e.prototype.appendToAttributeValue=function(e){this.currentAttribute()[1]+=e},e.prototype.finishAttributeValue=function(){this.current("StartTag").attributes.push(this._currentAttribute)},e.prototype.reportSyntaxError=function(e){this.current().syntaxError=e},e}();var mn=r(7734),bn=r.n(mn);const _n=window.wp.htmlEntities;function yn(){function e(e){return(t,...r)=>e("Block validation: "+t,...r)}return{error:e(console.error),warning:e(console.warn),getItems:()=>[]}}const kn=/[\t\n\r\v\f ]+/g,wn=/^[\t\n\r\v\f ]*$/,vn=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,Tn=["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"],Cn=[...Tn,"autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],xn=[e=>e,function(e){return Nn(e).join(" ")}],En=/^[\da-z]+$/i,Sn=/^#\d+$/,Bn=/^#x[\da-f]+$/i;class An{parse(e){if(t=e,En.test(t)||Sn.test(t)||Bn.test(t))return(0,_n.decodeEntities)("&"+e+";");var t}}function Nn(e){return e.trim().split(kn)}function Pn(e){return e.attributes.filter((e=>{const[t,r]=e;return r||0===t.indexOf("data-")||Cn.includes(t)}))}function On(e,t,r=yn()){let n=e.chars,o=t.chars;for(let e=0;e<xn.length;e++){const t=xn[e];if(n=t(n),o=t(o),n===o)return!0}return r.warning("Expected text `%s`, saw `%s`.",t.chars,e.chars),!1}function Ln(e){return 0===parseFloat(e)?"0":0===e.indexOf(".")?"0"+e:e}function Mn(e){return Nn(e).map(Ln).join(" ").replace(vn,"url($1)")}function jn(e){const t=e.replace(/;?\s*$/,"").split(";").map((e=>{const[t,...r]=e.split(":"),n=r.join(":");return[t.trim(),Mn(n.trim())]}));return Object.fromEntries(t)}const Dn={class:(e,t)=>{const[r,n]=[e,t].map(Nn),o=r.filter((e=>!n.includes(e))),a=n.filter((e=>!r.includes(e)));return 0===o.length&&0===a.length},style:(e,t)=>bn()(...[e,t].map(jn)),...Object.fromEntries(Tn.map((e=>[e,()=>!0])))};const zn={StartTag:(e,t,r=yn())=>e.tagName!==t.tagName&&e.tagName.toLowerCase()!==t.tagName.toLowerCase()?(r.warning("Expected tag name `%s`, instead saw `%s`.",t.tagName,e.tagName),!1):function(e,t,r=yn()){if(e.length!==t.length)return r.warning("Expected attributes %o, instead saw %o.",t,e),!1;const n={};for(let e=0;e<t.length;e++)n[t[e][0].toLowerCase()]=t[e][1];for(let t=0;t<e.length;t++){const[o,a]=e[t],i=o.toLowerCase();if(!n.hasOwnProperty(i))return r.warning("Encountered unexpected attribute `%s`.",o),!1;const s=n[i],c=Dn[i];if(c){if(!c(a,s))return r.warning("Expected attribute `%s` of value `%s`, saw `%s`.",o,s,a),!1}else if(a!==s)return r.warning("Expected attribute `%s` of value `%s`, saw `%s`.",o,s,a),!1}return!0}(...[e,t].map(Pn),r),Chars:On,Comment:On};function In(e){let t;for(;t=e.shift();){if("Chars"!==t.type)return t;if(!wn.test(t.chars))return t}}function Rn(e,t){return!!e.selfClosing&&!(!t||t.tagName!==e.tagName||"EndTag"!==t.type)}function Vn(e,t,r=yn()){if(e===t)return!0;const[n,o]=[e,t].map((e=>function(e,t=yn()){try{return new gn(new An).tokenize(e)}catch(r){t.warning("Malformed HTML detected: %s",e)}return null}(e,r)));if(!n||!o)return!1;let a,i;for(;a=In(n);){if(i=In(o),!i)return r.warning("Expected end of content, instead saw %o.",a),!1;if(a.type!==i.type)return r.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",i.type,i,a.type,a),!1;const e=zn[a.type];if(e&&!e(a,i,r))return!1;Rn(a,o[0])?In(o):Rn(i,n[0])&&In(n)}return!(i=In(o))||(r.warning("Expected %o, instead saw end of content.",i),!1)}function Hn(e,t=e.name){if(e.name===me()||e.name===ye())return[!0,[]];const r=function(){const e=[],t=yn();return{error(...r){e.push({log:t.error,args:r})},warning(...r){e.push({log:t.warning,args:r})},getItems:()=>e}}(),n=Ge(t);let o;try{o=Jr(n,e.attributes)}catch(e){return r.error("Block validation failed because an error occurred while generating block content:\n\n%s",e.toString()),[!1,r.getItems()]}const a=Vn(e.originalContent,o,r);return a||r.error("Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",n.name,n,o,e.originalContent),[a,r.getItems()]}function $n(e,t,r){Z()("isValidBlockContent introduces opportunity for data loss",{since:"12.6",plugin:"Gutenberg",alternative:"validateBlock"});const n=Ge(e),o={name:n.name,attributes:t,innerBlocks:[],originalContent:r},[a]=Hn(o,n);return a}function Un(e,t){const r={...t};if("core/cover-image"===e&&(e="core/cover"),"core/text"!==e&&"core/cover-text"!==e||(e="core/paragraph"),e&&0===e.indexOf("core/social-link-")&&(r.service=e.substring(17),e="core/social-link"),e&&0===e.indexOf("core-embed/")){const t=e.substring(11),n={speaker:"speaker-deck",polldaddy:"crowdsignal"};r.providerNameSlug=t in n?n[t]:t,["amazon-kindle","wordpress"].includes(t)||(r.responsive=!0),e="core/embed"}if("core/post-comment-author"===e&&(e="core/comment-author-name"),"core/post-comment-content"===e&&(e="core/comment-content"),"core/post-comment-date"===e&&(e="core/comment-date"),"core/comments-query-loop"===e){e="core/comments";const{className:t=""}=r;t.includes("wp-block-comments-query-loop")||(r.className=["wp-block-comments-query-loop",t].join(" "))}if("core/post-comments"===e&&(e="core/comments",r.legacy=!0),"grid"===t.layout?.type&&"string"==typeof t.layout?.columnCount&&(r.layout={...r.layout,columnCount:parseInt(t.layout.columnCount,10)}),"string"==typeof t.style?.layout?.columnSpan){const e=parseInt(t.style.layout.columnSpan,10);r.style={...r.style,layout:{...r.style.layout,columnSpan:isNaN(e)?void 0:e}}}if("string"==typeof t.style?.layout?.rowSpan){const e=parseInt(t.style.layout.rowSpan,10);r.style={...r.style,layout:{...r.style.layout,rowSpan:isNaN(e)?void 0:e}}}return[e,r]}var Fn,qn=function(){return Fn||(Fn=document.implementation.createHTMLDocument("")),Fn};function Gn(e,t){if(t){if("string"==typeof e){var r=qn();r.body.innerHTML=e,e=r.body}if("function"==typeof t)return t(e);if(Object===t.constructor)return Object.keys(t).reduce((function(r,n){return r[n]=Gn(e,t[n]),r}),{})}}function Kn(e,t){return 1===arguments.length&&(t=e,e=void 0),function(r){var n=r;if(e&&(n=r.querySelector(e)),n)return function(e,t){for(var r,n=t.split(".");r=n.shift();){if(!(r in e))return;e=e[r]}return e}(n,t)}}function Wn(e){const t={};for(let r=0;r<e.length;r++){const{name:n,value:o}=e[r];t[n]=o}return t}function Yn(e){if(Z()("wp.blocks.node.fromDOM",{since:"6.1",version:"6.3",alternative:"wp.richText.create",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e.nodeType===e.TEXT_NODE)return e.nodeValue;if(e.nodeType!==e.ELEMENT_NODE)throw new TypeError("A block node can only be created from a node of type text or element.");return{type:e.nodeName.toLowerCase(),props:{...Wn(e.attributes),children:Xn(e.childNodes)}}}function Zn(e){return Z()("wp.blocks.node.matcher",{since:"6.1",version:"6.3",alternative:"html source",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),t=>{let r=t;e&&(r=t.querySelector(e));try{return Yn(r)}catch(e){return null}}}var Qn={isNodeOfType:function(e,t){return Z()("wp.blocks.node.isNodeOfType",{since:"6.1",version:"6.3",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e&&e.type===t},fromDOM:Yn,toHTML:function(e){return Z()("wp.blocks.node.toHTML",{since:"6.1",version:"6.3",alternative:"wp.richText.toHTMLString",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),Jn([e])},matcher:Zn};function Xn(e){Z()("wp.blocks.children.fromDOM",{since:"6.1",version:"6.3",alternative:"wp.richText.create",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=[];for(let r=0;r<e.length;r++)try{t.push(Yn(e[r]))}catch(e){}return t}function Jn(e){Z()("wp.blocks.children.toHTML",{since:"6.1",version:"6.3",alternative:"wp.richText.toHTMLString",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=e;return(0,G.renderToString)(t)}function eo(e){return Z()("wp.blocks.children.matcher",{since:"6.1",version:"6.3",alternative:"html source",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),t=>{let r=t;return e&&(r=t.querySelector(e)),r?Xn(r.childNodes):[]}}var to={concat:function(...e){Z()("wp.blocks.children.concat",{since:"6.1",version:"6.3",alternative:"wp.richText.concat",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=[];for(let r=0;r<e.length;r++){const n=Array.isArray(e[r])?e[r]:[e[r]];for(let e=0;e<n.length;e++){const r=n[e];"string"==typeof r&&"string"==typeof t[t.length-1]?t[t.length-1]+=r:t.push(r)}}return t},getChildrenArray:function(e){return Z()("wp.blocks.children.getChildrenArray",{since:"6.1",version:"6.3",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e},fromDOM:Xn,toHTML:Jn,matcher:eo};function ro(e,t){return t.some((t=>function(e,t){switch(t){case"rich-text":return e instanceof W.RichTextData;case"string":return"string"==typeof e;case"boolean":return"boolean"==typeof e;case"object":return!!e&&e.constructor===Object;case"null":return null===e;case"array":return Array.isArray(e);case"integer":case"number":return"number"==typeof e}return!0}(e,t)))}function no(e,t,r,n,o){let a;switch(t.source){case void 0:a=n?n[e]:void 0;break;case"raw":a=o;break;case"attribute":case"property":case"html":case"text":case"rich-text":case"children":case"node":case"query":case"tag":a=io(r,t)}return function(e,t){return void 0===t||ro(e,Array.isArray(t)?t:[t])}(a,t.type)&&function(e,t){return!Array.isArray(t)||t.includes(e)}(a,t.enum)||(a=void 0),void 0===a&&(a=Ye(t)),a}const oo=function(e,t){var r,n,o=0;function a(){var a,i,s=r,c=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(i=0;i<c;i++)if(s.args[i]!==arguments[i]){s=s.next;continue e}return s!==r&&(s===n&&(n=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=r,s.prev=null,r.prev=s,r=s),s.val}s=s.next}for(a=new Array(c),i=0;i<c;i++)a[i]=arguments[i];return s={args:a,val:e.apply(null,a)},r?(r.prev=s,s.next=r):n=s,o===t.maxSize?(n=n.prev).next=null:o++,r=s,s.val}return t=t||{},a.clear=function(){r=null,n=null,o=0},a}((e=>{switch(e.source){case"attribute":{let t=function(e,t){return 1===arguments.length&&(t=e,e=void 0),function(r){var n=Kn(e,"attributes")(r);if(n&&n.hasOwnProperty(t))return n[t].value}}(e.selector,e.attribute);return"boolean"===e.type&&(t=(e=>t=>void 0!==e(t))(t)),t}case"html":return t=e.selector,r=e.multiline,e=>{let n=e;if(t&&(n=e.querySelector(t)),!n)return"";if(r){let e="";const t=n.children.length;for(let o=0;o<t;o++){const t=n.children[o];t.nodeName.toLowerCase()===r&&(e+=t.outerHTML)}return e}return n.innerHTML};case"text":return function(e){return Kn(e,"textContent")}(e.selector);case"rich-text":return((e,t)=>r=>{const n=e?r.querySelector(e):r;return n?W.RichTextData.fromHTMLElement(n,{preserveWhiteSpace:t}):W.RichTextData.empty()})(e.selector,e.__unstablePreserveWhiteSpace);case"children":return eo(e.selector);case"node":return Zn(e.selector);case"query":const n=Object.fromEntries(Object.entries(e.query).map((([e,t])=>[e,oo(t)])));return function(e,t){return function(r){var n=r.querySelectorAll(e);return[].map.call(n,(function(e){return Gn(e,t)}))}}(e.selector,n);case"tag":{const t=Kn(e.selector,"nodeName");return e=>t(e)?.toLowerCase()}default:console.error(`Unknown source type "${e.source}"`)}var t,r}));function ao(e){return Gn(e,(e=>e))}function io(e,t){return oo(t)(ao(e))}function so(e,t,r={}){const n=ao(t),o=Ge(e),a=Object.fromEntries(Object.entries(o.attributes??{}).map((([e,o])=>[e,no(e,o,n,r,t)])));return(0,Kt.applyFilters)("blocks.getBlockAttributes",a,o,t,r)}const co={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function lo(e){const t=io(`<div data-custom-class-name>${e}</div>`,co);return t?t.trim().split(/\s+/):[]}const uo={type:"string",source:"attribute",selector:"[data-aria-label] > *",attribute:"aria-label"};function po(e,t,r){if(!Ee(t,"ariaLabel",!1))return e;const n={...e},o=function(e){return io(`<div data-aria-label>${e}</div>`,uo)}(r);return o&&(n.ariaLabel=o),n}function fo(e,t){const{attributes:r,originalContent:n}=e;let o=r;return o=function(e,t,r){if(!Ee(t,"customClassName",!0))return e;const n={...e},{className:o,...a}=n,i=Jr(t,a),s=lo(i),c=lo(r).filter((e=>!s.includes(e)));return c.length?n.className=c.join(" "):i&&delete n.className,n}(r,t,n),o=po(o,t,n),{...e,attributes:o}}function ho(){return!1}function go(e,t){let r=function(e,t){const r=me(),n=e.blockName||me(),o=e.attrs||{},a=e.innerBlocks||[];let i=e.innerHTML.trim();return n!==r||"core/freeform"!==n||t?.__unstableSkipAutop||(i=(0,Hr.autop)(i).trim()),{...e,blockName:n,attrs:o,innerHTML:i,innerBlocks:a}}(e,t);r=function(e){const[t,r]=Un(e.blockName,e.attrs);return{...e,blockName:t,attrs:r}}(r);let n=Te(r.blockName);n||(r=function(e){const t=ye()||me(),r=qr(e,{isCommentDelimited:!1}),n=qr(e,{isCommentDelimited:!0});return{blockName:t,attrs:{originalName:e.blockName,originalContent:n,originalUndelimitedContent:r},innerHTML:e.blockName?n:e.innerHTML,innerBlocks:e.innerBlocks,innerContent:e.innerContent}}(r),n=Te(r.blockName));const o=r.blockName===me()||r.blockName===ye();if(!n||!r.innerHTML&&o)return;const a=r.innerBlocks.map((e=>go(e,t))).filter((e=>!!e)),i=xr(r.blockName,so(n,r.innerHTML,r.attrs),a);i.originalContent=r.innerHTML;const s=function(e,t){const[r]=Hn(e,t);if(r)return{...e,isValid:r,validationIssues:[]};const n=fo(e,t),[o,a]=Hn(n,t);return{...n,isValid:o,validationIssues:a}}(i,n),{validationIssues:c}=s,l=function(e,t,r){const n=t.attrs,{deprecated:o}=r;if(!o||!o.length)return e;for(let a=0;a<o.length;a++){const{isEligible:i=ho}=o[a];if(e.isValid&&!i(n,e.innerBlocks,{blockNode:t,block:e}))continue;const s=Object.assign(et(r,X),o[a]);let c={...e,attributes:so(s,e.originalContent,n)},[l]=Hn(c,s);if(l||(c=fo(c,s),[l]=Hn(c,s)),!l)continue;let u=c.innerBlocks,d=c.attributes;const{migrate:p}=s;if(p){let t=p(d,e.innerBlocks);Array.isArray(t)||(t=[t]),[d=n,u=e.innerBlocks]=t}e={...e,attributes:d,innerBlocks:u,isValid:!0,validationIssues:[]}}return e}(s,r,n);return l.isValid||(l.__unstableBlockSource=e),s.isValid||!l.isValid||t?.__unstableSkipMigrationLogs?s.isValid||l.isValid||c.forEach((({log:e,args:t})=>e(...t))):(console.groupCollapsed("Updated Block: %s",n.name),console.info("Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",n.name,n,Jr(n,l.attributes),l.originalContent),console.groupEnd()),l}function mo(e,t){return(0,Vr.parse)(e).reduce(((e,r)=>{const n=go(r,t);return n&&e.push(n),e}),[])}function bo(){return Dr("from").filter((({type:e})=>"raw"===e)).map((e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)}))}function _o(e,t){const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=e,Array.from(r.body.children).flatMap((e=>{const r=jr(bo(),(({isMatch:t})=>t(e)));if(!r)return G.Platform.isNative?mo(`\x3c!-- wp:html --\x3e${e.outerHTML}\x3c!-- /wp:html --\x3e`):xr("core/html",so("core/html",e.outerHTML));const{transform:n,blockName:o}=r;if(n){const r=n(e,t);return e.hasAttribute("class")&&(r.attributes.className=e.getAttribute("class")),r}return xr(o,so(o,e.outerHTML))}))}function yo(e,t={}){const r=document.implementation.createHTMLDocument(""),n=document.implementation.createHTMLDocument(""),o=r.body,a=n.body;for(o.innerHTML=e;o.firstChild;){const e=o.firstChild;e.nodeType===e.TEXT_NODE?(0,K.isEmpty)(e)?o.removeChild(e):(a.lastChild&&"P"===a.lastChild.nodeName||a.appendChild(n.createElement("P")),a.lastChild.appendChild(e)):e.nodeType===e.ELEMENT_NODE?"BR"===e.nodeName?(e.nextSibling&&"BR"===e.nextSibling.nodeName&&(a.appendChild(n.createElement("P")),o.removeChild(e.nextSibling)),a.lastChild&&"P"===a.lastChild.nodeName&&a.lastChild.hasChildNodes()?a.lastChild.appendChild(e):o.removeChild(e)):"P"===e.nodeName?(0,K.isEmpty)(e)&&!t.raw?o.removeChild(e):a.appendChild(e):(0,K.isPhrasingContent)(e)?(a.lastChild&&"P"===a.lastChild.nodeName||a.appendChild(n.createElement("P")),a.lastChild.appendChild(e)):a.appendChild(e):o.removeChild(e)}return a.innerHTML}function ko(e,t){if(e.nodeType!==e.COMMENT_NODE)return;if("nextpage"!==e.nodeValue&&0!==e.nodeValue.indexOf("more"))return;const r=function(e,t){if("nextpage"===e.nodeValue)return function(e){const t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}(t);const r=e.nodeValue.slice(4).trim();let n=e,o=!1;for(;n=n.nextSibling;)if(n.nodeType===n.COMMENT_NODE&&"noteaser"===n.nodeValue){o=!0,(0,K.remove)(n);break}return function(e,t,r){const n=r.createElement("wp-block");n.dataset.block="core/more",e&&(n.dataset.customText=e);t&&(n.dataset.noTeaser="");return n}(r,o,t)}(e,t);if(e.parentNode&&"P"===e.parentNode.nodeName){const n=Array.from(e.parentNode.childNodes),o=n.indexOf(e),a=e.parentNode.parentNode||t.body,i=(e,r)=>(e||(e=t.createElement("p")),e.appendChild(r),e);[n.slice(0,o).reduce(i,null),r,n.slice(o+1).reduce(i,null)].forEach((t=>t&&a.insertBefore(t,e.parentNode))),(0,K.remove)(e.parentNode)}else(0,K.replace)(e,r)}function wo(e){return"OL"===e.nodeName||"UL"===e.nodeName}function vo(e){if(!wo(e))return;const t=e,r=e.previousElementSibling;if(r&&r.nodeName===e.nodeName&&1===t.children.length){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode.removeChild(t)}const n=e.parentNode;if(n&&"LI"===n.nodeName&&1===n.children.length&&!/\S/.test((o=n,Array.from(o.childNodes).map((({nodeValue:e=""})=>e)).join("")))){const e=n,r=e.previousElementSibling,o=e.parentNode;r&&(r.appendChild(t),o.removeChild(e))}var o;if(n&&wo(n)){const t=e.previousElementSibling;t?t.appendChild(e):(0,K.unwrap)(e)}}function To(e){return t=>{"BLOCKQUOTE"===t.nodeName&&(t.innerHTML=yo(t.innerHTML,e))}}function Co(e,t=e){const r=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(r,t),r.appendChild(e)}function xo(e,t,r){if(!function(e,t){const r=e.nodeName.toLowerCase();return"figcaption"!==r&&!(0,K.isTextContent)(e)&&r in(t?.figure?.children??{})}(e,r))return;let n=e;const o=e.parentNode;(function(e,t){return e.nodeName.toLowerCase()in(t?.figure?.children?.a?.children??{})})(e,r)&&"A"===o.nodeName&&1===o.childNodes.length&&(n=e.parentNode);const a=n.closest("p,div");a?e.classList?(e.classList.contains("alignright")||e.classList.contains("alignleft")||e.classList.contains("aligncenter")||!a.textContent.trim())&&Co(n,a):Co(n,a):Co(n)}const Eo=window.wp.shortcode,So=e=>Array.isArray(e)?e:[e],Bo=/(\n|<p>)\s*$/,Ao=/^\s*(\n|<\/p>)/;var No=function e(t,r=0,n=[]){const o=jr(Dr("from"),(e=>-1===n.indexOf(e.blockName)&&"shortcode"===e.type&&So(e.tag).some((e=>(0,Eo.regexp)(e).test(t)))));if(!o)return[t];const a=So(o.tag).find((e=>(0,Eo.regexp)(e).test(t)));let i;const s=r;if(i=(0,Eo.next)(a,t,r)){r=i.index+i.content.length;const a=t.substr(0,i.index),c=t.substr(r);if(!(i.shortcode.content?.includes("<")||Bo.test(a)&&Ao.test(c)))return e(t,r);if(o.isMatch&&!o.isMatch(i.shortcode.attrs))return e(t,s,[...n,o.blockName]);let l=[];if("function"==typeof o.transform)l=[].concat(o.transform(i.shortcode.attrs,i)),l=l.map((e=>(e.originalContent=i.shortcode.content,fo(e,Te(e.name)))));else{const e=Object.fromEntries(Object.entries(o.attributes).filter((([,e])=>e.shortcode)).map((([e,t])=>[e,t.shortcode(i.shortcode.attrs,i)]))),r=Te(o.blockName);if(!r)return[t];const n={...r,attributes:o.attributes};let a=xr(o.blockName,so(n,i.shortcode.content,e));a.originalContent=i.shortcode.content,a=fo(a,n),l=[a]}return[...e(a.replace(Bo,"")),...l,...e(c.replace(Ao,""))]}return[t]};function Po(e){return function(e,t){const r={phrasingContentSchema:(0,K.getPhrasingContentSchema)(t),isPaste:"paste"===t};function n(e,t,r){switch(r){case"children":return"*"===e||"*"===t?"*":{...e,...t};case"attributes":case"require":return[...e||[],...t||[]];case"isMatch":if(!e||!t)return;return(...r)=>e(...r)||t(...r)}}function o(e,t){for(const r in t)e[r]=e[r]?n(e[r],t[r],r):{...t[r]};return e}return e.map((({isMatch:e,blockName:t,schema:n})=>{const o=Ee(t,"anchor");return n="function"==typeof n?n(r):n,o||e?n?Object.fromEntries(Object.entries(n).map((([t,r])=>{let n=r.attributes||[];return o&&(n=[...n,"id"]),[t,{...r,attributes:n,isMatch:e||void 0}]}))):{}:n})).reduce((function(e,t){for(const r in t)e[r]=e[r]?o(e[r],t[r]):{...t[r]};return e}),{})}(bo(),e)}function Oo(e,t,r,n){Array.from(e).forEach((e=>{Oo(e.childNodes,t,r,n),t.forEach((t=>{r.contains(e)&&t(e,r,n)}))}))}function Lo(e,t=[],r){const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,Oo(n.body.childNodes,t,n,r),n.body.innerHTML}function Mo(e,t){const r=e[`${t}Sibling`];if(r&&(0,K.isPhrasingContent)(r))return r;const{parentNode:n}=e;return n&&(0,K.isPhrasingContent)(n)?Mo(n,t):void 0}function jo(e){return Z()("wp.blocks.getPhrasingContentSchema",{since:"5.6",alternative:"wp.dom.getPhrasingContentSchema"}),(0,K.getPhrasingContentSchema)(e)}function Do({HTML:e=""}){if(-1!==e.indexOf("\x3c!-- wp:")){const t=mo(e);if(!(1===t.length&&"core/freeform"===t[0].name))return t}const t=No(e),r=Po();return t.map((e=>{if("string"!=typeof e)return e;return _o(e=yo(e=Lo(e,[vo,ko,xo,To({raw:!0})],r),{raw:!0}),Do)})).flat().filter(Boolean)}function zo(e){e.nodeType===e.COMMENT_NODE&&(0,K.remove)(e)}function Io(e,t){return e.every((e=>function(e,t){if((0,K.isTextContent)(e))return!0;if(!t)return!1;const r=e.nodeName.toLowerCase();return[["ul","li","ol"],["h1","h2","h3","h4","h5","h6"]].some((e=>0===[r,t].filter((t=>!e.includes(t))).length))}(e,t)&&Io(Array.from(e.children),t)))}function Ro(e){return"BR"===e.nodeName&&e.previousSibling&&"BR"===e.previousSibling.nodeName}function Vo(e,t){if("SPAN"===e.nodeName&&e.style){const{fontWeight:r,fontStyle:n,textDecorationLine:o,textDecoration:a,verticalAlign:i}=e.style;"bold"!==r&&"700"!==r||(0,K.wrap)(t.createElement("strong"),e),"italic"===n&&(0,K.wrap)(t.createElement("em"),e),("line-through"===o||a.includes("line-through"))&&(0,K.wrap)(t.createElement("s"),e),"super"===i?(0,K.wrap)(t.createElement("sup"),e):"sub"===i&&(0,K.wrap)(t.createElement("sub"),e)}else"B"===e.nodeName?e=(0,K.replaceTag)(e,"strong"):"I"===e.nodeName?e=(0,K.replaceTag)(e,"em"):"A"===e.nodeName&&(e.target&&"_blank"===e.target.toLowerCase()?e.rel="noreferrer noopener":(e.removeAttribute("target"),e.removeAttribute("rel")),e.name&&!e.id&&(e.id=e.name),e.id&&!e.ownerDocument.querySelector(`[href="#${e.id}"]`)&&e.removeAttribute("id"))}function Ho(e){"SCRIPT"!==e.nodeName&&"NOSCRIPT"!==e.nodeName&&"TEMPLATE"!==e.nodeName&&"STYLE"!==e.nodeName||e.parentNode.removeChild(e)}function $o(e){if(e.nodeType!==e.ELEMENT_NODE)return;const t=e.getAttribute("style");if(!t||!t.includes("mso-list"))return;"ignore"===t.split(";").reduce(((e,t)=>{const[r,n]=t.split(":");return r&&n&&(e[r.trim().toLowerCase()]=n.trim().toLowerCase()),e}),{})["mso-list"]&&e.remove()}function Uo(e){return"OL"===e.nodeName||"UL"===e.nodeName}function Fo(e,t){if("P"!==e.nodeName)return;const r=e.getAttribute("style");if(!r||!r.includes("mso-list"))return;const n=e.previousElementSibling;if(!n||!Uo(n)){const r=e.textContent.trim().slice(0,1),n=/[1iIaA]/.test(r),o=t.createElement(n?"ol":"ul");n&&o.setAttribute("type",r),e.parentNode.insertBefore(o,e)}const o=e.previousElementSibling,a=o.nodeName,i=t.createElement("li");let s=o;i.innerHTML=Lo(e.innerHTML,[$o]);const c=/mso-list\s*:[^;]+level([0-9]+)/i.exec(r);let l=c&&parseInt(c[1],10)-1||0;for(;l--;)s=s.lastChild||s,Uo(s)&&(s=s.lastChild||s);Uo(s)||(s=s.appendChild(t.createElement(a))),s.appendChild(i),e.parentNode.removeChild(e)}const qo=window.wp.blob;function Go(e){if("IMG"===e.nodeName){if(0===e.src.indexOf("file:")&&(e.src=""),0===e.src.indexOf("data:")){const[t,r]=e.src.split(","),[n]=t.slice(5).split(";");if(!r||!n)return void(e.src="");let o;try{o=atob(r)}catch(t){return void(e.src="")}const a=new Uint8Array(o.length);for(let e=0;e<a.length;e++)a[e]=o.charCodeAt(e);const i=n.replace("/","."),s=new window.File([a],i,{type:n});e.src=(0,qo.createBlobURL)(s)}1!==e.height&&1!==e.width||e.parentNode.removeChild(e)}}function Ko(e){"DIV"===e.nodeName&&(e.innerHTML=yo(e.innerHTML))}var Wo=r(1030);const Yo=new(r.n(Wo)().Converter)({noHeaderId:!0,tables:!0,literalMidWordUnderscores:!0,omitExtraWLInCodeBlocks:!0,simpleLineBreaks:!0,strikethrough:!0});function Zo(e){if("IFRAME"===e.nodeName){const t=e.ownerDocument.createTextNode(e.src);e.parentNode.replaceChild(t,e)}}function Qo(e){e.id&&0===e.id.indexOf("docs-internal-guid-")&&("B"===e.tagName?(0,K.unwrap)(e):e.removeAttribute("id"))}function Xo(e){if(e.nodeType!==e.TEXT_NODE)return;let t=e;for(;t=t.parentNode;)if(t.nodeType===t.ELEMENT_NODE&&"PRE"===t.nodeName)return;let r=e.data.replace(/[ \r\n\t]+/g," ");if(" "===r[0]){const t=Mo(e,"previous");t&&"BR"!==t.nodeName&&" "!==t.textContent.slice(-1)||(r=r.slice(1))}if(" "===r[r.length-1]){const t=Mo(e,"next");(!t||"BR"===t.nodeName||t.nodeType===t.TEXT_NODE&&(" "===(n=t.textContent[0])||"\r"===n||"\n"===n||"\t"===n))&&(r=r.slice(0,-1))}var n;r?e.data=r:e.parentNode.removeChild(e)}function Jo(e){"BR"===e.nodeName&&(Mo(e,"next")||e.parentNode.removeChild(e))}function ea(e){"P"===e.nodeName&&(e.hasChildNodes()||e.parentNode.removeChild(e))}function ta(e){if("SPAN"!==e.nodeName)return;if("paragraph-break"!==e.getAttribute("data-stringify-type"))return;const{parentNode:t}=e;t.insertBefore(e.ownerDocument.createElement("br"),e),t.insertBefore(e.ownerDocument.createElement("br"),e),t.removeChild(e)}const ra=(...e)=>window?.console?.log?.(...e);function na(e){return e=Lo(e,[Ho,Qo,$o,Vo,zo]),e=Lo(e=(0,K.removeInvalidHTML)(e,(0,K.getPhrasingContentSchema)("paste"),{inline:!0}),[Xo,Jo]),ra("Processed inline HTML:\n\n",e),e}function oa({HTML:e="",plainText:t="",mode:r="AUTO",tagName:n}){if(e=(e=(e=e.replace(/<meta[^>]+>/g,"")).replace(/^\s*<html[^>]*>\s*<body[^>]*>(?:\s*<!--\s*StartFragment\s*-->)?/i,"")).replace(/(?:<!--\s*EndFragment\s*-->\s*)?<\/body>\s*<\/html>\s*$/i,""),"INLINE"!==r){const r=e||t;if(-1!==r.indexOf("\x3c!-- wp:")){const e=mo(r);if(!(1===e.length&&"core/freeform"===e[0].name))return e}}String.prototype.normalize&&(e=e.normalize()),e=Lo(e,[ta]);const o=t&&(!e||function(e){return!/<(?!br[ />])/i.test(e)}(e));if(o&&function(e){const t=/[\p{L}\s]+/gu;let r;for(;r=t.exec(e);){if("{"===e[r.index-1])continue;let t=r[0];if("\\"===e[r.index-1]&&(t=t.replace(/^[a-zA-Z]+/,"")),!(t.length<6))return!1}return!!/\\[a-zA-Z]+\s*\{/g.test(e)||[e=>e.includes("^")&&!e.startsWith("^"),e=>["=","+","-","/","*"].some((t=>e.includes(t))),e=>/\\[a-zA-Z]+/g.test(e)].filter((t=>t(e))).length>=2}(t))return[xr("core/math",{latex:t})];var a;o&&(e=t,/^\s+$/.test(t)||(a=e,e=Yo.makeHtml(function(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,((e,t,r,n)=>`${t}\n${r}\n${n}`))}(function(e){return e.replace(/(^|\n)•( +)/g,"$1*$2")}(a)))));const i=No(e),s=i.length>1;if(o&&!s&&"AUTO"===r&&-1===t.indexOf("\n")&&0!==t.indexOf("<p>")&&0===e.indexOf("<p>")&&(r="INLINE"),"INLINE"===r)return na(e);if("AUTO"===r&&!s&&function(e,t){const r=document.implementation.createHTMLDocument("");r.body.innerHTML=e;const n=Array.from(r.body.children);return!n.some(Ro)&&Io(n,t)}(e,n))return na(e);const c=(0,K.getPhrasingContentSchema)("paste"),l=Po("paste"),u=i.map((e=>{if("string"!=typeof e)return e;const t=[Qo,Fo,Ho,vo,Go,Vo,ko,zo,Zo,xo,To(),Ko],r={...l,...c};return e=Lo(e,t,l),e=Lo(e=yo(e=(0,K.removeInvalidHTML)(e,r)),[Xo,Jo,ea],l),ra("Processed HTML piece:\n\n",e),_o(e,oa)})).flat().filter(Boolean);if("AUTO"===r&&1===u.length&&Ee(u[0].name,"__unstablePasteTextInline",!1)){const e=/^[\n]+|[\n]+$/g,r=t.replace(e,"");if(""!==r&&-1===r.indexOf("\n"))return(0,K.removeInvalidHTML)(en(u[0]),c).replace(e,"")}return u}function aa(){return(0,i.select)(br).getCategories()}function ia(e){(0,i.dispatch)(br).setCategories(e)}function sa(e,t){(0,i.dispatch)(br).updateCategory(e,t)}function ca(e=[],t=[]){return e.length===t.length&&t.every((([t,,r],n)=>{const o=e[n];return t===o.name&&ca(o.innerBlocks,r)}))}const la=e=>"html"===e?.source,ua=e=>"query"===e?.source;function da(e,t){return t?Object.fromEntries(Object.entries(t).map((([t,r])=>[t,pa(e[t],r)]))):{}}function pa(e,t){return la(e)&&Array.isArray(t)?(0,G.renderToString)(t):ua(e)&&t?t.map((t=>da(e.query,t))):t}function fa(e=[],t){return t?t.map((([t,r,n],o)=>{const a=e[o];if(a&&a.name===t){const e=fa(a.innerBlocks,n);return{...a,innerBlocks:e}}const i=Te(t),s=da(i?.attributes??{},r),[c,l]=Un(t,s);return xr(c,l,fa([],n))})):e}const ha={};function ga(e){return Z()("wp.blocks.withBlockContentContext",{since:"6.1"}),e}ie(ha,{isContentBlock:function(e){const t=Te(e),r=t?.attributes,n=t?.supports?.contentRole;return!!n||!!r&&!!Object.keys(r)?.some((e=>{const t=r[e];return"content"===t?.role||"content"===t?.__experimentalRole}))}})})(),(window.wp=window.wp||{}).blocks=n})(); patterns.js 0000644 00000170500 15121363551 0006747 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
privateApis: () => (/* reexport */ privateApis),
store: () => (/* reexport */ store)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/patterns/build-module/store/actions.js
var actions_namespaceObject = {};
__webpack_require__.r(actions_namespaceObject);
__webpack_require__.d(actions_namespaceObject, {
convertSyncedPatternToStatic: () => (convertSyncedPatternToStatic),
createPattern: () => (createPattern),
createPatternFromFile: () => (createPatternFromFile),
setEditingPattern: () => (setEditingPattern)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/patterns/build-module/store/selectors.js
var selectors_namespaceObject = {};
__webpack_require__.r(selectors_namespaceObject);
__webpack_require__.d(selectors_namespaceObject, {
isEditingPattern: () => (selectors_isEditingPattern)
});
;// external ["wp","data"]
const external_wp_data_namespaceObject = window["wp"]["data"];
;// ./node_modules/@wordpress/patterns/build-module/store/reducer.js
function isEditingPattern(state = {}, action) {
if (action?.type === "SET_EDITING_PATTERN") {
return {
...state,
[action.clientId]: action.isEditing
};
}
return state;
}
var reducer_default = (0,external_wp_data_namespaceObject.combineReducers)({
isEditingPattern
});
;// external ["wp","blocks"]
const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
;// external ["wp","coreData"]
const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
;// external ["wp","blockEditor"]
const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
;// ./node_modules/@wordpress/patterns/build-module/constants.js
const PATTERN_TYPES = {
theme: "pattern",
user: "wp_block"
};
const PATTERN_DEFAULT_CATEGORY = "all-patterns";
const PATTERN_USER_CATEGORY = "my-patterns";
const EXCLUDED_PATTERN_SOURCES = [
"core",
"pattern-directory/core",
"pattern-directory/featured"
];
const PATTERN_SYNC_TYPES = {
full: "fully",
unsynced: "unsynced"
};
const PARTIAL_SYNCING_SUPPORTED_BLOCKS = {
"core/paragraph": ["content"],
"core/heading": ["content"],
"core/button": ["text", "url", "linkTarget", "rel"],
"core/image": ["id", "url", "title", "alt", "caption"]
};
const PATTERN_OVERRIDES_BINDING_SOURCE = "core/pattern-overrides";
;// ./node_modules/@wordpress/patterns/build-module/store/actions.js
const createPattern = (title, syncType, content, categories) => async ({ registry }) => {
const meta = syncType === PATTERN_SYNC_TYPES.unsynced ? {
wp_pattern_sync_status: syncType
} : void 0;
const reusableBlock = {
title,
content,
status: "publish",
meta,
wp_pattern_category: categories
};
const updatedRecord = await registry.dispatch(external_wp_coreData_namespaceObject.store).saveEntityRecord("postType", "wp_block", reusableBlock);
return updatedRecord;
};
const createPatternFromFile = (file, categories) => async ({ dispatch }) => {
const fileContent = await file.text();
let parsedContent;
try {
parsedContent = JSON.parse(fileContent);
} catch (e) {
throw new Error("Invalid JSON file");
}
if (parsedContent.__file !== "wp_block" || !parsedContent.title || !parsedContent.content || typeof parsedContent.title !== "string" || typeof parsedContent.content !== "string" || parsedContent.syncStatus && typeof parsedContent.syncStatus !== "string") {
throw new Error("Invalid pattern JSON file");
}
const pattern = await dispatch.createPattern(
parsedContent.title,
parsedContent.syncStatus,
parsedContent.content,
categories
);
return pattern;
};
const convertSyncedPatternToStatic = (clientId) => ({ registry }) => {
const patternBlock = registry.select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId);
const existingOverrides = patternBlock.attributes?.content;
function cloneBlocksAndRemoveBindings(blocks) {
return blocks.map((block) => {
let metadata = block.attributes.metadata;
if (metadata) {
metadata = { ...metadata };
delete metadata.id;
delete metadata.bindings;
if (existingOverrides?.[metadata.name]) {
for (const [attributeName, value] of Object.entries(
existingOverrides[metadata.name]
)) {
if (!(0,external_wp_blocks_namespaceObject.getBlockType)(block.name)?.attributes[attributeName]) {
continue;
}
block.attributes[attributeName] = value;
}
}
}
return (0,external_wp_blocks_namespaceObject.cloneBlock)(
block,
{
metadata: metadata && Object.keys(metadata).length > 0 ? metadata : void 0
},
cloneBlocksAndRemoveBindings(block.innerBlocks)
);
});
}
const patternInnerBlocks = registry.select(external_wp_blockEditor_namespaceObject.store).getBlocks(patternBlock.clientId);
registry.dispatch(external_wp_blockEditor_namespaceObject.store).replaceBlocks(
patternBlock.clientId,
cloneBlocksAndRemoveBindings(patternInnerBlocks)
);
};
function setEditingPattern(clientId, isEditing) {
return {
type: "SET_EDITING_PATTERN",
clientId,
isEditing
};
}
;// ./node_modules/@wordpress/patterns/build-module/store/constants.js
const STORE_NAME = "core/patterns";
;// ./node_modules/@wordpress/patterns/build-module/store/selectors.js
function selectors_isEditingPattern(state, clientId) {
return state.isEditingPattern[clientId];
}
;// external ["wp","privateApis"]
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// ./node_modules/@wordpress/patterns/build-module/lock-unlock.js
const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
"@wordpress/patterns"
);
;// ./node_modules/@wordpress/patterns/build-module/store/index.js
const storeConfig = {
reducer: reducer_default
};
const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
...storeConfig
});
(0,external_wp_data_namespaceObject.register)(store);
unlock(store).registerPrivateActions(actions_namespaceObject);
unlock(store).registerPrivateSelectors(selectors_namespaceObject);
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// external ["wp","components"]
const external_wp_components_namespaceObject = window["wp"]["components"];
;// external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// ./node_modules/@wordpress/patterns/build-module/api/index.js
function isOverridableBlock(block) {
return Object.keys(PARTIAL_SYNCING_SUPPORTED_BLOCKS).includes(
block.name
) && !!block.attributes.metadata?.name && !!block.attributes.metadata?.bindings && Object.values(block.attributes.metadata.bindings).some(
(binding) => binding.source === "core/pattern-overrides"
);
}
function hasOverridableBlocks(blocks) {
return blocks.some((block) => {
if (isOverridableBlock(block)) {
return true;
}
return hasOverridableBlocks(block.innerBlocks);
});
}
;// ./node_modules/@wordpress/patterns/build-module/components/overrides-panel.js
const { BlockQuickNavigation } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function OverridesPanel() {
const allClientIds = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(external_wp_blockEditor_namespaceObject.store).getClientIdsWithDescendants(),
[]
);
const { getBlock } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
const clientIdsWithOverrides = (0,external_wp_element_namespaceObject.useMemo)(
() => allClientIds.filter((clientId) => {
const block = getBlock(clientId);
return isOverridableBlock(block);
}),
[allClientIds, getBlock]
);
if (!clientIdsWithOverrides?.length) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)("Overrides"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockQuickNavigation, { clientIds: clientIdsWithOverrides }) });
}
;// external ["wp","notices"]
const external_wp_notices_namespaceObject = window["wp"]["notices"];
;// external ["wp","compose"]
const external_wp_compose_namespaceObject = window["wp"]["compose"];
;// external ["wp","htmlEntities"]
const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
;// ./node_modules/@wordpress/patterns/build-module/components/category-selector.js
const unescapeString = (arg) => {
return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(arg);
};
const CATEGORY_SLUG = "wp_pattern_category";
function CategorySelector({
categoryTerms,
onChange,
categoryMap
}) {
const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)("");
const debouncedSearch = (0,external_wp_compose_namespaceObject.useDebounce)(setSearch, 500);
const suggestions = (0,external_wp_element_namespaceObject.useMemo)(() => {
return Array.from(categoryMap.values()).map((category) => unescapeString(category.label)).filter((category) => {
if (search !== "") {
return category.toLowerCase().includes(search.toLowerCase());
}
return true;
}).sort((a, b) => a.localeCompare(b));
}, [search, categoryMap]);
function handleChange(termNames) {
const uniqueTerms = termNames.reduce((terms, newTerm) => {
if (!terms.some(
(term) => term.toLowerCase() === newTerm.toLowerCase()
)) {
terms.push(newTerm);
}
return terms;
}, []);
onChange(uniqueTerms);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.FormTokenField,
{
className: "patterns-menu-items__convert-modal-categories",
value: categoryTerms,
suggestions,
onChange: handleChange,
onInputChange: debouncedSearch,
label: (0,external_wp_i18n_namespaceObject.__)("Categories"),
tokenizeOnBlur: true,
__experimentalExpandOnFocus: true,
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true
}
);
}
;// ./node_modules/@wordpress/patterns/build-module/private-hooks.js
function useAddPatternCategory() {
const { saveEntityRecord, invalidateResolution } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const { corePatternCategories, userPatternCategories } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getUserPatternCategories, getBlockPatternCategories } = select(external_wp_coreData_namespaceObject.store);
return {
corePatternCategories: getBlockPatternCategories(),
userPatternCategories: getUserPatternCategories()
};
},
[]
);
const categoryMap = (0,external_wp_element_namespaceObject.useMemo)(() => {
const uniqueCategories = /* @__PURE__ */ new Map();
userPatternCategories.forEach((category) => {
uniqueCategories.set(category.label.toLowerCase(), {
label: category.label,
name: category.name,
id: category.id
});
});
corePatternCategories.forEach((category) => {
if (!uniqueCategories.has(category.label.toLowerCase()) && // There are two core categories with `Post` label so explicitly remove the one with
// the `query` slug to avoid any confusion.
category.name !== "query") {
uniqueCategories.set(category.label.toLowerCase(), {
label: category.label,
name: category.name
});
}
});
return uniqueCategories;
}, [userPatternCategories, corePatternCategories]);
async function findOrCreateTerm(term) {
try {
const existingTerm = categoryMap.get(term.toLowerCase());
if (existingTerm?.id) {
return existingTerm.id;
}
const termData = existingTerm ? { name: existingTerm.label, slug: existingTerm.name } : { name: term };
const newTerm = await saveEntityRecord(
"taxonomy",
CATEGORY_SLUG,
termData,
{ throwOnError: true }
);
invalidateResolution("getUserPatternCategories");
return newTerm.id;
} catch (error) {
if (error.code !== "term_exists") {
throw error;
}
return error.data.term_id;
}
}
return { categoryMap, findOrCreateTerm };
}
;// ./node_modules/@wordpress/patterns/build-module/components/create-pattern-modal.js
function CreatePatternModal({
className = "patterns-menu-items__convert-modal",
modalTitle,
...restProps
}) {
const defaultModalTitle = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).getPostType(PATTERN_TYPES.user)?.labels?.add_new_item,
[]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
title: modalTitle || defaultModalTitle,
onRequestClose: restProps.onClose,
overlayClassName: className,
focusOnMount: "firstContentElement",
size: "small",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CreatePatternModalContents, { ...restProps })
}
);
}
function CreatePatternModalContents({
confirmLabel = (0,external_wp_i18n_namespaceObject.__)("Add"),
defaultCategories = [],
content,
onClose,
onError,
onSuccess,
defaultSyncType = PATTERN_SYNC_TYPES.full,
defaultTitle = ""
}) {
const [syncType, setSyncType] = (0,external_wp_element_namespaceObject.useState)(defaultSyncType);
const [categoryTerms, setCategoryTerms] = (0,external_wp_element_namespaceObject.useState)(defaultCategories);
const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(defaultTitle);
const [isSaving, setIsSaving] = (0,external_wp_element_namespaceObject.useState)(false);
const { createPattern } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const { categoryMap, findOrCreateTerm } = useAddPatternCategory();
async function onCreate(patternTitle, sync) {
if (!title || isSaving) {
return;
}
try {
setIsSaving(true);
const categories = await Promise.all(
categoryTerms.map(
(termName) => findOrCreateTerm(termName)
)
);
const newPattern = await createPattern(
patternTitle,
sync,
typeof content === "function" ? content() : content,
categories
);
onSuccess({
pattern: newPattern,
categoryId: PATTERN_DEFAULT_CATEGORY
});
} catch (error) {
createErrorNotice(error.message, {
type: "snackbar",
id: "pattern-create"
});
onError?.();
} finally {
setIsSaving(false);
setCategoryTerms([]);
setTitle("");
}
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"form",
{
onSubmit: (event) => {
event.preventDefault();
onCreate(title, syncType);
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Name"),
value: title,
onChange: setTitle,
placeholder: (0,external_wp_i18n_namespaceObject.__)("My pattern"),
className: "patterns-create-modal__name-input",
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CategorySelector,
{
categoryTerms,
onChange: setCategoryTerms,
categoryMap
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject._x)("Synced", "pattern (singular)"),
help: (0,external_wp_i18n_namespaceObject.__)(
"Sync this pattern across multiple locations."
),
checked: syncType === PATTERN_SYNC_TYPES.full,
onChange: () => {
setSyncType(
syncType === PATTERN_SYNC_TYPES.full ? PATTERN_SYNC_TYPES.unsynced : PATTERN_SYNC_TYPES.full
);
}
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: () => {
onClose();
setTitle("");
},
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "primary",
type: "submit",
"aria-disabled": !title || isSaving,
isBusy: isSaving,
children: confirmLabel
}
)
] })
] })
}
);
}
;// ./node_modules/@wordpress/patterns/build-module/components/duplicate-pattern-modal.js
function getTermLabels(pattern, categories) {
if (pattern.type !== PATTERN_TYPES.user) {
return categories.core?.filter(
(category) => pattern.categories?.includes(category.name)
).map((category) => category.label);
}
return categories.user?.filter(
(category) => pattern.wp_pattern_category?.includes(category.id)
).map((category) => category.label);
}
function useDuplicatePatternProps({ pattern, onSuccess }) {
const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const categories = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getUserPatternCategories, getBlockPatternCategories } = select(external_wp_coreData_namespaceObject.store);
return {
core: getBlockPatternCategories(),
user: getUserPatternCategories()
};
});
if (!pattern) {
return null;
}
return {
content: pattern.content,
defaultCategories: getTermLabels(pattern, categories),
defaultSyncType: pattern.type !== PATTERN_TYPES.user ? PATTERN_SYNC_TYPES.unsynced : pattern.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full,
defaultTitle: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Existing pattern title */
(0,external_wp_i18n_namespaceObject._x)("%s (Copy)", "pattern"),
typeof pattern.title === "string" ? pattern.title : pattern.title.raw
),
onSuccess: ({ pattern: newPattern }) => {
createSuccessNotice(
(0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The new pattern's title e.g. 'Call to action (copy)'.
(0,external_wp_i18n_namespaceObject._x)('"%s" duplicated.', "pattern"),
newPattern.title.raw
),
{
type: "snackbar",
id: "patterns-create"
}
);
onSuccess?.({ pattern: newPattern });
}
};
}
function DuplicatePatternModal({
pattern,
onClose,
onSuccess
}) {
const duplicatedProps = useDuplicatePatternProps({ pattern, onSuccess });
if (!pattern) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CreatePatternModal,
{
modalTitle: (0,external_wp_i18n_namespaceObject.__)("Duplicate pattern"),
confirmLabel: (0,external_wp_i18n_namespaceObject.__)("Duplicate"),
onClose,
onError: onClose,
...duplicatedProps
}
);
}
;// ./node_modules/@wordpress/patterns/build-module/components/rename-pattern-modal.js
function RenamePatternModal({
onClose,
onError,
onSuccess,
pattern,
...props
}) {
const originalName = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(pattern.title);
const [name, setName] = (0,external_wp_element_namespaceObject.useState)(originalName);
const [isSaving, setIsSaving] = (0,external_wp_element_namespaceObject.useState)(false);
const {
editEntityRecord,
__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const onRename = async (event) => {
event.preventDefault();
if (!name || name === pattern.title || isSaving) {
return;
}
try {
await editEntityRecord("postType", pattern.type, pattern.id, {
title: name
});
setIsSaving(true);
setName("");
onClose?.();
const savedRecord = await saveSpecifiedEntityEdits(
"postType",
pattern.type,
pattern.id,
["title"],
{ throwOnError: true }
);
onSuccess?.(savedRecord);
createSuccessNotice((0,external_wp_i18n_namespaceObject.__)("Pattern renamed"), {
type: "snackbar",
id: "pattern-update"
});
} catch (error) {
onError?.();
const errorMessage = error.message && error.code !== "unknown_error" ? error.message : (0,external_wp_i18n_namespaceObject.__)("An error occurred while renaming the pattern.");
createErrorNotice(errorMessage, {
type: "snackbar",
id: "pattern-update"
});
} finally {
setIsSaving(false);
setName("");
}
};
const onRequestClose = () => {
onClose?.();
setName("");
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
title: (0,external_wp_i18n_namespaceObject.__)("Rename"),
...props,
onRequestClose: onClose,
focusOnMount: "firstContentElement",
size: "small",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: onRename, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Name"),
value: name,
onChange: setName,
required: true
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: onRequestClose,
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "primary",
type: "submit",
children: (0,external_wp_i18n_namespaceObject.__)("Save")
}
)
] })
] }) })
}
);
}
;// external ["wp","primitives"]
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
;// ./node_modules/@wordpress/icons/build-module/library/symbol.js
var symbol_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) });
;// ./node_modules/@wordpress/patterns/build-module/components/pattern-convert-button.js
function PatternConvertButton({
clientIds,
rootClientId,
closeBlockSettingsMenu
}) {
const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const { replaceBlocks, updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const { setEditingPattern } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
const { getBlockAttributes } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
const canConvert = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { canUser } = select(external_wp_coreData_namespaceObject.store);
const {
getBlocksByClientId: getBlocksByClientId2,
canInsertBlockType,
getBlockRootClientId
} = select(external_wp_blockEditor_namespaceObject.store);
const rootId = rootClientId || (clientIds.length > 0 ? getBlockRootClientId(clientIds[0]) : void 0);
const blocks = getBlocksByClientId2(clientIds) ?? [];
const hasReusableBlockSupport = (blockName) => {
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName);
const hasParent = blockType && "parent" in blockType;
return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, "reusable", !hasParent);
};
const isSyncedPattern = blocks.length === 1 && blocks[0] && (0,external_wp_blocks_namespaceObject.isReusableBlock)(blocks[0]) && !!select(external_wp_coreData_namespaceObject.store).getEntityRecord(
"postType",
"wp_block",
blocks[0].attributes.ref
);
const isUnsyncedPattern = window?.__experimentalContentOnlyPatternInsertion && blocks.length === 1 && blocks?.[0]?.attributes?.metadata?.patternName;
const _canConvert = (
// Hide when this is already a pattern.
!isUnsyncedPattern && !isSyncedPattern && // Hide when patterns are disabled.
canInsertBlockType("core/block", rootId) && blocks.every(
(block) => (
// Guard against the case where a regular block has *just* been converted.
!!block && // Hide on invalid blocks.
block.isValid && // Hide when block doesn't support being made into a pattern.
hasReusableBlockSupport(block.name)
)
) && // Hide when current doesn't have permission to do that.
// Blocks refers to the wp_block post type, this checks the ability to create a post of that type.
!!canUser("create", {
kind: "postType",
name: "wp_block"
})
);
return _canConvert;
},
[clientIds, rootClientId]
);
const { getBlocksByClientId } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
const getContent = (0,external_wp_element_namespaceObject.useCallback)(
() => (0,external_wp_blocks_namespaceObject.serialize)(getBlocksByClientId(clientIds)),
[getBlocksByClientId, clientIds]
);
if (!canConvert) {
return null;
}
const handleSuccess = ({ pattern }) => {
if (pattern.wp_pattern_sync_status === PATTERN_SYNC_TYPES.unsynced) {
if (clientIds?.length === 1) {
const existingAttributes = getBlockAttributes(clientIds[0]);
updateBlockAttributes(clientIds[0], {
metadata: {
...existingAttributes?.metadata ? existingAttributes.metadata : {},
patternName: `core/block/${pattern.id}`,
name: pattern.title.raw
}
});
}
} else {
const newBlock = (0,external_wp_blocks_namespaceObject.createBlock)("core/block", {
ref: pattern.id
});
replaceBlocks(clientIds, newBlock);
setEditingPattern(newBlock.clientId, true);
closeBlockSettingsMenu();
}
createSuccessNotice(
pattern.wp_pattern_sync_status === PATTERN_SYNC_TYPES.unsynced ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: the name the user has given to the pattern.
(0,external_wp_i18n_namespaceObject.__)("Unsynced pattern created: %s"),
pattern.title.raw
) : (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: the name the user has given to the pattern.
(0,external_wp_i18n_namespaceObject.__)("Synced pattern created: %s"),
pattern.title.raw
),
{
type: "snackbar",
id: "convert-to-pattern-success"
}
);
setIsModalOpen(false);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
icon: symbol_default,
onClick: () => setIsModalOpen(true),
"aria-expanded": isModalOpen,
"aria-haspopup": "dialog",
children: (0,external_wp_i18n_namespaceObject.__)("Create pattern")
}
),
isModalOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CreatePatternModal,
{
content: getContent,
onSuccess: (pattern) => {
handleSuccess(pattern);
},
onError: () => {
setIsModalOpen(false);
},
onClose: () => {
setIsModalOpen(false);
}
}
)
] });
}
;// external ["wp","url"]
const external_wp_url_namespaceObject = window["wp"]["url"];
;// ./node_modules/@wordpress/patterns/build-module/components/patterns-manage-button.js
function PatternsManageButton({ clientId }) {
const {
attributes,
canDetach,
isVisible,
managePatternsUrl,
isSyncedPattern,
isUnsyncedPattern
} = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { canRemoveBlock, getBlock } = select(external_wp_blockEditor_namespaceObject.store);
const { canUser } = select(external_wp_coreData_namespaceObject.store);
const block = getBlock(clientId);
const _isUnsyncedPattern = window?.__experimentalContentOnlyPatternInsertion && !!block?.attributes?.metadata?.patternName;
const _isSyncedPattern = !!block && (0,external_wp_blocks_namespaceObject.isReusableBlock)(block) && !!canUser("update", {
kind: "postType",
name: "wp_block",
id: block.attributes.ref
});
return {
attributes: block.attributes,
// For unsynced patterns, detaching is simply removing the `patternName` attribute.
// For synced patterns, the `core:block` block is replaced with its inner blocks,
// so checking whether `canRemoveBlock` is possible is required.
canDetach: _isUnsyncedPattern || _isSyncedPattern && canRemoveBlock(clientId),
isUnsyncedPattern: _isUnsyncedPattern,
isSyncedPattern: _isSyncedPattern,
isVisible: _isUnsyncedPattern || _isSyncedPattern,
// The site editor and templates both check whether the user
// has edit_theme_options capabilities. We can leverage that here
// and omit the manage patterns link if the user can't access it.
managePatternsUrl: canUser("create", {
kind: "postType",
name: "wp_template"
}) ? (0,external_wp_url_namespaceObject.addQueryArgs)("site-editor.php", {
p: "/pattern"
}) : (0,external_wp_url_namespaceObject.addQueryArgs)("edit.php", {
post_type: "wp_block"
})
};
},
[clientId]
);
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const { convertSyncedPatternToStatic } = unlock(
(0,external_wp_data_namespaceObject.useDispatch)(store)
);
if (!isVisible) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
canDetach && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItem,
{
onClick: () => {
if (isSyncedPattern) {
convertSyncedPatternToStatic(clientId);
}
if (isUnsyncedPattern) {
const {
patternName,
...attributesWithoutPatternName
} = attributes?.metadata ?? {};
updateBlockAttributes(clientId, {
metadata: attributesWithoutPatternName
});
}
},
children: (0,external_wp_i18n_namespaceObject.__)("Detach")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { href: managePatternsUrl, children: (0,external_wp_i18n_namespaceObject.__)("Manage patterns") })
] });
}
var patterns_manage_button_default = PatternsManageButton;
;// ./node_modules/@wordpress/patterns/build-module/components/index.js
function PatternsMenuItems({ rootClientId }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, { children: ({ selectedClientIds, onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PatternConvertButton,
{
clientIds: selectedClientIds,
rootClientId,
closeBlockSettingsMenu: onClose
}
),
selectedClientIds.length === 1 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
patterns_manage_button_default,
{
clientId: selectedClientIds[0]
}
)
] }) });
}
;// external ["wp","a11y"]
const external_wp_a11y_namespaceObject = window["wp"]["a11y"];
;// ./node_modules/@wordpress/patterns/build-module/components/rename-pattern-category-modal.js
function RenamePatternCategoryModal({
category,
existingCategories,
onClose,
onError,
onSuccess,
...props
}) {
const id = (0,external_wp_element_namespaceObject.useId)();
const textControlRef = (0,external_wp_element_namespaceObject.useRef)();
const [name, setName] = (0,external_wp_element_namespaceObject.useState)((0,external_wp_htmlEntities_namespaceObject.decodeEntities)(category.name));
const [isSaving, setIsSaving] = (0,external_wp_element_namespaceObject.useState)(false);
const [validationMessage, setValidationMessage] = (0,external_wp_element_namespaceObject.useState)(false);
const validationMessageId = validationMessage ? `patterns-rename-pattern-category-modal__validation-message-${id}` : void 0;
const { saveEntityRecord, invalidateResolution } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const { createErrorNotice, createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const onChange = (newName) => {
if (validationMessage) {
setValidationMessage(void 0);
}
setName(newName);
};
const onSave = async (event) => {
event.preventDefault();
if (isSaving) {
return;
}
if (!name || name === category.name) {
const message = (0,external_wp_i18n_namespaceObject.__)("Please enter a new name for this category.");
(0,external_wp_a11y_namespaceObject.speak)(message, "assertive");
setValidationMessage(message);
textControlRef.current?.focus();
return;
}
if (existingCategories.patternCategories.find((existingCategory) => {
return existingCategory.id !== category.id && existingCategory.label.toLowerCase() === name.toLowerCase();
})) {
const message = (0,external_wp_i18n_namespaceObject.__)(
"This category already exists. Please use a different name."
);
(0,external_wp_a11y_namespaceObject.speak)(message, "assertive");
setValidationMessage(message);
textControlRef.current?.focus();
return;
}
try {
setIsSaving(true);
const savedRecord = await saveEntityRecord(
"taxonomy",
CATEGORY_SLUG,
{
id: category.id,
slug: category.slug,
name
}
);
invalidateResolution("getUserPatternCategories");
onSuccess?.(savedRecord);
onClose();
createSuccessNotice((0,external_wp_i18n_namespaceObject.__)("Pattern category renamed."), {
type: "snackbar",
id: "pattern-category-update"
});
} catch (error) {
onError?.();
createErrorNotice(error.message, {
type: "snackbar",
id: "pattern-category-update"
});
} finally {
setIsSaving(false);
setName("");
}
};
const onRequestClose = () => {
onClose();
setName("");
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
title: (0,external_wp_i18n_namespaceObject.__)("Rename"),
onRequestClose,
...props,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: onSave, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "2", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
ref: textControlRef,
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Name"),
value: name,
onChange,
"aria-describedby": validationMessageId,
required: true
}
),
validationMessage && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: "patterns-rename-pattern-category-modal__validation-message",
id: validationMessageId,
children: validationMessage
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: onRequestClose,
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "primary",
type: "submit",
"aria-disabled": !name || name === category.name || isSaving,
isBusy: isSaving,
children: (0,external_wp_i18n_namespaceObject.__)("Save")
}
)
] })
] }) })
}
);
}
;// ./node_modules/@wordpress/patterns/build-module/components/allow-overrides-modal.js
function AllowOverridesModal({
placeholder,
initialName = "",
onClose,
onSave
}) {
const [editedBlockName, setEditedBlockName] = (0,external_wp_element_namespaceObject.useState)(initialName);
const descriptionId = (0,external_wp_element_namespaceObject.useId)();
const isNameValid = !!editedBlockName.trim();
const handleSubmit = () => {
if (editedBlockName !== initialName) {
const message = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: new name/label for the block */
(0,external_wp_i18n_namespaceObject.__)('Block name changed to: "%s".'),
editedBlockName
);
(0,external_wp_a11y_namespaceObject.speak)(message, "assertive");
}
onSave(editedBlockName);
onClose();
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
title: (0,external_wp_i18n_namespaceObject.__)("Enable overrides"),
onRequestClose: onClose,
focusOnMount: "firstContentElement",
aria: { describedby: descriptionId },
size: "small",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"form",
{
onSubmit: (event) => {
event.preventDefault();
if (!isNameValid) {
return;
}
handleSubmit();
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "6", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { id: descriptionId, children: (0,external_wp_i18n_namespaceObject.__)(
"Overrides are changes you make to a block within a synced pattern instance. Use overrides to customize a synced pattern instance to suit its new context. Name this block to specify an override."
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
value: editedBlockName,
label: (0,external_wp_i18n_namespaceObject.__)("Name"),
help: (0,external_wp_i18n_namespaceObject.__)(
'For example, if you are creating a recipe pattern, you use "Recipe Title", "Recipe Description", etc.'
),
placeholder,
onChange: setEditedBlockName
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: onClose,
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
"aria-disabled": !isNameValid,
variant: "primary",
type: "submit",
children: (0,external_wp_i18n_namespaceObject.__)("Enable")
}
)
] })
] })
}
)
}
);
}
function DisallowOverridesModal({ onClose, onSave }) {
const descriptionId = (0,external_wp_element_namespaceObject.useId)();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Modal,
{
title: (0,external_wp_i18n_namespaceObject.__)("Disable overrides"),
onRequestClose: onClose,
aria: { describedby: descriptionId },
size: "small",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"form",
{
onSubmit: (event) => {
event.preventDefault();
onSave();
onClose();
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "6", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { id: descriptionId, children: (0,external_wp_i18n_namespaceObject.__)(
"Are you sure you want to disable overrides? Disabling overrides will revert all applied overrides for this block throughout instances of this pattern."
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: onClose,
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "primary",
type: "submit",
children: (0,external_wp_i18n_namespaceObject.__)("Disable")
}
)
] })
] })
}
)
}
);
}
;// ./node_modules/@wordpress/patterns/build-module/components/pattern-overrides-controls.js
function PatternOverridesControls({
attributes,
setAttributes,
name: blockName
}) {
const controlId = (0,external_wp_element_namespaceObject.useId)();
const [showAllowOverridesModal, setShowAllowOverridesModal] = (0,external_wp_element_namespaceObject.useState)(false);
const [showDisallowOverridesModal, setShowDisallowOverridesModal] = (0,external_wp_element_namespaceObject.useState)(false);
const hasName = !!attributes.metadata?.name;
const defaultBindings = attributes.metadata?.bindings?.__default;
const hasOverrides = hasName && defaultBindings?.source === PATTERN_OVERRIDES_BINDING_SOURCE;
const isConnectedToOtherSources = defaultBindings?.source && defaultBindings.source !== PATTERN_OVERRIDES_BINDING_SOURCE;
const { updateBlockBindings } = (0,external_wp_blockEditor_namespaceObject.useBlockBindingsUtils)();
function updateBindings(isChecked, customName) {
if (customName) {
setAttributes({
metadata: {
...attributes.metadata,
name: customName
}
});
}
updateBlockBindings({
__default: isChecked ? { source: PATTERN_OVERRIDES_BINDING_SOURCE } : void 0
});
}
if (isConnectedToOtherSources) {
return null;
}
const hasUnsupportedImageAttributes = blockName === "core/image" && !!attributes.href?.length;
const helpText = !hasOverrides && hasUnsupportedImageAttributes ? (0,external_wp_i18n_namespaceObject.__)(
`Overrides currently don't support image links. Remove the link first before enabling overrides.`
) : (0,external_wp_i18n_namespaceObject.__)(
"Allow changes to this block throughout instances of this pattern."
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.BaseControl,
{
__nextHasNoMarginBottom: true,
id: controlId,
label: (0,external_wp_i18n_namespaceObject.__)("Overrides"),
help: helpText,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
className: "pattern-overrides-control__allow-overrides-button",
variant: "secondary",
"aria-haspopup": "dialog",
onClick: () => {
if (hasOverrides) {
setShowDisallowOverridesModal(true);
} else {
setShowAllowOverridesModal(true);
}
},
disabled: !hasOverrides && hasUnsupportedImageAttributes,
accessibleWhenDisabled: true,
children: hasOverrides ? (0,external_wp_i18n_namespaceObject.__)("Disable overrides") : (0,external_wp_i18n_namespaceObject.__)("Enable overrides")
}
)
}
) }),
showAllowOverridesModal && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
AllowOverridesModal,
{
initialName: attributes.metadata?.name,
onClose: () => setShowAllowOverridesModal(false),
onSave: (newName) => {
updateBindings(true, newName);
}
}
),
showDisallowOverridesModal && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
DisallowOverridesModal,
{
onClose: () => setShowDisallowOverridesModal(false),
onSave: () => updateBindings(false)
}
)
] });
}
var pattern_overrides_controls_default = PatternOverridesControls;
;// ./node_modules/@wordpress/patterns/build-module/components/reset-overrides-control.js
const CONTENT = "content";
function ResetOverridesControl(props) {
const name = props.attributes.metadata?.name;
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const isOverridden = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
if (!name) {
return;
}
const { getBlockAttributes, getBlockParentsByBlockName } = select(external_wp_blockEditor_namespaceObject.store);
const [patternClientId] = getBlockParentsByBlockName(
props.clientId,
"core/block",
true
);
if (!patternClientId) {
return;
}
const overrides = getBlockAttributes(patternClientId)[CONTENT];
if (!overrides) {
return;
}
return overrides.hasOwnProperty(name);
},
[props.clientId, name]
);
function onClick() {
const { getBlockAttributes, getBlockParentsByBlockName } = registry.select(external_wp_blockEditor_namespaceObject.store);
const [patternClientId] = getBlockParentsByBlockName(
props.clientId,
"core/block",
true
);
if (!patternClientId) {
return;
}
const overrides = getBlockAttributes(patternClientId)[CONTENT];
if (!overrides.hasOwnProperty(name)) {
return;
}
const { updateBlockAttributes, __unstableMarkLastChangeAsPersistent } = registry.dispatch(external_wp_blockEditor_namespaceObject.store);
__unstableMarkLastChangeAsPersistent();
let newOverrides = { ...overrides };
delete newOverrides[name];
if (!Object.keys(newOverrides).length) {
newOverrides = void 0;
}
updateBlockAttributes(patternClientId, {
[CONTENT]: newOverrides
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableBlockToolbarLastItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick, disabled: !isOverridden, children: (0,external_wp_i18n_namespaceObject.__)("Reset") }) }) });
}
;// ./node_modules/@wordpress/icons/build-module/library/copy.js
var copy_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"
}
) });
;// ./node_modules/@wordpress/patterns/build-module/components/pattern-overrides-block-controls.js
const { useBlockDisplayTitle } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function PatternOverridesToolbarIndicator({ clientIds }) {
const isSingleBlockSelected = clientIds.length === 1;
const { icon, firstBlockName } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockAttributes, getBlockNamesByClientId } = select(external_wp_blockEditor_namespaceObject.store);
const { getBlockType, getActiveBlockVariation } = select(external_wp_blocks_namespaceObject.store);
const blockTypeNames = getBlockNamesByClientId(clientIds);
const _firstBlockTypeName = blockTypeNames[0];
const firstBlockType = getBlockType(_firstBlockTypeName);
let _icon;
if (isSingleBlockSelected) {
const match = getActiveBlockVariation(
_firstBlockTypeName,
getBlockAttributes(clientIds[0])
);
_icon = match?.icon || firstBlockType.icon;
} else {
const isSelectionOfSameType = new Set(blockTypeNames).size === 1;
_icon = isSelectionOfSameType ? firstBlockType.icon : copy_default;
}
return {
icon: _icon,
firstBlockName: getBlockAttributes(clientIds[0]).metadata.name
};
},
[clientIds, isSingleBlockSelected]
);
const firstBlockTitle = useBlockDisplayTitle({
clientId: clientIds[0],
maximumLength: 35
});
const blockDescription = isSingleBlockSelected ? (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: The block type's name. 2: The block's user-provided name (the same as the override name). */
(0,external_wp_i18n_namespaceObject.__)('This %1$s is editable using the "%2$s" override.'),
firstBlockTitle.toLowerCase(),
firstBlockName
) : (0,external_wp_i18n_namespaceObject.__)("These blocks are editable using overrides.");
const descriptionId = (0,external_wp_element_namespaceObject.useId)();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { children: (toggleProps) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropdownMenu,
{
className: "patterns-pattern-overrides-toolbar-indicator",
label: firstBlockTitle,
popoverProps: {
placement: "bottom-start",
className: "patterns-pattern-overrides-toolbar-indicator__popover"
},
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.BlockIcon,
{
icon,
className: "patterns-pattern-overrides-toolbar-indicator-icon",
showColors: true
}
) }),
toggleProps: {
description: blockDescription,
...toggleProps
},
menuProps: {
orientation: "both",
"aria-describedby": descriptionId
},
children: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { id: descriptionId, children: blockDescription })
}
) });
}
function PatternOverridesBlockControls() {
const { clientIds, hasPatternOverrides, hasParentPattern } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getBlockAttributes,
getSelectedBlockClientIds,
getBlockParentsByBlockName
} = select(external_wp_blockEditor_namespaceObject.store);
const selectedClientIds = getSelectedBlockClientIds();
const _hasPatternOverrides = selectedClientIds.every(
(clientId) => Object.values(
getBlockAttributes(clientId)?.metadata?.bindings ?? {}
).some(
(binding) => binding?.source === PATTERN_OVERRIDES_BINDING_SOURCE
)
);
const _hasParentPattern = selectedClientIds.every(
(clientId) => getBlockParentsByBlockName(clientId, "core/block", true).length > 0
);
return {
clientIds: selectedClientIds,
hasPatternOverrides: _hasPatternOverrides,
hasParentPattern: _hasParentPattern
};
},
[]
);
return hasPatternOverrides && hasParentPattern ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "parent", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternOverridesToolbarIndicator, { clientIds }) }) : null;
}
;// ./node_modules/@wordpress/patterns/build-module/private-apis.js
const privateApis = {};
lock(privateApis, {
OverridesPanel: OverridesPanel,
CreatePatternModal: CreatePatternModal,
CreatePatternModalContents: CreatePatternModalContents,
DuplicatePatternModal: DuplicatePatternModal,
isOverridableBlock: isOverridableBlock,
hasOverridableBlocks: hasOverridableBlocks,
useDuplicatePatternProps: useDuplicatePatternProps,
RenamePatternModal: RenamePatternModal,
PatternsMenuItems: PatternsMenuItems,
RenamePatternCategoryModal: RenamePatternCategoryModal,
PatternOverridesControls: pattern_overrides_controls_default,
ResetOverridesControl: ResetOverridesControl,
PatternOverridesBlockControls: PatternOverridesBlockControls,
useAddPatternCategory: useAddPatternCategory,
PATTERN_TYPES: PATTERN_TYPES,
PATTERN_DEFAULT_CATEGORY: PATTERN_DEFAULT_CATEGORY,
PATTERN_USER_CATEGORY: PATTERN_USER_CATEGORY,
EXCLUDED_PATTERN_SOURCES: EXCLUDED_PATTERN_SOURCES,
PATTERN_SYNC_TYPES: PATTERN_SYNC_TYPES,
PARTIAL_SYNCING_SUPPORTED_BLOCKS: PARTIAL_SYNCING_SUPPORTED_BLOCKS
});
;// ./node_modules/@wordpress/patterns/build-module/index.js
(window.wp = window.wp || {}).patterns = __webpack_exports__;
/******/ })()
; keycodes.min.js 0000644 00000005010 15121363551 0007470 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ALT:()=>S,BACKSPACE:()=>n,COMMAND:()=>A,CTRL:()=>E,DELETE:()=>m,DOWN:()=>C,END:()=>f,ENTER:()=>l,ESCAPE:()=>a,F10:()=>w,HOME:()=>u,LEFT:()=>p,PAGEDOWN:()=>d,PAGEUP:()=>s,RIGHT:()=>h,SHIFT:()=>O,SPACE:()=>c,TAB:()=>i,UP:()=>y,ZERO:()=>P,displayShortcut:()=>j,displayShortcutList:()=>_,isAppleOS:()=>o,isKeyboardEvent:()=>v,modifiers:()=>T,rawShortcut:()=>L,shortcutAriaLabel:()=>k});const r=window.wp.i18n;function o(e){if(!e){if("undefined"==typeof window)return!1;e=window}const{platform:t}=e.navigator;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}const n=8,i=9,l=13,a=27,c=32,s=33,d=34,f=35,u=36,p=37,y=38,h=39,C=40,m=46,w=121,S="alt",E="ctrl",A="meta",O="shift",P=48;function b(e){return e.length<2?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)}function g(e,t){return Object.fromEntries(Object.entries(e).map((([e,r])=>[e,t(r)])))}const T={primary:e=>e()?[A]:[E],primaryShift:e=>e()?[O,A]:[E,O],primaryAlt:e=>e()?[S,A]:[E,S],secondary:e=>e()?[O,S,A]:[E,O,S],access:e=>e()?[E,S]:[O,S],ctrl:()=>[E],alt:()=>[S],ctrlShift:()=>[E,O],shift:()=>[O],shiftAlt:()=>[O,S],undefined:()=>[]},L=g(T,(e=>(t,r=o)=>[...e(r),t.toLowerCase()].join("+"))),_=g(T,(e=>(t,r=o)=>{const n=r(),i={[S]:n?"⌥":"Alt",[E]:n?"⌃":"Ctrl",[A]:"⌘",[O]:n?"⇧":"Shift"};return[...e(r).reduce(((e,t)=>{const r=i[t]??t;return n?[...e,r]:[...e,r,"+"]}),[]),b(t)]})),j=g(_,(e=>(t,r=o)=>e(t,r).join(""))),k=g(T,(e=>(t,n=o)=>{const i=n(),l={[O]:"Shift",[A]:i?"Command":"Control",[E]:"Control",[S]:i?"Option":"Alt",",":(0,r.__)("Comma"),".":(0,r.__)("Period"),"`":(0,r.__)("Backtick"),"~":(0,r.__)("Tilde")};return[...e(n),t].map((e=>b(l[e]??e))).join(i?" ":" + ")}));const v=g(T,(e=>(t,r,n=o)=>{const i=e(n),l=function(e){return[S,E,A,O].filter((t=>e[`${t}Key`]))}(t),a={Comma:",",Backslash:"\\",IntlRo:"\\",IntlYen:"\\"},c=i.filter((e=>!l.includes(e))),s=l.filter((e=>!i.includes(e)));if(c.length>0||s.length>0)return!1;let d=t.key.toLowerCase();return r?(t.altKey&&1===r.length&&(d=String.fromCharCode(t.keyCode).toLowerCase()),t.shiftKey&&1===r.length&&a[t.code]&&(d=a[t.code]),"del"===r&&(r="delete"),d===r.toLowerCase()):i.includes(d)}));(window.wp=window.wp||{}).keycodes=t})(); edit-post.min.js 0000644 00000125301 15121363551 0007600 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var o in s)e.o(s,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:s[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{PluginBlockSettingsMenuItem:()=>Gt,PluginDocumentSettingPanel:()=>Ht,PluginMoreMenuItem:()=>Ut,PluginPostPublishPanel:()=>Wt,PluginPostStatusInfo:()=>Qt,PluginPrePublishPanel:()=>qt,PluginSidebar:()=>Xt,PluginSidebarMoreMenuItem:()=>Zt,__experimentalFullscreenModeClose:()=>D,__experimentalMainDashboardButton:()=>Yt,__experimentalPluginPostExcerpt:()=>$t,initializeEditor:()=>Jt,reinitializeEditor:()=>es,store:()=>ot});var s={};e.r(s),e.d(s,{__experimentalSetPreviewDeviceType:()=>_e,__unstableCreateTemplate:()=>ve,closeGeneralSidebar:()=>K,closeModal:()=>ee,closePublishSidebar:()=>se,hideBlockTypes:()=>ue,initializeMetaBoxes:()=>Se,metaBoxUpdatesFailure:()=>we,metaBoxUpdatesSuccess:()=>he,openGeneralSidebar:()=>Y,openModal:()=>J,openPublishSidebar:()=>te,removeEditorPanel:()=>ne,requestMetaBoxUpdates:()=>me,setAvailableMetaBoxesPerLocation:()=>ge,setIsEditingTemplate:()=>ye,setIsInserterOpened:()=>fe,setIsListViewOpened:()=>xe,showBlockTypes:()=>pe,switchEditorMode:()=>ce,toggleDistractionFree:()=>Pe,toggleEditorPanelEnabled:()=>ie,toggleEditorPanelOpened:()=>re,toggleFeature:()=>ae,toggleFullscreenMode:()=>Ee,togglePinnedPluginItem:()=>le,togglePublishSidebar:()=>oe,updatePreferredStyleVariations:()=>de});var o={};e.r(o),e.d(o,{__experimentalGetInsertionPoint:()=>Ke,__experimentalGetPreviewDeviceType:()=>$e,areMetaBoxesInitialized:()=>tt,getActiveGeneralSidebarName:()=>Ae,getActiveMetaBoxLocations:()=>He,getAllMetaBoxes:()=>Qe,getEditedPostTemplate:()=>st,getEditorMode:()=>ke,getHiddenBlockTypes:()=>De,getMetaBoxesPerLocation:()=>We,getPreference:()=>Ce,getPreferences:()=>Re,hasMetaBoxes:()=>Xe,isEditingTemplate:()=>et,isEditorPanelEnabled:()=>Le,isEditorPanelOpened:()=>Fe,isEditorPanelRemoved:()=>Ne,isEditorSidebarOpened:()=>Be,isFeatureActive:()=>ze,isInserterOpened:()=>Ye,isListViewOpened:()=>Je,isMetaBoxLocationActive:()=>qe,isMetaBoxLocationVisible:()=>Ue,isModalActive:()=>Ve,isPluginItemPinned:()=>Ge,isPluginSidebarOpened:()=>Ie,isPublishSidebarOpened:()=>Oe,isSavingMetaBoxes:()=>Ze});const i=window.ReactJSXRuntime,r=window.wp.blocks,n=window.wp.blockLibrary,a=window.wp.deprecated;var c=e.n(a);const l=window.wp.element,d=window.wp.data,p=window.wp.preferences,u=window.wp.widgets,g=window.wp.editor;function m(e){var t,s,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(s=m(e[t]))&&(o&&(o+=" "),o+=s)}else for(s in e)e[s]&&(o&&(o+=" "),o+=s);return o}const h=function(){for(var e,t,s=0,o="",i=arguments.length;s<i;s++)(e=arguments[s])&&(t=m(e))&&(o&&(o+=" "),o+=t);return o},w=(0,l.forwardRef)((({children:e,className:t,ariaLabel:s,as:o="div",...r},n)=>(0,i.jsx)(o,{ref:n,className:h("admin-ui-navigable-region",t),"aria-label":s,role:"region",tabIndex:"-1",...r,children:e})));w.displayName="NavigableRegion";var _=w;const f=window.wp.blockEditor,x=window.wp.plugins,y=window.wp.i18n,v=window.wp.primitives;var b=(0,i.jsx)(v.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(v.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})}),S=(0,i.jsx)(v.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(v.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})});const P=window.wp.notices,E=window.wp.commands,M=window.wp.url,j=window.wp.htmlEntities,T=window.wp.coreData,k=window.wp.components,B=window.wp.compose;var I=(0,i.jsx)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,i.jsx)(v.Path,{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"})}),A=(0,i.jsx)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(v.Path,{d:"M14 6H6v8h1.5V8.5L17 18l1-1-9.5-9.5H14V6Z"})});const R={edit:{clipPath:"inset(0% round 0px)"},hover:{clipPath:"inset( 22% round 2px )"},tap:{clipPath:"inset(0% round 0px)"}},C={edit:{opacity:0,scale:.2},hover:{opacity:1,scale:1,clipPath:"inset( 22% round 2px )"}};var D=function({showTooltip:e,icon:t,href:s,initialPost:o}){const{isRequestingSiteIcon:r,postType:n,siteIconUrl:a}=(0,d.useSelect)((e=>{const{getCurrentPostType:t}=e(g.store),{getEntityRecord:s,getPostType:i,isResolving:r}=e(T.store),n=s("root","__unstableBase",void 0)||{},a=o?.type||t();return{isRequestingSiteIcon:r("getEntityRecord",["root","__unstableBase",void 0]),postType:i(a),siteIconUrl:n.site_icon_url}}),[o?.type]),c=(0,B.useReducedMotion)(),l={duration:c?0:.2};if(!n)return null;let p;p=r&&!a?(0,i.jsx)("div",{className:"edit-post-fullscreen-mode-close-site-icon__image"}):a?(0,i.jsx)("img",{className:"edit-post-fullscreen-mode-close-site-icon__image",alt:(0,y.__)("Site Icon"),src:a}):(0,i.jsx)(k.Icon,{className:"edit-post-fullscreen-mode-close-site-icon__icon",icon:I,size:48});const u=t?(0,i.jsx)(k.Icon,{size:"36px",icon:t}):(0,i.jsx)("div",{className:"edit-post-fullscreen-mode-close-site-icon",children:p}),m=h("edit-post-fullscreen-mode-close",{"has-icon":a}),w=s??(0,M.addQueryArgs)("edit.php",{post_type:n.slug}),_=n?.labels?.view_items??(0,y.__)("Back");return(0,i.jsxs)(k.__unstableMotion.div,{className:"edit-post-fullscreen-mode-close__view-mode-toggle",animate:"edit",initial:"edit",whileHover:"hover",whileTap:"tap",transition:l,children:[(0,i.jsx)(k.Button,{__next40pxDefaultSize:!0,className:m,href:w,label:_,showTooltip:e,tooltipPosition:"middle right",children:(0,i.jsx)(k.__unstableMotion.div,{variants:!c&&R,children:(0,i.jsx)("div",{className:"edit-post-fullscreen-mode-close__view-mode-toggle-icon",children:u})})}),(0,i.jsx)(k.__unstableMotion.div,{className:h("edit-post-fullscreen-mode-close__back-icon",{"has-site-icon":a}),variants:!c&&C,children:(0,i.jsx)(k.Icon,{icon:A})})]})};const O=window.wp.privateApis,{lock:N,unlock:L}=(0,O.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/edit-post"),{BackButton:F}=L(g.privateApis),V={hidden:{x:"-100%"},distractionFreeInactive:{x:0},hover:{x:0,transition:{type:"tween",delay:.2}}};var z=function({initialPost:e}){return(0,i.jsx)(F,{children:({length:t})=>t<=1&&(0,i.jsx)(k.__unstableMotion.div,{variants:V,transition:{type:"tween",delay:.8},children:(0,i.jsx)(D,{showTooltip:!0,initialPost:e})})})};function G(){return(()=>{const{isViewable:e,newPermalink:t}=(0,d.useSelect)((e=>{const{getPostType:t}=e(T.store),{getCurrentPost:s,getEditedPostAttribute:o}=e(g.store),i=t(o("type"));return{isViewable:i?.viewable,newPermalink:s().link}}),[]),s=(0,l.useRef)();(0,l.useEffect)((()=>{s.current=document.querySelector("#wp-admin-bar-preview a")||document.querySelector("#wp-admin-bar-view a")}),[]),(0,l.useEffect)((()=>{t&&s.current&&(e?(s.current.style.display="",s.current.setAttribute("href",t)):s.current.style.display="none")}),[t,e])})(),null}const H=window.wp.keyboardShortcuts;function U(e=[],t){const s=[...e];for(const e of t){const t=s.findIndex((t=>t.id===e.id));-1!==t?s[t]=e:s.push(e)}return s}const q=(0,d.combineReducers)({isSaving:function(e=!1,t){switch(t.type){case"REQUEST_META_BOX_UPDATES":return!0;case"META_BOX_UPDATES_SUCCESS":case"META_BOX_UPDATES_FAILURE":return!1;default:return e}},locations:function(e={},t){if("SET_META_BOXES_PER_LOCATIONS"===t.type){const s={...e};for(const[e,o]of Object.entries(t.metaBoxesPerLocation))s[e]=U(s[e],o);return s}return e},initialized:function(e=!1,t){return"META_BOXES_INITIALIZED"===t.type||e}});var W=(0,d.combineReducers)({metaBoxes:q});const Q=window.wp.apiFetch;var X=e.n(Q);const Z=window.wp.hooks,{interfaceStore:$}=L(g.privateApis),Y=e=>({registry:t})=>{t.dispatch($).enableComplementaryArea("core",e)},K=()=>({registry:e})=>e.dispatch($).disableComplementaryArea("core"),J=e=>({registry:t})=>(c()("select( 'core/edit-post' ).openModal( name )",{since:"6.3",alternative:"select( 'core/interface').openModal( name )"}),t.dispatch($).openModal(e)),ee=()=>({registry:e})=>(c()("select( 'core/edit-post' ).closeModal()",{since:"6.3",alternative:"select( 'core/interface').closeModal()"}),e.dispatch($).closeModal()),te=()=>({registry:e})=>{c()("dispatch( 'core/edit-post' ).openPublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').openPublishSidebar"}),e.dispatch(g.store).openPublishSidebar()},se=()=>({registry:e})=>{c()("dispatch( 'core/edit-post' ).closePublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').closePublishSidebar"}),e.dispatch(g.store).closePublishSidebar()},oe=()=>({registry:e})=>{c()("dispatch( 'core/edit-post' ).togglePublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').togglePublishSidebar"}),e.dispatch(g.store).togglePublishSidebar()},ie=e=>({registry:t})=>{c()("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelEnabled"}),t.dispatch(g.store).toggleEditorPanelEnabled(e)},re=e=>({registry:t})=>{c()("dispatch( 'core/edit-post' ).toggleEditorPanelOpened",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelOpened"}),t.dispatch(g.store).toggleEditorPanelOpened(e)},ne=e=>({registry:t})=>{c()("dispatch( 'core/edit-post' ).removeEditorPanel",{since:"6.5",alternative:"dispatch( 'core/editor').removeEditorPanel"}),t.dispatch(g.store).removeEditorPanel(e)},ae=e=>({registry:t})=>t.dispatch(p.store).toggle("core/edit-post",e),ce=e=>({registry:t})=>{c()("dispatch( 'core/edit-post' ).switchEditorMode",{since:"6.6",alternative:"dispatch( 'core/editor').switchEditorMode"}),t.dispatch(g.store).switchEditorMode(e)},le=e=>({registry:t})=>{const s=t.select($).isItemPinned("core",e);t.dispatch($)[s?"unpinItem":"pinItem"]("core",e)};function de(){return c()("dispatch( 'core/edit-post' ).updatePreferredStyleVariations",{since:"6.6",hint:"Preferred Style Variations are not supported anymore."}),{type:"NOTHING"}}const pe=e=>({registry:t})=>{L(t.dispatch(g.store)).showBlockTypes(e)},ue=e=>({registry:t})=>{L(t.dispatch(g.store)).hideBlockTypes(e)};function ge(e){return{type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e}}const me=()=>async({registry:e,select:t,dispatch:s})=>{s({type:"REQUEST_META_BOX_UPDATES"}),window.tinyMCE&&window.tinyMCE.triggerSave();const o=new window.FormData(document.querySelector(".metabox-base-form")),i=o.get("post_ID"),r=o.get("post_type"),n=e.select(T.store).getEditedEntityRecord("postType",r,i),a=[!!n.comment_status&&["comment_status",n.comment_status],!!n.ping_status&&["ping_status",n.ping_status],!!n.sticky&&["sticky",n.sticky],!!n.author&&["post_author",n.author]].filter(Boolean),c=[o,...t.getActiveMetaBoxLocations().map((e=>new window.FormData((e=>{const t=document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`);return t||document.querySelector("#metaboxes .metabox-location-"+e)})(e))))].reduce(((e,t)=>{for(const[s,o]of t)e.append(s,o);return e}),new window.FormData);a.forEach((([e,t])=>c.append(e,t)));try{await X()({url:window._wpMetaBoxUrl,method:"POST",body:c,parse:!1}),s.metaBoxUpdatesSuccess()}catch{s.metaBoxUpdatesFailure()}};function he(){return{type:"META_BOX_UPDATES_SUCCESS"}}function we(){return{type:"META_BOX_UPDATES_FAILURE"}}const _e=e=>({registry:t})=>{c()("dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType",{since:"6.5",version:"6.7",hint:"registry.dispatch( editorStore ).setDeviceType"}),t.dispatch(g.store).setDeviceType(e)},fe=e=>({registry:t})=>{c()("dispatch( 'core/edit-post' ).setIsInserterOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsInserterOpened"}),t.dispatch(g.store).setIsInserterOpened(e)},xe=e=>({registry:t})=>{c()("dispatch( 'core/edit-post' ).setIsListViewOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsListViewOpened"}),t.dispatch(g.store).setIsListViewOpened(e)};function ye(){return c()("dispatch( 'core/edit-post' ).setIsEditingTemplate",{since:"6.5",alternative:"dispatch( 'core/editor').setRenderingMode"}),{type:"NOTHING"}}function ve(){return c()("dispatch( 'core/edit-post' ).__unstableCreateTemplate",{since:"6.5"}),{type:"NOTHING"}}let be=!1;const Se=()=>({registry:e,select:t,dispatch:s})=>{if(!e.select(g.store).__unstableIsEditorReady())return;if(be)return;const o=e.select(g.store).getCurrentPostType();window.postboxes.page!==o&&window.postboxes.add_postbox_toggles(o),be=!0,(0,Z.addAction)("editor.savePost","core/edit-post/save-metaboxes",(async(e,o)=>{!o.isAutosave&&t.hasMetaBoxes()&&await s.requestMetaBoxUpdates()})),s({type:"META_BOXES_INITIALIZED"})},Pe=()=>({registry:e})=>{c()("dispatch( 'core/edit-post' ).toggleDistractionFree",{since:"6.6",alternative:"dispatch( 'core/editor').toggleDistractionFree"}),e.dispatch(g.store).toggleDistractionFree()},Ee=()=>({registry:e})=>{const t=e.select(p.store).get("core/edit-post","fullscreenMode");e.dispatch(p.store).toggle("core/edit-post","fullscreenMode"),e.dispatch(P.store).createInfoNotice(t?(0,y.__)("Fullscreen mode deactivated."):(0,y.__)("Fullscreen mode activated."),{id:"core/edit-post/toggle-fullscreen-mode/notice",type:"snackbar",actions:[{label:(0,y.__)("Undo"),onClick:()=>{e.dispatch(p.store).toggle("core/edit-post","fullscreenMode")}}]})},{interfaceStore:Me}=L(g.privateApis),je=[],Te={},ke=(0,d.createRegistrySelector)((e=>()=>e(p.store).get("core","editorMode")??"visual")),Be=(0,d.createRegistrySelector)((e=>()=>{const t=e(Me).getActiveComplementaryArea("core");return["edit-post/document","edit-post/block"].includes(t)})),Ie=(0,d.createRegistrySelector)((e=>()=>{const t=e(Me).getActiveComplementaryArea("core");return!!t&&!["edit-post/document","edit-post/block"].includes(t)})),Ae=(0,d.createRegistrySelector)((e=>()=>e(Me).getActiveComplementaryArea("core")));const Re=(0,d.createRegistrySelector)((e=>()=>{c()("select( 'core/edit-post' ).getPreferences",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const t=["editorMode","hiddenBlockTypes"].reduce(((t,s)=>{const o=e(p.store).get("core",s);return{...t,[s]:o}}),{}),s=function(e,t){const s=e?.reduce(((e,t)=>({...e,[t]:{enabled:!1}})),{}),o=t?.reduce(((e,t)=>{const s=e?.[t];return{...e,[t]:{...s,opened:!0}}}),s??{});return o??s??Te}(e(p.store).get("core","inactivePanels"),e(p.store).get("core","openPanels"));return{...t,panels:s}}));function Ce(e,t,s){c()("select( 'core/edit-post' ).getPreference",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const o=Re(e)[t];return void 0===o?s:o}const De=(0,d.createRegistrySelector)((e=>()=>e(p.store).get("core","hiddenBlockTypes")??je)),Oe=(0,d.createRegistrySelector)((e=>()=>(c()("select( 'core/edit-post' ).isPublishSidebarOpened",{since:"6.6",alternative:"select( 'core/editor' ).isPublishSidebarOpened"}),e(g.store).isPublishSidebarOpened()))),Ne=(0,d.createRegistrySelector)((e=>(t,s)=>(c()("select( 'core/edit-post' ).isEditorPanelRemoved",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelRemoved"}),e(g.store).isEditorPanelRemoved(s)))),Le=(0,d.createRegistrySelector)((e=>(t,s)=>(c()("select( 'core/edit-post' ).isEditorPanelEnabled",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelEnabled"}),e(g.store).isEditorPanelEnabled(s)))),Fe=(0,d.createRegistrySelector)((e=>(t,s)=>(c()("select( 'core/edit-post' ).isEditorPanelOpened",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelOpened"}),e(g.store).isEditorPanelOpened(s)))),Ve=(0,d.createRegistrySelector)((e=>(t,s)=>(c()("select( 'core/edit-post' ).isModalActive",{since:"6.3",alternative:"select( 'core/interface' ).isModalActive"}),!!e(Me).isModalActive(s)))),ze=(0,d.createRegistrySelector)((e=>(t,s)=>!!e(p.store).get("core/edit-post",s))),Ge=(0,d.createRegistrySelector)((e=>(t,s)=>e(Me).isItemPinned("core",s))),He=(0,d.createSelector)((e=>Object.keys(e.metaBoxes.locations).filter((t=>qe(e,t)))),(e=>[e.metaBoxes.locations])),Ue=(0,d.createRegistrySelector)((e=>(t,s)=>qe(t,s)&&We(t,s)?.some((({id:t})=>e(g.store).isEditorPanelEnabled(`meta-box-${t}`)))));function qe(e,t){const s=We(e,t);return!!s&&0!==s.length}function We(e,t){return e.metaBoxes.locations[t]}const Qe=(0,d.createSelector)((e=>Object.values(e.metaBoxes.locations).flat()),(e=>[e.metaBoxes.locations]));function Xe(e){return He(e).length>0}function Ze(e){return e.metaBoxes.isSaving}const $e=(0,d.createRegistrySelector)((e=>()=>(c()("select( 'core/edit-site' ).__experimentalGetPreviewDeviceType",{since:"6.5",version:"6.7",alternative:"select( 'core/editor' ).getDeviceType"}),e(g.store).getDeviceType()))),Ye=(0,d.createRegistrySelector)((e=>()=>(c()("select( 'core/edit-post' ).isInserterOpened",{since:"6.5",alternative:"select( 'core/editor' ).isInserterOpened"}),e(g.store).isInserterOpened()))),Ke=(0,d.createRegistrySelector)((e=>()=>(c()("select( 'core/edit-post' ).__experimentalGetInsertionPoint",{since:"6.5",version:"6.7"}),L(e(g.store)).getInserter()))),Je=(0,d.createRegistrySelector)((e=>()=>(c()("select( 'core/edit-post' ).isListViewOpened",{since:"6.5",alternative:"select( 'core/editor' ).isListViewOpened"}),e(g.store).isListViewOpened()))),et=(0,d.createRegistrySelector)((e=>()=>(c()("select( 'core/edit-post' ).isEditingTemplate",{since:"6.5",alternative:"select( 'core/editor' ).getRenderingMode"}),"wp_template"===e(g.store).getCurrentPostType())));function tt(e){return e.metaBoxes.initialized}const st=(0,d.createRegistrySelector)((e=>()=>{const{id:t,type:s}=e(g.store).getCurrentPost(),o=L(e(T.store)).getTemplateId(s,t);if(o)return e(T.store).getEditedEntityRecord("postType","wp_template",o)})),ot=(0,d.createReduxStore)("core/edit-post",{reducer:W,actions:s,selectors:o});(0,d.register)(ot);var it=function(){const{toggleFullscreenMode:e}=(0,d.useDispatch)(ot),{registerShortcut:t}=(0,d.useDispatch)(H.store);return(0,l.useEffect)((()=>{t({name:"core/edit-post/toggle-fullscreen",category:"global",description:(0,y.__)("Enable or disable fullscreen mode."),keyCombination:{modifier:"secondary",character:"f"}})}),[]),(0,H.useShortcut)("core/edit-post/toggle-fullscreen",(()=>{e()})),null};function rt(){const{editPost:e}=(0,d.useDispatch)(g.store),[t,s]=(0,l.useState)(void 0),[o,r]=(0,l.useState)(""),{postType:n,isNewPost:a}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,isCleanNewPost:s}=e(g.store);return{postType:t("type"),isNewPost:s()}}),[]),[c,p]=(0,l.useState)((()=>a&&"wp_block"===n));return"wp_block"===n&&a?(0,i.jsx)(i.Fragment,{children:c&&(0,i.jsx)(k.Modal,{title:(0,y.__)("Create pattern"),onRequestClose:()=>{p(!1)},overlayClassName:"reusable-blocks-menu-items__convert-modal",children:(0,i.jsx)("form",{onSubmit:s=>{s.preventDefault(),p(!1),e({title:o,meta:{wp_pattern_sync_status:t}})},children:(0,i.jsxs)(k.__experimentalVStack,{spacing:"5",children:[(0,i.jsx)(k.TextControl,{label:(0,y.__)("Name"),value:o,onChange:r,placeholder:(0,y.__)("My pattern"),className:"patterns-create-modal__name-input",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,i.jsx)(k.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,y._x)("Synced","pattern (singular)"),help:(0,y.__)("Sync this pattern across multiple locations."),checked:!t,onChange:()=>{s(t?void 0:"unsynced")}}),(0,i.jsx)(k.__experimentalHStack,{justify:"right",children:(0,i.jsx)(k.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:!o,accessibleWhenDisabled:!0,children:(0,y.__)("Create")})})]})})})}):null}function nt(){const[e,t]=(0,l.useState)(null),{postId:s,postStatus:o}=(0,d.useSelect)((e=>{const{getCurrentPost:t}=e(g.store),s=t();let{id:o,status:i,type:r}=s;return["wp_template","wp_template_part"].includes(r)&&(o=s.wp_id),{postId:o,postStatus:i}}),[]);return(0,l.useEffect)((()=>{s&&s!==e&&"auto-draft"!==o&&(window.history.replaceState({id:s},"Post "+s,function(e){return(0,M.addQueryArgs)("post.php",{post:e,action:"edit"})}(s)),t(s))}),[s,o,e]),null}var at=function({location:e}){const t=(0,l.useRef)(null),s=(0,l.useRef)(null);(0,l.useEffect)((()=>(s.current=document.querySelector(".metabox-location-"+e),s.current&&t.current.appendChild(s.current),()=>{s.current&&document.querySelector("#metaboxes").appendChild(s.current)})),[e]);const o=(0,d.useSelect)((e=>e(ot).isSavingMetaBoxes()),[]),r=h("edit-post-meta-boxes-area",`is-${e}`,{"is-loading":o});return(0,i.jsxs)("div",{className:r,children:[o&&(0,i.jsx)(k.Spinner,{}),(0,i.jsx)("div",{className:"edit-post-meta-boxes-area__container",ref:t}),(0,i.jsx)("div",{className:"edit-post-meta-boxes-area__clear"})]})};function ct({id:e}){const t=(0,d.useSelect)((t=>t(g.store).isEditorPanelEnabled(`meta-box-${e}`)),[e]);return(0,l.useEffect)((()=>{const s=document.getElementById(e);s&&(t?s.classList.remove("is-hidden"):s.classList.add("is-hidden"))}),[e,t]),null}function lt({location:e}){const t=(0,d.useSelect)((t=>t(ot).getMetaBoxesPerLocation(e)),[e]);return(0,i.jsxs)(i.Fragment,{children:[(t??[]).map((({id:e})=>(0,i.jsx)(ct,{id:e},e))),(0,i.jsx)(at,{location:e})]})}const dt=window.wp.keycodes;var pt=function(){const e=(0,d.useSelect)((e=>{const{canUser:t}=e(T.store),s=(0,M.addQueryArgs)("edit.php",{post_type:"wp_block"}),o=(0,M.addQueryArgs)("site-editor.php",{p:"/pattern"});return t("create",{kind:"postType",name:"wp_template"})?o:s}),[]);return(0,i.jsx)(k.MenuItem,{role:"menuitem",href:e,children:(0,y.__)("Manage patterns")})};function ut(){const e=(0,d.useSelect)((e=>"wp_template"===e(g.store).getCurrentPostType()),[]);return(0,i.jsx)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:e?"welcomeGuideTemplate":"welcomeGuide",label:(0,y.__)("Welcome Guide")})}const{PreferenceBaseOption:gt}=L(p.privateApis);function mt({willEnable:e}){const[t,s]=(0,l.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{className:"edit-post-preferences-modal__custom-fields-confirmation-message",children:(0,y.__)("A page reload is required for this change. Make sure your content is saved before reloading.")}),(0,i.jsx)(k.Button,{__next40pxDefaultSize:!0,variant:"secondary",isBusy:t,accessibleWhenDisabled:!0,disabled:t,onClick:()=>{s(!0),function(){const e=document.getElementById("toggle-custom-fields-form");e.querySelector('[name="_wp_http_referer"]').setAttribute("value",(0,M.getPathAndQueryString)(window.location.href)),e.submit()}()},children:e?(0,y.__)("Show & Reload Page"):(0,y.__)("Hide & Reload Page")})]})}function ht({label:e}){const t=(0,d.useSelect)((e=>!!e(g.store).getEditorSettings().enableCustomFields),[]),[s,o]=(0,l.useState)(t);return(0,i.jsx)(gt,{label:e,isChecked:s,onChange:o,children:s!==t&&(0,i.jsx)(mt,{willEnable:s})})}const{PreferenceBaseOption:wt}=L(p.privateApis);function _t(e){const{toggleEditorPanelEnabled:t}=(0,d.useDispatch)(g.store),{isChecked:s,isRemoved:o}=(0,d.useSelect)((t=>{const{isEditorPanelEnabled:s,isEditorPanelRemoved:o}=t(g.store);return{isChecked:s(e.panelName),isRemoved:o(e.panelName)}}),[e.panelName]);return o?null:(0,i.jsx)(wt,{isChecked:s,onChange:()=>t(e.panelName),...e})}const{PreferencesModalSection:ft}=L(p.privateApis);var xt=(0,d.withSelect)((e=>{const{getEditorSettings:t}=e(g.store),{getAllMetaBoxes:s}=e(ot);return{areCustomFieldsRegistered:void 0!==t().enableCustomFields,metaBoxes:s()}}))((function({areCustomFieldsRegistered:e,metaBoxes:t,...s}){const o=t.filter((({id:e})=>"postcustom"!==e));return e||0!==o.length?(0,i.jsxs)(ft,{...s,children:[e&&(0,i.jsx)(ht,{label:(0,y.__)("Custom fields")}),o.map((({id:e,title:t})=>(0,i.jsx)(_t,{label:t,panelName:`meta-box-${e}`},e)))]}):null}));const{PreferenceToggleControl:yt}=L(p.privateApis),{PreferencesModal:vt}=L(g.privateApis);function bt(){const e={general:(0,i.jsx)(xt,{title:(0,y.__)("Advanced")}),appearance:(0,i.jsx)(yt,{scope:"core/edit-post",featureName:"themeStyles",help:(0,y.__)("Make the editor look like your theme."),label:(0,y.__)("Use theme styles")})};return(0,i.jsx)(vt,{extraSections:e})}const{ToolsMoreMenuGroup:St,ViewMoreMenuGroup:Pt}=L(g.privateApis);var Et=()=>{const e=(0,B.useViewportMatch)("large");return(0,i.jsxs)(i.Fragment,{children:[e&&(0,i.jsx)(Pt,{children:(0,i.jsx)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fullscreenMode",label:(0,y.__)("Fullscreen mode"),info:(0,y.__)("Show and hide the admin user interface"),messageActivated:(0,y.__)("Fullscreen mode activated."),messageDeactivated:(0,y.__)("Fullscreen mode deactivated."),shortcut:dt.displayShortcut.secondary("f")})}),(0,i.jsxs)(St,{children:[(0,i.jsx)(pt,{}),(0,i.jsx)(ut,{})]}),(0,i.jsx)(bt,{})]})};function Mt({nonAnimatedSrc:e,animatedSrc:t}){return(0,i.jsxs)("picture",{className:"edit-post-welcome-guide__image",children:[(0,i.jsx)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,i.jsx)("img",{src:t,width:"312",height:"240",alt:""})]})}function jt(){const{toggleFeature:e}=(0,d.useDispatch)(ot);return(0,i.jsx)(k.Guide,{className:"edit-post-welcome-guide",contentLabel:(0,y.__)("Welcome to the editor"),finishButtonText:(0,y.__)("Get started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,i.jsx)(Mt,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,y.__)("Welcome to the editor")}),(0,i.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,y.__)("In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.")})]})},{image:(0,i.jsx)(Mt,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,y.__)("Customize each block")}),(0,i.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,y.__)("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.")})]})},{image:(0,i.jsx)(Mt,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,y.__)("Explore all blocks")}),(0,i.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,l.createInterpolateElement)((0,y.__)("All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon."),{InserterIconImage:(0,i.jsx)("img",{alt:(0,y.__)("inserter"),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"})})})]})},{image:(0,i.jsx)(Mt,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,y.__)("Learn more")}),(0,i.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,l.createInterpolateElement)((0,y.__)("New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>"),{a:(0,i.jsx)(k.ExternalLink,{href:(0,y.__)("https://wordpress.org/documentation/article/wordpress-block-editor/")})})})]})}]})}function Tt(){const{toggleFeature:e}=(0,d.useDispatch)(ot);return(0,i.jsx)(k.Guide,{className:"edit-template-welcome-guide",contentLabel:(0,y.__)("Welcome to the template editor"),finishButtonText:(0,y.__)("Get started"),onFinish:()=>e("welcomeGuideTemplate"),pages:[{image:(0,i.jsx)(Mt,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.gif"}),content:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,y.__)("Welcome to the template editor")}),(0,i.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,y.__)("Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.")})]})}]})}function kt({postType:e}){const{isActive:t,isEditingTemplate:s}=(0,d.useSelect)((t=>{const{isFeatureActive:s}=t(ot),o="wp_template"===e;return{isActive:s(o?"welcomeGuideTemplate":"welcomeGuide"),isEditingTemplate:o}}),[e]);return t?s?(0,i.jsx)(Tt,{}):(0,i.jsx)(jt,{}):null}var Bt=(0,i.jsx)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(v.Path,{d:"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"})});const{getLayoutStyles:It}=L(f.privateApis),{useCommandContext:At}=L(E.privateApis),{Editor:Rt,FullscreenMode:Ct}=L(g.privateApis),{BlockKeyboardShortcuts:Dt}=L(n.privateApis),Ot=["wp_template","wp_template_part","wp_block","wp_navigation"];function Nt({isLegacy:e}){const[t,s,o]=(0,d.useSelect)((e=>{const{get:t}=e(p.store),{isMetaBoxLocationVisible:s}=e(ot);return[!!t("core/edit-post","metaBoxesMainIsOpen"),t("core/edit-post","metaBoxesMainOpenHeight"),s("normal")||s("advanced")||s("side")]}),[]),{set:r}=(0,d.useDispatch)(p.store),n=(0,l.useRef)(),a=(0,B.useMediaQuery)("(max-height: 549px)"),[{min:c,max:u},g]=(0,l.useState)((()=>({}))),m=(0,B.useRefEffect)((e=>{const t=e.closest(".interface-interface-skeleton__content");if(!t)return;const s=t.querySelectorAll(":scope > .components-notice-list"),o=t.querySelector(".edit-post-meta-boxes-main__presenter"),i=new window.ResizeObserver((()=>{let e=t.offsetHeight;for(const t of s)e-=t.offsetHeight;const i=o.offsetHeight;g({min:i,max:e})}));i.observe(t);for(const e of s)i.observe(e);return()=>i.disconnect()}),[]),h=(0,l.useRef)({}),w=(0,l.useRef)(),f=(0,l.useId)(),x=(e="auto",t,s)=>{"auto"===e?t=!1:e=Math.min(u,Math.max(c,e)),t?r("core/edit-post","metaBoxesMainOpenHeight",e):a||(w.current.ariaValueNow=M(e)),s&&n.current.updateSize({height:e,width:"auto"})},v=(0,B.useEvent)((()=>({isOpen:t,openHeight:s,min:c})));if((0,l.useEffect)((()=>{const e=v();if(void 0!==e.min&&n.current){const t=a?"auto":e.openHeight,s=e.isOpen?t:e.min;x(s,!1,!0)}}),[a]),!o)return;const P=(0,i.jsxs)("div",{className:"edit-post-layout__metaboxes edit-post-meta-boxes-main__liner",hidden:!e&&!t,children:[(0,i.jsx)(lt,{location:"normal"}),(0,i.jsx)(lt,{location:"advanced"})]});if(e)return P;const E=void 0===s,M=e=>Math.round((e-c)/(u-c)*100),j=void 0===u||E?50:M(s),T=(e=!t)=>r("core/edit-post","metaBoxesMainIsOpen",e),I=(0,y.__)("Meta Boxes"),A=(0,i.jsxs)("button",{"aria-expanded":t,onClick:({detail:e})=>{const{isToggleInferred:o}=h.current;if(a||!e||o){T();x(t?c:a?"auto":s,!1,!0)}},...a&&{onMouseDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation()},children:[I,(0,i.jsx)(k.Icon,{icon:t?b:S})]}),R=!a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(k.Tooltip,{text:(0,y.__)("Drag to resize"),children:(0,i.jsx)("button",{ref:w,role:"separator","aria-valuenow":j,"aria-label":(0,y.__)("Drag to resize"),"aria-describedby":f,onKeyDown:e=>{const t={ArrowUp:20,ArrowDown:-20}[e.key];if(t){const o=n.current.resizable,i=t+(E?o.offsetHeight:s);x(i,!0,!0),T(i>c),e.preventDefault()}}})}),(0,i.jsx)(k.VisuallyHidden,{id:f,children:(0,y.__)("Use up and down arrow keys to resize the meta box panel.")})]}),C={as:_,ref:n,className:"edit-post-meta-boxes-main",defaultSize:{height:t?s:0},minHeight:c,maxHeight:u,enable:{top:!0},handleClasses:{top:"edit-post-meta-boxes-main__presenter"},handleComponent:{top:(0,i.jsxs)(i.Fragment,{children:[A,R]})},onPointerDown:({pointerId:e,target:t})=>{w.current?.parentElement.contains(t)&&t.setPointerCapture(e)},onResizeStart:({timeStamp:e},t,s)=>{E&&x(s.offsetHeight,!1,!0),s.classList.add("is-resizing"),h.current={timeStamp:e,maxDelta:0}},onResize:(e,t,s,o)=>{const{maxDelta:i}=h.current,r=Math.abs(o.height);h.current.maxDelta=Math.max(i,r),x(n.current.state.height)},onResizeStop:(e,t,s)=>{s.classList.remove("is-resizing");const o=e.timeStamp-h.current.timeStamp,i=e.target===w.current,{maxDelta:r}=h.current;if(a||!i&&(r<1||o<144&&r<5))h.current.isToggleInferred=!0;else{const{height:e}=n.current.state,t=e>c;T(t),t&&x(e,!0)}}};return(0,i.jsxs)(k.ResizableBox,{"aria-label":I,...C,children:[(0,i.jsx)("meta",{ref:m}),P]})}var Lt=function({postId:e,postType:t,settings:s,initialEdits:o}){!function(){const{isFullscreen:e}=(0,d.useSelect)((e=>{const{get:t}=e(p.store);return{isFullscreen:t("core/edit-post","fullscreenMode")}}),[]),{toggle:t}=(0,d.useDispatch)(p.store),{createInfoNotice:s}=(0,d.useDispatch)(P.store);(0,E.useCommand)({name:"core/toggle-fullscreen-mode",label:e?(0,y.__)("Exit fullscreen"):(0,y.__)("Enter fullscreen"),icon:Bt,callback:({close:o})=>{t("core/edit-post","fullscreenMode"),o(),s(e?(0,y.__)("Fullscreen off."):(0,y.__)("Fullscreen on."),{id:"core/edit-post/toggle-fullscreen-mode/notice",type:"snackbar",actions:[{label:(0,y.__)("Undo"),onClick:()=>{t("core/edit-post","fullscreenMode")}}]})}})}();const n=(0,d.useSelect)((e=>{const{getEditorSettings:t,getCurrentPostType:s,getDeviceType:o}=e(g.store);return"Desktop"!==o()||["wp_template","wp_block"].includes(s())||L(e(f.store)).isZoomOut()||e(r.store).getBlockTypes().every((e=>e.apiVersion>=3))}),[]),{createErrorNotice:a}=(0,d.useDispatch)(P.store),{currentPost:{postId:c,postType:u},onNavigateToEntityRecord:m,onNavigateToPreviousEntityRecord:w}=function(e,t,s){const[o,i]=(0,l.useReducer)(((e,{type:t,post:s,previousRenderingMode:o})=>"push"===t?[...e,{post:s,previousRenderingMode:o}]:"pop"===t&&e.length>1?e.slice(0,-1):e),[{post:{postId:e,postType:t}}]),{post:r,previousRenderingMode:n}=o[o.length-1],{getRenderingMode:a}=(0,d.useSelect)(g.store),{setRenderingMode:c}=(0,d.useDispatch)(g.store),p=(0,l.useCallback)((e=>{i({type:"push",post:{postId:e.postId,postType:e.postType},previousRenderingMode:a()}),c(s)}),[a,c,s]),u=(0,l.useCallback)((()=>{i({type:"pop"}),n&&c(n)}),[c,n]);return{currentPost:r,onNavigateToEntityRecord:p,onNavigateToPreviousEntityRecord:o.length>1?u:void 0}}(e,t,"post-only"),_="wp_template"===u,{mode:v,isFullscreenActive:b,hasResolvedMode:S,hasActiveMetaboxes:I,hasBlockSelected:A,showIconLabels:R,isDistractionFree:C,showMetaBoxes:D,isWelcomeGuideVisible:O,templateId:N,enablePaddingAppender:F,isDevicePreview:V}=(0,d.useSelect)((e=>{const{get:t}=e(p.store),{isFeatureActive:o,hasMetaBoxes:i}=e(ot),{canUser:r,getPostType:n,getTemplateId:a}=L(e(T.store)),l=s.supportsTemplateMode,d=n(u)?.viewable??!1,m=r("read",{kind:"postType",name:"wp_template"}),{getBlockSelectionStart:h,isZoomOut:x}=L(e(f.store)),{getEditorMode:y,getRenderingMode:v,getDefaultRenderingMode:b,getDeviceType:S}=L(e(g.store)),P="post-only"===v(),E=!Ot.includes(u),M="wp_block"===u&&!w,j=a(u,c),k=b(u);return{mode:y(),isFullscreenActive:o("fullscreenMode"),hasActiveMetaboxes:i(),hasResolvedMode:"template-locked"===k?!!j:void 0!==k,hasBlockSelected:!!h(),showIconLabels:t("core","showIconLabels"),isDistractionFree:t("core","distractionFree"),showMetaBoxes:E&&!x()||M,isWelcomeGuideVisible:o("welcomeGuide"),templateId:l&&d&&m&&!_?j:null,enablePaddingAppender:!x()&&P&&E,isDevicePreview:"Desktop"!==S()}}),[u,c,_,s.supportsTemplateMode,w]);(e=>{const t=(0,d.useSelect)((t=>e&&t(g.store).__unstableIsEditorReady()),[e]),{initializeMetaBoxes:s}=(0,d.useDispatch)(ot);(0,l.useEffect)((()=>{t&&s()}),[t,s])})(I&&S);const[H,U]=function(e){const t=(0,d.useRegistry)(),s=(0,B.useRefEffect)((e=>{function s(s){if(s.target!==e&&s.target!==e.parentElement)return;const o=e.lastElementChild;if(!o)return;const i=o.getBoundingClientRect();if(s.clientY<i.bottom)return;s.preventDefault();const n=t.select(f.store).getBlockOrder(""),a=n[n.length-1],c=t.select(f.store).getBlock(a),{selectBlock:l,insertDefaultBlock:d}=t.dispatch(f.store);c&&(0,r.isUnmodifiedDefaultBlock)(c)?l(a):d()}const{ownerDocument:o}=e;return o.addEventListener("pointerdown",s),()=>{o.removeEventListener("pointerdown",s)}}),[t]);return e?[s,':root :where(.editor-styles-wrapper)::after {content: ""; display: block; height: 40vh;}']:[]}(F);At(A?"block-selection-edit":"entity-edit");const q=(0,l.useMemo)((()=>({...s,onNavigateToEntityRecord:m,onNavigateToPreviousEntityRecord:w,defaultRenderingMode:"post-only"})),[s,m,w]),W=function(...e){const{hasThemeStyleSupport:t,editorSettings:s}=(0,d.useSelect)((e=>({hasThemeStyleSupport:e(ot).isFeatureActive("themeStyles"),editorSettings:e(g.store).getEditorSettings()})),[]),o=e.join("\n");return(0,l.useMemo)((()=>{const e=s.styles?.filter((e=>e.__unstableType&&"theme"!==e.__unstableType))??[],i=[...s?.defaultEditorStyles??[],...e],r=t&&e.length!==(s.styles?.length??0);s.disableLayoutStyles||r||i.push({css:It({style:{},selector:"body",hasBlockGapSupport:!1,hasFallbackGapSupport:!0,fallbackGapValue:"0.5em"})});const n=r?s.styles??[]:i;return o?[...n,{css:o}]:n}),[s.defaultEditorStyles,s.disableLayoutStyles,s.styles,t,o])}(U);R?document.body.classList.add("show-icon-labels"):document.body.classList.remove("show-icon-labels");const Q=(0,k.__unstableUseNavigateRegions)(),X=h("edit-post-layout","is-mode-"+v,{"has-metaboxes":I}),{createSuccessNotice:Z}=(0,d.useDispatch)(P.store),$=(0,l.useCallback)(((e,t)=>{switch(e){case"move-to-trash":document.location.href=(0,M.addQueryArgs)("edit.php",{trashed:1,post_type:t[0].type,ids:t[0].id});break;case"duplicate-post":{const e=t[0],s="string"==typeof e.title?e.title:e.title?.rendered;Z((0,y.sprintf)((0,y.__)('"%s" successfully created.'),(0,j.decodeEntities)(s)||(0,y.__)("(no title)")),{type:"snackbar",id:"duplicate-post-action",actions:[{label:(0,y.__)("Edit"),onClick:()=>{const t=e.id;document.location.href=(0,M.addQueryArgs)("post.php",{post:t,action:"edit"})}}]})}}}),[Z]),Y=(0,l.useMemo)((()=>({type:t,id:e})),[t,e]),K=(0,B.useViewportMatch)("medium")&&b?(0,i.jsx)(z,{initialPost:Y}):null;return(0,i.jsx)(k.SlotFillProvider,{children:(0,i.jsxs)(g.ErrorBoundary,{canCopyContent:!0,children:[(0,i.jsx)(kt,{postType:u}),(0,i.jsx)("div",{className:Q.className,...Q,ref:Q.ref,children:(0,i.jsxs)(Rt,{settings:q,initialEdits:o,postType:u,postId:c,templateId:N,className:X,styles:W,forceIsDirty:I,contentRef:H,disableIframe:!n,autoFocus:!O,onActionPerformed:$,extraSidebarPanels:D&&(0,i.jsx)(lt,{location:"side"}),extraContent:!C&&D&&(0,i.jsx)(Nt,{isLegacy:!n||V}),children:[(0,i.jsx)(g.PostLockedModal,{}),(0,i.jsx)(G,{}),(0,i.jsx)(Ct,{isActive:b}),(0,i.jsx)(nt,{}),(0,i.jsx)(g.UnsavedChangesWarning,{}),(0,i.jsx)(g.AutosaveMonitor,{}),(0,i.jsx)(g.LocalAutosaveMonitor,{}),(0,i.jsx)(it,{}),(0,i.jsx)(g.EditorKeyboardShortcutsRegister,{}),(0,i.jsx)(Dt,{}),(0,i.jsx)(rt,{}),(0,i.jsx)(x.PluginArea,{onError:function(e){a((0,y.sprintf)((0,y.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}),(0,i.jsx)(Et,{}),K,(0,i.jsx)(g.EditorSnackbars,{})]})})]})})};const{PluginPostExcerpt:Ft}=L(g.privateApis),Vt=(0,M.getPath)(window.location.href)?.includes("site-editor.php"),zt=e=>{c()(`wp.editPost.${e}`,{since:"6.6",alternative:`wp.editor.${e}`})};function Gt(e){return Vt?null:(zt("PluginBlockSettingsMenuItem"),(0,i.jsx)(g.PluginBlockSettingsMenuItem,{...e}))}function Ht(e){return Vt?null:(zt("PluginDocumentSettingPanel"),(0,i.jsx)(g.PluginDocumentSettingPanel,{...e}))}function Ut(e){return Vt?null:(zt("PluginMoreMenuItem"),(0,i.jsx)(g.PluginMoreMenuItem,{...e}))}function qt(e){return Vt?null:(zt("PluginPrePublishPanel"),(0,i.jsx)(g.PluginPrePublishPanel,{...e}))}function Wt(e){return Vt?null:(zt("PluginPostPublishPanel"),(0,i.jsx)(g.PluginPostPublishPanel,{...e}))}function Qt(e){return Vt?null:(zt("PluginPostStatusInfo"),(0,i.jsx)(g.PluginPostStatusInfo,{...e}))}function Xt(e){return Vt?null:(zt("PluginSidebar"),(0,i.jsx)(g.PluginSidebar,{...e}))}function Zt(e){return Vt?null:(zt("PluginSidebarMoreMenuItem"),(0,i.jsx)(g.PluginSidebarMoreMenuItem,{...e}))}function $t(){return Vt?null:(c()("wp.editPost.__experimentalPluginPostExcerpt",{since:"6.6",hint:"Core and custom panels can be access programmatically using their panel name.",link:"https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically"}),Ft)}const{BackButton:Yt,registerCoreBlockBindingsSources:Kt}=L(g.privateApis);function Jt(e,t,s,o,a){const c=window.matchMedia("(min-width: 782px)").matches,m=document.getElementById(e),h=(0,l.createRoot)(m);(0,d.dispatch)(p.store).setDefaults("core/edit-post",{fullscreenMode:!0,themeStyles:!0,welcomeGuide:!0,welcomeGuideTemplate:!0}),(0,d.dispatch)(p.store).setDefaults("core",{allowRightClickOverrides:!0,editorMode:"visual",editorTool:"edit",fixedToolbar:!1,hiddenBlockTypes:[],inactivePanels:[],openPanels:["post-status"],showBlockBreadcrumbs:!0,showIconLabels:!1,showListViewByDefault:!1,enableChoosePatternModal:!0,isPublishSidebarEnabled:!0}),window.__experimentalMediaProcessing&&(0,d.dispatch)(p.store).setDefaults("core/media",{requireApproval:!0,optimizeOnUpload:!0}),(0,d.dispatch)(r.store).reapplyBlockTypeFilters(),c&&(0,d.select)(p.store).get("core","showListViewByDefault")&&!(0,d.select)(p.store).get("core","distractionFree")&&(0,d.dispatch)(g.store).setIsListViewOpened(!0),(0,n.registerCoreBlocks)(),Kt(),(0,u.registerLegacyWidgetBlock)({inserter:!1}),(0,u.registerWidgetGroupBlock)({inserter:!1});"Standards"!==("CSS1Compat"===document.compatMode?"Standards":"Quirks")&&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.");return-1!==window.navigator.userAgent.indexOf("iPhone")&&window.addEventListener("scroll",(e=>{const t=document.getElementsByClassName("interface-interface-skeleton__body")[0];e.target===document&&(window.scrollY>100&&(t.scrollTop=t.scrollTop+window.scrollY),document.getElementsByClassName("is-mode-visual")[0]&&window.scrollTo(0,0))})),window.addEventListener("dragover",(e=>e.preventDefault()),!1),window.addEventListener("drop",(e=>e.preventDefault()),!1),h.render((0,i.jsx)(l.StrictMode,{children:(0,i.jsx)(Lt,{settings:o,postId:s,postType:t,initialEdits:a})})),h}function es(){c()("wp.editPost.reinitializeEditor",{since:"6.2",version:"6.3"})}(window.wp=window.wp||{}).editPost=t})(); wordcount.min.js 0000644 00000006364 15121363552 0007724 0 ustar 00 /*! This file is auto-generated */
(()=>{var e={677:(e,n,t)=>{"use strict";function r(e,n){return n.replace(e.HTMLRegExp,"\n")}t.d(n,{A:()=>r})},2125:(e,n,t)=>{"use strict";function r(e,n){return n.replace(e.astralRegExp,"a")}t.d(n,{A:()=>r})},3608:(e,n,t)=>{"use strict";function r(e,n){return n.replace(e.connectorRegExp," ")}t.d(n,{A:()=>r})},4516:(e,n,t)=>{"use strict";function r(e,n){return e.shortcodesRegExp?n.replace(e.shortcodesRegExp,"\n"):n}t.d(n,{A:()=>r})},4579:(e,n,t)=>{"use strict";function r(e,n){return n.replace(e.HTMLcommentRegExp,"")}t.d(n,{A:()=>r})},4846:(e,n,t)=>{"use strict";function r(e,n){return n.replace(e.HTMLEntityRegExp,"")}t.d(n,{A:()=>r})},6019:()=>{},6542:(e,n,t)=>{"use strict";function r(e,n){return n.replace(e.removeRegExp,"")}t.d(n,{A:()=>r})},7742:(e,n,t)=>{"use strict";t.d(n,{L:()=>r});const r={HTMLRegExp:/<\/?[a-z][^>]*?>/gi,HTMLcommentRegExp:/<!--[\s\S]*?-->/g,spaceRegExp:/ | /gi,HTMLEntityRegExp:/&\S+?;/g,connectorRegExp:/--|\u2014/g,removeRegExp:new RegExp(["[","!-/:-@[-`{-~","-¿×÷"," -⯿","⸀-","]"].join(""),"g"),astralRegExp:/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wordsRegExp:/\S\s+/g,characters_excluding_spacesRegExp:/\S/g,characters_including_spacesRegExp:/[^\f\n\r\t\v\u00AD\u2028\u2029]/g,l10n:{type:"words"}}},8026:(e,n,t)=>{"use strict";function r(e,n){return n.replace(e.HTMLEntityRegExp,"a")}t.d(n,{A:()=>r})},8511:(e,n,t)=>{"use strict";function r(e,n){return n.replace(e.spaceRegExp," ")}t.d(n,{A:()=>r})}},n={};function t(r){var c=n[r];if(void 0!==c)return c.exports;var s=n[r]={exports:{}};return e[r](s,s.exports,t),s.exports}t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";t.r(r),t.d(r,{count:()=>E});var e=t(7742),n=t(677),c=t(2125),s=t(4846),u=t(3608),o=t(6542),i=t(4579),d=t(4516),a=t(8511),l=t(8026),p=t(6019),g={};for(const e in p)["default","count"].indexOf(e)<0&&(g[e]=()=>p[e]);function x(e,t,r){return e=[n.A.bind(null,r),i.A.bind(null,r),d.A.bind(null,r),c.A.bind(null,r),a.A.bind(null,r),l.A.bind(null,r)].reduce(((e,n)=>n(e)),e),e+="\n",e.match(t)?.length??0}function E(t,r,c){const l=function(n="words",t={}){const r={...{...e.L,...t},type:n,shortcodes:[]};return r.shortcodes=r.l10n?.shortcodes??[],r.shortcodes&&r.shortcodes.length&&(r.shortcodesRegExp=new RegExp("\\[\\/?(?:"+r.shortcodes.join("|")+")[^\\]]*?\\]","g")),"characters_excluding_spaces"!==r.type&&"characters_including_spaces"!==r.type&&(r.type="words"),r}(r,c);let p;switch(l.type){case"words":return p=l.wordsRegExp,function(e,t,r){return e=[n.A.bind(null,r),i.A.bind(null,r),d.A.bind(null,r),a.A.bind(null,r),s.A.bind(null,r),u.A.bind(null,r),o.A.bind(null,r)].reduce(((e,n)=>n(e)),e),e+="\n",e.match(t)?.length??0}(t,p,l);case"characters_including_spaces":return p=l.characters_including_spacesRegExp,x(t,p,l);case"characters_excluding_spaces":return p=l.characters_excluding_spacesRegExp,x(t,p,l);default:return 0}}t.d(r,g)})(),(window.wp=window.wp||{}).wordcount=r})(); widgets.js 0000644 00000137163 15121363552 0006566 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
MoveToWidgetArea: () => (/* reexport */ MoveToWidgetArea),
addWidgetIdToBlock: () => (/* reexport */ addWidgetIdToBlock),
getWidgetIdFromBlock: () => (/* reexport */ getWidgetIdFromBlock),
registerLegacyWidgetBlock: () => (/* binding */ registerLegacyWidgetBlock),
registerLegacyWidgetVariations: () => (/* reexport */ registerLegacyWidgetVariations),
registerWidgetGroupBlock: () => (/* binding */ registerWidgetGroupBlock)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/index.js
var legacy_widget_namespaceObject = {};
__webpack_require__.r(legacy_widget_namespaceObject);
__webpack_require__.d(legacy_widget_namespaceObject, {
yu: () => (block_namespaceObject),
UU: () => (legacy_widget_name),
W0: () => (settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/widgets/build-module/blocks/widget-group/index.js
var widget_group_namespaceObject = {};
__webpack_require__.r(widget_group_namespaceObject);
__webpack_require__.d(widget_group_namespaceObject, {
yu: () => (widget_group_block_namespaceObject),
UU: () => (widget_group_name),
W0: () => (widget_group_settings)
});
;// external ["wp","blocks"]
const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// external ["wp","primitives"]
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
;// ./node_modules/@wordpress/icons/build-module/library/widget.js
var widget_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6 3H8V5H16V3H18V5C19.1046 5 20 5.89543 20 7V19C20 20.1046 19.1046 21 18 21H6C4.89543 21 4 20.1046 4 19V7C4 5.89543 4.89543 5 6 5V3ZM18 6.5H6C5.72386 6.5 5.5 6.72386 5.5 7V8H18.5V7C18.5 6.72386 18.2761 6.5 18 6.5ZM18.5 9.5H5.5V19C5.5 19.2761 5.72386 19.5 6 19.5H18C18.2761 19.5 18.5 19.2761 18.5 19V9.5ZM11 11H13V13H11V11ZM7 11V13H9V11H7ZM15 13V11H17V13H15Z" }) });
;// ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/block.json
const block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/legacy-widget","title":"Legacy Widget","category":"widgets","description":"Display a legacy widget.","textdomain":"default","attributes":{"id":{"type":"string","default":null},"idBase":{"type":"string","default":null},"instance":{"type":"object","default":null}},"supports":{"html":false,"customClassName":false,"reusable":false},"editorStyle":"wp-block-legacy-widget-editor"}');
;// ./node_modules/clsx/dist/clsx.mjs
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx);
;// external ["wp","blockEditor"]
const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
;// external ["wp","components"]
const external_wp_components_namespaceObject = window["wp"]["components"];
;// ./node_modules/@wordpress/icons/build-module/library/brush.js
var brush_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z" }) });
;// external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// external ["wp","coreData"]
const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
;// external ["wp","data"]
const external_wp_data_namespaceObject = window["wp"]["data"];
;// ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/widget-type-selector.js
function WidgetTypeSelector({ selectedId, onSelect }) {
const widgetTypes = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const hiddenIds = select(external_wp_blockEditor_namespaceObject.store).getSettings()?.widgetTypesToHideFromLegacyWidgetBlock ?? [];
return select(external_wp_coreData_namespaceObject.store).getWidgetTypes({ per_page: -1 })?.filter((widgetType) => !hiddenIds.includes(widgetType.id));
}, []);
if (!widgetTypes) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {});
}
if (widgetTypes.length === 0) {
return (0,external_wp_i18n_namespaceObject.__)("There are no widgets available.");
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SelectControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Legacy widget"),
value: selectedId ?? "",
options: [
{ value: "", label: (0,external_wp_i18n_namespaceObject.__)("Select widget") },
...widgetTypes.map((widgetType) => ({
value: widgetType.id,
label: widgetType.name
}))
],
onChange: (value) => {
if (value) {
const selected = widgetTypes.find(
(widgetType) => widgetType.id === value
);
onSelect({
selectedId: selected.id,
isMulti: selected.is_multi
});
} else {
onSelect({ selectedId: null });
}
}
}
);
}
;// ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/inspector-card.js
function InspectorCard({ name, description }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "wp-block-legacy-widget-inspector-card", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", { className: "wp-block-legacy-widget-inspector-card__name", children: name }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: description })
] });
}
;// external ["wp","notices"]
const external_wp_notices_namespaceObject = window["wp"]["notices"];
;// external ["wp","compose"]
const external_wp_compose_namespaceObject = window["wp"]["compose"];
;// external ["wp","apiFetch"]
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
;// ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/control.js
class Control {
/**
* Creates and loads a new control.
*
* @access public
* @param {Object} params
* @param {string} params.id
* @param {string} params.idBase
* @param {Object} params.instance
* @param {Function} params.onChangeInstance
* @param {Function} params.onChangeHasPreview
* @param {Function} params.onError
*/
constructor({
id,
idBase,
instance,
onChangeInstance,
onChangeHasPreview,
onError
}) {
this.id = id;
this.idBase = idBase;
this._instance = instance;
this._hasPreview = null;
this.onChangeInstance = onChangeInstance;
this.onChangeHasPreview = onChangeHasPreview;
this.onError = onError;
this.number = ++lastNumber;
this.handleFormChange = (0,external_wp_compose_namespaceObject.debounce)(
this.handleFormChange.bind(this),
200
);
this.handleFormSubmit = this.handleFormSubmit.bind(this);
this.initDOM();
this.bindEvents();
this.loadContent();
}
/**
* Clean up the control so that it can be garbage collected.
*
* @access public
*/
destroy() {
this.unbindEvents();
this.element.remove();
}
/**
* Creates the control's DOM structure.
*
* @access private
*/
initDOM() {
this.element = el("div", { class: "widget open" }, [
el("div", { class: "widget-inside" }, [
this.form = el("form", { class: "form", method: "post" }, [
// These hidden form inputs are what most widgets' scripts
// use to access data about the widget.
el("input", {
class: "widget-id",
type: "hidden",
name: "widget-id",
value: this.id ?? `${this.idBase}-${this.number}`
}),
el("input", {
class: "id_base",
type: "hidden",
name: "id_base",
value: this.idBase ?? this.id
}),
el("input", {
class: "widget-width",
type: "hidden",
name: "widget-width",
value: "250"
}),
el("input", {
class: "widget-height",
type: "hidden",
name: "widget-height",
value: "200"
}),
el("input", {
class: "widget_number",
type: "hidden",
name: "widget_number",
value: this.idBase ? this.number.toString() : ""
}),
this.content = el("div", { class: "widget-content" }),
// Non-multi widgets can be saved via a Save button.
this.id && el(
"button",
{
class: "button is-primary",
type: "submit"
},
(0,external_wp_i18n_namespaceObject.__)("Save")
)
])
])
]);
}
/**
* Adds the control's event listeners.
*
* @access private
*/
bindEvents() {
if (window.jQuery) {
const { jQuery: $ } = window;
$(this.form).on("change", null, this.handleFormChange);
$(this.form).on("input", null, this.handleFormChange);
$(this.form).on("submit", this.handleFormSubmit);
} else {
this.form.addEventListener("change", this.handleFormChange);
this.form.addEventListener("input", this.handleFormChange);
this.form.addEventListener("submit", this.handleFormSubmit);
}
}
/**
* Removes the control's event listeners.
*
* @access private
*/
unbindEvents() {
if (window.jQuery) {
const { jQuery: $ } = window;
$(this.form).off("change", null, this.handleFormChange);
$(this.form).off("input", null, this.handleFormChange);
$(this.form).off("submit", this.handleFormSubmit);
} else {
this.form.removeEventListener("change", this.handleFormChange);
this.form.removeEventListener("input", this.handleFormChange);
this.form.removeEventListener("submit", this.handleFormSubmit);
}
}
/**
* Fetches the widget's form HTML from the REST API and loads it into the
* control's form.
*
* @access private
*/
async loadContent() {
try {
if (this.id) {
const { form } = await saveWidget(this.id);
this.content.innerHTML = form;
} else if (this.idBase) {
const { form, preview } = await encodeWidget({
idBase: this.idBase,
instance: this.instance,
number: this.number
});
this.content.innerHTML = form;
this.hasPreview = !isEmptyHTML(preview);
if (!this.instance.hash) {
const { instance } = await encodeWidget({
idBase: this.idBase,
instance: this.instance,
number: this.number,
formData: serializeForm(this.form)
});
this.instance = instance;
}
}
if (window.jQuery) {
const { jQuery: $ } = window;
$(document).trigger("widget-added", [$(this.element)]);
}
} catch (error) {
this.onError(error);
}
}
/**
* Perform a save when a multi widget's form is changed. Non-multi widgets
* are saved manually.
*
* @access private
*/
handleFormChange() {
if (this.idBase) {
this.saveForm();
}
}
/**
* Perform a save when the control's form is manually submitted.
*
* @access private
* @param {Event} event
*/
handleFormSubmit(event) {
event.preventDefault();
this.saveForm();
}
/**
* Serialize the control's form, send it to the REST API, and update the
* instance with the encoded instance that the REST API returns.
*
* @access private
*/
async saveForm() {
const formData = serializeForm(this.form);
try {
if (this.id) {
const { form } = await saveWidget(this.id, formData);
this.content.innerHTML = form;
if (window.jQuery) {
const { jQuery: $ } = window;
$(document).trigger("widget-updated", [
$(this.element)
]);
}
} else if (this.idBase) {
const { instance, preview } = await encodeWidget({
idBase: this.idBase,
instance: this.instance,
number: this.number,
formData
});
this.instance = instance;
this.hasPreview = !isEmptyHTML(preview);
}
} catch (error) {
this.onError(error);
}
}
/**
* The widget's instance object.
*
* @access private
*/
get instance() {
return this._instance;
}
/**
* The widget's instance object.
*
* @access private
*/
set instance(instance) {
if (this._instance !== instance) {
this._instance = instance;
this.onChangeInstance(instance);
}
}
/**
* Whether or not the widget can be previewed.
*
* @access public
*/
get hasPreview() {
return this._hasPreview;
}
/**
* Whether or not the widget can be previewed.
*
* @access private
*/
set hasPreview(hasPreview) {
if (this._hasPreview !== hasPreview) {
this._hasPreview = hasPreview;
this.onChangeHasPreview(hasPreview);
}
}
}
let lastNumber = 0;
function el(tagName, attributes = {}, content = null) {
const element = document.createElement(tagName);
for (const [attribute, value] of Object.entries(attributes)) {
element.setAttribute(attribute, value);
}
if (Array.isArray(content)) {
for (const child of content) {
if (child) {
element.appendChild(child);
}
}
} else if (typeof content === "string") {
element.innerText = content;
}
return element;
}
async function saveWidget(id, formData = null) {
let widget;
if (formData) {
widget = await external_wp_apiFetch_default()({
path: `/wp/v2/widgets/${id}?context=edit`,
method: "PUT",
data: {
form_data: formData
}
});
} else {
widget = await external_wp_apiFetch_default()({
path: `/wp/v2/widgets/${id}?context=edit`,
method: "GET"
});
}
return { form: widget.rendered_form };
}
async function encodeWidget({ idBase, instance, number, formData = null }) {
const response = await external_wp_apiFetch_default()({
path: `/wp/v2/widget-types/${idBase}/encode`,
method: "POST",
data: {
instance,
number,
form_data: formData
}
});
return {
instance: response.instance,
form: response.form,
preview: response.preview
};
}
function isEmptyHTML(html) {
const element = document.createElement("div");
element.innerHTML = html;
return isEmptyNode(element);
}
function isEmptyNode(node) {
switch (node.nodeType) {
case node.TEXT_NODE:
return node.nodeValue.trim() === "";
case node.ELEMENT_NODE:
if ([
"AUDIO",
"CANVAS",
"EMBED",
"IFRAME",
"IMG",
"MATH",
"OBJECT",
"SVG",
"VIDEO"
].includes(node.tagName)) {
return false;
}
if (!node.hasChildNodes()) {
return true;
}
return Array.from(node.childNodes).every(isEmptyNode);
default:
return true;
}
}
function serializeForm(form) {
return new window.URLSearchParams(
Array.from(new window.FormData(form))
).toString();
}
;// ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/form.js
function Form({
title,
isVisible,
id,
idBase,
instance,
isWide,
onChangeInstance,
onChangeHasPreview
}) {
const ref = (0,external_wp_element_namespaceObject.useRef)();
const isMediumLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("small");
const outgoingInstances = (0,external_wp_element_namespaceObject.useRef)(/* @__PURE__ */ new Set());
const incomingInstances = (0,external_wp_element_namespaceObject.useRef)(/* @__PURE__ */ new Set());
const { createNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (incomingInstances.current.has(instance)) {
incomingInstances.current.delete(instance);
return;
}
const control = new Control({
id,
idBase,
instance,
onChangeInstance(nextInstance) {
outgoingInstances.current.add(instance);
incomingInstances.current.add(nextInstance);
onChangeInstance(nextInstance);
},
onChangeHasPreview,
onError(error) {
window.console.error(error);
createNotice(
"error",
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: the name of the affected block. */
(0,external_wp_i18n_namespaceObject.__)(
'The "%s" block was affected by errors and may not function properly. Check the developer tools for more details.'
),
idBase || id
)
);
}
});
ref.current.appendChild(control.element);
return () => {
if (outgoingInstances.current.has(instance)) {
outgoingInstances.current.delete(instance);
return;
}
control.destroy();
};
}, [
id,
idBase,
instance,
onChangeInstance,
onChangeHasPreview,
isMediumLargeViewport
]);
if (isWide && isMediumLargeViewport) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
className: dist_clsx({
"wp-block-legacy-widget__container": isVisible
}),
children: [
isVisible && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", { className: "wp-block-legacy-widget__edit-form-title", children: title }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Popover,
{
focusOnMount: false,
placement: "right",
offset: 32,
resize: false,
flip: false,
shift: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
ref,
className: "wp-block-legacy-widget__edit-form",
hidden: !isVisible
}
)
}
)
]
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
ref,
className: "wp-block-legacy-widget__edit-form",
hidden: !isVisible,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", { className: "wp-block-legacy-widget__edit-form-title", children: title })
}
);
}
;// ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/preview.js
function Preview({ idBase, instance, isVisible }) {
const [isLoaded, setIsLoaded] = (0,external_wp_element_namespaceObject.useState)(false);
const [srcDoc, setSrcDoc] = (0,external_wp_element_namespaceObject.useState)("");
(0,external_wp_element_namespaceObject.useEffect)(() => {
const abortController = typeof window.AbortController === "undefined" ? void 0 : new window.AbortController();
async function fetchPreviewHTML() {
const restRoute = `/wp/v2/widget-types/${idBase}/render`;
return await external_wp_apiFetch_default()({
path: restRoute,
method: "POST",
signal: abortController?.signal,
data: instance ? { instance } : {}
});
}
fetchPreviewHTML().then((response) => {
setSrcDoc(response.preview);
}).catch((error) => {
if ("AbortError" === error.name) {
return;
}
throw error;
});
return () => abortController?.abort();
}, [idBase, instance]);
const ref = (0,external_wp_compose_namespaceObject.useRefEffect)(
(iframe) => {
if (!isLoaded) {
return;
}
function setHeight() {
const height = Math.max(
iframe.contentDocument.documentElement?.offsetHeight ?? 0,
iframe.contentDocument.body?.offsetHeight ?? 0
);
iframe.style.height = `${height !== 0 ? height : 100}px`;
}
const { IntersectionObserver } = iframe.ownerDocument.defaultView;
const intersectionObserver = new IntersectionObserver(
([entry]) => {
if (entry.isIntersecting) {
setHeight();
}
},
{
threshold: 1
}
);
intersectionObserver.observe(iframe);
iframe.addEventListener("load", setHeight);
return () => {
intersectionObserver.disconnect();
iframe.removeEventListener("load", setHeight);
};
},
[isLoaded]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
isVisible && !isLoaded && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx("wp-block-legacy-widget__edit-preview", {
"is-offscreen": !isVisible || !isLoaded
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"iframe",
{
ref,
className: "wp-block-legacy-widget__edit-preview-iframe",
tabIndex: "-1",
title: (0,external_wp_i18n_namespaceObject.__)("Legacy Widget Preview"),
srcDoc,
onLoad: (event) => {
event.target.contentDocument.body.style.overflow = "hidden";
setIsLoaded(true);
},
height: 100
}
) })
}
)
] });
}
;// ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/no-preview.js
function NoPreview({ name }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "wp-block-legacy-widget__edit-no-preview", children: [
name && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", { children: name }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)("No preview available.") })
] });
}
;// ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/convert-to-blocks-button.js
function ConvertToBlocksButton({ clientId, rawInstance }) {
const { replaceBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
onClick: () => {
if (rawInstance.title) {
replaceBlocks(clientId, [
(0,external_wp_blocks_namespaceObject.createBlock)("core/heading", {
content: rawInstance.title
}),
...(0,external_wp_blocks_namespaceObject.rawHandler)({ HTML: rawInstance.text })
]);
} else {
replaceBlocks(
clientId,
(0,external_wp_blocks_namespaceObject.rawHandler)({ HTML: rawInstance.text })
);
}
},
children: (0,external_wp_i18n_namespaceObject.__)("Convert to blocks")
}
);
}
;// ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/index.js
function Edit(props) {
const { id, idBase } = props.attributes;
const { isWide = false } = props;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
"is-wide-widget": isWide
})
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: !id && !idBase ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Empty, { ...props }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NotEmpty, { ...props }) });
}
function Empty({ attributes: { id, idBase }, setAttributes }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Placeholder,
{
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: brush_default }),
label: (0,external_wp_i18n_namespaceObject.__)("Legacy Widget"),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
WidgetTypeSelector,
{
selectedId: id ?? idBase,
onSelect: ({ selectedId, isMulti }) => {
if (!selectedId) {
setAttributes({
id: null,
idBase: null,
instance: null
});
} else if (isMulti) {
setAttributes({
id: null,
idBase: selectedId,
instance: {}
});
} else {
setAttributes({
id: selectedId,
idBase: null,
instance: null
});
}
}
}
) }) })
}
);
}
function NotEmpty({
attributes: { id, idBase, instance },
setAttributes,
clientId,
isSelected,
isWide = false
}) {
const [hasPreview, setHasPreview] = (0,external_wp_element_namespaceObject.useState)(null);
const widgetTypeId = id ?? idBase;
const { record: widgetType, hasResolved: hasResolvedWidgetType } = (0,external_wp_coreData_namespaceObject.useEntityRecord)("root", "widgetType", widgetTypeId);
const setInstance = (0,external_wp_element_namespaceObject.useCallback)((nextInstance) => {
setAttributes({ instance: nextInstance });
}, []);
if (!widgetType && hasResolvedWidgetType) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Placeholder,
{
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: brush_default }),
label: (0,external_wp_i18n_namespaceObject.__)("Legacy Widget"),
children: (0,external_wp_i18n_namespaceObject.__)("Widget is missing.")
}
);
}
if (!hasResolvedWidgetType) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) });
}
const mode = idBase && !isSelected ? "preview" : "edit";
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
idBase === "text" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ConvertToBlocksButton,
{
clientId,
rawInstance: instance.raw
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
InspectorCard,
{
name: widgetType.name,
description: widgetType.description
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Form,
{
title: widgetType.name,
isVisible: mode === "edit",
id,
idBase,
instance,
isWide,
onChangeInstance: setInstance,
onChangeHasPreview: setHasPreview
}
),
idBase && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
hasPreview === null && mode === "preview" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }),
hasPreview === true && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Preview,
{
idBase,
instance,
isVisible: mode === "preview"
}
),
hasPreview === false && mode === "preview" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NoPreview, { name: widgetType.name })
] })
] });
}
;// ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/transforms.js
const legacyWidgetTransforms = [
{
block: "core/calendar",
widget: "calendar"
},
{
block: "core/search",
widget: "search"
},
{
block: "core/html",
widget: "custom_html",
transform: ({ content }) => ({
content
})
},
{
block: "core/archives",
widget: "archives",
transform: ({ count, dropdown }) => {
return {
displayAsDropdown: !!dropdown,
showPostCounts: !!count
};
}
},
{
block: "core/latest-posts",
widget: "recent-posts",
transform: ({ show_date: displayPostDate, number }) => {
return {
displayPostDate: !!displayPostDate,
postsToShow: number
};
}
},
{
block: "core/latest-comments",
widget: "recent-comments",
transform: ({ number }) => {
return {
commentsToShow: number
};
}
},
{
block: "core/tag-cloud",
widget: "tag_cloud",
transform: ({ taxonomy, count }) => {
return {
showTagCounts: !!count,
taxonomy
};
}
},
{
block: "core/categories",
widget: "categories",
transform: ({ count, dropdown, hierarchical }) => {
return {
displayAsDropdown: !!dropdown,
showPostCounts: !!count,
showHierarchy: !!hierarchical
};
}
},
{
block: "core/audio",
widget: "media_audio",
transform: ({ url, preload, loop, attachment_id: id }) => {
return {
src: url,
id,
preload,
loop
};
}
},
{
block: "core/video",
widget: "media_video",
transform: ({ url, preload, loop, attachment_id: id }) => {
return {
src: url,
id,
preload,
loop
};
}
},
{
block: "core/image",
widget: "media_image",
transform: ({
alt,
attachment_id: id,
caption,
height,
link_classes: linkClass,
link_rel: rel,
link_target_blank: targetBlack,
link_type: linkDestination,
link_url: link,
size: sizeSlug,
url,
width
}) => {
return {
alt,
caption,
height,
id,
link,
linkClass,
linkDestination,
linkTarget: targetBlack ? "_blank" : void 0,
rel,
sizeSlug,
url,
width
};
}
},
{
block: "core/gallery",
widget: "media_gallery",
transform: ({ ids, link_type: linkTo, size, number }) => {
return {
ids,
columns: number,
linkTo,
sizeSlug: size,
images: ids.map((id) => ({
id
}))
};
}
},
{
block: "core/rss",
widget: "rss",
transform: ({
url,
show_author: displayAuthor,
show_date: displayDate,
show_summary: displayExcerpt,
items
}) => {
return {
feedURL: url,
displayAuthor: !!displayAuthor,
displayDate: !!displayDate,
displayExcerpt: !!displayExcerpt,
itemsToShow: items
};
}
}
].map(({ block, widget, transform }) => {
return {
type: "block",
blocks: [block],
isMatch: ({ idBase, instance }) => {
return idBase === widget && !!instance?.raw;
},
transform: ({ instance }) => {
const transformedBlock = (0,external_wp_blocks_namespaceObject.createBlock)(
block,
transform ? transform(instance.raw) : void 0
);
if (!instance.raw?.title) {
return transformedBlock;
}
return [
(0,external_wp_blocks_namespaceObject.createBlock)("core/heading", {
content: instance.raw.title
}),
transformedBlock
];
}
};
});
const transforms = {
to: legacyWidgetTransforms
};
var transforms_default = transforms;
;// ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/index.js
const { name: legacy_widget_name } = block_namespaceObject;
const settings = {
icon: widget_default,
edit: Edit,
transforms: transforms_default
};
;// ./node_modules/@wordpress/icons/build-module/library/group.js
var group_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z" }) });
;// ./node_modules/@wordpress/widgets/build-module/blocks/widget-group/block.json
const widget_group_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/widget-group","title":"Widget Group","category":"widgets","attributes":{"title":{"type":"string"}},"supports":{"html":false,"inserter":true,"customClassName":true,"reusable":false},"editorStyle":"wp-block-widget-group-editor","style":"wp-block-widget-group"}');
;// ./node_modules/@wordpress/widgets/build-module/blocks/widget-group/edit.js
function edit_Edit(props) {
const { clientId } = props;
const { innerBlocks } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId),
[clientId]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: "widget" }), children: innerBlocks.length === 0 ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PlaceholderContent, { ...props }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewContent, { ...props }) });
}
function PlaceholderContent({ clientId }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Placeholder,
{
className: "wp-block-widget-group__placeholder",
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: group_default }),
label: (0,external_wp_i18n_namespaceObject.__)("Widget Group"),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.ButtonBlockAppender, { rootClientId: clientId })
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks, { renderAppender: false })
] });
}
function PreviewContent({ attributes, setAttributes }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText,
{
tagName: "h2",
identifier: "title",
className: "widget-title",
allowedFormats: [],
placeholder: (0,external_wp_i18n_namespaceObject.__)("Title"),
value: attributes.title ?? "",
onChange: (title) => setAttributes({ title })
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks, {})
] });
}
;// ./node_modules/@wordpress/widgets/build-module/blocks/widget-group/save.js
function save({ attributes }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "h2",
className: "widget-title",
value: attributes.title
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-widget-group__inner-blocks", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) })
] });
}
;// ./node_modules/@wordpress/widgets/build-module/blocks/widget-group/deprecated.js
const v1 = {
attributes: {
title: {
type: "string"
}
},
supports: {
html: false,
inserter: true,
customClassName: true,
reusable: false
},
save({ attributes }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "h2",
className: "widget-title",
value: attributes.title
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {})
] });
}
};
var deprecated_default = [v1];
;// ./node_modules/@wordpress/widgets/build-module/blocks/widget-group/index.js
const { name: widget_group_name } = widget_group_block_namespaceObject;
const widget_group_settings = {
title: (0,external_wp_i18n_namespaceObject.__)("Widget Group"),
description: (0,external_wp_i18n_namespaceObject.__)(
"Create a classic widget layout with a title that\u2019s styled by your theme for your widget areas."
),
icon: group_default,
__experimentalLabel: ({ name: label }) => label,
edit: edit_Edit,
save: save,
transforms: {
from: [
{
type: "block",
isMultiBlock: true,
blocks: ["*"],
isMatch(attributes, blocks) {
return !blocks.some(
(block) => block.name === "core/widget-group"
);
},
__experimentalConvert(blocks) {
let innerBlocks = [
...blocks.map((block) => {
return (0,external_wp_blocks_namespaceObject.createBlock)(
block.name,
block.attributes,
block.innerBlocks
);
})
];
const firstHeadingBlock = innerBlocks[0].name === "core/heading" ? innerBlocks[0] : null;
innerBlocks = innerBlocks.filter(
(block) => block !== firstHeadingBlock
);
return (0,external_wp_blocks_namespaceObject.createBlock)(
"core/widget-group",
{
...firstHeadingBlock && {
title: firstHeadingBlock.attributes.content
}
},
innerBlocks
);
}
}
]
},
deprecated: deprecated_default
};
;// ./node_modules/@wordpress/icons/build-module/library/move-to.js
var move_to_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19.75 9c0-1.257-.565-2.197-1.39-2.858-.797-.64-1.827-1.017-2.815-1.247-1.802-.42-3.703-.403-4.383-.396L11 4.5V6l.177-.001c.696-.006 2.416-.02 4.028.356.887.207 1.67.518 2.216.957.52.416.829.945.829 1.688 0 .592-.167.966-.407 1.23-.255.281-.656.508-1.236.674-1.19.34-2.82.346-4.607.346h-.077c-1.692 0-3.527 0-4.942.404-.732.209-1.424.545-1.935 1.108-.526.579-.796 1.33-.796 2.238 0 1.257.565 2.197 1.39 2.858.797.64 1.827 1.017 2.815 1.247 1.802.42 3.703.403 4.383.396L13 19.5h.714V22L18 18.5 13.714 15v3H13l-.177.001c-.696.006-2.416.02-4.028-.356-.887-.207-1.67-.518-2.216-.957-.52-.416-.829-.945-.829-1.688 0-.592.167-.966.407-1.23.255-.281.656-.508 1.237-.674 1.189-.34 2.819-.346 4.606-.346h.077c1.692 0 3.527 0 4.941-.404.732-.209 1.425-.545 1.936-1.108.526-.579.796-1.33.796-2.238z" }) });
;// ./node_modules/@wordpress/widgets/build-module/components/move-to-widget-area/index.js
function MoveToWidgetArea({
currentWidgetAreaId,
widgetAreas,
onSelect
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { children: (toggleProps) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.DropdownMenu,
{
icon: move_to_default,
label: (0,external_wp_i18n_namespaceObject.__)("Move to widget area"),
toggleProps,
children: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)("Move to"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.MenuItemsChoice,
{
choices: widgetAreas.map(
(widgetArea) => ({
value: widgetArea.id,
label: widgetArea.name,
info: widgetArea.description
})
),
value: currentWidgetAreaId,
onSelect: (value) => {
onSelect(value);
onClose();
}
}
) })
}
) }) });
}
;// ./node_modules/@wordpress/widgets/build-module/components/index.js
;// ./node_modules/@wordpress/widgets/build-module/utils.js
function getWidgetIdFromBlock(block) {
return block.attributes.__internalWidgetId;
}
function addWidgetIdToBlock(block, widgetId) {
return {
...block,
attributes: {
...block.attributes || {},
__internalWidgetId: widgetId
}
};
}
;// ./node_modules/@wordpress/widgets/build-module/register-legacy-widget-variations.js
function registerLegacyWidgetVariations(settings) {
const unsubscribe = (0,external_wp_data_namespaceObject.subscribe)(() => {
const hiddenIds = settings?.widgetTypesToHideFromLegacyWidgetBlock ?? [];
const widgetTypes = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getWidgetTypes({ per_page: -1 })?.filter((widgetType) => !hiddenIds.includes(widgetType.id));
if (widgetTypes) {
unsubscribe();
(0,external_wp_data_namespaceObject.dispatch)(external_wp_blocks_namespaceObject.store).addBlockVariations(
"core/legacy-widget",
widgetTypes.map((widgetType) => ({
name: widgetType.id,
title: widgetType.name,
description: widgetType.description,
attributes: widgetType.is_multi ? {
idBase: widgetType.id,
instance: {}
} : {
id: widgetType.id
}
}))
);
}
});
}
;// ./node_modules/@wordpress/widgets/build-module/index.js
function registerLegacyWidgetBlock(supports = {}) {
const { /* metadata */ "yu": metadata, /* settings */ "W0": settings, /* name */ "UU": name } = legacy_widget_namespaceObject;
(0,external_wp_blocks_namespaceObject.registerBlockType)(
{ name, ...metadata },
{
...settings,
supports: {
...settings.supports,
...supports
}
}
);
}
function registerWidgetGroupBlock(supports = {}) {
const { /* metadata */ "yu": metadata, /* settings */ "W0": settings, /* name */ "UU": name } = widget_group_namespaceObject;
(0,external_wp_blocks_namespaceObject.registerBlockType)(
{ name, ...metadata },
{
...settings,
supports: {
...settings.supports,
...supports
}
}
);
}
(window.wp = window.wp || {}).widgets = __webpack_exports__;
/******/ })()
; keyboard-shortcuts.min.js 0000644 00000005760 15121363552 0011533 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ShortcutProvider:()=>K,__unstableUseShortcutEventMatch:()=>R,store:()=>h,useShortcut:()=>T});var o={};e.r(o),e.d(o,{registerShortcut:()=>c,unregisterShortcut:()=>a});var r={};e.r(r),e.d(r,{getAllShortcutKeyCombinations:()=>w,getAllShortcutRawKeyCombinations:()=>p,getCategoryShortcuts:()=>b,getShortcutAliases:()=>m,getShortcutDescription:()=>f,getShortcutKeyCombination:()=>y,getShortcutRepresentation:()=>S});const n=window.wp.data;var i=function(e={},t){switch(t.type){case"REGISTER_SHORTCUT":return{...e,[t.name]:{category:t.category,keyCombination:t.keyCombination,aliases:t.aliases,description:t.description}};case"UNREGISTER_SHORTCUT":const{[t.name]:o,...r}=e;return r}return e};function c({name:e,category:t,description:o,keyCombination:r,aliases:n}){return{type:"REGISTER_SHORTCUT",name:e,category:t,keyCombination:r,aliases:n,description:o}}function a(e){return{type:"UNREGISTER_SHORTCUT",name:e}}const s=window.wp.keycodes,u=[],d={display:s.displayShortcut,raw:s.rawShortcut,ariaLabel:s.shortcutAriaLabel};function l(e,t){return e?e.modifier?d[t][e.modifier](e.character):e.character:null}function y(e,t){return e[t]?e[t].keyCombination:null}function S(e,t,o="display"){return l(y(e,t),o)}function f(e,t){return e[t]?e[t].description:null}function m(e,t){return e[t]&&e[t].aliases?e[t].aliases:u}const w=(0,n.createSelector)(((e,t)=>[y(e,t),...m(e,t)].filter(Boolean)),((e,t)=>[e[t]])),p=(0,n.createSelector)(((e,t)=>w(e,t).map((e=>l(e,"raw")))),((e,t)=>[e[t]])),b=(0,n.createSelector)(((e,t)=>Object.entries(e).filter((([,e])=>e.category===t)).map((([e])=>e))),(e=>[e])),h=(0,n.createReduxStore)("core/keyboard-shortcuts",{reducer:i,actions:o,selectors:r});(0,n.register)(h);const g=window.wp.element;function R(){const{getAllShortcutKeyCombinations:e}=(0,n.useSelect)(h);return function(t,o){return e(t).some((({modifier:e,character:t})=>s.isKeyboardEvent[e](o,t)))}}const C=new Set,v=e=>{for(const t of C)t(e)},E=(0,g.createContext)({add:e=>{0===C.size&&document.addEventListener("keydown",v),C.add(e)},delete:e=>{C.delete(e),0===C.size&&document.removeEventListener("keydown",v)}});function T(e,t,{isDisabled:o=!1}={}){const r=(0,g.useContext)(E),n=R(),i=(0,g.useRef)();(0,g.useEffect)((()=>{i.current=t}),[t]),(0,g.useEffect)((()=>{if(!o)return r.add(t),()=>{r.delete(t)};function t(t){n(e,t)&&i.current(t)}}),[e,o,r])}E.displayName="KeyboardShortcutsContext";const k=window.ReactJSXRuntime,{Provider:O}=E;function K(e){const[t]=(0,g.useState)((()=>new Set));return(0,k.jsx)(O,{value:t,children:(0,k.jsx)("div",{...e,onKeyDown:function(o){e.onKeyDown&&e.onKeyDown(o);for(const e of t)e(o)}})})}(window.wp=window.wp||{}).keyboardShortcuts=t})(); server-side-render.js 0000644 00000023273 15121363552 0010621 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": () => (/* binding */ index_default)
});
// UNUSED EXPORTS: ServerSideRender, useServerSideRender
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// external ["wp","components"]
const external_wp_components_namespaceObject = window["wp"]["components"];
;// external ["wp","data"]
const external_wp_data_namespaceObject = window["wp"]["data"];
;// external ["wp","compose"]
const external_wp_compose_namespaceObject = window["wp"]["compose"];
;// external ["wp","apiFetch"]
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
;// external ["wp","url"]
const external_wp_url_namespaceObject = window["wp"]["url"];
;// external ["wp","blocks"]
const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
;// ./node_modules/@wordpress/server-side-render/build-module/hook.js
function rendererPath(block, attributes = null, urlQueryArgs = {}) {
return (0,external_wp_url_namespaceObject.addQueryArgs)(`/wp/v2/block-renderer/${block}`, {
context: "edit",
...null !== attributes ? { attributes } : {},
...urlQueryArgs
});
}
function removeBlockSupportAttributes(attributes) {
const {
backgroundColor,
borderColor,
fontFamily,
fontSize,
gradient,
textColor,
className,
...restAttributes
} = attributes;
const {
border,
color,
elements,
shadow,
spacing,
typography,
...restStyles
} = attributes?.style || {};
return {
...restAttributes,
style: restStyles
};
}
function useServerSideRender(args) {
const [response, setResponse] = (0,external_wp_element_namespaceObject.useState)({ status: "idle" });
const shouldDebounceRef = (0,external_wp_element_namespaceObject.useRef)(false);
const {
attributes,
block,
skipBlockSupportAttributes = false,
httpMethod = "GET",
urlQueryArgs
} = args;
let sanitizedAttributes = attributes && (0,external_wp_blocks_namespaceObject.__experimentalSanitizeBlockAttributes)(block, attributes);
if (skipBlockSupportAttributes) {
sanitizedAttributes = removeBlockSupportAttributes(sanitizedAttributes);
}
const isPostRequest = "POST" === httpMethod;
const urlAttributes = isPostRequest ? null : sanitizedAttributes;
const path = rendererPath(block, urlAttributes, urlQueryArgs);
const body = isPostRequest ? JSON.stringify({ attributes: sanitizedAttributes ?? null }) : void 0;
(0,external_wp_element_namespaceObject.useEffect)(() => {
const controller = new AbortController();
const debouncedFetch = (0,external_wp_compose_namespaceObject.debounce)(
function() {
{
setResponse({ status: "loading" });
external_wp_apiFetch_default()({
path,
method: isPostRequest ? "POST" : "GET",
body,
headers: isPostRequest ? {
"Content-Type": "application/json"
} : {},
signal: controller.signal
}).then((res) => {
setResponse({
status: "success",
content: res ? res.rendered : ""
});
}).catch((error) => {
if (error.name === "AbortError") {
return;
}
setResponse({
status: "error",
error: error.message
});
}).finally(() => {
shouldDebounceRef.current = true;
});
}
},
shouldDebounceRef.current ? 500 : 0
);
debouncedFetch();
return () => {
controller.abort();
debouncedFetch.cancel();
};
}, [path, isPostRequest, body]);
return response;
}
;// ./node_modules/@wordpress/server-side-render/build-module/server-side-render.js
const EMPTY_OBJECT = {};
function DefaultEmptyResponsePlaceholder({ className }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { className, children: (0,external_wp_i18n_namespaceObject.__)("Block rendered as empty.") });
}
function DefaultErrorResponsePlaceholder({ message, className }) {
const errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: error message describing the problem
(0,external_wp_i18n_namespaceObject.__)("Error loading block: %s"),
message
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { className, children: errorMessage });
}
function DefaultLoadingResponsePlaceholder({ children }) {
const [showLoader, setShowLoader] = (0,external_wp_element_namespaceObject.useState)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const timeout = setTimeout(() => {
setShowLoader(true);
}, 1e3);
return () => clearTimeout(timeout);
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { style: { position: "relative" }, children: [
showLoader && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
style: {
position: "absolute",
top: "50%",
left: "50%",
marginTop: "-9px",
marginLeft: "-9px"
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { style: { opacity: showLoader ? "0.3" : 1 }, children })
] });
}
function ServerSideRender(props) {
const prevContentRef = (0,external_wp_element_namespaceObject.useRef)("");
const {
className,
EmptyResponsePlaceholder = DefaultEmptyResponsePlaceholder,
ErrorResponsePlaceholder = DefaultErrorResponsePlaceholder,
LoadingResponsePlaceholder = DefaultLoadingResponsePlaceholder,
...restProps
} = props;
const { content, status, error } = useServerSideRender(restProps);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (content) {
prevContentRef.current = content;
}
}, [content]);
if (status === "loading") {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LoadingResponsePlaceholder, { ...props, children: !!prevContentRef.current && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { className, children: prevContentRef.current }) });
}
if (status === "success" && !content) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(EmptyResponsePlaceholder, { ...props });
}
if (status === "error") {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ErrorResponsePlaceholder, { message: error, ...props });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { className, children: content });
}
function ServerSideRenderWithPostId({
urlQueryArgs = EMPTY_OBJECT,
...props
}) {
const currentPostId = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const postId = select("core/editor")?.getCurrentPostId();
return postId && typeof postId === "number" ? postId : null;
}, []);
const newUrlQueryArgs = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!currentPostId) {
return urlQueryArgs;
}
return {
post_id: currentPostId,
...urlQueryArgs
};
}, [currentPostId, urlQueryArgs]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ServerSideRender, { urlQueryArgs: newUrlQueryArgs, ...props });
}
;// ./node_modules/@wordpress/server-side-render/build-module/index.js
const ServerSideRenderCompat = ServerSideRenderWithPostId;
ServerSideRenderCompat.ServerSideRender = ServerSideRenderWithPostId;
ServerSideRenderCompat.useServerSideRender = useServerSideRender;
var index_default = ServerSideRenderCompat;
(window.wp = window.wp || {}).serverSideRender = __webpack_exports__["default"];
/******/ })()
; primitives.js 0000644 00000012144 15121363552 0007302 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
BlockQuotation: () => (/* reexport */ BlockQuotation),
Circle: () => (/* reexport */ Circle),
Defs: () => (/* reexport */ Defs),
G: () => (/* reexport */ G),
HorizontalRule: () => (/* reexport */ HorizontalRule),
Line: () => (/* reexport */ Line),
LinearGradient: () => (/* reexport */ LinearGradient),
Path: () => (/* reexport */ Path),
Polygon: () => (/* reexport */ Polygon),
RadialGradient: () => (/* reexport */ RadialGradient),
Rect: () => (/* reexport */ Rect),
SVG: () => (/* reexport */ SVG),
Stop: () => (/* reexport */ Stop),
View: () => (/* reexport */ View)
});
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// ./node_modules/clsx/dist/clsx.mjs
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx);
;// external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// ./node_modules/@wordpress/primitives/build-module/svg/index.js
const Circle = (props) => (0,external_wp_element_namespaceObject.createElement)("circle", props);
const G = (props) => (0,external_wp_element_namespaceObject.createElement)("g", props);
const Line = (props) => (0,external_wp_element_namespaceObject.createElement)("line", props);
const Path = (props) => (0,external_wp_element_namespaceObject.createElement)("path", props);
const Polygon = (props) => (0,external_wp_element_namespaceObject.createElement)("polygon", props);
const Rect = (props) => (0,external_wp_element_namespaceObject.createElement)("rect", props);
const Defs = (props) => (0,external_wp_element_namespaceObject.createElement)("defs", props);
const RadialGradient = (props) => (0,external_wp_element_namespaceObject.createElement)("radialGradient", props);
const LinearGradient = (props) => (0,external_wp_element_namespaceObject.createElement)("linearGradient", props);
const Stop = (props) => (0,external_wp_element_namespaceObject.createElement)("stop", props);
const SVG = (0,external_wp_element_namespaceObject.forwardRef)(
/**
* @param {SVGProps} props isPressed indicates whether the SVG should appear as pressed.
* Other props will be passed through to svg component.
* @param {import('react').ForwardedRef<SVGSVGElement>} ref The forwarded ref to the SVG element.
*
* @return {JSX.Element} Stop component
*/
({ className, isPressed, ...props }, ref) => {
const appliedProps = {
...props,
className: dist_clsx(className, { "is-pressed": isPressed }) || void 0,
"aria-hidden": true,
focusable: false
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("svg", { ...appliedProps, ref });
}
);
SVG.displayName = "SVG";
;// ./node_modules/@wordpress/primitives/build-module/horizontal-rule/index.js
const HorizontalRule = "hr";
;// ./node_modules/@wordpress/primitives/build-module/block-quotation/index.js
const BlockQuotation = "blockquote";
;// ./node_modules/@wordpress/primitives/build-module/view/index.js
const View = "div";
;// ./node_modules/@wordpress/primitives/build-module/index.js
(window.wp = window.wp || {}).primitives = __webpack_exports__;
/******/ })()
; compose.js 0000644 00000435647 15121363553 0006576 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 1933:
/***/ ((module, exports, __webpack_require__) => {
var __WEBPACK_AMD_DEFINE_RESULT__;/*global define:false */
/**
* Copyright 2012-2017 Craig Campbell
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Mousetrap is a simple keyboard shortcut library for Javascript with
* no external dependencies
*
* @version 1.6.5
* @url craig.is/killing/mice
*/
(function(window, document, undefined) {
// Check if mousetrap is used inside browser, if not, return
if (!window) {
return;
}
/**
* mapping of special keycodes to their corresponding keys
*
* everything in this dictionary cannot use keypress events
* so it has to be here to map to the correct keycodes for
* keyup/keydown events
*
* @type {Object}
*/
var _MAP = {
8: 'backspace',
9: 'tab',
13: 'enter',
16: 'shift',
17: 'ctrl',
18: 'alt',
20: 'capslock',
27: 'esc',
32: 'space',
33: 'pageup',
34: 'pagedown',
35: 'end',
36: 'home',
37: 'left',
38: 'up',
39: 'right',
40: 'down',
45: 'ins',
46: 'del',
91: 'meta',
93: 'meta',
224: 'meta'
};
/**
* mapping for special characters so they can support
*
* this dictionary is only used incase you want to bind a
* keyup or keydown event to one of these keys
*
* @type {Object}
*/
var _KEYCODE_MAP = {
106: '*',
107: '+',
109: '-',
110: '.',
111 : '/',
186: ';',
187: '=',
188: ',',
189: '-',
190: '.',
191: '/',
192: '`',
219: '[',
220: '\\',
221: ']',
222: '\''
};
/**
* this is a mapping of keys that require shift on a US keypad
* back to the non shift equivelents
*
* this is so you can use keyup events with these keys
*
* note that this will only work reliably on US keyboards
*
* @type {Object}
*/
var _SHIFT_MAP = {
'~': '`',
'!': '1',
'@': '2',
'#': '3',
'$': '4',
'%': '5',
'^': '6',
'&': '7',
'*': '8',
'(': '9',
')': '0',
'_': '-',
'+': '=',
':': ';',
'\"': '\'',
'<': ',',
'>': '.',
'?': '/',
'|': '\\'
};
/**
* this is a list of special strings you can use to map
* to modifier keys when you specify your keyboard shortcuts
*
* @type {Object}
*/
var _SPECIAL_ALIASES = {
'option': 'alt',
'command': 'meta',
'return': 'enter',
'escape': 'esc',
'plus': '+',
'mod': /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'meta' : 'ctrl'
};
/**
* variable to store the flipped version of _MAP from above
* needed to check if we should use keypress or not when no action
* is specified
*
* @type {Object|undefined}
*/
var _REVERSE_MAP;
/**
* loop through the f keys, f1 to f19 and add them to the map
* programatically
*/
for (var i = 1; i < 20; ++i) {
_MAP[111 + i] = 'f' + i;
}
/**
* loop through to map numbers on the numeric keypad
*/
for (i = 0; i <= 9; ++i) {
// This needs to use a string cause otherwise since 0 is falsey
// mousetrap will never fire for numpad 0 pressed as part of a keydown
// event.
//
// @see https://github.com/ccampbell/mousetrap/pull/258
_MAP[i + 96] = i.toString();
}
/**
* cross browser add event method
*
* @param {Element|HTMLDocument} object
* @param {string} type
* @param {Function} callback
* @returns void
*/
function _addEvent(object, type, callback) {
if (object.addEventListener) {
object.addEventListener(type, callback, false);
return;
}
object.attachEvent('on' + type, callback);
}
/**
* takes the event and returns the key character
*
* @param {Event} e
* @return {string}
*/
function _characterFromEvent(e) {
// for keypress events we should return the character as is
if (e.type == 'keypress') {
var character = String.fromCharCode(e.which);
// if the shift key is not pressed then it is safe to assume
// that we want the character to be lowercase. this means if
// you accidentally have caps lock on then your key bindings
// will continue to work
//
// the only side effect that might not be desired is if you
// bind something like 'A' cause you want to trigger an
// event when capital A is pressed caps lock will no longer
// trigger the event. shift+a will though.
if (!e.shiftKey) {
character = character.toLowerCase();
}
return character;
}
// for non keypress events the special maps are needed
if (_MAP[e.which]) {
return _MAP[e.which];
}
if (_KEYCODE_MAP[e.which]) {
return _KEYCODE_MAP[e.which];
}
// if it is not in the special map
// with keydown and keyup events the character seems to always
// come in as an uppercase character whether you are pressing shift
// or not. we should make sure it is always lowercase for comparisons
return String.fromCharCode(e.which).toLowerCase();
}
/**
* checks if two arrays are equal
*
* @param {Array} modifiers1
* @param {Array} modifiers2
* @returns {boolean}
*/
function _modifiersMatch(modifiers1, modifiers2) {
return modifiers1.sort().join(',') === modifiers2.sort().join(',');
}
/**
* takes a key event and figures out what the modifiers are
*
* @param {Event} e
* @returns {Array}
*/
function _eventModifiers(e) {
var modifiers = [];
if (e.shiftKey) {
modifiers.push('shift');
}
if (e.altKey) {
modifiers.push('alt');
}
if (e.ctrlKey) {
modifiers.push('ctrl');
}
if (e.metaKey) {
modifiers.push('meta');
}
return modifiers;
}
/**
* prevents default for this event
*
* @param {Event} e
* @returns void
*/
function _preventDefault(e) {
if (e.preventDefault) {
e.preventDefault();
return;
}
e.returnValue = false;
}
/**
* stops propogation for this event
*
* @param {Event} e
* @returns void
*/
function _stopPropagation(e) {
if (e.stopPropagation) {
e.stopPropagation();
return;
}
e.cancelBubble = true;
}
/**
* determines if the keycode specified is a modifier key or not
*
* @param {string} key
* @returns {boolean}
*/
function _isModifier(key) {
return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';
}
/**
* reverses the map lookup so that we can look for specific keys
* to see what can and can't use keypress
*
* @return {Object}
*/
function _getReverseMap() {
if (!_REVERSE_MAP) {
_REVERSE_MAP = {};
for (var key in _MAP) {
// pull out the numeric keypad from here cause keypress should
// be able to detect the keys from the character
if (key > 95 && key < 112) {
continue;
}
if (_MAP.hasOwnProperty(key)) {
_REVERSE_MAP[_MAP[key]] = key;
}
}
}
return _REVERSE_MAP;
}
/**
* picks the best action based on the key combination
*
* @param {string} key - character for key
* @param {Array} modifiers
* @param {string=} action passed in
*/
function _pickBestAction(key, modifiers, action) {
// if no action was picked in we should try to pick the one
// that we think would work best for this key
if (!action) {
action = _getReverseMap()[key] ? 'keydown' : 'keypress';
}
// modifier keys don't work as expected with keypress,
// switch to keydown
if (action == 'keypress' && modifiers.length) {
action = 'keydown';
}
return action;
}
/**
* Converts from a string key combination to an array
*
* @param {string} combination like "command+shift+l"
* @return {Array}
*/
function _keysFromString(combination) {
if (combination === '+') {
return ['+'];
}
combination = combination.replace(/\+{2}/g, '+plus');
return combination.split('+');
}
/**
* Gets info for a specific key combination
*
* @param {string} combination key combination ("command+s" or "a" or "*")
* @param {string=} action
* @returns {Object}
*/
function _getKeyInfo(combination, action) {
var keys;
var key;
var i;
var modifiers = [];
// take the keys from this pattern and figure out what the actual
// pattern is all about
keys = _keysFromString(combination);
for (i = 0; i < keys.length; ++i) {
key = keys[i];
// normalize key names
if (_SPECIAL_ALIASES[key]) {
key = _SPECIAL_ALIASES[key];
}
// if this is not a keypress event then we should
// be smart about using shift keys
// this will only work for US keyboards however
if (action && action != 'keypress' && _SHIFT_MAP[key]) {
key = _SHIFT_MAP[key];
modifiers.push('shift');
}
// if this key is a modifier then add it to the list of modifiers
if (_isModifier(key)) {
modifiers.push(key);
}
}
// depending on what the key combination is
// we will try to pick the best event for it
action = _pickBestAction(key, modifiers, action);
return {
key: key,
modifiers: modifiers,
action: action
};
}
function _belongsTo(element, ancestor) {
if (element === null || element === document) {
return false;
}
if (element === ancestor) {
return true;
}
return _belongsTo(element.parentNode, ancestor);
}
function Mousetrap(targetElement) {
var self = this;
targetElement = targetElement || document;
if (!(self instanceof Mousetrap)) {
return new Mousetrap(targetElement);
}
/**
* element to attach key events to
*
* @type {Element}
*/
self.target = targetElement;
/**
* a list of all the callbacks setup via Mousetrap.bind()
*
* @type {Object}
*/
self._callbacks = {};
/**
* direct map of string combinations to callbacks used for trigger()
*
* @type {Object}
*/
self._directMap = {};
/**
* keeps track of what level each sequence is at since multiple
* sequences can start out with the same sequence
*
* @type {Object}
*/
var _sequenceLevels = {};
/**
* variable to store the setTimeout call
*
* @type {null|number}
*/
var _resetTimer;
/**
* temporary state where we will ignore the next keyup
*
* @type {boolean|string}
*/
var _ignoreNextKeyup = false;
/**
* temporary state where we will ignore the next keypress
*
* @type {boolean}
*/
var _ignoreNextKeypress = false;
/**
* are we currently inside of a sequence?
* type of action ("keyup" or "keydown" or "keypress") or false
*
* @type {boolean|string}
*/
var _nextExpectedAction = false;
/**
* resets all sequence counters except for the ones passed in
*
* @param {Object} doNotReset
* @returns void
*/
function _resetSequences(doNotReset) {
doNotReset = doNotReset || {};
var activeSequences = false,
key;
for (key in _sequenceLevels) {
if (doNotReset[key]) {
activeSequences = true;
continue;
}
_sequenceLevels[key] = 0;
}
if (!activeSequences) {
_nextExpectedAction = false;
}
}
/**
* finds all callbacks that match based on the keycode, modifiers,
* and action
*
* @param {string} character
* @param {Array} modifiers
* @param {Event|Object} e
* @param {string=} sequenceName - name of the sequence we are looking for
* @param {string=} combination
* @param {number=} level
* @returns {Array}
*/
function _getMatches(character, modifiers, e, sequenceName, combination, level) {
var i;
var callback;
var matches = [];
var action = e.type;
// if there are no events related to this keycode
if (!self._callbacks[character]) {
return [];
}
// if a modifier key is coming up on its own we should allow it
if (action == 'keyup' && _isModifier(character)) {
modifiers = [character];
}
// loop through all callbacks for the key that was pressed
// and see if any of them match
for (i = 0; i < self._callbacks[character].length; ++i) {
callback = self._callbacks[character][i];
// if a sequence name is not specified, but this is a sequence at
// the wrong level then move onto the next match
if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) {
continue;
}
// if the action we are looking for doesn't match the action we got
// then we should keep going
if (action != callback.action) {
continue;
}
// if this is a keypress event and the meta key and control key
// are not pressed that means that we need to only look at the
// character, otherwise check the modifiers as well
//
// chrome will not fire a keypress if meta or control is down
// safari will fire a keypress if meta or meta+shift is down
// firefox will fire a keypress if meta or control is down
if ((action == 'keypress' && !e.metaKey && !e.ctrlKey) || _modifiersMatch(modifiers, callback.modifiers)) {
// when you bind a combination or sequence a second time it
// should overwrite the first one. if a sequenceName or
// combination is specified in this call it does just that
//
// @todo make deleting its own method?
var deleteCombo = !sequenceName && callback.combo == combination;
var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level;
if (deleteCombo || deleteSequence) {
self._callbacks[character].splice(i, 1);
}
matches.push(callback);
}
}
return matches;
}
/**
* actually calls the callback function
*
* if your callback function returns false this will use the jquery
* convention - prevent default and stop propogation on the event
*
* @param {Function} callback
* @param {Event} e
* @returns void
*/
function _fireCallback(callback, e, combo, sequence) {
// if this event should not happen stop here
if (self.stopCallback(e, e.target || e.srcElement, combo, sequence)) {
return;
}
if (callback(e, combo) === false) {
_preventDefault(e);
_stopPropagation(e);
}
}
/**
* handles a character key event
*
* @param {string} character
* @param {Array} modifiers
* @param {Event} e
* @returns void
*/
self._handleKey = function(character, modifiers, e) {
var callbacks = _getMatches(character, modifiers, e);
var i;
var doNotReset = {};
var maxLevel = 0;
var processedSequenceCallback = false;
// Calculate the maxLevel for sequences so we can only execute the longest callback sequence
for (i = 0; i < callbacks.length; ++i) {
if (callbacks[i].seq) {
maxLevel = Math.max(maxLevel, callbacks[i].level);
}
}
// loop through matching callbacks for this key event
for (i = 0; i < callbacks.length; ++i) {
// fire for all sequence callbacks
// this is because if for example you have multiple sequences
// bound such as "g i" and "g t" they both need to fire the
// callback for matching g cause otherwise you can only ever
// match the first one
if (callbacks[i].seq) {
// only fire callbacks for the maxLevel to prevent
// subsequences from also firing
//
// for example 'a option b' should not cause 'option b' to fire
// even though 'option b' is part of the other sequence
//
// any sequences that do not match here will be discarded
// below by the _resetSequences call
if (callbacks[i].level != maxLevel) {
continue;
}
processedSequenceCallback = true;
// keep a list of which sequences were matches for later
doNotReset[callbacks[i].seq] = 1;
_fireCallback(callbacks[i].callback, e, callbacks[i].combo, callbacks[i].seq);
continue;
}
// if there were no sequence matches but we are still here
// that means this is a regular match so we should fire that
if (!processedSequenceCallback) {
_fireCallback(callbacks[i].callback, e, callbacks[i].combo);
}
}
// if the key you pressed matches the type of sequence without
// being a modifier (ie "keyup" or "keypress") then we should
// reset all sequences that were not matched by this event
//
// this is so, for example, if you have the sequence "h a t" and you
// type "h e a r t" it does not match. in this case the "e" will
// cause the sequence to reset
//
// modifier keys are ignored because you can have a sequence
// that contains modifiers such as "enter ctrl+space" and in most
// cases the modifier key will be pressed before the next key
//
// also if you have a sequence such as "ctrl+b a" then pressing the
// "b" key will trigger a "keypress" and a "keydown"
//
// the "keydown" is expected when there is a modifier, but the
// "keypress" ends up matching the _nextExpectedAction since it occurs
// after and that causes the sequence to reset
//
// we ignore keypresses in a sequence that directly follow a keydown
// for the same character
var ignoreThisKeypress = e.type == 'keypress' && _ignoreNextKeypress;
if (e.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {
_resetSequences(doNotReset);
}
_ignoreNextKeypress = processedSequenceCallback && e.type == 'keydown';
};
/**
* handles a keydown event
*
* @param {Event} e
* @returns void
*/
function _handleKeyEvent(e) {
// normalize e.which for key events
// @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion
if (typeof e.which !== 'number') {
e.which = e.keyCode;
}
var character = _characterFromEvent(e);
// no character found then stop
if (!character) {
return;
}
// need to use === for the character check because the character can be 0
if (e.type == 'keyup' && _ignoreNextKeyup === character) {
_ignoreNextKeyup = false;
return;
}
self.handleKey(character, _eventModifiers(e), e);
}
/**
* called to set a 1 second timeout on the specified sequence
*
* this is so after each key press in the sequence you have 1 second
* to press the next key before you have to start over
*
* @returns void
*/
function _resetSequenceTimer() {
clearTimeout(_resetTimer);
_resetTimer = setTimeout(_resetSequences, 1000);
}
/**
* binds a key sequence to an event
*
* @param {string} combo - combo specified in bind call
* @param {Array} keys
* @param {Function} callback
* @param {string=} action
* @returns void
*/
function _bindSequence(combo, keys, callback, action) {
// start off by adding a sequence level record for this combination
// and setting the level to 0
_sequenceLevels[combo] = 0;
/**
* callback to increase the sequence level for this sequence and reset
* all other sequences that were active
*
* @param {string} nextAction
* @returns {Function}
*/
function _increaseSequence(nextAction) {
return function() {
_nextExpectedAction = nextAction;
++_sequenceLevels[combo];
_resetSequenceTimer();
};
}
/**
* wraps the specified callback inside of another function in order
* to reset all sequence counters as soon as this sequence is done
*
* @param {Event} e
* @returns void
*/
function _callbackAndReset(e) {
_fireCallback(callback, e, combo);
// we should ignore the next key up if the action is key down
// or keypress. this is so if you finish a sequence and
// release the key the final key will not trigger a keyup
if (action !== 'keyup') {
_ignoreNextKeyup = _characterFromEvent(e);
}
// weird race condition if a sequence ends with the key
// another sequence begins with
setTimeout(_resetSequences, 10);
}
// loop through keys one at a time and bind the appropriate callback
// function. for any key leading up to the final one it should
// increase the sequence. after the final, it should reset all sequences
//
// if an action is specified in the original bind call then that will
// be used throughout. otherwise we will pass the action that the
// next key in the sequence should match. this allows a sequence
// to mix and match keypress and keydown events depending on which
// ones are better suited to the key provided
for (var i = 0; i < keys.length; ++i) {
var isFinal = i + 1 === keys.length;
var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i + 1]).action);
_bindSingle(keys[i], wrappedCallback, action, combo, i);
}
}
/**
* binds a single keyboard combination
*
* @param {string} combination
* @param {Function} callback
* @param {string=} action
* @param {string=} sequenceName - name of sequence if part of sequence
* @param {number=} level - what part of the sequence the command is
* @returns void
*/
function _bindSingle(combination, callback, action, sequenceName, level) {
// store a direct mapped reference for use with Mousetrap.trigger
self._directMap[combination + ':' + action] = callback;
// make sure multiple spaces in a row become a single space
combination = combination.replace(/\s+/g, ' ');
var sequence = combination.split(' ');
var info;
// if this pattern is a sequence of keys then run through this method
// to reprocess each pattern one key at a time
if (sequence.length > 1) {
_bindSequence(combination, sequence, callback, action);
return;
}
info = _getKeyInfo(combination, action);
// make sure to initialize array if this is the first time
// a callback is added for this key
self._callbacks[info.key] = self._callbacks[info.key] || [];
// remove an existing match if there is one
_getMatches(info.key, info.modifiers, {type: info.action}, sequenceName, combination, level);
// add this call back to the array
// if it is a sequence put it at the beginning
// if not put it at the end
//
// this is important because the way these are processed expects
// the sequence ones to come first
self._callbacks[info.key][sequenceName ? 'unshift' : 'push']({
callback: callback,
modifiers: info.modifiers,
action: info.action,
seq: sequenceName,
level: level,
combo: combination
});
}
/**
* binds multiple combinations to the same callback
*
* @param {Array} combinations
* @param {Function} callback
* @param {string|undefined} action
* @returns void
*/
self._bindMultiple = function(combinations, callback, action) {
for (var i = 0; i < combinations.length; ++i) {
_bindSingle(combinations[i], callback, action);
}
};
// start!
_addEvent(targetElement, 'keypress', _handleKeyEvent);
_addEvent(targetElement, 'keydown', _handleKeyEvent);
_addEvent(targetElement, 'keyup', _handleKeyEvent);
}
/**
* binds an event to mousetrap
*
* can be a single key, a combination of keys separated with +,
* an array of keys, or a sequence of keys separated by spaces
*
* be sure to list the modifier keys first to make sure that the
* correct key ends up getting bound (the last key in the pattern)
*
* @param {string|Array} keys
* @param {Function} callback
* @param {string=} action - 'keypress', 'keydown', or 'keyup'
* @returns void
*/
Mousetrap.prototype.bind = function(keys, callback, action) {
var self = this;
keys = keys instanceof Array ? keys : [keys];
self._bindMultiple.call(self, keys, callback, action);
return self;
};
/**
* unbinds an event to mousetrap
*
* the unbinding sets the callback function of the specified key combo
* to an empty function and deletes the corresponding key in the
* _directMap dict.
*
* TODO: actually remove this from the _callbacks dictionary instead
* of binding an empty function
*
* the keycombo+action has to be exactly the same as
* it was defined in the bind method
*
* @param {string|Array} keys
* @param {string} action
* @returns void
*/
Mousetrap.prototype.unbind = function(keys, action) {
var self = this;
return self.bind.call(self, keys, function() {}, action);
};
/**
* triggers an event that has already been bound
*
* @param {string} keys
* @param {string=} action
* @returns void
*/
Mousetrap.prototype.trigger = function(keys, action) {
var self = this;
if (self._directMap[keys + ':' + action]) {
self._directMap[keys + ':' + action]({}, keys);
}
return self;
};
/**
* resets the library back to its initial state. this is useful
* if you want to clear out the current keyboard shortcuts and bind
* new ones - for example if you switch to another page
*
* @returns void
*/
Mousetrap.prototype.reset = function() {
var self = this;
self._callbacks = {};
self._directMap = {};
return self;
};
/**
* should we stop this event before firing off callbacks
*
* @param {Event} e
* @param {Element} element
* @return {boolean}
*/
Mousetrap.prototype.stopCallback = function(e, element) {
var self = this;
// if the element has the class "mousetrap" then no need to stop
if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {
return false;
}
if (_belongsTo(element, self.target)) {
return false;
}
// Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,
// not the initial event target in the shadow tree. Note that not all events cross the
// shadow boundary.
// For shadow trees with `mode: 'open'`, the initial event target is the first element in
// the event’s composed path. For shadow trees with `mode: 'closed'`, the initial event
// target cannot be obtained.
if ('composedPath' in e && typeof e.composedPath === 'function') {
// For open shadow trees, update `element` so that the following check works.
var initialEventTarget = e.composedPath()[0];
if (initialEventTarget !== e.target) {
element = initialEventTarget;
}
}
// stop for input, select, and textarea
return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;
};
/**
* exposes _handleKey publicly so it can be overwritten by extensions
*/
Mousetrap.prototype.handleKey = function() {
var self = this;
return self._handleKey.apply(self, arguments);
};
/**
* allow custom key mappings
*/
Mousetrap.addKeycodes = function(object) {
for (var key in object) {
if (object.hasOwnProperty(key)) {
_MAP[key] = object[key];
}
}
_REVERSE_MAP = null;
};
/**
* Init the global mousetrap functions
*
* This method is needed to allow the global mousetrap functions to work
* now that mousetrap is a constructor function.
*/
Mousetrap.init = function() {
var documentMousetrap = Mousetrap(document);
for (var method in documentMousetrap) {
if (method.charAt(0) !== '_') {
Mousetrap[method] = (function(method) {
return function() {
return documentMousetrap[method].apply(documentMousetrap, arguments);
};
} (method));
}
}
};
Mousetrap.init();
// expose mousetrap to the global object
window.Mousetrap = Mousetrap;
// expose as a common js module
if ( true && module.exports) {
module.exports = Mousetrap;
}
// expose mousetrap as an AMD module
if (true) {
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
return Mousetrap;
}).call(exports, __webpack_require__, exports, module),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
}
}) (typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);
/***/ }),
/***/ 3758:
/***/ (function(module) {
/*!
* clipboard.js v2.0.11
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(true)
module.exports = factory();
else {}
})(this, function() {
return /******/ (function() { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 686:
/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_623__) {
"use strict";
// EXPORTS
__nested_webpack_require_623__.d(__nested_webpack_exports__, {
"default": function() { return /* binding */ clipboard; }
});
// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js
var tiny_emitter = __nested_webpack_require_623__(279);
var tiny_emitter_default = /*#__PURE__*/__nested_webpack_require_623__.n(tiny_emitter);
// EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js
var listen = __nested_webpack_require_623__(370);
var listen_default = /*#__PURE__*/__nested_webpack_require_623__.n(listen);
// EXTERNAL MODULE: ./node_modules/select/src/select.js
var src_select = __nested_webpack_require_623__(817);
var select_default = /*#__PURE__*/__nested_webpack_require_623__.n(src_select);
;// CONCATENATED MODULE: ./src/common/command.js
/**
* Executes a given operation type.
* @param {String} type
* @return {Boolean}
*/
function command(type) {
try {
return document.execCommand(type);
} catch (err) {
return false;
}
}
;// CONCATENATED MODULE: ./src/actions/cut.js
/**
* Cut action wrapper.
* @param {String|HTMLElement} target
* @return {String}
*/
var ClipboardActionCut = function ClipboardActionCut(target) {
var selectedText = select_default()(target);
command('cut');
return selectedText;
};
/* harmony default export */ var actions_cut = (ClipboardActionCut);
;// CONCATENATED MODULE: ./src/common/create-fake-element.js
/**
* Creates a fake textarea element with a value.
* @param {String} value
* @return {HTMLElement}
*/
function createFakeElement(value) {
var isRTL = document.documentElement.getAttribute('dir') === 'rtl';
var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS
fakeElement.style.fontSize = '12pt'; // Reset box model
fakeElement.style.border = '0';
fakeElement.style.padding = '0';
fakeElement.style.margin = '0'; // Move element out of screen horizontally
fakeElement.style.position = 'absolute';
fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically
var yPosition = window.pageYOffset || document.documentElement.scrollTop;
fakeElement.style.top = "".concat(yPosition, "px");
fakeElement.setAttribute('readonly', '');
fakeElement.value = value;
return fakeElement;
}
;// CONCATENATED MODULE: ./src/actions/copy.js
/**
* Create fake copy action wrapper using a fake element.
* @param {String} target
* @param {Object} options
* @return {String}
*/
var fakeCopyAction = function fakeCopyAction(value, options) {
var fakeElement = createFakeElement(value);
options.container.appendChild(fakeElement);
var selectedText = select_default()(fakeElement);
command('copy');
fakeElement.remove();
return selectedText;
};
/**
* Copy action wrapper.
* @param {String|HTMLElement} target
* @param {Object} options
* @return {String}
*/
var ClipboardActionCopy = function ClipboardActionCopy(target) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
container: document.body
};
var selectedText = '';
if (typeof target === 'string') {
selectedText = fakeCopyAction(target, options);
} else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) {
// If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange
selectedText = fakeCopyAction(target.value, options);
} else {
selectedText = select_default()(target);
command('copy');
}
return selectedText;
};
/* harmony default export */ var actions_copy = (ClipboardActionCopy);
;// CONCATENATED MODULE: ./src/actions/default.js
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
/**
* Inner function which performs selection from either `text` or `target`
* properties and then executes copy or cut operations.
* @param {Object} options
*/
var ClipboardActionDefault = function ClipboardActionDefault() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
// Defines base properties passed from constructor.
var _options$action = options.action,
action = _options$action === void 0 ? 'copy' : _options$action,
container = options.container,
target = options.target,
text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'.
if (action !== 'copy' && action !== 'cut') {
throw new Error('Invalid "action" value, use either "copy" or "cut"');
} // Sets the `target` property using an element that will be have its content copied.
if (target !== undefined) {
if (target && _typeof(target) === 'object' && target.nodeType === 1) {
if (action === 'copy' && target.hasAttribute('disabled')) {
throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
}
if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
}
} else {
throw new Error('Invalid "target" value, use a valid Element');
}
} // Define selection strategy based on `text` property.
if (text) {
return actions_copy(text, {
container: container
});
} // Defines which selection strategy based on `target` property.
if (target) {
return action === 'cut' ? actions_cut(target) : actions_copy(target, {
container: container
});
}
};
/* harmony default export */ var actions_default = (ClipboardActionDefault);
;// CONCATENATED MODULE: ./src/clipboard.js
function clipboard_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return clipboard_typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
/**
* Helper function to retrieve attribute value.
* @param {String} suffix
* @param {Element} element
*/
function getAttributeValue(suffix, element) {
var attribute = "data-clipboard-".concat(suffix);
if (!element.hasAttribute(attribute)) {
return;
}
return element.getAttribute(attribute);
}
/**
* Base class which takes one or more elements, adds event listeners to them,
* and instantiates a new `ClipboardAction` on each click.
*/
var Clipboard = /*#__PURE__*/function (_Emitter) {
_inherits(Clipboard, _Emitter);
var _super = _createSuper(Clipboard);
/**
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger
* @param {Object} options
*/
function Clipboard(trigger, options) {
var _this;
_classCallCheck(this, Clipboard);
_this = _super.call(this);
_this.resolveOptions(options);
_this.listenClick(trigger);
return _this;
}
/**
* Defines if attributes would be resolved using internal setter functions
* or custom functions that were passed in the constructor.
* @param {Object} options
*/
_createClass(Clipboard, [{
key: "resolveOptions",
value: function resolveOptions() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
this.text = typeof options.text === 'function' ? options.text : this.defaultText;
this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body;
}
/**
* Adds a click event listener to the passed trigger.
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger
*/
}, {
key: "listenClick",
value: function listenClick(trigger) {
var _this2 = this;
this.listener = listen_default()(trigger, 'click', function (e) {
return _this2.onClick(e);
});
}
/**
* Defines a new `ClipboardAction` on each click event.
* @param {Event} e
*/
}, {
key: "onClick",
value: function onClick(e) {
var trigger = e.delegateTarget || e.currentTarget;
var action = this.action(trigger) || 'copy';
var text = actions_default({
action: action,
container: this.container,
target: this.target(trigger),
text: this.text(trigger)
}); // Fires an event based on the copy operation result.
this.emit(text ? 'success' : 'error', {
action: action,
text: text,
trigger: trigger,
clearSelection: function clearSelection() {
if (trigger) {
trigger.focus();
}
window.getSelection().removeAllRanges();
}
});
}
/**
* Default `action` lookup function.
* @param {Element} trigger
*/
}, {
key: "defaultAction",
value: function defaultAction(trigger) {
return getAttributeValue('action', trigger);
}
/**
* Default `target` lookup function.
* @param {Element} trigger
*/
}, {
key: "defaultTarget",
value: function defaultTarget(trigger) {
var selector = getAttributeValue('target', trigger);
if (selector) {
return document.querySelector(selector);
}
}
/**
* Allow fire programmatically a copy action
* @param {String|HTMLElement} target
* @param {Object} options
* @returns Text copied.
*/
}, {
key: "defaultText",
/**
* Default `text` lookup function.
* @param {Element} trigger
*/
value: function defaultText(trigger) {
return getAttributeValue('text', trigger);
}
/**
* Destroy lifecycle.
*/
}, {
key: "destroy",
value: function destroy() {
this.listener.destroy();
}
}], [{
key: "copy",
value: function copy(target) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
container: document.body
};
return actions_copy(target, options);
}
/**
* Allow fire programmatically a cut action
* @param {String|HTMLElement} target
* @returns Text cutted.
*/
}, {
key: "cut",
value: function cut(target) {
return actions_cut(target);
}
/**
* Returns the support of the given action, or all actions if no action is
* given.
* @param {String} [action]
*/
}, {
key: "isSupported",
value: function isSupported() {
var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];
var actions = typeof action === 'string' ? [action] : action;
var support = !!document.queryCommandSupported;
actions.forEach(function (action) {
support = support && !!document.queryCommandSupported(action);
});
return support;
}
}]);
return Clipboard;
}((tiny_emitter_default()));
/* harmony default export */ var clipboard = (Clipboard);
/***/ }),
/***/ 828:
/***/ (function(module) {
var DOCUMENT_NODE_TYPE = 9;
/**
* A polyfill for Element.matches()
*/
if (typeof Element !== 'undefined' && !Element.prototype.matches) {
var proto = Element.prototype;
proto.matches = proto.matchesSelector ||
proto.mozMatchesSelector ||
proto.msMatchesSelector ||
proto.oMatchesSelector ||
proto.webkitMatchesSelector;
}
/**
* Finds the closest parent that matches a selector.
*
* @param {Element} element
* @param {String} selector
* @return {Function}
*/
function closest (element, selector) {
while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
if (typeof element.matches === 'function' &&
element.matches(selector)) {
return element;
}
element = element.parentNode;
}
}
module.exports = closest;
/***/ }),
/***/ 438:
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_15749__) {
var closest = __nested_webpack_require_15749__(828);
/**
* Delegates event to a selector.
*
* @param {Element} element
* @param {String} selector
* @param {String} type
* @param {Function} callback
* @param {Boolean} useCapture
* @return {Object}
*/
function _delegate(element, selector, type, callback, useCapture) {
var listenerFn = listener.apply(this, arguments);
element.addEventListener(type, listenerFn, useCapture);
return {
destroy: function() {
element.removeEventListener(type, listenerFn, useCapture);
}
}
}
/**
* Delegates event to a selector.
*
* @param {Element|String|Array} [elements]
* @param {String} selector
* @param {String} type
* @param {Function} callback
* @param {Boolean} useCapture
* @return {Object}
*/
function delegate(elements, selector, type, callback, useCapture) {
// Handle the regular Element usage
if (typeof elements.addEventListener === 'function') {
return _delegate.apply(null, arguments);
}
// Handle Element-less usage, it defaults to global delegation
if (typeof type === 'function') {
// Use `document` as the first parameter, then apply arguments
// This is a short way to .unshift `arguments` without running into deoptimizations
return _delegate.bind(null, document).apply(null, arguments);
}
// Handle Selector-based usage
if (typeof elements === 'string') {
elements = document.querySelectorAll(elements);
}
// Handle Array-like based usage
return Array.prototype.map.call(elements, function (element) {
return _delegate(element, selector, type, callback, useCapture);
});
}
/**
* Finds closest match and invokes callback.
*
* @param {Element} element
* @param {String} selector
* @param {String} type
* @param {Function} callback
* @return {Function}
*/
function listener(element, selector, type, callback) {
return function(e) {
e.delegateTarget = closest(e.target, selector);
if (e.delegateTarget) {
callback.call(element, e);
}
}
}
module.exports = delegate;
/***/ }),
/***/ 879:
/***/ (function(__unused_webpack_module, exports) {
/**
* Check if argument is a HTML element.
*
* @param {Object} value
* @return {Boolean}
*/
exports.node = function(value) {
return value !== undefined
&& value instanceof HTMLElement
&& value.nodeType === 1;
};
/**
* Check if argument is a list of HTML elements.
*
* @param {Object} value
* @return {Boolean}
*/
exports.nodeList = function(value) {
var type = Object.prototype.toString.call(value);
return value !== undefined
&& (type === '[object NodeList]' || type === '[object HTMLCollection]')
&& ('length' in value)
&& (value.length === 0 || exports.node(value[0]));
};
/**
* Check if argument is a string.
*
* @param {Object} value
* @return {Boolean}
*/
exports.string = function(value) {
return typeof value === 'string'
|| value instanceof String;
};
/**
* Check if argument is a function.
*
* @param {Object} value
* @return {Boolean}
*/
exports.fn = function(value) {
var type = Object.prototype.toString.call(value);
return type === '[object Function]';
};
/***/ }),
/***/ 370:
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_19113__) {
var is = __nested_webpack_require_19113__(879);
var delegate = __nested_webpack_require_19113__(438);
/**
* Validates all params and calls the right
* listener function based on its target type.
*
* @param {String|HTMLElement|HTMLCollection|NodeList} target
* @param {String} type
* @param {Function} callback
* @return {Object}
*/
function listen(target, type, callback) {
if (!target && !type && !callback) {
throw new Error('Missing required arguments');
}
if (!is.string(type)) {
throw new TypeError('Second argument must be a String');
}
if (!is.fn(callback)) {
throw new TypeError('Third argument must be a Function');
}
if (is.node(target)) {
return listenNode(target, type, callback);
}
else if (is.nodeList(target)) {
return listenNodeList(target, type, callback);
}
else if (is.string(target)) {
return listenSelector(target, type, callback);
}
else {
throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
}
}
/**
* Adds an event listener to a HTML element
* and returns a remove listener function.
*
* @param {HTMLElement} node
* @param {String} type
* @param {Function} callback
* @return {Object}
*/
function listenNode(node, type, callback) {
node.addEventListener(type, callback);
return {
destroy: function() {
node.removeEventListener(type, callback);
}
}
}
/**
* Add an event listener to a list of HTML elements
* and returns a remove listener function.
*
* @param {NodeList|HTMLCollection} nodeList
* @param {String} type
* @param {Function} callback
* @return {Object}
*/
function listenNodeList(nodeList, type, callback) {
Array.prototype.forEach.call(nodeList, function(node) {
node.addEventListener(type, callback);
});
return {
destroy: function() {
Array.prototype.forEach.call(nodeList, function(node) {
node.removeEventListener(type, callback);
});
}
}
}
/**
* Add an event listener to a selector
* and returns a remove listener function.
*
* @param {String} selector
* @param {String} type
* @param {Function} callback
* @return {Object}
*/
function listenSelector(selector, type, callback) {
return delegate(document.body, selector, type, callback);
}
module.exports = listen;
/***/ }),
/***/ 817:
/***/ (function(module) {
function select(element) {
var selectedText;
if (element.nodeName === 'SELECT') {
element.focus();
selectedText = element.value;
}
else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
var isReadOnly = element.hasAttribute('readonly');
if (!isReadOnly) {
element.setAttribute('readonly', '');
}
element.select();
element.setSelectionRange(0, element.value.length);
if (!isReadOnly) {
element.removeAttribute('readonly');
}
selectedText = element.value;
}
else {
if (element.hasAttribute('contenteditable')) {
element.focus();
}
var selection = window.getSelection();
var range = document.createRange();
range.selectNodeContents(element);
selection.removeAllRanges();
selection.addRange(range);
selectedText = selection.toString();
}
return selectedText;
}
module.exports = select;
/***/ }),
/***/ 279:
/***/ (function(module) {
function E () {
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
}
E.prototype = {
on: function (name, callback, ctx) {
var e = this.e || (this.e = {});
(e[name] || (e[name] = [])).push({
fn: callback,
ctx: ctx
});
return this;
},
once: function (name, callback, ctx) {
var self = this;
function listener () {
self.off(name, listener);
callback.apply(ctx, arguments);
};
listener._ = callback
return this.on(name, listener, ctx);
},
emit: function (name) {
var data = [].slice.call(arguments, 1);
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
var i = 0;
var len = evtArr.length;
for (i; i < len; i++) {
evtArr[i].fn.apply(evtArr[i].ctx, data);
}
return this;
},
off: function (name, callback) {
var e = this.e || (this.e = {});
var evts = e[name];
var liveEvents = [];
if (evts && callback) {
for (var i = 0, len = evts.length; i < len; i++) {
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
liveEvents.push(evts[i]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
(liveEvents.length)
? e[name] = liveEvents
: delete e[name];
return this;
}
};
module.exports = E;
module.exports.TinyEmitter = E;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __nested_webpack_require_24495__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_24495__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ !function() {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __nested_webpack_require_24495__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function() { return module['default']; } :
/******/ function() { return module; };
/******/ __nested_webpack_require_24495__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ !function() {
/******/ // define getter functions for harmony exports
/******/ __nested_webpack_require_24495__.d = function(exports, definition) {
/******/ for(var key in definition) {
/******/ if(__nested_webpack_require_24495__.o(definition, key) && !__nested_webpack_require_24495__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ !function() {
/******/ __nested_webpack_require_24495__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ }();
/******/
/************************************************************************/
/******/ // module exports must be returned from runtime so entry inlining is disabled
/******/ // startup
/******/ // Load entry module and return exports
/******/ return __nested_webpack_require_24495__(686);
/******/ })()
.default;
});
/***/ }),
/***/ 5760:
/***/ (() => {
/**
* adds a bindGlobal method to Mousetrap that allows you to
* bind specific keyboard shortcuts that will still work
* inside a text input field
*
* usage:
* Mousetrap.bindGlobal('ctrl+s', _saveChanges);
*/
/* global Mousetrap:true */
(function(Mousetrap) {
if (! Mousetrap) {
return;
}
var _globalCallbacks = {};
var _originalStopCallback = Mousetrap.prototype.stopCallback;
Mousetrap.prototype.stopCallback = function(e, element, combo, sequence) {
var self = this;
if (self.paused) {
return true;
}
if (_globalCallbacks[combo] || _globalCallbacks[sequence]) {
return false;
}
return _originalStopCallback.call(self, e, element, combo);
};
Mousetrap.prototype.bindGlobal = function(keys, callback, action) {
var self = this;
self.bind(keys, callback, action);
if (keys instanceof Array) {
for (var i = 0; i < keys.length; i++) {
_globalCallbacks[keys[i]] = true;
}
return;
}
_globalCallbacks[keys] = true;
};
Mousetrap.init();
}) (typeof Mousetrap !== "undefined" ? Mousetrap : undefined);
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
(() => {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
__experimentalUseDialog: () => (/* reexport */ use_dialog_default),
__experimentalUseDragging: () => (/* reexport */ useDragging),
__experimentalUseDropZone: () => (/* reexport */ useDropZone),
__experimentalUseFixedWindowList: () => (/* reexport */ useFixedWindowList),
__experimentalUseFocusOutside: () => (/* reexport */ useFocusOutside),
compose: () => (/* reexport */ compose_default),
createHigherOrderComponent: () => (/* reexport */ createHigherOrderComponent),
debounce: () => (/* reexport */ debounce),
ifCondition: () => (/* reexport */ if_condition_default),
observableMap: () => (/* reexport */ observableMap),
pipe: () => (/* reexport */ pipe_default),
pure: () => (/* reexport */ pure_default),
throttle: () => (/* reexport */ throttle),
useAsyncList: () => (/* reexport */ use_async_list_default),
useConstrainedTabbing: () => (/* reexport */ use_constrained_tabbing_default),
useCopyOnClick: () => (/* reexport */ useCopyOnClick),
useCopyToClipboard: () => (/* reexport */ useCopyToClipboard),
useDebounce: () => (/* reexport */ useDebounce),
useDebouncedInput: () => (/* reexport */ useDebouncedInput),
useDisabled: () => (/* reexport */ useDisabled),
useEvent: () => (/* reexport */ useEvent),
useFocusOnMount: () => (/* reexport */ useFocusOnMount),
useFocusReturn: () => (/* reexport */ use_focus_return_default),
useFocusableIframe: () => (/* reexport */ useFocusableIframe),
useInstanceId: () => (/* reexport */ use_instance_id_default),
useIsomorphicLayoutEffect: () => (/* reexport */ use_isomorphic_layout_effect_default),
useKeyboardShortcut: () => (/* reexport */ use_keyboard_shortcut_default),
useMediaQuery: () => (/* reexport */ useMediaQuery),
useMergeRefs: () => (/* reexport */ useMergeRefs),
useObservableValue: () => (/* reexport */ useObservableValue),
usePrevious: () => (/* reexport */ usePrevious),
useReducedMotion: () => (/* reexport */ use_reduced_motion_default),
useRefEffect: () => (/* reexport */ useRefEffect),
useResizeObserver: () => (/* reexport */ use_resize_observer_useResizeObserver),
useStateWithHistory: () => (/* reexport */ useStateWithHistory),
useThrottle: () => (/* reexport */ useThrottle),
useViewportMatch: () => (/* reexport */ use_viewport_match_default),
useWarnOnChange: () => (/* reexport */ use_warn_on_change_default),
withGlobalEvents: () => (/* reexport */ withGlobalEvents),
withInstanceId: () => (/* reexport */ with_instance_id_default),
withSafeTimeout: () => (/* reexport */ with_safe_timeout_default),
withState: () => (/* reexport */ withState)
});
;// ./node_modules/tslib/tslib.es6.mjs
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
}
return __assign.apply(this, arguments);
}
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
}
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
var _, done = false;
for (var i = decorators.length - 1; i >= 0; i--) {
var context = {};
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
if (kind === "accessor") {
if (result === void 0) continue;
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
if (_ = accept(result.get)) descriptor.get = _;
if (_ = accept(result.set)) descriptor.set = _;
if (_ = accept(result.init)) initializers.unshift(_);
}
else if (_ = accept(result)) {
if (kind === "field") initializers.unshift(_);
else descriptor[key] = _;
}
}
if (target) Object.defineProperty(target, contextIn.name, descriptor);
done = true;
};
function __runInitializers(thisArg, initializers, value) {
var useValue = arguments.length > 2;
for (var i = 0; i < initializers.length; i++) {
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
}
return useValue ? value : void 0;
};
function __propKey(x) {
return typeof x === "symbol" ? x : "".concat(x);
};
function __setFunctionName(f, name, prefix) {
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
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;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
var __createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
});
function __exportStar(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
}
/** @deprecated */
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
/** @deprecated */
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}
function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}
function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
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);
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); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}
function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __setModuleDefault = Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
};
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
}
function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
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");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
function __classPrivateFieldSet(receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
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");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}
function __classPrivateFieldIn(state, receiver) {
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
return typeof state === "function" ? receiver === state : state.has(receiver);
}
function __addDisposableResource(env, value, async) {
if (value !== null && value !== void 0) {
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
var dispose, inner;
if (async) {
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
dispose = value[Symbol.asyncDispose];
}
if (dispose === void 0) {
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
dispose = value[Symbol.dispose];
if (async) inner = dispose;
}
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
env.stack.push({ value: value, dispose: dispose, async: async });
}
else if (async) {
env.stack.push({ async: true });
}
return value;
}
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
function __disposeResources(env) {
function fail(e) {
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
env.hasError = true;
}
var r, s = 0;
function next() {
while (r = env.stack.pop()) {
try {
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
if (r.dispose) {
var result = r.dispose.call(r.value);
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
}
else s |= 1;
}
catch (e) {
fail(e);
}
}
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
if (env.hasError) throw env.error;
}
return next();
}
function __rewriteRelativeImportExtension(path, preserveJsx) {
if (typeof path === "string" && /^\.\.?\//.test(path)) {
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
});
}
return path;
}
/* harmony default export */ const tslib_es6 = ({
__extends,
__assign,
__rest,
__decorate,
__param,
__esDecorate,
__runInitializers,
__propKey,
__setFunctionName,
__metadata,
__awaiter,
__generator,
__createBinding,
__exportStar,
__values,
__read,
__spread,
__spreadArrays,
__spreadArray,
__await,
__asyncGenerator,
__asyncDelegator,
__asyncValues,
__makeTemplateObject,
__importStar,
__importDefault,
__classPrivateFieldGet,
__classPrivateFieldSet,
__classPrivateFieldIn,
__addDisposableResource,
__disposeResources,
__rewriteRelativeImportExtension,
});
;// ./node_modules/lower-case/dist.es2015/index.js
/**
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
*/
var SUPPORTED_LOCALE = {
tr: {
regexp: /\u0130|\u0049|\u0049\u0307/g,
map: {
İ: "\u0069",
I: "\u0131",
İ: "\u0069",
},
},
az: {
regexp: /\u0130/g,
map: {
İ: "\u0069",
I: "\u0131",
İ: "\u0069",
},
},
lt: {
regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
map: {
I: "\u0069\u0307",
J: "\u006A\u0307",
Į: "\u012F\u0307",
Ì: "\u0069\u0307\u0300",
Í: "\u0069\u0307\u0301",
Ĩ: "\u0069\u0307\u0303",
},
},
};
/**
* Localized lower case.
*/
function localeLowerCase(str, locale) {
var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
if (lang)
return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
return lowerCase(str);
}
/**
* Lower case as a function.
*/
function lowerCase(str) {
return str.toLowerCase();
}
;// ./node_modules/no-case/dist.es2015/index.js
// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
// Remove all non-word characters.
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
/**
* Normalize the string into something other libraries can manipulate easier.
*/
function noCase(input, options) {
if (options === void 0) { options = {}; }
var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
var start = 0;
var end = result.length;
// Trim the delimiter from around the output string.
while (result.charAt(start) === "\0")
start++;
while (result.charAt(end - 1) === "\0")
end--;
// Transform each token independently.
return result.slice(start, end).split("\0").map(transform).join(delimiter);
}
/**
* Replace `re` in the input string with the replacement value.
*/
function replace(input, re, value) {
if (re instanceof RegExp)
return input.replace(re, value);
return re.reduce(function (input, re) { return input.replace(re, value); }, input);
}
;// ./node_modules/pascal-case/dist.es2015/index.js
function pascalCaseTransform(input, index) {
var firstChar = input.charAt(0);
var lowerChars = input.substr(1).toLowerCase();
if (index > 0 && firstChar >= "0" && firstChar <= "9") {
return "_" + firstChar + lowerChars;
}
return "" + firstChar.toUpperCase() + lowerChars;
}
function pascalCaseTransformMerge(input) {
return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();
}
function pascalCase(input, options) {
if (options === void 0) { options = {}; }
return noCase(input, __assign({ delimiter: "", transform: pascalCaseTransform }, options));
}
;// ./node_modules/@wordpress/compose/build-module/utils/create-higher-order-component/index.js
function createHigherOrderComponent(mapComponent, modifierName) {
return (Inner) => {
const Outer = mapComponent(Inner);
Outer.displayName = hocName(modifierName, Inner);
return Outer;
};
}
const hocName = (name, Inner) => {
const inner = Inner.displayName || Inner.name || "Component";
const outer = pascalCase(name ?? "");
return `${outer}(${inner})`;
};
;// ./node_modules/@wordpress/compose/build-module/utils/debounce/index.js
const debounce = (func, wait, options) => {
let lastArgs;
let lastThis;
let maxWait = 0;
let result;
let timerId;
let lastCallTime;
let lastInvokeTime = 0;
let leading = false;
let maxing = false;
let trailing = true;
if (options) {
leading = !!options.leading;
maxing = "maxWait" in options;
if (options.maxWait !== void 0) {
maxWait = Math.max(options.maxWait, wait);
}
trailing = "trailing" in options ? !!options.trailing : trailing;
}
function invokeFunc(time) {
const args = lastArgs;
const thisArg = lastThis;
lastArgs = void 0;
lastThis = void 0;
lastInvokeTime = time;
result = func.apply(thisArg, args);
return result;
}
function startTimer(pendingFunc, waitTime) {
timerId = setTimeout(pendingFunc, waitTime);
}
function cancelTimer() {
if (timerId !== void 0) {
clearTimeout(timerId);
}
}
function leadingEdge(time) {
lastInvokeTime = time;
startTimer(timerExpired, wait);
return leading ? invokeFunc(time) : result;
}
function getTimeSinceLastCall(time) {
return time - (lastCallTime || 0);
}
function remainingWait(time) {
const timeSinceLastCall = getTimeSinceLastCall(time);
const timeSinceLastInvoke = time - lastInvokeTime;
const timeWaiting = wait - timeSinceLastCall;
return maxing ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
}
function shouldInvoke(time) {
const timeSinceLastCall = getTimeSinceLastCall(time);
const timeSinceLastInvoke = time - lastInvokeTime;
return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
}
function timerExpired() {
const time = Date.now();
if (shouldInvoke(time)) {
return trailingEdge(time);
}
startTimer(timerExpired, remainingWait(time));
return void 0;
}
function clearTimer() {
timerId = void 0;
}
function trailingEdge(time) {
clearTimer();
if (trailing && lastArgs) {
return invokeFunc(time);
}
lastArgs = lastThis = void 0;
return result;
}
function cancel() {
cancelTimer();
lastInvokeTime = 0;
clearTimer();
lastArgs = lastCallTime = lastThis = void 0;
}
function flush() {
return pending() ? trailingEdge(Date.now()) : result;
}
function pending() {
return timerId !== void 0;
}
function debounced(...args) {
const time = Date.now();
const isInvoking = shouldInvoke(time);
lastArgs = args;
lastThis = this;
lastCallTime = time;
if (isInvoking) {
if (!pending()) {
return leadingEdge(lastCallTime);
}
if (maxing) {
startTimer(timerExpired, wait);
return invokeFunc(lastCallTime);
}
}
if (!pending()) {
startTimer(timerExpired, wait);
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
debounced.pending = pending;
return debounced;
};
;// ./node_modules/@wordpress/compose/build-module/utils/throttle/index.js
const throttle = (func, wait, options) => {
let leading = true;
let trailing = true;
if (options) {
leading = "leading" in options ? !!options.leading : leading;
trailing = "trailing" in options ? !!options.trailing : trailing;
}
return debounce(func, wait, {
leading,
trailing,
maxWait: wait
});
};
;// ./node_modules/@wordpress/compose/build-module/utils/observable-map/index.js
function observableMap() {
const map = /* @__PURE__ */ new Map();
const listeners = /* @__PURE__ */ new Map();
function callListeners(name) {
const list = listeners.get(name);
if (!list) {
return;
}
for (const listener of list) {
listener();
}
}
return {
get(name) {
return map.get(name);
},
set(name, value) {
map.set(name, value);
callListeners(name);
},
delete(name) {
map.delete(name);
callListeners(name);
},
subscribe(name, listener) {
let list = listeners.get(name);
if (!list) {
list = /* @__PURE__ */ new Set();
listeners.set(name, list);
}
list.add(listener);
return () => {
list.delete(listener);
if (list.size === 0) {
listeners.delete(name);
}
};
}
};
}
;// ./node_modules/@wordpress/compose/build-module/higher-order/pipe.js
const basePipe = (reverse = false) => (...funcs) => (...args) => {
const functions = funcs.flat();
if (reverse) {
functions.reverse();
}
return functions.reduce(
(prev, func) => [func(...prev)],
args
)[0];
};
const pipe = basePipe();
var pipe_default = pipe;
;// ./node_modules/@wordpress/compose/build-module/higher-order/compose.js
const compose = basePipe(true);
var compose_default = compose;
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// ./node_modules/@wordpress/compose/build-module/higher-order/if-condition/index.js
function ifCondition(predicate) {
return createHigherOrderComponent(
(WrappedComponent) => (props) => {
if (!predicate(props)) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { ...props });
},
"ifCondition"
);
}
var if_condition_default = ifCondition;
;// external ["wp","isShallowEqual"]
const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"];
var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject);
;// external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// ./node_modules/@wordpress/compose/build-module/higher-order/pure/index.js
const pure = createHigherOrderComponent(function(WrappedComponent) {
if (WrappedComponent.prototype instanceof external_wp_element_namespaceObject.Component) {
return class extends WrappedComponent {
shouldComponentUpdate(nextProps, nextState) {
return !external_wp_isShallowEqual_default()(nextProps, this.props) || !external_wp_isShallowEqual_default()(nextState, this.state);
}
};
}
return class extends external_wp_element_namespaceObject.Component {
shouldComponentUpdate(nextProps) {
return !external_wp_isShallowEqual_default()(nextProps, this.props);
}
render() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { ...this.props });
}
};
}, "pure");
var pure_default = pure;
;// external ["wp","deprecated"]
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
;// ./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/listener.js
class Listener {
constructor() {
this.listeners = {};
this.handleEvent = this.handleEvent.bind(this);
}
add(eventType, instance) {
if (!this.listeners[eventType]) {
window.addEventListener(eventType, this.handleEvent);
this.listeners[eventType] = [];
}
this.listeners[eventType].push(instance);
}
remove(eventType, instance) {
if (!this.listeners[eventType]) {
return;
}
this.listeners[eventType] = this.listeners[eventType].filter(
(listener) => listener !== instance
);
if (!this.listeners[eventType].length) {
window.removeEventListener(eventType, this.handleEvent);
delete this.listeners[eventType];
}
}
handleEvent(event) {
this.listeners[event.type]?.forEach(
(instance) => {
instance.handleEvent(event);
}
);
}
}
var listener_default = Listener;
;// ./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/index.js
const listener = new listener_default();
function withGlobalEvents(eventTypesToHandlers) {
external_wp_deprecated_default()("wp.compose.withGlobalEvents", {
since: "5.7",
alternative: "useEffect"
});
return createHigherOrderComponent((WrappedComponent) => {
class Wrapper extends external_wp_element_namespaceObject.Component {
constructor(props) {
super(props);
this.handleEvent = this.handleEvent.bind(this);
this.handleRef = this.handleRef.bind(this);
}
componentDidMount() {
Object.keys(eventTypesToHandlers).forEach((eventType) => {
listener.add(eventType, this);
});
}
componentWillUnmount() {
Object.keys(eventTypesToHandlers).forEach((eventType) => {
listener.remove(eventType, this);
});
}
handleEvent(event) {
const handler = eventTypesToHandlers[
/** @type {keyof GlobalEventHandlersEventMap} */
event.type
/* eslint-enable jsdoc/no-undefined-types */
];
if (typeof this.wrappedRef[handler] === "function") {
this.wrappedRef[handler](event);
}
}
handleRef(el) {
this.wrappedRef = el;
if (this.props.forwardedRef) {
this.props.forwardedRef(el);
}
}
render() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
WrappedComponent,
{
...this.props.ownProps,
ref: this.handleRef
}
);
}
}
return (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Wrapper, { ownProps: props, forwardedRef: ref });
});
}, "withGlobalEvents");
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-instance-id/index.js
const instanceMap = /* @__PURE__ */ new WeakMap();
function createId(object) {
const instances = instanceMap.get(object) || 0;
instanceMap.set(object, instances + 1);
return instances;
}
function useInstanceId(object, prefix, preferredId) {
return (0,external_wp_element_namespaceObject.useMemo)(() => {
if (preferredId) {
return preferredId;
}
const id = createId(object);
return prefix ? `${prefix}-${id}` : id;
}, [object, preferredId, prefix]);
}
var use_instance_id_default = useInstanceId;
;// ./node_modules/@wordpress/compose/build-module/higher-order/with-instance-id/index.js
const withInstanceId = createHigherOrderComponent(
(WrappedComponent) => {
return (props) => {
const instanceId = use_instance_id_default(WrappedComponent);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { ...props, instanceId });
};
},
"instanceId"
);
var with_instance_id_default = withInstanceId;
;// ./node_modules/@wordpress/compose/build-module/higher-order/with-safe-timeout/index.js
const withSafeTimeout = createHigherOrderComponent(
(OriginalComponent) => {
return class WrappedComponent extends external_wp_element_namespaceObject.Component {
timeouts;
constructor(props) {
super(props);
this.timeouts = [];
this.setTimeout = this.setTimeout.bind(this);
this.clearTimeout = this.clearTimeout.bind(this);
}
componentWillUnmount() {
this.timeouts.forEach(clearTimeout);
}
setTimeout(fn, delay) {
const id = setTimeout(() => {
fn();
this.clearTimeout(id);
}, delay);
this.timeouts.push(id);
return id;
}
clearTimeout(id) {
clearTimeout(id);
this.timeouts = this.timeouts.filter(
(timeoutId) => timeoutId !== id
);
}
render() {
return (
// @ts-ignore
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
OriginalComponent,
{
...this.props,
setTimeout: this.setTimeout,
clearTimeout: this.clearTimeout
}
)
);
}
};
},
"withSafeTimeout"
);
var with_safe_timeout_default = withSafeTimeout;
;// ./node_modules/@wordpress/compose/build-module/higher-order/with-state/index.js
function withState(initialState = {}) {
external_wp_deprecated_default()("wp.compose.withState", {
since: "5.8",
alternative: "wp.element.useState"
});
return createHigherOrderComponent((OriginalComponent) => {
return class WrappedComponent extends external_wp_element_namespaceObject.Component {
constructor(props) {
super(props);
this.setState = this.setState.bind(this);
this.state = initialState;
}
render() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
OriginalComponent,
{
...this.props,
...this.state,
setState: this.setState
}
);
}
};
}, "withState");
}
;// external ["wp","dom"]
const external_wp_dom_namespaceObject = window["wp"]["dom"];
;// ./node_modules/@wordpress/compose/build-module/hooks/use-ref-effect/index.js
function useRefEffect(callback, dependencies) {
const cleanupRef = (0,external_wp_element_namespaceObject.useRef)();
return (0,external_wp_element_namespaceObject.useCallback)((node) => {
if (node) {
cleanupRef.current = callback(node);
} else if (cleanupRef.current) {
cleanupRef.current();
}
}, dependencies);
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-constrained-tabbing/index.js
function useConstrainedTabbing() {
return useRefEffect((node) => {
function onKeyDown(event) {
const { key, shiftKey, target } = event;
if (key !== "Tab") {
return;
}
const action = shiftKey ? "findPrevious" : "findNext";
const nextElement = external_wp_dom_namespaceObject.focus.tabbable[action](
/** @type {HTMLElement} */
target
) || null;
if (
/** @type {HTMLElement} */
target.contains(nextElement)
) {
event.preventDefault();
nextElement?.focus();
return;
}
if (node.contains(nextElement)) {
return;
}
const domAction = shiftKey ? "append" : "prepend";
const { ownerDocument } = node;
const trap = ownerDocument.createElement("div");
trap.tabIndex = -1;
node[domAction](trap);
trap.addEventListener("blur", () => node.removeChild(trap));
trap.focus();
}
node.addEventListener("keydown", onKeyDown);
return () => {
node.removeEventListener("keydown", onKeyDown);
};
}, []);
}
var use_constrained_tabbing_default = useConstrainedTabbing;
// EXTERNAL MODULE: ./node_modules/clipboard/dist/clipboard.js
var dist_clipboard = __webpack_require__(3758);
var clipboard_default = /*#__PURE__*/__webpack_require__.n(dist_clipboard);
;// ./node_modules/@wordpress/compose/build-module/hooks/use-copy-on-click/index.js
function useCopyOnClick(ref, text, timeout = 4e3) {
external_wp_deprecated_default()("wp.compose.useCopyOnClick", {
since: "5.8",
alternative: "wp.compose.useCopyToClipboard"
});
const clipboardRef = (0,external_wp_element_namespaceObject.useRef)();
const [hasCopied, setHasCopied] = (0,external_wp_element_namespaceObject.useState)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
let timeoutId;
if (!ref.current) {
return;
}
clipboardRef.current = new (clipboard_default())(ref.current, {
text: () => typeof text === "function" ? text() : text
});
clipboardRef.current.on("success", ({ clearSelection, trigger }) => {
clearSelection();
if (trigger) {
trigger.focus();
}
if (timeout) {
setHasCopied(true);
clearTimeout(timeoutId);
timeoutId = setTimeout(() => setHasCopied(false), timeout);
}
});
return () => {
if (clipboardRef.current) {
clipboardRef.current.destroy();
}
clearTimeout(timeoutId);
};
}, [text, timeout, setHasCopied]);
return hasCopied;
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-copy-to-clipboard/index.js
function useUpdatedRef(value) {
const ref = (0,external_wp_element_namespaceObject.useRef)(value);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
ref.current = value;
}, [value]);
return ref;
}
function useCopyToClipboard(text, onSuccess) {
const textRef = useUpdatedRef(text);
const onSuccessRef = useUpdatedRef(onSuccess);
return useRefEffect((node) => {
const clipboard = new (clipboard_default())(node, {
text() {
return typeof textRef.current === "function" ? textRef.current() : textRef.current || "";
}
});
clipboard.on("success", ({ clearSelection }) => {
clearSelection();
if (onSuccessRef.current) {
onSuccessRef.current();
}
});
return () => {
clipboard.destroy();
};
}, []);
}
;// external ["wp","keycodes"]
const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
;// ./node_modules/@wordpress/compose/build-module/hooks/use-focus-on-mount/index.js
function useFocusOnMount(focusOnMount = "firstElement") {
const focusOnMountRef = (0,external_wp_element_namespaceObject.useRef)(focusOnMount);
const setFocus = (target) => {
target.focus({
// When focusing newly mounted dialogs,
// the position of the popover is often not right on the first render
// This prevents the layout shifts when focusing the dialogs.
preventScroll: true
});
};
const timerIdRef = (0,external_wp_element_namespaceObject.useRef)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
focusOnMountRef.current = focusOnMount;
}, [focusOnMount]);
return useRefEffect((node) => {
if (!node || focusOnMountRef.current === false) {
return;
}
if (node.contains(node.ownerDocument?.activeElement ?? null)) {
return;
}
if (focusOnMountRef.current !== "firstElement") {
setFocus(node);
return;
}
timerIdRef.current = setTimeout(() => {
const firstTabbable = external_wp_dom_namespaceObject.focus.tabbable.find(node)[0];
if (firstTabbable) {
setFocus(firstTabbable);
}
}, 0);
return () => {
if (timerIdRef.current) {
clearTimeout(timerIdRef.current);
}
};
}, []);
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-focus-return/index.js
let origin = null;
function useFocusReturn(onFocusReturn) {
const ref = (0,external_wp_element_namespaceObject.useRef)(null);
const focusedBeforeMount = (0,external_wp_element_namespaceObject.useRef)(null);
const onFocusReturnRef = (0,external_wp_element_namespaceObject.useRef)(onFocusReturn);
(0,external_wp_element_namespaceObject.useEffect)(() => {
onFocusReturnRef.current = onFocusReturn;
}, [onFocusReturn]);
return (0,external_wp_element_namespaceObject.useCallback)((node) => {
if (node) {
ref.current = node;
if (focusedBeforeMount.current) {
return;
}
const activeDocument = node.ownerDocument.activeElement instanceof window.HTMLIFrameElement ? node.ownerDocument.activeElement.contentDocument : node.ownerDocument;
focusedBeforeMount.current = activeDocument?.activeElement ?? null;
} else if (focusedBeforeMount.current) {
const isFocused = ref.current?.contains(
ref.current?.ownerDocument.activeElement
);
if (ref.current?.isConnected && !isFocused) {
origin ??= focusedBeforeMount.current;
return;
}
if (onFocusReturnRef.current) {
onFocusReturnRef.current();
} else {
(!focusedBeforeMount.current.isConnected ? origin : focusedBeforeMount.current)?.focus();
}
origin = null;
}
}, []);
}
var use_focus_return_default = useFocusReturn;
;// ./node_modules/@wordpress/compose/build-module/hooks/use-focus-outside/index.js
const INPUT_BUTTON_TYPES = ["button", "submit"];
function isFocusNormalizedButton(eventTarget) {
if (!(eventTarget instanceof window.HTMLElement)) {
return false;
}
switch (eventTarget.nodeName) {
case "A":
case "BUTTON":
return true;
case "INPUT":
return INPUT_BUTTON_TYPES.includes(
eventTarget.type
);
}
return false;
}
function useFocusOutside(onFocusOutside) {
const currentOnFocusOutsideRef = (0,external_wp_element_namespaceObject.useRef)(onFocusOutside);
(0,external_wp_element_namespaceObject.useEffect)(() => {
currentOnFocusOutsideRef.current = onFocusOutside;
}, [onFocusOutside]);
const preventBlurCheckRef = (0,external_wp_element_namespaceObject.useRef)(false);
const blurCheckTimeoutIdRef = (0,external_wp_element_namespaceObject.useRef)();
const cancelBlurCheck = (0,external_wp_element_namespaceObject.useCallback)(() => {
clearTimeout(blurCheckTimeoutIdRef.current);
}, []);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!onFocusOutside) {
cancelBlurCheck();
}
}, [onFocusOutside, cancelBlurCheck]);
const normalizeButtonFocus = (0,external_wp_element_namespaceObject.useCallback)((event) => {
const { type, target } = event;
const isInteractionEnd = ["mouseup", "touchend"].includes(type);
if (isInteractionEnd) {
preventBlurCheckRef.current = false;
} else if (isFocusNormalizedButton(target)) {
preventBlurCheckRef.current = true;
}
}, []);
const queueBlurCheck = (0,external_wp_element_namespaceObject.useCallback)((event) => {
event.persist();
if (preventBlurCheckRef.current) {
return;
}
const ignoreForRelatedTarget = event.target.getAttribute(
"data-unstable-ignore-focus-outside-for-relatedtarget"
);
if (ignoreForRelatedTarget && event.relatedTarget?.closest(ignoreForRelatedTarget)) {
return;
}
blurCheckTimeoutIdRef.current = setTimeout(() => {
if (!document.hasFocus()) {
event.preventDefault();
return;
}
if ("function" === typeof currentOnFocusOutsideRef.current) {
currentOnFocusOutsideRef.current(event);
}
}, 0);
}, []);
return {
onFocus: cancelBlurCheck,
onMouseDown: normalizeButtonFocus,
onMouseUp: normalizeButtonFocus,
onTouchStart: normalizeButtonFocus,
onTouchEnd: normalizeButtonFocus,
onBlur: queueBlurCheck
};
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-merge-refs/index.js
function assignRef(ref, value) {
if (typeof ref === "function") {
ref(value);
} else if (ref && ref.hasOwnProperty("current")) {
ref.current = value;
}
}
function useMergeRefs(refs) {
const element = (0,external_wp_element_namespaceObject.useRef)();
const isAttachedRef = (0,external_wp_element_namespaceObject.useRef)(false);
const didElementChangeRef = (0,external_wp_element_namespaceObject.useRef)(false);
const previousRefsRef = (0,external_wp_element_namespaceObject.useRef)([]);
const currentRefsRef = (0,external_wp_element_namespaceObject.useRef)(refs);
currentRefsRef.current = refs;
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (didElementChangeRef.current === false && isAttachedRef.current === true) {
refs.forEach((ref, index) => {
const previousRef = previousRefsRef.current[index];
if (ref !== previousRef) {
assignRef(previousRef, null);
assignRef(ref, element.current);
}
});
}
previousRefsRef.current = refs;
}, refs);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
didElementChangeRef.current = false;
});
return (0,external_wp_element_namespaceObject.useCallback)((value) => {
assignRef(element, value);
didElementChangeRef.current = true;
isAttachedRef.current = value !== null;
const refsToAssign = value ? currentRefsRef.current : previousRefsRef.current;
for (const ref of refsToAssign) {
assignRef(ref, value);
}
}, []);
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-dialog/index.js
function useDialog(options) {
const currentOptions = (0,external_wp_element_namespaceObject.useRef)();
const { constrainTabbing = options.focusOnMount !== false } = options;
(0,external_wp_element_namespaceObject.useEffect)(() => {
currentOptions.current = options;
}, Object.values(options));
const constrainedTabbingRef = use_constrained_tabbing_default();
const focusOnMountRef = useFocusOnMount(options.focusOnMount);
const focusReturnRef = use_focus_return_default();
const focusOutsideProps = useFocusOutside((event) => {
if (currentOptions.current?.__unstableOnClose) {
currentOptions.current.__unstableOnClose("focus-outside", event);
} else if (currentOptions.current?.onClose) {
currentOptions.current.onClose();
}
});
const closeOnEscapeRef = (0,external_wp_element_namespaceObject.useCallback)((node) => {
if (!node) {
return;
}
node.addEventListener("keydown", (event) => {
if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented && currentOptions.current?.onClose) {
event.preventDefault();
currentOptions.current.onClose();
}
});
}, []);
return [
useMergeRefs([
constrainTabbing ? constrainedTabbingRef : null,
options.focusOnMount !== false ? focusReturnRef : null,
options.focusOnMount !== false ? focusOnMountRef : null,
closeOnEscapeRef
]),
{
...focusOutsideProps,
tabIndex: -1
}
];
}
var use_dialog_default = useDialog;
;// ./node_modules/@wordpress/compose/build-module/hooks/use-disabled/index.js
function useDisabled({
isDisabled: isDisabledProp = false
} = {}) {
return useRefEffect(
(node) => {
if (isDisabledProp) {
return;
}
const defaultView = node?.ownerDocument?.defaultView;
if (!defaultView) {
return;
}
const updates = [];
const disable = () => {
node.childNodes.forEach((child) => {
if (!(child instanceof defaultView.HTMLElement)) {
return;
}
if (!child.getAttribute("inert")) {
child.setAttribute("inert", "true");
updates.push(() => {
child.removeAttribute("inert");
});
}
});
};
const debouncedDisable = debounce(disable, 0, {
leading: true
});
disable();
const observer = new window.MutationObserver(debouncedDisable);
observer.observe(node, {
childList: true
});
return () => {
if (observer) {
observer.disconnect();
}
debouncedDisable.cancel();
updates.forEach((update) => update());
};
},
[isDisabledProp]
);
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-event/index.js
function useEvent(callback) {
const ref = (0,external_wp_element_namespaceObject.useRef)(() => {
throw new Error(
"Callbacks created with `useEvent` cannot be called during rendering."
);
});
(0,external_wp_element_namespaceObject.useInsertionEffect)(() => {
ref.current = callback;
});
return (0,external_wp_element_namespaceObject.useCallback)(
(...args) => ref.current?.(...args),
[]
);
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-isomorphic-layout-effect/index.js
const useIsomorphicLayoutEffect = typeof window !== "undefined" ? external_wp_element_namespaceObject.useLayoutEffect : external_wp_element_namespaceObject.useEffect;
var use_isomorphic_layout_effect_default = useIsomorphicLayoutEffect;
;// ./node_modules/@wordpress/compose/build-module/hooks/use-dragging/index.js
function useDragging({ onDragStart, onDragMove, onDragEnd }) {
const [isDragging, setIsDragging] = (0,external_wp_element_namespaceObject.useState)(false);
const eventsRef = (0,external_wp_element_namespaceObject.useRef)({
onDragStart,
onDragMove,
onDragEnd
});
use_isomorphic_layout_effect_default(() => {
eventsRef.current.onDragStart = onDragStart;
eventsRef.current.onDragMove = onDragMove;
eventsRef.current.onDragEnd = onDragEnd;
}, [onDragStart, onDragMove, onDragEnd]);
const onMouseMove = (0,external_wp_element_namespaceObject.useCallback)(
(event) => eventsRef.current.onDragMove && eventsRef.current.onDragMove(event),
[]
);
const endDrag = (0,external_wp_element_namespaceObject.useCallback)((event) => {
if (eventsRef.current.onDragEnd) {
eventsRef.current.onDragEnd(event);
}
document.removeEventListener("mousemove", onMouseMove);
document.removeEventListener("mouseup", endDrag);
setIsDragging(false);
}, []);
const startDrag = (0,external_wp_element_namespaceObject.useCallback)((event) => {
if (eventsRef.current.onDragStart) {
eventsRef.current.onDragStart(event);
}
document.addEventListener("mousemove", onMouseMove);
document.addEventListener("mouseup", endDrag);
setIsDragging(true);
}, []);
(0,external_wp_element_namespaceObject.useEffect)(() => {
return () => {
if (isDragging) {
document.removeEventListener("mousemove", onMouseMove);
document.removeEventListener("mouseup", endDrag);
}
};
}, [isDragging]);
return {
startDrag,
endDrag,
isDragging
};
}
// EXTERNAL MODULE: ./node_modules/mousetrap/mousetrap.js
var mousetrap_mousetrap = __webpack_require__(1933);
var mousetrap_default = /*#__PURE__*/__webpack_require__.n(mousetrap_mousetrap);
// EXTERNAL MODULE: ./node_modules/mousetrap/plugins/global-bind/mousetrap-global-bind.js
var mousetrap_global_bind = __webpack_require__(5760);
;// ./node_modules/@wordpress/compose/build-module/hooks/use-keyboard-shortcut/index.js
function useKeyboardShortcut(shortcuts, callback, {
bindGlobal = false,
eventName = "keydown",
isDisabled = false,
// This is important for performance considerations.
target
} = {}) {
const currentCallbackRef = (0,external_wp_element_namespaceObject.useRef)(callback);
(0,external_wp_element_namespaceObject.useEffect)(() => {
currentCallbackRef.current = callback;
}, [callback]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (isDisabled) {
return;
}
const mousetrap = new (mousetrap_default())(
target && target.current ? target.current : (
// We were passing `document` here previously, so to successfully cast it to Element we must cast it first to `unknown`.
// Not sure if this is a mistake but it was the behavior previous to the addition of types so we're just doing what's
// necessary to maintain the existing behavior.
/** @type {Element} */
/** @type {unknown} */
document
)
);
const shortcutsArray = Array.isArray(shortcuts) ? shortcuts : [shortcuts];
shortcutsArray.forEach((shortcut) => {
const keys = shortcut.split("+");
const modifiers = new Set(
keys.filter((value) => value.length > 1)
);
const hasAlt = modifiers.has("alt");
const hasShift = modifiers.has("shift");
if ((0,external_wp_keycodes_namespaceObject.isAppleOS)() && (modifiers.size === 1 && hasAlt || modifiers.size === 2 && hasAlt && hasShift)) {
throw new Error(
`Cannot bind ${shortcut}. Alt and Shift+Alt modifiers are reserved for character input.`
);
}
const bindFn = bindGlobal ? "bindGlobal" : "bind";
mousetrap[bindFn](
shortcut,
(...args) => (
/* eslint-enable jsdoc/valid-types */
currentCallbackRef.current(...args)
),
eventName
);
});
return () => {
mousetrap.reset();
};
}, [shortcuts, bindGlobal, eventName, target, isDisabled]);
}
var use_keyboard_shortcut_default = useKeyboardShortcut;
;// ./node_modules/@wordpress/compose/build-module/hooks/use-media-query/index.js
const matchMediaCache = /* @__PURE__ */ new Map();
function getMediaQueryList(query) {
if (!query) {
return null;
}
let match = matchMediaCache.get(query);
if (match) {
return match;
}
if (typeof window !== "undefined" && typeof window.matchMedia === "function") {
match = window.matchMedia(query);
matchMediaCache.set(query, match);
return match;
}
return null;
}
function useMediaQuery(query) {
const source = (0,external_wp_element_namespaceObject.useMemo)(() => {
const mediaQueryList = getMediaQueryList(query);
return {
/** @type {(onStoreChange: () => void) => () => void} */
subscribe(onStoreChange) {
if (!mediaQueryList) {
return () => {
};
}
mediaQueryList.addEventListener?.("change", onStoreChange);
return () => {
mediaQueryList.removeEventListener?.(
"change",
onStoreChange
);
};
},
getValue() {
return mediaQueryList?.matches ?? false;
}
};
}, [query]);
return (0,external_wp_element_namespaceObject.useSyncExternalStore)(
source.subscribe,
source.getValue,
() => false
);
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-previous/index.js
function usePrevious(value) {
const ref = (0,external_wp_element_namespaceObject.useRef)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
ref.current = value;
}, [value]);
return ref.current;
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-reduced-motion/index.js
const useReducedMotion = () => useMediaQuery("(prefers-reduced-motion: reduce)");
var use_reduced_motion_default = useReducedMotion;
;// ./node_modules/@wordpress/undo-manager/build-module/index.js
function mergeHistoryChanges(changes1, changes2) {
const newChanges = { ...changes1 };
Object.entries(changes2).forEach(([key, value]) => {
if (newChanges[key]) {
newChanges[key] = { ...newChanges[key], to: value.to };
} else {
newChanges[key] = value;
}
});
return newChanges;
}
const addHistoryChangesIntoRecord = (record, changes) => {
const existingChangesIndex = record?.findIndex(
({ id: recordIdentifier }) => {
return typeof recordIdentifier === "string" ? recordIdentifier === changes.id : external_wp_isShallowEqual_default()(recordIdentifier, changes.id);
}
);
const nextRecord = [...record];
if (existingChangesIndex !== -1) {
nextRecord[existingChangesIndex] = {
id: changes.id,
changes: mergeHistoryChanges(
nextRecord[existingChangesIndex].changes,
changes.changes
)
};
} else {
nextRecord.push(changes);
}
return nextRecord;
};
function createUndoManager() {
let history = [];
let stagedRecord = [];
let offset = 0;
const dropPendingRedos = () => {
history = history.slice(0, offset || void 0);
offset = 0;
};
const appendStagedRecordToLatestHistoryRecord = () => {
const index = history.length === 0 ? 0 : history.length - 1;
let latestRecord = history[index] ?? [];
stagedRecord.forEach((changes) => {
latestRecord = addHistoryChangesIntoRecord(latestRecord, changes);
});
stagedRecord = [];
history[index] = latestRecord;
};
const isRecordEmpty = (record) => {
const filteredRecord = record.filter(({ changes }) => {
return Object.values(changes).some(
({ from, to }) => typeof from !== "function" && typeof to !== "function" && !external_wp_isShallowEqual_default()(from, to)
);
});
return !filteredRecord.length;
};
return {
addRecord(record, isStaged = false) {
const isEmpty = !record || isRecordEmpty(record);
if (isStaged) {
if (isEmpty) {
return;
}
record.forEach((changes) => {
stagedRecord = addHistoryChangesIntoRecord(
stagedRecord,
changes
);
});
} else {
dropPendingRedos();
if (stagedRecord.length) {
appendStagedRecordToLatestHistoryRecord();
}
if (isEmpty) {
return;
}
history.push(record);
}
},
undo() {
if (stagedRecord.length) {
dropPendingRedos();
appendStagedRecordToLatestHistoryRecord();
}
const undoRecord = history[history.length - 1 + offset];
if (!undoRecord) {
return;
}
offset -= 1;
return undoRecord;
},
redo() {
const redoRecord = history[history.length + offset];
if (!redoRecord) {
return;
}
offset += 1;
return redoRecord;
},
hasUndo() {
return !!history[history.length - 1 + offset];
},
hasRedo() {
return !!history[history.length + offset];
}
};
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-state-with-history/index.js
function undoRedoReducer(state, action) {
switch (action.type) {
case "UNDO": {
const undoRecord = state.manager.undo();
if (undoRecord) {
return {
...state,
value: undoRecord[0].changes.prop.from
};
}
return state;
}
case "REDO": {
const redoRecord = state.manager.redo();
if (redoRecord) {
return {
...state,
value: redoRecord[0].changes.prop.to
};
}
return state;
}
case "RECORD": {
state.manager.addRecord(
[
{
id: "object",
changes: {
prop: { from: state.value, to: action.value }
}
}
],
action.isStaged
);
return {
...state,
value: action.value
};
}
}
return state;
}
function initReducer(value) {
return {
manager: createUndoManager(),
value
};
}
function useStateWithHistory(initialValue) {
const [state, dispatch] = (0,external_wp_element_namespaceObject.useReducer)(
undoRedoReducer,
initialValue,
initReducer
);
return {
value: state.value,
setValue: (0,external_wp_element_namespaceObject.useCallback)((newValue, isStaged) => {
dispatch({
type: "RECORD",
value: newValue,
isStaged
});
}, []),
hasUndo: state.manager.hasUndo(),
hasRedo: state.manager.hasRedo(),
undo: (0,external_wp_element_namespaceObject.useCallback)(() => {
dispatch({ type: "UNDO" });
}, []),
redo: (0,external_wp_element_namespaceObject.useCallback)(() => {
dispatch({ type: "REDO" });
}, [])
};
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-viewport-match/index.js
const BREAKPOINTS = {
xhuge: 1920,
huge: 1440,
wide: 1280,
xlarge: 1080,
large: 960,
medium: 782,
small: 600,
mobile: 480
};
const CONDITIONS = {
">=": "min-width",
"<": "max-width"
};
const OPERATOR_EVALUATORS = {
">=": (breakpointValue, width) => width >= breakpointValue,
"<": (breakpointValue, width) => width < breakpointValue
};
const ViewportMatchWidthContext = (0,external_wp_element_namespaceObject.createContext)(
/** @type {null | number} */
null
);
ViewportMatchWidthContext.displayName = "ViewportMatchWidthContext";
const useViewportMatch = (breakpoint, operator = ">=") => {
const simulatedWidth = (0,external_wp_element_namespaceObject.useContext)(ViewportMatchWidthContext);
const mediaQuery = !simulatedWidth && `(${CONDITIONS[operator]}: ${BREAKPOINTS[breakpoint]}px)`;
const mediaQueryResult = useMediaQuery(mediaQuery || void 0);
if (simulatedWidth) {
return OPERATOR_EVALUATORS[operator](
BREAKPOINTS[breakpoint],
simulatedWidth
);
}
return mediaQueryResult;
};
useViewportMatch.__experimentalWidthProvider = ViewportMatchWidthContext.Provider;
var use_viewport_match_default = useViewportMatch;
;// ./node_modules/@wordpress/compose/build-module/hooks/use-resize-observer/use-resize-observer.js
function useResizeObserver(callback, resizeObserverOptions = {}) {
const callbackEvent = useEvent(callback);
const observedElementRef = (0,external_wp_element_namespaceObject.useRef)();
const resizeObserverRef = (0,external_wp_element_namespaceObject.useRef)();
return useEvent((element) => {
if (element === observedElementRef.current) {
return;
}
resizeObserverRef.current ??= new ResizeObserver(callbackEvent);
const { current: resizeObserver } = resizeObserverRef;
if (observedElementRef.current) {
resizeObserver.unobserve(observedElementRef.current);
}
observedElementRef.current = element;
if (element) {
resizeObserver.observe(element, resizeObserverOptions);
}
});
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-resize-observer/legacy/index.js
const extractSize = (entry) => {
let entrySize;
if (!entry.contentBoxSize) {
entrySize = [entry.contentRect.width, entry.contentRect.height];
} else if (entry.contentBoxSize[0]) {
const contentBoxSize = entry.contentBoxSize[0];
entrySize = [contentBoxSize.inlineSize, contentBoxSize.blockSize];
} else {
const contentBoxSize = entry.contentBoxSize;
entrySize = [contentBoxSize.inlineSize, contentBoxSize.blockSize];
}
const [width, height] = entrySize.map((d) => Math.round(d));
return { width, height };
};
const RESIZE_ELEMENT_STYLES = {
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0,
pointerEvents: "none",
opacity: 0,
overflow: "hidden",
zIndex: -1
};
function ResizeElement({ onResize }) {
const resizeElementRef = useResizeObserver((entries) => {
const newSize = extractSize(entries.at(-1));
onResize(newSize);
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
ref: resizeElementRef,
style: RESIZE_ELEMENT_STYLES,
"aria-hidden": "true"
}
);
}
function sizeEquals(a, b) {
return a.width === b.width && a.height === b.height;
}
const NULL_SIZE = { width: null, height: null };
function useLegacyResizeObserver() {
const [size, setSize] = (0,external_wp_element_namespaceObject.useState)(NULL_SIZE);
const previousSizeRef = (0,external_wp_element_namespaceObject.useRef)(NULL_SIZE);
const handleResize = (0,external_wp_element_namespaceObject.useCallback)((newSize) => {
if (!sizeEquals(previousSizeRef.current, newSize)) {
previousSizeRef.current = newSize;
setSize(newSize);
}
}, []);
const resizeElement = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizeElement, { onResize: handleResize });
return [resizeElement, size];
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-resize-observer/index.js
function use_resize_observer_useResizeObserver(callback, options = {}) {
return callback ? useResizeObserver(callback, options) : useLegacyResizeObserver();
}
;// external ["wp","priorityQueue"]
const external_wp_priorityQueue_namespaceObject = window["wp"]["priorityQueue"];
;// ./node_modules/@wordpress/compose/build-module/hooks/use-async-list/index.js
function getFirstItemsPresentInState(list, state) {
const firstItems = [];
for (let i = 0; i < list.length; i++) {
const item = list[i];
if (!state.includes(item)) {
break;
}
firstItems.push(item);
}
return firstItems;
}
function useAsyncList(list, config = { step: 1 }) {
const { step = 1 } = config;
const [current, setCurrent] = (0,external_wp_element_namespaceObject.useState)([]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
let firstItems = getFirstItemsPresentInState(list, current);
if (firstItems.length < step) {
firstItems = firstItems.concat(
list.slice(firstItems.length, step)
);
}
setCurrent(firstItems);
const asyncQueue = (0,external_wp_priorityQueue_namespaceObject.createQueue)();
for (let i = firstItems.length; i < list.length; i += step) {
asyncQueue.add({}, () => {
(0,external_wp_element_namespaceObject.flushSync)(() => {
setCurrent((state) => [
...state,
...list.slice(i, i + step)
]);
});
});
}
return () => asyncQueue.reset();
}, [list]);
return current;
}
var use_async_list_default = useAsyncList;
;// ./node_modules/@wordpress/compose/build-module/hooks/use-warn-on-change/index.js
function useWarnOnChange(object, prefix = "Change detection") {
const previousValues = usePrevious(object);
Object.entries(previousValues ?? []).forEach(([key, value]) => {
if (value !== object[
/** @type {keyof typeof object} */
key
]) {
console.warn(
`${prefix}: ${key} key changed:`,
value,
object[
/** @type {keyof typeof object} */
key
]
/* eslint-enable jsdoc/check-types */
);
}
});
}
var use_warn_on_change_default = useWarnOnChange;
;// external "React"
const external_React_namespaceObject = window["React"];
;// ./node_modules/use-memo-one/dist/use-memo-one.esm.js
function areInputsEqual(newInputs, lastInputs) {
if (newInputs.length !== lastInputs.length) {
return false;
}
for (var i = 0; i < newInputs.length; i++) {
if (newInputs[i] !== lastInputs[i]) {
return false;
}
}
return true;
}
function useMemoOne(getResult, inputs) {
var initial = (0,external_React_namespaceObject.useState)(function () {
return {
inputs: inputs,
result: getResult()
};
})[0];
var isFirstRun = (0,external_React_namespaceObject.useRef)(true);
var committed = (0,external_React_namespaceObject.useRef)(initial);
var useCache = isFirstRun.current || Boolean(inputs && committed.current.inputs && areInputsEqual(inputs, committed.current.inputs));
var cache = useCache ? committed.current : {
inputs: inputs,
result: getResult()
};
(0,external_React_namespaceObject.useEffect)(function () {
isFirstRun.current = false;
committed.current = cache;
}, [cache]);
return cache.result;
}
function useCallbackOne(callback, inputs) {
return useMemoOne(function () {
return callback;
}, inputs);
}
var useMemo = (/* unused pure expression or super */ null && (useMemoOne));
var useCallback = (/* unused pure expression or super */ null && (useCallbackOne));
;// ./node_modules/@wordpress/compose/build-module/hooks/use-debounce/index.js
function useDebounce(fn, wait, options) {
const debounced = useMemoOne(
() => debounce(fn, wait ?? 0, options),
[fn, wait, options?.leading, options?.trailing, options?.maxWait]
);
(0,external_wp_element_namespaceObject.useEffect)(() => () => debounced.cancel(), [debounced]);
return debounced;
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-debounced-input/index.js
function useDebouncedInput(defaultValue = "") {
const [input, setInput] = (0,external_wp_element_namespaceObject.useState)(defaultValue);
const [debouncedInput, setDebouncedState] = (0,external_wp_element_namespaceObject.useState)(defaultValue);
const setDebouncedInput = useDebounce(setDebouncedState, 250);
(0,external_wp_element_namespaceObject.useEffect)(() => {
setDebouncedInput(input);
}, [input, setDebouncedInput]);
return [input, setInput, debouncedInput];
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-throttle/index.js
function useThrottle(fn, wait, options) {
const throttled = useMemoOne(
() => throttle(fn, wait ?? 0, options),
[fn, wait, options]
);
(0,external_wp_element_namespaceObject.useEffect)(() => () => throttled.cancel(), [throttled]);
return throttled;
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-drop-zone/index.js
function useDropZone({
dropZoneElement,
isDisabled,
onDrop: _onDrop,
onDragStart: _onDragStart,
onDragEnter: _onDragEnter,
onDragLeave: _onDragLeave,
onDragEnd: _onDragEnd,
onDragOver: _onDragOver
}) {
const onDropEvent = useEvent(_onDrop);
const onDragStartEvent = useEvent(_onDragStart);
const onDragEnterEvent = useEvent(_onDragEnter);
const onDragLeaveEvent = useEvent(_onDragLeave);
const onDragEndEvent = useEvent(_onDragEnd);
const onDragOverEvent = useEvent(_onDragOver);
return useRefEffect(
(elem) => {
if (isDisabled) {
return;
}
const element = dropZoneElement ?? elem;
let isDragging = false;
const { ownerDocument } = element;
function isElementInZone(targetToCheck) {
const { defaultView } = ownerDocument;
if (!targetToCheck || !defaultView || !(targetToCheck instanceof defaultView.HTMLElement) || !element.contains(targetToCheck)) {
return false;
}
let elementToCheck = targetToCheck;
do {
if (elementToCheck.dataset.isDropZone) {
return elementToCheck === element;
}
} while (elementToCheck = elementToCheck.parentElement);
return false;
}
function maybeDragStart(event) {
if (isDragging) {
return;
}
isDragging = true;
ownerDocument.addEventListener("dragend", maybeDragEnd);
ownerDocument.addEventListener("mousemove", maybeDragEnd);
if (_onDragStart) {
onDragStartEvent(event);
}
}
function onDragEnter(event) {
event.preventDefault();
if (element.contains(
/** @type {Node} */
event.relatedTarget
)) {
return;
}
if (_onDragEnter) {
onDragEnterEvent(event);
}
}
function onDragOver(event) {
if (!event.defaultPrevented && _onDragOver) {
onDragOverEvent(event);
}
event.preventDefault();
}
function onDragLeave(event) {
if (isElementInZone(event.relatedTarget)) {
return;
}
if (_onDragLeave) {
onDragLeaveEvent(event);
}
}
function onDrop(event) {
if (event.defaultPrevented) {
return;
}
event.preventDefault();
event.dataTransfer && event.dataTransfer.files.length;
if (_onDrop) {
onDropEvent(event);
}
maybeDragEnd(event);
}
function maybeDragEnd(event) {
if (!isDragging) {
return;
}
isDragging = false;
ownerDocument.removeEventListener("dragend", maybeDragEnd);
ownerDocument.removeEventListener("mousemove", maybeDragEnd);
if (_onDragEnd) {
onDragEndEvent(event);
}
}
element.setAttribute("data-is-drop-zone", "true");
element.addEventListener("drop", onDrop);
element.addEventListener("dragenter", onDragEnter);
element.addEventListener("dragover", onDragOver);
element.addEventListener("dragleave", onDragLeave);
ownerDocument.addEventListener("dragenter", maybeDragStart);
return () => {
element.removeAttribute("data-is-drop-zone");
element.removeEventListener("drop", onDrop);
element.removeEventListener("dragenter", onDragEnter);
element.removeEventListener("dragover", onDragOver);
element.removeEventListener("dragleave", onDragLeave);
ownerDocument.removeEventListener("dragend", maybeDragEnd);
ownerDocument.removeEventListener("mousemove", maybeDragEnd);
ownerDocument.removeEventListener(
"dragenter",
maybeDragStart
);
};
},
[isDisabled, dropZoneElement]
// Refresh when the passed in dropZoneElement changes.
);
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-focusable-iframe/index.js
function useFocusableIframe() {
return useRefEffect((element) => {
const { ownerDocument } = element;
if (!ownerDocument) {
return;
}
const { defaultView } = ownerDocument;
if (!defaultView) {
return;
}
function checkFocus() {
if (ownerDocument && ownerDocument.activeElement === element) {
element.focus();
}
}
defaultView.addEventListener("blur", checkFocus);
return () => {
defaultView.removeEventListener("blur", checkFocus);
};
}, []);
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-fixed-window-list/index.js
const DEFAULT_INIT_WINDOW_SIZE = 30;
function useFixedWindowList(elementRef, itemHeight, totalItems, options) {
const initWindowSize = options?.initWindowSize ?? DEFAULT_INIT_WINDOW_SIZE;
const useWindowing = options?.useWindowing ?? true;
const [fixedListWindow, setFixedListWindow] = (0,external_wp_element_namespaceObject.useState)({
visibleItems: initWindowSize,
start: 0,
end: initWindowSize,
itemInView: (index) => {
return index >= 0 && index <= initWindowSize;
}
});
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (!useWindowing) {
return;
}
const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(elementRef.current);
const measureWindow = (initRender) => {
if (!scrollContainer) {
return;
}
const visibleItems = Math.ceil(
scrollContainer.clientHeight / itemHeight
);
const windowOverscan = initRender ? visibleItems : options?.windowOverscan ?? visibleItems;
const firstViewableIndex = Math.floor(
scrollContainer.scrollTop / itemHeight
);
const start = Math.max(0, firstViewableIndex - windowOverscan);
const end = Math.min(
totalItems - 1,
firstViewableIndex + visibleItems + windowOverscan
);
setFixedListWindow((lastWindow) => {
const nextWindow = {
visibleItems,
start,
end,
itemInView: (index) => {
return start <= index && index <= end;
}
};
if (lastWindow.start !== nextWindow.start || lastWindow.end !== nextWindow.end || lastWindow.visibleItems !== nextWindow.visibleItems) {
return nextWindow;
}
return lastWindow;
});
};
measureWindow(true);
const debounceMeasureList = debounce(() => {
measureWindow();
}, 16);
scrollContainer?.addEventListener("scroll", debounceMeasureList);
scrollContainer?.ownerDocument?.defaultView?.addEventListener(
"resize",
debounceMeasureList
);
scrollContainer?.ownerDocument?.defaultView?.addEventListener(
"resize",
debounceMeasureList
);
return () => {
scrollContainer?.removeEventListener(
"scroll",
debounceMeasureList
);
scrollContainer?.ownerDocument?.defaultView?.removeEventListener(
"resize",
debounceMeasureList
);
};
}, [
itemHeight,
elementRef,
totalItems,
options?.expandedState,
options?.windowOverscan,
useWindowing
]);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
if (!useWindowing) {
return;
}
const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(elementRef.current);
const handleKeyDown = (event) => {
switch (event.keyCode) {
case external_wp_keycodes_namespaceObject.HOME: {
return scrollContainer?.scrollTo({ top: 0 });
}
case external_wp_keycodes_namespaceObject.END: {
return scrollContainer?.scrollTo({
top: totalItems * itemHeight
});
}
case external_wp_keycodes_namespaceObject.PAGEUP: {
return scrollContainer?.scrollTo({
top: scrollContainer.scrollTop - fixedListWindow.visibleItems * itemHeight
});
}
case external_wp_keycodes_namespaceObject.PAGEDOWN: {
return scrollContainer?.scrollTo({
top: scrollContainer.scrollTop + fixedListWindow.visibleItems * itemHeight
});
}
}
};
scrollContainer?.ownerDocument?.defaultView?.addEventListener(
"keydown",
handleKeyDown
);
return () => {
scrollContainer?.ownerDocument?.defaultView?.removeEventListener(
"keydown",
handleKeyDown
);
};
}, [
totalItems,
itemHeight,
elementRef,
fixedListWindow.visibleItems,
useWindowing,
options?.expandedState
]);
return [fixedListWindow, setFixedListWindow];
}
;// ./node_modules/@wordpress/compose/build-module/hooks/use-observable-value/index.js
function useObservableValue(map, name) {
const [subscribe, getValue] = (0,external_wp_element_namespaceObject.useMemo)(
() => [
(listener) => map.subscribe(name, listener),
() => map.get(name)
],
[map, name]
);
return (0,external_wp_element_namespaceObject.useSyncExternalStore)(subscribe, getValue, getValue);
}
;// ./node_modules/@wordpress/compose/build-module/index.js
})();
(window.wp = window.wp || {}).compose = __webpack_exports__;
/******/ })()
; media-utils.min.js 0000644 00000023340 15121363553 0010107 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={n:t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},d:(t,i)=>{for(var o in i)e.o(i,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:i[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{MediaUpload:()=>m,privateApis:()=>T,transformAttachment:()=>w,uploadMedia:()=>_,validateFileSize:()=>S,validateMimeType:()=>g,validateMimeTypeForUser:()=>b});const i=window.wp.element,o=window.wp.i18n,a=[],r=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Select.extend({featuredImageToolbar(t){this.createSelectToolbar(t,{text:e.media.view.l10n.setFeaturedImage,state:this.options.state})},editState(){const t=this.state("featured-image").get("selection"),i=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(i),i.loadEditor()},createStates:function(){this.on("toolbar:create:featured-image",this.featuredImageToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.FeaturedImage,new e.media.controller.EditImage({model:this.options.editImage})])}})},s=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Select.extend({createStates(){const t=this.options;this.options.states||this.states.add([new e.media.controller.Library({library:e.media.query(t.library),multiple:t.multiple,title:t.title,priority:20,filterable:"uploaded"}),new e.media.controller.EditImage({model:t.editImage})])}})},n=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Post.extend({galleryToolbar(){const t=this.state().get("editing");this.toolbar.set(new e.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:t?e.media.view.l10n.updateGallery:e.media.view.l10n.insertGallery,priority:80,requires:{library:!0},click(){const e=this.controller,t=e.state();e.close(),t.trigger("update",t.get("library")),e.setState(e.options.state),e.reset()}}}}))},editState(){const t=this.state("gallery").get("selection"),i=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(i),i.loadEditor()},createStates:function(){this.on("toolbar:create:main-gallery",this.galleryToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.Library({id:"gallery",title:e.media.view.l10n.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:!1,library:e.media.query({type:"image",...this.options.library})}),new e.media.controller.EditImage({model:this.options.editImage}),new e.media.controller.GalleryEdit({library:this.options.selection,editing:this.options.editing,menu:"gallery",displaySettings:!1,multiple:!0}),new e.media.controller.GalleryAdd])}})},l=e=>["sizes","mime","type","subtype","id","url","alt","link","caption"].reduce(((t,i)=>(e?.hasOwnProperty(i)&&(t[i]=e[i]),t)),{}),d=e=>{const{wp:t}=window;return t.media.query({order:"ASC",orderby:"post__in",post__in:e,posts_per_page:-1,query:!0,type:"image"})};class p extends i.Component{constructor(){super(...arguments),this.openModal=this.openModal.bind(this),this.onOpen=this.onOpen.bind(this),this.onSelect=this.onSelect.bind(this),this.onUpdate=this.onUpdate.bind(this),this.onClose=this.onClose.bind(this)}initializeListeners(){this.frame.on("select",this.onSelect),this.frame.on("update",this.onUpdate),this.frame.on("open",this.onOpen),this.frame.on("close",this.onClose)}buildAndSetGalleryFrame(){const{addToGallery:e=!1,allowedTypes:t,multiple:i=!1,value:o=a}=this.props;if(o===this.lastGalleryValue)return;const{wp:r}=window;let s;this.lastGalleryValue=o,this.frame&&this.frame.remove(),s=e?"gallery-library":o&&o.length?"gallery-edit":"gallery",this.GalleryDetailsMediaFrame||(this.GalleryDetailsMediaFrame=n());const l=d(o),p=new r.media.model.Selection(l.models,{props:l.props.toJSON(),multiple:i});this.frame=new this.GalleryDetailsMediaFrame({mimeType:t,state:s,multiple:i,selection:p,editing:!!o?.length}),r.media.frame=this.frame,this.initializeListeners()}buildAndSetFeatureImageFrame(){const{wp:e}=window,{value:t,multiple:i,allowedTypes:o}=this.props,a=r(),s=d(t),n=new e.media.model.Selection(s.models,{props:s.props.toJSON()});this.frame=new a({mimeType:o,state:"featured-image",multiple:i,selection:n,editing:t}),e.media.frame=this.frame,e.media.view.settings.post={...e.media.view.settings.post,featuredImageId:t||-1}}buildAndSetSingleMediaFrame(){const{wp:e}=window,{allowedTypes:t,multiple:i=!1,title:a=(0,o.__)("Select or Upload Media"),value:r}=this.props,n={title:a,multiple:i};t&&(n.library={type:t}),this.frame&&this.frame.remove();const l=s(),p=d(r),m=new e.media.model.Selection(p.models,{props:p.props.toJSON()});this.frame=new l({mimeType:t,multiple:i,selection:m,...n}),e.media.frame=this.frame}componentWillUnmount(){this.frame?.remove()}onUpdate(e){const{onSelect:t,multiple:i=!1}=this.props,o=this.frame.state(),a=e||o.get("selection");a&&a.models.length&&t(i?a.models.map((e=>l(e.toJSON()))):l(a.models[0].toJSON()))}onSelect(){const{onSelect:e,multiple:t=!1}=this.props,i=this.frame.state().get("selection").toJSON();e(t?i:i[0])}onOpen(){const{wp:e}=window,{value:t}=this.props;this.updateCollection(),this.props.mode&&this.frame.content.mode(this.props.mode);if(!(Array.isArray(t)?!!t?.length:!!t))return;const i=this.props.gallery,o=this.frame.state().get("selection"),a=Array.isArray(t)?t:[t];i||a.forEach((t=>{o.add(e.media.attachment(t))}));const r=d(a);r.more().done((function(){i&&r?.models?.length&&o.add(r.models)}))}onClose(){const{onClose:e}=this.props;e&&e(),this.frame.detach()}updateCollection(){const e=this.frame.content.get();if(e&&e.collection){const t=e.collection;t.toArray().forEach((e=>e.trigger("destroy",e))),t.mirroring._hasMore=!0,t.more()}}openModal(){const{gallery:e=!1,unstableFeaturedImageFlow:t=!1,modalClass:i}=this.props;e?this.buildAndSetGalleryFrame():this.buildAndSetSingleMediaFrame(),i&&this.frame.$el.addClass(i),t&&this.buildAndSetFeatureImageFrame(),this.initializeListeners(),this.frame.open()}render(){return this.props.render({open:this.openModal})}}var m=p;const c=window.wp.blob,h=window.wp.apiFetch;var u=e.n(h);function f(e,t,i){if(function(e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===Object.prototype}(i))for(const[o,a]of Object.entries(i))f(e,`${t}[${o}]`,a);else void 0!==i&&e.append(t,String(i))}function w(e){const{alt_text:t,source_url:i,...o}=e;return{...o,alt:e.alt_text,caption:e.caption?.raw??"",title:e.title.raw,url:e.source_url,poster:e._embedded?.["wp:featuredmedia"]?.[0]?.source_url||void 0}}class y extends Error{code;file;constructor({code:e,message:t,file:i,cause:o}){super(t,{cause:o}),Object.setPrototypeOf(this,new.target.prototype),this.code=e,this.file=i}}function g(e,t){if(!t)return;const i=t.some((t=>t.includes("/")?t===e.type:e.type.startsWith(`${t}/`)));if(e.type&&!i)throw new y({code:"MIME_TYPE_NOT_SUPPORTED",message:(0,o.sprintf)((0,o.__)("%s: Sorry, this file type is not supported here."),e.name),file:e})}function b(e,t){const i=(a=t)?Object.entries(a).flatMap((([e,t])=>{const[i]=t.split("/");return[t,...e.split("|").map((e=>`${i}/${e}`))]})):null;var a;if(!i)return;const r=i.includes(e.type);if(e.type&&!r)throw new y({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:(0,o.sprintf)((0,o.__)("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e})}function S(e,t){if(e.size<=0)throw new y({code:"EMPTY_FILE",message:(0,o.sprintf)((0,o.__)("%s: This file is empty."),e.name),file:e});if(t&&e.size>t)throw new y({code:"SIZE_ABOVE_LIMIT",message:(0,o.sprintf)((0,o.__)("%s: This file exceeds the maximum upload size for this site."),e.name),file:e})}function _({wpAllowedMimeTypes:e,allowedTypes:t,additionalData:i={},filesList:a,maxUploadFileSize:r,onError:s,onFileChange:n,signal:l,multiple:d=!0}){if(!d&&a.length>1)return void s?.(new Error((0,o.__)("Only one file can be used here.")));const p=[],m=[],h=(e,t)=>{window.__experimentalMediaProcessing||m[e]?.url&&(0,c.revokeBlobURL)(m[e].url),m[e]=t,n?.(m.filter((e=>null!==e)))};for(const i of a){try{b(i,e)}catch(e){s?.(e);continue}try{g(i,t)}catch(e){s?.(e);continue}try{S(i,r)}catch(e){s?.(e);continue}p.push(i),window.__experimentalMediaProcessing||(m.push({url:(0,c.createBlobURL)(i)}),n?.(m))}p.map((async(e,t)=>{try{const o=await async function(e,t={},i){const o=new FormData;o.append("file",e,e.name||e.type.replace("/","."));for(const[e,i]of Object.entries(t))f(o,e,i);return w(await u()({path:"/wp/v2/media?_embed=wp:featuredmedia",body:o,method:"POST",signal:i}))}(e,i,l);h(t,o)}catch(i){let a;h(t,null),a="object"==typeof i&&null!==i&&"message"in i?"string"==typeof i.message?i.message:String(i.message):(0,o.sprintf)((0,o.__)("Error while uploading file %s to the media library."),e.name),s?.(new y({code:"GENERAL",message:a,file:e,cause:i instanceof Error?i:void 0}))}}))}const v=()=>{};const O=window.wp.privateApis,{lock:E,unlock:M}=(0,O.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/media-utils"),T={};E(T,{sideloadMedia:async function({file:e,attachmentId:t,additionalData:i={},signal:a,onFileChange:r,onError:s=v}){try{const o=await async function(e,t,i={},o){const a=new FormData;a.append("file",e,e.name||e.type.replace("/","."));for(const[e,t]of Object.entries(i))f(a,e,t);return w(await u()({path:`/wp/v2/media/${t}/sideload`,body:a,method:"POST",signal:o}))}(e,t,i,a);r?.([o])}catch(t){let i;i=t instanceof Error?t.message:(0,o.sprintf)((0,o.__)("Error while sideloading file %s to the server."),e.name),s(new y({code:"GENERAL",message:i,file:e,cause:t instanceof Error?t:void 0}))}}}),(window.wp=window.wp||{}).mediaUtils=t})(); components.min.js 0000644 00003044604 15121363553 0010070 0 ustar 00 /*! This file is auto-generated */
(()=>{var e,t,n={66:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)};var n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function o(e,t,n){return e.concat(t).map((function(e){return r(e,n)}))}function i(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function a(e,t,n){var o={};return n.isMergeableObject(e)&&i(e).forEach((function(t){o[t]=r(e[t],n)})),i(t).forEach((function(i){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(s(e,i)&&n.isMergeableObject(t[i])?o[i]=function(e,t){if(!t.customMerge)return l;var n=t.customMerge(e);return"function"==typeof n?n:l}(i,n)(e[i],t[i],n):o[i]=r(t[i],n))})),o}function l(e,n,i){(i=i||{}).arrayMerge=i.arrayMerge||o,i.isMergeableObject=i.isMergeableObject||t,i.cloneUnlessOtherwiseSpecified=r;var s=Array.isArray(n);return s===Array.isArray(e)?s?i.arrayMerge(e,n,i):a(e,n,i):r(n,i)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return l(e,n,t)}),{})};var c=l;e.exports=c},83:(e,t,n)=>{"use strict";
/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var r=n(1609);var o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,s=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return a((function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})}),[e,n,t]),s((function(){return c(o)&&u({inst:o}),e((function(){c(o)&&u({inst:o})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},422:(e,t,n)=>{"use strict";e.exports=n(83)},1178:(e,t,n)=>{"use strict";e.exports=n(2950)},1609:e=>{"use strict";e.exports=window.React},1880:(e,t,n)=>{"use strict";var r=n(1178),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function l(e){return r.isMemo(e)?s:a[e.$$typeof]||o}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=s;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(p){var o=h(n);o&&o!==p&&e(t,o,r)}var s=u(n);d&&(s=s.concat(d(n)));for(var a=l(t),m=l(n),g=0;g<s.length;++g){var v=s[g];if(!(i[v]||r&&r[v]||m&&m[v]||a&&a[v])){var b=f(n,v);try{c(t,v,b)}catch(e){}}}}return t}},2950:(e,t)=>{"use strict";
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,x=n?Symbol.for("react.responder"):60118,y=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case i:case a:case s:case h:return e;default:switch(e=e&&e.$$typeof){case c:case f:case g:case m:case l:return e;default:return t}}case o:return t}}}function _(e){return w(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=f,t.Fragment=i,t.Lazy=g,t.Memo=m,t.Portal=o,t.Profiler=a,t.StrictMode=s,t.Suspense=h,t.isAsyncMode=function(e){return _(e)||w(e)===u},t.isConcurrentMode=_,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===f},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===a},t.isStrictMode=function(e){return w(e)===s},t.isSuspense=function(e){return w(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===a||e===s||e===h||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===f||e.$$typeof===b||e.$$typeof===x||e.$$typeof===y||e.$$typeof===v)},t.typeOf=w},7734:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],n.get(o[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(t[o]!==n[o])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},8924:(e,t)=>{var n,r;(r=r||{}).stringify=(n={"visit_linear-gradient":function(e){return n.visit_gradient(e)},"visit_repeating-linear-gradient":function(e){return n.visit_gradient(e)},"visit_radial-gradient":function(e){return n.visit_gradient(e)},"visit_repeating-radial-gradient":function(e){return n.visit_gradient(e)},visit_gradient:function(e){var t=n.visit(e.orientation);return t&&(t+=", "),e.type+"("+t+n.visit(e.colorStops)+")"},visit_shape:function(e){var t=e.value,r=n.visit(e.at),o=n.visit(e.style);return o&&(t+=" "+o),r&&(t+=" at "+r),t},"visit_default-radial":function(e){var t="",r=n.visit(e.at);return r&&(t+=r),t},"visit_extent-keyword":function(e){var t=e.value,r=n.visit(e.at);return r&&(t+=" at "+r),t},"visit_position-keyword":function(e){return e.value},visit_position:function(e){return n.visit(e.value.x)+" "+n.visit(e.value.y)},"visit_%":function(e){return e.value+"%"},visit_em:function(e){return e.value+"em"},visit_px:function(e){return e.value+"px"},visit_calc:function(e){return"calc("+e.value+")"},visit_literal:function(e){return n.visit_color(e.value,e)},visit_hex:function(e){return n.visit_color("#"+e.value,e)},visit_rgb:function(e){return n.visit_color("rgb("+e.value.join(", ")+")",e)},visit_rgba:function(e){return n.visit_color("rgba("+e.value.join(", ")+")",e)},visit_hsl:function(e){return n.visit_color("hsl("+e.value[0]+", "+e.value[1]+"%, "+e.value[2]+"%)",e)},visit_hsla:function(e){return n.visit_color("hsla("+e.value[0]+", "+e.value[1]+"%, "+e.value[2]+"%, "+e.value[3]+")",e)},visit_var:function(e){return n.visit_color("var("+e.value+")",e)},visit_color:function(e,t){var r=e,o=n.visit(t.length);return o&&(r+=" "+o),r},visit_angular:function(e){return e.value+"deg"},visit_directional:function(e){return"to "+e.value},visit_array:function(e){var t="",r=e.length;return e.forEach((function(e,o){t+=n.visit(e),o<r-1&&(t+=", ")})),t},visit_object:function(e){return e.width&&e.height?n.visit(e.width)+" "+n.visit(e.height):""},visit:function(e){if(!e)return"";if(e instanceof Array)return n.visit_array(e);if("object"!=typeof e||e.type){if(e.type){var t=n["visit_"+e.type];if(t)return t(e);throw Error("Missing visitor visit_"+e.type)}throw Error("Invalid node.")}return n.visit_object(e)}},function(e){return n.visit(e)}),(r=r||{}).parse=function(){var e=/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,t=/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,n=/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,r=/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,o=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,i=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,a=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,d=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))rad/,f=/^\(/,h=/^\)/,p=/^,/,m=/^\#([0-9a-fA-F]+)/,g=/^([a-zA-Z]+)/,v=/^rgb/i,b=/^rgba/i,x=/^var/i,y=/^calc/i,w=/^(--[a-zA-Z0-9-,\s\#]+)/,_=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,S=/^hsl/i,C=/^hsla/i,k="";function j(e){var t=new Error(k+": "+e);throw t.source=k,t}function E(){var e=z(M);return k.length>0&&j("Invalid input not EOF"),e}function M(){return N("linear-gradient",e,P)||N("repeating-linear-gradient",t,P)||N("radial-gradient",n,D)||N("repeating-radial-gradient",r,D)}function N(e,t,n){return T(t,(function(t){var r=n();return r&&(H(p)||j("Missing comma before color stops")),{type:e,orientation:r,colorStops:z(L)}}))}function T(e,t){var n=H(e);if(n){H(f)||j("Missing (");var r=t(n);return H(h)||j("Missing )"),r}}function P(){var e=$("directional",o,1);if(e)return e;var t=$("position-keyword",s,1);return t?{type:"directional",value:t.value}:$("angular",u,1)||$("angular",d,1)}function D(){var e,t,n=I();return n&&((e=[]).push(n),t=k,H(p)&&((n=I())?e.push(n):k=t)),e}function I(){var e=function(){var e=$("shape",/^(circle)/i,0);e&&(e.style=W()||R());return e}()||function(){var e=$("shape",/^(ellipse)/i,0);e&&(e.style=A()||V()||R());return e}();if(e)e.at=O();else{var t=R();if(t){e=t;var n=O();n&&(e.at=n)}else{var r=O();if(r)e={type:"default-radial",at:r};else{var o=A();o&&(e={type:"default-radial",at:o})}}}return e}function R(){return $("extent-keyword",i,1)}function O(){if($("position",/^at/,0)){var e=A();return e||j("Missing positioning value"),e}}function A(){var e={x:V(),y:V()};if(e.x||e.y)return{type:"position",value:e}}function z(e){var t=e(),n=[];if(t)for(n.push(t);H(p);)(t=e())?n.push(t):j("One extra comma");return n}function L(){var e=$("hex",m,1)||T(C,(function(){var e=B();H(p);var t=H(l),n=t?t[1]:null;H(p);var r=(t=H(l))?t[1]:null;H(p);var o=B();return n&&r||j("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[e,n,r,o]}}))||T(S,(function(){H(l)&&j("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");var e=B();H(p);var t=H(l),n=t?t[1]:null;H(p);var r=(t=H(l))?t[1]:null;return n&&r||j("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[e,n,r]}}))||T(b,(function(){return{type:"rgba",value:z(B)}}))||T(v,(function(){return{type:"rgb",value:z(B)}}))||T(x,(function(){return{type:"var",value:F()}}))||$("literal",g,0);return e||j("Expected color definition"),e.length=V(),e}function F(){return H(w)[1]}function B(){return H(_)[1]}function V(){return $("%",l,1)||$("position-keyword",s,1)||T(y,(function(){for(var e=1,t=0;e>0&&t<k.length;){var n=k.charAt(t);"("===n?e++:")"===n&&e--,t++}e>0&&j("Missing closing parenthesis in calc() expression");var r=k.substring(0,t-1);return U(t-1),{type:"calc",value:r}}))||W()}function W(){return $("px",a,1)||$("em",c,1)}function $(e,t,n){var r=H(t);if(r)return{type:e,value:r[n]}}function H(e){var t,n;return(n=/^[\n\r\t\s]+/.exec(k))&&U(n[0].length),(t=e.exec(k))&&U(t[0].length),t}function U(e){k=k.substr(e)}return function(e){return(k=e.toString().trim()).endsWith(";")&&(k=k.slice(0,-1)),E()}}(),t.parse=r.parse,t.stringify=r.stringify},9664:e=>{e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);Object.defineProperty(t,"combineChunks",{enumerable:!0,get:function(){return r.combineChunks}}),Object.defineProperty(t,"fillInChunks",{enumerable:!0,get:function(){return r.fillInChunks}}),Object.defineProperty(t,"findAll",{enumerable:!0,get:function(){return r.findAll}}),Object.defineProperty(t,"findChunks",{enumerable:!0,get:function(){return r.findChunks}})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.findAll=function(e){var t=e.autoEscape,i=e.caseSensitive,s=void 0!==i&&i,a=e.findChunks,l=void 0===a?r:a,c=e.sanitize,u=e.searchWords,d=e.textToHighlight;return o({chunksToHighlight:n({chunks:l({autoEscape:t,caseSensitive:s,sanitize:c,searchWords:u,textToHighlight:d})}),totalLength:d?d.length:0})};var n=t.combineChunks=function(e){var t=e.chunks;return t=t.sort((function(e,t){return e.start-t.start})).reduce((function(e,t){if(0===e.length)return[t];var n=e.pop();if(t.start<=n.end){var r=Math.max(n.end,t.end);e.push({highlight:!1,start:n.start,end:r})}else e.push(n,t);return e}),[])},r=function(e){var t=e.autoEscape,n=e.caseSensitive,r=e.sanitize,o=void 0===r?i:r,s=e.searchWords,a=e.textToHighlight;return a=o(a),s.filter((function(e){return e})).reduce((function(e,r){r=o(r),t&&(r=r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"));for(var i=new RegExp(r,n?"g":"gi"),s=void 0;s=i.exec(a);){var l=s.index,c=i.lastIndex;c>l&&e.push({highlight:!1,start:l,end:c}),s.index===i.lastIndex&&i.lastIndex++}return e}),[])};t.findChunks=r;var o=t.fillInChunks=function(e){var t=e.chunksToHighlight,n=e.totalLength,r=[],o=function(e,t,n){t-e>0&&r.push({start:e,end:t,highlight:n})};if(0===t.length)o(0,n,!1);else{var i=0;t.forEach((function(e){o(i,e.start,!1),o(e.start,e.end,!0),i=e.end})),o(i,n,!1)}return r};function i(e){return e}}])},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},n=Object.keys(t).join("|"),r=new RegExp(n,"g"),o=new RegExp(n,"");function i(e){return t[e]}var s=function(e){return e.replace(r,i)};e.exports=s,e.exports.has=function(e){return!!e.match(o)},e.exports.remove=s}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);o.r(i);var s={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>s[e]=()=>n[e]));return s.default=()=>n,o.d(i,s),i},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var i={};(()=>{"use strict";o.r(i),o.d(i,{AlignmentMatrixControl:()=>Ql,AnglePickerControl:()=>hw,Animate:()=>tc,Autocomplete:()=>N_,BaseControl:()=>Oy,BlockQuotation:()=>a.BlockQuotation,BorderBoxControl:()=>wE,BorderControl:()=>nE,BoxControl:()=>oM,Button:()=>Hy,ButtonGroup:()=>iM,Card:()=>BM,CardBody:()=>XM,CardDivider:()=>lN,CardFooter:()=>uN,CardHeader:()=>fN,CardMedia:()=>pN,CheckboxControl:()=>mN,Circle:()=>a.Circle,ClipboardButton:()=>vN,ColorIndicator:()=>IS,ColorPalette:()=>_j,ColorPicker:()=>Jk,ComboboxControl:()=>rP,Composite:()=>Kn,CustomGradientPicker:()=>aT,CustomSelectControl:()=>TD,Dashicon:()=>By,DatePicker:()=>_R,DateTimePicker:()=>HR,Disabled:()=>JR,Draggable:()=>nO,DropZone:()=>oO,DropZoneProvider:()=>iO,Dropdown:()=>LS,DropdownMenu:()=>CT,DuotonePicker:()=>fO,DuotoneSwatch:()=>hO,ExternalLink:()=>pO,Fill:()=>u_,Flex:()=>vv,FlexBlock:()=>xv,FlexItem:()=>Pv,FocalPointPicker:()=>LO,FocusReturnProvider:()=>OV,FocusableIframe:()=>FO,FontSizePicker:()=>JO,FormFileUpload:()=>eA,FormToggle:()=>rA,FormTokenField:()=>uA,G:()=>a.G,GradientPicker:()=>fT,Guide:()=>hA,GuidePage:()=>pA,HorizontalRule:()=>a.HorizontalRule,Icon:()=>Vy,IconButton:()=>mA,IsolatedEventContainer:()=>xV,KeyboardShortcuts:()=>vA,Line:()=>a.Line,MenuGroup:()=>bA,MenuItem:()=>yA,MenuItemsChoice:()=>_A,Modal:()=>yP,NavigableMenu:()=>wT,Navigator:()=>oL,Notice:()=>lL,NoticeList:()=>uL,Panel:()=>fL,PanelBody:()=>vL,PanelHeader:()=>dL,PanelRow:()=>bL,Path:()=>a.Path,Placeholder:()=>yL,Polygon:()=>a.Polygon,Popover:()=>y_,ProgressBar:()=>jL,QueryControls:()=>zL,RadioControl:()=>HL,RangeControl:()=>YC,Rect:()=>a.Rect,ResizableBox:()=>TF,ResponsiveWrapper:()=>PF,SVG:()=>a.SVG,SandBox:()=>IF,ScrollLock:()=>Rw,SearchControl:()=>dz,SelectControl:()=>oC,Slot:()=>d_,SlotFillProvider:()=>f_,Snackbar:()=>OF,SnackbarList:()=>zF,Spinner:()=>JT,TabPanel:()=>JF,TabbableContainer:()=>SA,TextControl:()=>tB,TextHighlight:()=>lB,TextareaControl:()=>aB,TimePicker:()=>BR,Tip:()=>uB,ToggleControl:()=>fB,Toolbar:()=>IB,ToolbarButton:()=>CB,ToolbarDropdownMenu:()=>RB,ToolbarGroup:()=>EB,ToolbarItem:()=>_B,Tooltip:()=>cs,TreeSelect:()=>PL,VisuallyHidden:()=>jl,__experimentalAlignmentMatrixControl:()=>Ql,__experimentalApplyValueToSides:()=>PE,__experimentalBorderBoxControl:()=>wE,__experimentalBorderControl:()=>nE,__experimentalBoxControl:()=>oM,__experimentalConfirmDialog:()=>_P,__experimentalDimensionControl:()=>GR,__experimentalDivider:()=>sN,__experimentalDropdownContentWrapper:()=>mj,__experimentalElevation:()=>cM,__experimentalGrid:()=>iE,__experimentalHStack:()=>ow,__experimentalHasSplitBorders:()=>pE,__experimentalHeading:()=>dj,__experimentalInputControl:()=>Fy,__experimentalInputControlPrefixWrapper:()=>ik,__experimentalInputControlSuffixWrapper:()=>BS,__experimentalIsDefinedBorder:()=>hE,__experimentalIsEmptyBorder:()=>fE,__experimentalItem:()=>RN,__experimentalItemGroup:()=>ON,__experimentalNavigation:()=>$A,__experimentalNavigationBackButton:()=>YA,__experimentalNavigationGroup:()=>KA,__experimentalNavigationItem:()=>oz,__experimentalNavigationMenu:()=>mz,__experimentalNavigatorBackButton:()=>nL,__experimentalNavigatorButton:()=>tL,__experimentalNavigatorProvider:()=>Jz,__experimentalNavigatorScreen:()=>eL,__experimentalNavigatorToParentButton:()=>rL,__experimentalNumberControl:()=>aw,__experimentalPaletteEdit:()=>FT,__experimentalParseQuantityAndUnitFromRawValue:()=>Hj,__experimentalRadio:()=>FL,__experimentalRadioGroup:()=>BL,__experimentalScrollable:()=>qM,__experimentalSpacer:()=>Mv,__experimentalStyleProvider:()=>t_,__experimentalSurface:()=>LF,__experimentalText:()=>Rb,__experimentalToggleGroupControl:()=>pS,__experimentalToggleGroupControlOption:()=>AR,__experimentalToggleGroupControlOptionIcon:()=>TS,__experimentalToolbarContext:()=>yB,__experimentalToolsPanel:()=>rV,__experimentalToolsPanelContext:()=>UB,__experimentalToolsPanelItem:()=>sV,__experimentalTreeGrid:()=>fV,__experimentalTreeGridCell:()=>gV,__experimentalTreeGridItem:()=>mV,__experimentalTreeGridRow:()=>vV,__experimentalTruncate:()=>cj,__experimentalUnitControl:()=>Zj,__experimentalUseCustomUnits:()=>Uj,__experimentalUseNavigator:()=>Kz,__experimentalUseSlot:()=>Lw,__experimentalUseSlotFills:()=>yV,__experimentalVStack:()=>lj,__experimentalView:()=>kl,__experimentalZStack:()=>kV,__unstableAnimatePresence:()=>mc,__unstableComposite:()=>lP,__unstableCompositeGroup:()=>cP,__unstableCompositeItem:()=>uP,__unstableDisclosureContent:()=>eO,__unstableGetAnimateClassName:()=>ec,__unstableMotion:()=>sv,__unstableUseAutocompleteProps:()=>M_,__unstableUseCompositeState:()=>dP,__unstableUseNavigateRegions:()=>EV,createSlotFill:()=>h_,navigateRegions:()=>MV,privateApis:()=>PG,useBaseControlProps:()=>T_,useNavigator:()=>Kz,withConstrainedTabbing:()=>NV,withFallbackStyles:()=>TV,withFilters:()=>IV,withFocusOutside:()=>GT,withFocusReturn:()=>RV,withNotices:()=>AV,withSpokenMessages:()=>sz});var e={};o.r(e),o.d(e,{Text:()=>xb,block:()=>yb,destructive:()=>_b,highlighterText:()=>Cb,muted:()=>Sb,positive:()=>wb,upperCase:()=>kb});var t={};o.r(t),o.d(t,{Rp:()=>SS,y0:()=>bS,uG:()=>yS,eh:()=>xS});var n={};o.r(n),o.d(n,{Button:()=>HU,CaptionLabel:()=>UU,Chevron:()=>YU,Day:()=>GU,DayButton:()=>qU,Dropdown:()=>KU,DropdownNav:()=>XU,Footer:()=>ZU,Month:()=>QU,MonthCaption:()=>JU,MonthGrid:()=>eY,Months:()=>tY,MonthsDropdown:()=>oY,Nav:()=>iY,NextMonthButton:()=>sY,Option:()=>aY,PreviousMonthButton:()=>lY,Root:()=>cY,Select:()=>uY,Week:()=>dY,WeekNumber:()=>pY,WeekNumberHeader:()=>mY,Weekday:()=>fY,Weekdays:()=>hY,Weeks:()=>gY,YearsDropdown:()=>vY});var r={};o.r(r),o.d(r,{formatCaption:()=>xY,formatDay:()=>wY,formatMonthCaption:()=>yY,formatMonthDropdown:()=>_Y,formatWeekNumber:()=>CY,formatWeekNumberHeader:()=>kY,formatWeekdayName:()=>SY,formatYearCaption:()=>EY,formatYearDropdown:()=>jY});var s={};o.r(s),o.d(s,{labelCaption:()=>IY,labelDay:()=>PY,labelDayButton:()=>TY,labelGrid:()=>DY,labelGridcell:()=>RY,labelMonthDropdown:()=>OY,labelNav:()=>AY,labelNext:()=>zY,labelPrevious:()=>LY,labelWeekNumber:()=>BY,labelWeekNumberHeader:()=>VY,labelWeekday:()=>FY,labelYearDropdown:()=>WY});const a=window.wp.primitives;function l(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=l(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}const c=function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=l(e))&&(r&&(r+=" "),r+=t);return r},u=window.wp.i18n,d=window.wp.compose,f=window.wp.element;var h=Object.defineProperty,p=Object.defineProperties,m=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,x=(e,t,n)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,y=(e,t)=>{for(var n in t||(t={}))v.call(t,n)&&x(e,n,t[n]);if(g)for(var n of g(t))b.call(t,n)&&x(e,n,t[n]);return e},w=(e,t)=>p(e,m(t)),_=(e,t)=>{var n={};for(var r in e)v.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&g)for(var r of g(e))t.indexOf(r)<0&&b.call(e,r)&&(n[r]=e[r]);return n},S=Object.defineProperty,C=Object.defineProperties,k=Object.getOwnPropertyDescriptors,j=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable,N=(e,t,n)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t)=>{for(var n in t||(t={}))E.call(t,n)&&N(e,n,t[n]);if(j)for(var n of j(t))M.call(t,n)&&N(e,n,t[n]);return e},P=(e,t)=>C(e,k(t)),D=(e,t)=>{var n={};for(var r in e)E.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&j)for(var r of j(e))t.indexOf(r)<0&&M.call(e,r)&&(n[r]=e[r]);return n};function I(...e){}function R(e,t){if(function(e){return"function"==typeof e}(e)){return e(function(e){return"function"==typeof e}(t)?t():t)}return e}function O(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function A(...e){return(...t)=>{for(const n of e)"function"==typeof n&&n(...t)}}function z(e){return e}function L(e,t){if(!e){if("string"!=typeof t)throw new Error("Invariant failed");throw new Error(t)}}function F(e,...t){const n="function"==typeof e?e(...t):e;return null!=n&&!n}function B(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function V(e){const t={};for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}function W(...e){for(const t of e)if(void 0!==t)return t}var $=o(1609),H=o.t($,2),U=o.n($);function Y(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function G(e){if(!function(e){return!!e&&!!(0,$.isValidElement)(e)&&("ref"in e.props||"ref"in e)}(e))return null;return y({},e.props).ref||e.ref}var q,K="undefined"!=typeof window&&!!(null==(q=window.document)?void 0:q.createElement);function X(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function Z(e){return e?"self"in e?e.self:X(e).defaultView||window:self}function Q(e,t=!1){const{activeElement:n}=X(e);if(!(null==n?void 0:n.nodeName))return null;if(ee(n)&&n.contentDocument)return Q(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=X(n).getElementById(e);if(t)return t}}return n}function J(e,t){return e===t||e.contains(t)}function ee(e){return"IFRAME"===e.tagName}function te(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==ne.indexOf(e.type)}var ne=["button","color","file","image","reset","submit"];function re(e){if("function"==typeof e.checkVisibility)return e.checkVisibility();const t=e;return t.offsetWidth>0||t.offsetHeight>0||e.getClientRects().length>0}function oe(e){try{const t=e instanceof HTMLInputElement&&null!==e.selectionStart,n="TEXTAREA"===e.tagName;return t||n||!1}catch(e){return!1}}function ie(e){return e.isContentEditable||oe(e)}function se(e,t){const n=null==e?void 0:e.getAttribute("role");return n&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(n)?n:t}function ae(e,t){var n;const r=se(e);if(!r)return t;return null!=(n={menu:"menuitem",listbox:"option",tree:"treeitem"}[r])?n:t}function le(e){if(!e)return null;const t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){const{overflowY:n}=getComputedStyle(e);if(t(n))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){const{overflowX:n}=getComputedStyle(e);if(t(n))return e}return le(e.parentElement)||document.scrollingElement||document.body}function ce(e,t){const n=e.map(((e,t)=>[t,e]));let r=!1;return n.sort((([e,n],[o,i])=>{const s=t(n),a=t(i);return s===a?0:s&&a?function(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}(s,a)?(e>o&&(r=!0),-1):(e<o&&(r=!0),1):0})),r?n.map((([e,t])=>t)):e}function ue(){return!!K&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function de(){return K&&ue()&&/apple/i.test(navigator.vendor)}function fe(){return K&&navigator.platform.startsWith("Mac")&&!(K&&navigator.maxTouchPoints)}function he(e){return Boolean(e.currentTarget&&!J(e.currentTarget,e.target))}function pe(e){return e.target===e.currentTarget}function me(e){const t=e.currentTarget;if(!t)return!1;const n=ue();if(n&&!e.metaKey)return!1;if(!n&&!e.ctrlKey)return!1;const r=t.tagName.toLowerCase();return"a"===r||("button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}function ge(e){const t=e.currentTarget;if(!t)return!1;const n=t.tagName.toLowerCase();return!!e.altKey&&("a"===n||("button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type))}function ve(e,t){const n=new FocusEvent("blur",t),r=e.dispatchEvent(n),o=P(T({},t),{bubbles:!0});return e.dispatchEvent(new FocusEvent("focusout",o)),r}function be(e,t){const n=new MouseEvent("click",t);return e.dispatchEvent(n)}function xe(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!J(n,r)}function ye(e,t,n,r){const o=(e=>{if(r){const t=setTimeout(e,r);return()=>clearTimeout(t)}const t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})((()=>{e.removeEventListener(t,i,!0),n()})),i=()=>{o(),n()};return e.addEventListener(t,i,{once:!0,capture:!0}),o}function we(e,t,n,r=window){const o=[];try{r.document.addEventListener(e,t,n);for(const i of Array.from(r.frames))o.push(we(e,t,n,i))}catch(e){}return()=>{try{r.document.removeEventListener(e,t,n)}catch(e){}for(const e of o)e()}}var _e=y({},H),Se=_e.useId,Ce=(_e.useDeferredValue,_e.useInsertionEffect),ke=K?$.useLayoutEffect:$.useEffect;function je(e){const[t]=(0,$.useState)(e);return t}function Ee(e){const t=(0,$.useRef)(e);return ke((()=>{t.current=e})),t}function Me(e){const t=(0,$.useRef)((()=>{throw new Error("Cannot call an event handler while rendering.")}));return Ce?Ce((()=>{t.current=e})):t.current=e,(0,$.useCallback)(((...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)}),[])}function Ne(e){const[t,n]=(0,$.useState)(null);return ke((()=>{if(null==t)return;if(!e)return;let n=null;return e((e=>(n=e,t))),()=>{e(n)}}),[t,e]),[t,n]}function Te(...e){return(0,$.useMemo)((()=>{if(e.some(Boolean))return t=>{for(const n of e)Y(n,t)}}),e)}function Pe(e){if(Se){const t=Se();return e||t}const[t,n]=(0,$.useState)(e);return ke((()=>{if(e||t)return;const r=Math.random().toString(36).slice(2,8);n(`id-${r}`)}),[e,t]),e||t}function De(e,t){const n=e=>{if("string"==typeof e)return e},[r,o]=(0,$.useState)((()=>n(t)));return ke((()=>{const r=e&&"current"in e?e.current:e;o((null==r?void 0:r.tagName.toLowerCase())||n(t))}),[e,t]),r}function Ie(e,t){const n=(0,$.useRef)(!1);(0,$.useEffect)((()=>{if(n.current)return e();n.current=!0}),t),(0,$.useEffect)((()=>()=>{n.current=!1}),[])}function Re(){return(0,$.useReducer)((()=>[]),[])}function Oe(e){return Me("function"==typeof e?e:()=>e)}function Ae(e,t,n=[]){const r=(0,$.useCallback)((n=>(e.wrapElement&&(n=e.wrapElement(n)),t(n))),[...n,e.wrapElement]);return w(y({},e),{wrapElement:r})}function ze(e=!1,t){const[n,r]=(0,$.useState)(null);return{portalRef:Te(r,t),portalNode:n,domReady:!e||n}}function Le(e,t,n){const r=e.onLoadedMetadataCapture,o=(0,$.useMemo)((()=>Object.assign((()=>{}),w(y({},r),{[t]:n}))),[r,t,n]);return[null==r?void 0:r[t],{onLoadedMetadataCapture:o}]}function Fe(){(0,$.useEffect)((()=>{we("mousemove",$e,!0),we("mousedown",He,!0),we("mouseup",He,!0),we("keydown",He,!0),we("scroll",He,!0)}),[]);return Me((()=>Be))}var Be=!1,Ve=0,We=0;function $e(e){(function(e){const t=e.movementX||e.screenX-Ve,n=e.movementY||e.screenY-We;return Ve=e.screenX,We=e.screenY,t||n||!1})(e)&&(Be=!0)}function He(){Be=!1}function Ue(e,t){const n=e.__unstableInternals;return L(n,"Invalid store"),n[t]}function Ye(e,...t){let n=e,r=n,o=Symbol(),i=I;const s=new Set,a=new Set,l=new Set,c=new Set,u=new Set,d=new WeakMap,f=new WeakMap,h=(e,t,n=c)=>(n.add(t),f.set(t,e),()=>{var e;null==(e=d.get(t))||e(),d.delete(t),f.delete(t),n.delete(t)}),p=(e,i,s=!1)=>{var l;if(!O(n,e))return;const h=R(i,n[e]);if(h===n[e])return;if(!s)for(const n of t)null==(l=null==n?void 0:n.setState)||l.call(n,e,h);const p=n;n=P(T({},n),{[e]:h});const m=Symbol();o=m,a.add(e);const g=(t,r,o)=>{var i;const s=f.get(t);s&&!s.some((t=>o?o.has(t):t===e))||(null==(i=d.get(t))||i(),d.set(t,t(n,r)))};for(const e of c)g(e,p);queueMicrotask((()=>{if(o!==m)return;const e=n;for(const e of u)g(e,r,a);r=e,a.clear()}))},m={getState:()=>n,setState:p,__unstableInternals:{setup:e=>(l.add(e),()=>l.delete(e)),init:()=>{const e=s.size,r=Symbol();s.add(r);const o=()=>{s.delete(r),s.size||i()};if(e)return o;const a=(c=n,Object.keys(c)).map((e=>A(...t.map((t=>{var n;const r=null==(n=null==t?void 0:t.getState)?void 0:n.call(t);if(r&&O(r,e))return Xe(t,[e],(t=>{p(e,t[e],!0)}))})))));var c;const u=[];for(const e of l)u.push(e());const d=t.map(qe);return i=A(...a,...u,...d),o},subscribe:(e,t)=>h(e,t),sync:(e,t)=>(d.set(t,t(n,n)),h(e,t)),batch:(e,t)=>(d.set(t,t(n,r)),h(e,t,u)),pick:e=>Ye(function(e,t){const n={};for(const r of t)O(e,r)&&(n[r]=e[r]);return n}(n,e),m),omit:e=>Ye(function(e,t){const n=T({},e);for(const e of t)O(n,e)&&delete n[e];return n}(n,e),m)}};return m}function Ge(e,...t){if(e)return Ue(e,"setup")(...t)}function qe(e,...t){if(e)return Ue(e,"init")(...t)}function Ke(e,...t){if(e)return Ue(e,"subscribe")(...t)}function Xe(e,...t){if(e)return Ue(e,"sync")(...t)}function Ze(e,...t){if(e)return Ue(e,"batch")(...t)}function Qe(e,...t){if(e)return Ue(e,"omit")(...t)}function Je(...e){const t=e.reduce(((e,t)=>{var n;const r=null==(n=null==t?void 0:t.getState)?void 0:n.call(t);return r?Object.assign(e,r):e}),{}),n=Ye(t,...e);return Object.assign({},...e,n)}var et=o(422),{useSyncExternalStore:tt}=et,nt=()=>()=>{};function rt(e,t=z){const n=$.useCallback((t=>e?Ke(e,null,t):nt()),[e]),r=()=>{const n="string"==typeof t?t:null,r="function"==typeof t?t:null,o=null==e?void 0:e.getState();return r?r(o):o&&n&&O(o,n)?o[n]:void 0};return tt(n,r,r)}function ot(e,t){const n=$.useRef({}),r=$.useCallback((t=>e?Ke(e,null,t):nt()),[e]),o=()=>{const r=null==e?void 0:e.getState();let o=!1;const i=n.current;for(const e in t){const n=t[e];if("function"==typeof n){const t=n(r);t!==i[e]&&(i[e]=t,o=!0)}if("string"==typeof n){if(!r)continue;if(!O(r,n))continue;const t=r[n];t!==i[e]&&(i[e]=t,o=!0)}}return o&&(n.current=y({},i)),n.current};return tt(r,o,o)}function it(e,t,n,r){const o=O(t,n)?t[n]:void 0,i=r?t[r]:void 0,s=Ee({value:o,setValue:i});ke((()=>Xe(e,[n],((e,t)=>{const{value:r,setValue:o}=s.current;o&&e[n]!==t[n]&&e[n]!==r&&o(e[n])}))),[e,n]),ke((()=>{if(void 0!==o)return e.setState(n,o),Ze(e,[n],(()=>{void 0!==o&&e.setState(n,o)}))}))}function st(e,t){const[n,r]=$.useState((()=>e(t)));ke((()=>qe(n)),[n]);const o=$.useCallback((e=>rt(n,e)),[n]);return[$.useMemo((()=>w(y({},n),{useState:o})),[n,o]),Me((()=>{r((n=>e(y(y({},t),n.getState()))))}))]}function at(e,t,n){return Ie(t,[n.store]),it(e,n,"items","setItems"),e}function lt(e={}){var t;e.store;const n=null==(t=e.store)?void 0:t.getState(),r=W(e.items,null==n?void 0:n.items,e.defaultItems,[]),o=new Map(r.map((e=>[e.id,e]))),i={items:r,renderedItems:W(null==n?void 0:n.renderedItems,[])},s=null==(a=e.store)?void 0:a.__unstablePrivateStore;var a;const l=Ye({items:r,renderedItems:i.renderedItems},s),c=Ye(i,e.store),u=e=>{const t=ce(e,(e=>e.element));l.setState("renderedItems",t),c.setState("renderedItems",t)};Ge(c,(()=>qe(l))),Ge(l,(()=>Ze(l,["items"],(e=>{c.setState("items",e.items)})))),Ge(l,(()=>Ze(l,["renderedItems"],(e=>{let t=!0,n=requestAnimationFrame((()=>{const{renderedItems:t}=c.getState();e.renderedItems!==t&&u(e.renderedItems)}));if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(n);const r=function(e){var t;const n=e.find((e=>!!e.element)),r=[...e].reverse().find((e=>!!e.element));let o=null==(t=null==n?void 0:n.element)?void 0:t.parentElement;for(;o&&(null==r?void 0:r.element);){if(r&&o.contains(r.element))return o;o=o.parentElement}return X(o).body}(e.renderedItems),o=new IntersectionObserver((()=>{t?t=!1:(cancelAnimationFrame(n),n=requestAnimationFrame((()=>u(e.renderedItems))))}),{root:r});for(const t of e.renderedItems)t.element&&o.observe(t.element);return()=>{cancelAnimationFrame(n),o.disconnect()}}))));const d=(e,t,n=!1)=>{let r;t((t=>{const n=t.findIndex((({id:t})=>t===e.id)),i=t.slice();if(-1!==n){r=t[n];const s=T(T({},r),e);i[n]=s,o.set(e.id,s)}else i.push(e),o.set(e.id,e);return i}));return()=>{t((t=>{if(!r)return n&&o.delete(e.id),t.filter((({id:t})=>t!==e.id));const i=t.findIndex((({id:t})=>t===e.id));if(-1===i)return t;const s=t.slice();return s[i]=r,o.set(e.id,r),s}))}},f=e=>d(e,(e=>l.setState("items",e)),!0);return P(T({},c),{registerItem:f,renderItem:e=>A(f(e),d(e,(e=>l.setState("renderedItems",e)))),item:e=>{if(!e)return null;let t=o.get(e);if(!t){const{items:n}=l.getState();t=n.find((t=>t.id===e)),t&&o.set(e,t)}return t||null},__unstablePrivateStore:l})}function ct(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}function ut(e){const t=[];for(const n of e)t.push(...n);return t}function dt(e){return e.slice().reverse()}var ft={id:null};function ht(e,t){return e.find((e=>t?!e.disabled&&e.id!==t:!e.disabled))}function pt(e,t){return e.filter((e=>e.rowId===t))}function mt(e){const t=[];for(const n of e){const e=t.find((e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId}));e?e.push(n):t.push([n])}return t}function gt(e){let t=0;for(const{length:n}of e)n>t&&(t=n);return t}function vt(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),r=lt(e),o=W(e.activeId,null==n?void 0:n.activeId,e.defaultActiveId),i=Ye(P(T({},r.getState()),{id:W(e.id,null==n?void 0:n.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:o,baseElement:W(null==n?void 0:n.baseElement,null),includesBaseElement:W(e.includesBaseElement,null==n?void 0:n.includesBaseElement,null===o),moves:W(null==n?void 0:n.moves,0),orientation:W(e.orientation,null==n?void 0:n.orientation,"both"),rtl:W(e.rtl,null==n?void 0:n.rtl,!1),virtualFocus:W(e.virtualFocus,null==n?void 0:n.virtualFocus,!1),focusLoop:W(e.focusLoop,null==n?void 0:n.focusLoop,!1),focusWrap:W(e.focusWrap,null==n?void 0:n.focusWrap,!1),focusShift:W(e.focusShift,null==n?void 0:n.focusShift,!1)}),r,e.store);Ge(i,(()=>Xe(i,["renderedItems","activeId"],(e=>{i.setState("activeId",(t=>{var n;return void 0!==t?t:null==(n=ht(e.renderedItems))?void 0:n.id}))}))));const s=(e="next",t={})=>{var n,r;const o=i.getState(),{skip:s=0,activeId:a=o.activeId,focusShift:l=o.focusShift,focusLoop:c=o.focusLoop,focusWrap:u=o.focusWrap,includesBaseElement:d=o.includesBaseElement,renderedItems:f=o.renderedItems,rtl:h=o.rtl}=t,p="up"===e||"down"===e,m="next"===e||"down"===e,g=m?h&&!p:!h||p,v=l&&!s;let b=p?ut(function(e,t,n){const r=gt(e);for(const o of e)for(let e=0;e<r;e+=1){const r=o[e];if(!r||n&&r.disabled){const r=0===e&&n?ht(o):o[e-1];o[e]=r&&t!==r.id&&n?r:{id:"__EMPTY_ITEM__",disabled:!0,rowId:null==r?void 0:r.rowId}}}return e}(mt(f),a,v)):f;if(b=g?dt(b):b,b=p?function(e){const t=mt(e),n=gt(t),r=[];for(let e=0;e<n;e+=1)for(const n of t){const t=n[e];t&&r.push(P(T({},t),{rowId:t.rowId?`${e}`:void 0}))}return r}(b):b,null==a)return null==(n=ht(b))?void 0:n.id;const x=b.find((e=>e.id===a));if(!x)return null==(r=ht(b))?void 0:r.id;const y=b.some((e=>e.rowId)),w=b.indexOf(x),_=b.slice(w+1),S=pt(_,x.rowId);if(s){const e=function(e,t){return e.filter((e=>t?!e.disabled&&e.id!==t:!e.disabled))}(S,a),t=e.slice(s)[0]||e[e.length-1];return null==t?void 0:t.id}const C=c&&(p?"horizontal"!==c:"vertical"!==c),k=y&&u&&(p?"horizontal"!==u:"vertical"!==u),j=m?(!y||p)&&C&&d:!!p&&d;if(C){const e=function(e,t,n=!1){const r=e.findIndex((e=>e.id===t));return[...e.slice(r+1),...n?[ft]:[],...e.slice(0,r)]}(k&&!j?b:pt(b,x.rowId),a,j),t=ht(e,a);return null==t?void 0:t.id}if(k){const e=ht(j?S:_,a);return j?(null==e?void 0:e.id)||null:null==e?void 0:e.id}const E=ht(S,a);return!E&&j?null:null==E?void 0:E.id};return P(T(T({},r),i),{setBaseElement:e=>i.setState("baseElement",e),setActiveId:e=>i.setState("activeId",e),move:e=>{void 0!==e&&(i.setState("activeId",e),i.setState("moves",(e=>e+1)))},first:()=>{var e;return null==(e=ht(i.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=ht(dt(i.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("up",e))})}function bt(e){const t=Pe(e.id);return y({id:t},e)}function xt(e,t,n){return it(e=at(e,t,n),n,"activeId","setActiveId"),it(e,n,"includesBaseElement"),it(e,n,"virtualFocus"),it(e,n,"orientation"),it(e,n,"rtl"),it(e,n,"focusLoop"),it(e,n,"focusWrap"),it(e,n,"focusShift"),e}function yt(e={}){e=bt(e);const[t,n]=st(vt,e);return xt(t,n,e)}var wt={id:null};function _t(e,t){return t&&e.item(t)||null}var St=Symbol("FOCUS_SILENTLY");function Ct(e,t,n){if(!t)return!1;if(t===n)return!1;const r=e.item(t.id);return!!r&&(!n||r.element!==n)}const kt=window.ReactJSXRuntime;function jt(e){const t=$.forwardRef(((t,n)=>e(w(y({},t),{ref:n}))));return t.displayName=e.displayName||e.name,t}function Et(e,t){return $.memo(e,t)}function Mt(e,t){const n=t,{wrapElement:r,render:o}=n,i=_(n,["wrapElement","render"]),s=Te(t.ref,G(o));let a;if($.isValidElement(o)){const e=w(y({},o.props),{ref:s});a=$.cloneElement(o,function(e,t){const n=y({},e);for(const r in t){if(!O(t,r))continue;if("className"===r){const r="className";n[r]=e[r]?`${e[r]} ${t[r]}`:t[r];continue}if("style"===r){const r="style";n[r]=e[r]?y(y({},e[r]),t[r]):t[r];continue}const o=t[r];if("function"==typeof o&&r.startsWith("on")){const t=e[r];if("function"==typeof t){n[r]=(...e)=>{o(...e),t(...e)};continue}}n[r]=o}return n}(i,e))}else a=o?o(i):(0,kt.jsx)(e,y({},i));return r?r(a):a}function Nt(e){const t=(t={})=>e(t);return t.displayName=e.name,t}function Tt(e=[],t=[]){const n=$.createContext(void 0),r=$.createContext(void 0),o=()=>$.useContext(n),i=t=>e.reduceRight(((e,n)=>(0,kt.jsx)(n,w(y({},t),{children:e}))),(0,kt.jsx)(n.Provider,y({},t)));return{context:n,scopedContext:r,useContext:o,useScopedContext:(e=!1)=>{const t=$.useContext(r),n=o();return e?t:t||n},useProviderContext:()=>{const e=$.useContext(r),t=o();if(!e||e!==t)return t},ContextProvider:i,ScopedContextProvider:e=>(0,kt.jsx)(i,w(y({},e),{children:t.reduceRight(((t,n)=>(0,kt.jsx)(n,w(y({},e),{children:t}))),(0,kt.jsx)(r.Provider,y({},e)))}))}}var Pt=Tt(),Dt=Pt.useContext,It=(Pt.useScopedContext,Pt.useProviderContext,Tt([Pt.ContextProvider],[Pt.ScopedContextProvider])),Rt=It.useContext,Ot=(It.useScopedContext,It.useProviderContext),At=It.ContextProvider,zt=It.ScopedContextProvider,Lt=(0,$.createContext)(void 0),Ft=(0,$.createContext)(void 0),Bt=(0,$.createContext)(!0),Vt="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function Wt(e){return!!e.matches(Vt)&&(!!re(e)&&!e.closest("[inert]"))}function $t(e){if(!Wt(e))return!1;if(function(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}(e))return!1;if(!("form"in e))return!0;if(!e.form)return!0;if(e.checked)return!0;if("radio"!==e.type)return!0;const t=e.form.elements.namedItem(e.name);if(!t)return!0;if(!("length"in t))return!0;const n=Q(e);return!n||(n===e||(!("form"in n)||(n.form!==e.form||n.name!==e.name)))}function Ht(e,t){const n=Array.from(e.querySelectorAll(Vt));t&&n.unshift(e);const r=n.filter(Wt);return r.forEach(((e,t)=>{if(ee(e)&&e.contentDocument){const n=e.contentDocument.body;r.splice(t,1,...Ht(n))}})),r}function Ut(e,t,n){const r=Array.from(e.querySelectorAll(Vt)),o=r.filter($t);return t&&$t(e)&&o.unshift(e),o.forEach(((e,t)=>{if(ee(e)&&e.contentDocument){const r=Ut(e.contentDocument.body,!1,n);o.splice(t,1,...r)}})),!o.length&&n?r:o}function Yt(e,t,n){const[r]=Ut(e,t,n);return r||null}function Gt(e,t){return function(e,t,n,r){const o=Q(e),i=Ht(e,t),s=i.indexOf(o),a=i.slice(s+1);return a.find($t)||(n?i.find($t):null)||(r?a[0]:null)||null}(document.body,!1,e,t)}function qt(e,t){return function(e,t,n,r){const o=Q(e),i=Ht(e,t).reverse(),s=i.indexOf(o),a=i.slice(s+1);return a.find($t)||(n?i.find($t):null)||(r?a[0]:null)||null}(document.body,!1,e,t)}function Kt(e){const t=Q(e);if(!t)return!1;if(t===e)return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&n===e.id}function Xt(e){const t=Q(e);if(!t)return!1;if(J(e,t))return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&("id"in e&&(n===e.id||!!e.querySelector(`#${CSS.escape(n)}`)))}function Zt(e){!Xt(e)&&Wt(e)&&e.focus()}function Qt(e){var t;const n=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",n),e.setAttribute("tabindex","-1")}var Jt=de(),en=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],tn=Symbol("safariFocusAncestor");function nn(e,t){e&&(e[tn]=t)}function rn(e){return!("input"!==e.tagName.toLowerCase()||!e.type)&&("radio"===e.type||"checkbox"===e.type)}function on(e,t,n,r,o){return e?t?n&&!r?-1:void 0:n?o:o||0:o}function sn(e,t){return Me((n=>{null==e||e(n),n.defaultPrevented||t&&(n.stopPropagation(),n.preventDefault())}))}var an=!0;function ln(e){const t=e.target;t&&"hasAttribute"in t&&(t.hasAttribute("data-focus-visible")||(an=!1))}function cn(e){e.metaKey||e.ctrlKey||e.altKey||(an=!0)}var un=Nt((function(e){var t=e,{focusable:n=!0,accessibleWhenDisabled:r,autoFocus:o,onFocusVisible:i}=t,s=_(t,["focusable","accessibleWhenDisabled","autoFocus","onFocusVisible"]);const a=(0,$.useRef)(null);(0,$.useEffect)((()=>{n&&(we("mousedown",ln,!0),we("keydown",cn,!0))}),[n]),Jt&&(0,$.useEffect)((()=>{if(!n)return;const e=a.current;if(!e)return;if(!rn(e))return;const t=function(e){return"labels"in e?e.labels:null}(e);if(!t)return;const r=()=>queueMicrotask((()=>e.focus()));for(const e of t)e.addEventListener("mouseup",r);return()=>{for(const e of t)e.removeEventListener("mouseup",r)}}),[n]);const l=n&&B(s),c=!!l&&!r,[u,d]=(0,$.useState)(!1);(0,$.useEffect)((()=>{n&&c&&u&&d(!1)}),[n,c,u]),(0,$.useEffect)((()=>{if(!n)return;if(!u)return;const e=a.current;if(!e)return;if("undefined"==typeof IntersectionObserver)return;const t=new IntersectionObserver((()=>{Wt(e)||d(!1)}));return t.observe(e),()=>t.disconnect()}),[n,u]);const f=sn(s.onKeyPressCapture,l),h=sn(s.onMouseDownCapture,l),p=sn(s.onClickCapture,l),m=s.onMouseDown,g=Me((e=>{if(null==m||m(e),e.defaultPrevented)return;if(!n)return;const t=e.currentTarget;if(!Jt)return;if(he(e))return;if(!te(t)&&!rn(t))return;let r=!1;const o=()=>{r=!0};t.addEventListener("focusin",o,{capture:!0,once:!0});const i=function(e){for(;e&&!Wt(e);)e=e.closest(Vt);return e||null}(t.parentElement);nn(i,!0),ye(t,"mouseup",(()=>{t.removeEventListener("focusin",o,!0),nn(i,!1),r||Zt(t)}))})),v=(e,t)=>{if(t&&(e.currentTarget=t),!n)return;const r=e.currentTarget;r&&Kt(r)&&(null==i||i(e),e.defaultPrevented||(r.dataset.focusVisible="true",d(!0)))},b=s.onKeyDownCapture,x=Me((e=>{if(null==b||b(e),e.defaultPrevented)return;if(!n)return;if(u)return;if(e.metaKey)return;if(e.altKey)return;if(e.ctrlKey)return;if(!pe(e))return;const t=e.currentTarget;ye(t,"focusout",(()=>v(e,t)))})),S=s.onFocusCapture,C=Me((e=>{if(null==S||S(e),e.defaultPrevented)return;if(!n)return;if(!pe(e))return void d(!1);const t=e.currentTarget,r=()=>v(e,t);an||function(e){const{tagName:t,readOnly:n,type:r}=e;return"TEXTAREA"===t&&!n||("SELECT"===t&&!n||("INPUT"!==t||n?!!e.isContentEditable||!("combobox"!==e.getAttribute("role")||!e.dataset.name):en.includes(r)))}(e.target)?ye(e.target,"focusout",r):d(!1)})),k=s.onBlur,j=Me((e=>{null==k||k(e),n&&xe(e)&&d(!1)})),E=(0,$.useContext)(Bt),M=Me((e=>{n&&o&&e&&E&&queueMicrotask((()=>{Kt(e)||Wt(e)&&e.focus()}))})),N=De(a),T=n&&function(e){return!e||"button"===e||"summary"===e||"input"===e||"select"===e||"textarea"===e||"a"===e}(N),P=n&&function(e){return!e||"button"===e||"input"===e||"select"===e||"textarea"===e}(N),D=s.style,I=(0,$.useMemo)((()=>c?y({pointerEvents:"none"},D):D),[c,D]);return V(s=w(y({"data-focus-visible":n&&u||void 0,"data-autofocus":o||void 0,"aria-disabled":l||void 0},s),{ref:Te(a,M,s.ref),style:I,tabIndex:on(n,c,T,P,s.tabIndex),disabled:!(!P||!c)||void 0,contentEditable:l?void 0:s.contentEditable,onKeyPressCapture:f,onClickCapture:p,onMouseDownCapture:h,onMouseDown:g,onKeyDownCapture:x,onFocusCapture:C,onBlur:j}))}));jt((function(e){return Mt("div",un(e))}));function dn(e,t,n){return Me((r=>{var o;if(null==t||t(r),r.defaultPrevented)return;if(r.isPropagationStopped())return;if(!pe(r))return;if(function(e){return"Shift"===e.key||"Control"===e.key||"Alt"===e.key||"Meta"===e.key}(r))return;if(function(e){const t=e.target;return!(t&&!oe(t)||1!==e.key.length||e.ctrlKey||e.metaKey)}(r))return;const i=e.getState(),s=null==(o=_t(e,i.activeId))?void 0:o.element;if(!s)return;const a=r,{view:l}=a,c=_(a,["view"]);s!==(null==n?void 0:n.current)&&s.focus(),function(e,t,n){const r=new KeyboardEvent(t,n);return e.dispatchEvent(r)}(s,r.type,c)||r.preventDefault(),r.currentTarget.contains(s)&&r.stopPropagation()}))}var fn=Nt((function(e){var t=e,{store:n,composite:r=!0,focusOnMove:o=r,moveOnKeyPress:i=!0}=t,s=_(t,["store","composite","focusOnMove","moveOnKeyPress"]);const a=Ot();L(n=n||a,!1);const l=(0,$.useRef)(null),c=(0,$.useRef)(null),u=function(e){const[t,n]=(0,$.useState)(!1),r=(0,$.useCallback)((()=>n(!0)),[]),o=e.useState((t=>_t(e,t.activeId)));return(0,$.useEffect)((()=>{const e=null==o?void 0:o.element;t&&e&&(n(!1),e.focus({preventScroll:!0}))}),[o,t]),r}(n),d=n.useState("moves"),[,f]=Ne(r?n.setBaseElement:null);(0,$.useEffect)((()=>{var e;if(!n)return;if(!d)return;if(!r)return;if(!o)return;const{activeId:t}=n.getState(),i=null==(e=_t(n,t))?void 0:e.element;i&&function(e,t){"scrollIntoView"in e?(e.focus({preventScroll:!0}),e.scrollIntoView(T({block:"nearest",inline:"nearest"},t))):e.focus()}(i)}),[n,d,r,o]),ke((()=>{if(!n)return;if(!d)return;if(!r)return;const{baseElement:e,activeId:t}=n.getState();if(!(null===t))return;if(!e)return;const o=c.current;c.current=null,o&&ve(o,{relatedTarget:e}),Kt(e)||e.focus()}),[n,d,r]);const h=n.useState("activeId"),p=n.useState("virtualFocus");ke((()=>{var e;if(!n)return;if(!r)return;if(!p)return;const t=c.current;if(c.current=null,!t)return;const o=(null==(e=_t(n,h))?void 0:e.element)||Q(t);o!==t&&ve(t,{relatedTarget:o})}),[n,h,p,r]);const m=dn(n,s.onKeyDownCapture,c),g=dn(n,s.onKeyUpCapture,c),v=s.onFocusCapture,b=Me((e=>{if(null==v||v(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:t}=n.getState();if(!t)return;const r=e.relatedTarget,o=function(e){const t=e[St];return delete e[St],t}(e.currentTarget);pe(e)&&o&&(e.stopPropagation(),c.current=r)})),x=s.onFocus,S=Me((e=>{if(null==x||x(e),e.defaultPrevented)return;if(!r)return;if(!n)return;const{relatedTarget:t}=e,{virtualFocus:o}=n.getState();o?pe(e)&&!Ct(n,t)&&queueMicrotask(u):pe(e)&&n.setActiveId(null)})),C=s.onBlurCapture,k=Me((e=>{var t;if(null==C||C(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:r,activeId:o}=n.getState();if(!r)return;const i=null==(t=_t(n,o))?void 0:t.element,s=e.relatedTarget,a=Ct(n,s),l=c.current;if(c.current=null,pe(e)&&a)s===i?l&&l!==s&&ve(l,e):i?ve(i,e):l&&ve(l,e),e.stopPropagation();else{!Ct(n,e.target)&&i&&ve(i,e)}})),j=s.onKeyDown,E=Oe(i),M=Me((e=>{var t;if(null==j||j(e),e.defaultPrevented)return;if(!n)return;if(!pe(e))return;const{orientation:r,renderedItems:o,activeId:i}=n.getState(),s=_t(n,i);if(null==(t=null==s?void 0:s.element)?void 0:t.isConnected)return;const a="horizontal"!==r,l="vertical"!==r,c=o.some((e=>!!e.rowId));if(("ArrowLeft"===e.key||"ArrowRight"===e.key||"Home"===e.key||"End"===e.key)&&oe(e.currentTarget))return;const u={ArrowUp:(c||a)&&(()=>{if(c){const e=function(e){return function(e,t){return e.find((e=>t?!e.disabled&&e.id!==t:!e.disabled))}(ut(dt(function(e){const t=[];for(const n of e){const e=t.find((e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId}));e?e.push(n):t.push([n])}return t}(e))))}(o);return null==e?void 0:e.id}return null==n?void 0:n.last()}),ArrowRight:(c||l)&&n.first,ArrowDown:(c||a)&&n.first,ArrowLeft:(c||l)&&n.last,Home:n.first,End:n.last,PageUp:n.first,PageDown:n.last},d=u[e.key];if(d){const t=d();if(void 0!==t){if(!E(e))return;e.preventDefault(),n.move(t)}}}));s=Ae(s,(e=>(0,kt.jsx)(At,{value:n,children:e})),[n]);const N=n.useState((e=>{var t;if(n&&r&&e.virtualFocus)return null==(t=_t(n,e.activeId))?void 0:t.id}));s=w(y({"aria-activedescendant":N},s),{ref:Te(l,f,s.ref),onKeyDownCapture:m,onKeyUpCapture:g,onFocusCapture:b,onFocus:S,onBlurCapture:k,onKeyDown:M});const P=n.useState((e=>r&&(e.virtualFocus||null===e.activeId)));return s=un(y({focusable:P},s))})),hn=jt((function(e){return Mt("div",fn(e))}));const pn=(0,f.createContext)({});pn.displayName="CompositeContext";const mn=()=>(0,f.useContext)(pn);var gn=(0,$.createContext)(void 0),vn=Nt((function(e){const[t,n]=(0,$.useState)();return e=Ae(e,(e=>(0,kt.jsx)(gn.Provider,{value:n,children:e})),[]),V(e=y({role:"group","aria-labelledby":t},e))})),bn=(jt((function(e){return Mt("div",vn(e))})),Nt((function(e){var t=e,{store:n}=t,r=_(t,["store"]);return r=vn(r)}))),xn=jt((function(e){return Mt("div",bn(e))}));const yn=(0,f.forwardRef)((function(e,t){var n;const r=mn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,kt.jsx)(xn,{store:o,...e,ref:t})}));var wn=Nt((function(e){const t=(0,$.useContext)(gn),n=Pe(e.id);return ke((()=>(null==t||t(n),()=>null==t?void 0:t(void 0))),[t,n]),V(e=y({id:n,"aria-hidden":!0},e))})),_n=(jt((function(e){return Mt("div",wn(e))})),Nt((function(e){var t=e,{store:n}=t,r=_(t,["store"]);return r=wn(r)}))),Sn=jt((function(e){return Mt("div",_n(e))}));const Cn=(0,f.forwardRef)((function(e,t){var n;const r=mn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,kt.jsx)(Sn,{store:o,...e,ref:t})}));function kn(e){const t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}var jn=Symbol("composite-hover");var En=Nt((function(e){var t=e,{store:n,focusOnHover:r=!0,blurOnHoverEnd:o=!!r}=t,i=_(t,["store","focusOnHover","blurOnHoverEnd"]);const s=Rt();L(n=n||s,!1);const a=Fe(),l=i.onMouseMove,c=Oe(r),u=Me((e=>{if(null==l||l(e),!e.defaultPrevented&&a()&&c(e)){if(!Xt(e.currentTarget)){const e=null==n?void 0:n.getState().baseElement;e&&!Kt(e)&&e.focus()}null==n||n.setActiveId(e.currentTarget.id)}})),d=i.onMouseLeave,f=Oe(o),h=Me((e=>{var t;null==d||d(e),e.defaultPrevented||a()&&(function(e){const t=kn(e);return!!t&&J(e.currentTarget,t)}(e)||function(e){let t=kn(e);if(!t)return!1;do{if(O(t,jn)&&t[jn])return!0;t=t.parentElement}while(t);return!1}(e)||c(e)&&f(e)&&(null==n||n.setActiveId(null),null==(t=null==n?void 0:n.getState().baseElement)||t.focus()))})),p=(0,$.useCallback)((e=>{e&&(e[jn]=!0)}),[]);return V(i=w(y({},i),{ref:Te(p,i.ref),onMouseMove:u,onMouseLeave:h}))})),Mn=Et(jt((function(e){return Mt("div",En(e))})));const Nn=(0,f.forwardRef)((function(e,t){var n;const r=mn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,kt.jsx)(Mn,{store:o,...e,ref:t})}));var Tn=Nt((function(e){var t=e,{store:n,shouldRegisterItem:r=!0,getItem:o=z,element:i}=t,s=_(t,["store","shouldRegisterItem","getItem","element"]);const a=Dt();n=n||a;const l=Pe(s.id),c=(0,$.useRef)(i);return(0,$.useEffect)((()=>{const e=c.current;if(!l)return;if(!e)return;if(!r)return;const t=o({id:l,element:e});return null==n?void 0:n.renderItem(t)}),[l,r,o,n]),V(s=w(y({},s),{ref:Te(c,s.ref)}))}));jt((function(e){return Mt("div",Tn(e))}));function Pn(e){if(!e.isTrusted)return!1;const t=e.currentTarget;return"Enter"===e.key?te(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(te(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}var Dn=Symbol("command"),In=Nt((function(e){var t=e,{clickOnEnter:n=!0,clickOnSpace:r=!0}=t,o=_(t,["clickOnEnter","clickOnSpace"]);const i=(0,$.useRef)(null),[s,a]=(0,$.useState)(!1);(0,$.useEffect)((()=>{i.current&&a(te(i.current))}),[]);const[l,c]=(0,$.useState)(!1),u=(0,$.useRef)(!1),d=B(o),[f,h]=Le(o,Dn,!0),p=o.onKeyDown,m=Me((e=>{null==p||p(e);const t=e.currentTarget;if(e.defaultPrevented)return;if(f)return;if(d)return;if(!pe(e))return;if(oe(t))return;if(t.isContentEditable)return;const o=n&&"Enter"===e.key,i=r&&" "===e.key,s="Enter"===e.key&&!n,a=" "===e.key&&!r;if(s||a)e.preventDefault();else if(o||i){const n=Pn(e);if(o){if(!n){e.preventDefault();const n=e,{view:r}=n,o=_(n,["view"]),i=()=>be(t,o);K&&/firefox\//i.test(navigator.userAgent)?ye(t,"keyup",i):queueMicrotask(i)}}else i&&(u.current=!0,n||(e.preventDefault(),c(!0)))}})),g=o.onKeyUp,v=Me((e=>{if(null==g||g(e),e.defaultPrevented)return;if(f)return;if(d)return;if(e.metaKey)return;const t=r&&" "===e.key;if(u.current&&t&&(u.current=!1,!Pn(e))){e.preventDefault(),c(!1);const t=e.currentTarget,n=e,{view:r}=n,o=_(n,["view"]);queueMicrotask((()=>be(t,o)))}}));return o=w(y(y({"data-active":l||void 0,type:s?"button":void 0},h),o),{ref:Te(i,o.ref),onKeyDown:m,onKeyUp:v}),o=un(o)}));jt((function(e){return Mt("button",In(e))}));function Rn(e,t=!1){const{top:n}=e.getBoundingClientRect();return t?n+e.clientHeight:n}function On(e,t,n,r=!1){var o;if(!t)return;if(!n)return;const{renderedItems:i}=t.getState(),s=le(e);if(!s)return;const a=function(e,t=!1){const n=e.clientHeight,{top:r}=e.getBoundingClientRect(),o=1.5*Math.max(.875*n,n-40),i=t?n-o+r:o+r;return"HTML"===e.tagName?i+e.scrollTop:i}(s,r);let l,c;for(let e=0;e<i.length;e+=1){const i=l;if(l=n(e),!l)break;if(l===i)continue;const s=null==(o=_t(t,l))?void 0:o.element;if(!s)continue;const u=Rn(s,r)-a,d=Math.abs(u);if(r&&u<=0||!r&&u>=0){void 0!==c&&c<d&&(l=i);break}c=d}return l}var An=Nt((function(e){var t=e,{store:n,rowId:r,preventScrollOnKeyDown:o=!1,moveOnKeyPress:i=!0,tabbable:s=!1,getItem:a,"aria-setsize":l,"aria-posinset":c}=t,u=_(t,["store","rowId","preventScrollOnKeyDown","moveOnKeyPress","tabbable","getItem","aria-setsize","aria-posinset"]);const d=Rt();n=n||d;const f=Pe(u.id),h=(0,$.useRef)(null),p=(0,$.useContext)(Ft),m=B(u)&&!u.accessibleWhenDisabled,{rowId:g,baseElement:v,isActiveItem:b,ariaSetSize:x,ariaPosInSet:S,isTabbable:C}=ot(n,{rowId:e=>r||(e&&(null==p?void 0:p.baseElement)&&p.baseElement===e.baseElement?p.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===f,ariaSetSize:e=>null!=l?l:e&&(null==p?void 0:p.ariaSetSize)&&p.baseElement===e.baseElement?p.ariaSetSize:void 0,ariaPosInSet(e){if(null!=c)return c;if(!e)return;if(!(null==p?void 0:p.ariaPosInSet))return;if(p.baseElement!==e.baseElement)return;const t=e.renderedItems.filter((e=>e.rowId===g));return p.ariaPosInSet+t.findIndex((e=>e.id===f))},isTabbable(e){if(!(null==e?void 0:e.renderedItems.length))return!0;if(e.virtualFocus)return!1;if(s)return!0;if(null===e.activeId)return!1;const t=null==n?void 0:n.item(e.activeId);return!!(null==t?void 0:t.disabled)||(!(null==t?void 0:t.element)||e.activeId===f)}}),k=(0,$.useCallback)((e=>{var t;const n=w(y({},e),{id:f||e.id,rowId:g,disabled:!!m,children:null==(t=e.element)?void 0:t.textContent});return a?a(n):n}),[f,g,m,a]),j=u.onFocus,E=(0,$.useRef)(!1),M=Me((e=>{if(null==j||j(e),e.defaultPrevented)return;if(he(e))return;if(!f)return;if(!n)return;if(function(e,t){return!pe(e)&&Ct(t,e.target)}(e,n))return;const{virtualFocus:t,baseElement:r}=n.getState();if(n.setActiveId(f),ie(e.currentTarget)&&function(e,t=!1){if(oe(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){const n=X(e).getSelection();null==n||n.selectAllChildren(e),t&&(null==n||n.collapseToEnd())}}(e.currentTarget),!t)return;if(!pe(e))return;if(ie(o=e.currentTarget)||"INPUT"===o.tagName&&!te(o))return;var o;if(!(null==r?void 0:r.isConnected))return;de()&&e.currentTarget.hasAttribute("data-autofocus")&&e.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),E.current=!0;e.relatedTarget===r||Ct(n,e.relatedTarget)?function(e){e[St]=!0,e.focus({preventScroll:!0})}(r):r.focus()})),N=u.onBlurCapture,T=Me((e=>{if(null==N||N(e),e.defaultPrevented)return;const t=null==n?void 0:n.getState();(null==t?void 0:t.virtualFocus)&&E.current&&(E.current=!1,e.preventDefault(),e.stopPropagation())})),P=u.onKeyDown,D=Oe(o),I=Oe(i),R=Me((e=>{if(null==P||P(e),e.defaultPrevented)return;if(!pe(e))return;if(!n)return;const{currentTarget:t}=e,r=n.getState(),o=n.item(f),i=!!(null==o?void 0:o.rowId),s="horizontal"!==r.orientation,a="vertical"!==r.orientation,l=()=>!!i||(!!a||(!r.baseElement||!oe(r.baseElement))),c={ArrowUp:(i||s)&&n.up,ArrowRight:(i||a)&&n.next,ArrowDown:(i||s)&&n.down,ArrowLeft:(i||a)&&n.previous,Home:()=>{if(l())return!i||e.ctrlKey?null==n?void 0:n.first():null==n?void 0:n.previous(-1)},End:()=>{if(l())return!i||e.ctrlKey?null==n?void 0:n.last():null==n?void 0:n.next(-1)},PageUp:()=>On(t,n,null==n?void 0:n.up,!0),PageDown:()=>On(t,n,null==n?void 0:n.down)}[e.key];if(c){if(ie(t)){const n=function(e){let t=0,n=0;if(oe(e))t=e.selectionStart||0,n=e.selectionEnd||0;else if(e.isContentEditable){const r=X(e).getSelection();if((null==r?void 0:r.rangeCount)&&r.anchorNode&&J(e,r.anchorNode)&&r.focusNode&&J(e,r.focusNode)){const o=r.getRangeAt(0),i=o.cloneRange();i.selectNodeContents(e),i.setEnd(o.startContainer,o.startOffset),t=i.toString().length,i.setEnd(o.endContainer,o.endOffset),n=i.toString().length}}return{start:t,end:n}}(t),r=a&&"ArrowLeft"===e.key,o=a&&"ArrowRight"===e.key,i=s&&"ArrowUp"===e.key,l=s&&"ArrowDown"===e.key;if(o||l){const{length:e}=function(e){if(oe(e))return e.value;if(e.isContentEditable){const t=X(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(t);if(n.end!==e)return}else if((r||i)&&0!==n.start)return}const r=c();if(D(e)||void 0!==r){if(!I(e))return;e.preventDefault(),n.move(r)}}})),O=(0,$.useMemo)((()=>({id:f,baseElement:v})),[f,v]);return u=Ae(u,(e=>(0,kt.jsx)(Lt.Provider,{value:O,children:e})),[O]),u=w(y({id:f,"data-active-item":b||void 0},u),{ref:Te(h,u.ref),tabIndex:C?u.tabIndex:-1,onFocus:M,onBlurCapture:T,onKeyDown:R}),u=In(u),u=Tn(w(y({store:n},u),{getItem:k,shouldRegisterItem:!!f&&u.shouldRegisterItem})),V(w(y({},u),{"aria-setsize":x,"aria-posinset":S}))})),zn=Et(jt((function(e){return Mt("button",An(e))})));const Ln=(0,f.forwardRef)((function(e,t){var n;const r=mn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,kt.jsx)(zn,{store:o,...e,ref:t})}));var Fn=Nt((function(e){var t=e,{store:n,"aria-setsize":r,"aria-posinset":o}=t,i=_(t,["store","aria-setsize","aria-posinset"]);const s=Rt();L(n=n||s,!1);const a=Pe(i.id),l=n.useState((e=>e.baseElement||void 0)),c=(0,$.useMemo)((()=>({id:a,baseElement:l,ariaSetSize:r,ariaPosInSet:o})),[a,l,r,o]);return i=Ae(i,(e=>(0,kt.jsx)(Ft.Provider,{value:c,children:e})),[c]),V(i=y({id:a},i))})),Bn=jt((function(e){return Mt("div",Fn(e))}));const Vn=(0,f.forwardRef)((function(e,t){var n;const r=mn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,kt.jsx)(Bn,{store:o,...e,ref:t})}));var Wn="";function $n(){Wn=""}function Hn(e,t){var n;const r=(null==(n=e.element)?void 0:n.textContent)||e.children||"value"in e&&e.value;return!!r&&(o=r,o.normalize("NFD").replace(/[\u0300-\u036f]/g,"")).trim().toLowerCase().startsWith(t.toLowerCase());var o}function Un(e,t,n){if(!n)return e;const r=e.find((e=>e.id===n));return r&&Hn(r,t)?Wn!==t&&Hn(r,Wn)?e:(Wn=t,function(e,t,n=!1){const r=e.findIndex((e=>e.id===t));return[...e.slice(r+1),...n?[wt]:[],...e.slice(0,r)]}(e.filter((e=>Hn(e,Wn))),n).filter((e=>e.id!==n))):e}var Yn=Nt((function(e){var t=e,{store:n,typeahead:r=!0}=t,o=_(t,["store","typeahead"]);const i=Rt();L(n=n||i,!1);const s=o.onKeyDownCapture,a=(0,$.useRef)(0),l=Me((e=>{if(null==s||s(e),e.defaultPrevented)return;if(!r)return;if(!n)return;if(!function(e){const t=e.target;return(!t||!oe(t))&&(!(" "!==e.key||!Wn.length)||1===e.key.length&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&/^[\p{Letter}\p{Number}]$/u.test(e.key))}(e))return $n();const{renderedItems:t,items:o,activeId:i,id:l}=n.getState();let c=function(e){return e.filter((e=>!e.disabled))}(o.length>t.length?o:t);const u=`[data-offscreen-id="${l}"]`,d=X(e.currentTarget).querySelectorAll(u);for(const e of d){const t="true"===e.ariaDisabled||"disabled"in e&&!!e.disabled;c.push({id:e.id,element:e,disabled:t})}if(d.length&&(c=ce(c,(e=>e.element))),!function(e,t){if(pe(e))return!0;const n=e.target;if(!n)return!1;const r=t.some((e=>e.element===n));return r}(e,c))return $n();e.preventDefault(),window.clearTimeout(a.current),a.current=window.setTimeout((()=>{Wn=""}),500);const f=e.key.toLowerCase();Wn+=f,c=Un(c,f,i);const h=c.find((e=>Hn(e,Wn)));h?n.move(h.id):$n()}));return V(o=w(y({},o),{onKeyDownCapture:l}))})),Gn=jt((function(e){return Mt("div",Yn(e))}));const qn=(0,f.forwardRef)((function(e,t){var n;const r=mn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,kt.jsx)(Gn,{store:o,...e,ref:t})})),Kn=Object.assign((0,f.forwardRef)((function({activeId:e,defaultActiveId:t,setActiveId:n,focusLoop:r=!1,focusWrap:o=!1,focusShift:i=!1,virtualFocus:s=!1,orientation:a="both",rtl:l=(0,u.isRTL)(),children:c,disabled:d=!1,...h},p){const m=h.store,g=yt({activeId:e,defaultActiveId:t,setActiveId:n,focusLoop:r,focusWrap:o,focusShift:i,virtualFocus:s,orientation:a,rtl:l}),v=null!=m?m:g,b=(0,f.useMemo)((()=>({store:v})),[v]);return(0,kt.jsx)(hn,{disabled:d,store:v,...h,ref:p,children:(0,kt.jsx)(pn.Provider,{value:b,children:c})})})),{Group:Object.assign(yn,{displayName:"Composite.Group"}),GroupLabel:Object.assign(Cn,{displayName:"Composite.GroupLabel"}),Item:Object.assign(Ln,{displayName:"Composite.Item"}),Row:Object.assign(Vn,{displayName:"Composite.Row"}),Hover:Object.assign(Nn,{displayName:"Composite.Hover"}),Typeahead:Object.assign(qn,{displayName:"Composite.Typeahead"}),Context:Object.assign(pn,{displayName:"Composite.Context"})});function Xn(e={}){const t=Je(e.store,Qe(e.disclosure,["contentElement","disclosureElement"])),n=null==t?void 0:t.getState(),r=W(e.open,null==n?void 0:n.open,e.defaultOpen,!1),o=W(e.animated,null==n?void 0:n.animated,!1),i=Ye({open:r,animated:o,animating:!!o&&r,mounted:r,contentElement:W(null==n?void 0:n.contentElement,null),disclosureElement:W(null==n?void 0:n.disclosureElement,null)},t);return Ge(i,(()=>Xe(i,["animated","animating"],(e=>{e.animated||i.setState("animating",!1)})))),Ge(i,(()=>Ke(i,["open"],(()=>{i.getState().animated&&i.setState("animating",!0)})))),Ge(i,(()=>Xe(i,["open","animating"],(e=>{i.setState("mounted",e.open||e.animating)})))),P(T({},i),{disclosure:e.disclosure,setOpen:e=>i.setState("open",e),show:()=>i.setState("open",!0),hide:()=>i.setState("open",!1),toggle:()=>i.setState("open",(e=>!e)),stopAnimation:()=>i.setState("animating",!1),setContentElement:e=>i.setState("contentElement",e),setDisclosureElement:e=>i.setState("disclosureElement",e)})}function Zn(e,t,n){return Ie(t,[n.store,n.disclosure]),it(e,n,"open","setOpen"),it(e,n,"mounted","setMounted"),it(e,n,"animated"),Object.assign(e,{disclosure:n.disclosure})}function Qn(e={}){const[t,n]=st(Xn,e);return Zn(t,n,e)}function Jn(e={}){return Xn(e)}function er(e,t,n){return Zn(e,t,n)}function tr(e,t,n){return Ie(t,[n.popover]),it(e,n,"placement"),er(e,t,n)}function nr(e,t,n){return it(e,n,"timeout"),it(e,n,"showTimeout"),it(e,n,"hideTimeout"),tr(e,t,n)}function rr(e={}){var t=e,{popover:n}=t,r=D(t,["popover"]);const o=Je(r.store,Qe(n,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"])),i=null==o?void 0:o.getState(),s=Jn(P(T({},r),{store:o})),a=W(r.placement,null==i?void 0:i.placement,"bottom"),l=Ye(P(T({},s.getState()),{placement:a,currentPlacement:a,anchorElement:W(null==i?void 0:i.anchorElement,null),popoverElement:W(null==i?void 0:i.popoverElement,null),arrowElement:W(null==i?void 0:i.arrowElement,null),rendered:Symbol("rendered")}),s,o);return P(T(T({},s),l),{setAnchorElement:e=>l.setState("anchorElement",e),setPopoverElement:e=>l.setState("popoverElement",e),setArrowElement:e=>l.setState("arrowElement",e),render:()=>l.setState("rendered",Symbol("rendered"))})}function or(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),r=rr(P(T({},e),{placement:W(e.placement,null==n?void 0:n.placement,"bottom")})),o=W(e.timeout,null==n?void 0:n.timeout,500),i=Ye(P(T({},r.getState()),{timeout:o,showTimeout:W(e.showTimeout,null==n?void 0:n.showTimeout),hideTimeout:W(e.hideTimeout,null==n?void 0:n.hideTimeout),autoFocusOnShow:W(null==n?void 0:n.autoFocusOnShow,!1)}),r,e.store);return P(T(T({},r),i),{setAutoFocusOnShow:e=>i.setState("autoFocusOnShow",e)})}function ir(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),r=or(P(T({},e),{placement:W(e.placement,null==n?void 0:n.placement,"top"),hideTimeout:W(e.hideTimeout,null==n?void 0:n.hideTimeout,0)})),o=Ye(P(T({},r.getState()),{type:W(e.type,null==n?void 0:n.type,"description"),skipTimeout:W(e.skipTimeout,null==n?void 0:n.skipTimeout,300)}),r,e.store);return T(T({},r),o)}function sr(e={}){const[t,n]=st(ir,e);return function(e,t,n){return it(e,n,"type"),it(e,n,"skipTimeout"),nr(e,t,n)}(t,n,e)}Nt((function(e){return e}));var ar=jt((function(e){return Mt("div",e)}));Object.assign(ar,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"].reduce(((e,t)=>(e[t]=jt((function(e){return Mt(t,e)})),e)),{}));var lr=Tt(),cr=(lr.useContext,lr.useScopedContext,lr.useProviderContext),ur=Tt([lr.ContextProvider],[lr.ScopedContextProvider]),dr=(ur.useContext,ur.useScopedContext,ur.useProviderContext),fr=ur.ContextProvider,hr=ur.ScopedContextProvider,pr=(0,$.createContext)(void 0),mr=(0,$.createContext)(void 0),gr=Tt([fr],[hr]),vr=gr.useContext,br=(gr.useScopedContext,gr.useProviderContext),xr=gr.ContextProvider,yr=gr.ScopedContextProvider,wr=Tt([xr],[yr]),_r=(wr.useContext,wr.useScopedContext,wr.useProviderContext),Sr=wr.ContextProvider,Cr=wr.ScopedContextProvider,kr=Nt((function(e){var t=e,{store:n,showOnHover:r=!0}=t,o=_(t,["store","showOnHover"]);const i=_r();L(n=n||i,!1);const s=B(o),a=(0,$.useRef)(0);(0,$.useEffect)((()=>()=>window.clearTimeout(a.current)),[]),(0,$.useEffect)((()=>we("mouseleave",(e=>{if(!n)return;const{anchorElement:t}=n.getState();t&&e.target===t&&(window.clearTimeout(a.current),a.current=0)}),!0)),[n]);const l=o.onMouseMove,c=Oe(r),u=Fe(),d=Me((e=>{if(null==l||l(e),s)return;if(!n)return;if(e.defaultPrevented)return;if(a.current)return;if(!u())return;if(!c(e))return;const t=e.currentTarget;n.setAnchorElement(t),n.setDisclosureElement(t);const{showTimeout:r,timeout:o}=n.getState(),i=()=>{a.current=0,u()&&(null==n||n.setAnchorElement(t),null==n||n.show(),queueMicrotask((()=>{null==n||n.setDisclosureElement(t)})))},d=null!=r?r:o;0===d?i():a.current=window.setTimeout(i,d)})),f=o.onClick,h=Me((e=>{null==f||f(e),n&&(window.clearTimeout(a.current),a.current=0)})),p=(0,$.useCallback)((e=>{if(!n)return;const{anchorElement:t}=n.getState();(null==t?void 0:t.isConnected)||n.setAnchorElement(e)}),[n]);return o=w(y({},o),{ref:Te(p,o.ref),onMouseMove:d,onClick:h}),o=un(o)})),jr=(jt((function(e){return Mt("a",kr(e))})),Tt([Sr],[Cr])),Er=(jr.useContext,jr.useScopedContext,jr.useProviderContext),Mr=(jr.ContextProvider,jr.ScopedContextProvider),Nr=Ye({activeStore:null});function Tr(e){return()=>{const{activeStore:t}=Nr.getState();t===e&&Nr.setState("activeStore",null)}}var Pr=Nt((function(e){var t=e,{store:n,showOnHover:r=!0}=t,o=_(t,["store","showOnHover"]);const i=Er();L(n=n||i,!1);const s=(0,$.useRef)(!1);(0,$.useEffect)((()=>Xe(n,["mounted"],(e=>{e.mounted||(s.current=!1)}))),[n]),(0,$.useEffect)((()=>{if(n)return A(Tr(n),Xe(n,["mounted","skipTimeout"],(e=>{if(!n)return;if(e.mounted){const{activeStore:e}=Nr.getState();return e!==n&&(null==e||e.hide()),Nr.setState("activeStore",n)}const t=setTimeout(Tr(n),e.skipTimeout);return()=>clearTimeout(t)})))}),[n]);const a=o.onMouseEnter,l=Me((e=>{null==a||a(e),s.current=!0})),c=o.onFocusVisible,u=Me((e=>{null==c||c(e),e.defaultPrevented||(null==n||n.setAnchorElement(e.currentTarget),null==n||n.show())})),d=o.onBlur,f=Me((e=>{if(null==d||d(e),e.defaultPrevented)return;const{activeStore:t}=Nr.getState();s.current=!1,t===n&&Nr.setState("activeStore",null)})),h=n.useState("type"),p=n.useState((e=>{var t;return null==(t=e.contentElement)?void 0:t.id}));return o=w(y({"aria-labelledby":"label"===h?p:void 0},o),{onMouseEnter:l,onFocusVisible:u,onBlur:f}),o=kr(y({store:n,showOnHover(e){if(!s.current)return!1;if(F(r,e))return!1;const{activeStore:t}=Nr.getState();return!t||(null==n||n.show(),!1)}},o))})),Dr=jt((function(e){return Mt("div",Pr(e))}));function Ir(e){return[e.clientX,e.clientY]}function Rr(e,t){const[n,r]=e;let o=!1;for(let e=t.length,i=0,s=e-1;i<e;s=i++){const[a,l]=t[i],[c,u]=t[s],[,d]=t[0===s?e-1:s-1]||[0,0],f=(l-u)*(n-a)-(a-c)*(r-l);if(u<l){if(r>=u&&r<l){if(0===f)return!0;f>0&&(r===u?r>d&&(o=!o):o=!o)}}else if(l<u){if(r>l&&r<=u){if(0===f)return!0;f<0&&(r===u?r<d&&(o=!o):o=!o)}}else if(r===l&&(n>=c&&n<=a||n>=a&&n<=c))return!0}return o}function Or(e,t){const n=e.getBoundingClientRect(),{top:r,right:o,bottom:i,left:s}=n,[a,l]=function(e,t){const{top:n,right:r,bottom:o,left:i}=t,[s,a]=e;return[s<i?"left":s>r?"right":null,a<n?"top":a>o?"bottom":null]}(t,n),c=[t];return a?("top"!==l&&c.push(["left"===a?s:o,r]),c.push(["left"===a?o:s,r]),c.push(["left"===a?o:s,i]),"bottom"!==l&&c.push(["left"===a?s:o,i])):"top"===l?(c.push([s,r]),c.push([s,i]),c.push([o,i]),c.push([o,r])):(c.push([s,i]),c.push([s,r]),c.push([o,r]),c.push([o,i])),c}function Ar(e,...t){if(!e)return!1;const n=e.getAttribute("data-backdrop");return null!=n&&(""===n||("true"===n||(!t.length||t.some((e=>n===e)))))}var zr=new WeakMap;function Lr(e,t,n){zr.has(e)||zr.set(e,new Map);const r=zr.get(e),o=r.get(t);if(!o)return r.set(t,n()),()=>{var e;null==(e=r.get(t))||e(),r.delete(t)};const i=n(),s=()=>{i(),o(),r.delete(t)};return r.set(t,s),()=>{r.get(t)===s&&(i(),r.set(t,o))}}function Fr(e,t,n){return Lr(e,t,(()=>{const r=e.getAttribute(t);return e.setAttribute(t,n),()=>{null==r?e.removeAttribute(t):e.setAttribute(t,r)}}))}function Br(e,t,n){return Lr(e,t,(()=>{const r=t in e,o=e[t];return e[t]=n,()=>{r?e[t]=o:delete e[t]}}))}function Vr(e,t){if(!e)return()=>{};return Lr(e,"style",(()=>{const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}))}var Wr=["SCRIPT","STYLE"];function $r(e){return`__ariakit-dialog-snapshot-${e}`}function Hr(e,t,n){return!Wr.includes(t.tagName)&&(!!function(e,t){const n=X(t),r=$r(e);if(!n.body[r])return!0;for(;;){if(t===n.body)return!1;if(t[r])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!n.some((e=>e&&J(t,e))))}function Ur(e,t,n,r){for(let o of t){if(!(null==o?void 0:o.isConnected))continue;const i=t.some((e=>!!e&&(e!==o&&e.contains(o)))),s=X(o),a=o;for(;o.parentElement&&o!==s.body;){if(null==r||r(o.parentElement,a),!i)for(const r of o.parentElement.children)Hr(e,r,t)&&n(r,a);o=o.parentElement}}}function Yr(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function Gr(e,t=""){return A(Br(e,Yr("",!0),!0),Br(e,Yr(t,!0),!0))}function qr(e,t){if(e[Yr(t,!0)])return!0;const n=Yr(t);for(;;){if(e[n])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function Kr(e,t){const n=[],r=t.map((e=>null==e?void 0:e.id));Ur(e,t,(t=>{Ar(t,...r)||n.unshift(function(e,t=""){return A(Br(e,Yr(),!0),Br(e,Yr(t),!0))}(t,e))}),((t,r)=>{r.hasAttribute("data-dialog")&&r.id!==e||n.unshift(Gr(t,e))}));return()=>{for(const e of n)e()}}const Xr=window.ReactDOM;function Zr(e,t){const n=setTimeout(t,e);return()=>clearTimeout(n)}function Qr(...e){return e.join(", ").split(", ").reduce(((e,t)=>{const n=t.endsWith("ms")?1:1e3,r=Number.parseFloat(t||"0s")*n;return r>e?r:e}),0)}function Jr(e,t,n){return!(n||!1===t||e&&!t)}var eo=Nt((function(e){var t=e,{store:n,alwaysVisible:r}=t,o=_(t,["store","alwaysVisible"]);const i=cr();L(n=n||i,!1);const s=(0,$.useRef)(null),a=Pe(o.id),[l,c]=(0,$.useState)(null),u=n.useState("open"),d=n.useState("mounted"),f=n.useState("animated"),h=n.useState("contentElement"),p=rt(n.disclosure,"contentElement");ke((()=>{s.current&&(null==n||n.setContentElement(s.current))}),[n]),ke((()=>{let e;return null==n||n.setState("animated",(t=>(e=t,!0))),()=>{void 0!==e&&(null==n||n.setState("animated",e))}}),[n]),ke((()=>{if(f){if(null==h?void 0:h.isConnected)return function(e){let t=requestAnimationFrame((()=>{t=requestAnimationFrame(e)}));return()=>cancelAnimationFrame(t)}((()=>{c(u?"enter":d?"leave":null)}));c(null)}}),[f,h,u,d]),ke((()=>{if(!n)return;if(!f)return;if(!l)return;if(!h)return;const e=()=>null==n?void 0:n.setState("animating",!1),t=()=>(0,Xr.flushSync)(e);if("leave"===l&&u)return;if("enter"===l&&!u)return;if("number"==typeof f){return Zr(f,t)}const{transitionDuration:r,animationDuration:o,transitionDelay:i,animationDelay:s}=getComputedStyle(h),{transitionDuration:a="0",animationDuration:c="0",transitionDelay:d="0",animationDelay:m="0"}=p?getComputedStyle(p):{},g=Qr(i,s,d,m)+Qr(r,o,a,c);if(!g)return"enter"===l&&n.setState("animated",!1),void e();return Zr(Math.max(g-1e3/60,0),t)}),[n,f,h,p,u,l]),o=Ae(o,(e=>(0,kt.jsx)(hr,{value:n,children:e})),[n]);const m=Jr(d,o.hidden,r),g=o.style,v=(0,$.useMemo)((()=>m?w(y({},g),{display:"none"}):g),[m,g]);return V(o=w(y({id:a,"data-open":u||void 0,"data-enter":"enter"===l||void 0,"data-leave":"leave"===l||void 0,hidden:m},o),{ref:Te(a?n.setContentElement:null,s,o.ref),style:v}))})),to=jt((function(e){return Mt("div",eo(e))})),no=jt((function(e){var t=e,{unmountOnHide:n}=t,r=_(t,["unmountOnHide"]);const o=cr();return!1===rt(r.store||o,(e=>!n||(null==e?void 0:e.mounted)))?null:(0,kt.jsx)(to,y({},r))}));function ro({store:e,backdrop:t,alwaysVisible:n,hidden:r}){const o=(0,$.useRef)(null),i=Qn({disclosure:e}),s=rt(e,"contentElement");(0,$.useEffect)((()=>{const e=o.current,t=s;e&&t&&(e.style.zIndex=getComputedStyle(t).zIndex)}),[s]),ke((()=>{const e=null==s?void 0:s.id;if(!e)return;const t=o.current;return t?Gr(t,e):void 0}),[s]);const a=eo({ref:o,store:i,role:"presentation","data-backdrop":(null==s?void 0:s.id)||"",alwaysVisible:n,hidden:null!=r?r:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,$.isValidElement)(t))return(0,kt.jsx)(ar,w(y({},a),{render:t}));const l="boolean"!=typeof t?t:"div";return(0,kt.jsx)(ar,w(y({},a),{render:(0,kt.jsx)(l,{})}))}function oo(e){return Fr(e,"aria-hidden","true")}function io(){return"inert"in HTMLElement.prototype}function so(e,t){if(!("style"in e))return I;if(io())return Br(e,"inert",!0);const n=Ut(e,!0).map((e=>{if(null==t?void 0:t.some((t=>t&&J(t,e))))return I;const n=Lr(e,"focus",(()=>(e.focus=I,()=>{delete e.focus})));return A(Fr(e,"tabindex","-1"),n)}));return A(...n,oo(e),Vr(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function ao(e,t,n){const r=function({attribute:e,contentId:t,contentElement:n,enabled:r}){const[o,i]=Re(),s=(0,$.useCallback)((()=>{if(!r)return!1;if(!n)return!1;const{body:o}=X(n),i=o.getAttribute(e);return!i||i===t}),[o,r,n,e,t]);return(0,$.useEffect)((()=>{if(!r)return;if(!t)return;if(!n)return;const{body:o}=X(n);if(s())return o.setAttribute(e,t),()=>o.removeAttribute(e);const a=new MutationObserver((()=>(0,Xr.flushSync)(i)));return a.observe(o,{attributeFilter:[e]}),()=>a.disconnect()}),[o,r,t,n,s,e]),s}({attribute:"data-dialog-prevent-body-scroll",contentElement:e,contentId:t,enabled:n});(0,$.useEffect)((()=>{if(!r())return;if(!e)return;const t=X(e),n=Z(e),{documentElement:o,body:i}=t,s=o.style.getPropertyValue("--scrollbar-width"),a=s?Number.parseInt(s):n.innerWidth-o.clientWidth,l=function(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}(o),c=ue()&&!fe();return A((d="--scrollbar-width",f=`${a}px`,(u=o)?Lr(u,d,(()=>{const e=u.style.getPropertyValue(d);return u.style.setProperty(d,f),()=>{e?u.style.setProperty(d,e):u.style.removeProperty(d)}})):()=>{}),c?(()=>{var e,t;const{scrollX:r,scrollY:o,visualViewport:s}=n,c=null!=(e=null==s?void 0:s.offsetLeft)?e:0,u=null!=(t=null==s?void 0:s.offsetTop)?t:0,d=Vr(i,{position:"fixed",overflow:"hidden",top:-(o-Math.floor(u))+"px",left:-(r-Math.floor(c))+"px",right:"0",[l]:`${a}px`});return()=>{d(),n.scrollTo({left:r,top:o,behavior:"instant"})}})():Vr(i,{overflow:"hidden",[l]:`${a}px`}));var u,d,f}),[r,e])}var lo=(0,$.createContext)({});function co({store:e,type:t,listener:n,capture:r,domReady:o}){const i=Me(n),s=rt(e,"open"),a=(0,$.useRef)(!1);ke((()=>{if(!s)return;if(!o)return;const{contentElement:t}=e.getState();if(!t)return;const n=()=>{a.current=!0};return t.addEventListener("focusin",n,!0),()=>t.removeEventListener("focusin",n,!0)}),[e,s,o]),(0,$.useEffect)((()=>{if(!s)return;return we(t,(t=>{const{contentElement:n,disclosureElement:r}=e.getState(),o=t.target;if(!n)return;if(!o)return;if(!function(e){return"HTML"===e.tagName||J(X(e).body,e)}(o))return;if(J(n,o))return;if(function(e,t){if(!e)return!1;if(J(e,t))return!0;const n=t.getAttribute("aria-activedescendant");if(n){const t=X(e).getElementById(n);if(t)return J(e,t)}return!1}(r,o))return;if(o.hasAttribute("data-focus-trap"))return;if(function(e,t){if(!("clientY"in e))return!1;const n=t.getBoundingClientRect();return 0!==n.width&&0!==n.height&&n.top<=e.clientY&&e.clientY<=n.top+n.height&&n.left<=e.clientX&&e.clientX<=n.left+n.width}(t,n))return;var s;a.current&&!qr(o,n.id)||((s=o)&&s[tn]||i(t))}),r)}),[s,r])}function uo(e,t){return"function"==typeof e?e(t):!!e}function fo(e,t,n){const r=function(e){const t=(0,$.useRef)();return(0,$.useEffect)((()=>{if(e)return we("mousedown",(e=>{t.current=e.target}),!0);t.current=null}),[e]),t}(rt(e,"open")),o={store:e,domReady:n,capture:!0};co(w(y({},o),{type:"click",listener:n=>{const{contentElement:o}=e.getState(),i=r.current;i&&re(i)&&qr(i,null==o?void 0:o.id)&&uo(t,n)&&e.hide()}})),co(w(y({},o),{type:"focusin",listener:n=>{const{contentElement:r}=e.getState();r&&n.target!==X(r)&&uo(t,n)&&e.hide()}})),co(w(y({},o),{type:"contextmenu",listener:n=>{uo(t,n)&&e.hide()}}))}var ho=Nt((function(e){var t=e,{autoFocusOnShow:n=!0}=t,r=_(t,["autoFocusOnShow"]);return r=Ae(r,(e=>(0,kt.jsx)(Bt.Provider,{value:n,children:e})),[n])})),po=(jt((function(e){return Mt("div",ho(e))})),(0,$.createContext)(0));function mo({level:e,children:t}){const n=(0,$.useContext)(po),r=Math.max(Math.min(e||n+1,6),1);return(0,kt.jsx)(po.Provider,{value:r,children:t})}var go=Nt((function(e){return e=w(y({},e),{style:y({border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},e.style)})})),vo=(jt((function(e){return Mt("span",go(e))})),Nt((function(e){return e=w(y({"data-focus-trap":"",tabIndex:0,"aria-hidden":!0},e),{style:y({position:"fixed",top:0,left:0},e.style)}),e=go(e)}))),bo=jt((function(e){return Mt("span",vo(e))})),xo=(0,$.createContext)(null);function yo(e){queueMicrotask((()=>{null==e||e.focus()}))}var wo=Nt((function(e){var t=e,{preserveTabOrder:n,preserveTabOrderAnchor:r,portalElement:o,portalRef:i,portal:s=!0}=t,a=_(t,["preserveTabOrder","preserveTabOrderAnchor","portalElement","portalRef","portal"]);const l=(0,$.useRef)(null),c=Te(l,a.ref),u=(0,$.useContext)(xo),[d,f]=(0,$.useState)(null),[h,p]=(0,$.useState)(null),m=(0,$.useRef)(null),g=(0,$.useRef)(null),v=(0,$.useRef)(null),b=(0,$.useRef)(null);return ke((()=>{const e=l.current;if(!e||!s)return void f(null);const t=function(e,t){return t?"function"==typeof t?t(e):t:X(e).createElement("div")}(e,o);if(!t)return void f(null);const n=t.isConnected;if(!n){const n=u||function(e){return X(e).body}(e);n.appendChild(t)}return t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).slice(2,8)}`}()),f(t),Y(i,t),n?void 0:()=>{t.remove(),Y(i,null)}}),[s,o,u,i]),ke((()=>{if(!s)return;if(!n)return;if(!r)return;const e=X(r).createElement("span");return e.style.position="fixed",r.insertAdjacentElement("afterend",e),p(e),()=>{e.remove(),p(null)}}),[s,n,r]),(0,$.useEffect)((()=>{if(!d)return;if(!n)return;let e=0;const t=t=>{if(!xe(t))return;const n="focusin"===t.type;if(cancelAnimationFrame(e),n)return function(e){const t=e.querySelectorAll("[data-tabindex]"),n=e=>{const t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};e.hasAttribute("data-tabindex")&&n(e);for(const e of t)n(e)}(d);e=requestAnimationFrame((()=>{!function(e,t){const n=Ut(e,t);for(const e of n)Qt(e)}(d,!0)}))};return d.addEventListener("focusin",t,!0),d.addEventListener("focusout",t,!0),()=>{cancelAnimationFrame(e),d.removeEventListener("focusin",t,!0),d.removeEventListener("focusout",t,!0)}}),[d,n]),a=Ae(a,(e=>{if(e=(0,kt.jsx)(xo.Provider,{value:d||u,children:e}),!s)return e;if(!d)return(0,kt.jsx)("span",{ref:c,id:a.id,style:{position:"fixed"},hidden:!0});e=(0,kt.jsxs)(kt.Fragment,{children:[n&&d&&(0,kt.jsx)(bo,{ref:g,"data-focus-trap":a.id,className:"__focus-trap-inner-before",onFocus:e=>{xe(e,d)?yo(Gt()):yo(m.current)}}),e,n&&d&&(0,kt.jsx)(bo,{ref:v,"data-focus-trap":a.id,className:"__focus-trap-inner-after",onFocus:e=>{xe(e,d)?yo(qt()):yo(b.current)}})]}),d&&(e=(0,Xr.createPortal)(e,d));let t=(0,kt.jsxs)(kt.Fragment,{children:[n&&d&&(0,kt.jsx)(bo,{ref:m,"data-focus-trap":a.id,className:"__focus-trap-outer-before",onFocus:e=>{!(e.relatedTarget===b.current)&&xe(e,d)?yo(g.current):yo(qt())}}),n&&(0,kt.jsx)("span",{"aria-owns":null==d?void 0:d.id,style:{position:"fixed"}}),n&&d&&(0,kt.jsx)(bo,{ref:b,"data-focus-trap":a.id,className:"__focus-trap-outer-after",onFocus:e=>{if(xe(e,d))yo(v.current);else{const e=Gt();if(e===g.current)return void requestAnimationFrame((()=>{var e;return null==(e=Gt())?void 0:e.focus()}));yo(e)}}})]});return h&&n&&(t=(0,Xr.createPortal)(t,h)),(0,kt.jsxs)(kt.Fragment,{children:[t,e]})}),[d,u,s,a.id,n,h]),a=w(y({},a),{ref:c})})),_o=(jt((function(e){return Mt("div",wo(e))})),de());function So(e,t=!1){if(!e)return null;const n="current"in e?e.current:e;return n?t?Wt(n)?n:null:n:null}var Co=Nt((function(e){var t=e,{store:n,open:r,onClose:o,focusable:i=!0,modal:s=!0,portal:a=!!s,backdrop:l=!!s,hideOnEscape:c=!0,hideOnInteractOutside:u=!0,getPersistentElements:d,preventBodyScroll:f=!!s,autoFocusOnShow:h=!0,autoFocusOnHide:p=!0,initialFocus:m,finalFocus:g,unmountOnHide:v,unstable_treeSnapshotKey:b}=t,x=_(t,["store","open","onClose","focusable","modal","portal","backdrop","hideOnEscape","hideOnInteractOutside","getPersistentElements","preventBodyScroll","autoFocusOnShow","autoFocusOnHide","initialFocus","finalFocus","unmountOnHide","unstable_treeSnapshotKey"]);const S=dr(),C=(0,$.useRef)(null),k=function(e={}){const[t,n]=st(Jn,e);return er(t,n,e)}({store:n||S,open:r,setOpen(e){if(e)return;const t=C.current;if(!t)return;const n=new Event("close",{bubbles:!1,cancelable:!0});o&&t.addEventListener("close",o,{once:!0}),t.dispatchEvent(n),n.defaultPrevented&&k.setOpen(!0)}}),{portalRef:j,domReady:E}=ze(a,x.portalRef),M=x.preserveTabOrder,N=rt(k,(e=>M&&!s&&e.mounted)),T=Pe(x.id),P=rt(k,"open"),D=rt(k,"mounted"),I=rt(k,"contentElement"),R=Jr(D,x.hidden,x.alwaysVisible);ao(I,T,f&&!R),fo(k,u,E);const{wrapElement:O,nestedDialogs:z}=function(e){const t=(0,$.useContext)(lo),[n,r]=(0,$.useState)([]),o=(0,$.useCallback)((e=>{var n;return r((t=>[...t,e])),A(null==(n=t.add)?void 0:n.call(t,e),(()=>{r((t=>t.filter((t=>t!==e))))}))}),[t]);ke((()=>Xe(e,["open","contentElement"],(n=>{var r;if(n.open&&n.contentElement)return null==(r=t.add)?void 0:r.call(t,e)}))),[e,t]);const i=(0,$.useMemo)((()=>({store:e,add:o})),[e,o]);return{wrapElement:(0,$.useCallback)((e=>(0,kt.jsx)(lo.Provider,{value:i,children:e})),[i]),nestedDialogs:n}}(k);x=Ae(x,O,[O]),ke((()=>{if(!P)return;const e=C.current,t=Q(e,!0);t&&"BODY"!==t.tagName&&(e&&J(e,t)||k.setDisclosureElement(t))}),[k,P]),_o&&(0,$.useEffect)((()=>{if(!D)return;const{disclosureElement:e}=k.getState();if(!e)return;if(!te(e))return;const t=()=>{let t=!1;const n=()=>{t=!0};e.addEventListener("focusin",n,{capture:!0,once:!0}),ye(e,"mouseup",(()=>{e.removeEventListener("focusin",n,!0),t||Zt(e)}))};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}}),[k,D]),(0,$.useEffect)((()=>{if(!D)return;if(!E)return;const e=C.current;if(!e)return;const t=Z(e),n=t.visualViewport||t,r=()=>{var n,r;const o=null!=(r=null==(n=t.visualViewport)?void 0:n.height)?r:t.innerHeight;e.style.setProperty("--dialog-viewport-height",`${o}px`)};return r(),n.addEventListener("resize",r),()=>{n.removeEventListener("resize",r)}}),[D,E]),(0,$.useEffect)((()=>{if(!s)return;if(!D)return;if(!E)return;const e=C.current;if(!e)return;return e.querySelector("[data-dialog-dismiss]")?void 0:function(e,t){const n=X(e).createElement("button");return n.type="button",n.tabIndex=-1,n.textContent="Dismiss popup",Object.assign(n.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),n.addEventListener("click",t),e.prepend(n),()=>{n.removeEventListener("click",t),n.remove()}}(e,k.hide)}),[k,s,D,E]),ke((()=>{if(!io())return;if(P)return;if(!D)return;if(!E)return;const e=C.current;return e?so(e):void 0}),[P,D,E]);const L=P&&E;ke((()=>{if(!T)return;if(!L)return;const e=C.current;return function(e,t){const{body:n}=X(t[0]),r=[];return Ur(e,t,(t=>{r.push(Br(t,$r(e),!0))})),A(Br(n,$r(e),!0),(()=>{for(const e of r)e()}))}(T,[e])}),[T,L,b]);const F=Me(d);ke((()=>{if(!T)return;if(!L)return;const{disclosureElement:e}=k.getState(),t=[C.current,...F()||[],...z.map((e=>e.getState().contentElement))];return s?A(Kr(T,t),function(e,t){const n=[],r=t.map((e=>null==e?void 0:e.id));return Ur(e,t,(e=>{Ar(e,...r)||function(e,...t){if(!e)return!1;const n=e.getAttribute("data-focus-trap");return null!=n&&(!t.length||""!==n&&t.some((e=>n===e)))}(e,...r)||n.unshift(so(e,t))}),(e=>{e.hasAttribute("role")&&(t.some((t=>t&&J(t,e)))||n.unshift(Fr(e,"role","none")))})),()=>{for(const e of n)e()}}(T,t)):Kr(T,[e,...t])}),[T,k,L,F,z,s,b]);const B=!!h,V=Oe(h),[W,H]=(0,$.useState)(!1);(0,$.useEffect)((()=>{if(!P)return;if(!B)return;if(!E)return;if(!(null==I?void 0:I.isConnected))return;const e=So(m,!0)||I.querySelector("[data-autofocus=true],[autofocus]")||Yt(I,!0,a&&N)||I,t=Wt(e);V(t?e:null)&&(H(!0),queueMicrotask((()=>{e.focus(),_o&&e.scrollIntoView({block:"nearest",inline:"nearest"})})))}),[P,B,E,I,m,a,N,V]);const U=!!p,Y=Oe(p),[G,q]=(0,$.useState)(!1);(0,$.useEffect)((()=>{if(P)return q(!0),()=>q(!1)}),[P]);const K=(0,$.useCallback)(((e,t=!0)=>{const{disclosureElement:n}=k.getState();if(function(e){const t=Q();return!(!t||e&&J(e,t)||!Wt(t))}(e))return;let r=So(g)||n;if(null==r?void 0:r.id){const e=X(r),t=`[aria-activedescendant="${r.id}"]`,n=e.querySelector(t);n&&(r=n)}if(r&&!Wt(r)){const e=r.closest("[data-dialog]");if(null==e?void 0:e.id){const t=X(e),n=`[aria-controls~="${e.id}"]`,o=t.querySelector(n);o&&(r=o)}}const o=r&&Wt(r);o||!t?Y(o?r:null)&&o&&(null==r||r.focus()):requestAnimationFrame((()=>K(e,!1)))}),[k,g,Y]),ee=(0,$.useRef)(!1);ke((()=>{if(P)return;if(!G)return;if(!U)return;const e=C.current;ee.current=!0,K(e)}),[P,G,E,U,K]),(0,$.useEffect)((()=>{if(!G)return;if(!U)return;const e=C.current;return()=>{ee.current?ee.current=!1:K(e)}}),[G,U,K]);const ne=Oe(c);(0,$.useEffect)((()=>{if(!E)return;if(!D)return;return we("keydown",(e=>{if("Escape"!==e.key)return;if(e.defaultPrevented)return;const t=C.current;if(!t)return;if(qr(t))return;const n=e.target;if(!n)return;const{disclosureElement:r}=k.getState();("BODY"===n.tagName||J(t,n)||!r||J(r,n))&&ne(e)&&k.hide()}),!0)}),[k,E,D,ne]);const re=(x=Ae(x,(e=>(0,kt.jsx)(mo,{level:s?1:void 0,children:e})),[s])).hidden,oe=x.alwaysVisible;x=Ae(x,(e=>l?(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(ro,{store:k,backdrop:l,hidden:re,alwaysVisible:oe}),e]}):e),[k,l,re,oe]);const[ie,se]=(0,$.useState)(),[ae,le]=(0,$.useState)();return x=Ae(x,(e=>(0,kt.jsx)(hr,{value:k,children:(0,kt.jsx)(pr.Provider,{value:se,children:(0,kt.jsx)(mr.Provider,{value:le,children:e})})})),[k]),x=w(y({id:T,"data-dialog":"",role:"dialog",tabIndex:i?-1:void 0,"aria-labelledby":ie,"aria-describedby":ae},x),{ref:Te(C,x.ref)}),x=ho(w(y({},x),{autoFocusOnShow:W})),x=eo(y({store:k},x)),x=un(w(y({},x),{focusable:i})),x=wo(w(y({portal:a},x),{portalRef:j,preserveTabOrder:N}))}));function ko(e,t=dr){return jt((function(n){const r=t();return rt(n.store||r,(e=>!n.unmountOnHide||(null==e?void 0:e.mounted)||!!n.open))?(0,kt.jsx)(e,y({},n)):null}))}ko(jt((function(e){return Mt("div",Co(e))})),dr);const jo=Math.min,Eo=Math.max,Mo=(Math.round,Math.floor,{left:"right",right:"left",bottom:"top",top:"bottom"}),No={start:"end",end:"start"};function To(e,t,n){return Eo(e,jo(t,n))}function Po(e,t){return"function"==typeof e?e(t):e}function Do(e){return e.split("-")[0]}function Io(e){return e.split("-")[1]}function Ro(e){return"x"===e?"y":"x"}function Oo(e){return"y"===e?"height":"width"}function Ao(e){return["top","bottom"].includes(Do(e))?"y":"x"}function zo(e){return Ro(Ao(e))}function Lo(e){return e.replace(/start|end/g,(e=>No[e]))}function Fo(e){return e.replace(/left|right|bottom|top/g,(e=>Mo[e]))}function Bo(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Vo(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Wo(e,t,n){let{reference:r,floating:o}=e;const i=Ao(t),s=zo(t),a=Oo(s),l=Do(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Io(t)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1)}return h}async function $o(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Po(t,e),p=Bo(h),m=a[f?"floating"===d?"reference":"floating":d],g=Vo(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{...s.floating,x:r,y:o}:s.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),x=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},y=Vo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:v,offsetParent:b,strategy:l}):v);return{top:(g.top-y.top+p.top)/x.y,bottom:(y.bottom-g.bottom+p.bottom)/x.y,left:(g.left-y.left+p.left)/x.x,right:(y.right-g.right+p.right)/x.x}}const Ho=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=Do(n),a=Io(n),l="y"===Ao(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=Po(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof p&&(h="end"===a?-1*p:p),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},Uo=Math.min,Yo=Math.max,Go=Math.round,qo=Math.floor,Ko=e=>({x:e,y:e});function Xo(){return"undefined"!=typeof window}function Zo(e){return ei(e)?(e.nodeName||"").toLowerCase():"#document"}function Qo(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Jo(e){var t;return null==(t=(ei(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ei(e){return!!Xo()&&(e instanceof Node||e instanceof Qo(e).Node)}function ti(e){return!!Xo()&&(e instanceof Element||e instanceof Qo(e).Element)}function ni(e){return!!Xo()&&(e instanceof HTMLElement||e instanceof Qo(e).HTMLElement)}function ri(e){return!(!Xo()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Qo(e).ShadowRoot)}function oi(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ui(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function ii(e){return["table","td","th"].includes(Zo(e))}function si(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function ai(e){const t=li(),n=ti(e)?ui(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function li(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function ci(e){return["html","body","#document"].includes(Zo(e))}function ui(e){return Qo(e).getComputedStyle(e)}function di(e){return ti(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fi(e){if("html"===Zo(e))return e;const t=e.assignedSlot||e.parentNode||ri(e)&&e.host||Jo(e);return ri(t)?t.host:t}function hi(e){const t=fi(e);return ci(t)?e.ownerDocument?e.ownerDocument.body:e.body:ni(t)&&oi(t)?t:hi(t)}function pi(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=hi(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=Qo(o);if(i){const e=function(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}(s);return t.concat(s,s.visualViewport||[],oi(o)?o:[],e&&n?pi(e):[])}return t.concat(o,pi(o,[],n))}function mi(e){const t=ui(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ni(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Go(n)!==i||Go(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function gi(e){return ti(e)?e:e.contextElement}function vi(e){const t=gi(e);if(!ni(t))return Ko(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=mi(t);let s=(i?Go(n.width):n.width)/r,a=(i?Go(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const bi=Ko(0);function xi(e){const t=Qo(e);return li()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:bi}function yi(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=gi(e);let s=Ko(1);t&&(r?ti(r)&&(s=vi(r)):s=vi(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Qo(e))&&t}(i,n,r)?xi(i):Ko(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=Qo(i),t=r&&ti(r)?Qo(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=vi(o),t=o.getBoundingClientRect(),r=ui(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=Qo(o),o=n.frameElement}}return Vo({width:u,height:d,x:l,y:c})}const wi=[":popover-open",":modal"];function _i(e){return wi.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Si(e){return yi(Jo(e)).left+di(e).scrollLeft}function Ci(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Qo(e),r=Jo(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=li();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=Jo(e),n=di(e),r=e.ownerDocument.body,o=Yo(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Yo(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Si(e);const a=-n.scrollTop;return"rtl"===ui(r).direction&&(s+=Yo(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(Jo(e));else if(ti(t))r=function(e,t){const n=yi(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ni(e)?vi(e):Ko(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=xi(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return Vo(r)}function ki(e,t){const n=fi(e);return!(n===t||!ti(n)||ci(n))&&("fixed"===ui(n).position||ki(n,t))}function ji(e,t,n){const r=ni(t),o=Jo(t),i="fixed"===n,s=yi(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Ko(0);if(r||!r&&!i)if(("body"!==Zo(t)||oi(o))&&(a=di(t)),r){const e=yi(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Si(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Ei(e,t){return ni(e)&&"fixed"!==ui(e).position?t?t(e):e.offsetParent:null}function Mi(e,t){const n=Qo(e);if(!ni(e)||_i(e))return n;let r=Ei(e,t);for(;r&&ii(r)&&"static"===ui(r).position;)r=Ei(r,t);return r&&("html"===Zo(r)||"body"===Zo(r)&&"static"===ui(r).position&&!ai(r))?n:r||function(e){let t=fi(e);for(;ni(t)&&!ci(t);){if(ai(t))return t;if(si(t))return null;t=fi(t)}return null}(e)||n}const Ni={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=Jo(r),a=!!t&&_i(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Ko(1);const u=Ko(0),d=ni(r);if((d||!d&&!i)&&(("body"!==Zo(r)||oi(s))&&(l=di(r)),ni(r))){const e=yi(r);c=vi(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:Jo,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=pi(e,[],!1).filter((e=>ti(e)&&"body"!==Zo(e))),o=null;const i="fixed"===ui(e).position;let s=i?fi(e):e;for(;ti(s)&&!ci(s);){const t=ui(s),n=ai(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||oi(s)&&!n&&ki(e,s))?r=r.filter((e=>e!==s)):o=t,s=fi(s)}return t.set(e,r),r}(t,this._c):[].concat(n),s=[...i,r],a=s[0],l=s.reduce(((e,n)=>{const r=Ci(t,n,o);return e.top=Yo(r.top,e.top),e.right=Uo(r.right,e.right),e.bottom=Uo(r.bottom,e.bottom),e.left=Yo(r.left,e.left),e}),Ci(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Mi,getElementRects:async function(e){const t=this.getOffsetParent||Mi,n=this.getDimensions;return{reference:ji(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=mi(e);return{width:t,height:n}},getScale:vi,isElement:ti,isRTL:function(e){return"rtl"===ui(e).direction}};function Ti(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=gi(e),u=o||i?[...c?pi(c):[],...pi(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=Jo(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h={rootMargin:-qo(u)+"px "+-qo(o.clientWidth-(c+d))+"px "+-qo(o.clientHeight-(u+f))+"px "+-qo(c)+"px",threshold:Yo(0,Uo(1,l))||1};let p=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),100)}p=!1}try{r=new IntersectionObserver(m,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,h)}r.observe(e)}(!0),i}(c,n):null;let f,h=-1,p=null;s&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let m=l?yi(e):null;return l&&function t(){const r=yi(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const Pi=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Po(e,t),c={x:n,y:r},u=await $o(t,l),d=Ao(Do(o)),f=Ro(d);let h=c[f],p=c[d];if(i){const e="y"===f?"bottom":"right";h=To(h+u["y"===f?"top":"left"],h,h-u[e])}if(s){const e="y"===d?"bottom":"right";p=To(p+u["y"===d?"top":"left"],p,p-u[e])}const m=a.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},Di=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=Po(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=Do(o),b=Do(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),y=f||(b||!m?[Fo(a)]:function(e){const t=Fo(e);return[Lo(e),t,Lo(t)]}(a));f||"none"===p||y.push(...function(e,t,n,r){const o=Io(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(Do(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Lo)))),i}(a,m,p,x));const w=[a,...y],_=await $o(t,g),S=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&S.push(_[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Io(e),o=zo(e),i=Oo(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Fo(s)),[s,Fo(s)]}(o,s,x);S.push(_[e[0]],_[e[1]])}if(C=[...C,{placement:o,overflows:S}],!S.every((e=>e<=0))){var k,j;const e=((null==(k=i.flip)?void 0:k.index)||0)+1,t=w[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(j=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:j.placement;if(!n)switch(h){case"bestFit":{var E;const e=null==(E=C.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:E[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Ii=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=Po(e,t),l=await $o(t,a),c=Do(n),u=Io(n),d="y"===Ao(n),{width:f,height:h}=r.floating;let p,m;"top"===c||"bottom"===c?(p=c,m=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,p="end"===u?"top":"bottom");const g=h-l[p],v=f-l[m],b=!t.middlewareData.shift;let x=g,y=v;if(d){const e=f-l.left-l.right;y=u||b?jo(v,e):e}else{const e=h-l.top-l.bottom;x=u||b?jo(g,e):e}if(b&&!u){const e=Eo(l.left,0),t=Eo(l.right,0),n=Eo(l.top,0),r=Eo(l.bottom,0);d?y=f-2*(0!==e||0!==t?e+t:Eo(l.left,l.right)):x=h-2*(0!==n||0!==r?n+r:Eo(l.top,l.bottom))}await s({...t,availableWidth:y,availableHeight:x});const w=await o.getDimensions(i.floating);return f!==w.width||h!==w.height?{reset:{rects:!0}}:{}}}},Ri=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Po(e,t)||{};if(null==c)return{};const d=Bo(u),f={x:n,y:r},h=zo(o),p=Oo(h),m=await s.getDimensions(c),g="y"===h,v=g?"top":"left",b=g?"bottom":"right",x=g?"clientHeight":"clientWidth",y=i.reference[p]+i.reference[h]-f[h]-i.floating[p],w=f[h]-i.reference[h],_=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let S=_?_[x]:0;S&&await(null==s.isElement?void 0:s.isElement(_))||(S=a.floating[x]||i.floating[p]);const C=y/2-w/2,k=S/2-m[p]/2-1,j=jo(d[v],k),E=jo(d[b],k),M=j,N=S-m[p]-E,T=S/2-m[p]/2+C,P=To(M,T,N),D=!l.arrow&&null!=Io(o)&&T!=P&&i.reference[p]/2-(T<M?j:E)-m[p]/2<0,I=D?T<M?T-M:T-N:0;return{[h]:f[h]+I,data:{[h]:P,centerOffset:T-P-I,...D&&{alignmentOffset:I}},reset:D}}}),Oi=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Po(e,t),u={x:n,y:r},d=Ao(o),f=Ro(d);let h=u[f],p=u[d];const m=Po(a,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+g.mainAxis,n=i.reference[f]+i.reference[e]-g.mainAxis;h<t?h=t:h>n&&(h=n)}if(c){var v,b;const e="y"===f?"width":"height",t=["top","left"].includes(Do(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=s.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(b=s.offset)?void 0:b[d])||0)-(t?g.crossAxis:0);p<n?p=n:p>r&&(p=r)}return{[f]:h,[d]:p}}}},Ai=(e,t,n)=>{const r=new Map,o={platform:Ni,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Wo(c,r,l),f=r,h={},p=0;for(let n=0;n<a.length;n++){const{name:i,fn:m}=a[n],{x:g,y:v,data:b,reset:x}=await m({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,h={...h,[i]:{...h[i],...b}},x&&p<=50&&(p++,"object"==typeof x&&(x.placement&&(f=x.placement),x.rects&&(c=!0===x.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):x.rects),({x:u,y:d}=Wo(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}})(e,t,{...o,platform:i})};function zi(e=0,t=0,n=0,r=0){if("function"==typeof DOMRect)return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return w(y({},o),{toJSON:()=>o})}function Li(e,t){return{contextElement:e||void 0,getBoundingClientRect:()=>{const n=e,r=null==t?void 0:t(n);return r||!n?function(e){if(!e)return zi();const{x:t,y:n,width:r,height:o}=e;return zi(t,n,r,o)}(r):n.getBoundingClientRect()}}}function Fi(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function Bi(e){const t=window.devicePixelRatio||1;return Math.round(e*t)/t}function Vi(e,t){return Ho((({placement:n})=>{var r;const o=((null==e?void 0:e.clientHeight)||0)/2,i="number"==typeof t.gutter?t.gutter+o:null!=(r=t.gutter)?r:o;return{crossAxis:!!n.split("-")[1]?void 0:t.shift,mainAxis:i,alignmentAxis:t.shift}}))}function Wi(e){if(!1===e.flip)return;const t="string"==typeof e.flip?e.flip.split(" "):void 0;return L(!t||t.every(Fi),!1),Di({padding:e.overflowPadding,fallbackPlacements:t})}function $i(e){if(e.slide||e.overlap)return Pi({mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Oi()})}function Hi(e){return Ii({padding:e.overflowPadding,apply({elements:t,availableWidth:n,availableHeight:r,rects:o}){const i=t.floating,s=Math.round(o.reference.width);n=Math.floor(n),r=Math.floor(r),i.style.setProperty("--popover-anchor-width",`${s}px`),i.style.setProperty("--popover-available-width",`${n}px`),i.style.setProperty("--popover-available-height",`${r}px`),e.sameWidth&&(i.style.width=`${s}px`),e.fitViewport&&(i.style.maxWidth=`${n}px`,i.style.maxHeight=`${r}px`)}})}function Ui(e,t){if(e)return Ri({element:e,padding:t.arrowPadding})}var Yi=Nt((function(e){var t=e,{store:n,modal:r=!1,portal:o=!!r,preserveTabOrder:i=!0,autoFocusOnShow:s=!0,wrapperProps:a,fixed:l=!1,flip:c=!0,shift:u=0,slide:d=!0,overlap:f=!1,sameWidth:h=!1,fitViewport:p=!1,gutter:m,arrowPadding:g=4,overflowPadding:v=8,getAnchorRect:b,updatePosition:x}=t,S=_(t,["store","modal","portal","preserveTabOrder","autoFocusOnShow","wrapperProps","fixed","flip","shift","slide","overlap","sameWidth","fitViewport","gutter","arrowPadding","overflowPadding","getAnchorRect","updatePosition"]);const C=br();L(n=n||C,!1);const k=n.useState("arrowElement"),j=n.useState("anchorElement"),E=n.useState("disclosureElement"),M=n.useState("popoverElement"),N=n.useState("contentElement"),T=n.useState("placement"),P=n.useState("mounted"),D=n.useState("rendered"),I=(0,$.useRef)(null),[R,O]=(0,$.useState)(!1),{portalRef:A,domReady:z}=ze(o,S.portalRef),F=Me(b),B=Me(x),V=!!x;ke((()=>{if(!(null==M?void 0:M.isConnected))return;M.style.setProperty("--popover-overflow-padding",`${v}px`);const e=Li(j,F),t=async()=>{if(!P)return;k||(I.current=I.current||document.createElement("div"));const t=k||I.current,r=[Vi(t,{gutter:m,shift:u}),Wi({flip:c,overflowPadding:v}),$i({slide:d,shift:u,overlap:f,overflowPadding:v}),Ui(t,{arrowPadding:g}),Hi({sameWidth:h,fitViewport:p,overflowPadding:v})],o=await Ai(e,M,{placement:T,strategy:l?"fixed":"absolute",middleware:r});null==n||n.setState("currentPlacement",o.placement),O(!0);const i=Bi(o.x),s=Bi(o.y);if(Object.assign(M.style,{top:"0",left:"0",transform:`translate3d(${i}px,${s}px,0)`}),t&&o.middlewareData.arrow){const{x:e,y:n}=o.middlewareData.arrow,r=o.placement.split("-")[0],i=t.clientWidth/2,s=t.clientHeight/2,a=null!=e?e+i:-i,l=null!=n?n+s:-s;M.style.setProperty("--popover-transform-origin",{top:`${a}px calc(100% + ${s}px)`,bottom:`${a}px ${-s}px`,left:`calc(100% + ${i}px) ${l}px`,right:`${-i}px ${l}px`}[r]),Object.assign(t.style,{left:null!=e?`${e}px`:"",top:null!=n?`${n}px`:"",[r]:"100%"})}},r=Ti(e,M,(async()=>{V?(await B({updatePosition:t}),O(!0)):await t()}),{elementResize:"function"==typeof ResizeObserver});return()=>{O(!1),r()}}),[n,D,M,k,j,M,T,P,z,l,c,u,d,f,h,p,m,g,v,F,V,B]),ke((()=>{if(!P)return;if(!z)return;if(!(null==M?void 0:M.isConnected))return;if(!(null==N?void 0:N.isConnected))return;const e=()=>{M.style.zIndex=getComputedStyle(N).zIndex};e();let t=requestAnimationFrame((()=>{t=requestAnimationFrame(e)}));return()=>cancelAnimationFrame(t)}),[P,z,M,N]);const W=l?"fixed":"absolute";return S=Ae(S,(e=>(0,kt.jsx)("div",w(y({},a),{style:y({position:W,top:0,left:0,width:"max-content"},null==a?void 0:a.style),ref:null==n?void 0:n.setPopoverElement,children:e}))),[n,W,a]),S=Ae(S,(e=>(0,kt.jsx)(yr,{value:n,children:e})),[n]),S=w(y({"data-placing":!R||void 0},S),{style:y({position:"relative"},S.style)}),S=Co(w(y({store:n,modal:r,portal:o,preserveTabOrder:i,preserveTabOrderAnchor:E||j,autoFocusOnShow:R&&s},S),{portalRef:A}))}));ko(jt((function(e){return Mt("div",Yi(e))})),br);function Gi(e,t,n,r){return!!Xt(t)||!!e&&(!!J(t,e)||(!(!n||!J(n,e))||!!(null==r?void 0:r.some((t=>Gi(e,t,n))))))}var qi=(0,$.createContext)(null),Ki=Nt((function(e){var t=e,{store:n,modal:r=!1,portal:o=!!r,hideOnEscape:i=!0,hideOnHoverOutside:s=!0,disablePointerEventsOnApproach:a=!!s}=t,l=_(t,["store","modal","portal","hideOnEscape","hideOnHoverOutside","disablePointerEventsOnApproach"]);const c=_r();L(n=n||c,!1);const u=(0,$.useRef)(null),[d,f]=(0,$.useState)([]),h=(0,$.useRef)(0),p=(0,$.useRef)(null),{portalRef:m,domReady:g}=ze(o,l.portalRef),v=Fe(),b=!!s,x=Oe(s),S=!!a,C=Oe(a),k=n.useState("open"),j=n.useState("mounted");(0,$.useEffect)((()=>{if(!g)return;if(!j)return;if(!b&&!S)return;const e=u.current;if(!e)return;return A(we("mousemove",(t=>{if(!n)return;if(!v())return;const{anchorElement:r,hideTimeout:o,timeout:i}=n.getState(),s=p.current,[a]=t.composedPath(),l=r;if(Gi(a,e,l,d))return p.current=a&&l&&J(l,a)?Ir(t):null,window.clearTimeout(h.current),void(h.current=0);if(!h.current){if(s){const n=Ir(t);if(Rr(n,Or(e,s))){if(p.current=n,!C(t))return;return t.preventDefault(),void t.stopPropagation()}}x(t)&&(h.current=window.setTimeout((()=>{h.current=0,null==n||n.hide()}),null!=o?o:i))}}),!0),(()=>clearTimeout(h.current)))}),[n,v,g,j,b,S,d,C,x]),(0,$.useEffect)((()=>{if(!g)return;if(!j)return;if(!S)return;const e=e=>{const t=u.current;if(!t)return;const n=p.current;if(!n)return;const r=Or(t,n);if(Rr(Ir(e),r)){if(!C(e))return;e.preventDefault(),e.stopPropagation()}};return A(we("mouseenter",e,!0),we("mouseover",e,!0),we("mouseout",e,!0),we("mouseleave",e,!0))}),[g,j,S,C]),(0,$.useEffect)((()=>{g&&(k||null==n||n.setAutoFocusOnShow(!1))}),[n,g,k]);const E=Ee(k);(0,$.useEffect)((()=>{if(g)return()=>{E.current||null==n||n.setAutoFocusOnShow(!1)}}),[n,g]);const M=(0,$.useContext)(qi);ke((()=>{if(r)return;if(!o)return;if(!j)return;if(!g)return;const e=u.current;return e?null==M?void 0:M(e):void 0}),[r,o,j,g]);const N=(0,$.useCallback)((e=>{f((t=>[...t,e]));const t=null==M?void 0:M(e);return()=>{f((t=>t.filter((t=>t!==e)))),null==t||t()}}),[M]);l=Ae(l,(e=>(0,kt.jsx)(Cr,{value:n,children:(0,kt.jsx)(qi.Provider,{value:N,children:e})})),[n,N]),l=w(y({},l),{ref:Te(u,l.ref)}),l=function(e){var t=e,{store:n}=t,r=_(t,["store"]);const[o,i]=(0,$.useState)(!1),s=n.useState("mounted");(0,$.useEffect)((()=>{s||i(!1)}),[s]);const a=r.onFocus,l=Me((e=>{null==a||a(e),e.defaultPrevented||i(!0)})),c=(0,$.useRef)(null);return(0,$.useEffect)((()=>Xe(n,["anchorElement"],(e=>{c.current=e.anchorElement}))),[]),w(y({autoFocusOnHide:o,finalFocus:c},r),{onFocus:l})}(y({store:n},l));const T=n.useState((e=>r||e.autoFocusOnShow));return l=Yi(w(y({store:n,modal:r,portal:o,autoFocusOnShow:T},l),{portalRef:m,hideOnEscape:e=>!F(i,e)&&(requestAnimationFrame((()=>{requestAnimationFrame((()=>{null==n||n.hide()}))})),!0)}))})),Xi=(ko(jt((function(e){return Mt("div",Ki(e))})),_r),Nt((function(e){var t=e,{store:n,portal:r=!0,gutter:o=8,preserveTabOrder:i=!1,hideOnHoverOutside:s=!0,hideOnInteractOutside:a=!0}=t,l=_(t,["store","portal","gutter","preserveTabOrder","hideOnHoverOutside","hideOnInteractOutside"]);const c=Er();L(n=n||c,!1),l=Ae(l,(e=>(0,kt.jsx)(Mr,{value:n,children:e})),[n]);const u=n.useState((e=>"description"===e.type?"tooltip":"none"));return l=y({role:u},l),l=Ki(w(y({},l),{store:n,portal:r,gutter:o,preserveTabOrder:i,hideOnHoverOutside(e){if(F(s,e))return!1;const t=null==n?void 0:n.getState().anchorElement;return!t||!("focusVisible"in t.dataset)},hideOnInteractOutside:e=>{if(F(a,e))return!1;const t=null==n?void 0:n.getState().anchorElement;return!t||!J(t,e.target)}}))}))),Zi=ko(jt((function(e){return Mt("div",Xi(e))})),Er);const Qi=window.wp.deprecated;var Ji=o.n(Qi);var es=function(e){const{shortcut:t,className:n}=e;if(!t)return null;let r,o;return"string"==typeof t&&(r=t),null!==t&&"object"==typeof t&&(r=t.display,o=t.ariaLabel),(0,kt.jsx)("span",{className:n,"aria-label":o,children:r})};const ts={bottom:"bottom",top:"top","middle left":"left","middle right":"right","bottom left":"bottom-end","bottom center":"bottom","bottom right":"bottom-start","top left":"top-end","top center":"top","top right":"top-start","middle left left":"left","middle left right":"left","middle left bottom":"left-end","middle left top":"left-start","middle right left":"right","middle right right":"right","middle right bottom":"right-end","middle right top":"right-start","bottom left left":"bottom-end","bottom left right":"bottom-end","bottom left bottom":"bottom-end","bottom left top":"bottom-end","bottom center left":"bottom","bottom center right":"bottom","bottom center bottom":"bottom","bottom center top":"bottom","bottom right left":"bottom-start","bottom right right":"bottom-start","bottom right bottom":"bottom-start","bottom right top":"bottom-start","top left left":"top-end","top left right":"top-end","top left bottom":"top-end","top left top":"top-end","top center left":"top","top center right":"top","top center bottom":"top","top center top":"top","top right left":"top-start","top right right":"top-start","top right bottom":"top-start","top right top":"top-start",middle:"bottom","middle center":"bottom","middle center bottom":"bottom","middle center left":"bottom","middle center right":"bottom","middle center top":"bottom"},ns=e=>{var t;return null!==(t=ts[e])&&void 0!==t?t:"bottom"},rs={top:{originX:.5,originY:1},"top-start":{originX:0,originY:1},"top-end":{originX:1,originY:1},right:{originX:0,originY:.5},"right-start":{originX:0,originY:0},"right-end":{originX:0,originY:1},bottom:{originX:.5,originY:0},"bottom-start":{originX:0,originY:0},"bottom-end":{originX:1,originY:0},left:{originX:1,originY:.5},"left-start":{originX:1,originY:0},"left-end":{originX:1,originY:1},overlay:{originX:.5,originY:.5}};const os=e=>null===e||Number.isNaN(e)?void 0:Math.round(e),is=(0,f.createContext)({isNestedInTooltip:!1});is.displayName="TooltipInternalContext";const ss=700,as={isNestedInTooltip:!0};const ls=(0,f.forwardRef)((function(e,t){const{children:n,className:r,delay:o=ss,hideOnClick:i=!0,placement:s,position:a,shortcut:l,text:u,...h}=e,{isNestedInTooltip:p}=(0,f.useContext)(is),m=(0,d.useInstanceId)(ls,"tooltip"),g=u||l?m:void 0,v=1===f.Children.count(n);let b;void 0!==s?b=s:void 0!==a&&(b=ns(a),Ji()("`position` prop in wp.components.tooltip",{since:"6.4",alternative:"`placement` prop"})),b=b||"bottom";const x=sr({placement:b,showTimeout:o}),y=rt(x,"mounted");return p?v?(0,kt.jsx)(ar,{...h,render:n}):n:(0,kt.jsxs)(is.Provider,{value:as,children:[(0,kt.jsx)(Dr,{onClick:i?x.hide:void 0,store:x,render:v?(w=n,g&&y&&void 0===w.props["aria-describedby"]&&w.props["aria-label"]!==u?(0,f.cloneElement)(w,{"aria-describedby":g}):w):void 0,ref:t,children:v?void 0:n}),v&&(u||l)&&(0,kt.jsxs)(Zi,{...h,className:c("components-tooltip",r),unmountOnHide:!0,gutter:4,id:g,overflowPadding:.5,store:x,children:[u,l&&(0,kt.jsx)(es,{className:u?"components-tooltip__shortcut":"",shortcut:l})]})]});var w}));var cs=ls;window.wp.warning;var us=o(66),ds=o.n(us),fs=o(7734),hs=o.n(fs);
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function ps(e){return"[object Object]"===Object.prototype.toString.call(e)}function ms(e){var t,n;return!1!==ps(e)&&(void 0===(t=e.constructor)||!1!==ps(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}var gs=function(e,t){const n=(0,f.useRef)(!1);(0,f.useEffect)((()=>{if(n.current)return e();n.current=!0}),t),(0,f.useEffect)((()=>()=>{n.current=!1}),[])};const vs=(0,f.createContext)({});vs.displayName="ComponentsContext";const bs=()=>(0,f.useContext)(vs);const xs=(0,f.memo)((({children:e,value:t})=>{const n=function({value:e}){const t=bs(),n=(0,f.useRef)(e);return gs((()=>{hs()(n.current,e)&&n.current}),[e]),(0,f.useMemo)((()=>ds()(null!=t?t:{},null!=e?e:{},{isMergeableObject:ms})),[t,e])}({value:t});return(0,kt.jsx)(vs.Provider,{value:n,children:e})})),ys="data-wp-component",ws="data-wp-c16t",_s="__contextSystemKey__";var Ss=function(){return Ss=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ss.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function Cs(e){return e.toLowerCase()}var ks=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],js=/[^A-Z0-9]+/gi;function Es(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function Ms(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,r=void 0===n?ks:n,o=t.stripRegexp,i=void 0===o?js:o,s=t.transform,a=void 0===s?Cs:s,l=t.delimiter,c=void 0===l?" ":l,u=Es(Es(e,r,"$1\0$2"),i,"\0"),d=0,f=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(f-1);)f--;return u.slice(d,f).split("\0").map(a).join(c)}(e,Ss({delimiter:"."},t))}function Ns(e,t){return void 0===t&&(t={}),Ms(e,Ss({delimiter:"-"},t))}function Ts(e,t){var n,r,o=0;function i(){var i,s,a=n,l=arguments.length;e:for(;a;){if(a.args.length===arguments.length){for(s=0;s<l;s++)if(a.args[s]!==arguments[s]){a=a.next;continue e}return a!==n&&(a===r&&(r=a.prev),a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=n,a.prev=null,n.prev=a,n=a),a.val}a=a.next}for(i=new Array(l),s=0;s<l;s++)i[s]=arguments[s];return a={args:i,val:e.apply(null,i)},n?(n.prev=a,a.next=n):r=a,o===t.maxSize?(r=r.prev).next=null:o++,n=a,a.val}return t=t||{},i.clear=function(){n=null,r=null,o=0},i}const Ps=Ts((function(e){return`components-${Ns(e)}`}));var Ds=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){0}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),Is=Math.abs,Rs=String.fromCharCode,Os=Object.assign;function As(e){return e.trim()}function zs(e,t,n){return e.replace(t,n)}function Ls(e,t){return e.indexOf(t)}function Fs(e,t){return 0|e.charCodeAt(t)}function Bs(e,t,n){return e.slice(t,n)}function Vs(e){return e.length}function Ws(e){return e.length}function $s(e,t){return t.push(e),e}var Hs=1,Us=1,Ys=0,Gs=0,qs=0,Ks="";function Xs(e,t,n,r,o,i,s){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:Hs,column:Us,length:s,return:""}}function Zs(e,t){return Os(Xs("",null,null,"",null,null,0),e,{length:-e.length},t)}function Qs(){return qs=Gs>0?Fs(Ks,--Gs):0,Us--,10===qs&&(Us=1,Hs--),qs}function Js(){return qs=Gs<Ys?Fs(Ks,Gs++):0,Us++,10===qs&&(Us=1,Hs++),qs}function ea(){return Fs(Ks,Gs)}function ta(){return Gs}function na(e,t){return Bs(Ks,e,t)}function ra(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function oa(e){return Hs=Us=1,Ys=Vs(Ks=e),Gs=0,[]}function ia(e){return Ks="",e}function sa(e){return As(na(Gs-1,ca(91===e?e+2:40===e?e+1:e)))}function aa(e){for(;(qs=ea())&&qs<33;)Js();return ra(e)>2||ra(qs)>3?"":" "}function la(e,t){for(;--t&&Js()&&!(qs<48||qs>102||qs>57&&qs<65||qs>70&&qs<97););return na(e,ta()+(t<6&&32==ea()&&32==Js()))}function ca(e){for(;Js();)switch(qs){case e:return Gs;case 34:case 39:34!==e&&39!==e&&ca(qs);break;case 40:41===e&&ca(e);break;case 92:Js()}return Gs}function ua(e,t){for(;Js()&&e+qs!==57&&(e+qs!==84||47!==ea()););return"/*"+na(t,Gs-1)+"*"+Rs(47===e?e:Js())}function da(e){for(;!ra(ea());)Js();return na(e,Gs)}var fa="-ms-",ha="-moz-",pa="-webkit-",ma="comm",ga="rule",va="decl",ba="@keyframes";function xa(e,t){for(var n="",r=Ws(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function ya(e,t,n,r){switch(e.type){case"@import":case va:return e.return=e.return||e.value;case ma:return"";case ba:return e.return=e.value+"{"+xa(e.children,r)+"}";case ga:e.value=e.props.join(",")}return Vs(n=xa(e.children,r))?e.return=e.value+"{"+n+"}":""}function wa(e){return ia(_a("",null,null,null,[""],e=oa(e),0,[0],e))}function _a(e,t,n,r,o,i,s,a,l){for(var c=0,u=0,d=s,f=0,h=0,p=0,m=1,g=1,v=1,b=0,x="",y=o,w=i,_=r,S=x;g;)switch(p=b,b=Js()){case 40:if(108!=p&&58==Fs(S,d-1)){-1!=Ls(S+=zs(sa(b),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:S+=sa(b);break;case 9:case 10:case 13:case 32:S+=aa(p);break;case 92:S+=la(ta()-1,7);continue;case 47:switch(ea()){case 42:case 47:$s(Ca(ua(Js(),ta()),t,n),l);break;default:S+="/"}break;case 123*m:a[c++]=Vs(S)*v;case 125*m:case 59:case 0:switch(b){case 0:case 125:g=0;case 59+u:h>0&&Vs(S)-d&&$s(h>32?ka(S+";",r,n,d-1):ka(zs(S," ","")+";",r,n,d-2),l);break;case 59:S+=";";default:if($s(_=Sa(S,t,n,c,u,o,a,x,y=[],w=[],d),i),123===b)if(0===u)_a(S,t,_,_,y,i,d,a,w);else switch(99===f&&110===Fs(S,3)?100:f){case 100:case 109:case 115:_a(e,_,_,r&&$s(Sa(e,_,_,0,0,o,a,x,o,y=[],d),w),o,w,d,a,r?y:w);break;default:_a(S,_,_,_,[""],w,0,a,w)}}c=u=h=0,m=v=1,x=S="",d=s;break;case 58:d=1+Vs(S),h=p;default:if(m<1)if(123==b)--m;else if(125==b&&0==m++&&125==Qs())continue;switch(S+=Rs(b),b*m){case 38:v=u>0?1:(S+="\f",-1);break;case 44:a[c++]=(Vs(S)-1)*v,v=1;break;case 64:45===ea()&&(S+=sa(Js())),f=ea(),u=d=Vs(x=S+=da(ta())),b++;break;case 45:45===p&&2==Vs(S)&&(m=0)}}return i}function Sa(e,t,n,r,o,i,s,a,l,c,u){for(var d=o-1,f=0===o?i:[""],h=Ws(f),p=0,m=0,g=0;p<r;++p)for(var v=0,b=Bs(e,d+1,d=Is(m=s[p])),x=e;v<h;++v)(x=As(m>0?f[v]+" "+b:zs(b,/&\f/g,f[v])))&&(l[g++]=x);return Xs(e,t,n,0===o?ga:a,l,c,u)}function Ca(e,t,n){return Xs(e,t,n,ma,Rs(qs),Bs(e,2,-2),0)}function ka(e,t,n,r){return Xs(e,t,n,va,Bs(e,0,r),Bs(e,r+1,-1),r)}var ja=function(e,t,n){for(var r=0,o=0;r=o,o=ea(),38===r&&12===o&&(t[n]=1),!ra(o);)Js();return na(e,Gs)},Ea=function(e,t){return ia(function(e,t){var n=-1,r=44;do{switch(ra(r)){case 0:38===r&&12===ea()&&(t[n]=1),e[n]+=ja(Gs-1,t,n);break;case 2:e[n]+=sa(r);break;case 4:if(44===r){e[++n]=58===ea()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Rs(r)}}while(r=Js());return e}(oa(e),t))},Ma=new WeakMap,Na=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Ma.get(n))&&!r){Ma.set(e,!0);for(var o=[],i=Ea(t,o),s=n.props,a=0,l=0;a<i.length;a++)for(var c=0;c<s.length;c++,l++)e.props[l]=o[a]?i[a].replace(/&\f/g,s[c]):s[c]+" "+i[a]}}},Ta=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Pa(e,t){switch(function(e,t){return 45^Fs(e,0)?(((t<<2^Fs(e,0))<<2^Fs(e,1))<<2^Fs(e,2))<<2^Fs(e,3):0}(e,t)){case 5103:return pa+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return pa+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return pa+e+ha+e+fa+e+e;case 6828:case 4268:return pa+e+fa+e+e;case 6165:return pa+e+fa+"flex-"+e+e;case 5187:return pa+e+zs(e,/(\w+).+(:[^]+)/,pa+"box-$1$2"+fa+"flex-$1$2")+e;case 5443:return pa+e+fa+"flex-item-"+zs(e,/flex-|-self/,"")+e;case 4675:return pa+e+fa+"flex-line-pack"+zs(e,/align-content|flex-|-self/,"")+e;case 5548:return pa+e+fa+zs(e,"shrink","negative")+e;case 5292:return pa+e+fa+zs(e,"basis","preferred-size")+e;case 6060:return pa+"box-"+zs(e,"-grow","")+pa+e+fa+zs(e,"grow","positive")+e;case 4554:return pa+zs(e,/([^-])(transform)/g,"$1"+pa+"$2")+e;case 6187:return zs(zs(zs(e,/(zoom-|grab)/,pa+"$1"),/(image-set)/,pa+"$1"),e,"")+e;case 5495:case 3959:return zs(e,/(image-set\([^]*)/,pa+"$1$`$1");case 4968:return zs(zs(e,/(.+:)(flex-)?(.*)/,pa+"box-pack:$3"+fa+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+pa+e+e;case 4095:case 3583:case 4068:case 2532:return zs(e,/(.+)-inline(.+)/,pa+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Vs(e)-1-t>6)switch(Fs(e,t+1)){case 109:if(45!==Fs(e,t+4))break;case 102:return zs(e,/(.+:)(.+)-([^]+)/,"$1"+pa+"$2-$3$1"+ha+(108==Fs(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ls(e,"stretch")?Pa(zs(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Fs(e,t+1))break;case 6444:switch(Fs(e,Vs(e)-3-(~Ls(e,"!important")&&10))){case 107:return zs(e,":",":"+pa)+e;case 101:return zs(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+pa+(45===Fs(e,14)?"inline-":"")+"box$3$1"+pa+"$2$3$1"+fa+"$2box$3")+e}break;case 5936:switch(Fs(e,t+11)){case 114:return pa+e+fa+zs(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return pa+e+fa+zs(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return pa+e+fa+zs(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return pa+e+fa+e+e}return e}var Da=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case va:e.return=Pa(e.value,e.length);break;case ba:return xa([Zs(e,{value:zs(e.value,"@","@"+pa)})],r);case ga:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return xa([Zs(e,{props:[zs(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return xa([Zs(e,{props:[zs(t,/:(plac\w+)/,":"+pa+"input-$1")]}),Zs(e,{props:[zs(t,/:(plac\w+)/,":-moz-$1")]}),Zs(e,{props:[zs(t,/:(plac\w+)/,fa+"input-$1")]})],r)}return""}))}}];const Ia=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r=e.stylisPlugins||Da;var o,i,s={},a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)s[t[n]]=!0;a.push(e)}));var l,c,u,d,f=[ya,(d=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],h=(c=[Na,Ta].concat(r,f),u=Ws(c),function(e,t,n,r){for(var o="",i=0;i<u;i++)o+=c[i](e,t,n,r)||"";return o});i=function(e,t,n,r){l=n,function(e){xa(wa(e),h)}(e?e+"{"+t.styles+"}":t.styles),r&&(p.inserted[t.name]=!0)};var p={key:t,sheet:new Ds({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:i};return p.sheet.hydrate(a),p};const Ra=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)};const Oa={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Aa(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var za=/[A-Z]|^ms/g,La=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Fa=function(e){return 45===e.charCodeAt(1)},Ba=function(e){return null!=e&&"boolean"!=typeof e},Va=Aa((function(e){return Fa(e)?e:e.replace(za,"-$&").toLowerCase()})),Wa=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(La,(function(e,t,n){return Ha={name:t,styles:n,next:Ha},t}))}return 1===Oa[e]||Fa(e)||"number"!=typeof t||0===t?t:t+"px"};function $a(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return Ha={name:n.name,styles:n.styles,next:Ha},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)Ha={name:r.name,styles:r.styles,next:Ha},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=$a(e,t,n[o])+";";else for(var i in n){var s=n[i];if("object"!=typeof s)null!=t&&void 0!==t[s]?r+=i+"{"+t[s]+"}":Ba(s)&&(r+=Va(i)+":"+Wa(i,s)+";");else if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var a=$a(e,t,s);switch(i){case"animation":case"animationName":r+=Va(i)+":"+a+";";break;default:r+=i+"{"+a+"}"}}else for(var l=0;l<s.length;l++)Ba(s[l])&&(r+=Va(i)+":"+Wa(i,s[l])+";")}return r}(e,t,n);case"function":if(void 0!==e){var o=Ha,i=n(e);return Ha=o,$a(e,t,i)}}if(null==t)return n;var s=t[n];return void 0!==s?s:n}var Ha,Ua=/label:\s*([^\s;\n{]+)\s*(;|$)/g;var Ya=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,o="";Ha=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,o+=$a(n,t,i)):o+=i[0];for(var s=1;s<e.length;s++)o+=$a(n,t,e[s]),r&&(o+=i[s]);Ua.lastIndex=0;for(var a,l="";null!==(a=Ua.exec(o));)l+="-"+a[1];return{name:Ra(o)+l,styles:o,next:Ha}},Ga=!!$.useInsertionEffect&&$.useInsertionEffect,qa=Ga||function(e){return e()},Ka=(0,$.createContext)("undefined"!=typeof HTMLElement?Ia({key:"css"}):null);var Xa=Ka.Provider,Za=function(e){return(0,$.forwardRef)((function(t,n){var r=(0,$.useContext)(Ka);return e(t,r,n)}))},Qa=(0,$.createContext)({});function Ja(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}var el=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},tl=function(e,t,n){el(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0);o=o.next}while(void 0!==o)}};function nl(e,t){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0)}function rl(e,t,n){var r=[],o=Ja(e,r,n);return r.length<2?n:o+t(r)}var ol=function e(t){for(var n="",r=0;r<t.length;r++){var o=t[r];if(null!=o){var i=void 0;switch(typeof o){case"boolean":break;case"object":if(Array.isArray(o))i=e(o);else for(var s in i="",o)o[s]&&s&&(i&&(i+=" "),i+=s);break;default:i=o}i&&(n&&(n+=" "),n+=i)}}return n};const il=function(e){var t=Ia(e);t.sheet.speedy=function(e){this.isSpeedy=e},t.compat=!0;var n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=Ya(n,t.registered,void 0);return tl(t,o,!1),t.key+"-"+o.name};return{css:n,cx:function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return rl(t.registered,n,ol(r))},injectGlobal:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=Ya(n,t.registered);nl(t,o)},keyframes:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=Ya(n,t.registered),i="animation-"+o.name;return nl(t,{name:o.name,styles:"@keyframes "+i+"{"+o.styles+"}"}),i},hydrate:function(e){e.forEach((function(e){t.inserted[e]=!0}))},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:Ja.bind(null,t.registered),merge:rl.bind(null,t.registered,n)}};var sl=il({key:"css"}),al=(sl.flush,sl.hydrate,sl.cx);sl.merge,sl.getRegisteredStyles,sl.injectGlobal,sl.keyframes,sl.css,sl.sheet,sl.cache;const ll=()=>{const e=(0,$.useContext)(Ka),t=(0,f.useCallback)(((...t)=>{if(null===e)throw new Error("The `useCx` hook should be only used within a valid Emotion Cache Context");return al(...t.map((t=>(e=>null!=e&&["name","styles"].every((t=>void 0!==e[t])))(t)?(tl(e,t,!1),`${e.key}-${t.name}`):t)))}),[e]);return t};function cl(e,t){const n=bs(),r=n?.[t]||{},o={[ws]:!0,...(i=t,{[ys]:i})};var i;const{_overrides:s,...a}=r,l=Object.entries(a).length?Object.assign({},a,e):e,c=ll()(Ps(t),e.className),u="function"==typeof l.renderChildren?l.renderChildren(l):l.children;for(const e in l)o[e]=l[e];for(const e in s)o[e]=s[e];return void 0!==u&&(o.children=u),o.className=c,o}function ul(e,t){return fl(e,t,{forwardsRef:!0})}function dl(e,t){return fl(e,t)}function fl(e,t,n){const r=n?.forwardsRef?(0,f.forwardRef)(e):e;let o=r[_s]||[t];return Array.isArray(t)&&(o=[...o,...t]),"string"==typeof t&&(o=[...o,t]),Object.assign(r,{[_s]:[...new Set(o)],displayName:t,selector:`.${Ps(t)}`})}function hl(e){if(!e)return[];let t=[];return e[_s]&&(t=e[_s]),e.type&&e.type[_s]&&(t=e.type[_s]),t}function pl(e,t){return!!e&&("string"==typeof t?hl(e).includes(t):!!Array.isArray(t)&&t.some((t=>hl(e).includes(t))))}const ml={border:0,clip:"rect(1px, 1px, 1px, 1px)",WebkitClipPath:"inset( 50% )",clipPath:"inset( 50% )",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",wordWrap:"normal"};function gl(){return gl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gl.apply(null,arguments)}var vl=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|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|enterKeyHint|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|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|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)-.*))$/,bl=Aa((function(e){return vl.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),xl=function(e){return"theme"!==e},yl=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?bl:xl},wl=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},_l=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;el(t,n,r);qa((function(){return tl(t,n,r)}));return null};const Sl=function e(t,n){var r,o,i=t.__emotion_real===t,s=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,o=n.target);var a=wl(t,n,i),l=a||yl(s),c=!l("as");return function(){var u=arguments,d=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&d.push("label:"+r+";"),null==u[0]||void 0===u[0].raw)d.push.apply(d,u);else{0,d.push(u[0][0]);for(var f=u.length,h=1;h<f;h++)d.push(u[h],u[0][h])}var p=Za((function(e,t,n){var r=c&&e.as||s,i="",u=[],f=e;if(null==e.theme){for(var h in f={},e)f[h]=e[h];f.theme=(0,$.useContext)(Qa)}"string"==typeof e.className?i=Ja(t.registered,u,e.className):null!=e.className&&(i=e.className+" ");var p=Ya(d.concat(u),t.registered,f);i+=t.key+"-"+p.name,void 0!==o&&(i+=" "+o);var m=c&&void 0===a?yl(r):l,g={};for(var v in e)c&&"as"===v||m(v)&&(g[v]=e[v]);return g.className=i,g.ref=n,(0,$.createElement)($.Fragment,null,(0,$.createElement)(_l,{cache:t,serialized:p,isStringTag:"string"==typeof r}),(0,$.createElement)(r,g))}));return p.displayName=void 0!==r?r:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",p.defaultProps=t.defaultProps,p.__emotion_real=p,p.__emotion_base=s,p.__emotion_styles=d,p.__emotion_forwardProp=a,Object.defineProperty(p,"toString",{value:function(){return"."+o}}),p.withComponent=function(t,r){return e(t,gl({},n,r,{shouldForwardProp:wl(p,r,!0)})).apply(void 0,d)},p}},Cl=Sl("div",{target:"e19lxcc00"})("");var kl=Object.assign((0,f.forwardRef)((function({as:e,...t},n){return(0,kt.jsx)(Cl,{as:e,ref:n,...t})})),{selector:".components-view"});var jl=ul((function(e,t){const{style:n,...r}=cl(e,"VisuallyHidden");return(0,kt.jsx)(kl,{ref:t,...r,style:{...ml,...n||{}}})}),"VisuallyHidden");const El=[["top left","top center","top right"],["center left","center center","center right"],["bottom left","bottom center","bottom right"]],Ml={"top left":(0,u.__)("Top Left"),"top center":(0,u.__)("Top Center"),"top right":(0,u.__)("Top Right"),"center left":(0,u.__)("Center Left"),"center center":(0,u.__)("Center"),center:(0,u.__)("Center"),"center right":(0,u.__)("Center Right"),"bottom left":(0,u.__)("Bottom Left"),"bottom center":(0,u.__)("Bottom Center"),"bottom right":(0,u.__)("Bottom Right")},Nl=El.flat();function Tl(e){const t="center"===e?"center center":e,n=t?.replace("-"," ");return Nl.includes(n)?n:void 0}function Pl(e,t){const n=Tl(t);if(!n)return;return`${e}-${n.replace(" ","-")}`}o(1880);function Dl(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ya(t)}var Il=function(){var e=Dl.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};function Rl(e){if(void 0===e)return;if(!e)return"0";const t="number"==typeof e?e:Number(e);return"undefined"!=typeof window&&window.CSS?.supports?.("margin",e.toString())||Number.isNaN(t)?e.toString():`calc(4px * ${e})`}const Ol="#fff",Al={900:"#1e1e1e",800:"#2f2f2f",700:"#757575",600:"#949494",400:"#ccc",300:"#ddd",200:"#e0e0e0",100:"#f0f0f0"},zl={accent:"var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9))",accentDarker10:"var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6))",accentDarker20:"var(--wp-components-color-accent-darker-20, var(--wp-admin-theme-color-darker-20, #183ad6))",accentInverted:`var(--wp-components-color-accent-inverted, ${Ol})`,background:`var(--wp-components-color-background, ${Ol})`,foreground:`var(--wp-components-color-foreground, ${Al[900]})`,foregroundInverted:`var(--wp-components-color-foreground-inverted, ${Ol})`,gray:{900:`var(--wp-components-color-foreground, ${Al[900]})`,800:`var(--wp-components-color-gray-800, ${Al[800]})`,700:`var(--wp-components-color-gray-700, ${Al[700]})`,600:`var(--wp-components-color-gray-600, ${Al[600]})`,400:`var(--wp-components-color-gray-400, ${Al[400]})`,300:`var(--wp-components-color-gray-300, ${Al[300]})`,200:`var(--wp-components-color-gray-200, ${Al[200]})`,100:`var(--wp-components-color-gray-100, ${Al[100]})`}},Ll={background:zl.background,backgroundDisabled:zl.gray[100],border:zl.gray[600],borderHover:zl.gray[700],borderFocus:zl.accent,borderDisabled:zl.gray[400],textDisabled:zl.gray[600],darkGrayPlaceholder:`color-mix(in srgb, ${zl.foreground}, transparent 38%)`,lightGrayPlaceholder:`color-mix(in srgb, ${zl.background}, transparent 35%)`},Fl=Object.freeze({gray:Al,white:Ol,alert:{yellow:"#f0b849",red:"#d94f4f",green:"#4ab866"},theme:zl,ui:Ll});const Bl="36px",Vl={controlPaddingX:12,controlPaddingXSmall:8,controlPaddingXLarge:12*1.3334,controlBoxShadowFocus:`0 0 0 0.5px ${Fl.theme.accent}`,controlHeight:Bl,controlHeightXSmall:`calc( ${Bl} * 0.6 )`,controlHeightSmall:`calc( ${Bl} * 0.8 )`,controlHeightLarge:`calc( ${Bl} * 1.2 )`,controlHeightXLarge:`calc( ${Bl} * 1.4 )`};var Wl=Object.assign({},Vl,{colorDivider:"rgba(0, 0, 0, 0.1)",colorScrollbarThumb:"rgba(0, 0, 0, 0.2)",colorScrollbarThumbHover:"rgba(0, 0, 0, 0.5)",colorScrollbarTrack:"rgba(0, 0, 0, 0.04)",elevationIntensity:1,radiusXSmall:"1px",radiusSmall:"2px",radiusMedium:"4px",radiusLarge:"8px",radiusFull:"9999px",radiusRound:"50%",borderWidth:"1px",borderWidthFocus:"1.5px",borderWidthTab:"4px",spinnerSize:16,fontSize:"13px",fontSizeH1:"calc(2.44 * 13px)",fontSizeH2:"calc(1.95 * 13px)",fontSizeH3:"calc(1.56 * 13px)",fontSizeH4:"calc(1.25 * 13px)",fontSizeH5:"13px",fontSizeH6:"calc(0.8 * 13px)",fontSizeInputMobile:"16px",fontSizeMobile:"15px",fontSizeSmall:"calc(0.92 * 13px)",fontSizeXSmall:"calc(0.75 * 13px)",fontLineHeightBase:"1.4",fontWeight:"normal",fontWeightHeading:"600",gridBase:"4px",cardPaddingXSmall:`${Rl(2)}`,cardPaddingSmall:`${Rl(4)}`,cardPaddingMedium:`${Rl(4)} ${Rl(6)}`,cardPaddingLarge:`${Rl(6)} ${Rl(8)}`,elevationXSmall:"0 1px 1px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02), 0 3px 3px rgba(0, 0, 0, 0.02), 0 4px 4px rgba(0, 0, 0, 0.01)",elevationSmall:"0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.04), 0 6px 6px rgba(0, 0, 0, 0.03), 0 8px 8px rgba(0, 0, 0, 0.02)",elevationMedium:"0 2px 3px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.04), 0 12px 12px rgba(0, 0, 0, 0.03), 0 16px 16px rgba(0, 0, 0, 0.02)",elevationLarge:"0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 27px rgba(0, 0, 0, 0.07), 0 30px 36px rgba(0, 0, 0, 0.04), 0 50px 43px rgba(0, 0, 0, 0.02)",surfaceBackgroundColor:Fl.white,surfaceBackgroundSubtleColor:"#F3F3F3",surfaceBackgroundTintColor:"#F5F5F5",surfaceBorderColor:"rgba(0, 0, 0, 0.1)",surfaceBorderBoldColor:"rgba(0, 0, 0, 0.15)",surfaceBorderSubtleColor:"rgba(0, 0, 0, 0.05)",surfaceBackgroundTertiaryColor:Fl.white,surfaceColor:Fl.white,transitionDuration:"200ms",transitionDurationFast:"160ms",transitionDurationFaster:"120ms",transitionDurationFastest:"100ms",transitionTimingFunction:"cubic-bezier(0.08, 0.52, 0.52, 1)",transitionTimingFunctionControl:"cubic-bezier(0.12, 0.8, 0.32, 1)"});const $l=({size:e=92})=>Dl("direction:ltr;display:grid;grid-template-columns:repeat( 3, 1fr );grid-template-rows:repeat( 3, 1fr );box-sizing:border-box;width:",e,"px;aspect-ratio:1;border-radius:",Wl.radiusMedium,";outline:none;","");var Hl={name:"e0dnmk",styles:"cursor:pointer"};const Ul=Sl("div",{target:"e1r95csn3"})($l," border:1px solid transparent;",(e=>e.disablePointerEvents?Dl("",""):Hl),";"),Yl=Sl("div",{target:"e1r95csn2"})({name:"1fbxn64",styles:"grid-column:1/-1;box-sizing:border-box;display:grid;grid-template-columns:repeat( 3, 1fr )"}),Gl=Sl("span",{target:"e1r95csn1"})({name:"e2kws5",styles:"position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;margin:0;padding:0;appearance:none;border:none;outline:none"}),ql=Sl("span",{target:"e1r95csn0"})("display:block;contain:strict;box-sizing:border-box;width:",6,"px;aspect-ratio:1;margin:auto;color:",Fl.theme.gray[400],";border:",3,"px solid currentColor;",Gl,"[data-active-item] &{color:",Fl.gray[900],";transform:scale( calc( 5 / 3 ) );}",Gl,":not([data-active-item]):hover &{color:",Fl.theme.accent,";}",Gl,"[data-focus-visible] &{outline:1px solid ",Fl.theme.accent,";outline-offset:1px;}@media not ( prefers-reduced-motion ){transition-property:color,transform;transition-duration:120ms;transition-timing-function:linear;}");function Kl({id:e,value:t,...n}){return(0,kt.jsx)(cs,{text:Ml[t],children:(0,kt.jsxs)(Kn.Item,{id:e,render:(0,kt.jsx)(Gl,{...n,role:"gridcell"}),children:[(0,kt.jsx)(jl,{children:t}),(0,kt.jsx)(ql,{role:"presentation"})]})})}var Xl=function({className:e,disablePointerEvents:t=!0,size:n,width:r,height:o,style:i={},value:s="center",...l}){var u,d;return(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:null!==(u=null!=n?n:r)&&void 0!==u?u:24,height:null!==(d=null!=n?n:o)&&void 0!==d?d:24,role:"presentation",className:c("component-alignment-matrix-control-icon",e),style:{pointerEvents:t?"none":void 0,...i},...l,children:Nl.map(((e,t)=>{const n=function(e="center"){const t=Tl(e);if(!t)return;const n=Nl.indexOf(t);return n>-1?n:void 0}(s)===t?4:2;return(0,kt.jsx)(a.Rect,{x:1.5+t%3*7+(7-n)/2,y:1.5+7*Math.floor(t/3)+(7-n)/2,width:n,height:n,fill:"currentColor"},e)}))})};const Zl=Object.assign((function e({className:t,id:n,label:r=(0,u.__)("Alignment Matrix Control"),defaultValue:o="center center",value:i,onChange:s,width:a=92,...l}){const h=(0,d.useInstanceId)(e,"alignment-matrix-control",n),p=(0,f.useCallback)((e=>{const t=function(e,t){const n=t?.replace(e+"-","");return Tl(n)}(h,e);t&&s?.(t)}),[h,s]),m=c("component-alignment-matrix-control",t);return(0,kt.jsx)(Kn,{defaultActiveId:Pl(h,o),activeId:Pl(h,i),setActiveId:p,rtl:(0,u.isRTL)(),render:(0,kt.jsx)(Ul,{...l,"aria-label":r,className:m,id:h,role:"grid",size:a}),children:El.map(((e,t)=>(0,kt.jsx)(Kn.Row,{render:(0,kt.jsx)(Yl,{role:"row"}),children:e.map((e=>(0,kt.jsx)(Kl,{id:Pl(h,e),value:e},e)))},t)))})}),{Icon:Object.assign(Xl,{displayName:"AlignmentMatrixControl.Icon"})});var Ql=Zl;function Jl(e){return"appear"===e?"top":"left"}function ec(e){if("loading"===e.type)return"components-animate__loading";const{type:t,origin:n=Jl(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return c("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?c("components-animate__slide-in","is-from-"+n):void 0}var tc=function({type:e,options:t={},children:n}){return n({className:ec({type:e,...t})})};const nc=(0,$.createContext)({});function rc(e){const t=(0,$.useRef)(null);return null===t.current&&(t.current=e()),t.current}const oc=(0,$.createContext)(null),ic=(0,$.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class sc extends $.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function ac({children:e,isPresent:t}){const n=(0,$.useId)(),r=(0,$.useRef)(null),o=(0,$.useRef)({width:0,height:0,top:0,left:0}),{nonce:i}=(0,$.useContext)(ic);return(0,$.useInsertionEffect)((()=>{const{width:e,height:s,top:a,left:l}=o.current;if(t||!r.current||!e||!s)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return i&&(c.nonce=i),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${s}px !important;\n top: ${a}px !important;\n left: ${l}px !important;\n }\n `),()=>{document.head.removeChild(c)}}),[t]),(0,kt.jsx)(sc,{isPresent:t,childRef:r,sizeRef:o,children:$.cloneElement(e,{ref:r})})}const lc=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s})=>{const a=rc(cc),l=(0,$.useId)(),c=(0,$.useCallback)((e=>{a.set(e,!0);for(const e of a.values())if(!e)return;r&&r()}),[a,r]),u=(0,$.useMemo)((()=>({id:l,initial:t,isPresent:n,custom:o,onExitComplete:c,register:e=>(a.set(e,!1),()=>a.delete(e))})),i?[Math.random(),c]:[n,c]);return(0,$.useMemo)((()=>{a.forEach(((e,t)=>a.set(t,!1)))}),[n]),$.useEffect((()=>{!n&&!a.size&&r&&r()}),[n]),"popLayout"===s&&(e=(0,kt.jsx)(ac,{isPresent:n,children:e})),(0,kt.jsx)(oc.Provider,{value:u,children:e})};function cc(){return new Map}function uc(e=!0){const t=(0,$.useContext)(oc);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=(0,$.useId)();(0,$.useEffect)((()=>{e&&o(i)}),[e]);const s=(0,$.useCallback)((()=>e&&r&&r(i)),[i,r,e]);return!n&&r?[!1,s]:[!0]}const dc=e=>e.key||"";function fc(e){const t=[];return $.Children.forEach(e,(e=>{(0,$.isValidElement)(e)&&t.push(e)})),t}const hc="undefined"!=typeof window,pc=hc?$.useLayoutEffect:$.useEffect,mc=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:i="sync",propagate:s=!1})=>{const[a,l]=uc(s),c=(0,$.useMemo)((()=>fc(e)),[e]),u=s&&!a?[]:c.map(dc),d=(0,$.useRef)(!0),f=(0,$.useRef)(c),h=rc((()=>new Map)),[p,m]=(0,$.useState)(c),[g,v]=(0,$.useState)(c);pc((()=>{d.current=!1,f.current=c;for(let e=0;e<g.length;e++){const t=dc(g[e]);u.includes(t)?h.delete(t):!0!==h.get(t)&&h.set(t,!1)}}),[g,u.length,u.join("-")]);const b=[];if(c!==p){let e=[...c];for(let t=0;t<g.length;t++){const n=g[t],r=dc(n);u.includes(r)||(e.splice(t,0,n),b.push(n))}return"wait"===i&&b.length&&(e=b),v(fc(e)),void m(c)}const{forceRender:x}=(0,$.useContext)(nc);return(0,kt.jsx)(kt.Fragment,{children:g.map((e=>{const p=dc(e),m=!(s&&!a)&&(c===g||u.includes(p));return(0,kt.jsx)(lc,{isPresent:m,initial:!(d.current&&!n)&&void 0,custom:m?void 0:t,presenceAffectsLayout:o,mode:i,onExitComplete:m?void 0:()=>{if(!h.has(p))return;h.set(p,!0);let e=!0;h.forEach((t=>{t||(e=!1)})),e&&(null==x||x(),v(f.current),s&&(null==l||l()),r&&r())},children:e},p)}))})};function gc(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy(((...t)=>e(...t)),{get:(n,r)=>"create"===r?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}function vc(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const bc=e=>Array.isArray(e);function xc(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function yc(e){return"string"==typeof e||Array.isArray(e)}function wc(e){const t=[{},{}];return null==e||e.values.forEach(((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function _c(e,t,n,r){if("function"==typeof t){const[o,i]=wc(r);t=t(void 0!==n?n:e.custom,o,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,i]=wc(r);t=t(void 0!==n?n:e.custom,o,i)}return t}function Sc(e,t,n){const r=e.getProps();return _c(r,t,void 0!==n?n:r.custom,e)}const Cc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],kc=["initial",...Cc];function jc(e){let t;return()=>(void 0===t&&(t=e()),t)}const Ec=jc((()=>void 0!==window.ScrollTimeline));class Mc{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map((e=>"finished"in e?e.finished:e)))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e,t){const n=this.animations.map((n=>Ec()&&n.attachTimeline?n.attachTimeline(e):"function"==typeof t?t(n):void 0));return()=>{n.forEach(((e,t)=>{e&&e(),this.animations[t].stop()}))}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach((t=>t[e]()))}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Nc extends Mc{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function Tc(e,t){return e?e[t]||e.default||e:void 0}const Pc=2e4;function Dc(e){let t=0;let n=e.next(t);for(;!n.done&&t<Pc;)t+=50,n=e.next(t);return t>=Pc?1/0:t}function Ic(e){return"function"==typeof e}function Rc(e,t){e.timeline=t,e.onfinish=null}const Oc=e=>Array.isArray(e)&&"number"==typeof e[0],Ac={linearEasing:void 0};function zc(e,t){const n=jc(e);return()=>{var e;return null!==(e=Ac[t])&&void 0!==e?e:n()}}const Lc=zc((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0}),"linearEasing"),Fc=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Bc=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let t=0;t<o;t++)r+=e(Fc(0,o-1,t))+", ";return`linear(${r.substring(0,r.length-2)})`};function Vc(e){return Boolean("function"==typeof e&&Lc()||!e||"string"==typeof e&&(e in $c||Lc())||Oc(e)||Array.isArray(e)&&e.every(Vc))}const Wc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,$c={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wc([0,.65,.55,1]),circOut:Wc([.55,0,1,.45]),backIn:Wc([.31,.01,.66,-.59]),backOut:Wc([.33,1.53,.69,.99])};function Hc(e,t){return e?"function"==typeof e&&Lc()?Bc(e,t):Oc(e)?Wc(e):Array.isArray(e)?e.map((e=>Hc(e,t)||$c.easeOut)):$c[e]:void 0}const Uc={x:!1,y:!1};function Yc(){return Uc.x||Uc.y}function Gc(e,t){const n=function(e,t,n){var r;if(e instanceof Element)return[e];if("string"==typeof e){let o=document;t&&(o=t.current);const i=null!==(r=null==n?void 0:n[e])&&void 0!==r?r:o.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function qc(e){return t=>{"touch"===t.pointerType||Yc()||e(t)}}const Kc=(e,t)=>!!t&&(e===t||Kc(e,t.parentElement)),Xc=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,Zc=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Qc=new WeakSet;function Jc(e){return t=>{"Enter"===t.key&&e(t)}}function eu(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function tu(e){return Xc(e)&&!Yc()}function nu(e,t,n={}){const[r,o,i]=Gc(e,n),s=e=>{const r=e.currentTarget;if(!tu(e)||Qc.has(r))return;Qc.add(r);const i=t(e),s=(e,t)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),tu(e)&&Qc.has(r)&&(Qc.delete(r),"function"==typeof i&&i(e,{success:t}))},a=e=>{s(e,n.useGlobalTarget||Kc(r,e.target))},l=e=>{s(e,!1)};window.addEventListener("pointerup",a,o),window.addEventListener("pointercancel",l,o)};return r.forEach((e=>{(function(e){return Zc.has(e.tagName)||-1!==e.tabIndex})(e)||null!==e.getAttribute("tabindex")||(e.tabIndex=0);(n.useGlobalTarget?window:e).addEventListener("pointerdown",s,o),e.addEventListener("focus",(e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=Jc((()=>{if(Qc.has(n))return;eu(n,"down");const e=Jc((()=>{eu(n,"up")}));n.addEventListener("keyup",e,t),n.addEventListener("blur",(()=>eu(n,"cancel")),t)}));n.addEventListener("keydown",r,t),n.addEventListener("blur",(()=>n.removeEventListener("keydown",r)),t)})(e,o)),o)})),i}const ru=e=>1e3*e,ou=e=>e/1e3,iu=e=>e;const su=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],au=new Set(su),lu=new Set(["width","height","top","left","right","bottom",...su]),cu=e=>bc(e)?e[e.length-1]||0:e,uu=!1,du=!1;const fu=["read","resolveKeyframes","update","preRender","render","postRender"];function hu(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=fu.reduce(((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,o=!1;const i=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function a(t){i.has(t)&&(l.schedule(t),e()),t(s)}const l={schedule:(e,o=!1,s=!1)=>{const a=s&&r?t:n;return o&&i.add(e),a.has(e)||a.add(e),e},cancel:e=>{n.delete(e),i.delete(e)},process:e=>{s=e,r?o=!0:(r=!0,[t,n]=[n,t],t.forEach(a),t.clear(),r=!1,o&&(o=!1,l.process(e)))}};return l}(i),e)),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=s,h=()=>{const i=du?o.timestamp:performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(h))};return{schedule:fu.reduce(((t,i)=>{const a=s[i];return t[i]=(t,i=!1,s=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(h)),a.schedule(t,i,s)),t}),{}),cancel:e=>{for(let t=0;t<fu.length;t++)s[fu[t]].cancel(e)},state:o,steps:s}}const{schedule:pu,cancel:mu,state:gu,steps:vu}=hu("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:iu,!0);let bu;function xu(){bu=void 0}const yu={now:()=>(void 0===bu&&yu.set(gu.isProcessing||du?gu.timestamp:performance.now()),bu),set:e=>{bu=e,queueMicrotask(xu)}};function wu(e,t){-1===e.indexOf(t)&&e.push(t)}function _u(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Su{constructor(){this.subscriptions=[]}add(e){return wu(this.subscriptions,e),()=>_u(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Cu(e,t){return t?e*(1e3/t):0}const ku={current:void 0};class ju{constructor(e,t={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=yu.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=yu.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Su);const n=this.events[e].add(t);return"change"===e?()=>{n(),pu.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return ku.current&&ku.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=yu.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Cu(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Eu(e,t){return new ju(e,t)}function Mu(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Eu(n))}const Nu=e=>Boolean(e&&e.getVelocity);function Tu(e,t){const n=e.getValue("willChange");if(r=n,Boolean(Nu(r)&&r.add))return n.add(t);var r}const Pu=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Du="data-"+Pu("framerAppearId");function Iu(e){return e.props[Du]}const Ru=!1,Ou=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Au(e,t,n,r){if(e===t&&n===r)return iu;const o=t=>function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=Ou(s,r,o)-e,i>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<12);return s}(t,0,1,e,n);return e=>0===e||1===e?e:Ou(o(e),t,r)}const zu=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Lu=e=>t=>1-e(1-t),Fu=Au(.33,1.53,.69,.99),Bu=Lu(Fu),Vu=zu(Bu),Wu=e=>(e*=2)<1?.5*Bu(e):.5*(2-Math.pow(2,-10*(e-1))),$u=e=>1-Math.sin(Math.acos(e)),Hu=Lu($u),Uu=zu($u),Yu=e=>/^0[^.\s]+$/u.test(e);const Gu=(e,t,n)=>n>t?t:n<e?e:n,qu={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Ku={...qu,transform:e=>Gu(0,1,e)},Xu={...qu,default:1},Zu=e=>Math.round(1e5*e)/1e5,Qu=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Ju=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ed=(e,t)=>n=>Boolean("string"==typeof n&&Ju.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),td=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[o,i,s,a]=r.match(Qu);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},nd={...qu,transform:e=>Math.round((e=>Gu(0,255,e))(e))},rd={test:ed("rgb","red"),parse:td("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+nd.transform(e)+", "+nd.transform(t)+", "+nd.transform(n)+", "+Zu(Ku.transform(r))+")"};const od={test:ed("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:rd.transform},id=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),sd=id("deg"),ad=id("%"),ld=id("px"),cd=id("vh"),ud=id("vw"),dd={...ad,parse:e=>ad.parse(e)/100,transform:e=>ad.transform(100*e)},fd={test:ed("hsl","hue"),parse:td("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ad.transform(Zu(t))+", "+ad.transform(Zu(n))+", "+Zu(Ku.transform(r))+")"},hd={test:e=>rd.test(e)||od.test(e)||fd.test(e),parse:e=>rd.test(e)?rd.parse(e):fd.test(e)?fd.parse(e):od.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?rd.transform(e):fd.transform(e)},pd=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const md="number",gd="color",vd=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function bd(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(vd,(e=>(hd.test(e)?(r.color.push(i),o.push(gd),n.push(hd.parse(e))):e.startsWith("var(")?(r.var.push(i),o.push("var"),n.push(e)):(r.number.push(i),o.push(md),n.push(parseFloat(e))),++i,"${}"))).split("${}");return{values:n,split:s,indexes:r,types:o}}function xd(e){return bd(e).values}function yd(e){const{split:t,types:n}=bd(e),r=t.length;return e=>{let o="";for(let i=0;i<r;i++)if(o+=t[i],void 0!==e[i]){const t=n[i];o+=t===md?Zu(e[i]):t===gd?hd.transform(e[i]):e[i]}return o}}const wd=e=>"number"==typeof e?0:e;const _d={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(Qu))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(pd))||void 0===n?void 0:n.length)||0)>0},parse:xd,createTransformer:yd,getAnimatableNone:function(e){const t=xd(e);return yd(e)(t.map(wd))}},Sd=new Set(["brightness","contrast","saturate","opacity"]);function Cd(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Qu)||[];if(!r)return e;const o=n.replace(r,"");let i=Sd.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const kd=/\b([a-z-]*)\(.*?\)/gu,jd={..._d,getAnimatableNone:e=>{const t=e.match(kd);return t?t.map(Cd).join(" "):e}},Ed={borderWidth:ld,borderTopWidth:ld,borderRightWidth:ld,borderBottomWidth:ld,borderLeftWidth:ld,borderRadius:ld,radius:ld,borderTopLeftRadius:ld,borderTopRightRadius:ld,borderBottomRightRadius:ld,borderBottomLeftRadius:ld,width:ld,maxWidth:ld,height:ld,maxHeight:ld,top:ld,right:ld,bottom:ld,left:ld,padding:ld,paddingTop:ld,paddingRight:ld,paddingBottom:ld,paddingLeft:ld,margin:ld,marginTop:ld,marginRight:ld,marginBottom:ld,marginLeft:ld,backgroundPositionX:ld,backgroundPositionY:ld},Md={rotate:sd,rotateX:sd,rotateY:sd,rotateZ:sd,scale:Xu,scaleX:Xu,scaleY:Xu,scaleZ:Xu,skew:sd,skewX:sd,skewY:sd,distance:ld,translateX:ld,translateY:ld,translateZ:ld,x:ld,y:ld,z:ld,perspective:ld,transformPerspective:ld,opacity:Ku,originX:dd,originY:dd,originZ:ld},Nd={...qu,transform:Math.round},Td={...Ed,...Md,zIndex:Nd,size:ld,fillOpacity:Ku,strokeOpacity:Ku,numOctaves:Nd},Pd={...Td,color:hd,backgroundColor:hd,outlineColor:hd,fill:hd,stroke:hd,borderColor:hd,borderTopColor:hd,borderRightColor:hd,borderBottomColor:hd,borderLeftColor:hd,filter:jd,WebkitFilter:jd},Dd=e=>Pd[e];function Id(e,t){let n=Dd(e);return n!==jd&&(n=_d),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Rd=new Set(["auto","none","0"]);const Od=e=>e===qu||e===ld,Ad=(e,t)=>parseFloat(e.split(", ")[t]),zd=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return Ad(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?Ad(t[1],e):0}},Ld=new Set(["x","y","z"]),Fd=su.filter((e=>!Ld.has(e)));const Bd={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:zd(4,13),y:zd(5,14)};Bd.translateX=Bd.x,Bd.translateY=Bd.y;const Vd=new Set;let Wd=!1,$d=!1;function Hd(){if($d){const e=Array.from(Vd).filter((e=>e.needsMeasurement)),t=new Set(e.map((e=>e.element))),n=new Map;t.forEach((e=>{const t=function(e){const t=[];return Fd.forEach((n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t}(e);t.length&&(n.set(e,t),e.render())})),e.forEach((e=>e.measureInitialState())),t.forEach((e=>{e.render();const t=n.get(e);t&&t.forEach((([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)}))})),e.forEach((e=>e.measureEndState())),e.forEach((e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)}))}$d=!1,Wd=!1,Vd.forEach((e=>e.complete())),Vd.clear()}function Ud(){Vd.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&($d=!0)}))}class Yd{constructor(e,t,n,r,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Vd.add(this),Wd||(Wd=!0,pu.read(Ud),pu.resolveKeyframes(Hd))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;o<e.length;o++)if(null===e[o])if(0===o){const o=null==r?void 0:r.get(),i=e[e.length-1];if(void 0!==o)e[0]=o;else if(n&&t){const r=n.readValue(t,i);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=i),r&&void 0===o&&r.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Vd.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Vd.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}let Gd=iu,qd=iu;const Kd=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Xd=e=>t=>"string"==typeof t&&t.startsWith(e),Zd=Xd("--"),Qd=Xd("var(--"),Jd=e=>!!Qd(e)&&ef.test(e.split("/*")[0].trim()),ef=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,tf=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function nf(e,t,n=1){qd(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=function(e){const t=tf.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const e=i.trim();return Kd(e)?parseFloat(e):e}return Jd(o)?nf(o,t,n+1):o}const rf=e=>t=>t.test(e),of=[qu,ld,ad,sd,ud,cd,{test:e=>"auto"===e,parse:e=>e}],sf=e=>of.find(rf(e));class af extends Yd{constructor(e,t,n,r,o){super(e,t,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if("string"==typeof r&&(r=r.trim(),Jd(r))){const o=nf(r,t.current);void 0!==o&&(e[n]=o),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!lu.has(n)||2!==e.length)return;const[r,o]=e,i=sf(r),s=sf(o);if(i!==s)if(Od(i)&&Od(s))for(let t=0;t<e.length;t++){const n=e[t];"string"==typeof n&&(e[t]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)("number"==typeof(r=e[t])?0===r:null===r||"none"===r||"0"===r||Yu(r))&&n.push(t);var r;n.length&&function(e,t,n){let r,o=0;for(;o<e.length&&!r;){const t=e[o];"string"==typeof t&&!Rd.has(t)&&bd(t).values.length&&(r=e[o]),o++}if(r&&n)for(const o of t)e[o]=Id(n,r)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Bd[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];void 0!==r&&e.getValue(n,r).jump(r,!1)}measureEndState(){var e;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,s=r[i];r[i]=Bd[n](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==s&&void 0===this.finalKeyframe&&(this.finalKeyframe=s),(null===(e=this.removedTransforms)||void 0===e?void 0:e.length)&&this.removedTransforms.forEach((([e,n])=>{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const lf=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!_d.test(e)&&"0"!==e||e.startsWith("url(")));function cf(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const i=e[e.length-1],s=lf(o,t),a=lf(i,t);return Gd(s===a,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!(!s||!a)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||Ic(n))&&r)}const uf=e=>null!==e;function df(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(uf),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}class ff{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=yu.now(),this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:i,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Ud(),Hd()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=yu.now(),this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:i,onComplete:s,onUpdate:a,isGenerator:l}=this.options;if(!l&&!cf(e,n,r,o)){if(Ru||!i)return a&&a(df(e,this.options,t)),s&&s(),void this.resolveFinishedPromise();this.options.duration=0}const c=this.initPlayback(e,t);!1!==c&&(this._resolved={keyframes:e,finalKeyframe:t,...c},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise((e=>{this.resolveFinishedPromise=e}))}}const hf=(e,t,n)=>e+(t-e)*n;function pf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function mf(e,t){return n=>n>0?t:e}const gf=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},vf=[od,rd,fd];function bf(e){const t=(e=>vf.find((t=>t.test(e))))(e);if(Gd(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let n=t.parse(e);return t===fd&&(n=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,i=0,s=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;o=pf(a,r,e+1/3),i=pf(a,r,e),s=pf(a,r,e-1/3)}else o=i=s=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:r}}(n)),n}const xf=(e,t)=>{const n=bf(e),r=bf(t);if(!n||!r)return mf(e,t);const o={...n};return e=>(o.red=gf(n.red,r.red,e),o.green=gf(n.green,r.green,e),o.blue=gf(n.blue,r.blue,e),o.alpha=hf(n.alpha,r.alpha,e),rd.transform(o))},yf=(e,t)=>n=>t(e(n)),wf=(...e)=>e.reduce(yf),_f=new Set(["none","hidden"]);function Sf(e,t){return n=>hf(e,t,n)}function Cf(e){return"number"==typeof e?Sf:"string"==typeof e?Jd(e)?mf:hd.test(e)?xf:Ef:Array.isArray(e)?kf:"object"==typeof e?hd.test(e)?xf:jf:mf}function kf(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>Cf(e)(e,t[n])));return e=>{for(let t=0;t<r;t++)n[t]=o[t](e);return n}}function jf(e,t){const n={...e,...t},r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=Cf(e[o])(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const Ef=(e,t)=>{const n=_d.createTransformer(t),r=bd(e),o=bd(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?_f.has(e)&&!o.values.length||_f.has(t)&&!r.values.length?function(e,t){return _f.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):wf(kf(function(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],a=e.indexes[s][o[s]],l=null!==(n=e.values[a])&&void 0!==n?n:0;r[i]=l,o[s]++}return r}(r,o),o.values),n):(Gd(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),mf(e,t))};function Mf(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return hf(e,t,n);return Cf(e)(e,t)}function Nf(e,t,n){const r=Math.max(t-5,0);return Cu(n-e(r),t-r)}const Tf=100,Pf=10,Df=1,If=0,Rf=800,Of=.3,Af=.3,zf={granular:.01,default:2},Lf={granular:.005,default:.5},Ff=.01,Bf=10,Vf=.05,Wf=1,$f=.001;function Hf({duration:e=Rf,bounce:t=Of,velocity:n=If,mass:r=Df}){let o,i;Gd(e<=ru(Bf),"Spring duration must be 10 seconds or less");let s=1-t;s=Gu(Vf,Wf,s),e=Gu(Ff,Bf,ou(e)),s<1?(o=t=>{const r=t*s,o=r*e,i=r-n,a=Yf(t,s),l=Math.exp(-o);return $f-i/a*l},i=t=>{const r=t*s*e,i=r*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=Yf(Math.pow(t,2),s);return(-o(t)+$f>0?-1:1)*((i-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let n=1;n<Uf;n++)r-=e(r)/t(r);return r}(o,i,5/e);if(e=ru(e),isNaN(a))return{stiffness:Tf,damping:Pf,duration:e};{const t=Math.pow(a,2)*r;return{stiffness:t,damping:2*s*Math.sqrt(r*t),duration:e}}}const Uf=12;function Yf(e,t){return e*Math.sqrt(1-t*t)}const Gf=["duration","bounce"],qf=["stiffness","damping","mass"];function Kf(e,t){return t.some((t=>void 0!==e[t]))}function Xf(e=Af,t=Of){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:h}=function(e){let t={velocity:If,stiffness:Tf,damping:Pf,mass:Df,isResolvedFromDuration:!1,...e};if(!Kf(e,qf)&&Kf(e,Gf))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(1.2*n),o=r*r,i=2*Gu(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Df,stiffness:o,damping:i}}else{const n=Hf(e);t={...t,...n,mass:Df},t.isResolvedFromDuration=!0}return t}({...n,velocity:-ou(n.velocity||0)}),p=f||0,m=c/(2*Math.sqrt(l*u)),g=s-i,v=ou(Math.sqrt(l/u)),b=Math.abs(g)<5;let x;if(r||(r=b?zf.granular:zf.default),o||(o=b?Lf.granular:Lf.default),m<1){const e=Yf(v,m);x=t=>{const n=Math.exp(-m*v*t);return s-n*((p+m*v*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===m)x=e=>s-Math.exp(-v*e)*(g+(p+v*g)*e);else{const e=v*Math.sqrt(m*m-1);x=t=>{const n=Math.exp(-m*v*t),r=Math.min(e*t,300);return s-n*((p+m*v*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}const y={calculatedDuration:h&&d||null,next:e=>{const t=x(e);if(h)a.done=e>=d;else{let n=0;m<1&&(n=0===e?ru(p):Nf(x,e,t));const i=Math.abs(n)<=r,l=Math.abs(s-t)<=o;a.done=i&&l}return a.value=a.done?s:t,a},toString:()=>{const e=Math.min(Dc(y),Pc),t=Bc((t=>y.next(e*t).value),e,30);return e+"ms "+t}};return y}function Zf({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},h=e=>void 0===a?l:void 0===l||Math.abs(a-e)<Math.abs(l-e)?a:l;let p=n*t;const m=d+p,g=void 0===s?m:s(m);g!==m&&(p=g-d);const v=e=>-p*Math.exp(-e/r),b=e=>g+v(e),x=e=>{const t=v(e),n=b(e);f.done=Math.abs(t)<=c,f.value=f.done?g:n};let y,w;const _=e=>{(e=>void 0!==a&&e<a||void 0!==l&&e>l)(f.value)&&(y=e,w=Xf({keyframes:[f.value,h(f.value)],velocity:Nf(b,e,f.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return _(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==y||(t=!0,x(e),_(e)),void 0!==y&&e>=y?w.next(e-y):(!t&&x(e),f)}}}const Qf=Au(.42,0,1,1),Jf=Au(0,0,.58,1),eh=Au(.42,0,.58,1),th={linear:iu,easeIn:Qf,easeInOut:eh,easeOut:Jf,circIn:$u,circInOut:Uu,circOut:Hu,backIn:Bu,backInOut:Vu,backOut:Fu,anticipate:Wu},nh=e=>{if(Oc(e)){qd(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Au(t,n,r,o)}return"string"==typeof e?(qd(void 0!==th[e],`Invalid easing type '${e}'`),th[e]):e};function rh(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(qd(i===t.length,"Both input and output ranges must be the same length"),1===i)return()=>t[0];if(2===i&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=function(e,t,n){const r=[],o=n||Mf,i=e.length-1;for(let n=0;n<i;n++){let i=o(e[n],e[n+1]);if(t){const e=Array.isArray(t)?t[n]||iu:t;i=wf(e,i)}r.push(i)}return r}(t,r,o),l=a.length,c=n=>{if(s&&n<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(n<e[r+1]);r++);const o=Fc(e[r],e[r+1],n);return a[r](o)};return n?t=>c(Gu(e[0],e[i-1],t)):c}function oh(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Fc(0,t,r);e.push(hf(n,1,o))}}(t,e.length-1),t}function ih({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(nh):nh(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:oh(t),e),a=rh(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||eh)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const sh=e=>{const t=({timestamp:t})=>e(t);return{start:()=>pu.update(t,!0),stop:()=>mu(t),now:()=>gu.isProcessing?gu.timestamp:yu.now()}},ah={decay:Zf,inertia:Zf,tween:ih,keyframes:ih,spring:Xf},lh=e=>e/100;class ch extends ff{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:n,element:r,keyframes:o}=this.options,i=(null==r?void 0:r.KeyframeResolver)||Yd;this.resolver=new i(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=this.options,s=Ic(t)?t:ah[t]||ih;let a,l;s!==ih&&"number"!=typeof e[0]&&(a=wf(lh,Mf(e[0],e[1])),e=[0,100]);const c=s({...this.options,keyframes:e});"mirror"===o&&(l=s({...this.options,keyframes:[...e].reverse(),velocity:-i})),null===c.calculatedDuration&&(c.calculatedDuration=Dc(c));const{calculatedDuration:u}=c,d=u+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:i,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return o.next(0);const{delay:d,repeat:f,repeatType:h,repeatDelay:p,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let b=this.currentTime,x=o;if(f){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,f+1);Boolean(t%2)&&("reverse"===h?(n=1-n,p&&(n-=p/u)):"mirror"===h&&(x=i)),b=Gu(0,1,n)*u}const y=v?{done:!1,value:a[0]}:x.next(b);s&&(y.value=s(y.value));let{done:w}=y;v||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return _&&void 0!==r&&(y.value=df(a,this.options,r)),m&&m(y.value),_&&this.finish(),y}get duration(){const{resolved:e}=this;return e?ou(e.calculatedDuration):0}get time(){return ou(this.currentTime)}set time(e){e=ru(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=ou(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=sh,onPlay:t,startTime:n}=this.options;this.driver||(this.driver=e((e=>this.tick(e)))),t&&t();const r=this.driver.now();null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=r):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const uh=new Set(["opacity","clipPath","filter","transform"]);const dh=jc((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));const fh={anticipate:Wu,backInOut:Vu,circInOut:Uu};class hh extends ff{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new af(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:n=300,times:r,ease:o,type:i,motionValue:s,name:a,startTime:l}=this.options;if(!s.owner||!s.owner.current)return!1;if("string"==typeof o&&Lc()&&o in fh&&(o=fh[o]),function(e){return Ic(e.type)||"spring"===e.type||!Vc(e.ease)}(this.options)){const{onComplete:t,onUpdate:s,motionValue:a,element:l,...c}=this.options,u=function(e,t){const n=new ch({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<2e4;)r=n.sample(i),o.push(r.value),i+=10;return{times:void 0,keyframes:o,duration:i-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),n=u.duration,r=u.times,o=u.ease,i="keyframes"}const c=function(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=Hc(a,o);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:"reverse"===s?"alternate":"normal"})}(s.owner.current,a,e,{...this.options,duration:n,times:r,ease:o});return c.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(Rc(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;s.set(df(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:n,times:r,type:i,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return ou(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return ou(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=ru(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return iu;const{animation:n}=t;Rc(n,e)}else this.pendingTimeline=e;return iu}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:r,type:o,ease:i,times:s}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,element:l,...c}=this.options,u=new ch({...c,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),d=ru(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;if(!(t&&t.owner&&t.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=t.owner.getProps();return dh()&&n&&uh.has(n)&&!a&&!l&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const ph={type:"spring",stiffness:500,damping:25,restSpeed:10},mh={type:"keyframes",duration:.8},gh={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},vh=(e,{keyframes:t})=>t.length>2?mh:au.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:ph:gh;const bh=(e,t,n,r={},o,i)=>s=>{const a=Tc(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c-=ru(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:e=>{t.set(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(a)||(u={...u,...vh(e,u)}),u.duration&&(u.duration=ru(u.duration)),u.repeatDelay&&(u.repeatDelay=ru(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(d=!0)),(Ru||uu)&&(d=!0,u.duration=0,u.delay=0),d&&!i&&void 0!==t.get()){const e=df(u.keyframes,a);if(void 0!==e)return pu.update((()=>{u.onUpdate(e),u.onComplete()})),new Nc([])}return!i&&hh.supports(u)?new hh(u):new ch(u)};function xh({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function yh(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(s=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const r=e.getValue(t,null!==(i=e.latestValues[t])&&void 0!==i?i:null),o=l[t];if(void 0===o||u&&xh(u,t))continue;const a={delay:n,...Tc(s||{},t)};let d=!1;if(window.MotionHandoffAnimation){const n=Iu(e);if(n){const e=window.MotionHandoffAnimation(n,t,pu);null!==e&&(a.startTime=e,d=!0)}}Tu(e,t),r.start(bh(t,r,o,e.shouldReduceMotion&&lu.has(t)?{type:!1}:a,e,d));const f=r.animation;f&&c.push(f)}return a&&Promise.all(c).then((()=>{pu.update((()=>{a&&function(e,t){const n=Sc(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const t in i)Mu(e,t,cu(i[t]))}(e,a)}))})),c}function wh(e,t,n={}){var r;const o=Sc(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const s=o?()=>Promise.all(yh(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(_h).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(wh(e,t,{...i,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(s)}(e,t,o+r,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[e,t]="beforeChildren"===l?[s,a]:[a,s];return e().then((()=>t()))}return Promise.all([s(),a(n.delay)])}function _h(e,t){return e.sortNodePosition(t)}const Sh=kc.length;function Ch(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&Ch(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<Sh;n++){const r=kc[n],o=e.props[r];(yc(o)||!1===o)&&(t[r]=o)}return t}const kh=[...Cc].reverse(),jh=Cc.length;function Eh(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map((t=>wh(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=wh(e,t,n);else{const o="function"==typeof t?Sc(e,t,n.custom):t;r=Promise.all(yh(e,o,n))}return r.then((()=>{e.notify("AnimationComplete",t)}))}(e,t,n))))}function Mh(e){let t=Eh(e),n=Ph(),r=!0;const o=t=>(n,r)=>{var o;const i=Sc(e,r,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(i){const{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function i(i){const{props:s}=e,a=Ch(e.parent)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;t<jh;t++){const f=kh[t],h=n[f],p=void 0!==s[f]?s[f]:a[f],m=yc(p),g=f===i?h.isActive:null;!1===g&&(d=t);let v=p===a[f]&&p!==s[f]&&m;if(v&&r&&e.manuallyAnimateOnMount&&(v=!1),h.protectedKeys={...u},!h.isActive&&null===g||!p&&!h.prevProp||vc(p)||"boolean"==typeof p)continue;const b=Nh(h.prevProp,p);let x=b||f===i&&h.isActive&&!v&&m||t>d&&m,y=!1;const w=Array.isArray(p)?p:[p];let _=w.reduce(o(f),{});!1===g&&(_={});const{prevResolvedValues:S={}}=h,C={...S,..._},k=t=>{x=!0,c.has(t)&&(y=!0,c.delete(t)),h.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in C){const t=_[e],n=S[e];if(u.hasOwnProperty(e))continue;let r=!1;r=bc(t)&&bc(n)?!xc(t,n):t!==n,r?null!=t?k(e):c.add(e):void 0!==t&&c.has(e)?k(e):h.protectedKeys[e]=!0}h.prevProp=p,h.prevResolvedValues=_,h.isActive&&(u={...u,..._}),r&&e.blockInitialAnimation&&(x=!1);x&&(!(v&&b)||y)&&l.push(...w.map((e=>({animation:e,options:{type:f}}))))}if(c.size){const t={};c.forEach((n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=null!=r?r:null})),l.push({animation:t})}let f=Boolean(l.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(f=!1),r=!1,f?t(l):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){var o;if(n[t].isActive===r)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const s=i(t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=Ph(),r=!0}}}function Nh(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!xc(t,e)}function Th(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ph(){return{animate:Th(!0),whileInView:Th(),whileHover:Th(),whileTap:Th(),whileDrag:Th(),whileFocus:Th(),exit:Th()}}class Dh{constructor(e){this.isMounted=!1,this.node=e}update(){}}let Ih=0;const Rh={animation:{Feature:class extends Dh{constructor(e){super(e),e.animationState||(e.animationState=Mh(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();vc(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends Dh{constructor(){super(...arguments),this.id=Ih++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then((()=>t(this.id)))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}};function Oh(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Ah(e){return{point:{x:e.pageX,y:e.pageY}}}function zh(e,t,n,r){return Oh(e,t,(e=>t=>Xc(t)&&e(t,Ah(t)))(n),r)}const Lh=(e,t)=>Math.abs(e-t);class Fh{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=Wh(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Lh(e.x,t.x),r=Lh(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=gu;this.history.push({...r,timestamp:o});const{onStart:i,onMove:s}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=Bh(t,this.transformPagePoint),pu.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=Wh("pointercancel"===e.type?this.lastMoveEventInfo:Bh(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!Xc(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=Bh(Ah(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=gu;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,Wh(i,this.history)),this.removeListeners=wf(zh(this.contextWindow,"pointermove",this.handlePointerMove),zh(this.contextWindow,"pointerup",this.handlePointerUp),zh(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),mu(this.updatePoint)}}function Bh(e,t){return t?{point:t(e.point)}:e}function Vh(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Wh({point:e},t){return{point:e,delta:Vh(e,Hh(t)),offset:Vh(e,$h(t)),velocity:Uh(t,.1)}}function $h(e){return e[0]}function Hh(e){return e[e.length-1]}function Uh(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Hh(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>ru(t)));)n--;if(!r)return{x:0,y:0};const i=ou(o.timestamp-r.timestamp);if(0===i)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Yh(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Gh(e){return e.max-e.min}function qh(e,t,n,r=.5){e.origin=r,e.originPoint=hf(t.min,t.max,e.origin),e.scale=Gh(n)/Gh(t),e.translate=hf(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function Kh(e,t,n,r){qh(e.x,t.x,n.x,r?r.originX:void 0),qh(e.y,t.y,n.y,r?r.originY:void 0)}function Xh(e,t,n){e.min=n.min+t.min,e.max=e.min+Gh(t)}function Zh(e,t,n){e.min=t.min-n.min,e.max=e.min+Gh(t)}function Qh(e,t,n){Zh(e.x,t.x,n.x),Zh(e.y,t.y,n.y)}function Jh(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function ep(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}const tp=.35;function np(e,t,n){return{min:rp(e,t),max:rp(e,n)}}function rp(e,t){return"number"==typeof e?e:e[t]||0}const op=()=>({x:{min:0,max:0},y:{min:0,max:0}});function ip(e){return[e("x"),e("y")]}function sp({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ap(e){return void 0===e||1===e}function lp({scale:e,scaleX:t,scaleY:n}){return!ap(e)||!ap(t)||!ap(n)}function cp(e){return lp(e)||up(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function up(e){return dp(e.x)||dp(e.y)}function dp(e){return e&&"0%"!==e}function fp(e,t,n){return n+t*(e-n)}function hp(e,t,n,r,o){return void 0!==o&&(e=fp(e,o,r)),fp(e,n,r)+t}function pp(e,t=0,n=1,r,o){e.min=hp(e.min,t,n,r,o),e.max=hp(e.max,t,n,r,o)}function mp(e,{x:t,y:n}){pp(e.x,t.translate,t.scale,t.originPoint),pp(e.y,n.translate,n.scale,n.originPoint)}const gp=.999999999999,vp=1.0000000000001;function bp(e,t){e.min=e.min+t,e.max=e.max+t}function xp(e,t,n,r,o=.5){pp(e,t,n,hf(e.min,e.max,o),r)}function yp(e,t){xp(e.x,t.x,t.scaleX,t.scale,t.originX),xp(e.y,t.y,t.scaleY,t.scale,t.originY)}function wp(e,t){return sp(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const _p=({current:e})=>e?e.ownerDocument.defaultView:null,Sp=new WeakMap;class Cp{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new Fh(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(Ah(e).point)},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:o}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(i=n)||"y"===i?Uc[i]?null:(Uc[i]=!0,()=>{Uc[i]=!1}):Uc.x||Uc.y?null:(Uc.x=Uc.y=!0,()=>{Uc.x=Uc.y=!1}),!this.openDragLock))return;var i;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ip((e=>{let t=this.getAxisMotionValue(e).get()||0;if(ad.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];if(r){t=Gh(r)*(parseFloat(t)/100)}}}this.originPoint[e]=t})),o&&pu.postRender((()=>o(e,t))),Tu(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:s}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(s),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),i&&i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>ip((e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:_p(this.visualElement)})}stop(e,t){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:o}=this.getProps();o&&pu.postRender((()=>o(e,t)))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!kp(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:n},r){return void 0!==t&&e<t?e=r?hf(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?hf(n,e,r.max):Math.min(e,n)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&Yh(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:Jh(e.x,n,o),y:Jh(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=tp){return!1===e?e=0:!0===e&&(e=tp),{x:np(e,"left","right"),y:np(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ip((e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))}))}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Yh(e))return!1;const n=e.current;qd(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=wp(e,n),{scroll:o}=t;return o&&(bp(r.x,o.offset.x),bp(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:ep(e.x,t.x),y:ep(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(i));this.hasMutatedConstraints=!!e,e&&(i=sp(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=ip((s=>{if(!kp(s,t,this.currentDirection))return;let l=a&&a[s]||{};i&&(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,d={type:"inertia",velocity:n?e[s]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(s,d)}));return Promise.all(l).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return Tu(this.visualElement,e),n.start(bh(e,n,0,t,this.visualElement,!1))}stopAnimation(){ip((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){ip((e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()}))}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),r=n[t];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){ip((t=>{const{drag:n}=this.getProps();if(!kp(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[t];o.set(e[t]-hf(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Yh(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ip((e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=Gh(e),o=Gh(t);return o>r?n=Fc(t.min,t.max-r,e.min):r>o&&(n=Fc(e.min,e.max-o,t.min)),Gu(0,1,n)}({min:n,max:n},this.constraints[e])}}));const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),ip((t=>{if(!kp(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(hf(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;Sp.set(this.visualElement,this);const e=zh(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();Yh(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),pu.read(t);const o=Oh(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(ip((t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))})),this.visualElement.render())}));return()=>{o(),e(),r(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=tp,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function kp(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const jp=e=>(t,n)=>{e&&pu.postRender((()=>e(t,n)))};const Ep=(0,$.createContext)({}),Mp={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Np(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Tp={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!ld.test(e))return e;e=parseFloat(e)}return`${Np(e,t.target.x)}% ${Np(e,t.target.y)}%`}},Pp={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=_d.parse(e);if(o.length>5)return r;const i=_d.createTransformer(e),s="number"!=typeof o[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=hf(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),i(o)}},Dp={};const{schedule:Ip,cancel:Rp}=hu(queueMicrotask,!1);class Op extends $.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var i;i=zp,Object.assign(Dp,i),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Mp.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||pu.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Ip.postRender((()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Ap(e){const[t,n]=uc(),r=(0,$.useContext)(nc);return(0,kt.jsx)(Op,{...e,layoutGroup:r,switchLayoutGroup:(0,$.useContext)(Ep),isPresent:t,safeToRemove:n})}const zp={borderRadius:{...Tp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Tp,borderTopRightRadius:Tp,borderBottomLeftRadius:Tp,borderBottomRightRadius:Tp,boxShadow:Pp};const Lp=(e,t)=>e.depth-t.depth;class Fp{constructor(){this.children=[],this.isDirty=!1}add(e){wu(this.children,e),this.isDirty=!0}remove(e){_u(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Lp),this.isDirty=!1,this.children.forEach(e)}}function Bp(e,t){const n=yu.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(mu(r),e(i-t))};return pu.read(r,!0),()=>mu(r)}function Vp(e){const t=Nu(e)?e.get():e;return(e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}const Wp=["TopLeft","TopRight","BottomLeft","BottomRight"],$p=Wp.length,Hp=e=>"string"==typeof e?parseFloat(e):e,Up=e=>"number"==typeof e||ld.test(e);function Yp(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Gp=Kp(0,.5,Hu),qp=Kp(.5,.95,iu);function Kp(e,t,n){return r=>r<e?0:r>t?1:n(Fc(e,t,r))}function Xp(e,t){e.min=t.min,e.max=t.max}function Zp(e,t){Xp(e.x,t.x),Xp(e.y,t.y)}function Qp(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Jp(e,t,n,r,o){return e=fp(e-=t,1/n,r),void 0!==o&&(e=fp(e,1/o,r)),e}function em(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){ad.test(t)&&(t=parseFloat(t),t=hf(s.min,s.max,t/100)-s.min);if("number"!=typeof t)return;let a=hf(i.min,i.max,r);e===i&&(a-=t),e.min=Jp(e.min,t,n,a,o),e.max=Jp(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const tm=["x","scaleX","originX"],nm=["y","scaleY","originY"];function rm(e,t,n,r){em(e.x,t,tm,n?n.x:void 0,r?r.x:void 0),em(e.y,t,nm,n?n.y:void 0,r?r.y:void 0)}function om(e){return 0===e.translate&&1===e.scale}function im(e){return om(e.x)&&om(e.y)}function sm(e,t){return e.min===t.min&&e.max===t.max}function am(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function lm(e,t){return am(e.x,t.x)&&am(e.y,t.y)}function cm(e){return Gh(e.x)/Gh(e.y)}function um(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class dm{constructor(){this.members=[]}add(e){wu(this.members,e),e.scheduleRender()}remove(e){if(_u(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex((t=>e===t));if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach((e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((e=>{e.instance&&e.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const fm={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},hm="undefined"!=typeof window&&void 0!==window.MotionDebug,pm=["","X","Y","Z"],mm={visibility:"hidden"};let gm=0;function vm(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function bm(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Iu(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",pu,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&bm(r)}function xm({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=gm++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,hm&&(fm.totalNodes=fm.resolvedTargetDeltas=fm.recalculatedProjection=0),this.nodes.forEach(_m),this.nodes.forEach(Nm),this.nodes.forEach(Tm),this.nodes.forEach(Sm),hm&&window.MotionDebug.record(fm)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Fp)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Su),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,n=this.root.hasTreeAnimated){if(this.instance)return;var r;this.isSVG=(r=t)instanceof SVGElement&&"svg"!==r.tagName,this.instance=t;const{layoutId:o,layout:i,visualElement:s}=this.options;if(s&&!s.current&&s.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(i||o)&&(this.isLayoutDirty=!0),e){let n;const r=()=>this.root.updateBlockedByResize=!1;e(t,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=Bp(r,250),Mp.hasAnimatedSinceResize&&(Mp.hasAnimatedSinceResize=!1,this.nodes.forEach(Mm))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&s&&(o||i)&&this.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||Am,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!lm(this.targetLayout,r)||n,c=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...Tc(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||Mm(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,mu(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Pm),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&bm(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){const t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}const{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(km);this.isUpdating||this.nodes.forEach(jm),this.isUpdating=!1,this.nodes.forEach(Em),this.nodes.forEach(ym),this.nodes.forEach(wm),this.clearAllSnapshots();const e=yu.now();gu.delta=Gu(0,1e3/60,e-gu.timestamp),gu.timestamp=e,gu.isProcessing=!0,vu.update.process(gu),vu.preRender.process(gu),vu.render.process(gu),gu.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ip.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Cm),this.sharedNodes.forEach(Dm)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,pu.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){pu.postRender((()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++){this.path[e].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){const t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!im(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,i=r!==this.prevTransformTemplateValue;e&&(t||cp(this.latestValues)||i)&&(o(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let n=this.removeElementScroll(t);var r;return e&&(n=this.removeTransform(n)),Fm((r=n).x),Fm(r.y),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var e;const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const n=t.measureViewportBox();if(!((null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)||this.path.some(Vm))){const{scroll:e}=this.root;e&&(bp(n.x,e.offset.x),bp(n.y,e.offset.y))}return n}removeElementScroll(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};if(Zp(n,e),null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)return n;for(let t=0;t<this.path.length;t++){const r=this.path[t],{scroll:o,options:i}=r;r!==this.root&&o&&i.layoutScroll&&(o.wasRoot&&Zp(n,e),bp(n.x,o.offset.x),bp(n.y,o.offset.y))}return n}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Zp(n,e);for(let e=0;e<this.path.length;e++){const r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&yp(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),cp(r.latestValues)&&yp(n,r.latestValues)}return cp(this.latestValues)&&yp(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};Zp(t,e);for(let e=0;e<this.path.length;e++){const n=this.path[e];if(!n.instance)continue;if(!cp(n.latestValues))continue;lp(n.latestValues)&&n.updateSnapshot();const r={x:{min:0,max:0},y:{min:0,max:0}};Zp(r,n.measurePageBox()),rm(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return cp(this.latestValues)&&rm(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==gu.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const r=Boolean(this.resumingFrom)||this!==n;if(!(e||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:o,layoutId:i}=this.options;if(this.layout&&(o||i)){if(this.resolvedRelativeTargetAt=gu.timestamp,!this.targetDelta&&!this.relativeTarget){const e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Qh(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),Zp(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var s,a,l;if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),s=this.target,a=this.relativeTarget,l=this.relativeParent.target,Xh(s.x,a.x,l.x),Xh(s.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Zp(this.target,this.layout.layoutBox),mp(this.target,this.targetDelta)):Zp(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const e=this.getClosestProjectingParent();e&&Boolean(e.resumingFrom)===Boolean(this.resumingFrom)&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Qh(this.relativeTargetOrigin,this.target,e.target),Zp(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}hm&&fm.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!lp(this.parent.latestValues)&&!up(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var e;const t=this.getLead(),n=Boolean(this.resumingFrom)||this!==t;let r=!0;if((this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty))&&(r=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===gu.timestamp&&(r=!1),r)return;const{layout:o,layoutId:i}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!i)return;Zp(this.layoutCorrected,this.layout.layoutBox);const s=this.treeScale.x,a=this.treeScale.y;!function(e,t,n,r=!1){const o=n.length;if(!o)return;let i,s;t.x=t.y=1;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const{visualElement:o}=i.options;o&&o.props.style&&"contents"===o.props.style.display||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&yp(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,mp(e,s)),r&&cp(i.latestValues)&&yp(e,i.latestValues))}t.x<vp&&t.x>gp&&(t.x=1),t.y<vp&&t.y>gp&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(Qp(this.prevProjectionDelta.x,this.projectionDelta.x),Qp(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Kh(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&um(this.projectionDelta.x,this.prevProjectionDelta.x)&&um(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),hm&&fm.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(Om));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;Im(i.x,e.x,n),Im(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qh(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,n,r){Rm(e.x,t.x,n.x,r),Rm(e.y,t.y,n.y,r)}(this.relativeTarget,this.relativeTargetOrigin,s,n),d&&function(e,t){return sm(e.x,t.x)&&sm(e.y,t.y)}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Zp(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=hf(0,void 0!==n.opacity?n.opacity:1,Gp(r)),e.opacityExit=hf(void 0!==t.opacity?t.opacity:1,0,qp(r))):i&&(e.opacity=hf(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o<$p;o++){const i=`border${Wp[o]}Radius`;let s=Yp(t,i),a=Yp(n,i);void 0===s&&void 0===a||(s||(s=0),a||(a=0),0===s||0===a||Up(s)===Up(a)?(e[i]=Math.max(hf(Hp(s),Hp(a),r),0),(ad.test(a)||ad.test(s))&&(e[i]+="%")):e[i]=a)}(t.rotate||n.rotate)&&(e.rotate=hf(t.rotate||0,n.rotate||0,r))}(o,r,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(mu(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pu.update((()=>{Mp.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=Nu(e)?e:Eu(e);return r.start(bh("",r,t,n)),r.animation}(0,1e3,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0}))}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&Bm(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=Gh(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Gh(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Zp(t,n),yp(t,o),Kh(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new dm);this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&vm("z",e,r,this.animationValues);for(let t=0;t<pm.length;t++)vm(`rotate${pm[t]}`,e,r,this.animationValues),vm(`skew${pm[t]}`,e,r,this.animationValues);e.render();for(const t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}getProjectionStyles(e){var t,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return mm;const r={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=Vp(null==e?void 0:e.pointerEvents)||"",r.transform=o?o(this.latestValues,""):"none",r;const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Vp(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!cp(this.latestValues)&&(t.transform=o?o({},""):"none",this.hasProjected=!1),t}const s=i.animationValues||i.latestValues;this.applyTransformsToTarget(),r.transform=function(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=(null==n?void 0:n.z)||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),1===t.x&&1===t.y||(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:e,rotate:t,rotateX:o,rotateY:i,skewX:s,skewY:a}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),o&&(r+=`rotateX(${o}deg) `),i&&(r+=`rotateY(${i}deg) `),s&&(r+=`skewX(${s}deg) `),a&&(r+=`skewY(${a}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return 1===a&&1===l||(r+=`scale(${a}, ${l})`),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,s),o&&(r.transform=o(s,r.transform));const{x:a,y:l}=this.projectionDelta;r.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,i.animationValues?r.opacity=i===this?null!==(n=null!==(t=s.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:r.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in Dp){if(void 0===s[e])continue;const{correct:t,applyTo:n}=Dp[e],o="none"===r.transform?s[e]:t(s[e],i);if(n){const e=n.length;for(let t=0;t<e;t++)r[n[t]]=o}else r[e]=o}return this.options.layoutId&&(r.pointerEvents=i===this?Vp(null==e?void 0:e.pointerEvents)||"":"none"),r}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach((e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()})),this.root.nodes.forEach(km),this.root.sharedNodes.clear()}}}function ym(e){e.updateLayout()}function wm(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,i=n.source!==e.layout.source;"size"===o?ip((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=Gh(r);r.min=t[e].min,r.max=r.min+o})):Bm(o,n.layoutBox,t)&&ip((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=Gh(t[r]);o.max=o.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+s)}));const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Kh(s,t,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};i?Kh(a,e.applyTransform(r,!0),n.measuredBox):Kh(a,t,n.layoutBox);const l=!im(s);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:i}=r;if(o&&i){const s={x:{min:0,max:0},y:{min:0,max:0}};Qh(s,n.layoutBox,o.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Qh(a,t,i.layoutBox),lm(s,a)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function _m(e){hm&&fm.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Sm(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Cm(e){e.clearSnapshot()}function km(e){e.clearMeasurements()}function jm(e){e.isLayoutDirty=!1}function Em(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Mm(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Nm(e){e.resolveTargetDelta()}function Tm(e){e.calcProjection()}function Pm(e){e.resetSkewAndRotation()}function Dm(e){e.removeLeadSnapshot()}function Im(e,t,n){e.translate=hf(t.translate,0,n),e.scale=hf(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Rm(e,t,n,r){e.min=hf(t.min,n.min,r),e.max=hf(t.max,n.max,r)}function Om(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const Am={duration:.45,ease:[.4,0,.1,1]},zm=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Lm=zm("applewebkit/")&&!zm("chrome/")?Math.round:iu;function Fm(e){e.min=Lm(e.min),e.max=Lm(e.max)}function Bm(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=cm(t),o=cm(n),i=.2,!(Math.abs(r-o)<=i));var r,o,i}function Vm(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const Wm=xm({attachResizeListener:(e,t)=>Oh(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),$m={current:void 0},Hm=xm({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!$m.current){const e=new Wm({});e.mount(window),e.setOptions({layoutScroll:!0}),$m.current=e}return $m.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),Um={pan:{Feature:class extends Dh{constructor(){super(...arguments),this.removePointerDownListener=iu}onPointerDown(e){this.session=new Fh(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:_p(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:jp(e),onStart:jp(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&pu.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=zh(this.node.current,"pointerdown",(e=>this.onPointerDown(e)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Dh{constructor(e){super(e),this.removeGroupControls=iu,this.removeListeners=iu,this.controls=new Cp(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||iu}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Hm,MeasureLayout:Ap}};function Ym(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const o=r["onHover"+n];o&&pu.postRender((()=>o(t,Ah(t))))}function Gm(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===n);const o=r["onTap"+("End"===n?"":n)];o&&pu.postRender((()=>o(t,Ah(t))))}const qm=new WeakMap,Km=new WeakMap,Xm=e=>{const t=qm.get(e.target);t&&t(e)},Zm=e=>{e.forEach(Xm)};function Qm(e,t,n){const r=function({root:e,...t}){const n=e||document;Km.has(n)||Km.set(n,{});const r=Km.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Zm,{root:e,...t})),r[o]}(t);return qm.set(e,n),r.observe(e),()=>{qm.delete(e),r.unobserve(e)}}const Jm={some:0,all:1};const eg={inView:{Feature:class extends Dh{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e,i={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Jm[r]};return Qm(this.node.current,i,(e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=t?n:r;i&&i(e)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Dh{mount(){const{current:e}=this.node;e&&(this.unmount=nu(e,(e=>(Gm(this.node,e,"Start"),(e,{success:t})=>Gm(this.node,e,t?"End":"Cancel"))),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Dh{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=wf(Oh(this.node.current,"focus",(()=>this.onFocus())),Oh(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends Dh{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[r,o,i]=Gc(e,n),s=qc((e=>{const{target:n}=e,r=t(e);if("function"!=typeof r||!n)return;const i=qc((e=>{r(e),n.removeEventListener("pointerleave",i)}));n.addEventListener("pointerleave",i,o)}));return r.forEach((e=>{e.addEventListener("pointerenter",s,o)})),i}(e,(e=>(Ym(this.node,e,"Start"),e=>Ym(this.node,e,"End")))))}unmount(){}}}},tg={layout:{ProjectionNode:Hm,MeasureLayout:Ap}},ng=(0,$.createContext)({strict:!1}),rg=(0,$.createContext)({});function og(e){return vc(e.animate)||kc.some((t=>yc(e[t])))}function ig(e){return Boolean(og(e)||e.variants)}function sg(e){const{initial:t,animate:n}=function(e,t){if(og(e)){const{initial:t,animate:n}=e;return{initial:!1===t||yc(t)?t:void 0,animate:yc(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,$.useContext)(rg));return(0,$.useMemo)((()=>({initial:t,animate:n})),[ag(t),ag(n)])}function ag(e){return Array.isArray(e)?e.join(" "):e}const lg={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},cg={};for(const e in lg)cg[e]={isEnabled:t=>lg[e].some((e=>!!t[e]))};const ug=Symbol.for("motionComponentSymbol");function dg(e,t,n){return(0,$.useCallback)((r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):Yh(n)&&(n.current=r))}),[t])}function fg(e,t,n,r,o){var i,s;const{visualElement:a}=(0,$.useContext)(rg),l=(0,$.useContext)(ng),c=(0,$.useContext)(oc),u=(0,$.useContext)(ic).reducedMotion,d=(0,$.useRef)(null);r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:u}));const f=d.current,h=(0,$.useContext)(Ep);!f||f.projection||!o||"html"!==f.type&&"svg"!==f.type||function(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:hg(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:Boolean(s)||a&&Yh(a),visualElement:e,animationType:"string"==typeof i?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(d.current,n,o,h);const p=(0,$.useRef)(!1);(0,$.useInsertionEffect)((()=>{f&&p.current&&f.update(n,c)}));const m=n[Du],g=(0,$.useRef)(Boolean(m)&&!(null===(i=window.MotionHandoffIsComplete)||void 0===i?void 0:i.call(window,m))&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,m)));return pc((()=>{f&&(p.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Ip.render(f.render),g.current&&f.animationState&&f.animationState.animateChanges())})),(0,$.useEffect)((()=>{f&&(!g.current&&f.animationState&&f.animationState.animateChanges(),g.current&&(queueMicrotask((()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,m)})),g.current=!1))})),f}function hg(e){if(e)return!1!==e.options.allowProjection?e.projection:hg(e.parent)}function pg({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){var i,s;function a(e,i){let s;const a={...(0,$.useContext)(ic),...e,layoutId:mg(e)},{isStatic:l}=a,c=sg(e),u=r(e,l);if(!l&&hc){!function(){(0,$.useContext)(ng).strict;0}();const e=function(e){const{drag:t,layout:n}=cg;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(a);s=e.MeasureLayout,c.visualElement=fg(o,u,a,t,e.ProjectionNode)}return(0,kt.jsxs)(rg.Provider,{value:c,children:[s&&c.visualElement?(0,kt.jsx)(s,{visualElement:c.visualElement,...a}):null,n(o,e,dg(u,c.visualElement,i),u,l,c.visualElement)]})}e&&function(e){for(const t in e)cg[t]={...cg[t],...e[t]}}(e),a.displayName=`motion.${"string"==typeof o?o:`create(${null!==(s=null!==(i=o.displayName)&&void 0!==i?i:o.name)&&void 0!==s?s:""})`}`;const l=(0,$.forwardRef)(a);return l[ug]=o,l}function mg({layoutId:e}){const t=(0,$.useContext)(nc).id;return t&&void 0!==e?t+"-"+e:e}const gg=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function vg(e){return"string"==typeof e&&!e.includes("-")&&!!(gg.indexOf(e)>-1||/[A-Z]/u.test(e))}const bg=e=>(t,n)=>{const r=(0,$.useContext)(rg),o=(0,$.useContext)(oc),i=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,i){const s={latestValues:xg(r,o,i,e),renderState:t()};return n&&(s.onMount=e=>n({props:r,current:e,...s}),s.onUpdate=e=>n(e)),s}(e,t,r,o);return n?i():rc(i)};function xg(e,t,n,r){const o={},i=r(e,{});for(const e in i)o[e]=Vp(i[e]);let{initial:s,animate:a}=e;const l=og(e),c=ig(e);t&&c&&!l&&!1!==e.inherit&&(void 0===s&&(s=t.initial),void 0===a&&(a=t.animate));let u=!!n&&!1===n.initial;u=u||!1===s;const d=u?a:s;if(d&&"boolean"!=typeof d&&!vc(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=_c(e,t[n]);if(r){const{transitionEnd:e,transition:t,...n}=r;for(const e in n){let t=n[e];if(Array.isArray(t)){t=t[u?t.length-1:0]}null!==t&&(o[e]=t)}for(const t in e)o[t]=e[t]}}}return o}const yg=(e,t)=>t&&"number"==typeof e?t.transform(e):e,wg={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_g=su.length;function Sg(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const e in t){const n=t[e];if(au.has(e))s=!0;else if(Zd(e))o[e]=n;else{const t=yg(n,Td[e]);e.startsWith("origin")?(a=!0,i[e]=t):r[e]=t}}if(t.transform||(s||n?r.transform=function(e,t,n){let r="",o=!0;for(let i=0;i<_g;i++){const s=su[i],a=e[s];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(s.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const e=yg(a,Td[s]);l||(o=!1,r+=`${wg[s]||s}(${e}) `),n&&(t[s]=e)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:e="50%",originY:t="50%",originZ:n=0}=i;r.transformOrigin=`${e} ${t} ${n}`}}const Cg={offset:"stroke-dashoffset",array:"stroke-dasharray"},kg={offset:"strokeDashoffset",array:"strokeDasharray"};function jg(e,t,n){return"string"==typeof e?e:ld.transform(t+n*e)}function Eg(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(Sg(e,c,d),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:f,style:h,dimensions:p}=e;f.transform&&(p&&(h.transform=f.transform),delete f.transform),p&&(void 0!==o||void 0!==i||h.transform)&&(h.transformOrigin=function(e,t,n){return`${jg(t,e.x,e.width)} ${jg(n,e.y,e.height)}`}(p,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==t&&(f.x=t),void 0!==n&&(f.y=n),void 0!==r&&(f.scale=r),void 0!==s&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?Cg:kg;e[i.offset]=ld.transform(-r);const s=ld.transform(t),a=ld.transform(n);e[i.array]=`${s} ${a}`}(f,s,a,l,!1)}const Mg=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Ng=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Tg=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Pg(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const Dg=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ig(e,t,n,r){Pg(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(Dg.has(n)?n:Pu(n),t.attrs[n])}function Rg(e,{layout:t,layoutId:n}){return au.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Dp[e]||"opacity"===e)}function Og(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(Nu(o[s])||t.style&&Nu(t.style[s])||Rg(s,e)||void 0!==(null===(r=null==n?void 0:n.getValue(s))||void 0===r?void 0:r.liveStyle))&&(i[s]=o[s]);return i}function Ag(e,t,n){const r=Og(e,t,n);for(const n in e)if(Nu(e[n])||Nu(t[n])){r[-1!==su.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]}return r}const zg=["x","y","width","height","cx","cy","r"],Lg={useVisualState:bg({scrapeMotionValuesFromProps:Ag,createRenderState:Ng,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:o})=>{if(!n)return;let i=!!e.drag;if(!i)for(const e in o)if(au.has(e)){i=!0;break}if(!i)return;let s=!t;if(t)for(let n=0;n<zg.length;n++){const r=zg[n];e[r]!==t[r]&&(s=!0)}s&&pu.read((()=>{!function(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(e){t.dimensions={x:0,y:0,width:0,height:0}}}(n,r),pu.render((()=>{Eg(r,o,Tg(n.tagName),e.transformTemplate),Ig(n,r)}))}))}})},Fg={useVisualState:bg({scrapeMotionValuesFromProps:Og,createRenderState:Mg})};function Bg(e,t,n){for(const r in t)Nu(t[r])||Rg(r,n)||(e[r]=t[r])}function Vg(e,t){const n={};return Bg(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,$.useMemo)((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Sg(n,t,e),Object.assign({},n.vars,n.style)}),[t])}(e,t)),n}function Wg(e,t){const n={},r=Vg(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const $g=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Hg(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||$g.has(e)}let Ug=e=>!Hg(e);try{(Yg=require("@emotion/is-prop-valid").default)&&(Ug=e=>e.startsWith("on")?!Hg(e):Yg(e))}catch(q){}var Yg;function Gg(e,t,n,r){const o=(0,$.useMemo)((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Eg(n,t,Tg(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};Bg(t,e.style,e),o.style={...t,...o.style}}return o}function qg(e=!1){return(t,n,r,{latestValues:o},i)=>{const s=(vg(t)?Gg:Wg)(n,o,i,t),a=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(Ug(o)||!0===n&&Hg(o)||!t&&!Hg(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),l=t!==$.Fragment?{...a,...s,ref:r}:{},{children:c}=n,u=(0,$.useMemo)((()=>Nu(c)?c.get():c),[c]);return(0,$.createElement)(t,{...l,children:u})}}function Kg(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return pg({...vg(n)?Lg:Fg,preloadedFeatures:e,useRender:qg(r),createVisualElement:t,Component:n})}}const Xg={current:null},Zg={current:!1};const Qg=[...of,hd,_d],Jg=new WeakMap;const ev=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class tv{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Yd,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=yu.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,pu.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:c}=i;this.onUpdate=c,this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=s,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=og(t),this.isVariantNode=ig(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in d){const t=d[e];void 0!==a[e]&&Nu(t)&&t.set(a[e],!1)}}mount(e){this.current=e,Jg.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((e,t)=>this.bindToMotionValue(t,e))),Zg.current||function(){if(Zg.current=!0,hc)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Xg.current=e.matches;e.addListener(t),t()}else Xg.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Xg.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Jg.delete(this.current),this.projection&&this.projection.unmount(),mu(this.notifyUpdate),mu(this.render),this.valueSubscriptions.forEach((e=>e())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=au.has(e),r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&pu.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,(()=>{r(),o(),i&&i(),t.owner&&t.stop()}))}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in cg){const t=cg[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<ev.length;t++){const n=ev[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=e["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(e,t,n){for(const r in t){const o=t[r],i=n[r];if(Nu(o))e.addValue(r,o);else if(Nu(i))e.addValue(r,Eu(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const t=e.getValue(r);!0===t.liveStyle?t.jump(o):t.hasAnimated||t.set(o)}else{const t=e.getStaticValue(r);e.addValue(r,Eu(void 0!==t?t:o,{owner:e}))}}for(const r in n)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Eu(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=r&&("string"==typeof r&&(Kd(r)||Yu(r))?r=parseFloat(r):!(e=>Qg.find(rf(e)))(r)&&_d.test(t)&&(r=Id(e,t)),this.setBaseTarget(e,Nu(r)?r.get():r)),Nu(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=_c(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||Nu(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new Su),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class nv extends tv{constructor(){super(...arguments),this.KeyframeResolver=af}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Nu(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}}class rv extends nv{constructor(){super(...arguments),this.type="html",this.renderInstance=Pg}readValueFromInstance(e,t){if(au.has(t)){const e=Dd(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),o=(Zd(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return wp(e,t)}build(e,t,n){Sg(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Og(e,t,n)}}class ov extends nv{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=op}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(au.has(t)){const e=Dd(t);return e&&e.default||0}return t=Dg.has(t)?t:Pu(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Ag(e,t,n)}build(e,t,n){Eg(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){Ig(e,t,0,r)}mount(e){this.isSVGTag=Tg(e.tagName),super.mount(e)}}const iv=(e,t)=>vg(e)?new ov(t):new rv(t,{allowProjection:e!==$.Fragment}),sv=gc(Kg({...Rh,...eg,...Um,...tg},iv)),av=["40em","52em","64em"],lv=(e={})=>{const{defaultIndex:t=0}=e;if("number"!=typeof t)throw new TypeError(`Default breakpoint index should be a number. Got: ${t}, ${typeof t}`);if(t<0||t>av.length-1)throw new RangeError(`Default breakpoint index out of range. Theme has ${av.length} breakpoints, got index ${t}`);const[n,r]=(0,f.useState)(t);return(0,f.useEffect)((()=>{const e=()=>{const e=av.filter((e=>"undefined"!=typeof window&&window.matchMedia(`screen and (min-width: ${e})`).matches)).length;n!==e&&r(e)};return e(),"undefined"!=typeof window&&window.addEventListener("resize",e),()=>{"undefined"!=typeof window&&window.removeEventListener("resize",e)}}),[n]),n};function cv(e,t={}){const n=lv(t);if(!Array.isArray(e)&&"function"!=typeof e)return e;const r=e||[];return r[n>=r.length?r.length-1:n]}const uv={name:"zjik7",styles:"display:flex"},dv={name:"qgaee5",styles:"display:block;max-height:100%;max-width:100%;min-height:0;min-width:0"},fv={name:"82a6rk",styles:"flex:1"},hv={name:"13nosa1",styles:">*{min-height:0;}"},pv={name:"1pwxzk4",styles:">*{min-width:0;}"};function mv(e){const{align:t,className:n,direction:r="row",expanded:o=!0,gap:i=2,justify:s="space-between",wrap:a=!1,...l}=cl(function(e){const{isReversed:t,...n}=e;return void 0!==t?(Ji()("Flex isReversed",{alternative:'Flex direction="row-reverse" or "column-reverse"',since:"5.9"}),{...n,direction:t?"row-reverse":"row"}):n}(e),"Flex"),c=cv(Array.isArray(r)?r:[r]),u="string"==typeof c&&!!c.includes("column"),d=ll();return{...l,className:(0,f.useMemo)((()=>{const e=Dl({alignItems:null!=t?t:u?"normal":"center",flexDirection:c,flexWrap:a?"wrap":void 0,gap:Rl(i),justifyContent:s,height:u&&o?"100%":void 0,width:!u&&o?"100%":void 0},"","");return d(uv,e,u?hv:pv,n)}),[t,n,d,c,o,i,u,s,a]),isColumn:u}}const gv=(0,f.createContext)({flexItemDisplay:void 0});var vv=ul((function(e,t){const{children:n,isColumn:r,...o}=mv(e);return(0,kt.jsx)(gv.Provider,{value:{flexItemDisplay:r?"block":void 0},children:(0,kt.jsx)(kl,{...o,ref:t,children:n})})}),"Flex");function bv(e){const{className:t,display:n,isBlock:r=!1,...o}=cl(e,"FlexItem"),i={},s=(0,f.useContext)(gv).flexItemDisplay;i.Base=Dl({display:n||s},"","");return{...o,className:ll()(dv,i.Base,r&&fv,t)}}var xv=ul((function(e,t){const n=function(e){return bv({isBlock:!0,...cl(e,"FlexBlock")})}(e);return(0,kt.jsx)(kl,{...n,ref:t})}),"FlexBlock");const yv=new RegExp(/-left/g),wv=new RegExp(/-right/g),_v=new RegExp(/Left/g),Sv=new RegExp(/Right/g);function Cv(e){return"left"===e?"right":"right"===e?"left":yv.test(e)?e.replace(yv,"-right"):wv.test(e)?e.replace(wv,"-left"):_v.test(e)?e.replace(_v,"Right"):Sv.test(e)?e.replace(Sv,"Left"):e}function kv(e={},t){return()=>t?(0,u.isRTL)()?Dl(t,"",""):Dl(e,"",""):(0,u.isRTL)()?Dl(((e={})=>Object.fromEntries(Object.entries(e).map((([e,t])=>[Cv(e),t]))))(e),"",""):Dl(e,"","")}function jv(e){return null!=e}kv.watch=()=>(0,u.isRTL)();const Ev=ul((function(e,t){const n=function(e){const{className:t,margin:n,marginBottom:r=2,marginLeft:o,marginRight:i,marginTop:s,marginX:a,marginY:l,padding:c,paddingBottom:u,paddingLeft:d,paddingRight:f,paddingTop:h,paddingX:p,paddingY:m,...g}=cl(e,"Spacer");return{...g,className:ll()(jv(n)&&Dl("margin:",Rl(n),";",""),jv(l)&&Dl("margin-bottom:",Rl(l),";margin-top:",Rl(l),";",""),jv(a)&&Dl("margin-left:",Rl(a),";margin-right:",Rl(a),";",""),jv(s)&&Dl("margin-top:",Rl(s),";",""),jv(r)&&Dl("margin-bottom:",Rl(r),";",""),jv(o)&&kv({marginLeft:Rl(o)})(),jv(i)&&kv({marginRight:Rl(i)})(),jv(c)&&Dl("padding:",Rl(c),";",""),jv(m)&&Dl("padding-bottom:",Rl(m),";padding-top:",Rl(m),";",""),jv(p)&&Dl("padding-left:",Rl(p),";padding-right:",Rl(p),";",""),jv(h)&&Dl("padding-top:",Rl(h),";",""),jv(u)&&Dl("padding-bottom:",Rl(u),";",""),jv(d)&&kv({paddingLeft:Rl(d)})(),jv(f)&&kv({paddingRight:Rl(f)})(),t)}}(e);return(0,kt.jsx)(kl,{...n,ref:t})}),"Spacer");var Mv=Ev,Nv=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),Tv=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"M7 11.5h10V13H7z"})});var Pv=ul((function(e,t){const n=bv(e);return(0,kt.jsx)(kl,{...n,ref:t})}),"FlexItem");const Dv={name:"hdknak",styles:"display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"};function Iv(e){return null!=e}const Rv=e=>"string"==typeof e?(e=>parseFloat(e))(e):e,Ov="…",Av={auto:"auto",head:"head",middle:"middle",tail:"tail",none:"none"},zv={ellipsis:Ov,ellipsizeMode:Av.auto,limit:0,numberOfLines:0};function Lv(e="",t){const n={...zv,...t},{ellipsis:r,ellipsizeMode:o,limit:i}=n;if(o===Av.none)return e;let s,a;switch(o){case Av.head:s=0,a=i;break;case Av.middle:s=Math.floor(i/2),a=Math.floor(i/2);break;default:s=i,a=0}const l=o!==Av.auto?function(e,t,n,r){if("string"!=typeof e)return"";const o=e.length,i=~~t,s=~~n,a=Iv(r)?r:Ov;return 0===i&&0===s||i>=o||s>=o||i+s>=o?e:0===s?e.slice(0,i)+a:e.slice(0,i)+a+e.slice(o-s)}(e,s,a,r):e;return l}function Fv(e){const{className:t,children:n,ellipsis:r=Ov,ellipsizeMode:o=Av.auto,limit:i=0,numberOfLines:s=0,...a}=cl(e,"Truncate"),l=ll();let c;"string"==typeof n?c=n:"number"==typeof n&&(c=n.toString());const u=c?Lv(c,{ellipsis:r,ellipsizeMode:o,limit:i,numberOfLines:s}):n,d=!!c&&o===Av.auto;return{...a,className:(0,f.useMemo)((()=>l(d&&!s&&Dv,d&&!!s&&Dl(1===s?"word-break: break-all;":""," -webkit-box-orient:vertical;-webkit-line-clamp:",s,";display:-webkit-box;overflow:hidden;",""),t)),[t,l,s,d]),children:u}}var Bv={grad:.9,turn:360,rad:360/(2*Math.PI)},Vv=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Wv=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},$v=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Hv=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Uv=function(e){return{r:$v(e.r,0,255),g:$v(e.g,0,255),b:$v(e.b,0,255),a:$v(e.a)}},Yv=function(e){return{r:Wv(e.r),g:Wv(e.g),b:Wv(e.b),a:Wv(e.a,3)}},Gv=/^#([0-9a-f]{3,8})$/i,qv=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Kv=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),s=i-Math.min(t,n,r),a=s?i===t?(n-r)/s:i===n?2+(r-t)/s:4+(t-n)/s:0;return{h:60*(a<0?a+6:a),s:i?s/i*100:0,v:i/255*100,a:o}},Xv=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),s=r*(1-n),a=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:255*[r,a,s,s,l,r][c],g:255*[l,r,r,a,s,s][c],b:255*[s,s,l,r,r,a][c],a:o}},Zv=function(e){return{h:Hv(e.h),s:$v(e.s,0,100),l:$v(e.l,0,100),a:$v(e.a)}},Qv=function(e){return{h:Wv(e.h),s:Wv(e.s),l:Wv(e.l),a:Wv(e.a,3)}},Jv=function(e){return Xv((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},eb=function(e){return{h:(t=Kv(e)).h,s:(o=(200-(n=t.s))*(r=t.v)/100)>0&&o<200?n*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,n,r,o},tb=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,nb=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rb=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ob=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ib={string:[[function(e){var t=Gv.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?Wv(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?Wv(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=rb.exec(e)||ob.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Uv({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=tb.exec(e)||nb.exec(e);if(!t)return null;var n,r,o=Zv({h:(n=t[1],r=t[2],void 0===r&&(r="deg"),Number(n)*(Bv[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Jv(o)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=void 0===o?1:o;return Vv(t)&&Vv(n)&&Vv(r)?Uv({r:Number(t),g:Number(n),b:Number(r),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,o=e.a,i=void 0===o?1:o;if(!Vv(t)||!Vv(n)||!Vv(r))return null;var s=Zv({h:Number(t),s:Number(n),l:Number(r),a:Number(i)});return Jv(s)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,o=e.a,i=void 0===o?1:o;if(!Vv(t)||!Vv(n)||!Vv(r))return null;var s=function(e){return{h:Hv(e.h),s:$v(e.s,0,100),v:$v(e.v,0,100),a:$v(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(i)});return Xv(s)},"hsv"]]},sb=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0](e);if(r)return[r,t[n][1]]}return[null,void 0]},ab=function(e){return"string"==typeof e?sb(e.trim(),ib.string):"object"==typeof e&&null!==e?sb(e,ib.object):[null,void 0]},lb=function(e,t){var n=eb(e);return{h:n.h,s:$v(n.s+100*t,0,100),l:n.l,a:n.a}},cb=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},ub=function(e,t){var n=eb(e);return{h:n.h,s:n.s,l:$v(n.l+100*t,0,100),a:n.a}},db=function(){function e(e){this.parsed=ab(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return Wv(cb(this.rgba),2)},e.prototype.isDark=function(){return cb(this.rgba)<.5},e.prototype.isLight=function(){return cb(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=Yv(this.rgba)).r,n=e.g,r=e.b,i=(o=e.a)<1?qv(Wv(255*o)):"","#"+qv(t)+qv(n)+qv(r)+i;var e,t,n,r,o,i},e.prototype.toRgb=function(){return Yv(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Yv(this.rgba)).r,n=e.g,r=e.b,(o=e.a)<1?"rgba("+t+", "+n+", "+r+", "+o+")":"rgb("+t+", "+n+", "+r+")";var e,t,n,r,o},e.prototype.toHsl=function(){return Qv(eb(this.rgba))},e.prototype.toHslString=function(){return t=(e=Qv(eb(this.rgba))).h,n=e.s,r=e.l,(o=e.a)<1?"hsla("+t+", "+n+"%, "+r+"%, "+o+")":"hsl("+t+", "+n+"%, "+r+"%)";var e,t,n,r,o},e.prototype.toHsv=function(){return e=Kv(this.rgba),{h:Wv(e.h),s:Wv(e.s),v:Wv(e.v),a:Wv(e.a,3)};var e},e.prototype.invert=function(){return fb({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),fb(lb(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),fb(lb(this.rgba,-e))},e.prototype.grayscale=function(){return fb(lb(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),fb(ub(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),fb(ub(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?fb({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Wv(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=eb(this.rgba);return"number"==typeof e?fb({h:e,s:t.s,l:t.l,a:t.a}):Wv(t.h)},e.prototype.isEqual=function(e){return this.toHex()===fb(e).toHex()},e}(),fb=function(e){return e instanceof db?e:new db(e)},hb=[],pb=function(e){e.forEach((function(e){hb.indexOf(e)<0&&(e(db,ib),hb.push(e))}))};function mb(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var o in n)r[n[o]]=o;var i={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,s,a=r[this.toHex()];if(a)return a;if(null==t?void 0:t.closest){var l=this.toRgb(),c=1/0,u="black";if(!i.length)for(var d in n)i[d]=new e(n[d]).toRgb();for(var f in n){var h=(o=l,s=i[f],Math.pow(o.r-s.r,2)+Math.pow(o.g-s.g,2)+Math.pow(o.b-s.b,2));h<c&&(c=h,u=f)}return u}},t.string.push([function(t){var r=t.toLowerCase(),o="transparent"===r?"#0000":n[r];return o?new e(o).toRgb():null},"name"])}let gb;pb([mb]);const vb=Ts((function(e){if("string"!=typeof e)return"";if("string"==typeof(t=e)&&fb(t).isValid())return e;var t;if(!e.includes("var("))return"";if("undefined"==typeof document)return"";const n=function(){if("undefined"!=typeof document){if(!gb){const e=document.createElement("div");e.setAttribute("data-g2-color-computation-node",""),document.body.appendChild(e),gb=e}return gb}}();if(!n)return"";n.style.background=e;const r=window?.getComputedStyle(n).background;return n.style.background="",r||""}));function bb(e){const t=function(e){const t=vb(e);return fb(t).isLight()?"#000000":"#ffffff"}(e);return"#000000"===t?"dark":"light"}const xb=Dl("color:",Fl.theme.foreground,";line-height:",Wl.fontLineHeightBase,";margin:0;text-wrap:balance;text-wrap:pretty;",""),yb={name:"4zleql",styles:"display:block"},wb=Dl("color:",Fl.alert.green,";",""),_b=Dl("color:",Fl.alert.red,";",""),Sb=Dl("color:",Fl.gray[700],";",""),Cb=Dl("mark{background:",Fl.alert.yellow,";border-radius:",Wl.radiusSmall,";box-shadow:0 0 0 1px rgba( 0, 0, 0, 0.05 ) inset,0 -1px 0 rgba( 0, 0, 0, 0.1 ) inset;}",""),kb={name:"50zrmy",styles:"text-transform:uppercase"};var jb=o(9664);const Eb=Ts((e=>{const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}));const Mb={body:13,caption:10,footnote:11,largeTitle:28,subheadline:12,title:20},Nb=[1,2,3,4,5,6].flatMap((e=>[e,e.toString()]));function Tb(e=13){if(e in Mb)return Tb(Mb[e]);if("number"!=typeof e){const t=parseFloat(e);if(Number.isNaN(t))return e;e=t}return`calc(${`(${e} / 13)`} * ${Wl.fontSize})`}function Pb(e=3){if(!Nb.includes(e))return Tb(e);return Wl[`fontSizeH${e}`]}var Db={name:"50zrmy",styles:"text-transform:uppercase"};function Ib(t){const{adjustLineHeightForInnerControls:n,align:r,children:o,className:i,color:s,ellipsizeMode:a,isDestructive:l=!1,display:c,highlightEscape:u=!1,highlightCaseSensitive:d=!1,highlightWords:h,highlightSanitize:p,isBlock:m=!1,letterSpacing:g,lineHeight:v,optimizeReadabilityFor:b,size:x,truncate:y=!1,upperCase:w=!1,variant:_,weight:S=Wl.fontWeight,...C}=cl(t,"Text");let k=o;const j=Array.isArray(h),E="caption"===x;if(j){if("string"!=typeof o)throw new TypeError("`children` of `Text` must only be `string` types when `highlightWords` is defined");k=function({activeClassName:e="",activeIndex:t=-1,activeStyle:n,autoEscape:r,caseSensitive:o=!1,children:i,findChunks:s,highlightClassName:a="",highlightStyle:l={},highlightTag:c="mark",sanitize:u,searchWords:d=[],unhighlightClassName:h="",unhighlightStyle:p}){if(!i)return null;if("string"!=typeof i)return i;const m=i,g=(0,jb.findAll)({autoEscape:r,caseSensitive:o,findChunks:s,sanitize:u,searchWords:d,textToHighlight:m}),v=c;let b,x=-1,y="";const w=g.map(((r,i)=>{const s=m.substr(r.start,r.end-r.start);if(r.highlight){let r;x++,r="object"==typeof a?o?a[s]:(a=Eb(a))[s.toLowerCase()]:a;const c=x===+t;y=`${r} ${c?e:""}`,b=!0===c&&null!==n?Object.assign({},l,n):l;const u={children:s,className:y,key:i,style:b};return"string"!=typeof v&&(u.highlightIndex=x),(0,f.createElement)(v,u)}return(0,f.createElement)("span",{children:s,className:h,key:i,style:p})}));return w}({autoEscape:u,children:o,caseSensitive:d,searchWords:h,sanitize:p})}const M=ll();let N;!0===y&&(N="auto"),!1===y&&(N="none");const T=Fv({...C,className:(0,f.useMemo)((()=>{const t={},o=function(e,t){if(t)return t;if(!e)return;let n=`calc(${Wl.controlHeight} + ${Rl(2)})`;switch(e){case"large":n=`calc(${Wl.controlHeightLarge} + ${Rl(2)})`;break;case"small":n=`calc(${Wl.controlHeightSmall} + ${Rl(2)})`;break;case"xSmall":n=`calc(${Wl.controlHeightXSmall} + ${Rl(2)})`}return n}(n,v);if(t.Base=Dl({color:s,display:c,fontSize:Tb(x),fontWeight:S,lineHeight:o,letterSpacing:g,textAlign:r},"",""),t.upperCase=Db,t.optimalTextColor=null,b){const e="dark"===bb(b);t.optimalTextColor=Dl(e?{color:Fl.gray[900]}:{color:Fl.white},"","")}return M(xb,t.Base,t.optimalTextColor,l&&_b,!!j&&Cb,m&&yb,E&&Sb,_&&e[_],w&&t.upperCase,i)}),[n,r,i,s,M,c,m,E,l,j,g,v,b,x,w,_,S]),children:o,ellipsizeMode:a||N});return!y&&Array.isArray(o)&&(k=f.Children.map(o,(e=>{if("object"!=typeof e||null===e||!("props"in e))return e;return pl(e,["Link"])?(0,f.cloneElement)(e,{size:e.props.size||"inherit"}):e}))),{...T,children:y?T.children:k}}var Rb=ul((function(e,t){const n=Ib(e);return(0,kt.jsx)(kl,{as:"span",...n,ref:t})}),"Text");const Ob={name:"9amh4a",styles:"font-size:11px;font-weight:500;line-height:1.4;text-transform:uppercase"};const Ab=Sl("span",{target:"em5sgkm8"})({name:"pvvbxf",styles:"box-sizing:border-box;display:block"}),zb=Sl("span",{target:"em5sgkm7"})({name:"jgf79h",styles:"align-items:center;align-self:stretch;box-sizing:border-box;display:flex"}),Lb=({disabled:e,isBorderless:t})=>t?"transparent":e?Fl.ui.borderDisabled:Fl.ui.border,Fb=Sl("div",{target:"em5sgkm6"})("&&&{box-sizing:border-box;border-color:",Lb,";border-radius:inherit;border-style:solid;border-width:1px;bottom:0;left:0;margin:0;padding:0;pointer-events:none;position:absolute;right:0;top:0;",kv({paddingLeft:2}),";}"),Bb=Sl(vv,{target:"em5sgkm5"})("box-sizing:border-box;position:relative;border-radius:",Wl.radiusSmall,";padding-top:0;&:focus-within:not( :has( :is( ",Ab,", ",zb," ):focus-within ) ){",Fb,"{border-color:",Fl.ui.borderFocus,";box-shadow:",Wl.controlBoxShadowFocus,";outline:2px solid transparent;outline-offset:-2px;}}"),Vb=({disabled:e})=>Dl({backgroundColor:e?Fl.ui.backgroundDisabled:Fl.ui.background},"","");var Wb={name:"1d3w5wq",styles:"width:100%"};const $b=({__unstableInputWidth:e,labelPosition:t})=>e?"side"===t?"":Dl("edge"===t?{flex:`0 0 ${e}`}:{width:e},"",""):Wb,Hb=Sl("div",{target:"em5sgkm4"})("align-items:center;box-sizing:border-box;border-radius:inherit;display:flex;flex:1;position:relative;",Vb," ",$b,";"),Ub=({disabled:e})=>e?Dl({color:Fl.ui.textDisabled},"",""):"",Yb=({inputSize:e})=>{const t={default:"13px",small:"11px",compact:"13px","__unstable-large":"13px"},n=t[e]||t.default;return n?Dl("font-size:","16px",";@media ( min-width: 600px ){font-size:",n,";}",""):""},Gb=({inputSize:e,__next40pxDefaultSize:t})=>{const n={default:{height:40,lineHeight:1,minHeight:40,paddingLeft:Wl.controlPaddingX,paddingRight:Wl.controlPaddingX},small:{height:24,lineHeight:1,minHeight:24,paddingLeft:Wl.controlPaddingXSmall,paddingRight:Wl.controlPaddingXSmall},compact:{height:32,lineHeight:1,minHeight:32,paddingLeft:Wl.controlPaddingXSmall,paddingRight:Wl.controlPaddingXSmall},"__unstable-large":{height:40,lineHeight:1,minHeight:40,paddingLeft:Wl.controlPaddingX,paddingRight:Wl.controlPaddingX}};return t||(n.default=n.compact),n[e]||n.default},qb=e=>Dl(Gb(e),"",""),Kb=({paddingInlineStart:e,paddingInlineEnd:t})=>Dl({paddingInlineStart:e,paddingInlineEnd:t},"",""),Xb=({isDragging:e,dragCursor:t})=>{let n,r;return e&&(n=Dl("cursor:",t,";user-select:none;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}","")),e&&t&&(r=Dl("&:active{cursor:",t,";}","")),Dl(n," ",r,";","")},Zb=Sl("input",{target:"em5sgkm3"})("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:",Fl.theme.foreground,";display:block;font-family:inherit;margin:0;outline:none;width:100%;",Xb," ",Ub," ",Yb," ",qb," ",Kb," &::-webkit-input-placeholder{color:",Fl.ui.darkGrayPlaceholder,";}&::-moz-placeholder{color:",Fl.ui.darkGrayPlaceholder,";}&:-ms-input-placeholder{color:",Fl.ui.darkGrayPlaceholder,";}&[type='email'],&[type='url']{direction:ltr;}}"),Qb=Sl(Rb,{target:"em5sgkm2"})("&&&{",Ob,";box-sizing:border-box;display:block;padding-top:0;padding-bottom:0;max-width:100%;z-index:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}"),Jb=e=>(0,kt.jsx)(Qb,{...e,as:"label"}),ex=Sl(Pv,{target:"em5sgkm1"})({name:"1b6uupn",styles:"max-width:calc( 100% - 10px )"}),tx=({variant:e="default",size:t,__next40pxDefaultSize:n,isPrefix:r})=>{const{paddingLeft:o}=Gb({inputSize:t,__next40pxDefaultSize:n}),i=r?"paddingInlineStart":"paddingInlineEnd";return Dl("default"===e?{[i]:o}:{display:"flex",[i]:o-4},"","")},nx=Sl("div",{target:"em5sgkm0"})(tx,";");var rx=(0,f.memo)((function({disabled:e=!1,isBorderless:t=!1}){return(0,kt.jsx)(Fb,{"aria-hidden":"true",className:"components-input-control__backdrop",disabled:e,isBorderless:t})}));function ox({children:e,hideLabelFromVision:t,htmlFor:n,...r}){return e?t?(0,kt.jsx)(jl,{as:"label",htmlFor:n,children:e}):(0,kt.jsx)(ex,{children:(0,kt.jsx)(Jb,{htmlFor:n,...r,children:e})}):null}function ix(e){const{__next36pxDefaultSize:t,__next40pxDefaultSize:n,...r}=e;return{...r,__next40pxDefaultSize:null!=n?n:t}}function sx(e){const t={};switch(e){case"top":t.direction="column",t.expanded=!1,t.gap=0;break;case"bottom":t.direction="column-reverse",t.expanded=!1,t.gap=0;break;case"edge":t.justify="space-between"}return t}function ax(e,t){const{__next40pxDefaultSize:n,__unstableInputWidth:r,children:o,className:i,disabled:s=!1,hideLabelFromVision:a=!1,labelPosition:l,id:c,isBorderless:u=!1,label:h,prefix:p,size:m="default",suffix:g,...v}=ix(cl(e,"InputBase")),b=function(e){const t=(0,d.useInstanceId)(ax);return e||`input-base-control-${t}`}(c),x=a||!h,y=(0,f.useMemo)((()=>({InputControlPrefixWrapper:{__next40pxDefaultSize:n,size:m},InputControlSuffixWrapper:{__next40pxDefaultSize:n,size:m}})),[n,m]);return(0,kt.jsxs)(Bb,{...v,...sx(l),className:i,gap:2,ref:t,children:[(0,kt.jsx)(ox,{className:"components-input-control__label",hideLabelFromVision:a,labelPosition:l,htmlFor:b,children:h}),(0,kt.jsxs)(Hb,{__unstableInputWidth:r,className:"components-input-control__container",disabled:s,hideLabel:x,labelPosition:l,children:[(0,kt.jsxs)(xs,{value:y,children:[p&&(0,kt.jsx)(Ab,{className:"components-input-control__prefix",children:p}),o,g&&(0,kt.jsx)(zb,{className:"components-input-control__suffix",children:g})]}),(0,kt.jsx)(rx,{disabled:s,isBorderless:u})]})]})}var lx=ul(ax,"InputBase");const cx={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function ux(e,t,n){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*n):e*t*n/(t+n*e)}function dx(e,t,n,r=.15){return 0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-ux(t-e,n-t,r)+t:e>n?+ux(e-n,n-t,r)+n:e}function fx(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function hx(e,t,n){return(t=fx(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function px(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?px(Object(n),!0).forEach((function(t){hx(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):px(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const gx={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function vx(e){return e?e[0].toUpperCase()+e.slice(1):""}const bx=["enter","leave"];function xx(e,t="",n=!1){const r=gx[e],o=r&&r[t]||t;return"on"+vx(e)+vx(o)+(function(e=!1,t){return e&&!bx.includes(t)}(n,o)?"Capture":"")}const yx=["gotpointercapture","lostpointercapture"];function wx(e){let t=e.substring(2).toLowerCase();const n=!!~t.indexOf("passive");n&&(t=t.replace("passive",""));const r=yx.includes(t)?"capturecapture":"capture",o=!!~t.indexOf(r);return o&&(t=t.replace("capture","")),{device:t,capture:o,passive:n}}function _x(e){return"touches"in e}function Sx(e){return _x(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function Cx(e){return _x(e)?function(e){return"touchend"===e.type||"touchcancel"===e.type?e.changedTouches:e.targetTouches}(e)[0]:e}function kx(e){return function(e){return Array.from(e.touches).filter((t=>{var n,r;return t.target===e.currentTarget||(null===(n=e.currentTarget)||void 0===n||null===(r=n.contains)||void 0===r?void 0:r.call(n,t.target))}))}(e).map((e=>e.identifier))}function jx(e){const t=Cx(e);return _x(e)?t.identifier:t.pointerId}function Ex(e){const t=Cx(e);return[t.clientX,t.clientY]}function Mx(e,...t){return"function"==typeof e?e(...t):e}function Nx(){}function Tx(...e){return 0===e.length?Nx:1===e.length?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function Px(e,t){return Object.assign({},t,e||{})}class Dx{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:n,args:r}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?Mx(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:n,shared:r}=this;t.args=this.args;let o=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,function(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i})}return t}(e)),r.down=r.pressed=r.buttons%2==1||r.touches>0,o=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const e=t._delta.map(Math.abs);cx.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);const[i,s]=t._movement,[a,l]=n.threshold,{_step:c,values:u}=t;if(n.hasCustomTransform?(!1===c[0]&&(c[0]=Math.abs(i)>=a&&u[0]),!1===c[1]&&(c[1]=Math.abs(s)>=l&&u[1])):(!1===c[0]&&(c[0]=Math.abs(i)>=a&&Math.sign(i)*a),!1===c[1]&&(c[1]=Math.abs(s)>=l&&Math.sign(s)*l)),t.intentional=!1!==c[0]||!1!==c[1],!t.intentional)return;const d=[0,0];if(n.hasCustomTransform){const[e,t]=u;d[0]=!1!==c[0]?e-c[0]:0,d[1]=!1!==c[1]?t-c[1]:0}else d[0]=!1!==c[0]?i-c[0]:0,d[1]=!1!==c[1]?s-c[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);const f=t.offset,h=t._active&&!t._blocked||t.active;h&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=Mx(n.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));const[p,m]=t.offset,[[g,v],[b,x]]=t._bounds;t.overflow=[p<g?-1:p>v?1:0,m<b?-1:m>x?1:0],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);const y=t._active&&n.rubberband||[0,0];if(t.offset=function(e,[t,n],[r,o]){const[[i,s],[a,l]]=e;return[dx(t,i,s,r),dx(n,a,l,o)]}(t._bounds,t.offset,y),t.delta=cx.sub(t.offset,f),this.computeMovement(),h&&(!t.last||o>32)){t.delta=cx.sub(t.offset,f);const e=t.delta.map(Math.abs);cx.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&o>0&&(t.velocity=[e[0]/o,e[1]/o],t.timeDelta=o)}}emit(){const e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const r=this.handler(mx(mx(mx({},t),e),{},{[this.aliasKey]:e.values}));void 0!==r&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class Ix extends Dx{constructor(...e){super(...e),hx(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=cx.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=cx.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,n=this.config;if(!t.axis&&e){const r="object"==typeof n.axisThreshold?n.axisThreshold[Sx(e)]:n.axisThreshold;t.axis=function([e,t],n){const r=Math.abs(e),o=Math.abs(t);return r>o&&r>n?"x":o>r&&o>n?"y":void 0}(t._movement,r)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}const Rx=e=>e,Ox={enabled:(e=!0)=>e,eventOptions:(e,t,n)=>mx(mx({},n.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return cx.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?cx.toVector(e):void 0,transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||Rx},threshold:e=>cx.toVector(e,0)};const Ax=mx(mx({},Ox),{},{axis(e,t,{axis:n}){if(this.lockDirection="lock"===n,!this.lockDirection)return n},axisThreshold:(e=0)=>e,bounds(e={}){if("function"==typeof e)return t=>Ax.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:o=1/0}=e;return[[t,n],[r,o]]}}),zx={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};const Lx="undefined"!=typeof window&&window.document&&window.document.createElement;function Fx(){return Lx&&"ontouchstart"in window}const Bx={isBrowser:Lx,gesture:function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),touch:Fx(),touchscreen:Fx()||Lx&&window.navigator.maxTouchPoints>1,pointer:Lx&&"onpointerdown"in window,pointerLock:Lx&&"exitPointerLock"in window.document},Vx={mouse:0,touch:0,pen:8},Wx=mx(mx({},Ax),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&Bx.pointerLock,Bx.touch&&n?"touch":this.pointerLock?"mouse":Bx.pointer&&!o?"pointer":Bx.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay="number"==typeof n?n:n||void 0===n&&e?250:void 0,Bx.touchscreen&&!1!==n)return e||(void 0!==n?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:o=!0}={}}){return this.pointerButtons=r,this.keys=o,!this.pointerLock&&"pointer"===this.device&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:o}){const i=cx.toVector(e,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,i},swipe({velocity:e=.5,distance:t=50,duration:n=250}={}){return{velocity:this.transform(cx.toVector(e)),distance:this.transform(cx.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?mx(mx({},Vx),e):Vx,keyboardDisplacement:(e=10)=>e});mx(mx({},Ox),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!Bx.touch&&Bx.gesture)return"gesture";if(Bx.touch&&r)return"touch";if(Bx.touchscreen){if(Bx.pointer)return"pointer";if(Bx.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const o=e=>{const t=Px(Mx(n,e),{min:-1/0,max:1/0});return[t.min,t.max]},i=e=>{const t=Px(Mx(r,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof n&&"function"!=typeof r?[o(),i()]:e=>[o(e),i(e)]},threshold(e,t,n){this.lockDirection="lock"===n.axis;return cx.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e});mx(mx({},Ax),{},{mouseOnly:(e=!0)=>e});mx(mx({},Ax),{},{mouseOnly:(e=!0)=>e});const $x=new Map,Hx=new Map;const Ux={key:"drag",engine:class extends Ix{constructor(...e){super(...e),hx(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),r={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=Ax.bounds(r)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout((()=>{this.compute(),this.emit()}),0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,n=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;const r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),r&&r.size>1&&n._pointerActive||(this.start(e),this.setupPointer(e),n._pointerId=jx(e),n._pointerActive=!0,this.computeValues(Ex(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==Sx(e)?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,n=this.config;if(!t._pointerActive)return;const r=jx(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;const o=Ex(e);return document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=cx.sub(o,t._values),this.computeValues(o)),cx.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional?(this.timeoutStore.remove("dragDelay"),t.active=!1,void this.startPointerDrag(e)):n.preventScrollAxis&&!t._preventScroll?t.axis?t.axis===n.preventScrollAxis||"xy"===n.preventScrollAxis?(t._active=!1,void this.clean()):(this.timeoutStore.remove("startPointerDrag"),void this.startPointerDrag(e)):void 0:void this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(e){0}const t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;const r=jx(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[o,i]=t._distance;if(t.tap=o<=n.tapsThreshold&&i<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{const[e,r]=t._delta,[o,i]=t._movement,[s,a]=n.swipe.velocity,[l,c]=n.swipe.distance,u=n.swipe.duration;if(t.elapsedTime<u){const n=Math.abs(e/t.timeDelta),u=Math.abs(r/t.timeDelta);n>s&&Math.abs(o)>l&&(t.swipe[0]=Math.sign(e)),u>a&&Math.abs(i)>c&&(t.swipe[1]=Math.sign(r))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,function(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",(()=>{this.state._step=[0,0],this.startPointerDrag(e)}),this.config.delay)}keyDown(e){const t=zx[e.key];if(t){const n=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,r),n._keyboardActive=!0,cx.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in zx&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:Wx};function Yx(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const Gx={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=(Bx.isBrowser?window:void 0))=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},qx=["target","eventOptions","window","enabled","transform"];function Kx(e={},t){const n={};for(const[r,o]of Object.entries(t))switch(typeof o){case"function":n[r]=o.call(n,e[r],r,e);break;case"object":n[r]=Kx(e[r],o);break;case"boolean":o&&(n[r]=e[r])}return n}class Xx{constructor(e,t){hx(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,r,o){const i=this._listeners,s=function(e,t=""){const n=gx[e];return e+(n&&n[t]||t)}(t,n),a=mx(mx({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),o);e.addEventListener(s,r,a);const l=()=>{e.removeEventListener(s,r,a),i.delete(l)};return i.add(l),l}clean(){this._listeners.forEach((e=>e())),this._listeners.clear()}}class Zx{constructor(){hx(this,"_timeouts",new Map)}add(e,t,n=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...r))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach((e=>{window.clearTimeout(e)})),this._timeouts.clear()}}class Qx{constructor(e){hx(this,"gestures",new Set),hx(this,"_targetEventStore",new Xx(this)),hx(this,"gestureEventStores",{}),hx(this,"gestureTimeoutStores",{}),hx(this,"handlers",{}),hx(this,"config",{}),hx(this,"pointerIds",new Set),hx(this,"touchIds",new Set),hx(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&Jx(e,"drag");t.wheel&&Jx(e,"wheel");t.scroll&&Jx(e,"scroll");t.move&&Jx(e,"move");t.pinch&&Jx(e,"pinch");t.hover&&Jx(e,"hover")}(this,e)}setEventIds(e){return _x(e)?(this.touchIds=new Set(kx(e)),this.touchIds):"pointerId"in e?("pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds):void 0}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,n={}){const r=e,{target:o,eventOptions:i,window:s,enabled:a,transform:l}=r,c=Yx(r,qx);if(n.shared=Kx({target:o,eventOptions:i,window:s,enabled:a,transform:l},Gx),t){const e=Hx.get(t);n[t]=Kx(mx({shared:n.shared},c),e)}else for(const e in c){const t=Hx.get(e);t&&(n[e]=Kx(mx({shared:n.shared},c[e]),t))}return n}(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,n={};let r;if(!t.target||(r=t.target(),r)){if(t.enabled){for(const t of this.gestures){const o=this.config[t],i=ey(n,o.eventOptions,!!r);if(o.enabled){new($x.get(t))(this,e,t).bind(i)}}const o=ey(n,t.eventOptions,!!r);for(const t in this.nativeHandlers)o(t,"",(n=>this.nativeHandlers[t](mx(mx({},this.state.shared),{},{event:n,args:e}))),void 0,!0)}for(const e in n)n[e]=Tx(...n[e]);if(!r)return n;for(const e in n){const{device:t,capture:o,passive:i}=wx(e);this._targetEventStore.add(r,t,"",n[e],{capture:o,passive:i})}}}}function Jx(e,t){e.gestures.add(t),e.gestureEventStores[t]=new Xx(e,t),e.gestureTimeoutStores[t]=new Zx}const ey=(e,t,n)=>(r,o,i,s={},a=!1)=>{var l,c;const u=null!==(l=s.capture)&&void 0!==l?l:t.capture,d=null!==(c=s.passive)&&void 0!==c?c:t.passive;let f=a?r:xx(r,o,u);n&&d&&(f+="Passive"),e[f]=e[f]||[],e[f].push(i)};function ty(e,t={},n,r){const o=U().useMemo((()=>new Qx(e)),[]);if(o.applyHandlers(e,r),o.applyConfig(t,n),U().useEffect(o.effect.bind(o)),U().useEffect((()=>o.clean.bind(o)),[]),void 0===t.target)return o.bind.bind(o)}function ny(e,t){var n;return n=Ux,$x.set(n.key,n.engine),Hx.set(n.key,n.resolver),ty({drag:e},t||{},"drag")}const ry=e=>e,oy={error:null,initialValue:"",isDirty:!1,isDragEnabled:!1,isDragging:!1,isPressEnterToChange:!1,value:""},iy="CHANGE",sy="COMMIT",ay="CONTROL",ly="DRAG_END",cy="DRAG_START",uy="DRAG",dy="INVALIDATE",fy="PRESS_DOWN",hy="PRESS_ENTER",py="PRESS_UP",my="RESET";function gy(e=ry,t=oy,n){const[r,o]=(0,f.useReducer)((i=e,(e,t)=>{const n={...e};switch(t.type){case ay:return n.value=t.payload.value,n.isDirty=!1,n._event=void 0,n;case py:case fy:n.isDirty=!1;break;case cy:n.isDragging=!0;break;case ly:n.isDragging=!1;break;case iy:n.error=null,n.value=t.payload.value,e.isPressEnterToChange&&(n.isDirty=!0);break;case sy:n.value=t.payload.value,n.isDirty=!1;break;case my:n.error=null,n.isDirty=!1,n.value=t.payload.value||e.initialValue;break;case dy:n.error=t.payload.error}return n._event=t.payload.event,i(n,t)}),function(e=oy){const{value:t}=e;return{...oy,...e,initialValue:t}}(t));var i;const s=e=>(t,n)=>{o({type:e,payload:{value:t,event:n}})},a=e=>t=>{o({type:e,payload:{event:t}})},l=e=>t=>{o({type:e,payload:t})},c=s(iy),u=s(my),d=s(sy),h=l(cy),p=l(uy),m=l(ly),g=a(py),v=a(fy),b=a(hy),x=(0,f.useRef)(r),y=(0,f.useRef)({value:t.value,onChangeHandler:n});return(0,f.useLayoutEffect)((()=>{x.current=r,y.current={value:t.value,onChangeHandler:n}})),(0,f.useLayoutEffect)((()=>{var e;void 0===x.current._event||r.value===y.current.value||r.isDirty||y.current.onChangeHandler(null!==(e=r.value)&&void 0!==e?e:"",{event:x.current._event})}),[r.value,r.isDirty]),(0,f.useLayoutEffect)((()=>{var e;t.value===x.current.value||x.current.isDirty||o({type:ay,payload:{value:null!==(e=t.value)&&void 0!==e?e:""}})}),[t.value]),{change:c,commit:d,dispatch:o,drag:p,dragEnd:m,dragStart:h,invalidate:(e,t)=>o({type:dy,payload:{error:e,event:t}}),pressDown:v,pressEnter:b,pressUp:g,reset:u,state:r}}function vy(e){return t=>{const{isComposing:n}="nativeEvent"in t?t.nativeEvent:t;n||229===t.keyCode||e(t)}}const by=()=>{};const xy=(0,f.forwardRef)((function({disabled:e=!1,dragDirection:t="n",dragThreshold:n=10,id:r,isDragEnabled:o=!1,isPressEnterToChange:i=!1,onBlur:s=by,onChange:a=by,onDrag:l=by,onDragEnd:c=by,onDragStart:u=by,onKeyDown:d=by,onValidate:h=by,size:p="default",stateReducer:m=e=>e,value:g,type:v,...b},x){const{state:y,change:w,commit:_,drag:S,dragEnd:C,dragStart:k,invalidate:j,pressDown:E,pressEnter:M,pressUp:N,reset:T}=gy(m,{isDragEnabled:o,value:g,isPressEnterToChange:i},a),{value:P,isDragging:D,isDirty:I}=y,R=(0,f.useRef)(!1),O=function(e,t){const n=function(e){let t="ns-resize";switch(e){case"n":case"s":t="ns-resize";break;case"e":case"w":t="ew-resize"}return t}(t);return(0,f.useEffect)((()=>{document.documentElement.style.cursor=e?n:null}),[e,n]),n}(D,t),A=e=>{const t=e.currentTarget.value;try{h(t),_(t,e)}catch(t){j(t,e)}},z=ny((e=>{const{distance:t,dragging:n,event:r,target:o}=e;if(e.event={...e.event,target:o},t){if(r.stopPropagation(),!n)return c(e),void C(e);l(e),S(e),D||(u(e),k(e))}}),{axis:"e"===t||"w"===t?"x":"y",threshold:n,enabled:o,pointer:{capture:!1}}),L=o?z():{};return(0,kt.jsx)(Zb,{...b,...L,className:"components-input-control__input",disabled:e,dragCursor:O,isDragging:D,id:r,onBlur:e=>{s(e),!I&&e.target.validity.valid||(R.current=!0,A(e))},onChange:e=>{const t=e.target.value;w(t,e)},onKeyDown:vy((e=>{const{key:t}=e;switch(d(e),t){case"ArrowUp":N(e);break;case"ArrowDown":E(e);break;case"Enter":M(e),i&&(e.preventDefault(),A(e));break;case"Escape":i&&I&&(e.preventDefault(),T(g,e))}})),ref:x,inputSize:p,value:null!=P?P:"",type:v})}));var yy=xy,wy={"default.fontFamily":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif","default.fontSize":"13px","helpText.fontSize":"12px",mobileTextMinFontSize:"16px"};function _y(e){var t;return null!==(t=wy[e])&&void 0!==t?t:""}const Sy={name:"kv6lnz",styles:"box-sizing:border-box;*,*::before,*::after{box-sizing:inherit;}"};const Cy=Sl("div",{target:"ej5x27r4"})("font-family:",_y("default.fontFamily"),";font-size:",_y("default.fontSize"),";",Sy,";"),ky=({__nextHasNoMarginBottom:e=!1})=>!e&&Dl("margin-bottom:",Rl(2),";",""),jy=Sl("div",{target:"ej5x27r3"})(ky," .components-panel__row &{margin-bottom:inherit;}"),Ey=Dl(Ob,";display:block;margin-bottom:",Rl(2),";padding:0;",""),My=Sl("label",{target:"ej5x27r2"})(Ey,";");var Ny={name:"11yad0w",styles:"margin-bottom:revert"};const Ty=({__nextHasNoMarginBottom:e=!1})=>!e&&Ny,Py=Sl("p",{target:"ej5x27r1"})("margin-top:",Rl(2),";margin-bottom:0;font-size:",_y("helpText.fontSize"),";font-style:normal;color:",Fl.gray[700],";",Ty,";"),Dy=Sl("span",{target:"ej5x27r0"})(Ey,";"),Iy=(0,f.forwardRef)(((e,t)=>{const{className:n,children:r,...o}=e;return(0,kt.jsx)(Dy,{ref:t,...o,className:c("components-base-control__label",n),children:r})})),Ry=Object.assign(dl((e=>{const{__nextHasNoMarginBottom:t=!1,__associatedWPComponentName:n="BaseControl",id:r,label:o,hideLabelFromVision:i=!1,help:s,className:a,children:l}=cl(e,"BaseControl");return t||Ji()(`Bottom margin styles for wp.components.${n}`,{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."}),(0,kt.jsxs)(Cy,{className:a,children:[(0,kt.jsxs)(jy,{className:"components-base-control__field",__nextHasNoMarginBottom:t,children:[o&&r&&(i?(0,kt.jsx)(jl,{as:"label",htmlFor:r,children:o}):(0,kt.jsx)(My,{className:"components-base-control__label",htmlFor:r,children:o})),o&&!r&&(i?(0,kt.jsx)(jl,{as:"label",children:o}):(0,kt.jsx)(Iy,{children:o})),l]}),!!s&&(0,kt.jsx)(Py,{id:r?r+"__help":void 0,className:"components-base-control__help",__nextHasNoMarginBottom:t,children:s})]})}),"BaseControl"),{VisualLabel:Iy});var Oy=Ry;function Ay({componentName:e,__next40pxDefaultSize:t,size:n,__shouldNotWarnDeprecated36pxSize:r}){r||t||void 0!==n&&"default"!==n||Ji()(`36px default size for wp.components.${e}`,{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."})}const zy=()=>{};const Ly=(0,f.forwardRef)((function(e,t){const{__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:r,__unstableStateReducer:o=e=>e,__unstableInputWidth:i,className:s,disabled:a=!1,help:l,hideLabelFromVision:u=!1,id:h,isPressEnterToChange:p=!1,label:m,labelPosition:g="top",onChange:v=zy,onValidate:b=zy,onKeyDown:x=zy,prefix:y,size:w="default",style:_,suffix:S,value:C,...k}=ix(e),j=function(e){const t=(0,d.useInstanceId)(Ly);return e||`inspector-input-control-${t}`}(h),E=c("components-input-control",s),M=function(e){const t=(0,f.useRef)(e.value),[n,r]=(0,f.useState)({}),o=void 0!==n.value?n.value:e.value;return(0,f.useLayoutEffect)((()=>{const{current:o}=t;t.current=e.value,void 0===n.value||n.isStale?n.isStale&&e.value!==o&&r({}):r({...n,isStale:!0})}),[e.value,n]),{value:o,onBlur:t=>{r({}),e.onBlur?.(t)},onChange:(t,n)=>{r((e=>Object.assign(e,{value:t,isStale:!1}))),e.onChange(t,n)}}}({value:C,onBlur:k.onBlur,onChange:v}),N=l?{"aria-describedby":`${j}__help`}:{};return Ay({componentName:"InputControl",__next40pxDefaultSize:n,size:w,__shouldNotWarnDeprecated36pxSize:r}),(0,kt.jsx)(Oy,{className:E,help:l,id:j,__nextHasNoMarginBottom:!0,children:(0,kt.jsx)(lx,{__next40pxDefaultSize:n,__unstableInputWidth:i,disabled:a,gap:3,hideLabelFromVision:u,id:j,justify:"left",label:m,labelPosition:g,prefix:y,size:w,style:_,suffix:S,children:(0,kt.jsx)(yy,{...k,...N,__next40pxDefaultSize:n,className:"components-input-control__input",disabled:a,id:j,isPressEnterToChange:p,onKeyDown:x,onValidate:b,paddingInlineStart:y?Rl(1):void 0,paddingInlineEnd:S?Rl(1):void 0,ref:t,size:w,stateReducer:o,...M})})})}));var Fy=Ly;var By=function({icon:e,className:t,size:n=20,style:r={},...o}){const i=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" "),s={...20!=n?{fontSize:`${n}px`,width:`${n}px`,height:`${n}px`}:{},...r};return(0,kt.jsx)("span",{className:i,style:s,...o})};var Vy=function({icon:e=null,size:t=("string"==typeof e?20:24),...n}){if("string"==typeof e)return(0,kt.jsx)(By,{icon:e,size:t,...n});if((0,f.isValidElement)(e)&&By===e.type)return(0,f.cloneElement)(e,{...n});if("function"==typeof e)return(0,f.createElement)(e,{size:t,...n});if(e&&("svg"===e.type||e.type===a.SVG)){const r={...e.props,width:t,height:t,...n};return(0,kt.jsx)(a.SVG,{...r})}return(0,f.isValidElement)(e)?(0,f.cloneElement)(e,{size:t,width:t,height:t,...n}):e};const Wy=["onMouseDown","onClick"];const $y=(0,f.forwardRef)((function(e,t){const{__next40pxDefaultSize:n,accessibleWhenDisabled:r,isBusy:o,isDestructive:i,className:s,disabled:a,icon:l,iconPosition:u="left",iconSize:f,showTooltip:h,tooltipPosition:p,shortcut:m,label:g,children:v,size:b="default",text:x,variant:y,description:w,..._}=function({__experimentalIsFocusable:e,isDefault:t,isPrimary:n,isSecondary:r,isTertiary:o,isLink:i,isPressed:s,isSmall:a,size:l,variant:c,describedBy:u,...d}){let f=l,h=c;const p={accessibleWhenDisabled:e,"aria-pressed":s,description:u};var m,g,v,b,x,y;return a&&(null!==(m=f)&&void 0!==m||(f="small")),n&&(null!==(g=h)&&void 0!==g||(h="primary")),o&&(null!==(v=h)&&void 0!==v||(h="tertiary")),r&&(null!==(b=h)&&void 0!==b||(h="secondary")),t&&(Ji()("wp.components.Button `isDefault` prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(x=h)&&void 0!==x||(h="secondary")),i&&(null!==(y=h)&&void 0!==y||(h="link")),{...p,...d,size:f,variant:h}}(e),{href:S,target:C,"aria-checked":k,"aria-pressed":j,"aria-selected":E,...M}="href"in _?_:{href:void 0,target:void 0,..._},N=(0,d.useInstanceId)($y,"components-button__description"),T="string"==typeof v&&!!v||Array.isArray(v)&&v?.[0]&&null!==v[0]&&"components-tooltip"!==v?.[0]?.props?.className,P=c("components-button",s,{"is-next-40px-default-size":n,"is-secondary":"secondary"===y,"is-primary":"primary"===y,"is-small":"small"===b,"is-compact":"compact"===b,"is-tertiary":"tertiary"===y,"is-pressed":[!0,"true","mixed"].includes(j),"is-pressed-mixed":"mixed"===j,"is-busy":o,"is-link":"link"===y,"is-destructive":i,"has-text":!!l&&(T||x),"has-icon":!!l,"has-icon-right":"right"===u}),D=a&&!r,I=void 0===S||a?"button":"a",R="button"===I?{type:"button",disabled:D,"aria-checked":k,"aria-pressed":j,"aria-selected":E}:{},O="a"===I?{href:S,target:C}:{},A={};if(a&&r){R["aria-disabled"]=!0,O["aria-disabled"]=!0;for(const e of Wy)A[e]=e=>{e&&(e.stopPropagation(),e.preventDefault())}}const z=!D&&(h&&!!g||!!m||!!g&&!v?.length&&!1!==h),L=w?N:void 0,F=M["aria-describedby"]||L,B={className:P,"aria-label":M["aria-label"]||g,"aria-describedby":F,ref:t},V=(0,kt.jsxs)(kt.Fragment,{children:[l&&"left"===u&&(0,kt.jsx)(Vy,{icon:l,size:f}),x&&(0,kt.jsx)(kt.Fragment,{children:x}),v,l&&"right"===u&&(0,kt.jsx)(Vy,{icon:l,size:f})]}),W="a"===I?(0,kt.jsx)("a",{...O,...M,...A,...B,children:V}):(0,kt.jsx)("button",{...R,...M,...A,...B,children:V}),$=z?{text:v?.length&&w?w:g,shortcut:m,placement:p&&ns(p)}:{};return(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(cs,{...$,children:W}),w&&(0,kt.jsx)(jl,{children:(0,kt.jsx)("span",{id:L,children:w})})]})}));var Hy=$y;var Uy={name:"euqsgg",styles:"input[type='number']::-webkit-outer-spin-button,input[type='number']::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}input[type='number']{-moz-appearance:textfield;}"};const Yy=({hideHTMLArrows:e})=>e?Uy:"",Gy=Sl(Fy,{target:"ep09it41"})(Yy,";"),qy=Sl(Hy,{target:"ep09it40"})("&&&&&{color:",Fl.theme.accent,";}"),Ky={smallSpinButtons:Dl("width:",Rl(5),";min-width:",Rl(5),";height:",Rl(5),";","")};function Xy(e){const t=Number(e);return isNaN(t)?0:t}function Zy(...e){return e.reduce(((e,t)=>e+Xy(t)),0)}function Qy(e){const t=(e+"").split(".");return void 0!==t[1]?t[1].length:0}function Jy(e,t,n){const r=Xy(e);return Math.max(t,Math.min(r,n))}const ew={bottom:{align:"flex-end",justify:"center"},bottomLeft:{align:"flex-end",justify:"flex-start"},bottomRight:{align:"flex-end",justify:"flex-end"},center:{align:"center",justify:"center"},edge:{align:"center",justify:"space-between"},left:{align:"center",justify:"flex-start"},right:{align:"center",justify:"flex-end"},stretch:{align:"stretch"},top:{align:"flex-start",justify:"center"},topLeft:{align:"flex-start",justify:"flex-start"},topRight:{align:"flex-start",justify:"flex-end"}},tw={bottom:{justify:"flex-end",align:"center"},bottomLeft:{justify:"flex-end",align:"flex-start"},bottomRight:{justify:"flex-end",align:"flex-end"},center:{justify:"center",align:"center"},edge:{justify:"space-between",align:"center"},left:{justify:"center",align:"flex-start"},right:{justify:"center",align:"flex-end"},stretch:{align:"stretch"},top:{justify:"flex-start",align:"center"},topLeft:{justify:"flex-start",align:"flex-start"},topRight:{justify:"flex-start",align:"flex-end"}};function nw(e){return"string"==typeof e?[e]:f.Children.toArray(e).filter((e=>(0,f.isValidElement)(e)))}function rw(e){const{alignment:t="edge",children:n,direction:r,spacing:o=2,...i}=cl(e,"HStack"),s=function(e,t="row"){if(!Iv(e))return{};const n="column"===t?tw:ew;return e in n?n[e]:{align:e}}(t,r),a=nw(n).map(((e,t)=>{if(pl(e,["Spacer"])){const n=e,r=n.key||`hstack-${t}`;return(0,kt.jsx)(Pv,{isBlock:!0,...n.props},r)}return e})),l={children:a,direction:r,justify:"center",...s,...i,gap:o},{isColumn:c,...u}=mv(l);return u}var ow=ul((function(e,t){const n=rw(e);return(0,kt.jsx)(kl,{...n,ref:t})}),"HStack");const iw=()=>{};const sw=(0,f.forwardRef)((function(e,t){const{__unstableStateReducer:n,className:r,dragDirection:o="n",hideHTMLArrows:i=!1,spinControls:s=(i?"none":"native"),isDragEnabled:a=!0,isShiftStepEnabled:l=!0,label:h,max:p=1/0,min:m=-1/0,required:g=!1,shiftStep:v=10,step:b=1,spinFactor:x=1,type:y="number",value:w,size:_="default",suffix:S,onChange:C=iw,__shouldNotWarnDeprecated36pxSize:k,...j}=ix(e);Ay({componentName:"NumberControl",size:_,__next40pxDefaultSize:j.__next40pxDefaultSize,__shouldNotWarnDeprecated36pxSize:k}),i&&Ji()("wp.components.NumberControl hideHTMLArrows prop ",{alternative:'spinControls="none"',since:"6.2",version:"6.3"});const E=(0,f.useRef)(),M=(0,d.useMergeRefs)([E,t]),N="any"===b,T=N?1:Rv(b),P=Rv(x)*T,D=(e,t)=>(N||(e=function(e,t,n){const r=Xy(e),o=Xy(t),i=Xy(n),s=Math.max(Qy(n),Qy(t)),a=o%i?o:0,l=Math.round((r-a)/i)*i+a;return s?Xy(l.toFixed(s)):l}(e,m,null!=t?t:T)),`${Jy(e,m,p)}`),I=D(0),R="number"===y?"off":void 0,O=c("components-number-control",r),A=ll()("small"===_&&Ky.smallSpinButtons),z=(e,t,n)=>{n?.preventDefault();const r=n?.shiftKey&&l,o=r?Rv(v)*P:P;let i=function(e){const t=""===e;return!Iv(e)||t}(e)?I:e;return"up"===t?i=Zy(i,o):"down"===t&&(i=function(...e){return e.reduce(((e,t,n)=>{const r=Xy(t);return 0===n?r:e-r}),0)}(i,o)),D(i,r?o:void 0)},L=e=>t=>C(String(z(w,e,t)),{event:{...t,target:E.current}});return(0,kt.jsx)(Gy,{autoComplete:R,inputMode:"numeric",...j,className:O,dragDirection:o,hideHTMLArrows:"native"!==s,isDragEnabled:a,label:h,max:p===1/0?void 0:p,min:m===-1/0?void 0:m,ref:M,required:g,step:b,type:y,value:w,__unstableStateReducer:(e,t)=>{var r;const i=((e,t)=>{const n={...e},{type:r,payload:i}=t,s=i.event,c=n.value;if(r!==py&&r!==fy||(n.value=z(c,r===py?"up":"down",s)),r===uy&&a){const[e,t]=i.delta,r=i.shiftKey&&l,s=r?Rv(v)*P:P;let a,d;switch(o){case"n":d=t,a=-1;break;case"e":d=e,a=(0,u.isRTL)()?-1:1;break;case"s":d=t,a=1;break;case"w":d=e,a=(0,u.isRTL)()?1:-1}if(0!==d){d=Math.ceil(Math.abs(d))*Math.sign(d);const e=d*s*a;n.value=D(Zy(c,e),r?s:void 0)}}if(r===hy||r===sy){const e=!1===g&&""===c;n.value=e?c:D(c)}return n})(e,t);return null!==(r=n?.(i,t))&&void 0!==r?r:i},size:_,__shouldNotWarnDeprecated36pxSize:!0,suffix:"custom"===s?(0,kt.jsxs)(kt.Fragment,{children:[S,(0,kt.jsx)(Mv,{marginBottom:0,marginRight:2,children:(0,kt.jsxs)(ow,{spacing:1,children:[(0,kt.jsx)(qy,{className:A,icon:Nv,size:"small",label:(0,u.__)("Increment"),onClick:L("up")}),(0,kt.jsx)(qy,{className:A,icon:Tv,size:"small",label:(0,u.__)("Decrement"),onClick:L("down")})]})})]}):S,onChange:C})}));var aw=sw;const lw=Sl("div",{target:"eln3bjz3"})("border-radius:",Wl.radiusRound,";border:",Wl.borderWidth," solid ",Fl.ui.border,";box-sizing:border-box;cursor:grab;height:",32,"px;overflow:hidden;width:",32,"px;:active{cursor:grabbing;}"),cw=Sl("div",{target:"eln3bjz2"})({name:"1r307gh",styles:"box-sizing:border-box;position:relative;width:100%;height:100%;:focus-visible{outline:none;}"}),uw=Sl("div",{target:"eln3bjz1"})("background:",Fl.theme.accent,";border-radius:",Wl.radiusRound,";box-sizing:border-box;display:block;left:50%;top:4px;transform:translateX( -50% );position:absolute;width:",6,"px;height:",6,"px;"),dw=Sl(Rb,{target:"eln3bjz0"})("color:",Fl.theme.accent,";margin-right:",Rl(3),";");var fw=function({value:e,onChange:t,...n}){const r=(0,f.useRef)(null),o=(0,f.useRef)(),i=(0,f.useRef)(),s=e=>{if(void 0!==e&&(e.preventDefault(),e.target?.focus(),void 0!==o.current&&void 0!==t)){const{x:n,y:r}=o.current;t(function(e,t,n,r){const o=r-t,i=n-e,s=Math.atan2(o,i),a=Math.round(s*(180/Math.PI))+90;if(a<0)return 360+a;return a}(n,r,e.clientX,e.clientY))}},{startDrag:a,isDragging:l}=(0,d.__experimentalUseDragging)({onDragStart:e=>{(()=>{if(null===r.current)return;const e=r.current.getBoundingClientRect();o.current={x:e.x+e.width/2,y:e.y+e.height/2}})(),s(e)},onDragMove:s,onDragEnd:s});return(0,f.useEffect)((()=>{l?(void 0===i.current&&(i.current=document.body.style.cursor),document.body.style.cursor="grabbing"):(document.body.style.cursor=i.current||"",i.current=void 0)}),[l]),(0,kt.jsx)(lw,{ref:r,onMouseDown:a,className:"components-angle-picker-control__angle-circle",...n,children:(0,kt.jsx)(cw,{style:e?{transform:`rotate(${e}deg)`}:void 0,className:"components-angle-picker-control__angle-circle-indicator-wrapper",tabIndex:-1,children:(0,kt.jsx)(uw,{className:"components-angle-picker-control__angle-circle-indicator"})})})};var hw=(0,f.forwardRef)((function(e,t){const{className:n,label:r=(0,u.__)("Angle"),onChange:o,value:i,...s}=e,a=c("components-angle-picker-control",n),l=(0,kt.jsx)(dw,{children:"°"}),[d,f]=(0,u.isRTL)()?[l,null]:[null,l];return(0,kt.jsxs)(vv,{...s,ref:t,className:a,gap:2,children:[(0,kt.jsx)(xv,{children:(0,kt.jsx)(aw,{__next40pxDefaultSize:!0,label:r,className:"components-angle-picker-control__input-field",max:360,min:0,onChange:e=>{if(void 0===o)return;const t=void 0!==e&&""!==e?parseInt(e,10):0;o(t)},step:"1",value:i,spinControls:"none",prefix:d,suffix:f})}),(0,kt.jsx)(Mv,{marginBottom:"1",marginTop:"auto",children:(0,kt.jsx)(fw,{"aria-hidden":"true",value:i,onChange:o})})]})})),pw=o(9681),mw=o.n(pw);const gw=window.wp.richText,vw=window.wp.a11y,bw=window.wp.keycodes,xw=new RegExp(/[\u007e\u00ad\u2053\u207b\u208b\u2212\p{Pd}]/gu),yw=e=>mw()(e).normalize("NFKC").toLocaleLowerCase().replace(xw,"-");function ww(e){var t;let n=null!==(t=e?.toString?.())&&void 0!==t?t:"";return n=n.replace(/['\u2019]/,""),Ns(n,{splitRegexp:[/(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g,/(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g,/([A-Za-z])([0-9])/g,/([A-Z])([A-Z][a-z])/g]})}function _w(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}function Sw(e){return t=>{const[n,r]=(0,f.useState)([]);return(0,f.useLayoutEffect)((()=>{const{options:n,isDebounced:o}=e,i=(0,d.debounce)((()=>{const o=Promise.resolve("function"==typeof n?n(t):n).then((n=>{if(o.canceled)return;const i=n.map(((t,n)=>({key:`${e.name}-${n}`,value:t,label:e.getOptionLabel(t),keywords:e.getOptionKeywords?e.getOptionKeywords(t):[],isDisabled:!!e.isOptionDisabled&&e.isOptionDisabled(t)}))),s=new RegExp("(?:\\b|\\s|^)"+_w(t),"i");r(function(e,t=[],n=10){const r=[];for(let o=0;o<t.length;o++){const i=t[o];let{keywords:s=[]}=i;if("string"==typeof i.label&&(s=[...s,i.label]),s.some((t=>e.test(mw()(t))))&&(r.push(i),r.length===n))break}return r}(s,i))}));return o}),o?250:0),s=i();return()=>{i.cancel(),s&&(s.canceled=!0)}}),[t]),[n]}}const Cw=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Ri({element:n.current,padding:r}).fn(t):{}:n?Ri({element:n,padding:r}).fn(t):{};var o}});var kw="undefined"!=typeof document?$.useLayoutEffect:$.useEffect;function jw(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!jw(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!jw(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Ew(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Mw(e,t){const n=Ew(e);return Math.round(t*n)/n}function Nw(e){const t=$.useRef(e);return kw((()=>{t.current=e})),t}var Tw=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})});let Pw=0;function Dw(e){const t=document.scrollingElement||document.body;e&&(Pw=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=Pw)}let Iw=0;var Rw=function(){return(0,f.useEffect)((()=>(0===Iw&&Dw(!0),++Iw,()=>{1===Iw&&Dw(!1),--Iw})),[]),null};const Ow={slots:(0,d.observableMap)(),fills:(0,d.observableMap)(),registerSlot:()=>{},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},isDefault:!0},Aw=(0,f.createContext)(Ow);Aw.displayName="SlotFillContext";var zw=Aw;function Lw(e){const t=(0,f.useContext)(zw);return{...(0,d.useObservableValue)(t.slots,e)}}const Fw={slots:(0,d.observableMap)(),fills:(0,d.observableMap)(),registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},updateFill:()=>{}},Bw=(0,f.createContext)(Fw);Bw.displayName="SlotFillContext";var Vw=Bw;function Ww({name:e,children:t}){const n=(0,f.useContext)(Vw),r=(0,f.useRef)({}),o=(0,f.useRef)(t);return(0,f.useLayoutEffect)((()=>{o.current=t}),[t]),(0,f.useLayoutEffect)((()=>{const t=r.current;return n.registerFill(e,t,o.current),()=>n.unregisterFill(e,t)}),[n,e]),(0,f.useLayoutEffect)((()=>{n.updateFill(e,r.current,o.current)})),null}function $w(e){return"function"==typeof e}var Hw=function(e){var t;const n=(0,f.useContext)(Vw),r=(0,f.useRef)({}),{name:o,children:i,fillProps:s={}}=e;(0,f.useLayoutEffect)((()=>{const e=r.current;return n.registerSlot(o,e),()=>n.unregisterSlot(o,e)}),[n,o]);let a=null!==(t=(0,d.useObservableValue)(n.fills,o))&&void 0!==t?t:[];(0,d.useObservableValue)(n.slots,o)!==r.current&&(a=[]);const l=a.map((e=>function(e){return f.Children.map(e,((e,t)=>{if(!e||"string"==typeof e)return e;let n=t;return"object"==typeof e&&"key"in e&&e?.key&&(n=e.key),(0,f.cloneElement)(e,{key:n})}))}($w(e.children)?e.children(s):e.children))).filter((e=>!(0,f.isEmptyElement)(e)));return(0,kt.jsx)(kt.Fragment,{children:$w(i)?i(l):l})};const Uw={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Yw;const Gw=new Uint8Array(16);function qw(){if(!Yw&&(Yw="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Yw))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Yw(Gw)}const Kw=[];for(let e=0;e<256;++e)Kw.push((e+256).toString(16).slice(1));function Xw(e,t=0){return Kw[e[t+0]]+Kw[e[t+1]]+Kw[e[t+2]]+Kw[e[t+3]]+"-"+Kw[e[t+4]]+Kw[e[t+5]]+"-"+Kw[e[t+6]]+Kw[e[t+7]]+"-"+Kw[e[t+8]]+Kw[e[t+9]]+"-"+Kw[e[t+10]]+Kw[e[t+11]]+Kw[e[t+12]]+Kw[e[t+13]]+Kw[e[t+14]]+Kw[e[t+15]]}const Zw=function(e,t,n){if(Uw.randomUUID&&!t&&!e)return Uw.randomUUID();const r=(e=e||{}).random||(e.rng||qw)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return Xw(r)},Qw=new Set,Jw=new WeakMap;function e_(e){const{children:t,document:n}=e;if(!n)return null;const r=(e=>{if(Jw.has(e))return Jw.get(e);let t=Zw().replace(/[0-9]/g,"");for(;Qw.has(t);)t=Zw().replace(/[0-9]/g,"");Qw.add(t);const n=Ia({container:e,key:t});return Jw.set(e,n),n})(n.head);return(0,kt.jsx)(Xa,{value:r,children:t})}var t_=e_;function n_({name:e,children:t}){var n;const r=(0,f.useContext)(zw),o=(0,d.useObservableValue)(r.slots,e),i=(0,f.useRef)({});if((0,f.useEffect)((()=>{const t=i.current;return r.registerFill(e,t),()=>r.unregisterFill(e,t)}),[r,e]),!o||!o.ref.current)return null;const s=(0,kt.jsx)(t_,{document:o.ref.current.ownerDocument,children:"function"==typeof t?t(null!==(n=o.fillProps)&&void 0!==n?n:{}):t});return(0,f.createPortal)(s,o.ref.current)}var r_=(0,f.forwardRef)((function(e,t){const{name:n,fillProps:r={},as:o,children:i,...s}=e,a=(0,f.useContext)(zw),l=(0,f.useRef)(null),c=(0,f.useRef)(r);return(0,f.useLayoutEffect)((()=>{c.current=r}),[r]),(0,f.useLayoutEffect)((()=>(a.registerSlot(n,l,c.current),()=>a.unregisterSlot(n,l))),[a,n]),(0,f.useLayoutEffect)((()=>{a.updateSlot(n,l,c.current)})),(0,kt.jsx)(kl,{as:o,ref:(0,d.useMergeRefs)([t,l]),...s})}));const o_=window.wp.isShallowEqual;var i_=o.n(o_);function s_(){const e=(0,d.observableMap)(),t=(0,d.observableMap)();return{slots:e,fills:t,registerSlot:(t,n,r)=>{e.set(t,{ref:n,fillProps:r})},updateSlot:(t,n,r)=>{const o=e.get(t);o&&o.ref===n&&(i_()(o.fillProps,r)||e.set(t,{ref:n,fillProps:r}))},unregisterSlot:(t,n)=>{const r=e.get(t);r&&r.ref===n&&e.delete(t)},registerFill:(e,n)=>{t.set(e,[...t.get(e)||[],n])},unregisterFill:(e,n)=>{const r=t.get(e);r&&t.set(e,r.filter((e=>e!==n)))}}}function a_({children:e}){const[t]=(0,f.useState)(s_);return(0,kt.jsx)(zw.Provider,{value:t,children:e})}function l_(){const e=(0,d.observableMap)(),t=(0,d.observableMap)();return{slots:e,fills:t,registerSlot:function(t,n){e.set(t,n)},unregisterSlot:function(t,n){e.get(t)===n&&e.delete(t)},registerFill:function(e,n,r){t.set(e,[...t.get(e)||[],{instance:n,children:r}])},unregisterFill:function(e,n){const r=t.get(e);r&&t.set(e,r.filter((e=>e.instance!==n)))},updateFill:function(e,n,r){const o=t.get(e);if(!o)return;const i=o.find((e=>e.instance===n));i&&i.children!==r&&t.set(e,o.map((e=>e.instance===n?{instance:n,children:r}:e)))}}}var c_=function({children:e}){const[t]=(0,f.useState)(l_);return(0,kt.jsx)(Vw.Provider,{value:t,children:e})};function u_(e){return(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(Ww,{...e}),(0,kt.jsx)(n_,{...e})]})}const d_=(0,f.forwardRef)((function(e,t){const{bubblesVirtually:n,...r}=e;return n?(0,kt.jsx)(r_,{...r,ref:t}):(0,kt.jsx)(Hw,{...r})}));function f_({children:e,passthrough:t=!1}){return!(0,f.useContext)(zw).isDefault&&t?(0,kt.jsx)(kt.Fragment,{children:e}):(0,kt.jsx)(c_,{children:(0,kt.jsx)(a_,{children:e})})}function h_(e){const t="symbol"==typeof e?e.description:e,n=t=>(0,kt.jsx)(u_,{name:e,...t});n.displayName=`${t}Fill`;const r=t=>(0,kt.jsx)(d_,{name:e,...t});return r.displayName=`${t}Slot`,r.__unstableName=e,{name:e,Fill:n,Slot:r}}f_.displayName="SlotFillProvider";const p_="Popover",m_=()=>(0,kt.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:"components-popover__triangle",role:"presentation",children:[(0,kt.jsx)(a.Path,{className:"components-popover__triangle-bg",d:"M 0 0 L 50 50 L 100 0"}),(0,kt.jsx)(a.Path,{className:"components-popover__triangle-border",d:"M 0 0 L 50 50 L 100 0",vectorEffect:"non-scaling-stroke"})]}),g_=(0,f.createContext)(void 0);g_.displayName="__unstableSlotNameContext";const v_="components-popover__fallback-container",b_=(0,f.forwardRef)((({name:e=p_},t)=>(0,kt.jsx)(d_,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t}))),x_=Object.assign(ul(((e,t)=>{const{animate:n=!0,headerTitle:r,constrainTabbing:o,onClose:i,children:s,className:a,noArrow:l=!0,position:h,placement:p="bottom-start",offset:m=0,focusOnMount:g="firstElement",anchor:v,expandOnMobile:b,onFocusOutside:x,__unstableSlotName:y=p_,flip:w=!0,resize:_=!0,shift:S=!1,inline:C=!1,variant:k,style:j,__unstableForcePosition:E,anchorRef:M,anchorRect:N,getAnchorRect:T,isAlternate:P,...D}=cl(e,"Popover");let I=w,R=_;void 0!==E&&(Ji()("`__unstableForcePosition` prop in wp.components.Popover",{since:"6.1",version:"6.3",alternative:"`flip={ false }` and `resize={ false }`"}),I=!E,R=!E),void 0!==M&&Ji()("`anchorRef` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"}),void 0!==N&&Ji()("`anchorRect` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"}),void 0!==T&&Ji()("`getAnchorRect` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"});const O=P?"toolbar":k;void 0!==P&&Ji()("`isAlternate` prop in wp.components.Popover",{since:"6.2",alternative:"`variant` prop with the `'toolbar'` value"});const A=(0,f.useRef)(null),[z,L]=(0,f.useState)(null),F=(0,f.useCallback)((e=>{L(e)}),[]),B=(0,d.useViewportMatch)("medium","<"),V=b&&B,W=!V&&!l,H=h?ns(h):p,U=[..."overlay"===p?[{name:"overlay",fn:({rects:e})=>e.reference},Ii({apply({rects:e,elements:t}){var n;const{firstElementChild:r}=null!==(n=t.floating)&&void 0!==n?n:{};r instanceof HTMLElement&&Object.assign(r.style,{width:`${e.reference.width}px`,height:`${e.reference.height}px`})}})]:[],Ho(m),I&&Di(),R&&Ii({padding:8,apply(e){var t;const{firstElementChild:n}=null!==(t=J.floating.current)&&void 0!==t?t:{};n instanceof HTMLElement&&Object.assign(n.style,{maxHeight:`${Math.max(0,e.availableHeight)}px`,overflow:"auto"})}}),S&&Pi({crossAxis:!0,limiter:Oi(),padding:1}),Cw({element:A})],Y=(0,f.useContext)(g_)||y,G=Lw(Y);let q;(i||x)&&(q=(e,t)=>{"focus-outside"===e&&x?x(t):i&&i()});const[K,X]=(0,d.__experimentalUseDialog)({constrainTabbing:o,focusOnMount:g,__unstableOnClose:q,onClose:q}),{x:Z,y:Q,refs:J,strategy:ee,update:te,placement:ne,middlewareData:{arrow:re}}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=$.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=$.useState(r);jw(f,r)||h(r);const[p,m]=$.useState(null),[g,v]=$.useState(null),b=$.useCallback((e=>{e!==_.current&&(_.current=e,m(e))}),[]),x=$.useCallback((e=>{e!==S.current&&(S.current=e,v(e))}),[]),y=i||p,w=s||g,_=$.useRef(null),S=$.useRef(null),C=$.useRef(u),k=null!=l,j=Nw(l),E=Nw(o),M=$.useCallback((()=>{if(!_.current||!S.current)return;const e={placement:t,strategy:n,middleware:f};E.current&&(e.platform=E.current),Ai(_.current,S.current,e).then((e=>{const t={...e,isPositioned:!0};N.current&&!jw(C.current,t)&&(C.current=t,Xr.flushSync((()=>{d(t)})))}))}),[f,t,n,E]);kw((()=>{!1===c&&C.current.isPositioned&&(C.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const N=$.useRef(!1);kw((()=>(N.current=!0,()=>{N.current=!1})),[]),kw((()=>{if(y&&(_.current=y),w&&(S.current=w),y&&w){if(j.current)return j.current(y,w,M);M()}}),[y,w,M,j,k]);const T=$.useMemo((()=>({reference:_,floating:S,setReference:b,setFloating:x})),[b,x]),P=$.useMemo((()=>({reference:y,floating:w})),[y,w]),D=$.useMemo((()=>{const e={position:n,left:0,top:0};if(!P.floating)return e;const t=Mw(P.floating,u.x),r=Mw(P.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...Ew(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,a,P.floating,u.x,u.y]);return $.useMemo((()=>({...u,update:M,refs:T,elements:P,floatingStyles:D})),[u,M,T,P,D])}({placement:"overlay"===H?void 0:H,middleware:U,whileElementsMounted:(e,t,n)=>Ti(e,t,n,{layoutShift:!1,animationFrame:!0})}),oe=(0,f.useCallback)((e=>{A.current=e,te()}),[te]),ie=M?.top,se=M?.bottom,ae=M?.startContainer,le=M?.current;(0,f.useLayoutEffect)((()=>{const e=(({anchor:e,anchorRef:t,anchorRect:n,getAnchorRect:r,fallbackReferenceElement:o})=>{var i;let s=null;return e?s=e:function(e){return!!e?.top}(t)?s={getBoundingClientRect(){const e=t.top.getBoundingClientRect(),n=t.bottom.getBoundingClientRect();return new window.DOMRect(e.x,e.y,e.width,n.bottom-e.top)}}:function(e){return!!e?.current}(t)?s=t.current:t?s=t:n?s={getBoundingClientRect:()=>n}:r?s={getBoundingClientRect(){var e,t,n,i;const s=r(o);return new window.DOMRect(null!==(e=s.x)&&void 0!==e?e:s.left,null!==(t=s.y)&&void 0!==t?t:s.top,null!==(n=s.width)&&void 0!==n?n:s.right-s.left,null!==(i=s.height)&&void 0!==i?i:s.bottom-s.top)}}:o&&(s=o.parentElement),null!==(i=s)&&void 0!==i?i:null})({anchor:v,anchorRef:M,anchorRect:N,getAnchorRect:T,fallbackReferenceElement:z});J.setReference(e)}),[v,M,ie,se,ae,le,N,T,z,J]);const ce=(0,d.useMergeRefs)([J.setFloating,K,t]),ue=V?void 0:{position:ee,top:0,left:0,x:os(Z),y:os(Q)},de=(0,d.useReducedMotion)(),fe=n&&!V&&!de,[he,pe]=(0,f.useState)(!1),{style:me,...ge}=(0,f.useMemo)((()=>(e=>{const t=e.startsWith("top")||e.startsWith("bottom")?"translateY":"translateX",n=e.startsWith("top")||e.startsWith("left")?1:-1;return{style:rs[e],initial:{opacity:0,scale:0,[t]:2*n+"em"},animate:{opacity:1,scale:1,[t]:0},transition:{duration:.1,ease:[0,0,.2,1]}}})(ne)),[ne]),ve=fe?{style:{...j,...me,...ue},onAnimationComplete:()=>pe(!0),...ge}:{animate:!1,style:{...j,...ue}},be=(!fe||he)&&null!==Z&&null!==Q;let xe=(0,kt.jsxs)(sv.div,{className:c(a,{"is-expanded":V,"is-positioned":be,[`is-${"toolbar"===O?"alternate":O}`]:O}),...ve,...D,ref:ce,...X,tabIndex:-1,children:[V&&(0,kt.jsx)(Rw,{}),V&&(0,kt.jsxs)("div",{className:"components-popover__header",children:[(0,kt.jsx)("span",{className:"components-popover__header-title",children:r}),(0,kt.jsx)(Hy,{className:"components-popover__close",size:"small",icon:Tw,onClick:i,label:(0,u.__)("Close")})]}),(0,kt.jsx)("div",{className:"components-popover__content",children:s}),W&&(0,kt.jsx)("div",{ref:oe,className:["components-popover__arrow",`is-${ne.split("-")[0]}`].join(" "),style:{left:void 0!==re?.x&&Number.isFinite(re.x)?`${re.x}px`:"",top:void 0!==re?.y&&Number.isFinite(re.y)?`${re.y}px`:""},children:(0,kt.jsx)(m_,{})})]});const ye=G.ref&&!C,we=M||N||v;return ye?xe=(0,kt.jsx)(u_,{name:Y,children:xe}):C||(xe=(0,f.createPortal)((0,kt.jsx)(e_,{document,children:xe}),(()=>{let e=document.body.querySelector("."+v_);return e||(e=document.createElement("div"),e.className=v_,document.body.append(e)),e})())),we?xe:(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)("span",{ref:F}),xe]})}),"Popover"),{Slot:Object.assign(b_,{displayName:"Popover.Slot"}),__unstableSlotNameProvider:Object.assign(g_.Provider,{displayName:"Popover.__unstableSlotNameProvider"})});var y_=x_;function w_({items:e,onSelect:t,selectedIndex:n,instanceId:r,listBoxId:o,className:i,Component:s="div"}){return(0,kt.jsx)(s,{id:o,role:"listbox",className:"components-autocomplete__results",children:e.map(((e,o)=>(0,kt.jsx)(Hy,{id:`components-autocomplete-item-${r}-${e.key}`,role:"option",__next40pxDefaultSize:!0,"aria-selected":o===n,accessibleWhenDisabled:!0,disabled:e.isDisabled,className:c("components-autocomplete__result",i,{"is-selected":o===n}),variant:o===n?"primary":void 0,onClick:()=>t(e),children:e.label},e.key)))})}function __(e){var t;const n=null!==(t=e.useItems)&&void 0!==t?t:Sw(e);return function({filterValue:e,instanceId:t,listBoxId:r,className:o,selectedIndex:i,onChangeOptions:s,onSelect:a,onReset:l,reset:c,contentRef:h}){const[p]=n(e),m=(0,gw.useAnchor)({editableContentElement:h.current}),[g,v]=(0,f.useState)(!1),b=(0,f.useRef)(null),x=(0,d.useMergeRefs)([b,(0,d.useRefEffect)((e=>{h.current&&v(e.ownerDocument!==h.current.ownerDocument)}),[h])]);var y,w;y=b,w=c,(0,f.useEffect)((()=>{const e=e=>{y.current&&!y.current.contains(e.target)&&w(e)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}}),[w,y]);const _=(0,d.useDebounce)(vw.speak,500);return(0,f.useLayoutEffect)((()=>{s(p),function(t){_&&(t.length?_(e?(0,u.sprintf)((0,u._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",t.length),t.length):(0,u.sprintf)((0,u._n)("Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.","Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.",t.length),t.length),"assertive"):_((0,u.__)("No results."),"assertive"))}(p)}),[p]),0===p.length?null:(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(y_,{focusOnMount:!1,onClose:l,placement:"top-start",className:"components-autocomplete__popover",anchor:m,ref:x,children:(0,kt.jsx)(w_,{items:p,onSelect:a,selectedIndex:i,instanceId:t,listBoxId:r,className:o})}),h.current&&g&&(0,Xr.createPortal)((0,kt.jsx)(w_,{items:p,onSelect:a,selectedIndex:i,instanceId:t,listBoxId:r,className:o,Component:jl}),h.current.ownerDocument.body)]})}}const S_=e=>{if(null===e)return"";switch(typeof e){case"string":case"number":return e.toString();case"object":return e instanceof Array?e.map(S_).join(""):"props"in e?S_(e.props.children):"";default:return""}};var C_=S_;const k_=[],j_={};function E_({record:e,onChange:t,onReplace:n,completers:r,contentRef:o}){const i=(0,d.useInstanceId)(j_),[s,a]=(0,f.useState)(0),[l,c]=(0,f.useState)(k_),[u,h]=(0,f.useState)(""),[p,m]=(0,f.useState)(null),[g,v]=(0,f.useState)(null),b=(0,f.useRef)(!1);function x(r){const{getOptionCompletion:i}=p||{};if(!r.isDisabled){if(i){const o=i(r.value,u),s=(e=>null!==e&&"object"==typeof e&&"action"in e&&void 0!==e.action&&"value"in e&&void 0!==e.value)(o)?o:{action:"insert-at-caret",value:o};if("replace"===s.action)return void n([s.value]);"insert-at-caret"===s.action&&function(n){if(null===p)return;const r=e.start,o=r-p.triggerPrefix.length-u.length,i=(0,gw.create)({html:(0,f.renderToString)(n)});t((0,gw.insert)(e,i,o,r))}(s.value)}y(),o.current?.focus()}}function y(){a(0),c(k_),h(""),m(null),v(null)}const w=(0,f.useMemo)((()=>(0,gw.isCollapsed)(e)?(0,gw.getTextContent)((0,gw.slice)(e,0)):""),[e]);(0,f.useEffect)((()=>{if(!w)return void(p&&y());const t=r.reduce(((e,t)=>w.lastIndexOf(t.triggerPrefix)>(null!==e?w.lastIndexOf(e.triggerPrefix):-1)?t:e),null);if(!t)return void(p&&y());const{allowContext:n,triggerPrefix:o}=t,i=w.lastIndexOf(o),s=w.slice(i+o.length);if(s.length>50)return;const a=0===l.length,c=s.split(/\s/),u=1===c.length,d=b.current&&c.length<=3;if(a&&!d&&!u)return void(p&&y());const f=(0,gw.getTextContent)((0,gw.slice)(e,void 0,(0,gw.getTextContent)(e).length));if(n&&!n(w.slice(0,i),f))return void(p&&y());if(/^\s/.test(s)||/\s\s+$/.test(s))return void(p&&y());if(!/[\u0000-\uFFFF]*$/.test(s))return void(p&&y());const x=_w(t.triggerPrefix),_=mw()(w),S=_.slice(_.lastIndexOf(t.triggerPrefix)).match(new RegExp(`${x}([\0-]*)$`)),C=S&&S[1];m(t),v((()=>t!==p?__(t):g)),h(null===C?"":C)}),[w]);const{key:_=""}=l[s]||{},{className:S}=p||{},C=!!p&&l.length>0,k=C?`components-autocomplete-listbox-${i}`:void 0,j=C?`components-autocomplete-item-${i}-${_}`:null,E=void 0!==e.start,M=!!w&&E&&!!g;return{listBoxId:k,activeId:j,onKeyDown:vy((function(e){if(b.current="Backspace"===e.key,p&&0!==l.length&&!e.defaultPrevented){switch(e.key){case"ArrowUp":{const e=(0===s?l.length:s)-1;a(e),(0,bw.isAppleOS)()&&(0,vw.speak)(C_(l[e].label),"assertive");break}case"ArrowDown":{const e=(s+1)%l.length;a(e),(0,bw.isAppleOS)()&&(0,vw.speak)(C_(l[e].label),"assertive");break}case"Escape":m(null),v(null),e.preventDefault();break;case"Enter":x(l[s]);break;case"ArrowLeft":case"ArrowRight":return void y();default:return}e.preventDefault()}})),popover:M&&(0,kt.jsx)(g,{className:S,filterValue:u,instanceId:i,listBoxId:k,selectedIndex:s,onChangeOptions:function(e){a(e.length===l.length?s:0),c(e)},onSelect:x,value:e,contentRef:o,reset:y})}}function M_(e){const t=(0,f.useRef)(null),n=(0,f.useRef)(),{record:r}=e,o=function(e){const t=(0,f.useRef)(new Set);return t.current.add(e),t.current.size>2&&t.current.delete(Array.from(t.current)[0]),Array.from(t.current)[0]}(r),{popover:i,listBoxId:s,activeId:a,onKeyDown:l}=E_({...e,contentRef:t});n.current=l;const c=(0,d.useMergeRefs)([t,(0,d.useRefEffect)((e=>{function t(e){n.current?.(e)}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[])]);return r.text!==o?.text?{ref:c,children:i,"aria-autocomplete":s?"list":void 0,"aria-owns":s,"aria-activedescendant":a}:{ref:c}}function N_({children:e,isSelected:t,...n}){const{popover:r,...o}=E_(n);return(0,kt.jsxs)(kt.Fragment,{children:[e(o),t&&r]})}function T_(e){const{help:t,id:n,...r}=e,o=(0,d.useInstanceId)(Oy,"wp-components-base-control",n);return{baseControlProps:{id:o,help:t,...r},controlProps:{id:o,...t?{"aria-describedby":`${o}__help`}:{}}}}var P_=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})}),D_=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"})});const I_=Dl("",""),R_={name:"bjn8wh",styles:"position:relative"},O_=e=>{const{color:t=Fl.gray[200],style:n="solid",width:r=Wl.borderWidth}=e||{};return`${t} ${!!r&&"0"!==r||!!t?n||"solid":n} ${r!==Wl.borderWidth?`clamp(1px, ${r}, 10px)`:r}`},A_={name:"1nwbfnf",styles:"grid-column:span 2;margin:0 auto"};function z_(e){const{className:t,size:n="default",...r}=cl(e,"BorderBoxControlLinkedButton"),o=ll();return{...r,className:(0,f.useMemo)((()=>o((e=>Dl("position:absolute;top:","__unstable-large"===e?"8px":"3px",";",kv({right:0})()," line-height:0;",""))(n),t)),[t,o,n])}}var L_=ul(((e,t)=>{const{className:n,isLinked:r,...o}=z_(e),i=r?(0,u.__)("Unlink sides"):(0,u.__)("Link sides");return(0,kt.jsx)(Hy,{...o,size:"small",icon:r?P_:D_,iconSize:24,label:i,ref:t,className:n})}),"BorderBoxControlLinkedButton");function F_(e){const{className:t,value:n,size:r="default",...o}=cl(e,"BorderBoxControlVisualizer"),i=ll(),s=(0,f.useMemo)((()=>i(((e,t)=>Dl("position:absolute;top:","__unstable-large"===t?"20px":"15px",";right:","__unstable-large"===t?"39px":"29px",";bottom:","__unstable-large"===t?"20px":"15px",";left:","__unstable-large"===t?"39px":"29px",";border-top:",O_(e?.top),";border-bottom:",O_(e?.bottom),";",kv({borderLeft:O_(e?.left)})()," ",kv({borderRight:O_(e?.right)})(),";",""))(n,r),t)),[i,t,n,r]);return{...o,className:s,value:n}}var B_=ul(((e,t)=>{const{value:n,...r}=F_(e);return(0,kt.jsx)(kl,{...r,ref:t})}),"BorderBoxControlVisualizer"),V_=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"M5 11.25h14v1.5H5z"})}),W_=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"})}),$_=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{fillRule:"evenodd",d:"M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",clipRule:"evenodd"})});const H_=e=>{const t=Dl("border-color:",Fl.ui.border,";","");return Dl(e&&t," &:hover{border-color:",Fl.ui.borderHover,";}&:focus-within{border-color:",Fl.ui.borderFocus,";box-shadow:",Wl.controlBoxShadowFocus,";z-index:1;outline:2px solid transparent;outline-offset:-2px;}","")};var U_={name:"1aqh2c7",styles:"min-height:40px;padding:3px"},Y_={name:"1ndywgm",styles:"min-height:36px;padding:2px"};const G_=e=>({default:Y_,"__unstable-large":U_}[e]),q_={name:"7whenc",styles:"display:flex;width:100%"},K_=Sl("div",{target:"eakva830"})({name:"zjik7",styles:"display:flex"});function X_(e={}){var t,n=D(e,[]);const r=null==(t=n.store)?void 0:t.getState(),o=vt(P(T({},n),{focusLoop:W(n.focusLoop,null==r?void 0:r.focusLoop,!0)})),i=Ye(P(T({},o.getState()),{value:W(n.value,null==r?void 0:r.value,n.defaultValue,null)}),o,n.store);return P(T(T({},o),i),{setValue:e=>i.setState("value",e)})}function Z_(e={}){const[t,n]=st(X_,e);return function(e,t,n){return it(e=xt(e,t,n),n,"value","setValue"),e}(t,n,e)}var Q_=Tt([At],[zt]),J_=Q_.useContext,eS=(Q_.useScopedContext,Q_.useProviderContext),tS=(Q_.ContextProvider,Q_.ScopedContextProvider),nS=Nt((function(e){var t=e,{store:n}=t,r=_(t,["store"]);const o=eS();return L(n=n||o,!1),r=Ae(r,(e=>(0,kt.jsx)(tS,{value:n,children:e})),[n]),r=y({role:"radiogroup"},r),r=fn(y({store:n},r))})),rS=jt((function(e){return Mt("div",nS(e))}));const oS=(0,f.createContext)({});oS.displayName="ToggleGroupControlContext";var iS=oS;function sS(e){const t=(0,f.useRef)(!0),n=(0,d.usePrevious)(e),r=(0,f.useRef)(!1);(0,f.useEffect)((()=>{t.current&&(t.current=!1)}),[]);const o=r.current||!t.current&&n!==e;return(0,f.useEffect)((()=>{r.current=o}),[o]),o?{value:null!=e?e:"",defaultValue:void 0}:{value:void 0,defaultValue:e}}const aS=(0,f.forwardRef)((function({children:e,isAdaptiveWidth:t,label:n,onChange:r,size:o,value:i,id:s,setSelectedElement:a,...l},c){const h=(0,d.useInstanceId)(aS,"toggle-group-control-as-radio-group"),p=s||h,{value:m,defaultValue:g}=sS(i),v=r?e=>{r(null!=e?e:void 0)}:void 0,b=Z_({defaultValue:g,value:m,setValue:v,rtl:(0,u.isRTL)()}),x=rt(b,"value"),y=b.setValue;(0,f.useEffect)((()=>{""===x&&b.setActiveId(void 0)}),[b,x]);const w=(0,f.useMemo)((()=>({activeItemIsNotFirstItem:()=>b.getState().activeId!==b.first(),baseId:p,isBlock:!t,size:o,value:x,setValue:y,setSelectedElement:a})),[p,t,b,x,a,y,o]);return(0,kt.jsx)(iS.Provider,{value:w,children:(0,kt.jsx)(rS,{store:b,"aria-label":n,render:(0,kt.jsx)(kl,{}),...l,id:p,ref:c,children:e})})}));function lS({defaultValue:e,onChange:t,value:n}){const r=void 0!==n,o=r?n:e,[i,s]=(0,f.useState)(o),a=r?n:i,l=(0,f.useCallback)(((e,...n)=>{s(e),t?.(e,...n)}),[t]);let c;return c=r&&"function"==typeof t?t:r||"function"!=typeof t?s:l,[a,c]}const cS=(0,f.forwardRef)((function({children:e,isAdaptiveWidth:t,label:n,onChange:r,size:o,value:i,id:s,setSelectedElement:a,...l},c){const u=(0,d.useInstanceId)(cS,"toggle-group-control-as-button-group"),h=s||u,{value:p,defaultValue:m}=sS(i),[g,v]=lS({defaultValue:m,value:p,onChange:r}),b=(0,f.useMemo)((()=>({baseId:h,value:g,setValue:v,isBlock:!t,isDeselectable:!0,size:o,setSelectedElement:a})),[h,g,v,t,o,a]);return(0,kt.jsx)(iS.Provider,{value:b,children:(0,kt.jsx)(kl,{"aria-label":n,...l,ref:c,role:"group",children:e})})})),uS={element:void 0,top:0,right:0,bottom:0,left:0,width:0,height:0};function dS(e,t=[]){const[n,r]=(0,f.useState)(uS),o=(0,f.useRef)(),i=(0,d.useEvent)((()=>{if(e&&e.isConnected){const t=function(e){var t,n,r;const o=e.getBoundingClientRect();if(0===o.width||0===o.height)return;const i=e.offsetParent,s=null!==(t=i?.getBoundingClientRect())&&void 0!==t?t:uS,a=null!==(n=i?.scrollLeft)&&void 0!==n?n:0,l=null!==(r=i?.scrollTop)&&void 0!==r?r:0,c=parseFloat(getComputedStyle(e).width),u=parseFloat(getComputedStyle(e).height),d=c/o.width,f=u/o.height;return{element:e,top:(o.top-s?.top)*f+l,right:(s?.right-o.right)*d-a,bottom:(s?.bottom-o.bottom)*f-l,left:(o.left-s?.left)*d+a,width:c,height:u}}(e);if(t)return r(t),clearInterval(o.current),!0}else clearInterval(o.current);return!1})),s=(0,d.useResizeObserver)((()=>{i()||requestAnimationFrame((()=>{i()||(o.current=setInterval(i,100))}))}));return(0,f.useLayoutEffect)((()=>{s(e),e||r(uS)}),[s,e]),(0,f.useLayoutEffect)((()=>{i()}),t),n}function fS(e,t,{prefix:n="subelement",dataAttribute:r=`${n}-animated`,transitionEndFilter:o=()=>!0,roundRect:i=!1}={}){const s=(0,d.useEvent)((()=>{Object.keys(t).forEach((r=>"element"!==r&&e?.style.setProperty(`--${n}-${r}`,String(i?Math.floor(t[r]):t[r]))))}));(0,f.useLayoutEffect)((()=>{s()}),[t,s]),function(e,t){const n=(0,f.useRef)(e),r=(0,d.useEvent)(t);(0,f.useLayoutEffect)((()=>{n.current!==e&&(r({previousValue:n.current}),n.current=e)}),[r,e])}(t.element,(({previousValue:n})=>{t.element&&n&&e?.setAttribute(`data-${r}`,"")})),(0,f.useLayoutEffect)((()=>{function t(t){o(t)&&e?.removeAttribute(`data-${r}`)}return e?.addEventListener("transitionend",t),()=>e?.removeEventListener("transitionend",t)}),[r,e,o])}const hS=ul((function(e,t){const{__nextHasNoMarginBottom:n=!1,__next40pxDefaultSize:r=!1,__shouldNotWarnDeprecated36pxSize:o,className:i,isAdaptiveWidth:s=!1,isBlock:a=!1,isDeselectable:l=!1,label:c,hideLabelFromVision:u=!1,help:h,onChange:p,size:m="default",value:g,children:v,...b}=cl(e,"ToggleGroupControl"),x=r&&"default"===m?"__unstable-large":m,[y,w]=(0,f.useState)(),[_,S]=(0,f.useState)(),C=(0,d.useMergeRefs)([S,t]);fS(_,dS(null!=g?y:void 0),{prefix:"selected",dataAttribute:"indicator-animated",transitionEndFilter:e=>"::before"===e.pseudoElement,roundRect:!0});const k=ll(),j=(0,f.useMemo)((()=>k((({isBlock:e,isDeselectable:t,size:n})=>Dl("background:",Fl.ui.background,";border:1px solid transparent;border-radius:",Wl.radiusSmall,";display:inline-flex;min-width:0;position:relative;",G_(n)," ",!t&&H_(e),"@media not ( prefers-reduced-motion ){&[data-indicator-animated]::before{transition-property:transform,border-radius;transition-duration:0.2s;transition-timing-function:ease-out;}}&::before{content:'';position:absolute;pointer-events:none;background:",Fl.theme.foreground,";outline:2px solid transparent;outline-offset:-3px;--antialiasing-factor:100;border-radius:calc(\n\t\t\t\t",Wl.radiusXSmall," /\n\t\t\t\t\t(\n\t\t\t\t\t\tvar( --selected-width, 0 ) /\n\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t)/",Wl.radiusXSmall,";left:-1px;width:calc( var( --antialiasing-factor ) * 1px );height:calc( var( --selected-height, 0 ) * 1px );transform-origin:left top;transform:translateX( calc( var( --selected-left, 0 ) * 1px ) ) scaleX(\n\t\t\t\tcalc(\n\t\t\t\t\tvar( --selected-width, 0 ) / var( --antialiasing-factor )\n\t\t\t\t)\n\t\t\t);}",""))({isBlock:a,isDeselectable:l,size:x}),a&&q_,i)),[i,k,a,l,x]),E=l?cS:aS;return Ay({componentName:"ToggleGroupControl",size:m,__next40pxDefaultSize:r,__shouldNotWarnDeprecated36pxSize:o}),(0,kt.jsxs)(Oy,{help:h,__nextHasNoMarginBottom:n,__associatedWPComponentName:"ToggleGroupControl",children:[!u&&(0,kt.jsx)(K_,{children:(0,kt.jsx)(Oy.VisualLabel,{children:c})}),(0,kt.jsx)(E,{...b,setSelectedElement:w,className:j,isAdaptiveWidth:s,label:c,onChange:p,ref:C,size:x,value:g,children:v})]})}),"ToggleGroupControl");var pS=hS,mS="input";var gS=Nt((function(e){var t=e,{store:n,name:r,value:o,checked:i}=t,s=_(t,["store","name","value","checked"]);const a=J_();n=n||a;const l=Pe(s.id),c=(0,$.useRef)(null),u=rt(n,(e=>null!=i?i:function(e,t){if(void 0!==t)return null!=e&&null!=t?t===e:!!t}(o,null==e?void 0:e.value)));(0,$.useEffect)((()=>{if(!l)return;if(!u)return;(null==n?void 0:n.getState().activeId)===l||null==n||n.setActiveId(l)}),[n,u,l]);const d=s.onChange,f=function(e,t){return"input"===e&&(!t||"radio"===t)}(De(c,mS),s.type),h=B(s),[p,m]=Re();(0,$.useEffect)((()=>{const e=c.current;e&&(f||(void 0!==u&&(e.checked=u),void 0!==r&&(e.name=r),void 0!==o&&(e.value=`${o}`)))}),[p,f,u,r,o]);const g=Me((e=>{if(h)return e.preventDefault(),void e.stopPropagation();(null==n?void 0:n.getState().value)!==o&&(f||(e.currentTarget.checked=!0,m()),null==d||d(e),e.defaultPrevented||null==n||n.setValue(o))})),v=s.onClick,b=Me((e=>{null==v||v(e),e.defaultPrevented||f||g(e)})),x=s.onFocus,S=Me((e=>{if(null==x||x(e),e.defaultPrevented)return;if(!f)return;if(!n)return;const{moves:t,activeId:r}=n.getState();t&&(l&&r!==l||g(e))}));return s=w(y({id:l,role:f?void 0:"radio",type:f?"radio":void 0,"aria-checked":u},s),{ref:Te(c,s.ref),onChange:g,onClick:b,onFocus:S}),s=An(y({store:n,clickOnEnter:!f},s)),V(y({name:f?r:void 0,value:f?o:void 0,checked:u},s))})),vS=Et(jt((function(e){const t=gS(e);return Mt(mS,t)})));const bS=Sl("div",{target:"et6ln9s1"})({name:"sln1fl",styles:"display:inline-flex;max-width:100%;min-width:0;position:relative"}),xS={name:"82a6rk",styles:"flex:1"},yS=({isDeselectable:e,isIcon:t,isPressed:n,size:r})=>Dl("align-items:center;appearance:none;background:transparent;border:none;border-radius:",Wl.radiusXSmall,";color:",Fl.theme.gray[700],";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;@media not ( prefers-reduced-motion ){transition:background ",Wl.transitionDurationFast," linear,color ",Wl.transitionDurationFast," linear,font-weight 60ms linear;}user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&[disabled]{opacity:0.4;cursor:default;}&:active{background:",Fl.ui.background,";}",e&&_S," ",t&&CS({size:r})," ",n&&wS,";",""),wS=Dl("color:",Fl.theme.foregroundInverted,";&:active{background:transparent;}",""),_S=Dl("color:",Fl.theme.foreground,";&:focus{box-shadow:inset 0 0 0 1px ",Fl.ui.background,",0 0 0 ",Wl.borderWidthFocus," ",Fl.theme.accent,";outline:2px solid transparent;}",""),SS=Sl("div",{target:"et6ln9s0"})("display:flex;font-size:",Wl.fontSize,";line-height:1;"),CS=({size:e="default"})=>Dl("color:",Fl.theme.foreground,";height:",{default:"30px","__unstable-large":"32px"}[e],";aspect-ratio:1;padding-left:0;padding-right:0;",""),{Rp:kS,y0:jS}=t,ES=({showTooltip:e,text:t,children:n})=>e&&t?(0,kt.jsx)(cs,{text:t,placement:"top",children:n}):(0,kt.jsx)(kt.Fragment,{children:n});const MS=ul((function e(t,n){const r=(0,f.useContext)(oS),o=cl({...t,id:(0,d.useInstanceId)(e,r.baseId||"toggle-group-control-option-base")},"ToggleGroupControlOptionBase"),{isBlock:i=!1,isDeselectable:s=!1,size:a="default"}=r,{className:l,isIcon:c=!1,value:u,children:h,showTooltip:p=!1,disabled:m,...g}=o,v=r.value===u,b=ll(),x=(0,f.useMemo)((()=>b(i&&xS)),[b,i]),y=(0,f.useMemo)((()=>b(yS({isDeselectable:s,isIcon:c,isPressed:v,size:a}),l)),[b,s,c,v,a,l]),w={...g,className:y,"data-value":u,ref:n},_=(0,f.useRef)(null);return(0,f.useLayoutEffect)((()=>{v&&_.current&&r.setSelectedElement(_.current)}),[v,r]),(0,kt.jsx)(jS,{ref:_,className:x,children:(0,kt.jsx)(ES,{showTooltip:p,text:g["aria-label"],children:s?(0,kt.jsx)("button",{...w,disabled:m,"aria-pressed":v,type:"button",onClick:()=>{s&&v?r.setValue(void 0):r.setValue(u)},children:(0,kt.jsx)(kS,{children:h})}):(0,kt.jsx)(vS,{disabled:m,onFocusVisible:()=>{(null===r.value||""===r.value)&&!r.activeItemIsNotFirstItem?.()||r.setValue(u)},render:(0,kt.jsx)("button",{type:"button",...w}),value:u,children:(0,kt.jsx)(kS,{children:h})})})})}),"ToggleGroupControlOptionBase");var NS=MS;var TS=(0,f.forwardRef)((function(e,t){const{icon:n,label:r,...o}=e;return(0,kt.jsx)(NS,{...o,isIcon:!0,"aria-label":r,showTooltip:!0,ref:t,children:(0,kt.jsx)(Vy,{icon:n})})}));const PS=[{label:(0,u.__)("Solid"),icon:V_,value:"solid"},{label:(0,u.__)("Dashed"),icon:W_,value:"dashed"},{label:(0,u.__)("Dotted"),icon:$_,value:"dotted"}];var DS=ul((function({onChange:e,...t},n){return(0,kt.jsx)(pS,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,ref:n,isDeselectable:!0,onChange:t=>{e?.(t)},...t,children:PS.map((e=>(0,kt.jsx)(TS,{value:e.value,icon:e.icon,label:e.label},e.value)))})}),"BorderControlStylePicker");var IS=(0,f.forwardRef)((function(e,t){const{className:n,colorValue:r,...o}=e;return(0,kt.jsx)("span",{className:c("component-color-indicator",n),style:{background:r},ref:t,...o})})),RS=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},OS=function(e){return.2126*RS(e.r)+.7152*RS(e.g)+.0722*RS(e.b)};function AS(e){e.prototype.luminance=function(){return e=OS(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,r,o,i,s,a,l,c=t instanceof e?t:new e(t);return i=this.rgba,s=c.toRgb(),n=(a=OS(i))>(l=OS(s))?(a+.05)/(l+.05):(l+.05)/(a+.05),void 0===(r=2)&&(r=0),void 0===o&&(o=Math.pow(10,r)),Math.floor(o*n)/o+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(s=void 0===(i=(n=t).size)?"normal":i,"AAA"===(o=void 0===(r=n.level)?"AA":r)&&"normal"===s?7:"AA"===o&&"large"===s?3:4.5);var n,r,o,i,s}}const zS=ul(((e,t)=>{const{renderContent:n,renderToggle:r,className:o,contentClassName:i,expandOnMobile:s,headerTitle:a,focusOnMount:l,popoverProps:u,onClose:h,onToggle:p,style:m,open:g,defaultOpen:v,position:b,variant:x}=cl(e,"Dropdown");void 0!==b&&Ji()("`position` prop in wp.components.Dropdown",{since:"6.2",alternative:"`popoverProps.placement` prop",hint:"Note that the `position` prop will override any values passed through the `popoverProps.placement` prop."});const[y,w]=(0,f.useState)(null),_=(0,f.useRef)(),[S,C]=lS({defaultValue:v,value:g,onChange:p});function k(){h?.(),C(!1)}const j={isOpen:!!S,onToggle:()=>C(!S),onClose:k},E=!!(u?.anchor||u?.anchorRef||u?.getAnchorRect||u?.anchorRect);return(0,kt.jsxs)("div",{className:o,ref:(0,d.useMergeRefs)([_,t,w]),tabIndex:-1,style:m,children:[r(j),S&&(0,kt.jsx)(y_,{position:b,onClose:k,onFocusOutside:function(){if(!_.current)return;const{ownerDocument:e}=_.current,t=e?.activeElement?.closest('[role="dialog"]');_.current.contains(e.activeElement)||t&&!t.contains(_.current)||k()},expandOnMobile:s,headerTitle:a,focusOnMount:l,offset:13,anchor:E?void 0:y,variant:x,...u,className:c("components-dropdown__content",u?.className,i),children:n(j)})]})}),"Dropdown");var LS=zS;const FS=ul((function(e,t){const n=cl(e,"InputControlSuffixWrapper");return(0,kt.jsx)(nx,{...n,ref:t})}),"InputControlSuffixWrapper");var BS=FS;const VS=({disabled:e})=>e?Dl("color:",Fl.ui.textDisabled,";cursor:default;",""):"";var WS={name:"1lv1yo7",styles:"display:inline-flex"};const $S=({variant:e})=>"minimal"===e?WS:"",HS=Sl(lx,{target:"e1mv6sxx3"})("color:",Fl.theme.foreground,";cursor:pointer;",VS," ",$S,";"),US=({__next40pxDefaultSize:e,multiple:t,selectSize:n="default"})=>{if(t)return;const r={default:{height:40,minHeight:40,paddingTop:0,paddingBottom:0},small:{height:24,minHeight:24,paddingTop:0,paddingBottom:0},compact:{height:32,minHeight:32,paddingTop:0,paddingBottom:0},"__unstable-large":{height:40,minHeight:40,paddingTop:0,paddingBottom:0}};e||(r.default=r.compact);return Dl(r[n]||r.default,"","")},YS=({__next40pxDefaultSize:e,multiple:t,selectSize:n="default"})=>{const r={default:Wl.controlPaddingX,small:Wl.controlPaddingXSmall,compact:Wl.controlPaddingXSmall,"__unstable-large":Wl.controlPaddingX};e||(r.default=r.compact);const o=r[n]||r.default;return kv({paddingLeft:o,paddingRight:o+18,...t?{paddingTop:o,paddingBottom:o}:{}})},GS=({multiple:e})=>({overflow:e?"auto":"hidden"});var qS={name:"n1jncc",styles:"field-sizing:content"};const KS=({variant:e})=>"minimal"===e?qS:"",XS=Sl("select",{target:"e1mv6sxx2"})("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:currentColor;cursor:inherit;display:block;font-family:inherit;margin:0;width:100%;max-width:none;white-space:nowrap;text-overflow:ellipsis;",Yb,";",US,";",YS,";",GS," ",KS,";}"),ZS=Sl("div",{target:"e1mv6sxx1"})("margin-inline-end:",Rl(-1),";line-height:0;path{fill:currentColor;}"),QS=Sl(BS,{target:"e1mv6sxx0"})("position:absolute;pointer-events:none;",kv({right:0}),";");var JS=(0,f.forwardRef)((({icon:e,size:t=24,...n},r)=>(0,f.cloneElement)(e,{width:t,height:t,...n,ref:r}))),eC=(0,kt.jsx)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,kt.jsx)(a.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})});var tC=()=>(0,kt.jsx)(QS,{children:(0,kt.jsx)(ZS,{children:(0,kt.jsx)(JS,{icon:eC,size:18})})});function nC({options:e}){return e.map((({id:e,label:t,value:n,...r},o)=>{const i=e||`${t}-${n}-${o}`;return(0,kt.jsx)("option",{value:n,...r,children:t},i)}))}const rC=(0,f.forwardRef)((function(e,t){const{className:n,disabled:r=!1,help:o,hideLabelFromVision:i,id:s,label:a,multiple:l=!1,onChange:u,options:f=[],size:h="default",value:p,labelPosition:m="top",children:g,prefix:v,suffix:b,variant:x="default",__next40pxDefaultSize:y=!1,__nextHasNoMarginBottom:w=!1,__shouldNotWarnDeprecated36pxSize:_,...S}=ix(e),C=function(e){const t=(0,d.useInstanceId)(rC);return e||`inspector-select-control-${t}`}(s),k=o?`${C}__help`:void 0;if(!f?.length&&!g)return null;const j=c("components-select-control",n);return Ay({componentName:"SelectControl",__next40pxDefaultSize:y,size:h,__shouldNotWarnDeprecated36pxSize:_}),(0,kt.jsx)(Oy,{help:o,id:C,className:j,__nextHasNoMarginBottom:w,__associatedWPComponentName:"SelectControl",children:(0,kt.jsx)(HS,{disabled:r,hideLabelFromVision:i,id:C,isBorderless:"minimal"===x,label:a,size:h,suffix:b||!l&&(0,kt.jsx)(tC,{}),prefix:v,labelPosition:m,__unstableInputWidth:"minimal"===x?"auto":void 0,variant:x,__next40pxDefaultSize:y,children:(0,kt.jsx)(XS,{...S,__next40pxDefaultSize:y,"aria-describedby":k,className:"components-select-control__input",disabled:r,id:C,multiple:l,onChange:t=>{if(e.multiple){const n=Array.from(t.target.options).filter((({selected:e})=>e)).map((({value:e})=>e));e.onChange?.(n,{event:t})}else e.onChange?.(t.target.value,{event:t})},ref:t,selectSize:h,value:p,variant:x,children:g||(0,kt.jsx)(nC,{options:f})})})})}));var oC=rC;const iC={initial:void 0,fallback:""};var sC=function(e,t=iC){const{initial:n,fallback:r}={...iC,...t},[o,i]=(0,f.useState)(e),s=Iv(e);return(0,f.useEffect)((()=>{s&&o&&i(void 0)}),[s,o]),[function(e=[],t){var n;return null!==(n=e.find(Iv))&&void 0!==n?n:t}([e,o,n],r),(0,f.useCallback)((e=>{s||i(e)}),[s])]};function aC(e,t,n){return"number"!=typeof e?null:parseFloat(`${Jy(e,t,n)}`)}const lC=30,cC=()=>Dl({height:lC,minHeight:lC},"",""),uC=12,dC=({__next40pxDefaultSize:e})=>!e&&Dl({minHeight:lC},"",""),fC=Sl("div",{target:"e1epgpqk14"})("-webkit-tap-highlight-color:transparent;align-items:center;display:flex;justify-content:flex-start;padding:0;position:relative;touch-action:none;width:100%;min-height:40px;",dC,";"),hC=({color:e=Fl.ui.borderFocus})=>Dl({color:e},"",""),pC=({marks:e,__nextHasNoMarginBottom:t})=>t?"":Dl({marginBottom:e?16:void 0},"",""),mC=Sl("div",{shouldForwardProp:e=>!["color","__nextHasNoMarginBottom","marks"].includes(e),target:"e1epgpqk13"})("display:block;flex:1;position:relative;width:100%;",hC,";",cC,";",pC,";"),gC=Sl("span",{target:"e1epgpqk12"})("display:flex;margin-top:",4,"px;",kv({marginRight:6}),";"),vC=Sl("span",{target:"e1epgpqk11"})("display:flex;margin-top:",4,"px;",kv({marginLeft:6}),";"),bC=({disabled:e,railColor:t})=>{let n=t||"";return e&&(n=Fl.ui.backgroundDisabled),Dl({background:n},"","")},xC=Sl("span",{target:"e1epgpqk10"})("background-color:",Fl.gray[300],";left:0;pointer-events:none;right:0;display:block;height:",4,"px;position:absolute;margin-top:",13,"px;top:0;border-radius:",Wl.radiusFull,";",bC,";"),yC=({disabled:e,trackColor:t})=>{let n=t||"currentColor";return e&&(n=Fl.gray[400]),Dl({background:n},"","")},wC=Sl("span",{target:"e1epgpqk9"})("background-color:currentColor;border-radius:",Wl.radiusFull,";height:",4,"px;pointer-events:none;display:block;position:absolute;margin-top:",13,"px;top:0;.is-marked &{@media not ( prefers-reduced-motion ){transition:width ease 0.1s;}}",yC,";"),_C=Sl("span",{target:"e1epgpqk8"})({name:"g5kg28",styles:"display:block;pointer-events:none;position:relative;width:100%;user-select:none;margin-top:17px"}),SC=Sl("span",{target:"e1epgpqk7"})("position:absolute;left:0;top:-4px;height:4px;width:2px;transform:translateX( -50% );background-color:",Fl.ui.background,";z-index:1;"),CC=({isFilled:e})=>Dl({color:e?Fl.gray[700]:Fl.gray[300]},"",""),kC=Sl("span",{target:"e1epgpqk6"})("color:",Fl.gray[300],";font-size:11px;position:absolute;top:8px;white-space:nowrap;",kv({left:0}),";",kv({transform:"translateX( -50% )"},{transform:"translateX( 50% )"}),";",CC,";"),jC=({disabled:e})=>Dl("background-color:",e?Fl.gray[400]:Fl.theme.accent,";",""),EC=Sl("span",{target:"e1epgpqk5"})("align-items:center;display:flex;height:",uC,"px;justify-content:center;margin-top:",9,"px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:",uC,"px;border-radius:",Wl.radiusRound,";z-index:3;.is-marked &{@media not ( prefers-reduced-motion ){transition:left ease 0.1s;}}",jC,";",kv({marginLeft:-10}),";",kv({transform:"translateX( 4.5px )"},{transform:"translateX( -4.5px )"}),";"),MC=({isFocused:e})=>e?Dl("&::before{content:' ';position:absolute;background-color:",Fl.theme.accent,";opacity:0.4;border-radius:",Wl.radiusRound,";height:",20,"px;width:",20,"px;top:-4px;left:-4px;}",""):"",NC=Sl("span",{target:"e1epgpqk4"})("align-items:center;border-radius:",Wl.radiusRound,";height:100%;outline:0;position:absolute;user-select:none;width:100%;box-shadow:",Wl.elevationXSmall,";",jC,";",MC,";"),TC=Sl("input",{target:"e1epgpqk3"})("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -",6,"px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ",uC,"px );"),PC=({show:e})=>Dl("display:",e?"inline-block":"none",";opacity:",e?1:0,";@media not ( prefers-reduced-motion ){transition:opacity 120ms ease,display 120ms ease allow-discrete;}@starting-style{opacity:0;}","");var DC={name:"1cypxip",styles:"top:-80%"},IC={name:"1lr98c4",styles:"bottom:-80%"};const RC=({placement:e})=>"bottom"===e?IC:DC,OC=Sl("span",{target:"e1epgpqk2"})("background:rgba( 0, 0, 0, 0.8 );border-radius:",Wl.radiusSmall,";color:white;font-size:12px;min-width:32px;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;user-select:none;line-height:1.4;",PC,";",RC,";",kv({transform:"translateX(-50%)"},{transform:"translateX(50%)"}),";"),AC=Sl(aw,{target:"e1epgpqk1"})("display:inline-block;font-size:13px;margin-top:0;input[type='number']&{",cC,";}",kv({marginLeft:`${Rl(4)} !important`}),";"),zC=Sl("span",{target:"e1epgpqk0"})("display:block;margin-top:0;button,button.is-small{margin-left:0;",cC,";}",kv({marginLeft:8}),";");var LC=(0,f.forwardRef)((function(e,t){const{describedBy:n,label:r,value:o,...i}=e;return(0,kt.jsx)(TC,{...i,"aria-describedby":n,"aria-label":r,"aria-hidden":!1,ref:t,tabIndex:0,type:"range",value:o})}));function FC(e){const{className:t,isFilled:n=!1,label:r,style:o={},...i}=e,s=c("components-range-control__mark",n&&"is-filled",t),a=c("components-range-control__mark-label",n&&"is-filled");return(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(SC,{...i,"aria-hidden":"true",className:s,style:o}),r&&(0,kt.jsx)(kC,{"aria-hidden":"true",className:a,isFilled:n,style:o,children:r})]})}function BC(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:s=0,...a}=e;return(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(xC,{disabled:t,...a}),n&&(0,kt.jsx)(VC,{disabled:t,marks:n,min:r,max:o,step:i,value:s})]})}function VC(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:s=0}=e,a=function({marks:e,min:t=0,max:n=100,step:r=1,value:o=0}){if(!e)return[];const i=n-t;if(!Array.isArray(e)){e=[];const n=1+Math.round(i/r);for(;n>e.push({value:r*e.length+t}););}const s=[];return e.forEach(((e,r)=>{if(e.value<t||e.value>n)return;const a=`mark-${r}`,l=e.value<=o,c=(e.value-t)/i*100+"%",d={[(0,u.isRTL)()?"right":"left"]:c};s.push({...e,isFilled:l,key:a,style:d})})),s}({marks:n,min:r,max:o,step:"any"===i?1:i,value:s});return(0,kt.jsx)(_C,{"aria-hidden":"true",className:"components-range-control__marks",children:a.map((e=>(0,$.createElement)(FC,{...e,key:e.key,"aria-hidden":"true",disabled:t})))})}function WC(e){const{className:t,inputRef:n,tooltipPlacement:r,show:o=!1,style:i={},value:s=0,renderTooltipContent:a=e=>e,zIndex:l=100,...u}=e,d=function({inputRef:e,tooltipPlacement:t}){const[n,r]=(0,f.useState)(),o=(0,f.useCallback)((()=>{e&&e.current&&r(t)}),[t,e]);return(0,f.useEffect)((()=>{o()}),[o]),(0,f.useEffect)((()=>(window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}))),n}({inputRef:n,tooltipPlacement:r}),h=c("components-simple-tooltip",t),p={...i,zIndex:l};return(0,kt.jsx)(OC,{...u,"aria-hidden":"false",className:h,placement:d,show:o,role:"tooltip",style:p,children:a(s)})}const $C=()=>{};function HC({resetFallbackValue:e,initialPosition:t}){return void 0!==e?Number.isNaN(e)?null:e:void 0!==t?Number.isNaN(t)?null:t:null}const UC=(0,f.forwardRef)((function e(t,n){const{__nextHasNoMarginBottom:r=!1,afterIcon:o,allowReset:i=!1,beforeIcon:s,className:a,color:l=Fl.theme.accent,currentInput:h,disabled:p=!1,help:m,hideLabelFromVision:g=!1,initialPosition:v,isShiftStepEnabled:b=!0,label:x,marks:y=!1,max:w=100,min:_=0,onBlur:S=$C,onChange:C=$C,onFocus:k=$C,onMouseLeave:j=$C,onMouseMove:E=$C,railColor:M,renderTooltipContent:N=e=>e,resetFallbackValue:T,__next40pxDefaultSize:P=!1,shiftStep:D=10,showTooltip:I,step:R=1,trackColor:O,value:A,withInputField:z=!0,__shouldNotWarnDeprecated36pxSize:L,...F}=t,[B,V]=function(e){const{min:t,max:n,value:r,initial:o}=e,[i,s]=sC(aC(r,t,n),{initial:aC(null!=o?o:null,t,n),fallback:null});return[i,(0,f.useCallback)((e=>{s(null===e?null:aC(e,t,n))}),[t,n,s])]}({min:_,max:w,value:null!=A?A:null,initial:v}),W=(0,f.useRef)(!1);let $=I,H=z;"any"===R&&($=!1,H=!1);const[U,Y]=(0,f.useState)($),[G,q]=(0,f.useState)(!1),K=(0,f.useRef)(),X=K.current?.matches(":focus"),Z=!p&&G,Q=null===B,J=Q?"":void 0!==B?B:h,ee=Q?(w-_)/2+_:B,te=`${Jy(Q?50:(B-_)/(w-_)*100,0,100)}%`,ne=c("components-range-control",a),re=c("components-range-control__wrapper",!!y&&"is-marked"),oe=(0,d.useInstanceId)(e,"inspector-range-control"),ie=m?`${oe}__help`:void 0,se=!1!==$&&Number.isFinite(B),ae=()=>{const e=Number.isNaN(T)?null:null!=T?T:null;V(e),C(null!=e?e:void 0)},le={[(0,u.isRTL)()?"right":"left"]:te};return Ay({componentName:"RangeControl",__next40pxDefaultSize:P,size:void 0,__shouldNotWarnDeprecated36pxSize:L}),(0,kt.jsx)(Oy,{__nextHasNoMarginBottom:r,__associatedWPComponentName:"RangeControl",className:ne,label:x,hideLabelFromVision:g,id:`${oe}`,help:m,children:(0,kt.jsxs)(fC,{className:"components-range-control__root",__next40pxDefaultSize:P,children:[s&&(0,kt.jsx)(gC,{children:(0,kt.jsx)(Vy,{icon:s})}),(0,kt.jsxs)(mC,{__nextHasNoMarginBottom:r,className:re,color:l,marks:!!y,children:[(0,kt.jsx)(LC,{...F,className:"components-range-control__slider",describedBy:ie,disabled:p,id:`${oe}`,label:x,max:w,min:_,onBlur:e=>{S(e),q(!1),Y(!1)},onChange:e=>{const t=parseFloat(e.target.value);V(t),C(t)},onFocus:e=>{k(e),q(!0),Y(!0)},onMouseMove:E,onMouseLeave:j,ref:(0,d.useMergeRefs)([K,n]),step:R,value:null!=J?J:void 0}),(0,kt.jsx)(BC,{"aria-hidden":!0,disabled:p,marks:y,max:w,min:_,railColor:M,step:R,value:ee}),(0,kt.jsx)(wC,{"aria-hidden":!0,className:"components-range-control__track",disabled:p,style:{width:te},trackColor:O}),(0,kt.jsx)(EC,{className:"components-range-control__thumb-wrapper",style:le,disabled:p,children:(0,kt.jsx)(NC,{"aria-hidden":!0,isFocused:Z,disabled:p})}),se&&(0,kt.jsx)(WC,{className:"components-range-control__tooltip",inputRef:K,tooltipPlacement:"bottom",renderTooltipContent:N,show:X||U,style:le,value:B})]}),o&&(0,kt.jsx)(vC,{children:(0,kt.jsx)(Vy,{icon:o})}),H&&(0,kt.jsx)(AC,{"aria-label":x,className:"components-range-control__number",disabled:p,inputMode:"decimal",isShiftStepEnabled:b,max:w,min:_,onBlur:()=>{W.current&&(ae(),W.current=!1)},onChange:e=>{let t=parseFloat(e);V(t),isNaN(t)?i&&(W.current=!0):((t<_||t>w)&&(t=aC(t,_,w)),C(t),W.current=!1)},shiftStep:D,size:P?"__unstable-large":"default",__unstableInputWidth:Rl(P?20:16),step:R,value:J,__shouldNotWarnDeprecated36pxSize:!0}),i&&(0,kt.jsx)(zC,{children:(0,kt.jsx)(Hy,{className:"components-range-control__reset",accessibleWhenDisabled:!p,disabled:p||B===HC({resetFallbackValue:T,initialPosition:v}),variant:"secondary",size:"small",onClick:ae,children:(0,u.__)("Reset")})})]})})}));var YC=UC;const GC=Sl(aw,{target:"ez9hsf46"})("width:",Rl(24),";"),qC=Sl(oC,{target:"ez9hsf45"})("margin-left:",Rl(-2),";"),KC=Sl(YC,{target:"ez9hsf44"})("flex:1;margin-right:",Rl(2),";"),XC=`\n.react-colorful__interactive {\n\twidth: calc( 100% - ${Rl(2)} );\n\tmargin-left: ${Rl(1)};\n}`,ZC=Sl("div",{target:"ez9hsf43"})("padding-top:",Rl(2),";padding-right:0;padding-left:0;padding-bottom:0;"),QC=Sl(ow,{target:"ez9hsf42"})("padding-left:",Rl(4),";padding-right:",Rl(4),";"),JC=Sl(vv,{target:"ez9hsf41"})("padding-top:",Rl(4),";padding-left:",Rl(4),";padding-right:",Rl(3),";padding-bottom:",Rl(5),";"),ek=Sl("div",{target:"ez9hsf40"})(Sy,";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:",Rl(4),";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:",Wl.radiusFull,";margin-bottom:",Rl(2),";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;@media not ( prefers-reduced-motion ){transition:transform ",Wl.transitionDurationFast," ease-in-out;}}.react-colorful__interactive:focus .react-colorful__pointer{box-shadow:0 0 0 ",Wl.borderWidthFocus," ",Wl.surfaceColor,";border:",Wl.borderWidthFocus," solid black;transform:translate( -50%, -50% ) scale( 1.5 );}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ",Wl.borderWidthFocus," #fff;}",XC,";");var tk=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})}),nk=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})});const rk=e=>{const{color:t,colorType:n}=e,[r,o]=(0,f.useState)(null),i=(0,f.useRef)(),s=(0,d.useCopyToClipboard)((()=>{switch(n){case"hsl":return t.toHslString();case"rgb":return t.toRgbString();default:return t.toHex()}}),(()=>{i.current&&clearTimeout(i.current),o(t.toHex()),i.current=setTimeout((()=>{o(null),i.current=void 0}),3e3)}));(0,f.useEffect)((()=>()=>{i.current&&clearTimeout(i.current)}),[]);const a=r===t.toHex(),l=a?(0,u.__)("Copied!"):(0,u.__)("Copy");return(0,kt.jsx)(cs,{delay:0,hideOnClick:!1,text:l,children:(0,kt.jsx)($y,{size:"compact","aria-label":l,ref:s,icon:a?tk:nk,showTooltip:!1})})};const ok=ul((function(e,t){const n=cl(e,"InputControlPrefixWrapper");return(0,kt.jsx)(nx,{...n,isPrefix:!0,ref:t})}),"InputControlPrefixWrapper");var ik=ok;const sk=({min:e,max:t,label:n,abbreviation:r,onChange:o,value:i})=>(0,kt.jsxs)(ow,{spacing:4,children:[(0,kt.jsx)(GC,{__next40pxDefaultSize:!0,min:e,max:t,label:n,hideLabelFromVision:!0,value:i,onChange:e=>{o(e?"string"!=typeof e?e:parseInt(e,10):0)},prefix:(0,kt.jsx)(ik,{children:(0,kt.jsx)(Rb,{color:Fl.theme.accent,lineHeight:1,children:r})}),spinControls:"none"}),(0,kt.jsx)(KC,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:n,hideLabelFromVision:!0,min:e,max:t,value:i,onChange:o,withInputField:!1})]}),ak=({color:e,onChange:t,enableAlpha:n})=>{const{r,g:o,b:i,a:s}=e.toRgb();return(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(sk,{min:0,max:255,label:"Red",abbreviation:"R",value:r,onChange:e=>t(fb({r:e,g:o,b:i,a:s}))}),(0,kt.jsx)(sk,{min:0,max:255,label:"Green",abbreviation:"G",value:o,onChange:e=>t(fb({r,g:e,b:i,a:s}))}),(0,kt.jsx)(sk,{min:0,max:255,label:"Blue",abbreviation:"B",value:i,onChange:e=>t(fb({r,g:o,b:e,a:s}))}),n&&(0,kt.jsx)(sk,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*s),onChange:e=>t(fb({r,g:o,b:i,a:e/100}))})]})},lk=({color:e,onChange:t,enableAlpha:n})=>{const r=(0,f.useMemo)((()=>e.toHsl()),[e]),[o,i]=(0,f.useState)({...r}),s=e.isEqual(fb(o));(0,f.useEffect)((()=>{s||i(r)}),[r,s]);const a=s?o:r,l=n=>{const r=fb({...a,...n});e.isEqual(r)?i((e=>({...e,...n}))):t(r)};return(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(sk,{min:0,max:359,label:"Hue",abbreviation:"H",value:a.h,onChange:e=>{l({h:e})}}),(0,kt.jsx)(sk,{min:0,max:100,label:"Saturation",abbreviation:"S",value:a.s,onChange:e=>{l({s:e})}}),(0,kt.jsx)(sk,{min:0,max:100,label:"Lightness",abbreviation:"L",value:a.l,onChange:e=>{l({l:e})}}),n&&(0,kt.jsx)(sk,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*a.a),onChange:e=>{l({a:e/100})}})]})},ck=({color:e,onChange:t,enableAlpha:n})=>(0,kt.jsx)(Ly,{prefix:(0,kt.jsx)(ik,{children:(0,kt.jsx)(Rb,{color:Fl.theme.accent,lineHeight:1,children:"#"})}),value:e.toHex().slice(1).toUpperCase(),onChange:e=>{if(!e)return;const n=e.startsWith("#")?e:"#"+e;t(fb(n))},maxLength:n?9:7,label:(0,u.__)("Hex color"),hideLabelFromVision:!0,size:"__unstable-large",__unstableStateReducer:(e,t)=>{const n=t.payload?.event?.nativeEvent;if("insertFromPaste"!==n?.inputType)return{...e};const r=e.value?.startsWith("#")?e.value.slice(1).toUpperCase():e.value?.toUpperCase();return{...e,value:r}},__unstableInputWidth:"9em"}),uk=({colorType:e,color:t,onChange:n,enableAlpha:r})=>{const o={color:t,onChange:n,enableAlpha:r};switch(e){case"hsl":return(0,kt.jsx)(lk,{...o});case"rgb":return(0,kt.jsx)(ak,{...o});default:return(0,kt.jsx)(ck,{...o})}};function dk(){return(dk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function fk(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function hk(e){var t=(0,$.useRef)(e),n=(0,$.useRef)((function(e){t.current&&t.current(e)}));return t.current=e,n.current}var pk=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e<t?t:e},mk=function(e){return"touches"in e},gk=function(e){return e&&e.ownerDocument.defaultView||self},vk=function(e,t,n){var r=e.getBoundingClientRect(),o=mk(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:pk((o.pageX-(r.left+gk(e).pageXOffset))/r.width),top:pk((o.pageY-(r.top+gk(e).pageYOffset))/r.height)}},bk=function(e){!mk(e)&&e.preventDefault()},xk=$.memo((function(e){var t=e.onMove,n=e.onKey,r=fk(e,["onMove","onKey"]),o=(0,$.useRef)(null),i=hk(t),s=hk(n),a=(0,$.useRef)(null),l=(0,$.useRef)(!1),c=(0,$.useMemo)((function(){var e=function(e){bk(e),(mk(e)?e.touches.length>0:e.buttons>0)&&o.current?i(vk(o.current,e,a.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,i=gk(o.current),s=n?i.addEventListener:i.removeEventListener;s(r?"touchmove":"mousemove",e),s(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(bk(t),!function(e,t){return t&&!mk(e)}(t,l.current)&&r)){if(mk(t)){l.current=!0;var s=t.changedTouches||[];s.length&&(a.current=s[0].identifier)}r.focus(),i(vk(r,t,a.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]}),[s,i]),u=c[0],d=c[1],f=c[2];return(0,$.useEffect)((function(){return f}),[f]),$.createElement("div",dk({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:o,onKeyDown:d,tabIndex:0,role:"slider"}))})),yk=function(e){return e.filter(Boolean).join(" ")},wk=function(e){var t=e.color,n=e.left,r=e.top,o=void 0===r?.5:r,i=yk(["react-colorful__pointer",e.className]);return $.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},$.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},_k=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},Sk=(Math.PI,function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:_k(e.h),s:_k(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:_k(o/2),a:_k(r,2)}}),Ck=function(e){var t=Sk(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},kk=function(e){var t=Sk(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},jk=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),s=r*(1-n),a=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:_k(255*[r,a,s,s,l,r][c]),g:_k(255*[l,r,r,a,s,s][c]),b:_k(255*[s,s,l,r,r,a][c]),a:_k(o,2)}},Ek=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?Nk({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},Mk=Ek,Nk=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),s=i-Math.min(t,n,r),a=s?i===t?(n-r)/s:i===n?2+(r-t)/s:4+(t-n)/s:0;return{h:_k(60*(a<0?a+6:a)),s:_k(i?s/i*100:0),v:_k(i/255*100),a:o}},Tk=$.memo((function(e){var t=e.hue,n=e.onChange,r=yk(["react-colorful__hue",e.className]);return $.createElement("div",{className:r},$.createElement(xk,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:pk(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":_k(t),"aria-valuemax":"360","aria-valuemin":"0"},$.createElement(wk,{className:"react-colorful__hue-pointer",left:t/360,color:Ck({h:t,s:100,v:100,a:1})})))})),Pk=$.memo((function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Ck({h:t.h,s:100,v:100,a:1})};return $.createElement("div",{className:"react-colorful__saturation",style:r},$.createElement(xk,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:pk(t.s+100*e.left,0,100),v:pk(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+_k(t.s)+"%, Brightness "+_k(t.v)+"%"},$.createElement(wk,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Ck(t)})))})),Dk=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},Ik=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")};function Rk(e,t,n){var r=hk(n),o=(0,$.useState)((function(){return e.toHsva(t)})),i=o[0],s=o[1],a=(0,$.useRef)({color:t,hsva:i});(0,$.useEffect)((function(){if(!e.equal(t,a.current.color)){var n=e.toHsva(t);a.current={hsva:n,color:t},s(n)}}),[t,e]),(0,$.useEffect)((function(){var t;Dk(i,a.current.hsva)||e.equal(t=e.fromHsva(i),a.current.color)||(a.current={hsva:i,color:t},r(t))}),[i,e,r]);var l=(0,$.useCallback)((function(e){s((function(t){return Object.assign({},t,e)}))}),[]);return[i,l]}var Ok,Ak="undefined"!=typeof window?$.useLayoutEffect:$.useEffect,zk=new Map,Lk=function(e){Ak((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!zk.has(t)){var n=t.createElement("style");n.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',zk.set(t,n);var r=Ok||o.nc;r&&n.setAttribute("nonce",r),t.head.appendChild(n)}}),[])},Fk=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,s=fk(e,["className","colorModel","color","onChange"]),a=(0,$.useRef)(null);Lk(a);var l=Rk(n,o,i),c=l[0],u=l[1],d=yk(["react-colorful",t]);return $.createElement("div",dk({},s,{ref:a,className:d}),$.createElement(Pk,{hsva:c,onChange:u}),$.createElement(Tk,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},Bk=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+kk(Object.assign({},n,{a:0}))+", "+kk(Object.assign({},n,{a:1}))+")"},i=yk(["react-colorful__alpha",t]),s=_k(100*n.a);return $.createElement("div",{className:i},$.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),$.createElement(xk,{onMove:function(e){r({a:e.left})},onKey:function(e){r({a:pk(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},$.createElement(wk,{className:"react-colorful__alpha-pointer",left:n.a,color:kk(n)})))},Vk=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,s=fk(e,["className","colorModel","color","onChange"]),a=(0,$.useRef)(null);Lk(a);var l=Rk(n,o,i),c=l[0],u=l[1],d=yk(["react-colorful",t]);return $.createElement("div",dk({},s,{ref:a,className:d}),$.createElement(Pk,{hsva:c,onChange:u}),$.createElement(Tk,{hue:c.h,onChange:u}),$.createElement(Bk,{hsva:c,onChange:u,className:"react-colorful__last-control"}))},Wk={defaultColor:"rgba(0, 0, 0, 1)",toHsva:Ek,fromHsva:function(e){var t=jk(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:Ik},$k=function(e){return $.createElement(Vk,dk({},e,{colorModel:Wk}))},Hk={defaultColor:"rgb(0, 0, 0)",toHsva:Mk,fromHsva:function(e){var t=jk(e);return"rgb("+t.r+", "+t.g+", "+t.b+")"},equal:Ik},Uk=function(e){return $.createElement(Fk,dk({},e,{colorModel:Hk}))};const Yk=({color:e,enableAlpha:t,onChange:n})=>{const r=t?$k:Uk,o=(0,f.useMemo)((()=>e.toRgbString()),[e]);return(0,kt.jsx)(r,{color:o,onChange:e=>{n(fb(e))},onPointerDown:({currentTarget:e,pointerId:t})=>{e.setPointerCapture(t)},onPointerUp:({currentTarget:e,pointerId:t})=>{e.releasePointerCapture(t)}})};pb([mb]);const Gk=[{label:"RGB",value:"rgb"},{label:"HSL",value:"hsl"},{label:"Hex",value:"hex"}],qk=ul(((e,t)=>{const{enableAlpha:n=!1,color:r,onChange:o,defaultValue:i="#fff",copyFormat:s,...a}=cl(e,"ColorPicker"),[l,c]=lS({onChange:o,value:r,defaultValue:i}),h=(0,f.useMemo)((()=>fb(l||"")),[l]),p=(0,d.useDebounce)(c),m=(0,f.useCallback)((e=>{p(e.toHex())}),[p]),[g,v]=(0,f.useState)(s||"hex");return(0,kt.jsxs)(ek,{ref:t,...a,children:[(0,kt.jsx)(Yk,{onChange:m,color:h,enableAlpha:n}),(0,kt.jsxs)(ZC,{children:[(0,kt.jsxs)(QC,{justify:"space-between",children:[(0,kt.jsx)(qC,{__nextHasNoMarginBottom:!0,size:"compact",options:Gk,value:g,onChange:e=>v(e),label:(0,u.__)("Color format"),hideLabelFromVision:!0,variant:"minimal"}),(0,kt.jsx)(rk,{color:h,colorType:s||g})]}),(0,kt.jsx)(JC,{direction:"column",gap:2,children:(0,kt.jsx)(uk,{colorType:g,color:h,onChange:m,enableAlpha:n})})]})]})}),"ColorPicker");var Kk=qk;function Xk(e){if(void 0!==e)return"string"==typeof e?e:e.hex?e.hex:void 0}const Zk=Ts((e=>{const t=fb(e),n=t.toHex(),r=t.toRgb(),o=t.toHsv(),i=t.toHsl();return{hex:n,rgb:r,hsv:o,hsl:i,source:"hex",oldHue:i.h}}));function Qk(e){const{onChangeComplete:t}=e,n=(0,f.useCallback)((e=>{t(Zk(e))}),[t]);return function(e){return void 0!==e.onChangeComplete||void 0!==e.disableAlpha||"string"==typeof e.color?.hex}(e)?{color:Xk(e.color),enableAlpha:!e.disableAlpha,onChange:n}:{...e,color:e.color,enableAlpha:e.enableAlpha,onChange:e.onChange}}const Jk=e=>(0,kt.jsx)(Kk,{...Qk(e)}),ej=(0,f.createContext)({});ej.displayName="CircularOptionPickerContext";const tj=(0,f.forwardRef)((function(e,t){const{isPressed:n,label:r,...o}=e;return(0,kt.jsx)(Hy,{...o,"aria-pressed":n,ref:t,label:r})}));const nj=(0,f.forwardRef)((function(e,t){const{id:n,isSelected:r,label:o,...i}=e,{setActiveId:s,activeId:a}=(0,f.useContext)(ej);return(0,f.useEffect)((()=>{r&&!a&&window.setTimeout((()=>s?.(n)),0)}),[r,s,a,n]),(0,kt.jsx)(Kn.Item,{render:(0,kt.jsx)(Hy,{...i,role:"option","aria-selected":!!r,ref:t,label:o}),id:n})}));function rj(e){const{actions:t,options:n,baseId:r,className:o,loop:i=!0,children:s,...a}=e,[l,c]=(0,f.useState)(void 0),d=(0,f.useMemo)((()=>({baseId:r,activeId:l,setActiveId:c})),[r,l,c]);return(0,kt.jsx)("div",{className:o,children:(0,kt.jsxs)(ej.Provider,{value:d,children:[(0,kt.jsx)(Kn,{...a,id:r,focusLoop:i,rtl:(0,u.isRTL)(),role:"listbox",activeId:l,setActiveId:c,children:n}),s,t]})})}function oj(e){const{actions:t,options:n,children:r,baseId:o,...i}=e,s=(0,f.useMemo)((()=>({baseId:o})),[o]);return(0,kt.jsx)("div",{...i,role:"group",id:o,children:(0,kt.jsxs)(ej.Provider,{value:s,children:[n,r,t]})})}function ij(e){const{asButtons:t,actions:n,options:r,children:o,className:i,...s}=e,a=(0,d.useInstanceId)(ij,"components-circular-option-picker",s.id),l=t?oj:rj,u=n?(0,kt.jsx)("div",{className:"components-circular-option-picker__custom-clear-wrapper",children:n}):void 0,f=(0,kt.jsx)("div",{className:"components-circular-option-picker__swatches",children:r});return(0,kt.jsx)(l,{...s,baseId:a,className:c("components-circular-option-picker",i),actions:u,options:f,children:o})}ij.Option=function e({className:t,isSelected:n,selectedIconProps:r={},tooltipText:o,...i}){const{baseId:s,setActiveId:a}=(0,f.useContext)(ej),l={id:(0,d.useInstanceId)(e,s||"components-circular-option-picker__option"),className:"components-circular-option-picker__option",__next40pxDefaultSize:!0,...i},u=void 0!==a?(0,kt.jsx)(nj,{...l,label:o,isSelected:n}):(0,kt.jsx)(tj,{...l,label:o,isPressed:n});return(0,kt.jsxs)("div",{className:c(t,"components-circular-option-picker__option-wrapper"),children:[u,n&&(0,kt.jsx)(JS,{icon:tk,...r})]})},ij.OptionGroup=function({className:e,options:t,...n}){const r="aria-label"in n||"aria-labelledby"in n?"group":void 0;return(0,kt.jsx)("div",{...n,role:r,className:c("components-circular-option-picker__option-group","components-circular-option-picker__swatches",e),children:t})},ij.ButtonAction=function({className:e,children:t,...n}){return(0,kt.jsx)(Hy,{__next40pxDefaultSize:!0,className:c("components-circular-option-picker__clear",e),variant:"tertiary",...n,children:t})},ij.DropdownLinkAction=function({buttonProps:e,className:t,dropdownProps:n,linkText:r}){return(0,kt.jsx)(LS,{className:c("components-circular-option-picker__dropdown-link-action",t),renderToggle:({isOpen:t,onToggle:n})=>(0,kt.jsx)(Hy,{"aria-expanded":t,"aria-haspopup":"true",onClick:n,variant:"link",...e,children:r}),...n})};var sj=ij;function aj(e,t,n,r){return{metaProps:e?{asButtons:!0}:{asButtons:!1,loop:t},labelProps:{"aria-labelledby":r,"aria-label":r?void 0:n||(0,u.__)("Custom color picker")}}}var lj=ul((function(e,t){const n=function(e){const{expanded:t=!1,alignment:n="stretch",...r}=cl(e,"VStack");return rw({direction:"column",expanded:t,alignment:n,...r})}(e);return(0,kt.jsx)(kl,{...n,ref:t})}),"VStack");var cj=ul((function(e,t){const n=Fv(e);return(0,kt.jsx)(kl,{as:"span",...n,ref:t})}),"Truncate");const uj=ul((function(e,t){const n=function(e){const{as:t,level:n=2,color:r=Fl.theme.foreground,isBlock:o=!0,weight:i=Wl.fontWeightHeading,...s}=cl(e,"Heading"),a=t||`h${n}`,l={};return"string"==typeof a&&"h"!==a[0]&&(l.role="heading",l["aria-level"]="string"==typeof n?parseInt(n):n),{...Ib({color:r,isBlock:o,weight:i,size:Pb(n),...s}),...l,as:a}}(e);return(0,kt.jsx)(kl,{...n,ref:t})}),"Heading");var dj=uj;const fj=Sl(dj,{target:"ev9wop70"})({name:"13lxv2o",styles:"text-transform:uppercase;line-height:24px;font-weight:500;&&&{font-size:11px;margin-bottom:0;}"}),hj=({paddingSize:e="small"})=>{if("none"===e)return;const t={small:Rl(2),medium:Rl(4)};return Dl("padding:",t[e]||t.small,";","")},pj=Sl("div",{target:"eovvns30"})("margin-left:",Rl(-2),";margin-right:",Rl(-2),";&:first-of-type{margin-top:",Rl(-2),";}&:last-of-type{margin-bottom:",Rl(-2),";}",hj,";");var mj=ul((function(e,t){const{paddingSize:n="small",...r}=cl(e,"DropdownContentWrapper");return(0,kt.jsx)(pj,{...r,paddingSize:n,ref:t})}),"DropdownContentWrapper");pb([mb,AS]);const gj=e=>{const t=/var\(/.test(null!=e?e:""),n=/color-mix\(/.test(null!=e?e:"");return!t&&!n},vj=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.colors)&&!("color"in t);var t}));function bj({className:e,clearColor:t,colors:n,onChange:r,value:o,...i}){const s=(0,f.useMemo)((()=>n.map((({color:e,name:n},i)=>{const s=fb(e),a=o===e;return(0,kt.jsx)(sj.Option,{isSelected:a,selectedIconProps:a?{fill:s.contrast()>s.contrast("#000")?"#fff":"#000"}:{},tooltipText:n||(0,u.sprintf)((0,u.__)("Color code: %s"),e),style:{backgroundColor:e,color:e},onClick:a?t:()=>r(e,i)},`${e}-${i}`)}))),[n,o,r,t]);return(0,kt.jsx)(sj.OptionGroup,{className:e,options:s,...i})}function xj({className:e,clearColor:t,colors:n,onChange:r,value:o,headingLevel:i}){const s=(0,d.useInstanceId)(xj,"color-palette");return 0===n.length?null:(0,kt.jsx)(lj,{spacing:3,className:e,children:n.map((({name:e,colors:n},a)=>{const l=`${s}-${a}`;return(0,kt.jsxs)(lj,{spacing:2,children:[(0,kt.jsx)(fj,{id:l,level:i,children:e}),(0,kt.jsx)(bj,{clearColor:t,colors:n,onChange:e=>r(e,a),value:o,"aria-labelledby":l})]},a)}))})}function yj({isRenderedInSidebar:e,popoverProps:t,...n}){const r=(0,f.useMemo)((()=>({shift:!0,resize:!1,...e?{placement:"left-start",offset:34}:{placement:"bottom",offset:8},...t})),[e,t]);return(0,kt.jsx)(LS,{contentClassName:"components-color-palette__custom-color-dropdown-content",popoverProps:r,...n})}pb([mb,AS]);const wj=(0,f.forwardRef)((function(e,t){const{asButtons:n,loop:r,clearable:o=!0,colors:i=[],disableCustomColors:s=!1,enableAlpha:a=!1,onChange:l,value:d,__experimentalIsRenderedInSidebar:h=!1,headingLevel:p=2,"aria-label":m,"aria-labelledby":g,...v}=e,[b,x]=(0,f.useState)(d),y=(0,f.useCallback)((()=>l(void 0)),[l]),w=(0,f.useCallback)((e=>{x(((e,t)=>{if(!e||!t||gj(e))return e;const{ownerDocument:n}=t,{defaultView:r}=n,o=r?.getComputedStyle(t).backgroundColor;return o?fb(o).toHex():e})(d,e))}),[d]),_=vj(i),S=(0,f.useMemo)((()=>((e,t=[],n=!1)=>{if(!e)return"";const r=!!e&&gj(e),o=r?fb(e).toHex():e,i=n?t:[{colors:t}];for(const{colors:e}of i)for(const{name:t,color:n}of e)if(o===(r?fb(n).toHex():n))return t;return(0,u.__)("Custom")})(d,i,_)),[d,i,_]),C=d?.startsWith("#"),k=d?.replace(/^var\((.+)\)$/,"$1"),j=k?(0,u.sprintf)((0,u.__)('Custom color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),S,k):(0,u.__)("Custom color picker"),E={clearColor:y,onChange:l,value:d},M=!!o&&(0,kt.jsx)(sj.ButtonAction,{onClick:y,accessibleWhenDisabled:!0,disabled:!d,children:(0,u.__)("Clear")}),{metaProps:N,labelProps:T}=aj(n,r,m,g);return(0,kt.jsxs)(lj,{spacing:3,ref:t,...v,children:[!s&&(0,kt.jsx)(yj,{isRenderedInSidebar:h,renderContent:()=>(0,kt.jsx)(mj,{paddingSize:"none",children:(0,kt.jsx)(Jk,{color:b,onChange:e=>l(e),enableAlpha:a})}),renderToggle:({isOpen:e,onToggle:t})=>(0,kt.jsxs)(lj,{className:"components-color-palette__custom-color-wrapper",spacing:0,children:[(0,kt.jsx)("button",{ref:w,className:"components-color-palette__custom-color-button","aria-expanded":e,"aria-haspopup":"true",onClick:t,"aria-label":j,style:{background:d},type:"button"}),(0,kt.jsxs)(lj,{className:"components-color-palette__custom-color-text-wrapper",spacing:.5,children:[(0,kt.jsx)(cj,{className:"components-color-palette__custom-color-name",children:d?S:(0,u.__)("No color selected")}),(0,kt.jsx)(cj,{className:c("components-color-palette__custom-color-value",{"components-color-palette__custom-color-value--is-hex":C}),children:k})]})]})}),(i.length>0||M)&&(0,kt.jsx)(sj,{...N,...T,actions:M,options:_?(0,kt.jsx)(xj,{...E,headingLevel:p,colors:i,value:d}):(0,kt.jsx)(bj,{...E,colors:i,value:d})})]})}));var _j=wj;const Sj=Sl(aw,{target:"e1bagdl32"})("&&&{input{display:block;width:100%;}",Fb,"{transition:box-shadow 0.1s linear;}}"),Cj=({selectSize:e})=>({small:Dl("box-sizing:border-box;padding:2px 1px;width:20px;font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;&:not( :disabled ){color:",Fl.gray[800],";}",""),default:Dl("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:",Rl(2),";padding:",Rl(1),";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;field-sizing:content;&:not( :disabled ){color:",Fl.theme.accent,";}","")}[e]),kj=Sl("div",{target:"e1bagdl31"})("&&&{pointer-events:none;",Cj,";color:",Fl.gray[900],";}"),jj=({selectSize:e="default"})=>({small:Dl("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;",kv({borderTopLeftRadius:0,borderBottomLeftRadius:0})()," &:not(:disabled):hover{background-color:",Fl.gray[100],";}&:focus{border:1px solid ",Fl.ui.borderFocus,";box-shadow:inset 0 0 0 ",Wl.borderWidth+" "+Fl.ui.borderFocus,";outline-offset:0;outline:2px solid transparent;z-index:1;}",""),default:Dl("display:flex;justify-content:center;align-items:center;&:where( :not( :disabled ) ):hover{box-shadow:0 0 0 ",Wl.borderWidth+" "+Fl.ui.borderFocus,";outline:",Wl.borderWidth," solid transparent;}&:focus{box-shadow:0 0 0 ",Wl.borderWidthFocus+" "+Fl.ui.borderFocus,";outline:",Wl.borderWidthFocus," solid transparent;}","")}[e]),Ej=Sl("select",{target:"e1bagdl30"})("&&&{appearance:none;background:transparent;border-radius:",Wl.radiusXSmall,";border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;",Cj,";",jj,";&:not( :disabled ){cursor:pointer;}}");const Mj=Dl("box-shadow:inset ",Wl.controlBoxShadowFocus,";",""),Nj=Dl("border:0;padding:0;margin:0;",Sy,";",""),Tj=Dl(Sj,"{flex:0 0 auto;}",""),Pj=Dl("background:#fff;&&>button{aspect-ratio:1;padding:0;display:flex;align-items:center;justify-content:center;",kv({borderRadius:"2px 0 0 2px"},{borderRadius:"0 2px 2px 0"})()," border:",Wl.borderWidth," solid ",Fl.ui.border,";&:focus,&:hover:not( :disabled ){",Mj," border-color:",Fl.ui.borderFocus,";z-index:1;position:relative;}}",""),Dj=(e,t)=>{const{style:n}=e||{};return Dl("border-radius:",Wl.radiusFull,";border:2px solid transparent;",n?(e=>{const{color:t,style:n}=e||{},r=n&&"none"!==n?Fl.gray[300]:void 0;return Dl("border-style:","none"===n?"solid":n,";border-color:",t||r,";","")})(e):void 0," width:","__unstable-large"===t?"24px":"22px",";height:","__unstable-large"===t?"24px":"22px",";padding:","__unstable-large"===t?"2px":"1px",";&>span{height:",Rl(4),";width:",Rl(4),";background:linear-gradient(\n\t\t\t\t-45deg,\n\t\t\t\ttransparent 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 52%,\n\t\t\t\ttransparent 52%\n\t\t\t);}","")},Ij=Dl("width:",228,"px;>div:first-of-type>",My,"{margin-bottom:0;}&& ",My,"+button:not( .has-text ){min-width:24px;padding:0;}",""),Rj=Dl("",""),Oj=Dl("",""),Aj={name:"1ghe26v",styles:"display:flex;justify-content:flex-end;margin-top:12px"},zj="web"===f.Platform.OS,Lj={px:{value:"px",label:zj?"px":(0,u.__)("Pixels (px)"),a11yLabel:(0,u.__)("Pixels (px)"),step:1},"%":{value:"%",label:zj?"%":(0,u.__)("Percentage (%)"),a11yLabel:(0,u.__)("Percent (%)"),step:.1},em:{value:"em",label:zj?"em":(0,u.__)("Relative to parent font size (em)"),a11yLabel:(0,u._x)("ems","Relative to parent font size (em)"),step:.01},rem:{value:"rem",label:zj?"rem":(0,u.__)("Relative to root font size (rem)"),a11yLabel:(0,u._x)("rems","Relative to root font size (rem)"),step:.01},vw:{value:"vw",label:zj?"vw":(0,u.__)("Viewport width (vw)"),a11yLabel:(0,u.__)("Viewport width (vw)"),step:.1},vh:{value:"vh",label:zj?"vh":(0,u.__)("Viewport height (vh)"),a11yLabel:(0,u.__)("Viewport height (vh)"),step:.1},vmin:{value:"vmin",label:zj?"vmin":(0,u.__)("Viewport smallest dimension (vmin)"),a11yLabel:(0,u.__)("Viewport smallest dimension (vmin)"),step:.1},vmax:{value:"vmax",label:zj?"vmax":(0,u.__)("Viewport largest dimension (vmax)"),a11yLabel:(0,u.__)("Viewport largest dimension (vmax)"),step:.1},ch:{value:"ch",label:zj?"ch":(0,u.__)("Width of the zero (0) character (ch)"),a11yLabel:(0,u.__)("Width of the zero (0) character (ch)"),step:.01},ex:{value:"ex",label:zj?"ex":(0,u.__)("x-height of the font (ex)"),a11yLabel:(0,u.__)("x-height of the font (ex)"),step:.01},cm:{value:"cm",label:zj?"cm":(0,u.__)("Centimeters (cm)"),a11yLabel:(0,u.__)("Centimeters (cm)"),step:.001},mm:{value:"mm",label:zj?"mm":(0,u.__)("Millimeters (mm)"),a11yLabel:(0,u.__)("Millimeters (mm)"),step:.1},in:{value:"in",label:zj?"in":(0,u.__)("Inches (in)"),a11yLabel:(0,u.__)("Inches (in)"),step:.001},pc:{value:"pc",label:zj?"pc":(0,u.__)("Picas (pc)"),a11yLabel:(0,u.__)("Picas (pc)"),step:1},pt:{value:"pt",label:zj?"pt":(0,u.__)("Points (pt)"),a11yLabel:(0,u.__)("Points (pt)"),step:1},svw:{value:"svw",label:zj?"svw":(0,u.__)("Small viewport width (svw)"),a11yLabel:(0,u.__)("Small viewport width (svw)"),step:.1},svh:{value:"svh",label:zj?"svh":(0,u.__)("Small viewport height (svh)"),a11yLabel:(0,u.__)("Small viewport height (svh)"),step:.1},svi:{value:"svi",label:zj?"svi":(0,u.__)("Viewport smallest size in the inline direction (svi)"),a11yLabel:(0,u.__)("Small viewport width or height (svi)"),step:.1},svb:{value:"svb",label:zj?"svb":(0,u.__)("Viewport smallest size in the block direction (svb)"),a11yLabel:(0,u.__)("Small viewport width or height (svb)"),step:.1},svmin:{value:"svmin",label:zj?"svmin":(0,u.__)("Small viewport smallest dimension (svmin)"),a11yLabel:(0,u.__)("Small viewport smallest dimension (svmin)"),step:.1},lvw:{value:"lvw",label:zj?"lvw":(0,u.__)("Large viewport width (lvw)"),a11yLabel:(0,u.__)("Large viewport width (lvw)"),step:.1},lvh:{value:"lvh",label:zj?"lvh":(0,u.__)("Large viewport height (lvh)"),a11yLabel:(0,u.__)("Large viewport height (lvh)"),step:.1},lvi:{value:"lvi",label:zj?"lvi":(0,u.__)("Large viewport width or height (lvi)"),a11yLabel:(0,u.__)("Large viewport width or height (lvi)"),step:.1},lvb:{value:"lvb",label:zj?"lvb":(0,u.__)("Large viewport width or height (lvb)"),a11yLabel:(0,u.__)("Large viewport width or height (lvb)"),step:.1},lvmin:{value:"lvmin",label:zj?"lvmin":(0,u.__)("Large viewport smallest dimension (lvmin)"),a11yLabel:(0,u.__)("Large viewport smallest dimension (lvmin)"),step:.1},dvw:{value:"dvw",label:zj?"dvw":(0,u.__)("Dynamic viewport width (dvw)"),a11yLabel:(0,u.__)("Dynamic viewport width (dvw)"),step:.1},dvh:{value:"dvh",label:zj?"dvh":(0,u.__)("Dynamic viewport height (dvh)"),a11yLabel:(0,u.__)("Dynamic viewport height (dvh)"),step:.1},dvi:{value:"dvi",label:zj?"dvi":(0,u.__)("Dynamic viewport width or height (dvi)"),a11yLabel:(0,u.__)("Dynamic viewport width or height (dvi)"),step:.1},dvb:{value:"dvb",label:zj?"dvb":(0,u.__)("Dynamic viewport width or height (dvb)"),a11yLabel:(0,u.__)("Dynamic viewport width or height (dvb)"),step:.1},dvmin:{value:"dvmin",label:zj?"dvmin":(0,u.__)("Dynamic viewport smallest dimension (dvmin)"),a11yLabel:(0,u.__)("Dynamic viewport smallest dimension (dvmin)"),step:.1},dvmax:{value:"dvmax",label:zj?"dvmax":(0,u.__)("Dynamic viewport largest dimension (dvmax)"),a11yLabel:(0,u.__)("Dynamic viewport largest dimension (dvmax)"),step:.1},svmax:{value:"svmax",label:zj?"svmax":(0,u.__)("Small viewport largest dimension (svmax)"),a11yLabel:(0,u.__)("Small viewport largest dimension (svmax)"),step:.1},lvmax:{value:"lvmax",label:zj?"lvmax":(0,u.__)("Large viewport largest dimension (lvmax)"),a11yLabel:(0,u.__)("Large viewport largest dimension (lvmax)"),step:.1}},Fj=Object.values(Lj),Bj=[Lj.px,Lj["%"],Lj.em,Lj.rem,Lj.vw,Lj.vh],Vj=Lj.px;function Wj(e,t,n){return Hj(t?`${null!=e?e:""}${t}`:e,n)}function $j(e){return Array.isArray(e)&&!!e.length}function Hj(e,t=Fj){let n,r;if(void 0!==e||null===e){n=`${e}`.trim();const t=parseFloat(n);r=isFinite(t)?t:void 0}const o=n?.match(/[\d.\-\+]*\s*(.*)/),i=o?.[1]?.toLowerCase();let s;if($j(t)){const e=t.find((e=>e.value===i));s=e?.value}else s=Vj.value;return[r,s]}const Uj=({units:e=Fj,availableUnits:t=[],defaultValues:n})=>{const r=function(e=[],t){return Array.isArray(t)?t.filter((t=>e.includes(t.value))):[]}(t,e);return n?r.map((e=>{const[t]=n[e.value]?Hj(n[e.value]):[];return{...e,default:t}})):r};const Yj=e=>e.replace(/^var\((.+)\)$/,"$1"),Gj=ul(((e,t)=>{const{__experimentalIsRenderedInSidebar:n,border:r,colors:o,disableCustomColors:i,enableAlpha:s,enableStyle:a,indicatorClassName:l,indicatorWrapperClassName:c,isStyleSettable:d,onReset:h,onColorChange:p,onStyleChange:m,popoverContentClassName:g,popoverControlsClassName:v,resetButtonWrapperClassName:b,size:x,__unstablePopoverProps:y,...w}=function(e){const{border:t,className:n,colors:r=[],enableAlpha:o=!1,enableStyle:i=!0,onChange:s,previousStyleSelection:a,size:l="default",__experimentalIsRenderedInSidebar:c=!1,...u}=cl(e,"BorderControlDropdown"),[d]=Hj(t?.width),h=0===d,p=ll(),m=(0,f.useMemo)((()=>p(Pj,n)),[n,p]),g=(0,f.useMemo)((()=>p(Oj)),[p]),v=(0,f.useMemo)((()=>p(Dj(t,l))),[t,p,l]),b=(0,f.useMemo)((()=>p(Ij)),[p]),x=(0,f.useMemo)((()=>p(Rj)),[p]),y=(0,f.useMemo)((()=>p(Aj)),[p]);return{...u,border:t,className:m,colors:r,enableAlpha:o,enableStyle:i,indicatorClassName:g,indicatorWrapperClassName:v,onColorChange:e=>{s({color:e,style:"none"===t?.style?a:t?.style,width:h&&e?"1px":t?.width})},onStyleChange:e=>{const n=h&&e?"1px":t?.width;s({...t,style:e,width:n})},onReset:()=>{s({...t,color:void 0,style:void 0})},popoverContentClassName:x,popoverControlsClassName:b,resetButtonWrapperClassName:y,size:l,__experimentalIsRenderedInSidebar:c}}(e),{color:_,style:S}=r||{},C=((e,t)=>{if(e&&t){if(vj(t)){let n;return t.some((t=>t.colors.some((t=>t.color===e&&(n=t,!0))))),n}return t.find((t=>t.color===e))}})(_,o),k=((e,t,n,r)=>{if(r){if(t){const e=Yj(t.color);return n?(0,u.sprintf)((0,u.__)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s". The currently selected style is "%3$s".'),t.name,e,n):(0,u.sprintf)((0,u.__)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),t.name,e)}if(e){const t=Yj(e);return n?(0,u.sprintf)((0,u.__)('Border color and style picker. The currently selected color has a value of "%1$s". The currently selected style is "%2$s".'),t,n):(0,u.sprintf)((0,u.__)('Border color and style picker. The currently selected color has a value of "%s".'),t)}return(0,u.__)("Border color and style picker.")}return t?(0,u.sprintf)((0,u.__)('Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),t.name,Yj(t.color)):e?(0,u.sprintf)((0,u.__)('Border color picker. The currently selected color has a value of "%s".'),Yj(e)):(0,u.__)("Border color picker.")})(_,C,S,a),j=_||S&&"none"!==S,E=n?"bottom left":void 0;return(0,kt.jsx)(LS,{renderToggle:({onToggle:e})=>(0,kt.jsx)(Hy,{onClick:e,variant:"tertiary","aria-label":k,tooltipPosition:E,label:(0,u.__)("Border color and style picker"),showTooltip:!0,__next40pxDefaultSize:"__unstable-large"===x,children:(0,kt.jsx)("span",{className:c,children:(0,kt.jsx)(IS,{className:l,colorValue:_})})}),renderContent:()=>(0,kt.jsx)(kt.Fragment,{children:(0,kt.jsxs)(mj,{paddingSize:"medium",children:[(0,kt.jsxs)(lj,{className:v,spacing:6,children:[(0,kt.jsx)(_j,{className:g,value:_,onChange:p,colors:o,disableCustomColors:i,__experimentalIsRenderedInSidebar:n,clearable:!1,enableAlpha:s}),a&&d&&(0,kt.jsx)(DS,{label:(0,u.__)("Style"),value:S,onChange:m})]}),(0,kt.jsx)("div",{className:b,children:(0,kt.jsx)(Hy,{variant:"tertiary",onClick:()=>{h()},disabled:!j,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,u.__)("Reset")})})]})}),popoverProps:{...y},...w,ref:t})}),"BorderControlDropdown");var qj=Gj;var Kj=(0,f.forwardRef)((function({className:e,isUnitSelectTabbable:t=!0,onChange:n,size:r="default",unit:o="px",units:i=Bj,...s},a){if(!$j(i)||1===i?.length)return(0,kt.jsx)(kj,{className:"components-unit-control__unit-label",selectSize:r,children:o});const l=c("components-unit-control__select",e);return(0,kt.jsx)(Ej,{ref:a,className:l,onChange:e=>{const{value:t}=e.target,r=i.find((e=>e.value===t));n?.(t,{event:e,data:r})},selectSize:r,tabIndex:t?void 0:-1,value:o,...s,children:i.map((e=>(0,kt.jsx)("option",{value:e.value,children:e.label},e.value)))})}));const Xj=(0,f.forwardRef)((function(e,t){const{__unstableStateReducer:n,autoComplete:r="off",children:o,className:i,disabled:s=!1,disableUnits:a=!1,isPressEnterToChange:l=!1,isResetValueOnUnitChange:d=!1,isUnitSelectTabbable:h=!0,label:p,onChange:m,onUnitChange:g,size:v="default",unit:b,units:x=Bj,value:y,onFocus:w,__shouldNotWarnDeprecated36pxSize:_,...S}=ix(e);Ay({componentName:"UnitControl",__next40pxDefaultSize:S.__next40pxDefaultSize,size:v,__shouldNotWarnDeprecated36pxSize:_}),"unit"in e&&Ji()("UnitControl unit prop",{since:"5.6",hint:"The unit should be provided within the `value` prop.",version:"6.2"});const C=null!=y?y:void 0,[k,j]=(0,f.useMemo)((()=>{const e=function(e,t,n=Fj){const r=Array.isArray(n)?[...n]:[],[,o]=Wj(e,t,Fj);return o&&!r.some((e=>e.value===o))&&Lj[o]&&r.unshift(Lj[o]),r}(C,b,x),[{value:t=""}={},...n]=e,r=n.reduce(((e,{value:t})=>{const n=_w(t?.substring(0,1)||"");return e.includes(n)?e:`${e}|${n}`}),_w(t.substring(0,1)));return[e,new RegExp(`^(?:${r})$`,"i")]}),[C,b,x]),[E,M]=Wj(C,b,k),[N,T]=sC(1===k.length?k[0].value:b,{initial:M,fallback:""});(0,f.useEffect)((()=>{void 0!==M&&T(M)}),[M,T]);const P=c("components-unit-control","components-unit-control-wrapper",i);let D;!a&&h&&k.length&&(D=e=>{S.onKeyDown?.(e),e.metaKey||e.ctrlKey||!j.test(e.key)||I.current?.focus()});const I=(0,f.useRef)(null),R=a?null:(0,kt.jsx)(Kj,{ref:I,"aria-label":(0,u.__)("Select unit"),disabled:s,isUnitSelectTabbable:h,onChange:(e,t)=>{const{data:n}=t;let r=`${null!=E?E:""}${e}`;d&&void 0!==n?.default&&(r=`${n.default}${e}`),m?.(r,t),g?.(e,t),T(e)},size:["small","compact"].includes(v)||"default"===v&&!S.__next40pxDefaultSize?"small":"default",unit:N,units:k,onFocus:w,onBlur:e.onBlur});let O=S.step;if(!O&&k){var A;const e=k.find((e=>e.value===N));O=null!==(A=e?.step)&&void 0!==A?A:1}return(0,kt.jsx)(Sj,{...S,__shouldNotWarnDeprecated36pxSize:!0,autoComplete:r,className:P,disabled:s,spinControls:"none",isPressEnterToChange:l,label:p,onKeyDown:D,onChange:(e,t)=>{if(""===e||null==e)return void m?.("",t);const n=function(e,t,n,r){const[o,i]=Hj(e,t),s=null!=o?o:n;let a=i||r;return!a&&$j(t)&&(a=t[0].value),[s,a]}(e,k,E,N).join("");m?.(n,t)},ref:t,size:v,suffix:R,type:l?"text":"number",value:null!=E?E:"",step:O,onFocus:w,__unstableStateReducer:n})}));var Zj=Xj;const Qj=e=>void 0!==e?.width&&""!==e.width||void 0!==e?.color;function Jj(e){const{className:t,colors:n=[],isCompact:r,onChange:o,enableAlpha:i=!0,enableStyle:s=!0,shouldSanitizeBorder:a=!0,size:l="default",value:c,width:u,__experimentalIsRenderedInSidebar:d=!1,__next40pxDefaultSize:h,__shouldNotWarnDeprecated36pxSize:p,...m}=cl(e,"BorderControl");Ay({componentName:"BorderControl",__next40pxDefaultSize:h,size:l,__shouldNotWarnDeprecated36pxSize:p});const g="default"===l&&h?"__unstable-large":l,[v,b]=Hj(c?.width),x=b||"px",y=0===v,[w,_]=(0,f.useState)(),[S,C]=(0,f.useState)(),k=!a||Qj(c),j=(0,f.useCallback)((e=>{!a||Qj(e)?o(e):o(void 0)}),[o,a]),E=(0,f.useCallback)((e=>{const t=""===e?void 0:e,[n]=Hj(e),r=0===n,o={...c,width:t};r&&!y&&(_(c?.color),C(c?.style),o.color=void 0,o.style="none"),!r&&y&&(void 0===o.color&&(o.color=w),"none"===o.style&&(o.style=S)),j(o)}),[c,y,w,S,j]),M=(0,f.useCallback)((e=>{E(`${e}${x}`)}),[E,x]),N=ll(),T=(0,f.useMemo)((()=>N(Nj,t)),[t,N]);let P=u;r&&(P="__unstable-large"===l?"116px":"90px");const D=(0,f.useMemo)((()=>{const e=!!P&&Tj,t=(e=>Dl("height:","__unstable-large"===e?"40px":"30px",";",""))(g);return N(Dl(Sj,"{flex:1 1 40%;}&& ",Ej,"{min-height:0;}",""),e,t)}),[P,N,g]),I=(0,f.useMemo)((()=>N(Dl("flex:1 1 60%;",kv({marginRight:Rl(3)})(),";",""))),[N]);return{...m,className:T,colors:n,enableAlpha:i,enableStyle:s,innerWrapperClassName:D,inputWidth:P,isStyleSettable:k,onBorderChange:j,onSliderChange:M,onWidthChange:E,previousStyleSelection:S,sliderClassName:I,value:c,widthUnit:x,widthValue:v,size:g,__experimentalIsRenderedInSidebar:d,__next40pxDefaultSize:h}}const eE=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,kt.jsx)(jl,{as:"legend",children:t}):(0,kt.jsx)(My,{as:"legend",children:t}):null},tE=ul(((e,t)=>{const{__next40pxDefaultSize:n=!1,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:s,enableStyle:a,hideLabelFromVision:l,innerWrapperClassName:c,inputWidth:d,isStyleSettable:f,label:h,onBorderChange:p,onSliderChange:m,onWidthChange:g,placeholder:v,__unstablePopoverProps:b,previousStyleSelection:x,showDropdownHeader:y,size:w,sliderClassName:_,value:S,widthUnit:C,widthValue:k,withSlider:j,__experimentalIsRenderedInSidebar:E,...M}=Jj(e);return(0,kt.jsxs)(kl,{as:"fieldset",...M,ref:t,children:[(0,kt.jsx)(eE,{label:h,hideLabelFromVision:l}),(0,kt.jsxs)(ow,{spacing:4,className:c,children:[(0,kt.jsx)(Zj,{__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0,prefix:(0,kt.jsx)(Mv,{marginRight:1,marginBottom:0,children:(0,kt.jsx)(qj,{border:S,colors:r,__unstablePopoverProps:b,disableCustomColors:o,enableAlpha:s,enableStyle:a,isStyleSettable:f,onChange:p,previousStyleSelection:x,__experimentalIsRenderedInSidebar:E,size:w})}),label:(0,u.__)("Border width"),hideLabelFromVision:!0,min:0,onChange:g,value:S?.width||"",placeholder:v,disableUnits:i,__unstableInputWidth:d,size:w}),j&&(0,kt.jsx)(YC,{__nextHasNoMarginBottom:!0,label:(0,u.__)("Border width"),hideLabelFromVision:!0,className:_,initialPosition:0,max:100,min:0,onChange:m,step:["px","%"].includes(C)?1:.1,value:k||void 0,withInputField:!1,__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0})]})]})}),"BorderControl");var nE=tE;const rE={bottom:{alignItems:"flex-end",justifyContent:"center"},bottomLeft:{alignItems:"flex-start",justifyContent:"flex-end"},bottomRight:{alignItems:"flex-end",justifyContent:"flex-end"},center:{alignItems:"center",justifyContent:"center"},spaced:{alignItems:"center",justifyContent:"space-between"},left:{alignItems:"center",justifyContent:"flex-start"},right:{alignItems:"center",justifyContent:"flex-end"},stretch:{alignItems:"stretch"},top:{alignItems:"flex-start",justifyContent:"center"},topLeft:{alignItems:"flex-start",justifyContent:"flex-start"},topRight:{alignItems:"flex-start",justifyContent:"flex-end"}};function oE(e){const{align:t,alignment:n,className:r,columnGap:o,columns:i=2,gap:s=3,isInline:a=!1,justify:l,rowGap:c,rows:u,templateColumns:d,templateRows:h,...p}=cl(e,"Grid"),m=cv(Array.isArray(i)?i:[i]),g=cv(Array.isArray(u)?u:[u]),v=d||!!i&&`repeat( ${m}, 1fr )`,b=h||!!u&&`repeat( ${g}, 1fr )`,x=ll();return{...p,className:(0,f.useMemo)((()=>{const e=function(e){return e?rE[e]:{}}(n),i=Dl({alignItems:t,display:a?"inline-grid":"grid",gap:`calc( ${Wl.gridBase} * ${s} )`,gridTemplateColumns:v||void 0,gridTemplateRows:b||void 0,gridRowGap:c,gridColumnGap:o,justifyContent:l,verticalAlign:a?"middle":void 0,...e},"","");return x(i,r)}),[t,n,r,o,x,s,v,b,a,l,c])}}var iE=ul((function(e,t){const n=oE(e);return(0,kt.jsx)(kl,{...n,ref:t})}),"Grid");function sE(e){const{className:t,colors:n=[],enableAlpha:r=!1,enableStyle:o=!0,size:i="default",__experimentalIsRenderedInSidebar:s=!1,...a}=cl(e,"BorderBoxControlSplitControls"),l=ll(),c=(0,f.useMemo)((()=>l((e=>Dl("position:relative;flex:1;width:","__unstable-large"===e?void 0:"80%",";",""))(i),t)),[l,t,i]);return{...a,centeredClassName:(0,f.useMemo)((()=>l(A_,t)),[l,t]),className:c,colors:n,enableAlpha:r,enableStyle:o,rightAlignedClassName:(0,f.useMemo)((()=>l(Dl(kv({marginLeft:"auto"})(),";",""),t)),[l,t]),size:i,__experimentalIsRenderedInSidebar:s}}const aE=ul(((e,t)=>{const{centeredClassName:n,colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:s,onChange:a,popoverPlacement:l,popoverOffset:c,rightAlignedClassName:h,size:p="default",value:m,__experimentalIsRenderedInSidebar:g,...v}=sE(e),[b,x]=(0,f.useState)(null),y=(0,f.useMemo)((()=>l?{placement:l,offset:c,anchor:b,shift:!0}:void 0),[l,c,b]),w={colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:s,isCompact:!0,__experimentalIsRenderedInSidebar:g,size:p,__shouldNotWarnDeprecated36pxSize:!0},_=(0,d.useMergeRefs)([x,t]);return(0,kt.jsxs)(iE,{...v,ref:_,gap:3,children:[(0,kt.jsx)(B_,{value:m,size:p}),(0,kt.jsx)(nE,{className:n,hideLabelFromVision:!0,label:(0,u.__)("Top border"),onChange:e=>a(e,"top"),__unstablePopoverProps:y,value:m?.top,...w}),(0,kt.jsx)(nE,{hideLabelFromVision:!0,label:(0,u.__)("Left border"),onChange:e=>a(e,"left"),__unstablePopoverProps:y,value:m?.left,...w}),(0,kt.jsx)(nE,{className:h,hideLabelFromVision:!0,label:(0,u.__)("Right border"),onChange:e=>a(e,"right"),__unstablePopoverProps:y,value:m?.right,...w}),(0,kt.jsx)(nE,{className:n,hideLabelFromVision:!0,label:(0,u.__)("Bottom border"),onChange:e=>a(e,"bottom"),__unstablePopoverProps:y,value:m?.bottom,...w})]})}),"BorderBoxControlSplitControls");var lE=aE;const cE=/^([\d.\-+]*)\s*(fr|cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax|%|cap|ic|rlh|vi|vb|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx|svw|lvw|dvw|svh|lvh|dvh|svi|lvi|dvi|svb|lvb|dvb|svmin|lvmin|dvmin|svmax|lvmax|dvmax)?$/;const uE=["top","right","bottom","left"],dE=["color","style","width"],fE=e=>!e||!dE.some((t=>void 0!==e[t])),hE=e=>{if(!e)return!1;if(pE(e)){return!uE.every((t=>fE(e[t])))}return!fE(e)},pE=(e={})=>Object.keys(e).some((e=>-1!==uE.indexOf(e))),mE=e=>{if(!pE(e))return!1;const t=uE.map((t=>gE(e?.[t])));return!t.every((e=>e===t[0]))},gE=(e,t)=>{if(fE(e))return t;const{color:n,style:r,width:o}=t||{},{color:i=n,style:s=r,width:a=o}=e;return[a,!!a&&"0"!==a||!!i?s||"solid":s,i].filter(Boolean).join(" ")},vE=e=>function(e){if(0===e.length)return;const t={};let n,r=0;return e.forEach((e=>{t[e]=void 0===t[e]?1:t[e]+1,t[e]>r&&(n=e,r=t[e])})),n}(e.map((e=>void 0===e?void 0:function(e){const t=e.trim().match(cE);if(!t)return[void 0,void 0];const[,n,r]=t;let o=parseFloat(n);return o=Number.isNaN(o)?void 0:o,[o,r]}(`${e}`)[1])).filter((e=>void 0!==e)));function bE(e){const{className:t,colors:n=[],onChange:r,enableAlpha:o=!1,enableStyle:i=!0,size:s="default",value:a,__experimentalIsRenderedInSidebar:l=!1,__next40pxDefaultSize:c,...u}=cl(e,"BorderBoxControl");Ay({componentName:"BorderBoxControl",__next40pxDefaultSize:c,size:s});const d="default"===s&&c?"__unstable-large":s,h=mE(a),p=pE(a),m=p?(e=>{if(!e)return;const t=[],n=[],r=[];uE.forEach((o=>{t.push(e[o]?.color),n.push(e[o]?.style),r.push(e[o]?.width)}));const o=t.every((e=>e===t[0])),i=n.every((e=>e===n[0])),s=r.every((e=>e===r[0]));return{color:o?t[0]:void 0,style:i?n[0]:void 0,width:s?r[0]:vE(r)}})(a):a,g=p?a:(e=>{if(e&&!fE(e))return{top:e,right:e,bottom:e,left:e}})(a),v=!isNaN(parseFloat(`${m?.width}`)),[b,x]=(0,f.useState)(!h),y=ll(),w=(0,f.useMemo)((()=>y(I_,t)),[y,t]),_=(0,f.useMemo)((()=>y(Dl("flex:1;",kv({marginRight:"24px"})(),";",""))),[y]),S=(0,f.useMemo)((()=>y(R_)),[y]);return{...u,className:w,colors:n,disableUnits:h&&!v,enableAlpha:o,enableStyle:i,hasMixedBorders:h,isLinked:b,linkedControlClassName:_,onLinkedChange:e=>{if(!e)return r(void 0);if(!h||(t=e)&&dE.every((e=>void 0!==t[e])))return r(fE(e)?void 0:e);var t;const n=((e,t)=>{const n={};return e.color!==t.color&&(n.color=t.color),e.style!==t.style&&(n.style=t.style),e.width!==t.width&&(n.width=t.width),n})(m,e),o={top:{...a?.top,...n},right:{...a?.right,...n},bottom:{...a?.bottom,...n},left:{...a?.left,...n}};if(mE(o))return r(o);const i=fE(o.top)?void 0:o.top;r(i)},onSplitChange:(e,t)=>{const n={...g,[t]:e};mE(n)?r(n):r(e)},toggleLinked:()=>x(!b),linkedValue:m,size:d,splitValue:g,wrapperClassName:S,__experimentalIsRenderedInSidebar:l}}const xE=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,kt.jsx)(jl,{as:"label",children:t}):(0,kt.jsx)(My,{children:t}):null},yE=ul(((e,t)=>{const{className:n,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:s,enableStyle:a,hasMixedBorders:l,hideLabelFromVision:c,isLinked:h,label:p,linkedControlClassName:m,linkedValue:g,onLinkedChange:v,onSplitChange:b,popoverPlacement:x,popoverOffset:y,size:w,splitValue:_,toggleLinked:S,wrapperClassName:C,__experimentalIsRenderedInSidebar:k,...j}=bE(e),[E,M]=(0,f.useState)(null),N=(0,f.useMemo)((()=>x?{placement:x,offset:y,anchor:E,shift:!0}:void 0),[x,y,E]),T=(0,d.useMergeRefs)([M,t]);return(0,kt.jsxs)(kl,{className:n,...j,ref:T,children:[(0,kt.jsx)(xE,{label:p,hideLabelFromVision:c}),(0,kt.jsxs)(kl,{className:C,children:[h?(0,kt.jsx)(nE,{className:m,colors:r,disableUnits:i,disableCustomColors:o,enableAlpha:s,enableStyle:a,onChange:v,placeholder:l?(0,u.__)("Mixed"):void 0,__unstablePopoverProps:N,shouldSanitizeBorder:!1,value:g,withSlider:!0,width:"__unstable-large"===w?"116px":"110px",__experimentalIsRenderedInSidebar:k,__shouldNotWarnDeprecated36pxSize:!0,size:w}):(0,kt.jsx)(lE,{colors:r,disableCustomColors:o,enableAlpha:s,enableStyle:a,onChange:b,popoverPlacement:x,popoverOffset:y,value:_,__experimentalIsRenderedInSidebar:k,size:w}),(0,kt.jsx)(L_,{onClick:S,isLinked:h,size:w})]})]})}),"BorderBoxControl");var wE=yE,_E=(0,kt.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,kt.jsx)(a.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,kt.jsx)(a.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]});const SE={px:{max:300,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:10,step:.1},rm:{max:10,step:.1},svw:{max:100,step:1},lvw:{max:100,step:1},dvw:{max:100,step:1},svh:{max:100,step:1},lvh:{max:100,step:1},dvh:{max:100,step:1},vi:{max:100,step:1},svi:{max:100,step:1},lvi:{max:100,step:1},dvi:{max:100,step:1},vb:{max:100,step:1},svb:{max:100,step:1},lvb:{max:100,step:1},dvb:{max:100,step:1},vmin:{max:100,step:1},svmin:{max:100,step:1},lvmin:{max:100,step:1},dvmin:{max:100,step:1},vmax:{max:100,step:1},svmax:{max:100,step:1},lvmax:{max:100,step:1},dvmax:{max:100,step:1}},CE={all:(0,u.__)("All sides"),top:(0,u.__)("Top side"),bottom:(0,u.__)("Bottom side"),left:(0,u.__)("Left side"),right:(0,u.__)("Right side"),vertical:(0,u.__)("Top and bottom sides"),horizontal:(0,u.__)("Left and right sides")},kE={top:void 0,right:void 0,bottom:void 0,left:void 0},jE=["top","right","bottom","left"];function EE(e={},t=jE){const n=TE(t);return n.some((t=>e[t]!==e[n[0]]))}function ME(e){return e&&Object.values(e).filter((e=>!!e&&/\d/.test(e))).length>0}function NE(e,t){let n="all";return e||(n=t?"vertical":"top"),n}function TE(e){const t=[];if(!e?.length)return jE;if(e.includes("vertical"))t.push("top","bottom");else if(e.includes("horizontal"))t.push("left","right");else{const n=jE.filter((t=>e.includes(t)));t.push(...n)}return t}function PE(e,t,n){Ji()("applyValueToSides",{since:"6.8",version:"7.0"});const r={...e};return n?.length?n.forEach((e=>{"vertical"===e?(r.top=t,r.bottom=t):"horizontal"===e?(r.left=t,r.right=t):r[e]=t})):jE.forEach((e=>r[e]=t)),r}function DE(e){const t=new Set(e?[]:jE);return e?.forEach((e=>{"vertical"===e?(t.add("top"),t.add("bottom")):"horizontal"===e?(t.add("right"),t.add("left")):t.add(e)})),t}function IE(e,t){return e.startsWith(`var:preset|${t}|`)}const RE=Sl("span",{target:"e1j5nr4z8"})({name:"1w884gc",styles:"box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px"}),OE=Sl("span",{target:"e1j5nr4z7"})({name:"i6vjox",styles:"box-sizing:border-box;display:block;position:relative;width:100%;height:100%"}),AE=({isFocused:e})=>Dl({backgroundColor:"currentColor",opacity:e?1:.3},"",""),zE=Sl("span",{target:"e1j5nr4z6"})("box-sizing:border-box;display:block;pointer-events:none;position:absolute;",AE,";"),LE=Sl(zE,{target:"e1j5nr4z5"})({name:"1k2w39q",styles:"bottom:3px;top:3px;width:2px"}),FE=Sl(zE,{target:"e1j5nr4z4"})({name:"1q9b07k",styles:"height:2px;left:3px;right:3px"}),BE=Sl(FE,{target:"e1j5nr4z3"})({name:"abcix4",styles:"top:0"}),VE=Sl(LE,{target:"e1j5nr4z2"})({name:"1wf8jf",styles:"right:0"}),WE=Sl(FE,{target:"e1j5nr4z1"})({name:"8tapst",styles:"bottom:0"}),$E=Sl(LE,{target:"e1j5nr4z0"})({name:"1ode3cm",styles:"left:0"});function HE({size:e=24,side:t="all",sides:n,...r}){const o=e=>!(e=>n?.length&&!n.includes(e))(e)&&("all"===t||t===e),i=o("top")||o("vertical"),s=o("right")||o("horizontal"),a=o("bottom")||o("vertical"),l=o("left")||o("horizontal"),c=e/24;return(0,kt.jsx)(RE,{style:{transform:`scale(${c})`},...r,children:(0,kt.jsxs)(OE,{children:[(0,kt.jsx)(BE,{isFocused:i}),(0,kt.jsx)(VE,{isFocused:s}),(0,kt.jsx)(WE,{isFocused:a}),(0,kt.jsx)($E,{isFocused:l})]})})}const UE=Sl(Zj,{target:"e1jovhle5"})({name:"1ejyr19",styles:"max-width:90px"}),YE=Sl(ow,{target:"e1jovhle4"})({name:"1j1lmoi",styles:"grid-column:1/span 3"}),GE=Sl(Hy,{target:"e1jovhle3"})({name:"tkya7b",styles:"grid-area:1/2;justify-self:end"}),qE=Sl("div",{target:"e1jovhle2"})({name:"1dfa8al",styles:"grid-area:1/3;justify-self:end"}),KE=Sl(HE,{target:"e1jovhle1"})({name:"ou8xsw",styles:"flex:0 0 auto"}),XE=Sl(YC,{target:"e1jovhle0"})("width:100%;margin-inline-end:",Rl(2),";"),ZE=()=>{};function QE(e,t,n){const r=DE(t);let o=[];switch(e){case"all":o=["top","bottom","left","right"];break;case"horizontal":o=["left","right"];break;case"vertical":o=["top","bottom"];break;default:o=[e]}if(n)switch(e){case"top":o.push("bottom");break;case"bottom":o.push("top");break;case"left":o.push("left");break;case"right":o.push("right")}return o.filter((e=>r.has(e)))}function JE({__next40pxDefaultSize:e,onChange:t=ZE,onFocus:n=ZE,values:r,selectedUnits:o,setSelectedUnits:i,sides:s,side:a,min:l=0,presets:c,presetKey:h,...p}){var m,g;const v=QE(a,s),b=e=>{t(e)},x=(e,t)=>{const n={...r},o=void 0!==e&&!isNaN(parseFloat(e))?e:void 0;QE(a,s,!!t?.event.altKey).forEach((e=>{n[e]=o})),b(n)},y=function(e={},t=jE){const n=TE(t);if(n.every((t=>e[t]===e[n[0]])))return e[n[0]]}(r,v),w=ME(r),_=w&&v.length>1&&EE(r,v),[S,C]=Hj(y),k=w?C:o[v[0]],j=[(0,d.useInstanceId)(JE,"box-control-input"),a].join("-"),E=v.length>1&&void 0===y&&v.some((e=>o[e]!==k)),M=void 0===y&&k?k:y,N=_||E?(0,u.__)("Mixed"):void 0,T=c&&c.length>0&&h,P=T&&void 0!==y&&!_&&IE(y,h),[D,I]=(0,f.useState)(!T||!P&&!_&&void 0!==y),R=P?function(e,t,n){if(!IE(e,t))return;const r=e.match(new RegExp(`^var:preset\\|${t}\\|(.+)$`));if(!r)return;const o=r[1],i=n.findIndex((e=>e.slug===o));return-1!==i?i:void 0}(y,h,c):void 0,O=T?[{value:0,label:"",tooltip:(0,u.__)("None")},...c.map(((e,t)=>{var n;return{value:t+1,label:"",tooltip:null!==(n=e.name)&&void 0!==n?n:e.slug}}))]:[];return(0,kt.jsxs)(YE,{expanded:!0,children:[(0,kt.jsx)(KE,{side:a,sides:s}),D&&(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(cs,{placement:"top-end",text:CE[a],children:(0,kt.jsx)(UE,{...p,min:l,__shouldNotWarnDeprecated36pxSize:!0,__next40pxDefaultSize:e,className:"component-box-control__unit-control",id:j,isPressEnterToChange:!0,disableUnits:_||E,value:M,onChange:x,onUnitChange:e=>{const t={...o};v.forEach((n=>{t[n]=e})),i(t)},onFocus:e=>{n(e,{side:a})},label:CE[a],placeholder:N,hideLabelFromVision:!0})}),(0,kt.jsx)(XE,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,"aria-controls":j,label:CE[a],hideLabelFromVision:!0,onChange:e=>{x(void 0!==e?[e,k].join(""):void 0)},min:isFinite(l)?l:0,max:null!==(m=SE[null!=k?k:"px"]?.max)&&void 0!==m?m:10,step:null!==(g=SE[null!=k?k:"px"]?.step)&&void 0!==g?g:.1,value:null!=S?S:0,withInputField:!1})]}),T&&!D&&(0,kt.jsx)(XE,{__next40pxDefaultSize:!0,className:"spacing-sizes-control__range-control",value:void 0!==R?R+1:0,onChange:e=>{const t=0===e||void 0===e?void 0:function(e,t,n){return`var:preset|${t}|${n[e].slug}`}(e-1,h,c);(e=>{const t={...r};v.forEach((n=>{t[n]=e})),b(t)})(t)},withInputField:!1,"aria-valuenow":void 0!==R?R+1:0,"aria-valuetext":O[void 0!==R?R+1:0].tooltip,renderTooltipContent:e=>O[e||0].tooltip,min:0,max:O.length-1,marks:O,label:CE[a],hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),T&&(0,kt.jsx)(Hy,{label:D?(0,u.__)("Use size preset"):(0,u.__)("Set custom size"),icon:_E,onClick:()=>{I(!D)},isPressed:D,size:"small",iconSize:24})]},`box-control-${a}`)}function eM({isLinked:e,...t}){const n=e?(0,u.__)("Unlink sides"):(0,u.__)("Link sides");return(0,kt.jsx)(Hy,{...t,className:"component-box-control__linked-button",size:"small",icon:e?P_:D_,iconSize:24,label:n})}const tM={min:0},nM=()=>{};function rM({__next40pxDefaultSize:e=!1,id:t,inputProps:n=tM,onChange:r=nM,label:o=(0,u.__)("Box Control"),values:i,units:s,sides:a,splitOnAxis:l=!1,allowReset:c=!0,resetValues:h=kE,presets:p,presetKey:m,onMouseOver:g,onMouseOut:v}){const[b,x]=sC(i,{fallback:kE}),y=b||kE,w=ME(i),_=1===a?.length,[S,C]=(0,f.useState)(w),[k,j]=(0,f.useState)(!w||!EE(y)||_),[E,M]=(0,f.useState)(NE(k,l)),[N,T]=(0,f.useState)({top:Hj(i?.top)[1],right:Hj(i?.right)[1],bottom:Hj(i?.bottom)[1],left:Hj(i?.left)[1]}),P=function(e){const t=(0,d.useInstanceId)(rM,"inspector-box-control");return e||t}(t),D=`${P}-heading`,I={onMouseOver:g,onMouseOut:v,...n,onChange:e=>{r(e),x(e),C(!0)},onFocus:(e,{side:t})=>{M(t)},isLinked:k,units:s,selectedUnits:N,setSelectedUnits:T,sides:a,values:y,__next40pxDefaultSize:e,presets:p,presetKey:m};Ay({componentName:"BoxControl",__next40pxDefaultSize:e,size:void 0});const R=DE(a);if(p&&!m||!p&&m){}return(0,kt.jsxs)(iE,{id:P,columns:3,templateColumns:"1fr min-content min-content",role:"group","aria-labelledby":D,children:[(0,kt.jsx)(Ry.VisualLabel,{id:D,children:o}),k&&(0,kt.jsx)(YE,{children:(0,kt.jsx)(JE,{side:"all",...I})}),!_&&(0,kt.jsx)(qE,{children:(0,kt.jsx)(eM,{onClick:()=>{j(!k),M(NE(!k,l))},isLinked:k})}),!k&&l&&["vertical","horizontal"].map((e=>(0,kt.jsx)(JE,{side:e,...I},e))),!k&&!l&&Array.from(R).map((e=>(0,kt.jsx)(JE,{side:e,...I},e))),c&&(0,kt.jsx)(GE,{className:"component-box-control__reset-button",variant:"secondary",size:"small",onClick:()=>{r(h),x(h),T(h),C(!1)},disabled:!S,children:(0,u.__)("Reset")})]})}var oM=rM;var iM=(0,f.forwardRef)((function(e,t){const{className:n,__shouldNotWarnDeprecated:r,...o}=e,i=c("components-button-group",n);return r||Ji()("wp.components.ButtonGroup",{since:"6.8",alternative:"wp.components.__experimentalToggleGroupControl"}),(0,kt.jsx)("div",{ref:t,role:"group",className:i,...o})}));const sM={name:"12ip69d",styles:"background:transparent;display:block;margin:0!important;pointer-events:none;position:absolute;will-change:box-shadow"};function aM(e){return`0 ${e}px ${2*e}px 0\n\t${`rgba(0, 0, 0, ${e/20})`}`}const lM=ul((function(e,t){const n=function(e){const{active:t,borderRadius:n="inherit",className:r,focus:o,hover:i,isInteractive:s=!1,offset:a=0,value:l=0,...c}=cl(e,"Elevation"),u=ll();return{...c,className:(0,f.useMemo)((()=>{let e=Iv(i)?i:2*l,c=Iv(t)?t:l/2;s||(e=Iv(i)?i:void 0,c=Iv(t)?t:void 0);const d=`box-shadow ${Wl.transitionDuration} ${Wl.transitionTimingFunction}`,f={};return f.Base=Dl({borderRadius:n,bottom:a,boxShadow:aM(l),opacity:Wl.elevationIntensity,left:a,right:a,top:a},Dl("@media not ( prefers-reduced-motion ){transition:",d,";}",""),"",""),Iv(e)&&(f.hover=Dl("*:hover>&{box-shadow:",aM(e),";}","")),Iv(c)&&(f.active=Dl("*:active>&{box-shadow:",aM(c),";}","")),Iv(o)&&(f.focus=Dl("*:focus>&{box-shadow:",aM(o),";}","")),u(sM,f.Base,f.hover,f.focus,f.active,r)}),[t,n,r,u,o,i,s,a,l]),"aria-hidden":!0}}(e);return(0,kt.jsx)(kl,{...n,ref:t})}),"Elevation");var cM=lM;const uM=`calc(${Wl.radiusLarge} - 1px)`,dM=Dl("box-shadow:0 0 0 1px ",Wl.surfaceBorderColor,";outline:none;",""),fM={name:"1showjb",styles:"border-bottom:1px solid;box-sizing:border-box;&:last-child{border-bottom:none;}"},hM={name:"14n5oej",styles:"border-top:1px solid;box-sizing:border-box;&:first-of-type{border-top:none;}"},pM={name:"13udsys",styles:"height:100%"},mM={name:"6ywzd",styles:"box-sizing:border-box;height:auto;max-height:100%"},gM={name:"dq805e",styles:"box-sizing:border-box;overflow:hidden;&>img,&>iframe{display:block;height:auto;max-width:100%;width:100%;}"},vM={name:"c990dr",styles:"box-sizing:border-box;display:block;width:100%"},bM=Dl("&:first-of-type{border-top-left-radius:",uM,";border-top-right-radius:",uM,";}&:last-of-type{border-bottom-left-radius:",uM,";border-bottom-right-radius:",uM,";}",""),xM=Dl("border-color:",Wl.colorDivider,";",""),yM={name:"1t90u8d",styles:"box-shadow:none"},wM={name:"1e1ncky",styles:"border:none"},_M=Dl("border-radius:",uM,";",""),SM=Dl("padding:",Wl.cardPaddingXSmall,";",""),CM={large:Dl("padding:",Wl.cardPaddingLarge,";",""),medium:Dl("padding:",Wl.cardPaddingMedium,";",""),small:Dl("padding:",Wl.cardPaddingSmall,";",""),xSmall:SM,extraSmall:SM},kM=Dl("background-color:",Fl.ui.backgroundDisabled,";",""),jM=Dl("background-color:",Wl.surfaceColor,";color:",Fl.gray[900],";position:relative;","");Wl.surfaceBackgroundColor;function EM({borderBottom:e,borderLeft:t,borderRight:n,borderTop:r}){const o=`1px solid ${Wl.surfaceBorderColor}`;return Dl({borderBottom:e?o:void 0,borderLeft:t?o:void 0,borderRight:n?o:void 0,borderTop:r?o:void 0},"","")}const MM=Dl("",""),NM=Dl("background:",Wl.surfaceBackgroundTintColor,";",""),TM=Dl("background:",Wl.surfaceBackgroundTertiaryColor,";",""),PM=e=>[e,e].join(" "),DM=e=>["90deg",[Wl.surfaceBackgroundColor,e].join(" "),"transparent 1%"].join(","),IM=e=>[[Wl.surfaceBackgroundColor,e].join(" "),"transparent 1%"].join(","),RM=(e,t)=>Dl("background:",(e=>[`linear-gradient( ${DM(e)} ) center`,`linear-gradient( ${IM(e)} ) center`,Wl.surfaceBorderBoldColor].join(","))(t),";background-size:",PM(e),";",""),OM=[`linear-gradient( ${[`${Wl.surfaceBorderSubtleColor} 1px`,"transparent 1px"].join(",")} )`,`linear-gradient( ${["90deg",`${Wl.surfaceBorderSubtleColor} 1px`,"transparent 1px"].join(",")} )`].join(","),AM=(e,t,n)=>{switch(e){case"dotted":return RM(t,n);case"grid":return(e=>Dl("background:",Wl.surfaceBackgroundColor,";background-image:",OM,";background-size:",PM(e),";",""))(t);case"primary":return MM;case"secondary":return NM;case"tertiary":return TM}};function zM(e){const{backgroundSize:t=12,borderBottom:n=!1,borderLeft:r=!1,borderRight:o=!1,borderTop:i=!1,className:s,variant:a="primary",...l}=cl(e,"Surface"),c=ll();return{...l,className:(0,f.useMemo)((()=>{const e={borders:EM({borderBottom:n,borderLeft:r,borderRight:o,borderTop:i})};return c(jM,e.borders,AM(a,`${t}px`,t-1+"px"),s)}),[t,n,r,o,i,s,c,a])}}function LM(e){const{className:t,elevation:n=0,isBorderless:r=!1,isRounded:o=!0,size:i="medium",...s}=cl(function({elevation:e,isElevated:t,...n}){const r={...n};let o=e;var i;return t&&(Ji()("Card isElevated prop",{since:"5.9",alternative:"elevation"}),null!==(i=o)&&void 0!==i||(o=2)),void 0!==o&&(r.elevation=o),r}(e),"Card"),a=ll();return{...zM({...s,className:(0,f.useMemo)((()=>a(dM,r&&yM,o&&_M,t)),[t,a,r,o])}),elevation:n,isBorderless:r,isRounded:o,size:i}}const FM=ul((function(e,t){const{children:n,elevation:r,isBorderless:o,isRounded:i,size:s,...a}=LM(e),l=i?Wl.radiusLarge:0,c=ll(),u=(0,f.useMemo)((()=>c(Dl({borderRadius:l},"",""))),[c,l]),d=(0,f.useMemo)((()=>{const e={size:s,isBorderless:o};return{CardBody:e,CardHeader:e,CardFooter:e}}),[o,s]);return(0,kt.jsx)(xs,{value:d,children:(0,kt.jsxs)(kl,{...a,ref:t,children:[(0,kt.jsx)(kl,{className:c(pM),children:n}),(0,kt.jsx)(cM,{className:u,isInteractive:!1,value:r?1:0}),(0,kt.jsx)(cM,{className:u,isInteractive:!1,value:r})]})})}),"Card");var BM=FM;const VM=Dl("@media only screen and ( min-device-width: 40em ){&::-webkit-scrollbar{height:12px;width:12px;}&::-webkit-scrollbar-track{background-color:transparent;}&::-webkit-scrollbar-track{background:",Wl.colorScrollbarTrack,";border-radius:8px;}&::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:",Wl.colorScrollbarThumb,";border:2px solid rgba( 0, 0, 0, 0 );border-radius:7px;}&:hover::-webkit-scrollbar-thumb{background-color:",Wl.colorScrollbarThumbHover,";}}",""),WM={name:"13udsys",styles:"height:100%"},$M={name:"7zq9w",styles:"scroll-behavior:smooth"},HM={name:"q33xhg",styles:"overflow-x:auto;overflow-y:hidden"},UM={name:"103x71s",styles:"overflow-x:hidden;overflow-y:auto"},YM={name:"umwchj",styles:"overflow-y:auto"};const GM=ul((function(e,t){const n=function(e){const{className:t,scrollDirection:n="y",smoothScroll:r=!1,...o}=cl(e,"Scrollable"),i=ll();return{...o,className:(0,f.useMemo)((()=>i(WM,VM,r&&$M,"x"===n&&HM,"y"===n&&UM,"auto"===n&&YM,t)),[t,i,n,r])}}(e);return(0,kt.jsx)(kl,{...n,ref:t})}),"Scrollable");var qM=GM;const KM=ul((function(e,t){const{isScrollable:n,...r}=function(e){const{className:t,isScrollable:n=!1,isShady:r=!1,size:o="medium",...i}=cl(e,"CardBody"),s=ll();return{...i,className:(0,f.useMemo)((()=>s(mM,bM,CM[o],r&&kM,"components-card__body",t)),[t,s,r,o]),isScrollable:n}}(e);return n?(0,kt.jsx)(qM,{...r,ref:t}):(0,kt.jsx)(kl,{...r,ref:t})}),"CardBody");var XM=KM,ZM=Nt((function(e){var t=e,{orientation:n="horizontal"}=t,r=_(t,["orientation"]);return r=y({role:"separator","aria-orientation":n},r)})),QM=jt((function(e){return Mt("hr",ZM(e))}));const JM={vertical:{start:"marginLeft",end:"marginRight"},horizontal:{start:"marginTop",end:"marginBottom"}},eN=({"aria-orientation":e="horizontal",margin:t,marginStart:n,marginEnd:r})=>Dl(kv({[JM[e].start]:Rl(null!=n?n:t),[JM[e].end]:Rl(null!=r?r:t)})(),"","");var tN={name:"1u4hpl4",styles:"display:inline"};const nN=({"aria-orientation":e="horizontal"})=>"vertical"===e?tN:void 0,rN=({"aria-orientation":e="horizontal"})=>Dl({["vertical"===e?"borderRight":"borderBottom"]:"1px solid currentColor"},"",""),oN=({"aria-orientation":e="horizontal"})=>Dl({height:"vertical"===e?"auto":0,width:"vertical"===e?0:"auto"},"",""),iN=Sl("hr",{target:"e19on6iw0"})("border:0;margin:0;",nN," ",rN," ",oN," ",eN,";");var sN=ul((function(e,t){const n=cl(e,"Divider");return(0,kt.jsx)(QM,{render:(0,kt.jsx)(iN,{}),...n,ref:t})}),"Divider");const aN=ul((function(e,t){const n=function(e){const{className:t,...n}=cl(e,"CardDivider"),r=ll();return{...n,className:(0,f.useMemo)((()=>r(vM,xM,"components-card__divider",t)),[t,r])}}(e);return(0,kt.jsx)(sN,{...n,ref:t})}),"CardDivider");var lN=aN;const cN=ul((function(e,t){const n=function(e){const{className:t,justify:n,isBorderless:r=!1,isShady:o=!1,size:i="medium",...s}=cl(e,"CardFooter"),a=ll();return{...s,className:(0,f.useMemo)((()=>a(hM,bM,xM,CM[i],r&&wM,o&&kM,"components-card__footer",t)),[t,a,r,o,i]),justify:n}}(e);return(0,kt.jsx)(vv,{...n,ref:t})}),"CardFooter");var uN=cN;const dN=ul((function(e,t){const n=function(e){const{className:t,isBorderless:n=!1,isShady:r=!1,size:o="medium",...i}=cl(e,"CardHeader"),s=ll();return{...i,className:(0,f.useMemo)((()=>s(fM,bM,xM,CM[o],n&&wM,r&&kM,"components-card__header",t)),[t,s,n,r,o])}}(e);return(0,kt.jsx)(vv,{...n,ref:t})}),"CardHeader");var fN=dN;const hN=ul((function(e,t){const n=function(e){const{className:t,...n}=cl(e,"CardMedia"),r=ll();return{...n,className:(0,f.useMemo)((()=>r(gM,bM,"components-card__media",t)),[t,r])}}(e);return(0,kt.jsx)(kl,{...n,ref:t})}),"CardMedia");var pN=hN;var mN=function e(t){const{__nextHasNoMarginBottom:n,label:r,className:o,heading:i,checked:s,indeterminate:a,help:l,id:u,onChange:h,onClick:p,...m}=t;i&&Ji()("`heading` prop in `CheckboxControl`",{alternative:"a separate element to implement a heading",since:"5.8"});const[g,v]=(0,f.useState)(!1),[b,x]=(0,f.useState)(!1),y=(0,d.useRefEffect)((e=>{e&&(e.indeterminate=!!a,v(e.matches(":checked")),x(e.matches(":indeterminate")))}),[s,a]),w=(0,d.useInstanceId)(e,"inspector-checkbox-control",u);return(0,kt.jsx)(Oy,{__nextHasNoMarginBottom:n,__associatedWPComponentName:"CheckboxControl",label:i,id:w,help:l&&(0,kt.jsx)("span",{className:"components-checkbox-control__help",children:l}),className:c("components-checkbox-control",o),children:(0,kt.jsxs)(ow,{spacing:0,justify:"start",alignment:"top",children:[(0,kt.jsxs)("span",{className:"components-checkbox-control__input-container",children:[(0,kt.jsx)("input",{ref:y,id:w,className:"components-checkbox-control__input",type:"checkbox",value:"1",onChange:e=>h(e.target.checked),checked:s,"aria-describedby":l?w+"__help":void 0,onClick:e=>{e.currentTarget.focus(),p?.(e)},...m}),b?(0,kt.jsx)(JS,{icon:Tv,className:"components-checkbox-control__indeterminate",role:"presentation"}):null,g?(0,kt.jsx)(JS,{icon:tk,className:"components-checkbox-control__checked",role:"presentation"}):null]}),r&&(0,kt.jsx)("label",{className:"components-checkbox-control__label",htmlFor:w,children:r})]})})};const gN=4e3;function vN({className:e,children:t,onCopy:n,onFinishCopy:r,text:o,...i}){Ji()("wp.components.ClipboardButton",{since:"5.8",alternative:"wp.compose.useCopyToClipboard"});const s=(0,f.useRef)(),a=(0,d.useCopyToClipboard)(o,(()=>{n(),s.current&&clearTimeout(s.current),r&&(s.current=setTimeout((()=>r()),gN))}));(0,f.useEffect)((()=>()=>{s.current&&clearTimeout(s.current)}),[]);const l=c("components-clipboard-button",e);return(0,kt.jsx)(Hy,{...i,className:l,ref:a,onCopy:e=>{e.target.focus()},children:t})}var bN=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});const xN={name:"1bcj5ek",styles:"width:100%;display:block"},yN={name:"150ruhm",styles:"box-sizing:border-box;width:100%;display:block;margin:0;color:inherit"},wN=Dl("border:1px solid ",Wl.surfaceBorderColor,";",""),_N=Dl(">*:not( marquee )>*{border-bottom:1px solid ",Wl.surfaceBorderColor,";}>*:last-of-type>*{border-bottom-color:transparent;}",""),SN=Wl.radiusSmall,CN=Dl("border-radius:",SN,";",""),kN=Dl("border-radius:",SN,";>*:first-of-type>*{border-top-left-radius:",SN,";border-top-right-radius:",SN,";}>*:last-of-type>*{border-bottom-left-radius:",SN,";border-bottom-right-radius:",SN,";}",""),jN=`calc(${Wl.fontSize} * ${Wl.fontLineHeightBase})`,EN=`calc((${Wl.controlHeight} - ${jN} - 2px) / 2)`,MN=`calc((${Wl.controlHeightSmall} - ${jN} - 2px) / 2)`,NN=`calc((${Wl.controlHeightLarge} - ${jN} - 2px) / 2)`,TN={small:Dl("padding:",MN," ",Wl.controlPaddingXSmall,"px;",""),medium:Dl("padding:",EN," ",Wl.controlPaddingX,"px;",""),large:Dl("padding:",NN," ",Wl.controlPaddingXLarge,"px;","")},PN=(0,f.createContext)({size:"medium"});PN.displayName="ItemGroupContext";const DN=()=>(0,f.useContext)(PN);function IN(e){const{as:t,className:n,onClick:r,role:o="listitem",size:i,...s}=cl(e,"Item"),{spacedAround:a,size:l}=DN(),c=i||l,u=t||(void 0!==r?"button":"div"),d=ll(),h=(0,f.useMemo)((()=>d(("button"===u||"a"===u)&&(e=>Dl("font-size:",_y("default.fontSize"),";font-family:inherit;appearance:none;border:1px solid transparent;cursor:pointer;background:none;text-align:start;text-decoration:","a"===e?"none":void 0,";svg,path{fill:currentColor;}&:hover{color:",Fl.theme.accent,";}&:focus{box-shadow:none;outline:none;}&:focus-visible{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ",Fl.theme.accent,";outline:2px solid transparent;outline-offset:0;}",""))(u),TN[c]||TN.medium,yN,a&&CN,n)),[u,n,d,c,a]),p=d(xN);return{as:u,className:h,onClick:r,wrapperClassName:p,role:o,...s}}var RN=ul((function(e,t){const{role:n,wrapperClassName:r,...o}=IN(e);return(0,kt.jsx)("div",{role:n,className:r,children:(0,kt.jsx)(kl,{...o,ref:t})})}),"Item");var ON=ul((function(e,t){const{isBordered:n,isSeparated:r,size:o,...i}=function(e){const{className:t,isBordered:n=!1,isRounded:r=!0,isSeparated:o=!1,role:i="list",...s}=cl(e,"ItemGroup");return{isBordered:n,className:ll()(n&&wN,o&&_N,r&&kN,t),role:i,isSeparated:o,...s}}(e),{size:s}=DN(),a={spacedAround:!n&&!r,size:o||s};return(0,kt.jsx)(PN.Provider,{value:a,children:(0,kt.jsx)(kl,{...i,ref:t})})}),"ItemGroup");function AN(e){return Math.max(0,Math.min(100,e))}function zN(e,t,n){const r=e.slice();return r[t]=n,r}function LN(e,t,n){if(function(e,t,n,r=0){const o=e[t].position,i=Math.min(o,n),s=Math.max(o,n);return e.some((({position:e},o)=>o!==t&&(Math.abs(e-n)<r||i<e&&e<s)))}(e,t,n))return e;return zN(e,t,{...e[t],position:n})}function FN(e,t,n){return zN(e,t,{...e[t],color:n})}function BN(e,t){if(!t)return;const{x:n,width:r}=t.getBoundingClientRect(),o=e-n;return Math.round(AN(100*o/r))}function VN({isOpen:e,position:t,color:n,...r}){const o=`components-custom-gradient-picker__control-point-button-description-${(0,d.useInstanceId)(VN)}`;return(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(Hy,{"aria-label":(0,u.sprintf)((0,u.__)("Gradient control point at position %1$d%% with color code %2$s."),t,n),"aria-describedby":o,"aria-haspopup":"true","aria-expanded":e,__next40pxDefaultSize:!0,className:c("components-custom-gradient-picker__control-point-button",{"is-active":e}),...r}),(0,kt.jsx)(jl,{id:o,children:(0,u.__)("Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.")})]})}function WN({isRenderedInSidebar:e,className:t,...n}){const r=(0,f.useMemo)((()=>({placement:"bottom",offset:8,resize:!1})),[]),o=c("components-custom-gradient-picker__control-point-dropdown",t);return(0,kt.jsx)(yj,{isRenderedInSidebar:e,popoverProps:r,className:o,...n})}function $N({disableRemove:e,disableAlpha:t,gradientPickerDomRef:n,ignoreMarkerPosition:r,value:o,onChange:i,onStartControlPointChange:s,onStopControlPointChange:a,__experimentalIsRenderedInSidebar:l}){const c=(0,f.useRef)(),d=e=>{if(void 0===c.current||null===n.current)return;const t=BN(e.clientX,n.current),{initialPosition:r,index:s,significantMoveHappened:a}=c.current;!a&&Math.abs(r-t)>=5&&(c.current.significantMoveHappened=!0),i(LN(o,s,t))},h=()=>{window&&window.removeEventListener&&c.current&&c.current.listenersActivated&&(window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",h),a(),c.current.listenersActivated=!1)},p=(0,f.useRef)();return p.current=h,(0,f.useEffect)((()=>()=>{p.current?.()}),[]),(0,kt.jsx)(kt.Fragment,{children:o.map(((n,f)=>{const p=n?.position;return r!==p&&(0,kt.jsx)(WN,{isRenderedInSidebar:l,onClose:a,renderToggle:({isOpen:e,onToggle:t})=>(0,kt.jsx)(VN,{onClick:()=>{c.current&&c.current.significantMoveHappened||(e?a():s(),t())},onMouseDown:()=>{window&&window.addEventListener&&(c.current={initialPosition:p,index:f,significantMoveHappened:!1,listenersActivated:!0},s(),window.addEventListener("mousemove",d),window.addEventListener("mouseup",h))},onKeyDown:e=>{"ArrowLeft"===e.code?(e.stopPropagation(),i(LN(o,f,AN(n.position-10)))):"ArrowRight"===e.code&&(e.stopPropagation(),i(LN(o,f,AN(n.position+10))))},isOpen:e,position:n.position,color:n.color},f),renderContent:({onClose:r})=>(0,kt.jsxs)(mj,{paddingSize:"none",children:[(0,kt.jsx)(Jk,{enableAlpha:!t,color:n.color,onChange:e=>{i(FN(o,f,fb(e).toRgbString()))}}),!e&&o.length>2&&(0,kt.jsx)(ow,{className:"components-custom-gradient-picker__remove-control-point-wrapper",alignment:"center",children:(0,kt.jsx)(Hy,{onClick:()=>{i(function(e,t){return e.filter(((e,n)=>n!==t))}(o,f)),r()},variant:"link",children:(0,u.__)("Remove Control Point")})})]}),style:{left:`${n.position}%`,transform:"translateX( -50% )"}},f)}))})}$N.InsertPoint=function({value:e,onChange:t,onOpenInserter:n,onCloseInserter:r,insertPosition:o,disableAlpha:i,__experimentalIsRenderedInSidebar:s}){const[a,l]=(0,f.useState)(!1);return(0,kt.jsx)(WN,{isRenderedInSidebar:s,className:"components-custom-gradient-picker__inserter",onClose:()=>{r()},renderToggle:({isOpen:e,onToggle:t})=>(0,kt.jsx)(Hy,{__next40pxDefaultSize:!0,"aria-expanded":e,"aria-haspopup":"true",onClick:()=>{e?r():(l(!1),n()),t()},className:"components-custom-gradient-picker__insert-point-dropdown",icon:Nv}),renderContent:()=>(0,kt.jsx)(mj,{paddingSize:"none",children:(0,kt.jsx)(Jk,{enableAlpha:!i,onChange:n=>{a?t(function(e,t,n){const r=e.findIndex((e=>e.position===t));return FN(e,r,n)}(e,o,fb(n).toRgbString())):(t(function(e,t,n){const r=e.findIndex((e=>e.position>t)),o={color:n,position:t},i=e.slice();return i.splice(r-1,0,o),i}(e,o,fb(n).toRgbString())),l(!0))}})}),style:null!==o?{left:`${o}%`,transform:"translateX( -50% )"}:void 0})};var HN=$N;const UN=(e,t)=>{switch(t.type){case"MOVE_INSERTER":if("IDLE"===e.id||"MOVING_INSERTER"===e.id)return{id:"MOVING_INSERTER",insertPosition:t.insertPosition};break;case"STOP_INSERTER_MOVE":if("MOVING_INSERTER"===e.id)return{id:"IDLE"};break;case"OPEN_INSERTER":if("MOVING_INSERTER"===e.id)return{id:"INSERTING_CONTROL_POINT",insertPosition:e.insertPosition};break;case"CLOSE_INSERTER":if("INSERTING_CONTROL_POINT"===e.id)return{id:"IDLE"};break;case"START_CONTROL_CHANGE":if("IDLE"===e.id)return{id:"MOVING_CONTROL_POINT"};break;case"STOP_CONTROL_CHANGE":if("MOVING_CONTROL_POINT"===e.id)return{id:"IDLE"}}return e},YN={id:"IDLE"};function GN({background:e,hasGradient:t,value:n,onChange:r,disableInserter:o=!1,disableAlpha:i=!1,__experimentalIsRenderedInSidebar:s=!1}){const a=(0,f.useRef)(null),[l,u]=(0,f.useReducer)(UN,YN),d=e=>{if(!a.current)return;const t=BN(e.clientX,a.current);n.some((({position:e})=>Math.abs(t-e)<10))?"MOVING_INSERTER"===l.id&&u({type:"STOP_INSERTER_MOVE"}):u({type:"MOVE_INSERTER",insertPosition:t})},h="MOVING_INSERTER"===l.id,p="INSERTING_CONTROL_POINT"===l.id;return(0,kt.jsxs)("div",{className:c("components-custom-gradient-picker__gradient-bar",{"has-gradient":t}),onMouseEnter:d,onMouseMove:d,onMouseLeave:()=>{u({type:"STOP_INSERTER_MOVE"})},children:[(0,kt.jsx)("div",{className:"components-custom-gradient-picker__gradient-bar-background",style:{background:e,opacity:t?1:.4}}),(0,kt.jsxs)("div",{ref:a,className:"components-custom-gradient-picker__markers-container",children:[!o&&(h||p)&&(0,kt.jsx)(HN.InsertPoint,{__experimentalIsRenderedInSidebar:s,disableAlpha:i,insertPosition:l.insertPosition,value:n,onChange:r,onOpenInserter:()=>{u({type:"OPEN_INSERTER"})},onCloseInserter:()=>{u({type:"CLOSE_INSERTER"})}}),(0,kt.jsx)(HN,{__experimentalIsRenderedInSidebar:s,disableAlpha:i,disableRemove:o,gradientPickerDomRef:a,ignoreMarkerPosition:p?l.insertPosition:void 0,value:n,onChange:r,onStartControlPointChange:()=>{u({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{u({type:"STOP_CONTROL_CHANGE"})}})]})]})}var qN=o(8924);const KN="linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)",XN={type:"angular",value:"90"},ZN=[{value:"linear-gradient",label:(0,u.__)("Linear")},{value:"radial-gradient",label:(0,u.__)("Radial")}],QN={top:0,"top right":45,"right top":45,right:90,"right bottom":135,"bottom right":135,bottom:180,"bottom left":225,"left bottom":225,left:270,"top left":315,"left top":315};function JN({type:e,value:t,length:n}){return`${function({type:e,value:t}){if("literal"===e)return t;if("hex"===e)return`#${t}`;if("var"===e)return`var(${t})`;if("hsl"===e){const[e,n,r]=t;return`hsl(${e},${n}%,${r}%)`}if("hsla"===e){const[e,n,r,o]=t;return`hsla(${e},${n}%,${r}%,${o})`}return`${e}(${t.join(",")})`}({type:e,value:t})} ${function(e){if(!e)return"";const{value:t,type:n}=e;return"calc"===n?`calc(${t})`:`${t}${n}`}(n)}`}function eT({type:e,orientation:t,colorStops:n}){const r=function(e){if(!Array.isArray(e)&&e&&"angular"===e.type)return`${e.value}deg`}(t);return`${e}(${[r,...n.sort(((e,t)=>{const n=e=>void 0===e?.length?.value?0:parseInt(e.length.value);return n(e)-n(t)})).map(JN)].filter(Boolean).join(",")})`}function tT(e){return void 0===e.length||"%"!==e.length.type}function nT(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"var":return`${e.type}(${e.value})`;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;case"hsl":{const[t,n,r]=e.value;return`hsl(${t},${n}%,${r}%)`}case"hsla":{const[t,n,r,o]=e.value;return`hsla(${t},${n}%,${r}%,${o})`}default:return"transparent"}}pb([mb]);const rT=Sl(xv,{target:"e10bzpgi1"})({name:"1gvx10y",styles:"flex-grow:5"}),oT=Sl(xv,{target:"e10bzpgi0"})({name:"1gvx10y",styles:"flex-grow:5"}),iT=({gradientAST:e,hasGradient:t,onChange:n})=>{var r;const o=null!==(r=e?.orientation?.value)&&void 0!==r?r:180;return(0,kt.jsx)(hw,{onChange:t=>{n(eT({...e,orientation:{type:"angular",value:`${t}`}}))},value:t?o:""})},sT=({gradientAST:e,hasGradient:t,onChange:n})=>{const{type:r}=e;return(0,kt.jsx)(oC,{__nextHasNoMarginBottom:!0,className:"components-custom-gradient-picker__type-picker",label:(0,u.__)("Type"),labelPosition:"top",onChange:t=>{"linear-gradient"===t&&n(eT({...e,orientation:e.orientation?void 0:XN,type:"linear-gradient"})),"radial-gradient"===t&&(()=>{const{orientation:t,...r}=e;n(eT({...r,type:"radial-gradient"}))})()},options:ZN,size:"__unstable-large",value:t?r:void 0})};var aT=function({value:e,onChange:t,enableAlpha:n=!0,__experimentalIsRenderedInSidebar:r=!1}){const{gradientAST:o,hasGradient:i}=function(e){let t,n=!!e;const r=null!=e?e:KN;try{t=qN.parse(r)[0]}catch(e){console.warn("wp.components.CustomGradientPicker failed to parse the gradient with error",e),t=qN.parse(KN)[0],n=!1}if(Array.isArray(t.orientation)||"directional"!==t.orientation?.type||(t.orientation={type:"angular",value:QN[t.orientation.value].toString()}),t.colorStops.some(tT)){const{colorStops:e}=t,n=100/(e.length-1);e.forEach(((e,t)=>{e.length={value:""+n*t,type:"%"}}))}return{gradientAST:t,hasGradient:n}}(e),s=function(e){return eT({type:"linear-gradient",orientation:XN,colorStops:e.colorStops})}(o),a=o.colorStops.map((e=>({color:nT(e),position:parseInt(e.length.value)})));return(0,kt.jsxs)(lj,{spacing:4,className:"components-custom-gradient-picker",children:[(0,kt.jsx)(GN,{__experimentalIsRenderedInSidebar:r,disableAlpha:!n,background:s,hasGradient:i,value:a,onChange:e=>{t(eT(function(e,t){return{...e,colorStops:t.map((({position:e,color:t})=>{const{r:n,g:r,b:o,a:i}=fb(t).toRgb();return{length:{type:"%",value:e?.toString()},type:i<1?"rgba":"rgb",value:i<1?[`${n}`,`${r}`,`${o}`,`${i}`]:[`${n}`,`${r}`,`${o}`]}}))}}(o,e)))}}),(0,kt.jsxs)(vv,{gap:3,className:"components-custom-gradient-picker__ui-line",children:[(0,kt.jsx)(rT,{children:(0,kt.jsx)(sT,{gradientAST:o,hasGradient:i,onChange:t})}),(0,kt.jsx)(oT,{children:"linear-gradient"===o.type&&(0,kt.jsx)(iT,{gradientAST:o,hasGradient:i,onChange:t})})]})]})};const lT=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.gradients)&&!("gradient"in t);var t}));function cT({className:e,clearGradient:t,gradients:n,onChange:r,value:o,...i}){const s=(0,f.useMemo)((()=>n.map((({gradient:e,name:n,slug:i},s)=>(0,kt.jsx)(sj.Option,{value:e,isSelected:o===e,tooltipText:n||(0,u.sprintf)((0,u.__)("Gradient code: %s"),e),style:{color:"rgba( 0,0,0,0 )",background:e},onClick:o===e?t:()=>r(e,s),"aria-label":n?(0,u.sprintf)((0,u.__)("Gradient: %s"),n):(0,u.sprintf)((0,u.__)("Gradient code: %s"),e)},i)))),[n,o,r,t]);return(0,kt.jsx)(sj.OptionGroup,{className:e,options:s,...i})}function uT({className:e,clearGradient:t,gradients:n,onChange:r,value:o,headingLevel:i}){const s=(0,d.useInstanceId)(uT);return(0,kt.jsx)(lj,{spacing:3,className:e,children:n.map((({name:e,gradients:n},a)=>{const l=`color-palette-${s}-${a}`;return(0,kt.jsxs)(lj,{spacing:2,children:[(0,kt.jsx)(fj,{level:i,id:l,children:e}),(0,kt.jsx)(cT,{clearGradient:t,gradients:n,onChange:e=>r(e,a),value:o,"aria-labelledby":l})]},a)}))})}function dT(e){const{asButtons:t,loop:n,actions:r,headingLevel:o,"aria-label":i,"aria-labelledby":s,...a}=e,l=lT(e.gradients)?(0,kt.jsx)(uT,{headingLevel:o,...a}):(0,kt.jsx)(cT,{...a}),{metaProps:c,labelProps:u}=aj(t,n,i,s);return(0,kt.jsx)(sj,{...c,...u,actions:r,options:l})}var fT=function({className:e,gradients:t=[],onChange:n,value:r,clearable:o=!0,enableAlpha:i=!0,disableCustomGradients:s=!1,__experimentalIsRenderedInSidebar:a,headingLevel:l=2,...c}){const d=(0,f.useCallback)((()=>n(void 0)),[n]);return(0,kt.jsxs)(lj,{spacing:t.length?4:0,children:[!s&&(0,kt.jsx)(aT,{__experimentalIsRenderedInSidebar:a,enableAlpha:i,value:r,onChange:n}),(t.length>0||o)&&(0,kt.jsx)(dT,{...c,className:e,clearGradient:d,gradients:t,onChange:n,value:r,actions:o&&!s&&(0,kt.jsx)(sj.ButtonAction,{onClick:d,accessibleWhenDisabled:!0,disabled:!r,children:(0,u.__)("Clear")}),headingLevel:l})]})},hT=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z"})});const pT=window.wp.dom,mT=()=>{},gT=["menuitem","menuitemradio","menuitemcheckbox"];class vT extends f.Component{constructor(e){super(e),this.onKeyDown=this.onKeyDown.bind(this),this.bindContainer=this.bindContainer.bind(this),this.getFocusableContext=this.getFocusableContext.bind(this),this.getFocusableIndex=this.getFocusableIndex.bind(this)}componentDidMount(){this.container&&this.container.addEventListener("keydown",this.onKeyDown)}componentWillUnmount(){this.container&&this.container.removeEventListener("keydown",this.onKeyDown)}bindContainer(e){const{forwardedRef:t}=this.props;this.container=e,"function"==typeof t?t(e):t&&"current"in t&&(t.current=e)}getFocusableContext(e){if(!this.container)return null;const{onlyBrowserTabstops:t}=this.props,n=(t?pT.focus.tabbable:pT.focus.focusable).find(this.container),r=this.getFocusableIndex(n,e);return r>-1&&e?{index:r,target:e,focusables:n}:null}getFocusableIndex(e,t){return e.indexOf(t)}onKeyDown(e){this.props.onKeyDown&&this.props.onKeyDown(e);const{getFocusableContext:t}=this,{cycle:n=!0,eventToOffset:r,onNavigate:o=mT,stopNavigationEvents:i}=this.props,s=r(e);if(void 0!==s&&i){e.stopImmediatePropagation();const t=e.target?.getAttribute("role");!!t&&gT.includes(t)&&e.preventDefault()}if(!s)return;const a=e.target?.ownerDocument?.activeElement;if(!a)return;const l=t(a);if(!l)return;const{index:c,focusables:u}=l,d=n?function(e,t,n){const r=e+n;return r<0?t+r:r>=t?r-t:r}(c,u.length,s):c+s;d>=0&&d<u.length&&(u[d].focus(),o(d,u[d]),"Tab"===e.code&&e.preventDefault())}render(){const{children:e,stopNavigationEvents:t,eventToOffset:n,onNavigate:r,onKeyDown:o,cycle:i,onlyBrowserTabstops:s,forwardedRef:a,...l}=this.props;return(0,kt.jsx)("div",{ref:this.bindContainer,...l,children:e})}}const bT=(e,t)=>(0,kt.jsx)(vT,{...e,forwardedRef:t});bT.displayName="NavigableContainer";var xT=(0,f.forwardRef)(bT);const yT=(0,f.forwardRef)((function({role:e="menu",orientation:t="vertical",...n},r){return(0,kt.jsx)(xT,{ref:r,stopNavigationEvents:!0,onlyBrowserTabstops:!1,role:e,"aria-orientation":"presentation"===e||"vertical"!==t&&"horizontal"!==t?void 0:t,eventToOffset:e=>{const{code:n}=e;let r=["ArrowDown"],o=["ArrowUp"];return"horizontal"===t&&(r=["ArrowRight"],o=["ArrowLeft"]),"both"===t&&(r=["ArrowRight","ArrowDown"],o=["ArrowLeft","ArrowUp"]),r.includes(n)?1:o.includes(n)?-1:["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(n)?0:void 0},...n})}));var wT=yT;function _T(e={},t={}){const n={...e,...t};return t.className&&e.className&&(n.className=c(t.className,e.className)),n}function ST(e){return"function"==typeof e}var CT=dl((function(e){const{children:t,className:n,controls:r,icon:o=hT,label:i,popoverProps:s,toggleProps:a,menuProps:l,disableOpenOnArrowDown:u=!1,text:d,noIcons:f,open:h,defaultOpen:p,onToggle:m,variant:g}=cl(e,"DropdownMenu");if(!r?.length&&!ST(t))return null;let v;r?.length&&(v=r,Array.isArray(v[0])||(v=[r]));const b=_T({className:"components-dropdown-menu__popover",variant:g},s);return(0,kt.jsx)(LS,{className:n,popoverProps:b,renderToggle:({isOpen:e,onToggle:t})=>{var n;const{as:r=Hy,...s}=null!=a?a:{},l=_T({className:c("components-dropdown-menu__toggle",{"is-opened":e})},s);return(0,kt.jsx)(r,{...l,icon:o,onClick:e=>{t(),l.onClick&&l.onClick(e)},onKeyDown:n=>{(n=>{u||e||"ArrowDown"!==n.code||(n.preventDefault(),t())})(n),l.onKeyDown&&l.onKeyDown(n)},"aria-haspopup":"true","aria-expanded":e,label:i,text:d,showTooltip:null===(n=a?.showTooltip)||void 0===n||n,children:l.children})},renderContent:e=>{const n=_T({"aria-label":i,className:c("components-dropdown-menu__menu",{"no-icons":f})},l);return(0,kt.jsxs)(wT,{...n,role:"menu",children:[ST(t)?t(e):null,v?.flatMap(((t,n)=>t.map(((t,r)=>(0,kt.jsx)(Hy,{__next40pxDefaultSize:!0,onClick:n=>{n.stopPropagation(),e.onClose(),t.onClick&&t.onClick()},className:c("components-dropdown-menu__menu-item",{"has-separator":n>0&&0===r,"is-active":t.isActive,"is-icon-only":!t.title}),icon:t.icon,label:t.label,"aria-checked":"menuitemcheckbox"===t.role||"menuitemradio"===t.role?t.isActive:void 0,role:"menuitemcheckbox"===t.role||"menuitemradio"===t.role?t.role:"menuitem",accessibleWhenDisabled:!0,disabled:t.isDisabled,children:t.title},[n,r].join())))))]})},open:h,defaultOpen:p,onToggle:m})}),"DropdownMenu");const kT=Sl(IS,{target:"e1lpqc908"})("&&{flex-shrink:0;width:",Rl(6),";height:",Rl(6),";}"),jT=Sl(Fy,{target:"e1lpqc907"})(Hb,"{background:",Fl.gray[100],";border-radius:",Wl.radiusXSmall,";",Zb,Zb,Zb,Zb,"{height:",Rl(8),";}",Fb,Fb,Fb,"{border-color:transparent;box-shadow:none;}}"),ET=Sl("div",{target:"e1lpqc906"})("line-height:",Rl(8),";margin-left:",Rl(2),";margin-right:",Rl(2),";white-space:nowrap;overflow:hidden;"),MT=Sl(dj,{target:"e1lpqc905"})("text-transform:uppercase;line-height:",Rl(6),";font-weight:500;&&&{font-size:11px;margin-bottom:0;}"),NT=Sl(kl,{target:"e1lpqc904"})("height:",Rl(6),";display:flex;"),TT=Sl(kl,{target:"e1lpqc903"})("margin-top:",Rl(2),";"),PT=Sl(kl,{target:"e1lpqc902"})({name:"u6wnko",styles:"&&&{.components-button.has-icon{min-width:0;padding:0;}}"}),DT=Sl(Hy,{target:"e1lpqc901"})("&&{color:",Fl.theme.accent,";}"),IT=Sl(Hy,{target:"e1lpqc900"})("&&{margin-top:",Rl(1),";}");function RT({value:e,onChange:t,label:n}){return(0,kt.jsx)(jT,{size:"compact",label:n,hideLabelFromVision:!0,value:e,onChange:t})}function OT({isGradient:e,element:t,onChange:n,popoverProps:r,onClose:o=()=>{}}){const i=(0,f.useMemo)((()=>({shift:!0,offset:20,resize:!1,placement:"left-start",...r,className:c("components-palette-edit__popover",r?.className)})),[r]);return(0,kt.jsxs)(y_,{...i,onClose:o,children:[!e&&(0,kt.jsx)(Jk,{color:t.color,enableAlpha:!0,onChange:e=>{n({...t,color:e})}}),e&&(0,kt.jsx)("div",{className:"components-palette-edit__popover-gradient-picker",children:(0,kt.jsx)(aT,{__experimentalIsRenderedInSidebar:!0,value:t.gradient,onChange:e=>{n({...t,gradient:e})}})})]})}function AT({canOnlyChangeValues:e,element:t,onChange:n,onRemove:r,popoverProps:o,slugPrefix:i,isGradient:s}){const a=s?t.gradient:t.color,[l,c]=(0,f.useState)(!1),[d,h]=(0,f.useState)(null),p=(0,f.useMemo)((()=>({...o,anchor:d})),[d,o]);return(0,kt.jsxs)(RN,{ref:h,size:"small",children:[(0,kt.jsxs)(ow,{justify:"flex-start",children:[(0,kt.jsx)(Hy,{size:"small",onClick:()=>{c(!0)},"aria-label":(0,u.sprintf)((0,u.__)("Edit: %s"),t.name.trim().length?t.name:a||""),style:{padding:0},children:(0,kt.jsx)(kT,{colorValue:a})}),(0,kt.jsx)(xv,{children:e?(0,kt.jsx)(ET,{children:t.name.trim().length?t.name:" "}):(0,kt.jsx)(RT,{label:s?(0,u.__)("Gradient name"):(0,u.__)("Color name"),value:t.name,onChange:e=>n({...t,name:e,slug:i+ww(null!=e?e:"")})})}),!e&&(0,kt.jsx)(Pv,{children:(0,kt.jsx)(IT,{size:"small",icon:V_,label:(0,u.sprintf)((0,u.__)("Remove color: %s"),t.name.trim().length?t.name:a||""),onClick:r})})]}),l&&(0,kt.jsx)(OT,{isGradient:s,onChange:n,element:t,popoverProps:p,onClose:()=>c(!1)})]})}function zT({elements:e,onChange:t,canOnlyChangeValues:n,slugPrefix:r,isGradient:o,popoverProps:i,addColorRef:s}){const a=(0,f.useRef)();(0,f.useEffect)((()=>{a.current=e}),[e]);const l=(0,d.useDebounce)((e=>t(function(e){const t={};return e.map((e=>{var n;let r;const{slug:o}=e;return t[o]=(t[o]||0)+1,t[o]>1&&(r=`${o}-${t[o]-1}`),{...e,slug:null!==(n=r)&&void 0!==n?n:o}}))}(e))),100);return(0,kt.jsx)(lj,{spacing:3,children:(0,kt.jsx)(ON,{isRounded:!0,isBordered:!0,isSeparated:!0,children:e.map(((a,c)=>(0,kt.jsx)(AT,{isGradient:o,canOnlyChangeValues:n,element:a,onChange:t=>{l(e.map(((e,n)=>n===c?t:e)))},onRemove:()=>{const n=e.filter(((e,t)=>t!==c));t(n.length?n:void 0),s.current?.focus()},slugPrefix:r,popoverProps:i},c)))})})}const LT=[];var FT=function({gradients:e,colors:t=LT,onChange:n,paletteLabel:r,paletteLabelHeadingLevel:o=2,emptyMessage:i,canOnlyChangeValues:s,canReset:a,slugPrefix:l="",popoverProps:c}){const h=!!e,p=h?e:t,[m,g]=(0,f.useState)(!1),[v,b]=(0,f.useState)(null),x=m&&!!v&&p[v]&&!p[v].slug,y=p.length>0,w=(0,d.useDebounce)(n,100),_=(0,f.useCallback)(((e,t)=>{const n=void 0===t?void 0:p[t];n&&n[h?"gradient":"color"]===e?b(t):g(!0)}),[h,p]),S=(0,f.useRef)(null);return(0,kt.jsxs)(PT,{children:[(0,kt.jsxs)(ow,{children:[(0,kt.jsx)(MT,{level:o,children:r}),(0,kt.jsxs)(NT,{children:[y&&m&&(0,kt.jsx)(DT,{size:"small",onClick:()=>{g(!1),b(null)},children:(0,u.__)("Done")}),!s&&(0,kt.jsx)(Hy,{ref:S,size:"small",isPressed:x,icon:Nv,label:h?(0,u.__)("Add gradient"):(0,u.__)("Add color"),onClick:()=>{const{name:r,slug:o}=function(e,t){const n=new RegExp(`^${t}color-([\\d]+)$`),r=e.reduce(((e,t)=>{if("string"==typeof t?.slug){const r=t?.slug.match(n);if(r){const t=parseInt(r[1],10);if(t>=e)return t+1}}return e}),1);return{name:(0,u.sprintf)((0,u.__)("Color %d"),r),slug:`${t}color-${r}`}}(p,l);n(e?[...e,{gradient:KN,name:r,slug:o}]:[...t,{color:"#000",name:r,slug:o}]),g(!0),b(p.length)}}),y&&(!m||!s||a)&&(0,kt.jsx)(CT,{icon:bN,label:h?(0,u.__)("Gradient options"):(0,u.__)("Color options"),toggleProps:{size:"small"},children:({onClose:e})=>(0,kt.jsx)(kt.Fragment,{children:(0,kt.jsxs)(wT,{role:"menu",children:[!m&&(0,kt.jsx)(Hy,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{g(!0),e()},className:"components-palette-edit__menu-button",children:(0,u.__)("Show details")}),!s&&(0,kt.jsx)(Hy,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{b(null),g(!1),n(),e()},className:"components-palette-edit__menu-button",children:h?(0,u.__)("Remove all gradients"):(0,u.__)("Remove all colors")}),a&&(0,kt.jsx)(Hy,{__next40pxDefaultSize:!0,className:"components-palette-edit__menu-button",variant:"tertiary",onClick:()=>{b(null),n(),e()},children:h?(0,u.__)("Reset gradient"):(0,u.__)("Reset colors")})]})})})]})]}),y&&(0,kt.jsxs)(TT,{children:[m&&(0,kt.jsx)(zT,{canOnlyChangeValues:s,elements:p,onChange:n,slugPrefix:l,isGradient:h,popoverProps:c,addColorRef:S}),!m&&null!==v&&(0,kt.jsx)(OT,{isGradient:h,onClose:()=>b(null),onChange:e=>{w(p.map(((t,n)=>n===v?e:t)))},element:p[null!=v?v:-1],popoverProps:c}),!m&&(h?(0,kt.jsx)(fT,{gradients:e,onChange:_,clearable:!1,disableCustomGradients:!0}):(0,kt.jsx)(_j,{colors:t,onChange:_,clearable:!1,disableCustomColors:!0}))]}),!y&&i&&(0,kt.jsx)(TT,{children:i})]})},BT=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{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"})});const VT=({__next40pxDefaultSize:e})=>!e&&Dl("height:28px;padding-left:",Rl(1),";padding-right:",Rl(1),";",""),WT=Sl(vv,{target:"evuatpg0"})("height:38px;padding-left:",Rl(2),";padding-right:",Rl(2),";",VT,";");const $T=(0,f.forwardRef)((function(e,t){const{value:n,isExpanded:r,instanceId:o,selectedSuggestionIndex:i,className:s,onChange:a,onFocus:l,onBlur:u,...d}=e,[h,p]=(0,f.useState)(!1),m=n?n.length+1:0;return(0,kt.jsx)("input",{ref:t,id:`components-form-token-input-${o}`,type:"text",...d,value:n||"",onChange:e=>{a&&a({value:e.target.value})},onFocus:e=>{p(!0),l?.(e)},onBlur:e=>{p(!1),u?.(e)},size:m,className:c(s,"components-form-token-field__input"),autoComplete:"off",role:"combobox","aria-expanded":r,"aria-autocomplete":"list","aria-owns":r?`components-form-token-suggestions-${o}`:void 0,"aria-activedescendant":h&&-1!==i&&r?`components-form-token-suggestions-${o}-${i}`:void 0,"aria-describedby":`components-form-token-suggestions-howto-${o}`})}));var HT=$T;const UT=e=>{e.preventDefault()};var YT=function({selectedIndex:e,scrollIntoView:t,match:n,onHover:r,onSelect:o,suggestions:i=[],displayTransform:s,instanceId:a,__experimentalRenderItem:l}){const f=(0,d.useRefEffect)((n=>{e>-1&&t&&n.children[e]&&n.children[e].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"})}),[e,t]),h=e=>()=>{r?.(e)},p=e=>()=>{o?.(e)};return(0,kt.jsxs)("ul",{ref:f,className:"components-form-token-field__suggestions-list",id:`components-form-token-suggestions-${a}`,role:"listbox",children:[i.map(((t,r)=>{const o=(e=>{const t=s(n).normalize("NFKC").toLocaleLowerCase();if(0===t.length)return null;const r=s(e),o=r.normalize("NFKC").toLocaleLowerCase().indexOf(t);return{suggestionBeforeMatch:r.substring(0,o),suggestionMatch:r.substring(o,o+t.length),suggestionAfterMatch:r.substring(o+t.length)}})(t),i=r===e,u="object"==typeof t&&t?.disabled,d="object"==typeof t&&"value"in t?t?.value:s(t),f=c("components-form-token-field__suggestion",{"is-selected":i});let m;return m="function"==typeof l?l({item:t}):o?(0,kt.jsxs)("span",{"aria-label":s(t),children:[o.suggestionBeforeMatch,(0,kt.jsx)("strong",{className:"components-form-token-field__suggestion-match",children:o.suggestionMatch}),o.suggestionAfterMatch]}):s(t),(0,kt.jsx)("li",{id:`components-form-token-suggestions-${a}-${r}`,role:"option",className:f,onMouseDown:UT,onClick:p(t),onMouseEnter:h(t),"aria-selected":r===e,"aria-disabled":u,children:m},d)})),0===i.length&&(0,kt.jsx)("li",{className:"components-form-token-field__suggestion is-empty",children:(0,u.__)("No items found")})]})},GT=(0,d.createHigherOrderComponent)((e=>t=>{const[n,r]=(0,f.useState)(void 0),o=(0,f.useCallback)((e=>r((()=>e?.handleFocusOutside?e.handleFocusOutside.bind(e):void 0))),[]);return(0,kt.jsx)("div",{...(0,d.__experimentalUseFocusOutside)(n),children:(0,kt.jsx)(e,{ref:o,...t})})}),"withFocusOutside");const qT=Il`
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
`,KT=Sl("svg",{target:"ea4tfvq2"})("width:",Wl.spinnerSize,"px;height:",Wl.spinnerSize,"px;display:inline-block;margin:5px 11px 0;position:relative;color:",Fl.theme.accent,";overflow:visible;opacity:1;background-color:transparent;"),XT={name:"9s4963",styles:"fill:transparent;stroke-width:1.5px"},ZT=Sl("circle",{target:"ea4tfvq1"})(XT,";stroke:",Fl.gray[300],";"),QT=Sl("path",{target:"ea4tfvq0"})(XT,";stroke:currentColor;stroke-linecap:round;transform-origin:50% 50%;animation:1.4s linear infinite both ",qT,";");var JT=(0,f.forwardRef)((function({className:e,...t},n){return(0,kt.jsxs)(KT,{className:c("components-spinner",e),viewBox:"0 0 100 100",width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",role:"presentation",focusable:"false",...t,ref:n,children:[(0,kt.jsx)(ZT,{cx:"50",cy:"50",r:"50",vectorEffect:"non-scaling-stroke"}),(0,kt.jsx)(QT,{d:"m 50 0 a 50 50 0 0 1 50 50",vectorEffect:"non-scaling-stroke"})]})}));const eP=()=>{},tP=GT(class extends f.Component{handleFocusOutside(e){this.props.onFocusOutside(e)}render(){return this.props.children}}),nP=(e,t)=>null===e?-1:t.indexOf(e);var rP=function e(t){var n;const{__nextHasNoMarginBottom:r=!1,__next40pxDefaultSize:o=!1,value:i,label:s,options:a,onChange:l,onFilterValueChange:h=eP,hideLabelFromVision:p,help:m,allowReset:g=!0,className:v,isLoading:b=!1,messages:x={selected:(0,u.__)("Item selected.")},__experimentalRenderItem:y,expandOnFocus:w=!0,placeholder:_}=ix(t),[S,C]=lS({value:i,onChange:l}),k=a.find((e=>e.value===S)),j=null!==(n=k?.label)&&void 0!==n?n:"",E=(0,d.useInstanceId)(e,"combobox-control"),[M,N]=(0,f.useState)(k||null),[T,P]=(0,f.useState)(!1),[D,I]=(0,f.useState)(!1),[R,O]=(0,f.useState)(""),A=(0,f.useRef)(null),z=(0,f.useMemo)((()=>{const e=[],t=[],n=yw(R);return a.forEach((r=>{const o=yw(r.label).indexOf(n);0===o?e.push(r):o>0&&t.push(r)})),e.concat(t)}),[R,a]),L=e=>{e.disabled||(C(e.value),(0,vw.speak)(x.selected,"assertive"),N(e),O(""),P(!1))},F=(e=1)=>{let t=nP(M,z)+e;t<0?t=z.length-1:t>=z.length&&(t=0),N(z[t]),P(!0)},B=vy((e=>{let t=!1;if(!e.defaultPrevented){switch(e.code){case"Enter":M&&(L(M),t=!0);break;case"ArrowUp":F(-1),t=!0;break;case"ArrowDown":F(1),t=!0;break;case"Escape":P(!1),N(null),t=!0}t&&e.preventDefault()}}));return(0,f.useEffect)((()=>{const e=z.length>0,t=nP(M,z)>0;e&&!t&&N(z[0])}),[z,M]),(0,f.useEffect)((()=>{const e=z.length>0;if(T){const t=e?(0,u.sprintf)((0,u._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",z.length),z.length):(0,u.__)("No results.");(0,vw.speak)(t,"polite")}}),[z,T]),Ay({componentName:"ComboboxControl",__next40pxDefaultSize:o,size:void 0}),(0,kt.jsx)(tP,{onFocusOutside:()=>{P(!1)},children:(0,kt.jsx)(Oy,{__nextHasNoMarginBottom:r,__associatedWPComponentName:"ComboboxControl",className:c(v,"components-combobox-control"),label:s,id:`components-form-token-input-${E}`,hideLabelFromVision:p,help:m,children:(0,kt.jsxs)("div",{className:"components-combobox-control__suggestions-container",tabIndex:-1,onKeyDown:B,children:[(0,kt.jsxs)(WT,{__next40pxDefaultSize:o,children:[(0,kt.jsx)(xv,{children:(0,kt.jsx)(HT,{className:"components-combobox-control__input",instanceId:E,ref:A,placeholder:_,value:T?R:j,onFocus:()=>{I(!0),w&&P(!0),h(""),O("")},onBlur:()=>{I(!1)},onClick:()=>{P(!0)},isExpanded:T,selectedSuggestionIndex:nP(M,z),onChange:e=>{const t=e.value;O(t),h(t),D&&P(!0)}})}),b&&(0,kt.jsx)(JT,{}),g&&(0,kt.jsx)(Hy,{size:"small",icon:BT,disabled:!S,onClick:()=>{C(null),A.current?.focus()},onKeyDown:e=>{e.stopPropagation()},label:(0,u.__)("Reset")})]}),T&&!b&&(0,kt.jsx)(YT,{instanceId:E,match:{label:R,value:""},displayTransform:e=>e.label,suggestions:z,selectedIndex:nP(M,z),onHover:N,onSelect:L,scrollIntoView:!0,__experimentalRenderItem:y})]})})})};function oP(e){if(e.state){const{state:t,...n}=e,{store:r,...o}=oP(t);return{...n,...o,store:r}}return e}const iP={__unstableComposite:"Composite",__unstableCompositeGroup:"Composite.Group or Composite.Row",__unstableCompositeItem:"Composite.Item",__unstableUseCompositeState:"Composite"};function sP(e,t={}){var n;const r=null!==(n=e.displayName)&&void 0!==n?n:"",o=n=>{Ji()(`wp.components.${r}`,{since:"6.7",alternative:iP.hasOwnProperty(r)?iP[r]:void 0});const{store:o,...i}=oP(n);let s=i;return s={...s,id:(0,d.useInstanceId)(o,s.baseId,s.id)},Object.entries(t).forEach((([e,t])=>{s.hasOwnProperty(e)&&(Object.assign(s,{[t]:s[e]}),delete s[e])})),delete s.baseId,(0,kt.jsx)(e,{...s,store:o})};return o.displayName=r,o}const aP=(0,f.forwardRef)((({role:e,...t},n)=>{const r="row"===e?Kn.Row:Kn.Group;return(0,kt.jsx)(r,{ref:n,role:e,...t})})),lP=sP(Object.assign(Kn,{displayName:"__unstableComposite"}),{baseId:"id"}),cP=sP(Object.assign(aP,{displayName:"__unstableCompositeGroup"})),uP=sP(Object.assign(Kn.Item,{displayName:"__unstableCompositeItem"}),{focusable:"accessibleWhenDisabled"});function dP(e={}){Ji()("wp.components.__unstableUseCompositeState",{since:"6.7",alternative:iP.__unstableUseCompositeState});const{baseId:t,currentId:n,orientation:r,rtl:o=!1,loop:i=!1,wrap:s=!1,shift:a=!1,unstable_virtual:l}=e;return{baseId:(0,d.useInstanceId)(lP,"composite",t),store:yt({defaultActiveId:n,rtl:o,orientation:r,focusLoop:i,focusShift:a,focusWrap:s,virtualFocus:l})}}const fP=new Set(["alert","status","log","marquee","timer"]),hP=[];function pP(e){const t=e.getAttribute("role");return!("SCRIPT"===e.tagName||e.hasAttribute("hidden")||e.hasAttribute("aria-hidden")||e.hasAttribute("aria-live")||t&&fP.has(t))}const mP=Wl.transitionDuration,gP=Number.parseInt(Wl.transitionDuration);const vP=(0,f.createContext)(new Set);vP.displayName="ModalContext";const bP=new Map;const xP=(0,f.forwardRef)((function(e,t){const{bodyOpenClassName:n="modal-open",role:r="dialog",title:o=null,focusOnMount:i=!0,shouldCloseOnEsc:s=!0,shouldCloseOnClickOutside:a=!0,isDismissible:l=!0,aria:h={labelledby:void 0,describedby:void 0},onRequestClose:p,icon:m,closeButtonLabel:g,children:v,style:b,overlayClassName:x,className:y,contentLabel:w,onKeyDown:_,isFullScreen:S=!1,size:C,headerActions:k=null,__experimentalHideHeader:j=!1}=e,E=(0,f.useRef)(),M=(0,d.useInstanceId)(xP),N=o?`components-modal-header-${M}`:h.labelledby,T=(0,d.useFocusOnMount)("firstContentElement"===i?"firstElement":i),P=(0,d.useConstrainedTabbing)(),D=(0,d.useFocusReturn)(),I=(0,f.useRef)(null),R=(0,f.useRef)(null),[O,A]=(0,f.useState)(!1),[z,L]=(0,f.useState)(!1);let F;S||"fill"===C?F="is-full-screen":C&&(F=`has-size-${C}`);const B=(0,f.useCallback)((()=>{if(!I.current)return;const e=(0,pT.getScrollContainer)(I.current);I.current===e?L(!0):L(!1)}),[I]);(0,f.useEffect)((()=>(function(e){const t=Array.from(document.body.children),n=[];hP.push(n);for(const r of t)r!==e&&pP(r)&&(r.setAttribute("aria-hidden","true"),n.push(r))}(E.current),()=>function(){const e=hP.pop();if(e)for(const t of e)t.removeAttribute("aria-hidden")}())),[]);const V=(0,f.useRef)();(0,f.useEffect)((()=>{V.current=p}),[p]);const W=(0,f.useContext)(vP),[$]=(0,f.useState)((()=>new Set));(0,f.useEffect)((()=>{W.add(V);for(const e of W)e!==V&&e.current?.();return()=>{for(const e of $)e.current?.();W.delete(V)}}),[W,$]),(0,f.useEffect)((()=>{var e;const t=n,r=1+(null!==(e=bP.get(t))&&void 0!==e?e:0);return bP.set(t,r),document.body.classList.add(n),()=>{const e=bP.get(t)-1;0===e?(document.body.classList.remove(t),bP.delete(t)):bP.set(t,e)}}),[n]);const{closeModal:H,frameRef:U,frameStyle:Y,overlayClassname:G}=function(){const e=(0,f.useRef)(),[t,n]=(0,f.useState)(!1),r=(0,d.useReducedMotion)(),o=(0,f.useCallback)((()=>new Promise((t=>{const o=e.current;if(r)return void t();if(!o)return void t();let i;Promise.race([new Promise((e=>{i=t=>{"components-modal__disappear-animation"===t.animationName&&e()},o.addEventListener("animationend",i),n(!0)})),new Promise((e=>{setTimeout((()=>e()),1.2*gP)}))]).then((()=>{i&&o.removeEventListener("animationend",i),n(!1),t()}))}))),[r]);return{overlayClassname:t?"is-animating-out":void 0,frameRef:e,frameStyle:{"--modal-frame-animation-duration":`${mP}`},closeModal:o}}();(0,f.useLayoutEffect)((()=>{if(!window.ResizeObserver||!R.current)return;const e=new ResizeObserver(B);return e.observe(R.current),B(),()=>{e.disconnect()}}),[B,R]);const q=(0,f.useCallback)((e=>{var t;const n=null!==(t=e?.currentTarget?.scrollTop)&&void 0!==t?t:-1;!O&&n>0?A(!0):O&&n<=0&&A(!1)}),[O]);let K=null;const X={onPointerDown:e=>{e.target===e.currentTarget&&(K=e.target,e.preventDefault())},onPointerUp:({target:e,button:t})=>{const n=e===K;K=null,0===t&&n&&H().then((()=>p()))}},Z=(0,kt.jsx)("div",{ref:(0,d.useMergeRefs)([E,t]),className:c("components-modal__screen-overlay",G,x),onKeyDown:vy((function(e){!s||"Escape"!==e.code&&"Escape"!==e.key||e.defaultPrevented||(e.preventDefault(),H().then((()=>p(e))))})),...a?X:{},children:(0,kt.jsx)(t_,{document,children:(0,kt.jsx)("div",{className:c("components-modal__frame",F,y),style:{...Y,...b},ref:(0,d.useMergeRefs)([U,P,D,"firstContentElement"!==i?T:null]),role:r,"aria-label":w,"aria-labelledby":w?void 0:N,"aria-describedby":h.describedby,tabIndex:-1,onKeyDown:_,children:(0,kt.jsxs)("div",{className:c("components-modal__content",{"hide-header":j,"is-scrollable":z,"has-scrolled-content":O}),role:"document",onScroll:q,ref:I,"aria-label":z?(0,u.__)("Scrollable section"):void 0,tabIndex:z?0:void 0,children:[!j&&(0,kt.jsxs)("div",{className:"components-modal__header",children:[(0,kt.jsxs)("div",{className:"components-modal__header-heading-container",children:[m&&(0,kt.jsx)("span",{className:"components-modal__icon-container","aria-hidden":!0,children:m}),o&&(0,kt.jsx)("h1",{id:N,className:"components-modal__header-heading",children:o})]}),k,l&&(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(Mv,{marginBottom:0,marginLeft:2}),(0,kt.jsx)(Hy,{size:"compact",onClick:e=>H().then((()=>p(e))),icon:Tw,label:g||(0,u.__)("Close")})]})]}),(0,kt.jsx)("div",{ref:(0,d.useMergeRefs)([R,"firstContentElement"===i?T:null]),children:v})]})})})});return(0,f.createPortal)((0,kt.jsx)(vP.Provider,{value:$,children:Z}),document.body)}));var yP=xP;const wP={name:"7g5ii0",styles:"&&{z-index:1000001;}"};var _P=ul(((e,t)=>{const{isOpen:n,onConfirm:r,onCancel:o,children:i,confirmButtonText:s,cancelButtonText:a,...l}=cl(e,"ConfirmDialog"),c=ll()(wP),d=(0,f.useRef)(),h=(0,f.useRef)(),[p,m]=(0,f.useState)(),[g,v]=(0,f.useState)();(0,f.useEffect)((()=>{const e=void 0!==n;m(!e||n),v(!e)}),[n]);const b=(0,f.useCallback)((e=>t=>{e?.(t),g&&m(!1)}),[g,m]),x=(0,f.useCallback)((e=>{e.target===d.current||e.target===h.current||"Enter"!==e.key||b(r)(e)}),[b,r]),y=null!=a?a:(0,u.__)("Cancel"),w=null!=s?s:(0,u.__)("OK");return(0,kt.jsx)(kt.Fragment,{children:p&&(0,kt.jsx)(yP,{onRequestClose:b(o),onKeyDown:x,closeButtonLabel:y,isDismissible:!0,ref:t,overlayClassName:c,__experimentalHideHeader:!0,...l,children:(0,kt.jsxs)(lj,{spacing:8,children:[(0,kt.jsx)(Rb,{children:i}),(0,kt.jsxs)(vv,{direction:"row",justify:"flex-end",children:[(0,kt.jsx)(Hy,{__next40pxDefaultSize:!0,ref:d,variant:"tertiary",onClick:b(o),children:y}),(0,kt.jsx)(Hy,{__next40pxDefaultSize:!0,ref:h,variant:"primary",onClick:b(r),children:w})]})]})})})}),"ConfirmDialog"),SP=((0,$.createContext)(void 0),Tt([xr,At],[yr,zt])),CP=SP.useContext,kP=(SP.useScopedContext,SP.useProviderContext);SP.ContextProvider,SP.ScopedContextProvider,(0,$.createContext)(void 0),(0,$.createContext)(!1);function jP(e={}){var t=e,{combobox:n}=t,r=D(t,["combobox"]);const o=Je(r.store,Qe(n,["value","items","renderedItems","baseElement","arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"])),i=o.getState(),s=vt(P(T({},r),{store:o,virtualFocus:W(r.virtualFocus,i.virtualFocus,!0),includesBaseElement:W(r.includesBaseElement,i.includesBaseElement,!1),activeId:W(r.activeId,i.activeId,r.defaultActiveId,null),orientation:W(r.orientation,i.orientation,"vertical")})),a=rr(P(T({},r),{store:o,placement:W(r.placement,i.placement,"bottom-start")})),l=new String(""),c=P(T(T({},s.getState()),a.getState()),{value:W(r.value,i.value,r.defaultValue,l),setValueOnMove:W(r.setValueOnMove,i.setValueOnMove,!1),labelElement:W(i.labelElement,null),selectElement:W(i.selectElement,null),listElement:W(i.listElement,null)}),u=Ye(c,s,a,o);return Ge(u,(()=>Xe(u,["value","items"],(e=>{if(e.value!==l)return;if(!e.items.length)return;const t=e.items.find((e=>!e.disabled&&null!=e.value));null!=(null==t?void 0:t.value)&&u.setState("value",t.value)})))),Ge(u,(()=>Xe(u,["mounted"],(e=>{e.mounted||u.setState("activeId",c.activeId)})))),Ge(u,(()=>Xe(u,["mounted","items","value"],(e=>{if(n)return;if(e.mounted)return;const t=ct(e.value),r=t[t.length-1];if(null==r)return;const o=e.items.find((e=>!e.disabled&&e.value===r));o&&u.setState("activeId",o.id)})))),Ge(u,(()=>Ze(u,["setValueOnMove","moves"],(e=>{const{mounted:t,value:n,activeId:r}=u.getState();if(!e.setValueOnMove&&t)return;if(Array.isArray(n))return;if(!e.moves)return;if(!r)return;const o=s.item(r);o&&!o.disabled&&null!=o.value&&u.setState("value",o.value)})))),P(T(T(T({},s),a),u),{combobox:n,setValue:e=>u.setState("value",e),setLabelElement:e=>u.setState("labelElement",e),setSelectElement:e=>u.setState("selectElement",e),setListElement:e=>u.setState("listElement",e)})}function EP(e={}){e=function(e){const t=kP();return bt(e=w(y({},e),{combobox:void 0!==e.combobox?e.combobox:t}))}(e);const[t,n]=st(jP,e);return function(e,t,n){return Ie(t,[n.combobox]),it(e,n,"value","setValue"),it(e,n,"setValueOnMove"),Object.assign(tr(xt(e,t,n),t,n),{combobox:n.combobox})}(t,n,e)}var MP=Tt([xr,At],[yr,zt]),NP=MP.useContext,TP=MP.useScopedContext,PP=MP.useProviderContext,DP=(MP.ContextProvider,MP.ScopedContextProvider),IP=(0,$.createContext)(!1),RP=(0,$.createContext)(null),OP=Nt((function(e){var t=e,{store:n}=t,r=_(t,["store"]);const o=PP();L(n=n||o,!1);const i=Pe(r.id),s=r.onClick,a=Me((e=>{null==s||s(e),e.defaultPrevented||queueMicrotask((()=>{const e=null==n?void 0:n.getState().selectElement;null==e||e.focus()}))}));return V(r=w(y({id:i},r),{ref:Te(n.setLabelElement,r.ref),onClick:a,style:y({cursor:"default"},r.style)}))})),AP=Et(jt((function(e){return Mt("div",OP(e))}))),zP="button",LP=Nt((function(e){const t=(0,$.useRef)(null),n=De(t,zP),[r,o]=(0,$.useState)((()=>!!n&&te({tagName:n,type:e.type})));return(0,$.useEffect)((()=>{t.current&&o(te(t.current))}),[]),e=w(y({role:r||"a"===n?void 0:"button"},e),{ref:Te(t,e.ref)}),e=In(e)})),FP=(jt((function(e){const t=LP(e);return Mt(zP,t)})),Symbol("disclosure")),BP=Nt((function(e){var t=e,{store:n,toggleOnClick:r=!0}=t,o=_(t,["store","toggleOnClick"]);const i=cr();L(n=n||i,!1);const s=(0,$.useRef)(null),[a,l]=(0,$.useState)(!1),c=n.useState("disclosureElement"),u=n.useState("open");(0,$.useEffect)((()=>{let e=c===s.current;(null==c?void 0:c.isConnected)||(null==n||n.setDisclosureElement(s.current),e=!0),l(u&&e)}),[c,n,u]);const d=o.onClick,f=Oe(r),[h,p]=Le(o,FP,!0),m=Me((e=>{null==d||d(e),e.defaultPrevented||h||f(e)&&(null==n||n.setDisclosureElement(e.currentTarget),null==n||n.toggle())})),g=n.useState("contentElement");return o=w(y(y({"aria-expanded":a,"aria-controls":null==g?void 0:g.id},p),o),{ref:Te(s,o.ref),onClick:m}),o=LP(o)})),VP=(jt((function(e){return Mt("button",BP(e))})),Nt((function(e){var t=e,{store:n}=t,r=_(t,["store"]);const o=dr();L(n=n||o,!1);const i=n.useState("contentElement");return r=y({"aria-haspopup":se(i,"dialog")},r),r=BP(y({store:n},r))}))),WP=(jt((function(e){return Mt("button",VP(e))})),Nt((function(e){var t=e,{store:n}=t,r=_(t,["store"]);const o=br();return n=n||o,r=w(y({},r),{ref:Te(null==n?void 0:n.setAnchorElement,r.ref)})}))),$P=(jt((function(e){return Mt("div",WP(e))})),Nt((function(e){var t=e,{store:n}=t,r=_(t,["store"]);const o=br();L(n=n||o,!1);const i=r.onClick,s=Me((e=>{null==n||n.setAnchorElement(e.currentTarget),null==i||i(e)}));return r=Ae(r,(e=>(0,kt.jsx)(yr,{value:n,children:e})),[n]),r=w(y({},r),{onClick:s}),r=WP(y({store:n},r)),r=VP(y({store:n},r))}))),HP=(jt((function(e){return Mt("button",$P(e))})),{top:"4,10 8,6 12,10",right:"6,4 10,8 6,12",bottom:"4,6 8,10 12,6",left:"10,4 6,8 10,12"}),UP=Nt((function(e){var t=e,{store:n,placement:r}=t,o=_(t,["store","placement"]);const i=vr();L(n=n||i,!1);const s=n.useState((e=>r||e.placement)).split("-")[0],a=HP[s],l=(0,$.useMemo)((()=>(0,kt.jsx)("svg",{display:"block",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,viewBox:"0 0 16 16",height:"1em",width:"1em",children:(0,kt.jsx)("polyline",{points:a})})),[a]);return V(o=w(y({children:l,"aria-hidden":!0},o),{style:y({width:"1em",height:"1em",pointerEvents:"none"},o.style)}))})),YP=(jt((function(e){return Mt("span",UP(e))})),Nt((function(e){var t=e,{store:n}=t,r=_(t,["store"]);const o=NP();return r=UP(y({store:n=n||o},r))}))),GP=jt((function(e){return Mt("span",YP(e))}));function qP(e,t){return()=>{const n=t();if(!n)return;let r=0,o=e.item(n);const i=o;for(;o&&null==o.value;){const n=t(++r);if(!n)return;if(o=e.item(n),o===i)break}return null==o?void 0:o.id}}var KP=Nt((function(e){var t=e,{store:n,name:r,form:o,required:i,showOnKeyDown:s=!0,moveOnKeyDown:a=!0,toggleOnPress:l=!0,toggleOnClick:c=l}=t,u=_(t,["store","name","form","required","showOnKeyDown","moveOnKeyDown","toggleOnPress","toggleOnClick"]);const d=PP();L(n=n||d,!1);const f=u.onKeyDown,h=Oe(s),p=Oe(a),m=n.useState("placement").split("-")[0],g=n.useState("value"),v=Array.isArray(g),b=Me((e=>{var t;if(null==f||f(e),e.defaultPrevented)return;if(!n)return;const{orientation:r,items:o,activeId:i}=n.getState(),s="horizontal"!==r,a="vertical"!==r,l=!!(null==(t=o.find((e=>!e.disabled&&null!=e.value)))?void 0:t.rowId),c={ArrowUp:(l||s)&&qP(n,n.up),ArrowRight:(l||a)&&qP(n,n.next),ArrowDown:(l||s)&&qP(n,n.down),ArrowLeft:(l||a)&&qP(n,n.previous)}[e.key];c&&p(e)&&(e.preventDefault(),n.move(c()));const u="top"===m||"bottom"===m;({ArrowDown:u,ArrowUp:u,ArrowLeft:"left"===m,ArrowRight:"right"===m})[e.key]&&h(e)&&(e.preventDefault(),n.move(i),ye(e.currentTarget,"keyup",n.show))}));u=Ae(u,(e=>(0,kt.jsx)(DP,{value:n,children:e})),[n]);const[x,S]=(0,$.useState)(!1),C=(0,$.useRef)(!1);(0,$.useEffect)((()=>{const e=C.current;C.current=!1,e||S(!1)}),[g]);const k=n.useState((e=>{var t;return null==(t=e.labelElement)?void 0:t.id})),j=u["aria-label"],E=u["aria-labelledby"]||k,M=n.useState((e=>{if(r)return e.items})),N=(0,$.useMemo)((()=>[...new Set(null==M?void 0:M.map((e=>e.value)).filter((e=>null!=e)))]),[M]);u=Ae(u,(e=>r?(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsxs)("select",{style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},tabIndex:-1,"aria-hidden":!0,"aria-label":j,"aria-labelledby":E,name:r,form:o,required:i,value:g,multiple:v,onFocus:()=>{var e;return null==(e=null==n?void 0:n.getState().selectElement)?void 0:e.focus()},onChange:e=>{var t;C.current=!0,S(!0),null==n||n.setValue(v?(t=e.target,Array.from(t.selectedOptions).map((e=>e.value))):e.target.value)},children:[ct(g).map((e=>null==e||N.includes(e)?null:(0,kt.jsx)("option",{value:e,children:e},e))),N.map((e=>(0,kt.jsx)("option",{value:e,children:e},e)))]}),e]}):e),[n,j,E,r,o,i,g,v,N]);const T=(0,kt.jsxs)(kt.Fragment,{children:[g,(0,kt.jsx)(GP,{})]}),P=n.useState("contentElement");return u=w(y({role:"combobox","aria-autocomplete":"none","aria-labelledby":k,"aria-haspopup":se(P,"listbox"),"data-autofill":x||void 0,"data-name":r,children:T},u),{ref:Te(n.setSelectElement,u.ref),onKeyDown:b}),u=$P(y({store:n,toggleOnClick:c},u)),u=Yn(y({store:n},u))})),XP=jt((function(e){return Mt("button",KP(e))})),ZP=(0,$.createContext)(null),QP=Nt((function(e){var t=e,{store:n,resetOnEscape:r=!0,hideOnEnter:o=!0,focusOnMove:i=!0,composite:s,alwaysVisible:a}=t,l=_(t,["store","resetOnEscape","hideOnEnter","focusOnMove","composite","alwaysVisible"]);const c=NP();L(n=n||c,!1);const u=Pe(l.id),d=n.useState("value"),f=Array.isArray(d),[h,p]=(0,$.useState)(d),m=n.useState("mounted");(0,$.useEffect)((()=>{m||p(d)}),[m,d]),r=r&&!f;const g=l.onKeyDown,v=Oe(r),b=Oe(o),x=Me((e=>{null==g||g(e),e.defaultPrevented||("Escape"===e.key&&v(e)&&(null==n||n.setValue(h))," "!==e.key&&"Enter"!==e.key||pe(e)&&b(e)&&(e.preventDefault(),null==n||n.hide()))})),S=(0,$.useContext)(RP),C=(0,$.useState)(),[k,j]=S||C,E=(0,$.useMemo)((()=>[k,j]),[k]),[M,N]=(0,$.useState)(null),T=(0,$.useContext)(ZP);(0,$.useEffect)((()=>{if(T)return T(n),()=>T(null)}),[T,n]),l=Ae(l,(e=>(0,kt.jsx)(DP,{value:n,children:(0,kt.jsx)(ZP.Provider,{value:N,children:(0,kt.jsx)(RP.Provider,{value:E,children:e})})})),[n,E]);const P=!!n.combobox;s=null!=s?s:!P&&M!==n;const[D,I]=Ne(s?n.setListElement:null),R=function(e,t,n){const r=je(n),[o,i]=(0,$.useState)(r);return(0,$.useEffect)((()=>{const n=e&&"current"in e?e.current:e;if(!n)return;const o=()=>{const e=n.getAttribute(t);i(null==e?r:e)},s=new MutationObserver(o);return s.observe(n,{attributeFilter:[t]}),o(),()=>s.disconnect()}),[e,t,r]),o}(D,"role",l.role),O=(s||("listbox"===R||"menu"===R||"tree"===R||"grid"===R))&&f||void 0,A=Jr(m,l.hidden,a),z=A?w(y({},l.style),{display:"none"}):l.style;s&&(l=y({role:"listbox","aria-multiselectable":O},l));const F=n.useState((e=>{var t;return k||(null==(t=e.labelElement)?void 0:t.id)}));return l=w(y({id:u,"aria-labelledby":F,hidden:A},l),{ref:Te(I,l.ref),style:z,onKeyDown:x}),l=fn(w(y({store:n},l),{composite:s})),l=Yn(y({store:n,typeahead:!P},l))})),JP=(jt((function(e){return Mt("div",QP(e))})),Nt((function(e){var t=e,{store:n,alwaysVisible:r}=t,o=_(t,["store","alwaysVisible"]);const i=PP();return o=QP(y({store:n=n||i,alwaysVisible:r},o)),o=Yi(y({store:n,alwaysVisible:r},o))}))),eD=ko(jt((function(e){return Mt("div",JP(e))})),PP);var tD=Nt((function(e){var t,n=e,{store:r,value:o,getItem:i,hideOnClick:s,setValueOnClick:a=null!=o,preventScrollOnKeyDown:l=!0,focusOnHover:c=!0}=n,u=_(n,["store","value","getItem","hideOnClick","setValueOnClick","preventScrollOnKeyDown","focusOnHover"]);const d=TP();L(r=r||d,!1);const f=Pe(u.id),h=B(u),{listElement:p,multiSelectable:m,selected:g,autoFocus:v}=ot(r,{listElement:"listElement",multiSelectable:e=>Array.isArray(e.value),selected:e=>function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)}(e.value,o),autoFocus:e=>null!=o&&(null!=e.value&&((e.activeId===f||!(null==r?void 0:r.item(e.activeId)))&&(Array.isArray(e.value)?e.value[e.value.length-1]===o:e.value===o)))}),b=(0,$.useCallback)((e=>{const t=w(y({},e),{value:h?void 0:o,children:o});return i?i(t):t}),[h,o,i]);s=null!=s?s:null!=o&&!m;const x=u.onClick,S=Oe(a),C=Oe(s),k=Me((e=>{null==x||x(e),e.defaultPrevented||ge(e)||me(e)||(S(e)&&null!=o&&(null==r||r.setValue((e=>Array.isArray(e)?e.includes(o)?e.filter((e=>e!==o)):[...e,o]:o))),C(e)&&(null==r||r.hide()))}));u=Ae(u,(e=>(0,kt.jsx)(IP.Provider,{value:null!=g&&g,children:e})),[g]),u=w(y({id:f,role:ae(p),"aria-selected":g,children:o},u),{autoFocus:null!=(t=u.autoFocus)?t:v,onClick:k}),u=An(y({store:r,getItem:b,preventScrollOnKeyDown:l},u));const j=Oe(c);return u=En(w(y({store:r},u),{focusOnHover(e){if(!j(e))return!1;const t=null==r?void 0:r.getState();return!!(null==t?void 0:t.open)}}))})),nD=Et(jt((function(e){return Mt("div",tD(e))}))),rD=(0,$.createContext)(!1),oD=(0,kt.jsx)("svg",{display:"block",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,viewBox:"0 0 16 16",height:"1em",width:"1em",children:(0,kt.jsx)("polyline",{points:"4,8 7,12 12,4"})});var iD=Nt((function(e){var t=e,{store:n,checked:r}=t,o=_(t,["store","checked"]);const i=(0,$.useContext)(rD),s=function(e){return e.checked?e.children||oD:"function"==typeof e.children?e.children:null}({checked:r=null!=r?r:i,children:o.children});return V(o=w(y({"aria-hidden":!0},o),{children:s,style:y({width:"1em",height:"1em",pointerEvents:"none"},o.style)}))})),sD=(jt((function(e){return Mt("span",iD(e))})),Nt((function(e){var t=e,{store:n,checked:r}=t,o=_(t,["store","checked"]);const i=(0,$.useContext)(IP);return r=null!=r?r:i,o=iD(w(y({},o),{checked:r}))}))),aD=jt((function(e){return Mt("span",sD(e))}));const lD="2px",cD="400ms",uD="cubic-bezier( 0.16, 1, 0.3, 1 )",dD={compact:Wl.controlPaddingXSmall,small:Wl.controlPaddingXSmall,default:Wl.controlPaddingX},fD=Sl(XP,{shouldForwardProp:e=>"hasCustomRenderProp"!==e,target:"e1p3eej77"})((({size:e,hasCustomRenderProp:t})=>Dl("display:block;background-color:",Fl.theme.background,";border:none;color:",Fl.theme.foreground,";cursor:pointer;font-family:inherit;text-align:start;user-select:none;width:100%;&[data-focus-visible]{outline:none;}",((e,t)=>{const n={compact:{[t]:32,paddingInlineStart:dD.compact,paddingInlineEnd:dD.compact+18},default:{[t]:40,paddingInlineStart:dD.default,paddingInlineEnd:dD.default+18},small:{[t]:24,paddingInlineStart:dD.small,paddingInlineEnd:dD.small+18}};return n[e]||n.default})(e,t?"minHeight":"height")," ",!t&&gD," ",Yb({inputSize:e}),";","")),""),hD=Il({"0%":{opacity:0,transform:`translateY(-${lD})`},"100%":{opacity:1,transform:"translateY(0)"}}),pD=Sl(eD,{target:"e1p3eej76"})("display:flex;flex-direction:column;background-color:",Fl.theme.background,";border-radius:",Wl.radiusSmall,";border:1px solid ",Fl.theme.foreground,";box-shadow:",Wl.elevationMedium,";z-index:1000000;max-height:min( var( --popover-available-height, 400px ), 400px );overflow:auto;overscroll-behavior:contain;min-width:min-content;&[data-open]{@media not ( prefers-reduced-motion ){animation-duration:",cD,";animation-timing-function:",uD,";animation-name:",hD,";will-change:transform,opacity;}}&[data-focus-visible]{outline:none;}"),mD=Sl(nD,{target:"e1p3eej75"})((({size:e})=>Dl("cursor:default;display:flex;align-items:center;justify-content:space-between;font-size:",Wl.fontSize,";line-height:28px;padding-block:",Rl(2),";scroll-margin:",Rl(1),";user-select:none;&[aria-disabled='true']{cursor:not-allowed;}&[data-active-item]{background-color:",Fl.theme.gray[300],";}",(e=>{const t={compact:{paddingInlineStart:dD.compact,paddingInlineEnd:dD.compact-6},default:{paddingInlineStart:dD.default,paddingInlineEnd:dD.default-6},small:{paddingInlineStart:dD.small,paddingInlineEnd:dD.small-6}};return t[e]||t.default})(e),";","")),""),gD={name:"1h52dri",styles:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap"},vD=Sl("div",{target:"e1p3eej74"})(gD,";"),bD=Sl("span",{target:"e1p3eej73"})("color:",Fl.theme.gray[600],";margin-inline-start:",Rl(2),";"),xD=Sl("div",{target:"e1p3eej72"})("display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;flex:1;column-gap:",Rl(4),";"),yD=Sl("span",{target:"e1p3eej71"})("color:",Fl.theme.gray[600],";text-align:initial;line-height:",Wl.fontLineHeightBase,";padding-inline-end:",Rl(1),";margin-block:",Rl(1),";"),wD=Sl(aD,{target:"e1p3eej70"})("display:flex;align-items:center;margin-inline-start:",Rl(2),";fill:currentColor;align-self:start;margin-block-start:2px;font-size:0;",xD,"~&,&:not(:empty){font-size:24px;}"),_D=(0,f.createContext)(void 0);function SD(e){return(Array.isArray(e)?0===e.length:null==e)?(0,u.__)("Select an item"):Array.isArray(e)?1===e.length?e[0]:(0,u.sprintf)((0,u._n)("%d item selected","%d items selected",e.length),e.length):e}_D.displayName="CustomSelectContext";const CD=({renderSelectedValue:e,size:t="default",store:n,...r})=>{const{value:o}=rt(n),i=(0,f.useMemo)((()=>null!=e?e:SD),[e]);return(0,kt.jsx)(fD,{...r,size:t,hasCustomRenderProp:!!e,store:n,children:i(o)})};var kD=function(e){const{children:t,hideLabelFromVision:n=!1,label:r,size:o,store:i,className:s,isLegacy:a=!1,...l}=e,c=(0,f.useCallback)((e=>{a&&e.stopPropagation()}),[a]),u=(0,f.useMemo)((()=>({store:i,size:o})),[i,o]);return(0,kt.jsxs)("div",{className:s,children:[(0,kt.jsx)(AP,{store:i,render:n?(0,kt.jsx)(jl,{}):(0,kt.jsx)(Oy.VisualLabel,{as:"div"}),children:r}),(0,kt.jsxs)(lx,{__next40pxDefaultSize:!0,size:o,suffix:(0,kt.jsx)(tC,{}),children:[(0,kt.jsx)(CD,{...l,size:o,store:i,showOnKeyDown:!a}),(0,kt.jsx)(pD,{gutter:12,store:i,sameWidth:!0,slide:!1,onKeyDown:c,flip:!a,children:(0,kt.jsx)(_D.Provider,{value:u,children:t})})]})]})};function jD({children:e,...t}){var n;const r=(0,f.useContext)(_D);return(0,kt.jsxs)(mD,{store:r?.store,size:null!==(n=r?.size)&&void 0!==n?n:"default",...t,children:[null!=e?e:t.value,(0,kt.jsx)(wD,{children:(0,kt.jsx)(JS,{icon:tk})})]})}jD.displayName="CustomSelectControlV2.Item";var ED=jD;function MD({__experimentalHint:e,...t}){return{hint:e,...t}}function ND(e,t){return t||(0,u.sprintf)((0,u.__)("Currently selected: %s"),e)}var TD=function e(t){const{__next40pxDefaultSize:n=!1,__shouldNotWarnDeprecated36pxSize:r,describedBy:o,options:i,onChange:s,size:a="default",value:l,className:u,showSelectedHint:f=!1,...h}=function({__experimentalShowSelectedHint:e,...t}){return{showSelectedHint:e,...t}}(t);Ay({componentName:"CustomSelectControl",__next40pxDefaultSize:n,size:a,__shouldNotWarnDeprecated36pxSize:r});const p=(0,d.useInstanceId)(e,"custom-select-control__description"),m=EP({async setValue(e){const t=i.find((t=>t.name===e));if(!s||!t)return;await Promise.resolve();const n=m.getState(),r={highlightedIndex:n.renderedItems.findIndex((t=>t.value===e)),inputValue:"",isOpen:n.open,selectedItem:t,type:""};s(r)},value:l?.name,defaultValue:i[0]?.name}),g=i.map(MD).map((({name:e,key:t,hint:n,style:r,className:o})=>{const i=(0,kt.jsxs)(xD,{children:[(0,kt.jsx)("span",{children:e}),(0,kt.jsx)(yD,{className:"components-custom-select-control__item-hint",children:n})]});return(0,kt.jsx)(ED,{value:e,children:n?i:e,style:r,className:c(o,"components-custom-select-control__item",{"has-hint":n})},t)})),v=rt(m,"value"),b=n&&"default"===a||"__unstable-large"===a?"default":n||"default"!==a?a:"compact";return(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(kD,{"aria-describedby":p,renderSelectedValue:f?()=>{const e=i?.map(MD)?.find((({name:e})=>v===e))?.hint;return(0,kt.jsxs)(vD,{children:[v,e&&(0,kt.jsx)(bD,{className:"components-custom-select-control__hint",children:e})]})}:void 0,size:b,store:m,className:c("components-custom-select-control",u),isLegacy:!0,...h,children:g}),(0,kt.jsx)(jl,{children:(0,kt.jsx)("span",{id:p,children:ND(v,o)})})]})};function PD(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function DD(e){const t=PD(e);return t.setHours(0,0,0,0),t}function ID(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function RD(e,t){const n=PD(e);if(isNaN(t))return ID(e,NaN);if(!t)return n;const r=n.getDate(),o=ID(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);return r>=o.getDate()?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}function OD(e,t){return RD(e,-t)}const AD={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function zD(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const LD={date:zD({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:zD({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:zD({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},FD={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function BD(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}const VD={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:BD({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:BD({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:BD({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:BD({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:BD({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function WD(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(a,(e=>e.test(s))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(a,(e=>e.test(s)));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:t.slice(s.length)}}}const $D={ordinalNumber:(HD={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(HD.matchPattern);if(!n)return null;const r=n[0],o=e.match(HD.parsePattern);if(!o)return null;let i=HD.valueCallback?HD.valueCallback(o[0]):o[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(r.length)}}),era:WD({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:WD({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:WD({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:WD({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:WD({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var HD;const UD={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=AD[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:LD,formatRelative:(e,t,n,r)=>FD[e],localize:VD,match:$D,options:{weekStartsOn:0,firstWeekContainsDate:1}};let YD={};function GD(){return YD}Math.pow(10,8);const qD=6048e5;function KD(e){const t=PD(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function XD(e,t){const n=DD(e),r=DD(t),o=+n-KD(n),i=+r-KD(r);return Math.round((o-i)/864e5)}function ZD(e){const t=PD(e),n=ID(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function QD(e){const t=PD(e);return XD(t,ZD(t))+1}function JD(e,t){const n=GD(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=PD(e),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function eI(e){return JD(e,{weekStartsOn:1})}function tI(e){const t=PD(e),n=t.getFullYear(),r=ID(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=eI(r),i=ID(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=eI(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function nI(e){const t=tI(e),n=ID(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),eI(n)}function rI(e){const t=PD(e),n=+eI(t)-+nI(t);return Math.round(n/qD)+1}function oI(e,t){const n=PD(e),r=n.getFullYear(),o=GD(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=ID(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=JD(s,t),l=ID(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=JD(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function iI(e,t){const n=GD(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=oI(e,t),i=ID(e,0);i.setFullYear(o,0,r),i.setHours(0,0,0,0);return JD(i,t)}function sI(e,t){const n=PD(e),r=+JD(n,t)-+iI(n,t);return Math.round(r/qD)+1}function aI(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const lI={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return aI("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):aI(n+1,2)},d:(e,t)=>aI(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>aI(e.getHours()%12||12,t.length),H:(e,t)=>aI(e.getHours(),t.length),m:(e,t)=>aI(e.getMinutes(),t.length),s:(e,t)=>aI(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return aI(Math.trunc(r*Math.pow(10,n-3)),t.length)}},cI="midnight",uI="noon",dI="morning",fI="afternoon",hI="evening",pI="night",mI={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return lI.y(e,t)},Y:function(e,t,n,r){const o=oI(e,r),i=o>0?o:1-o;if("YY"===t){return aI(i%100,2)}return"Yo"===t?n.ordinalNumber(i,{unit:"year"}):aI(i,t.length)},R:function(e,t){return aI(tI(e),t.length)},u:function(e,t){return aI(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return aI(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return aI(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return lI.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return aI(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=sI(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):aI(o,t.length)},I:function(e,t,n){const r=rI(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):aI(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):lI.d(e,t)},D:function(e,t,n){const r=QD(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):aI(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return aI(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return aI(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return aI(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?uI:0===r?cI:r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?hI:r>=12?fI:r>=4?dI:pI,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return lI.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):lI.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):aI(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):aI(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):lI.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):lI.s(e,t)},S:function(e,t){return lI.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return vI(r);case"XXXX":case"XX":return bI(r);default:return bI(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return vI(r);case"xxxx":case"xx":return bI(r);default:return bI(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+gI(r,":");default:return"GMT"+bI(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+gI(r,":");default:return"GMT"+bI(r,":")}},t:function(e,t,n){return aI(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return aI(e.getTime(),t.length)}};function gI(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return 0===i?n+String(o):n+String(o)+t+aI(i,2)}function vI(e,t){if(e%60==0){return(e>0?"-":"+")+aI(Math.abs(e)/60,2)}return bI(e,t)}function bI(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+aI(Math.trunc(r/60),2)+t+aI(r%60,2)}const xI=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},yI=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},wI={p:yI,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return xI(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"})}return i.replace("{{date}}",xI(r,t)).replace("{{time}}",yI(o,t))}},_I=/^D+$/,SI=/^Y+$/,CI=["D","DD","YY","YYYY"];function kI(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function jI(e){if(!kI(e)&&"number"!=typeof e)return!1;const t=PD(e);return!isNaN(Number(t))}const EI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,MI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,NI=/^'([^]*?)'?$/,TI=/''/g,PI=/[a-zA-Z]/;function DI(e,t,n){const r=GD(),o=n?.locale??r.locale??UD,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=PD(e);if(!jI(a))throw new RangeError("Invalid time value");let l=t.match(MI).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,wI[t])(e,o.formatLong)}return e})).join("").match(EI).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:II(e)};if(mI[t])return{isToken:!0,value:e};if(t.match(PI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map((r=>{if(!r.isToken)return r.value;const i=r.value;(!n?.useAdditionalWeekYearTokens&&function(e){return SI.test(e)}(i)||!n?.useAdditionalDayOfYearTokens&&function(e){return _I.test(e)}(i))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(r),CI.includes(e))throw new RangeError(r)}(i,t,String(e));return(0,mI[i[0]])(a,i,o.localize,c)})).join("")}function II(e){const t=e.match(NI);return t?t[1].replace(TI,"'"):e}function RI(e,t){const n=PD(e),r=PD(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function OI(e,t){return+PD(e)==+PD(t)}function AI(e,t){return+DD(e)==+DD(t)}function zI(e,t){const n=PD(e);return isNaN(t)?ID(e,NaN):t?(n.setDate(n.getDate()+t),n):n}function LI(e,t){return zI(e,7*t)}function FI(e,t){return LI(e,-t)}function BI(e,t){const n=GD(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=PD(e),i=o.getDay(),s=6+(i<r?-7:0)-(i-r);return o.setDate(o.getDate()+s),o.setHours(23,59,59,999),o}var VI=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})}),WI=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})});const $I=window.wp.date;function HI(e,t){const n=PD(e),r=PD(t);return n.getTime()>r.getTime()}function UI(e,t){return+PD(e)<+PD(t)}function YI(e){const t=PD(e),n=t.getFullYear(),r=t.getMonth(),o=ID(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function GI(e,t){const n=PD(e),r=n.getFullYear(),o=n.getDate(),i=ID(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=YI(i);return n.setMonth(t,Math.min(o,s)),n}function qI(e,t){let n=PD(e);return isNaN(+n)?ID(e,NaN):(null!=t.year&&n.setFullYear(t.year),null!=t.month&&(n=GI(n,t.month)),null!=t.date&&n.setDate(t.date),null!=t.hours&&n.setHours(t.hours),null!=t.minutes&&n.setMinutes(t.minutes),null!=t.seconds&&n.setSeconds(t.seconds),null!=t.milliseconds&&n.setMilliseconds(t.milliseconds),n)}function KI(){return DD(Date.now())}function XI(e,t){const n=PD(e);return isNaN(+n)?ID(e,NaN):(n.setFullYear(t),n)}function ZI(e,t){return RD(e,12*t)}function QI(e,t){return ZI(e,-t)}function JI(e,t){const n=PD(e.start),r=PD(e.end);let o=+n>+r;const i=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0);let a=t?.step??1;if(!a)return[];a<0&&(a=-a,o=!o);const l=[];for(;+s<=i;)l.push(PD(s)),s.setDate(s.getDate()+a),s.setHours(0,0,0,0);return o?l.reverse():l}function eR(e,t){const n=PD(e.start),r=PD(e.end);let o=+n>+r;const i=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0),s.setDate(1);let a=t?.step??1;if(!a)return[];a<0&&(a=-a,o=!o);const l=[];for(;+s<=i;)l.push(PD(s)),s.setMonth(s.getMonth()+a);return o?l.reverse():l}function tR(e){const t=PD(e);return t.setDate(1),t.setHours(0,0,0,0),t}function nR(e){const t=PD(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function rR(e,t){const n=PD(e.start),r=PD(e.end);let o=+n>+r;const i=JD(o?r:n,t),s=JD(o?n:r,t);i.setHours(15),s.setHours(15);const a=+s.getTime();let l=i,c=t?.step??1;if(!c)return[];c<0&&(c=-c,o=!o);const u=[];for(;+l<=a;)l.setHours(0),u.push(PD(l)),l=LI(l,c),l.setHours(15);return o?u.reverse():u}let oR=function(e){return e[e.SUNDAY=0]="SUNDAY",e[e.MONDAY=1]="MONDAY",e[e.TUESDAY=2]="TUESDAY",e[e.WEDNESDAY=3]="WEDNESDAY",e[e.THURSDAY=4]="THURSDAY",e[e.FRIDAY=5]="FRIDAY",e[e.SATURDAY=6]="SATURDAY",e}({});const iR=(e,t,n)=>(OI(e,t)||HI(e,t))&&(OI(e,n)||UI(e,n)),sR=e=>qI(e,{hours:0,minutes:0,seconds:0,milliseconds:0});const aR=Sl("div",{target:"e105ri6r7"})(Sy,";"),lR=Sl(ow,{target:"e105ri6r6"})("column-gap:",Rl(2),";display:grid;grid-template-columns:0.5fr repeat( 5, 1fr ) 0.5fr;justify-items:center;margin-bottom:",Rl(4),";"),cR=Sl(Hy,{target:"e105ri6r5"})({name:"sarfoe",styles:"grid-column:1/2"}),uR=Sl(Hy,{target:"e105ri6r4"})({name:"1v98r3z",styles:"grid-column:7/8"}),dR=Sl(dj,{target:"e105ri6r3"})("font-size:",Wl.fontSize,";font-weight:",Wl.fontWeight,";grid-column:2/7;strong{font-weight:",Wl.fontWeightHeading,";}"),fR=Sl("div",{target:"e105ri6r2"})("column-gap:",Rl(2),";display:grid;grid-template-columns:0.5fr repeat( 5, 1fr ) 0.5fr;justify-items:center;row-gap:",Rl(2),";"),hR=Sl("div",{target:"e105ri6r1"})("color:",Fl.theme.gray[700],";font-size:",Wl.fontSize,";line-height:",Wl.fontLineHeightBase,";"),pR=Sl(Hy,{shouldForwardProp:e=>!["column","isSelected","isToday","hasEvents"].includes(e),target:"e105ri6r0"})("grid-column:",(e=>e.column),";position:relative;justify-content:center;",(e=>e.disabled&&"\n\t\tpointer-events: none;\n\t\t")," &&&{border-radius:",Wl.radiusRound,";height:",Rl(7),";width:",Rl(7),";",(e=>e.isSelected&&`\n\t\t\t\tbackground: ${Fl.theme.accent};\n\n\t\t\t\t&,\n\t\t\t\t&:hover:not(:disabled, [aria-disabled=true]) {\n\t\t\t\t\tcolor: ${Fl.theme.accentInverted};\n\t\t\t\t}\n\n\t\t\t\t&:focus:not(:disabled),\n\t\t\t\t&:focus:not(:disabled) {\n\t\t\t\t\tborder: ${Wl.borderWidthFocus} solid currentColor;\n\t\t\t\t}\n\n\t\t\t\t/* Highlight the selected day for high-contrast mode */\n\t\t\t\t&::after {\n\t\t\t\t\tcontent: '';\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\tinset: 0;\n\t\t\t\t\tborder-radius: inherit;\n\t\t\t\t\tborder: 1px solid transparent;\n\t\t\t\t}\n\t\t\t`)," ",(e=>!e.isSelected&&e.isToday&&`\n\t\t\tbackground: ${Fl.theme.gray[200]};\n\t\t\t`),";}",(e=>e.hasEvents&&`\n\t\t::before {\n\t\t\tborder: 2px solid ${e.isSelected?Fl.theme.accentInverted:Fl.theme.accent};\n\t\t\tborder-radius: ${Wl.radiusRound};\n\t\t\tcontent: " ";\n\t\t\tleft: 50%;\n\t\t\tposition: absolute;\n\t\t\ttransform: translate(-50%, 9px);\n\t\t}\n\t\t`),";");function mR(e){return"string"==typeof e?new Date(e):PD(e)}function gR(e,t){return t?(e%12+12)%24:e%12}function vR(e){return(t,n)=>{const r={...t};return n.type!==sy&&n.type!==py&&n.type!==fy||void 0!==r.value&&(r.value=r.value.toString().padStart(e,"0")),r}}function bR(e){var t;const n=null!==(t=e.target?.ownerDocument.defaultView?.HTMLInputElement)&&void 0!==t?t:HTMLInputElement;return e.target instanceof n&&e.target.validity.valid}const xR="yyyy-MM-dd'T'HH:mm:ss";function yR({day:e,column:t,isSelected:n,isFocusable:r,isFocusAllowed:o,isToday:i,isInvalid:s,numEvents:a,onClick:l,onKeyDown:c}){const u=(0,f.useRef)();return(0,f.useEffect)((()=>{u.current&&r&&o&&u.current.focus()}),[r]),(0,kt.jsx)(pR,{__next40pxDefaultSize:!0,ref:u,className:"components-datetime__date__day",disabled:s,tabIndex:r?0:-1,"aria-label":wR(e,n,a),column:t,isSelected:n,isToday:i,hasEvents:a>0,onClick:l,onKeyDown:c,children:(0,$I.dateI18n)("j",e,-e.getTimezoneOffset())})}function wR(e,t,n){const{formats:r}=(0,$I.getSettings)(),o=(0,$I.dateI18n)(r.date,e,-e.getTimezoneOffset());return t&&n>0?(0,u.sprintf)((0,u._n)("%1$s. Selected. There is %2$d event","%1$s. Selected. There are %2$d events",n),o,n):t?(0,u.sprintf)((0,u.__)("%1$s. Selected"),o):n>0?(0,u.sprintf)((0,u._n)("%1$s. There is %2$d event","%1$s. There are %2$d events",n),o,n):o}var _R=function({currentDate:e,onChange:t,events:n=[],isInvalidDate:r,onMonthPreviewed:o,startOfWeek:i=0}){const s=e?mR(e):new Date,{calendar:a,viewing:l,setSelected:c,setViewing:d,isSelected:h,viewPreviousMonth:p,viewNextMonth:m}=(({weekStartsOn:e=oR.SUNDAY,viewing:t=new Date,selected:n=[],numberOfMonths:r=1}={})=>{const[o,i]=(0,f.useState)(t),s=(0,f.useCallback)((()=>i(KI())),[i]),a=(0,f.useCallback)((e=>i((t=>GI(t,e)))),[]),l=(0,f.useCallback)((()=>i((e=>OD(e,1)))),[]),c=(0,f.useCallback)((()=>i((e=>RD(e,1)))),[]),u=(0,f.useCallback)((e=>i((t=>XI(t,e)))),[]),d=(0,f.useCallback)((()=>i((e=>QI(e,1)))),[]),h=(0,f.useCallback)((()=>i((e=>ZI(e,1)))),[]),[p,m]=(0,f.useState)(n.map(sR)),g=(0,f.useCallback)((e=>p.findIndex((t=>OI(t,e)))>-1),[p]),v=(0,f.useCallback)(((e,t)=>{m(t?Array.isArray(e)?e:[e]:t=>t.concat(Array.isArray(e)?e:[e]))}),[]),b=(0,f.useCallback)((e=>m((t=>Array.isArray(e)?t.filter((t=>!e.map((e=>e.getTime())).includes(t.getTime()))):t.filter((t=>!OI(t,e)))))),[]),x=(0,f.useCallback)(((e,t)=>g(e)?b(e):v(e,t)),[b,g,v]),y=(0,f.useCallback)(((e,t,n)=>{m(n?JI({start:e,end:t}):n=>n.concat(JI({start:e,end:t})))}),[]),w=(0,f.useCallback)(((e,t)=>{m((n=>n.filter((n=>!JI({start:e,end:t}).map((e=>e.getTime())).includes(n.getTime())))))}),[]),_=(0,f.useMemo)((()=>eR({start:tR(o),end:nR(RD(o,r-1))}).map((t=>rR({start:tR(t),end:nR(t)},{weekStartsOn:e}).map((t=>JI({start:JD(t,{weekStartsOn:e}),end:BI(t,{weekStartsOn:e})})))))),[o,e,r]);return{clearTime:sR,inRange:iR,viewing:o,setViewing:i,viewToday:s,viewMonth:a,viewPreviousMonth:l,viewNextMonth:c,viewYear:u,viewPreviousYear:d,viewNextYear:h,selected:p,setSelected:m,clearSelected:()=>m([]),isSelected:g,select:v,deselect:b,toggle:x,selectRange:y,deselectRange:w,calendar:_}})({selected:[DD(s)],viewing:DD(s),weekStartsOn:i}),[g,v]=(0,f.useState)(DD(s)),[b,x]=(0,f.useState)(!1),[y,w]=(0,f.useState)(e);return e!==y&&(w(e),c([DD(s)]),d(DD(s)),v(DD(s))),(0,kt.jsxs)(aR,{className:"components-datetime__date",role:"application","aria-label":(0,u.__)("Calendar"),children:[(0,kt.jsxs)(lR,{children:[(0,kt.jsx)(cR,{icon:(0,u.isRTL)()?VI:WI,variant:"tertiary","aria-label":(0,u.__)("View previous month"),onClick:()=>{p(),v(OD(g,1)),o?.(DI(OD(l,1),xR))},size:"compact"}),(0,kt.jsxs)(dR,{level:3,children:[(0,kt.jsx)("strong",{children:(0,$I.dateI18n)("F",l,-l.getTimezoneOffset())})," ",(0,$I.dateI18n)("Y",l,-l.getTimezoneOffset())]}),(0,kt.jsx)(uR,{icon:(0,u.isRTL)()?WI:VI,variant:"tertiary","aria-label":(0,u.__)("View next month"),onClick:()=>{m(),v(RD(g,1)),o?.(DI(RD(l,1),xR))},size:"compact"})]}),(0,kt.jsxs)(fR,{onFocus:()=>x(!0),onBlur:()=>x(!1),children:[a[0][0].map((e=>(0,kt.jsx)(hR,{children:(0,$I.dateI18n)("D",e,-e.getTimezoneOffset())},e.toString()))),a[0].map((e=>e.map(((e,i)=>RI(e,l)?(0,kt.jsx)(yR,{day:e,column:i+1,isSelected:h(e),isFocusable:OI(e,g),isFocusAllowed:b,isToday:AI(e,new Date),isInvalid:!!r&&r(e),numEvents:n.filter((t=>AI(t.date,e))).length,onClick:()=>{c([e]),v(e),t?.(DI(new Date(e.getFullYear(),e.getMonth(),e.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()),xR))},onKeyDown:t=>{let n;"ArrowLeft"===t.key&&(n=zI(e,(0,u.isRTL)()?1:-1)),"ArrowRight"===t.key&&(n=zI(e,(0,u.isRTL)()?-1:1)),"ArrowUp"===t.key&&(n=FI(e,1)),"ArrowDown"===t.key&&(n=LI(e,1)),"PageUp"===t.key&&(n=OD(e,1)),"PageDown"===t.key&&(n=RD(e,1)),"Home"===t.key&&(n=JD(e)),"End"===t.key&&(n=DD(BI(e))),n&&(t.preventDefault(),v(n),RI(n,l)||(d(n),o?.(DI(n,xR))))}},e.toString()):null))))]})]})};function SR(e){const t=PD(e);return t.setSeconds(0,0),t}const CR=Sl("div",{target:"evcr2319"})("box-sizing:border-box;font-size:",Wl.fontSize,";"),kR=Sl("fieldset",{target:"evcr2318"})("border:0;margin:0 0 ",Rl(4)," 0;padding:0;&:last-child{margin-bottom:0;}"),jR=Sl("div",{target:"evcr2317"})({name:"pd0mhc",styles:"direction:ltr;display:flex"}),ER=Dl("&&& ",Zb,"{padding-left:",Rl(2),";padding-right:",Rl(2),";text-align:center;}",""),MR=Sl(aw,{target:"evcr2316"})(ER," width:",Rl(9),";&&& ",Zb,"{padding-right:0;}&&& ",Fb,"{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;}"),NR=Sl("span",{target:"evcr2315"})("border-top:",Wl.borderWidth," solid ",Fl.gray[700],";border-bottom:",Wl.borderWidth," solid ",Fl.gray[700],";font-size:",Wl.fontSize,";line-height:calc(\n\t\t",Wl.controlHeight," - ",Wl.borderWidth," * 2\n\t);display:inline-block;"),TR=Sl(aw,{target:"evcr2314"})(ER," width:",Rl(9),";&&& ",Zb,"{padding-left:0;}&&& ",Fb,"{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;}"),PR=Sl("div",{target:"evcr2313"})({name:"1ff36h2",styles:"flex-grow:1"}),DR=Sl(aw,{target:"evcr2312"})(ER," width:",Rl(9),";"),IR=Sl(aw,{target:"evcr2311"})(ER," width:",Rl(14),";"),RR=Sl("div",{target:"evcr2310"})({name:"ebu3jh",styles:"text-decoration:underline dotted"});var OR=()=>{const{timezone:e}=(0,$I.getSettings)(),t=(new Date).getTimezoneOffset()/60*-1;if(Number(e.offset)===t)return null;const n=Number(e.offset)>=0?"+":"",r=""!==e.abbr&&isNaN(Number(e.abbr))?e.abbr:`UTC${n}${e.offsetFormatted}`,o=e.string.replace("_"," "),i="UTC"===e.string?(0,u.__)("Coordinated Universal Time"):`(${r}) ${o}`;return 0===o.trim().length?(0,kt.jsx)(RR,{className:"components-datetime__timezone",children:r}):(0,kt.jsx)(cs,{placement:"top",text:i,children:(0,kt.jsx)(RR,{className:"components-datetime__timezone",children:r})})};var AR=(0,f.forwardRef)((function(e,t){const{label:n,...r}=e,o=r["aria-label"]||n;return(0,kt.jsx)(NS,{...r,"aria-label":o,ref:t,children:n})}));function zR({value:e,defaultValue:t,is12Hour:n,label:r,minutesProps:o,onChange:i}){const[s={hours:(new Date).getHours(),minutes:(new Date).getMinutes()},a]=lS({value:e,onChange:i,defaultValue:t}),l=s.hours<12?"AM":"PM";const d=s.hours%12||12;const h=e=>(t,{event:r})=>{if(!bR(r))return;const o=Number(t);a({...s,[e]:"hours"===e&&n?gR(o,"PM"===l):o})};const p=r?kR:f.Fragment;return(0,kt.jsxs)(p,{children:[r&&(0,kt.jsx)(Oy.VisualLabel,{as:"legend",children:r}),(0,kt.jsxs)(ow,{alignment:"left",expanded:!1,children:[(0,kt.jsxs)(jR,{className:"components-datetime__time-field components-datetime__time-field-time",children:[(0,kt.jsx)(MR,{className:"components-datetime__time-field-hours-input",label:(0,u.__)("Hours"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,value:String(n?d:s.hours).padStart(2,"0"),step:1,min:n?1:0,max:n?12:23,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:h("hours"),__unstableStateReducer:vR(2)}),(0,kt.jsx)(NR,{className:"components-datetime__time-separator","aria-hidden":"true",children:":"}),(0,kt.jsx)(TR,{className:c("components-datetime__time-field-minutes-input",o?.className),label:(0,u.__)("Minutes"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,value:String(s.minutes).padStart(2,"0"),step:1,min:0,max:59,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:(...e)=>{h("minutes")(...e),o?.onChange?.(...e)},__unstableStateReducer:vR(2),...o})]}),n&&(0,kt.jsxs)(pS,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,isBlock:!0,label:(0,u.__)("Select AM or PM"),hideLabelFromVision:!0,value:l,onChange:e=>{var t;(t=e,()=>{l!==t&&a({...s,hours:gR(d,"PM"===t)})})()},children:[(0,kt.jsx)(AR,{value:"AM",label:(0,u.__)("AM")}),(0,kt.jsx)(AR,{value:"PM",label:(0,u.__)("PM")})]})]})]})}const LR=["dmy","mdy","ymd"];function FR({is12Hour:e,currentTime:t,onChange:n,dateOrder:r,hideLabelFromVision:o=!1}){const[i,s]=(0,f.useState)((()=>t?SR(mR(t)):new Date));(0,f.useEffect)((()=>{s(t?SR(mR(t)):new Date)}),[t]);const a=[{value:"01",label:(0,u.__)("January")},{value:"02",label:(0,u.__)("February")},{value:"03",label:(0,u.__)("March")},{value:"04",label:(0,u.__)("April")},{value:"05",label:(0,u.__)("May")},{value:"06",label:(0,u.__)("June")},{value:"07",label:(0,u.__)("July")},{value:"08",label:(0,u.__)("August")},{value:"09",label:(0,u.__)("September")},{value:"10",label:(0,u.__)("October")},{value:"11",label:(0,u.__)("November")},{value:"12",label:(0,u.__)("December")}],{day:l,month:c,year:d,minutes:h,hours:p}=(0,f.useMemo)((()=>({day:DI(i,"dd"),month:DI(i,"MM"),year:DI(i,"yyyy"),minutes:DI(i,"mm"),hours:DI(i,"HH"),am:DI(i,"a")})),[i]),m=e=>(t,{event:r})=>{if(!bR(r))return;const o=Number(t),a=qI(i,{[e]:o});s(a),n?.(DI(a,xR))},g=(0,kt.jsx)(DR,{className:"components-datetime__time-field components-datetime__time-field-day",label:(0,u.__)("Day"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,value:l,step:1,min:1,max:31,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:m("date")},"day"),v=(0,kt.jsx)(PR,{children:(0,kt.jsx)(oC,{className:"components-datetime__time-field components-datetime__time-field-month",label:(0,u.__)("Month"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:c,options:a,onChange:e=>{const t=GI(i,Number(e)-1);s(t),n?.(DI(t,xR))}})},"month"),b=(0,kt.jsx)(IR,{className:"components-datetime__time-field components-datetime__time-field-year",label:(0,u.__)("Year"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,value:d,step:1,min:1,max:9999,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:m("year"),__unstableStateReducer:vR(4)},"year"),x=e?"mdy":"dmy",y=(r&&LR.includes(r)?r:x).split("").map((e=>{switch(e){case"d":return g;case"m":return v;case"y":return b;default:return null}}));return(0,kt.jsxs)(CR,{className:"components-datetime__time",children:[(0,kt.jsxs)(kR,{children:[o?(0,kt.jsx)(jl,{as:"legend",children:(0,u.__)("Time")}):(0,kt.jsx)(Oy.VisualLabel,{as:"legend",className:"components-datetime__time-legend",children:(0,u.__)("Time")}),(0,kt.jsxs)(ow,{className:"components-datetime__time-wrapper",children:[(0,kt.jsx)(zR,{value:{hours:Number(p),minutes:Number(h)},is12Hour:e,onChange:({hours:e,minutes:t})=>{const r=qI(i,{hours:e,minutes:t});s(r),n?.(DI(r,xR))}}),(0,kt.jsx)(Mv,{}),(0,kt.jsx)(OR,{})]})]}),(0,kt.jsxs)(kR,{children:[o?(0,kt.jsx)(jl,{as:"legend",children:(0,u.__)("Date")}):(0,kt.jsx)(Oy.VisualLabel,{as:"legend",className:"components-datetime__time-legend",children:(0,u.__)("Date")}),(0,kt.jsx)(ow,{className:"components-datetime__time-wrapper",children:y})]})]})}FR.TimeInput=zR,Object.assign(FR.TimeInput,{displayName:"TimePicker.TimeInput"});var BR=FR;const VR=Sl(lj,{target:"e1p5onf00"})({name:"1khn195",styles:"box-sizing:border-box"}),WR=()=>{};const $R=(0,f.forwardRef)((function({currentDate:e,is12Hour:t,dateOrder:n,isInvalidDate:r,onMonthPreviewed:o=WR,onChange:i,events:s,startOfWeek:a},l){return(0,kt.jsx)(VR,{ref:l,className:"components-datetime",spacing:4,children:(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(BR,{currentTime:e,onChange:i,is12Hour:t,dateOrder:n}),(0,kt.jsx)(_R,{currentDate:e,onChange:i,isInvalidDate:r,events:s,onMonthPreviewed:o,startOfWeek:a})]})})}));var HR=$R;var UR=[{name:(0,u._x)("None","Size of a UI element"),slug:"none"},{name:(0,u._x)("Small","Size of a UI element"),slug:"small"},{name:(0,u._x)("Medium","Size of a UI element"),slug:"medium"},{name:(0,u._x)("Large","Size of a UI element"),slug:"large"},{name:(0,u._x)("Extra Large","Size of a UI element"),slug:"xlarge"}];const YR={BaseControl:{_overrides:{__associatedWPComponentName:"DimensionControl"}}};var GR=function(e){const{__next40pxDefaultSize:t=!1,__nextHasNoMarginBottom:n=!1,label:r,value:o,sizes:i=UR,icon:s,onChange:a,className:l=""}=e;Ji()("wp.components.DimensionControl",{since:"6.7",version:"7.0"}),Ay({componentName:"DimensionControl",__next40pxDefaultSize:t,size:void 0});const d=(0,kt.jsxs)(kt.Fragment,{children:[s&&(0,kt.jsx)(Vy,{icon:s}),r]});return(0,kt.jsx)(xs,{value:YR,children:(0,kt.jsx)(oC,{__next40pxDefaultSize:t,__shouldNotWarnDeprecated36pxSize:!0,__nextHasNoMarginBottom:n,className:c(l,"block-editor-dimension-control"),label:d,hideLabelFromVision:!1,value:o,onChange:e=>{const t=((e,t)=>e.find((e=>t===e.slug)))(i,e);t&&o!==t.slug?"function"==typeof a&&a(t.slug):a?.(void 0)},options:(e=>{const t=e.map((({name:e,slug:t})=>({label:e,value:t})));return[{label:(0,u.__)("Default"),value:""},...t]})(i)})})};const qR={name:"u2jump",styles:"position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}"},KR=(0,f.createContext)(!1);KR.displayName="DisabledContext";const{Consumer:XR,Provider:ZR}=KR;function QR({className:e,children:t,isDisabled:n=!0,...r}){const o=ll();return(0,kt.jsx)(ZR,{value:n,children:(0,kt.jsx)("div",{inert:n?"true":void 0,className:n?o(qR,e,"components-disabled"):void 0,...r,children:t})})}QR.Context=KR,QR.Consumer=XR;var JR=QR;const eO=(0,f.forwardRef)((({visible:e,children:t,...n},r)=>{const o=Qn({open:e});return(0,kt.jsx)(no,{store:o,ref:r,...n,children:t})}));const tO="is-dragging-components-draggable";var nO=function({children:e,onDragStart:t,onDragOver:n,onDragEnd:r,appendToOwnerDocument:o=!1,cloneClassname:i,elementId:s,transferData:a,__experimentalTransferDataType:l="text",__experimentalDragComponent:c}){const u=(0,f.useRef)(null),h=(0,f.useRef)((()=>{}));return(0,f.useEffect)((()=>()=>{h.current()}),[]),(0,kt.jsxs)(kt.Fragment,{children:[e({onDraggableStart:function(e){const{ownerDocument:r}=e.target;e.dataTransfer.setData(l,JSON.stringify(a));const c=r.createElement("div");c.style.top="0",c.style.left="0";const f=r.createElement("div");"function"==typeof e.dataTransfer.setDragImage&&(f.classList.add("components-draggable__invisible-drag-image"),r.body.appendChild(f),e.dataTransfer.setDragImage(f,0,0)),c.classList.add("components-draggable__clone"),i&&c.classList.add(i);let p=0,m=0;if(u.current){p=e.clientX,m=e.clientY,c.style.transform=`translate( ${p}px, ${m}px )`;const t=r.createElement("div");t.innerHTML=u.current.innerHTML,c.appendChild(t),r.body.appendChild(c)}else{const e=r.getElementById(s),t=e.getBoundingClientRect(),n=e.parentNode,i=t.top,a=t.left;c.style.width=`${t.width+0}px`;const l=e.cloneNode(!0);l.id=`clone-${s}`,p=a-0,m=i-0,c.style.transform=`translate( ${p}px, ${m}px )`,Array.from(l.querySelectorAll("iframe")).forEach((e=>e.parentNode?.removeChild(e))),c.appendChild(l),o?r.body.appendChild(c):n?.appendChild(c)}let g=e.clientX,v=e.clientY;const b=(0,d.throttle)((function(e){if(g===e.clientX&&v===e.clientY)return;const t=p+e.clientX-g,r=m+e.clientY-v;c.style.transform=`translate( ${t}px, ${r}px )`,g=e.clientX,v=e.clientY,p=t,m=r,n&&n(e)}),16);r.addEventListener("dragover",b),r.body.classList.add(tO),t&&t(e),h.current=()=>{c&&c.parentNode&&c.parentNode.removeChild(c),f&&f.parentNode&&f.parentNode.removeChild(f),r.body.classList.remove(tO),r.removeEventListener("dragover",b)}},onDraggableEnd:function(e){e.preventDefault(),h.current(),r&&r(e)}}),c&&(0,kt.jsx)("div",{className:"components-draggable-drag-component-root",style:{display:"none"},ref:u,children:c})]})},rO=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})});var oO=function({className:e,icon:t=rO,label:n,onFilesDrop:r,onHTMLDrop:o,onDrop:i,isEligible:s=()=>!0,...a}){const[l,h]=(0,f.useState)(),[p,m]=(0,f.useState)(),[g,v]=(0,f.useState)(),b=(0,d.__experimentalUseDropZone)({onDrop(e){if(!e.dataTransfer)return;const t=(0,pT.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n&&o?o(n):t.length&&r?r(t):i&&i(e)},onDragStart(e){h(!0),e.dataTransfer&&(e.dataTransfer.types.includes("text/html")?v(!!o):e.dataTransfer.types.includes("Files")||(0,pT.getFilesFromDataTransfer)(e.dataTransfer).length>0?v(!!r):v(!!i&&s(e.dataTransfer)))},onDragEnd(){m(!1),h(!1),v(void 0)},onDragEnter(){m(!0)},onDragLeave(){m(!1)}}),x=c("components-drop-zone",e,{"is-active":g,"is-dragging-over-document":l,"is-dragging-over-element":p});return(0,kt.jsx)("div",{...a,ref:b,className:x,children:(0,kt.jsx)("div",{className:"components-drop-zone__content",children:(0,kt.jsxs)("div",{className:"components-drop-zone__content-inner",children:[(0,kt.jsx)(JS,{icon:t,className:"components-drop-zone__content-icon"}),(0,kt.jsx)("span",{className:"components-drop-zone__content-text",children:n||(0,u.__)("Drop files to upload")})]})})})};function iO({children:e}){return Ji()("wp.components.DropZoneProvider",{since:"5.8",hint:"wp.component.DropZone no longer needs a provider. wp.components.DropZoneProvider is safe to remove from your code."}),e}var sO=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"M7.1 5.7 8 6.9c.4-.3.9-.6 1.5-.8l-.6-1.4c-.7.3-1.3.6-1.8 1ZM4.6 8.9l1.4.6c.2-.5.5-1 .8-1.5l-1.2-.9c-.4.6-.8 1.2-1 1.8Zm14.8 0c-.3-.7-.6-1.3-1-1.8l-1.2.9c.3.4.6.9.8 1.5l1.4-.6ZM7.1 18.3c.6.4 1.2.8 1.8 1l.6-1.4c-.5-.2-1-.5-1.5-.8l-.9 1.2ZM5.5 12v-.9h-.7l-.7-.2v2l1.5-.2v-.9Zm-.7 3h-.2c.3.7.6 1.3 1 1.9l1.2-.9c-.3-.4-.6-.9-.8-1.5l-1.2.5Zm9.7 3 .5 1.2v.2c.7-.3 1.3-.6 1.9-1l-.9-1.2c-.4.3-.9.6-1.5.8Zm-2.5.5h-.9l-.2 1.3v.2h2l-.2-1.5h-.9Zm7.9-7.5-1.5.2V13h.7l.7.2v-2ZM18 14.5c-.2.5-.5 1-.8 1.5l1.2.9c.4-.6.8-1.2 1-1.8h-.2l-1.2-.6ZM11 4.1l.2 1.5H13V4.2h-1.9ZM14.5 6c.5.2 1 .5 1.5.8l.9-1.2c-.6-.4-1.2-.8-1.8-1L14.5 6Z"})});function aO({label:e,value:t,colors:n,disableCustomColors:r,enableAlpha:o,onChange:i}){const[s,a]=(0,f.useState)(!1),l=(0,d.useInstanceId)(aO,"color-list-picker-option"),c=`${l}__label`,h=`${l}__content`;return(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(Hy,{__next40pxDefaultSize:!0,className:"components-color-list-picker__swatch-button",id:c,onClick:()=>a((e=>!e)),"aria-expanded":s,"aria-controls":h,icon:t?(0,kt.jsx)(IS,{colorValue:t,className:"components-color-list-picker__swatch-color"}):(0,kt.jsx)(Vy,{icon:sO}),text:e}),(0,kt.jsx)("div",{role:"group",id:h,"aria-labelledby":c,"aria-hidden":!s,children:s&&(0,kt.jsx)(_j,{"aria-label":(0,u.__)("Color options"),className:"components-color-list-picker__color-picker",colors:n,value:t,clearable:!1,onChange:i,disableCustomColors:r,enableAlpha:o})})]})}var lO=function({colors:e,labels:t,value:n=[],disableCustomColors:r,enableAlpha:o,onChange:i}){return(0,kt.jsx)("div",{className:"components-color-list-picker",children:t.map(((t,s)=>(0,kt.jsx)(aO,{label:t,value:n[s],colors:e,disableCustomColors:r,enableAlpha:o,onChange:e=>{const t=n.slice();t[s]=e,i(t)}},s)))})};function cO(e=[],t="90deg"){const n=100/e.length,r=e.map(((e,t)=>`${e} ${t*n}%, ${e} ${(t+1)*n}%`)).join(", ");return`linear-gradient( ${t}, ${r} )`}pb([mb]);const uO=["#333","#CCC"];function dO({value:e,onChange:t}){const n=!!e,r=n?e:uO,o=cO(r),i=(s=r).map(((e,t)=>({position:100*t/(s.length-1),color:e})));var s;return(0,kt.jsx)(GN,{disableInserter:!0,background:o,hasGradient:n,value:i,onChange:e=>{const n=function(e=[]){return e.map((({color:e})=>e))}(e);t(n)}})}var fO=function({asButtons:e,loop:t,clearable:n=!0,unsetable:r=!0,colorPalette:o,duotonePalette:i,disableCustomColors:s,disableCustomDuotone:a,value:l,onChange:c,"aria-label":d,"aria-labelledby":h,...p}){const[m,g]=(0,f.useMemo)((()=>{return!(e=o)||e.length<2?["#000","#fff"]:e.map((({color:e})=>({color:e,brightness:fb(e).brightness()}))).reduce((([e,t],n)=>[n.brightness<=e.brightness?n:e,n.brightness>=t.brightness?n:t]),[{brightness:1,color:""},{brightness:0,color:""}]).map((({color:e})=>e));var e}),[o]),v="unset"===l,b=(0,u.__)("Unset"),x=(0,kt.jsx)(sj.Option,{value:"unset",isSelected:v,tooltipText:b,"aria-label":b,className:"components-duotone-picker__color-indicator",onClick:()=>{c(v?void 0:"unset")}},"unset"),y=i.map((({colors:e,slug:t,name:n})=>{const r={background:cO(e,"135deg"),color:"transparent"},o=null!=n?n:(0,u.sprintf)((0,u.__)("Duotone code: %s"),t),i=n?(0,u.sprintf)((0,u.__)("Duotone: %s"),n):o,s=hs()(e,l);return(0,kt.jsx)(sj.Option,{value:e,isSelected:s,"aria-label":i,tooltipText:o,style:r,onClick:()=>{c(s?void 0:e)}},t)})),{metaProps:w,labelProps:_}=aj(e,t,d,h),S=r?[x,...y]:y;return(0,kt.jsx)(sj,{...p,...w,..._,options:S,actions:!!n&&(0,kt.jsx)(sj.ButtonAction,{onClick:()=>c(void 0),accessibleWhenDisabled:!0,disabled:!l,children:(0,u.__)("Clear")}),children:(0,kt.jsx)(Mv,{paddingTop:0===S.length?0:4,children:(0,kt.jsxs)(lj,{spacing:3,children:[!s&&!a&&(0,kt.jsx)(dO,{value:v?void 0:l,onChange:c}),!a&&(0,kt.jsx)(lO,{labels:[(0,u.__)("Shadows"),(0,u.__)("Highlights")],colors:o,value:v?void 0:l,disableCustomColors:s,enableAlpha:!0,onChange:e=>{e[0]||(e[0]=m),e[1]||(e[1]=g);const t=e.length>=2?e:void 0;c(t)}})]})})})};var hO=function({values:e}){return e?(0,kt.jsx)(IS,{colorValue:cO(e,"135deg")}):(0,kt.jsx)(Vy,{icon:sO})};var pO=(0,f.forwardRef)((function(e,t){const{href:n,children:r,className:o,rel:i="",...s}=e,a=[...new Set([...i.split(" "),"external","noreferrer","noopener"].filter(Boolean))].join(" "),l=c("components-external-link",o),d=!!n?.startsWith("#");return(0,kt.jsxs)("a",{...s,className:l,href:n,onClick:t=>{d&&t.preventDefault(),e.onClick&&e.onClick(t)},target:"_blank",rel:a,ref:t,children:[(0,kt.jsx)("span",{className:"components-external-link__contents",children:r}),(0,kt.jsx)("span",{className:"components-external-link__icon","aria-label":(0,u.__)("(opens in a new tab)"),children:"↗"})]})}));const mO={width:200,height:170},gO=["avi","mpg","mpeg","mov","mp4","m4v","ogg","ogv","webm","wmv"];function vO(e){return Math.round(100*e)}const bO=Sl("div",{target:"eeew7dm8"})({name:"jqnsxy",styles:"background-color:transparent;display:flex;text-align:center;width:100%"}),xO=Sl("div",{target:"eeew7dm7"})("align-items:center;border-radius:",Wl.radiusSmall,";cursor:pointer;display:inline-flex;justify-content:center;margin:auto;position:relative;height:100%;&:after{border-radius:inherit;bottom:0;box-shadow:inset 0 0 0 1px rgba( 0, 0, 0, 0.1 );content:'';left:0;pointer-events:none;position:absolute;right:0;top:0;}img,video{border-radius:inherit;box-sizing:border-box;display:block;height:auto;margin:0;max-height:100%;max-width:100%;pointer-events:none;user-select:none;width:100%;}"),yO=Sl("div",{target:"eeew7dm6"})("background:",Fl.gray[100],";border-radius:inherit;box-sizing:border-box;height:",mO.height,"px;max-width:280px;min-width:",mO.width,"px;width:100%;"),wO=Sl(Zj,{target:"eeew7dm5"})({name:"1d3w5wq",styles:"width:100%"});var _O={name:"1mn7kwb",styles:"padding-bottom:1em"};const SO=({__nextHasNoMarginBottom:e})=>e?void 0:_O;var CO={name:"1mn7kwb",styles:"padding-bottom:1em"};const kO=({hasHelpText:e=!1})=>e?CO:void 0,jO=Sl(vv,{target:"eeew7dm4"})("max-width:320px;padding-top:1em;",kO," ",SO,";"),EO=Sl("div",{target:"eeew7dm3"})("left:50%;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate3d( -50%, -50%, 0 );z-index:1;@media not ( prefers-reduced-motion ){transition:opacity 100ms linear;}opacity:",(({showOverlay:e})=>e?1:0),";"),MO=Sl("div",{target:"eeew7dm2"})({name:"1yzbo24",styles:"background:rgba( 255, 255, 255, 0.4 );backdrop-filter:blur( 16px ) saturate( 180% );position:absolute;transform:translateZ( 0 )"}),NO=Sl(MO,{target:"eeew7dm1"})({name:"1sw8ur",styles:"height:1px;left:1px;right:1px"}),TO=Sl(MO,{target:"eeew7dm0"})({name:"188vg4t",styles:"width:1px;top:1px;bottom:1px"}),PO=()=>{};function DO({__nextHasNoMarginBottom:e,hasHelpText:t,onChange:n=PO,point:r={x:.5,y:.5}}){const o=vO(r.x),i=vO(r.y),s=(e,t)=>{if(void 0===e)return;const o=parseInt(e,10);isNaN(o)||n({...r,[t]:o/100})};return(0,kt.jsxs)(jO,{className:"focal-point-picker__controls",__nextHasNoMarginBottom:e,hasHelpText:t,gap:4,children:[(0,kt.jsx)(IO,{label:(0,u.__)("Left"),"aria-label":(0,u.__)("Focal point left position"),value:[o,"%"].join(""),onChange:e=>s(e,"x"),dragDirection:"e"}),(0,kt.jsx)(IO,{label:(0,u.__)("Top"),"aria-label":(0,u.__)("Focal point top position"),value:[i,"%"].join(""),onChange:e=>s(e,"y"),dragDirection:"s"})]})}function IO(e){return(0,kt.jsx)(wO,{__next40pxDefaultSize:!0,className:"focal-point-picker__controls-position-unit-control",labelPosition:"top",max:100,min:0,units:[{value:"%",label:"%"}],...e})}const RO=Sl("div",{target:"e19snlhg0"})("background-color:transparent;cursor:grab;height:40px;margin:-20px 0 0 -20px;position:absolute;user-select:none;width:40px;will-change:transform;z-index:10000;background:rgba( 255, 255, 255, 0.4 );border:1px solid rgba( 255, 255, 255, 0.4 );border-radius:",Wl.radiusRound,";backdrop-filter:blur( 16px ) saturate( 180% );box-shadow:rgb( 0 0 0 / 10% ) 0px 0px 8px;@media not ( prefers-reduced-motion ){transition:transform 100ms linear;}",(({isDragging:e})=>e&&"\n\t\t\tbox-shadow: rgb( 0 0 0 / 12% ) 0px 0px 10px;\n\t\t\ttransform: scale( 1.1 );\n\t\t\tcursor: grabbing;\n\t\t\t"),";");function OO({left:e="50%",top:t="50%",...n}){const r={left:e,top:t};return(0,kt.jsx)(RO,{...n,className:"components-focal-point-picker__icon_container",style:r})}function AO({bounds:e,...t}){return(0,kt.jsxs)(EO,{...t,className:"components-focal-point-picker__grid",style:{width:e.width,height:e.height},children:[(0,kt.jsx)(NO,{style:{top:"33%"}}),(0,kt.jsx)(NO,{style:{top:"66%"}}),(0,kt.jsx)(TO,{style:{left:"33%"}}),(0,kt.jsx)(TO,{style:{left:"66%"}})]})}function zO({alt:e,autoPlay:t,src:n,onLoad:r,mediaRef:o,muted:i=!0,...s}){if(!n)return(0,kt.jsx)(yO,{className:"components-focal-point-picker__media components-focal-point-picker__media--placeholder",ref:o,...s});return function(e=""){return!!e&&(e.startsWith("data:video/")||gO.includes(function(e=""){const t=e.split(".");return t[t.length-1]}(e)))}(n)?(0,kt.jsx)("video",{...s,autoPlay:t,className:"components-focal-point-picker__media components-focal-point-picker__media--video",loop:!0,muted:i,onLoadedData:r,ref:o,src:n}):(0,kt.jsx)("img",{...s,alt:e,className:"components-focal-point-picker__media components-focal-point-picker__media--image",onLoad:r,ref:o,src:n})}var LO=function e({__nextHasNoMarginBottom:t,autoPlay:n=!0,className:r,help:o,label:i,onChange:s,onDrag:a,onDragEnd:l,onDragStart:h,resolvePoint:p,url:m,value:g={x:.5,y:.5},...v}){const[b,x]=(0,f.useState)(g),[y,w]=(0,f.useState)(!1),{startDrag:_,endDrag:S,isDragging:C}=(0,d.__experimentalUseDragging)({onDragStart:e=>{E.current?.focus();const t=P(e);t&&(h?.(t,e),x(t))},onDragMove:e=>{e.preventDefault();const t=P(e);t&&(a?.(t,e),x(t))},onDragEnd:()=>{l?.(),s?.(b)}}),{x:k,y:j}=C?b:g,E=(0,f.useRef)(null),[M,N]=(0,f.useState)(mO),T=(0,f.useRef)((()=>{if(!E.current)return;const{clientWidth:e,clientHeight:t}=E.current;N(e>0&&t>0?{width:e,height:t}:{...mO})}));(0,f.useEffect)((()=>{const e=T.current;if(!E.current)return;const{defaultView:t}=E.current.ownerDocument;return t?.addEventListener("resize",e),()=>t?.removeEventListener("resize",e)}),[]),(0,d.useIsomorphicLayoutEffect)((()=>{T.current()}),[]);const P=({clientX:e,clientY:t,shiftKey:n})=>{if(!E.current)return;const{top:r,left:o}=E.current.getBoundingClientRect();let i=(e-o)/M.width,s=(t-r)/M.height;return n&&(i=.1*Math.round(i/.1),s=.1*Math.round(s/.1)),D({x:i,y:s})},D=e=>{var t;const n=null!==(t=p?.(e))&&void 0!==t?t:e;n.x=Math.max(0,Math.min(n.x,1)),n.y=Math.max(0,Math.min(n.y,1));const r=e=>Math.round(100*e)/100;return{x:r(n.x),y:r(n.y)}},I={left:void 0!==k?k*M.width:.5*M.width,top:void 0!==j?j*M.height:.5*M.height},R=c("components-focal-point-picker-control",r),O=`inspector-focal-point-picker-control-${(0,d.useInstanceId)(e)}`;return gs((()=>{w(!0);const e=window.setTimeout((()=>{w(!1)}),600);return()=>window.clearTimeout(e)}),[k,j]),(0,kt.jsxs)(Oy,{...v,__nextHasNoMarginBottom:t,__associatedWPComponentName:"FocalPointPicker",label:i,id:O,help:o,className:R,children:[(0,kt.jsx)(bO,{className:"components-focal-point-picker-wrapper",children:(0,kt.jsxs)(xO,{className:"components-focal-point-picker",onKeyDown:e=>{const{code:t,shiftKey:n}=e;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t))return;e.preventDefault();const r={x:k,y:j},o=n?.1:.01,i="ArrowUp"===t||"ArrowLeft"===t?-1*o:o,a="ArrowUp"===t||"ArrowDown"===t?"y":"x";r[a]=r[a]+i,s?.(D(r))},onMouseDown:_,onBlur:()=>{C&&S()},ref:E,role:"button",tabIndex:-1,children:[(0,kt.jsx)(AO,{bounds:M,showOverlay:y}),(0,kt.jsx)(zO,{alt:(0,u.__)("Media preview"),autoPlay:n,onLoad:T.current,src:m}),(0,kt.jsx)(OO,{...I,isDragging:C})]})}),(0,kt.jsx)(DO,{__nextHasNoMarginBottom:t,hasHelpText:!!o,point:{x:k,y:j},onChange:e=>{s?.(D(e))}})]})};function FO({iframeRef:e,...t}){const n=(0,d.useMergeRefs)([e,(0,d.useFocusableIframe)()]);return Ji()("wp.components.FocusableIframe",{since:"5.9",alternative:"wp.compose.useFocusableIframe"}),(0,kt.jsx)("iframe",{ref:n,...t})}const BO=Sl("fieldset",{target:"e8tqeku4"})({name:"k2q51s",styles:"border:0;margin:0;padding:0;display:contents"}),VO=Sl(ow,{target:"e8tqeku3"})("height:",Rl(4),";"),WO=Sl(Hy,{target:"e8tqeku2"})("margin-top:",Rl(-1),";"),$O=Sl(Oy.VisualLabel,{target:"e8tqeku1"})("display:flex;gap:",Rl(1),";justify-content:flex-start;margin-bottom:0;"),HO=Sl(TD,{target:"e8tqeku0"})({name:"anvx77",styles:".components-custom-select-control__item .components-custom-select-control__item-hint{width:100%;}"});function UO(e){return e.hint?e.hint:(t=e.size,/^[\d\.]+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i.test(String(t))?String(e.size):void 0);var t}const YO={key:"default",name:(0,u.__)("Default"),value:void 0};var GO=e=>{const{__next40pxDefaultSize:t,fontSizes:n,value:r,size:o,valueMode:i="literal",onChange:s}=e,a=[YO,...n.map((e=>{const t=UO(e);return{key:e.slug,name:e.name||e.slug,value:e.size,hint:t}}))],l=(0,f.useMemo)((()=>{var e;if(void 0===r)return YO;if("slug"===i){const e=a.find((e=>e.key===r));if(e)return e}return null!==(e=a.find((e=>e.value===r)))&&void 0!==e?e:YO}),[r,i,a]);return(0,kt.jsx)(HO,{__next40pxDefaultSize:t,__shouldNotWarnDeprecated36pxSize:!0,className:"components-font-size-picker__select",label:(0,u.__)("Font size"),hideLabelFromVision:!0,describedBy:(0,u.sprintf)((0,u.__)("Currently selected font size: %s"),l.name),options:a,value:l,showSelectedHint:!0,onChange:({selectedItem:e})=>{const t="default"===e.key?void 0:n.find((t=>t.slug===e.key));s(e.value,t)},size:o})};const qO=[(0,u.__)("S"),(0,u.__)("M"),(0,u.__)("L"),(0,u.__)("XL"),(0,u.__)("XXL")],KO=[(0,u.__)("Small"),(0,u.__)("Medium"),(0,u.__)("Large"),(0,u.__)("Extra Large"),(0,u.__)("Extra Extra Large")];var XO=e=>{const{fontSizes:t,value:n,valueMode:r="literal",__next40pxDefaultSize:o,size:i,onChange:s}=e,a=(()=>{if(!n)return;if("slug"===r)return String(n);if(t.filter((e=>e.size===n)).length>1)return;const e=t.find((e=>e.size===n));return e?.slug})();return(0,kt.jsx)(pS,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:o,__shouldNotWarnDeprecated36pxSize:!0,label:(0,u.__)("Font size"),hideLabelFromVision:!0,value:a,onChange:e=>{if(void 0===e)s(void 0);else{const n=t.find((t=>t.slug===String(e)));n&&s(n.size,n)}},isBlock:!0,size:i,children:t.map(((e,t)=>(0,kt.jsx)(AR,{value:e.slug,label:qO[t],"aria-label":e.name||KO[t],showTooltip:!0},e.slug)))})};const ZO=["px","em","rem","vw","vh"],QO=(e,t)=>{const{__next40pxDefaultSize:n=!1,fallbackFontSize:r,fontSizes:o=[],disableCustomFontSizes:i=!1,onChange:s,size:a="default",units:l=ZO,value:c,valueMode:h="literal",withSlider:p=!1,withReset:m=!0}=e,g=(0,d.useInstanceId)(QO,"font-size-picker-label"),v=Uj({availableUnits:l}),b=(()=>{if(c)return"slug"===h?o.find((e=>e.slug===c)):o.find((e=>e.size===c))})(),x=!!c&&!b,[y,w]=(0,f.useState)(x),_="slug"===h?b?.size:c;let S;if(S=!i&&y?"custom":o.length>5?"select":"togglegroup",0===o.length&&i)return null;const C="string"==typeof _||"string"==typeof o[0]?.size,[k,j]=Hj(_,v),E=!!j&&["em","rem","vw","vh"].includes(j),M=void 0===c;return Ay({componentName:"FontSizePicker",__next40pxDefaultSize:n,size:a}),(0,kt.jsxs)(BO,{ref:t,className:"components-font-size-picker","aria-labelledby":g,children:[(0,kt.jsx)(Mv,{children:(0,kt.jsxs)(VO,{className:"components-font-size-picker__header",children:[(0,kt.jsx)($O,{id:g,children:(0,u.__)("Font size")}),!i&&(0,kt.jsx)(WO,{label:"custom"===S?(0,u.__)("Use size preset"):(0,u.__)("Set custom size"),icon:_E,onClick:()=>w(!y),isPressed:"custom"===S,size:"small"})]})}),(0,kt.jsxs)("div",{children:["select"===S&&(0,kt.jsx)(GO,{__next40pxDefaultSize:n,fontSizes:o,value:c,valueMode:h,disableCustomFontSizes:i,size:a,onChange:(e,t)=>{s?.(void 0===e?void 0:C?e:Number(e),t)},onSelectCustom:()=>w(!0)}),"togglegroup"===S&&(0,kt.jsx)(XO,{fontSizes:o,value:c,valueMode:h,__next40pxDefaultSize:n,size:a,onChange:(e,t)=>{s?.(void 0===e?void 0:C?e:Number(e),t)}}),"custom"===S&&(0,kt.jsxs)(vv,{className:"components-font-size-picker__custom-size-control",children:[(0,kt.jsx)(Pv,{isBlock:!0,children:(0,kt.jsx)(Zj,{__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0,label:(0,u.__)("Font size"),labelPosition:"top",hideLabelFromVision:!0,value:C?`${null!=k?k:""}${null!=j?j:""}`:_,onChange:e=>{w(!0),s?.(void 0===e||""===e?void 0:C?e:parseInt(e,10))},size:a,units:C?v:[],min:0})}),p&&(0,kt.jsx)(Pv,{isBlock:!0,children:(0,kt.jsx)(Mv,{marginX:2,marginBottom:0,children:(0,kt.jsx)(YC,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0,className:"components-font-size-picker__custom-input",label:(0,u.__)("Font size"),hideLabelFromVision:!0,value:k,initialPosition:r,withInputField:!1,onChange:e=>{w(!0),s?.(void 0===e?void 0:C?e+(null!=j?j:"px"):e)},min:0,max:E?10:100,step:E?.1:1})})}),m&&(0,kt.jsx)(Pv,{children:(0,kt.jsx)($y,{disabled:M,accessibleWhenDisabled:!0,onClick:()=>{s?.(void 0)},variant:"secondary",__next40pxDefaultSize:!0,size:"__unstable-large"===a||e.__next40pxDefaultSize?"default":"small",children:(0,u.__)("Reset")})})]})]})]})};var JO=(0,f.forwardRef)(QO);var eA=function({accept:e,children:t,multiple:n=!1,onChange:r,onClick:o,render:i,...s}){const a=(0,f.useRef)(null),l=()=>{a.current?.click()};i||Ay({componentName:"FormFileUpload",__next40pxDefaultSize:s.__next40pxDefaultSize,size:s.size});const c=i?i({openFileDialog:l}):(0,kt.jsx)(Hy,{onClick:l,...s,children:t}),u=e?.includes("audio/*")?`${e}, audio/mp3, audio/x-m4a, audio/x-m4b, audio/x-m4p, audio/x-wav, audio/webm`:e;return(0,kt.jsxs)("div",{className:"components-form-file-upload",children:[c,(0,kt.jsx)("input",{type:"file",ref:a,multiple:n,style:{display:"none"},accept:u,onChange:r,onClick:o,"data-testid":"form-file-upload-input"})]})};const tA=()=>{};const nA=(0,f.forwardRef)((function(e,t){const{className:n,checked:r,id:o,disabled:i,onChange:s=tA,onClick:a,...l}=e,u=c("components-form-toggle",n,{"is-checked":r,"is-disabled":i});return(0,kt.jsxs)("span",{className:u,children:[(0,kt.jsx)("input",{className:"components-form-toggle__input",id:o,type:"checkbox",checked:r,onChange:s,disabled:i,onClick:e=>{e.currentTarget.focus(),a?.(e)},...l,ref:t}),(0,kt.jsx)("span",{className:"components-form-toggle__track"}),(0,kt.jsx)("span",{className:"components-form-toggle__thumb"})]})}));var rA=nA;const oA=()=>{};function iA({value:e,status:t,title:n,displayTransform:r,isBorderless:o=!1,disabled:i=!1,onClickRemove:s=oA,onMouseEnter:a,onMouseLeave:l,messages:f,termPosition:h,termsCount:p}){const m=(0,d.useInstanceId)(iA),g=c("components-form-token-field__token",{"is-error":"error"===t,"is-success":"success"===t,"is-validating":"validating"===t,"is-borderless":o,"is-disabled":i}),v=r(e),b=(0,u.sprintf)((0,u.__)("%1$s (%2$d of %3$d)"),v,h,p);return(0,kt.jsxs)("span",{className:g,onMouseEnter:a,onMouseLeave:l,title:n,children:[(0,kt.jsxs)("span",{className:"components-form-token-field__token-text",id:`components-form-token-field__token-text-${m}`,children:[(0,kt.jsx)(jl,{as:"span",children:b}),(0,kt.jsx)("span",{"aria-hidden":"true",children:v})]}),(0,kt.jsx)(Hy,{className:"components-form-token-field__remove-token",size:"small",icon:BT,onClick:i?void 0:()=>s({value:e}),disabled:i,label:f.remove,"aria-describedby":`components-form-token-field__token-text-${m}`})]})}const sA=({__next40pxDefaultSize:e,hasTokens:t})=>!e&&Dl("padding-top:",Rl(t?1:.5),";padding-bottom:",Rl(t?1:.5),";",""),aA=Sl(vv,{target:"ehq8nmi0"})("padding:7px;",Sy," ",sA,";"),lA=e=>e;function cA(e){const{autoCapitalize:t,autoComplete:n,maxLength:r,placeholder:o,label:i=(0,u.__)("Add item"),className:s,suggestions:a=[],maxSuggestions:l=100,value:h=[],displayTransform:p=lA,saveTransform:m=e=>e.trim(),onChange:g=()=>{},onInputChange:v=()=>{},onFocus:b,isBorderless:x=!1,disabled:y=!1,tokenizeOnSpace:w=!1,messages:_={added:(0,u.__)("Item added."),removed:(0,u.__)("Item removed."),remove:(0,u.__)("Remove item"),__experimentalInvalid:(0,u.__)("Invalid item")},__experimentalRenderItem:S,__experimentalExpandOnFocus:C=!1,__experimentalValidateInput:k=()=>!0,__experimentalShowHowTo:j=!0,__next40pxDefaultSize:E=!1,__experimentalAutoSelectFirstMatch:M=!1,__nextHasNoMarginBottom:N=!1,tokenizeOnBlur:T=!1}=ix(e);N||Ji()("Bottom margin styles for wp.components.FormTokenField",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."}),Ay({componentName:"FormTokenField",size:void 0,__next40pxDefaultSize:E});const P=(0,d.useInstanceId)(cA),[D,I]=(0,f.useState)(""),[R,O]=(0,f.useState)(0),[A,z]=(0,f.useState)(!1),[L,F]=(0,f.useState)(!1),[B,V]=(0,f.useState)(-1),[W,$]=(0,f.useState)(!1),H=(0,d.usePrevious)(a),U=(0,d.usePrevious)(h),Y=(0,f.useRef)(null),G=(0,f.useRef)(null),q=(0,d.useDebounce)(vw.speak,500);function K(){Y.current?.focus()}function X(){return Y.current===Y.current?.ownerDocument.activeElement}function Z(e){if(he()&&k(D))z(!1),T&&he()&&ae(D);else{if(I(""),O(0),z(!1),C){const t=e.relatedTarget===G.current;F(t)}else F(!1);V(-1),$(!1)}}function Q(e){e.target===G.current&&A&&e.preventDefault()}function J(e){le(e.value),K()}function ee(e){const t=e.value,n=w?/[ ,\t]+/:/[,\t]+/,r=t.split(n),o=r[r.length-1]||"";r.length>1&&se(r.slice(0,-1)),I(o),v(o)}function te(e){let t=!1;return X()&&fe()&&(e(),t=!0),t}function ne(e){e.target instanceof HTMLInputElement&&(I(e.target.value),F(!1),V(-1),$(!1))}function re(){const e=de()-1;e>-1&&le(h[e])}function oe(){const e=de();e<h.length&&(le(h[e]),function(e){O(h.length-Math.max(e,-1)-1)}(e))}function ie(){let e=!1;const t=function(){if(-1!==B)return ue()[B];return}();return t?(ae(t),e=!0):he()&&(ae(D),e=!0),e}function se(e){const t=[...new Set(e.map(m).filter(Boolean).filter((e=>!function(e){return h.some((t=>ce(e)===ce(t)))}(e))))];if(t.length>0){const e=[...h];e.splice(de(),0,...t),g(e)}}function ae(e){k(e)?(se([e]),(0,vw.speak)(_.added,"assertive"),I(""),V(-1),$(!1),F(!C),A&&!T&&K()):(0,vw.speak)(_.__experimentalInvalid,"assertive")}function le(e){const t=h.filter((t=>ce(t)!==ce(e)));g(t),(0,vw.speak)(_.removed,"assertive")}function ce(e){return"object"==typeof e?e.value:e}function ue(e=D,t=a,n=h,r=l,o=m){let i=o(e);const s=[],c=[],u=n.map((e=>"string"==typeof e?e:e.value));return 0===i.length?t=t.filter((e=>!u.includes(e))):(i=i.normalize("NFKC").toLocaleLowerCase(),t.forEach((e=>{const t=e.normalize("NFKC").toLocaleLowerCase().indexOf(i);-1===u.indexOf(e)&&(0===t?s.push(e):t>0&&c.push(e))})),t=s.concat(c)),t.slice(0,r)}function de(){return h.length-R}function fe(){return 0===D.length}function he(){return m(D).length>0}function pe(e=!0){const t=D.trim().length>1,n=ue(D),r=n.length>0,o=X()&&C;if(F(o||t&&r),e&&(M&&t&&r?(V(0),$(!0)):(V(-1),$(!1))),t){const e=r?(0,u.sprintf)((0,u._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",n.length),n.length):(0,u.__)("No results.");q(e,"assertive")}}function me(e,t,n){const r=ce(e),o="string"!=typeof e?e.status:void 0,i=t+1,s=n.length;return(0,kt.jsx)(Pv,{children:(0,kt.jsx)(iA,{value:r,status:o,title:"string"!=typeof e?e.title:void 0,displayTransform:p,onClickRemove:J,isBorderless:"string"!=typeof e&&e.isBorderless||x,onMouseEnter:"string"!=typeof e?e.onMouseEnter:void 0,onMouseLeave:"string"!=typeof e?e.onMouseLeave:void 0,disabled:"error"!==o&&y,messages:_,termsCount:s,termPosition:i})},"token-"+r)}(0,f.useEffect)((()=>{A&&!X()&&K()}),[A]),(0,f.useEffect)((()=>{const e=!i_()(a,H||[]);(e||h!==U)&&pe(e)}),[a,H,h,U]),(0,f.useEffect)((()=>{pe()}),[D]),(0,f.useEffect)((()=>{pe()}),[M]),y&&A&&(z(!1),I(""));const ge=c(s,"components-form-token-field__input-container",{"is-active":A,"is-disabled":y});let ve={className:"components-form-token-field",tabIndex:-1};const be=ue();return y||(ve=Object.assign({},ve,{onKeyDown:vy((function(e){let t=!1;if(!e.defaultPrevented){switch(e.key){case"Backspace":t=te(re);break;case"Enter":t=ie();break;case"ArrowLeft":t=function(){let e=!1;return fe()&&(O((e=>Math.min(e+1,h.length))),e=!0),e}();break;case"ArrowUp":V((e=>(0===e?ue(D,a,h,l,m).length:e)-1)),$(!0),t=!0;break;case"ArrowRight":t=function(){let e=!1;return fe()&&(O((e=>Math.max(e-1,0))),e=!0),e}();break;case"ArrowDown":V((e=>(e+1)%ue(D,a,h,l,m).length)),$(!0),t=!0;break;case"Delete":t=te(oe);break;case"Space":w&&(t=ie());break;case"Escape":t=function(e){return ne(e),!0}(e);break;case"Tab":t=function(e){return ne(e),!1}(e)}t&&e.preventDefault()}})),onKeyPress:function(e){let t=!1;","===e.key&&(he()&&ae(D),t=!0);t&&e.preventDefault()},onFocus:function(e){X()||e.target===G.current?(z(!0),F(C||L)):z(!1),"function"==typeof b&&b(e)}})),(0,kt.jsxs)("div",{...ve,children:[i&&(0,kt.jsx)(My,{htmlFor:`components-form-token-input-${P}`,className:"components-form-token-field__label",children:i}),(0,kt.jsxs)("div",{ref:G,className:ge,tabIndex:-1,onMouseDown:Q,onTouchStart:Q,children:[(0,kt.jsx)(aA,{justify:"flex-start",align:"center",gap:1,wrap:!0,__next40pxDefaultSize:E,hasTokens:!!h.length,children:function(){const e=h.map(me);return e.splice(de(),0,function(){const e={instanceId:P,autoCapitalize:t,autoComplete:n,placeholder:0===h.length?o:"",disabled:y,value:D,onBlur:Z,isExpanded:L,selectedSuggestionIndex:B};return(0,kt.jsx)(HT,{...e,onChange:r&&h.length>=r?void 0:ee,ref:Y},"input")}()),e}()}),L&&(0,kt.jsx)(YT,{instanceId:P,match:m(D),displayTransform:p,suggestions:be,selectedIndex:B,scrollIntoView:W,onHover:function(e){const t=ue().indexOf(e);t>=0&&(V(t),$(!1))},onSelect:function(e){ae(e)},__experimentalRenderItem:S})]}),!N&&(0,kt.jsx)(Mv,{marginBottom:2}),j&&(0,kt.jsx)(Py,{id:`components-form-token-suggestions-howto-${P}`,className:"components-form-token-field__help",__nextHasNoMarginBottom:N,children:w?(0,u.__)("Separate with commas, spaces, or the Enter key."):(0,u.__)("Separate with commas or the Enter key.")})]})}var uA=cA;const dA=()=>(0,kt.jsx)(a.SVG,{width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,kt.jsx)(a.Circle,{cx:"4",cy:"4",r:"4"})});function fA({currentPage:e,numberOfPages:t,setCurrentPage:n}){return(0,kt.jsx)("ul",{className:"components-guide__page-control","aria-label":(0,u.__)("Guide controls"),children:Array.from({length:t}).map(((r,o)=>(0,kt.jsx)("li",{"aria-current":o===e?"step":void 0,children:(0,kt.jsx)(Hy,{size:"small",icon:(0,kt.jsx)(dA,{}),"aria-label":(0,u.sprintf)((0,u.__)("Page %1$d of %2$d"),o+1,t),onClick:()=>n(o)},o)},o)))})}var hA=function({children:e,className:t,contentLabel:n,finishButtonText:r=(0,u.__)("Finish"),nextButtonText:o=(0,u.__)("Next"),previousButtonText:i=(0,u.__)("Previous"),onFinish:s,pages:a=[]}){const l=(0,f.useRef)(null),[d,h]=(0,f.useState)(0);var p;(0,f.useEffect)((()=>{const e=l.current?.querySelector(".components-guide");e instanceof HTMLElement&&e.focus()}),[d]),(0,f.useEffect)((()=>{f.Children.count(e)&&Ji()("Passing children to <Guide>",{since:"5.5",alternative:"the `pages` prop"})}),[e]),f.Children.count(e)&&(a=null!==(p=f.Children.map(e,(e=>({content:e}))))&&void 0!==p?p:[]);const m=d>0,g=d<a.length-1,v=()=>{m&&h(d-1)},b=()=>{g&&h(d+1)};return 0===a.length?null:(0,kt.jsx)(yP,{className:c("components-guide",t),contentLabel:n,isDismissible:a.length>1,onRequestClose:s,onKeyDown:e=>{"ArrowLeft"===e.code?(v(),e.preventDefault()):"ArrowRight"===e.code&&(b(),e.preventDefault())},ref:l,children:(0,kt.jsxs)("div",{className:"components-guide__container",children:[(0,kt.jsxs)("div",{className:"components-guide__page",children:[a[d].image,a.length>1&&(0,kt.jsx)(fA,{currentPage:d,numberOfPages:a.length,setCurrentPage:h}),a[d].content]}),(0,kt.jsxs)("div",{className:"components-guide__footer",children:[m&&(0,kt.jsx)(Hy,{className:"components-guide__back-button",variant:"tertiary",onClick:v,__next40pxDefaultSize:!0,children:i}),g&&(0,kt.jsx)(Hy,{className:"components-guide__forward-button",variant:"primary",onClick:b,__next40pxDefaultSize:!0,children:o}),!g&&(0,kt.jsx)(Hy,{className:"components-guide__finish-button",variant:"primary",onClick:s,__next40pxDefaultSize:!0,children:r})]})]})})};function pA(e){return(0,f.useEffect)((()=>{Ji()("<GuidePage>",{since:"5.5",alternative:"the `pages` prop in <Guide>"})}),[]),(0,kt.jsx)("div",{...e})}var mA=(0,f.forwardRef)((function({label:e,labelPosition:t,size:n,tooltip:r,...o},i){return Ji()("wp.components.IconButton",{since:"5.4",alternative:"wp.components.Button",version:"6.2"}),(0,kt.jsx)(Hy,{...o,ref:i,tooltipPosition:t,iconSize:n,showTooltip:void 0!==r?!!r:void 0,label:r||e})}));function gA({target:e,callback:t,shortcut:n,bindGlobal:r,eventName:o}){return(0,d.useKeyboardShortcut)(n,t,{bindGlobal:r,target:e,eventName:o}),null}var vA=function({children:e,shortcuts:t,bindGlobal:n,eventName:r}){const o=(0,f.useRef)(null),i=Object.entries(null!=t?t:{}).map((([e,t])=>(0,kt.jsx)(gA,{shortcut:e,callback:t,bindGlobal:n,eventName:r,target:o},e)));return f.Children.count(e)?(0,kt.jsxs)("div",{ref:o,children:[i,e]}):(0,kt.jsx)(kt.Fragment,{children:i})};var bA=function e(t){const{children:n,className:r="",label:o,hideSeparator:i}=t,s=(0,d.useInstanceId)(e);if(!f.Children.count(n))return null;const a=`components-menu-group-label-${s}`,l=c(r,"components-menu-group",{"has-hidden-separator":i});return(0,kt.jsxs)("div",{className:l,children:[o&&(0,kt.jsx)("div",{className:"components-menu-group__label",id:a,"aria-hidden":"true",children:o}),(0,kt.jsx)("div",{role:"group","aria-labelledby":o?a:void 0,children:n})]})};const xA=(0,f.forwardRef)((function(e,t){let{children:n,info:r,className:o,icon:i,iconPosition:s="right",shortcut:a,isSelected:l,role:u="menuitem",suffix:d,...h}=e;return o=c("components-menu-item__button",o),r&&(n=(0,kt.jsxs)("span",{className:"components-menu-item__info-wrapper",children:[(0,kt.jsx)("span",{className:"components-menu-item__item",children:n}),(0,kt.jsx)("span",{className:"components-menu-item__info",children:r})]})),i&&"string"!=typeof i&&(i=(0,f.cloneElement)(i,{className:c("components-menu-items__item-icon",{"has-icon-right":"right"===s})})),(0,kt.jsxs)(Hy,{__next40pxDefaultSize:!0,ref:t,"aria-checked":"menuitemcheckbox"===u||"menuitemradio"===u?l:void 0,role:u,icon:"left"===s?i:void 0,className:o,accessibleWhenDisabled:!0,...h,children:[(0,kt.jsx)("span",{className:"components-menu-item__item",children:n}),!d&&(0,kt.jsx)(es,{className:"components-menu-item__shortcut",shortcut:a}),!d&&i&&"right"===s&&(0,kt.jsx)(Vy,{icon:i}),d]})}));var yA=xA;const wA=()=>{};var _A=function({choices:e=[],onHover:t=wA,onSelect:n,value:r}){return(0,kt.jsx)(kt.Fragment,{children:e.map((e=>{const o=r===e.value;return(0,kt.jsx)(yA,{role:"menuitemradio",disabled:e.disabled,icon:o?tk:null,info:e.info,isSelected:o,shortcut:e.shortcut,className:"components-menu-items-choice",onClick:()=>{o||n(e.value)},onMouseEnter:()=>t(e.value),onMouseLeave:()=>t(null),"aria-label":e["aria-label"],children:e.label},e.value)}))})};var SA=(0,f.forwardRef)((function({eventToOffset:e,...t},n){return(0,kt.jsx)(xT,{ref:n,stopNavigationEvents:!0,onlyBrowserTabstops:!0,eventToOffset:t=>{const{code:n,shiftKey:r}=t;return"Tab"===n?r?-1:1:e?e(t):void 0},...t})}));const CA="root",kA=()=>{},jA=()=>{},EA=(0,f.createContext)({activeItem:void 0,activeMenu:CA,setActiveMenu:kA,navigationTree:{items:{},getItem:jA,addItem:kA,removeItem:kA,menus:{},getMenu:jA,addMenu:kA,removeMenu:kA,childMenu:{},traverseMenu:kA,isMenuEmpty:()=>!1}});EA.displayName="NavigationContext";const MA=()=>(0,f.useContext)(EA);const NA=Sl("div",{target:"eeiismy11"})("width:100%;box-sizing:border-box;padding:0 ",Rl(4),";overflow:hidden;"),TA=Sl("div",{target:"eeiismy10"})("margin-top:",Rl(6),";margin-bottom:",Rl(6),";display:flex;flex-direction:column;ul{padding:0;margin:0;list-style:none;}.components-navigation__back-button{margin-bottom:",Rl(6),";}.components-navigation__group+.components-navigation__group{margin-top:",Rl(6),";}"),PA=Sl(Hy,{target:"eeiismy9"})({name:"26l0q2",styles:"&.is-tertiary{color:inherit;opacity:0.7;&:hover:not( :disabled ){opacity:1;box-shadow:none;color:inherit;}&:active:not( :disabled ){background:transparent;opacity:1;color:inherit;}}"}),DA=Sl("div",{target:"eeiismy8"})({name:"1aubja5",styles:"overflow:hidden;width:100%"}),IA=Sl("div",{target:"eeiismy7"})({name:"rgorny",styles:"margin:11px 0;padding:1px"}),RA=Sl("span",{target:"eeiismy6"})("height:",Rl(6),";.components-button.is-small{color:inherit;opacity:0.7;margin-right:",Rl(1),";padding:0;&:active:not( :disabled ){background:none;opacity:1;color:inherit;}&:hover:not( :disabled ){box-shadow:none;opacity:1;color:inherit;}}"),OA=Sl(dj,{target:"eeiismy5"})("min-height:",Rl(12),";align-items:center;color:inherit;display:flex;justify-content:space-between;margin-bottom:",Rl(2),";padding:",(()=>(0,u.isRTL)()?`${Rl(1)} ${Rl(4)} ${Rl(1)} ${Rl(2)}`:`${Rl(1)} ${Rl(2)} ${Rl(1)} ${Rl(4)}`),";"),AA=Sl("li",{target:"eeiismy4"})("border-radius:",Wl.radiusSmall,";color:inherit;margin-bottom:0;>button,>a.components-button,>a{width:100%;color:inherit;opacity:0.7;padding:",Rl(2)," ",Rl(4),";",kv({textAlign:"left"},{textAlign:"right"})," &:hover,&:focus:not( [aria-disabled='true'] ):active,&:active:not( [aria-disabled='true'] ):active{color:inherit;opacity:1;}}&.is-active{background-color:",Fl.theme.accent,";color:",Fl.theme.accentInverted,";>button,.components-button:hover,>a{color:",Fl.theme.accentInverted,";opacity:1;}}>svg path{color:",Fl.gray[600],";}"),zA=Sl("div",{target:"eeiismy3"})("display:flex;align-items:center;height:auto;min-height:40px;margin:0;padding:",Rl(1.5)," ",Rl(4),";font-weight:400;line-height:20px;width:100%;color:inherit;opacity:0.7;"),LA=Sl("span",{target:"eeiismy2"})("display:flex;margin-right:",Rl(2),";"),FA=Sl("span",{target:"eeiismy1"})("margin-left:",(()=>(0,u.isRTL)()?"0":Rl(2)),";margin-right:",(()=>(0,u.isRTL)()?Rl(2):"0"),";display:inline-flex;padding:",Rl(1)," ",Rl(3),";border-radius:",Wl.radiusSmall,";@keyframes fade-in{from{opacity:0;}to{opacity:1;}}@media not ( prefers-reduced-motion ){animation:fade-in 250ms ease-out;}"),BA=Sl(Rb,{target:"eeiismy0"})((()=>(0,u.isRTL)()?"margin-left: auto;":"margin-right: auto;")," font-size:14px;line-height:20px;color:inherit;");function VA(){const[e,t]=(0,f.useState)({});return{nodes:e,getNode:t=>e[t],addNode:(e,n)=>{const{children:r,...o}=n;return t((t=>({...t,[e]:o})))},removeNode:e=>t((t=>{const{[e]:n,...r}=t;return r}))}}const WA=()=>{};var $A=function({activeItem:e,activeMenu:t=CA,children:n,className:r,onActivateMenu:o=WA}){const[i,s]=(0,f.useState)(t),[a,l]=(0,f.useState)(),d=(()=>{const{nodes:e,getNode:t,addNode:n,removeNode:r}=VA(),{nodes:o,getNode:i,addNode:s,removeNode:a}=VA(),[l,c]=(0,f.useState)({}),u=e=>l[e]||[],d=(e,t)=>{const n=[];let r,o=[e];for(;o.length>0&&(r=i(o.shift()),!r||n.includes(r.menu)||(n.push(r.menu),o=[...o,...u(r.menu)],!1!==t(r))););};return{items:e,getItem:t,addItem:n,removeItem:r,menus:o,getMenu:i,addMenu:(e,t)=>{c((n=>{const r={...n};return t.parentMenu?(r[t.parentMenu]||(r[t.parentMenu]=[]),r[t.parentMenu].push(e),r):r})),s(e,t)},removeMenu:a,childMenu:l,traverseMenu:d,isMenuEmpty:e=>{let t=!0;return d(e,(e=>{if(!e.isEmpty)return t=!1,!1})),t}}})(),h=(0,u.isRTL)()?"right":"left";Ji()("wp.components.Navigation (and all subcomponents)",{since:"6.8",version:"7.1",alternative:"wp.components.Navigator"});const p=(e,t=h)=>{d.getMenu(e)&&(l(t),s(e),o(e))},m=(0,f.useRef)(!1);(0,f.useEffect)((()=>{m.current||(m.current=!0)}),[]),(0,f.useEffect)((()=>{t!==i&&p(t)}),[t]);const g={activeItem:e,activeMenu:i,setActiveMenu:p,navigationTree:d},v=c("components-navigation",r),b=ec({type:"slide-in",origin:a});return(0,kt.jsx)(NA,{className:v,children:(0,kt.jsx)("div",{className:b?c({[b]:m.current&&a}):void 0,children:(0,kt.jsx)(EA.Provider,{value:g,children:n})},i)})},HA=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),UA=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})});var YA=(0,f.forwardRef)((function({backButtonLabel:e,className:t,href:n,onClick:r,parentMenu:o},i){const{setActiveMenu:s,navigationTree:a}=MA(),l=c("components-navigation__back-button",t),d=void 0!==o?a.getMenu(o)?.title:void 0,f=(0,u.isRTL)()?HA:UA;return(0,kt.jsxs)(PA,{__next40pxDefaultSize:!0,className:l,href:n,variant:"tertiary",ref:i,onClick:e=>{"function"==typeof r&&r(e);const t=(0,u.isRTL)()?"left":"right";o&&!e.defaultPrevented&&s(o,t)},children:[(0,kt.jsx)(JS,{icon:f}),e||d||(0,u.__)("Back")]})}));const GA=(0,f.createContext)({group:void 0});GA.displayName="NavigationGroupContext";let qA=0;var KA=function({children:e,className:t,title:n}){const[r]=(0,f.useState)("group-"+ ++qA),{navigationTree:{items:o}}=MA(),i={group:r};if(!Object.values(o).some((e=>e.group===r&&e._isVisible)))return(0,kt.jsx)(GA.Provider,{value:i,children:e});const s=`components-navigation__group-title-${r}`,a=c("components-navigation__group",t);return(0,kt.jsx)(GA.Provider,{value:i,children:(0,kt.jsxs)("li",{className:a,children:[n&&(0,kt.jsx)(OA,{className:"components-navigation__group-title",id:s,level:3,children:n}),(0,kt.jsx)("ul",{"aria-labelledby":s,role:"group",children:e})]})})};function XA(e){const{badge:t,title:n}=e;return(0,kt.jsxs)(kt.Fragment,{children:[n&&(0,kt.jsx)(BA,{className:"components-navigation__item-title",as:"span",children:n}),t&&(0,kt.jsx)(FA,{className:"components-navigation__item-badge",children:t})]})}const ZA=(0,f.createContext)({menu:void 0,search:""});ZA.displayName="NavigationMenuContext";const QA=()=>(0,f.useContext)(ZA),JA=e=>mw()(e).replace(/^\//,"").toLowerCase(),ez=(e,t)=>{const{activeMenu:n,navigationTree:{addItem:r,removeItem:o}}=MA(),{group:i}=(0,f.useContext)(GA),{menu:s,search:a}=QA();(0,f.useEffect)((()=>{const l=n===s,c=!a||void 0!==t.title&&((e,t)=>-1!==JA(e).indexOf(JA(t)))(t.title,a);return r(e,{...t,group:i,menu:s,_isVisible:l&&c}),()=>{o(e)}}),[n,a])};let tz=0;function nz(e){const{children:t,className:n,title:r,href:o,...i}=e,[s]=(0,f.useState)("item-"+ ++tz);ez(s,e);const{navigationTree:a}=MA();if(!a.getItem(s)?._isVisible)return null;const l=c("components-navigation__item",n);return(0,kt.jsx)(AA,{className:l,...i,children:t})}const rz=()=>{};var oz=function(e){const{badge:t,children:n,className:r,href:o,item:i,navigateToMenu:s,onClick:a=rz,title:l,icon:d,hideIfTargetMenuEmpty:f,isText:h,...p}=e,{activeItem:m,setActiveMenu:g,navigationTree:{isMenuEmpty:v}}=MA();if(f&&s&&v(s))return null;const b=i&&m===i,x=c(r,{"is-active":b}),y=(0,u.isRTL)()?UA:HA,w=n?e:{...e,onClick:void 0},_=h?p:{as:Hy,__next40pxDefaultSize:!("as"in p)||void 0===p.as,href:o,onClick:e=>{s&&g(s),a(e)},"aria-current":b?"page":void 0,...p};return(0,kt.jsx)(nz,{...w,className:x,children:n||(0,kt.jsxs)(zA,{..._,children:[d&&(0,kt.jsx)(LA,{children:(0,kt.jsx)(JS,{icon:d})}),(0,kt.jsx)(XA,{title:l,badge:t}),s&&(0,kt.jsx)(JS,{icon:y})]})})};var iz=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"})}),sz=(0,d.createHigherOrderComponent)((e=>t=>(0,kt.jsx)(e,{...t,speak:vw.speak,debouncedSpeak:(0,d.useDebounce)(vw.speak,500)})),"withSpokenMessages");const az=Sl(Fy,{target:"effl84m1"})({name:"37btb2",styles:"input[type='search']{&::-webkit-search-decoration,&::-webkit-search-cancel-button,&::-webkit-search-results-button,&::-webkit-search-results-decoration{-webkit-appearance:none;}}"}),lz=Sl(Vy,{target:"effl84m0"})({name:"1i54h4p",styles:"&:dir( ltr ){transform:scaleX( -1 );}"});function cz({searchRef:e,value:t,onChange:n,onClose:r}){if(!r&&!t)return null;r&&Ji()("`onClose` prop in wp.components.SearchControl",{since:"6.8"});return(0,kt.jsx)(FS,{variant:"control",children:(0,kt.jsx)(Hy,{size:"small",icon:BT,label:r?(0,u.__)("Close search"):(0,u.__)("Reset search"),onClick:null!=r?r:()=>{n(""),e.current?.focus()}})})}const uz=(0,f.forwardRef)((function({__nextHasNoMarginBottom:e=!1,className:t,onChange:n,value:r,label:o=(0,u.__)("Search"),placeholder:i=(0,u.__)("Search"),hideLabelFromVision:s=!0,onClose:a,size:l="default",...h},p){const{disabled:m,...g}=h,v=(0,f.useRef)(null),b=(0,d.useInstanceId)(uz,"components-search-control"),x=(0,f.useMemo)((()=>({BaseControl:{_overrides:{__nextHasNoMarginBottom:e},__associatedWPComponentName:"SearchControl"}})),[e]);return(0,kt.jsx)(xs,{value:x,children:(0,kt.jsx)(az,{__next40pxDefaultSize:!0,id:b,hideLabelFromVision:s,label:o,ref:(0,d.useMergeRefs)([v,p]),type:"search",size:l,className:c("components-search-control",t),onChange:e=>n(null!=e?e:""),autoComplete:"off",placeholder:i,value:null!=r?r:"",prefix:(0,kt.jsx)(ok,{variant:"icon",children:(0,kt.jsx)(lz,{icon:iz,fill:"currentColor"})}),suffix:(0,kt.jsx)(cz,{searchRef:v,value:r,onChange:n,onClose:a}),...g})})}));var dz=uz;var fz=sz((function({debouncedSpeak:e,onCloseSearch:t,onSearch:n,search:r,title:o}){const{navigationTree:{items:i}}=MA(),{menu:s}=QA(),a=(0,f.useRef)(null);(0,f.useEffect)((()=>{const e=setTimeout((()=>{a.current?.focus()}),100);return()=>{clearTimeout(e)}}),[]),(0,f.useEffect)((()=>{if(!r)return;const t=Object.values(i).filter((e=>e._isVisible)).length,n=(0,u.sprintf)((0,u._n)("%d result found.","%d results found.",t),t);e(n)}),[i,r]);const l=()=>{n?.(""),t()},c=`components-navigation__menu-title-search-${s}`,d=(0,u.sprintf)((0,u.__)("Search %s"),o?.toLowerCase()||"").trim();return(0,kt.jsx)(IA,{children:(0,kt.jsx)(dz,{__nextHasNoMarginBottom:!0,className:"components-navigation__menu-search-input",id:c,onChange:e=>n?.(e),onKeyDown:e=>{"Escape"!==e.code||e.defaultPrevented||(e.preventDefault(),l())},placeholder:d,onClose:l,ref:a,value:r})})}));function hz({hasSearch:e,onSearch:t,search:n,title:r,titleAction:o}){const[i,s]=(0,f.useState)(!1),{menu:a}=QA(),l=(0,f.useRef)(null);if(!r)return null;const c=`components-navigation__menu-title-${a}`,d=(0,u.sprintf)((0,u.__)("Search in %s"),r);return(0,kt.jsxs)(DA,{className:"components-navigation__menu-title",children:[!i&&(0,kt.jsxs)(OA,{as:"h2",className:"components-navigation__menu-title-heading",level:3,children:[(0,kt.jsx)("span",{id:c,children:r}),(e||o)&&(0,kt.jsxs)(RA,{children:[o,e&&(0,kt.jsx)(Hy,{size:"small",variant:"tertiary",label:d,onClick:()=>s(!0),ref:l,children:(0,kt.jsx)(JS,{icon:iz})})]})]}),i&&(0,kt.jsx)("div",{className:ec({type:"slide-in",origin:"left"}),children:(0,kt.jsx)(fz,{onCloseSearch:()=>{s(!1),setTimeout((()=>{l.current?.focus()}),100)},onSearch:t,search:n,title:r})})]})}function pz({search:e}){const{navigationTree:{items:t}}=MA(),n=Object.values(t).filter((e=>e._isVisible)).length;return!e||n?null:(0,kt.jsx)(AA,{children:(0,kt.jsxs)(zA,{children:[(0,u.__)("No results found.")," "]})})}var mz=function(e){const{backButtonLabel:t,children:n,className:r,hasSearch:o,menu:i=CA,onBackButtonClick:s,onSearch:a,parentMenu:l,search:u,isSearchDebouncing:d,title:h,titleAction:p}=e,[m,g]=(0,f.useState)("");(e=>{const{navigationTree:{addMenu:t,removeMenu:n}}=MA(),r=e.menu||CA;(0,f.useEffect)((()=>(t(r,{...e,menu:r}),()=>{n(r)})),[])})(e);const{activeMenu:v}=MA(),b={menu:i,search:m};if(v!==i)return(0,kt.jsx)(ZA.Provider,{value:b,children:n});const x=!!a,y=x?u:m,w=x?a:g,_=`components-navigation__menu-title-${i}`,S=c("components-navigation__menu",r);return(0,kt.jsx)(ZA.Provider,{value:b,children:(0,kt.jsxs)(TA,{className:S,children:[(l||s)&&(0,kt.jsx)(YA,{backButtonLabel:t,parentMenu:l,onClick:s}),h&&(0,kt.jsx)(hz,{hasSearch:o,onSearch:w,search:y,title:h,titleAction:p}),(0,kt.jsx)(wT,{children:(0,kt.jsxs)("ul",{"aria-labelledby":_,children:[n,y&&!d&&(0,kt.jsx)(pz,{search:y})]})})]})})};function gz(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n<e.length;){var r=e[n];if("*"!==r&&"+"!==r&&"?"!==r)if("\\"!==r)if("{"!==r)if("}"!==r)if(":"!==r)if("("!==r)t.push({type:"CHAR",index:n,value:e[n++]});else{var o=1,i="";if("?"===e[a=n+1])throw new TypeError('Pattern cannot start with "?" at '.concat(a));for(;a<e.length;)if("\\"!==e[a]){if(")"===e[a]){if(0==--o){a++;break}}else if("("===e[a]&&(o++,"?"!==e[a+1]))throw new TypeError("Capturing groups are not allowed at ".concat(a));i+=e[a++]}else i+=e[a++]+e[a++];if(o)throw new TypeError("Unbalanced pattern at ".concat(n));if(!i)throw new TypeError("Missing pattern at ".concat(n));t.push({type:"PATTERN",index:n,value:i}),n=a}else{for(var s="",a=n+1;a<e.length;){var l=e.charCodeAt(a);if(!(l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||95===l))break;s+=e[a++]}if(!s)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:s}),n=a}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),r=t.prefixes,o=void 0===r?"./":r,i=t.delimiter,s=void 0===i?"/#?":i,a=[],l=0,c=0,u="",d=function(e){if(c<n.length&&n[c].type===e)return n[c++].value},f=function(e){var t=d(e);if(void 0!==t)return t;var r=n[c],o=r.type,i=r.index;throw new TypeError("Unexpected ".concat(o," at ").concat(i,", expected ").concat(e))},h=function(){for(var e,t="";e=d("CHAR")||d("ESCAPED_CHAR");)t+=e;return t},p=function(e){var t=a[a.length-1],n=e||(t&&"string"==typeof t?t:"");if(t&&!n)throw new TypeError('Must have text between two parameters, missing text after "'.concat(t.name,'"'));return!n||function(e){for(var t=0,n=s;t<n.length;t++){var r=n[t];if(e.indexOf(r)>-1)return!0}return!1}(n)?"[^".concat(bz(s),"]+?"):"(?:(?!".concat(bz(n),")[^").concat(bz(s),"])+?")};c<n.length;){var m=d("CHAR"),g=d("NAME"),v=d("PATTERN");if(g||v){var b=m||"";-1===o.indexOf(b)&&(u+=b,b=""),u&&(a.push(u),u=""),a.push({name:g||l++,prefix:b,suffix:"",pattern:v||p(b),modifier:d("MODIFIER")||""})}else{var x=m||d("ESCAPED_CHAR");if(x)u+=x;else if(u&&(a.push(u),u=""),d("OPEN")){b=h();var y=d("NAME")||"",w=d("PATTERN")||"",_=h();f("CLOSE"),a.push({name:y||(w?l++:""),pattern:y&&!w?p(b):w,prefix:b,suffix:_,modifier:d("MODIFIER")||""})}else f("END")}}return a}function vz(e,t){var n=[];return function(e,t,n){void 0===n&&(n={});var r=n.decode,o=void 0===r?function(e){return e}:r;return function(n){var r=e.exec(n);if(!r)return!1;for(var i=r[0],s=r.index,a=Object.create(null),l=function(e){if(void 0===r[e])return"continue";var n=t[e-1];"*"===n.modifier||"+"===n.modifier?a[n.name]=r[e].split(n.prefix+n.suffix).map((function(e){return o(e,n)})):a[n.name]=o(r[e],n)},c=1;c<r.length;c++)l(c);return{path:i,index:s,params:a}}}(wz(e,n,t),n,t)}function bz(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function xz(e){return e&&e.sensitive?"":"i"}function yz(e,t,n){return function(e,t,n){void 0===n&&(n={});for(var r=n.strict,o=void 0!==r&&r,i=n.start,s=void 0===i||i,a=n.end,l=void 0===a||a,c=n.encode,u=void 0===c?function(e){return e}:c,d=n.delimiter,f=void 0===d?"/#?":d,h=n.endsWith,p="[".concat(bz(void 0===h?"":h),"]|$"),m="[".concat(bz(f),"]"),g=s?"^":"",v=0,b=e;v<b.length;v++){var x=b[v];if("string"==typeof x)g+=bz(u(x));else{var y=bz(u(x.prefix)),w=bz(u(x.suffix));if(x.pattern)if(t&&t.push(x),y||w)if("+"===x.modifier||"*"===x.modifier){var _="*"===x.modifier?"?":"";g+="(?:".concat(y,"((?:").concat(x.pattern,")(?:").concat(w).concat(y,"(?:").concat(x.pattern,"))*)").concat(w,")").concat(_)}else g+="(?:".concat(y,"(").concat(x.pattern,")").concat(w,")").concat(x.modifier);else{if("+"===x.modifier||"*"===x.modifier)throw new TypeError('Can not repeat "'.concat(x.name,'" without a prefix and suffix'));g+="(".concat(x.pattern,")").concat(x.modifier)}else g+="(?:".concat(y).concat(w,")").concat(x.modifier)}}if(l)o||(g+="".concat(m,"?")),g+=n.endsWith?"(?=".concat(p,")"):"$";else{var S=e[e.length-1],C="string"==typeof S?m.indexOf(S[S.length-1])>-1:void 0===S;o||(g+="(?:".concat(m,"(?=").concat(p,"))?")),C||(g+="(?=".concat(m,"|").concat(p,")"))}return new RegExp(g,xz(n))}(gz(e,n),t,n)}function wz(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,o=n.exec(e.source);o;)t.push({name:o[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),o=n.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,n){var r=e.map((function(e){return wz(e,t,n).source}));return new RegExp("(?:".concat(r.join("|"),")"),xz(n))}(e,t,n):yz(e,t,n)}function _z(e,t){return vz(t,{decode:decodeURIComponent})(e)}const Sz=(0,f.createContext)({location:{},goTo:()=>{},goBack:()=>{},goToParent:()=>{},addScreen:()=>{},removeScreen:()=>{},params:{}});Sz.displayName="NavigatorContext";const Cz={name:"1br0vvk",styles:"position:relative;overflow-x:clip;contain:layout;display:grid;grid-template-columns:1fr;grid-template-rows:1fr;align-items:start"},kz=Il({from:{opacity:0}}),jz=Il({to:{opacity:0}}),Ez=Il({from:{transform:"translateX(100px)"}}),Mz=Il({to:{transform:"translateX(-80px)"}}),Nz=Il({from:{transform:"translateX(-100px)"}}),Tz=Il({to:{transform:"translateX(80px)"}}),Pz=70,Dz="linear",Iz={IN:70,OUT:40},Rz=300,Oz="cubic-bezier(0.33, 0, 0, 1)",Az=Math.max(Pz+Iz.IN,Rz),zz=Math.max(Pz+Iz.OUT,Rz),Lz={end:{in:Ez.name,out:Mz.name},start:{in:Nz.name,out:Tz.name}},Fz={end:{in:Dl(Pz,"ms ",Dz," ",Iz.IN,"ms both ",kz,",",Rz,"ms ",Oz," both ",Ez,";",""),out:Dl(Pz,"ms ",Dz," ",Iz.OUT,"ms both ",jz,",",Rz,"ms ",Oz," both ",Mz,";","")},start:{in:Dl(Pz,"ms ",Dz," ",Iz.IN,"ms both ",kz,",",Rz,"ms ",Oz," both ",Nz,";",""),out:Dl(Pz,"ms ",Dz," ",Iz.OUT,"ms both ",jz,",",Rz,"ms ",Oz," both ",Tz,";","")}},Bz=Dl("z-index:1;&[data-animation-type='out']{z-index:0;}@media not ( prefers-reduced-motion ){&:not( [data-skip-animation] ){",["start","end"].map((e=>["in","out"].map((t=>Dl("&[data-animation-direction='",e,"'][data-animation-type='",t,"']{animation:",Fz[e][t],";}",""))))),";}}",""),Vz={name:"14di7zd",styles:"overflow-x:auto;max-height:100%;box-sizing:border-box;position:relative;grid-column:1/-1;grid-row:1/-1"};function Wz(e,t,n={}){var r;const{focusSelectors:o}=e,i={...e.currentLocation},{isBack:s=!1,skipFocus:a=!1,replace:l,focusTargetSelector:c,...u}=n;if(i.path===t)return{currentLocation:i,focusSelectors:o};let d,f;function h(){var t;return d=null!==(t=d)&&void 0!==t?t:new Map(e.focusSelectors),d}return c&&i.path&&h().set(i.path,c),o.get(t)&&(s&&(f=o.get(t)),h().delete(t)),{currentLocation:{...u,isInitial:!1,path:t,isBack:s,hasRestoredFocus:!1,focusTargetSelector:f,skipFocus:a},focusSelectors:null!==(r=d)&&void 0!==r?r:o}}function $z(e,t={}){const{screens:n,focusSelectors:r}=e,o={...e.currentLocation},i=o.path;if(void 0===i)return{currentLocation:o,focusSelectors:r};const s=function(e,t){if(!e.startsWith("/"))return;const n=e.split("/");let r;for(;n.length>1&&void 0===r;){n.pop();const e=""===n.join("/")?"/":n.join("/");t.find((t=>!1!==_z(e,t.path)))&&(r=e)}return r}(i,n);return void 0===s?{currentLocation:o,focusSelectors:r}:Wz(e,s,{...t,isBack:!0})}function Hz(e,t){let{screens:n,currentLocation:r,matchedPath:o,focusSelectors:i,...s}=e;switch(t.type){case"add":n=function({screens:e},t){return e.some((e=>e.path===t.path))?e:[...e,t]}(e,t.screen);break;case"remove":n=function({screens:e},t){return e.filter((e=>e.id!==t.id))}(e,t.screen);break;case"goto":({currentLocation:r,focusSelectors:i}=Wz(e,t.path,t.options));break;case"gotoparent":({currentLocation:r,focusSelectors:i}=$z(e,t.options))}if(n===e.screens&&r===e.currentLocation)return e;const a=r.path;return o=void 0!==a?function(e,t){for(const n of t){const t=_z(e,n.path);if(t)return{params:t.params,id:n.id}}}(a,n):void 0,o&&e.matchedPath&&o.id===e.matchedPath.id&&i_()(o.params,e.matchedPath.params)&&(o=e.matchedPath),{...s,screens:n,currentLocation:r,matchedPath:o,focusSelectors:i}}const Uz=ul((function(e,t){const{initialPath:n,children:r,className:o,...i}=cl(e,"Navigator"),[s,a]=(0,f.useReducer)(Hz,n,(e=>({screens:[],currentLocation:{path:e,isInitial:!0},matchedPath:void 0,focusSelectors:new Map,initialPath:n}))),l=(0,f.useMemo)((()=>({goBack:e=>a({type:"gotoparent",options:e}),goTo:(e,t)=>a({type:"goto",path:e,options:t}),goToParent:e=>{Ji()("wp.components.useNavigator().goToParent",{since:"6.7",alternative:"wp.components.useNavigator().goBack"}),a({type:"gotoparent",options:e})},addScreen:e=>a({type:"add",screen:e}),removeScreen:e=>a({type:"remove",screen:e})})),[]),{currentLocation:c,matchedPath:u}=s,d=(0,f.useMemo)((()=>{var e;return{location:c,params:null!==(e=u?.params)&&void 0!==e?e:{},match:u?.id,...l}}),[c,u,l]),h=ll(),p=(0,f.useMemo)((()=>h(Cz,o)),[o,h]);return(0,kt.jsx)(kl,{ref:t,className:p,...i,children:(0,kt.jsx)(Sz.Provider,{value:d,children:r})})}),"Navigator"),Yz=window.wp.escapeHtml;function Gz({isMatch:e,skipAnimation:t,isBack:n,onAnimationEnd:r}){const o=(0,u.isRTL)(),i=(0,d.useReducedMotion)(),[s,a]=(0,f.useState)("INITIAL"),l="ANIMATING_IN"!==s&&"IN"!==s&&e,c="ANIMATING_OUT"!==s&&"OUT"!==s&&!e;(0,f.useLayoutEffect)((()=>{l?a(t||i?"IN":"ANIMATING_IN"):c&&a(t||i?"OUT":"ANIMATING_OUT")}),[l,c,t,i]);const h=o&&n||!o&&!n?"end":"start",p="ANIMATING_IN"===s,m="ANIMATING_OUT"===s;let g;p?g="in":m&&(g="out");const v=(0,f.useCallback)((e=>{r?.(e),((e,t,n)=>"ANIMATING_OUT"===t&&n===Lz[e].out)(h,s,e.animationName)?a("OUT"):((e,t,n)=>"ANIMATING_IN"===t&&n===Lz[e].in)(h,s,e.animationName)&&a("IN")}),[r,s,h]);return(0,f.useEffect)((()=>{let e;return m?e=window.setTimeout((()=>{a("OUT"),e=void 0}),1.2*zz):p&&(e=window.setTimeout((()=>{a("IN"),e=void 0}),1.2*Az)),()=>{e&&(window.clearTimeout(e),e=void 0)}}),[m,p]),{animationStyles:Bz,shouldRenderScreen:e||"IN"===s||"ANIMATING_OUT"===s,screenProps:{onAnimationEnd:v,"data-animation-direction":h,"data-animation-type":g,"data-skip-animation":t||void 0}}}const qz=ul((function(e,t){/^\//.test(e.path);const n=(0,f.useId)(),{children:r,className:o,path:i,onAnimationEnd:s,...a}=cl(e,"Navigator.Screen"),{location:l,match:c,addScreen:u,removeScreen:h}=(0,f.useContext)(Sz),{isInitial:p,isBack:m,focusTargetSelector:g,skipFocus:v}=l,b=c===n,x=(0,f.useRef)(null),y=!!p&&!m;(0,f.useEffect)((()=>{const e={id:n,path:(0,Yz.escapeAttribute)(i)};return u(e),()=>h(e)}),[n,i,u,h]);const{animationStyles:w,shouldRenderScreen:_,screenProps:S}=Gz({isMatch:b,isBack:m,onAnimationEnd:s,skipAnimation:y}),C=ll(),k=(0,f.useMemo)((()=>C(Vz,w,o)),[o,C,w]),j=(0,f.useRef)(l);(0,f.useEffect)((()=>{j.current=l}),[l]),(0,f.useEffect)((()=>{const e=x.current;if(y||!b||!e||j.current.hasRestoredFocus||v)return;const t=e.ownerDocument.activeElement;if(e.contains(t))return;let n=null;if(m&&g&&(n=e.querySelector(g)),!n){const[t]=pT.focus.tabbable.find(e);n=null!=t?t:e}j.current.hasRestoredFocus=!0,n.focus()}),[y,b,m,g,v]);const E=(0,d.useMergeRefs)([t,x]);return _?(0,kt.jsx)(kl,{ref:E,className:k,...S,...a,children:r}):null}),"Navigator.Screen");function Kz(){const{location:e,params:t,goTo:n,goBack:r,goToParent:o}=(0,f.useContext)(Sz);return{location:e,goTo:n,goBack:r,goToParent:o,params:t}}const Xz=ul((function(e,t){const n=function(e){const{path:t,onClick:n,as:r=Hy,attributeName:o="id",...i}=cl(e,"Navigator.Button"),s=(0,Yz.escapeAttribute)(t),{goTo:a}=Kz();return{as:r,onClick:(0,f.useCallback)((e=>{var t,r;e.preventDefault(),a(s,{focusTargetSelector:(t=o,r=s,`[${t}="${r}"]`)}),n?.(e)}),[a,n,o,s]),...i,[o]:s}}(e);return(0,kt.jsx)(kl,{ref:t,...n})}),"Navigator.Button");const Zz=ul((function(e,t){const n=function(e){const{onClick:t,as:n=Hy,...r}=cl(e,"Navigator.BackButton"),{goBack:o}=Kz();return{as:n,onClick:(0,f.useCallback)((e=>{e.preventDefault(),o(),t?.(e)}),[o,t]),...r}}(e);return(0,kt.jsx)(kl,{ref:t,...n})}),"Navigator.BackButton");const Qz=ul((function(e,t){return Ji()("wp.components.NavigatorToParentButton",{since:"6.7",alternative:"wp.components.Navigator.BackButton"}),(0,kt.jsx)(Zz,{ref:t,...e})}),"Navigator.ToParentButton"),Jz=Object.assign(Uz,{displayName:"NavigatorProvider"}),eL=Object.assign(qz,{displayName:"NavigatorScreen"}),tL=Object.assign(Xz,{displayName:"NavigatorButton"}),nL=Object.assign(Zz,{displayName:"NavigatorBackButton"}),rL=Object.assign(Qz,{displayName:"NavigatorToParentButton"}),oL=Object.assign(Uz,{Screen:Object.assign(qz,{displayName:"Navigator.Screen"}),Button:Object.assign(Xz,{displayName:"Navigator.Button"}),BackButton:Object.assign(Zz,{displayName:"Navigator.BackButton"})}),iL=()=>{};function sL(e){switch(e){case"success":case"warning":case"info":return"polite";default:return"assertive"}}function aL(e){switch(e){case"warning":return(0,u.__)("Warning notice");case"info":return(0,u.__)("Information notice");case"error":return(0,u.__)("Error notice");default:return(0,u.__)("Notice")}}var lL=function({className:e,status:t="info",children:n,spokenMessage:r=n,onRemove:o=iL,isDismissible:i=!0,actions:s=[],politeness:a=sL(t),__unstableHTML:l,onDismiss:d=iL}){!function(e,t){const n="string"==typeof e?e:(0,f.renderToString)(e);(0,f.useEffect)((()=>{n&&(0,vw.speak)(n,t)}),[n,t])}(r,a);const h=c(e,"components-notice","is-"+t,{"is-dismissible":i});return l&&"string"==typeof n&&(n=(0,kt.jsx)(f.RawHTML,{children:n})),(0,kt.jsxs)("div",{className:h,children:[(0,kt.jsx)(jl,{children:aL(t)}),(0,kt.jsxs)("div",{className:"components-notice__content",children:[n,(0,kt.jsx)("div",{className:"components-notice__actions",children:s.map((({className:e,label:t,isPrimary:n,variant:r,noDefaultClasses:o=!1,onClick:i,url:s},a)=>{let l=r;return"primary"===r||o||(l=s?"link":"secondary"),void 0===l&&n&&(l="primary"),(0,kt.jsx)(Hy,{__next40pxDefaultSize:!0,href:s,variant:l,onClick:s?void 0:i,className:c("components-notice__action",e),children:t},a)}))})]}),i&&(0,kt.jsx)(Hy,{size:"small",className:"components-notice__dismiss",icon:Tw,label:(0,u.__)("Close"),onClick:()=>{d(),o()}})]})};const cL=()=>{};var uL=function({notices:e,onRemove:t=cL,className:n,children:r}){const o=e=>()=>t(e);return n=c("components-notice-list",n),(0,kt.jsxs)("div",{className:n,children:[r,[...e].reverse().map((e=>{const{content:t,...n}=e;return(0,$.createElement)(lL,{...n,key:e.id,onRemove:o(e.id)},e.content)}))]})};var dL=function({label:e,children:t}){return(0,kt.jsxs)("div",{className:"components-panel__header",children:[e&&(0,kt.jsx)("h2",{children:e}),t]})};var fL=(0,f.forwardRef)((function({header:e,className:t,children:n},r){const o=c(t,"components-panel");return(0,kt.jsxs)("div",{className:o,ref:r,children:[e&&(0,kt.jsx)(dL,{label:e}),n]})})),hL=(0,kt.jsx)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,kt.jsx)(a.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})});const pL=()=>{};const mL=(0,f.forwardRef)((({isOpened:e,icon:t,title:n,...r},o)=>n?(0,kt.jsx)("h2",{className:"components-panel__body-title",children:(0,kt.jsxs)(Hy,{__next40pxDefaultSize:!0,className:"components-panel__body-toggle","aria-expanded":e,ref:o,...r,children:[(0,kt.jsx)("span",{"aria-hidden":"true",children:(0,kt.jsx)(Vy,{className:"components-panel__arrow",icon:e?hL:eC})}),n,t&&(0,kt.jsx)(Vy,{icon:t,className:"components-panel__icon",size:20})]})}):null)),gL=(0,f.forwardRef)((function(e,t){const{buttonProps:n={},children:r,className:o,icon:i,initialOpen:s,onToggle:a=pL,opened:l,title:u,scrollAfterOpen:h=!0}=e,[p,m]=sC(l,{initial:void 0===s||s,fallback:!1}),g=(0,f.useRef)(null),v=(0,d.useReducedMotion)()?"auto":"smooth",b=(0,f.useRef)();b.current=h,gs((()=>{p&&b.current&&g.current?.scrollIntoView&&g.current.scrollIntoView({inline:"nearest",block:"nearest",behavior:v})}),[p,v]);const x=c("components-panel__body",o,{"is-opened":p});return(0,kt.jsxs)("div",{className:x,ref:(0,d.useMergeRefs)([g,t]),children:[(0,kt.jsx)(mL,{icon:i,isOpened:Boolean(p),onClick:e=>{e.preventDefault();const t=!p;m(t),a(t)},title:u,...n}),"function"==typeof r?r({opened:Boolean(p)}):p&&r]})}));var vL=gL;var bL=(0,f.forwardRef)((function({className:e,children:t},n){return(0,kt.jsx)("div",{className:c("components-panel__row",e),ref:n,children:t})}));const xL=(0,kt.jsx)(a.SVG,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none",children:(0,kt.jsx)(a.Path,{vectorEffect:"non-scaling-stroke",d:"M60 60 0 0"})});var yL=function(e){const{icon:t,children:n,label:r,instructions:o,className:i,notices:s,preview:a,isColumnLayout:l,withIllustration:u,...h}=e,[p,{width:m}]=(0,d.useResizeObserver)();let g;"number"==typeof m&&(g={"is-large":m>=480,"is-medium":m>=160&&m<480,"is-small":m<160});const v=c("components-placeholder",i,g,u?"has-illustration":null),b=c("components-placeholder__fieldset",{"is-column-layout":l});return(0,f.useEffect)((()=>{o&&(0,vw.speak)(o)}),[o]),(0,kt.jsxs)("div",{...h,className:v,children:[u?xL:null,p,s,a&&(0,kt.jsx)("div",{className:"components-placeholder__preview",children:a}),(0,kt.jsxs)("div",{className:"components-placeholder__label",children:[(0,kt.jsx)(Vy,{icon:t}),r]}),!!o&&(0,kt.jsx)("div",{className:"components-placeholder__instructions",children:o}),(0,kt.jsx)("div",{className:b,children:n})]})};function wL(e=!1){const t=e?"right":"left";return Il({"0%":{[t]:"-50%"},"100%":{[t]:"100%"}})}const _L=Sl("div",{target:"e15u147w2"})("position:relative;overflow:hidden;height:",Wl.borderWidthFocus,";background-color:color-mix(\n\t\tin srgb,\n\t\t",Fl.theme.foreground,",\n\t\ttransparent 90%\n\t);border-radius:",Wl.radiusFull,";outline:2px solid transparent;outline-offset:2px;:where( & ){width:160px;}");var SL={name:"152sa26",styles:"width:var(--indicator-width);transition:width 0.4s ease-in-out"};const CL=Sl("div",{target:"e15u147w1"})("display:inline-block;position:absolute;top:0;height:100%;border-radius:",Wl.radiusFull,";background-color:color-mix(\n\t\tin srgb,\n\t\t",Fl.theme.foreground,",\n\t\ttransparent 10%\n\t);outline:2px solid transparent;outline-offset:-2px;",(({isIndeterminate:e})=>e?Dl({animationDuration:"1.5s",animationTimingFunction:"ease-in-out",animationIterationCount:"infinite",animationName:wL((0,u.isRTL)()),width:"50%"},"",""):SL),";"),kL=Sl("progress",{target:"e15u147w0"})({name:"11fb690",styles:"position:absolute;top:0;left:0;opacity:0;width:100%;height:100%"});var jL=(0,f.forwardRef)((function(e,t){const{className:n,value:r,...o}=e,i=!Number.isFinite(r);return(0,kt.jsxs)(_L,{className:n,children:[(0,kt.jsx)(CL,{style:{"--indicator-width":i?void 0:`${r}%`},isIndeterminate:i}),(0,kt.jsx)(kL,{max:100,value:r,"aria-label":(0,u.__)("Loading …"),ref:t,...o})]})}));function EL(e){const t=e.map((e=>({children:[],parent:null,...e,id:String(e.id)})));if(!t.every((e=>null!==e.parent)))return t;const n=t.reduce(((e,t)=>{const{parent:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{}),r=e=>e.map((e=>{const t=n[e.id];return{...e,children:t&&t.length?r(t):[]}}));return r(n[0]||[])}const ML=window.wp.htmlEntities,NL={BaseControl:{_overrides:{__associatedWPComponentName:"TreeSelect"}}};function TL(e,t=0){return e.flatMap((e=>[{value:e.id,label:" ".repeat(3*t)+(0,ML.decodeEntities)(e.name)},...TL(e.children||[],t+1)]))}var PL=function(e){const{label:t,noOptionLabel:n,onChange:r,selectedId:o,tree:i=[],...s}=ix(e),a=(0,f.useMemo)((()=>[n&&{value:"",label:n},...TL(i)].filter((e=>!!e))),[n,i]);return Ay({componentName:"TreeSelect",size:s.size,__next40pxDefaultSize:s.__next40pxDefaultSize}),(0,kt.jsx)(xs,{value:NL,children:(0,kt.jsx)(rC,{__shouldNotWarnDeprecated36pxSize:!0,label:t,options:a,onChange:r,value:o,...s})})};function DL({__next40pxDefaultSize:e,label:t,noOptionLabel:n,authorList:r,selectedAuthorId:o,onChange:i}){if(!r)return null;const s=EL(r);return(0,kt.jsx)(PL,{label:t,noOptionLabel:n,onChange:i,tree:s,selectedId:void 0!==o?String(o):void 0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e})}function IL({__next40pxDefaultSize:e,label:t,noOptionLabel:n,categoriesList:r,selectedCategoryId:o,onChange:i,...s}){const a=(0,f.useMemo)((()=>EL(r)),[r]);return(0,kt.jsx)(PL,{label:t,noOptionLabel:n,onChange:i,tree:a,selectedId:void 0!==o?String(o):void 0,...s,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e})}function RL(e){return"categoriesList"in e}function OL(e){return"categorySuggestions"in e}const AL=[{label:(0,u.__)("Newest to oldest"),value:"date/desc"},{label:(0,u.__)("Oldest to newest"),value:"date/asc"},{label:(0,u.__)("A → Z"),value:"title/asc"},{label:(0,u.__)("Z → A"),value:"title/desc"}];var zL=function({authorList:e,selectedAuthorId:t,numberOfItems:n,order:r,orderBy:o,orderByOptions:i=AL,maxItems:s=100,minItems:a=1,onAuthorChange:l,onNumberOfItemsChange:c,onOrderChange:d,onOrderByChange:f,...h}){return(0,kt.jsx)(lj,{spacing:"4",className:"components-query-controls",children:[d&&f&&(0,kt.jsx)(oC,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,u.__)("Order by"),value:void 0===o||void 0===r?void 0:`${o}/${r}`,options:i,onChange:e=>{if("string"!=typeof e)return;const[t,n]=e.split("/");n!==r&&d(n),t!==o&&f(t)}},"query-controls-order-select"),RL(h)&&h.categoriesList&&h.onCategoryChange&&(0,kt.jsx)(IL,{__next40pxDefaultSize:!0,categoriesList:h.categoriesList,label:(0,u.__)("Category"),noOptionLabel:(0,u._x)("All","categories"),selectedCategoryId:h.selectedCategoryId,onChange:h.onCategoryChange},"query-controls-category-select"),OL(h)&&h.categorySuggestions&&h.onCategoryChange&&(0,kt.jsx)(uA,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,u.__)("Categories"),value:h.selectedCategories&&h.selectedCategories.map((e=>({id:e.id,value:e.name||e.value}))),suggestions:Object.keys(h.categorySuggestions),onChange:h.onCategoryChange,maxSuggestions:20},"query-controls-categories-select"),l&&(0,kt.jsx)(DL,{__next40pxDefaultSize:!0,authorList:e,label:(0,u.__)("Author"),noOptionLabel:(0,u._x)("All","authors"),selectedAuthorId:t,onChange:l},"query-controls-author-select"),c&&(0,kt.jsx)(YC,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,u.__)("Number of items"),value:n,onChange:c,min:a,max:s,required:!0},"query-controls-range-control")]})};const LL=(0,f.createContext)({store:void 0,disabled:void 0});LL.displayName="RadioGroupContext";var FL=(0,f.forwardRef)((function({value:e,children:t,...n},r){const{store:o,disabled:i}=(0,f.useContext)(LL),s=rt(o,"value"),a=void 0!==s&&s===e;return Ay({componentName:"Radio",size:void 0,__next40pxDefaultSize:n.__next40pxDefaultSize}),(0,kt.jsx)(vS,{disabled:i,store:o,ref:r,value:e,render:(0,kt.jsx)(Hy,{variant:a?"primary":"secondary",...n}),children:t||e})}));var BL=(0,f.forwardRef)((function({label:e,checked:t,defaultChecked:n,disabled:r,onChange:o,children:i,...s},a){const l=Z_({value:t,defaultValue:n,setValue:e=>{o?.(null!=e?e:void 0)},rtl:(0,u.isRTL)()}),c=(0,f.useMemo)((()=>({store:l,disabled:r})),[l,r]);return Ji()("wp.components.__experimentalRadioGroup",{alternative:"wp.components.RadioControl or wp.components.__experimentalToggleGroupControl",since:"6.8"}),(0,kt.jsx)(LL.Provider,{value:c,children:(0,kt.jsx)(rS,{store:l,render:(0,kt.jsx)(iM,{__shouldNotWarnDeprecated:!0,children:i}),"aria-label":e,ref:a,...s})})}));function VL(e,t){return`${e}-${t}-option-description`}function WL(e,t){return`${e}-${t}`}function $L(e){return`${e}__help`}var HL=function e(t){const{label:n,className:r,selected:o,help:i,onChange:s,onClick:a,hideLabelFromVision:l,options:u=[],id:f,...h}=t,p=(0,d.useInstanceId)(e,"inspector-radio-control",f),m=e=>s(e.target.value);return u?.length?(0,kt.jsxs)("fieldset",{id:p,className:c(r,"components-radio-control"),"aria-describedby":i?$L(p):void 0,children:[l?(0,kt.jsx)(jl,{as:"legend",children:n}):(0,kt.jsx)(Oy.VisualLabel,{as:"legend",children:n}),(0,kt.jsx)(lj,{spacing:3,className:c("components-radio-control__group-wrapper",{"has-help":!!i}),children:u.map(((e,t)=>(0,kt.jsxs)("div",{className:"components-radio-control__option",children:[(0,kt.jsx)("input",{id:WL(p,t),className:"components-radio-control__input",type:"radio",name:p,value:e.value,onChange:m,checked:e.value===o,"aria-describedby":e.description?VL(p,t):void 0,onClick:e=>{e.currentTarget.focus(),a?.(e)},...h}),(0,kt.jsx)("label",{className:"components-radio-control__label",htmlFor:WL(p,t),children:e.label}),e.description?(0,kt.jsx)(Py,{__nextHasNoMarginBottom:!0,id:VL(p,t),className:"components-radio-control__option-description",children:e.description}):null]},WL(p,t))))}),!!i&&(0,kt.jsx)(Py,{__nextHasNoMarginBottom:!0,id:$L(p),className:"components-base-control__help",children:i})]}):null},UL=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),YL=function(){return YL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},YL.apply(this,arguments)},GL={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},qL={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},KL={width:"20px",height:"20px",position:"absolute"},XL={top:YL(YL({},GL),{top:"-5px"}),right:YL(YL({},qL),{left:void 0,right:"-5px"}),bottom:YL(YL({},GL),{top:void 0,bottom:"-5px"}),left:YL(YL({},qL),{left:"-5px"}),topRight:YL(YL({},KL),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:YL(YL({},KL),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:YL(YL({},KL),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:YL(YL({},KL),{left:"-10px",top:"-10px",cursor:"nw-resize"})},ZL=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onMouseDown=function(e){t.props.onResizeStart(e,t.props.direction)},t.onTouchStart=function(e){t.props.onResizeStart(e,t.props.direction)},t}return UL(t,e),t.prototype.render=function(){return $.createElement("div",{className:this.props.className||"",style:YL(YL({position:"absolute",userSelect:"none"},XL[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}($.PureComponent),QL=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),JL=function(){return JL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},JL.apply(this,arguments)},eF={width:"auto",height:"auto"},tF=function(e,t,n){return Math.max(Math.min(e,n),t)},nF=function(e,t){return Math.round(e/t)*t},rF=function(e,t){return new RegExp(e,"i").test(t)},oF=function(e){return Boolean(e.touches&&e.touches.length)},iF=function(e,t,n){void 0===n&&(n=0);var r=t.reduce((function(n,r,o){return Math.abs(r-e)<Math.abs(t[n]-e)?o:n}),0),o=Math.abs(t[r]-e);return 0===n||o<n?t[r]:e},sF=function(e){return"auto"===(e=e.toString())||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:e+"px"},aF=function(e,t,n,r){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return t*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return n*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return r*(Number(e.replace("vh",""))/100)}return e},lF=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],cF="__resizable_base__",uF=function(e){function t(t){var n=e.call(this,t)||this;return n.ratio=1,n.resizable=null,n.parentLeft=0,n.parentTop=0,n.resizableLeft=0,n.resizableRight=0,n.resizableTop=0,n.resizableBottom=0,n.targetLeft=0,n.targetTop=0,n.appendBase=function(){if(!n.resizable||!n.window)return null;var e=n.parentNode;if(!e)return null;var t=n.window.document.createElement("div");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.transform="scale(0, 0)",t.style.left="0",t.style.flex="0 0 100%",t.classList?t.classList.add(cF):t.className+=cF,e.appendChild(t),t},n.removeBase=function(e){var t=n.parentNode;t&&t.removeChild(e)},n.ref=function(e){e&&(n.resizable=e)},n.state={isResizing:!1,width:void 0===(n.propsSize&&n.propsSize.width)?"auto":n.propsSize&&n.propsSize.width,height:void 0===(n.propsSize&&n.propsSize.height)?"auto":n.propsSize&&n.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},n.onResizeStart=n.onResizeStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n}return QL(t,e),Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||eF},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,r=this.resizable.offsetHeight,o=this.resizable.style.position;"relative"!==o&&(this.resizable.style.position="relative"),e="auto"!==this.resizable.style.width?this.resizable.offsetWidth:n,t="auto"!==this.resizable.style.height?this.resizable.offsetHeight:r,this.resizable.style.position=o}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,n=function(t){if(void 0===e.state[t]||"auto"===e.state[t])return"auto";if(e.propsSize&&e.propsSize[t]&&e.propsSize[t].toString().endsWith("%")){if(e.state[t].toString().endsWith("%"))return e.state[t].toString();var n=e.getParentSize();return Number(e.state[t].toString().replace("px",""))/n[t]*100+"%"}return sF(e.state[t])};return{width:t&&void 0!==t.width&&!this.state.isResizing?sF(t.width):n("width"),height:t&&void 0!==t.height&&!this.state.isResizing?sF(t.height):n("height")}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,n=this.parentNode.style.flexWrap;"wrap"!==n&&(t=!0,this.parentNode.style.flexWrap="wrap"),e.style.position="relative",e.style.minWidth="100%",e.style.minHeight="100%";var r={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=n),this.removeBase(e),r},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(this.resizable&&this.window){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==e.flexBasis?e.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(e,t){var n=this.propsSize&&this.propsSize[t];return"auto"!==this.state[t]||this.state.original[t]!==e||void 0!==n&&"auto"!==n?e:"auto"},t.prototype.calculateNewMaxFromBoundary=function(e,t){var n,r,o=this.props.boundsByDirection,i=this.state.direction,s=o&&rF("left",i),a=o&&rF("top",i);if("parent"===this.props.bounds){var l=this.parentNode;l&&(n=s?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),r=a?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(n=s?this.resizableRight:this.window.innerWidth-this.resizableLeft,r=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(n=s?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),r=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return n&&Number.isFinite(n)&&(e=e&&e<n?e:n),r&&Number.isFinite(r)&&(t=t&&t<r?t:r),{maxWidth:e,maxHeight:t}},t.prototype.calculateNewSizeFromDirection=function(e,t){var n=this.props.scale||1,r=this.props.resizeRatio||1,o=this.state,i=o.direction,s=o.original,a=this.props,l=a.lockAspectRatio,c=a.lockAspectRatioExtraHeight,u=a.lockAspectRatioExtraWidth,d=s.width,f=s.height,h=c||0,p=u||0;return rF("right",i)&&(d=s.width+(e-s.x)*r/n,l&&(f=(d-p)/this.ratio+h)),rF("left",i)&&(d=s.width-(e-s.x)*r/n,l&&(f=(d-p)/this.ratio+h)),rF("bottom",i)&&(f=s.height+(t-s.y)*r/n,l&&(d=(f-h)*this.ratio+p)),rF("top",i)&&(f=s.height-(t-s.y)*r/n,l&&(d=(f-h)*this.ratio+p)),{newWidth:d,newHeight:f}},t.prototype.calculateNewSizeFromAspectRatio=function(e,t,n,r){var o=this.props,i=o.lockAspectRatio,s=o.lockAspectRatioExtraHeight,a=o.lockAspectRatioExtraWidth,l=void 0===r.width?10:r.width,c=void 0===n.width||n.width<0?e:n.width,u=void 0===r.height?10:r.height,d=void 0===n.height||n.height<0?t:n.height,f=s||0,h=a||0;if(i){var p=(u-f)*this.ratio+h,m=(d-f)*this.ratio+h,g=(l-h)/this.ratio+f,v=(c-h)/this.ratio+f,b=Math.max(l,p),x=Math.min(c,m),y=Math.max(u,g),w=Math.min(d,v);e=tF(e,b,x),t=tF(t,y,w)}else e=tF(e,l,c),t=tF(t,u,d);return{newWidth:e,newHeight:t}},t.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var e=this.parentNode;if(e){var t=e.getBoundingClientRect();this.parentLeft=t.left,this.parentTop=t.top}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var n=this.props.bounds.getBoundingClientRect();this.targetLeft=n.left,this.targetTop=n.top}if(this.resizable){var r=this.resizable.getBoundingClientRect(),o=r.left,i=r.top,s=r.right,a=r.bottom;this.resizableLeft=o,this.resizableRight=s,this.resizableTop=i,this.resizableBottom=a}},t.prototype.onResizeStart=function(e,t){if(this.resizable&&this.window){var n,r=0,o=0;if(e.nativeEvent&&function(e){return Boolean((e.clientX||0===e.clientX)&&(e.clientY||0===e.clientY))}(e.nativeEvent)?(r=e.nativeEvent.clientX,o=e.nativeEvent.clientY):e.nativeEvent&&oF(e.nativeEvent)&&(r=e.nativeEvent.touches[0].clientX,o=e.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(e,t,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var i=this.window.getComputedStyle(this.resizable);if("auto"!==i.flexBasis){var s=this.parentNode;if(s){var a=this.window.getComputedStyle(s).flexDirection;this.flexDir=a.startsWith("row")?"row":"column",n=i.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:r,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:JL(JL({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:n};this.setState(l)}},t.prototype.onMouseMove=function(e){var t=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&oF(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var n=this.props,r=n.maxWidth,o=n.maxHeight,i=n.minWidth,s=n.minHeight,a=oF(e)?e.touches[0].clientX:e.clientX,l=oF(e)?e.touches[0].clientY:e.clientY,c=this.state,u=c.direction,d=c.original,f=c.width,h=c.height,p=this.getParentSize(),m=function(e,t,n,r,o,i,s){return r=aF(r,e.width,t,n),o=aF(o,e.height,t,n),i=aF(i,e.width,t,n),s=aF(s,e.height,t,n),{maxWidth:void 0===r?void 0:Number(r),maxHeight:void 0===o?void 0:Number(o),minWidth:void 0===i?void 0:Number(i),minHeight:void 0===s?void 0:Number(s)}}(p,this.window.innerWidth,this.window.innerHeight,r,o,i,s);r=m.maxWidth,o=m.maxHeight,i=m.minWidth,s=m.minHeight;var g=this.calculateNewSizeFromDirection(a,l),v=g.newHeight,b=g.newWidth,x=this.calculateNewMaxFromBoundary(r,o);this.props.snap&&this.props.snap.x&&(b=iF(b,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(v=iF(v,this.props.snap.y,this.props.snapGap));var y=this.calculateNewSizeFromAspectRatio(b,v,{width:x.maxWidth,height:x.maxHeight},{width:i,height:s});if(b=y.newWidth,v=y.newHeight,this.props.grid){var w=nF(b,this.props.grid[0]),_=nF(v,this.props.grid[1]),S=this.props.snapGap||0;b=0===S||Math.abs(w-b)<=S?w:b,v=0===S||Math.abs(_-v)<=S?_:v}var C={width:b-d.width,height:v-d.height};if(f&&"string"==typeof f)if(f.endsWith("%"))b=b/p.width*100+"%";else if(f.endsWith("vw")){b=b/this.window.innerWidth*100+"vw"}else if(f.endsWith("vh")){b=b/this.window.innerHeight*100+"vh"}if(h&&"string"==typeof h)if(h.endsWith("%"))v=v/p.height*100+"%";else if(h.endsWith("vw")){v=v/this.window.innerWidth*100+"vw"}else if(h.endsWith("vh")){v=v/this.window.innerHeight*100+"vh"}var k={width:this.createSizeForCssProperty(b,"width"),height:this.createSizeForCssProperty(v,"height")};"row"===this.flexDir?k.flexBasis=k.width:"column"===this.flexDir&&(k.flexBasis=k.height),(0,Xr.flushSync)((function(){t.setState(k)})),this.props.onResize&&this.props.onResize(e,u,this.resizable,C)}},t.prototype.onMouseUp=function(e){var t=this.state,n=t.isResizing,r=t.direction,o=t.original;if(n&&this.resizable){var i={width:this.size.width-o.width,height:this.size.height-o.height};this.props.onResizeStop&&this.props.onResizeStop(e,r,this.resizable,i),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:JL(JL({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(e){this.setState({width:e.width,height:e.height})},t.prototype.renderResizer=function(){var e=this,t=this.props,n=t.enable,r=t.handleStyles,o=t.handleClasses,i=t.handleWrapperStyle,s=t.handleWrapperClass,a=t.handleComponent;if(!n)return null;var l=Object.keys(n).map((function(t){return!1!==n[t]?$.createElement(ZL,{key:t,direction:t,onResizeStart:e.onResizeStart,replaceStyles:r&&r[t],className:o&&o[t]},a&&a[t]?a[t]:null):null}));return $.createElement("div",{className:s,style:i},l)},t.prototype.render=function(){var e=this,t=Object.keys(this.props).reduce((function(t,n){return-1!==lF.indexOf(n)||(t[n]=e.props[n]),t}),{}),n=JL(JL(JL({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(n.flexBasis=this.state.flexBasis);var r=this.props.as||"div";return $.createElement(r,JL({ref:this.ref,style:n,className:this.props.className},t),this.state.isResizing&&$.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}($.PureComponent);const dF=()=>{},fF="bottom",hF="corner";function pF({axis:e,fadeTimeout:t=180,onResize:n=dF,position:r=fF,showPx:o=!1}){const[i,s]=(0,d.useResizeObserver)(),a=!!e,[l,c]=(0,f.useState)(!1),[u,h]=(0,f.useState)(!1),{width:p,height:m}=s,g=(0,f.useRef)(m),v=(0,f.useRef)(p),b=(0,f.useRef)(),x=(0,f.useCallback)((()=>{b.current&&window.clearTimeout(b.current),b.current=window.setTimeout((()=>{a||(c(!1),h(!1))}),t)}),[t,a]);(0,f.useEffect)((()=>{if(!(null!==p||null!==m))return;const e=p!==v.current,t=m!==g.current;if(e||t){if(p&&!v.current&&m&&!g.current)return v.current=p,void(g.current=m);e&&(c(!0),v.current=p),t&&(h(!0),g.current=m),n({width:p,height:m}),x()}}),[p,m,n,x]);const y=function({axis:e,height:t,moveX:n=!1,moveY:r=!1,position:o=fF,showPx:i=!1,width:s}){if(!n&&!r)return;if(o===hF)return`${s} x ${t}`;const a=i?" px":"";if(e){if("x"===e&&n)return`${s}${a}`;if("y"===e&&r)return`${t}${a}`}if(n&&r)return`${s} x ${t}`;if(n)return`${s}${a}`;if(r)return`${t}${a}`;return}({axis:e,height:m,moveX:l,moveY:u,position:r,showPx:o,width:p});return{label:y,resizeListener:i}}const mF=Sl("div",{target:"e1wq7y4k3"})({name:"1cd7zoc",styles:"bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0"}),gF=Sl("div",{target:"e1wq7y4k2"})({name:"ajymcs",styles:"align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear"}),vF=Sl("div",{target:"e1wq7y4k1"})("background:",Fl.theme.foreground,";border-radius:",Wl.radiusSmall,";box-sizing:border-box;font-family:",_y("default.fontFamily"),";font-size:12px;color:",Fl.theme.foregroundInverted,";padding:4px 8px;position:relative;"),bF=Sl(Rb,{target:"e1wq7y4k0"})("&&&{color:",Fl.theme.foregroundInverted,";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}");const xF=(0,f.forwardRef)((function({label:e,position:t=hF,zIndex:n=1e3,...r},o){const i=!!e,s=t===hF;if(!i)return null;let a={opacity:i?1:void 0,zIndex:n},l={};return t===fF&&(a={...a,position:"absolute",bottom:-10,left:"50%",transform:"translate(-50%, 0)"},l={transform:"translate(0, 100%)"}),s&&(a={...a,position:"absolute",top:4,right:(0,u.isRTL)()?void 0:4,left:(0,u.isRTL)()?4:void 0}),(0,kt.jsx)(gF,{"aria-hidden":"true",className:"components-resizable-tooltip__tooltip-wrapper",ref:o,style:a,...r,children:(0,kt.jsx)(vF,{className:"components-resizable-tooltip__tooltip",style:l,children:(0,kt.jsx)(bF,{as:"span",children:e})})})}));var yF=xF;const wF=()=>{};const _F=(0,f.forwardRef)((function({axis:e,className:t,fadeTimeout:n=180,isVisible:r=!0,labelRef:o,onResize:i=wF,position:s=fF,showPx:a=!0,zIndex:l=1e3,...u},d){const{label:f,resizeListener:h}=pF({axis:e,fadeTimeout:n,onResize:i,showPx:a,position:s});if(!r)return null;const p=c("components-resize-tooltip",t);return(0,kt.jsxs)(mF,{"aria-hidden":"true",className:p,ref:d,...u,children:[h,(0,kt.jsx)(yF,{"aria-hidden":u["aria-hidden"],label:f,position:s,ref:o,zIndex:l})]})}));var SF=_F;const CF="components-resizable-box__handle",kF="components-resizable-box__side-handle",jF="components-resizable-box__corner-handle",EF={top:c(CF,kF,"components-resizable-box__handle-top"),right:c(CF,kF,"components-resizable-box__handle-right"),bottom:c(CF,kF,"components-resizable-box__handle-bottom"),left:c(CF,kF,"components-resizable-box__handle-left"),topLeft:c(CF,jF,"components-resizable-box__handle-top","components-resizable-box__handle-left"),topRight:c(CF,jF,"components-resizable-box__handle-top","components-resizable-box__handle-right"),bottomRight:c(CF,jF,"components-resizable-box__handle-bottom","components-resizable-box__handle-right"),bottomLeft:c(CF,jF,"components-resizable-box__handle-bottom","components-resizable-box__handle-left")},MF={width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0},NF={top:MF,right:MF,bottom:MF,left:MF,topLeft:MF,topRight:MF,bottomRight:MF,bottomLeft:MF};var TF=(0,f.forwardRef)((function({className:e,children:t,showHandle:n=!0,__experimentalShowTooltip:r=!1,__experimentalTooltipProps:o={},...i},s){return(0,kt.jsxs)(uF,{className:c("components-resizable-box__container",n&&"has-show-handle",e),handleComponent:Object.fromEntries(Object.keys(EF).map((e=>[e,(0,kt.jsx)("div",{tabIndex:-1},e)]))),handleClasses:EF,handleStyles:NF,ref:s,...i,children:[t,r&&(0,kt.jsx)(SF,{...o})]})}));var PF=function({naturalWidth:e,naturalHeight:t,children:n,isInline:r=!1}){if(1!==f.Children.count(n))return null;const o=r?"span":"div";let i;return e&&t&&(i=`${e} / ${t}`),(0,kt.jsx)(o,{className:"components-responsive-wrapper",children:(0,kt.jsx)("div",{children:(0,f.cloneElement)(n,{className:c("components-responsive-wrapper__content",n.props.className),style:{...n.props.style,aspectRatio:i}})})})};const DF=function(){const{MutationObserver:e}=window;if(!e||!document.body||!window.parent)return;function t(){const e=document.body.getBoundingClientRect();window.parent.postMessage({action:"resize",width:e.width,height:e.height},"*")}function n(e){e.style&&["width","height","minHeight","maxHeight"].forEach((function(t){/^\\d+(vw|vh|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)$/.test(e.style[t])&&(e.style[t]="")}))}new e(t).observe(document.body,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),window.addEventListener("load",t,!0),Array.prototype.forEach.call(document.querySelectorAll("[style]"),n),Array.prototype.forEach.call(document.styleSheets,(function(e){Array.prototype.forEach.call(e.cssRules||e.rules,n)})),document.body.style.position="absolute",document.body.style.width="100%",document.body.setAttribute("data-resizable-iframe-connected",""),t(),window.addEventListener("resize",t,!0)};var IF=function({html:e="",title:t="",type:n,styles:r=[],scripts:o=[],onFocus:i,tabIndex:s}){const a=(0,f.useRef)(),[l,c]=(0,f.useState)(0),[u,h]=(0,f.useState)(0);function p(i=!1){if(!function(){try{return!!a.current?.contentDocument?.body}catch(e){return!1}}())return;const{contentDocument:s,ownerDocument:l}=a.current;if(!i&&null!==s?.body.getAttribute("data-resizable-iframe-connected"))return;const c=(0,kt.jsxs)("html",{lang:l.documentElement.lang,className:n,children:[(0,kt.jsxs)("head",{children:[(0,kt.jsx)("title",{children:t}),(0,kt.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div {\n\t\twidth: 100%;\n\t}\n\thtml.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio > div,\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t}\n\tbody > div > * {\n\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\tmargin-bottom: 0 !important;\n\t}\n"}}),r.map(((e,t)=>(0,kt.jsx)("style",{dangerouslySetInnerHTML:{__html:e}},t)))]}),(0,kt.jsxs)("body",{"data-resizable-iframe-connected":"data-resizable-iframe-connected",className:n,children:[(0,kt.jsx)("div",{dangerouslySetInnerHTML:{__html:e}}),(0,kt.jsx)("script",{type:"text/javascript",dangerouslySetInnerHTML:{__html:`(${DF.toString()})();`}}),o.map((e=>(0,kt.jsx)("script",{src:e},e)))]})]});s.open(),s.write("<!DOCTYPE html>"+(0,f.renderToString)(c)),s.close()}return(0,f.useEffect)((()=>{function e(){p(!1)}function t(e){const t=a.current;if(!t||t.contentWindow!==e.source)return;let n=e.data||{};if("string"==typeof n)try{n=JSON.parse(n)}catch(e){}"resize"===n.action&&(c(n.width),h(n.height))}p();const n=a.current,r=n?.ownerDocument?.defaultView;return n?.addEventListener("load",e,!1),r?.addEventListener("message",t),()=>{n?.removeEventListener("load",e,!1),r?.removeEventListener("message",t)}}),[]),(0,f.useEffect)((()=>{p()}),[t,r,o]),(0,f.useEffect)((()=>{p(!0)}),[e,n]),(0,kt.jsx)("iframe",{ref:(0,d.useMergeRefs)([a,(0,d.useFocusableIframe)()]),title:t,tabIndex:s,className:"components-sandbox",sandbox:"allow-scripts allow-same-origin allow-presentation",onFocus:i,width:Math.ceil(l),height:Math.ceil(u)})};const RF=(0,f.forwardRef)((function({className:e,children:t,spokenMessage:n=t,politeness:r="polite",actions:o=[],onRemove:i,icon:s=null,explicitDismiss:a=!1,onDismiss:l,listRef:d},h){function p(e){e&&e.preventDefault&&e.preventDefault(),d?.current?.focus(),l?.(),i?.()}function m(e,t){e.stopPropagation(),i?.(),t&&t(e)}!function(e,t){const n="string"==typeof e?e:(0,f.renderToString)(e);(0,f.useEffect)((()=>{n&&(0,vw.speak)(n,t)}),[n,t])}(n,r);const g=(0,f.useRef)({onDismiss:l,onRemove:i});(0,f.useLayoutEffect)((()=>{g.current={onDismiss:l,onRemove:i}})),(0,f.useEffect)((()=>{const e=setTimeout((()=>{a||(g.current.onDismiss?.(),g.current.onRemove?.())}),1e4);return()=>clearTimeout(e)}),[a]);const v=c(e,"components-snackbar",{"components-snackbar-explicit-dismiss":!!a});o&&o.length>1&&(o=[o[0]]);const b=c("components-snackbar__content",{"components-snackbar__content-with-icon":!!s});return(0,kt.jsx)("div",{ref:h,className:v,onClick:a?void 0:p,tabIndex:0,role:a?void 0:"button",onKeyPress:a?void 0:p,"aria-label":a?void 0:(0,u.__)("Dismiss this notice"),"data-testid":"snackbar",children:(0,kt.jsxs)("div",{className:b,children:[s&&(0,kt.jsx)("div",{className:"components-snackbar__icon",children:s}),t,o.map((({label:e,onClick:t,url:n,openInNewTab:r=!1},o)=>void 0!==n&&r?(0,kt.jsx)(pO,{href:n,onClick:e=>m(e,t),className:"components-snackbar__action",children:e},o):(0,kt.jsx)(Hy,{__next40pxDefaultSize:!0,href:n,variant:"link",onClick:e=>m(e,t),className:"components-snackbar__action",children:e},o))),a&&(0,kt.jsx)("span",{role:"button","aria-label":(0,u.__)("Dismiss this notice"),tabIndex:0,className:"components-snackbar__dismiss-button",onClick:p,onKeyPress:p,children:"✕"})]})})}));var OF=RF;const AF={init:{height:0,opacity:0},open:{height:"auto",opacity:1,transition:{height:{type:"tween",duration:.3,ease:[0,0,.2,1]},opacity:{type:"tween",duration:.25,delay:.05,ease:[0,0,.2,1]}}},exit:{opacity:0,transition:{type:"tween",duration:.1,ease:[0,0,.2,1]}}};var zF=function({notices:e,className:t,children:n,onRemove:r}){const o=(0,f.useRef)(null),i=(0,d.useReducedMotion)();t=c("components-snackbar-list",t);const s=e=>()=>r?.(e.id);return(0,kt.jsxs)("div",{className:t,tabIndex:-1,ref:o,"data-testid":"snackbar-list",children:[n,(0,kt.jsx)(mc,{children:e.map((e=>{const{content:t,...n}=e;return(0,kt.jsx)(sv.div,{layout:!i,initial:"init",animate:"open",exit:"exit",variants:i?void 0:AF,children:(0,kt.jsx)("div",{className:"components-snackbar-list__notice-container",children:(0,kt.jsx)(OF,{...n,onRemove:s(e),listRef:o,children:e.content})})},e.id)}))})]})};var LF=ul((function(e,t){const n=zM(e);return(0,kt.jsx)(kl,{...n,ref:t})}),"Surface");function FF(e={}){var t=e,{composite:n,combobox:r}=t,o=D(t,["composite","combobox"]);const i=["items","renderedItems","moves","orientation","virtualFocus","includesBaseElement","baseElement","focusLoop","focusShift","focusWrap"],s=Je(o.store,Qe(n,i),Qe(r,i)),a=null==s?void 0:s.getState(),l=vt(P(T({},o),{store:s,includesBaseElement:W(o.includesBaseElement,null==a?void 0:a.includesBaseElement,!1),orientation:W(o.orientation,null==a?void 0:a.orientation,"horizontal"),focusLoop:W(o.focusLoop,null==a?void 0:a.focusLoop,!0)})),c=lt(),u=Ye(P(T({},l.getState()),{selectedId:W(o.selectedId,null==a?void 0:a.selectedId,o.defaultSelectedId),selectOnMove:W(o.selectOnMove,null==a?void 0:a.selectOnMove,!0)}),l,s);Ge(u,(()=>Xe(u,["moves"],(()=>{const{activeId:e,selectOnMove:t}=u.getState();if(!t)return;if(!e)return;const n=l.item(e);n&&(n.dimmed||n.disabled||u.setState("selectedId",n.id))}))));let d=!0;Ge(u,(()=>Ze(u,["selectedId"],((e,t)=>{d?n&&e.selectedId===t.selectedId||u.setState("activeId",e.selectedId):d=!0})))),Ge(u,(()=>Xe(u,["selectedId","renderedItems"],(e=>{if(void 0!==e.selectedId)return;const{activeId:t,renderedItems:n}=u.getState(),r=l.item(t);if(!r||r.disabled||r.dimmed){const e=n.find((e=>!e.disabled&&!e.dimmed));u.setState("selectedId",null==e?void 0:e.id)}else u.setState("selectedId",r.id)})))),Ge(u,(()=>Xe(u,["renderedItems"],(e=>{const t=e.renderedItems;if(t.length)return Xe(c,["renderedItems"],(e=>{const n=e.renderedItems;n.some((e=>!e.tabId))&&n.forEach(((e,n)=>{if(e.tabId)return;const r=t[n];r&&c.renderItem(P(T({},e),{tabId:r.id}))}))}))}))));let f=null;return Ge(u,(()=>{const e=()=>{f=u.getState().selectedId},t=()=>{d=!1,u.setState("selectedId",f)};return n&&"setSelectElement"in n?A(Xe(n,["value"],e),Xe(n,["mounted"],t)):r?A(Xe(r,["selectedValue"],e),Xe(r,["mounted"],t)):void 0})),P(T(T({},l),u),{panels:c,setSelectedId:e=>u.setState("selectedId",e),select:e=>{u.setState("selectedId",e),l.move(e)}})}function BF(e={}){const t=CP(),n=NP()||t;e=w(y({},e),{composite:void 0!==e.composite?e.composite:n,combobox:void 0!==e.combobox?e.combobox:t});const[r,o]=st(FF,e);return function(e,t,n){Ie(t,[n.composite,n.combobox]),it(e=xt(e,t,n),n,"selectedId","setSelectedId"),it(e,n,"selectOnMove");const[r,o]=st((()=>e.panels),{});return Ie(o,[e,o]),Object.assign((0,$.useMemo)((()=>w(y({},e),{panels:r})),[e,r]),{composite:n.composite,combobox:n.combobox})}(r,o,e)}var VF=Tt([At],[zt]),WF=(VF.useContext,VF.useScopedContext),$F=VF.useProviderContext,HF=(VF.ContextProvider,VF.ScopedContextProvider),UF=Nt((function(e){var t=e,{store:n}=t,r=_(t,["store"]);const o=$F();L(n=n||o,!1);const i=n.useState((e=>"both"===e.orientation?void 0:e.orientation));return r=Ae(r,(e=>(0,kt.jsx)(HF,{value:n,children:e})),[n]),n.composite&&(r=y({focusable:!1},r)),r=y({role:"tablist","aria-orientation":i},r),r=fn(y({store:n},r))})),YF=jt((function(e){return Mt("div",UF(e))})),GF=Nt((function(e){var t,n=e,{store:r,getItem:o}=n,i=_(n,["store","getItem"]);const s=WF();L(r=r||s,!1);const a=Pe(),l=i.id||a,c=B(i),u=(0,$.useCallback)((e=>{const t=w(y({},e),{dimmed:c});return o?o(t):t}),[c,o]),d=i.onClick,f=Me((e=>{null==d||d(e),e.defaultPrevented||null==r||r.setSelectedId(l)})),h=r.panels.useState((e=>{var t;return null==(t=e.items.find((e=>e.tabId===l)))?void 0:t.id})),p=!!a&&i.shouldRegisterItem,m=r.useState((e=>!!l&&e.activeId===l)),g=r.useState((e=>!!l&&e.selectedId===l)),v=r.useState((e=>!!r.item(e.activeId))),b=m||g&&!v,x=g||null==(t=i.accessibleWhenDisabled)||t;if(rt(r.combobox||r.composite,"virtualFocus")&&(i=w(y({},i),{tabIndex:-1})),i=w(y({id:l,role:"tab","aria-selected":g,"aria-controls":h||void 0},i),{onClick:f}),r.composite){const e={id:l,accessibleWhenDisabled:x,store:r.composite,shouldRegisterItem:b&&p,rowId:i.rowId,render:i.render};i=w(y({},i),{render:(0,kt.jsx)(zn,w(y({},e),{render:r.combobox&&r.composite!==r.combobox?(0,kt.jsx)(zn,w(y({},e),{store:r.combobox})):e.render}))})}return i=An(w(y({store:r},i),{accessibleWhenDisabled:x,getItem:u,shouldRegisterItem:p}))})),qF=Et(jt((function(e){return Mt("button",GF(e))}))),KF=Nt((function(e){var t=e,{store:n,unmountOnHide:r,tabId:o,getItem:i,scrollRestoration:s,scrollElement:a}=t,l=_(t,["store","unmountOnHide","tabId","getItem","scrollRestoration","scrollElement"]);const c=$F();L(n=n||c,!1);const u=(0,$.useRef)(null),d=Pe(l.id),f=rt(n.panels,(()=>{var e;return o||(null==(e=null==n?void 0:n.panels.item(d))?void 0:e.tabId)})),h=Qn({open:rt(n,(e=>!!f&&e.selectedId===f))}),p=rt(h,"mounted"),m=(0,$.useRef)(new Map),g=Me((()=>{const e=u.current;return e?a?"function"==typeof a?a(e):"current"in a?a.current:a:e:null}));(0,$.useEffect)((()=>{var e,t;if(!s)return;if(!p)return;const n=g();if(!n)return;if("reset"===s)return void n.scroll(0,0);if(!f)return;const r=m.current.get(f);n.scroll(null!=(e=null==r?void 0:r.x)?e:0,null!=(t=null==r?void 0:r.y)?t:0);const o=()=>{m.current.set(f,{x:n.scrollLeft,y:n.scrollTop})};return n.addEventListener("scroll",o),()=>{n.removeEventListener("scroll",o)}}),[s,p,f,g,n]);const[v,b]=(0,$.useState)(!1);(0,$.useEffect)((()=>{const e=u.current;if(!e)return;const t=Ut(e);b(!!t.length)}),[]);const x=(0,$.useCallback)((e=>{const t=w(y({},e),{id:d||e.id,tabId:o});return i?i(t):t}),[d,o,i]),S=l.onKeyDown,C=Me((e=>{if(null==S||S(e),e.defaultPrevented)return;if(!(null==n?void 0:n.composite))return;const t={ArrowLeft:n.previous,ArrowRight:n.next,Home:n.first,End:n.last}[e.key];if(!t)return;const{selectedId:r}=n.getState(),o=t({activeId:r});o&&(e.preventDefault(),n.move(o))}));return l=Ae(l,(e=>(0,kt.jsx)(HF,{value:n,children:e})),[n]),l=w(y({id:d,role:"tabpanel","aria-labelledby":f||void 0},l),{children:r&&!p?null:l.children,ref:Te(u,l.ref),onKeyDown:C}),l=un(y({focusable:!n.composite&&!v},l)),l=eo(y({store:h},l)),l=Tn(w(y({store:n.panels},l),{getItem:x}))})),XF=jt((function(e){return Mt("div",KF(e))}));const ZF=e=>{if(null!=e)return e.match(/^tab-panel-[0-9]*-(.*)/)?.[1]},QF=(0,f.forwardRef)((({className:e,children:t,tabs:n,selectOnMove:r=!0,initialTabName:o,orientation:i="horizontal",activeClass:s="is-active",onSelect:a},l)=>{const h=(0,d.useInstanceId)(QF,"tab-panel"),p=(0,f.useCallback)((e=>{if(void 0!==e)return`${h}-${e}`}),[h]),m=BF({setSelectedId:e=>{if(null==e)return;const t=n.find((t=>p(t.name)===e));if(t?.disabled||t===b)return;const r=ZF(e);void 0!==r&&a?.(r)},orientation:i,selectOnMove:r,defaultSelectedId:p(o),rtl:(0,u.isRTL)()}),g=ZF(rt(m,"selectedId")),v=(0,f.useCallback)((e=>{m.setState("selectedId",p(e))}),[p,m]),b=n.find((({name:e})=>e===g)),x=(0,d.usePrevious)(g);return(0,f.useEffect)((()=>{x!==g&&g===o&&g&&a?.(g)}),[g,o,a,x]),(0,f.useLayoutEffect)((()=>{if(b)return;const e=n.find((e=>e.name===o));if(!o||e)if(e&&!e.disabled)v(e.name);else{const e=n.find((e=>!e.disabled));e&&v(e.name)}}),[n,b,o,h,v]),(0,f.useEffect)((()=>{if(!b?.disabled)return;const e=n.find((e=>!e.disabled));e&&v(e.name)}),[n,b?.disabled,v,h]),(0,kt.jsxs)("div",{className:e,ref:l,children:[(0,kt.jsx)(YF,{store:m,className:"components-tab-panel__tabs",children:n.map((e=>(0,kt.jsx)(qF,{id:p(e.name),className:c("components-tab-panel__tabs-item",e.className,{[s]:e.name===g}),disabled:e.disabled,"aria-controls":`${p(e.name)}-view`,render:(0,kt.jsx)(Hy,{__next40pxDefaultSize:!0,icon:e.icon,label:e.icon&&e.title,showTooltip:!!e.icon}),children:!e.icon&&e.title},e.name)))}),b&&(0,kt.jsx)(XF,{id:`${p(b.name)}-view`,store:m,tabId:p(b.name),className:"components-tab-panel__tab-content",children:t(b)})]})}));var JF=QF;const eB=(0,f.forwardRef)((function(e,t){const{__nextHasNoMarginBottom:n,__next40pxDefaultSize:r=!1,label:o,hideLabelFromVision:i,value:s,help:a,id:l,className:u,onChange:f,type:h="text",...p}=e,m=(0,d.useInstanceId)(eB,"inspector-text-control",l);return Ay({componentName:"TextControl",size:void 0,__next40pxDefaultSize:r}),(0,kt.jsx)(Oy,{__nextHasNoMarginBottom:n,__associatedWPComponentName:"TextControl",label:o,hideLabelFromVision:i,id:m,help:a,className:u,children:(0,kt.jsx)("input",{className:c("components-text-control__input",{"is-next-40px-default-size":r}),type:h,id:m,value:s,onChange:e=>f(e.target.value),"aria-describedby":a?m+"__help":void 0,ref:t,...p})})}));var tB=eB,nB={huge:"1440px",wide:"1280px","x-large":"1080px",large:"960px",medium:"782px",small:"600px",mobile:"480px","zoomed-in":"280px"};const rB=Dl("box-shadow:0 0 0 transparent;border-radius:",Wl.radiusSmall,";border:",Wl.borderWidth," solid ",Fl.ui.border,";@media not ( prefers-reduced-motion ){transition:box-shadow 0.1s linear;}",""),oB=Dl("border-color:",Fl.theme.accent,";box-shadow:0 0 0 calc( ",Wl.borderWidthFocus," - ",Wl.borderWidth," ) ",Fl.theme.accent,";outline:2px solid transparent;",""),iB=Sl("textarea",{target:"e1w5nnrk0"})("width:100%;display:block;font-family:",_y("default.fontFamily"),";line-height:20px;background:",Fl.theme.background,";color:",Fl.theme.foreground,";resize:vertical;padding:9px 11px;",rB,";font-size:",_y("mobileTextMinFontSize"),";",`@media (min-width: ${nB["small"]})`,"{font-size:",_y("default.fontSize"),";}&:focus{",oB,";}&::-webkit-input-placeholder{color:",Fl.ui.darkGrayPlaceholder,";}&::-moz-placeholder{color:",Fl.ui.darkGrayPlaceholder,";}&:-ms-input-placeholder{color:",Fl.ui.darkGrayPlaceholder,";}.is-dark-theme &{&::-webkit-input-placeholder{color:",Fl.ui.lightGrayPlaceholder,";}&::-moz-placeholder{color:",Fl.ui.lightGrayPlaceholder,";}&:-ms-input-placeholder{color:",Fl.ui.lightGrayPlaceholder,";}}");const sB=(0,f.forwardRef)((function(e,t){const{__nextHasNoMarginBottom:n,label:r,hideLabelFromVision:o,value:i,help:s,onChange:a,rows:l=4,className:u,...f}=e,h=`inspector-textarea-control-${(0,d.useInstanceId)(sB)}`,p=c("components-textarea-control",u);return(0,kt.jsx)(Oy,{__nextHasNoMarginBottom:n,__associatedWPComponentName:"TextareaControl",label:r,hideLabelFromVision:o,id:h,help:s,className:p,children:(0,kt.jsx)(iB,{className:"components-textarea-control__input",id:h,rows:l,onChange:e=>a(e.target.value),"aria-describedby":s?h+"__help":void 0,value:i,ref:t,...f})})}));var aB=sB;var lB=e=>{const{text:t="",highlight:n=""}=e,r=n.trim();if(!r)return(0,kt.jsx)(kt.Fragment,{children:t});const o=new RegExp(`(${_w(r)})`,"gi");return(0,f.createInterpolateElement)(t.replace(o,"<mark>$&</mark>"),{mark:(0,kt.jsx)("mark",{})})},cB=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"M12 15.8c-3.7 0-6.8-3-6.8-6.8s3-6.8 6.8-6.8c3.7 0 6.8 3 6.8 6.8s-3.1 6.8-6.8 6.8zm0-12C9.1 3.8 6.8 6.1 6.8 9s2.4 5.2 5.2 5.2c2.9 0 5.2-2.4 5.2-5.2S14.9 3.8 12 3.8zM8 17.5h8V19H8zM10 20.5h4V22h-4z"})});var uB=function(e){const{children:t}=e;return(0,kt.jsxs)("div",{className:"components-tip",children:[(0,kt.jsx)(JS,{icon:cB}),(0,kt.jsx)("p",{children:t})]})};const dB=(0,f.forwardRef)((function({__nextHasNoMarginBottom:e,label:t,checked:n,help:r,className:o,onChange:i,disabled:s},a){const l=`inspector-toggle-control-${(0,d.useInstanceId)(dB)}`,u=ll()("components-toggle-control",o,!e&&Dl({marginBottom:Rl(3)},"",""));let f,h;return e||Ji()("Bottom margin styles for wp.components.ToggleControl",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."}),r&&("function"==typeof r?void 0!==n&&(h=r(n)):h=r,h&&(f=l+"__help")),(0,kt.jsx)(Oy,{id:l,help:h&&(0,kt.jsx)("span",{className:"components-toggle-control__help",children:h}),className:u,__nextHasNoMarginBottom:!0,children:(0,kt.jsxs)(ow,{justify:"flex-start",spacing:2,children:[(0,kt.jsx)(rA,{id:l,checked:n,onChange:function(e){i(e.target.checked)},"aria-describedby":f,disabled:s,ref:a}),(0,kt.jsx)(xv,{as:"label",htmlFor:l,className:c("components-toggle-control__label",{"is-disabled":s}),children:t})]})})}));var fB=dB,hB=Tt([At],[zt]),pB=hB.useContext,mB=(hB.useScopedContext,hB.useProviderContext),gB=(hB.ContextProvider,hB.ScopedContextProvider),vB=Nt((function(e){var t=e,{store:n}=t,r=_(t,["store"]);const o=pB();return r=An(y({store:n=n||o},r))})),bB=Et(jt((function(e){return Mt("button",vB(e))})));const xB=(0,f.createContext)(void 0);xB.displayName="ToolbarContext";var yB=xB;const wB=(0,f.forwardRef)((function({children:e,as:t,...n},r){const o=(0,f.useContext)(yB),i="function"==typeof e;if(!i&&!t)return null;const s={...n,ref:r,"data-toolbar-item":!0};if(!o)return t?(0,kt.jsx)(t,{...s,children:e}):i?e(s):null;const a=i?e:t&&(0,kt.jsx)(t,{children:e});return(0,kt.jsx)(bB,{accessibleWhenDisabled:!0,...s,store:o,render:a})}));var _B=wB;var SB=({children:e,className:t})=>(0,kt.jsx)("div",{className:t,children:e});var CB=(0,f.forwardRef)((function(e,t){const{children:n,className:r,containerClassName:o,extraProps:i,isActive:s,title:a,...l}=function({isDisabled:e,...t}){return{disabled:e,...t}}(e);return(0,f.useContext)(yB)?(0,kt.jsx)(_B,{className:c("components-toolbar-button",r),...i,...l,ref:t,children:e=>(0,kt.jsx)(Hy,{size:"compact",label:a,isPressed:s,...e,children:n})}):(0,kt.jsx)(SB,{className:o,children:(0,kt.jsx)(Hy,{ref:t,icon:l.icon,size:"compact",label:a,shortcut:l.shortcut,"data-subscript":l.subscript,onClick:e=>{e.stopPropagation(),l.onClick&&l.onClick(e)},className:c("components-toolbar__control",r),isPressed:s,accessibleWhenDisabled:!0,"data-toolbar-item":!0,...i,...l,children:n})})}));var kB=({className:e,children:t,...n})=>(0,kt.jsx)("div",{className:e,...n,children:t});var jB=function({controls:e=[],toggleProps:t,...n}){const r=t=>(0,kt.jsx)(CT,{controls:e,toggleProps:{...t,"data-toolbar-item":!0},...n});return(0,f.useContext)(yB)?(0,kt.jsx)(_B,{...t,children:r}):r(t)};var EB=function({controls:e=[],children:t,className:n,isCollapsed:r,title:o,...i}){const s=(0,f.useContext)(yB);if(!(e&&e.length||t))return null;const a=c(s?"components-toolbar-group":"components-toolbar",n);let l;var u;return u=e,l=Array.isArray(u)&&Array.isArray(u[0])?e:[e],r?(0,kt.jsx)(jB,{label:o,controls:l,className:a,children:t,...i}):(0,kt.jsxs)(kB,{className:a,...i,children:[l?.flatMap(((e,t)=>e.map(((e,n)=>(0,kt.jsx)(CB,{containerClassName:t>0&&0===n?"has-left-divider":void 0,...e},[t,n].join()))))),t]})};function MB(e={}){var t;const n=null==(t=e.store)?void 0:t.getState();return vt(P(T({},e),{orientation:W(e.orientation,null==n?void 0:n.orientation,"horizontal"),focusLoop:W(e.focusLoop,null==n?void 0:n.focusLoop,!0)}))}function NB(e={}){const[t,n]=st(MB,e);return function(e,t,n){return xt(e,t,n)}(t,n,e)}var TB=Nt((function(e){var t=e,{store:n,orientation:r,virtualFocus:o,focusLoop:i,rtl:s}=t,a=_(t,["store","orientation","virtualFocus","focusLoop","rtl"]);const l=mB(),c=NB({store:n=n||l,orientation:r,virtualFocus:o,focusLoop:i,rtl:s}),u=c.useState((e=>"both"===e.orientation?void 0:e.orientation));return a=Ae(a,(e=>(0,kt.jsx)(gB,{value:c,children:e})),[c]),a=y({role:"toolbar","aria-orientation":u},a),a=fn(y({store:c},a))})),PB=jt((function(e){return Mt("div",TB(e))}));var DB=(0,f.forwardRef)((function({label:e,...t},n){const r=NB({focusLoop:!0,rtl:(0,u.isRTL)()});return(0,kt.jsx)(yB.Provider,{value:r,children:(0,kt.jsx)(PB,{ref:n,"aria-label":e,store:r,...t})})}));var IB=(0,f.forwardRef)((function({className:e,label:t,variant:n,...r},o){const i=void 0!==n,s=(0,f.useMemo)((()=>i?{}:{DropdownMenu:{variant:"toolbar"},Dropdown:{variant:"toolbar"},Menu:{variant:"toolbar"}}),[i]);if(!t){Ji()("Using Toolbar without label prop",{since:"5.6",alternative:"ToolbarGroup component",link:"https://developer.wordpress.org/block-editor/components/toolbar/"});const{title:t,...n}=r;return(0,kt.jsx)(EB,{isCollapsed:!1,...n,className:e})}const a=c("components-accessible-toolbar",e,n&&`is-${n}`);return(0,kt.jsx)(xs,{value:s,children:(0,kt.jsx)(DB,{className:a,label:t,ref:o,...r})})}));var RB=(0,f.forwardRef)((function(e,t){return(0,f.useContext)(yB)?(0,kt.jsx)(_B,{ref:t,...e.toggleProps,children:t=>(0,kt.jsx)(CT,{...e,popoverProps:{...e.popoverProps},toggleProps:t})}):(0,kt.jsx)(CT,{...e})}));const OB={columns:e=>Dl("grid-template-columns:",`repeat( ${e}, minmax(0, 1fr) )`,";",""),spacing:Dl("column-gap:",Rl(4),";row-gap:",Rl(4),";",""),item:{fullWidth:{name:"18iuzk9",styles:"grid-column:1/-1"}}},AB={name:"huufmu",styles:">div:not( :first-of-type ){display:none;}"},zB=Dl(OB.item.fullWidth," gap:",Rl(2),";.components-dropdown-menu{margin:",Rl(-1)," 0;line-height:0;}&&&& .components-dropdown-menu__toggle{padding:0;min-width:",Rl(6),";}",""),LB={name:"1pmxm02",styles:"font-size:inherit;font-weight:500;line-height:normal;&&{margin:0;}"},FB=Dl(OB.item.fullWidth,"&>div,&>fieldset{padding-bottom:0;margin-bottom:0;max-width:100%;}&& ",Cy,"{margin-bottom:0;",jy,":last-child{margin-bottom:0;}}",Py,"{margin-bottom:0;}&& ",ex,"{label{line-height:1.4em;}}",""),BB={name:"eivff4",styles:"display:none"},VB={name:"16gsvie",styles:"min-width:200px"},WB=Sl("span",{target:"ews648u0"})("color:",Fl.theme.accentDarker10,";font-size:11px;font-weight:500;line-height:1.4;",kv({marginLeft:Rl(3)})," text-transform:uppercase;"),$B=Dl("color:",Fl.gray[900],";&&[aria-disabled='true']{color:",Fl.gray[700],";opacity:1;&:hover{color:",Fl.gray[700],";}",WB,"{opacity:0.3;}}",""),HB=()=>{},UB=(0,f.createContext)({menuItems:{default:{},optional:{}},hasMenuItems:!1,isResetting:!1,shouldRenderPlaceholderItems:!1,registerPanelItem:HB,deregisterPanelItem:HB,flagItemCustomization:HB,registerResetAllFilter:HB,deregisterResetAllFilter:HB,areAllOptionalControlsHidden:!0});UB.displayName="ToolsPanelContext";const YB=()=>(0,f.useContext)(UB);const GB=({itemClassName:e,items:t,toggleItem:n})=>{if(!t.length)return null;const r=(0,kt.jsx)(WB,{"aria-hidden":!0,children:(0,u.__)("Reset")});return(0,kt.jsx)(kt.Fragment,{children:t.map((([t,o])=>o?(0,kt.jsx)(yA,{className:e,role:"menuitem",label:(0,u.sprintf)((0,u.__)("Reset %s"),t),onClick:()=>{n(t),(0,vw.speak)((0,u.sprintf)((0,u.__)("%s reset to default"),t),"assertive")},suffix:r,children:t},t):(0,kt.jsx)(yA,{icon:tk,className:e,role:"menuitemcheckbox",isSelected:!0,"aria-disabled":!0,children:t},t)))})},qB=({items:e,toggleItem:t})=>e.length?(0,kt.jsx)(kt.Fragment,{children:e.map((([e,n])=>{const r=n?(0,u.sprintf)((0,u.__)("Hide and reset %s"),e):(0,u.sprintf)((0,u._x)("Show %s","input control"),e);return(0,kt.jsx)(yA,{icon:n?tk:null,isSelected:n,label:r,onClick:()=>{n?(0,vw.speak)((0,u.sprintf)((0,u.__)("%s hidden and reset to default"),e),"assertive"):(0,vw.speak)((0,u.sprintf)((0,u.__)("%s is now visible"),e),"assertive"),t(e)},role:"menuitemcheckbox",children:e},e)}))}):null,KB=ul(((e,t)=>{const{areAllOptionalControlsHidden:n,defaultControlsItemClassName:r,dropdownMenuClassName:o,hasMenuItems:i,headingClassName:s,headingLevel:a=2,label:l,menuItems:c,resetAll:d,toggleItem:h,dropdownMenuProps:p,...m}=function(e){const{className:t,headingLevel:n=2,...r}=cl(e,"ToolsPanelHeader"),o=ll(),i=(0,f.useMemo)((()=>o(zB,t)),[t,o]),s=(0,f.useMemo)((()=>o(VB)),[o]),a=(0,f.useMemo)((()=>o(LB)),[o]),l=(0,f.useMemo)((()=>o($B)),[o]),{menuItems:c,hasMenuItems:u,areAllOptionalControlsHidden:d}=YB();return{...r,areAllOptionalControlsHidden:d,defaultControlsItemClassName:l,dropdownMenuClassName:s,hasMenuItems:u,headingClassName:a,headingLevel:n,menuItems:c,className:i}}(e);if(!l)return null;const g=Object.entries(c?.default||{}),v=Object.entries(c?.optional||{}),b=n?Nv:bN,x=(0,u.sprintf)((0,u._x)("%s options","Button label to reveal tool panel options"),l),y=n?(0,u.__)("All options are currently hidden"):void 0,w=[...g,...v].some((([,e])=>e));return(0,kt.jsxs)(ow,{...m,ref:t,children:[(0,kt.jsx)(dj,{level:a,className:s,children:l}),i&&(0,kt.jsx)(CT,{...p,icon:b,label:x,menuProps:{className:o},toggleProps:{size:"small",description:y},children:()=>(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsxs)(bA,{label:l,children:[(0,kt.jsx)(GB,{items:g,toggleItem:h,itemClassName:r}),(0,kt.jsx)(qB,{items:v,toggleItem:h})]}),(0,kt.jsx)(bA,{children:(0,kt.jsx)(yA,{"aria-disabled":!w,variant:"tertiary",onClick:()=>{w&&(d(),(0,vw.speak)((0,u.__)("All options reset"),"assertive"))},children:(0,u.__)("Reset all")})})]})})]})}),"ToolsPanelHeader");var XB=KB;function ZB(){return{panelItems:[],menuItemOrder:[],menuItems:{default:{},optional:{}}}}const QB=({panelItems:e,shouldReset:t,currentMenuItems:n,menuItemOrder:r})=>{const o={default:{},optional:{}},i={default:{},optional:{}};return e.forEach((({hasValue:e,isShownByDefault:r,label:i})=>{const s=r?"default":"optional",a=n?.[s]?.[i],l=a||e();o[s][i]=!t&&l})),r.forEach((e=>{o.default.hasOwnProperty(e)&&(i.default[e]=o.default[e]),o.optional.hasOwnProperty(e)&&(i.optional[e]=o.optional[e])})),Object.keys(o.default).forEach((e=>{i.default.hasOwnProperty(e)||(i.default[e]=o.default[e])})),Object.keys(o.optional).forEach((e=>{i.optional.hasOwnProperty(e)||(i.optional[e]=o.optional[e])})),i};function JB(e,t){const n=function(e,t){switch(t.type){case"REGISTER_PANEL":{const n=[...e],r=n.findIndex((e=>e.label===t.item.label));return-1!==r&&n.splice(r,1),n.push(t.item),n}case"UNREGISTER_PANEL":{const n=e.findIndex((e=>e.label===t.label));if(-1!==n){const t=[...e];return t.splice(n,1),t}return e}default:return e}}(e.panelItems,t),r=function(e,t){return"REGISTER_PANEL"===t.type?e.includes(t.item.label)?e:[...e,t.item.label]:e}(e.menuItemOrder,t),o=function(e,t){switch(t.type){case"REGISTER_PANEL":case"UNREGISTER_PANEL":return QB({currentMenuItems:e.menuItems,panelItems:e.panelItems,menuItemOrder:e.menuItemOrder,shouldReset:!1});case"RESET_ALL":return QB({panelItems:e.panelItems,menuItemOrder:e.menuItemOrder,shouldReset:!0});case"UPDATE_VALUE":{const n=e.menuItems[t.group][t.label];return t.value===n?e.menuItems:{...e.menuItems,[t.group]:{...e.menuItems[t.group],[t.label]:t.value}}}case"TOGGLE_VALUE":{const n=e.panelItems.find((e=>e.label===t.label));if(!n)return e.menuItems;const r=n.isShownByDefault?"default":"optional";return{...e.menuItems,[r]:{...e.menuItems[r],[t.label]:!e.menuItems[r][t.label]}}}default:return e.menuItems}}({panelItems:n,menuItemOrder:r,menuItems:e.menuItems},t);return{panelItems:n,menuItemOrder:r,menuItems:o}}function eV(e,t){switch(t.type){case"REGISTER":return[...e,t.filter];case"UNREGISTER":return e.filter((e=>e!==t.filter));default:return e}}const tV=e=>0===Object.keys(e).length;function nV(e){const{className:t,headingLevel:n=2,resetAll:r,panelId:o,hasInnerWrapper:i=!1,shouldRenderPlaceholderItems:s=!1,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l,...c}=cl(e,"ToolsPanel"),u=(0,f.useRef)(!1),d=u.current;(0,f.useEffect)((()=>{d&&(u.current=!1)}),[d]);const[{panelItems:h,menuItems:p},m]=(0,f.useReducer)(JB,void 0,ZB),[g,v]=(0,f.useReducer)(eV,[]),b=(0,f.useCallback)((e=>{m({type:"REGISTER_PANEL",item:e})}),[]),x=(0,f.useCallback)((e=>{m({type:"UNREGISTER_PANEL",label:e})}),[]),y=(0,f.useCallback)((e=>{v({type:"REGISTER",filter:e})}),[]),w=(0,f.useCallback)((e=>{v({type:"UNREGISTER",filter:e})}),[]),_=(0,f.useCallback)(((e,t,n="default")=>{m({type:"UPDATE_VALUE",group:n,label:t,value:e})}),[]),S=(0,f.useMemo)((()=>tV(p.default)&&!tV(p.optional)&&Object.values(p.optional).every((e=>!e))),[p]),C=ll(),k=(0,f.useMemo)((()=>{const e=i&&Dl(">div:not( :first-of-type ){display:grid;",OB.columns(2)," ",OB.spacing," ",OB.item.fullWidth,";}","");const n=S&&AB;return C((e=>Dl(OB.columns(e)," ",OB.spacing," border-top:",Wl.borderWidth," solid ",Fl.gray[300],";margin-top:-1px;padding:",Rl(4),";",""))(2),e,n,t)}),[S,t,C,i]),j=(0,f.useCallback)((e=>{m({type:"TOGGLE_VALUE",label:e})}),[]),E=(0,f.useCallback)((()=>{"function"==typeof r&&(u.current=!0,r(g)),m({type:"RESET_ALL"})}),[g,r]),M=e=>{const t=p.optional||{},n=e.find((e=>e.isShownByDefault||t[e.label]));return n?.label},N=M(h),T=M([...h].reverse()),P=h.length>0;return{...c,headingLevel:n,panelContext:(0,f.useMemo)((()=>({areAllOptionalControlsHidden:S,deregisterPanelItem:x,deregisterResetAllFilter:w,firstDisplayedItem:N,flagItemCustomization:_,hasMenuItems:P,isResetting:u.current,lastDisplayedItem:T,menuItems:p,panelId:o,registerPanelItem:b,registerResetAllFilter:y,shouldRenderPlaceholderItems:s,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l})),[S,x,w,N,_,T,p,o,P,y,b,s,a,l]),resetAllItems:E,toggleItem:j,className:k}}var rV=ul(((e,t)=>{const{children:n,label:r,panelContext:o,resetAllItems:i,toggleItem:s,headingLevel:a,dropdownMenuProps:l,...c}=nV(e);return(0,kt.jsx)(iE,{...c,columns:2,ref:t,children:(0,kt.jsxs)(UB.Provider,{value:o,children:[(0,kt.jsx)(XB,{label:r,resetAll:i,toggleItem:s,headingLevel:a,dropdownMenuProps:l}),n]})})}),"ToolsPanel");const oV=()=>{};const iV=ul(((e,t)=>{const{children:n,isShown:r,shouldRenderPlaceholder:o,...i}=function(e){const{className:t,hasValue:n,isShownByDefault:r=!1,label:o,panelId:i,resetAllFilter:s=oV,onDeselect:a,onSelect:l,...c}=cl(e,"ToolsPanelItem"),{panelId:u,menuItems:h,registerResetAllFilter:p,deregisterResetAllFilter:m,registerPanelItem:g,deregisterPanelItem:v,flagItemCustomization:b,isResetting:x,shouldRenderPlaceholderItems:y,firstDisplayedItem:w,lastDisplayedItem:_,__experimentalFirstVisibleItemClass:S,__experimentalLastVisibleItemClass:C}=YB(),k=(0,f.useCallback)(n,[i]),j=(0,f.useCallback)(s,[i]),E=(0,d.usePrevious)(u),M=u===i||null===u;(0,f.useLayoutEffect)((()=>(M&&null!==E&&g({hasValue:k,isShownByDefault:r,label:o,panelId:i}),()=>{(null===E&&u||u===i)&&v(o)})),[u,M,r,o,k,i,E,g,v]),(0,f.useEffect)((()=>(M&&p(j),()=>{M&&m(j)})),[p,m,j,M]);const N=r?"default":"optional",T=h?.[N]?.[o],P=(0,d.usePrevious)(T),D=void 0!==h?.[N]?.[o],I=n();(0,f.useEffect)((()=>{(r||I)&&b(I,o,N)}),[I,N,o,b,r]),(0,f.useEffect)((()=>{D&&!x&&M&&(!T||I||P||l?.(),!T&&I&&P&&a?.())}),[M,T,D,x,I,P,l,a]);const R=r?void 0!==h?.[N]?.[o]:T,O=ll(),A=(0,f.useMemo)((()=>{const e=y&&!R;return O(FB,e&&BB,!e&&t,w===o&&S,_===o&&C)}),[R,y,t,O,w,_,S,C,o]);return{...c,isShown:R,shouldRenderPlaceholder:y,className:A}}(e);return r?(0,kt.jsx)(kl,{...i,ref:t,children:n}):o?(0,kt.jsx)(kl,{...i,ref:t}):null}),"ToolsPanelItem");var sV=iV;const aV=(0,f.createContext)(void 0);aV.displayName="RovingTabIndexContext";const lV=aV.Provider;function cV({children:e}){const[t,n]=(0,f.useState)(),r=(0,f.useMemo)((()=>({lastFocusedElement:t,setLastFocusedElement:n})),[t]);return(0,kt.jsx)(lV,{value:r,children:e})}function uV(e){return pT.focus.focusable.find(e,{sequential:!0}).filter((t=>t.closest('[role="row"]')===e))}const dV=(0,f.forwardRef)((function({children:e,onExpandRow:t=()=>{},onCollapseRow:n=()=>{},onFocusRow:r=()=>{},applicationAriaLabel:o,...i},s){const a=(0,f.useCallback)((e=>{const{keyCode:o,metaKey:i,ctrlKey:s,altKey:a}=e;if(i||s||a||![bw.UP,bw.DOWN,bw.LEFT,bw.RIGHT,bw.HOME,bw.END].includes(o))return;e.stopPropagation();const{activeElement:l}=document,{currentTarget:c}=e;if(!l||!c.contains(l))return;const u=l.closest('[role="row"]');if(!u)return;const d=uV(u),f=d.indexOf(l),h=0===f,p=h&&("false"===u.getAttribute("data-expanded")||"false"===u.getAttribute("aria-expanded"))&&o===bw.RIGHT;if([bw.LEFT,bw.RIGHT].includes(o)){let r;if(r=o===bw.LEFT?Math.max(0,f-1):Math.min(f+1,d.length-1),h){if(o===bw.LEFT){var m;if("true"===u.getAttribute("data-expanded")||"true"===u.getAttribute("aria-expanded"))return n(u),void e.preventDefault();const t=Math.max(parseInt(null!==(m=u?.getAttribute("aria-level"))&&void 0!==m?m:"1",10)-1,1),r=Array.from(c.querySelectorAll('[role="row"]'));let o=u;for(let e=r.indexOf(u);e>=0;e--){const n=r[e].getAttribute("aria-level");if(null!==n&&parseInt(n,10)===t){o=r[e];break}}uV(o)?.[0]?.focus()}if(o===bw.RIGHT){if("false"===u.getAttribute("data-expanded")||"false"===u.getAttribute("aria-expanded"))return t(u),void e.preventDefault();const n=uV(u);n.length>0&&n[r]?.focus()}return void e.preventDefault()}if(p)return;d[r].focus(),e.preventDefault()}else if([bw.UP,bw.DOWN].includes(o)){const t=Array.from(c.querySelectorAll('[role="row"]')),n=t.indexOf(u);let i;if(i=o===bw.UP?Math.max(0,n-1):Math.min(n+1,t.length-1),i===n)return void e.preventDefault();const s=uV(t[i]);if(!s||!s.length)return void e.preventDefault();s[Math.min(f,s.length-1)].focus(),r(e,u,t[i]),e.preventDefault()}else if([bw.HOME,bw.END].includes(o)){const t=Array.from(c.querySelectorAll('[role="row"]')),n=t.indexOf(u);let i;if(i=o===bw.HOME?0:t.length-1,i===n)return void e.preventDefault();const s=uV(t[i]);if(!s||!s.length)return void e.preventDefault();s[Math.min(f,s.length-1)].focus(),r(e,u,t[i]),e.preventDefault()}}),[t,n,r]);return(0,kt.jsx)(cV,{children:(0,kt.jsx)("div",{role:"application","aria-label":o,children:(0,kt.jsx)("table",{...i,role:"treegrid",onKeyDown:a,ref:s,children:(0,kt.jsx)("tbody",{children:e})})})})}));var fV=dV;const hV=(0,f.forwardRef)((function({children:e,as:t,...n},r){const o=(0,f.useRef)(),i=r||o,{lastFocusedElement:s,setLastFocusedElement:a}=(0,f.useContext)(aV);let l;s&&(l=s===("current"in i?i.current:void 0)?0:-1);const c={ref:i,tabIndex:l,onFocus:e=>a?.(e.target),...n};return"function"==typeof e?e(c):t?(0,kt.jsx)(t,{...c,children:e}):null}));var pV=hV;var mV=(0,f.forwardRef)((function({children:e,...t},n){return(0,kt.jsx)(pV,{ref:n,...t,children:e})}));var gV=(0,f.forwardRef)((function({children:e,withoutGridItem:t=!1,...n},r){return(0,kt.jsx)("td",{...n,role:"gridcell",children:t?(0,kt.jsx)(kt.Fragment,{children:"function"==typeof e?e({...n,ref:r}):e}):(0,kt.jsx)(mV,{ref:r,children:e})})}));var vV=(0,f.forwardRef)((function({children:e,level:t,positionInSet:n,setSize:r,isExpanded:o,...i},s){return(0,kt.jsx)("tr",{...i,ref:s,role:"row","aria-level":t,"aria-posinset":n,"aria-setsize":r,"aria-expanded":o,children:e})}));function bV(e){e.stopPropagation()}var xV=(0,f.forwardRef)(((e,t)=>(Ji()("wp.components.IsolatedEventContainer",{since:"5.7"}),(0,kt.jsx)("div",{...e,ref:t,onMouseDown:bV}))));function yV(e){const t=(0,f.useContext)(zw);return(0,d.useObservableValue)(t.fills,e)}const wV=Sl("div",{target:"ebn2ljm1"})("&:not( :first-of-type ){",(({offsetAmount:e})=>Dl({marginInlineStart:e},"","")),";}",(({zIndex:e})=>Dl({zIndex:e},"","")),";");var _V={name:"rs0gp6",styles:"grid-row-start:1;grid-column-start:1"};const SV=Sl("div",{target:"ebn2ljm0"})("display:inline-grid;grid-auto-flow:column;position:relative;&>",wV,"{position:relative;justify-self:start;",(({isLayered:e})=>e?_V:void 0),";}");const CV=ul((function(e,t){const{children:n,className:r,isLayered:o=!0,isReversed:i=!1,offset:s=0,...a}=cl(e,"ZStack"),l=nw(n),c=l.length-1,u=l.map(((e,t)=>{const n=i?c-t:t,r=o?s*t:s,a=(0,f.isValidElement)(e)?e.key:t;return(0,kt.jsx)(wV,{offsetAmount:r,zIndex:n,children:e},a)}));return(0,kt.jsx)(SV,{...a,className:r,isLayered:o,ref:t,children:u})}),"ZStack");var kV=CV;const jV={previous:[{modifier:"ctrlShift",character:"`"},{modifier:"ctrlShift",character:"~"},{modifier:"access",character:"p"}],next:[{modifier:"ctrl",character:"`"},{modifier:"access",character:"n"}]};function EV(e=jV){const t=(0,f.useRef)(null),[n,r]=(0,f.useState)(!1);function o(e){var n;const o=Array.from(null!==(n=t.current?.querySelectorAll('[role="region"][tabindex="-1"]'))&&void 0!==n?n:[]);if(!o.length)return;let i=o[0];const s=t.current?.ownerDocument?.activeElement?.closest('[role="region"][tabindex="-1"]'),a=s?o.indexOf(s):-1;if(-1!==a){let t=a+e;t=-1===t?o.length-1:t,t=t===o.length?0:t,i=o[t]}i.focus(),r(!0)}const i=(0,d.useRefEffect)((e=>{function t(){r(!1)}return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}),[r]);return{ref:(0,d.useMergeRefs)([t,i]),className:n?"is-focusing-regions":"",onKeyDown(t){e.previous.some((({modifier:e,character:n})=>bw.isKeyboardEvent[e](t,n)))?o(-1):e.next.some((({modifier:e,character:n})=>bw.isKeyboardEvent[e](t,n)))&&o(1)}}}var MV=(0,d.createHigherOrderComponent)((e=>({shortcuts:t,...n})=>(0,kt.jsx)("div",{...EV(t),children:(0,kt.jsx)(e,{...n})})),"navigateRegions");var NV=(0,d.createHigherOrderComponent)((e=>function(t){const n=(0,d.useConstrainedTabbing)();return(0,kt.jsx)("div",{ref:n,tabIndex:-1,children:(0,kt.jsx)(e,{...t})})}),"withConstrainedTabbing"),TV=e=>(0,d.createHigherOrderComponent)((t=>class extends f.Component{constructor(e){super(e),this.nodeRef=this.props.node,this.state={fallbackStyles:void 0,grabStylesCompleted:!1},this.bindRef=this.bindRef.bind(this)}bindRef(e){e&&(this.nodeRef=e)}componentDidMount(){this.grabFallbackStyles()}componentDidUpdate(){this.grabFallbackStyles()}grabFallbackStyles(){const{grabStylesCompleted:t,fallbackStyles:n}=this.state;if(this.nodeRef&&!t){const t=e(this.nodeRef,this.props);hs()(t,n)||this.setState({fallbackStyles:t,grabStylesCompleted:Object.values(t).every(Boolean)})}}render(){const e=(0,kt.jsx)(t,{...this.props,...this.state.fallbackStyles});return this.props.node?e:(0,kt.jsxs)("div",{ref:this.bindRef,children:[" ",e," "]})}}),"withFallbackStyles");const PV=window.wp.hooks,DV=16;function IV(e){return(0,d.createHigherOrderComponent)((t=>{const n="core/with-filters/"+e;let r;class o extends f.Component{constructor(n){super(n),void 0===r&&(r=(0,PV.applyFilters)(e,t))}componentDidMount(){o.instances.push(this),1===o.instances.length&&((0,PV.addAction)("hookRemoved",n,s),(0,PV.addAction)("hookAdded",n,s))}componentWillUnmount(){o.instances=o.instances.filter((e=>e!==this)),0===o.instances.length&&((0,PV.removeAction)("hookRemoved",n),(0,PV.removeAction)("hookAdded",n))}render(){return(0,kt.jsx)(r,{...this.props})}}o.instances=[];const i=(0,d.debounce)((()=>{r=(0,PV.applyFilters)(e,t),o.instances.forEach((e=>{e.forceUpdate()}))}),DV);function s(t){t===e&&i()}return o}),"withFilters")}var RV=(0,d.createHigherOrderComponent)((e=>{const t=({onFocusReturn:e}={})=>t=>n=>{const r=(0,d.useFocusReturn)(e);return(0,kt.jsx)("div",{ref:r,children:(0,kt.jsx)(t,{...n})})};if((n=e)instanceof f.Component||"function"==typeof n){const n=e;return t()(n)}var n;return t(e)}),"withFocusReturn");const OV=({children:e})=>(Ji()("wp.components.FocusReturnProvider component",{since:"5.7",hint:"This provider is not used anymore. You can just remove it from your codebase"}),e);var AV=(0,d.createHigherOrderComponent)((e=>{function t(t,r){const[o,i]=(0,f.useState)([]),s=(0,f.useMemo)((()=>{const e=e=>{const t=e.id?e:{...e,id:Zw()};i((e=>[...e,t]))};return{createNotice:e,createErrorNotice:t=>{e({status:"error",content:t})},removeNotice:e=>{i((t=>t.filter((t=>t.id!==e))))},removeAllNotices:()=>{i([])}}}),[]),a={...t,noticeList:o,noticeOperations:s,noticeUI:o.length>0&&(0,kt.jsx)(uL,{className:"components-with-notices-ui",notices:o,onRemove:s.removeNotice})};return n?(0,kt.jsx)(e,{...a,ref:r}):(0,kt.jsx)(e,{...a})}let n;const{render:r}=e;return"function"==typeof r?(n=!0,(0,f.forwardRef)(t)):t}),"withNotices"),zV=Tt([At,Sr],[zt,Cr]),LV=zV.useContext,FV=zV.useScopedContext,BV=zV.useProviderContext,VV=zV.ContextProvider,WV=zV.ScopedContextProvider,$V=(0,$.createContext)(void 0),HV=Tt([At],[zt]),UV=HV.useContext,YV=HV.useScopedContext;HV.useProviderContext,HV.ContextProvider,HV.ScopedContextProvider,(0,$.createContext)(void 0);function GV(e={}){var t=e,{combobox:n,parent:r,menubar:o}=t,i=D(t,["combobox","parent","menubar"]);const s=!!o&&!r,a=Je(i.store,function(e,...t){if(e)return Ue(e,"pick")(...t)}(r,["values"]),Qe(n,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"])),l=a.getState(),c=vt(P(T({},i),{store:a,orientation:W(i.orientation,l.orientation,"vertical")})),u=or(P(T({},i),{store:a,placement:W(i.placement,l.placement,"bottom-start"),timeout:W(i.timeout,l.timeout,s?0:150),hideTimeout:W(i.hideTimeout,l.hideTimeout,0)})),d=Ye(P(T(T({},c.getState()),u.getState()),{initialFocus:W(l.initialFocus,"container"),values:W(i.values,l.values,i.defaultValues,{})}),c,u,a);return Ge(d,(()=>Xe(d,["mounted"],(e=>{e.mounted||d.setState("activeId",null)})))),Ge(d,(()=>Xe(r,["orientation"],(e=>{d.setState("placement","vertical"===e.orientation?"right-start":"bottom-start")})))),P(T(T(T({},c),u),d),{combobox:n,parent:r,menubar:o,hideAll:()=>{u.hide(),null==r||r.hideAll()},setInitialFocus:e=>d.setState("initialFocus",e),setValues:e=>d.setState("values",e),setValue:(e,t)=>{"__proto__"!==e&&"constructor"!==e&&(Array.isArray(e)||d.setState("values",(n=>{const r=n[e],o=R(t,r);return o===r?n:P(T({},n),{[e]:void 0!==o&&o})})))}})}function qV(e={}){const t=LV(),n=UV(),r=kP();e=w(y({},e),{parent:void 0!==e.parent?e.parent:t,menubar:void 0!==e.menubar?e.menubar:n,combobox:void 0!==e.combobox?e.combobox:r});const[o,i]=st(GV,e);return function(e,t,n){return Ie(t,[n.combobox,n.parent,n.menubar]),it(e,n,"values","setValues"),Object.assign(nr(xt(e,t,n),t,n),{combobox:n.combobox,parent:n.parent,menubar:n.menubar})}(o,i,e)}const KV=(0,f.createContext)(void 0);KV.displayName="MenuContext";var XV=Nt((function(e){var t=e,{store:n,hideOnClick:r=!0,preventScrollOnKeyDown:o=!0,focusOnHover:i,blurOnHoverEnd:s}=t,a=_(t,["store","hideOnClick","preventScrollOnKeyDown","focusOnHover","blurOnHoverEnd"]);const l=FV(!0),c=YV();L(n=n||l||c,!1);const u=a.onClick,d=Oe(r),f="hideAll"in n?n.hideAll:void 0,h=!!f,p=Me((e=>{if(null==u||u(e),e.defaultPrevented)return;if(ge(e))return;if(me(e))return;if(!f)return;"menu"!==e.currentTarget.getAttribute("aria-haspopup")&&d(e)&&f()})),m=ae(rt(n,(e=>"contentElement"in e?e.contentElement:null)),"menuitem");return a=w(y({role:m},a),{onClick:p}),a=An(y({store:n,preventScrollOnKeyDown:o},a)),a=En(w(y({store:n},a),{focusOnHover(e){if(!n)return!1;if(!("function"==typeof i?i(e):null==i||i))return!1;const{baseElement:t,items:r}=n.getState();return h?(e.currentTarget.hasAttribute("aria-expanded")&&e.currentTarget.focus(),!0):!!function(e,t,n){var r;if(!e)return!1;if(Xt(e))return!0;const o=null==t?void 0:t.find((e=>{var t;return e.element!==n&&"true"===(null==(t=e.element)?void 0:t.getAttribute("aria-expanded"))})),i=null==(r=null==o?void 0:o.element)?void 0:r.getAttribute("aria-controls");if(!i)return!1;const s=X(e).getElementById(i);return!(!s||!Xt(s)&&!s.querySelector("[role=menuitem][aria-expanded=true]"))}(t,r,e.currentTarget)&&(e.currentTarget.focus(),!0)},blurOnHoverEnd:e=>"function"==typeof s?s(e):null!=s?s:h})),a})),ZV=Et(jt((function(e){return Mt("div",XV(e))}))),QV=Tt(),JV=QV.useContext,eW=(QV.useScopedContext,QV.useProviderContext,QV.ContextProvider,QV.ScopedContextProvider,"input");function tW(e,t){t?e.indeterminate=!0:e.indeterminate&&(e.indeterminate=!1)}function nW(e){return Array.isArray(e)?e.toString():e}var rW=Nt((function(e){var t=e,{store:n,name:r,value:o,checked:i,defaultChecked:s}=t,a=_(t,["store","name","value","checked","defaultChecked"]);const l=JV();n=n||l;const[c,u]=(0,$.useState)(null!=s&&s),d=rt(n,(e=>{if(void 0!==i)return i;if(void 0===(null==e?void 0:e.value))return c;if(null!=o){if(Array.isArray(e.value)){const t=nW(o);return e.value.includes(t)}return e.value===o}return!Array.isArray(e.value)&&("boolean"==typeof e.value&&e.value)})),f=(0,$.useRef)(null),h=function(e,t){return"input"===e&&(!t||"checkbox"===t)}(De(f,eW),a.type),p=d?"mixed"===d:void 0,m="mixed"!==d&&d,g=B(a),[v,b]=Re();(0,$.useEffect)((()=>{const e=f.current;e&&(tW(e,p),h||(e.checked=m,void 0!==r&&(e.name=r),void 0!==o&&(e.value=`${o}`)))}),[v,p,h,m,r,o]);const x=a.onChange,S=Me((e=>{if(g)return e.stopPropagation(),void e.preventDefault();if(tW(e.currentTarget,p),h||(e.currentTarget.checked=!e.currentTarget.checked,b()),null==x||x(e),e.defaultPrevented)return;const t=e.currentTarget.checked;u(t),null==n||n.setValue((e=>{if(null==o)return t;const n=nW(o);return Array.isArray(e)?t?e.includes(n)?e:[...e,n]:e.filter((e=>e!==n)):e!==n&&n}))})),C=a.onClick,k=Me((e=>{null==C||C(e),e.defaultPrevented||h||S(e)}));return a=Ae(a,(e=>(0,kt.jsx)(rD.Provider,{value:m,children:e})),[m]),a=w(y({role:h?void 0:"checkbox",type:h?"checkbox":void 0,"aria-checked":d},a),{ref:Te(f,a.ref),onChange:S,onClick:k}),a=In(y({clickOnEnter:!h},a)),V(y({name:h?r:void 0,value:h?o:void 0,checked:m},a))}));jt((function(e){const t=rW(e);return Mt(eW,t)}));function oW(e={}){var t;e.store;const n=null==(t=e.store)?void 0:t.getState(),r=Ye({value:W(e.value,null==n?void 0:n.value,e.defaultValue,!1)},e.store);return P(T({},r),{setValue:e=>r.setState("value",e)})}function iW(e={}){const[t,n]=st(oW,e);return function(e,t,n){return Ie(t,[n.store]),it(e,n,"value","setValue"),e}(t,n,e)}function sW(e,t,n){if(void 0===t)return Array.isArray(e)?e:!!n;const r=function(e){return Array.isArray(e)?e.toString():e}(t);return Array.isArray(e)?n?e.includes(r)?e:[...e,r]:e.filter((e=>e!==r)):n?r:e!==r&&e}var aW=Nt((function(e){var t=e,{store:n,name:r,value:o,checked:i,defaultChecked:s,hideOnClick:a=!1}=t,l=_(t,["store","name","value","checked","defaultChecked","hideOnClick"]);const c=FV();L(n=n||c,!1);const u=je(s);(0,$.useEffect)((()=>{null==n||n.setValue(r,((e=[])=>u?sW(e,o,!0):e))}),[n,r,o,u]),(0,$.useEffect)((()=>{void 0!==i&&(null==n||n.setValue(r,(e=>sW(e,o,i))))}),[n,r,o,i]);const d=iW({value:n.useState((e=>e.values[r])),setValue(e){null==n||n.setValue(r,(()=>{if(void 0===i)return e;const t=sW(e,o,i);return Array.isArray(t)&&Array.isArray(e)&&function(e,t){if(e===t)return!0;if(!e)return!1;if(!t)return!1;if("object"!=typeof e)return!1;if("object"!=typeof t)return!1;const n=Object.keys(e),r=Object.keys(t),{length:o}=n;if(r.length!==o)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}(e,t)?e:t}))}});return l=y({role:"menuitemcheckbox"},l),l=rW(y({store:d,name:r,value:o,checked:i},l)),l=XV(y({store:n,hideOnClick:a},l))})),lW=Et(jt((function(e){return Mt("div",aW(e))})));function cW(e,t,n){return void 0===n?e:n?t:e}var uW=Nt((function(e){var t=e,{store:n,name:r,value:o,checked:i,onChange:s,hideOnClick:a=!1}=t,l=_(t,["store","name","value","checked","onChange","hideOnClick"]);const c=FV();L(n=n||c,!1);const u=je(l.defaultChecked);(0,$.useEffect)((()=>{null==n||n.setValue(r,((e=!1)=>cW(e,o,u)))}),[n,r,o,u]),(0,$.useEffect)((()=>{void 0!==i&&(null==n||n.setValue(r,(e=>cW(e,o,i))))}),[n,r,o,i]);const d=n.useState((e=>e.values[r]===o));return l=Ae(l,(e=>(0,kt.jsx)($V.Provider,{value:!!d,children:e})),[d]),l=y({role:"menuitemradio"},l),l=gS(y({name:r,value:o,checked:d,onChange(e){if(null==s||s(e),e.defaultPrevented)return;const t=e.currentTarget;null==n||n.setValue(r,(e=>cW(e,o,null!=i?i:t.checked)))}},l)),l=XV(y({store:n,hideOnClick:a},l))})),dW=Et(jt((function(e){return Mt("div",uW(e))}))),fW=Nt((function(e){return e=bn(e)})),hW=jt((function(e){return Mt("div",fW(e))})),pW=Nt((function(e){return e=_n(e)})),mW=jt((function(e){return Mt("div",pW(e))})),gW=Nt((function(e){var t=e,{store:n}=t,r=_(t,["store"]);const o=Rt();L(n=n||o,!1);const i=n.useState((e=>"horizontal"===e.orientation?"vertical":"horizontal"));return r=ZM(w(y({},r),{orientation:i}))})),vW=(jt((function(e){return Mt("hr",gW(e))})),Nt((function(e){var t=e,{store:n}=t,r=_(t,["store"]);const o=LV();return r=gW(y({store:n=n||o},r))}))),bW=jt((function(e){return Mt("hr",vW(e))}));const xW=.82,yW=.9,wW={IN:"400ms",OUT:"200ms"},_W="cubic-bezier(0.33, 0, 0, 1)",SW=Rl(1),CW=Rl(2),kW=Rl(3),jW=Fl.theme.gray[300],EW=Fl.theme.gray[200],MW=Fl.theme.gray[700],NW=Fl.theme.gray[100],TW=Fl.theme.foreground,PW=`0 0 0 ${Wl.borderWidth} ${jW}, ${Wl.elevationMedium}`,DW=`0 0 0 ${Wl.borderWidth} ${TW}`,IW="minmax( 0, max-content ) 1fr",RW=Sl("div",{target:"e1wg7tti14"})("position:relative;background-color:",Fl.ui.background,";border-radius:",Wl.radiusMedium,";",(e=>Dl("box-shadow:","toolbar"===e.variant?DW:PW,";",""))," overflow:hidden;@media not ( prefers-reduced-motion ){transition-property:transform,opacity;transition-timing-function:",_W,";transition-duration:",wW.IN,";will-change:transform,opacity;opacity:0;&:has( [data-enter] ){opacity:1;}&:has( [data-leave] ){transition-duration:",wW.OUT,";}&:has( [data-side='bottom'] ),&:has( [data-side='top'] ){transform:scaleY( ",xW," );}&:has( [data-side='bottom'] ){transform-origin:top;}&:has( [data-side='top'] ){transform-origin:bottom;}&:has( [data-enter][data-side='bottom'] ),&:has( [data-enter][data-side='top'] ),&:has( [data-leave][data-side='bottom'] ),&:has( [data-leave][data-side='top'] ){transform:scaleY( 1 );}}"),OW=Sl("div",{target:"e1wg7tti13"})("position:relative;z-index:1000000;display:grid;grid-template-columns:",IW,";grid-template-rows:auto;box-sizing:border-box;min-width:160px;max-width:320px;max-height:var( --popover-available-height );padding:",SW,";overscroll-behavior:contain;overflow:auto;outline:2px solid transparent!important;@media not ( prefers-reduced-motion ){transition:inherit;transform-origin:inherit;&[data-side='bottom'],&[data-side='top']{transform:scaleY(\n\t\t\t\tcalc(\n\t\t\t\t\t1 / ",xW," *\n\t\t\t\t\t\t",yW,"\n\t\t\t\t)\n\t\t\t);}&[data-enter][data-side='bottom'],&[data-enter][data-side='top'],&[data-leave][data-side='bottom'],&[data-leave][data-side='top']{transform:scaleY( 1 );}}"),AW=Dl("all:unset;position:relative;min-height:",Rl(10),";box-sizing:border-box;grid-column:1/-1;display:grid;grid-template-columns:",IW,";align-items:center;@supports ( grid-template-columns: subgrid ){grid-template-columns:subgrid;}font-size:",_y("default.fontSize"),";font-family:inherit;font-weight:normal;line-height:20px;color:",Fl.theme.foreground,";border-radius:",Wl.radiusSmall,";padding-block:",CW,";padding-inline:",kW,";scroll-margin:",SW,";user-select:none;outline:none;&[aria-disabled='true']{color:",Fl.ui.textDisabled,";cursor:not-allowed;}&[data-active-item]:not( [data-focus-visible] ):not(\n\t\t\t[aria-disabled='true']\n\t\t){background-color:",Fl.theme.accent,";color:",Fl.theme.accentInverted,";}&[data-focus-visible]{box-shadow:0 0 0 1.5px ",Fl.theme.accent,";outline:2px solid transparent;}&:active,&[data-active]{}",OW,':not(:focus) &:not(:focus)[aria-expanded="true"]{background-color:',NW,";color:",Fl.theme.foreground,";}svg{fill:currentColor;}",""),zW=Sl(ZV,{target:"e1wg7tti12"})(AW,";"),LW=Sl(lW,{target:"e1wg7tti11"})(AW,";"),FW=Sl(dW,{target:"e1wg7tti10"})(AW,";"),BW=Sl("span",{target:"e1wg7tti9"})("grid-column:1;",LW,">&,",FW,">&{min-width:",Rl(6),";}",LW,">&,",FW,">&,&:not( :empty ){margin-inline-end:",Rl(2),";}display:flex;align-items:center;justify-content:center;color:",MW,";[data-active-item]:not( [data-focus-visible] )>&,[aria-disabled='true']>&{color:inherit;}"),VW=Sl("div",{target:"e1wg7tti8"})("grid-column:2;display:flex;align-items:center;justify-content:space-between;gap:",Rl(3),";pointer-events:none;"),WW=Sl("div",{target:"e1wg7tti7"})("flex:1;display:inline-flex;flex-direction:column;gap:",Rl(1),";"),$W=Sl("span",{target:"e1wg7tti6"})("flex:0 1 fit-content;min-width:0;width:fit-content;display:flex;align-items:center;justify-content:center;gap:",Rl(3),";color:",MW,";[data-active-item]:not( [data-focus-visible] ) *:not(",OW,") &,[aria-disabled='true'] *:not(",OW,") &{color:inherit;}"),HW=Sl(hW,{target:"e1wg7tti5"})({name:"49aokf",styles:"display:contents"}),UW=Sl(mW,{target:"e1wg7tti4"})("grid-column:1/-1;padding-block-start:",Rl(3),";padding-block-end:",Rl(2),";padding-inline:",kW,";"),YW=Sl(bW,{target:"e1wg7tti3"})("grid-column:1/-1;border:none;height:",Wl.borderWidth,";background-color:",(e=>"toolbar"===e.variant?TW:EW),";margin-block:",Rl(2),";margin-inline:",kW,";outline:2px solid transparent;"),GW=Sl(Vy,{target:"e1wg7tti2"})("width:",Rl(1.5),";",kv({transform:"scaleX(1)"},{transform:"scaleX(-1)"}),";"),qW=Sl(cj,{target:"e1wg7tti1"})("font-size:",_y("default.fontSize"),";line-height:20px;color:inherit;"),KW=Sl(cj,{target:"e1wg7tti0"})("font-size:",_y("helpText.fontSize"),";line-height:16px;color:",MW,";overflow-wrap:anywhere;[data-active-item]:not( [data-focus-visible] ) *:not( ",OW," ) &,[aria-disabled='true'] *:not( ",OW," ) &{color:inherit;}"),XW=(0,f.forwardRef)((function({prefix:e,suffix:t,children:n,disabled:r=!1,hideOnClick:o=!0,store:i,...s},a){const l=(0,f.useContext)(KV);if(!l?.store)throw new Error("Menu.Item can only be rendered inside a Menu component");const c=null!=i?i:l.store;return(0,kt.jsxs)(zW,{ref:a,...s,accessibleWhenDisabled:!0,disabled:r,hideOnClick:o,store:c,children:[(0,kt.jsx)(BW,{children:e}),(0,kt.jsxs)(VW,{children:[(0,kt.jsx)(WW,{children:n}),t&&(0,kt.jsx)($W,{children:t})]})]})}));var ZW=Nt((function(e){var t=e,{store:n,checked:r}=t,o=_(t,["store","checked"]);const i=(0,$.useContext)($V);return r=null!=r?r:i,o=iD(w(y({},o),{checked:r}))})),QW=jt((function(e){return Mt("span",ZW(e))}));const JW=(0,f.forwardRef)((function({suffix:e,children:t,disabled:n=!1,hideOnClick:r=!1,...o},i){const s=(0,f.useContext)(KV);if(!s?.store)throw new Error("Menu.CheckboxItem can only be rendered inside a Menu component");return(0,kt.jsxs)(LW,{ref:i,...o,accessibleWhenDisabled:!0,disabled:n,hideOnClick:r,store:s.store,children:[(0,kt.jsx)(QW,{store:s.store,render:(0,kt.jsx)(BW,{}),style:{width:"auto",height:"auto"},children:(0,kt.jsx)(JS,{icon:tk,size:24})}),(0,kt.jsxs)(VW,{children:[(0,kt.jsx)(WW,{children:t}),e&&(0,kt.jsx)($W,{children:e})]})]})})),e$=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Circle,{cx:12,cy:12,r:3})}),t$=(0,f.forwardRef)((function({suffix:e,children:t,disabled:n=!1,hideOnClick:r=!1,...o},i){const s=(0,f.useContext)(KV);if(!s?.store)throw new Error("Menu.RadioItem can only be rendered inside a Menu component");return(0,kt.jsxs)(FW,{ref:i,...o,accessibleWhenDisabled:!0,disabled:n,hideOnClick:r,store:s.store,children:[(0,kt.jsx)(QW,{store:s.store,render:(0,kt.jsx)(BW,{}),style:{width:"auto",height:"auto"},children:(0,kt.jsx)(JS,{icon:e$,size:24})}),(0,kt.jsxs)(VW,{children:[(0,kt.jsx)(WW,{children:t}),e&&(0,kt.jsx)($W,{children:e})]})]})})),n$=(0,f.forwardRef)((function(e,t){const n=(0,f.useContext)(KV);if(!n?.store)throw new Error("Menu.Group can only be rendered inside a Menu component");return(0,kt.jsx)(HW,{ref:t,...e,store:n.store})})),r$=(0,f.forwardRef)((function(e,t){const n=(0,f.useContext)(KV);if(!n?.store)throw new Error("Menu.GroupLabel can only be rendered inside a Menu component");return(0,kt.jsx)(UW,{ref:t,render:(0,kt.jsx)(Rb,{upperCase:!0,variant:"muted",size:"11px",weight:500,lineHeight:"16px"}),...e,store:n.store})})),o$=(0,f.forwardRef)((function(e,t){const n=(0,f.useContext)(KV);if(!n?.store)throw new Error("Menu.Separator can only be rendered inside a Menu component");return(0,kt.jsx)(YW,{ref:t,...e,store:n.store,variant:n.variant})})),i$=(0,f.forwardRef)((function(e,t){const n=(0,f.useContext)(KV);if(!n?.store)throw new Error("Menu.ItemLabel can only be rendered inside a Menu component");return(0,kt.jsx)(qW,{numberOfLines:1,ref:t,...e})})),s$=(0,f.forwardRef)((function(e,t){const n=(0,f.useContext)(KV);if(!n?.store)throw new Error("Menu.ItemHelpText can only be rendered inside a Menu component");return(0,kt.jsx)(KW,{numberOfLines:2,ref:t,...e})}));function a$(e,t){return!!(null==e?void 0:e.some((e=>!!e.element&&(e.element!==t&&"true"===e.element.getAttribute("aria-expanded")))))}var l$=Nt((function(e){var t=e,{store:n,focusable:r,accessibleWhenDisabled:o,showOnHover:i}=t,s=_(t,["store","focusable","accessibleWhenDisabled","showOnHover"]);const a=BV();L(n=n||a,!1);const l=(0,$.useRef)(null),c=n.parent,u=n.menubar,d=!!c,f=!!u&&!d,h=B(s),p=()=>{const e=l.current;e&&(null==n||n.setDisclosureElement(e),null==n||n.setAnchorElement(e),null==n||n.show())},m=s.onFocus,g=Me((e=>{if(null==m||m(e),h)return;if(e.defaultPrevented)return;if(null==n||n.setAutoFocusOnShow(!1),null==n||n.setActiveId(null),!u)return;if(!f)return;const{items:t}=u.getState();a$(t,e.currentTarget)&&p()})),v=rt(n,(e=>e.placement.split("-")[0])),b=s.onKeyDown,x=Me((e=>{if(null==b||b(e),h)return;if(e.defaultPrevented)return;const t=function(e,t){return{ArrowDown:("bottom"===t||"top"===t)&&"first",ArrowUp:("bottom"===t||"top"===t)&&"last",ArrowRight:"right"===t&&"first",ArrowLeft:"left"===t&&"first"}[e.key]}(e,v);t&&(e.preventDefault(),p(),null==n||n.setAutoFocusOnShow(!0),null==n||n.setInitialFocus(t))})),S=s.onClick,C=Me((e=>{if(null==S||S(e),e.defaultPrevented)return;if(!n)return;const t=!e.detail,{open:r}=n.getState();r&&!t||(d&&!t||n.setAutoFocusOnShow(!0),n.setInitialFocus(t?"first":"container")),d&&p()}));s=Ae(s,(e=>(0,kt.jsx)(VV,{value:n,children:e})),[n]),d&&(s=w(y({},s),{render:(0,kt.jsx)(ar.div,{render:s.render})}));const k=Pe(s.id),j=rt((null==c?void 0:c.combobox)||c,"contentElement"),E=d||f?ae(j,"menuitem"):void 0,M=n.useState("contentElement");return s=w(y({id:k,role:E,"aria-haspopup":se(M,"menu")},s),{ref:Te(l,s.ref),onFocus:g,onKeyDown:x,onClick:C}),s=kr(w(y({store:n,focusable:r,accessibleWhenDisabled:o},s),{showOnHover:e=>{if(!(()=>{if("function"==typeof i)return i(e);if(null!=i)return i;if(d)return!0;if(!u)return!1;const{items:t}=u.getState();return f&&a$(t)})())return!1;const t=f?u:c;return!t||(t.setActiveId(e.currentTarget.id),!0)}})),s=$P(y({store:n,toggleOnClick:!d,focusable:r,accessibleWhenDisabled:o},s)),s=Yn(y({store:n,typeahead:f},s))})),c$=jt((function(e){return Mt("button",l$(e))}));const u$=(0,f.forwardRef)((function({children:e,disabled:t=!1,...n},r){const o=(0,f.useContext)(KV);if(!o?.store)throw new Error("Menu.TriggerButton can only be rendered inside a Menu component");if(o.store.parent)throw new Error("Menu.TriggerButton should not be rendered inside a nested Menu component. Use Menu.SubmenuTriggerItem instead.");return(0,kt.jsx)(c$,{ref:r,...n,disabled:t,store:o.store,children:e})}));var d$=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})});const f$=(0,f.forwardRef)((function({suffix:e,...t},n){const r=(0,f.useContext)(KV);if(!r?.store.parent)throw new Error("Menu.SubmenuTriggerItem can only be rendered inside a nested Menu component");return(0,kt.jsx)(c$,{ref:n,accessibleWhenDisabled:!0,store:r.store,render:(0,kt.jsx)(XW,{...t,store:r.store.parent,suffix:(0,kt.jsxs)(kt.Fragment,{children:[e,(0,kt.jsx)(GW,{"aria-hidden":"true",icon:d$,size:24,preserveAspectRatio:"xMidYMid slice"})]})})})}));var h$=Nt((function(e){var t=e,{store:n,alwaysVisible:r,composite:o}=t,i=_(t,["store","alwaysVisible","composite"]);const s=BV();L(n=n||s,!1);const a=n.parent,l=n.menubar,c=!!a,u=Pe(i.id),d=i.onKeyDown,f=n.useState((e=>e.placement.split("-")[0])),h=n.useState((e=>"both"===e.orientation?void 0:e.orientation)),p="vertical"!==h,m=rt(l,(e=>!!e&&"vertical"!==e.orientation)),g=Me((e=>{if(null==d||d(e),!e.defaultPrevented){if(c||l&&!p){const t={ArrowRight:()=>"left"===f&&!p,ArrowLeft:()=>"right"===f&&!p,ArrowUp:()=>"bottom"===f&&p,ArrowDown:()=>"top"===f&&p}[e.key];if(null==t?void 0:t())return e.stopPropagation(),e.preventDefault(),null==n?void 0:n.hide()}if(l){const t={ArrowRight:()=>{if(m)return l.next()},ArrowLeft:()=>{if(m)return l.previous()},ArrowDown:()=>{if(!m)return l.next()},ArrowUp:()=>{if(!m)return l.previous()}}[e.key],n=null==t?void 0:t();void 0!==n&&(e.stopPropagation(),e.preventDefault(),l.move(n))}}}));i=Ae(i,(e=>(0,kt.jsx)(WV,{value:n,children:e})),[n]);const v=function(e){var t=e,{store:n}=t,r=_(t,["store"]);const[o,i]=(0,$.useState)(void 0),s=r["aria-label"],a=rt(n,"disclosureElement"),l=rt(n,"contentElement");return(0,$.useEffect)((()=>{const e=a;e&&l&&(s||l.hasAttribute("aria-label")?i(void 0):e.id&&i(e.id))}),[s,a,l]),o}(y({store:n},i)),b=Jr(n.useState("mounted"),i.hidden,r),x=b?w(y({},i.style),{display:"none"}):i.style;i=w(y({id:u,"aria-labelledby":v,hidden:b},i),{ref:Te(u?n.setContentElement:null,i.ref),style:x,onKeyDown:g});const S=!!n.combobox;return(o=null!=o?o:!S)&&(i=y({role:"menu","aria-orientation":h},i)),i=fn(y({store:n,composite:o},i)),i=Yn(y({store:n,typeahead:!S},i))})),p$=(jt((function(e){return Mt("div",h$(e))})),Nt((function(e){var t=e,{store:n,modal:r=!1,portal:o=!!r,hideOnEscape:i=!0,autoFocusOnShow:s=!0,hideOnHoverOutside:a,alwaysVisible:l}=t,c=_(t,["store","modal","portal","hideOnEscape","autoFocusOnShow","hideOnHoverOutside","alwaysVisible"]);const u=BV();L(n=n||u,!1);const d=(0,$.useRef)(null),f=n.parent,h=n.menubar,p=!!f,m=!!h&&!p;c=w(y({},c),{ref:Te(d,c.ref)});const g=h$(y({store:n,alwaysVisible:l},c)),{"aria-labelledby":v}=g;c=_(g,["aria-labelledby"]);const[b,x]=(0,$.useState)(),S=n.useState("autoFocusOnShow"),C=n.useState("initialFocus"),k=n.useState("baseElement"),j=n.useState("renderedItems");(0,$.useEffect)((()=>{let e=!1;return x((t=>{var n,r,o;if(e)return;if(!S)return;if(null==(n=null==t?void 0:t.current)?void 0:n.isConnected)return t;const i=(0,$.createRef)();switch(C){case"first":i.current=(null==(r=j.find((e=>!e.disabled&&e.element)))?void 0:r.element)||null;break;case"last":i.current=(null==(o=[...j].reverse().find((e=>!e.disabled&&e.element)))?void 0:o.element)||null;break;default:i.current=k}return i})),()=>{e=!0}}),[n,S,C,j,k]);const E=!p&&r,M=!!s,N=!!b||!!c.initialFocus||!!E,T=rt(n.combobox||n,"contentElement"),P=rt((null==f?void 0:f.combobox)||f,"contentElement"),D=(0,$.useMemo)((()=>{if(!P)return;if(!T)return;const e=T.getAttribute("role"),t=P.getAttribute("role");return"menu"!==t&&"menubar"!==t||"menu"!==e?P:void 0}),[T,P]);return void 0!==D&&(c=y({preserveTabOrderAnchor:D},c)),c=Ki(w(y({store:n,alwaysVisible:l,initialFocus:b,autoFocusOnShow:M?N&&s:S||!!E},c),{hideOnEscape:e=>!F(i,e)&&(null==n||n.hideAll(),!0),hideOnHoverOutside(e){const t=null==n?void 0:n.getState().disclosureElement;return!!("function"==typeof a?a(e):null!=a?a:p||m&&(!t||!Xt(t)))&&(!!e.defaultPrevented||(!p||(!t||(function(e,t,n){const r=new Event(t,n);e.dispatchEvent(r)}(t,"mouseout",e),!Xt(t)||(requestAnimationFrame((()=>{Xt(t)||null==n||n.hide()})),!1)))))},modal:E,portal:o,backdrop:!p&&c.backdrop})),c=y({"aria-labelledby":v},c)}))),m$=ko(jt((function(e){return Mt("div",p$(e))})),BV);const g$=(0,f.forwardRef)((function({gutter:e,children:t,shift:n,modal:r=!0,...o},i){const s=(0,f.useContext)(KV),a=rt(s?.store,"currentPlacement")?.split("-")[0],l=(0,f.useCallback)((e=>(e.preventDefault(),!0)),[]),c=rt(s?.store,"rtl")?"rtl":"ltr",u=(0,f.useMemo)((()=>({dir:c,style:{direction:c}})),[c]);if(!s?.store)throw new Error("Menu.Popover can only be rendered inside a Menu component");return(0,kt.jsx)(m$,{...o,ref:i,modal:r,store:s.store,gutter:null!=e?e:s.store.parent?0:8,shift:null!=n?n:s.store.parent?-4:0,hideOnHoverOutside:!1,"data-side":a,wrapperProps:u,hideOnEscape:l,unmountOnHide:!0,render:e=>(0,kt.jsx)(RW,{variant:s.variant,children:(0,kt.jsx)(OW,{...e})}),children:t})})),v$=Object.assign(dl((e=>{const{children:t,defaultOpen:n=!1,open:r,onOpenChange:o,placement:i,variant:s}=cl(e,"Menu"),a=(0,f.useContext)(KV),l=(0,u.isRTL)();let c=null!=i?i:a?.store?"right-start":"bottom-start";l&&(/right/.test(c)?c=c.replace("right","left"):/left/.test(c)&&(c=c.replace("left","right")));const d=qV({parent:a?.store,open:r,defaultOpen:n,placement:c,focusLoop:!0,setOpen(e){o?.(e)},rtl:l}),h=(0,f.useMemo)((()=>({store:d,variant:s})),[d,s]);return(0,kt.jsx)(KV.Provider,{value:h,children:t})}),"Menu"),{Context:Object.assign(KV,{displayName:"Menu.Context"}),Item:Object.assign(XW,{displayName:"Menu.Item"}),RadioItem:Object.assign(t$,{displayName:"Menu.RadioItem"}),CheckboxItem:Object.assign(JW,{displayName:"Menu.CheckboxItem"}),Group:Object.assign(n$,{displayName:"Menu.Group"}),GroupLabel:Object.assign(r$,{displayName:"Menu.GroupLabel"}),Separator:Object.assign(o$,{displayName:"Menu.Separator"}),ItemLabel:Object.assign(i$,{displayName:"Menu.ItemLabel"}),ItemHelpText:Object.assign(s$,{displayName:"Menu.ItemHelpText"}),Popover:Object.assign(g$,{displayName:"Menu.Popover"}),TriggerButton:Object.assign(u$,{displayName:"Menu.TriggerButton"}),SubmenuTriggerItem:Object.assign(f$,{displayName:"Menu.SubmenuTriggerItem"})});const b$=Sl("div",{target:"e1krjpvb0"})({name:"1a3idx0",styles:"color:var( --wp-components-color-foreground, currentColor )"});function x$(e){!function(e){for(const[t,n]of Object.entries(e))void 0!==n&&fb(n).isValid()}(e);const t={...y$(e.accent),...w$(e.background)};return function(e){for(const t of Object.values(e));}(function(e,t){const n=e.background||Fl.white,r=e.accent||"#3858e9",o=t.foreground||Fl.gray[900],i=t.gray||Fl.gray;return{accent:fb(n).isReadable(r)?void 0:`The background color ("${n}") does not have sufficient contrast against the accent color ("${r}").`,foreground:fb(n).isReadable(o)?void 0:`The background color provided ("${n}") does not have sufficient contrast against the standard foreground colors.`,grays:fb(n).contrast(i[600])>=3&&fb(n).contrast(i[700])>=4.5?void 0:`The background color provided ("${n}") cannot generate a set of grayscale foreground colors with sufficient contrast. Try adjusting the color to be lighter or darker.`}}(e,t)),{colors:t}}function y$(e){return e?{accent:e,accentDarker10:fb(e).darken(.1).toHex(),accentDarker20:fb(e).darken(.2).toHex(),accentInverted:_$(e)}:{}}function w$(e){if(!e)return{};const t=_$(e);return{background:e,foreground:t,foregroundInverted:_$(t),gray:S$(e,t)}}function _$(e){return fb(e).isDark()?Fl.white:Fl.gray[900]}function S$(e,t){const n=fb(e).isDark()?"lighten":"darken",r=Math.abs(fb(e).toHsl().l-fb(t).toHsl().l)/100,o={};return Object.entries({100:.06,200:.121,300:.132,400:.2,600:.42,700:.543,800:.821}).forEach((([t,i])=>{o[parseInt(t)]=fb(e)[n](i/.884*r).toHex()})),o}pb([mb,AS]);var C$=function({accent:e,background:t,className:n,...r}){const o=ll(),i=(0,f.useMemo)((()=>o(...(({colors:e})=>{const t=Object.entries(e.gray||{}).map((([e,t])=>`--wp-components-color-gray-${e}: ${t};`)).join("");return[Dl("--wp-components-color-accent:",e.accent,";--wp-components-color-accent-darker-10:",e.accentDarker10,";--wp-components-color-accent-darker-20:",e.accentDarker20,";--wp-components-color-accent-inverted:",e.accentInverted,";--wp-components-color-background:",e.background,";--wp-components-color-foreground:",e.foreground,";--wp-components-color-foreground-inverted:",e.foregroundInverted,";",t,";","")]})(x$({accent:e,background:t})),n)),[e,t,n,o]);return(0,kt.jsx)(b$,{className:i,...r})};const k$=(0,f.createContext)(void 0);k$.displayName="TabsContext";const j$=()=>(0,f.useContext)(k$);const E$=Sl(YF,{target:"enfox0g4"})("display:flex;align-items:stretch;overflow-x:auto;&[aria-orientation='vertical']{flex-direction:column;}:where( [aria-orientation='horizontal'] ){width:fit-content;}--direction-factor:1;--direction-start:left;--direction-end:right;--selected-start:var( --selected-left, 0 );&:dir( rtl ){--direction-factor:-1;--direction-start:right;--direction-end:left;--selected-start:var( --selected-right, 0 );}@media not ( prefers-reduced-motion ){&[data-indicator-animated]::before{transition-property:transform,border-radius,border-block;transition-duration:0.2s;transition-timing-function:ease-out;}}position:relative;&::before{content:'';position:absolute;pointer-events:none;transform-origin:var( --direction-start ) top;outline:2px solid transparent;outline-offset:-1px;}--antialiasing-factor:100;&[aria-orientation='horizontal']{--fade-width:4rem;--fade-gradient-base:transparent 0%,black var( --fade-width );--fade-gradient-composed:var( --fade-gradient-base ),black 60%,transparent 50%;&.is-overflowing-first{mask-image:linear-gradient(\n\t\t\t\tto var( --direction-end ),\n\t\t\t\tvar( --fade-gradient-base )\n\t\t\t);}&.is-overflowing-last{mask-image:linear-gradient(\n\t\t\t\tto var( --direction-start ),\n\t\t\t\tvar( --fade-gradient-base )\n\t\t\t);}&.is-overflowing-first.is-overflowing-last{mask-image:linear-gradient(\n\t\t\t\t\tto right,\n\t\t\t\t\tvar( --fade-gradient-composed )\n\t\t\t\t),linear-gradient( to left, var( --fade-gradient-composed ) );}&::before{bottom:0;height:0;width:calc( var( --antialiasing-factor ) * 1px );transform:translateX(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --selected-start ) * var( --direction-factor ) *\n\t\t\t\t\t\t\t1px\n\t\t\t\t\t)\n\t\t\t\t) scaleX(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --selected-width, 0 ) /\n\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t\t);border-bottom:var( --wp-admin-border-width-focus ) solid ",Fl.theme.accent,";}}&[aria-orientation='vertical']{&::before{border-radius:",Wl.radiusSmall,"/calc(\n\t\t\t\t\t",Wl.radiusSmall," /\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tvar( --selected-height, 0 ) /\n\t\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t\t)\n\t\t\t\t);top:0;left:0;width:100%;height:calc( var( --antialiasing-factor ) * 1px );transform:translateY( calc( var( --selected-top, 0 ) * 1px ) ) scaleY(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --selected-height, 0 ) /\n\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t\t);background-color:color-mix(\n\t\t\t\tin srgb,\n\t\t\t\t",Fl.theme.accent,",\n\t\t\t\ttransparent 96%\n\t\t\t);}&[data-select-on-move='true']:has(\n\t\t\t\t:is( :focus-visible, [data-focus-visible] )\n\t\t\t)::before{box-sizing:border-box;border:var( --wp-admin-border-width-focus ) solid ",Fl.theme.accent,";border-block-width:calc(\n\t\t\t\tvar( --wp-admin-border-width-focus, 1px ) /\n\t\t\t\t\t(\n\t\t\t\t\t\tvar( --selected-height, 0 ) /\n\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t);}}"),M$=Sl(qF,{target:"enfox0g3"})("&{border-radius:0;background:transparent;border:none;box-shadow:none;flex:1 0 auto;white-space:nowrap;display:flex;align-items:center;cursor:pointer;line-height:1.2;font-weight:400;font-size:",_y("default.fontSize"),";color:",Fl.theme.foreground,";position:relative;&[aria-disabled='true']{cursor:default;color:",Fl.ui.textDisabled,";}&:not( [aria-disabled='true'] ):is( :hover, [data-focus-visible] ){color:",Fl.theme.accent,";}&:focus:not( :disabled ){box-shadow:none;outline:none;}&::after{position:absolute;pointer-events:none;outline:var( --wp-admin-border-width-focus ) solid ",Fl.theme.accent,";border-radius:",Wl.radiusSmall,";opacity:0;@media not ( prefers-reduced-motion ){transition:opacity 0.1s linear;}}&[data-focus-visible]::after{opacity:1;}}[aria-orientation='horizontal'] &{padding-inline:",Rl(4),";height:",Rl(12),";scroll-margin:24px;&::after{content:'';inset:",Rl(3),";}}[aria-orientation='vertical'] &{padding:",Rl(2)," ",Rl(3),";min-height:",Rl(10),";&[aria-selected='true']{color:",Fl.theme.accent,";fill:currentColor;}}[aria-orientation='vertical'][data-select-on-move='false'] &::after{content:'';inset:var( --wp-admin-border-width-focus );}"),N$=Sl("span",{target:"enfox0g2"})({name:"9at4z3",styles:"flex-grow:1;display:flex;align-items:center;[aria-orientation='horizontal'] &{justify-content:center;}[aria-orientation='vertical'] &{justify-content:start;}"}),T$=Sl(Vy,{target:"enfox0g1"})("flex-shrink:0;margin-inline-end:",Rl(-1),";[aria-orientation='horizontal'] &{display:none;}opacity:0;[role='tab']:is( [aria-selected='true'], [data-focus-visible], :hover ) &{opacity:1;}@media not ( prefers-reduced-motion ){[data-select-on-move='true'] [role='tab']:is( [aria-selected='true'], ) &{transition:opacity 0.15s 0.15s linear;}}&:dir( rtl ){rotate:180deg;}"),P$=Sl(XF,{target:"enfox0g0"})("&:focus{box-shadow:none;outline:none;}&[data-focus-visible]{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ",Fl.theme.accent,";outline:2px solid transparent;outline-offset:0;}"),D$=(0,f.forwardRef)((function({children:e,tabId:t,disabled:n,render:r,...o},i){var s;const{store:a,instanceId:l}=null!==(s=j$())&&void 0!==s?s:{};if(!a)return null;const c=`${l}-${t}`;return(0,kt.jsxs)(M$,{ref:i,store:a,id:c,disabled:n,render:r,...o,children:[(0,kt.jsx)(N$,{children:e}),(0,kt.jsx)(T$,{icon:HA})]})}));const I$=(0,f.forwardRef)((function({children:e,...t},n){var r;const{store:o}=null!==(r=j$())&&void 0!==r?r:{},i=rt(o,"selectedId"),s=rt(o,"activeId"),a=rt(o,"selectOnMove"),l=rt(o,"items"),[u,h]=(0,f.useState)(),p=(0,d.useMergeRefs)([n,h]),m=o?.item(i),g=rt(o,"renderedItems"),v=g&&m?g.indexOf(m):-1,b=dS(m?.element,[v]),x=function(e,t){const[n,r]=(0,f.useState)(!1),[o,i]=(0,f.useState)(!1),[s,a]=(0,f.useState)(),l=(0,d.useEvent)((e=>{for(const n of e)n.target===t.first&&r(!n.isIntersecting),n.target===t.last&&i(!n.isIntersecting)}));return(0,f.useEffect)((()=>{if(!e||!window.IntersectionObserver)return;const t=new IntersectionObserver(l,{root:e,threshold:.9});return a(t),()=>t.disconnect()}),[l,e]),(0,f.useEffect)((()=>{if(s)return t.first&&s.observe(t.first),t.last&&s.observe(t.last),()=>{t.first&&s.unobserve(t.first),t.last&&s.unobserve(t.last)}}),[t.first,t.last,s]),{first:n,last:o}}(u,{first:l?.at(0)?.element,last:l?.at(-1)?.element});fS(u,b,{prefix:"selected",dataAttribute:"indicator-animated",transitionEndFilter:e=>"::before"===e.pseudoElement,roundRect:!0}),function(e,t,{margin:n=24}={}){(0,f.useLayoutEffect)((()=>{if(!e||!t)return;const{scrollLeft:r}=e,o=e.getBoundingClientRect().width,{left:i,width:s}=t,a=i+s+n-(r+o),l=r-(i-n);let c=null;l>0?c=r-l:a>0&&(c=r+a),null!==c&&e.scroll?.({left:c})}),[n,e,t])}(u,b);return o?(0,kt.jsx)(E$,{ref:p,store:o,render:e=>{var t;return(0,kt.jsx)("div",{...e,tabIndex:null!==(t=e.tabIndex)&&void 0!==t?t:-1})},onBlur:()=>{a&&i!==s&&o?.setActiveId(i)},"data-select-on-move":a?"true":"false",...t,className:c(x.first&&"is-overflowing-first",x.last&&"is-overflowing-last",t.className),children:e}):null})),R$=(0,f.forwardRef)((function({children:e,tabId:t,focusable:n=!0,...r},o){const i=j$(),s=rt(i?.store,"selectedId");if(!i)return null;const{store:a,instanceId:l}=i,c=`${l}-${t}`;return(0,kt.jsx)(P$,{ref:o,store:a,id:`${c}-view`,tabId:c,focusable:n,...r,children:s===c&&e})}));function O$(e,t){return e&&`${t}-${e}`}function A$(e,t){return"string"==typeof e?e.replace(`${t}-`,""):e}const z$=Object.assign((function e({selectOnMove:t=!0,defaultTabId:n,orientation:r="horizontal",onSelect:o,children:i,selectedTabId:s,activeTabId:a,defaultActiveTabId:l,onActiveTabIdChange:c}){const h=(0,d.useInstanceId)(e,"tabs"),p=BF({selectOnMove:t,orientation:r,defaultSelectedId:O$(n,h),setSelectedId:e=>{o?.(A$(e,h))},selectedId:O$(s,h),defaultActiveId:O$(l,h),setActiveId:e=>{c?.(A$(e,h))},activeId:O$(a,h),rtl:(0,u.isRTL)()}),{items:m,activeId:g}=rt(p),{setActiveId:v}=p;(0,f.useEffect)((()=>{requestAnimationFrame((()=>{const e=m?.[0]?.element?.ownerDocument.activeElement;e&&m.some((t=>e===t.element))&&g!==e.id&&v(e.id)}))}),[g,m,v]);const b=(0,f.useMemo)((()=>({store:p,instanceId:h})),[p,h]);return(0,kt.jsx)(k$.Provider,{value:b,children:i})}),{Tab:Object.assign(D$,{displayName:"Tabs.Tab"}),TabList:Object.assign(I$,{displayName:"Tabs.TabList"}),TabPanel:Object.assign(R$,{displayName:"Tabs.TabPanel"}),Context:Object.assign(k$,{displayName:"Tabs.Context"})}),L$=window.wp.privateApis,{lock:F$,unlock:B$}=(0,L$.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/components");var V$=(0,kt.jsx)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,kt.jsx)(a.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})}),W$=(0,kt.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(a.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"})}),$$=(0,kt.jsx)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,kt.jsx)(a.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 12v-1.5h1.5V16h-1.5Zm0-8v5h1.5V8h-1.5Z"})}),H$=(0,kt.jsx)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,kt.jsx)(a.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"})});var U$=function({className:e,intent:t="default",children:n,...r}){const o=function(e="default"){switch(e){case"info":return V$;case"success":return W$;case"warning":return $$;case"error":return H$;default:return null}}(t),i=!!o;return(0,kt.jsx)("span",{className:c("components-badge",e,{[`is-${t}`]:t,"has-icon":i}),...r,children:(0,kt.jsxs)("span",{className:"components-badge__flex-wrapper",children:[i&&(0,kt.jsx)(Vy,{icon:o,size:16,fill:"currentColor",className:"components-badge__icon"}),(0,kt.jsx)("span",{className:"components-badge__content",children:n})]})})};Symbol.for("constructDateFrom");const Y$={},G$={};function q$(e,t){try{const n=(Y$[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return n in G$?G$[n]:X$(n,n.split(":"))}catch{if(e in G$)return G$[e];const t=e?.match(K$);return t?X$(e,t.slice(1)):NaN}}const K$=/([+-]\d\d):?(\d\d)?/;function X$(e,t){const n=+(t[0]||0),r=+(t[1]||0),o=+(t[2]||0)/60;return G$[e]=60*n+r>0?60*n+r+o:60*n-r-o}class Z$ extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(q$(this.timeZone,this))?this.setTime(NaN):e.length?"number"==typeof e[0]&&(1===e.length||2===e.length&&"number"!=typeof e[1])?this.setTime(e[0]):"string"==typeof e[0]?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),eH(this),J$(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new Z$(...t,e):new Z$(Date.now(),e)}withTimeZone(e){return new Z$(+this,e)}getTimezoneOffset(){const e=-q$(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),J$(this),+this}[Symbol.for("constructDateFrom")](e){return new Z$(+new Date(e),this.timeZone)}}const Q$=/^(get|set)(?!UTC)/;function J$(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(60*-q$(e.timeZone,e)))}function eH(e){const t=q$(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const o=-new Date(+e).getTimezoneOffset(),i=o- -new Date(+r).getTimezoneOffset(),s=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();i&&s&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+i);const a=o-n;a&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+a);const l=new Date(+e);l.setUTCSeconds(0);const c=o>0?l.getSeconds():(l.getSeconds()-60)%60,u=Math.round(-60*q$(e.timeZone,e))%60;(u||c)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+c));const d=q$(e.timeZone,e),f=d>0?Math.floor(d):Math.ceil(d),h=-new Date(+e).getTimezoneOffset()-f-a;if(f!==n&&h){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+h);const t=q$(e.timeZone,e),n=f-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}Object.getOwnPropertyNames(Date.prototype).forEach((e=>{if(!Q$.test(e))return;const t=e.replace(Q$,"$1UTC");Z$.prototype[t]&&(e.startsWith("get")?Z$.prototype[e]=function(){return this.internal[t]()}:(Z$.prototype[e]=function(){var e;return Date.prototype[t].apply(this.internal,arguments),e=this,Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),eH(e),+this},Z$.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),J$(this),+this}))}));class tH extends Z${static tz(e,...t){return t.length?new tH(...t,e):new tH(Date.now(),e)}toISOString(){const[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,n,r]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${function(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset();return[e>0?"-":"+",String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),String(Math.abs(e)%60).padStart(2,"0")]}withTimeZone(e){return new tH(+this,e)}[Symbol.for("constructDateFrom")](e){return new tH(+new Date(e),this.timeZone)}}const nH={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function rH(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const oH={date:rH({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:rH({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:rH({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},iH={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function sH(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}const aH={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:sH({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:sH({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:sH({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:sH({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:sH({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function lH(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(a,(e=>e.test(s))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(a,(e=>e.test(s)));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:t.slice(s.length)}}}const cH={ordinalNumber:function(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;return{value:s,rest:t.slice(o.length)}}}({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:lH({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:lH({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:lH({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:lH({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:lH({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},uH={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=nH[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:oH,formatRelative:(e,t,n,r)=>iH[e],localize:aH,match:cH,options:{weekStartsOn:0,firstWeekContainsDate:1}},dH=(Math.pow(10,8),6048e5),fH=Symbol.for("constructDateFrom");function hH(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&fH in e?e[fH](t):e instanceof Date?new e.constructor(t):new Date(t)}function pH(e,t){return hH(t||e,e)}function mH(e,t,n){const r=pH(e,n?.in);return isNaN(t)?hH(n?.in||e,NaN):t?(r.setDate(r.getDate()+t),r):r}function gH(e,t,n){const r=pH(e,n?.in);if(isNaN(t))return hH(n?.in||e,NaN);if(!t)return r;const o=r.getDate(),i=hH(n?.in||e,r.getTime());i.setMonth(r.getMonth()+t+1,0);return o>=i.getDate()?i:(r.setFullYear(i.getFullYear(),i.getMonth(),o),r)}function vH(e,t,n){return mH(e,7*t,n)}function bH(e,t,n){return gH(e,12*t,n)}function xH(e){const t=pH(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function yH(e,...t){const n=hH.bind(null,e||t.find((e=>"object"==typeof e)));return t.map(n)}function wH(e,t){const n=pH(e,t?.in);return n.setHours(0,0,0,0),n}function _H(e,t,n){const[r,o]=yH(n?.in,e,t),i=wH(r),s=wH(o),a=+i-xH(i),l=+s-xH(s);return Math.round((a-l)/864e5)}function SH(e,t,n){const[r,o]=yH(n?.in,e,t);return 12*(r.getFullYear()-o.getFullYear())+(r.getMonth()-o.getMonth())}function CH(e,t){const[n,r]=yH(e,t.start,t.end);return{start:n,end:r}}function kH(e,t){const{start:n,end:r}=CH(t?.in,e);let o=+n>+r;const i=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0),s.setDate(1);let a=t?.step??1;if(!a)return[];a<0&&(a=-a,o=!o);const l=[];for(;+s<=i;)l.push(hH(n,s)),s.setMonth(s.getMonth()+a);return o?l.reverse():l}function jH(e,t){const{start:n,end:r}=CH(t?.in,e);let o=+n>+r;const i=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0),s.setMonth(0,1);let a=t?.step??1;if(!a)return[];a<0&&(a=-a,o=!o);const l=[];for(;+s<=i;)l.push(hH(n,s)),s.setFullYear(s.getFullYear()+a);return o?l.reverse():l}let EH={};function MH(){return EH}function NH(e,t){const n=MH(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=pH(e,t?.in),i=o.getDay(),s=6+(i<r?-7:0)-(i-r);return o.setDate(o.getDate()+s),o.setHours(23,59,59,999),o}function TH(e,t){return NH(e,{...t,weekStartsOn:1})}function PH(e,t){const n=pH(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function DH(e,t){const n=pH(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function IH(e,t){const n=pH(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function RH(e,t){const n=pH(e,t?.in);return _H(n,IH(n))+1}function OH(e,t){const n=MH(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=pH(e,t?.in),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function AH(e,t){return OH(e,{...t,weekStartsOn:1})}function zH(e,t){const n=pH(e,t?.in),r=n.getFullYear(),o=hH(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const i=AH(o),s=hH(n,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);const a=AH(s);return n.getTime()>=i.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function LH(e,t){const n=zH(e,t),r=hH(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),AH(r)}function FH(e,t){const n=pH(e,t?.in),r=+AH(n)-+LH(n);return Math.round(r/dH)+1}function BH(e,t){const n=pH(e,t?.in),r=n.getFullYear(),o=MH(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=hH(t?.in||e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=OH(s,t),l=hH(t?.in||e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=OH(l,t);return+n>=+a?r+1:+n>=+c?r:r-1}function VH(e,t){const n=MH(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=BH(e,t),i=hH(t?.in||e,0);i.setFullYear(o,0,r),i.setHours(0,0,0,0);return OH(i,t)}function WH(e,t){const n=pH(e,t?.in),r=+OH(n,t)-+VH(n,t);return Math.round(r/dH)+1}function $H(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const HH={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return $H("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):$H(n+1,2)},d:(e,t)=>$H(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>$H(e.getHours()%12||12,t.length),H:(e,t)=>$H(e.getHours(),t.length),m:(e,t)=>$H(e.getMinutes(),t.length),s:(e,t)=>$H(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return $H(Math.trunc(r*Math.pow(10,n-3)),t.length)}},UH="midnight",YH="noon",GH="morning",qH="afternoon",KH="evening",XH="night",ZH={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return HH.y(e,t)},Y:function(e,t,n,r){const o=BH(e,r),i=o>0?o:1-o;if("YY"===t){return $H(i%100,2)}return"Yo"===t?n.ordinalNumber(i,{unit:"year"}):$H(i,t.length)},R:function(e,t){return $H(zH(e),t.length)},u:function(e,t){return $H(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return $H(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return $H(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return HH.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return $H(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=WH(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):$H(o,t.length)},I:function(e,t,n){const r=FH(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):$H(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):HH.d(e,t)},D:function(e,t,n){const r=RH(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):$H(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return $H(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return $H(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return $H(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?YH:0===r?UH:r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?KH:r>=12?qH:r>=4?GH:XH,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return HH.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):HH.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):$H(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):$H(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):HH.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):HH.s(e,t)},S:function(e,t){return HH.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return JH(r);case"XXXX":case"XX":return eU(r);default:return eU(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return JH(r);case"xxxx":case"xx":return eU(r);default:return eU(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+QH(r,":");default:return"GMT"+eU(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+QH(r,":");default:return"GMT"+eU(r,":")}},t:function(e,t,n){return $H(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return $H(+e,t.length)}};function QH(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return 0===i?n+String(o):n+String(o)+t+$H(i,2)}function JH(e,t){if(e%60==0){return(e>0?"-":"+")+$H(Math.abs(e)/60,2)}return eU(e,t)}function eU(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+$H(Math.trunc(r/60),2)+t+$H(r%60,2)}const tU=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},nU=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},rU={p:nU,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return tU(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"})}return i.replace("{{date}}",tU(r,t)).replace("{{time}}",nU(o,t))}},oU=/^D+$/,iU=/^Y+$/,sU=["D","DD","YY","YYYY"];function aU(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function lU(e){return!(!aU(e)&&"number"!=typeof e||isNaN(+pH(e)))}const cU=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uU=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dU=/^'([^]*?)'?$/,fU=/''/g,hU=/[a-zA-Z]/;function pU(e,t,n){const r=MH(),o=n?.locale??r.locale??uH,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=pH(e,n?.in);if(!lU(a))throw new RangeError("Invalid time value");let l=t.match(uU).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,rU[t])(e,o.formatLong)}return e})).join("").match(cU).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:mU(e)};if(ZH[t])return{isToken:!0,value:e};if(t.match(hU))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map((r=>{if(!r.isToken)return r.value;const i=r.value;(!n?.useAdditionalWeekYearTokens&&function(e){return iU.test(e)}(i)||!n?.useAdditionalDayOfYearTokens&&function(e){return oU.test(e)}(i))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(r),sU.includes(e))throw new RangeError(r)}(i,t,String(e));return(0,ZH[i[0]])(a,i,o.localize,c)})).join("")}function mU(e){const t=e.match(dU);return t?t[1].replace(fU,"'"):e}function gU(e,t){return pH(e,t?.in).getMonth()}function vU(e,t){return pH(e,t?.in).getFullYear()}function bU(e,t){return+pH(e)>+pH(t)}function xU(e,t){return+pH(e)<+pH(t)}function yU(e,t,n){const[r,o]=yH(n?.in,e,t);return+wH(r)==+wH(o)}function wU(e,t,n){const[r,o]=yH(n?.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function _U(e,t,n){const[r,o]=yH(n?.in,e,t);return r.getFullYear()===o.getFullYear()}function SU(e,t){let n,r=t?.in;return e.forEach((e=>{r||"object"!=typeof e||(r=hH.bind(null,e));const t=pH(e,r);(!n||n<t||isNaN(+t))&&(n=t)})),hH(r,n||NaN)}function CU(e,t){let n,r=t?.in;return e.forEach((e=>{r||"object"!=typeof e||(r=hH.bind(null,e));const t=pH(e,r);(!n||n>t||isNaN(+t))&&(n=t)})),hH(r,n||NaN)}function kU(e,t){const n=pH(e,t?.in),r=n.getFullYear(),o=n.getMonth(),i=hH(n,0);return i.setFullYear(r,o+1,0),i.setHours(0,0,0,0),i.getDate()}function jU(e,t,n){const r=pH(e,n?.in),o=r.getFullYear(),i=r.getDate(),s=hH(n?.in||e,0);s.setFullYear(o,t,15),s.setHours(0,0,0,0);const a=kU(s);return r.setMonth(t,Math.min(i,a)),r}function EU(e,t,n){const r=pH(e,n?.in);return isNaN(+r)?hH(n?.in||e,NaN):(r.setFullYear(t),r)}function MU(e,t){const n=pH(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function NU(e,t){const n=t.startOfMonth(e),r=n.getDay();return 1===r?n:0===r?t.addDays(n,-6):t.addDays(n,-1*(r-1))}class TU{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?tH.tz(this.options.timeZone):new this.Date,this.newDate=(e,t,n)=>this.overrides?.newDate?this.overrides.newDate(e,t,n):this.options.timeZone?new tH(e,t,n,this.options.timeZone):new Date(e,t,n),this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):mH(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):gH(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):vH(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):bH(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):_H(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):SH(e,t),this.eachMonthOfInterval=e=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):kH(e),this.eachYearOfInterval=e=>{const t=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(e):jH(e),n=new Set(t.map((e=>this.getYear(e))));if(n.size===t.length)return t;const r=[];return n.forEach((e=>{r.push(new Date(e,0,1))})),r},this.endOfBroadcastWeek=e=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e):function(e,t){const n=NU(e,t),r=function(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,1-r),i=t.addDays(o,34);return t.getMonth(e)===t.getMonth(i)?5:4}(e,t);return t.addDays(n,7*r-1)}(e,this),this.endOfISOWeek=e=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):TH(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):PH(e),this.endOfWeek=(e,t)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(e,t):NH(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):DH(e),this.format=(e,t,n)=>{const r=this.overrides?.format?this.overrides.format(e,t,this.options):pU(e,t,this.options);return this.options.numerals&&"latn"!==this.options.numerals?this.replaceDigits(r):r},this.getISOWeek=e=>this.overrides?.getISOWeek?this.overrides.getISOWeek(e):FH(e),this.getMonth=(e,t)=>this.overrides?.getMonth?this.overrides.getMonth(e,this.options):gU(e,this.options),this.getYear=(e,t)=>this.overrides?.getYear?this.overrides.getYear(e,this.options):vU(e,this.options),this.getWeek=(e,t)=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):WH(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):bU(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):xU(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):aU(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):yU(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):wU(e,t),this.isSameYear=(e,t)=>this.overrides?.isSameYear?this.overrides.isSameYear(e,t):_U(e,t),this.max=e=>this.overrides?.max?this.overrides.max(e):SU(e),this.min=e=>this.overrides?.min?this.overrides.min(e):CU(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):jU(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):EU(e,t),this.startOfBroadcastWeek=(e,t)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):NU(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):wH(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):AH(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):MU(e),this.startOfWeek=(e,t)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):OH(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):IH(e),this.options={locale:uH,...e},this.overrides=t}getDigitMap(){const{numerals:e="latn"}=this.options,t=new Intl.NumberFormat("en-US",{numberingSystem:e}),n={};for(let e=0;e<10;e++)n[e.toString()]=t.format(e);return n}replaceDigits(e){const t=this.getDigitMap();return e.replace(/\d/g,(e=>t[e]||e))}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&TU.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:t,timeZone:n,numerals:r}=this.options,o=t?.code;if(o&&TU.yearFirstLocales.has(o))try{const t=new Intl.DateTimeFormat(o,{month:"long",year:"numeric",timeZone:n,numberingSystem:r});return t.format(e)}catch{}const i="year-first"===this.getMonthYearOrder()?"y LLLL":"LLLL y";return this.format(e,i)}}TU.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const PU=new TU;var DU,IU,RU,OU;function AU(e,t,n=!1,r=PU){let{from:o,to:i}=e;const{differenceInCalendarDays:s,isSameDay:a}=r;if(o&&i){s(i,o)<0&&([o,i]=[i,o]);return s(t,o)>=(n?1:0)&&s(i,t)>=(n?1:0)}return!n&&i?a(i,t):!(n||!o)&&a(o,t)}!function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"}(DU||(DU={})),function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"}(IU||(IU={})),function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"}(RU||(RU={})),function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"}(OU||(OU={}));function zU(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}function LU(e){return Boolean(e&&"object"==typeof e&&"from"in e)}function FU(e){return Boolean(e&&"object"==typeof e&&"after"in e)}function BU(e){return Boolean(e&&"object"==typeof e&&"before"in e)}function VU(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}function WU(e,t){return Array.isArray(e)&&e.every(t.isDate)}function $U(e,t,n=PU){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:i,isAfter:s}=n;return r.some((t=>{if("boolean"==typeof t)return t;if(n.isDate(t))return o(e,t);if(WU(t,n))return t.includes(e);if(LU(t))return AU(t,e,!1,n);if(VU(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if(zU(t)){const n=i(t.before,e)>0,r=i(t.after,e)<0;return s(t.before,t.after)?r&&n:n||r}return FU(t)?i(e,t.after)>0:BU(t)?i(t.before,e)>0:"function"==typeof t&&t(e)}))}function HU(e){return $.createElement("button",{...e})}function UU(e){return $.createElement("span",{...e})}function YU(e){const{size:t=24,orientation:n="left",className:r}=e;return $.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},"up"===n&&$.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),"down"===n&&$.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),"left"===n&&$.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),"right"===n&&$.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function GU(e){const{day:t,modifiers:n,...r}=e;return $.createElement("td",{...r})}function qU(e){const{day:t,modifiers:n,...r}=e,o=$.useRef(null);return $.useEffect((()=>{n.focused&&o.current?.focus()}),[n.focused]),$.createElement("button",{ref:o,...r})}function KU(e){const{options:t,className:n,components:r,classNames:o,...i}=e,s=[o[DU.Dropdown],n].join(" "),a=t?.find((({value:e})=>e===i.value));return $.createElement("span",{"data-disabled":i.disabled,className:o[DU.DropdownRoot]},$.createElement(r.Select,{className:s,...i},t?.map((({value:e,label:t,disabled:n})=>$.createElement(r.Option,{key:e,value:e,disabled:n},t)))),$.createElement("span",{className:o[DU.CaptionLabel],"aria-hidden":!0},a?.label,$.createElement(r.Chevron,{orientation:"down",size:18,className:o[DU.Chevron]})))}function XU(e){return $.createElement("div",{...e})}function ZU(e){return $.createElement("div",{...e})}function QU(e){const{calendarMonth:t,displayIndex:n,...r}=e;return $.createElement("div",{...r},e.children)}function JU(e){const{calendarMonth:t,displayIndex:n,...r}=e;return $.createElement("div",{...r})}function eY(e){return $.createElement("table",{...e})}function tY(e){return $.createElement("div",{...e})}const nY=(0,$.createContext)(void 0);function rY(){const e=(0,$.useContext)(nY);if(void 0===e)throw new Error("useDayPicker() must be used within a custom component.");return e}function oY(e){const{components:t}=rY();return $.createElement(t.Dropdown,{...e})}function iY(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:o,...i}=e,{components:s,classNames:a,labels:{labelPrevious:l,labelNext:c}}=rY(),u=(0,$.useCallback)((e=>{o&&n?.(e)}),[o,n]),d=(0,$.useCallback)((e=>{r&&t?.(e)}),[r,t]);return $.createElement("nav",{...i},$.createElement(s.PreviousMonthButton,{type:"button",className:a[DU.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":!r||void 0,"aria-label":l(r),onClick:d},$.createElement(s.Chevron,{disabled:!r||void 0,className:a[DU.Chevron],orientation:"left"})),$.createElement(s.NextMonthButton,{type:"button",className:a[DU.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":!o||void 0,"aria-label":c(o),onClick:u},$.createElement(s.Chevron,{disabled:!o||void 0,orientation:"right",className:a[DU.Chevron]})))}function sY(e){const{components:t}=rY();return $.createElement(t.Button,{...e})}function aY(e){return $.createElement("option",{...e})}function lY(e){const{components:t}=rY();return $.createElement(t.Button,{...e})}function cY(e){const{rootRef:t,...n}=e;return $.createElement("div",{...n,ref:t})}function uY(e){return $.createElement("select",{...e})}function dY(e){const{week:t,...n}=e;return $.createElement("tr",{...n})}function fY(e){return $.createElement("th",{...e})}function hY(e){return $.createElement("thead",{"aria-hidden":!0},$.createElement("tr",{...e}))}function pY(e){const{week:t,...n}=e;return $.createElement("th",{...n})}function mY(e){return $.createElement("th",{...e})}function gY(e){return $.createElement("tbody",{...e})}function vY(e){const{components:t}=rY();return $.createElement(t.Dropdown,{...e})}function bY(){const e={};for(const t in DU)e[DU[t]]=`rdp-${DU[t]}`;for(const t in IU)e[IU[t]]=`rdp-${IU[t]}`;for(const t in RU)e[RU[t]]=`rdp-${RU[t]}`;for(const t in OU)e[OU[t]]=`rdp-${OU[t]}`;return e}function xY(e,t,n){return(n??new TU(t)).formatMonthYear(e)}const yY=xY;function wY(e,t,n){return(n??new TU(t)).format(e,"d")}function _Y(e,t=PU){return t.format(e,"LLLL")}function SY(e,t,n){return(n??new TU(t)).format(e,"cccccc")}function CY(e,t=PU){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function kY(){return""}function jY(e,t=PU){return t.format(e,"yyyy")}const EY=jY;function MY(e,t,n,r,o){const{startOfMonth:i,startOfYear:s,endOfYear:a,eachMonthOfInterval:l,getMonth:c}=o;return l({start:s(e),end:a(e)}).map((e=>{const s=r.formatMonthDropdown(e,o);return{value:c(e),label:s,disabled:t&&e<i(t)||n&&e>i(n)||!1}}))}function NY(e,t,n,r,o=!1){if(!e)return;if(!t)return;const{startOfYear:i,endOfYear:s,eachYearOfInterval:a,getYear:l}=r,c=a({start:i(e),end:s(t)});return o&&c.reverse(),c.map((e=>{const t=n.formatYearDropdown(e,r);return{value:l(e),label:t,disabled:!1}}))}function TY(e,t,n,r){let o=(r??new TU(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const PY=TY;function DY(e,t,n){return(n??new TU(t)).formatMonthYear(e)}const IY=DY;function RY(e,t,n,r){let o=(r??new TU(n)).format(e,"PPPP");return t?.today&&(o=`Today, ${o}`),o}function OY(e){return"Choose the Month"}function AY(){return""}function zY(e){return"Go to the Next Month"}function LY(e){return"Go to the Previous Month"}function FY(e,t,n){return(n??new TU(t)).format(e,"cccc")}function BY(e,t){return`Week ${e}`}function VY(e){return"Week Number"}function WY(e){return"Choose the Year"}const $Y=e=>e instanceof HTMLElement?e:null,HY=e=>[...e.querySelectorAll("[data-animated-month]")??[]],UY=e=>$Y(e.querySelector("[data-animated-caption]")),YY=e=>$Y(e.querySelector("[data-animated-weeks]"));function GY(e,t,{classNames:n,months:r,focused:o,dateLib:i}){const s=(0,$.useRef)(null),a=(0,$.useRef)(r),l=(0,$.useRef)(!1);(0,$.useLayoutEffect)((()=>{const c=a.current;if(a.current=r,!(t&&e.current&&e.current instanceof HTMLElement&&0!==r.length&&0!==c.length&&r.length===c.length))return;const u=i.isSameMonth(r[0].date,c[0].date),d=i.isAfter(r[0].date,c[0].date),f=d?n[OU.caption_after_enter]:n[OU.caption_before_enter],h=d?n[OU.weeks_after_enter]:n[OU.weeks_before_enter],p=s.current,m=e.current.cloneNode(!0);if(m instanceof HTMLElement){HY(m).forEach((e=>{if(!(e instanceof HTMLElement))return;const t=$Y(e.querySelector("[data-animated-month]"));t&&e.contains(t)&&e.removeChild(t);const n=UY(e);n&&n.classList.remove(f);const r=YY(e);r&&r.classList.remove(h)})),s.current=m}else s.current=null;if(l.current||u||o)return;const g=p instanceof HTMLElement?HY(p):[],v=HY(e.current);if(v?.every((e=>e instanceof HTMLElement))&&g&&g.every((e=>e instanceof HTMLElement))){l.current=!0;const t=[];e.current.style.isolation="isolate";const r=(b=e.current,$Y(b.querySelector("[data-animated-nav]")));r&&(r.style.zIndex="1"),v.forEach(((o,i)=>{const s=g[i];if(!s)return;o.style.position="relative",o.style.overflow="hidden";const a=UY(o);a&&a.classList.add(f);const c=YY(o);c&&c.classList.add(h);const u=()=>{l.current=!1,e.current&&(e.current.style.isolation=""),r&&(r.style.zIndex=""),a&&a.classList.remove(f),c&&c.classList.remove(h),o.style.position="",o.style.overflow="",o.contains(s)&&o.removeChild(s)};t.push(u),s.style.pointerEvents="none",s.style.position="absolute",s.style.overflow="hidden",s.setAttribute("aria-hidden","true");const p=(e=>$Y(e.querySelector("[data-animated-weekdays]")))(s);p&&(p.style.opacity="0");const m=UY(s);m&&(m.classList.add(d?n[OU.caption_before_exit]:n[OU.caption_after_exit]),m.addEventListener("animationend",u));const v=YY(s);v&&v.classList.add(d?n[OU.weeks_before_exit]:n[OU.weeks_after_exit]),o.insertBefore(s,o.firstChild)}))}var b}))}function qY(e,t,n,r){const{month:o,defaultMonth:i,today:s=r.today(),numberOfMonths:a=1}=e;let l=o||i||s;const{differenceInCalendarMonths:c,addMonths:u,startOfMonth:d}=r;if(n&&c(n,l)<a-1){l=u(n,-1*(a-1))}return t&&c(l,t)<0&&(l=t),d(l)}class KY{constructor(e,t,n=PU){this.date=e,this.displayMonth=t,this.outside=Boolean(t&&!n.isSameMonth(e,t)),this.dateLib=n}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class XY{constructor(e,t){this.days=t,this.weekNumber=e}}class ZY{constructor(e,t){this.date=e,this.weeks=t}}function QY(e,t){const[n,r]=(0,$.useState)(e);return[void 0===t?n:t,r]}function JY(e,t){const[n,r]=function(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:i,startOfMonth:s,endOfMonth:a,addYears:l,endOfYear:c,newDate:u,today:d}=t,{fromYear:f,toYear:h,fromMonth:p,toMonth:m}=e;!n&&p&&(n=p),!n&&f&&(n=t.newDate(f,0,1)),!r&&m&&(r=m),!r&&h&&(r=u(h,11,31));const g="dropdown"===e.captionLayout||"dropdown-years"===e.captionLayout;return n?n=s(n):f?n=u(f,0,1):!n&&g&&(n=o(l(e.today??d(),-100))),r?r=a(r):h?r=u(h,11,31):!r&&g&&(r=c(e.today??d())),[n?i(n):n,r?i(r):r]}(e,t),{startOfMonth:o,endOfMonth:i}=t,s=qY(e,n,r,t),[a,l]=QY(s,e.month?s:void 0);(0,$.useEffect)((()=>{const o=qY(e,n,r,t);l(o)}),[e.timeZone]);const c=function(e,t,n,r){const{numberOfMonths:o=1}=n,i=[];for(let n=0;n<o;n++){const o=r.addMonths(e,n);if(t&&o>t)break;i.push(o)}return i}(a,r,e,t),u=function(e,t,n,r){const o=e[0],i=e[e.length-1],{ISOWeek:s,fixedWeeks:a,broadcastCalendar:l}=n??{},{addDays:c,differenceInCalendarDays:u,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:h,endOfMonth:p,endOfWeek:m,isAfter:g,startOfBroadcastWeek:v,startOfISOWeek:b,startOfWeek:x}=r,y=l?v(o,r):s?b(o):x(o),w=u(l?f(i):s?h(p(i)):m(p(i)),y),_=d(i,o)+1,S=[];for(let e=0;e<=w;e++){const n=c(y,e);if(t&&g(n,t))break;S.push(n)}const C=(l?35:42)*_;if(a&&S.length<C){const e=C-S.length;for(let t=0;t<e;t++){const e=c(S[S.length-1],1);S.push(e)}}return S}(c,e.endMonth?i(e.endMonth):void 0,e,t),d=function(e,t,n,r){const{addDays:o,endOfBroadcastWeek:i,endOfISOWeek:s,endOfMonth:a,endOfWeek:l,getISOWeek:c,getWeek:u,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:h}=r,p=e.reduce(((e,p)=>{const m=n.broadcastCalendar?d(p,r):n.ISOWeek?f(p):h(p),g=n.broadcastCalendar?i(p):n.ISOWeek?s(a(p)):l(a(p)),v=t.filter((e=>e>=m&&e<=g)),b=n.broadcastCalendar?35:42;if(n.fixedWeeks&&v.length<b){const e=t.filter((e=>{const t=b-v.length;return e>g&&e<=o(g,t)}));v.push(...e)}const x=v.reduce(((e,t)=>{const o=n.ISOWeek?c(t):u(t),i=e.find((e=>e.weekNumber===o)),s=new KY(t,p,r);return i?i.days.push(s):e.push(new XY(o,[s])),e}),[]),y=new ZY(p,x);return e.push(y),e}),[]);return n.reverseMonths?p.reverse():p}(c,u,e,t),f=function(e){return e.reduce(((e,t)=>e.concat(t.weeks.slice())),[].slice())}(d),h=function(e){const t=[];return e.reduce(((e,n)=>{const r=n.weeks.reduce(((e,t)=>e.concat(t.days.slice())),t.slice());return e.concat(r.slice())}),t.slice())}(d),p=function(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:i}=n,{startOfMonth:s,addMonths:a,differenceInCalendarMonths:l}=r,c=o?i??1:1,u=s(e);return t&&l(u,t)<=0?void 0:a(u,-c)}(a,n,e,t),m=function(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:i=1}=n,{startOfMonth:s,addMonths:a,differenceInCalendarMonths:l}=r,c=o?i:1,u=s(e);return t&&l(t,e)<i?void 0:a(u,c)}(a,r,e,t),{disableNavigation:g,onMonthChange:v}=e,b=e=>{if(g)return;let t=o(e);n&&t<o(n)&&(t=o(n)),r&&t>o(r)&&(t=o(r)),l(t),v?.(t)},x={months:d,weeks:f,days:h,navStart:n,navEnd:r,previousMonth:p,nextMonth:m,goToMonth:b,goToDay:e=>{(e=>f.some((t=>t.days.some((t=>t.isEqualTo(e))))))(e)||b(e.date)}};return x}var eG;function tG(e){return!e[IU.disabled]&&!e[IU.hidden]&&!e[IU.outside]}function nG(e,t,n,r,o,i,s,a=0){if(a>365)return;const l=function(e,t,n,r,o,i,s){const{ISOWeek:a,broadcastCalendar:l}=i,{addDays:c,addMonths:u,addWeeks:d,addYears:f,endOfBroadcastWeek:h,endOfISOWeek:p,endOfWeek:m,max:g,min:v,startOfBroadcastWeek:b,startOfISOWeek:x,startOfWeek:y}=s;let w={day:c,week:d,month:u,year:f,startOfWeek:e=>l?b(e,s):a?x(e):y(e),endOfWeek:e=>l?h(e):a?p(e):m(e)}[e](n,"after"===t?1:-1);return"before"===t&&r?w=g([r,w]):"after"===t&&o&&(w=v([o,w])),w}(e,t,n.date,r,o,i,s),c=Boolean(i.disabled&&$U(l,i.disabled,s)),u=Boolean(i.hidden&&$U(l,i.hidden,s)),d=new KY(l,l,s);return c||u?nG(e,t,d,r,o,i,s,a+1):d}function rG(e,t,n,r,o){const{autoFocus:i}=e,[s,a]=(0,$.useState)(),l=function(e,t,n,r){let o,i=-1;for(const s of e){const e=t(s);tG(e)&&(e[IU.focused]&&i<eG.FocusedModifier?(o=s,i=eG.FocusedModifier):r?.isEqualTo(s)&&i<eG.LastFocused?(o=s,i=eG.LastFocused):n(s.date)&&i<eG.Selected?(o=s,i=eG.Selected):e[IU.today]&&i<eG.Today&&(o=s,i=eG.Today))}return o||(o=e.find((e=>tG(t(e))))),o}(t.days,n,r||(()=>!1),s),[c,u]=(0,$.useState)(i?l:void 0);return{isFocusTarget:e=>Boolean(l?.isEqualTo(e)),setFocused:u,focused:c,blur:()=>{a(c),u(void 0)},moveFocus:(n,r)=>{if(!c)return;const i=nG(n,r,c,t.navStart,t.navEnd,e,o);if(i){if(e.disableNavigation){if(!t.days.some((e=>e.isEqualTo(i))))return}t.goToDay(i),u(i)}}}}function oG(e,t,n=PU){return AU(e,t.from,!1,n)||AU(e,t.to,!1,n)||AU(t,e.from,!1,n)||AU(t,e.to,!1,n)}function iG(e,t,n=PU){const r=Array.isArray(t)?t:[t],o=r.filter((e=>"function"!=typeof e)).some((t=>{if("boolean"==typeof t)return t;if(n.isDate(t))return AU(e,t,!1,n);if(WU(t,n))return t.some((t=>AU(e,t,!1,n)));if(LU(t))return!(!t.from||!t.to)&&oG(e,{from:t.from,to:t.to},n);if(VU(t))return function(e,t,n=PU){const r=Array.isArray(t)?t:[t];let o=e.from;const i=n.differenceInCalendarDays(e.to,e.from),s=Math.min(i,6);for(let e=0;e<=s;e++){if(r.includes(o.getDay()))return!0;o=n.addDays(o,1)}return!1}(e,t.dayOfWeek,n);if(zU(t)){return n.isAfter(t.before,t.after)?oG(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):$U(e.from,t,n)||$U(e.to,t,n)}return!(!FU(t)&&!BU(t))&&($U(e.from,t,n)||$U(e.to,t,n))}));if(o)return!0;const i=r.filter((e=>"function"==typeof e));if(i.length){let t=e.from;const r=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=r;e++){if(i.some((e=>e(t))))return!0;t=n.addDays(t,1)}}return!1}function sG(e,t){const{disabled:n,excludeDisabled:r,selected:o,required:i,onSelect:s}=e,[a,l]=QY(o,s?o:void 0),c=s?o:a;return{selected:c,select:(o,a,u)=>{const{min:d,max:f}=e,h=o?function(e,t,n=0,r=0,o=!1,i=PU){const{from:s,to:a}=t||{},{isSameDay:l,isAfter:c,isBefore:u}=i;let d;if(s||a){if(s&&!a)d=l(s,e)?0===n?{from:s,to:e}:o?{from:s,to:void 0}:void 0:u(e,s)?{from:e,to:s}:{from:s,to:e};else if(s&&a)if(l(s,e)&&l(a,e))d=o?{from:s,to:a}:void 0;else if(l(s,e))d={from:s,to:n>0?void 0:e};else if(l(a,e))d={from:e,to:n>0?void 0:e};else if(u(e,s))d={from:e,to:a};else if(c(e,s))d={from:s,to:e};else{if(!c(e,a))throw new Error("Invalid range");d={from:s,to:e}}}else d={from:e,to:n>0?void 0:e};if(d?.from&&d?.to){const t=i.differenceInCalendarDays(d.to,d.from);(r>0&&t>r||n>1&&t<n)&&(d={from:e,to:void 0})}return d}(o,c,d,f,i,t):void 0;return r&&n&&h?.from&&h.to&&iG({from:h.from,to:h.to},n,t)&&(h.from=o,h.to=void 0),s||l(h),s?.(h,o,a,u),h},isSelected:e=>c&&AU(c,e,!1,t)}}function aG(e,t){const n=function(e,t){const{selected:n,required:r,onSelect:o}=e,[i,s]=QY(n,o?n:void 0),a=o?n:i,{isSameDay:l}=t;return{selected:a,select:(e,t,n)=>{let i=e;return!r&&a&&a&&l(e,a)&&(i=void 0),o||s(i),o?.(i,e,t,n),i},isSelected:e=>!!a&&l(a,e)}}(e,t),r=function(e,t){const{selected:n,required:r,onSelect:o}=e,[i,s]=QY(n,o?n:void 0),a=o?n:i,{isSameDay:l}=t,c=e=>a?.some((t=>l(t,e)))??!1,{min:u,max:d}=e;return{selected:a,select:(e,t,n)=>{let i=[...a??[]];if(c(e)){if(a?.length===u)return;if(r&&1===a?.length)return;i=a?.filter((t=>!l(t,e)))}else i=a?.length===d?[e]:[...i,e];return o||s(i),o?.(i,e,t,n),i},isSelected:c}}(e,t),o=sG(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}function lG(e){let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new tH(t.today,t.timeZone)),t.month&&(t.month=new tH(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new tH(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new tH(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new tH(t.endMonth,t.timeZone)),"single"===t.mode&&t.selected?t.selected=new tH(t.selected,t.timeZone):"multiple"===t.mode&&t.selected?t.selected=t.selected?.map((e=>new tH(e,t.timeZone))):"range"===t.mode&&t.selected&&(t.selected={from:t.selected.from?new tH(t.selected.from,t.timeZone):void 0,to:t.selected.to?new tH(t.selected.to,t.timeZone):void 0}));const{components:o,formatters:i,labels:a,dateLib:l,locale:c,classNames:u}=(0,$.useMemo)((()=>{const e={...uH,...t.locale};return{dateLib:new TU({locale:e,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:(i=t.components,{...n,...i}),formatters:(o=t.formatters,o?.formatMonthCaption&&!o.formatCaption&&(o.formatCaption=o.formatMonthCaption),o?.formatYearCaption&&!o.formatYearDropdown&&(o.formatYearDropdown=o.formatYearCaption),{...r,...o}),labels:{...s,...t.labels},locale:e,classNames:{...bY(),...t.classNames}};var o,i}),[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:d,mode:f,navLayout:h,numberOfMonths:p=1,onDayBlur:m,onDayClick:g,onDayFocus:v,onDayKeyDown:b,onDayMouseEnter:x,onDayMouseLeave:y,onNextClick:w,onPrevClick:_,showWeekNumber:S,styles:C}=t,{formatCaption:k,formatDay:j,formatMonthDropdown:E,formatWeekNumber:M,formatWeekNumberHeader:N,formatWeekdayName:T,formatYearDropdown:P}=i,D=JY(t,l),{days:I,months:R,navStart:O,navEnd:A,previousMonth:z,nextMonth:L,goToMonth:F}=D,B=function(e,t,n,r,o){const{disabled:i,hidden:s,modifiers:a,showOutsideDays:l,broadcastCalendar:c,today:u}=t,{isSameDay:d,isSameMonth:f,startOfMonth:h,isBefore:p,endOfMonth:m,isAfter:g}=o,v=n&&h(n),b=r&&m(r),x={[IU.focused]:[],[IU.outside]:[],[IU.disabled]:[],[IU.hidden]:[],[IU.today]:[]},y={};for(const t of e){const{date:e,displayMonth:n}=t,r=Boolean(n&&!f(e,n)),h=Boolean(v&&p(e,v)),m=Boolean(b&&g(e,b)),w=Boolean(i&&$U(e,i,o)),_=Boolean(s&&$U(e,s,o))||h||m||!c&&!l&&r||c&&!1===l&&r,S=d(e,u??o.today());r&&x.outside.push(t),w&&x.disabled.push(t),_&&x.hidden.push(t),S&&x.today.push(t),a&&Object.keys(a).forEach((n=>{const r=a?.[n];r&&$U(e,r,o)&&(y[n]?y[n].push(t):y[n]=[t])}))}return e=>{const t={[IU.focused]:!1,[IU.disabled]:!1,[IU.hidden]:!1,[IU.outside]:!1,[IU.today]:!1},n={};for(const n in x){const r=x[n];t[n]=r.some((t=>t===e))}for(const t in y)n[t]=y[t].some((t=>t===e));return{...t,...n}}}(I,t,O,A,l),{isSelected:V,select:W,selected:H}=aG(t,l)??{},{blur:U,focused:Y,isFocusTarget:G,moveFocus:q,setFocused:K}=rG(t,D,B,V??(()=>!1),l),{labelDayButton:X,labelGridcell:Z,labelGrid:Q,labelMonthDropdown:J,labelNav:ee,labelPrevious:te,labelNext:ne,labelWeekday:re,labelWeekNumber:oe,labelWeekNumberHeader:ie,labelYearDropdown:se}=a,ae=(0,$.useMemo)((()=>function(e,t,n){const r=e.today(),o=n?e.startOfBroadcastWeek(r,e):t?e.startOfISOWeek(r):e.startOfWeek(r),i=[];for(let t=0;t<7;t++){const n=e.addDays(o,t);i.push(n)}return i}(l,t.ISOWeek)),[l,t.ISOWeek]),le=void 0!==f||void 0!==g,ce=(0,$.useCallback)((()=>{z&&(F(z),_?.(z))}),[z,F,_]),ue=(0,$.useCallback)((()=>{L&&(F(L),w?.(L))}),[F,L,w]),de=(0,$.useCallback)(((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),K(e),W?.(e.date,t,n),g?.(e.date,t,n)}),[W,g,K]),fe=(0,$.useCallback)(((e,t)=>n=>{K(e),v?.(e.date,t,n)}),[v,K]),he=(0,$.useCallback)(((e,t)=>n=>{U(),m?.(e.date,t,n)}),[U,m]),pe=(0,$.useCallback)(((e,n)=>r=>{const o={ArrowLeft:[r.shiftKey?"month":"day","rtl"===t.dir?"after":"before"],ArrowRight:[r.shiftKey?"month":"day","rtl"===t.dir?"before":"after"],ArrowDown:[r.shiftKey?"year":"week","after"],ArrowUp:[r.shiftKey?"year":"week","before"],PageUp:[r.shiftKey?"year":"month","before"],PageDown:[r.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(o[r.key]){r.preventDefault(),r.stopPropagation();const[e,t]=o[r.key];q(e,t)}b?.(e.date,n,r)}),[q,b,t.dir]),me=(0,$.useCallback)(((e,t)=>n=>{x?.(e.date,t,n)}),[x]),ge=(0,$.useCallback)(((e,t)=>n=>{y?.(e.date,t,n)}),[y]),ve=(0,$.useCallback)((e=>t=>{const n=Number(t.target.value),r=l.setMonth(l.startOfMonth(e),n);F(r)}),[l,F]),be=(0,$.useCallback)((e=>t=>{const n=Number(t.target.value),r=l.setYear(l.startOfMonth(e),n);F(r)}),[l,F]),{className:xe,style:ye}=(0,$.useMemo)((()=>({className:[u[DU.Root],t.className].filter(Boolean).join(" "),style:{...C?.[DU.Root],...t.style}})),[u,t.className,t.style,C]),we=function(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach((([e,n])=>{e.startsWith("data-")&&(t[e]=n)})),t}(t),_e=(0,$.useRef)(null);GY(_e,Boolean(t.animate),{classNames:u,months:R,focused:Y,dateLib:l});const Se={dayPickerProps:t,selected:H,select:W,isSelected:V,months:R,nextMonth:L,previousMonth:z,goToMonth:F,getModifiers:B,components:o,classNames:u,styles:C,labels:a,formatters:i};return $.createElement(nY.Provider,{value:Se},$.createElement(o.Root,{rootRef:t.animate?_e:void 0,className:xe,style:ye,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...we},$.createElement(o.Months,{className:u[DU.Months],style:C?.[DU.Months]},!t.hideNavigation&&!h&&$.createElement(o.Nav,{"data-animated-nav":t.animate?"true":void 0,className:u[DU.Nav],style:C?.[DU.Nav],"aria-label":ee(),onPreviousClick:ce,onNextClick:ue,previousMonth:z,nextMonth:L}),R.map(((e,n)=>$.createElement(o.Month,{"data-animated-month":t.animate?"true":void 0,className:u[DU.Month],style:C?.[DU.Month],key:n,displayIndex:n,calendarMonth:e},"around"===h&&!t.hideNavigation&&0===n&&$.createElement(o.PreviousMonthButton,{type:"button",className:u[DU.PreviousMonthButton],tabIndex:z?void 0:-1,"aria-disabled":!z||void 0,"aria-label":te(z),onClick:ce,"data-animated-button":t.animate?"true":void 0},$.createElement(o.Chevron,{disabled:!z||void 0,className:u[DU.Chevron],orientation:"rtl"===t.dir?"right":"left"})),$.createElement(o.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:u[DU.MonthCaption],style:C?.[DU.MonthCaption],calendarMonth:e,displayIndex:n},d?.startsWith("dropdown")?$.createElement(o.DropdownNav,{className:u[DU.Dropdowns],style:C?.[DU.Dropdowns]},(()=>{const n="dropdown"===d||"dropdown-months"===d?$.createElement(o.MonthsDropdown,{key:"month",className:u[DU.MonthsDropdown],"aria-label":J(),classNames:u,components:o,disabled:Boolean(t.disableNavigation),onChange:ve(e.date),options:MY(e.date,O,A,i,l),style:C?.[DU.Dropdown],value:l.getMonth(e.date)}):$.createElement("span",{key:"month"},E(e.date,l)),r="dropdown"===d||"dropdown-years"===d?$.createElement(o.YearsDropdown,{key:"year",className:u[DU.YearsDropdown],"aria-label":se(l.options),classNames:u,components:o,disabled:Boolean(t.disableNavigation),onChange:be(e.date),options:NY(O,A,i,l,Boolean(t.reverseYears)),style:C?.[DU.Dropdown],value:l.getYear(e.date)}):$.createElement("span",{key:"year"},P(e.date,l));return"year-first"===l.getMonthYearOrder()?[r,n]:[n,r]})(),$.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},k(e.date,l.options,l))):$.createElement(o.CaptionLabel,{className:u[DU.CaptionLabel],role:"status","aria-live":"polite"},k(e.date,l.options,l))),"around"===h&&!t.hideNavigation&&n===p-1&&$.createElement(o.NextMonthButton,{type:"button",className:u[DU.NextMonthButton],tabIndex:L?void 0:-1,"aria-disabled":!L||void 0,"aria-label":ne(L),onClick:ue,"data-animated-button":t.animate?"true":void 0},$.createElement(o.Chevron,{disabled:!L||void 0,className:u[DU.Chevron],orientation:"rtl"===t.dir?"left":"right"})),n===p-1&&"after"===h&&!t.hideNavigation&&$.createElement(o.Nav,{"data-animated-nav":t.animate?"true":void 0,className:u[DU.Nav],style:C?.[DU.Nav],"aria-label":ee(),onPreviousClick:ce,onNextClick:ue,previousMonth:z,nextMonth:L}),$.createElement(o.MonthGrid,{role:"grid","aria-multiselectable":"multiple"===f||"range"===f,"aria-label":Q(e.date,l.options,l)||void 0,className:u[DU.MonthGrid],style:C?.[DU.MonthGrid]},!t.hideWeekdays&&$.createElement(o.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:u[DU.Weekdays],style:C?.[DU.Weekdays]},S&&$.createElement(o.WeekNumberHeader,{"aria-label":ie(l.options),className:u[DU.WeekNumberHeader],style:C?.[DU.WeekNumberHeader],scope:"col"},N()),ae.map((e=>$.createElement(o.Weekday,{"aria-label":re(e,l.options,l),className:u[DU.Weekday],key:String(e),style:C?.[DU.Weekday],scope:"col"},T(e,l.options,l))))),$.createElement(o.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:u[DU.Weeks],style:C?.[DU.Weeks]},e.weeks.map((e=>$.createElement(o.Week,{className:u[DU.Week],key:e.weekNumber,style:C?.[DU.Week],week:e},S&&$.createElement(o.WeekNumber,{week:e,style:C?.[DU.WeekNumber],"aria-label":oe(e.weekNumber,{locale:c}),className:u[DU.WeekNumber],scope:"row",role:"rowheader"},M(e.weekNumber,l)),e.days.map((e=>{const{date:n}=e,r=B(e);if(r[IU.focused]=!r.hidden&&Boolean(Y?.isEqualTo(e)),r[RU.selected]=V?.(n)||r.selected,LU(H)){const{from:e,to:t}=H;r[RU.range_start]=Boolean(e&&t&&l.isSameDay(n,e)),r[RU.range_end]=Boolean(e&&t&&l.isSameDay(n,t)),r[RU.range_middle]=AU(H,n,!0,l)}const i=function(e,t={},n={}){let r={...t?.[DU.Day]};return Object.entries(e).filter((([,e])=>!0===e)).forEach((([e])=>{r={...r,...n?.[e]}})),r}(r,C,t.modifiersStyles),s=function(e,t,n={}){return Object.entries(e).filter((([,e])=>!0===e)).reduce(((e,[r])=>(n[r]?e.push(n[r]):t[IU[r]]?e.push(t[IU[r]]):t[RU[r]]&&e.push(t[RU[r]]),e)),[t[DU.Day]])}(r,u,t.modifiersClassNames),a=le||r.hidden?void 0:Z(n,r,l.options,l);return $.createElement(o.Day,{key:`${l.format(n,"yyyy-MM-dd")}_${l.format(e.displayMonth,"yyyy-MM")}`,day:e,modifiers:r,className:s.join(" "),style:i,role:"gridcell","aria-selected":r.selected||void 0,"aria-label":a,"data-day":l.format(n,"yyyy-MM-dd"),"data-month":e.outside?l.format(n,"yyyy-MM"):void 0,"data-selected":r.selected||void 0,"data-disabled":r.disabled||void 0,"data-hidden":r.hidden||void 0,"data-outside":e.outside||void 0,"data-focused":r.focused||void 0,"data-today":r.today||void 0},!r.hidden&&le?$.createElement(o.DayButton,{className:u[DU.DayButton],style:C?.[DU.DayButton],type:"button",day:e,modifiers:r,disabled:r.disabled||void 0,tabIndex:G(e)?0:-1,"aria-label":X(n,r,l.options,l),onClick:de(e,r),onBlur:he(e,r),onFocus:fe(e,r),onKeyDown:pe(e,r),onMouseEnter:me(e,r),onMouseLeave:ge(e,r)},j(n,l.options,l)):!r.hidden&&j(e.date,l.options,l))}))))))))))),t.footer&&$.createElement(o.Footer,{className:u[DU.Footer],style:C?.[DU.Footer],role:"status","aria-live":"polite"},t.footer)))}!function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"}(eG||(eG={}));const cG=()=>(0,kt.jsx)("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeDasharray:"3.7677",strokeDashoffset:"3.2",strokeWidth:"1",children:(0,kt.jsx)("path",{d:"M29.5,0.5 h-27 a2,2 0 0 0 -2,2 v27 a2,2 0 0 0 2,2 h27 a2,2 0 0 0 2,-2 v-27 a2,2 0 0 0 -2,-2"})}),uG=()=>(0,kt.jsx)("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeDasharray:"3.84516",strokeDashoffset:"1.9226",strokeWidth:"1",children:(0,kt.jsx)("path",{d:"M32,0.5 h-29.5 a2,2 0 0 0 -2,2 v27 a2,2 0 0 0 2,2 h30"})}),dG=()=>(0,kt.jsxs)("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeDasharray:"3.9 4",strokeDashoffset:"2",strokeWidth:"1",children:[(0,kt.jsx)("line",{x1:"0",y1:"0.5",x2:"100",y2:"0.5"}),(0,kt.jsx)("line",{x1:"0",y1:"31.5",x2:"100",y2:"31.5"})]}),fG=()=>(0,kt.jsx)("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeDasharray:"3.84516",strokeDashoffset:"1.9226",strokeWidth:"1",children:(0,kt.jsx)("path",{d:"M0,0.5 h29.5 a2,2 0 0 1 2,2 v27 a2,2 0 0 1 -2,2 h-29.5"})});const hG={preview:"components-calendar__day--preview",preview_start:"components-calendar__day--preview-start",preview_end:"components-calendar__day--preview-end"},pG={animate:!0,showOutsideDays:!1,showWeekNumber:!1,hideWeekdays:!1,captionLayout:"label",fixedWeeks:!1,hideNavigation:!1,classNames:{root:"components-calendar",day:"components-calendar__day",day_button:"components-calendar__day-button",caption_label:"components-calendar__caption-label",button_next:"components-calendar__button-next",button_previous:"components-calendar__button-previous",chevron:"components-calendar__chevron",nav:"components-calendar__nav",month_caption:"components-calendar__month-caption",months:"components-calendar__months",month_grid:"components-calendar__month-grid",weekday:"components-calendar__weekday",today:"components-calendar__day--today",selected:"components-calendar__day--selected",disabled:"components-calendar__day--disabled",hidden:"components-calendar__day--hidden",range_start:"components-calendar__range-start",range_end:"components-calendar__range-end",range_middle:"components-calendar__range-middle",weeks_before_enter:"components-calendar__weeks-before-enter",weeks_before_exit:"components-calendar__weeks-before-exit",weeks_after_enter:"components-calendar__weeks-after-enter",weeks_after_exit:"components-calendar__weeks-after-exit",caption_after_enter:"components-calendar__caption-after-enter",caption_after_exit:"components-calendar__caption-after-exit",caption_before_enter:"components-calendar__caption-before-enter",caption_before_exit:"components-calendar__caption-before-exit"},role:"application",components:{Day:function(e){const{day:t,modifiers:n,children:r,...o}=e;let i;return n.preview_start&&n.preview_end?i=cG:n.preview_start?i=uG:n.preview_end?i=fG:n.preview&&(i=dG),(0,kt.jsxs)("td",{...o,children:[i&&(0,kt.jsx)(i,{}),r]})}}};function mG(e){return Math.min(3,Math.max(1,e))}function gG(e){const t=new Intl.Locale(e);return"getTextInfo"in t?"rtl"===t.getTextInfo().direction:["ar","he","fa","ur","ps","syr","dv","ku","yi"].includes(t.language)}const vG=({locale:e,timeZone:t,mode:n})=>(0,f.useMemo)((()=>{const r=new Intl.DateTimeFormat(e.code,{year:"numeric",month:"long",timeZone:t}),o=new Intl.DateTimeFormat(e.code,{weekday:"narrow",timeZone:t}),i=new Intl.DateTimeFormat(e.code,{weekday:"long",timeZone:t}),s=new Intl.DateTimeFormat(e.code,{weekday:"long",year:"numeric",month:"long",day:"numeric",timeZone:t});return{"aria-label":"single"===n?(0,u.__)("Date calendar"):(0,u.__)("Date range calendar"),labels:{labelGrid:e=>r.format(e),labelGridcell:(e,t)=>{const n=s.format(e);let r=n;return t?.today&&(r=(0,u.sprintf)((0,u.__)("Today, %s"),n)),r},labelNext:()=>(0,u.__)("Go to the Next Month"),labelPrevious:()=>(0,u.__)("Go to the Previous Month"),labelDayButton:(e,t)=>{const n=s.format(e);let r=n;return t?.today&&(r=(0,u.sprintf)((0,u.__)("Today, %s"),n)),t?.selected&&(r=(0,u.sprintf)((0,u.__)("%s, selected"),n)),r},labelWeekday:e=>i.format(e)},locale:e,dir:gG(e.code)?"rtl":"ltr",formatters:{formatWeekdayName:e=>o.format(e),formatCaption:e=>r.format(e)},timeZone:t}}),[e,t,n]);function bG({type:e,message:t}){const n={valid:W$,invalid:H$};return(0,kt.jsxs)("p",{className:c("components-validated-control__indicator",`is-${e}`),children:["validating"===e?(0,kt.jsx)(JT,{className:"components-validated-control__indicator-spinner"}):(0,kt.jsx)(Vy,{className:"components-validated-control__indicator-icon",icon:n[e],size:16,fill:"currentColor"}),t]})}function xG(e,t,n){return t&&!n?(0,kt.jsxs)(kt.Fragment,{children:[e," ",`(${(0,u.__)("Required")})`]}):!t&&n?(0,kt.jsxs)(kt.Fragment,{children:[e," ",`(${(0,u.__)("Optional")})`]}):e}const yG=(0,f.forwardRef)((function({required:e,markWhenOptional:t,onValidate:n,customValidity:r,getValidityTarget:o,children:i},s){const[a,l]=(0,f.useState)(),[c,u]=(0,f.useState)(),[h,p]=(0,f.useState)(!1),m=(0,d.usePrevious)(r?.type);return(0,f.useEffect)((()=>{const e=o(),t=()=>l(e?.validationMessage);return e?.addEventListener("invalid",t),()=>{e?.removeEventListener("invalid",t)}})),(0,f.useEffect)((()=>{if(!h)return;const e=o();if(!r?.type)return e?.setCustomValidity(""),l(e?.validationMessage),void u(void 0);switch(r.type){case"validating":{const t=setTimeout((()=>{e?.setCustomValidity(""),l(void 0),u({type:"validating",message:r.message})}),1e3);return()=>clearTimeout(t)}case"valid":if("valid"===m)break;e?.setCustomValidity(""),l(e?.validationMessage),u({type:"valid",message:r.message});break;case"invalid":var t;e?.setCustomValidity(null!==(t=r.message)&&void 0!==t?t:""),l(e?.validationMessage),u(void 0)}}),[h,r?.type,r?.message,o,m]),(0,kt.jsxs)("div",{className:"components-validated-control",ref:s,onBlur:e=>{h||e.relatedTarget&&e.currentTarget.contains(e.relatedTarget)||(p(!0),n?.())},onKeyDown:vy((e=>{"Enter"===e.key&&n?.()})),children:[(0,f.cloneElement)(i,{label:xG(i.props.label,e,t),onChange:(...e)=>{i.props.onChange?.(...e),(h||a)&&n?.()},required:e}),(0,kt.jsxs)("div",{"aria-live":"polite",children:[a&&(0,kt.jsx)(bG,{type:"invalid",message:a}),!a&&c&&(0,kt.jsx)(bG,{type:c.type,message:c.message})]})]})})),wG=(0,f.forwardRef)((({required:e,onValidate:t,customValidity:n,onChange:r,markWhenOptional:o,...i},s)=>{const a=(0,f.useRef)(null),l=(0,d.useMergeRefs)([s,a]),c=(0,f.useRef)(i.value);return(0,kt.jsx)(yG,{required:e,markWhenOptional:o,onValidate:()=>t?.(c.current),customValidity:n,getValidityTarget:()=>a.current,children:(0,kt.jsx)(Fy,{__next40pxDefaultSize:!0,ref:l,onChange:(e,...t)=>{c.current=e,r?.(e,...t)},...i})})})),_G=(0,f.forwardRef)((({required:e,onValidate:t,customValidity:n,onChange:r,markWhenOptional:o,...i},s)=>{const a=(0,f.useRef)(null),l=(0,d.useMergeRefs)([s,a]),c=(0,f.useRef)(i.checked);return(0,kt.jsx)(yG,{required:e,markWhenOptional:o,ref:l,onValidate:()=>t?.(c.current),customValidity:n,getValidityTarget:()=>a.current?.querySelector('input[type="checkbox"]'),children:(0,kt.jsx)(mN,{__nextHasNoMarginBottom:!0,onChange:e=>{c.current=e,r?.(e)},...i})})})),SG=(0,f.forwardRef)((({required:e,onValidate:t,customValidity:n,onChange:r,markWhenOptional:o,...i},s)=>{const a=(0,f.useRef)(null),l=(0,d.useMergeRefs)([s,a]),c=(0,f.useRef)(i.value);return(0,kt.jsx)(yG,{required:e,markWhenOptional:o,onValidate:()=>t?.(c.current),customValidity:n,getValidityTarget:()=>a.current,children:(0,kt.jsx)(aw,{__next40pxDefaultSize:!0,ref:l,onChange:(e,...t)=>{c.current=e,r?.(e,...t)},...i})})})),CG=(0,f.forwardRef)((({required:e,onValidate:t,customValidity:n,onChange:r,markWhenOptional:o,...i},s)=>{const a=(0,f.useRef)(null),l=(0,d.useMergeRefs)([s,a]),c=(0,f.useRef)(i.value);return(0,kt.jsx)(yG,{required:e,markWhenOptional:o,onValidate:()=>t?.(c.current),customValidity:n,getValidityTarget:()=>a.current,children:(0,kt.jsx)(oC,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,ref:l,onChange:e=>{c.current=e,r?.(e)},...i})})})),kG=(0,f.forwardRef)((({required:e,onValidate:t,customValidity:n,onChange:r,markWhenOptional:o,...i},s)=>{const a=(0,f.useRef)(null),l=(0,d.useMergeRefs)([s,a]),c=(0,f.useRef)(i.selected);return(0,kt.jsx)(yG,{required:e,markWhenOptional:o,ref:l,onValidate:()=>t?.(c.current),customValidity:n,getValidityTarget:()=>a.current?.querySelector('input[type="radio"]'),children:(0,kt.jsx)(HL,{onChange:e=>{c.current=e,r?.(e)},...i})})})),jG=(0,f.forwardRef)((({required:e,onValidate:t,customValidity:n,onChange:r,markWhenOptional:o,...i},s)=>{const a=(0,f.useRef)(null),l=(0,d.useMergeRefs)([s,a]),c=(0,f.useRef)(i.value);return(0,kt.jsx)(yG,{required:e,markWhenOptional:o,onValidate:()=>t?.(c.current),customValidity:n,getValidityTarget:()=>a.current,children:(0,kt.jsx)(tB,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,ref:l,onChange:e=>{c.current=e,r?.(e)},...i})})})),EG=(0,f.forwardRef)((({required:e,onValidate:t,customValidity:n,onChange:r,markWhenOptional:o,...i},s)=>{const a=(0,f.useRef)(null),l=(0,d.useMergeRefs)([s,a]),c=(0,f.useRef)(i.value);return(0,kt.jsx)(yG,{required:e,markWhenOptional:o,onValidate:()=>t?.(c.current),customValidity:n,getValidityTarget:()=>a.current,children:(0,kt.jsx)(aB,{__nextHasNoMarginBottom:!0,ref:l,onChange:e=>{c.current=e,r?.(e)},...i})})})),MG=(0,f.forwardRef)((({required:e,onValidate:t,customValidity:n,onChange:r,markWhenOptional:o,...i},s)=>{const a=(0,f.useRef)(null),l=(0,d.useMergeRefs)([s,a]),c=(0,f.useRef)(i.checked);return(0,f.useEffect)((()=>{a.current&&(a.current.required=null!=e&&e)}),[e]),(0,kt.jsx)(yG,{required:e,markWhenOptional:o,onValidate:()=>t?.(c.current),customValidity:n,getValidityTarget:()=>a.current,children:(0,kt.jsx)(fB,{__nextHasNoMarginBottom:!0,ref:l,onChange:e=>{c.current=e,r?.(e)},...i})})})),NG=(0,f.forwardRef)((({required:e,onValidate:t,customValidity:n,onChange:r,markWhenOptional:o,...i},s)=>{const a=(0,f.useRef)(null),l=(0,f.useRef)(i.value),c=(0,f.useId)();return(0,kt.jsxs)("div",{className:"components-validated-control__wrapper-with-error-delegate",children:[(0,kt.jsx)(yG,{required:e,markWhenOptional:o,onValidate:()=>t?.(l.current),customValidity:n,getValidityTarget:()=>a.current,children:(0,kt.jsx)(pS,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,ref:s,onChange:e=>{l.current=e,r?.(e)},...i})}),(0,kt.jsx)("input",{className:"components-validated-control__error-delegate",type:"radio",ref:a,required:e,checked:void 0!==i.value,tabIndex:-1,name:c,onChange:()=>{},onFocus:e=>{e.target.previousElementSibling?.querySelector('[data-active-item="true"]')?.focus()}})]})})),TG=(0,f.forwardRef)((({required:e,onValidate:t,customValidity:n,onChange:r,markWhenOptional:o,...i},s)=>{const a=(0,f.useRef)(null),l=(0,f.useRef)(i.value);return(0,kt.jsxs)("div",{className:"components-validated-control__wrapper-with-error-delegate",ref:s,children:[(0,kt.jsx)(yG,{required:e,markWhenOptional:o,onValidate:()=>t?.(l.current),customValidity:n,getValidityTarget:()=>a.current,children:(0,kt.jsx)(cA,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,...i,onChange:(e,...t)=>{l.current=e,r?.(e,...t)}})}),(0,kt.jsx)("input",{className:"components-validated-control__error-delegate",type:"text",ref:a,required:e,value:l.current&&l.current.length>0?"hasvalue":"",tabIndex:-1,onChange:()=>{},onFocus:e=>{e.target.previousElementSibling?.querySelector('input[type="text"]')?.focus()}})]})})),PG={};F$(PG,{__experimentalPopoverLegacyPositionToPlacement:ns,ComponentsContext:vs,Tabs:z$,Theme:C$,Menu:v$,kebabCase:ww,withIgnoreIMEEvents:vy,Badge:U$,normalizeTextString:yw,DateCalendar:({defaultSelected:e,selected:t,onSelect:n,numberOfMonths:r=1,locale:o=uH,timeZone:i,...s})=>{const a=vG({locale:o,timeZone:i,mode:"single"}),l=(0,f.useCallback)(((e,t,r,o)=>{n?.(null!=e?e:void 0,t,r,o)}),[n]),[c,u]=lS({defaultValue:e,value:t,onChange:l});return(0,kt.jsx)(lG,{...pG,...a,...s,mode:"single",numberOfMonths:mG(r),selected:null!=c?c:void 0,onSelect:u})},DateRangeCalendar:({defaultSelected:e,selected:t,onSelect:n,numberOfMonths:r=1,excludeDisabled:o,min:i,max:s,disabled:a,locale:l=uH,timeZone:c,...u})=>{const d=vG({locale:l,timeZone:c,mode:"range"}),h=(0,f.useCallback)(((e,t,r,o)=>{n?.(null!=e?e:void 0,t,r,o)}),[n]),[p,m]=lS({defaultValue:e,value:t,onChange:h}),[g,v]=(0,f.useState)(void 0),b=function({selected:e,hoveredDate:t,excludeDisabled:n,min:r,max:o,disabled:i}){return(0,f.useMemo)((()=>{if(!t||!e?.from)return;let s,a;var l;if(t<e.from)s={from:t,to:e.from},a={from:t,to:null!==(l=e.to)&&void 0!==l?l:e.from};else if(e.to&&t>e.from&&t<e.to)s={from:e.from,to:t},a={from:e.from,to:t};else if(t>e.from){var c;s={from:null!==(c=e.to)&&void 0!==c?c:e.from,to:t},a={from:e.from,to:t}}return void 0!==r&&r>0&&a&&XD(a.to,a.from)<r&&(s={from:t,to:t}),void 0!==o&&o>0&&a&&XD(a.to,a.from)>o&&(s={from:t,to:t}),n&&i&&a&&iG(a,i)&&(s={from:t,to:t}),s}),[e,t,n,r,o,i])}({selected:p,hoveredDate:g,excludeDisabled:o,min:i,max:s,disabled:a}),x=(0,f.useMemo)((()=>({preview:b,preview_start:b?.from,preview_end:b?.to})),[b]);return(0,kt.jsx)(lG,{...pG,...d,...u,mode:"range",numberOfMonths:mG(r),disabled:a,excludeDisabled:o,min:i,max:s,selected:null!=p?p:void 0,onSelect:m,onDayMouseEnter:e=>v(e),onDayMouseLeave:()=>v(void 0),modifiers:x,modifiersClassNames:hG})},TZDate:tH,Picker:Yk,ValidatedInputControl:wG,ValidatedCheckboxControl:_G,ValidatedNumberControl:SG,ValidatedSelectControl:CG,ValidatedRadioControl:kG,ValidatedTextControl:jG,ValidatedTextareaControl:EG,ValidatedToggleControl:MG,ValidatedToggleGroupControl:NG,ValidatedFormTokenField:TG})})(),(window.wp=window.wp||{}).components=i})(); plugins.js 0000644 00000033230 15121363554 0006571 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
PluginArea: () => (/* reexport */ plugin_area_default),
getPlugin: () => (/* reexport */ getPlugin),
getPlugins: () => (/* reexport */ getPlugins),
registerPlugin: () => (/* reexport */ registerPlugin),
unregisterPlugin: () => (/* reexport */ unregisterPlugin),
usePluginContext: () => (/* reexport */ usePluginContext),
withPluginContext: () => (/* reexport */ withPluginContext)
});
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// ./node_modules/memize/dist/index.js
/**
* Memize options object.
*
* @typedef MemizeOptions
*
* @property {number} [maxSize] Maximum size of the cache.
*/
/**
* Internal cache entry.
*
* @typedef MemizeCacheNode
*
* @property {?MemizeCacheNode|undefined} [prev] Previous node.
* @property {?MemizeCacheNode|undefined} [next] Next node.
* @property {Array<*>} args Function arguments for cache
* entry.
* @property {*} val Function result.
*/
/**
* Properties of the enhanced function for controlling cache.
*
* @typedef MemizeMemoizedFunction
*
* @property {()=>void} clear Clear the cache.
*/
/**
* Accepts a function to be memoized, and returns a new memoized function, with
* optional options.
*
* @template {(...args: any[]) => any} F
*
* @param {F} fn Function to memoize.
* @param {MemizeOptions} [options] Options object.
*
* @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function.
*/
function memize(fn, options) {
var size = 0;
/** @type {?MemizeCacheNode|undefined} */
var head;
/** @type {?MemizeCacheNode|undefined} */
var tail;
options = options || {};
function memoized(/* ...args */) {
var node = head,
len = arguments.length,
args,
i;
searchCache: while (node) {
// Perform a shallow equality test to confirm that whether the node
// under test is a candidate for the arguments passed. Two arrays
// are shallowly equal if their length matches and each entry is
// strictly equal between the two sets. Avoid abstracting to a
// function which could incur an arguments leaking deoptimization.
// Check whether node arguments match arguments length
if (node.args.length !== arguments.length) {
node = node.next;
continue;
}
// Check whether node arguments match arguments values
for (i = 0; i < len; i++) {
if (node.args[i] !== arguments[i]) {
node = node.next;
continue searchCache;
}
}
// At this point we can assume we've found a match
// Surface matched node to head if not already
if (node !== head) {
// As tail, shift to previous. Must only shift if not also
// head, since if both head and tail, there is no previous.
if (node === tail) {
tail = node.prev;
}
// Adjust siblings to point to each other. If node was tail,
// this also handles new tail's empty `next` assignment.
/** @type {MemizeCacheNode} */ (node.prev).next = node.next;
if (node.next) {
node.next.prev = node.prev;
}
node.next = head;
node.prev = null;
/** @type {MemizeCacheNode} */ (head).prev = node;
head = node;
}
// Return immediately
return node.val;
}
// No cached value found. Continue to insertion phase:
// Create a copy of arguments (avoid leaking deoptimization)
args = new Array(len);
for (i = 0; i < len; i++) {
args[i] = arguments[i];
}
node = {
args: args,
// Generate the result from original function
val: fn.apply(null, args),
};
// Don't need to check whether node is already head, since it would
// have been returned above already if it was
// Shift existing head down list
if (head) {
head.prev = node;
node.next = head;
} else {
// If no head, follows that there's no tail (at initial or reset)
tail = node;
}
// Trim tail if we're reached max size and are pending cache insertion
if (size === /** @type {MemizeOptions} */ (options).maxSize) {
tail = /** @type {MemizeCacheNode} */ (tail).prev;
/** @type {MemizeCacheNode} */ (tail).next = null;
} else {
size++;
}
head = node;
return node.val;
}
memoized.clear = function () {
head = null;
tail = null;
size = 0;
};
// Ignore reason: There's not a clear solution to create an intersection of
// the function with additional properties, where the goal is to retain the
// function signature of the incoming argument and add control properties
// on the return value.
// @ts-ignore
return memoized;
}
;// external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// external ["wp","hooks"]
const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
;// external ["wp","isShallowEqual"]
const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"];
var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject);
;// external ["wp","compose"]
const external_wp_compose_namespaceObject = window["wp"]["compose"];
;// external ["wp","deprecated"]
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
;// ./node_modules/@wordpress/plugins/build-module/components/plugin-context/index.js
const Context = (0,external_wp_element_namespaceObject.createContext)({
name: null,
icon: null
});
Context.displayName = "PluginContext";
const PluginContextProvider = Context.Provider;
function usePluginContext() {
return (0,external_wp_element_namespaceObject.useContext)(Context);
}
const withPluginContext = (mapContextToProps) => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((OriginalComponent) => {
external_wp_deprecated_default()("wp.plugins.withPluginContext", {
since: "6.8.0",
alternative: "wp.plugins.usePluginContext"
});
return (props) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Context.Consumer, { children: (context) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
OriginalComponent,
{
...props,
...mapContextToProps(context, props)
}
) });
}, "withPluginContext");
;// ./node_modules/@wordpress/plugins/build-module/components/plugin-error-boundary/index.js
class PluginErrorBoundary extends external_wp_element_namespaceObject.Component {
constructor(props) {
super(props);
this.state = {
hasError: false
};
}
static getDerivedStateFromError() {
return { hasError: true };
}
componentDidCatch(error) {
const { name, onError } = this.props;
if (onError) {
onError(name, error);
}
}
render() {
if (!this.state.hasError) {
return this.props.children;
}
return null;
}
}
;// external ["wp","primitives"]
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
;// ./node_modules/@wordpress/icons/build-module/library/plugins.js
var plugins_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z" }) });
;// ./node_modules/@wordpress/plugins/build-module/api/index.js
const plugins = {};
function registerPlugin(name, settings) {
if (typeof settings !== "object") {
console.error("No settings object provided!");
return null;
}
if (typeof name !== "string") {
console.error("Plugin name must be string.");
return null;
}
if (!/^[a-z][a-z0-9-]*$/.test(name)) {
console.error(
'Plugin name must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".'
);
return null;
}
if (plugins[name]) {
console.error(`Plugin "${name}" is already registered.`);
}
settings = (0,external_wp_hooks_namespaceObject.applyFilters)(
"plugins.registerPlugin",
settings,
name
);
const { render, scope } = settings;
if (typeof render !== "function") {
console.error(
'The "render" property must be specified and must be a valid function.'
);
return null;
}
if (scope) {
if (typeof scope !== "string") {
console.error("Plugin scope must be string.");
return null;
}
if (!/^[a-z][a-z0-9-]*$/.test(scope)) {
console.error(
'Plugin scope must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-page".'
);
return null;
}
}
plugins[name] = {
name,
icon: plugins_default,
...settings
};
(0,external_wp_hooks_namespaceObject.doAction)("plugins.pluginRegistered", settings, name);
return settings;
}
function unregisterPlugin(name) {
if (!plugins[name]) {
console.error('Plugin "' + name + '" is not registered.');
return;
}
const oldPlugin = plugins[name];
delete plugins[name];
(0,external_wp_hooks_namespaceObject.doAction)("plugins.pluginUnregistered", oldPlugin, name);
return oldPlugin;
}
function getPlugin(name) {
return plugins[name];
}
function getPlugins(scope) {
return Object.values(plugins).filter(
(plugin) => plugin.scope === scope
);
}
;// ./node_modules/@wordpress/plugins/build-module/components/plugin-area/index.js
const getPluginContext = memize(
(icon, name) => ({
icon,
name
})
);
function PluginArea({
scope,
onError
}) {
const store = (0,external_wp_element_namespaceObject.useMemo)(() => {
let lastValue = [];
return {
subscribe(listener) {
(0,external_wp_hooks_namespaceObject.addAction)(
"plugins.pluginRegistered",
"core/plugins/plugin-area/plugins-registered",
listener
);
(0,external_wp_hooks_namespaceObject.addAction)(
"plugins.pluginUnregistered",
"core/plugins/plugin-area/plugins-unregistered",
listener
);
return () => {
(0,external_wp_hooks_namespaceObject.removeAction)(
"plugins.pluginRegistered",
"core/plugins/plugin-area/plugins-registered"
);
(0,external_wp_hooks_namespaceObject.removeAction)(
"plugins.pluginUnregistered",
"core/plugins/plugin-area/plugins-unregistered"
);
};
},
getValue() {
const nextValue = getPlugins(scope);
if (!external_wp_isShallowEqual_default()(lastValue, nextValue)) {
lastValue = nextValue;
}
return lastValue;
}
};
}, [scope]);
const plugins = (0,external_wp_element_namespaceObject.useSyncExternalStore)(
store.subscribe,
store.getValue,
store.getValue
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { style: { display: "none" }, children: plugins.map(({ icon, name, render: Plugin }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
PluginContextProvider,
{
value: getPluginContext(icon, name),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PluginErrorBoundary, { name, onError, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Plugin, {}) })
},
name
)) });
}
var plugin_area_default = PluginArea;
;// ./node_modules/@wordpress/plugins/build-module/components/index.js
;// ./node_modules/@wordpress/plugins/build-module/index.js
(window.wp = window.wp || {}).plugins = __webpack_exports__;
/******/ })()
; edit-widgets.js 0000644 00000460600 15121363554 0007506 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
initialize: () => (/* binding */ initialize),
initializeEditor: () => (/* binding */ initializeEditor),
reinitializeEditor: () => (/* binding */ reinitializeEditor),
store: () => (/* reexport */ store_store)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js
var actions_namespaceObject = {};
__webpack_require__.r(actions_namespaceObject);
__webpack_require__.d(actions_namespaceObject, {
closeModal: () => (closeModal),
disableComplementaryArea: () => (disableComplementaryArea),
enableComplementaryArea: () => (enableComplementaryArea),
openModal: () => (openModal),
pinItem: () => (pinItem),
setDefaultComplementaryArea: () => (setDefaultComplementaryArea),
setFeatureDefaults: () => (setFeatureDefaults),
setFeatureValue: () => (setFeatureValue),
toggleFeature: () => (toggleFeature),
unpinItem: () => (unpinItem)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/selectors.js
var selectors_namespaceObject = {};
__webpack_require__.r(selectors_namespaceObject);
__webpack_require__.d(selectors_namespaceObject, {
getActiveComplementaryArea: () => (getActiveComplementaryArea),
isComplementaryAreaLoading: () => (isComplementaryAreaLoading),
isFeatureActive: () => (isFeatureActive),
isItemPinned: () => (isItemPinned),
isModalActive: () => (isModalActive)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/actions.js
var store_actions_namespaceObject = {};
__webpack_require__.r(store_actions_namespaceObject);
__webpack_require__.d(store_actions_namespaceObject, {
closeGeneralSidebar: () => (closeGeneralSidebar),
lockWidgetSaving: () => (lockWidgetSaving),
moveBlockToWidgetArea: () => (moveBlockToWidgetArea),
persistStubPost: () => (persistStubPost),
saveEditedWidgetAreas: () => (saveEditedWidgetAreas),
saveWidgetArea: () => (saveWidgetArea),
saveWidgetAreas: () => (saveWidgetAreas),
setIsInserterOpened: () => (setIsInserterOpened),
setIsListViewOpened: () => (setIsListViewOpened),
setIsWidgetAreaOpen: () => (setIsWidgetAreaOpen),
setWidgetAreasOpenState: () => (setWidgetAreasOpenState),
setWidgetIdForClientId: () => (setWidgetIdForClientId),
unlockWidgetSaving: () => (unlockWidgetSaving)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/resolvers.js
var resolvers_namespaceObject = {};
__webpack_require__.r(resolvers_namespaceObject);
__webpack_require__.d(resolvers_namespaceObject, {
getWidgetAreas: () => (getWidgetAreas),
getWidgets: () => (getWidgets)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/selectors.js
var store_selectors_namespaceObject = {};
__webpack_require__.r(store_selectors_namespaceObject);
__webpack_require__.d(store_selectors_namespaceObject, {
__experimentalGetInsertionPoint: () => (__experimentalGetInsertionPoint),
canInsertBlockInWidgetArea: () => (canInsertBlockInWidgetArea),
getEditedWidgetAreas: () => (getEditedWidgetAreas),
getIsWidgetAreaOpen: () => (getIsWidgetAreaOpen),
getParentWidgetAreaBlock: () => (getParentWidgetAreaBlock),
getReferenceWidgetBlocks: () => (getReferenceWidgetBlocks),
getWidget: () => (getWidget),
getWidgetAreaForWidgetId: () => (getWidgetAreaForWidgetId),
getWidgetAreas: () => (selectors_getWidgetAreas),
getWidgets: () => (selectors_getWidgets),
isInserterOpened: () => (isInserterOpened),
isListViewOpened: () => (isListViewOpened),
isSavingWidgetAreas: () => (isSavingWidgetAreas),
isWidgetSavingLocked: () => (isWidgetSavingLocked)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/private-selectors.js
var private_selectors_namespaceObject = {};
__webpack_require__.r(private_selectors_namespaceObject);
__webpack_require__.d(private_selectors_namespaceObject, {
getInserterSidebarToggleRef: () => (getInserterSidebarToggleRef),
getListViewToggleRef: () => (getListViewToggleRef)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/index.js
var widget_area_namespaceObject = {};
__webpack_require__.r(widget_area_namespaceObject);
__webpack_require__.d(widget_area_namespaceObject, {
metadata: () => (block_namespaceObject),
name: () => (widget_area_name),
settings: () => (settings)
});
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// external ["wp","blocks"]
const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
;// external ["wp","data"]
const external_wp_data_namespaceObject = window["wp"]["data"];
;// external ["wp","deprecated"]
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
;// external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// external ["wp","blockLibrary"]
const external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"];
;// external ["wp","coreData"]
const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
;// external ["wp","widgets"]
const external_wp_widgets_namespaceObject = window["wp"]["widgets"];
;// external ["wp","preferences"]
const external_wp_preferences_namespaceObject = window["wp"]["preferences"];
;// external ["wp","apiFetch"]
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
;// ./node_modules/@wordpress/edit-widgets/build-module/store/reducer.js
function widgetAreasOpenState(state = {}, action) {
const { type } = action;
switch (type) {
case "SET_WIDGET_AREAS_OPEN_STATE": {
return action.widgetAreasOpenState;
}
case "SET_IS_WIDGET_AREA_OPEN": {
const { clientId, isOpen } = action;
return {
...state,
[clientId]: isOpen
};
}
default: {
return state;
}
}
}
function blockInserterPanel(state = false, action) {
switch (action.type) {
case "SET_IS_LIST_VIEW_OPENED":
return action.isOpen ? false : state;
case "SET_IS_INSERTER_OPENED":
return action.value;
}
return state;
}
function listViewPanel(state = false, action) {
switch (action.type) {
case "SET_IS_INSERTER_OPENED":
return action.value ? false : state;
case "SET_IS_LIST_VIEW_OPENED":
return action.isOpen;
}
return state;
}
function listViewToggleRef(state = { current: null }) {
return state;
}
function inserterSidebarToggleRef(state = { current: null }) {
return state;
}
function widgetSavingLock(state = {}, action) {
switch (action.type) {
case "LOCK_WIDGET_SAVING":
return { ...state, [action.lockName]: true };
case "UNLOCK_WIDGET_SAVING": {
const { [action.lockName]: removedLockName, ...restState } = state;
return restState;
}
}
return state;
}
var reducer_default = (0,external_wp_data_namespaceObject.combineReducers)({
blockInserterPanel,
inserterSidebarToggleRef,
listViewPanel,
listViewToggleRef,
widgetAreasOpenState,
widgetSavingLock
});
;// external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// external ["wp","notices"]
const external_wp_notices_namespaceObject = window["wp"]["notices"];
;// ./node_modules/clsx/dist/clsx.mjs
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx);
;// external ["wp","components"]
const external_wp_components_namespaceObject = window["wp"]["components"];
;// external ["wp","primitives"]
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
;// ./node_modules/@wordpress/icons/build-module/library/check.js
var check_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/star-filled.js
var star_filled_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 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" }) });
;// ./node_modules/@wordpress/icons/build-module/library/star-empty.js
var star_empty_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
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",
clipRule: "evenodd"
}
) });
;// external ["wp","viewport"]
const external_wp_viewport_namespaceObject = window["wp"]["viewport"];
;// external ["wp","compose"]
const external_wp_compose_namespaceObject = window["wp"]["compose"];
;// external ["wp","plugins"]
const external_wp_plugins_namespaceObject = window["wp"]["plugins"];
;// ./node_modules/@wordpress/icons/build-module/library/close-small.js
var close_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 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" }) });
;// ./node_modules/@wordpress/interface/build-module/store/deprecated.js
function normalizeComplementaryAreaScope(scope) {
if (["core/edit-post", "core/edit-site"].includes(scope)) {
external_wp_deprecated_default()(`${scope} interface scope`, {
alternative: "core interface scope",
hint: "core/edit-post and core/edit-site are merging.",
version: "6.6"
});
return "core";
}
return scope;
}
function normalizeComplementaryAreaName(scope, name) {
if (scope === "core" && name === "edit-site/template") {
external_wp_deprecated_default()(`edit-site/template sidebar`, {
alternative: "edit-post/document",
version: "6.6"
});
return "edit-post/document";
}
if (scope === "core" && name === "edit-site/block-inspector") {
external_wp_deprecated_default()(`edit-site/block-inspector sidebar`, {
alternative: "edit-post/block",
version: "6.6"
});
return "edit-post/block";
}
return name;
}
;// ./node_modules/@wordpress/interface/build-module/store/actions.js
const setDefaultComplementaryArea = (scope, area) => {
scope = normalizeComplementaryAreaScope(scope);
area = normalizeComplementaryAreaName(scope, area);
return {
type: "SET_DEFAULT_COMPLEMENTARY_AREA",
scope,
area
};
};
const enableComplementaryArea = (scope, area) => ({ registry, dispatch }) => {
if (!area) {
return;
}
scope = normalizeComplementaryAreaScope(scope);
area = normalizeComplementaryAreaName(scope, area);
const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, "isComplementaryAreaVisible");
if (!isComplementaryAreaVisible) {
registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, "isComplementaryAreaVisible", true);
}
dispatch({
type: "ENABLE_COMPLEMENTARY_AREA",
scope,
area
});
};
const disableComplementaryArea = (scope) => ({ registry }) => {
scope = normalizeComplementaryAreaScope(scope);
const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, "isComplementaryAreaVisible");
if (isComplementaryAreaVisible) {
registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, "isComplementaryAreaVisible", false);
}
};
const pinItem = (scope, item) => ({ registry }) => {
if (!item) {
return;
}
scope = normalizeComplementaryAreaScope(scope);
item = normalizeComplementaryAreaName(scope, item);
const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, "pinnedItems");
if (pinnedItems?.[item] === true) {
return;
}
registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, "pinnedItems", {
...pinnedItems,
[item]: true
});
};
const unpinItem = (scope, item) => ({ registry }) => {
if (!item) {
return;
}
scope = normalizeComplementaryAreaScope(scope);
item = normalizeComplementaryAreaName(scope, item);
const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, "pinnedItems");
registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, "pinnedItems", {
...pinnedItems,
[item]: false
});
};
function toggleFeature(scope, featureName) {
return function({ registry }) {
external_wp_deprecated_default()(`dispatch( 'core/interface' ).toggleFeature`, {
since: "6.0",
alternative: `dispatch( 'core/preferences' ).toggle`
});
registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(scope, featureName);
};
}
function setFeatureValue(scope, featureName, value) {
return function({ registry }) {
external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureValue`, {
since: "6.0",
alternative: `dispatch( 'core/preferences' ).set`
});
registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, featureName, !!value);
};
}
function setFeatureDefaults(scope, defaults) {
return function({ registry }) {
external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureDefaults`, {
since: "6.0",
alternative: `dispatch( 'core/preferences' ).setDefaults`
});
registry.dispatch(external_wp_preferences_namespaceObject.store).setDefaults(scope, defaults);
};
}
function openModal(name) {
return {
type: "OPEN_MODAL",
name
};
}
function closeModal() {
return {
type: "CLOSE_MODAL"
};
}
;// ./node_modules/@wordpress/interface/build-module/store/selectors.js
const getActiveComplementaryArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (state, scope) => {
scope = normalizeComplementaryAreaScope(scope);
const isComplementaryAreaVisible = select(external_wp_preferences_namespaceObject.store).get(
scope,
"isComplementaryAreaVisible"
);
if (isComplementaryAreaVisible === void 0) {
return void 0;
}
if (isComplementaryAreaVisible === false) {
return null;
}
return state?.complementaryAreas?.[scope];
}
);
const isComplementaryAreaLoading = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (state, scope) => {
scope = normalizeComplementaryAreaScope(scope);
const isVisible = select(external_wp_preferences_namespaceObject.store).get(
scope,
"isComplementaryAreaVisible"
);
const identifier = state?.complementaryAreas?.[scope];
return isVisible && identifier === void 0;
}
);
const isItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (state, scope, item) => {
scope = normalizeComplementaryAreaScope(scope);
item = normalizeComplementaryAreaName(scope, item);
const pinnedItems = select(external_wp_preferences_namespaceObject.store).get(
scope,
"pinnedItems"
);
return pinnedItems?.[item] ?? true;
}
);
const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (state, scope, featureName) => {
external_wp_deprecated_default()(
`select( 'core/interface' ).isFeatureActive( scope, featureName )`,
{
since: "6.0",
alternative: `select( 'core/preferences' ).get( scope, featureName )`
}
);
return !!select(external_wp_preferences_namespaceObject.store).get(scope, featureName);
}
);
function isModalActive(state, modalName) {
return state.activeModal === modalName;
}
;// ./node_modules/@wordpress/interface/build-module/store/reducer.js
function complementaryAreas(state = {}, action) {
switch (action.type) {
case "SET_DEFAULT_COMPLEMENTARY_AREA": {
const { scope, area } = action;
if (state[scope]) {
return state;
}
return {
...state,
[scope]: area
};
}
case "ENABLE_COMPLEMENTARY_AREA": {
const { scope, area } = action;
return {
...state,
[scope]: area
};
}
}
return state;
}
function activeModal(state = null, action) {
switch (action.type) {
case "OPEN_MODAL":
return action.name;
case "CLOSE_MODAL":
return null;
}
return state;
}
var reducer_reducer_default = (0,external_wp_data_namespaceObject.combineReducers)({
complementaryAreas,
activeModal
});
;// ./node_modules/@wordpress/interface/build-module/store/constants.js
const STORE_NAME = "core/interface";
;// ./node_modules/@wordpress/interface/build-module/store/index.js
const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
reducer: reducer_reducer_default,
actions: actions_namespaceObject,
selectors: selectors_namespaceObject
});
(0,external_wp_data_namespaceObject.register)(store);
;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-toggle/index.js
function roleSupportsCheckedState(role) {
return [
"checkbox",
"option",
"radio",
"switch",
"menuitemcheckbox",
"menuitemradio",
"treeitem"
].includes(role);
}
function ComplementaryAreaToggle({
as = external_wp_components_namespaceObject.Button,
scope,
identifier: identifierProp,
icon: iconProp,
selectedIcon,
name,
shortcut,
...props
}) {
const ComponentToUse = as;
const context = (0,external_wp_plugins_namespaceObject.usePluginContext)();
const icon = iconProp || context.icon;
const identifier = identifierProp || `${context.name}/${name}`;
const isSelected = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store).getActiveComplementaryArea(scope) === identifier,
[identifier, scope]
);
const { enableComplementaryArea, disableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ComponentToUse,
{
icon: selectedIcon && isSelected ? selectedIcon : icon,
"aria-controls": identifier.replace("/", ":"),
"aria-checked": roleSupportsCheckedState(props.role) ? isSelected : void 0,
onClick: () => {
if (isSelected) {
disableComplementaryArea(scope);
} else {
enableComplementaryArea(scope, identifier);
}
},
shortcut,
...props
}
);
}
;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-header/index.js
const ComplementaryAreaHeader = ({
children,
className,
toggleButtonProps
}) => {
const toggleButton = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaToggle, { icon: close_small_default, ...toggleButtonProps });
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
className: dist_clsx(
"components-panel__header",
"interface-complementary-area-header",
className
),
tabIndex: -1,
children: [
children,
toggleButton
]
}
);
};
var complementary_area_header_default = ComplementaryAreaHeader;
;// ./node_modules/@wordpress/interface/build-module/components/action-item/index.js
const noop = () => {
};
function ActionItemSlot({
name,
as: Component = external_wp_components_namespaceObject.MenuGroup,
fillProps = {},
bubblesVirtually,
...props
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Slot,
{
name,
bubblesVirtually,
fillProps,
children: (fills) => {
if (!external_wp_element_namespaceObject.Children.toArray(fills).length) {
return null;
}
const initializedByPlugins = [];
external_wp_element_namespaceObject.Children.forEach(
fills,
({
props: { __unstableExplicitMenuItem, __unstableTarget }
}) => {
if (__unstableTarget && __unstableExplicitMenuItem) {
initializedByPlugins.push(__unstableTarget);
}
}
);
const children = external_wp_element_namespaceObject.Children.map(fills, (child) => {
if (!child.props.__unstableExplicitMenuItem && initializedByPlugins.includes(
child.props.__unstableTarget
)) {
return null;
}
return child;
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { ...props, children });
}
}
);
}
function ActionItem({ name, as: Component = external_wp_components_namespaceObject.Button, onClick, ...props }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, { name, children: ({ onClick: fpOnClick }) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Component,
{
onClick: onClick || fpOnClick ? (...args) => {
(onClick || noop)(...args);
(fpOnClick || noop)(...args);
} : void 0,
...props
}
);
} });
}
ActionItem.Slot = ActionItemSlot;
var action_item_default = ActionItem;
;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-more-menu-item/index.js
const PluginsMenuItem = ({
// Menu item is marked with unstable prop for backward compatibility.
// They are removed so they don't leak to DOM elements.
// @see https://github.com/WordPress/gutenberg/issues/14457
__unstableExplicitMenuItem,
__unstableTarget,
...restProps
}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { ...restProps });
function ComplementaryAreaMoreMenuItem({
scope,
target,
__unstableExplicitMenuItem,
...props
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ComplementaryAreaToggle,
{
as: (toggleProps) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
action_item_default,
{
__unstableExplicitMenuItem,
__unstableTarget: `${scope}/${target}`,
as: PluginsMenuItem,
name: `${scope}/plugin-more-menu`,
...toggleProps
}
);
},
role: "menuitemcheckbox",
selectedIcon: check_default,
name: target,
scope,
...props
}
);
}
;// ./node_modules/@wordpress/interface/build-module/components/pinned-items/index.js
function PinnedItems({ scope, ...props }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, { name: `PinnedItems/${scope}`, ...props });
}
function PinnedItemsSlot({ scope, className, ...props }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Slot, { name: `PinnedItems/${scope}`, ...props, children: (fills) => fills?.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: dist_clsx(
className,
"interface-pinned-items"
),
children: fills
}
) });
}
PinnedItems.Slot = PinnedItemsSlot;
var pinned_items_default = PinnedItems;
;// ./node_modules/@wordpress/interface/build-module/components/complementary-area/index.js
const ANIMATION_DURATION = 0.3;
function ComplementaryAreaSlot({ scope, ...props }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Slot, { name: `ComplementaryArea/${scope}`, ...props });
}
const SIDEBAR_WIDTH = 280;
const variants = {
open: { width: SIDEBAR_WIDTH },
closed: { width: 0 },
mobileOpen: { width: "100vw" }
};
function ComplementaryAreaFill({
activeArea,
isActive,
scope,
children,
className,
id
}) {
const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
const previousActiveArea = (0,external_wp_compose_namespaceObject.usePrevious)(activeArea);
const previousIsActive = (0,external_wp_compose_namespaceObject.usePrevious)(isActive);
const [, setState] = (0,external_wp_element_namespaceObject.useState)({});
(0,external_wp_element_namespaceObject.useEffect)(() => {
setState({});
}, [isActive]);
const transition = {
type: "tween",
duration: disableMotion || isMobileViewport || !!previousActiveArea && !!activeArea && activeArea !== previousActiveArea ? 0 : ANIMATION_DURATION,
ease: [0.6, 0, 0.4, 1]
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, { name: `ComplementaryArea/${scope}`, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { initial: false, children: (previousIsActive || isActive) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
variants,
initial: "closed",
animate: isMobileViewport ? "mobileOpen" : "open",
exit: "closed",
transition,
className: "interface-complementary-area__fill",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
id,
className,
style: {
width: isMobileViewport ? "100vw" : SIDEBAR_WIDTH
},
children
}
)
}
) }) });
}
function useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall) {
const previousIsSmallRef = (0,external_wp_element_namespaceObject.useRef)(false);
const shouldOpenWhenNotSmallRef = (0,external_wp_element_namespaceObject.useRef)(false);
const { enableComplementaryArea, disableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (isActive && isSmall && !previousIsSmallRef.current) {
disableComplementaryArea(scope);
shouldOpenWhenNotSmallRef.current = true;
} else if (
// If there is a flag indicating the complementary area should be
// enabled when we go from small to big window size and we are going
// from a small to big window size.
shouldOpenWhenNotSmallRef.current && !isSmall && previousIsSmallRef.current
) {
shouldOpenWhenNotSmallRef.current = false;
enableComplementaryArea(scope, identifier);
} else if (
// If the flag is indicating the current complementary should be
// reopened but another complementary area becomes active, remove
// the flag.
shouldOpenWhenNotSmallRef.current && activeArea && activeArea !== identifier
) {
shouldOpenWhenNotSmallRef.current = false;
}
if (isSmall !== previousIsSmallRef.current) {
previousIsSmallRef.current = isSmall;
}
}, [
isActive,
isSmall,
scope,
identifier,
activeArea,
disableComplementaryArea,
enableComplementaryArea
]);
}
function ComplementaryArea({
children,
className,
closeLabel = (0,external_wp_i18n_namespaceObject.__)("Close plugin"),
identifier: identifierProp,
header,
headerClassName,
icon: iconProp,
isPinnable = true,
panelClassName,
scope,
name,
title,
toggleShortcut,
isActiveByDefault
}) {
const context = (0,external_wp_plugins_namespaceObject.usePluginContext)();
const icon = iconProp || context.icon;
const identifier = identifierProp || `${context.name}/${name}`;
const [isReady, setIsReady] = (0,external_wp_element_namespaceObject.useState)(false);
const {
isLoading,
isActive,
isPinned,
activeArea,
isSmall,
isLarge,
showIconLabels
} = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getActiveComplementaryArea,
isComplementaryAreaLoading,
isItemPinned
} = select(store);
const { get } = select(external_wp_preferences_namespaceObject.store);
const _activeArea = getActiveComplementaryArea(scope);
return {
isLoading: isComplementaryAreaLoading(scope),
isActive: _activeArea === identifier,
isPinned: isItemPinned(scope, identifier),
activeArea: _activeArea,
isSmall: select(external_wp_viewport_namespaceObject.store).isViewportMatch("< medium"),
isLarge: select(external_wp_viewport_namespaceObject.store).isViewportMatch("large"),
showIconLabels: get("core", "showIconLabels")
};
},
[identifier, scope]
);
const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
useAdjustComplementaryListener(
scope,
identifier,
activeArea,
isActive,
isSmall
);
const {
enableComplementaryArea,
disableComplementaryArea,
pinItem,
unpinItem
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (isActiveByDefault && activeArea === void 0 && !isSmall) {
enableComplementaryArea(scope, identifier);
} else if (activeArea === void 0 && isSmall) {
disableComplementaryArea(scope, identifier);
}
setIsReady(true);
}, [
activeArea,
isActiveByDefault,
scope,
identifier,
isSmall,
enableComplementaryArea,
disableComplementaryArea
]);
if (!isReady) {
return;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
isPinnable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(pinned_items_default, { scope, children: isPinned && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ComplementaryAreaToggle,
{
scope,
identifier,
isPressed: isActive && (!showIconLabels || isLarge),
"aria-expanded": isActive,
"aria-disabled": isLoading,
label: title,
icon: showIconLabels ? check_default : icon,
showTooltip: !showIconLabels,
variant: showIconLabels ? "tertiary" : void 0,
size: "compact",
shortcut: toggleShortcut
}
) }),
name && isPinnable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ComplementaryAreaMoreMenuItem,
{
target: name,
scope,
icon,
identifier,
children: title
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
ComplementaryAreaFill,
{
activeArea,
isActive,
className: dist_clsx("interface-complementary-area", className),
scope,
id: identifier.replace("/", ":"),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
complementary_area_header_default,
{
className: headerClassName,
closeLabel,
onClose: () => disableComplementaryArea(scope),
toggleButtonProps: {
label: closeLabel,
size: "compact",
shortcut: toggleShortcut,
scope,
identifier
},
children: header || /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "interface-complementary-area-header__title", children: title }),
isPinnable && !isMobileViewport && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
className: "interface-complementary-area__pin-unpin-item",
icon: isPinned ? star_filled_default : star_empty_default,
label: isPinned ? (0,external_wp_i18n_namespaceObject.__)("Unpin from toolbar") : (0,external_wp_i18n_namespaceObject.__)("Pin to toolbar"),
onClick: () => (isPinned ? unpinItem : pinItem)(
scope,
identifier
),
isPressed: isPinned,
"aria-expanded": isPinned,
size: "compact"
}
)
] })
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Panel, { className: panelClassName, children })
]
}
)
] });
}
ComplementaryArea.Slot = ComplementaryAreaSlot;
var complementary_area_default = ComplementaryArea;
;// ./node_modules/@wordpress/admin-ui/build-module/navigable-region/index.js
const NavigableRegion = (0,external_wp_element_namespaceObject.forwardRef)(
({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Tag,
{
ref,
className: dist_clsx("admin-ui-navigable-region", className),
"aria-label": ariaLabel,
role: "region",
tabIndex: "-1",
...props,
children
}
);
}
);
NavigableRegion.displayName = "NavigableRegion";
var navigable_region_default = NavigableRegion;
;// ./node_modules/@wordpress/interface/build-module/components/interface-skeleton/index.js
const interface_skeleton_ANIMATION_DURATION = 0.25;
const commonTransition = {
type: "tween",
duration: interface_skeleton_ANIMATION_DURATION,
ease: [0.6, 0, 0.4, 1]
};
function useHTMLClass(className) {
(0,external_wp_element_namespaceObject.useEffect)(() => {
const element = document && document.querySelector(`html:not(.${className})`);
if (!element) {
return;
}
element.classList.toggle(className);
return () => {
element.classList.toggle(className);
};
}, [className]);
}
const headerVariants = {
hidden: { opacity: 1, marginTop: -60 },
visible: { opacity: 1, marginTop: 0 },
distractionFreeHover: {
opacity: 1,
marginTop: 0,
transition: {
...commonTransition,
delay: 0.2,
delayChildren: 0.2
}
},
distractionFreeHidden: {
opacity: 0,
marginTop: -60
},
distractionFreeDisabled: {
opacity: 0,
marginTop: 0,
transition: {
...commonTransition,
delay: 0.8,
delayChildren: 0.8
}
}
};
function InterfaceSkeleton({
isDistractionFree,
footer,
header,
editorNotices,
sidebar,
secondarySidebar,
content,
actions,
labels,
className
}, ref) {
const [secondarySidebarResizeListener, secondarySidebarSize] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
const defaultTransition = {
type: "tween",
duration: disableMotion ? 0 : interface_skeleton_ANIMATION_DURATION,
ease: [0.6, 0, 0.4, 1]
};
useHTMLClass("interface-interface-skeleton__html-container");
const defaultLabels = {
/* translators: accessibility text for the top bar landmark region. */
header: (0,external_wp_i18n_namespaceObject._x)("Header", "header landmark area"),
/* translators: accessibility text for the content landmark region. */
body: (0,external_wp_i18n_namespaceObject.__)("Content"),
/* translators: accessibility text for the secondary sidebar landmark region. */
secondarySidebar: (0,external_wp_i18n_namespaceObject.__)("Block Library"),
/* translators: accessibility text for the settings landmark region. */
sidebar: (0,external_wp_i18n_namespaceObject._x)("Settings", "settings landmark area"),
/* translators: accessibility text for the publish landmark region. */
actions: (0,external_wp_i18n_namespaceObject.__)("Publish"),
/* translators: accessibility text for the footer landmark region. */
footer: (0,external_wp_i18n_namespaceObject.__)("Footer")
};
const mergedLabels = { ...defaultLabels, ...labels };
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"div",
{
ref,
className: dist_clsx(
className,
"interface-interface-skeleton",
!!footer && "has-footer"
),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "interface-interface-skeleton__editor", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { initial: false, children: !!header && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
navigable_region_default,
{
as: external_wp_components_namespaceObject.__unstableMotion.div,
className: "interface-interface-skeleton__header",
"aria-label": mergedLabels.header,
initial: isDistractionFree && !isMobileViewport ? "distractionFreeHidden" : "hidden",
whileHover: isDistractionFree && !isMobileViewport ? "distractionFreeHover" : "visible",
animate: isDistractionFree && !isMobileViewport ? "distractionFreeDisabled" : "visible",
exit: isDistractionFree && !isMobileViewport ? "distractionFreeHidden" : "hidden",
variants: headerVariants,
transition: defaultTransition,
children: header
}
) }),
isDistractionFree && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "interface-interface-skeleton__header", children: editorNotices }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "interface-interface-skeleton__body", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { initial: false, children: !!secondarySidebar && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
navigable_region_default,
{
className: "interface-interface-skeleton__secondary-sidebar",
ariaLabel: mergedLabels.secondarySidebar,
as: external_wp_components_namespaceObject.__unstableMotion.div,
initial: "closed",
animate: "open",
exit: "closed",
variants: {
open: { width: secondarySidebarSize.width },
closed: { width: 0 }
},
transition: defaultTransition,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__unstableMotion.div,
{
style: {
position: "absolute",
width: isMobileViewport ? "100vw" : "fit-content",
height: "100%",
left: 0
},
variants: {
open: { x: 0 },
closed: { x: "-100%" }
},
transition: defaultTransition,
children: [
secondarySidebarResizeListener,
secondarySidebar
]
}
)
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
navigable_region_default,
{
className: "interface-interface-skeleton__content",
ariaLabel: mergedLabels.body,
children: content
}
),
!!sidebar && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
navigable_region_default,
{
className: "interface-interface-skeleton__sidebar",
ariaLabel: mergedLabels.sidebar,
children: sidebar
}
),
!!actions && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
navigable_region_default,
{
className: "interface-interface-skeleton__actions",
ariaLabel: mergedLabels.actions,
children: actions
}
)
] })
] }),
!!footer && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
navigable_region_default,
{
className: "interface-interface-skeleton__footer",
ariaLabel: mergedLabels.footer,
children: footer
}
)
]
}
);
}
var interface_skeleton_default = (0,external_wp_element_namespaceObject.forwardRef)(InterfaceSkeleton);
;// ./node_modules/@wordpress/interface/build-module/components/index.js
;// ./node_modules/@wordpress/interface/build-module/index.js
;// external ["wp","blockEditor"]
const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
;// ./node_modules/@wordpress/edit-widgets/build-module/store/transformers.js
function transformWidgetToBlock(widget) {
if (widget.id_base === "block") {
const parsedBlocks = (0,external_wp_blocks_namespaceObject.parse)(widget.instance.raw.content, {
__unstableSkipAutop: true
});
if (!parsedBlocks.length) {
return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)(
(0,external_wp_blocks_namespaceObject.createBlock)("core/paragraph", {}, []),
widget.id
);
}
return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)(parsedBlocks[0], widget.id);
}
let attributes;
if (widget._embedded.about[0].is_multi) {
attributes = {
idBase: widget.id_base,
instance: widget.instance
};
} else {
attributes = {
id: widget.id
};
}
return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)(
(0,external_wp_blocks_namespaceObject.createBlock)("core/legacy-widget", attributes, []),
widget.id
);
}
function transformBlockToWidget(block, relatedWidget = {}) {
let widget;
const isValidLegacyWidgetBlock = block.name === "core/legacy-widget" && (block.attributes.id || block.attributes.instance);
if (isValidLegacyWidgetBlock) {
widget = {
...relatedWidget,
id: block.attributes.id ?? relatedWidget.id,
id_base: block.attributes.idBase ?? relatedWidget.id_base,
instance: block.attributes.instance ?? relatedWidget.instance
};
} else {
widget = {
...relatedWidget,
id_base: "block",
instance: {
raw: {
content: (0,external_wp_blocks_namespaceObject.serialize)(block)
}
}
};
}
delete widget.rendered;
delete widget.rendered_form;
return widget;
}
;// ./node_modules/@wordpress/edit-widgets/build-module/store/utils.js
const KIND = "root";
const WIDGET_AREA_ENTITY_TYPE = "sidebar";
const POST_TYPE = "postType";
const buildWidgetAreaPostId = (widgetAreaId) => `widget-area-${widgetAreaId}`;
const buildWidgetAreasPostId = () => `widget-areas`;
function buildWidgetAreasQuery() {
return {
per_page: -1
};
}
function buildWidgetsQuery() {
return {
per_page: -1,
_embed: "about"
};
}
const createStubPost = (id, blocks) => ({
id,
slug: id,
status: "draft",
type: "page",
blocks,
meta: {
widgetAreaId: id
}
});
;// ./node_modules/@wordpress/edit-widgets/build-module/store/constants.js
const constants_STORE_NAME = "core/edit-widgets";
;// ./node_modules/@wordpress/edit-widgets/build-module/store/actions.js
const persistStubPost = (id, blocks) => ({ registry }) => {
const stubPost = createStubPost(id, blocks);
registry.dispatch(external_wp_coreData_namespaceObject.store).receiveEntityRecords(
KIND,
POST_TYPE,
stubPost,
{ id: stubPost.id },
false
);
return stubPost;
};
const saveEditedWidgetAreas = () => async ({ select, dispatch, registry }) => {
const editedWidgetAreas = select.getEditedWidgetAreas();
if (!editedWidgetAreas?.length) {
return;
}
try {
await dispatch.saveWidgetAreas(editedWidgetAreas);
registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)("Widgets saved."), {
type: "snackbar"
});
} catch (e) {
registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(
/* translators: %s: The error message. */
(0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("There was an error. %s"), e.message),
{
type: "snackbar"
}
);
}
};
const saveWidgetAreas = (widgetAreas) => async ({ dispatch, registry }) => {
try {
for (const widgetArea of widgetAreas) {
await dispatch.saveWidgetArea(widgetArea.id);
}
} finally {
await registry.dispatch(external_wp_coreData_namespaceObject.store).finishResolution(
"getEntityRecord",
KIND,
WIDGET_AREA_ENTITY_TYPE,
buildWidgetAreasQuery()
);
}
};
const saveWidgetArea = (widgetAreaId) => async ({ dispatch, select, registry }) => {
const widgets = select.getWidgets();
const post = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(
KIND,
POST_TYPE,
buildWidgetAreaPostId(widgetAreaId)
);
const areaWidgets = Object.values(widgets).filter(
({ sidebar }) => sidebar === widgetAreaId
);
const usedReferenceWidgets = [];
const widgetsBlocks = post.blocks.filter((block) => {
const { id } = block.attributes;
if (block.name === "core/legacy-widget" && id) {
if (usedReferenceWidgets.includes(id)) {
return false;
}
usedReferenceWidgets.push(id);
}
return true;
});
const deletedWidgets = [];
for (const widget of areaWidgets) {
const widgetsNewArea = select.getWidgetAreaForWidgetId(widget.id);
if (!widgetsNewArea) {
deletedWidgets.push(widget);
}
}
const batchMeta = [];
const batchTasks = [];
const sidebarWidgetsIds = [];
for (let i = 0; i < widgetsBlocks.length; i++) {
const block = widgetsBlocks[i];
const widgetId = (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block);
const oldWidget = widgets[widgetId];
const widget = transformBlockToWidget(block, oldWidget);
sidebarWidgetsIds.push(widgetId);
if (oldWidget) {
registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(
"root",
"widget",
widgetId,
{
...widget,
sidebar: widgetAreaId
},
{ undoIgnore: true }
);
const hasEdits = registry.select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord("root", "widget", widgetId);
if (!hasEdits) {
continue;
}
batchTasks.push(
({ saveEditedEntityRecord }) => saveEditedEntityRecord("root", "widget", widgetId)
);
} else {
batchTasks.push(
({ saveEntityRecord }) => saveEntityRecord("root", "widget", {
...widget,
sidebar: widgetAreaId
})
);
}
batchMeta.push({
block,
position: i,
clientId: block.clientId
});
}
for (const widget of deletedWidgets) {
batchTasks.push(
({ deleteEntityRecord }) => deleteEntityRecord("root", "widget", widget.id, {
force: true
})
);
}
const records = await registry.dispatch(external_wp_coreData_namespaceObject.store).__experimentalBatch(batchTasks);
const preservedRecords = records.filter(
(record) => !record.hasOwnProperty("deleted")
);
const failedWidgetNames = [];
for (let i = 0; i < preservedRecords.length; i++) {
const widget = preservedRecords[i];
const { block, position } = batchMeta[i];
post.blocks[position].attributes.__internalWidgetId = widget.id;
const error = registry.select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError("root", "widget", widget.id);
if (error) {
failedWidgetNames.push(block.attributes?.name || block?.name);
}
if (!sidebarWidgetsIds[position]) {
sidebarWidgetsIds[position] = widget.id;
}
}
if (failedWidgetNames.length) {
throw new Error(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: List of widget names */
(0,external_wp_i18n_namespaceObject.__)("Could not save the following widgets: %s."),
failedWidgetNames.join(", ")
)
);
}
registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(
KIND,
WIDGET_AREA_ENTITY_TYPE,
widgetAreaId,
{
widgets: sidebarWidgetsIds
},
{ undoIgnore: true }
);
dispatch(trySaveWidgetArea(widgetAreaId));
registry.dispatch(external_wp_coreData_namespaceObject.store).receiveEntityRecords(KIND, POST_TYPE, post, void 0);
};
const trySaveWidgetArea = (widgetAreaId) => ({ registry }) => {
registry.dispatch(external_wp_coreData_namespaceObject.store).saveEditedEntityRecord(
KIND,
WIDGET_AREA_ENTITY_TYPE,
widgetAreaId,
{
throwOnError: true
}
);
};
function setWidgetIdForClientId(clientId, widgetId) {
return {
type: "SET_WIDGET_ID_FOR_CLIENT_ID",
clientId,
widgetId
};
}
function setWidgetAreasOpenState(widgetAreasOpenState) {
return {
type: "SET_WIDGET_AREAS_OPEN_STATE",
widgetAreasOpenState
};
}
function setIsWidgetAreaOpen(clientId, isOpen) {
return {
type: "SET_IS_WIDGET_AREA_OPEN",
clientId,
isOpen
};
}
function setIsInserterOpened(value) {
return {
type: "SET_IS_INSERTER_OPENED",
value
};
}
function setIsListViewOpened(isOpen) {
return {
type: "SET_IS_LIST_VIEW_OPENED",
isOpen
};
}
const closeGeneralSidebar = () => ({ registry }) => {
registry.dispatch(store).disableComplementaryArea(constants_STORE_NAME);
};
const moveBlockToWidgetArea = (clientId, widgetAreaId) => async ({ dispatch, select, registry }) => {
const sourceRootClientId = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockRootClientId(clientId);
const widgetAreas = registry.select(external_wp_blockEditor_namespaceObject.store).getBlocks();
const destinationWidgetAreaBlock = widgetAreas.find(
({ attributes }) => attributes.id === widgetAreaId
);
const destinationRootClientId = destinationWidgetAreaBlock.clientId;
const destinationInnerBlocksClientIds = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockOrder(destinationRootClientId);
const destinationIndex = destinationInnerBlocksClientIds.length;
const isDestinationWidgetAreaOpen = select.getIsWidgetAreaOpen(
destinationRootClientId
);
if (!isDestinationWidgetAreaOpen) {
dispatch.setIsWidgetAreaOpen(destinationRootClientId, true);
}
registry.dispatch(external_wp_blockEditor_namespaceObject.store).moveBlocksToPosition(
[clientId],
sourceRootClientId,
destinationRootClientId,
destinationIndex
);
};
function unlockWidgetSaving(lockName) {
return {
type: "UNLOCK_WIDGET_SAVING",
lockName
};
}
function lockWidgetSaving(lockName) {
return {
type: "LOCK_WIDGET_SAVING",
lockName
};
}
;// ./node_modules/@wordpress/edit-widgets/build-module/store/resolvers.js
const getWidgetAreas = () => async ({ dispatch, registry }) => {
const query = buildWidgetAreasQuery();
const widgetAreas = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getEntityRecords(KIND, WIDGET_AREA_ENTITY_TYPE, query);
const widgetAreaBlocks = [];
const sortedWidgetAreas = widgetAreas.sort((a, b) => {
if (a.id === "wp_inactive_widgets") {
return 1;
}
if (b.id === "wp_inactive_widgets") {
return -1;
}
return 0;
});
for (const widgetArea of sortedWidgetAreas) {
widgetAreaBlocks.push(
(0,external_wp_blocks_namespaceObject.createBlock)("core/widget-area", {
id: widgetArea.id,
name: widgetArea.name
})
);
if (!widgetArea.widgets.length) {
dispatch(
persistStubPost(
buildWidgetAreaPostId(widgetArea.id),
[]
)
);
}
}
const widgetAreasOpenState = {};
widgetAreaBlocks.forEach((widgetAreaBlock, index) => {
widgetAreasOpenState[widgetAreaBlock.clientId] = index === 0;
});
dispatch(setWidgetAreasOpenState(widgetAreasOpenState));
dispatch(
persistStubPost(buildWidgetAreasPostId(), widgetAreaBlocks)
);
};
const getWidgets = () => async ({ dispatch, registry }) => {
const query = buildWidgetsQuery();
const widgets = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getEntityRecords("root", "widget", query);
const groupedBySidebar = {};
for (const widget of widgets) {
const block = transformWidgetToBlock(widget);
groupedBySidebar[widget.sidebar] = groupedBySidebar[widget.sidebar] || [];
groupedBySidebar[widget.sidebar].push(block);
}
for (const sidebarId in groupedBySidebar) {
if (groupedBySidebar.hasOwnProperty(sidebarId)) {
dispatch(
persistStubPost(
buildWidgetAreaPostId(sidebarId),
groupedBySidebar[sidebarId]
)
);
}
}
};
;// ./node_modules/@wordpress/edit-widgets/build-module/store/selectors.js
const EMPTY_INSERTION_POINT = {
rootClientId: void 0,
insertionIndex: void 0
};
const selectors_getWidgets = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (0,external_wp_data_namespaceObject.createSelector)(
() => {
const widgets = select(external_wp_coreData_namespaceObject.store).getEntityRecords(
"root",
"widget",
buildWidgetsQuery()
);
return (
// Key widgets by their ID.
widgets?.reduce(
(allWidgets, widget) => ({
...allWidgets,
[widget.id]: widget
}),
{}
) ?? {}
);
},
() => [
select(external_wp_coreData_namespaceObject.store).getEntityRecords(
"root",
"widget",
buildWidgetsQuery()
)
]
)
);
const getWidget = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (state, id) => {
const widgets = select(constants_STORE_NAME).getWidgets();
return widgets[id];
}
);
const selectors_getWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)((select) => () => {
const query = buildWidgetAreasQuery();
return select(external_wp_coreData_namespaceObject.store).getEntityRecords(
KIND,
WIDGET_AREA_ENTITY_TYPE,
query
);
});
const getWidgetAreaForWidgetId = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (state, widgetId) => {
const widgetAreas = select(constants_STORE_NAME).getWidgetAreas();
return widgetAreas.find((widgetArea) => {
const post = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(
KIND,
POST_TYPE,
buildWidgetAreaPostId(widgetArea.id)
);
const blockWidgetIds = post.blocks.map(
(block) => (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block)
);
return blockWidgetIds.includes(widgetId);
});
}
);
const getParentWidgetAreaBlock = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (state, clientId) => {
const { getBlock, getBlockName, getBlockParents } = select(external_wp_blockEditor_namespaceObject.store);
const blockParents = getBlockParents(clientId);
const widgetAreaClientId = blockParents.find(
(parentClientId) => getBlockName(parentClientId) === "core/widget-area"
);
return getBlock(widgetAreaClientId);
}
);
const getEditedWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (state, ids) => {
let widgetAreas = select(constants_STORE_NAME).getWidgetAreas();
if (!widgetAreas) {
return [];
}
if (ids) {
widgetAreas = widgetAreas.filter(
({ id }) => ids.includes(id)
);
}
return widgetAreas.filter(
({ id }) => select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord(
KIND,
POST_TYPE,
buildWidgetAreaPostId(id)
)
).map(
({ id }) => select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(
KIND,
WIDGET_AREA_ENTITY_TYPE,
id
)
);
}
);
const getReferenceWidgetBlocks = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (state, referenceWidgetName = null) => {
const results = [];
const widgetAreas = select(constants_STORE_NAME).getWidgetAreas();
for (const _widgetArea of widgetAreas) {
const post = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(
KIND,
POST_TYPE,
buildWidgetAreaPostId(_widgetArea.id)
);
for (const block of post.blocks) {
if (block.name === "core/legacy-widget" && (!referenceWidgetName || block.attributes?.referenceWidgetName === referenceWidgetName)) {
results.push(block);
}
}
}
return results;
}
);
const isSavingWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)((select) => () => {
const widgetAreasIds = select(constants_STORE_NAME).getWidgetAreas()?.map(({ id }) => id);
if (!widgetAreasIds) {
return false;
}
for (const id of widgetAreasIds) {
const isSaving = select(external_wp_coreData_namespaceObject.store).isSavingEntityRecord(
KIND,
WIDGET_AREA_ENTITY_TYPE,
id
);
if (isSaving) {
return true;
}
}
const widgetIds = [
...Object.keys(select(constants_STORE_NAME).getWidgets()),
void 0
// account for new widgets without an ID
];
for (const id of widgetIds) {
const isSaving = select(external_wp_coreData_namespaceObject.store).isSavingEntityRecord(
"root",
"widget",
id
);
if (isSaving) {
return true;
}
}
return false;
});
const getIsWidgetAreaOpen = (state, clientId) => {
const { widgetAreasOpenState } = state;
return !!widgetAreasOpenState[clientId];
};
function isInserterOpened(state) {
return !!state.blockInserterPanel;
}
function __experimentalGetInsertionPoint(state) {
if (typeof state.blockInserterPanel === "boolean") {
return EMPTY_INSERTION_POINT;
}
return state.blockInserterPanel;
}
const canInsertBlockInWidgetArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(
(select) => (state, blockName) => {
const widgetAreas = select(external_wp_blockEditor_namespaceObject.store).getBlocks();
const [firstWidgetArea] = widgetAreas;
return select(external_wp_blockEditor_namespaceObject.store).canInsertBlockType(
blockName,
firstWidgetArea.clientId
);
}
);
function isListViewOpened(state) {
return state.listViewPanel;
}
function isWidgetSavingLocked(state) {
return Object.keys(state.widgetSavingLock).length > 0;
}
;// ./node_modules/@wordpress/edit-widgets/build-module/store/private-selectors.js
function getListViewToggleRef(state) {
return state.listViewToggleRef;
}
function getInserterSidebarToggleRef(state) {
return state.inserterSidebarToggleRef;
}
;// external ["wp","privateApis"]
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// ./node_modules/@wordpress/edit-widgets/build-module/lock-unlock.js
const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
"@wordpress/edit-widgets"
);
;// ./node_modules/@wordpress/edit-widgets/build-module/store/index.js
const storeConfig = {
reducer: reducer_default,
selectors: store_selectors_namespaceObject,
resolvers: resolvers_namespaceObject,
actions: store_actions_namespaceObject
};
const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, storeConfig);
(0,external_wp_data_namespaceObject.register)(store_store);
external_wp_apiFetch_default().use(function(options, next) {
if (options.path?.indexOf("/wp/v2/types/widget-area") === 0) {
return Promise.resolve({});
}
return next(options);
});
unlock(store_store).registerPrivateSelectors(private_selectors_namespaceObject);
;// external ["wp","hooks"]
const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
;// ./node_modules/@wordpress/edit-widgets/build-module/filters/move-to-widget-area.js
const withMoveToWidgetAreaToolbarItem = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
(BlockEdit) => (props) => {
const { clientId, name: blockName } = props;
const { widgetAreas, currentWidgetAreaId, canInsertBlockInWidgetArea } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
if (blockName === "core/widget-area") {
return {};
}
const selectors = select(store_store);
const widgetAreaBlock = selectors.getParentWidgetAreaBlock(clientId);
return {
widgetAreas: selectors.getWidgetAreas(),
currentWidgetAreaId: widgetAreaBlock?.attributes?.id,
canInsertBlockInWidgetArea: selectors.canInsertBlockInWidgetArea(blockName)
};
},
[clientId, blockName]
);
const { moveBlockToWidgetArea } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const hasMultipleWidgetAreas = widgetAreas?.length > 1;
const isMoveToWidgetAreaVisible = blockName !== "core/widget-area" && hasMultipleWidgetAreas && canInsertBlockInWidgetArea;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { ...props }, "edit"),
isMoveToWidgetAreaVisible && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_widgets_namespaceObject.MoveToWidgetArea,
{
widgetAreas,
currentWidgetAreaId,
onSelect: (widgetAreaId) => {
moveBlockToWidgetArea(
props.clientId,
widgetAreaId
);
}
}
) })
] });
},
"withMoveToWidgetAreaToolbarItem"
);
(0,external_wp_hooks_namespaceObject.addFilter)(
"editor.BlockEdit",
"core/edit-widgets/block-edit",
withMoveToWidgetAreaToolbarItem
);
;// external ["wp","mediaUtils"]
const external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"];
;// ./node_modules/@wordpress/edit-widgets/build-module/filters/replace-media-upload.js
const replaceMediaUpload = () => external_wp_mediaUtils_namespaceObject.MediaUpload;
(0,external_wp_hooks_namespaceObject.addFilter)(
"editor.MediaUpload",
"core/edit-widgets/replace-media-upload",
replaceMediaUpload
);
;// ./node_modules/@wordpress/edit-widgets/build-module/filters/index.js
;// ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/block.json
const block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/widget-area","title":"Widget Area","category":"widgets","attributes":{"id":{"type":"string"},"name":{"type":"string"}},"supports":{"html":false,"inserter":false,"customClassName":false,"reusable":false,"__experimentalToolbar":false,"__experimentalParentSelector":false,"__experimentalDisableBlockOverlay":true},"editorStyle":"wp-block-widget-area-editor","style":"wp-block-widget-area"}');
;// ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/use-is-dragging-within.js
const useIsDraggingWithin = (elementRef) => {
const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const { ownerDocument } = elementRef.current;
function handleDragStart(event) {
handleDragEnter(event);
}
function handleDragEnd() {
setIsDraggingWithin(false);
}
function handleDragEnter(event) {
if (elementRef.current.contains(event.target)) {
setIsDraggingWithin(true);
} else {
setIsDraggingWithin(false);
}
}
ownerDocument.addEventListener("dragstart", handleDragStart);
ownerDocument.addEventListener("dragend", handleDragEnd);
ownerDocument.addEventListener("dragenter", handleDragEnter);
return () => {
ownerDocument.removeEventListener("dragstart", handleDragStart);
ownerDocument.removeEventListener("dragend", handleDragEnd);
ownerDocument.removeEventListener("dragenter", handleDragEnter);
};
}, []);
return isDraggingWithin;
};
var use_is_dragging_within_default = useIsDraggingWithin;
;// ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/inner-blocks.js
function WidgetAreaInnerBlocks({ id }) {
const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)(
"root",
"postType"
);
const innerBlocksRef = (0,external_wp_element_namespaceObject.useRef)();
const isDraggingWithinInnerBlocks = use_is_dragging_within_default(innerBlocksRef);
const shouldHighlightDropZone = isDraggingWithinInnerBlocks;
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(
{ ref: innerBlocksRef },
{
value: blocks,
onInput,
onChange,
templateLock: false,
renderAppender: external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender
}
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
"data-widget-area-id": id,
className: dist_clsx(
"wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper",
{
"wp-block-widget-area__highlight-drop-zone": shouldHighlightDropZone
}
),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps })
}
);
}
;// ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/index.js
function WidgetAreaEdit({
clientId,
attributes: { id, name }
}) {
const isOpen = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(store_store).getIsWidgetAreaOpen(clientId),
[clientId]
);
const { setIsWidgetAreaOpen } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const wrapper = (0,external_wp_element_namespaceObject.useRef)();
const setOpen = (0,external_wp_element_namespaceObject.useCallback)(
(openState) => setIsWidgetAreaOpen(clientId, openState),
[clientId]
);
const isDragging = useIsDragging(wrapper);
const isDraggingWithin = use_is_dragging_within_default(wrapper);
const [openedWhileDragging, setOpenedWhileDragging] = (0,external_wp_element_namespaceObject.useState)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isDragging) {
setOpenedWhileDragging(false);
return;
}
if (isDraggingWithin && !isOpen) {
setOpen(true);
setOpenedWhileDragging(true);
} else if (!isDraggingWithin && isOpen && openedWhileDragging) {
setOpen(false);
}
}, [isOpen, isDragging, isDraggingWithin, openedWhileDragging]);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Panel, { ref: wrapper, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.PanelBody,
{
title: name,
opened: isOpen,
onToggle: () => {
setIsWidgetAreaOpen(clientId, !isOpen);
},
scrollAfterOpen: !isDragging,
children: ({ opened }) => (
// This is required to ensure LegacyWidget blocks are not
// unmounted when the panel is collapsed. Unmounting legacy
// widgets may have unintended consequences (e.g. TinyMCE
// not being properly reinitialized)
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__unstableDisclosureContent,
{
className: "wp-block-widget-area__panel-body-content",
visible: opened,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_coreData_namespaceObject.EntityProvider,
{
kind: "root",
type: "postType",
id: `widget-area-${id}`,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WidgetAreaInnerBlocks, { id })
}
)
}
)
)
}
) }) });
}
const useIsDragging = (elementRef) => {
const [isDragging, setIsDragging] = (0,external_wp_element_namespaceObject.useState)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const { ownerDocument } = elementRef.current;
function handleDragStart() {
setIsDragging(true);
}
function handleDragEnd() {
setIsDragging(false);
}
ownerDocument.addEventListener("dragstart"